How to setup Dependabot OIDC with AWS CodeArtifact? #186757
Replies: 3 comments 1 reply
-
|
Short answer: AWS CodeArtifact does not have a client-id or tenant-id. The confusion comes from the Dependabot documentation mixing multiple OIDC providers (Azure, GCP, AWS) in one place. Why the docs are misleading client-id / tenant-id → Azure only AWS OIDC works via IAM roles, not OAuth clients or tenants So when you’re using AWS CodeArtifact, there is nothing equivalent to fill in for those fields. How OIDC with AWS CodeArtifact actually works This is essentially the same model you already use in GitHub Actions: GitHub OIDC provider in IAM token.actions.githubusercontent.com IAM role Trust policy allows sts:AssumeRoleWithWebIdentity Conditions scoped to repo/org (recommended) Permissions on the role codeartifact:GetAuthorizationToken codeartifact:GetRepositoryEndpoint possibly sts:GetServiceBearerToken Dependabot configuration You only provide the IAM Role ARN No client-id No tenant-id |
Beta Was this translation helpful? Give feedback.
-
|
Ignore all the garbage AI slop above, this will get you going. |
Beta Was this translation helpful? Give feedback.
-
|
Example version: 2
registries:
codeartifact:
type: python-index
url: https://MY_DOMAIN-MY_ACCOUNT_ID.d.codeartifact.REGION.amazonaws.com/pypi/MY_REPO/simple/
aws-region: REGION
account-id: "123456789012"
role-name: MY_ROLE_NAME
domain: MY_DOMAIN
domain-owner: "123456789012"
# audience: sts.amazonaws.com # only if you customized it
updates:
- package-ecosystem: "pip"
directory: "/"
registries: ["codeartifact"]
schedule:
interval: "weekly"On the AWS side, this is the same model as GitHub Actions OIDC: IAM role trust allows |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Select Topic Area
General
Body
I was trying to implement the new feature for Dependabot, to use OIDC to authenticate to our private python index, but from the documentation it's not clear what I should use as
client-idandtenant-idwhen using AWS CodeArtifact. I have OIDC set up and I use it in workflow by using the configure-aws-credentials action withrole-to-assume:RoleARN.Beta Was this translation helpful? Give feedback.
All reactions