forked from WebGoat/WebGoat
-
Notifications
You must be signed in to change notification settings - Fork 0
Update codeql_conditional_scan.yml #10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from 31 commits
Commits
Show all changes
36 commits
Select commit
Hold shift + click to select a range
7cf54f9
Update codeql_conditional_scan.yml
MissionOpen 1ee1130
Update codeql_conditional_scan.yml
MissionOpen 9d1069b
prova trigger rilevamento vulnerabilità codeql
dadecarolis-afk 00932db
updated action to include custom queries for analysis
dadecarolis-afk b1636a2
codeql analyze@v2 deprecated & custom-queries moved
MissionOpen ae516c1
delete unnecessary action and gitignore update
MissionOpen e88286e
Update codeql_conditional_scan.yml
MissionOpen 1ac8dd3
@kind metadata added
MissionOpen ff92d87
delete workflow with errors
MissionOpen 40d8537
GDPR Data Processing Detection Metadata added
MissionOpen eb0486b
Create codeql.yml
MissionOpen ec44769
Update codeql.yml
MissionOpen 5999b7b
Update codeql.yml
MissionOpen 7f7aead
java file modified
MissionOpen cc98c57
Update codeql.yml
MissionOpen 0be4b6b
custom-queries tags changed
MissionOpen e1fc0fb
Update codeql.yml
MissionOpen 0b964bf
Update codeql.yml
MissionOpen c3fc2cf
Update codeql.yml
MissionOpen da38d2d
Update codeql.yml
MissionOpen 49d82be
Update codeql.yml
MissionOpen e5acba1
codeql config file for custom-queries
MissionOpen 942a1a5
add links to codeql-config
MissionOpen 0bb081b
Create codeql-no-diff.yml
MissionOpen c189911
Update codeql-no-diff.yml
MissionOpen 38dcc08
Update codeql-no-diff.yml
MissionOpen 0d6c3eb
Update codeql-no-diff.yml
MissionOpen c859d73
Update codeql-no-diff.yml
MissionOpen 0414b34
introduced 2 empty catch block exceptions
dadecarolis-afk 79dafa8
Update codeql-no-diff.yml
MissionOpen 608efcc
Add new vulnerability for test & fix custom-queries
MissionOpen 93bd9b8
New queries for Autofix Test
MissionOpen da06267
Autofix for empty catch block
dadecarolis-afk 7f56a19
delete new query
MissionOpen a293786
Restored empt-catch-block query
MissionOpen 90f9e6e
Update codeql-no-diff.yml
MissionOpen File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
5 changes: 4 additions & 1 deletion
5
.codeql/custom-queries/02-compliance/gdpr-data-processing-detection.ql
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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,18 @@ | ||
| name: "Custom CodeQL Configuration" | ||
|
|
||
| queries: | ||
| - uses: ./.codeql/custom-queries | ||
|
|
||
| disable-default-queries: true | ||
|
|
||
| # È necessario aggiungere almeno un'istruzione query, queries, o qlpack alla definizione della suite, altrimenti non verrà selezionata alcuna query. | ||
| # https://docs.github.com/en/code-security/codeql-cli/using-the-advanced-functionality-of-the-codeql-cli/creating-codeql-query-suites | ||
|
|
||
| # - query: path/to/query.ql | ||
| # - queries: path/to/queries/ | ||
| # - exclude: path/to/excluded-query.ql | ||
| # - include: another-suite.qls | ||
| # - tags: security | ||
|
|
||
| # Attraverso i tags nei metadati delle query CodeQL puoi selezionare (includere o escludere) facilmente gruppi di query in una query suite. | ||
| # https://codeql.github.com/docs/writing-codeql-queries/metadata-for-codeql-queries/ |
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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,65 @@ | ||
| #1) HEADER & TRIGGER | ||
| name: "Codeql on PR / Total Scan" | ||
|
|
||
| on: | ||
| push: | ||
| branches: [ "main", "git_actions" ] | ||
| pull_request: | ||
| branches: [ "main", "git_actions" ] #Se voglio triggerare su tutti i rami = branches: [ "*" ] | ||
|
|
||
| #2) CONFIGURAZIONE JOBS | ||
| jobs: | ||
| analyze: | ||
| name: Analyze Java - Total no Diff | ||
| runs-on: ubuntu-latest | ||
|
|
||
| #3) PERMESSI - DEFINISCE COSA PUO' FARE IL WORKFLOW NEL REPOSITORY | ||
| permissions: | ||
| security-events: write # Per scrivere risultati di sicurezza | ||
| packages: read # Per scaricare query pack CodeQL | ||
| actions: read # Per leggere altri workflow | ||
| contents: read # Per leggere il codice del repo | ||
|
|
||
| #4) CHECKOUT | ||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
|
|
||
| #5) SETUP JAVA | ||
| - name: Setup Java | ||
| uses: actions/setup-java@v4 | ||
| with: | ||
| distribution: 'temurin' | ||
| java-version: '21' | ||
|
|
||
| #6) INITIALIZE CODEQL | ||
| - name: Initialize CodeQL | ||
| uses: github/codeql-action/init@v3 | ||
| with: | ||
| languages: java-kotlin | ||
| build-mode: none | ||
| config-file: ./.github/codeql/codeql-config.yml | ||
|
|
||
| #7) ANALISI CODEQL | ||
| - name: Perform CodeQL Analysis | ||
| uses: github/codeql-action/analyze@v3 | ||
|
|
||
| #8) DEBUG | ||
| - name: Debug SARIF Path | ||
| run: find /home/runner/work/WebGoat/ -name "*.sarif" | ||
|
|
||
| #9) UPLOAD SARIF E CREAZIONE ARTIFACT | ||
| - name: Upload SARIF | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: sarif-report | ||
| path: /home/runner/work/WebGoat/results/java.sarif | ||
|
|
||
| #10) SUMMARY | ||
| - name: Analysis Summary | ||
| run: | | ||
| echo "WebGoat CodeQL analysis completed" | ||
| echo "Files analyzed: ${{ steps.changed-files.outputs.all_changed_files }}" | ||
| echo "Language: java-kotlin" | ||
|
|
||
|
|
This file contains hidden or 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,111 @@ | ||
|
|
||
| # You may wish to alter this file to override the set of languages analyzed, | ||
| # or to provide custom queries or build logic. | ||
| # | ||
| # ******** NOTE ******** | ||
| # We have attempted to detect the languages in your repository. Please check | ||
| # the `language` matrix defined below to confirm you have the correct set of | ||
| # supported CodeQL languages. | ||
|
|
||
| #1) HEADER & TRIGGER | ||
| name: "Codeql on PR / Conditional Scan NEW" | ||
|
|
||
| on: | ||
| pull_request: | ||
| branches: [ "main" ] #Se voglio triggerare su tutti i rami = branches: [ "*" ] | ||
|
|
||
| #2) CONFIGURAZIONE JOBS | ||
| jobs: | ||
| analyze: | ||
| name: Analyze Java - Conditional | ||
| runs-on: ubuntu-latest | ||
|
|
||
| #3) PERMESSI - DEFINISCE COSA PUO' FARE IL WORKFLOW NEL REPOSITORY | ||
| permissions: | ||
| security-events: write # Per scrivere risultati di sicurezza | ||
| packages: read # Per scaricare query pack CodeQL | ||
| actions: read # Per leggere altri workflow | ||
| contents: read # Per leggere il codice del repo | ||
|
|
||
| #4) CHECKOUT | ||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 # Necessario per rilevare i file modificati | ||
|
|
||
| #5) RILEVAMENTO FILE MODIFICATI | ||
| - name: Get changed files | ||
| id: changed-files | ||
| uses: tj-actions/changed-files@v44 # https://github.com/tj-actions/changed-files | ||
| with: | ||
| files: | | ||
| **/*.java | ||
| **/*.xml | ||
| **/*.properties | ||
|
|
||
| #6) SETUP JAVA - CONDIZIONALE | ||
| - name: Setup Java | ||
| if: steps.changed-files.outputs.any_changed == 'true' | ||
| uses: actions/setup-java@v4 | ||
| with: | ||
| distribution: 'temurin' | ||
| java-version: '21' | ||
|
|
||
| #7) INITIALIZE CODEQL - CONDIZIONALE | ||
| - name: Initialize CodeQL | ||
| if: steps.changed-files.outputs.any_changed == 'true' | ||
| uses: github/codeql-action/init@v3 | ||
| with: | ||
| languages: java-kotlin | ||
| build-mode: none | ||
| config-file: ./.github/codeql/codeql-config.yml | ||
| # https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning#extending-codeql-coverage-with-codeql-model-packs | ||
|
|
||
| # If you wish to specify custom queries, you can do so here or in a config file. | ||
| # By default, queries listed here will override any specified in a config file. | ||
| # Prefix the list here with "+" to use these queries and those in the config file. | ||
|
|
||
| # For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs | ||
| # queries: security-extended,security-and-quality | ||
|
|
||
| #8) BUILD MANUALE - CONDIZIONALE | ||
| # - name: Build WebGoat - Full Project | ||
| # if: steps.changed-files.outputs.any_changed == 'true' | ||
| # run: | | ||
| # echo "Building complete WebGoat project..." | ||
| # mvn clean compile -DskipTests -q | ||
| # echo "Build completed successfully" | ||
|
|
||
| #9) ANALISI CODEQL - CONDIZIONALE | ||
| - name: Perform CodeQL Analysis | ||
| if: steps.changed-files.outputs.any_changed == 'true' | ||
| uses: github/codeql-action/analyze@v3 | ||
|
|
||
| #10) DEBUG | ||
| - name: Debug SARIF Path | ||
| if: steps.changed-files.outputs.any_changed == 'true' | ||
| run: find /home/runner/work/WebGoat/ -name "*.sarif" | ||
|
|
||
| #11) UPLOAD SARIF E CREAZIONE ARTIFACT | ||
| - name: Upload SARIF | ||
| if: steps.changed-files.outputs.any_changed == 'true' | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: sarif-report | ||
| path: /home/runner/work/WebGoat/results/java.sarif | ||
|
|
||
| #12) SUMMARY | ||
| - name: Analysis Summary | ||
| if: steps.changed-files.outputs.any_changed == 'true' | ||
| run: | | ||
| echo "WebGoat CodeQL analysis completed" | ||
| echo "Files analyzed: ${{ steps.changed-files.outputs.all_changed_files }}" | ||
| echo "Language: java-kotlin" | ||
|
|
||
| - name: No Changes Summary | ||
| if: steps.changed-files.outputs.any_changed == 'false' | ||
| run: | | ||
| echo "No Java/XML/Properties files changed" | ||
| echo "⏭CodeQL analysis skipped for performance" | ||
|
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The query ID 'java/find-sql-queries' doesn't match the query's purpose of GDPR data processing detection. This should be something like 'java/gdpr-data-processing-detection' to match the filename and description.