-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #13 from advanced-security/jsinglet/bundle-feature
Adding Bundle Feature
- Loading branch information
Showing
74 changed files
with
4,668 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
108 changes: 108 additions & 0 deletions
108
.github/workflows/internal-pr-bundle-integration-test-cpp.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,108 @@ | ||
name: ⚙️ Integration Test Bundle on PR (CPP) | ||
|
||
on: | ||
push: | ||
branches: | ||
- 'main' | ||
pull_request: | ||
branches: | ||
- 'main' | ||
workflow_dispatch: | ||
|
||
jobs: | ||
analyze: | ||
name: Analyze | ||
runs-on: ubuntu-latest | ||
permissions: | ||
actions: read | ||
contents: read | ||
security-events: write | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
language: [ 'cpp' ] | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install QLT | ||
id: install-qlt | ||
uses: ./.github/actions/install-qlt-local | ||
with: | ||
qlt-version: 'latest' | ||
add-to-path: true | ||
|
||
- name: Validate QLT Installation | ||
shell: bash | ||
run: | | ||
echo -e "Checking QLT Version:" | ||
echo "QLT Home: ${{ steps.install-qlt.outputs.qlt-home }}" | ||
qlt version | ||
- name: Create Bundle (compiled) | ||
shell: bash | ||
run: | | ||
if ! qlt codeql run install --base example/ --custom-bundle ; then | ||
echo "Failed to generate bundle." | ||
exit 1 | ||
fi | ||
# ensure bundle runs | ||
if ! qlt query run install-packs --use-bundle --base example/ ; then | ||
echo "Failed to install query packs with tool." | ||
exit 1 | ||
fi | ||
- name: Validate Bundle Existence | ||
shell: bash | ||
run: | | ||
echo "Checking Bundle Existence" | ||
ls -l ${{ env.QLT_CODEQL_HOME }}/../out/ | ||
- name: Initialize CodeQL | ||
uses: github/codeql-action/init@v2 | ||
with: | ||
languages: ${{ matrix.language }} | ||
queries: security-extended | ||
source-root: integration-tests/cpp/src/ # Path containing the example application | ||
tools: ${{ env.QLT_CODEQL_BUNDLE_PATH }} | ||
|
||
- name: Autobuild | ||
uses: github/codeql-action/autobuild@v2 | ||
with: | ||
working-directory: integration-tests/cpp/src/ # Path containing the example application | ||
|
||
- name: Perform CodeQL Analysis | ||
id: analysis | ||
uses: github/codeql-action/analyze@v2 | ||
|
||
- name: Validate SARIF Location | ||
shell: bash | ||
run: | | ||
# validate we have the actual sarif results | ||
echo "Checking SARIF file location at: ${{ steps.analysis.outputs.sarif-output }}" | ||
ls -l ${{ steps.analysis.outputs.sarif-output }} | ||
- name: Upload SARIF Results | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: actual.sarif | ||
path: | | ||
${{ steps.analysis.outputs.sarif-output }}/*.sarif | ||
if-no-files-found: error | ||
|
||
- name: Upload Bundle Used | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: codeql-bundle.tar.gz | ||
path: | | ||
${{ env.QLT_CODEQL_BUNDLE_PATH }} | ||
if-no-files-found: error | ||
|
||
- name: Validate SARIF Results | ||
shell: bash | ||
run: | | ||
# Compare the expected vs the actual | ||
qlt bundle run validate-integration-tests --expected integration-tests/cpp/expected.sarif --actual ${{ steps.analysis.outputs.sarif-output }}/cpp.sarif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
name: ⚙️ Test Bundle Creation | ||
|
||
on: | ||
push: | ||
branches: | ||
- 'main' | ||
pull_request: | ||
branches: | ||
- 'main' | ||
workflow_dispatch: | ||
|
||
jobs: | ||
test-bundle-creation: | ||
name: Test Bundle Creation | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Install QLT | ||
id: install-qlt | ||
uses: ./.github/actions/install-qlt-local | ||
with: | ||
qlt-version: 'latest' | ||
add-to-path: true | ||
|
||
- name: Validate QLT Installation | ||
shell: bash | ||
run: | | ||
echo -e "Checking QLT Version:" | ||
echo "QLT Home: ${{ steps.install-qlt.outputs.qlt-home }}" | ||
qlt version | ||
- name: Create Bundle (compiled) | ||
shell: bash | ||
run: | | ||
if ! qlt codeql run install --base example/ --custom-bundle ; then | ||
echo "Failed to generate bundle." | ||
exit 1 | ||
fi | ||
# ensure bundle runs | ||
if ! qlt query run install-packs --use-bundle --base example/ ; then | ||
echo "Failed to install query packs with tool." | ||
exit 1 | ||
fi | ||
49 changes: 49 additions & 0 deletions
49
.github/workflows/internal-pr-test-quick-bundle-creation.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
name: ⚙️ Test Bundle Creation (Quick) | ||
|
||
on: | ||
push: | ||
branches: | ||
- 'main' | ||
pull_request: | ||
branches: | ||
- 'main' | ||
workflow_dispatch: | ||
|
||
jobs: | ||
test-bundle-creation: | ||
name: Test Bundle Creation | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Install QLT | ||
id: install-qlt | ||
uses: ./.github/actions/install-qlt-local | ||
with: | ||
qlt-version: 'latest' | ||
add-to-path: true | ||
|
||
- name: Validate QLT Installation | ||
shell: bash | ||
run: | | ||
echo -e "Checking QLT Version:" | ||
echo "QLT Home: ${{ steps.install-qlt.outputs.qlt-home }}" | ||
qlt version | ||
- name: Create Bundle (quick) | ||
shell: bash | ||
run: | | ||
if ! qlt codeql run install --base example/ --quick-bundle ; then | ||
echo "Failed to generate bundle." | ||
exit 1 | ||
fi | ||
# ensure bundle runs | ||
if ! qlt query run install-packs --use-bundle --base example/ ; then | ||
echo "Failed to install query packs with tool." | ||
exit 1 | ||
fi | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -360,4 +360,5 @@ MigrationBackup/ | |
.ionide/ | ||
|
||
# Fody - auto-generated XML schema | ||
FodyWeavers.xsd | ||
FodyWeavers.xsd | ||
/dist/ |
Oops, something went wrong.