File tree Expand file tree Collapse file tree 2 files changed +20
-1
lines changed Expand file tree Collapse file tree 2 files changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,11 @@ inputs:
11
11
severity :
12
12
required : true
13
13
description : " List of severities that will cause a failure"
14
+ logout :
15
+ required : true
16
+ description : |
17
+ Whether to logout of public AWS ECR. Set to 'true' for PR workflows to avoid potential call failures,
18
+ 'false' for daily scans which has a higher bar for passing regularly and specifically wants to sign in.
14
19
15
20
runs :
16
21
using : " composite"
22
27
# ensure we can make unauthenticated call. This is important for making the pr_build workflow run on
23
28
# PRs created from forked repos.
24
29
- name : Logout of public AWS ECR
30
+ if : inputs.logout == 'true'
25
31
shell : bash
26
32
run : docker logout public.ecr.aws
27
33
30
36
with :
31
37
image-ref : ${{ inputs.image-ref }}
32
38
severity : ${{ inputs.severity }}
33
- exit-code : ' 1'
39
+ exit-code : ' 1'
Original file line number Diff line number Diff line change @@ -65,13 +65,25 @@ jobs:
65
65
if : ${{ steps.dep_scan.outcome != 'success' }}
66
66
run : less dependency-check-report.html
67
67
68
+ - name : Configure AWS credentials for image scan
69
+ uses : aws-actions/configure-aws-credentials@v4
70
+ with :
71
+ role-to-assume : ${{ secrets.AWS_ASSUME_ROLE_ARN }}
72
+ aws-region : ${{ env.AWS_DEFAULT_REGION }}
73
+
74
+ - name : Login to Public ECR
75
+ uses : docker/login-action@v3
76
+ with :
77
+ registry : public.ecr.aws
78
+
68
79
- name : Perform high image scan
69
80
if : always()
70
81
id : high_scan
71
82
uses : ./.github/actions/image_scan
72
83
with :
73
84
image-ref : " public.ecr.aws/aws-observability/adot-autoinstrumentation-dotnet:v1.9.0"
74
85
severity : ' CRITICAL,HIGH'
86
+ logout : ' false'
75
87
76
88
- name : Perform low image scan
77
89
if : always()
80
92
with :
81
93
image-ref : " public.ecr.aws/aws-observability/adot-autoinstrumentation-dotnet:v1.9.0"
82
94
severity : ' MEDIUM,LOW,UNKNOWN'
95
+ logout : ' false'
83
96
84
97
- name : Configure AWS Credentials for emitting metrics
85
98
if : always()
You can’t perform that action at this time.
0 commit comments