[08] Security Flashcards

1
Q

What is the definitive source for information on controlling access to ECS actions?

A

The Service Authorization Reference

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is a method for scoping IAM policies for ECS?

A

Based on tags, ecs:cluster or ecs:service

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

When is the ECS service linked role created?

A

Automatically when a cluster or service is created, including when created using the CLI or API directly

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is the purpose of the AmazonEC2ContainerServiceforEC2Role managed IAM policy?

A

Intended for use by EC2 container instances

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What permissions are included in the AmazonEC2ContainerServiceforEC2Role policy?

A

ec2:DescribeTags, ecs:CreateCluser, ecs:DeregisterContainerInstance, ecs:DiscoverPollEndpoint, ecs:Poll, ecs:RegisterContainerInstance, ecs:StartTelemetrySession, ecs:TagResource, ecs:UpdateContainerInstanceState, ecs:Submit*, ecr permissions for pulling images, and CloudWatch logging permissions

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What does the AmazonECSTaskExecutionRolePolicy managed policy allow?

A

Includes permissions for pulling images from ECR and CloudWatch logging

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What permission is required to create tags as part of other API calls like CreateCluster?

A

ecs:TagResource

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Where can credentials for the task role be fetched from?

A

169.254.170.2${AWS_CONTAINER_CREDENTIALS_RELATIVE_URI}

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is the format of the AWS_CONTAINER_CREDENTIALS_RELATIVE_URI environment variable?

A

/{{credentials_version}}/credentials?id={{task_credential_id}}

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What API action cannot have the aws:sourceVpc or aws:sourceVPce condition keys applied to it?

A

ecr:GetAuthorizationToken

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Why can’t the aws:sourceVpc or aws:sourceVPce condition keys be applied to the ecr:GetAuthorizationToken API action?

A

The GetAuthorizationToken API call goes through the Fargate ENI, not the task ENI

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Can tasks running on EC2 instances access IMDS by default?

A

Yes

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

How can access to IMDS be prevented for awsvpc tasks on EC2?

A

Using the ECS_AWSVPC_BLOCK_IMDS agent setting

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

How can access to IMDS be prevented for bridge tasks on EC2?

A

Using an iptables rule

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Is it possible to prevent access to IMDS for host tasks on EC2?

A

No

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What must the trust policies for the task and execution roles include?

A

ecs-tasks.amazonaws.com

17
Q

Why must the trust policies include ecs-tasks.amazonaws.com?

A

Because sts:AssumeRole is called by the ECS service itself, not the agent or container instance

18
Q

What additional steps are required when using task roles for tasks running on EC2 Windows?

A

The ECS agent must be initialised with the -EnableTaskIAMRole option, for non-awsvpc tasks a bootstrap script must be run inside the containers, the task must not expose port 80, if the instance is restarted the proxy interface must be deleted and the agent reinitialised