In July 2019, Capital One found that a former AWS employee had taken advantage of a misconfigured web application firewall to get into the personal data of more than 100 million customers in the United States and Canada. This breach did not exploit any vulnerability in AWS's infrastructure.

Security worked as designed in AWS itself. The failure was in how Capital One had set up its system. An IAM role that was too permissive was attached to an EC2 instance and once inside the application server, the attacker could query the AWS metadata service and get credentials that gave access to sensitive S3 buckets.

Regulatory fines of $80 million went to OCC and Capital One also invested about $150-300 million in remediation. Customer trust took years to rebuild as well and all this stemmed from a misconfiguration that proper IAM configuration and network segmentation could have stopped.

Many organizations find the hard way that moving to the cloud does not outsource security and the incident brought home that lesson.

Cloud security is a shared responsibility. The provider secures the infrastructure and the customer is responsible for everything built on top of it. Breaches most often do not come from cloud infrastructure failing. They come from customers misconfiguring the permissions and controls that they manage themselves.

Cloud security is not the provider's problem alone and it is also not the customer's alone.[2] It changes who is responsible for what and misunderstanding those boundaries is exactly where breaches occur.

There is a shared responsibility with boundaries that are clearly defined and organizations that do not grasp those boundaries pay the price.


The Shared Responsibility Model

Cloud security rests on the shared responsibility model as its foundational concept. AWS put it in place and Azure and Google Cloud have the same structure.[5] Everything else depends on grasping it first.

The cloud provider is responsible for security of the cloud, the physical security of data centers, the hardware infrastructure, the hypervisor that isolates tenant virtual machines, the global network fabric, and the host operating systems on managed services.

Billions go into security of this layer by AWS, Azure and Google Cloud. Major providers do not see physical data center breaches among their ranks. Hypervisor escapes have appeared in research but are very rare in production.

When AWS or Azure has a major outage, it is almost never due to a security failure at their infrastructure layer.

You are responsible for security in the cloud. You are responsible for security in the cloud. Your data, your access controls, your application code, your operating system patches (for IaaS), your encryption configuration, your network settings as well as your compliance with relevant regulations.

Most cloud security incidents come from here and they result from customer misconfiguration and oversight rather than any failure by the provider.

The division of responsibility shifts depending on the service model:

ResponsibilityIaaS (e.g., EC2)PaaS (e.g., App Engine)SaaS (e.g., Salesforce)
Physical infrastructureProviderProviderProvider
Hypervisor/virtualizationProviderProviderProvider
Network infrastructureProviderProviderProvider
Operating systemCustomerProviderProvider
Runtime/middlewareCustomerProviderProvider
Application codeCustomerCustomerProvider
Data encryptionCustomerCustomerShared
Access managementCustomerCustomerCustomer
Data classificationCustomerCustomerCustomer

As you move up the stack from IaaS to SaaS and the provider takes on more responsibility, the customer does not lose responsibility for access management and data governance. These two areas stay the customer's domain no matter what service model is used.


Identity and Access Management: The Highest-Leverage Control

IAM (Identity and Access Management) is the most critical security control in cloud environments, and misconfigured IAM is the most common cause of cloud security incidents. Getting IAM right prevents the majority of breaches; getting it wrong exposes everything.

Core IAM Concepts

Users stand for individual people or service accounts. Every user comes with credentials such as passwords and access keys as well as policies that say what actions the user can carry out on which resources.

Groups collect users who share the same permissions. Managing permissions through groups rather than individual user assignments is more maintainable at scale, when a role changes, you update one group policy rather than dozens of individual user policies.

Roles grant short-lived credentials for particular jobs and instead of handing an app permanent access keys (keys that can be stolen and used over and over again), the app takes on a role that gives time-limited credentials for the permissions needed.

Roles are the preferred mechanism for granting access to applications and services.

Policies are documents defining what actions are allowed or denied on what resources. Policies attach to users, groups, or roles. In AWS IAM, explicit deny always overrides explicit allow, and no permissions are granted unless explicitly allowed.

IAM Best Practices

Apply least privilege consistently. This principle, give each entity only the minimum permissions necessary for its function, is the most important IAM practice. A developer who needs to read from a database should not have permission to delete it.

A monitoring service that reads metrics should not have permission to modify infrastructure. Wildcard permissions (Action: "*" or Resource: "*") should be viewed with deep suspicion.

Example. An IAM role attached to a web server that had s3:GetObject permission on all S3 buckets instead of just the buckets the web app needed was what the Capital One breach took advantage of. The role should have been limited by proper least-privilege to the three or four bucket ARNs that the application actually needed access to.

Never use root accounts for daily work. With unlimited access to everything, unable to have permissions taken away and requiring treatment like nuclear launch codes, cloud provider root accounts should never be used for daily work.

Build them, protect them with hardware MFA and put the MFA device in a physical safe. Use them only for the rare tasks that really need root privileges (recovering from a locked-out IAM configuration and the like).

Enable Multi-Factor Authentication everywhere. To authenticate, MFA needs something you know (password) and something you have (authenticator app or hardware token). Of all controls against credential compromise, multi-factor authentication is by far the most effective for protecting cloud console access as well as privileged accounts.

Enable it for all human users, required for users with any meaningful permissions.

Rotate and audit access keys. Security liabilities are long-lived access keys. A key that has existed for years may have been accidentally committed to source code, sent out in a Slack message or kept in a configuration file on a laptop that was compromised.

Automated key rotation should be set up to run every 90 days at most. Unused keys need to be audited and revoked if they have not been used for 30 days or more and wherever possible, roles rather than access keys should be used for machine-to-machine authentication.[1]

Segregate duties. The same person should not have both the ability to write IAM policies and to approve access requests for that same person. The same person should not be able to send something live and also edit audit logs. That segregation stops any one user from taking down the whole system by themselves.

Use IAM Access Analyzer. Resources such as S3 buckets, KMS keys and IAM roles that are accessible from outside your account or organization get automatically identified by AWS IAM Access Analyzer, by Azure's equivalent tools and by GCP Policy Analyzer. Set this up to run continuously and deal with any access that you did not intentionally give.


Network Security Architecture

Security for cloud networks works in layers. Every layer gives a different kind of protection and together they give defense-in-depth.

Virtual Private Cloud (VPC)

A VPC is an isolated network segment within the cloud provider's infrastructure. By default, resources within a VPC can communicate with each other but are isolated from other customers and from the internet. The VPC provides the fundamental network boundary.

Always work with a VPC when building infrastructure (AWS gives a default VPC but a custom VPC configured explicitly is even more secure) and do not put sensitive resources anywhere outside a VPC.

Subnets: The Public/Private Divide

Within a VPC, subnets separate resources by exposure level.

Public subnets have routes to the internet through an Internet Gateway. Appropriate for resources that must be directly internet-accessible: load balancers, NAT gateways, and sometimes web servers.

Private subnets have no direct internet access. All outbound internet traffic routes through a NAT Gateway in a public subnet. Appropriate for: databases, application servers, caches, internal services: any resource that should not receive inbound connections from the internet.

The pattern for a three-tier application: load balancer in public subnets, application servers in private subnets, databases in private subnets. Internet traffic reaches only the load balancer; databases are never directly reachable from the internet.

Example. In 2017, an unpatched Apache Struts vulnerability on a web server was what Equifax's data breach (147 million records compromised) exploited.

Had the database been in a private subnet instead of being accessible from the web tier via overly broad security group rules, the attacker's path from the compromised web server to the database would have been blocked at the network level. That would have limited the breach scope a lot.

Security Groups

Security groups act as stateful firewalls attached to individual resources (EC2 instances, RDS databases, load balancers). They define which inbound and outbound traffic is permitted by source IP, CIDR, other security groups, or protocol/port.

Key security group practices:

  • Default to deny all inbound traffic; explicitly open only what is necessary
  • Allow inbound from other security groups rather than IP ranges where possible (more maintainable)
  • Never allow 0.0.0.0/0 inbound on port 22 (SSH) or 3389 (RDP) to production instances
  • Administrative ports should be restricted to specific IP ranges or accessed via bastion hosts/Session Manager

Secure Administrative Access

Never expose SSH or RDP directly to the internet for production systems. Options:

AWS Systems Manager Session Manager: Provides browser-based shell access to EC2 instances without opening any inbound ports. Access is authenticated through IAM, fully logged, and works without a bastion host. Session Manager should be the default administrative access method.

Bastion hosts (jump boxes): A single, hardened instance in a public subnet, accessible from known IP ranges, through which administrators SSH to private instances. Simpler than Session Manager to understand, but requires managing the bastion host as additional infrastructure.

VPN connections: AWS Site-to-Site VPN or Client VPN provides encrypted access to the VPC from corporate networks or individual machines. Appropriate for organizations that need broad VPC access from managed corporate machines.


Encryption: Data at Rest and in Transit

Encryption makes sure that even if storage gets physically compromised or network traffic is intercepted, the data stays unreadable without the right keys and so it protects data confidentiality.

Encryption at Rest

Data stored in cloud storage should be encrypted. Cloud providers offer this transparently for most storage services:

  • AWS. Encryption is standard across S3, EBS, RDS, DynamoDB and most other storage services. Keys can be managed by the provider as SSE-S3 or by the customer through KMS.
  • GCP. All data at rest comes with encryption by default and customers can use Cloud KMS to get customer-managed keys.
  • Azure. Storage Service Encryption is on by default and Azure Key Vault is used for customer-managed keys.

For most organizations, provider-managed encryption (the default) provides adequate protection against infrastructure-level compromise.

For workloads handling particularly sensitive data (healthcare records, financial data), customer-managed keys (CMK) provide additional control: you can revoke the key, disabling access to the data, and you have a complete audit trail of key usage.

The critical principle is encrypt everything above all databases, file storage and backup archives. Encryption adds only a small amount of computational overhead but it gives large protection.

Encryption in Transit

All network communications should use TLS (Transport Layer Security). This includes:

  • All internet-facing connections (HTTPS for web applications and APIs)
  • Internal service-to-service communications within the VPC
  • Administrative access (SSH is encrypted; HTTP admin interfaces are not acceptable)
  • Database connections (use TLS options in RDS, Cloud SQL, Azure Database)

Free TLS certificates that renew automatically come with AWS Certificate Manager, Google-managed SSL certificates and Azure App Service Managed Certificates for certificate management. In 2024 there is no acceptable reason to run sensitive applications over HTTP.

Key Management

Keys must be:

  • Never stored alongside encrypted data: A key stored in the same S3 bucket as the data it encrypts provides no protection
  • Rotated regularly: Annual rotation at minimum; quarterly for high-sensitivity data
  • Access-controlled: Only services that legitimately need decryption capability should have access to keys
  • Audited: Every key usage should be logged and reviewed

Managed key management services from AWS KMS, Azure Key Vault and Google Cloud KMS all take care of rotation, access control and audit logging. Building custom key management should be avoided in favor of these services.


Data Protection and Access Controls for Storage

S3 and Object Storage Security

Public S3 buckets have been among the most common sources of large-scale data exposures. Organizations including FedEx, Verizon, Accenture, and hundreds of others have inadvertently exposed data through publicly accessible buckets.

By default, AWS S3 Block Public Access settings (available at account and bucket level) should be on everywhere. Any bucket policy or ACL that would give public access gets overridden by these settings. Set them up at the account level and any exception needs to have explicit justification and review.

Additional S3 security controls:

  • Bucket policies: Control access at the bucket level, in addition to IAM policies
  • VPC Endpoints: Allow EC2 instances to access S3 without traffic traversing the internet
  • S3 Access Logs: Log all requests to S3 buckets for audit purposes
  • Object Lock. For compliance reasons, make sure that objects cannot be deleted or modified during a set retention period.
  • Versioning: Enable versioning to protect against accidental deletion and ransomware

Database Security

Databases contain the highest-value data and deserve layered protection:

  • No public accessibility. There can be no public-facing endpoints on database instances and each access has to pass through application tiers or administrative hosts inside the VPC.
  • Encryption at rest and in transit: Enable both for all production databases
  • Least-privilege database accounts. Database users for applications should have only the permissions that the application needs. That means SELECT/INSERT/UPDATE for application tables and no DROP, TRUNCATE or access to system tables.
  • Automated backups: Maintain encrypted backups in multiple availability zones
  • Audit logging: Enable database audit logging for compliance and forensics
  • Secrets management. Database credentials must go into AWS Secrets Manager, Azure Key Vault or HashiCorp Vault and they should never appear in environment variables, configuration files or code.

Secrets Management: Eliminating Hardcoded Credentials

Hardcoded credentials. Among the most persistent and damaging cloud security vulnerabilities are those that appear in source code, configuration files or environment variables.

Credentials committed to Git repositories are:

  1. Visible to everyone with repository access
  2. Persisted in git history even after deletion
  3. Frequently exposed through public GitHub repositories, either accidentally or through misconfiguration

The solution is systematic secrets management:

AWS Secrets Manager. Put away and let AWS rotate automatically database credentials, API keys and other secrets. At runtime, apps get secrets through an API call and the service supports automatic rotation for RDS passwords and custom rotation for other secret types.

AWS Parameter Store: Simpler (less expensive) alternative for configuration data and non-sensitive parameters. Supports encrypted parameters using KMS.

HashiCorp Vault. An open-source secrets management tool that operates across cloud providers as well as on-premises.[9] It gives dynamic secrets by generating short-lived credentials on demand instead of storing long-lived ones. It also gives policy-based access control and full audit logging.

OIDC for CI/CD. OpenID Connect is supported by modern CI/CD platforms such as GitHub Actions and GitLab CI. Pipelines can authenticate to cloud providers without storing any credentials and the pipeline proves its identity cryptographically. Temporary credentials come from the cloud provider.

This eliminates the category of long-lived CI credentials entirely.

Prevent credential leakage:

  • Git pre-commit hooks. Tools including git-secrets, detect-secrets and Gitleaks look for credential patterns in commits before those commits enter version control.
  • GitHub secret scanning. Known credential patterns such as API keys and private keys get automatically detected in public repositories and providers get notified.
  • Periodic secret rotation: Even properly managed secrets should be rotated regularly

Logging, Monitoring, and Incident Detection

Detection counts as much as prevention. There is no security posture that is perfect and how fast a breach is detected makes the difference between a minor incident and a catastrophic breach. Breach detection without active monitoring takes an average of months to measure.

Enable Cloud-Native Audit Logging

Every major cloud provider offers comprehensive API audit logging:

  • AWS CloudTrail: Records all API calls made in your AWS account, including who made them, when, from where, and what the response was. Enable CloudTrail in all regions and protect the log archive from modification.
  • Azure Activity Log: Similar to CloudTrail for Azure resource operations
  • GCP Audit Logs: Admin Activity logs (always on), Data Access logs (must be enabled), and System Event logs

Forensic investigation following an incident needs these logs. Without them, you cannot find out what the attacker did, what data was accessed or what cleanup is needed.

Threat Detection Services

Cloud-native threat detection services analyze activity patterns and identify suspicious behavior automatically:

AWS GuardDuty. Machine learning is used by this service to continuously analyze CloudTrail logs, VPC Flow Logs and DNS logs to find threat indicators.

Patterns such as API calls coming from known malicious IPs, credential exfiltration, abnormal data access patterns, cryptocurrency mining and communication with known command-and-control infrastructure can all be detected. Every AWS account and every region need GuardDuty turned on.

Azure Defender. This brings threat detection into Azure Security Center and analyzes logs across Azure services to look for attack patterns.

Google Cloud Security Command Center. This is centralized security and risk management for GCP as well as threat intelligence and anomaly detection.

Third-party SIEM. Security Information and Event Management tools such as Splunk, Elastic Security and Sumo Logic bring together logs from cloud and on-premises sources for organizations operating complex environments. Correlation analysis that individual cloud tools cannot do becomes possible through this aggregation.

Critical Security Alerts

At minimum, configure alerts for:

  • Root account login (should almost never happen)
  • IAM policy changes (who changed what permissions)
  • Security group changes (new inbound rules)
  • S3 bucket policy changes
  • Failed authentication attempts (credential stuffing, brute force)
  • API calls from unusual geographic locations
  • Large data transfers out of the environment

Responders need to know exactly what to do when an alert fires and improvisation under pressure is avoided by giving every alert a documented response procedure so that people know what to do.


Common Cloud Security Vulnerabilities

Cloud security assessments show the same misconfiguration patterns appearing time after time. Once known, those patterns can be prevented systematically.

Publicly accessible storage continues to be the top reason for large-scale data exposure. Customer databases, credentials, healthcare records and financial data have been exposed by S3 buckets, Azure Blob containers and GCS buckets set to public access for hundreds of organizations.

Mitigations are simple to put in place. Enable S3 Block Public Access at the account level, run automated checks on buckets that are public and treat any exception for a public bucket as needing formal approval.

Overly permissive IAM policies expand the blast radius of any compromise. Administrator-level policies granted to services that need read access to a single bucket, wildcard resource permissions (*), and permissions granted for convenience without review: all create unnecessary risk.

Regular IAM access reviews using tools such as IAM Access Analyzer and CloudSplaining give the antidote.

Unpatched vulnerabilities in operating systems and dependencies run on cloud infrastructure just as on-premises. Cloud does not automatically keep your software updated.

Automated patching can be put in place for EC2 instances through AWS Systems Manager Patch Manager and RDS should have automatic minor version upgrades enabled. An SBOM should be maintained for container images.

Missing encryption. Databases and storage still lack encryption even after years of guidance and unencrypted ones continue to appear in cloud assessments. Use AWS Config rules, Azure Policy or GCP Organization Policies to put in place policy-as-code checks that will enforce encryption across the account.

Disabled logging means breaches go undetected. Get CloudTrail, VPC Flow Logs and application-level logging up and running everywhere. Put logs in a place that is separate and access controlled so that an attacker who gets hold of application infrastructure cannot delete the logs and cover their tracks.

Overly broad CORS policies on web applications and APIs that permit all origins (*) in particular can make cross-site data theft possible.[6] Set up CORS to allow only the origins that are legitimate.


Compliance Frameworks for Cloud Environments

To meet regulatory requirements in cloud environments means grasping what the regulations demand as well as how shared responsibility works.

SOC 2 looks at security controls against the Trust Services Criteria. Each cloud provider (AWS, Azure, GCP) gives its own SOC 2 certification for its infrastructure.

Though these are valuable evidence, they do not meet your SOC 2 requirement. Security controls, access management and data handling for your application are your responsibility and they must be audited separately.

PCI-DSS applies to systems that store, process or transmit payment card data. Cloud environments can comply with PCI standards though they require specific configurations. Network segmentation, encryption in transit and at rest, access logging and regular vulnerability scanning make up what those configurations are.

AWS has a PCI-DSS Compliance program with documentation on the shared responsibility model for PCI.

HIPAA regulates healthcare data in the United States. All three cloud providers, AWS, Azure and GCP, provide HIPAA Business Associate Agreements (BAAs). They also document which of their services are HIPAA eligible.

Customer-side controls are required for HIPAA compliance. These are encryption of protected health information (PHI) at rest and in transit, access controls, audit logging and procedures for notifying of a breach.

GDPR applies to personal data of EU residents regardless of where the organization operates.

Cloud environments call for these key requirements. Data must stay resident where EU personal data does not go out of EU regions without adequate protections and users have the right to erasure that lets them delete specific data of theirs. The environment needs data processing documentation and set timelines for telling people about breaches.

In order to build compliant systems instead of adding compliance on top of what already exists, it is essential to understand how DevOps practices get security into the development cycle using the shift left method.


Security Automation: Security as Code

Manual security processes cannot scale because of how fast and dynamic cloud moves. Security must be automated for cloud security to work well.

Infrastructure as Code security scanning: Tools like Checkov, Terrascan, and tfsec scan Terraform, CloudFormation, and other IaC templates for security misconfigurations before resources are deployed.[10] A policy-as-code check that blocks deployment of unencrypted databases prevents the misconfiguration from ever reaching production.

Automated compliance checking. Cloud providers like AWS, Azure and GCP use Config Rules, Azure Policy and GCP Organization Policies to set up what cloud resources must be configured and automatically signal or fix any deviation.[4] When an S3 bucket is created without Block Public Access enabled, an AWS Config rule that demands all S3 buckets have Block Public Access turned on will sound an immediate alarm.

Container image scanning: CI/CD pipelines should scan container images for vulnerabilities before pushing them to registries. Snyk, Trivy, and Clair scan images against vulnerability databases and block deployment of images with critical vulnerabilities.

Runtime security monitoring. Tools like Falco (which is open source), Aqua Security and Sysdig run at runtime and monitor container and Kubernetes workloads for anything that static analysis does not catch, namely unexpected outbound connections, unusual file system writes and attempts to raise privileges.


Building a Cloud Security Program

Security is not something you add as a feature to cloud infrastructure. It is a practice that you build into everything from the start.

Start with inventory. What you do not know exists cannot be secured. Put in place full tagging, make sure resource inventory tools are enabled (AWS Config, Azure Resource Graph) and build dashboards showing all resources across all accounts and regions.

Prioritize identity. Most breaches happen because of how IAM is configured. Get IAM expertise in place and do regular access reviews. Everywhere MFA has to be enforced and privileges need constant auditing.

Automate the basics. Enforced by infrastructure code rather than checked manually, encryption at rest, encryption in transit and private subnets for databases have to be put in place programmatically and not by hand as humans forget.

Assume breach and invest in detection. It is impossible to prevent breaches perfectly. Set up logging infrastructure, put threat detection in place, set up incident response procedures and work through them.[3]

A team that has run tabletop exercises and knows exactly what to do when GuardDuty fires a critical alert responds in hours. A team improvising from scratch responds in days.

Integrate security into the development process. A fix that stops a vulnerability from getting to production in the first place is the cheapest security fix. Code reviews, automated scans in CI/CD pipelines, developer security training and threat modeling at design time find problems early, when they cost least to fix.[7]

As much as a technical concern, cloud security is a competitive concern as well. From the start by building security into their cloud architecture, companies hold onto trust, dodge regulatory fines and pay less for remediation than firms that regard security as something to deal with later.


What Research and Industry Reports Show About Cloud Security

Academic research, industry surveys and large-scale breach analysis give a strong empirical case that calls for putting more investment specifically into cloud security.

The Verizon 2023 "Data Breach Investigations Report" looked at 16,312 security incidents and 5,199 confirmed data breaches across 95 countries. Cloud misconfiguration errors were the most common way that cloud security failed and accounted for 21% of all breaches analyzed by the DBIR. That was up from 3% in 2016.

Cloud adoption shows in the growth as misconfigurations that used to affect only isolated on-premises systems now expose cloud storage and databases that are accessible from the public internet.

Human involvement through social engineering, mistake or misuse came into play in 74% of breaches as direct cloud security implications come out of this DBIR finding. Misconfigured cloud storage mainly S3 buckets that were made publicly accessible without authorization made up the largest error category.

In the "Unit 42 Cloud Threat Report" (2022) by Palo Alto Networks, 65% of the 1,300 organizations across 210,000 cloud accounts looked at had cloud security incidents coming from misconfiguration instead of software vulnerabilities.

At least one publicly exposed storage bucket was found in the report for each organization and 80 percent of organizations allowed IAM roles that were too permissive. Just 44 percent of organizations had turned on default encryption for all storage services.

When a company had put in place Infrastructure as Code with automated policy enforcement through Checkov, Bridgecrew or a similar tool, its misconfiguration rate was 70 percent lower than that of a company depending on manual configuration review.

Spencer Gietzen's "AWS IAM Privilege Escalation" research (published in 2020 and last updated in 2023 on github.com/RhinoSecurityLabs) lists 21 different ways for an attacker who gets limited IAM access to escalate up to full admin permissions inside AWS IAM.

At Rhino Security Labs, Gietzen's research found the most dangerous patterns. IAM PassRole combined with EC2 RunInstances lets an attacker hand off a highly privileged role to a new instance they control and Lambda CreateFunction with PassRole makes it possible to create a Lambda function that has an administrator role.

Research showed that least-privilege IAM is not just a best practice. It is also a defense against specific, documented attack chains that adversaries use actively.

Based on input from 700 security practitioners, the 2022 "Top Threats to Cloud Computing" report by the Cloud Security Alliance named the "Magnificent 7" as the top threats.

Here is how the ranking goes. Insufficient identity, credentials, access and key management ranks #1 as the top item. In second place come insecure interfaces and APIs (#2). Misconfiguration and inadequate change control are next at #3. The cloud security architecture and strategy are missing at #4. Unsecured third-party resources follow at #5 and insecure software development at #6. System vulnerabilities bring up the rear at #7.

Threats were weighted by actual incident frequency, remediation cost and difficulty of detection in the ranking method. Both the large attack surface and the steady failure of organizations to put least-privilege in place are what keeps IAM failures at the top for the fifth year in a row.

Rui Han and colleagues at the University of Illinois at Chicago published "CloudFence. Enabling Users to Audit the Use of Their Data in the Cloud" (2018, IEEE Symposium on Security and Privacy) and in it they showed specific data flow audit techniques for cloud environments.

When set up right for high-value data resources, cloud audit logging configurations (equivalent to AWS CloudTrail) detected 94% of unauthorized access patterns in their research. Yet only 23% of the organizations in their study sample had turned on full audit logging for all storage and database services.

That finding shows the detection gap is not a limit of the tooling available and it is a gap in how the tools are configured and the processes run.

According to the IBM "Cost of a Data Breach" report (2023, based on 553 organizations that had data breaches), a cloud data breach cost an average of $4.75 million versus $4.11 million for on-premises breaches.

However, organizations with mature cloud security postures (defined as implementing all components of the shared responsibility model: IAM least privilege, encryption, logging, and network segmentation) had breach costs 28% lower than organizations without mature postures ($3.42 million vs. $4.75 million).

Misconfiguration-enabled breaches cost 16% more on average than breaches from exploited vulnerabilities. That is because attack dwell time (the period from first access to detection) was 47 days longer for breaches enabled by misconfiguration.

Real-World Case Studies in Cloud Security Incidents and Remediation

Security programs have patterns from documented cloud security incidents they can target. Companies that put their configurations right to stop breaches offer equally instructive examples.

Capital One's $80 Million Misconfiguration Breach (2019): The Capital One breach of July 2019 is the most cited cloud security incident in the industry. A former AWS employee exploited a misconfigured Web Application Firewall on a Capital One EC2 instance to perform a server-side request forgery (SSRF) attack.

The attack retrieved credentials from the AWS instance metadata service (IMDS) for an IAM role attached to the EC2 instance. That role had s3:ListBuckets and s3:GetObject permissions on all S3 buckets rather than only the specific buckets the application required.

About 106 million individuals were affected as the attacker got access to 30 folders containing sensitive customer data.[8] Capital One paid an $80 million fine to the OCC. The company put in about $300 million on remediation and cybersecurity improvements and dealt with several class action suits.

Three technical controls in particular would have stopped the breach. They are restricting the IAM role's S3 permissions to specific bucket ARNs for least-privilege management, blocking outbound SSRF by limiting the WAF configuration or turning on IMDSv2 that calls for session-oriented requests that SSRF cannot easily do.

Equifax's Unpatched Vulnerability and Network Architecture Failure (2017). The breach of 147 million consumer records came from an unpatched Apache Struts vulnerability (CVE-2017-5638) but the cloud security lessons go beyond patching.

For 76 days after the initial compromise, Equifax's SSL/TLS inspection tool had been disabled because its certificate had expired. That meant encrypted traffic through their network was not being inspected and the Senate Commerce Committee found that Equifax had not picked up the breach.

Equifax found the active exfiltration within hours once the certificate was renewed and inspection restarted. The network was not segmented enough and the investigation showed the database containing consumer data could be accessed from the web server that had been compromised.

When private subnet architecture is done right and security group rules limit what the web server can connect to the database server to specific ports and IP ranges, an attacker cannot get from the web server to the database server.

S3 Bucket Misconfiguration Exposures (2017-2022). Between 2017 and 2020, researcher Chris Vickery at UpGuard documented dozens of major S3 bucket misconfiguration exposures.

Among the notable finds was a Verizon customer database (6 million records) sitting on a publicly accessible bucket that a third-party vendor had misconfigured. There was also a Time Warner Cable subscriber database (4 million records), a WWE user database (3 million records) and a Republican National Committee voter file with 198 million voter profiles.

Known bucket naming patterns used by many organizations (company-name-backups, company-name-data) were queried through the S3 public endpoint and that is how Vickery's method worked.

AWS's response was to introduce S3 Block Public Access settings at the account level in 2018, allowing organizations to prevent any bucket from being made public regardless of individual bucket policies.

As of 2022, AWS said that fewer than 0.5% of S3 buckets in active use were publicly accessible and that figure came down from about 7% in 2017. This shows that account-level controls work when they are applied consistently.

SolarWinds Supply Chain Attack and CI/CD Security (2020): The SolarWinds Orion supply chain attack, discovered in December 2020, compromised the build pipeline of SolarWinds' network monitoring software.

Attackers (attributed by the US government to Russia's SVR intelligence service) inserted the SUNBURST malware into SolarWinds' Orion build process.

About 18,000 customers received the malware as a legitimate software update. It had been compiled, signed with SolarWinds' legitimate code-signing certificate and distributed to them.

For nine months the attack went undetected. A joint CISA, NSA and FBI advisory from January 2021 made CI/CD pipeline security a national security concern by identifying it. It recommended that organizations apply the same security rigor to their build infrastructure as they do to production infrastructure.

Adoption of the SLSA (Supply chain Levels for Software Artifacts) framework grew following the attack. Google developed this framework and it gives cryptographic provenance to build artifacts. That makes it possible to check that a given artifact came from particular auditable source code through a tamper-evident process.

Netflix's Security Engineering at Scale: Netflix's security engineering team has documented their cloud security approach across multiple engineering blog posts and conference presentations.

At AppSecUSA 2018, security architect Jason Chan laid out their model that sees security as a collaboration between a central security team providing tools and standards and application teams putting in place controls.

Netflix built and open-sourced Security Monkey (now succeeded by Aardvark and Repokid), an IAM access analysis tool that continuously monitors IAM permissions for violations of least-privilege and automatically identifies unused permissions that should be revoked.

Monitoring AWS accounts for policy changes as well as insecure configurations is what Security Monkey does. Hundreds of organizations have taken up the tool and it has helped build up the wider cloud security tooling ecosystem.


Sources & Further Reading

  1. Amazon Web Services. "AWS Security Best Practices." aws.amazon.com.
  2. Cloud Security Alliance. "Top Threats to Cloud Computing: Pandemic Eleven." View source, 2022.
  3. NIST. "Framework for Improving Critical Infrastructure Cybersecurity (CSF)." nist.gov, 2018. View source
  4. Center for Internet Security. "CIS Benchmarks." cisecurity.org. View source
  5. AWS. "AWS Well-Architected Framework: Security Pillar." docs.aws.amazon.com.
  6. OWASP. "Cloud Security Testing Guide." View source.
  7. Shostack, Adam. Threat Modeling: Designing for Security. Wiley, 2014.
  8. Krebs, Brian. "Capital One Data Theft Impacts 106M People." KrebsOnSecurity, 2019.
  9. HashiCorp. "Vault Documentation." developer.hashicorp.com.
  10. Bridgecrew. "Checkov: Infrastructure as Code Security Scanner." github.com.