The provider was not hacked
A small shop keeps its product photos and invoices in a cloud bucket. One morning the invoices turn up on a public website.
Nobody broke into the cloud provider. One setting that belonged to the shop was wrong, and nobody had checked it.
The one rule
Warning
Everything in this module happens in the practice cloud of your own lab. Testing a cloud account you do not own needs the owner's written permission. In the UK, without it, it can break the Computer Misuse Act 1990.
Quick check: the rule
Have a go
Quick check: the rule
3 questionsBy the end of this lesson
Note
I can say which security jobs are mine and which are the provider's for a cloud service.
Key words
| Word | What it means |
|---|---|
| Shared responsibility | security split between the provider and you |
| Provider | the company that runs the cloud |
| IaaS | renting machines you look after yourself |
| PaaS | renting a platform that runs your code |
| SaaS | renting finished software |
| Default | the setting you get without choosing |
The cells students fill in are left blank in this preview.
Starter
Have a go
Starter
3 questionsThe provider secures the cloud, you its contents
The provider secures its buildings, hardware and network, and the software behind each service. You secure your data, who can reach it and how each service is set up.
Where the line falls depends on what you rent. Rent a bare virtual machine and you patch its operating system. Rent finished software and you only look after your data and your users.
Who secures each layer
| Layer | IaaS: a virtual machine | PaaS: a code platform | SaaS: an email service |
|---|---|---|---|
| Data | You | You | You |
| Access: who can reach it | You | You | You |
| Application | You | You | Provider |
| Runtime | You | Provider | Provider |
| Operating system and patches | You | Provider | Provider |
| Network controls | You | Provider | Provider |
| Hardware and buildings | Provider | Provider | Provider |
The cells students fill in are left blank in this preview.
Try it: your layers for one model
split = {"iaas": 6, "paas": 3, "saas": 2}
layers = ["data", "access", "application", "runtime",
"operating system", "network controls", "hardware", "buildings"]
model = "paas"
for at, layer in enumerate(layers):
who = "you" if at < split[model] else "provider"
print(layer, ":", who)
# Change model to "saas". Which layers are still yours?
Make a free account to save your work and track your progress.
Check
Have a go
Check
3 questionsYour stack plays the provider
Your lab runs MiniStack, a practice copy of S3, SQS and DynamoDB. It plays the provider: you did not build it and you cannot patch it.
It is an emulator. It stores every setting you make and enforces none of them, but the commands and answers are the real ones. Set the made-up key, make the shop's bucket and ask the stack what it runs.
Point the aws command at your stack
export AWS_ACCESS_KEY_ID=test AWS_SECRET_ACCESS_KEY=test AWS_DEFAULT_REGION=us-east-1 AWS_ENDPOINT_URL=http://cloud:4566Shown here, not run. Press Start lab to type it into your own lab’s terminal.
Make the shop's bucket
aws s3 mb s3://shop-mediaShown here, not run. Press Start lab to type it into your own lab’s terminal.
Ask the stack which services it runs
curl -s http://cloud:4566/_ministack/healthShown here, not run. Press Start lab to type it into your own lab’s terminal.
What did the new bucket come with?
Each of the next three Runs asks the bucket for one setting: block public access, encryption at rest and versioning. Read each answer before the next.
Ask for block public access
aws s3api get-public-access-block --bucket shop-mediaShown here, not run. Press Start lab to type it into your own lab’s terminal.
Ask for default encryption
aws s3api get-bucket-encryption --bucket shop-mediaShown here, not run. Press Start lab to type it into your own lab’s terminal.
Ask for versioning
aws s3api get-bucket-versioning --bucket shop-mediaShown here, not run. Press Start lab to type it into your own lab’s terminal.
Your stack and AWS compared
| Setting | What your stack printed | A new bucket on AWS |
|---|---|---|
| Block public access | NoSuchPublicAccessBlockConfiguration | All four parts on, since April 2023 |
| Default encryption | ServerSideEncryptionConfigurationNotFoundError | SSE-S3, since January 2023 |
| Versioning | Nothing at all | Off |
The cells students fill in are left blank in this preview.
A common mistake
Warning
Many people think the provider keeps their data safe because it is in the provider's cloud. The provider secures the service, and the settings are yours. Read every setting yourself, because defaults differ between services, years and emulators.
Check
Have a go
Check
3 questionsSet your half, then read it back
Turn on default encryption and versioning for the bucket. Versioning keeps old copies, so a deleted or overwritten photo can come back. Then read both settings back, because a setting you have not read is a guess. Lesson 3 adds block public access.
Turn on default encryption
aws s3api put-bucket-encryption --bucket shop-media --server-side-encryption-configuration '{"Rules":[{"ApplyServerSideEncryptionByDefault":{"SSEAlgorithm":"AES256"}}]}'Shown here, not run. Press Start lab to type it into your own lab’s terminal.
Turn on versioning
aws s3api put-bucket-versioning --bucket shop-media --versioning-configuration Status=EnabledShown here, not run. Press Start lab to type it into your own lab’s terminal.
Read both settings back
aws s3api get-bucket-encryption --bucket shop-media --query 'ServerSideEncryptionConfiguration.Rules[0].ApplyServerSideEncryptionByDefault.SSEAlgorithm' --output text && aws s3api get-bucket-versioning --bucket shop-media --output textShown here, not run. Press Start lab to type it into your own lab’s terminal.
Check your half on a schedule
Anybody with the right access can undo a setting you fixed once. So a team writes its half of the split down as checks and runs them every day.
On AWS, AWS Config rules and Security Hub run checks like these. In lesson 6 you write your own posture check over your stack.
Assignment: whose layer is it?
Turn the table of layers into code a team could check against.
customer_layers(model) gives your layers for "iaas", "paas" or "saas", top first. who_secures(layer, model) answers "customer" or "provider". gaps(model, done) lists your layers that are not in done, in the order of LAYERS.
LAYERS = ["data", "access", "application", "runtime", "operating system",
"network controls", "hardware", "buildings"]
CUT = {"iaas": 6, "paas": 3, "saas": 2}
def customer_layers(model):
# The layers you secure for this kind of service, top first.
return []
def who_secures(layer, model):
# "customer" or "provider".
return "provider"
def gaps(model, done):
# Your layers that are not in done, in the order of LAYERS.
return []
Make a free account to save your work and track your progress.
Exit quiz
Have a go