PCI DSS Sampling

I sometimes get asked about sampling, how this works for Payment Card Industry Data Security Standard (PCI DSS) assessments, and what methodology I follow. This blog post covers the following topics:

  • What is sampling?
  • What can be sampled within a PCI DSS assessment?
  • How should you determine a suitable sample?
  • When should you expand the sample?
  • What cannot and should not be sampled?
  • Documenting the sampling rationale
  • Ramblings

What is sampling?

Sampling is a technique used to select a subset from a population of similar items, based upon certain criteria. This is often leveraged for larger PCI DSS assessments to manage costs by reducing the amount of effort. Although sampling is built into the PCI DSS (See Section 6 of the PCI DSS Requirements and Testing Procedures, v4.0.1), this must be carried out appropriately, and the environment MUST be suitable for employing such a technique, considering the complexity of the environment being assessed.

Although managing costs is often why sampling is often leveraged as part of a PCI DSS assessment, it is not the driving factor. The assessor must:

  • ensure the organisation and environment is suitable for sampling, and
  • ensure the sampling technique employed provides a suitable sample that will accurately reflect the entire in-scope environment and must be made up of a representative sample of all variants in use by the environment being assessed.

Sampling is one technique that can be used to streamline PCI DSS assessments. Another technique is to leverage automation processes or other mechanisms to help with assessment activities of the entire environment to give full assurance. For example, a script could be leveraged to remotely connect to all system components to extract specific configuration information, for example, on Windows machines, the NTP registry settings could be extracted remotely using the “reg” command.

Section 6 “For Assessors: Sampling for PCI DSS Assessments” from the “PCI DSS Requirements and Testing Procedures, v4.0.1” document explains this further.

What can be sampled within a PCI DSS assessment?

Typically, most people will think of system components or locations when thinking about sampling, however sampling can be applied to much more. Sampling can be used when assessing a business process, for example when carrying out an assessment against PCI DSS Requirement:

’10.4.1 The following audit logs are reviewed at least once daily:

– All security events.

– Logs of all system components that store, process, or transmit CHD and/or SAD.

– Logs of all critical system components.

– Logs of all servers and system components that perform security functions (for example, network security controls, intrusion-detection systems/intrusion-prevention systems (IDS/IPS), authentication servers)’

In this example, you may choose to select a sample of dates you want to examine the log review evidence against.

Additionally, you can also sample staff for interviews, for example, if you are assessing a large retailer with 1000’s of store locations, you will most likely end up choosing a sample of staff to interview at the stores included in the sample of stores.

What I’m trying to demonstrate here is that you don’t simply sample system components of the Cardholder Data Environment (CDE), there are other elements of the People, Process and Technology that will come into play when conducting sampling during an assessment.

Remember, all samples must have the same attributes to be part of the same sampling pool.

How should you determine a suitable sample?

First, you must ensure sampling is appropriate. This key factor is the level of assurance you have that system components are built in a consistent and repeatable manner, and that business processes and controls are mature enough, so they are consistently applied in a repeatable manner.  Determining the level of assurance will also depend upon the organisational structure and the responsibilities across the various locations of the organisation, especially for large multinational companies that may devolve responsibilities to individual regions or countries instead of being centrally managed.

For technology sampling, one thing that is becoming more commonplace is Infrastructure as Code (IaC). Since this works by programmatically deploying and configuring system components into an environment, this can provide a good level of assurance that system components are deployed in a consistent manner within the environment through Continuous Integration/Continuous Development (CI/CD) pipelines, using technologies such as Puppet.

Complications can be introduced where autoscaling technologies are in use. Where this is being leveraged, the total population will dynamically change, and samples may get removed from the environment. You may need to consider using base images as the sample if there are base images for each primary role or look at how individual configuration settings are applied to base images once resources are added.

System Components

For system component sampling, I tend to do this based on the system component type, the Operating System, the primary function and the location of the devices.  These traits are used to build the individual item listing, which can be used to apply sampling to. For example:

Attributes
TypeOS VersionPrimary RoleLocationTotal Population
Linux UbuntuOS Version 22.04Radius ServerUK South4
Linux UbuntuOS Version 22.04Radius ServerUK West2
Linux UbuntuOS Version 20.04.5Radius ServerFrance Central2
Linux UbuntuOS Version 22.04Scanning NodeUK South1
Linux UbuntuOS Version 22.04Scanning NodeUK West1
Linux UbuntuOS Version 22.04Scanning NodeFrance Central1
Linux UbuntuOS Version 24.04.1Front End WebUK South5
Linux UbuntuOS Version 24.04.3Front End WebUK West4
Linux UbuntuOS Version 24.04.1Front End WebFrance Central2
Linux UbuntuOS Version 24.04.3AppLogicControlUK South2
Linux UbuntuOS Version 24.04.3AppLogicControlUK West2
Linux UbuntuOS Version 24.04.1AppLogicControlFrance Central2
WatchgGuard FirewallFirebox Cloud LargeInternet FirewallUK South2
WatchgGuard FirewallFirebox Cloud LargeInternet FirewallUK West2
WatchgGuard FirewallFirebox Cloud MediumInternet FirewallFrance Central2
Etc..    

With the above, I will typically look at creating a population sample size on primary role. I will then choose a sample based on my defined percentage of population. Once I have this number, I will proportion it based on other attributes, for example, the Operating System version, which they would split into the locations to get coverage. So, as an example for the Radius Server role, I  select a population sample of four, which would be 4/8 or a 50% sample size. I would then look at the operating system version and proportion this based on the OS version.  With the above, it would fit nicely to having one system component running Linux Ubuntu 20.04.5 and two system components running Linux Ubuntu 22.04.  This fits nicely with the locations because I can then select one system component from each of the three locations.

Sometimes, I may choose to slightly increase the population sample to ensure coverage across the various attributes, for example if I end up with a small sample population size, for example two, I may choose to increase this to three to cover a single system component in all three locations.  As we have already discussed though, it very much depends on your level of assurance that the environment is consistently built the same.

Once I have followed this approach, I will then check the overall “Type” sample, for example, Linux Host, to ensure this sample is reasonable based on the population sample size percentage to ensure the representative sample is large enough.

Typically, where the entire population is small, for example if you were doing a Merchant Self-Assessment Questionnaire A (SAQ) aligned ROC with only three webservers that are in scope, you would typically select all three servers as the sample is so small.  Sampling is good where the environment is large.

Note: The above is for illustrative purposes only, the actual population sample size I pick may differ based upon the upcoming ‘Population Sample Size’ section.

Locations

For locations I typically select the sample based on the total population. The locations visited vary depending upon the types of payment channels in use. For example, locations may come into scope for, but not limited to:

  • Shops/Stores
  • Contact Centre Agents (Telephone Payments)
  • Other Departments (Telephone Payments), for example, Finance Teams, Debt Recover Teams, etc…
  • Unattended Card-Present locations, for example, Train/Tram Stops, Car Parks, etc…
  • Physical Data Centre locations
  • Office Locations where business processes are carried out, for example, Security Operation Centres (SOCs), Network Operation Centres (NOCs), Point of Interaction (POI) storage locations, where teams are based who carry out patching/vulnerability scanning/etc…

For locations, I may just randomly select the sites based on the population sample size that I am selecting, or I may select the sites based on the people at the sites in case I want to specifically interview certain people, i.e. if a senior contact centre agent is at a specific location, I may choose to ensure that location is within my sample.

For shop/store locations I employ a slightly different approach. I will typically work with the merchant to identify if they have geographic locations (regional) that have regional managers aligned with the stores in a particular region. We may then choose to sample shops based on a sample of regional managers. For example, if there are six regional managers for a particular merchant, we may choose three regional managers and then select our sample of stores from these three regions.

Staff

For staff members, I would want to select staff based upon their job function and role/position within the business.

For store staff (looking at interviews and observations for POI devices for example), as already discussed, I would typically do this based on the population sample size of stores visiting and a staff member from every store in our sample would be selected.  Again, who is picked from each store will depend upon each Merchant’s setup. Some Merchants may include a responsibility for all staff members operating the tills to do tamper checks; however, they may only have the store manager (and team leaders) who perform the substitution checks so you will need to understand how this works during the scoping stage to ensure you are selecting the correct people.

Population Sample Size

There is no hard and fast rule with this however, here is a rough idea of what I would try and follow:

Total PopulationSample
2 or less100%
6 or less50%
10 or less40%
25 or less25%
50 or less15%
100 or less10%
More than 1005%

This is my rule of thumb, however I may adjust this methodology based upon various factors already discussed, i.e. to ensure good coverage across all the different attributes.

Note: Work through the table in order until you no longer match a total population. For example, five would not meet ‘2 or less’ but would meet ‘6 or less’. I would always round up, so if I had a total population of seven, 40% of this would be 2.8, therefore I would have a sample of 3.

Other Sampling

I’m not going to continue going through all types of sampling but hopefully this gives you an idea of how you can start to build a methodical approach to this within your assessments.

When should you expand the sample?

Sampling is based on the level of assurance you have that the environment is built in a consistent manner. You do this by checking build processes for system components, and other process documents for process flows, if you can determine to some degree of certainty that there are mature and repeatable processes in place, then you can potentially sample.

Where a suitable sample size has been identified, for example, the build processes employed by the organisation appear to be mature, well documented and repeatable, you will select your sample and start to assess configuration settings in line with the PCI DSS Requirements that are in-scope for the assessment.  If during this assessment phase, I identify a mismatch of configuration settings across the sample, indicative of inconsistencies in the build process, then:

  • Firstly, this should prompt remediation activities since the settings are not what you are expecting to find, as per the documented build standards, and
  • Secondly, this should prompt an increase in the population sample size, which I would typically do during the remediation period which will cover the system components that were incorrectly configured, therefore additional system components would be selected. This would be determined based upon exactly what was wrong during the assessment phase. If for example a single host had a minor discrepancy, I may double the sample for that specific check, if however a large number of system components had discrepancies, I may choose to test the full population, across all PCI DSS checks for those system components.

What cannot and should not be sampled?

Cannot be sampled

Within the PCI DSS Requirements and Testing Procedures, v4.0.1 under Section 6 “For Assessors: Sampling for PCI DSS Assessments” describes two scenarios where sampling cannot be applied as follows:

Sampling of PCI DSS Requirements: All applicable PCI DSS Requirements must be assessed as part of the PCI DSS assessment activities. The QSA (or entity if self-assessing) must

Applying PCI DSS Requirements to a sample of the environment: This is referring to assessing a PCI DSS Requirement but only against a sample of what the specific PCI DSS Requirement is asking for. This is best explained where you have PCI DSS Requirements that requires something periodically, for example, Quarterly ASV Scanning. In this example, you cannot sample the quarterly ASV scans and must review all four scans to perform an ‘affirmative’ assessment finding response of ‘In Place’, ‘Not Applicable’ or ‘Not in Place’.

Note: You are unable to provide an ‘affirmative’ finding by use of the ‘Not Tested’ response, which I discuss in a previous blog post “PCI DSS “Not Tested” Response”.

Should not be sampled

If you are carrying out a PCI DSS assessment of the same entity each year, the representative sample should change year on year ensuring any variations to configurations and processes can be identified and corrected as part of the assessment / remediation process.

Documenting the sampling rationale

Within the Report of Compliance (ROC) under section “6.2 Sampling”, the QSA (or ISA if allowed by the Acquirer) must indicate if sampling has been used. If so, you must:

  • describe the rationale used for selecting sample sizes across all the items sampled. You should list all the different types of items explaining how you have decided on the sample size for each;
  • explain why the samples are appropriate and representative of the overall populations, again this needs to be done against all the different types of items in the sample;
  • indicate if standardised processes and controls are in place to provide consistency between items in the sample, and if so, you must describe how these were validated to be in place and effective.

If undertaking a self-assessment, I would recommend that you include the rationale within your workpapers.

Ultimately, the sampling rationale must provide reasonable assurance that controls are in place across the entire population of items that have been sampled, without undertaking an assessment of everything.

Ramblings

This is an approach that I follow (no longer just in my head), however as discussed in this article, the environment MUST be able to support the use of sampling by ensuring that well defined and repeatable processes are in place, and you are able to evidence that they are well defined and repeatable as you need to justify the use of sampling within the ROC.

Sampling and the sample size used is ultimately up to the QSA, providing they are not only able to justify their decision but also that their decision is defendable if it were to be scrutinised at the point of a review by the PCI Security Standards Council (PCI SSC) or on the back of a breach where it is determined that an official PCI Forensic Investigation is needed.

I would recommend that QSACs make it clear in their customer collateral that sampling will be used to streamline the assessment process where it is justified. However, should the use of sampling be brought into doubt during the assessment, the sample may need to be increased, meaning additional costs. The collateral should make it clear when this would happen if you need to justify your need to increase the sampling partway through an assessment. The key is to stay transparent and work ethically but most importantly be able to defend your decision making.