For some value of n. . .
Related discussions:
For some value of n. . .
Related discussions:
I guess the first would be stuffing your private stuff into a VPC and not giving certain back end things direct public access.
The most impact comes from limiting your public footprint. The fewer attack vectors the better.
These are some basic tips to that end. They won’t entirely apply to complex infrastructures.
Excellent tips, thank you!
Have you ever used the EC2 Systems Manager? If so, would you recommend that over regular SSH?
We’re tinkering it with it, but most of our systems automation is via chef. Our use of EC2 predates systems manager by many years.
How do you disable access to regions? I have set up cloud trail to audit all regions, and config to alert me if cloudtrail is disabled, but I don’t see a way to disable a region. Conditional policies only seem to work for some services.
There are also side benefits of tucking in behind cloudfront. That means they are doing a bunch of blocking of malformed requests and suspicious actors out on the Edge locations.
Nice. . . did not know that, thank you.
One of my SysOps did it for us. I think it might be at the IAM level but I’m not sure.
I am policies. Basically deny all actions to any resource where region isn’t the one you want.
The other infrastructure-centric points are already addressed, but there’s others that matter just as much if not more for me.
Excellent, thanks!
Use IAM profiles and roles to avoid using API keys
Would you say that IAM roles can be used instead of API keys 100% of the time? I’m guessing the answer is yes or close to 100%.
It’s tough to sum it up in a “top” set of steps because that list will vary depending on the services you use. There are numerous best practices to follow, however. I would rank them:
Account security. Disable the root account. Use IAM users only. Limit their permissions using specific policies instead of “.”. Enable MFA for all users. Do not use hard coded credentials (access keys) in any applications. Use IAM roles instead.
Auditing. Turn on CloudTrail (in every region, even the ones you don’t use). Turn on CloudTrail log validation and encryption so you can see if someone’s tampered with the logs. Make sure the S3 bucket they’re being sent to has the proper permissions and has “MFA delete” enabled so someone can’t delete the logs without that extra step. Integrate your CloudTrail logs with CloudWatch and setup alerts for specific actions. Turn on VPC Flow logs. Turn on ConfigService.
Encryption/Backup. Use EBS volume encryption, S3 encryption at rest, KMS key rotation, RDS encryption, EMR encryption, RedShift encryption. Setup proper backups for those services and ensure they are active and tested.
Networking. Don’t allow “0.0.0.0/0” access for security groups for anything other than web traffic (unless you expect public access for another service). Use a private/public architecture for VPCs. Don’t launch EC2 instances in EC2 classic. Don’t put instances in the public tier, put them behind an ELB instead. Use the latest ELB SSL/TLS policies.
There are lots more, but these cover the core services. Shameless plug/full disclosure: I’m the founder of CloudSploit, a service that I wrote to continually check that these best practices are enabled and properly setup within your AWS accounts.
This CIS AWS Benchmark has a list of controls as well as prescriptive guidance on how to secure your AWS account. Tony de la Fuente from Alfresco has a tool on Github to automate all of the checks here.
All our developers are using STS credentials from their IAM role for any API access, unless whatever they’re doing doesn’t support STS credentials which we have seen. Static keys are really only for service accounts that can’t use an IAM instance profile.
Can you elaborate on this? Would things not running on AWS be, say something like, internal jenkins servers that deploy AWS infrastructure / on to infrastructure? I’m trying to understand how one could perform this kind of automation without static API keys.
E: looks like I should probably investigate STS.
Use a bastion server if you can. If not at least only open SSH on one of your machines and ssh to your others from there.
Better yet, use ProxyCommand to use the bastion or jumper as a tunnel. This limits needing to store the EC2 keypairs on your bastion, and doesnt use ssh-agent forwarding which can be monitored by users on the bastion (say, in the event of compromise).
Ensure theres some form of attestation and non-repudiation; logging / auditing and backups thereof.
Scout2 and/or Security Monkey would be something in the same vein.
Fairly easy to use tools for security auditing.
Interesting, could you describe what a typical use case is and how it works? I.e. i that just for developers running commands/tools on their local machines?