S3 Resource Policies Flashcards

1
Q

What is a resource policy in the context of Amazon S3?

A

A resource policy, specifically a bucket policy in Amazon S3, is a type of policy applied directly to the S3 bucket to manage permissions. It allows specifying what actions are allowed or denied on the bucket and its objects.

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

How do S3 bucket policies differ from IAM policies?

A

S3 bucket policies are resource-based policies that attach directly to an S3 bucket to manage permissions for the bucket and its objects. IAM policies, on the other hand, are user-based policies that grant permissions to IAM users or roles to access particular AWS resources, including S3.

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

Can S3 bucket policies restrict access based on IP address?

A

Yes, S3 bucket policies can restrict access based on IP addresses. You can specify conditions within the policy to allow or deny access to the bucket or objects based on the requester’s IP address or IP address range.

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

What is the significance of the ‘Principal’ element in an S3 bucket policy?

A

The ‘Principal’ element in an S3 bucket policy specifies the account, user, role, or federated user to which the policy grants or denies access. If set to ‘*’, the policy applies to all principals (i.e., public access).

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

How can you make an S3 bucket publicly readable using a bucket policy?

A

To make an S3 bucket publicly readable, you can create a bucket policy that grants the ‘s3:GetObject’ permission to all users (‘Principal’ set to ‘*’). This allows anyone to read the bucket’s objects.

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

What is the ‘Effect’ element in an S3 bucket policy, and what values can it have?

A

The ‘Effect’ element in an S3 bucket policy specifies whether the policy results in an ‘Allow’ or ‘Deny’ permission. These are the only two values it can have, controlling access based on the matching conditions.

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

How does the ‘Action’ element in an S3 bucket policy define access permissions?

A

The ‘Action’ element in an S3 bucket policy defines specific permissions or operations (like s3:GetObject, s3:PutObject) that are allowed or denied by the policy. It can specify individual actions or a list of actions.

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

Can S3 bucket policies be used to enforce server-side encryption?

A

Yes, S3 bucket policies can be used to enforce server-side encryption by denying ‘s3:PutObject’ actions unless the request includes the header for server-side encryption (SSE). This ensures that all objects are encrypted when stored.

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

What is the use of the ‘Resource’ element in an S3 bucket policy?

A

The ‘Resource’ element in an S3 bucket policy specifies the bucket and/or objects to which the policy applies. It can target an entire bucket or specific objects within a bucket by using Amazon Resource Names (ARNs).

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

How can S3 bucket policies help in securing a static website hosted on S3?

A

S3 bucket policies can help secure a static website by restricting access to website content, forcing HTTPS for data in transit, or permitting access only from specific sources. This enhances the security of the static website hosted on S3.

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