Sub topic 3
What you secure: your data, configuration, and access
This chapter covers the customer side of the shared responsibility model: security in the cloud. It assumes you know core AWS services (EC2, S3, IAM), Regions and Availability Zones, and basic security ideas such as encryption, authentication, and least privilege. You should also be able to read a short AWS CLI command.
The principle: AWS provides the capability, you make the choice
AWS runs the facilities, hardware, network, and virtualization layer. That work is covered in the previous chapter. It does not decide how your account is used. Every service has settings, and each setting is a decision. AWS offers the capability, but you decide whether to turn it on, who may use it, and what data goes into it.
A useful test for any control is to ask whether AWS could change it without your knowing. If AWS cannot choose the setting for you, the setting is yours. AWS cannot decide that your bucket should be private, that a database column holds personal data, or that a contractor's access should end on Friday.
Your duties fall into three groups:
- Data: what you store, how sensitive it is, how it is encrypted, and how long you keep it.
- Configuration: how you set up resources, including networks, operating systems, and service settings.
- Access: which people and systems can reach which resources, and what they can do.
Data: you own it, so you classify and protect it
AWS does not look inside your data and does not know what it means to your business. You are responsible for four things.
- Classification. Decide which data is public, internal, confidential, or regulated. Without a classification, you cannot choose the right controls. Amazon Macie can help find sensitive data in S3, but you still decide what to do with its findings.
- Encryption. AWS provides the encryption features and the key infrastructure, such as AWS Key Management Service (KMS). You decide whether to use them, which keys to use, and who can use those keys.
- Protection in transit. You choose whether clients connect over TLS, and you can enforce it with bucket policies or load balancer listeners.
- Lifecycle. You set retention, backups, versioning, and deletion rules. If you delete data by mistake and have no backup, AWS has no obligation to restore it.
The encryption choice shows the pattern clearly. EBS encryption is available in every Region, but a new volume is only encrypted if you ask for it or if you set the account default. This command sets the default for one Region:
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. Keep these limits in mind:
- The setting applies to one Region in one account. You must repeat it for each Region you use.
- It affects newly created volumes and snapshot copies. It does not encrypt volumes that already exist.
- Encrypted volumes use a KMS key. If you leave the default AWS managed key in place, you cannot restrict who uses it as precisely as you can with a customer managed key.
Configuration: defaults are a starting point
Each service gives you a configuration surface. How large that surface is depends on the service type, which a later chapter covers. For now, remember that you configure something for every service you use.
Common configuration duties include:
- Network rules. Security groups, network ACLs, route tables, and which subnets are public or private.
- Operating system and software. On EC2, you patch the guest operating system, harden it, and manage the applications that run on it.
- Service settings. Public access settings, logging, versioning, backup schedules, and parameter groups.
- Logging. AWS CloudTrail records API activity, but you decide to keep the trails, where the logs go, and who can read or delete them.
Public exposure of S3 buckets is the standard example. S3 is operated by AWS, but whether a bucket is public is your configuration 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=trueThe four settings do different things:
| Setting | What it does |
|---|---|
| `BlockPublicAcls` | Rejects requests that try to add a public ACL to the bucket or its objects. |
| `IgnorePublicAcls` | Ignores any existing public ACLs when checking access. |
| `BlockPublicPolicy` | Rejects bucket policies that would grant public access. |
| `RestrictPublicBuckets` | Limits access to a bucket with a public policy to AWS services and authorized users in the account. |
You can also apply the same settings to an entire account, which prevents a single bucket from being missed. Newly created buckets have Block Public Access enabled by default, but older buckets, and buckets where someone changed the settings, may not.
Access: identity is the main perimeter
In the cloud, a request to an AWS API is a request from some identity. The network path matters less than whether that identity is allowed. Because of this, access is usually the highest-impact area of your responsibility.
Your access duties include:
- Creating and removing identities. You create IAM roles and users, or federate from an identity provider, and you remove access when people leave or change jobs.
- Writing policies. You decide what each identity may do. Start narrow and add permissions as needed, rather than starting with
AdministratorAccess. - Protecting credentials. Enable multi-factor authentication (MFA) for people. Use roles with temporary credentials for applications instead of long-lived access keys. Never place keys in source code.
- Securing the root user. The account root user has full power over the account. Protect it with MFA and do not use it for daily work.
- Reviewing access. Permissions tend to grow over time. Review them on a schedule and remove what is unused.
AWS provides tools such as IAM Access Analyzer and credential reports. These tools show you the state of your access. You still have to act on what they show.
Responsibility does not disappear when you delegate
You may hire a managed service provider, use a third-party tool, or give another team access to your account. Those arrangements change who performs the work, but they do not move the accountability. If a vendor's role in your account is too broad and it is misused, the exposure is in your account. When you delegate, write down what the other party does, scope their IAM permissions to match, and keep the logs.
How your duties change with the service
The duties above apply to every account, but their weight depends on the service. The next chapter covers this in detail, so here is only a short preview using three services you know:
| Service | Typical customer duties |
|---|---|
| EC2 | Guest OS patching, security groups, IAM roles for the instance, volume encryption, data, backups |
| RDS | Database users and permissions, security groups, encryption choice, parameter settings, data |
| S3 | Bucket policies, Block Public Access, encryption settings, versioning, data |
As you move from EC2 toward S3, AWS takes over more of the underlying work. Your duties for data, configuration, and access remain, though. No service removes them entirely.
A short checklist for a new workload
Use this list when you start a workload. It is a prompt for thinking, not a complete security program.
- Classify the data the workload stores and processes.
- Decide who needs access, and create roles with the least privilege that works.
- Turn on MFA for all human users, and secure the root user.
- Enable encryption for storage services and require TLS for connections.
- Block public access by default, and open only what you can justify.
- Turn on CloudTrail and send logs to a protected location.
- Define a patching and backup process for anything you run yourself.
- Write down who owns each of these items.
The last item feeds into the responsibility matrix chapter, which turns this list into a formal document.
Exercise
A teammate says, "S3 is a fully managed AWS service, so AWS is responsible if our customer export bucket is public." Is the teammate right? Name the setting involved and the command you would use to address it for one bucket.
Show answer
No. AWS secures the S3 infrastructure, but whether a bucket is public is a configuration decision that belongs to the customer. The relevant settings are S3 Block Public Access. For one bucket, run aws s3api put-public-access-block with BlockPublicAcls, IgnorePublicAcls, BlockPublicPolicy, and RestrictPublicBuckets all set to true. You should also review the bucket policy and ACLs to see how the bucket became public.
Exercise
You run aws ec2 enable-ebs-encryption-by-default --region us-east-1. Name two things this does not do.
Show answer
It does not encrypt EBS volumes that already exist, and it does not apply to other Regions. Each Region needs its own setting. It also does not control who can read data through valid IAM permissions.