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:
1111 severity :
1212 required : true
1313 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.
1419
1520runs :
1621 using : " composite"
2227 # ensure we can make unauthenticated call. This is important for making the pr_build workflow run on
2328 # PRs created from forked repos.
2429 - name : Logout of public AWS ECR
30+ if : inputs.logout == 'true'
2531 shell : bash
2632 run : docker logout public.ecr.aws
2733
3036 with :
3137 image-ref : ${{ inputs.image-ref }}
3238 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:
6565 if : ${{ steps.dep_scan.outcome != 'success' }}
6666 run : less dependency-check-report.html
6767
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+
6879 - name : Perform high image scan
6980 if : always()
7081 id : high_scan
7182 uses : ./.github/actions/image_scan
7283 with :
7384 image-ref : " public.ecr.aws/aws-observability/adot-autoinstrumentation-dotnet:v1.9.0"
7485 severity : ' CRITICAL,HIGH'
86+ logout : ' false'
7587
7688 - name : Perform low image scan
7789 if : always()
8092 with :
8193 image-ref : " public.ecr.aws/aws-observability/adot-autoinstrumentation-dotnet:v1.9.0"
8294 severity : ' MEDIUM,LOW,UNKNOWN'
95+ logout : ' false'
8396
8497 - name : Configure AWS Credentials for emitting metrics
8598 if : always()
You can’t perform that action at this time.
0 commit comments