From fe0950906a372d0c2e84d369d079b85212ab3246 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Janin?= Date: Wed, 28 Oct 2026 14:39:13 -0400 Subject: [PATCH] chore: update Github actions requiring public ECR image to alleviate rate limiting issue --- .../workflows/docker-vulnerability-scan.yml | 4 ++-- .github/workflows/staging-post-deployment.yml | 18 +++++++++++++++++- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/.github/workflows/docker-vulnerability-scan.yml b/.github/workflows/docker-vulnerability-scan.yml index dca4badc..5446708f 100644 --- a/.github/workflows/docker-vulnerability-scan.yml +++ b/.github/workflows/docker-vulnerability-scan.yml @@ -23,7 +23,7 @@ jobs: uses: aws-actions/configure-aws-credentials@7474bc4690e29a8392af63c5b98e7449536d5c3a # v4.3.1 with: role-to-assume: arn:aws:iam::${{ env.AWS_ACCOUNT_ID }}:role/forms-api-plan - role-session-name: ECRPull + role-session-name: DockerVulnerabilityScan aws-region: ${{ env.AWS_REGION }} - name: Login to Staging Amazon ECR @@ -33,7 +33,7 @@ jobs: - name: Docker vulnerability scan uses: cds-snc/security-tools/.github/actions/docker-scan@5a93d1deec72d4cb2737cb8418364fedba1c695c # v3.2.1 env: - TRIVY_DB_REPOSITORY: ${{ vars.TRIVY_DB_REPOSITORY }} + TRIVY_DB_REPOSITORY: ${{ vars.LOCAL_TRIVY_DB_REPOSITORY }} ECR_REGISTRY: ${{ steps.login-ecr-staging.outputs.registry }} with: docker_image: "${{ env.ECR_REGISTRY }}/${{ env.ECR_REPOSITORY }}:latest" diff --git a/.github/workflows/staging-post-deployment.yml b/.github/workflows/staging-post-deployment.yml index aa1d04fa..67878c42 100644 --- a/.github/workflows/staging-post-deployment.yml +++ b/.github/workflows/staging-post-deployment.yml @@ -12,7 +12,12 @@ concurrency: group: staging-post-deployment cancel-in-progress: true +env: + AWS_ACCOUNT_ID: ${{ vars.STAGING_AWS_ACCOUNT_ID }} + AWS_REGION: ca-central-1 + permissions: + id-token: write contents: write security-events: write @@ -26,10 +31,21 @@ jobs: - name: Build Docker image run: docker build --platform=linux/amd64 --provenance false -t forms-api . + - name: Configure AWS credentials using OIDC + uses: aws-actions/configure-aws-credentials@7474bc4690e29a8392af63c5b98e7449536d5c3a # v4.3.1 + with: + role-to-assume: arn:aws:iam::${{ env.AWS_ACCOUNT_ID }}:role/forms-api-plan + role-session-name: StagingPostDeployment + aws-region: ${{ env.AWS_REGION }} + + - name: Login to Staging Amazon ECR + id: login-ecr-staging + uses: aws-actions/amazon-ecr-login@f2e9fc6c2b355c1890b65e6f6f0e2ac3e6e22f78 + - name: Docker generate SBOM uses: cds-snc/security-tools/.github/actions/generate-sbom@837a88b6337d4842543184c8eac97a8adac8f302 # v4.0.3 env: - TRIVY_DB_REPOSITORY: ${{ vars.TRIVY_DB_REPOSITORY }} + TRIVY_DB_REPOSITORY: ${{ vars.LOCAL_TRIVY_DB_REPOSITORY }} with: docker_image: "forms-api" dockerfile_path: "Dockerfile"