Greetings!<p>I've created a GitHub action that works that allows GitHub Actions to exchange a GitHub token for AWS Access Credentials.<p>I've cultivated a few examples of it in action:<p><a href="https://github.com/saml-to/aws-assume-role-action-examples" rel="nofollow">https://github.com/saml-to/aws-assume-role-action-examples</a><p>I've always found management of AWS Credentials has been a pain. So this setting up this Action works like this:<p>1) A SAML Identity Provider is created in AWS<p>2) A Role in AWS is set up to trust that Identity Provider<p>3) A config file is added to the repository indicating which role can be assumed<p>4) The GitHub Action exchanges the Repo Secret for AWS Credentials using the SAML.to backend for the exchange<p>Let me know what you think! I'm Happy to take questions and comments here or on Gitter:<p><a href="https://gitter.im/saml-to/assume-aws-role-action" rel="nofollow">https://gitter.im/saml-to/assume-aws-role-action</a>
The title "Show HN: Stop Putting AWS Credentials in GitHub Secrets" to me sounds like it's exposing some sort of specific vulunerability or similar but I might just be overreacting because of all the recent hacks.<p>A title like "Show HN: A GitHub action to help using AWS credentials" sounds more appropriate to me, saying what it is and what it does instead of saying what not to do.
Isn't it just this? <a href="https://awsteele.com/blog/2021/09/15/aws-federation-comes-to-github-actions.html" rel="nofollow">https://awsteele.com/blog/2021/09/15/aws-federation-comes-to...</a> (<a href="https://github.com/github/roadmap/issues/249" rel="nofollow">https://github.com/github/roadmap/issues/249</a>)<p>Why does SAML.to need to be used?
Some observations:<p>* it seems your package.json is still from an old iteration: <a href="https://github.com/saml-to/assume-aws-role-action/blob/main/package.json#L8" rel="nofollow">https://github.com/saml-to/assume-aws-role-action/blob/main/...</a><p>* it was super opaque where this relative import comes from: <a href="https://github.com/saml-to/assume-aws-role-action/blob/main/src/action.ts#L9" rel="nofollow">https://github.com/saml-to/assume-aws-role-action/blob/main/...</a> but after some sniffing around, it seems to be some openapi generation magick <a href="https://github.com/saml-to/assume-aws-role-action/blob/main/package.json#L17" rel="nofollow">https://github.com/saml-to/assume-aws-role-action/blob/main/...</a> against one of your own API endpoints <a href="https://github.com/saml-to/assume-aws-role-action/blob/main/.scaffoldly/services.json#L3" rel="nofollow">https://github.com/saml-to/assume-aws-role-action/blob/main/...</a> which seems to mean that using this toy is not "self contained" in the way that `sts:AssumeRoleWithWebIdentity` is
I remember receiving a bill for 5K from Amazon once. When inspecting I realized that someone had found my keys in a public GitHub repo I had and was using my account to mine bitcoins. Thankfully AWS support was understanding and forgave me that amount.<p>Other than never exposing keys like that I learned to never hide admin keys and to always create roles specific to the use case. It doesn’t fully protect you but at least it prevents abuse on your behalf.
Does anyone know the differences between saml and open id connect? <a href="https://docs.github.com/en/enterprise-cloud@latest/actions/deployment/security-hardening-your-deployments/configuring-openid-connect-in-amazon-web-services" rel="nofollow">https://docs.github.com/en/enterprise-cloud@latest/actions/d...</a>
But then what would happen if the GitHub token leaks? Would someone then be able to retrieve their own credentials as if they were your CI/CD pipeline? I feel like it be hard to audit that because a baddie would then be able to blend in with your CI/CD pipeline's traffic.<p>But you say you find "management of AWS Credentials a pain", so I guess this isn't for security purposes, right? More of just a convenience?<p>Don't get me wrong, I'm all about lessening the amount of environment variables in a pipeline!.. especially with ones that you want to rotate!
Speaking of credentials, you can use <a href="https://github.com/zricethezav/gitleaks" rel="nofollow">https://github.com/zricethezav/gitleaks</a> to check if your repos contain any secrets