Docker vulnerability scan #381
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Docker vulnerability scan | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: "0 4 * * *" | |
env: | |
AWS_REGION: ca-central-1 | |
ECR_REGISTRY: ${{ secrets.AWS_ACCOUNT }}.dkr.ecr.ca-central-1.amazonaws.com/list-manager | |
permissions: | |
id-token: write | |
contents: write | |
security-events: write | |
jobs: | |
docker-vulnerability-scan: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Configure AWS credentials using OIDC | |
uses: aws-actions/configure-aws-credentials@010d0da01d0b5a38af31e9c3470dbfdabdecca3a # v4.0.1 | |
with: | |
role-to-assume: arn:aws:iam::${{ secrets.AWS_ACCOUNT }}:role/list-manager-plan | |
role-session-name: ECRPull | |
aws-region: ${{ env.AWS_REGION }} | |
- name: Login to ECR | |
id: login-ecr | |
uses: aws-actions/amazon-ecr-login@062b18b96a7aff071d4dc91bc00c4c1a7945b076 # v2.0.1 | |
- name: Docker vulnerability scan | |
uses: cds-snc/security-tools/.github/actions/docker-scan@d6bb182e15f0cad80e7625887ae88e5830728aab # v3.0.0 | |
with: | |
docker_image: "${{ env.ECR_REGISTRY }}/api:latest" | |
dockerfile_path: "api/Dockerfile" | |
token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Logout of Amazon ECR | |
run: docker logout ${{ steps.login-ecr.outputs.registry }} |