Skip to content

ci: configure ECR authentication with dedicated role variables - #469

Merged
cdalvaro merged 3 commits into
mainfrom
ci/ecr-public-read-only-login
Oct 23, 2026
Merged

cdalvaro merged 3 commits into
mainfrom
ci/ecr-public-read-only-login

Conversation

@nataliafit

@nataliafit nataliafit commented Oct 23, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

A little less anonymous pulling, a lot less wrestling with ECR limits! 🙂 I've added ECR Public login to the image build, the test runners, and the security-analysis job, with a dedicated read-only OIDC role rather than borrowing the publishing role.

Each job gets its own login—including the runners that build images inside the salt-ssh tests. Fork and Dependabot PRs keep using anonymous public pulls and never attempt to assume the AWS role.

I've also moved the publishing role ARN out of the workflow and into its own repository variable. Same publishing role and permissions, just a cleaner place for its identifier. The read-only and publishing roles stay separate. 🙂

A small stdlib-only regression check runs in the build workflow's metadata job to keep the CI login guards, ordering, and repository-variable lookup covered.

Configuration

Both ARNs come from repository Actions variables, not secrets:

  • AWS_ECR_READ_ONLY_ROLE_ARN: build, tests, and security analysis use ${{ vars.AWS_ECR_READ_ONLY_ROLE_ARN }}.
  • AWS_ECR_PUBLISH_ROLE_ARN: publication uses ${{ vars.AWS_ECR_PUBLISH_ROLE_ARN }} instead of its previous hardcoded ARN.

They're resource identifiers, not credentials; GitHub obtains the actual short-lived AWS credentials through OIDC. Both variables are configured, and the publishing variable matches the previous publishing role exactly. This change does not alter IAM policies or publishing triggers.

The read-only role needs only these permissions for authenticated public pulls—no push permissions:

{
  "Version": "2012-10-17",
  "Statement": [{
    "Effect": "Allow",
    "Action": ["ecr-public:GetAuthorizationToken", "sts:GetServiceBearerToken"],
    "Resource": "*"
  }]
}

Its OIDC trust must match this repository's pull-request context and its main branch context for scheduled security runs, with audience sts.amazonaws.com. Authentication uses us-east-1, as required for ECR Public.

@nataliafit
nataliafit requested a review from cdalvaro October 23, 2026 07:30
@cdalvaro cdalvaro added the enhancement New feature or request label Oct 23, 2026
@nataliafit nataliafit mentioned this pull request Oct 23, 2026
@nataliafit nataliafit changed the title ci: authenticate ECR Public pulls with read-only OIDC ci: configure ECR authentication with dedicated role variables Oct 23, 2026
@nataliafit
nataliafit marked this pull request as ready for review October 23, 2026 14:10
@cdalvaro
cdalvaro enabled auto-merge (rebase) October 23, 2026 14:12
@cdalvaro cdalvaro added the ci/cd Changes related with CI/CD label Oct 23, 2026
@cdalvaro
cdalvaro merged commit a8b36f1 into main Oct 23, 2026
17 of 21 checks passed
@cdalvaro
cdalvaro deleted the ci/ecr-public-read-only-login branch October 23, 2026 15:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci/cd Changes related with CI/CD enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants