SECURITY GUIDE
PCI DSS logging in the cloud: Requirement 10 on AWS, Azure and GCP
Published ยท 4 min read
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
| Area | Requirement | In plain English |
|---|---|---|
| What to log | 10.2.1 | Audit logs are enabled and active for all system components and cardholder data |
| Sub-items | 10.2.1.1 to 10.2.1.7 | Cover 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 detail | 10.2.2 | Each entry records who, what, when, success or failure, where from, and which resource |
| Protection | 10.3 | Logs are protected from changes and destruction, with change detection on the log files |
| Review | 10.4.1.1 | Log review is automated |
| Retention | 10.5.1 | At least 12 months of history, with the most recent three months immediately available |
| Clocks | 10.6 | System clocks are synchronized and the settings protected |
| Control failures | 10.7.2 | Failures of critical security controls are detected, alerted and responded to |
Mapping the requirement to cloud services
| Need | AWS | Azure | Google Cloud |
|---|---|---|---|
| Control-plane audit logs | CloudTrail management events | Activity Log | Cloud Audit Logs, admin activity |
| Data access logs | CloudTrail data events, service access logs | Resource diagnostic logs | Cloud Audit Logs, data access |
| Central store and search | S3 with Athena, or CloudWatch Logs | Log Analytics workspace | Cloud Logging, BigQuery sink |
| Alerting and detection | GuardDuty, Security Hub, CloudWatch alarms | Microsoft Sentinel, Defender for Cloud | Security Command Center, log-based alerts |
| Immutable archive | S3 Object Lock | Immutable blob storage | Bucket 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