I want to be sure that my Amazon Simple Storage Service (Amazon S3) buckets and objects are secure. The resources that I want to be private must be private. How can I limit permissions to my Amazon S3 resources? How can I monitor the access to these resources?

Restrict access to your S3 resources

By default, all S3 buckets are private and can be accessed only by users that are explicitly granted access. When using AWS, it's a best practice to restrict access to your resources to the people that absolutely need it. Follow the principle of least privilege.

Restrict access to your S3 buckets or objects by:

  • Writing AWS Identity and Access Management (IAM) user policies that specify the users that can access specific buckets and objects. Using IAM policies provides a programmatic way to manage Amazon S3 permissions for multiple users. For more information about creating and testing user policies, see the AWS Policy Generator and IAM Policy Simulator.
  • Writing bucket policies that define access to specific buckets and objects. You can use a bucket policy to grant access across AWS accounts, grant public or anonymous permissions, and allow or block access based on certain conditions. For more information about creating and testing bucket policies, see the AWS Policy Generator.
    Note: You can use a deny statement in a bucket policy to restrict access to specific IAM users, even if the users are granted access in an IAM policy.
  • Using Amazon S3 Block Public Access as a centralized way to limit public access. Block Public Access settings override bucket policies and object permissions.
  • Setting access control lists (ACLs) on your buckets and objects.
    Note: If you need a programmatic way to manage permissions, use IAM policies or bucket policies instead of ACLs. However, you can use ACLs when your bucket policy exceeds the 20 KB maximum file size, or when you grant access for Amazon S3 server access logs or Amazon CloudFront logs.

Consider these best practices when you use ACLs to secure your resources:

  • Be sure to review ACL permissions that allow Amazon S3 actions on a bucket or an object. For the list of ACL permissions and the actions that they allow, see What Permissions Can I Grant?
  • Be stringent about who gets Read and Write access to your buckets.
  • Carefully consider your use case before granting Read access to the Everyone group because this allows anyone to access the bucket or object.
  • Never allow Write access to the Everyone group. This setting allows anyone to add objects to your bucket, which you will then be billed for. This setting also allows anyone to delete objects in the bucket.
  • Never allow Write access to the Any authenticated AWS user group, which includes anyone with an active AWS account, not just IAM users in your account. To control access for IAM users on your account, use an IAM policy instead. For more information on how Amazon S3 evaluates IAM policies, see How Amazon S3 Authorizes a Request.

In addition to using policies, Block Public Access, and ACLs, you can also restrict access to specific actions in these ways:

  • Enable MFA Delete, which requires a user to authenticate using a multi-factor authentication (MFA) device before deleting an object or disabling bucket versioning.
  • Set up MFA-protected API access, which requires that users authenticate with an AWS MFA device before they call certain Amazon S3 API operations.
  • If you temporarily share an S3 object with another user, create a presigned URL to grant time-limited access to the object. For more information, see Share an Object with Others.

Monitor your S3 resources

To track what actions are taken on your buckets and objects, you can enable logging and monitor your resources in these ways:

Use encryption to protect your data

If your use case requires encryption during transmission, Amazon S3 supports the HTTPS protocol, which encrypts data in transit to and from Amazon S3. All AWS SDKs and AWS tools use HTTPS by default.
Note: If you use third-party tools to interact with Amazon S3, contact the developers to confirm if their tools also support the HTTPS protocol.

If your use case requires encryption for data at rest, Amazon S3 offers server-side encryption (SSE). The SSE options include SSE-S3, SSE-KMS, or SSE-C. You can specify the SSE parameters when you write objects to the bucket. You can also enable default encryption on your bucket with SSE-S3 or SSE-KMS.

If your use case requires client-side encryption, see Protecting Data Using Client-Side Encryption.


Did this page help you? Yes | No

Back to the AWS Support Knowledge Center

Need help? Visit the AWS Support Center

Published: 2017-07-25

Updated: 2019-02-08