In the previous lesson we saw that each service model splits the layers of the stack between the provider and the customer. That division has a direct consequence for security: if the provider manages some layers and you manage others, each side is responsible for protecting its own. This idea is known as the shared responsibility model, and every large provider publishes it and applies it in their contracts. Understanding it properly is probably the most important thing in this module, because most cloud security incidents are not caused by provider failures, but by customer misconfigurations made by people who thought "the cloud takes care of that". In this lesson you will learn what each side takes on in IaaS, PaaS, and SaaS, which responsibilities are never delegated, what typical mistakes come from misreading the model, what a least-privilege access policy looks like, and you will build Hortalia's responsibility matrix.
Warning: this lesson has an educational purpose. The configuration examples are simplified and illustrative. The security configuration of a real environment must be designed or reviewed by a qualified professional, following the provider's current documentation.
- Security OF the cloud versus security IN the cloud
AWS popularised a formula that sums up the model and is now used across the industry:
- The provider is responsible for security OF the cloud: the physical infrastructure and the software that makes it run. Data centers, hardware, physical network, hypervisors, and the services it manages.
- The customer is responsible for security IN the cloud: everything they put in, configure, and run inside it. Their data, their users and permissions, their configurations and, depending on the model, their operating systems and applications.
An analogy: a cloud provider is like a bank's safe deposit box business. The bank protects the building, the vault, the surveillance cameras, and the guards (security OF the premises). But if you lose the key to your box, lend it to the wrong person, or leave it open, the bank cannot prevent that (security IN your box).
flowchart TB
subgraph CLI["Customer: security IN the cloud"]
C1["Data"]
C2["Identities and access"]
C3["Service configuration"]
C4["Applications, OS, and virtual network (depending on the model)"]
end
subgraph PRO["Provider: security OF the cloud"]
P1["Platform software: hypervisor, managed services"]
P2["Hardware: servers, storage, physical network"]
P3["Data centers: physical access, power, cooling"]
end
CLI --> PRO
The exact line between the two blocks moves with the service model, exactly like the layer stack in Comparing IaaS, PaaS, and SaaS.
- The split by service model
2.1 IaaS
The provider protects the physical infrastructure and the virtualization. Everything from the operating system upwards is yours:
- Patching the guest operating system.
- Configuring the system firewall and the virtual network rules (security groups).
- Installing and maintaining antivirus or protection agents, where applicable.
- Securing the software installed (SQL Server, for example) and its accounts.
- Encrypting disks (the provider supplies the feature, often on by default, but you decide and manage the keys if you need to).
- Taking and testing backups.
2.2 PaaS
The provider also takes on the operating system, the middleware, and the runtime: it patches and maintains them. The customer remains responsible for:
- The security of their code (vulnerabilities such as SQL injection, outdated dependencies).
- The platform configuration: who can deploy, whether the database is reachable from the internet, which secrets the application uses and where they are kept.
- The data and the access of users and applications.
2.3 SaaS
The provider manages the whole application. The customer, however, keeps critical responsibilities:
- Who has an account and with what permissions; removing anyone who leaves the company.
- Enabling multi-factor authentication (MFA) and password policies.
- The sharing configuration: public links, external guests, automatic email forwarding.
- What data goes in, how it is classified, and how long it is kept.
- Reviewing which third-party applications connect to the account and with what permissions.
- Detailed table by area of responsibility
| Area | On-premises | IaaS | PaaS | SaaS |
|---|---|---|---|---|
| Physical security of the data center | Customer | Provider | Provider | Provider |
| Hardware (servers, disks, physical network) | Customer | Provider | Provider | Provider |
| Virtualization / hypervisor | Customer | Provider | Provider | Provider |
| Virtual network and traffic rules (firewall, internet exposure) | Customer | Customer | Shared | Provider |
| Operating system and its patches | Customer | Customer | Provider | Provider |
| Middleware and runtime (DB engine, web server, Python version) | Customer | Customer | Provider (the customer picks versions) | Provider |
| Code and application security | Customer | Customer | Customer | Provider |
| Service configuration (security options, sharing, logs) | Customer | Customer | Customer | Customer |
| Identities and access (users, roles, MFA) | Customer | Customer | Customer | Customer |
| Data (classification, encryption, backups, retention) | Customer | Customer | Customer | Customer |
| User devices (laptops, phones) | Customer | Customer | Customer | Customer |
How to read it:
- "Shared" means both sides are involved. In PaaS, for example, the provider protects the underlying network, but the customer decides whether their database accepts connections from the internet or only from a private network.
- Even when the provider manages something, the customer chooses options that affect security (runtime version, region, service tier). Choosing badly is a responsibility too.
- Responsibility does not disappear: it is partly transferred to the provider, and the customer keeps the obligation to choose a suitable provider and verify their guarantees (certifications, contracts). The regulatory aspects are covered in Security and Regulatory Compliance by Model.
- What is always the customer's responsibility
Look at the last four rows of the table: they belong to the customer in every model. They are worth memorising:
- The data. What data is stored, where, how it is classified, who can see it, how long it is kept, and whether there are copies outside the service. If an employee accidentally deletes the customers folder in a SaaS application, getting it back depends on the retention options configured or on your own backups, not on the provider's goodwill.
- The identities. Which people and applications have an account, how they authenticate (MFA), and what happens when somebody leaves the company.
- The access configuration. What permissions each identity has and which resources are public. Applying the principle of least privilege: every person or application should only have the permissions strictly necessary for their task.
- The devices access comes from. An infected laptop can steal a user's session, no matter how secure the cloud is.
A practical rule: the provider protects the lock; you decide who gets the key and what you keep inside.
- Typical incidents caused by misreading the model
The following scenarios are generic (they do not describe specific real cases), but they represent patterns that come up again and again in industry reports.
5.1 The accidentally public storage
A developer creates an object storage container (an Amazon S3 bucket, an Azure Blob Storage or a Google Cloud Storage container) to share a file with an external supplier and configures it as public "just for a moment". Months later, the container is still public and it holds customer exports.
- Why it happens: people believe "the cloud is secure" and forget that public access is a customer configuration decision.
- What is done today: the large providers block public access by default on new containers, but that block can be turned off. It is best to keep it on at account level, use temporary signed links for sharing, and review regularly with the provider's audit tools.
5.2 Leaked credentials
Some API access keys for the provider end up written into an application's code and are pushed to a public repository. Automated programs that crawl repositories find them within minutes and use them to spin up cryptocurrency mining machines or to read data.
- Why it happens: permanent keys with too many permissions are used and stored in the code.
- Mitigation: do not use long-lived keys when alternatives exist (roles and managed identities the provider assigns to the application), keep secrets in a secrets manager, enable secret scanning in repositories, limit permissions, and set up spend alerts (which are often the first sign of abuse).
5.3 SaaS without MFA
A company migrates its email to a SaaS suite but does not enable MFA. An employee falls for a phishing email and types their password into a fake page. The attacker gets into their mailbox, creates an auto-forwarding rule, and sends fake invoices to customers with a different bank account.
- Why it happens: people assume that because the provider is a large company, the account "is already protected". But the provider cannot know that whoever types the correct password is not the employee.
- Mitigation: mandatory MFA for everyone (preferably phishing-resistant methods, such as security keys or passkeys), blocking automatic forwarding to the outside, training users, and reviewing suspicious sign-ins.
5.4 The common pattern
| Incident | Layer affected | Whose responsibility was it? |
|---|---|---|
| Public storage | Configuration / data | Customer |
| Leaked credentials | Identities and access | Customer |
| SaaS without MFA | Identities | Customer |
| VM with an unpatched operating system on IaaS | Operating system | Customer |
| Vulnerability in the hypervisor | Virtualization | Provider |
In the first four cases, the provider worked exactly as expected. The failure was on the customer's side of the model.
- Least privilege in practice: an access policy explained line by line
Providers control permissions through identity and access management (IAM) systems. In AWS, permissions are expressed as policies in JSON format. Let us look at an example policy designed for Hortalia.
Situation: Laura wants the ERP backup process to upload the SQL Server backups every night to an Amazon S3 bucket called hortalia-erp-copias, inside the sqlserver/ folder. That process must not be able to delete or read the backups: if ransomware took control of the server, it could not destroy the existing backups using those credentials.
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "UploadERPBackups",
"Effect": "Allow",
"Action": "s3:PutObject",
"Resource": "arn:aws:s3:::hortalia-erp-copias/sqlserver/*"
},
{
"Sid": "ListOnlyBackupsFolder",
"Effect": "Allow",
"Action": "s3:ListBucket",
"Resource": "arn:aws:s3:::hortalia-erp-copias",
"Condition": {
"StringLike": {
"s3:prefix": "sqlserver/*"
}
}
}
]
}Line by line:
{ ... }: the whole document is a JSON object, a set of"key": valuepairs."Version": "2012-10-17": the AWS policy language version. It is not the date of the policy and it does not need updating: it is a fixed value indicating that the current syntax is in use. It must always be written like this."Statement": [ ... ]: a list of statements. Each one grants or denies a set of permissions. Here there are two.- First statement:
"Sid": "UploadERPBackups": an optional, human-readable identifier that helps document the purpose."Effect": "Allow": this statement allows something. The alternative is"Deny", which denies and always takes precedence over anyAllow."Action": "s3:PutObject": the only action allowed is uploading (writing) objects. Neithers3:GetObject(read) nors3:DeleteObject(delete) is included."Resource": "arn:aws:s3:::hortalia-erp-copias/sqlserver/*": the resource it applies to, identified by its ARN (Amazon Resource Name). It means "any object (*) inside thesqlserver/folder of thehortalia-erp-copiasbucket". Outside that folder, uploading is not allowed.
- Second statement:
"Action": "s3:ListBucket": allows listing the contents of the bucket (many backup tools need this to check what is there)."Resource": "arn:aws:s3:::hortalia-erp-copias": the ARN of the bucket itself, with no/; listing is an operation on the bucket, not on the objects."Condition": adds a condition so that the permission only applies in certain cases."StringLike": { "s3:prefix": "sqlserver/*" }: listing is only allowed if what is being listed starts withsqlserver/. The process cannot see what is in other folders of the bucket.
The key point is the philosophy: in IAM, anything not explicitly allowed is denied. That is why a good policy lists only the bare essentials. This policy, on its own, is not enough to protect the backups: in a real environment it would be combined with other measures (blocking public access, versioning or object lock to make the backups immutable, encryption, alerts, a copy in another region). Azure (with Azure RBAC and roles) and Google Cloud (with Cloud IAM and roles) apply the same principle with different syntax. We will go deeper into identity management in module 4, in Integration, Identity, and Governance of SaaS Applications.
- Hortalia's responsibility matrix
To ground everything above, Laura draws up a provisional matrix based on the hypothesis from the previous lesson: ERP on IaaS, store on PaaS, and email on SaaS. It states who is responsible for each task. "Provider" means the cloud or SaaS provider chosen (still to be decided).
| Area | ERP on IaaS (Windows VM) | hortalia-shop store on PaaS | Email on SaaS |
|---|---|---|---|
| Physical security, hardware, virtualization | Provider | Provider | Provider |
| Virtual network and internet exposure | Laura (the ERP must not be reachable from the internet; only from the warehouse network over VPN) | Marc configures, Laura reviews (the public website; the database, private) | Provider |
| Operating system patches | Laura (monthly Windows Server patching window) | Provider | Provider |
| Middleware patches (SQL Server, PostgreSQL, Python runtime) | Laura (SQL Server) | Provider applies them; Marc picks and upgrades the Python version when the platform retires the old one | Provider |
| Application | The ERP vendor publishes updates; Laura installs them | Marc (secure code, dependencies up to date) | Provider |
| Service security configuration | Laura | Marc, reviewed by Laura | Laura (external forwarding, antispam, sharing) |
| Identities and access | Laura (ERP accounts and VM administration accounts) | Marc (deployment accounts and secrets); Laura (cloud accounts) | Laura (joiners, leavers, mandatory MFA for all 120 users) |
| Data and backups | Laura (daily backups to S3 with the policy above and a quarterly test restore) | Marc (backups of the orders and customers database, retention) | Laura (retention and, if agreed, mailbox backup with an additional tool) |
| User training | Laura | Laura | Laura, with management's support |
| Cost monitoring and spend alerts (linked to abuse) | Sara receives the reports; Laura sets up the alerts | Same | Same |
Observations Laura shares with management:
- Laura carries a lot of responsibilities. Moving to the cloud does not remove her work, it transforms it; training or external support will have to be considered.
- The SaaS column is not empty. Email on SaaS does away with the server, but identity management, MFA, and configuration remain Hortalia's, and that is precisely where most incidents happen.
- The store introduces a new responsibility: code security. On PaaS, Marc does not patch servers, but he does have to keep the Python libraries up to date and protect the store's customer data.
- Sara plays a part too: cost monitoring is not purely financial; an unusual spend can be the first sign of stolen credentials.
This matrix will be revisited when the specific services are chosen in modules 2, 3, and 4, and consolidated in module 5.
Common Mistakes and Tips
- "It is in the cloud, so it is secure." The provider protects the infrastructure; your data, access, and configurations are still yours.
- "With SaaS there is nothing for me to do." You have identities, MFA, permissions, sharing, and data.
- Granting broad permissions "so that it works". Start with the minimum and widen when necessary; it is much harder to cut back later.
- Keeping access keys in code or in shared documents. Use roles, managed identities, and secrets managers.
- Not reading the provider's documentation. Every service publishes its own responsibility matrix; the general table is a guide, not a substitute.
- Assuming the provider takes the backups. Many services offer backups, but configuring them, deciding the retention, and testing the restore is the customer's job.
- Tip: for every service you subscribe to, answer in writing: who patches? who manages access? where are the backups and who tests them? If any answer is "I don't know", you have a risk.
Exercises
Exercise 1. State whether each task belongs to the provider or the customer: a) replacing a faulty disk in an Azure server; b) applying a security patch to Windows Server on an Amazon EC2 VM; c) updating the underlying database engine in Cloud SQL with a minor security patch; d) removing the Google Workspace account of an employee who has left the company; e) deciding whether the store's PostgreSQL database accepts connections from the internet.
Exercise 2. Marc proposes this policy for the backup process: "Action": "s3:*" and "Resource": "*". Explain what it would allow and why it is dangerous. Rewrite the two fields to match the least privilege of the example in section 6.
Exercise 3. After migrating email to SaaS, a Hortalia sales rep receives an email that looks like it is from the provider and "verifies" their password through a link. Whose responsibility is it under the model? List three measures Laura should have applied and two immediate actions now that it has happened.
Solutions
Solution 1. a) Provider (hardware); b) Customer (OS on IaaS); c) Provider (middleware on PaaS; the customer can choose the maintenance window and the major version); d) Customer (identities, always); e) Customer (access and network configuration, always).
Common mistake: thinking that on PaaS the customer decides nothing about networking. Whether or not to expose the database is the customer's decision.
Solution 2. "s3:*" allows every S3 action (read, delete, change permissions, make a bucket public...) and "Resource": "*" applies them to every bucket in the account. If somebody stole those credentials, or ransomware took over the server, they could delete all the backups and read any stored data. Least-privilege version:
Plus the second s3:ListBucket statement restricted to the sqlserver/ prefix, if the backup tool needs to list.
Solution 3. The responsibility is the customer's (Hortalia's): identities and user training. The provider cannot tell the sales rep apart from somebody who knows their password.
- Preventive measures: mandatory MFA (ideally phishing-resistant), blocking automatic forwarding to the outside, and regular phishing training. Alerts for suspicious sign-ins also help.
- Immediate actions: change the password and close all the user's active sessions; review the mailbox rules (forwarding, automatic deletions) and recent access to see whether the attacker actually got in. If personal data was accessed, take advice on whether it needs to be notified under the GDPR.
Conclusion
The shared responsibility model boils down to one sentence: the provider takes care of security OF the cloud and the customer of security IN the cloud. The boundary rises as we move from IaaS to PaaS and SaaS, but some responsibilities are never delegated: data, identities, access configuration, and devices. The most common incidents (public storage, leaked credentials, accounts without MFA) all come from forgetting this, and the principle of least privilege, as in the ERP backup policy, is the first line of defence. With Hortalia's matrix you have seen that the cloud redistributes the work of Laura, Marc, and even Sara, but it does not make it disappear.
With this lesson we close module 1. You now know what the cloud is and how it works inside, what its advantages and risks are, how IaaS, PaaS, and SaaS differ, and who answers for what in each model. From here we start digging into each model, beginning with the foundation of the stack: in module 2 we will study Infrastructure as a Service, its compute, storage, and networking components, and we will follow Laura on the road to moving Hortalia's ERP from the warehouse cabinet to a virtual machine in the cloud. We begin in Definition and Characteristics of IaaS.
