Sub topic 5
Worked examples: EC2, RDS, and S3
This chapter walks through three services to show where the responsibility line falls in practice. It assumes you know core AWS services (EC2, S3, IAM), understand Regions and Availability Zones, and can read a short AWS CLI command. The three services sit at different points on the spectrum of infrastructure, container, and abstracted services. As the service moves toward abstracted, AWS takes on more of the work.
EC2: an infrastructure service
Amazon EC2 gives you a virtual server. AWS secures the host hardware, the data center, the network fabric, and the hypervisor that isolates your instance from others. You secure everything from the guest operating system upward.
Your duties on EC2 include:
- Patching the guest OS and the applications on it.
- Configuring security groups and network ACLs.
- Managing the IAM roles attached to the instance.
- Encrypting EBS volumes and handling the data on them.
- Managing SSH keys or Systems Manager access.
AWS provides the encryption capability, but you decide to use it. This command makes new EBS volumes in a Region encrypted by default:
aws ec2 enable-ebs-encryption-by-default --region us-east-1
aws ec2 get-ebs-encryption-by-default --region us-east-1The second command should return "EbsEncryptionByDefault": true. The setting applies per Region, so repeat it in each Region you use.
RDS: a container-style managed service
Amazon RDS runs a database engine for you. AWS takes over the operating system and database software. It patches the OS, manages the underlying instance, and handles backup automation and failover when you enable them. You still own the database's use.
Your duties on RDS include:
- Choosing whether the instance is publicly accessible.
- Controlling access through security groups and database accounts.
- Enabling encryption at rest when you create the instance.
- Setting the backup retention period and the maintenance window.
- Deciding what data goes into the database.
Note that you cannot log in to the RDS host OS. That is the practical sign that AWS owns that layer.
S3: an abstracted service
Amazon S3 is an abstracted service. AWS runs the storage platform, the servers, and the operating systems. You never see or patch any of them. You are left with the configuration of your buckets and the data in them.
Your duties on S3 include:
- Writing bucket policies and IAM policies.
- Deciding whether a bucket can be public.
- Choosing an encryption setting and managing keys if you use KMS.
- Enabling versioning, logging, and lifecycle rules.
S3 is operated by AWS, but whether a bucket is public is your choice. This command turns on all four Block Public Access settings for one bucket:
aws s3api put-public-access-block \
--bucket amzn-s3-demo-bucket \
--public-access-block-configuration \
BlockPublicAcls=true,IgnorePublicAcls=true,BlockPublicPolicy=true,RestrictPublicBuckets=trueComparing the three
| Layer | EC2 | RDS | S3 |
|---|---|---|---|
| Physical data center and hardware | AWS | AWS | AWS |
| Hypervisor | AWS | AWS | AWS |
| Operating system and patching | You | AWS | AWS |
| Database or platform software | You | AWS | AWS |
| Network rules and access policy | You | You | You |
| Data and encryption choices | You | You | You |
Checking your side
After you configure these controls, confirm them. This command lists the AWS Config rules that currently report non-compliant resources:
aws configservice describe-compliance-by-config-rule \
--compliance-types NON_COMPLIANTAn empty result means no rule is reporting a problem. It does not prove that your rules cover every control, so check that the rules you need exist.
Exercise
A team runs a PostgreSQL database on Amazon RDS. A colleague says AWS handles all of its security. Name two things the team still owns.
Show answer
Any two of: deciding whether the instance is publicly accessible, security group and database account access, turning on encryption at rest, backup retention settings, and the data stored in the database. AWS owns the host OS and database engine patching.
Exercise
Why does S3 still require customer security work even though it is an abstracted service?
Show answer
AWS secures the platform, but you control bucket policies, public access settings, encryption choices, and the data itself. Exposure usually results from these configurations.