View a markdown version of this page

ACCT.17 Restrict AWS API calls to used Regions only - AWS Prescriptive Guidance

ACCT.17 Restrict AWS API calls to used Regions only

Create an IAM policy that denies API calls in AWS Regions you do not use. This helps prevent threat actors from creating resources, such as compute instances for cryptocurrency mining, in Regions where you have no monitoring or visibility. This control extends ACCT.09 Delete unused VPCs, subnets, and security groups by restricting all resource creation in unused Regions, not only VPC-related resources.

Use the aws:RequestedRegion condition key in a deny policy. The policy must exclude global services such as AWS Identity and Access Management (IAM), AWS Security Token Service (AWS STS), Amazon CloudFront, and Amazon Route 53 because these services do not operate in a specific Region. Use NotAction to list the global services that are excluded from the Region restriction.

To restrict API calls to specific Regions

Create an IAM policy using the following template. Replace the Regions in the aws:RequestedRegion condition with the Regions you use:

{ "Version": "2012-10-17", "Statement": [ { "Sid": "DenyAllOutsideAllowedRegions", "Effect": "Deny", "NotAction": [ "iam:*", "sts:*", "cloudfront:*", "route53:*", "route53domains:*", "support:*", "trustedadvisor:*", "health:*", "organizations:*", "budgets:*", "ce:*", "cur:*", "aws-portal:*", "pricing:*", "waf:*", "wafv2:*", "shield:*", "globalaccelerator:*", "networkmanager:*" ], "Resource": "*", "Condition": { "StringNotEquals": { "aws:RequestedRegion": [ "us-east-1", "us-west-2" ] } } } ] }

Attach the policy to each IAM role and IAM user in your account, or attach it as a permissions boundary. For more information about permissions boundaries, see Permissions boundaries for IAM entities in the IAM documentation.

For more information about the aws:RequestedRegion condition key, see AWS global condition context keys in the IAM documentation. For a complete example, see AWS: Denies access to AWS based on the requested Region in the IAM documentation.

Note

There is no additional charge for IAM policies. If you later adopt AWS Organizations, you can implement this same restriction as a service control policy (SCP) for centralized enforcement across accounts.