Skip to content

Commit 47045a0

Browse files
committed
Updated the guidance to include aws:RequestedRegion along with aws:SourceVpc condition key
1 parent f8f53c5 commit 47045a0

19 files changed

Lines changed: 669 additions & 554 deletions

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,8 @@ To achieve data perimeter objectives, you will primarily use three policy types:
6666
|Identity perimeter | Only trusted identities are allowed from my network |Network |[default_endpoint_policy.json](vpc_endpoint_policies/default_endpoint_policy.json)|
6767
|Resource perimeter |My identities can access only trusted resources |Identity |[resource_perimeter_scp.json](service_control_policies/resource_perimeter_scp.json)|
6868
|Resource perimeter |Only trusted resources can be accessed from my network |Network |[default_endpoint_policy.json](vpc_endpoint_policies/default_endpoint_policy.json)|
69-
|Network perimeter |My identities can access resources only from expected networks |Identity |[network_perimeter_scp.json](service_control_policies/network_perimeter_scp.json)|
70-
|Network perimeter |My resources can only be accessed from expected networks |Resource |[network_perimeter_rcp.json](resource_control_policies/network_perimeter_rcp.json)|
69+
|Network perimeter |My identities can access resources only from expected networks |Identity |[network_perimeter_vpceorgid_scp.json](service_control_policies/network_perimeter_vpceorgid_scp.json), [network_perimeter_sourcevpc_scp.json](service_control_policies/network_perimeter_sourcevpc_scp.json)|
70+
|Network perimeter |My resources can only be accessed from expected networks |Resource |[network_perimeter_vpceorgid_rcp.json](resource_control_policies/network_perimeter_vpceorgid_rcp.json), [network_perimeter_sourcevpc_rcp.json](resource_control_policies/network_perimeter_sourcevpc_rcp.json)|
7171

7272
See README.md in the [service_control_policies](service_control_policies/README.md), [resource_control_policies](resource_control_policies/README.md), and [vpc_endpoint_policies](vpc_endpoint_policies/README.md) folders for information about the exact controls included in the data perimeter policies linked in the preceding table.
7373

resource_control_policies/README.md

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ These examples do not represent a complete list of valid data access patterns, a
2222

2323
Use the following RCP examples individually or in combination:
2424
* [identity_perimeter_rcp](identity_perimeter_rcp.json) – Enforces identity perimeter controls on resources within your Organizations organization.
25-
* [network_perimeter_rcp](network_perimeter_rcp.json) – Enforces network perimeter controls on resources within your Organizations organization.
25+
* [network_perimeter_vpceorgid_rcp](network_perimeter_vpceorgid_rcp.json), [network_perimeter_sourcevpc_rcp](network_perimeter_vpceorgid_rcp.json) – Enforces network perimeter controls on resources within your Organizations organization.
2626
* [data_perimeter_governance_rcp](data_perimeter_governance_rcp.json) – Includes controls for protecting data perimeter controls’ dependencies, such as session tags used to control their scope.
2727

2828
[service_specific_controls](service_specific_controls) subfolder contains policy examples you can implement as resource-based policies for select services that are not supported by RCPs and other service-specific controls.
@@ -91,18 +91,33 @@ Example data access patterns:
9191
* *AWS services using AWS KMS grants.* Some services that use AWS KMS grants to encrypt/decrypt your resources don’t support `aws:SourceOrgID` enforcement on their calls against your AWS KMS keys. However, AWS KMS grants used by services include the encryption context that restricts the use of the grant so that it is only on behalf of a resource it was originally created for. The `Null` condition operator with the `aws:SourceAccount` condition key accounts for these service integrations.
9292
* *Elastic Load Balancing (ELB) access logging*. In some AWS Regions, [Classic Load Balancers](https://docs.aws.amazon.com/elasticloadbalancing/latest/classic/enable-access-logs.html#attach-bucket-policy) and [Application Load Balancers](https://docs.aws.amazon.com/elasticloadbalancing/latest/application/load-balancer-access-logs.html#access-logging-bucket-permissions) use their service principals to publish logs to your Amazon S3 buckets but don’t populate the `aws:SourceOrgID` condition key. The `Null` condition operator with the `aws:SourceAccount` condition key accounts for this service integration. The name of the log file stored in your S3 bucket always contains the account ID of the account with the configured load balancer. When you grant access to your bucket for logging, you can scope it down to the specific path in your bucket that contains the account ID.
9393

94+
### "Sid":"EnforceNetworkPerimeterVpceOrgID"
9495

95-
### "Sid":"EnforceNetworkPerimeter"
96-
97-
This policy statement is included in the [network_perimeter_rcp](network_perimeter_rcp.json) and limits access to expected networks for IAM principals tagged with the `dp:include:network` tag set to `true` and federated users. Expected networks are defined as follows:
96+
This policy statement is included in the [network_perimeter_vpceorgid_rcp](network_perimeter_vpceorgid_rcp.json). This policy statement limits access to expected networks with the aws:VpceOrgID condition key for [supported services](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_condition-keys.html#condition-keys-vpceorgid) and for IAM principals tagged with the `dp:include:network` tag set to `true` and federated users. If all of the services you use are supported by aws:VpceOrgID, you can disregard the `"Sid":"EnforceNetworkPerimeterSourceVPC"` and `"Sid":"SourceVPCRegion"`. Expected networks are defined as follows:
9897

9998
* Your organization’s on-premises data centers and static egress points in AWS such as a NAT gateway that are specified by IP ranges (`<my-corporate-cidr>`) in the policy statement.
100-
* Your organization’s VPCs that are specified by VPC IDs (`<my-vpc>`) in the policy statement.
99+
* Your organization’s VPCs that are specified by the organization ID (`<my-org-id>`) in the policy statement.
100+
* Networks of AWS services that use your credentials to access resources using [forward access sessions (FAS)](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_forward_access_sessions.html) as denoted by `aws:ViaAWSService` in the policy statement. This access pattern applies when you access data via an AWS service, and that service takes subsequent actions on your behalf by using your IAM credentials.
101+
* Networks of AWS services that use [service principals](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_principal.html#principal-services) to access resources on your behalf are denoted by `aws:PrincipalIsAWSService` in the policy statement. Use the `"Sid": "EnforceConfusedDeputyProtection"` in the [identity_perimeter_rcp](../identity_perimeter_rcp.json) to further restrict AWS service actions so that they can only interact with your resources when performing operations on behalf of accounts that you own.
102+
* Networks of AWS services that use [service roles](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_terms-and-concepts.html) to access resources on your behalf as denoted by `arn:aws:iam::*:role/aws:ec2-infrastructure` in the policy statement.
103+
* Networks of trusted third parties are specified by their account IDs (`<third-party-account-a>` and `<third-party-account-b>`) in the policy statement.
104+
105+
### "Sid":"EnforceNetworkPerimeterSourceVPC"
106+
107+
This policy statement is included in the [network_perimeter_sourcevpc_rcp](network_perimeter_sourcevpc_rcp.json). Use the `aws:SourceVpc` with `aws:RequestedRegion` for services not supported by [aws:VpceOrgID](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_condition-keys.html#condition-keys-vpceorgid)`.
108+
109+
This policy statement limits access to expected networks for IAM principals tagged with the `dp:include:network` tag set to `true` and federated users. Expected networks are defined as follows:
110+
101111
* Networks of AWS services that use your credentials to access resources using [forward access sessions (FAS)]( https://docs.aws.amazon.com/IAM/latest/UserGuide/access_forward_access_sessions.html) as denoted by `aws:ViaAWSService` in the policy statement. This access pattern applies when you access data via an AWS service, and that service takes subsequent actions on your behalf by using your IAM credentials.
102112
* Networks of AWS services that use [service principals](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_principal.html#principal-services) to access resources on your behalf are denoted by `aws:PrincipalIsAWSService` in the policy statement. Use the `"Sid": "EnforceConfusedDeputyProtection"` in the [identity_perimeter_rcp](identity_perimeter_rcp.json) to further restrict AWS service actions so that they can only interact with your resources when performing operations on behalf of accounts that you own.
103113
* Networks of AWS services that use [service roles](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_terms-and-concepts.html) to access resources on your behalf as denoted by `arn:aws:iam::*:role/aws:ec2-infrastructure` in the policy statement.
104114
* Networks of trusted third parties are specified by their account IDs (`<third-party-account-a>` and `<third-party-account-b>`) in the policy statement.
105115

116+
### "Sid":"SourceVPCRegion"
117+
This policy statement is included in the [network_perimeter_sourcevpc_rcp](network_perimeter_sourcevpc_rcp.json) and limits access to expected networks for IAM principals tagged with the dp:include:network tag set to true and federated users. Expected networks are defined as follows:
118+
119+
* AWS VPC IDs are unique within a AWS Region, and same VPC ID can exist in different AWS Regions. [aws:RequestedRegion](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_condition-keys.html#condition-keys-requestedregion) is used with [aws:SourceVpc](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_condition-keys.html#condition-keys-sourcevpc) to limit access to expected networks with the `aws:SourceVpc` condition along with the region from which the request originates. Replace `<my-vpc-in-this-region>` with the VPC ID specified under `"Sid":"EnforceNetworkPerimeterSourceVPC"` and `<my-vpc-region>` with the VPC region.
120+
106121
Additional considerations:
107122

108123
* This policy statement exempts identities that are tagged with `dp:exclude:network` set to `true` from the network perimeter guardrail. Note that it is not recommended to have this exception in the policy unless it is accompanied by `"Sid": "EnforceOrgIdentities"`. This helps ensure that an account outside of your Organizations organization cannot tag their identities with `dp:exclude:network` to circumvent your network perimeter controls.

resource_control_policies/network_perimeter_rcp.json

Lines changed: 0 additions & 54 deletions
This file was deleted.
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
{
2+
"Version":"2012-10-17",
3+
"Statement":[
4+
{
5+
"Sid":"EnforceNetworkPerimeterSourceVPC",
6+
"Effect":"Deny",
7+
"Principal":"*",
8+
"Action":[
9+
"sqs:*",
10+
"secretsmanager:*",
11+
"sts:AssumeRole",
12+
"sts:DecodeAuthorizationMessage",
13+
"sts:GetAccessKeyInfo",
14+
"sts:GetFederationToken",
15+
"sts:GetServiceBearerToken",
16+
"sts:GetSessionToken",
17+
"sts:SetContext",
18+
"aoss:*",
19+
"ecr:*"
20+
],
21+
"Resource":"*",
22+
"Condition":{
23+
"NotIpAddressIfExists":{
24+
"aws:SourceIp":"<my-corporate-cidr>"
25+
},
26+
"StringNotEqualsIfExists":{
27+
"aws:SourceVpc":"<my-vpc>",
28+
"aws:PrincipalTag/dp:exclude:network":"true",
29+
"aws:PrincipalAccount":[
30+
"<load-balancing-account-id>",
31+
"<fin-space-account-id>",
32+
"<third-party-account-a>",
33+
"<third-party-account-b>"
34+
],
35+
"aws:ResourceTag/dp:exclude:network":"true"
36+
},
37+
"BoolIfExists":{
38+
"aws:PrincipalIsAWSService":"false",
39+
"aws:ViaAWSService":"false"
40+
},
41+
"ArnNotLikeIfExists":{
42+
"aws:PrincipalArn":[
43+
"arn:aws:iam::*:role/aws:ec2-infrastructure"
44+
]
45+
},
46+
"StringEquals":{
47+
"aws:PrincipalTag/dp:include:network":"true"
48+
}
49+
}
50+
},
51+
{
52+
"Sid":"SourceVPCRegion",
53+
"Effect":"Deny",
54+
"Action":"*",
55+
"Resource":"*",
56+
"Condition":{
57+
"StringEquals":{
58+
"aws:SourceVpc":"<my-vpc-in-this-region>"
59+
},
60+
"StringNotEqualsIfExists":{
61+
"aws:RequestedRegion":"<my-vpc-region>"
62+
}
63+
}
64+
},
65+
{
66+
"Sid":"SourceVPCRegion2",
67+
"Effect":"Deny",
68+
"Action":"*",
69+
"Resource":"*",
70+
"Condition":{
71+
"StringEquals":{
72+
"aws:SourceVpc":"<my-vpc-in-this-region>"
73+
},
74+
"StringNotEqualsIfExists":{
75+
"aws:RequestedRegion":"<my-vpc-region-2>"
76+
}
77+
}
78+
}
79+
]
80+
}

resource_control_policies/service_specific_controls/network_perimeter_vpceorgid_rcp.json renamed to resource_control_policies/network_perimeter_vpceorgid_rcp.json

File renamed without changes.

0 commit comments

Comments
 (0)