-
Notifications
You must be signed in to change notification settings - Fork 38
92 lines (78 loc) · 2.81 KB
/
Copy pathcontainer-scan.yml
File metadata and controls
92 lines (78 loc) · 2.81 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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
name: Container Security Scan
on:
push:
branches: [main]
paths:
- 'containers/**'
- '.github/workflows/container-scan.yml'
pull_request:
branches: [main]
paths:
- 'containers/**'
- '.github/workflows/container-scan.yml'
schedule:
# Run weekly on Sundays at 00:00 UTC
- cron: '0 0 * * 0'
workflow_dispatch:
permissions:
contents: read
security-events: write
jobs:
scan-agent:
name: Scan Agent Container
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4
- name: Build Agent image
run: |
docker build -t awf-agent:${{ github.sha }} ./containers/agent
- name: Run Trivy vulnerability scanner (table output)
uses: aquasecurity/trivy-action@6c175e9c4083a92bbca2f9724c8a5e33bc2d97a5 # v0.30.0
with:
image-ref: 'awf-agent:${{ github.sha }}'
format: 'table'
severity: 'CRITICAL,HIGH'
- name: Run Trivy vulnerability scanner (SARIF output)
uses: aquasecurity/trivy-action@6c175e9c4083a92bbca2f9724c8a5e33bc2d97a5 # v0.30.0
with:
image-ref: 'awf-agent:${{ github.sha }}'
format: 'sarif'
output: 'trivy-agent-results.sarif'
severity: 'CRITICAL,HIGH'
- name: Upload Trivy scan results to GitHub Security tab
uses: github/codeql-action/upload-sarif@a4fda0891d53e117609b7ddb3570638c2c6d7c89 # v3
if: always()
with:
sarif_file: 'trivy-agent-results.sarif'
category: 'container-agent'
scan-squid:
name: Scan Squid Container
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4
- name: Build Squid image
run: |
docker build -t awf-squid:${{ github.sha }} ./containers/squid
- name: Run Trivy vulnerability scanner (table output)
uses: aquasecurity/trivy-action@6c175e9c4083a92bbca2f9724c8a5e33bc2d97a5 # v0.30.0
with:
image-ref: 'awf-squid:${{ github.sha }}'
format: 'table'
severity: 'CRITICAL,HIGH'
- name: Run Trivy vulnerability scanner (SARIF output)
uses: aquasecurity/trivy-action@6c175e9c4083a92bbca2f9724c8a5e33bc2d97a5 # v0.30.0
with:
image-ref: 'awf-squid:${{ github.sha }}'
format: 'sarif'
output: 'trivy-squid-results.sarif'
severity: 'CRITICAL,HIGH'
- name: Upload Trivy scan results to GitHub Security tab
uses: github/codeql-action/upload-sarif@a4fda0891d53e117609b7ddb3570638c2c6d7c89 # v3
if: always()
with:
sarif_file: 'trivy-squid-results.sarif'
category: 'container-squid'