mooc-notes

Notes from online courses

View on GitHub

Introduction

Course Objectives

Introduce and explain the available properties that are configurable at the bucket level that Amazon S3 has to offer to help you manage and administer your data effectively.

Standard

Advanced


Versioning

This is a bucket feature that allows for multiple versions of the same object to exist. This is useful to allow you to retrieve previous versions of a file, or recover a file should it subjected to accidental deletion, or intended malicious deletion of an object.

Enabling Versioning

Not enabled by default. But once enabled, cannot disable. You can suspend, which will prevent any further versions of the object from being created.

Versioning States

Which means the bucket can be in any one of these versioning states:

  1. Unversioned (Default)
  2. Versioning-enabled (will incur additional costs as you will be storing multiple versions of the same object)
  3. Versioning-suspended

Versioning can be enabled via AWS management console either during the creation of a bucket or enable on an existing bucket

Objects with versioning enabled are not overwritten, instead a new object with a new version id is created.

Note: costs will increase rapidly if you have 1000s of rapidly changing files

Deleting objects


Server-Access Logging

In a nutshell, when server-access logging is enabled on a bucket, it captures details of requests made to the bucket and its objects. Logging is important when it comes to security, root-cause cause analysis following incidents, and it can also be required to conform to specific audit and governance certifications.

However, server-access logging is not guaranteed and is conducted on a Best-Effort basis by S3. The logs are collated and sent every few hours but there’s no guarantee that every request will be captured and that you will receive a log for a specific request within a set time frame.

Enabling the feature

By default SAL is disabled. Enabling access logging on your buckets is a very simple process using the S3 Management Console: specify target bucket (used to store any logs created by enabling SAL on your source bucket, which must be in the same region) and target prefix (optional). Can be enabled both during bucket creation and after it’s created.

Permissions

To allow S3 to write access logs to a target bucket, it will, of course, require specific permissions. These permissions will require write access for a group known as the Log Delivery group, which is a pre-defined Amazon S3 group used to deliver log files to your target buckets.

Logs

Naming convention: Log entry:


##Static Website Hosting How to configure S3 bucket to host a static website

Enabling the feature

By default it is disabled. 3 options while enabling the feature:

  1. Use this bucket to host a website
    1. add index doc (home page)
    2. error doc
    3. redirection rules - xml rules for advanced redirection
  2. Redirect requests
    1. redirect requests to the s3 bucket endpoint to a specified website
    2. protocol (http, https)
  3. Disable website hosting

Additionally it provides a region-specific endpoint which allows users to access your website via that URL. However,

Permissions

By default, blocked to public. To allow public access, enable it in Permissions tab and then add a bucket policy


Object-Level Logging

This feature is actually more closely related to the AWS CloudTrail service than S3 in a way, as it’s AWS CloudTrail that performs logging activities against Amazon S3 data events. These data events are specific API calls used in S3, such as GetObject, DeleteObject, and PutObject.

So what is CloudTrail? CloudTrail is a service that has a primary function to record and track all AWS API requests made. These API calls can be programmatic requests initiated from a user using an SDK, the AWS command-line interface, from within the AWS management console or even from a request made by another AWS service.

When an API request is initiated, AWS CloudTrail captures the request as an event and records this event within a log file which is then stored on S3. Each API call represents a new event within the log file. CloudTrail also records and associates other identifying metadata with all the events. For example, the identity of the caller, the timestamp of when the request was initiated and the source IP address.

Capturing S3 data events can be configured in 2 ways: Firstly, if you want to capture data events for all or some of your S3 buckets, then you can configure this from within one of your Trails using the AWS CloudTrail console itself as shown here. Secondly, if it’s not already enabled via AWS CloudTrail for your bucket you can configure it at the bucket level using the Properties tab. Selecting the Object-level logging tile will present you with options to configure it.


Default Encryption

Whenever you have sensitive data being stored in S3 it’s imperative to have some level of encryption enabled as an additional layer of security to protect your data.

Using default encryption, you are able to set a default encryption mechanism for every new object that is uploaded to the bucket. However, please note that for any objects that are already in your bucket prior to enabling default encryption, they will NOT be encrypted.

Enabling the feature

To enable default encryption on a particular bucket you can select the ‘Default Encryption’ tile from the bucket properties tab. This will enable you to configure one of 2 different default encryption options.

  1. AES-256, also known as SSE-S3 which stands for Server-side encryption using S3 managed keys, and
  2. AWS-KMS, this is often referred to as SSE-KMS which stands for Server-side encryption using KMS managed keys. KMS is the Key Management Service. If you are unfamiliar with this service you can learn more about it in this course here.

Check video for how encryption works with both these methods

Other encryption available to use within S3


Object Lock

Enabling the feature

Retention modes

Governance Mode

Compliance Mode

Per-object Retention


Tags

Enabling the feature


Transfer Acceleration

Cost

Enabling the feature

Operations not supported


Events

Enabling the feature


Requester Pays

Enabling the feature


Summary

  1. Versioning
    1. allows multiple versions of the same object to exist
    2. This is useful to allow you to retrieve previous versions of a file, or recover a file should it subjected to accidental deletion, or intended malicious deletion of an object.
  2. Server Access Logging
    1. when this is enabled on a bucket it captures details of requests that are made to that bucket and its objects.
    2. Logging is important when it comes to security, root-cause cause analysis following incidents, and it can also be required to conform to specific audit and governance certifications.
  3. Static Website Hosting
    1. if you are looking to create a simple and static website that requires no server-side scripting of any kind, then it can easily be hosted within one of your Amazon S3 buckets.
  4. Object-level Logging
    1. This feature is actually more closely related to the AWS CloudTrail service than S3, as it’s AWS CloudTrail that performs logging activities against Amazon S3 data events.
    2. These data events are specific API calls used in S3, such as GetObject, DeleteObject, and PutObject.
  5. Default Encryption
    1. When using default encryption, you are able to set a default encryption mechanism for every new object that is uploaded to the bucket.
    2. However, for any objects that are already in your bucket prior to enabling default encryption, they will NOT be encrypted.
  6. Object Lock
    1. This feature is often used to meet a level of compliance known as WORM, meaning Write Once Read Many.
    2. It allows you to offer a level of protection against your objects in your bucket and prevents them from being deleted, either for a set period of time that is defined by you or alternatively prevents it from being deleted until the end of time!
    3. The ability to add retention periods using Object Lock help S3 to comply with regulations such as FINRA.
  7. Tags
    1. Known as S3 cost allocation tags, you can assign key-value pairs at the bucket level to help with bucket and object categorization.
    2. Using the Cost Explorer you can then report on these key-values to identify and highlight the costs associated with your resources with specific key-value pairs.
  8. Transfer Acceleration
    1. Transfer acceleration can dramatically speed up the process of transferring data into or out of Amazon S3 from and to your remote client, or to another AWS region, by utilizing Amazon CloudFront.
    2. With transfer acceleration enabled at the bucket level, the request will go via one of the CloudFront Edge Locations, where the request will then be routed through a high speed optimized AWS network path to Amazon S3.
  9. Events
    1. Events allow you to monitor specific events that may occur within your buckets which can then be sent to either an SNS Topic, an SQS Queue or a Lambda Function.
  10. Requester Pays
    1. which simply passes the costs of all object requests and data transfer becomes to the requester instead of the bucket owner.
    2. The bucket owner will still, however, pay for the storage costs associated with the objects stored in the bucket.