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 }}'