Skip to content

Commit 3ec2d9d

Browse files
authored
Adding data perimeter service-specific guidance
2 parents 6e64238 + bcd89b6 commit 3ec2d9d

36 files changed

Lines changed: 3651 additions & 104 deletions

README.md

Lines changed: 62 additions & 20 deletions
Large diffs are not rendered by default.
169 KB
Loading

resource_control_policies/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ RCPs are a type of [AWS Organizations](https://aws.amazon.com/organizations/) or
1818

1919
This folder contains examples of RCPs that help enforce identity and network perimeter controls on [services supported by RCPs](https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_rcps.html#rcp-supported-services). This folder also includes policy examples you can implement as [resource-based policies](resource_based_policies) for select services that are not supported by RCPs.
2020

21-
These examples do not represent a complete list of valid data access patterns, and they are intended for you to tailor and extend them to suit the needs of your environment. See [Tagging conventions](https://github.com/aws-samples/data-perimeter-policy-examples/tree/main?tab=readme-ov-file#tagging-conventions) used in the policy examples to control the scope of data perimeter guardrails. You can also use the `NotResource` IAM policy element to exclude specific resources from the controls.
21+
These examples do not represent a complete list of valid data access patterns, and they are intended for you to tailor and extend them to suit the needs of your environment. See [Tagging conventions](https://github.com/aws-samples/data-perimeter-policy-examples/tree/main?tab=readme-ov-file#tagging-conventions-and-governance) used in the policy examples to control the scope of data perimeter guardrails. You can also use the `NotResource` IAM policy element to exclude specific resources from the controls.
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.

service_control_policies/README.md

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,6 @@ Example data access patterns:
149149
* [AWS Directory Service directory](https://docs.aws.amazon.com/directoryservice/latest/admin-guide/ms_ad_directory_sharing.html): You can share a directory with other accounts with the `ShareDirectory` API.
150150
* [AWS Direct Connect gateway](https://docs.aws.amazon.com/directconnect/latest/UserGuide/multi-account-associate-vgw.html): You can associate a Direct Connect gateway with a virtual private gateway that is owned by another AWS account with the `CreateDirectConnectGatewayAssociationProposal` API.
151151
* [Amazon Detective graph](https://docs.aws.amazon.com/detective/latest/userguide/accounts.html): A Detective administrator account can invite other accounts to join a behavior graph with the `CreateMembers` API.
152-
* [Amazon CloudWatch Logs subscription filters](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/SubscriptionFilters.html): You can send CloudWatch Logs to cross-account destinations with the `PutSubscriptionFilter` API.
153152
* [AWS Glue Data Catalog](https://docs.aws.amazon.com/lake-formation/latest/dg/granting-catalog-perms-TBAC.html) databases: You can grant data catalog permissions to another account by using the AWS Lake Formation tag-based access control method with the `GrantPermissions` and `BatchGrantPermissions` APIs.
154153
* [Amazon AppStream 2.0 image](https://docs.aws.amazon.com/appstream2/latest/developerguide/administer-images.html#share-image-with-another-account): You can share an Amazon AppStream 2.0 image that you own with other accounts with the `UpdateImagePermissions` API.
155154
* [Amazon Macie member accounts](https://docs.aws.amazon.com/macie/latest/user/accounts-mgmt-invitations-administer.html): You can add member accounts to your Macie administrator account with the `CreateInvitations` API.
@@ -160,16 +159,21 @@ Example data access patterns:
160159
* [Amazon WorkSpaces image](https://docs.aws.amazon.com/workspaces/latest/adminguide/share-custom-image.html): You can share custom WorkSpaces images with other accounts with the `UpdateWorkspaceImagePermission` API.
161160
* [Amazon CloudWatch sink](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-Unified-Cross-Account.html): You can share observability data with other accounts with the `CreateLink` API.
162161
* [AWS Service Catalog portfolio](https://docs.aws.amazon.com/servicecatalog/latest/adminguide/catalogs_portfolios_sharing.html): AWS Service Catalog portfolios can be shared with other AWS accounts with the `CreatePortfolioShare` API.
163-
* [AWS Config aggregator](https://docs.aws.amazon.com/config/latest/developerguide/aggregate-data.html): The `PutConfigurationAggregator` API allows you to select another account to add to your AWS Config aggregator.
162+
* [AWS Config aggregator](https://docs.aws.amazon.com/config/latest/developerguide/aggregate-data.html): The `PutConfigurationAggregator` API allows you to select another account to add to your AWS Config aggregator. Additionally, the `PutAggregationAuthorization` API allows you to authorize another account to collect data from your account.
164163
* [AWS Fault Injection experiment template](https://docs.aws.amazon.com/fis/latest/userguide/multi-account.html): You create a multi-account experiment template by specifying other accounts with the `CreateTargetAccountConfiguration` API.
165164
* [AWS Global Accelerator attachment](https://docs.aws.amazon.com/global-accelerator/latest/dg/cross-account-resources.create-attachment.html): You can add a resource from another account as an endpoint for an accelerator with the `CreateCrossAccountAttachment` API.
166165
* [AWS Cloud9 shared environment](https://docs.aws.amazon.com/cloud9/latest/user-guide/share-environment.html): You can share AWS Cloud9 development environment with users from other accounts with the `CreateEnvironmentMembership` API.
167166
* [Amazon Connect dataset](https://docs.aws.amazon.com/connect/latest/APIReference/API_BatchAssociateAnalyticsDataSet.html#connect-BatchAssociateAnalyticsDataSet-request-DataSetIds): You can associate a list of Amazon Connect instance analytics datasets to a target account using `BatchAssociateAnalyticsDataSet` API.
168167
* [Amazon Redshift Serverless snapshot](https://docs.aws.amazon.com/redshift-serverless/latest/APIReference/API_PutResourcePolicy.html): You can share snapshots across AWS accounts using `PutResourcePolicy` API.
169168

169+
### "Sid": “RestrictKMSGrantsCreationToAWSServices”
170+
This statement is included in the [data_perimeter_governance_scp](data_perimeter_governance_scp.json) and restricts creation of [AWS KMS grants](https://docs.aws.amazon.com/kms/latest/developerguide/grants.html) to administrators and AWS services only.
171+
172+
The `CreateGrant` API allows you to add a grant for another account to use your KMS key. Use this statement to help ensure that only trusted identities can view information about your keys.
173+
170174
### "Sid":"ProtectActionsNotSupportedByPrimaryDPControls"
171175

172-
This statement is included in [data_perimeter_governance_scp](data_perimeter_governance_scp.json) and restricts actions that are not supported by primary data perimeter controls, such as those listed in the[ResourceOrgID condition key page](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_condition-keys.html#condition-keys-resourceorgid).
176+
This statement is included in [data_perimeter_governance_scp](data_perimeter_governance_scp.json) and restricts actions that are not supported by primary data perimeter controls, such as those listed in the [ResourceOrgID condition key page](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_condition-keys.html#condition-keys-resourceorgid).
173177

174178
Example data access patterns:
175179

@@ -191,16 +195,6 @@ You can also consider using service-specific condition keys such as `ec2:Accepte
191195

192196
This statement is included in the [data_perimeter_governance_scp](data_perimeter_governance_scp.json) and prevents the attaching, detaching, and modifying of tags used for authorization controls within the data perimeter.
193197

194-
### "Sid":"PreventS3PublicAccessBlockConfigurations"
195-
196-
This statement is included in the [data_perimeter_governance_scp](data_perimeter_governance_scp.json) and prevents users from altering S3 Block Public Access configurations.
197-
198-
[S3 Block Public Access](https://docs.aws.amazon.com/AmazonS3/latest/userguide/access-control-block-public-access.html) provides settings for access points, buckets, and accounts to help you manage public access to Amazon S3 resources. With S3 Block Public Access, account administrators and bucket owners can set up centralized controls to limit public access to their Amazon S3 resources that are enforced, regardless of how the resources are created.
199-
200-
### "Sid":"PreventPublicBucketACL"
201-
202-
This statement is included in the [data_perimeter_governance_scp](data_perimeter_governance_scp.json) and prevents users from applying public read and public read-write canned access control lists to Amazon S3 buckets.
203-
204198
### "Sid":"PreventLambdaFunctionURLAuthNone"
205199

206200
This statement is included in the [data_perimeter_governance_scp](data_perimeter_governance_scp.json) and denies the creation of Lambda functions that have `lambda:FunctionUrlAuthType` set to `NONE`.

service_control_policies/data_perimeter_governance_scp.json

Lines changed: 22 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@
3737
"ds:ShareDirectory",
3838
"directconnect:CreateDirectConnectGatewayAssociationProposal",
3939
"detective:CreateMembers",
40-
"logs:PutSubscriptionFilter",
4140
"lakeformation:GrantPermissions",
4241
"lakeformation:BatchGrantPermissions",
4342
"appstream:UpdateImagePermissions",
@@ -51,6 +50,7 @@
5150
"oam:CreateLink",
5251
"servicecatalog:CreatePortfolioShare",
5352
"config:PutConfigurationAggregator",
53+
"config:PutAggregationAuthorization",
5454
"fis:CreateTargetAccountConfiguration",
5555
"globalaccelerator:CreateCrossAccountAttachment",
5656
"cloud9:CreateEnvironmentMembership",
@@ -64,6 +64,21 @@
6464
}
6565
}
6666
},
67+
{
68+
"Sid": "RestrictKMSGrantsCreationToAWSServices",
69+
"Effect": "Deny",
70+
"Action": "kms:CreateGrant",
71+
"Resource": "*",
72+
"Condition": {
73+
"BoolIfExists": {
74+
"kms:GrantIsForAWSResource": "false",
75+
"aws:PrincipalIsAWSService": "false"
76+
},
77+
"StringNotEqualsIfExists": {
78+
"aws:PrincipalTag/dp:exclude:identity": "true"
79+
}
80+
}
81+
},
6782
{
6883
"Sid": "ProtectActionsNotSupportedByPrimaryDPControls",
6984
"Effect": "Deny",
@@ -100,51 +115,20 @@
100115
}
101116
},
102117
{
103-
"Sid": "PreventPublicBucketACL",
118+
"Sid": "PreventLambdaFunctionURLAuthNone",
104119
"Effect": "Deny",
105120
"Action": [
106-
"s3:PutBucketAcl",
107-
"s3:CreateBucket"
108-
],
109-
"Resource": "*",
110-
"Condition": {
111-
"StringEquals": {
112-
"s3:x-amz-acl": [
113-
"public-read",
114-
"public-read-write"
115-
]
116-
},
117-
"StringNotEqualsIfExists": {
118-
"aws:PrincipalTag/dp:exclude:identity": "true"
119-
}
120-
}
121-
},
122-
{
123-
"Sid": "PreventS3PublicAccessBlockConfigurations",
124-
"Effect": "Deny",
125-
"Action": "s3:PutAccountPublicAccessBlock",
126-
"Resource": "*",
127-
"Condition": {
128-
"StringNotEqualsIfExists": {
129-
"aws:PrincipalTag/dp:exclude:identity": "true"
130-
}
131-
}
132-
},
133-
{
134-
"Sid":"PreventLambdaFunctionURLAuthNone",
135-
"Effect":"Deny",
136-
"Action":[
137121
"lambda:AddPermission",
138122
"lambda:UpdateFunctionUrlConfig",
139123
"lambda:CreateFunctionUrlConfig"
140124
],
141-
"Resource":"*",
142-
"Condition":{
143-
"StringNotEqualsIfExists":{
125+
"Resource": "*",
126+
"Condition": {
127+
"StringNotEqualsIfExists": {
144128
"aws:PrincipalTag/dp:exclude:identity": "true"
145129
},
146130
"StringEquals": {
147-
"lambda:FunctionUrlAuthType" : "NONE"
131+
"lambda:FunctionUrlAuthType": "NONE"
148132
}
149133
}
150134
},
@@ -166,4 +150,4 @@
166150
}
167151
}
168152
]
169-
}
153+
}

0 commit comments

Comments
 (0)