-
Notifications
You must be signed in to change notification settings - Fork 7
58 lines (51 loc) · 1.46 KB
/
security.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
---
name: security
# Run for all pushes to main and pull requests when Go or YAML files change
on:
push:
branches:
- main
pull_request:
# The branches below must be a subset of the branches above
branches: [ main ]
schedule:
- cron: '23 20 * * 2'
jobs:
scan-trivy:
name: sec-scan-trivy
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Run Trivy vulnerability scanner in repo mode
uses: aquasecurity/trivy-action@master
with:
scan-type: 'fs'
security-checks: 'vuln,config,secret'
ignore-unfixed: true
format: 'sarif'
output: 'trivy-results.sarif'
severity: 'HIGH,CRITICAL'
skip-dirs: 'tests'
- name: Upload Trivy scan results to GitHub Security tab
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: 'trivy-results.sarif'
scan-anchore:
name: sec-scan-anchore
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Scan current project
id: codescan
uses: anchore/scan-action@v3
with:
path: "."
severity-cutoff: high
acs-report-enable: true
- name: upload Anchore scan SARIF report
uses: github/codeql-action/upload-sarif@v3
if: ${{ always() }}
with:
sarif_file: ${{ steps.codescan.outputs.sarif }}