Shrinking PCI DSS scope: keep the card number out of your platform
The cheapest way to secure cardholder data is to never hold it. How hosted fields and tokens move a lending platform toward the smallest self-assessment questionnaire, and what still has to be isolated.
Contents
PCI DSS (the Payment Card Industry Data Security Standard) applies to every system that stores, processes, or transmits cardholder data, and to every system that can affect the security of those systems. The size of that set is called scope. Every control in the standard applies to everything in scope, so the first design decision is not "how do we secure the card data" but "how little of the platform ever touches it".
This is the approach I took designing the cardholder data environment for a lending platform on AWS, and the reasoning that drove it.
Step one: the card number never enters the platform#
The payment provider offers hosted fields: the card number, expiry, and CVV inputs are rendered by the provider inside the page, from the provider's domain. The customer types into the provider's inputs. The provider returns a token. The platform sends the token to the provider's API to charge the card. At no point does a card number travel through the platform's servers, logs, or database.
This changes the compliance picture more than any firewall rule:
- The platform stores no cardholder data, so most storage, encryption, and retention requirements for card data apply to nothing.
- The merchant becomes eligible for the smallest self-assessment questionnaire, SAQ A, instead of SAQ A-EP or SAQ D. The difference is dozens of requirements against hundreds.
- The provider carries the PCI DSS Level 1 assessment for the systems that do see the number.
WARNING
SAQ A eligibility is specific. Under PCI DSS v4.0 the merchant page that embeds the provider's fields can still affect the security of the transaction, so the standard asks you to protect that page against script injection and to confirm eligibility with your acquirer or a QSA. Do not assume hosted fields alone make you SAQ A. Check the current eligibility criteria.
Step two: isolate what remains#
Hosted fields remove the card number, but some payment services still exist: the service that calls the provider with the token, the webhook receiver that hears the result, and the records of what was charged. These are not cardholder data, but they are the systems closest to it, and a compromise there is a compromise of payments.
I placed them in a dedicated AWS account with its own VPC and no route to the rest of the estate. No peering, no transit gateway attachment, no shared IAM roles. The payment services talk to the provider over the internet through a NAT gateway with an egress allow-list, and to the rest of the platform through one API with its own authentication. An account boundary is the strongest isolation AWS offers; a subnet boundary is a configuration that one wrong security group rule undoes.
Step three: keys and evidence#
Two more decisions complete the picture.
One KMS key per data classification. Payment records, identity documents, and general application data each encrypt under a different customer-managed key. CloudHSM-backed keys hold the payment and identity classifications. Key administration and key use live in different IAM policies held by different teams, so no single role can both read the data and change who can read it.
An audit trail nobody can edit. CloudTrail from every account ships to one S3 bucket with Object Lock in compliance mode. For the retention period, not even the root user can delete or alter a record. When an assessor asks "show me who changed this security group in March", the answer is a query, not a reconstruction.
What this buys#
Scope reduction is not a trick to avoid security work. It concentrates the work where it matters. The platform team spends its effort on the isolation boundary, the key policies, and the evidence pipeline, and leaves the hardest problem, protecting the card number itself, to a provider whose whole business is that problem.
The principle generalises beyond payments. For any class of sensitive data, ask first whether the platform needs to hold it at all. The data you never collect needs no encryption, no retention policy, and no breach notification.