From e663cf7385a29e936972cb91be7129cffe75d206 Mon Sep 17 00:00:00 2001 From: Mike Baker <1426795+mbaker3@users.noreply.github.com> Date: Tue, 16 Aug 2022 13:34:07 -0400 Subject: [PATCH 1/5] Create codeql-analysis file --- .github/workflows/codeql-analysis.yml | 72 +++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 .github/workflows/codeql-analysis.yml diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml new file mode 100644 index 0000000..357b0a7 --- /dev/null +++ b/.github/workflows/codeql-analysis.yml @@ -0,0 +1,72 @@ +# For most projects, this workflow file will not need changing; you simply need +# to commit it to your repository. +# +# 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. +# +name: "CodeQL" + +on: + push: + branches: [ "main" ] + pull_request: + # The branches below must be a subset of the branches above + branches: [ "main" ] + schedule: + - cron: '37 9 * * 6' + +jobs: + analyze: + name: Analyze + runs-on: ubuntu-latest + permissions: + actions: read + contents: read + security-events: write + + strategy: + fail-fast: false + matrix: + language: [ 'csharp' ] + # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ] + # Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + # Initializes the CodeQL tools for scanning. + - name: Initialize CodeQL + uses: github/codeql-action/init@v2 + with: + languages: ${{ matrix.language }} + # 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. + + # 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 + + + # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). + # If this step fails, then you should remove it and run the build manually (see below) + - name: Autobuild + uses: github/codeql-action/autobuild@v2 + + # ℹī¸ 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 the Autobuild fails above, remove it and uncomment the following three lines. + # modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance. + + # - run: | + # echo "Run, Build Application using script" + # ./location_of_script_within_repo/buildscript.sh + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v2 From ffce71acc814f49937bd5de39c2434bc04e044c7 Mon Sep 17 00:00:00 2001 From: Mike Baker <1426795+mbaker3@users.noreply.github.com> Date: Tue, 16 Aug 2022 14:23:43 -0400 Subject: [PATCH 2/5] build core --- .github/workflows/codeql-analysis.yml | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 357b0a7..2f46889 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -55,8 +55,8 @@ jobs: # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). # If this step fails, then you should remove it and run the build manually (see below) - - name: Autobuild - uses: github/codeql-action/autobuild@v2 +# - name: Autobuild + #uses: github/codeql-action/autobuild@v2 # ℹī¸ 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 @@ -64,9 +64,16 @@ jobs: # If the Autobuild fails above, remove it and uncomment the following three lines. # modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance. - # - run: | - # echo "Run, Build Application using script" - # ./location_of_script_within_repo/buildscript.sh + - name: Build Logging + - working-directory: ./Logging/.CSProject + - run: | + echo "Building logging project" + dotnet build anvil-csharp-logging.sln + + - name: Build Core + - run: | + echo "Building core project" + dotnet build anvil-csharp-core.csproj - name: Perform CodeQL Analysis uses: github/codeql-action/analyze@v2 From 03f9e11e8dad77f1073206372a1184dbd0ed5803 Mon Sep 17 00:00:00 2001 From: Mike Baker <1426795+mbaker3@users.noreply.github.com> Date: Tue, 16 Aug 2022 14:24:40 -0400 Subject: [PATCH 3/5] Update codeql-analysis.yml --- .github/workflows/codeql-analysis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 2f46889..707753a 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -65,10 +65,10 @@ jobs: # modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance. - name: Build Logging - - working-directory: ./Logging/.CSProject - run: | echo "Building logging project" dotnet build anvil-csharp-logging.sln + - working-directory: ./Logging/.CSProject - name: Build Core - run: | From 6bf7919539e572f5408eb2116fa14e61cadaa654 Mon Sep 17 00:00:00 2001 From: Mike Baker <1426795+mbaker3@users.noreply.github.com> Date: Tue, 16 Aug 2022 14:26:09 -0400 Subject: [PATCH 4/5] Update codeql-analysis.yml --- .github/workflows/codeql-analysis.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 707753a..38ecdf0 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -65,13 +65,13 @@ jobs: # modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance. - name: Build Logging - - run: | + working-directory: ./Logging/.CSProject + run: | echo "Building logging project" dotnet build anvil-csharp-logging.sln - - working-directory: ./Logging/.CSProject - name: Build Core - - run: | + run: | echo "Building core project" dotnet build anvil-csharp-core.csproj From 38c105571eb3ede478b06794fe1465821b7ac206 Mon Sep 17 00:00:00 2001 From: Mike Baker <1426795+mbaker3@users.noreply.github.com> Date: Mon, 17 Oct 2022 15:48:09 -0400 Subject: [PATCH 5/5] CodeQL - Update to scan quality --- .github/workflows/codeql-analysis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 38ecdf0..c3a294d 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -50,7 +50,7 @@ jobs: # Prefix the list here with "+" to use these queries and those in the config file. # 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-and-quality # Autobuild attempts to build any compiled languages (C/C++, C#, or Java).