File tree Expand file tree Collapse file tree 8 files changed +97
-65
lines changed Expand file tree Collapse file tree 8 files changed +97
-65
lines changed Original file line number Diff line number Diff line change 1
- name : build_image
1
+ name : build-image
2
2
3
3
on :
4
4
workflow_call :
Original file line number Diff line number Diff line change
1
+ name : import-vulnerabilities
2
+
3
+ on :
4
+ workflow_call :
5
+ inputs :
6
+ image_digest :
7
+ description : ' Fully-qualified image uri (repo/image@digest)'
8
+ required : true
9
+ type : string
10
+ auth_provider :
11
+ description : ' OIDC provider ID'
12
+ required : true
13
+ type : string
14
+ auth_user :
15
+ description : ' OIDC user ID'
16
+ required : true
17
+ type : string
18
+ target_project :
19
+ description : ' Target project ID where vulnerability scan will be imported'
20
+ required : true
21
+ type : string
22
+ report_path :
23
+ description : ' Path to vulnerability scan report'
24
+ type : string
25
+ default : ' report.json'
26
+
27
+ permissions :
28
+ contents : read
29
+
30
+ jobs :
31
+ import :
32
+ runs-on : ubuntu-latest
33
+ permissions :
34
+ actions : read
35
+ id-token : write
36
+ steps :
37
+
38
+ - name : Checkout Code
39
+ uses : actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
40
+
41
+ - id : auth
42
+ name : Auth GCP
43
+ uses : google-github-actions/auth@ef5d53e30bbcd8d0836f4288f5e50ff3e086997d # v1.0.0
44
+ with :
45
+ token_format : " access_token"
46
+ workload_identity_provider : ${{ inputs.auth_provider }}
47
+ service_account : ${{ inputs.auth_user }}
48
+
49
+ - id : scan
50
+ name : Vulnerability Scan
51
+ uses : aquasecurity/trivy-action@master
52
+ with :
53
+ image-ref : ${{ inputs.image_digest }}
54
+ scanners : vuln
55
+ format : json
56
+ output : ${{ inputs.report_path }}
57
+ timeout : 5m
58
+ hide-progress : true
59
+
60
+ - uses : mchmarny/vulctl@main
61
+ with :
62
+ project : ${{ inputs.target_project }}
63
+ digest : ${{ inputs.image_digest }}
64
+ file : ${{ inputs.report_path }}
65
+ format : trivy
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 15
15
PROVIDER_ID : projects/689738033528/locations/global/workloadIdentityPools/vulctl-github-pool/providers/github-provider
16
16
REG_URI : us-west1-docker.pkg.dev/cloudy-build/vulctl
17
17
18
+ PROJECT_ID : cloudy-build
18
19
19
20
# Defaults
20
21
BUILDER_VERSION : v1.4.0
34
35
provider_id : ${{ steps.conf.outputs.provider_id }}
35
36
registry_uri : ${{ steps.conf.outputs.registry_uri }}
36
37
service_account : ${{ steps.conf.outputs.service_account }}
38
+ project_id : ${{ steps.conf.outputs.project_id }}
37
39
steps :
38
40
39
41
- name : Export Config
47
49
echo "provider_id=${{ env.PROVIDER_ID }}" >> $GITHUB_OUTPUT
48
50
echo "registry_uri=${{ env.REG_URI }}" >> $GITHUB_OUTPUT
49
51
echo "service_account=${{ env.SA_EMAIL }}" >> $GITHUB_OUTPUT
52
+ echo "project_id=${{ env.PROJECT_ID }}" >> $GITHUB_OUTPUT
50
53
51
54
test :
52
55
needs :
@@ -107,3 +110,18 @@ jobs:
107
110
auth_provider : ${{ needs.conf.outputs.provider_id }}
108
111
auth_user : ${{ needs.conf.outputs.service_account }}
109
112
image_digest : ${{ needs.image.outputs.digest }}
113
+
114
+ import :
115
+ needs :
116
+ - conf
117
+ - image
118
+ permissions :
119
+ contents : read
120
+ actions : read
121
+ id-token : write
122
+ uses : ./.github/workflows/import.yaml
123
+ with :
124
+ auth_provider : ${{ needs.conf.outputs.provider_id }}
125
+ auth_user : ${{ needs.conf.outputs.service_account }}
126
+ image_digest : ${{ needs.image.outputs.digest }}
127
+ target_project : ${{ needs.conf.outputs.project_id }}
Original file line number Diff line number Diff line change 1
- name : sign_image
1
+ name : sign-image
2
2
3
3
on :
4
4
workflow_call :
Original file line number Diff line number Diff line change 1
- name : slsa_provenance_create
1
+ name : slsa-provenance-create
2
2
3
3
on :
4
4
workflow_call :
Original file line number Diff line number Diff line change 1
- v0.2.9
1
+ v0.2.10
Original file line number Diff line number Diff line change 15
15
16
16
## usage
17
17
18
+ Below example, shows how to import vulnerabilities from previously generated report.
19
+
20
+ > Make sure to use the latest tag release (e.g. ` v0.2.10 ` )
21
+
18
22
``` yaml
19
- uses : actions /vulctl@main
23
+ uses : mchmarny /vulctl@v0.2.10
20
24
with :
21
- project : cloudy-demo
22
- digest : ${{ env.IMAGE_DIGEST }}
23
- file : report.json
24
- format : snyk
25
+ project : ${{ env.PROJECT_ID }}
26
+ digest : ${{ steps.build.outputs.digest }}
27
+ file : ${{ steps.scan.outputs.output }}
28
+ format : ${{ steps.scan.outputs.format }}
25
29
` ` `
26
30
27
- > Fully working example can be found in [.github/workflows/on-push- import.yaml](../../.github/workflows/on-push- import.yaml).
31
+ > Fully working example can be found in [.github/workflows/import.yaml](../../.github/workflows/import.yaml).
You can’t perform that action at this time.
0 commit comments