Cloud security
About this lesson
In the cloud, security is shared: the provider secures the buildings, hardware and its own software, and you secure your data, your accounts and every setting. The most common cloud weakness is simply a wrong setting. Follow one storage bucket of customer invoices that starts public, unencrypted and unlogged, write the safe settings down as a six-line Python check, and fix the bucket one setting at a time until the check finds nothing wrong.
What the cloud is
Cloud computing means renting computers and storage from a provider and using them over the internet. Our example: a small shop's app saves customer invoices in a storage bucket, a place for files in the provider's data centre.
cloud computing rented computers, storage and
software, used over the internet
NIST SP 800-145 "on-demand network access to a
shared pool of configurable
computing resources"
here the shop's app → a storage bucket
of customer invoicesRead the lesson step by step
What the cloud is
Cloud computing means renting computers and storage from a provider and using them over the internet. Our example: a small shop's app saves customer invoices in a storage bucket, a place for files in the provider's data centre.
cloud computing rented computers, storage and software, used over the internet NIST SP 800-145 "on-demand network access to a shared pool of configurable computing resources" here the shop's app → a storage bucket of customer invoicesSecurity is shared
Security in the cloud is shared. The provider secures the buildings, the hardware and the cloud's own software. The customer secures what they put in and how they set it up: their app, the data in the bucket, who may use it, and every setting.
shared responsibility provider buildings, hardware, network, the cloud's own software customer the data, the accounts and who may use what, every setting the split moves with the service you rent, but your data is always your jobOne wrong setting
The most common cloud weakness is a misconfiguration: a setting left wrong. This bucket has three. It is public, so anyone can read it. Its files are not encrypted. And logging is off, so nobody records who reads them.
misconfiguration a setting left wrong (OWASP Top 10: A05) bucket settings now safe public True False encrypted False True logging False TruePublic means anyone
Public means no sign-in is needed. Anyone who finds the bucket's address can download every invoice, without breaking anything. The data leaks, a loss of confidentiality, because of one wrong setting, not clever hacking.
public = True no sign-in needed to read who can read anyone who finds the address what leaks every invoice in the bucket harmed confidentiality the cause a setting, not a break-inWrite the safe settings down
Clicking through settings by hand is easy to get wrong. Instead, write the safe values down as code. SAFE is a Python dictionary: public must be False, encrypted True and logging True.
SAFE = {"public": False, "encrypted": True, "logging": True} dictionary setting name → the safe value one place the same rule for every bucket, reviewed like any other codeLet code check the settings
problems(cfg) goes through SAFE and keeps each setting whose value is different. For our bucket it returns all three names, so the lamp shows 0: not safe. Checking settings with code like this is called policy as code.
>>> bucket = {"public": True, ... "encrypted": False, ... "logging": False} >>> problems(bucket) ['public', 'encrypted', 'logging'] lamp 0 (the list is not empty)Fix 1: block public access
Fix one: turn public off. Now every read of the bucket must come from a signed-in identity with permission, like the shop's app. The same download from the internet is refused. problems() now returns two names.
bucket["public"] = False from the internet refused (no sign-in) the shop's app signed in, allowed >>> problems(bucket) ['encrypted', 'logging']Fix 2: encrypt at rest
Fix two: turn on encryption at rest. The files are stored scrambled, and only allowed callers get them unscrambled, with a key the provider's key service guards. A copied disk or file is useless without the key.
bucket["encrypted"] = True at rest files stored scrambled the key kept in the key service, used only for allowed callers >>> problems(bucket) ['logging']Fix 3: turn on logging
Fix three: turn on logging. Every read of the bucket, even the app's, is now recorded: who, what and when. Logs block nothing, but they let you spot strange reads and investigate later. That is NIST's Detect function.
bucket["logging"] = True each read → a log entry who · what · when logs do not block; they let you notice, investigate and prove (NIST CSF 2.0: Detect)Check again, and keep checking
Run problems() again: it returns an empty list, and the lamp shows 1. Run the check on every change and on a schedule too, because settings drift: someone may switch one back for a quick test.
>>> problems(bucket) [] lamp 1 (no problems) run it on every change, before it ships and on a schedule (settings drift)Cloud security in four habits
Cloud security in four habits: know your side of the shared responsibility and the provider's, keep buckets private by default, encrypt and log them, and check every setting with code. One wrong setting should never be enough to leak data.
1 know your side provider vs customer 2 private by default no public data 3 encrypt and log at rest; every read 4 check with code every change, and on a schedule
5 quick questions
Choose one answer per question. You can change your choices before checking them.
01A company rents storage from a cloud provider. Under the shared responsibility model, who is responsible for setting that storage to private?
The provider secures its buildings, hardware and its own software. What you put in the cloud and how you set it up, including who can read it, is the customer's job.
02A storage bucket is set to public and its files are downloaded by strangers. What kind of weakness is this?
Nothing was broken into: a setting was left wrong. OWASP lists improperly configured cloud permissions under A05 Security Misconfiguration.
03With SAFE = {"public": False, "encrypted": True, "logging": True}, what does problems({"public": False, "encrypted": False, "logging": True}) return?
problems() keeps each setting whose value differs from SAFE. Only encrypted differs (False instead of True), so the list holds just 'encrypted'.
04Which fix lets you notice strange reads of a bucket and investigate them later, without blocking anything?
Logging records who read what and when. It does not stop a read, but it lets you detect and investigate one (the Detect function of NIST CSF 2.0).
05The check returned an empty list today. Why run it again on every change and on a schedule?
Settings change over time, for a quick test or by mistake. OWASP recommends an automated process to verify configurations in all environments, and NIST describes continuous monitoring.
Glossary
- Cloud computing
- Renting computers, storage and software from a provider and using them over the internet. NIST SP 800-145: on-demand network access to a shared pool of configurable computing resources.
- Shared responsibility
- The split of security work in the cloud: the provider secures the buildings, hardware and its own software; the customer secures their data, accounts and settings.
- Storage bucket
- A place in the cloud that holds files (objects). Its settings decide who can read them.
- Misconfiguration
- A setting left wrong, such as storage that anyone on the internet can read. OWASP Top 10 2021: A05 Security Misconfiguration.
- Encryption at rest
- Storing data scrambled, so a copied disk or file is unreadable without the key. The key is kept apart, in a key management service.
- Access log
- A record of every read or change: who, what and when. It does not block anything, but it lets you detect and investigate.
- Policy as code
- Writing the rules for safe settings as code, so a program can check every resource the same way, on every change.
Notes and sources
- Real cloud storage has many more settings, and each provider names them differently. The idea is the same everywhere: write the safe values down once and let a program compare every resource against them.
- Where the line falls depends on what you rent. With rented servers you also patch the operating system; with a ready-made app the provider does more. Your data, accounts and settings are always yours (NIST SP 800-144).
- Blocking public access only helps if the identities that remain are protected too: least privilege for the app, MFA for people, and no passwords or keys written into code (CISA and NSA cloud guidance).
- Real teams use ready-made checkers for this, such as CISA's ScubaGear, which compares a cloud tenant with CISA's secure configuration baselines. The six-line function shows the idea, not a full tool.
- This course is about defence. It explains how attacks work only at the level needed to stop them, and never how to attack a real system.
- NIST SP 800-145: The NIST Definition of Cloud Computing
- NIST SP 800-144: Guidelines on Security and Privacy in Public Cloud Computing
- CISA: Cloud Security Technical Reference Architecture
- CISA and NSA: Cybersecurity Information Sheets on Cloud Security Best Practices (March 2024)
- CISA: Secure Cloud Business Applications (SCuBA) Project
- OWASP Top 10 2021: A05 Security Misconfiguration
- NIST SP 800-204C: Implementation of DevSecOps for a Microservices-based Application with Service Mesh
- NIST SP 800-137: Information Security Continuous Monitoring
- NIST SP 800-92: Guide to Computer Security Log Management
- NIST CSWP 29: The NIST Cybersecurity Framework (CSF) 2.0
- Python documentation: dict.get
- Python documentation: list comprehensions
Quiz Unlocks after the last step.