SECURITY GUIDE

PCI DSS logging in the cloud: Requirement 10 on AWS, Azure and GCP

Published ยท 4 min read

pci-dssloggingmonitoring

Requirement 10 is where cloud teams most often discover that "logging is on" and "logging meets PCI DSS" are different things. The requirement asks for complete audit logs, protected logs, enough history, and review that does not depend on someone remembering to look.

Note

The examples here are starting points, not finished designs. Test them in a non-production account, and check the wording of each requirement in the standard with your assessor.

What Requirement 10 asks for

AreaRequirementIn plain English
What to log10.2.1Audit logs are enabled and active for all system components and cardholder data
Sub-items10.2.1.1 to 10.2.1.7Cover user access to cardholder data, administrator actions, access to the logs themselves, failed access attempts, changes to credentials, starting and stopping of logs, and creation or deletion of system-level objects
Log detail10.2.2Each entry records who, what, when, success or failure, where from, and which resource
Protection10.3Logs are protected from changes and destruction, with change detection on the log files
Review10.4.1.1Log review is automated
Retention10.5.1At least 12 months of history, with the most recent three months immediately available
Clocks10.6System clocks are synchronized and the settings protected
Control failures10.7.2Failures of critical security controls are detected, alerted and responded to

Mapping the requirement to cloud services

NeedAWSAzureGoogle Cloud
Control-plane audit logsCloudTrail management eventsActivity LogCloud Audit Logs, admin activity
Data access logsCloudTrail data events, service access logsResource diagnostic logsCloud Audit Logs, data access
Central store and searchS3 with Athena, or CloudWatch LogsLog Analytics workspaceCloud Logging, BigQuery sink
Alerting and detectionGuardDuty, Security Hub, CloudWatch alarmsMicrosoft Sentinel, Defender for CloudSecurity Command Center, log-based alerts
Immutable archiveS3 Object LockImmutable blob storageBucket retention policies with a lock

Data access logging is usually off by default and costs money, so decide deliberately which resources in the CDE need it. Everything in the CDE should log, and non-CDE systems can log less.

Keep logs where an attacker cannot reach them

An attacker with admin rights tries to turn off logging and delete history. Design so that cannot happen quietly:

  • Send logs to a separate account, subscription or project with very few humans in it.
  • Give sending systems write-only access to the archive.
  • Turn on log integrity validation where the service offers it.
  • Use retention locks so even administrators cannot delete inside the retention window.
  • Alert if any of those settings change.

An AWS starting point

This Terraform sketch creates a locked log bucket and an organization trail with integrity validation. It omits the bucket policy that lets CloudTrail write, encryption settings and access logging, all of which you will need.

resource "aws_s3_bucket" "audit_logs" {
  bucket              = "example-pci-audit-logs"
  object_lock_enabled = true
}

resource "aws_s3_bucket_versioning" "audit_logs" {
  bucket = aws_s3_bucket.audit_logs.id
  versioning_configuration {
    status = "Enabled"
  }
}

resource "aws_s3_bucket_object_lock_configuration" "audit_logs" {
  bucket = aws_s3_bucket.audit_logs.id
  rule {
    default_retention {
      mode = "COMPLIANCE"
      days = 365
    }
  }
}

resource "aws_cloudtrail" "org" {
  name                          = "pci-org-trail"
  s3_bucket_name                = aws_s3_bucket.audit_logs.id
  is_organization_trail         = true
  is_multi_region_trail         = true
  enable_log_file_validation    = true
  include_global_service_events = true
}

Note that Compliance-mode retention cannot be shortened once set, so try it with a short period in a test account first.

Retention: hot and cold

10.5.1 asks for 12 months of history with the latest three months immediately available. A common design:

  • Months 0 to 3: in your search platform, queryable in seconds
  • Months 4 to 12: in cheaper archive storage, retrievable on request and documented as such
  • Beyond 12 months: only if your own policy or other rules require it

Write down how an analyst retrieves archived logs, and test it once before an assessor asks.

Automate the review

10.4.1.1 means alert rules, not a weekly look at a dashboard. Good first rules for CDE systems:

  • Console or API logins that fail repeatedly, or succeed from unexpected places
  • Use of root or break-glass accounts
  • Audit logging turned off, paused or reconfigured (10.2.1.6)
  • Changes to identity policies, roles and trust relationships
  • Changes to network rules that open paths into the CDE
  • Changes to key policies or key deletion
  • Creation or deletion of system-level objects (10.2.1.7)

Send alerts to a person who is on call, and record how each alert was handled. That record is evidence.

Detect when the controls themselves fail

10.7.2 is easy to miss. If your log pipeline silently stops, you are blind but looking compliant. Add alerts for:

  • No logs received from a source for a set period
  • A logging agent, EDR or change-detection tool that stops reporting
  • Log delivery errors and permission failures
  • Clock drift on CDE hosts

Checklist

  • Turn on control-plane logging in every account, subscription and project in scope
  • Turn on data access logging for CDE resources
  • Send logs to a separate, locked archive
  • Enable integrity validation and change detection on logs
  • Keep 12 months of history, with 3 months immediately searchable
  • Write alert rules covering the list above
  • Alert on silent log failures and agent outages
  • Synchronize clocks and protect the settings
  • Test retrieving archived logs and keep the record

Sources and further reading

Browse live cloud security jobs