00->1
Learning pathStep 44 of 62Network attacks and defence ← All writeups

Cloud Security Basics, Explained

If you are reading this, you have probably heard "it's in the cloud" and "the cloud provider handles security" in the same meeting, and you want to know what is true and what is not.

By the end you will be able to define cloud computing in NIST's terms, tell IaaS, PaaS and SaaS apart, say which security tasks the provider handles and which stay with you, and name the handful of mistakes that cause most cloud incidents. You will also practise reading cloud permission policies, with no cloud account needed.

You do not need any cloud experience. Where this post gives a concrete example, it uses Amazon Web Services (AWS) because its documentation is detailed and public, and it points to the Microsoft Azure and Google Cloud equivalents where I could check them. The ideas are the same everywhere; the product names and defaults are not, and defaults change, so always check the provider's current documentation.


1. What "the cloud" is

"Someone else's computer" is a joke with some truth in it, but the standard definition is more precise. NIST, the US standards body, defines it like this:

"Cloud computing is a model for enabling ubiquitous, convenient, on-demand network access to a shared pool of configurable computing resources (e.g., networks, servers, storage, applications, and services) that can be rapidly provisioned and released with minimal management effort or service provider interaction." (NIST SP 800-145)

The same document says the model has five essential characteristics:

Characteristic In plain words
On-demand self-service You create servers or storage yourself, when you need them, without phoning the provider
Broad network access Everything is reached over the network, from phones, laptops and other clients
Resource pooling The provider's hardware is shared among many customers (a multi-tenant model). You generally do not know the exact physical location, though you may be able to pick a country, state or data centre
Rapid elasticity You can scale up and down quickly, sometimes automatically
Measured service Usage is metered, so you can see and pay for what you use

Two of these matter for security straight away. Self-service means anyone with the right permissions can create or expose a resource in seconds, including by mistake. Broad network access means the cloud's management interface is reachable from the internet, so the login to it is a very valuable target. Both come up again below.


2. The three service models: IaaS, PaaS, SaaS

NIST defines three service models. They differ in how much the provider runs for you, and that decides how much you have to secure.

Model NIST's wording (shortened) You control Example
IaaS (Infrastructure as a Service) The consumer can "provision processing, storage, networks, and other fundamental computing resources" and "deploy and run arbitrary software, which can include operating systems and applications" "operating systems, storage, and deployed applications", and possibly limited networking such as host firewalls A virtual machine such as Amazon EC2 or an Azure virtual machine
PaaS (Platform as a Service) The consumer deploys "consumer-created or acquired applications" onto the provider's platform "the deployed applications and possibly configuration settings for the application-hosting environment" Azure App Service
SaaS (Software as a Service) The consumer uses "the provider's applications running on a cloud infrastructure" Only "limited user-specific application configuration settings" Microsoft 365, web email

(The examples come from Microsoft's shared responsibility page, which lists Azure Virtual Machines as IaaS, Azure App Service as PaaS and Microsoft 365 as SaaS, and from AWS's page, which labels Amazon EC2 as IaaS. NIST's own example for SaaS is web-based email.)

A simple way to remember it: with IaaS you rent an empty flat and bring everything; with PaaS it comes furnished and you bring your own belongings; with SaaS you check into a hotel room.

The four deployment models

NIST also describes where the cloud runs:

Model Meaning
Public cloud Open for use by the general public, run on the provider's premises. AWS, Azure and Google Cloud are public clouds
Private cloud Provisioned for exclusive use by a single organization. It may be run by that organization or a third party, on or off its premises
Community cloud Provisioned for a specific community of organizations with shared concerns
Hybrid cloud A composition of two or more of the above, bound together by technology that lets data and applications move between them

You will often hear "multi-cloud" (using more than one provider). That term is common in the industry but is not one of NIST's four models.


3. The shared responsibility model

This is the most important idea in cloud security, and the one most often misunderstood. The provider secures part of the stack. You secure the rest.

AWS states it as two halves:

  • Security of the cloud (the provider): "AWS is responsible for protecting the infrastructure that runs all of the services offered in the AWS Cloud." AWS lists hardware, software, networking and facilities.
  • Security in the cloud (you): "Customer responsibility will be determined by the AWS Cloud services that a customer selects."

AWS gives two examples. For Amazon EC2, "customers that deploy an Amazon EC2 instance are responsible for management of the guest operating system", along with their applications and the security group firewall. For what AWS calls abstracted services such as Amazon S3 and DynamoDB, "AWS operates the infrastructure layer, the operating system, and platforms", while "customers are responsible for managing their data (including encryption options)", classifying their assets and setting IAM permissions (AWS).

Who does what, by service model

Microsoft publishes a matrix for Azure. It is Microsoft's own illustration, and Microsoft notes it is guidance and not legal advice, but it shows the pattern well:

Responsibility area On-premises IaaS PaaS SaaS
Customer data You You You You
Identities and users You You You You
Configurations and settings You You You You
Applications You You Shared Shared
Network controls You You Shared Microsoft
Operating system You You Microsoft Microsoft
Physical hosts, network and data centre You Microsoft Microsoft Microsoft

(Microsoft Learn: Shared responsibility in the cloud, which also lists "client devices" as a row; it is "Shared" for SaaS.)

Read the top three rows. In every column, data, identities and configuration stay with the customer. Microsoft says so directly: "For all cloud deployment types, you own your data and identities." Google Cloud says it in the same spirit: "customers always remain responsible for their access policies and data" (Google Cloud Architecture Framework).

AWS also describes how some controls are inherited (physical and environmental security, which you fully inherit from AWS), some are shared (patch management: AWS patches the infrastructure, you patch your guest operating system and applications) and some are customer-specific.

Why this matters

The classic failure is an assumption: "We're on a big cloud provider, so it is secured." The provider secures the data centre and the platform. If you leave a storage bucket open to the world, give an application full administrator rights, or lose an access key, that is on your side of the line, and no amount of provider security will fix it. This is why cloud incidents are so often described as misconfiguration rather than as "the cloud was hacked". OWASP ranks it as a top web risk: A02:2025 Security Misconfiguration covers systems, applications and cloud services that are set up insecurely (see OWASP Top 10).


4. Identity is the front door

Because cloud services are reached over the network, the credentials that can call the cloud's API matter at least as much as any firewall. Whoever holds a powerful credential can create servers, read storage and delete backups from anywhere.

AWS's own IAM (Identity and Access Management) best practices are a good beginner checklist, and similar ideas apply on other platforms (AWS IAM best practices):

Practice What AWS says, in short
Prefer temporary credentials Human users should use federation with an identity provider and get temporary credentials. Workloads should use IAM roles, so there is "no need to distribute long lived credentials for an IAM user to your workloads running on AWS"
Require MFA For IAM users and the root user, require multi-factor authentication. AWS recommends "phishing-resistant MFA such as passkeys and security keys wherever possible"
Protect the root user The root user has "complete access to all AWS resources in your account". AWS strongly recommends not using it unless a task requires it, securing it with MFA, and not creating access keys for it (root user best practices)
Apply least privilege "Grant only the permissions required to perform a task"
Remove what you do not use Regularly review and remove unused users, roles, permissions, policies and credentials
Check for public and cross-account access Use IAM Access Analyzer to find resources that allow public or cross-account access

All of this is the same thinking you met in Authentication vs. Authorization and Security Design Principles: verify who is acting, then allow only what is needed. Long-lived access keys are also the credentials most likely to end up in a Git repository by accident, which is why Git and GitHub tells you what to do first if one is committed.

Roles and the metadata service

When your code runs on a cloud server, it needs credentials to call other services. The safe pattern is a role: AWS says that on compute services such as Amazon EC2 or Lambda, "AWS delivers the temporary credentials of an IAM role to that compute resource". That is much better than pasting a key into a file, but it makes the role's permissions important: anyone who can steal those temporary credentials, for example through a server-side request forgery flaw, can act with the same permissions. Server-Side Request Forgery explains the metadata service, the Capital One case (where public analyses report that a role's credentials were obtained this way) and why least-privilege roles limit the damage.


5. The classic mistake: public storage

Cloud storage services let you share data with the whole internet. That is useful for a public website and disastrous for a customer database. Each provider has a way to prevent it, and the defaults differ, so you should check:

Provider What the provider's documentation says
AWS (Amazon S3) "By default, new buckets, access points, and objects don't allow public access. However, users can modify bucket policies, access point policies, or object permissions to allow public access." The Block Public Access feature overrides such changes, and AWS recommends turning on all four of its settings for your account
Azure Blob Storage "By default, anonymous access to your blob data is always prohibited." But if a container is set for anonymous access, "any client can read data in that container"
Google Cloud Storage Public access prevention stops anyone making data public through IAM policies or ACLs, but the documentation describes it as something you enforce, noting that if the setting is not set for a resource, it "does not apply to the bucket"

(AWS, Microsoft, Google)

Two lessons:

  1. Safe defaults are not a guarantee. Someone with enough permissions can change a setting. AWS adds that Block Public Access settings "don't alter existing policies or ACLs", so removing the setting makes a bucket with a public policy "again publicly accessible".
  2. A wildcard principal is a warning sign. In an AWS resource-based policy, "using a wildcard (*) with an Allow effect grants access to all users, including anonymous users (public access)" (AWS IAM Principal element). The exercise in section 8 practises spotting this.

6. Protecting data and seeing what happened

Encryption

Encryption in the cloud is usually easy to turn on and easy to misunderstand. For example, Amazon S3 automatically encrypts all new objects with its own managed keys (SSE-S3, which uses 256-bit AES) from 5 January 2023, at no extra cost, and this cannot be disabled (AWS). That is good. But remember the shared responsibility split: AWS still tells you that you are "responsible for managing [your] data (including encryption options)". Encryption at rest protects against someone who steals the disks or a copy of the storage. It does not protect against an authorized identity, or an identity you accidentally authorized, reading the data through the normal interface, because the service decrypts it for them. Keys, key sizes and why key management matters are covered in Cryptography Basics, and data states in Data Security and Privacy Basics.

Logs

You cannot investigate what you did not record. In AWS, the CloudTrail Event history is turned on by default and gives "a viewable, searchable, downloadable, and immutable record of the past 90 days of management events in an AWS Region". It does not show data events, such as individual file reads, and for an ongoing record AWS says to "create an event data store or a trail" (AWS CloudTrail). The general lesson applies to every provider: know where the audit logs are, how long they are kept, what they leave out, and who looks at them. Security Operations explains how logs feed monitoring and incident response.


7. Other points worth knowing

  • Multi-tenancy. Because resources are pooled between customers (NIST's "resource pooling"), the provider's isolation between tenants is part of what you trust. NIST's guide to public cloud security and privacy, SP 800-144, reviews the challenges and the considerations for organizations that outsource data or infrastructure to a public cloud.
  • Location and law. NIST notes that you may be able to choose a country, state or data centre. Where your data sits can matter for the rules that apply to it (see GDPR and India's DPDP law in Data Security and Privacy Basics).
  • Do not forget the basics. Many cloud security failures are old problems in a new place: weak passwords, missing multi-factor authentication, unpatched servers (your job on IaaS), and secrets in code.
  • Provider "shared fate". Google describes its approach as "shared fate", which it frames as the provider taking responsibility for helping customers be more secure. Whatever the marketing, the customer's duty for data and access policies does not go away.

8. Practise: three exercises, no cloud account needed

Exercise 1: who is responsible?

Use the Microsoft matrix in section 3 and AWS's statements. Decide whether each task is yours or the provider's. Answers follow below.

  1. Applying security updates to the operating system inside a virtual machine you rent (IaaS).
  2. Applying security updates to the operating system under a PaaS web hosting service.
  3. Deciding who in your company can read the files stored in a SaaS application such as Microsoft 365.
  4. Guarding the physical building that holds the servers.
  5. Deciding whether a customer-data storage bucket should be readable by anyone.

Answers. 1: yours (IaaS, "Operating system: Customer"; AWS says customers manage the guest operating system). 2: the provider's (PaaS, "Operating system: Microsoft"). 3: yours ("Identities and users" and "Customer data" are the customer's in SaaS). 4: the provider's (physical datacenter), which AWS calls a control you inherit. 5: yours (data and access policies).

Exercise 2: read the policies

These are written in AWS's policy language. Each one is an Allow or Deny statement. For each, say what it permits and what you would change.

Policy A

{
  "Version": "2012-10-17",
  "Statement": [
    { "Effect": "Allow", "Action": "*", "Resource": "*" }
  ]
}

Policy B

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Action": "s3:GetObject",
      "Resource": "arn:aws:s3:::amzn-s3-demo-bucket/*"
    }
  ]
}

Policy C (attached to the bucket itself)

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Principal": "*",
      "Action": "s3:GetObject",
      "Resource": "arn:aws:s3:::amzn-s3-demo-bucket/*"
    }
  ]
}

Policy D (attached to the bucket itself)

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Deny",
      "Principal": "*",
      "Action": "s3:*",
      "Resource": [
        "arn:aws:s3:::amzn-s3-demo-bucket",
        "arn:aws:s3:::amzn-s3-demo-bucket/*"
      ],
      "Condition": { "Bool": { "aws:SecureTransport": "false" } }
    }
  ]
}

Answers.

  • A allows every action on every resource. That is far more than any single task needs, so it breaks least privilege. Replace it with only the actions and resources the identity really uses.
  • B allows reading objects (s3:GetObject) in one named bucket and nothing else. That is the kind of narrow permission to aim for. It says who can use it only when attached to a user or role, because it has no Principal.
  • C has "Principal": "*" with Allow. As in the AWS documentation quoted above, a wildcard principal with an Allow grants access to everyone including anonymous users, so every object in the bucket is public to read. If that is not intended, remove it. With S3 Block Public Access turned on, saving a policy like this is rejected (the BlockPublicPolicy setting), and a bucket that already has one is restricted to the owner's account and AWS services (RestrictPublicBuckets).
  • D denies every S3 action on the bucket when a request does not use HTTPS (aws:SecureTransport is false). AWS recommends this condition to allow only encrypted connections. Here the wildcard principal is correct, because it makes the restriction apply to everyone. An explicit deny overrides an allow in AWS policy evaluation.

(All four use syntax shown in AWS's documentation: the Version value 2012-10-17 is the current policy-language version, and amzn-s3-demo-bucket is AWS's placeholder bucket name.)

Exercise 3: if you have a cloud account of your own

Only look; do not create anything that might cost money or change a real system. Check that:

  1. The root/owner login has multi-factor authentication turned on and has no access keys.
  2. Storage public-access protection is on at the account level.
  3. You know where the audit log is and can find your own recent actions in it. (For AWS, viewing CloudTrail Event history has no CloudTrail charge.)

If you cannot tick all three, you have found your first real finding.


9. Common mistakes

Mistake The facts
"The cloud provider secures everything" The provider secures its part. Data, identities, access policies and configuration are always yours
"SaaS means no security work" In SaaS you still own your data, your users and their access. The Microsoft matrix lists these as the customer's in every model
"Public cloud means public data" "Public" describes who may use the cloud service. Your data is private unless you or your tools make it public
"Encryption at rest means nobody can read it" The service decrypts data for any identity that is allowed to read it. Encryption protects against stolen storage, not against over-broad permissions
"Default settings are safe, so I don't need to check" Defaults vary by provider and change over time. Someone with permissions can also change them
"A role is safer, so its permissions don't matter" Roles use temporary credentials, but anyone who obtains them gets the role's permissions. Keep them narrow
"Admin rights are easier, I'll tighten later" "Later" often never comes. Start narrow and widen as needed
"I'll put the access key in the code just for now" Keys in code get copied and pushed. Use roles or a secrets service, and never commit keys
"Logs are on by default, so I'm covered" Default logs may keep only a short window and may omit data-level events. Check what is recorded and for how long
"It's a cloud flaw, so it's the provider's problem" Most incidents come from customer-side configuration. Read the shared responsibility model for your service

Closing

The cloud is a model: pooled, self-service, network-accessed resources that you can scale and pay for as you use them. What changes for security is mainly who runs which layer. The provider takes the physical and platform layers; you keep your data, your identities, your permissions and your configuration. Most cloud breaches live in that second group.

Keep these points:

  • Know your model. IaaS, PaaS and SaaS decide how much you must secure. In IaaS you manage the operating system; in SaaS you still manage users and data.
  • Data, identities and access policies are always yours. No model moves them to the provider.
  • Treat credentials like keys to the building. Prefer roles and temporary credentials, require multi-factor authentication, lock down the root account and avoid long-lived keys.
  • Least privilege, always. One policy with "Action": "*" on "Resource": "*" undoes a lot of careful work.
  • Check for public exposure. Wildcard principals and public-storage settings are the classic leak.
  • Encrypt, but do not rely on it alone. It protects against stolen storage, not over-broad permissions.
  • Log, keep, and read the logs. Know their retention and what they leave out.
  • Defaults differ and change. Read the provider's current documentation.

If you can look at any cloud task and say whether it is your job or the provider's, you understand the foundation.

Related: Server-Side Request Forgery shows what happens when a cloud server's temporary credentials are reachable, Cryptography Basics explains the encryption and keys the cloud relies on, and Network Defence covers the layered network controls that cloud providers let you configure.