-
Notifications
You must be signed in to change notification settings - Fork 1
82 lines (70 loc) · 2.22 KB
/
security_scan.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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
name: Security Scan
on:
push:
branches: [ "main" ]
workflow_dispatch:
jobs:
scan:
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write
steps:
- uses: actions/checkout@v3
- name: Run Trivy vulnerability scanner
uses: aquasecurity/trivy-action@master
continue-on-error: true
with:
scan-type: 'fs'
format: 'sarif'
output: 'trivy-results.sarif'
vuln-type: 'os,library,vuln,secret,config'
severity: 'UNKNOWN,LOW,MEDIUM,HIGH,CRITICAL'
- name: Run TruffleHog OSS Secret scanner
uses: trufflesecurity/trufflehog@main
continue-on-error: true
with:
path: ./
base: ${{ github.event.repository.default_branch }}
- name: Run tfsec for Terraform files
continue-on-error: true
uses: aquasecurity/tfsec-sarif-action@master
with:
sarif_file: tfsec.sarif
- name: Run Bandit for azure-goat Python function
continue-on-error: true
uses: jpetrucciani/bandit-check@master
with:
path: './azure-goat/modules/module-1/resources/azure_function/data/app'
bandit_flags: '--format sarif --output bandit.sarif'
- name: Upload report from Trivy as Build Artifact
uses: actions/upload-artifact@v3
with:
name: ScanReport
path: 'trivy-results.sarif'
- name: Upload report from tfsec as Build Artifact
uses: actions/upload-artifact@v3
with:
name: ScanReport
path: 'tfsec.sarif'
- name: Upload report from bandit as Build Artifact
uses: actions/upload-artifact@v3
with:
name: ScanReport
path: 'bandit.sarif'
- name: Upload alerts from trivy to Security tab
continue-on-error: true
uses: github/codeql-action/upload-sarif@v2
with:
sarif_file: 'trivy-results.sarif'
- name: Upload alerts from tfsec to Security tab
continue-on-error: true
uses: github/codeql-action/upload-sarif@v2
with:
sarif_file: 'tfsec.sarif'
- name: Upload alerts from bandit to Security tab
continue-on-error: true
uses: github/codeql-action/upload-sarif@v2
with:
sarif_file: 'bandit.sarif'