Skip to content

Commit 6aef504

Browse files
committed
Adding EC2 Image builder and Cloud9 service owned resources
1 parent 9871bba commit 6aef504

5 files changed

Lines changed: 25 additions & 9 deletions

File tree

service_control_policies/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ This policy statement is included in the [resource_perimeter_policy](resource_pe
4141
* `cloudformation:CreateChangeSet` - Required for using the [transforms hosted by AWS CloudFormation](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/transform-reference.html) in your CloudFormation templates.
4242
* `s3:GetObject`,`s3:GetObjectVersion`, `s3:PutObject`, `s3:PutObjectAcl`, `s3:ListBucket` - Required for importing and storing assets in Amazon S3 buckets, like Service Catalog CloudFormation templates, [AWS Data Exchange assets](https://docs.aws.amazon.com/data-exchange/latest/userguide/access-control.html#:~:text=Amazon%20S3%20permissions), [AWS Glue Studio transformations](https://docs.aws.amazon.com/glue/latest/dg/getting-started-min-privs-job.html#getting-started-min-privs-data), [AWS Elastic Beanstalk configuration files](https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/vpc-vpce.policy.html#AWSHowTo.S3.VPCendpoints.required-permissions.assets), [Amazon CloudWatch Synthetic monitoring canaries](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Synthetics_Canaries.html), [Amazon SageMaker JumpStart models](https://docs.aws.amazon.com/sagemaker/latest/dg/jumpstart-deploy.html#jumpstart-config-security).
4343
* `ssm:Describe*`, `ssm:List*`, `ssm:Get*`, `ssm:SendCommand`, `ssm:CreateAssociation`, `ssm:StartSession`, `ssm:StartChangeRequestExecution`, `ssm:StartAutomationExecution` - Required for [AWS Systems Manager](https://aws.amazon.com/systems-manager/) global parameters, documents and automation runbooks. Some AWS services publish information about common artifacts as Systems Manager public parameters. For example, Amazon EC2 publishes information about Amazon Machine Images (AMIs) as public parameters. AWS automation or custom applications may need to access Systems Manager public documents also to support their operations. The AWS Systems Manager automation runbooks, such as AWS-ConfigureMaintenanceWindows, may be needed to configure maintenance windows in AWS Systems Manager.
44-
* `imagebuilder:GetComponent` - Required for [EC2 Image Builder](https://aws.amazon.com/image-builder/) Amazon managed [AWSTOE components](https://docs.aws.amazon.com/imagebuilder/latest/userguide/manage-components.html).
44+
* `imagebuilder:GetComponent`,`imagebuilder:GetImage` - Required for [EC2 Image Builder](https://aws.amazon.com/image-builder/) [managed components and images](https://docs.aws.amazon.com/imagebuilder/latest/userguide/security_iam_service-with-iam.html#sec-iam-ib-id-based-policies-resources).
4545
* `ecr:GetDownloadUrlForLayer`, `ecr:BatchGetImage` - Required for [Amazon Elastic Kubernetes Service (Amazon EKS) add-ons](https://docs.aws.amazon.com/eks/latest/userguide/eks-add-ons.html), [GuardDuty EKS Runtime Monitoring](https://docs.aws.amazon.com/guardduty/latest/ug/guardduty-eks-runtime-monitoring.html), and [Amazon SageMaker pre-built Docker images](https://docs.aws.amazon.com/sagemaker/latest/dg-ecr-paths/sagemaker-algo-docker-registry-paths.html).
4646
* `lambda:GetLayerVersion` - Required for CloudWatch Lambda Insights extension and [AWS AppConfig](https://aws.amazon.com/systems-manager/features/appconfig/?whats-new-cards.sort-by=item.additionalFields.postDateTime&whats-new-cards.sort-order=desc&blog-posts-cards.sort-by=item.additionalFields.createdDate&blog-posts-cards.sort-order=desc) Agent Lambda extension.
4747
* `ec2:Owner` condition key:
@@ -88,7 +88,7 @@ This policy statement is included in the [resource_perimeter_policy](resource_pe
8888
This policy statement is included in the [resource_perimeter_policy](resource_perimeter_policy.json) and limits access to trusted [EC2 Image Builder](https://aws.amazon.com/image-builder/) resources:
8989

9090
* EC2 Image Builder resources that belong to your Organizations organization specified by the organization ID (`<my-org-id>`) in the policy statement.
91-
* Amazon managed [AWSTOE components](https://docs.aws.amazon.com/imagebuilder/latest/userguide/manage-components.html) that might be accessed by your identities and applications using your IAM credentials. To account for this access pattern, the `imagebuilder:GetComponent` is first listed in the `NotAction` element of the `"Sid":"EnforceResourcePerimeterAWSResources"` statement. `"Sid":"EnforceResourcePerimeterAWSResourcesImageBuilder"` then uses the `aws:PrincipalTag` condition key with `dp:exclude:resource:imagebuilder` tag set to `true` to restrict access to these actions to IAM principals tagged for access to EC2 Image Builder resources that do not belong to your organization.
91+
* Amazon [managed AWSTOE components and images](https://docs.aws.amazon.com/imagebuilder/latest/userguide/security_iam_service-with-iam.html) that might be accessed by your identities and applications using your IAM credentials. To account for this access pattern, the `imagebuilder:GetComponent`, `imagebuilder:GetImage` are first listed in the `NotAction` element of the `"Sid":"EnforceResourcePerimeterAWSResources"` statement. `"Sid":"EnforceResourcePerimeterAWSResourcesImageBuilder"` then uses the `aws:PrincipalTag` condition key with `dp:exclude:resource:imagebuilder` tag set to `true` to restrict access to these actions to IAM principals tagged for access to EC2 Image Builder resources that do not belong to your organization.
9292

9393

9494
### "Sid":"EnforceResourcePerimeterAWSResourcesECR"

service_control_policies/resource_perimeter_policy.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
"ssm:StartChangeRequestExecution",
2626
"ssm:StartAutomationExecution",
2727
"imagebuilder:GetComponent",
28+
"imagebuilder:GetImage",
2829
"ecr:GetDownloadUrlForLayer",
2930
"ecr:BatchGetImage",
3031
"lambda:GetLayerVersion",
@@ -93,7 +94,10 @@
9394
{
9495
"Sid": "EnforceResourcePerimeterAWSResourcesEC2ImageBuilder",
9596
"Effect": "Deny",
96-
"Action": "imagebuilder:GetComponent",
97+
"Action": [
98+
"imagebuilder:GetComponent",
99+
"imagebuilder:GetImage"
100+
],
97101
"Resource": "*",
98102
"Condition": {
99103
"StringNotEqualsIfExists": {

vpc_endpoint_policies/README.md

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,11 +103,16 @@ Example data access patterns:
103103

104104
* *Using EC2 Image Builder components*. [EC2 Image Builder](https://aws.amazon.com/image-builder/) uses a publicly available Amazon S3 bucket to store and access managed resources, such as components. It also downloads the AWSTOE component management application from a separate Amazon S3 bucket. The call to Amazon S3 is unauthenticated and passes through the Amazon S3 VPC endpoint.
105105

106-
* [AWS owned buckets](https://docs.aws.amazon.com/imagebuilder/latest/userguide/vpc-interface-endpoints.html):
106+
* [AWS owned buckets](https://docs.aws.amazon.com/imagebuilder/latest/userguide/security-iam-data-perimeter.html):
107107

108108
* `arn:aws:s3:::ec2imagebuilder-toe-<region>-prod/*`,
109109
* `arn:aws:s3:::ec2imagebuilder-managed-resources-<region>-prod/components/*`
110110

111+
* *AWS Cloud9 software packages.* [AWS Cloud9](https://aws.amazon.com/cloud9/) environments contain software packages required for AWS Cloud9 to function and support IDE features. To [download patches for these software packages](https://docs.aws.amazon.com/cloud9/latest/user-guide/vulnerability-analysis-and-management.html) from AWS Cloud9 repositories hosted on AWS owned Amazon S3 buckets, AWS Cloud9 makes an unauthenticated call to Amazon S3. The call originates from your VPC and passes through the Amazon S3 VPC endpoint.
112+
113+
* [AWS owned buckets](https://docs.aws.amazon.com/cloud9/latest/user-guide/ec2-ssm.html#create-s3-endpoint)
114+
115+
* `arn:aws:s3:::static-<region>-prod-static-<string>/content/dependencies/*`
111116

112117
* *Creation of containers with Amazon ECR images.* [Amazon Elastic Container Registry (Amazon ECR)](https://aws.amazon.com/ecr/) uses AWS owned Amazon S3 buckets to store Amazon ECR private image layers. When your containers download images from Amazon ECR, they must access Amazon ECR to get the image manifest and then Amazon S3 to download the actual image layers. A call to Amazon S3 is signed using a presigned URL, which is created by an Amazon ECR account and not the service principal. The call originates from your VPC and passes through the Amazon S3 VPC endpoint.
113118

@@ -176,11 +181,15 @@ Example data access patterns:
176181

177182
* `arn:aws:ssm:<region>::automation-definition/*`
178183

179-
* *Using EC2 Image builder components.* Image Builder uses the [AWS Task Orchestrator and Executor (AWSTOE)](https://docs.aws.amazon.com/imagebuilder/latest/userguide/toe-component-manager.html) component management application running on its Amazon EC2 build and test instances. If you are using Amazon managed components in your recipe, AWSTOE uses an instance profile to make a call to Image Builder to get those components, which passes through the Image Builder VPC endpoint.
184+
* *Using EC2 Image builder components and images.* Image Builder uses the [AWS Task Orchestrator and Executor (AWSTOE)](https://docs.aws.amazon.com/imagebuilder/latest/userguide/toe-component-manager.html) component management application running on the Amazon EC2 build and test instances. If you are using Amazon managed components in your recipe, AWSTOE uses an instance profile to make a call to Image Builder to get those components, which passes through the Image Builder VPC endpoint. Similarly, if you are using Amazon managed images, Image Builder uses the instance profile to retrieve those images to set up and boot an EC2 instance.
180185

181-
* [AWS owned component](https://docs.aws.amazon.com/imagebuilder/latest/userguide/vpc-interface-endpoints.html):
186+
* [AWS owned components](https://docs.aws.amazon.com/imagebuilder/latest/userguide/vpc-interface-endpoints.html):
182187

183188
* `arn:aws:imagebuilder:<region>:aws:component/*`
189+
190+
* [Amazon managed images](https://docs.aws.amazon.com/imagebuilder/latest/userguide/security_iam_service-with-iam.html#sec-iam-ib-id-based-policies-resources):
191+
192+
* `arn:aws:imagebuilder:<region>:aws:image/*`
184193

185194
* *Using Elastic Kubernetes Service add-ons.* [Amazon Elastic Kubernetes Service (Amazon EKS)](https://aws.amazon.com/eks/) uses an Amazon EKS managed Amazon Elastic Container Registry (Amazon ECR) private repository to host Docker container images for [Amazon EKS add-ons](https://docs.aws.amazon.com/eks/latest/userguide/eks-add-ons.html). Each Region has a dedicated private repository. If you use Amazon EKS managed node groups or want to have your Amazon EKS nodes pull the container images from the Amazon EKS private repository, your Amazon ECR VPC endpoint (com.amazonaws.region.ecr.api) policy must allow your principals to access the repository for the Region in which you are operating.
186195
* [AWS owned repositories for EKS add-ons](https://docs.aws.amazon.com/eks/latest/userguide/add-ons-images.html):

vpc_endpoint_policies/imagebuilder_endpoint_policy.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,12 @@
3131
"Effect": "Allow",
3232
"Principal": "*",
3333
"Action": [
34-
"imagebuilder:GetComponent"
34+
"imagebuilder:GetComponent",
35+
"imagebuilder:GetImage"
3536
],
3637
"Resource": [
37-
"arn:aws:imagebuilder:<region>:aws:component/*"
38+
"arn:aws:imagebuilder:<region>:aws:component/*",
39+
"arn:aws:imagebuilder:<region>:aws:image/*"
3840
],
3941
"Condition": {
4042
"StringEquals": {

vpc_endpoint_policies/s3_endpoint_policy.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,8 @@
9292
"arn:aws:s3:::elasticbeanstalk-env-resources-<region>/*",
9393
"arn:aws:s3:::elasticbeanstalk-<region>/*",
9494
"arn:aws:s3:::jumpstart-cache-prod-<region>/*",
95-
"arn:aws:s3:::jumpstart-cache-prod-<region>"
95+
"arn:aws:s3:::jumpstart-cache-prod-<region>",
96+
"arn:aws:s3:::static-<region>-prod-static-<string>/content/dependencies/*"
9697
]
9798
},
9899
{

0 commit comments

Comments
 (0)