From 851136ad8945c16ef2c172732fbbb101f901bb7f Mon Sep 17 00:00:00 2001 From: priyanka <21082240+priya-gitTest@users.noreply.github.com> Date: Sat, 21 Nov 2026 21:29:02 +0100 Subject: [PATCH] ci: add CodeQL SAST (Python) for the harvester and edges --- .github/workflows/codeql.yml | 46 ++++++++++++++++++++++++++++++++++++ 1 file changed, 46 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 0000000..899c69e --- /dev/null +++ b/.github/workflows/codeql.yml @@ -0,0 +1,46 @@ +name: CodeQL + +# Static analysis (SAST) of our own Python — the harvester, the FastAPI read +# edge, and the MCP server. This scans the code MACH itself runs (which fetches +# and parses untrusted data from many forges and registries), not the catalogue +# entries. Findings appear under the repo's Security -> Code scanning tab. + +on: + push: + branches: [main] + pull_request: + branches: [main] + schedule: + # Weekly, so new CodeQL queries catch issues even without a code change. + - cron: '27 5 * * 1' + +permissions: + contents: read + +jobs: + analyze: + name: Analyze Python + runs-on: ubuntu-latest + permissions: + security-events: write # upload results to code scanning + contents: read + + steps: + - name: Harden runner + uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2 + with: + egress-policy: audit + + - name: Checkout + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v4 + + - name: Initialize CodeQL + uses: github/codeql-action/init@f3bbb05694c2f74569081c28664c0866d64dec21 # v4.39.3 + with: + languages: python + queries: security-and-quality + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@f3bbb05694c2f74569081c28664c0866d64dec21 # v4.39.3 + with: + category: "/language:python"