-
Notifications
You must be signed in to change notification settings - Fork 3
83 lines (70 loc) · 2.62 KB
/
scan.yaml
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
name: Scan for vulnerabilities
on:
pull_request:
branches: [main]
types: [milestoned, opened, synchronize]
schedule:
- cron: '0 1 * * *'
workflow_dispatch: {}
jobs:
# cannot scan registry1 and upstream at the same time because the sarif upload have a file limit of 20 files
scan-upstream:
runs-on: ubuntu-latest
name: Scan for vulnerabilities - Upstream
permissions:
contents: read
pull-requests: read
steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
fetch-depth: 0
- name: Environment setup
uses: defenseunicorns/uds-common/.github/actions/setup@264ec430c4079129870820e70c4439f3f3d57cbc # v0.3.9
with:
username: ${{ secrets.IRON_BANK_ROBOT_USERNAME }}
password: ${{ secrets.IRON_BANK_ROBOT_PASSWORD }}
- name: Scan the repository for vulnerabilities - Upstream
env:
FLAVOR: upstream
run: |
uds run grype:install
uds run scan:scan
- name: Upload SARIF files - Upstream
uses: github/codeql-action/upload-sarif@1b1aada464948af03b950897e5eb522f92603cc2
with:
sarif_file: ./sarif
scan-registry1:
runs-on: ubuntu-latest
name: Scan for vulnerabilities - Registry1
permissions:
contents: read
pull-requests: read
steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
fetch-depth: 0
- name: Environment setup
uses: defenseunicorns/uds-common/.github/actions/setup@264ec430c4079129870820e70c4439f3f3d57cbc # v0.3.9
with:
username: ${{ secrets.IRON_BANK_ROBOT_USERNAME }}
password: ${{ secrets.IRON_BANK_ROBOT_PASSWORD }}
- name: Iron Bank Login
env:
REGISTRY_USERNAME: ${{ secrets.IRON_BANK_ROBOT_USERNAME }}
REGISTRY_PASSWORD: ${{ secrets.IRON_BANK_ROBOT_PASSWORD }}
run: echo "${{ env.REGISTRY_PASSWORD }}" | uds zarf tools registry login -u "${{ env.REGISTRY_USERNAME }}" --password-stdin registry1.dso.mil
shell: bash
- name: Scan the repository for vulnerabilities - Registry1
run: |
uds run grype:install
uds run scan:scan
env:
GRYPE_USERNAME: ${{ secrets.IRON_BANK_ROBOT_USERNAME }}
GRYPE_PASSWORD: ${{ secrets.IRON_BANK_ROBOT_PASSWORD }}
FLAVOR: registry1
- name: Upload SARIF files - Registry1
uses: github/codeql-action/upload-sarif@1b1aada464948af03b950897e5eb522f92603cc2
with:
sarif_file: ./sarif