How to Enforce Safer Security Defaults Across AWS Accounts

Summary
The article provides AWS hardening guidance, including SCPs and configuration steps to restrict public exposure, disable risky features, enforce IMDSv2 and EBS encryption, and limit network and administrative access.
Key points
- Review CloudTrail logs and Access Advisor data before deploying restrictive SCPs; exceptions may be needed to avoid disrupting workloads.
- Enable S3 Public Access Block and prevent changes that could remove the protection; disable public sharing of Systems Manager documents.
- Block public AMI access and require IAM authentication for Lambda function URLs.
- Restrict external AWS Resource Access Manager sharing and disable S3 ACLs where bucket-owner-enforced ownership is appropriate.
- Prevent creation of IAM users and access keys; require IMDSv2 for EC2 instances.
- Use SCPs to restrict internet-facing network changes, keep default EBS encryption enabled, and limit admin-role access by source IP.
Article Details
- Defense Focus
- Establish secure AWS defaults and use Service Control Policies (SCPs) to prevent risky configurations and changes to security guardrails.
- Detection Methods
- Review CloudTrail logs before deploying restrictions to identify functionality currently in use.
- Use AWS Access Advisor data to check service usage across the organization and identify where exceptions may be needed.
- Data Sources
- CloudTrail logs
- AWS Access Advisor data
- Rule Types
- AWS Service Control Policies (SCPs)
- Platforms
- AWS
- Defensive Actions
- Enable S3 Block Public Access for existing non-public buckets and at the account level where appropriate; deny changes to these settings with an SCP.
- Prevent EC2 AMI public-access protection from being disabled.
- Disable public sharing of Systems Manager documents in each region and deny changes to that setting.
- Require AWS IAM authentication for Lambda function URLs.
- Use SCPs to prevent resource sharing with external accounts where required.
- Disable S3 ACLs by enforcing Bucket owner enforced ownership controls, and deny changes to those controls.
- Use IAM roles instead of IAM users; prevent creation of IAM users, login profiles, and access keys.
- Require IMDSv2 for EC2 instances and prevent changes that weaken instance metadata protections.
- Restrict network modifications that could create paths to the Internet outside the designated network account.
- Enable EBS encryption by default in every region and prevent the setting from being disabled.
- Restrict production administrator access with network controls, such as an IP-address condition.
- Review existing usage before deploying SCPs, create necessary principal or account exceptions, and combine policies as needed to stay within AWS SCP limits.
Products
AWSThere are no features of AWS that are bad to use, but there are some features that may increase the risk of a security incident. One example is the use of IAM User access keys, which we discussed the risks of and showedAWS Lambda Prevent Lambda URLs from being public AWS Resource Access ManagerAWS Resource Access Manager (RAM) allows you to share resources such as VPCs with other AWS accounts. These can even be shared with accounts outside of your AWS Organization, and external accounts can also shareAWS Systems ManagerAWS Systems Manager can be used to send commands to one or more EC2s. This is done by sending documents to them. These documents can be shared with other accounts or even made public. It is possible these could containEBS Enforce EBS encryption EC2EC2 instances are created from Amazon Machine Images (AMIs). Operating system vendors provide these publicly and customers can create their own. Unless you are an operating system vendor, you likely do not want to makeIAMbut there are some features that may increase the risk of a security incident. One example is the use of IAM User access keys, which we discussed the risks of and showed how to avoid in a blog series titled How toS3Prevent S3 buckets from being made public