forked from angrymeir/Module-3-DevSecOps-Example
-
Notifications
You must be signed in to change notification settings - Fork 0
61 lines (46 loc) · 1.16 KB
/
sast.yml
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
name: SAST with Bandit
on:
push:
branches: ['main']
workflow_dispatch:
## Start: Version 3
pull_request:
types: [opened, reopened, synchronize]
## End: Version 3
jobs:
scan:
runs-on: ubuntu-latest
steps:
## Start: Version 0
- name: Checkout repository
uses: actions/checkout@v3
## End: Version 0
## Start: Version 1
# - name: Install dependencies
# shell: bash
# run: |
# pip install bandit
# - name: Bandit
# shell: bash
# run: |
# bandit -r .
## End: Version 1
## Start: Version 2
- name: Install dependencies
shell: bash
run: |
pip install bandit-sarif-formatter bandit
- name: Bandit
shell: bash
run: |
bandit -f sarif -o results.sarif -r --exit-zero .
- name: Upload artifact
uses: actions/upload-artifact@main
with:
name: results.sarif
path: results.sarif
- name: Upload SARIF file
uses: github/codeql-action/upload-sarif@v2
with:
sarif_file: results.sarif
## End: Version 2