-
Notifications
You must be signed in to change notification settings - Fork 4
57 lines (48 loc) · 1.72 KB
/
Copy pathsecurity.yml
File metadata and controls
57 lines (48 loc) · 1.72 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
name: Security Checks
on:
workflow_call:
permissions:
contents: read
security-events: write
jobs:
bandit-scan:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10
# https://bandit.readthedocs.io/en/latest/faq.html#under-which-version-of-python-should-i-install-bandit
- name: Set up Python 3.10
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405
with:
python-version: '3.10'
cache: 'pip'
cache-dependency-path: '.github/workflows/requirements/security.txt'
- name: Install Python dependencies
run: pip install -r .github/workflows/requirements/security.txt
- name: Run Bandit
run: bandit -c pyproject.toml -r src -f sarif -o results.sarif
# upload security results to github; a bot will add inline comments to
# the PR if any issues are found
- name: Upload SARIF file
if: always()
uses: github/codeql-action/upload-sarif@87557b9c84dde89fdd9b10e88954ac2f4248e463
with:
sarif_file: results.sarif
category: bandit
codeql-analyze:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
language: [actions, python]
steps:
- name: Checkout repository
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10
- name: Initialize CodeQL
uses: github/codeql-action/init@87557b9c84dde89fdd9b10e88954ac2f4248e463
with:
languages: ${{ matrix.language }}
build-mode: none
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@87557b9c84dde89fdd9b10e88954ac2f4248e463
with:
category: "/language:${{matrix.language}}"