<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Code Securing Code - Medium]]></title>
        <description><![CDATA[Security is not usually an enabler and can be hard. When working on a personal project, security modeling and features are far down the to-do list. Code Securing Code attempts to help in this space providing musing and working projects to help you do security better…or at all. - Medium]]></description>
        <link>https://medium.com/code-securing-code?source=rss----3cd2368884a3---4</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>Code Securing Code - Medium</title>
            <link>https://medium.com/code-securing-code?source=rss----3cd2368884a3---4</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 23 Nov 2026 22:51:52 GMT</lastBuildDate>
        <atom:link href="https://medium.com/feed/code-securing-code" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[AWS STS for the People]]></title>
            <link>https://medium.com/code-securing-code/aws-sts-for-the-people-76821eabe383?source=rss----3cd2368884a3---4</link>
            <guid isPermaLink="false">https://medium.com/p/76821eabe383</guid>
            <category><![CDATA[terraform]]></category>
            <category><![CDATA[temporary-credentials]]></category>
            <category><![CDATA[golang]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[jesse taylor]]></dc:creator>
            <pubDate>Fri, 03 Sep 2021 20:22:05 GMT</pubDate>
            <atom:updated>2021-09-03T20:22:05.675Z</atom:updated>
            <content:encoded><![CDATA[<h4>AWS STS for the Hobbyist and Tinkerer</h4><p>AWS Security Token Service (STS) is a way to create on-demand, short-lived, programmatic credentials to access resources in an AWS account.</p><p>AWS STS, with a little help, can help you get rid of all those static credentials for your personal or one-off accounts and move to a more secure future.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2F4GRj3pwoAJSwg%2Ftwitter%2Fiframe&amp;display_name=Giphy&amp;url=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2F4GRj3pwoAJSwg%2Fgiphy.gif%3Fcid%3Decf05e47k0a3rfrwod1z6mhms3g3aewwufp0hwx871f3uw8f%26rid%3Dgiphy.gif%26ct%3Dg&amp;image=https%3A%2F%2Fi.giphy.com%2Fmedia%2F4GRj3pwoAJSwg%2Fgiphy.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="326" frameborder="0" scrolling="no"><a href="https://medium.com/media/d60f2b900e313a7b72e7554ee28c0eb6/href">https://medium.com/media/d60f2b900e313a7b72e7554ee28c0eb6/href</a></iframe><p>Don’t be like this guy. Use <a href="https://github.com/jtaylorcpp/stsftw">STSFTW</a> and get your credentials when you need them…don’t horde them on your filesystem.</p><p>Still curious? Read on at your own eye-glazing peril.</p><p>AWS is pretty neat…a plethora of cool engineering things that just beckon to be configured once and left on for an eternity.</p><p>For those S3 buckets with your version k8s bins (looking at you early adopters), maybe it’ll just cost a few dollars over a year…less than the oh so hipster PSL.</p><p>However; there is one service that everyone uses, likely configured poorly, is left on for an enternity (because you have to), and doesn’t cost money but is the gateway to big spend: IAM.</p><p>IAM is neat… it’s complex, let’s us all make excellent decisions when mixing and matching policies, and it can be used as identity for all the things. As I said…neat.</p><p>It’s so neat that most users need a whole identity platform, centralized process, or some duct-taped automation to make any sort of sense of it.</p><p>Sadly, for the enthusiast, tinkerer, hobbyist, weekend engineer, experimenter, etc. we get stuck in a special bin where the system is too complex to use successfully and we resort to minting our first IAM user. IAM Users can be great, they provide dependable access to an account and the AWS tooling easily slurps them up for your enjoyment. However; the same goes for any person with access to the credentials, including those you didn’t give them to explicitly.</p><p>Accidentally shoot them to GitHub? Password manager get popped? Leave them on an old unencrypted computer where the admin password is <em>password</em>?</p><p>Some tech-hipster, internet sleuth will find them and maybe help you rack up a few more dollars in resource spend.</p><p>As I mentioned above, an identity platform usually handles this through federation or minting short lived tokens. This helps the issue of unintentional exposure of long lived credentials and limiting an incidents blast radius.</p><p>This is where AWS STS can give us a hand.</p><p>AWS Security Token Service (STS) is a way to mint short lived credentials to an AWS account. However, as an AWS service, it shares the same issue as the rest of them…you need permissions or credentials to be able to use the service…neat.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2Fl0G18dQvjDzpg0L8Q%2Ftwitter%2Fiframe&amp;display_name=Giphy&amp;url=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2Fl0G18dQvjDzpg0L8Q%2Fgiphy.gif%3Fcid%3Decf05e47t74xyku99gi8waskekxwcq7ge8yqvl71qd8gjqio%26rid%3Dgiphy.gif%26ct%3Dg&amp;image=https%3A%2F%2Fi.giphy.com%2Fmedia%2Fl0G18dQvjDzpg0L8Q%2Fgiphy.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="328" frameborder="0" scrolling="no"><a href="https://medium.com/media/a79c3ae04811956c0fc96c1da61f6b9a/href">https://medium.com/media/a79c3ae04811956c0fc96c1da61f6b9a/href</a></iframe><p>Unfortunately what follows next seems to be an AWS pattern…enable and use more resources to be able to use the resource you really wanted to use…super fun(can you over use neat?).</p><p>None the less, I’ve thrown a few resources together to help us all use STS without needing an identity platform. All you need is a phone with and authenticator app and a public endpoint to put the collection of services behind.</p><p>I give you <a href="https://github.com/jtaylorcpp/stsftw">STSFTW</a>.</p><p>Comments, concerns, and PRs are always welcome.</p><h3>How it works…</h3><p>At the heart of it, STSFTW is a lambda function that validates a auth code (OTP) and IAM role request made by the user. Once validated, the lambda will mint a short lived set of credentials that have the specified (and validated) role.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ccb5iynD9IzxsxT_GzIXKQ.png" /></figure><p>For all you hackers out there, maybe a sequence diagram works better:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DOMx8fQJMMhbb7xUx7jv0w.png" /><figcaption>STSFTW Sequence Diagram</figcaption></figure><h4>The smattering of AWS services in use:</h4><p><strong>DynamoDB</strong></p><p>DynamoDB is a nosql database used to store all of the end-user auth information. It is only used by the lambda based service and by the application admin who manages it out of bound (there are no flows to writing to the database through the application).</p><p><strong>Lambda</strong></p><p>AWS Lambda is a serverless platform where you just supply code for AWS to run. The lambda is integrated with a VPC so that it can be the target of an Application Load Balancer.</p><p><strong>Route53 (optional)</strong></p><p>This is marked optional since you don’t <em>have </em>to use it. Here, it is set up to both create the domain and CNAME(or AWS ALIAS) record for the public ALB endpoint as well as validate certificates for ACM.</p><p><strong>ACM</strong></p><p>ACM provides certificates for the ALB public endpoint allowing end users to make HTTPS connections to an endpoint that they can validate through the preinstalled and ubiquitous AWS Certificate Authority.</p><p><strong>VPC (can bring your own)</strong></p><p>A place to run the lambda as well as deploy the Application Load Balancer.</p><p><strong>STS</strong></p><p>STS is the service we actually want to use (not all the others listed).</p><p>AWS Security Token Service is a service that generates short-lived AWS credentials that can be bound to an inline-policy, policy, or role.</p><p>Well use this to turn an OTP code paired with a known identity into AWS credentials to be used to access your AWS account.</p><p><strong>IAM</strong></p><p>AWS IAM is the AWS identity platform. It does…identity…and access management.</p><p><strong>SNS</strong></p><p>AWS Simple Notification Service is one of the pub/sub technologies AWS provides. SNS is used because there is a pretty straight forward email integration that we can use to notify the owner of the STSFTW deployment when any credentials are minted.</p><h4>All the other tech:</h4><p><strong>Terragrunt/Terraform</strong></p><p>Keep it DRY and usable by others.</p><p><strong>Golang</strong></p><p>Supports all the things and easy to package and build from an ARM Chromebook.</p><p><strong>Make</strong></p><p>Oldie but a goodie.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=76821eabe383" width="1" height="1" alt=""><hr><p><a href="https://medium.com/code-securing-code/aws-sts-for-the-people-76821eabe383">AWS STS for the People</a> was originally published in <a href="https://medium.com/code-securing-code">Code Securing Code</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>