Skip to content

Add docker login for daily scan workflow image scanning #451

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Aug 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/actions/artifacts_build/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,4 +104,5 @@ runs:
uses: ./.github/actions/image_scan
with:
image-ref: ${{ inputs.image_uri_with_tag }}
severity: 'CRITICAL,HIGH,MEDIUM,LOW,UNKNOWN'
severity: 'CRITICAL,HIGH,MEDIUM,LOW,UNKNOWN'
logout: 'true'
8 changes: 7 additions & 1 deletion .github/actions/image_scan/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ inputs:
severity:
required: true
description: "List of severities that will cause a failure"
logout:
required: true
description: |
Whether to logout of public AWS ECR. Set to 'true' for PR workflows to avoid potential call failures,
'false' for daily scans which has a higher bar for passing regularly and specifically wants to sign in.

runs:
using: "composite"
Expand All @@ -22,6 +27,7 @@ runs:
# ensure we can make unauthenticated call. This is important for making the pr_build workflow run on
# PRs created from forked repos.
- name: Logout of public AWS ECR
if: inputs.logout == 'true'
shell: bash
run: docker logout public.ecr.aws

Expand All @@ -30,4 +36,4 @@ runs:
with:
image-ref: ${{ inputs.image-ref }}
severity: ${{ inputs.severity }}
exit-code: '1'
exit-code: '1'
13 changes: 13 additions & 0 deletions .github/workflows/daily_scan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,25 @@ jobs:
if: ${{ steps.dep_scan.outcome != 'success' }}
run: less dependency-check-report.html

- name: Configure AWS credentials for image scan
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ secrets.AWS_ASSUME_ROLE_ARN }}
aws-region: ${{ env.AWS_DEFAULT_REGION }}

- name: Login to Public ECR
uses: docker/login-action@v3
with:
registry: public.ecr.aws

- name: Perform high image scan
if: always()
id: high_scan
uses: ./.github/actions/image_scan
with:
image-ref: "public.ecr.aws/aws-observability/adot-autoinstrumentation-python:v0.10.1"
severity: 'CRITICAL,HIGH'
logout: 'false'

- name: Perform low image scan
if: always()
Expand All @@ -92,6 +104,7 @@ jobs:
with:
image-ref: "public.ecr.aws/aws-observability/adot-autoinstrumentation-python:v0.10.1"
severity: 'MEDIUM,LOW,UNKNOWN'
logout: 'false'

- name: Configure AWS Credentials for emitting metrics
if: always()
Expand Down
Loading