PCI DSS v4.0
ActiveCore framework
Best for: Any entity that stores, processes, or transmits payment card data from Visa, Mastercard, American Express, Discover, or JCB: merchants, payment processors, acquirers, issuers, and service providers. Transaction volume determines your validation path, a QSA-led Report on Compliance (ROC) or a Self-Assessment Questionnaire (SAQ). Even a small e-commerce site that redirects to a hosted payment page must validate compliance.
| Mandatory? | Mandatory for any entity processing card data |
|---|---|
| Who validates? | QSA (Level 1 merchants/SPs); SAQ self-assessment (Levels 2–4) |
| Renewal | Annual |
| Scope | Cardholder data environment (CDE) and connected systems |
| Governing body | PCI Security Standards Council (PCI SSC), founded by American Express, Discover, JCB, Mastercard, and Visa., PCI DSS v4.0. Official source |
Get started
Point the module source at the PCI DSS v4.0 endpoint and pin a version range you reviewed:
module "..." {
source = "pcidss.compliance.tf/terraform-aws-modules/<module>/aws"
version = "<version>"
}pcidss.compliance.tf lists every PCI DSS v4.0 module with its versions, inputs and outputs.
What compliance.tf covers and what you handle
| Area | Compliance.tf automates | You handle |
|---|---|---|
| Encryption at Rest | Checks encryption configuration on API Gateway caches, Athena workgroups, and AWS Backup recovery points, and verifies that KMS-managed keys are applied where available. | Key management procedures must be documented per Requirement 3.6, including rotation schedules, split knowledge and dual control for custodians, and the cryptographic key inventory. None of this is enforceable through infrastructure code alone. |
| Encryption in Transit | Validates TLS enforcement on CloudFront distributions and API Gateway stages (SSL certificate attachment), and checks ACM certificate properties including RSA key length (2048-bit minimum) and expiration within 30 days. | TLS policy version selection (ensuring TLS 1.2 or higher), cipher suite configuration review, documenting authorized protocols per Requirement 4.2.1, and certificate lifecycle management processes beyond expiration monitoring. |
| Access Control | Verifies that API Gateway v2 routes have authorization types explicitly configured, confirms AWS Organizations governance at the account level, and checks IMDSv2 enforcement on Auto Scaling launch configurations to prevent credential exposure. | You own the RBAC design, user provisioning and deprovisioning workflows, access reviews at least once every six months (Req 7.2.4), and MFA implementation for all access into the CDE (Req 8.4.2). |
| Logging and Monitoring | Confirms logging is enabled on API Gateway stages and AppSync GraphQL APIs (field-level), checks X-Ray tracing on REST API stages, and validates CloudFormation stack notification configuration for change detection. | Log aggregation, correlation, and 12-month retention (Req 10.5.1). Daily log review processes, SIEM integration, alerting rules for security events per Requirement 10.4.1, and defining which events trigger incident response. |
| Data Protection and Backup | Validates that backup plans enforce a minimum 35-day retention period, that recovery points are encrypted, and that manual deletion of recovery points is disabled. | Backup restoration testing, documented data retention and disposal policies per Requirement 3.2.1, and secure media destruction processes for Requirement 9.4. |
| Network Security | Checks that API Gateway stages are associated with WAF web ACLs, providing layer 7 filtering on public-facing endpoints. | WAF rules need human tuning. Penetration testing to validate segmentation at least once every 12 months (Req 11.4.5; every six months for service providers, Req 11.4.6), firewall rule reviews every six months (Req 1.2.7), and documentation of all inbound and outbound traffic flows are outside what any scanning tool can assess. |
Controls by category
105 of 170 mapped controls are Enforced by compliance.tf modules at terraform plan. The other 65 are Mapped only: PCI DSS v4.0 lists them, no compliance.tf module checks them.
Requirement 10: Log and Monitor All Access
Assessors want logs that capture user identification, event type, timestamp, and success or failure for all access to system components and CHD per Requirement 10.2.2. Disabled logging on API Gateway stages is one of the most common PCI findings in AWS environments. X-Ray tracing and CloudFormation stack notifications both contribute to Requirement 10.4.1's expectation of timely detection for security-relevant changes.
Requirement 12: Maintain Security Policies and Data Retention
Manual deletion being enabled on backup recovery points is a red flag. It signals weak protection against insider threats and ransomware, and directly conflicts with the data retention and disposal policies of Requirement 3.2.1. Assessors also cross-check retention periods against documented organizational policy and the disposal requirements under Requirement 3.2.1.
| Control | Status |
|---|---|
| Backup plan rules should retain recovery points for at least 35 days | Mapped |
Requirement 3: Protect Stored Account Data
Requirement 3.6 is what assessors focus on: are encryption keys managed separately from the data they protect? They will check every data store, cache, and backup connected to the CDE for strong cryptography. Unencrypted backup recovery points and API Gateway caches holding response data are among the most reliably flagged findings.
Requirement 4: Protect Data in Transit with Strong Cryptography
All CHD transmissions over open, public networks must use TLS 1.2 or higher per Requirement 4.2.1. Assessors check certificate validity, RSA key strength (2048-bit minimum), and HTTPS enforcement on all public-facing endpoints. Expired ACM certificates and CloudFront distributions with HTTP fallback are the gaps that surface most reliably.
Requirement 7-8: Access Control and Authentication
The first question is whether authorization types on API routes are explicitly configured rather than left open by default. Assessors also want evidence that access is restricted by business need to know (Req 7.2) and that every user has a unique ID (Req 8.2.1). A registered security contact demonstrates incident response readiness tied to Requirement 12.10.1.
| Control | Status |
|---|---|
| API Gateway routes should require an authorization type | Enforced |
Additional controls (159)
AWS CloudTrail (4)
AWS CodeBuild (4)
AWS Database Migration Service (3)
| Control | Status |
|---|---|
| DMS endpoints for Redis OSS should have TLS enabled | Mapped |
| DMS endpoints should use SSL | Enforced |
| DMS replication instances should not be publicly accessible | Enforced |
AWS IAM (9)
AWS KMS (1)
| Control | Status |
|---|---|
| KMS CMK rotation should be enabled | Enforced |
AWS Lambda (2)
| Control | Status |
|---|---|
| Lambda functions should be in a VPC | Enforced |
| Lambda functions should use latest runtimes | Enforced |
AWS Secrets Manager (1)
| Control | Status |
|---|---|
| Secrets Manager secrets should be encrypted using CMK | Enforced |
AWS Step Functions (1)
| Control | Status |
|---|---|
| Step Functions state machines should have logging enabled | Enforced |
AWS WAF (1)
| Control | Status |
|---|---|
| WAFv2 rules should have CloudWatch metrics enabled | Enforced |
Amazon CloudFront (4)
Amazon CloudWatch (2)
Amazon CloudWatch Logs (1)
| Control | Status |
|---|---|
| Log groups should have encryption at rest enabled | Enforced |
Amazon DocumentDB (3)
Amazon DynamoDB (3)
Amazon DynamoDB Accelerator (2)
Amazon EBS (2)
| Control | Status |
|---|---|
| Attached EBS volumes should have encryption enabled | Enforced |
| EBS snapshots should be encrypted | Mapped |
Amazon EC2 (9)
Amazon ECR (1)
| Control | Status |
|---|---|
| ECR repositories should have image scan on push enabled | Enforced |
Amazon ECS (3)
Amazon EFS (4)
Amazon EKS (4)
Amazon EMR (1)
| Control | Status |
|---|---|
| EMR cluster Kerberos should be enabled | Mapped |
Amazon ElastiCache (5)
Amazon Kinesis (2)
Amazon MQ (1)
| Control | Status |
|---|---|
| MQ brokers should have audit log streaming to CloudWatch enabled | Mapped |
Amazon MSK (1)
| Control | Status |
|---|---|
| MSK clusters should require TLS for client-broker connections | Enforced |
Amazon Neptune (4)
Amazon OpenSearch Service (7)
Amazon RDS (18)
Amazon Redshift (10)
Amazon S3 (21)
Amazon SNS (1)
| Control | Status |
|---|---|
| SNS topics should be encrypted at rest | Enforced |
Amazon SageMaker (5)
Amazon VPC (4)
Elastic Load Balancing (4)
Other (11)
Related frameworks
| Framework | Control overlap | Note |
|---|---|---|
| NIST Cybersecurity Framework v1.1 | High 69% | |
| NIST Cybersecurity Framework v2.0 | High 64% | |
| ISO/IEC 27001:2022 | Medium 58% |
Frequently asked questions
Does PCI DSS v4.0 apply to my organization if we use a third-party payment processor?
Yes. Using a third-party processor reduces your scope but does not eliminate your compliance obligation. If your systems touch cardholder data at any point, including web pages that host payment fields or redirect to a processor, you are in scope. Most small merchants using hosted payment pages can complete SAQ A, which has the fewest requirements. Your acquiring bank determines your merchant level and the applicable SAQ type.
What changed between PCI DSS v3.2.1 and v4.0 that I need to know?
The largest changes are: expanded MFA requirements covering all access into the CDE, not just remote access (Req 8.4.2); a new requirement for automated log review mechanisms (Req 10.4.1.1); targeted risk analysis replacing the blanket 'periodic' language across several requirements (Req 12.3.1); client-side script integrity monitoring for payment pages (Req 6.4.3); and the customized approach as an alternative validation method. Requirements that were labeled future-dated until March 31, 2025 are now mandatory.
How long does a PCI DSS v4.0 assessment typically take?
It depends on your level and readiness. A Level 1 merchant or service provider undergoing a full QSA-led ROC assessment typically runs 3 to 6 months from gap analysis through final report submission. SAQ completion for smaller merchants can take 2 to 6 weeks. The formal assessment is annual, but quarterly ASV scans and ongoing monitoring run year-round.
What does the 'customized approach' in PCI DSS v4.0 mean for my AWS environment?
The customized approach (described in PCI DSS v4.0 Appendices D and E; Requirement 12.3.2 requires a targeted risk analysis for each requirement met this way) lets you meet a requirement's stated objective using a control different from the defined approach. You must document a controls matrix, perform a targeted risk analysis, and have the QSA validate that your custom control meets the objective. For AWS environments, one approach to meeting this would be combining native services (GuardDuty, Security Hub, Config Rules) to satisfy a requirement's intent where the specific prescribed method differs. Be aware that the customized approach requires more documentation and QSA scrutiny, not less.
Which parts of PCI DSS v4.0 can compliance.tf automate, and what requires manual evidence?
The controls mapped here cover technical configuration: encryption settings, logging enablement, access authorization, certificate validity, and backup policies. That said, PCI DSS v4.0 has 12 principal requirements (v4.0 added 64 new requirements), many of which require procedural evidence (written policies, training records, physical security controls, penetration test reports, incident response plans). Requirements 9 and 12 depend mostly on physical and administrative evidence, and Requirements 5 and 11 on operational evidence such as anti-malware, vulnerability scan and penetration test results, which Terraform configuration does not produce.