-
Notifications
You must be signed in to change notification settings - Fork 0
77 lines (67 loc) · 2.66 KB
/
codeql.yml
File metadata and controls
77 lines (67 loc) · 2.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
# CodeQL static analysis — GitHub's built-in scanner for known
# vulnerability patterns (SQL injection, command injection, hardcoded
# secrets, prototype pollution, path traversal, etc.). Free for
# public repos.
#
# Findings appear under the repo's "Security → Code scanning alerts"
# tab and as inline annotations on PR diffs. Resolved alerts close
# automatically when the offending code is removed.
#
# We scan on every push to master and every PR, plus a weekly cron so
# new patterns added to the CodeQL ruleset catch existing code that
# hasn't been touched in a while.
name: CodeQL
on:
push:
branches: [master]
pull_request:
branches: [master]
schedule:
# 03:17 UTC every Monday — off-peak for maintenance, far from the
# hour boundary that everyone else uses.
- cron: '17 3 * * 1'
# Cancel an in-progress run if a newer commit lands on the same ref.
# Saves Actions minutes (CodeQL is the slowest scan we run).
concurrency:
group: codeql-${{ github.ref }}
cancel-in-progress: true
permissions:
# CodeQL needs to write its findings to the Security tab.
security-events: write
# `actions: read` lets it read the state of the workflow run itself
# (needed for some intra-workflow telemetry).
actions: read
# Read access to the source code being analysed.
contents: read
jobs:
analyze:
name: Analyze ${{ matrix.language }}
runs-on: ubuntu-latest
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
# `python` covers the FastAPI backend; `javascript-typescript`
# covers the React / Vite frontend (CodeQL treats TS as a
# superset of JS).
language: [python, javascript-typescript]
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Initialize CodeQL
uses: github/codeql-action/init@e46ed2cbd01164d986452f91f178727624ae40d7 # v4.35.3
with:
languages: ${{ matrix.language }}
# `security-extended` adds rules beyond the default set
# (e.g. CWE-178 case-sensitivity, CWE-330 weak randomness).
# `security-and-quality` would also flag style issues —
# too noisy for our size.
queries: security-extended
# Custom config to skip test/scripts/docs paths — see file.
config-file: ./.github/codeql/codeql-config.yml
- name: Autobuild
uses: github/codeql-action/autobuild@e46ed2cbd01164d986452f91f178727624ae40d7 # v4.35.3
- name: Perform analysis
uses: github/codeql-action/analyze@e46ed2cbd01164d986452f91f178727624ae40d7 # v4.35.3
with:
category: '/language:${{ matrix.language }}'