From 5e92fd9a069025d47d27695cec83d04195c0d679 Mon Sep 17 00:00:00 2001 From: Randall Wyatt Date: Thu, 11 Sep 2025 14:40:41 -0400 Subject: [PATCH 1/5] Adding initial CodeQL workflow --- .github/workflows/codeql.yml | 67 ++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 .github/workflows/codeql.yml diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml new file mode 100644 index 000000000..523fe92d9 --- /dev/null +++ b/.github/workflows/codeql.yml @@ -0,0 +1,67 @@ +name: "CodeQL Scan" + +on: + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] + +jobs: + analyze: + name: Analyze Java + runs-on: [codeql] + permissions: + # required for all workflows + security-events: write + + # required to fetch internal or private CodeQL packs + packages: read + + # only required for workflows in private repositories + actions: read + contents: read + + strategy: + fail-fast: false + matrix: + include: + - language: actions + build-mode: none + - language: java-kotlin + build-mode: autobuild + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Initialize CodeQL + uses: github/codeql-action/init@v3 + with: + languages: ${{ matrix.language }} + build-mode: ${{ matrix.build-mode }} + # 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 + + # If the analyze step fails for one of the languages you are analyzing with + # "We were unable to automatically build your code", modify the matrix above + # to set the build mode to "manual" for that language. Then modify this step + # to build your code. + # â„šī¸ Command-line programs to run using the OS shell. + # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun + - if: matrix.build-mode == 'manual' + shell: bash + run: | + echo 'If you are using a "manual" build mode for one or more of the' \ + 'languages you are analyzing, replace this with the commands to build' \ + 'your code, for example:' + echo ' make bootstrap' + echo ' make release' + exit 1 + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v3 + with: + category: "/language:${{matrix.language}}" From c5dad5534eca21adb3cc5785aab881497a6726e8 Mon Sep 17 00:00:00 2001 From: Randall Wyatt Date: Thu, 11 Sep 2025 14:45:15 -0400 Subject: [PATCH 2/5] Adding initial CodeQL workflow --- .github/workflows/codeql.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 523fe92d9..41ef5157e 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -14,7 +14,7 @@ jobs: # required for all workflows security-events: write - # required to fetch internal or private CodeQL packs + # required to fetch internal or private CodeQL packsCodeQ packages: read # only required for workflows in private repositories From 1971bc180c622011ab9fb48e357f3c5bd3679319 Mon Sep 17 00:00:00 2001 From: Randall Wyatt Date: Thu, 11 Sep 2025 14:58:37 -0400 Subject: [PATCH 3/5] updating runs on to allow the workflow to progress --- .github/workflows/codeql.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 41ef5157e..6747bd81f 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -9,7 +9,7 @@ on: jobs: analyze: name: Analyze Java - runs-on: [codeql] + runs-on: ubuntu-latest permissions: # required for all workflows security-events: write From 5b01996b2cdf975b25a3dcddb75d761a310ddecd Mon Sep 17 00:00:00 2001 From: Randall Wyatt Date: Fri, 12 Sep 2025 11:38:42 -0400 Subject: [PATCH 4/5] uncommenting the queries --- .github/workflows/codeql.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 6747bd81f..78fbd8d9b 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -43,7 +43,7 @@ jobs: # 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 + queries: security-extended,security-and-quality # If the analyze step fails for one of the languages you are analyzing with # "We were unable to automatically build your code", modify the matrix above From d1a00d1d1e7b212e70883be7218af575a4cbc311 Mon Sep 17 00:00:00 2001 From: Randall Wyatt Date: Fri, 12 Sep 2025 13:18:37 -0400 Subject: [PATCH 5/5] updating the queries selection --- .github/workflows/codeql.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 78fbd8d9b..7ac6c2e1b 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -25,8 +25,6 @@ jobs: fail-fast: false matrix: include: - - language: actions - build-mode: none - language: java-kotlin build-mode: autobuild steps: @@ -43,7 +41,7 @@ jobs: # 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 + queries: ${{ matrix.language == 'java-kotlin' && 'security-extended, security-and-quality' }} # If the analyze step fails for one of the languages you are analyzing with # "We were unable to automatically build your code", modify the matrix above