Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
    • Switch to GitLab Next
  • Sign in / Register
  • Configure OpenID Connect between GitLab and AWS Configure OpenID Connect between GitLab and AWS
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 3
    • Issues 3
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
    • Requirements
  • Merge requests 1
    • Merge requests 1
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Container Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Guided ExplorationsGuided Explorations
  • AWSAWS
  • Configure OpenID Connect between GitLab and AWSConfigure OpenID Connect between GitLab and AWS
  • Issues
  • #2
Closed
Open
Issue created Feb 05, 2022 by Darren Gallagher@d.gallagherContributor

Not authorized to perform sts:AssumeRoleWithWebIdentity

Hi,

I applied this to our gitlab runner setup in AWS. We use docker+machine, spot instances, with a EC2 policy (rather than AWS keys).

A representative example of my policy and runner config can be found here: https://github.com/dazzag24/gitlab-runner-aws-autoscaler

I had to make a change to use a different region (see !1 (merged)) to get the terraform to apply but I cannot overcome the error below:

$ STS=($(aws sts assume-role-with-web-identity --role-arn ${ROLE_ARN} --role-session-name "GitLabRunner-${CI_PROJECT_ID}-${CI_PIPELINE_ID}" --web-identity-token $CI_JOB_JWT_V2 --duration-seconds 3600 --query 'Credentials.[AccessKeyId,SecretAccessKey,SessionToken]' --output text))
An error occurred (AccessDenied) when calling the AssumeRoleWithWebIdentity operation: Not authorized to perform sts:AssumeRoleWithWebIdentity

How can I debug this further?

Is it possbile to view the CI_JOB_JWT_V2 token unmasked in the CI job logs?

Thanks

Edited Feb 05, 2022 by Darren Gallagher
Assignee
Assign to
Time tracking