Cloud Security Basics: Shared Responsibility, IAM and Misconfigurations
What is cloud security?
Cloud security is the set of policies, controls and practices that protect data, applications and infrastructure running on cloud platforms such as AWS, Microsoft Azure and Google Cloud. The provider secures the underlying infrastructure, while the customer secures identities, data, configuration and workloads. Most cloud breaches come from customer-side mistakes, such as weak access control or public storage.
The shared responsibility model
Every major provider describes security as shared. The provider is responsible for security of the cloud: data centres, hardware, the network and the virtualisation layer. The customer is responsible for security in the cloud. Where the line falls depends on the service model:
| Layer | IaaS (virtual machines) | PaaS (managed platforms) | SaaS (applications) |
|---|---|---|---|
| Physical data centre and hardware | Provider | Provider | Provider |
| Operating system patching | Customer | Provider | Provider |
| Network controls and firewall rules | Customer | Shared | Provider |
| Application code and configuration | Customer | Customer | Provider, with customer settings |
| Identities, access and data | Customer | Customer | Customer |
Identity, access and data always remain the customer's job. A provider cannot stop you from granting everyone read access to a storage bucket.
Key terms
- IAM: Identity and Access Management, the service that controls who can do what.
- Principal: a user, group, role or service identity that can make requests.
- Policy: a document that allows or denies actions on resources.
- CSPM: Cloud Security Posture Management, tooling that continuously checks for misconfiguration.
Identity first: least privilege and MFA
In the cloud, identity is the main perimeter: anyone with valid credentials and enough permissions can reach resources from anywhere. Apply least privilege, granting only the actions and resources a person or workload needs, and nothing more.
- Lock away the root or owner account, enable MFA on it and do not use it for daily work.
- Require MFA for every human user, preferably phishing-resistant methods such as passkeys or security keys.
- Use roles with short-lived credentials for applications instead of long-lived access keys.
- Grant permissions to groups or roles, not to individual users.
- Review unused permissions and identities regularly and remove them.
This AWS IAM policy lets an application read objects from one bucket prefix and nothing else:
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "ReadReportsOnly",
"Effect": "Allow",
"Action": "s3:GetObject",
"Resource": "arn:aws:s3:::example-reports-bucket/reports/*"
}
]
}The underlying ideas are explained in authentication and authorisation.
Network controls: security groups and segmentation
A security group is a stateful virtual firewall attached to instances or network interfaces. Rules allow traffic by protocol, port and source; return traffic is allowed automatically. Network ACLs on AWS, and network security groups on Azure, add further filtering.
- Never allow SSH (port 22) or RDP (port 3389) from
0.0.0.0/0; use a bastion, a VPN or the provider's session manager service. - Allow database ports only from the application tier's security group, not from the internet.
- Place databases and internal services in private subnets without public IP addresses.
- Document the purpose of every rule so stale rules can be removed safely.
The same thinking applies on premises; see firewalls and VPNs.
Data protection: encryption and secrets management
Encrypt data in transit with TLS and at rest using the provider's key management service (AWS KMS, Azure Key Vault or Google Cloud KMS). Many services now encrypt storage by default, but you still control who can use the keys, whether you need customer-managed keys and how keys are rotated. Background on algorithms is in the cryptography guide.
Secrets such as database passwords, API keys and certificates should never sit in source code, container images or plain environment files committed to Git. Store them in a secrets manager (AWS Secrets Manager, Azure Key Vault, Google Secret Manager or HashiCorp Vault), grant access through roles and rotate them. Scan repositories for leaked secrets, and if one leaks, revoke and replace it immediately; deleting the commit is not enough.
Logging, monitoring and common misconfigurations
Turn on the control-plane audit log in every account and region: AWS CloudTrail, the Azure Activity Log and Google Cloud Audit Logs record who changed what and when. Send logs to a separate, protected account or project, keep them for the required period and alert on high-risk actions such as disabling logging or creating access keys for the root account.
| Misconfiguration | Risk | Fix |
|---|---|---|
| Public storage bucket | Anyone on the internet can list or download data | Enable account-level public access blocks; share through signed URLs |
| Admin ports open to the internet | Brute force and exploitation of remote access | Restrict sources; use a VPN or session manager |
Wildcard IAM permissions (*) | One leaked credential controls the account | Scope actions and resources; use permission boundaries |
| Audit logging disabled | Incidents cannot be investigated | Organisation-wide logging that member accounts cannot switch off |
| Unencrypted snapshots shared publicly | Full disk contents exposed | Encrypt by default; review sharing settings |
# AWS CLI read-only checks (run against your own account)
aws s3api get-public-access-block --bucket example-reports-bucket
aws s3control get-public-access-block --account-id 123456789012
aws iam get-account-summary
aws cloudtrail describe-trails
aws ec2 describe-security-groups --filters Name=ip-permission.cidr,Values=0.0.0.0/0 Practical exercise: secure a free-tier cloud account
Use a personal cloud account on the free tier, set a billing alert first, and work only in your own account.
- Enable MFA on the root or owner account and create a separate administrator identity with MFA for daily use.
- Create a storage bucket, confirm the public access block is on and upload a test file.
- Create a role that can only read that bucket and test that it cannot delete objects.
- Launch a small instance with a security group allowing SSH only from your own public IP address.
- Turn on the audit log, make one change and find the matching log entry.
- Delete the resources you created and confirm nothing billable remains.
You are done when you can show the MFA setting, the denied delete attempt and the log entry for your change. Cloud and network security labs are part of the Advanced Networking course.
Common mistakes
- Assuming the cloud provider is responsible for securing your data and access settings.
- Using the root account for everyday work or leaving it without MFA.
- Hard-coding access keys in application code or committing them to Git.
- Opening SSH or RDP to the whole internet for convenience.
- Enabling audit logs in one region or account only, leaving gaps elsewhere.
Frequently asked questions
Is the cloud less secure than an on-premises data centre?
Not inherently. Providers run strong physical and infrastructure security, but customers must configure identity, network and data controls correctly. Most incidents trace back to those customer-side settings.
Do the same rules apply on Azure and Google Cloud?
Yes. Service names differ, such as Microsoft Entra ID for identity on Azure and Cloud IAM on Google Cloud, but shared responsibility, least privilege, MFA, encryption and logging apply on every platform.
What is a CSPM tool?
Cloud Security Posture Management tools continuously compare cloud settings with policies or benchmarks, such as the CIS Benchmarks, and flag misconfigurations like public buckets. The method is similar to a security audit, run automatically.