|
4 | 4 | { |
5 | 5 | "Sid":"EnforceResourcePerimeterAWSResources", |
6 | 6 | "Effect":"Deny", |
7 | | - "NotAction":[ |
8 | | - "iam:GetPolicy", |
9 | | - "iam:GetPolicyVersion", |
10 | | - "iam:ListEntitiesForPolicy", |
11 | | - "iam:ListPolicyVersions", |
12 | | - "iam:GenerateServiceLastAccessedDetails", |
13 | | - "cloudformation:CreateChangeSet", |
14 | | - "s3:GetObject", |
15 | | - "s3:GetObjectVersion", |
16 | | - "s3:PutObject", |
17 | | - "s3:PutObjectAcl", |
18 | | - "s3:ListBucket", |
19 | | - "ssm:Describe*", |
20 | | - "ssm:List*", |
21 | | - "ssm:Get*", |
22 | | - "ssm:SendCommand", |
23 | | - "ssm:CreateAssociation", |
24 | | - "ssm:StartSession", |
25 | | - "ssm:StartChangeRequestExecution", |
26 | | - "ssm:StartAutomationExecution", |
27 | | - "imagebuilder:GetComponent", |
28 | | - "imagebuilder:GetImage", |
29 | | - "ecr:GetDownloadUrlForLayer", |
30 | | - "ecr:BatchGetImage", |
31 | | - "lambda:GetLayerVersion", |
32 | | - "ec2:CreateTags", |
33 | | - "ec2:DeleteTags", |
34 | | - "ec2:GetManagedPrefixListEntries", |
35 | | - "<action>" |
36 | | - |
| 7 | + "Action":"*", |
| 8 | + "NotResource": [ |
| 9 | + "arn:aws:iam::aws:policy/*", |
| 10 | + "arn:aws:ssm:*::document/*", |
| 11 | + "arn:aws:ssm:*::parameter/*", |
| 12 | + "arn:aws:ssm:*::automation-definition/*", |
| 13 | + "arn:aws:imagebuilder:*:aws:component/*", |
| 14 | + "arn:aws:imagebuilder:*:aws:image/*", |
| 15 | + "arn:aws:ec2:*::image/*", |
| 16 | + "arn:aws:ec2:*:aws:prefix-list/*", |
| 17 | + "arn:aws:lambda:*:<service-account-id>:layer:*", |
| 18 | + "arn:aws:ecr:*:<service-account-id>:repository/*", |
| 19 | + "arn:aws:s3:::aws-glue-studio-transforms-<service-account-id>-prod-<region>/*", |
| 20 | + "arn:aws:s3:::elasticbeanstalk-samples-<region>/*", |
| 21 | + "arn:aws:s3:::elasticbeanstalk-platform-assets-<region>/*", |
| 22 | + "arn:aws:s3:::elasticbeanstalk-env-resources-<region>/*", |
| 23 | + "arn:aws:s3:::elasticbeanstalk-<region>/*", |
| 24 | + "arn:aws:s3:::jumpstart-cache-prod-<region>/*", |
| 25 | + "arn:aws:s3:::jumpstart-cache-prod-<region>", |
| 26 | + "arn:aws:cloudformation:*:aws:transform/*", |
| 27 | + "arn:aws:s3:::aws-synthetics-library-<unique-identifier>/*", |
| 28 | + "arn:aws:s3:::<unique-identifier>aws-data-exchange<unique-identifier>", |
| 29 | + "arn:aws:s3:::sc-<product-identifier>-<region>/*", |
| 30 | + "arn:aws:s3:::aws-neptune-notebook", |
| 31 | + "arn:aws:s3:::aws-neptune-notebook/*", |
| 32 | + "arn:aws:s3:::aws-neptune-notebook-<region>", |
| 33 | + "arn:aws:s3:::aws-neptune-notebook-<region>/*", |
| 34 | + "<third-party-resource>" |
37 | 35 | ], |
38 | | - "Resource":"*", |
39 | 36 | "Condition":{ |
40 | 37 | "StringNotEqualsIfExists":{ |
41 | 38 | "aws:ResourceOrgID":"<my-org-id>", |
42 | | - "ec2:Owner":"amazon", |
43 | 39 | "aws:PrincipalTag/dp:exclude:resource": "true" |
44 | 40 | } |
45 | 41 | } |
46 | 42 | }, |
47 | 43 | { |
48 | 44 | "Sid":"EnforceResourcePerimeterAWSResourcesS3", |
49 | 45 | "Effect":"Deny", |
50 | | - "Action":[ |
51 | | - "s3:GetObject", |
52 | | - "s3:GetObjectVersion", |
53 | | - "s3:PutObject", |
54 | | - "s3:PutObjectAcl", |
55 | | - "s3:ListBucket" |
| 46 | + "Action":"*", |
| 47 | + "Resource":[ |
| 48 | + "arn:aws:s3:::<unique-identifier>aws-data-exchange<unique-identifier>", |
| 49 | + "arn:aws:s3:::sc-<product-identifier>-<region>/*" |
56 | 50 | ], |
57 | | - "Resource":"*", |
58 | 51 | "Condition":{ |
59 | 52 | "StringNotEqualsIfExists":{ |
60 | 53 | "aws:ResourceOrgID":"<my-org-id>", |
61 | | - "aws:ResourceAccount": "<glue-account-id>", |
62 | | - "aws:PrincipalTag/dp:exclude:resource": "true", |
63 | | - "aws:PrincipalTag/dp:exclude:resource:s3": "true" |
| 54 | + "aws:PrincipalTag/dp:exclude:resource": "true" |
64 | 55 | }, |
65 | 56 | "ForAllValues:StringNotEquals":{ |
66 | 57 | "aws:CalledVia":[ |
|
70 | 61 | } |
71 | 62 | } |
72 | 63 | }, |
73 | | - { |
74 | | - "Sid": "EnforceResourcePerimeterAWSResourcesSSM", |
75 | | - "Effect": "Deny", |
76 | | - "Action": [ |
77 | | - "ssm:SendCommand", |
78 | | - "ssm:CreateAssociation", |
79 | | - "ssm:StartSession", |
80 | | - "ssm:Get*", |
81 | | - "ssm:StartChangeRequestExecution", |
82 | | - "ssm:StartAutomationExecution" |
83 | | - ], |
84 | | - "Resource": "*", |
85 | | - "Condition": { |
86 | | - "StringNotEqualsIfExists": { |
87 | | - "aws:ResourceOrgID": "<my-org-id>", |
88 | | - "aws:PrincipalTag/dp:exclude:resource:ssm": "true", |
89 | | - "aws:PrincipalTag/dp:exclude:resource": "true" |
90 | | - } |
91 | | - } |
92 | | - }, |
93 | | - { |
94 | | - "Sid": "EnforceResourcePerimeterAWSResourcesEC2ImageBuilder", |
95 | | - "Effect": "Deny", |
96 | | - "Action": [ |
97 | | - "imagebuilder:GetComponent", |
98 | | - "imagebuilder:GetImage" |
99 | | - ], |
100 | | - "Resource": "*", |
101 | | - "Condition": { |
102 | | - "StringNotEqualsIfExists": { |
103 | | - "aws:ResourceOrgID": "<my-org-id>", |
104 | | - "aws:PrincipalTag/dp:exclude:resource:imagebuilder": "true", |
105 | | - "aws:PrincipalTag/dp:exclude:resource": "true" |
106 | | - } |
107 | | - } |
108 | | - }, |
109 | | - { |
110 | | - "Sid": "EnforceResourcePerimeterAWSResourcesECR", |
111 | | - "Effect": "Deny", |
112 | | - "Action": [ |
113 | | - "ecr:GetDownloadUrlForLayer", |
114 | | - "ecr:BatchGetImage" |
115 | | - ], |
116 | | - "Resource": "*", |
117 | | - "Condition": { |
118 | | - "StringNotEqualsIfExists": { |
119 | | - "aws:ResourceAccount": "<ecr-account-id>", |
120 | | - "aws:ResourceOrgID": "<my-org-id>", |
121 | | - "aws:PrincipalTag/dp:exclude:resource": "true" |
122 | | - } |
123 | | - } |
124 | | - }, |
125 | | - { |
126 | | - "Sid": "EnforceResourcePerimeterAWSResourcesLambdaLayer", |
127 | | - "Effect": "Deny", |
128 | | - "Action": [ |
129 | | - "lambda:GetLayerVersion" |
130 | | - ], |
131 | | - "Resource": "*", |
132 | | - "Condition": { |
133 | | - "StringNotEqualsIfExists": { |
134 | | - "aws:ResourceAccount": "<lambdalayer-account-id>", |
135 | | - "aws:ResourceOrgID": "<my-org-id>", |
136 | | - "aws:PrincipalTag/dp:exclude:resource": "true" |
137 | | - } |
138 | | - } |
139 | | - }, |
140 | | - { |
141 | | - "Sid": "EnforceResourcePerimeterAWSResourcesEC2PrefixList", |
142 | | - "Effect": "Deny", |
143 | | - "Action": [ |
144 | | - "ec2:CreateTags", |
145 | | - "ec2:DeleteTags", |
146 | | - "ec2:GetManagedPrefixListEntries" |
147 | | - ], |
148 | | - "Resource": "*", |
149 | | - "Condition": { |
150 | | - "StringNotEqualsIfExists": { |
151 | | - "aws:ResourceOrgID": "<my-org-id>", |
152 | | - "aws:PrincipalTag/dp:exclude:resource:ec2": "true", |
153 | | - "aws:PrincipalTag/dp:exclude:resource": "true" |
154 | | - } |
155 | | - } |
156 | | - }, |
157 | 64 | { |
158 | 65 | "Sid":"EnforceResourcePerimeterThirdPartyResources", |
159 | 66 | "Effect":"Deny", |
160 | | - "Action":"<action>", |
161 | | - "Resource":"*", |
| 67 | + "Action":"*", |
| 68 | + "Resource":[ |
| 69 | + "<third-party-resource>" |
| 70 | + ], |
162 | 71 | "Condition":{ |
163 | 72 | "StringNotEqualsIfExists":{ |
164 | | - "aws:ResourceOrgID":"<my-org-id>", |
165 | 73 | "aws:PrincipalTag/dp:exclude:resource": "true", |
166 | 74 | "aws:ResourceAccount": [ |
167 | 75 | "<third-party-account-a>", |
|
0 commit comments