Skip to content

Commit af2756e

Browse files
chanel-yCopilot
andcommitted
Fix local IaC test setup
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 02af720 commit af2756e

6 files changed

Lines changed: 23 additions & 32 deletions

File tree

iac/.codeqlmanifest.json

Lines changed: 0 additions & 12 deletions
This file was deleted.

iac/docs/workflows.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,10 @@ The CodeQL CLI can be used to analyze IaC files using the CodeQL Extractor, Libr
7070
3. Check the extractor is installed correctly by running:
7171
- `codeql resolve languages` and checking if `iac` is listed
7272
4. Install the IaC queries pack by running:
73-
- `codeql pack install advanced-security/iac-queries`
73+
- `codeql pack install microsoft/iac-queries`
7474
5. Run the CodeQL database commands to create and analyze the IaC files
7575
- `codeql database create <database-name> --language=iac --source-root=<path-to-iac-files>`
76-
- `codeql database analyze <database-name> --format=sarif-latest --output=<output-file-name> advanced-security/iac-queries`
76+
- `codeql database analyze <database-name> --format=sarif-latest --output=<output-file-name> microsoft/iac-queries`
7777

7878
### CLI Example
7979

@@ -108,5 +108,5 @@ codeql database analyze \
108108
--format="sarif-latest" \
109109
--output="./codeql-iac.sarif" \
110110
"$CODEQL_DATABASE" \
111-
"advanced-security/iac-queries"
111+
"microsoft/iac-queries"
112112
```

iac/ql/lib/codeql-pack.lock.yml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
11
---
22
lockVersion: 1.0.0
3-
dependencies:
4-
codeql/util:
5-
version: 1.0.12
6-
codeql/yaml:
7-
version: 1.0.25
3+
dependencies: {}
84
compiled: false

iac/ql/src/codeql-pack.lock.yml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
11
---
22
lockVersion: 1.0.0
3-
dependencies:
4-
codeql/util:
5-
version: 1.0.12
6-
codeql/yaml:
7-
version: 1.0.25
3+
dependencies: {}
84
compiled: false

iac/ql/test/qlpack.yml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
1-
name: advanced-security/iac-tests
1+
name: microsoft/iac-tests
22
groups: [iac, test]
33
dependencies:
4-
dependencies:
5-
advanced-security/iac-all: ${workspace}
6-
advanced-security/iac-queries: ${workspace}
7-
extractor: iac
4+
microsoft/iac-all: ${workspace}
5+
microsoft/iac-queries: ${workspace}
86
extractor: iac
97
tests: .
108
warnOnImplicitThis: true

iac/tools/qltest.cmd

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,24 @@
11
@echo off
22

3-
type NUL && "%CODEQL_DIST%\codeql.exe" database index-files ^
3+
"%CODEQL_DIST%\codeql.exe" database index-files ^
44
--prune=**/*.testproj ^
55
--include-extension=.hcl ^
66
--include-extension=.tf ^
7+
--include-extension=.tfvars ^
8+
--include-extension=.bicep ^
79
--size-limit=5m ^
8-
--language=hcl ^
10+
--language=iac ^
11+
--working-dir=. ^
12+
"%CODEQL_EXTRACTOR_IAC_WIP_DATABASE%"
13+
if %ERRORLEVEL% neq 0 exit /b %ERRORLEVEL%
14+
15+
"%CODEQL_DIST%\codeql.exe" database index-files ^
16+
--prune=**/*.testproj ^
17+
--include-extension=.yml ^
18+
--include-extension=.yaml ^
19+
--include-extension=.json ^
20+
--size-limit=5m ^
21+
--language=yaml ^
922
--working-dir=. ^
1023
"%CODEQL_EXTRACTOR_IAC_WIP_DATABASE%"
1124

0 commit comments

Comments
 (0)