Authenticating to AWS the right way

Authenticating to AWS the right way

Hackers hate these 11 simple steps :scream::scream:.

11 secrets hackers don’t want you to know :face_with_crossed_out_eyes:. Number 7 will blow your mind :collision::exploding_head:

  1. Never use the root access keys, remove those and create restricted users as soon as you can. Protect the root account with MFA immediately.
  2. Disable all the regions that you don’t need to use.
  3. Do NOT use permanent programmatic access keys. Force rotation with the shortest period.
  4. Use AWS SSO with federated identity to your company identity provider.
  5. Set billing alerts
  6. Restrict the instance sizes and types that can be used by the accounts.
  7. Always use STS to get short lived access tokens.
  8. Always have MFA, use ā€œsaml2awsā€ or something similar.
  9. Restrict all the expensive services that your account doesn’t need, like machine learning services if you just use basic workloads.
  10. Use access analyzer to make sure you have least privilege properly setup.
  11. Never use credentials inside a repository, even if it is local.

Did you read the article?

Probably not because he is familiar enough with how to do it and is summarizing it for everyone.

I want to add don’t expose instances or services that can be used to expose sts keys using ssrf

I want to add ā€˜Authenticate to AWS as an EC2 Instance’, if you are doing this lock down your damn ec2 otherwise it’s just exposed and ripe for pickings…

this was a fine article but the swearing added nothing tbh, and this is coming from someone who loves swearing

And turn on IMDSv2

Your name confirms it

Thank you kind sir, that looks like a fine article for noobs like myself

This is awesome

I love it

Can you recommend an SCP policy to prevent expensive ML and expensive services? Just for a personal account or would you go through and add services you need?

Appreciate the feedback! Acknowledge it’s not for everyone, but I enjoy writing this way because it feels less corporate

This is 100% perspective on the AWS side. On the developer machine side, always use short-lived credentials.

Rotate them regularly with the provided authorization method given for each account!

P.S. use a tool to help you generate short-lived credentials only

Looks like a very useful tool and what I was looking for some time ago, thanks! Neat background on the company too. Getting others onboard with using STS can be a pain. Do you all use this with non developers as well (giving someone access to a resource via a role)? For example, if I wanted to allow someone to start and stop an EC2 instance via a role in another account, would this help with that? Same example with an S3 bucket.

What I don’t get is how are all those people got hacked. Did they have such an awful password? Some read like Ā“I got hacked and my bill is bigger than yoursĖ‹

Yes, mainly because it is both a Desktop App and a CLI, and you can access Web Console and programmatic access via STS.

Also, the project just introduced the concept of the plugin; with that, you can now access an EC2 instance with system manager, but a plugin can do everything that is coded in it, so a simple plugin with access to an S3 bucket or start and stop an EC2 instance can be created easily through his template

Great, thanks for the info. I’m looking forward to trying it out. Keep up the good work with it!