diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 64d241ba20a..d07ef88044d 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -11,6 +11,7 @@ # CI /.github/ @lucasssvaz @me-no-dev @P-R-O-C-H-Y +/.github/codeql/ @lucasssvaz /.gitlab/ @lucasssvaz /tests/ @lucasssvaz @P-R-O-C-H-Y diff --git a/.github/codeql/codeql-config.yml b/.github/codeql/codeql-config.yml new file mode 100644 index 00000000000..c640d7bd6ef --- /dev/null +++ b/.github/codeql/codeql-config.yml @@ -0,0 +1,26 @@ +name: "CodeQL config" + +packs: + - trailofbits/cpp-queries + - githubsecuritylab/codeql-cpp-queries + - githubsecuritylab/codeql-python-queries + +queries: + - uses: security-extended + - uses: security-and-quality + +query-filters: + - exclude: + query path: + - /^experimental\/.*/ + - exclude: + tags contain: + - experimental + - exclude: + problem.severity: + - recommendation + - exclude: + id: tob/cpp/use-of-legacy-algorithm + +paths-ignore: + - tests/** diff --git a/.github/workflows/codeql_actions.yml b/.github/workflows/codeql_actions.yml new file mode 100644 index 00000000000..07688f896ba --- /dev/null +++ b/.github/workflows/codeql_actions.yml @@ -0,0 +1,31 @@ +name: CodeQL Actions Analysis + +on: + workflow_dispatch: + push: + branches: + - master + pull_request: + paths: + - ".github/workflows/*.yml" + - ".github/workflows/*.yaml" + +jobs: + codeql-analysis: + name: CodeQL Actions Analysis + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + + - name: Initialize CodeQL + uses: github/codeql-action/init@181d5eefc20863364f96762470ba6f862bdef56b # v3.29.2 + with: + languages: actions + config-file: ./.github/codeql/codeql-config.yml + + - name: Run CodeQL Analysis + uses: github/codeql-action/analyze@181d5eefc20863364f96762470ba6f862bdef56b # v3.29.2 + with: + category: "Analysis: Actions" diff --git a/.github/workflows/codeql_python.yml b/.github/workflows/codeql_python.yml new file mode 100644 index 00000000000..312974cd3c1 --- /dev/null +++ b/.github/workflows/codeql_python.yml @@ -0,0 +1,30 @@ +name: CodeQL Python Analysis + +on: + workflow_dispatch: + push: + branches: + - master + pull_request: + paths: + - "**/*.py" + +jobs: + codeql-analysis: + name: CodeQL Python Analysis + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + + - name: Initialize CodeQL + uses: github/codeql-action/init@181d5eefc20863364f96762470ba6f862bdef56b # v3.29.2 + with: + languages: python + config-file: ./.github/codeql/codeql-config.yml + + - name: Run CodeQL Analysis + uses: github/codeql-action/analyze@181d5eefc20863364f96762470ba6f862bdef56b # v3.29.2 + with: + category: "Analysis: Python"