Normal view

A quick guide and gotchas for GitHub OIDC and avoid using AWS permanent credentials in GitHub Actions

I have been aggressively migrating from AWS permanent credentials to OIDC in GitHub Actions, mainly for deploying to ECS.

I know GitHub Actions were supporting OIDC for a while now. But the pressure on compliance is the reason for this migration.

If you are new to OpenID Connect (OIDC), it allows GitHub runners to mint short-lived (15–60 min) STS tokens on-the-fly with zero stored secrets.

Here’s a quick breakdown of how it works, the Terraform/OpenTofu setup, and the subtle gotchas that I faced.

1. How It Works Under the Hood

  1. When your workflow job starts with id-token: write, GitHub's OIDC service generates a cryptographically signed JSON Web Token (JWT).
  2. The aws-actions/configure-aws-credentials action sends this JWT to AWS STS via sts:AssumeRoleWithWebIdentity.
  3. AWS validates GitHub's signature, checks your IAM Role's Trust Policy (to ensure the token came from your exact repo and branch), and returns temporary STS credentials.

2. The Infrastructure Setup (Terraform / OpenTofu)

You only need two AWS resources: an OIDC Provider and an IAM Role with a Trust Policy.

hcl # 1. The GitHub OIDC Identity Provider resource "aws_iam_openid_connect_provider" "github" { url = "https://token.actions.githubusercontent.com" client_id_list = ["sts.amazonaws.com"] thumbprint_list = [ "6938fd4d98bab03faadb97b34396831e3780aea1", "1c58a3a8518e8759bf075b76b750d4f2df264fcd" ] } # 2. IAM Role with Scoped Trust Policy resource "aws_iam_role" "github_deploy_role" { name = "github-actions-deploy-role" assume_role_policy = jsonencode({ Version = "2012-10-17" Statement = [{ Effect = "Allow" Principal = { Federated = aws_iam_openid_connect_provider.github.arn } Action = "sts:AssumeRoleWithWebIdentity" Condition = { StringEquals = { "token.actions.githubusercontent.com:aud" = "sts.amazonaws.com" } StringLike = { # Restrict exclusively to your repository & branch/tags "token.actions.githubusercontent.com:sub" = "repo:your-username/your-repo:*" } } }] }) }

3. The GitHub Actions Workflow

In your .github/workflows/deploy.yml

name: Deploy to AWS on: push: branches: [ main ] jobs: deploy: runs-on: ubuntu-latest permissions: id-token: write # CRITICAL: required to request the OIDC JWT contents: read steps: - name: Checkout code uses: actions/checkout@v4 - name: Configure AWS Credentials via OIDC uses: aws-actions/configure-aws-credentials@v4 with: role-to-assume: arn:aws:iam::123456789012:role/github-actions-deploy-role aws-region: us-east-1 - name: Verify Authentication run: aws sts get-caller-identity 

Three real-world gotchas that will save you hours

If you get Error: Could not assume role with OIDC: Not authorized to perform sts:AssumeRoleWithWebIdentity, check these 3 things:

  1. Case Sensitivity in the sub claim: AWS IAM condition strings are case-sensitive. If your GitHub repo or username uses mixed casing (e.g. MyOrg/Repo), make sure your IAM sub condition matches the exact casing GitHub sends in the token. Using wildcard matching (repo:MyOrg/Repo:*) helps avoid exact ref string mismatch issues.
  2. Job-Level vs. Workflow-Level Permissions: Always set permissions: id-token: write on the specific job, not just globally at the top of the YAML file. Some runner configs don't inherit top-level permissions to nested jobs.
  3. CA Thumbprints: Don't dynamically query GitHub's leaf certificate for thumbprints in Terraform—they change frequently with CDN updates. Use GitHub's official intermediate root CA thumbprints:
    • 6938fd4d98bab03faadb97b34396831e3780aea1
    • 1c58a3a8518e8759bf075b76b750d4f2df264fcd

Summary

  • No stored secrets in GitHub settings.
  • No key rotation schedules to manage.
  • Granular security. You can restrict deployment roles to specific branches or environments.

Are you already using OIDC for your pipelines, or are you still relying on IAM users? Curious how folks here handle multi-account / cross-account OIDC setups.

submitted by /u/SeaworthinessHour233 to r/devops
[link] [comments]

Looking for a high-quality laptop backpack for work / business travel – available in Europe

Hi everyone,

I’m looking for a good-quality laptop backpack mainly for work, commuting, customer visits, and occasional business travel.

I’d like something practical and durable, but still professional-looking rather than a hiking or tactical backpack.

My main priorities are:

- good protection for the laptop, preferably a separate padded laptop compartment

- comfortable shoulder straps and back panel

- good internal organization for charger, cables, mouse, headphones, documents, etc.

- quick-access pocket for keys / phone / wallet

- space for a water bottle

- durable materials and good-quality zippers

- some water resistance would be a plus

- preferably a luggage pass-through for attaching it to a suitcase

- professional / minimalist design

- preferably something that will last for many years

It will mainly be used for everyday work, but occasionally I’d also like to use it for 1–2 day business trips.

I’m based in Europe, so I’m mainly interested in brands/models that are easily available in the EU without expensive international shipping, customs, or import fees.

I’m not necessarily looking for the cheapest option — I’d rather pay more for something comfortable, well designed, and durable.

What backpacks are you actually using and would recommend?

I’m especially interested in long-term experience: how long have you owned it, what do you like about it, and what annoys you?

Thanks!

submitted by /u/No-Perspective3501 to r/devops
[link] [comments]

Blacksmith.sh GitHub runners

I signed up for blacksmith about a week in I’ve got a $7 bill already. I’m also getting you’ve hit 80% of your free mins and you should add a payment method.

I’m seriously confused after being extremely impressed by how fast their runners are. Now I’m wondering what the heck is going on.

I tried to reach out to them but need a payment method to contact billing and no reply on the support@ email.

I’m happy to pay as the service is good but really surprised how they work/do business. I feel I could easily be in for future bull shocks.

Has this happened to anyone else.

Looks like I’m not the only one hit by this - https://forestwalk.ai/blog/surprise-blacksmith-costs/

submitted by /u/hashkent to r/devops
[link] [comments]

Implementation is getting faster but the org around it moves at the same speed as always and DevOps is in-between.

We all know that large organizations tend to have a lot of meetings, bureaucratic processes and are in general slow moving. That was true for a long time and I experienced that myself, having worked in multiple different companies from startups, scaleups and large corperations.

However since everyone now adopts AI and implementation speed is undeniable multiples faster. I mean it's not just implementation, but also a good part of DevOps. But the rest of the organization moves in the same speed as before. Even if the company uses AI in the other departments (my company does basically throw AI at everything, I guess you know what I mean), they still can't competet with the productivity change in software development.

The blockers are now decisions, requirements and communication. That's not completly new, but now its >95% of the time. I implement features in hours that would have taken days before (I am not a pure DevOps Engineer). And it's not the review process itself that blocks us (We use AI in reviews as well, because otherwise it would be impossible), it's the normal company processes and pace.

Don't get me wrong here, I kind of enjoy it a bit, because I can use a lot of time for learning, building stuff that I think is worth improving, but I think we have a general problem here that is basically systematic to every large organization. And I see that so called "AI native organizations" (what ever that means), will probably overtake tech companies in the long term.

I have a really good comparsion, because I am working with a startup as a side gig and my main job is in a mid-sized tech company. In the Startup we (2 devs) built a product that would have taken several months by a 5-person team in the past and the reason is mostly: decisions and communication.

Do you see that in your company?

My conclusion is that we need to make engineers owners of the feature/product + infra, otherwise we won't see much productivity gains and this means also that management layers need to be cut, because they are the bottleneck currently. The idea of centralized DevOps will is going to die I guess.

submitted by /u/rudiXOR to r/devops
[link] [comments]

Anyone else interested in connecting with DevOps folks from different parts of the world?

I recently came across a post on Reddit from someone looking to connect with other DevOps professionals. I reached out, and we ended up moving the conversation to Discord.

It's been pretty nice having a place where we can talk about things we're working on, exchange ideas, troubleshoot things, and share what we've learned.

But the conversations haven't really stayed limited to DevOps - which is actually what I've enjoyed most.

We sometimes end up talking about things like:

  • How DevOps/tech work differs between countries
  • Differences in workplace and engineering culture
  • How people got into the industry and how their careers have developed
  • Tools, practices, and technologies people are using
  • Interesting things we're currently learning or building
  • And occasionally just completely random stuff 😄

I'd like to meet more people from different parts of the world and have more of these conversations.

You don't need to be a DevOps expert or have 10+ years of experience. If you work somewhere around DevOps, SRE, cloud, infrastructure, platform engineering, sysadmin, or software engineering - or you're simply learning in that direction - feel free to reach out.

We're currently a small group, and we'd like to keep it that way rather than turn it into a huge server full of people who never talk.

If you'd be interested in chatting and getting to know some other people in the space, leave a comment or send me a DM. Happy to connect.

submitted by /u/Intrepid_Dentist708 to r/devops
[link] [comments]

Thinking of backup plans

So i'm a senior software engineer with almost 9 years of experience, mostly backend stuff, a lot of AWS, serverless, Node.js and JavaScript in general. Lately i've been watching how fast everyone is adopting AI and honestly it's making me less interested in this field, or at least less sure about where it's going, and i don't want to just sit around waiting to see if i end up on a layoff list.

What i really want is a backup plan, something i can lean on if things go sideways, and DevOps or platform engineering feels like a natural step since i already live in AWS and deal with infra day to day, but i don't really know what the day to day is like or how it compares to backend work.

For those of you who moved into DevOps from backend, what did the transition look like, what did you have to learn that you didn't expect, and what would you focus on now so i'm not the one who gets cut? Any honest takes appreciated.

submitted by /u/BlessED0071 to r/devops
[link] [comments]
❌