Can customer data sit in staging? SOC 2 and non-production environments
Updated
No source fetched for this page quotes a SOC 2 criterion that bans customer data in staging. SOC 2 judges it through your own written controls: if your policy says customer data stays in production, a copy in staging is a deviation the auditor can find. ISO 27001 (controls 8.31 and 8.33) and PCI DSS (requirement 6.5.5) do speak to test data directly. The defensible choices are masked or synthetic data, an approved and logged exception with production-grade controls, or no customer data outside production at all. The sources here are vendors and guidance sites, not the AICPA, ISO or PCI texts, so confirm with your CPA firm.
What each framework says
| Framework | What the source says | Source |
|---|---|---|
| SOC 2 | No test data criterion; Red Gate maps it to CC6, CC8.1 (changes "authorized, documented, tested, approved, and implemented"), C1.1 and C1.2, and to Privacy P4.1 to P4.3 if Privacy is in scope | Red Gate, 7 Oct 2026, sells test data tools |
| ISO 27001:2022 | 8.33: "Test information should be appropriately selected, protected and managed." 8.31 separates development, test and production | Hightable, updated 11 Nov 2026, an ISO 27001 guidance site |
| PCI DSS v4.0.1 | 6.5.5: live card numbers "are not used in pre-production environments, except where those environments are included in the CDE" and fully protected | WithPCI, undated, a guidance site |
The difference matters when a team holds more than one report. If you also run ISO 27001 or take card payments, the stricter text sets your floor, and the SOC 2 control should say the same thing so the two do not drift apart. See SOC 2 vs ISO 27001 for how the two frameworks line up.
Three positions you can defend
- Masked or synthetic data only. Red Gate describes static masking as producing "a sanitized base copy" with referential integrity kept, and synthetic data as an option for sensitive domains (Red Gate). The masked copy is no longer customer data, so staging stays outside the confidentiality boundary.
- Real data under an approved exception. Hightable's ISO 8.33 guide lists the steps: an authorized transfer between environments, a log of the transfer, deletion of test data immediately after use, and a risk register entry when real data cannot be avoided (Hightable). While the copy exists, staging gets production's access controls and logging. Your written policy has to allow this; Policyseed's generated Data Classification and Handling Policy does not (see below).
- No customer data outside production. Reproduce bugs with seeded fixtures, or debug in production through the audited access path in the production access guide.
The evidence to keep
Red Gate says auditors look for evidence that controls operate consistently over time, and for test data it names an audit trail of what ran, when and under which rules, plus records of how data was classified, provisioned, accessed and removed (Red Gate). For a small team that comes to:
- The written rule (the policy items below) and a note of what data each non-production environment holds.
- The masking or synthesis job: its rules in version control and a dated run log.
- For each exception: the ticket, the approver, the end date, and the record that the copy was deleted.
- Deletion of derived copies. Red Gate covers short-lived test databases but not backups or snapshots taken of them; list those in the ticket and delete them too.
Log each exception in the policy exception register and add real-data use to the risk register, as Hightable suggests.
Isolation is an infrastructure job
Railway's guide, written for its own platform, gives one example of the boundary: each environment has its own private network, so "nothing in staging can reach production over the private network"; a duplicated environment gets its own database volumes; every variable is scoped to one environment; and production secrets can be sealed so they are not copied when staging is duplicated (Railway). On other clouds the same pattern is usually a separate account, project or subscription with its own credentials. Where those credentials live is covered in secrets and key management.
What the generated policies say
Policyseed sells a kit, so read these as one example, not a requirement. Five generated policies cover the topic, and they do not yet say the same thing. The Data Classification and Handling Policy allows only synthetic or irreversibly anonymized data, and its exceptions section says no exception permits un-anonymized production data in non-production environments. The Change Management and Network policies allow masked or anonymized data with the Security Owner's approval. The Backup and Recovery Policy goes further and allows restoring real production data with approval and production-grade access controls. An auditor reading these side by side can see a contradiction, so pick one rule (the strict one is simpler to evidence) and edit the others to match before you adopt them.
Production customer data is not copied into development, staging, test or analytics environments. Where realistic data is needed, Engineering uses synthetic data or data irreversibly anonymized through a process approved by the Security Owner.
Data Classification and Handling Policy, item 4.6
Non-production data. Engineering documents the source of data in every non-production environment. Where production-like data is genuinely needed, the requesting engineer proposes an anonymization or synthesis method, the Security Owner approves it, and the resulting dataset is recorded in the inventory as Internal. Production credentials are never present in non-production environments.
Data Classification and Handling Policy, item 5.4
Development, staging and production are logically separated with distinct credentials, and changes are promoted through staging before production. Production customer data is not copied to lower environments except in anonymized or masked form approved by the Security Owner.
Change Management Policy, item 4.11
Production, staging and development environments are isolated in separate accounts, projects or subscriptions with no shared network paths, credentials or data. Production data is not copied into non-production environments except as anonymized or synthetic datasets approved by the Security Owner.
Network and Infrastructure Security Policy, item 4.1
Backups may contain customer data, including PII data, and are handled at the highest classification of the data they contain. Restoring production data into a non-production environment requires the Security Owner's approval and either masking or the same access controls as production.
Backup and Recovery Policy, item 4.10
Read the full Data Classification and Handling Policy, Change Management Policy and Backup and Recovery Policy. How long any copy may be kept is covered in SOC 2 data retention requirements, and the change process that promotes code through staging is on the change management page.
Frequently asked questions
- Does SOC 2 forbid production data in a test environment?
- No source fetched for this page quotes a SOC 2 criterion that bans it. Red Gate, which sells test data tools, maps test data to CC6 (protecting and restricting customer data outside production), CC8.1 (testing changes) and the Confidentiality criteria C1.1 and C1.2. So the question is judged against your own written commitments. If your policy says customer data stays in production, a copy in staging is a deviation from your own control. ISO 27001 and PCI DSS are different: each has a control that speaks to test data directly.
- Can I restore a production backup into staging to debug a bug?
- Only if your policy allows it and you can show the approval. Hightable's guide to ISO 27001 control 8.33 asks for an authorized and logged transfer between environments, deletion right after use, and a risk register entry when real data must be used. Policyseed's generated Backup and Recovery Policy allows the restore with the Security Owner's approval and either masking or production-grade access controls, but the generated Data Classification and Handling Policy says no exception permits un-anonymized production data outside production. Those two disagree today, so if you keep both, decide which rule you mean and edit the other before using this option. Keep the ticket, the approval and the record that the copy and any snapshots of it were deleted.
- Is anonymized or masked data okay?
- It is the usual answer. Red Gate recommends static masking, which replaces sensitive values irreversibly and keeps referential integrity, or synthetic data that mimics production without real records. The evidence is the masking job's output and the version-controlled rules it ran with, not a statement that masking happens. Weak masking that can be reversed is still customer data.
- Does staging need to be a separate cloud account?
- SOC 2 does not set the architecture. Railway's guide to isolating staging, written for its own platform, gives each environment its own private network, database volumes and variables, so nothing in staging can reach production and staging credentials do not work in production. Separate accounts or projects are one way to get that boundary on other clouds. Write the boundary you actually have into the policy.
- Do we need to log activity in staging?
- The sources here do not say SOC 2 requires it. Hightable's ISO 27001 guide asks for transfers between environments to be logged. Policyseed's generated Logging and Monitoring Policy logs the same security events in non-production so that misuse of staging is detectable. If staging ever holds customer data under an exception, it needs the same logging as production while it does.
- We process card payments. Is the rule stricter?
- Yes. PCI DSS v4.0.1 requirement 6.5.5, as quoted by WithPCI, says live card numbers are not used in pre-production environments unless those environments are in the cardholder data environment and protected under all applicable PCI DSS requirements. The assessor examines pre-production test data. If a payment processor's hosted fields keep card numbers out of your systems, there should be none to copy.
Policyseed provides governance policy templates and AI tailoring. It is not legal advice and not a compliance guarantee. Management adopts the policies; the CPA firm performs the SOC 2 examination.