From c4a891165612f6493d196584d3d24699c520d53b Mon Sep 17 00:00:00 2001 From: Guido X Jansen Date: Fri, 20 Feb 2026 21:54:09 +0100 Subject: [PATCH] ci(codeql): switch to advanced setup, exclude Fastify false positive (#68) The js/missing-rate-limiting rule does not recognise @fastify/rate-limit's per-route config.rateLimit pattern and flags every route handler as unprotected. All flagged routes already have rate limiting configured. Switch from CodeQL default setup to an advanced workflow with a custom config that excludes this rule while keeping the security-extended suite. --- .github/codeql/codeql-config.yml | 11 +++++++++ .github/workflows/codeql.yml | 39 ++++++++++++++++++++++++++++++++ 2 files changed, 50 insertions(+) create mode 100644 .github/codeql/codeql-config.yml create mode 100644 .github/workflows/codeql.yml diff --git a/.github/codeql/codeql-config.yml b/.github/codeql/codeql-config.yml new file mode 100644 index 0000000..1a90b53 --- /dev/null +++ b/.github/codeql/codeql-config.yml @@ -0,0 +1,11 @@ +# CodeQL configuration for barazo-api +# Uses the extended query suite with exclusions for false positives. + +name: 'Barazo API CodeQL Config' + +# Exclude queries that produce false positives with Fastify. +# js/missing-rate-limiting does not recognise @fastify/rate-limit's +# per-route config.rateLimit option and flags every handler as unprotected. +query-filters: + - exclude: + id: js/missing-rate-limiting diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml new file mode 100644 index 0000000..ff8998f --- /dev/null +++ b/.github/workflows/codeql.yml @@ -0,0 +1,39 @@ +name: CodeQL + +on: + push: + branches: [main] + pull_request: + branches: [main] + schedule: + # Run weekly on Monday at 06:00 UTC + - cron: '0 6 * * 1' + +permissions: + contents: read + security-events: write + +jobs: + analyze: + name: Analyze + runs-on: ubuntu-latest + + strategy: + fail-fast: false + matrix: + language: [javascript-typescript] + + steps: + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + + - name: Initialize CodeQL + uses: github/codeql-action/init@45580472a5bb82c4681c4ac726cfdb60060c2ee1 # v3 + with: + languages: ${{ matrix.language }} + config-file: .github/codeql/codeql-config.yml + queries: security-extended + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@45580472a5bb82c4681c4ac726cfdb60060c2ee1 # v3 + with: + category: '/language:${{ matrix.language }}' -- 2.51.2