How to Reduce the Risk of AWS Access Keys with Least-Privilege IAM

· Original article ↗

Summary

Wiz outlines ways to reduce AWS access-key risk: identify high-impact keys, remove unnecessary IAM permissions, add policy restrictions, proxy sensitive access, and isolate key-dependent functionality.

Key points

  • Prioritize keys with broad privileges or access to sensitive accounts and data.
  • Use IAM Access Advisor to identify unnecessary service-level permissions and Access Analyzer policy generation to help determine required actions; recommendations depend on CloudTrail data.
  • Review permissions that enable privilege escalation or resource discovery, such as some iam or sts privileges and s3:ListAllMyBuckets.
  • Restrict access to specific resources where feasible, using CloudTrail logs or application source code to guide review.
  • Consider policy conditions such as aws:SourceIp, while accounting for possible IP changes; VPC endpoints may be preferable in some network setups.
  • Proxy sensitive operations or isolate access-key-dependent tasks in a narrowly privileged service to add controls and limit exposure.

Article Details

Defense Focus
Reduce the risk of compromised AWS access keys and other identity principals through least-privilege IAM policies, access restrictions, and isolation of sensitive operations.
Detection Methods
  • Identify high-risk keys by reviewing attached privileges, sensitive account context, and access to sensitive data.
  • Use IAM Access Advisor information to identify service-level permissions that may be unnecessary.
  • Use Access Analyzer policy generator to review required action-level permissions, recognizing that its suggestions depend on CloudTrail records and may miss cases.
  • Review CloudTrail logs or application source code to determine which individual resources a principal needs to access.
Data Sources
  • IAM policy and principal configuration
  • IAM Access Advisor information
  • Access Analyzer policy-generator findings
  • CloudTrail logs
  • Application source code
  • Account sensitivity and sensitive-data access context
Platforms
  • AWS
Defensive Actions
  • Remove unnecessary permissions and scope policies from broad administrative access to required services, actions, and resources.
  • Review IAM and STS permissions for potential privilege-escalation capability, and remove resource-listing permissions such as s3:ListAllMyBuckets when they are not needed.
  • Apply an aws:SourceIp policy condition where the source address is stable; consider VPC endpoints when appropriate to the network setup.
  • Proxy sensitive data access through a service that can enforce rate limits, geo-IP restrictions, and data redaction or tokenization; consider S3 Object Lambdas where suitable.
  • Isolate access-key-dependent functionality, such as generating long-lived S3 pre-signed URLs, in a dedicated microservice with limited privileges.

Products

Related Articles