Cloud Security Basics: What Every Developer Needs to Know

In This Guide

  1. The Shared Responsibility Model: What the Cloud Secures vs What You Secure
  2. IAM: Identity Is the New Perimeter
  3. Encryption: At Rest and In Transit
  4. Network Security: VPCs, Security Groups, NACLs
  5. Secrets Management: Never Hardcode Credentials
  6. Logging and Monitoring: You Can't Protect What You Can't See
  7. The 7 Most Common Cloud Security Mistakes
  8. Compliance Basics: SOC 2, HIPAA, FedRAMP
  9. Frequently Asked Questions

Key Takeaways

In 2025, the most common cause of cloud data breaches was not sophisticated hacking — it was misconfigured IAM permissions and exposed S3 buckets. Companies spent millions on firewalls and intrusion detection systems while leaving storage buckets publicly readable or giving EC2 instances admin-level permissions they never needed.

Cloud security is not optional and it is not only the security team's job. Every developer who builds in the cloud — writing Lambda functions, deploying containers, provisioning RDS databases — makes security decisions constantly. Most of those decisions happen without a security review, which means the developer is the last line of defense.

This guide covers the concepts every developer needs to make good security decisions in the cloud, without requiring a security engineering background.

The Shared Responsibility Model: What the Cloud Secures vs What You Secure

Every major cloud provider operates on a shared responsibility model: the cloud secures the infrastructure (hardware, facilities, hypervisor, physical network), and the customer secures everything built on top of it (OS configuration, application code, data, network rules, IAM).

What AWS is responsible for:

What you are responsible for:

The Mental Model That Matters

Think of the cloud like renting office space. The building owner (AWS) secures the building, the elevators, and the electrical system. You are responsible for locking your office door, controlling who has keys, and not leaving sensitive documents on the lobby coffee table. The building cannot be held responsible if you leave your door open.

IAM: Identity Is the New Perimeter

In traditional networking, security meant building walls (firewalls, VPNs, DMZs) to keep attackers outside your network. In the cloud, those walls do not exist by default — your S3 bucket is reachable from anywhere in the world unless you explicitly restrict it. Identity and Access Management (IAM) is the replacement for the network perimeter.

Every action in AWS — reading an S3 object, launching an EC2 instance, writing to DynamoDB — is an API call that requires authentication (who is making this call?) and authorization (are they allowed to make this call?). IAM is the system that answers both questions.

Key IAM concepts:

The three IAM rules that prevent most breaches:

  1. Never use root account credentials for anything except account setup. The root account has unlimited permissions and cannot be restricted. Enable MFA on root and lock the credentials in a secure vault.
  2. Follow least privilege for every policy. Start with no permissions and add only what is explicitly needed. Never attach AdministratorAccess to a service role.
  3. Rotate and audit credentials regularly. Use IAM Access Analyzer to find unused permissions and overly permissive policies. Delete unused users and roles.

Encryption: At Rest and In Transit

Enable encryption at rest for every storage service: S3, RDS, EBS volumes, DynamoDB, and any other data store. Enable HTTPS/TLS for every network connection. These are not optional security enhancements — they are the baseline that every security audit, compliance framework, and enterprise contract requires.

Encryption at rest:

Encryption in transit:

Key management: Use AWS KMS for managing encryption keys. Never hardcode encryption keys in application code or environment variables. KMS integrates directly with S3, RDS, Secrets Manager, and most other AWS services — you reference a key ARN, and KMS handles the encryption/decryption transparently.

Network Security: VPCs, Security Groups, NACLs

All production workloads should run inside a VPC with private subnets for databases and application servers. Security groups control traffic at the instance level. NACLs control traffic at the subnet level. Public subnets should contain only load balancers, bastion hosts, and NAT gateways — not databases or application servers.

VPC architecture basics:

Security group rules:

Secrets Management: Never Hardcode Credentials

API keys, database passwords, OAuth secrets, and encryption keys must never appear in source code, environment variable files committed to git, or application logs. Use AWS Secrets Manager or Parameter Store to store secrets and inject them at runtime.

The most common pattern for exposed credentials in 2026 is still the same as it was in 2016: a developer hardcodes an API key in a config file, commits it to a public GitHub repository, and automated bots find it within minutes and start running up AWS bills or exfiltrating data.

The right way to handle secrets in AWS:

  1. Store secrets in AWS Secrets Manager (for sensitive credentials that rotate) or SSM Parameter Store (for non-sensitive config and secrets that do not need automatic rotation).
  2. Give your Lambda function, ECS task, or EC2 instance an IAM role with permission to read the specific secret — nothing else.
  3. Retrieve the secret at runtime using the AWS SDK: secretsmanager.get_secret_value(SecretId='my-db-password').
  4. Never log secret values, even in debug mode.

Enable git-secrets or a pre-commit hook to scan for secrets before they are committed. AWS offers free tools (Secrets Manager rotation, Security Hub findings for exposed credentials) to help detect and respond to accidental exposure.

The 7 Most Common Cloud Security Mistakes

These are the mistakes I see repeatedly in production environments, security audits, and post-breach analyses:

  1. Public S3 buckets with sensitive data: S3 buckets are private by default, but developers frequently disable Block Public Access to "test something quickly" and forget to re-enable it. Audit all buckets quarterly.
  2. Over-permissioned IAM roles: Attaching AdministratorAccess to Lambda functions or ECS tasks because it is "easier." Every role should have a specific, minimal policy.
  3. Hardcoded credentials in code or environment variables: Use Secrets Manager. Always.
  4. No MFA on admin accounts: Every AWS account with console access should have MFA enabled. Root account MFA is mandatory.
  5. Unencrypted databases: RDS and DynamoDB encryption are checkbox operations. There is no excuse for unencrypted production databases.
  6. Security groups open to 0.0.0.0/0: SSH, RDP, and database ports should never be open to the entire internet. Use VPN, bastion hosts, or Session Manager.
  7. No logging or alerting: CloudTrail, VPC Flow Logs, and GuardDuty are the minimum logging stack. If you are not logging, you cannot detect or investigate incidents.

Compliance Basics: SOC 2, HIPAA, FedRAMP

If you work with enterprise customers, healthcare data, or government contracts, you will encounter compliance requirements. Here is what the major frameworks require from a cloud architecture perspective:

SOC 2: Focuses on security, availability, processing integrity, confidentiality, and privacy. AWS is SOC 2 compliant for its infrastructure. Your application needs: access controls, encryption, audit logging, incident response procedures, and vendor management documentation.

HIPAA: Applies to any application that stores, processes, or transmits Protected Health Information (PHI). AWS services that are HIPAA-eligible are listed in the AWS HIPAA compliance page. You must sign a Business Associate Agreement (BAA) with AWS. Key technical requirements: encryption at rest and in transit, access logging, backup and disaster recovery, and minimum necessary access controls.

FedRAMP: Required for cloud services used by US federal agencies. FedRAMP authorization is a rigorous, expensive process. Unless you are targeting government contracts specifically, you will consume FedRAMP-authorized services (like AWS GovCloud) rather than building your own authorization. AWS GovCloud (US) has FedRAMP High authorization and is the standard cloud for federal workloads.

For most startups and SMBs, the practical compliance checklist is: enable CloudTrail, enable encryption everywhere, configure least-privilege IAM, document your security controls, and get a SOC 2 Type 2 report when enterprise sales require it.

Frequently Asked Questions

What is the most common cause of cloud security breaches?

Misconfigured IAM permissions and public S3 buckets with sensitive data are consistently the top two causes of cloud data breaches. Both are preventable with basic hygiene: follow least privilege for all IAM policies and enable S3 Block Public Access on all buckets unless explicitly required to be public.

Do I need a security certification to work in cloud security?

Not to get started. Understanding the shared responsibility model, IAM, encryption, and network security will take you far as a developer. If you want to specialize in cloud security, AWS Security Specialty and the CompTIA Security+ are the most recognized certifications. CISPs and CEHs are valued at senior levels.

How does encryption at rest work in S3?

When you enable SSE-S3 (server-side encryption with AWS-managed keys), AWS automatically encrypts every object when it is written to S3 and decrypts it when it is read by an authorized caller. This happens transparently — your application reads and writes S3 objects exactly as before. The encryption protects against physical media theft from AWS data centers but does not protect against misconfigured access policies.

What is AWS GuardDuty and should I enable it?

GuardDuty is AWS's managed threat detection service. It analyzes CloudTrail logs, VPC Flow Logs, and DNS logs to detect threats like unusual API calls, compromised credentials, cryptomining, and reconnaissance activity. It costs roughly $0.80 per million events analyzed. For any production account, GuardDuty should be enabled — the cost is trivial compared to the detection value.

Security is not optional. Build it right from the start. Get the skills.

Join professionals from Denver, NYC, Dallas, LA, and Chicago for two days of hands-on AI and tech training. $1,490. October 2026. Seats are limited.

Reserve Your Seat

Note: Information in this article reflects the state of the field as of early 2026. Technology evolves rapidly — verify specific version numbers, pricing, and service availability directly with vendors before making decisions.

BP

Bo Peng

AI Instructor & Founder, Precision AI Academy

Bo has trained 400+ professionals in applied AI across federal agencies and Fortune 500 companies. Former university instructor specializing in practical AI tools for non-programmers. Kaggle competitor and builder of production AI systems. He founded Precision AI Academy to bridge the gap between AI theory and real-world professional application.

Explore More Guides