-
Notifications
You must be signed in to change notification settings - Fork 1
52 lines (42 loc) · 1.53 KB
/
inspector_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
name: Scan repo with Inspector
on: [push]
jobs:
daily_job:
runs-on: ubuntu-latest
environment:
name: InspectorScanSbom
steps:
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-region: ${{ secrets.AWS_REGION }}
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
role-to-assume: ${{ secrets.AWS_IAM_ROLE }}
- name: Checkout repository
uses: actions/checkout@v4
- name: Scan project with Inspector
id: inspector
uses: aws-actions/vulnerability-scan-github-action-for-amazon-inspector@v1.0.0
with:
artifact_type: 'repository'
artifact_path: './'
display_vulnerability_findings: "enabled"
critical_threshold: 1
high_threshold: 1
medium_threshold: 1
low_threshold: 1
other_threshold: 1
- name: Display SBOM
run: cat ${{ steps.inspector.outputs.artifact_sbom }}
- name: Display vulnerability scan
run: cat ${{ steps.inspector.outputs.inspector_scan_results }}
- name: Upload scan results
uses: actions/upload-artifact@v4
with:
name: Inspector Vulnerability Scan Artifacts
path: |
${{ steps.inspector.outputs.inspector_scan_results }}
${{ steps.inspector.outputs.artifact_sbom }}
- name: Fail if vulns detected
run: exit ${{ steps.inspector.outputs.vulnerability_threshold_exceeded }}