One of the most common questions organisations ask when planning a security assessment is whether penetration testing should be performed against a staging environment or a live production system.
At first glance, staging appears to be the safer option. It provides an environment where testing can be conducted without affecting real users, customer data, or operational services. However, the production environment provides a true representation of how applications and infrastructure are configured, and is therefore a more accurate picture of the security posture.
The answer is rarely as simple as choosing one over the other. The most appropriate approach depends on the objectives of the assessment, the maturity of the environment, and the level of assurance required.
If you’re new to penetration testing, our article discussing what penetration testing is would be a great place to start.
Understanding the difference between staging and production
A staging environment is typically designed to mirror production as closely as possible. It provides a platform for testing functionality, validating changes, and identifying issues before code is released to live users.
Production environments, by contrast, contain the systems, configurations, and data that support actual business operations. They represent the environment an attacker would encounter in a real-world scenario.
In theory, a perfectly maintained staging environment should provide an accurate representation of production. In practice, differences often emerge over time. Configuration drift, infrastructure changes, security controls, integrations, and user permissions can all vary between environments, sometimes significantly.
This distinction is important because effective penetration testing services relies on assessing systems as they actually exist, rather than how they are intended to exist.
The advantages of testing in staging
Staging environments provide a number of practical benefits. Perhaps most importantly, they allow testing to be conducted with minimal risk to business operations.
Security assessments can involve activities such as vulnerability validation, authentication testing, input manipulation, and workflow analysis. While professional testers take care to minimise disruption, there is always a possibility that testing may affect system performance or expose unforeseen issues.
A staging environment provides a controlled setting in which these risks can be managed more comfortably. It also allows organisations greater flexibility when testing sensitive functionality that might be difficult to assess safely in production.
For development teams operating rapid release cycles, staging assessments can be particularly valuable. Security testing can be integrated into deployment processes, allowing vulnerabilities to be identified before new functionality reaches production.
The limitations of staging environments
The challenge with staging environments is that they are rarely identical to production.
Even when organisations make significant efforts to maintain parity, differences can emerge in infrastructure configuration, access controls, third-party integrations, logging, monitoring, and cloud permissions. Application and cloud environments can suffer from similar divergences. These differences may appear minor but can have a significant impact on security outcomes.
From a penetration testing perspective, vulnerabilities are often discovered at the intersection of systems, configurations, and operational processes. If those elements differ between staging and production, there is a risk that important issues go undiscovered.
This is particularly relevant for cloud-native applications, SaaS platforms, and complex environments where permissions and integrations form a significant part of the attack surface.
Testing an environment that differs materially from production can provide useful assurance, but it may not provide a complete picture of actual risk exposure.
Why production testing is often preferred
For many organisations and regulators, production testing provides the highest level of confidence for customers, auditors and procurement teams, because it assesses the environment that attackers would target.
Furthermore, the risk of divergent environments is removed where production systems are tested directly. This is particularly important where configuration drift has occurred or where infrastructure is managed separately from development environments. In these situations, production testing may identify issues that would never appear within staging.
Modern penetration testing assessments are generally intended to be performed safely against production environments. Testing methodologies are carefully structured to minimise operational impact while still providing meaningful security assurance. If you have concerns, it is important to ask your provider what controls are put in place to reduce the risk of a disruption during testing.
For externally facing applications, APIs, and cloud infrastructure, production testing is often the preferred approach because it reflects the actual attack surface exposed to potential adversaries.
When staging may be the better choice
There are situations where staging environments remain the most appropriate option.
Large-scale changes, major platform migrations, or newly developed products may benefit from assessment before public release. In these cases, identifying vulnerabilities before deployment can reduce remediation effort and minimise risk.
Staging may also be preferable where production systems are particularly sensitive or where contractual, operational, or regulatory constraints limit testing activity on live systems.
The key consideration is ensuring that the staging environment accurately reflects production. The greater the divergence between the two environments, the less confidence organisations should place in the results as a representation of real-world exposure.
When choosing to test in staging, a compliance or regulatory authority may ask for evidence that validates the configuration between staging and production are identical, or that differences are known and tested appropriately.
The hybrid approach
Some organisations manage to achieve an appropriate level of assurance through a combination of staging and production testing. Whilst not applicable for every organisation, this approach can strike the right balance between operational risk and pressure from regulators or compliance authorities to test live systems.
Security assessments performed during development and pre-release phases help identify vulnerabilities early in the software lifecycle. Follow-up testing in production then validates that deployed systems are secure and that no issues have been introduced through deployment processes, infrastructure changes, or environmental differences.
Combining this process with a well-maintained record of differences between the production and staging environments can provide enough evidence to satisfy auditors where testing production environments carries a high degree of risk.
Factors to consider when making the decision
The decision ultimately depends on what level of assurance the organisation is trying to achieve and for what purpose.
If the objective is to validate a new application before launch, staging may be entirely appropriate. If the goal is to understand real-world exposure to satisfy an auditor or diligent customer, production testing will often provide stronger assurance.
Other factors include the sensitivity of the environment, operational constraints, the complexity of the architecture, and the organisation’s tolerance for testing activity on live systems. The ultimate decision can also influence penetration testing costs, particularly where additional safeguards or testing limitations are required to protect production systems.
An experienced professional should be able to explain the advantages and limitations of each approach and which is best suited to your specific situation when choosing a penetration testing provider.
How can Sentrium help?
There is no universal answer to whether penetration testing should be performed in staging or production. Both environments have advantages and limitations, and the appropriate choice depends on the purpose of the assessment.
Staging environments provide a safe and controlled setting for identifying vulnerabilities before deployment. Production environments provide the most accurate representation of real-world exposure and are often preferred when assessing operational risk.
If you’re unsure which environment should be tested, we can help you scope your penetration testing requirements during quotation and provide advice on which environment is best suited to your requirements.