Code and supply chain: penetration test vs red team exercise

A penetration test shows what is exploitable in a defined set of code, pipelines and artifacts. A red team exercise shows whether an objective-driven attack along the build and release path succeeds and whether defenders notice it.

On this page

Penetration test vs red team exercise for code and supply chain: which to buy first

A penetration test shows what is exploitable in a defined set of code, pipelines and artifacts. A red team exercise shows whether an objective-driven attack along the build and release path succeeds and gets noticed. If you own repositories, CI/CD pipelines and third-party dependencies, decide which of those two answers your current question before you write the scope. Commission a penetration test when you need a bounded list of exploitable weaknesses in named targets, such as runner configuration, secrets exposed to jobs, a signing step or an internally built artifact, with findings you can fix and retest. Choose a red team when the question is whether an attacker who gets a foothold in a developer account can reach production, and whether your logging and alerting would catch it.

A red team is the better fit once the basics are in place. That means branch protection, pinned dependencies and restricted workflow tokens have already been checked, for example with the automated checks in OpenSSF Scorecard, and someone on your team owns the remediation queue. Ask the provider how they would test the risks in the OWASP Top 10 CI/CD Security Risks, such as dependency chain abuse (CICD-SEC-3) and poisoned pipeline execution (CICD-SEC-4), and what access they would need. Write the boundaries down before work starts: whether testers may push to protected branches, use production signing keys, or reach third-party package registries and build services that your team does not operate. Each of those decisions belongs to your legal, platform and vendor owners, and each one changes the rules of engagement.

For most teams without a recent baseline, buy the penetration test first. It can also cover the developer-facing practices in NIST SP 800-53 control SA-11, such as manual code review, static analysis and attack surface review, which a red team exercise does not replace. Once known weaknesses are fixed, a red team can test whether detection works on the paths that matter. NIST SP 800-115 notes that organizations often combine techniques to reach an in-depth assessment at an acceptable level of risk, and that is the usual sequence: test the build path for exploitable weaknesses, then run an objective-driven exercise against what remains. CIS Safeguard 18.4 asks for security measures to be validated after each test so that detections cover the techniques the testers used. If you are a regulated financial entity, confirm with your supervisor whether a threat-led exercise is already required, because that changes both the scope and the minimum duration.

Penetration test vs red team exercise: goals, scope and evidence side by side

This table compares a scoped penetration test and a red team exercise across the code and supply chain, from repositories and build systems to artifact registries and signing. Read each row as a choice about which question you need answered first. The main takeaway is that a penetration test checks known weaknesses in named components, while a red team checks whether an adversary can reach a release-integrity objective without being noticed.

DimensionPenetration testRed team exercise
Primary goalFind and validate exploitable weaknesses in named repositories, pipelines and registries.Test whether an adversary can reach a defined objective, such as altering a release, and whether anyone notices.
Starting questionWhich weaknesses in these build components can an attacker exploit, and how severe are they?Can an adversary get from outside access to a tampered, signed artifact before defenders respond?
Scope unitListed repositories, CI/CD pipelines, build servers, artifact registries and signing services, tested one by one.An objective and the paths to it, which may cross repositories, pipelines, registries and signing services.
Access levelSource code and, if agreed, low-privilege build credentials, documented in the scope.Starts outside the environment; insider-level views such as build credentials only if the rules allow.
Method at a buyer levelFollows PTES phases: pre-engagement, intelligence gathering, threat modeling, vulnerability analysis, exploitation, post-exploitation, reporting.Planned against MITRE ATT&CK Enterprise tactics, such as initial access, persistence, credential access and impact, then adapted as the test runs.
Rules of engagementWritten in line with the NIST SP 800-115 Appendix B template, naming systems, time windows, and limits on production signing keys.Adds objectives, deconfliction contacts, stop conditions and what social engineering may touch, agreed in writing before start.
What defenders are measured onWhether validated weaknesses get fixed and pass retest.Whether the objective was reached and what defenders detected, escalated and contained. TIBER-EU results have no pass or fail.
Evidence producedReproducible findings with severity, evidence and fix guidance, mapped to the component tested.A narrative attack path with timeline, detection gaps and the objective outcome, shared in a joint review.
Buyer team effortNamed engineers for pipeline questions, test accounts, triage of fixes and a retest after remediation.A small control group that knows the exercise, a white cell for deconfliction, and staff for joint review.

How each approach runs against a code and supply chain target

A penetration test answers a bounded question: what can a tester reach and exploit inside an agreed scope? The PTES sections run in order: pre-engagement interactions, intelligence gathering, threat modeling, vulnerability analysis, exploitation, post exploitation and reporting. On a code and supply chain target, the pre-engagement and threat modeling steps decide what is in scope: which repositories, build runners, package registries and deploy paths are included, and whether testers receive source, pipeline configuration and developer access or only a deployed URL. That access changes what can be verified. OWASP ASVS 5.0.0 notes that many Level 2 and Level 3 requirements need documentation, source code, configuration and the development team, which black box testing cannot supply. PCI SSC's penetration testing guidance describes the work as essentially manual and says running an automated tool alone does not satisfy the requirement, so ask who performs the test and how much of it is human-led.

A red team exercise starts from an objective and lets the team choose its own path to reach it. For a supply chain target, that objective is often a pipeline or credential outcome. Illustrative examples include getting an unreviewed change into a release artifact or obtaining the token that publishes packages. The team may pivot from a compromised developer account into CI runners, artifact stores and cloud roles, and the route it takes becomes a key finding. Evidence is a narrative of the attack path, the controls it crossed and whether defenders detected it. Because the path is open, the scope must also state the boundaries, such as whether phishing or stolen credentials are allowed and whether production signing keys are off limits, since those choices change what the exercise actually tests.

Whichever approach you choose, the rules of engagement must be agreed in writing before work starts. NIST SP 800-115 provides a rules of engagement template in Appendix B. Use it to settle which pipelines, runners and credentials may be touched, whether a tester may alter a build or publish an artifact, what happens if a signing key or deploy token is captured, and who is called when production degrades. Frameworks such as the Secure Software Development Framework and SLSA are design baselines to measure against, and they are not tests in themselves. A tester can show where a pipeline falls short of them, but a finished test does not certify conformance.

Which test fits which code and supply chain question

The diagram starts from the buyer goal. If the aim is to find exploitable flaws in a defined set of repositories and pipelines, a penetration test with source access fits. If the aim is to test whether detection and response catch an attack on the build and release path, a red team exercise under written rules of engagement fits. Teams that need both outcomes can run a combined programme. Designated financial entities follow a separate regulator-led branch, where DORA threat-led penetration testing or TIBER-EU applies. Confirm which branch your regulator or contract requires before you scope the work.

Decision path from the buyer goal to the test that fits.

What each approach finds and misses in code and supply chains

Penetration tests and red team exercises answer different questions about code and supply chains. The first checks which flaws in a defined set of repositories, pipelines and dependencies can be exploited, while the second checks whether an attacker can chain weaknesses across code, pipeline and people without being noticed. Read the cards as a pair: each method's blind spot is the other's focus.

What a penetration test finds

A penetration test uses exploits against the repositories, CI/CD pipelines and build systems named in its written scope, and it reports what the tester could actually reach. Typical findings include overly broad pipeline permissions, workflows or runners that can read secrets they do not need, and credentials stored where a tester can pick them up. NIST SP 800-115 treats penetration testing as a high-risk, active technique, so agree the rules of engagement in writing before testing starts. Ask for a list of every pipeline and token the tester tried, so the report shows what was reachable and what was not.

NIST SP 800-115

What a penetration test misses

A penetration test covers only the repositories, pipelines and dependencies its scope names, so a service repository or a self-hosted runner outside the agreed list stays untested. It also says little about detection. Unless the statement of work asks for it, nobody checks whether logs, alerts or pipeline audit trails fired during the test. CIS Safeguard 18.4 asks for security measures to be validated after each test so that detections cover the techniques testers used, so confirm that step is in the contract. Ask the tester to name every excluded asset in the report.

What a red team finds

A red team exercise chains weaknesses across code, pipeline and people to reach a defined objective, such as tampering with a release artifact or obtaining a signing key. Chained paths are the main output, and they show which steps the defenders saw and which passed silently, which is the detection gap that penetration reports often leave unmeasured. An illustrative chain might start with a compromised maintainer account, move through a workflow that trusts pull request input from outside the team, and end at a deploy credential. Use the results to set priorities for logging, approvals and key handling.

What a red team misses

A red team samples paths by design. It picks an objective and follows the routes that reach it, so a vulnerable dependency or an unreviewed workflow in a repository nobody targeted may never be examined. Broad coverage of every repository is not what the exercise is built to deliver. If you need a repository-by-repository answer, pair the exercise with a scheduled review of code and pipeline configuration, and ask the provider which paths it deliberately left unexplored and why.

Gaps neither test closes

Source code reviews, dependency analysis and SBOM work can find problems that neither a penetration test nor a red team exercise reaches, and both approaches can miss them. A code review sees only the code it was given, a dependency analysis sees only the packages it can identify, and an SBOM is only as complete as the build data behind it. The NTIA minimum elements, published on 12 July 2021, define what an SBOM should contain, but they do not check its accuracy. Ask for each of these as a separate deliverable with its own coverage statement.

NTIA SBOM elements

What you receive from each: report, evidence and retest

This table compares what each test hands back to your team: the findings or narrative, the timeline, the debrief and the retest. Read it by asking which output your remediation owners and assessors need, since a penetration test closes with a findings register and a red team closes with an attack narrative. Audit inputs such as SBOMs and SLSA provenance must be requested explicitly in either case.

ElementPenetration testRed team exercise
Primary outputFindings register listing each issue, severity, reproduction steps and affected repositories or pipelines.Attack narrative listing objectives reached, the path taken and the defender actions observed along it.
Pipeline and code scopeNamed repositories, CI workflows, build runners and dependency paths tested, with source access agreed in writing.Objectives such as tampering with a release pipeline or merging malicious code, scoped and approved in advance.
Timeline and detectionUsually records whether a control blocked a step, with timestamps for each test action.Timeline of defender actions, detection points and response decisions, drawn from logs and the joint review.
Severity and scoringEach finding rated, using the scoring method named in the scope (confirm the CVSS version with the tester).Results framed around objectives reached and detection. TIBER-EU tests produce no pass or fail result.
Joint debriefWalkthrough of findings with repository and pipeline owners who can reproduce them.Joint debrief with blue team and engineering owners, covering what was seen, missed and changed.
RetestRetest of each fixed finding against the same reproduction steps, within the agreed scope.Replay of the attack path after fixes to confirm detection and response changes. Agree retest terms in writing.
Audit inputs (SBOM, SLSA)Ask for SBOMs in CycloneDX or SPDX and SLSA provenance as explicit inputs, since tests do not produce them by default.Same inputs apply. Ask for provenance for the pipeline tested, so the path can be checked against build records.
Audit reportsDeployOpen prepares test evidence for your assessor. It does not issue audit reports or attestations; independent auditors do.Exercise records can support assessor review. DeployOpen does not issue audit reports or attestations.

What drives cost and duration for each approach

Cost and duration for code and supply chain work follow the written scope. Penetration tests and red team exercises share cost components such as tester time, access setup, legal preparation and reporting, but each adds different scope items. DeployOpen publishes no price list, and a quote follows from the written scope, so ask for named scope items, the access model, retest terms and report format.

Penetration test scope

Effort follows what sits inside the boundary: repositories, CI/CD pipelines, build artifacts such as container images and packages, and the environments (dev, staging, production) where they run. Each added item adds tester time, so count every pipeline and artifact registry before you ask for a number. Ask the provider to name each repository and environment in the statement of work, and to state which ones are excluded.

Access level and verification depth

Access changes how deep verification can go. Read access to source lets testers trace dependency declarations, workflow files and secret handling in code. Build credentials show whether a pipeline can be pushed to or its artifacts altered, and admin views expose branch protection and runner configuration. Decide the access model before scoping, because each tier adds effort. Confirm who grants access and how it is revoked when testing ends.

Red team objectives and attack paths

A red team exercise is scoped around an objective, such as reaching a signing key or changing a release artifact, plus the number of attack paths testers may try toward it. More objectives and paths mean more planning, more time inside the environment and more intelligence gathering. A supply chain objective might chain a compromised dependency, a poisoned workflow and a stolen token. Agree on a short list of named objectives and a path count in writing.

Defender baseline and blue team role

Whether the blue team knows about the exercise changes both effort and what you can learn. If defenders take part, plan observer time, a joint debrief and a shared timeline. A covert run tests detection and response, but you need clear success criteria and a record of what each team saw. Confirm which pipeline, registry and runner logs exist before testing. A missing log makes a detection finding impossible to prove.

Rules of engagement and authorization letters

Rules of engagement set what testers may touch, which hours they may act, what happens if they reach production data, and who to call when a pipeline breaks. NIST SP 800-115 includes a rules of engagement template in Appendix B. For supply chain work, the authorization letter must cover third-party repositories, hosted CI services and package registries, since you cannot authorize testing of systems you do not control. Get legal review of every third-party service on the list.

NIST SP 800-115

Retests and recurring cadence

One engagement produces findings, so the cost question shifts to retesting. Ask whether one retest of fixed pipeline changes is included, how long the retest window runs and whether ongoing work moves into a retainer. CIS Controls v8.1 Safeguards 18.2 and 18.5 ask for penetration tests at least annually, so recurring work is common for mature programs. Put retest terms and the recurring cadence in the quote, alongside the first test.

How penetration tests and red team exercises combine across the software lifecycle

Start with source code review and dependency analysis early in development, while changes are still cheap to make. NIST SP 800-218, the Secure Software Development Framework Version 1.1, places this work in its Produce Well-Secured Software (PW) group, which covers building security into the software as it is written and assembled. For a self-hosted platform, that means reviewing your own customizations, connectors and configuration, and checking the open-source components you pull in for known weaknesses and for hygiene signals such as pinned dependencies and protected branches. OpenSSF Scorecard runs several of these checks automatically on open-source repositories. The OWASP Web Security Testing Guide v4.2 also recommends putting more weight on the early development phases. Confirm early whether the tester will receive source access, because OWASP ASVS 5.0.0 notes that many Level 2 and Level 3 requirements need documentation, source code and access to the development team, not only black box testing.

Next, schedule penetration tests against pre-release builds of the application and its delivery pipeline. NIST SP 800-115 suggests interleaving regularly scheduled scanning with periodic penetration testing, so scanning catches routine drift between tests. A penetration test uses real exploits against the target, which is why the guide rates it as high risk compared with passive review techniques. PCI SSC's penetration testing guidance is explicit that simply running an automated tool does not satisfy a penetration testing requirement. For the pipeline, the OWASP Top 10 CI/CD Security Risks give a usable scope list, including CICD-SEC-4 Poisoned Pipeline Execution and CICD-SEC-9 Improper Artifact Integrity Validation. Fix the commit and build the tester receives, write down which pipeline credentials and runners are in scope, and make remediation under the Respond to Vulnerabilities (RV) group the exit criterion for the release.

Which compliance frameworks call for each approach

NIST SP 800-53 Rev. 5 is the control catalog that many US federal and federally aligned programs use, and it covers both approaches in two families. CA-8 Penetration Testing addresses independent testers and red team exercises, while SA-11 Developer Testing and Evaluation places specific testing activities on the developer during build.

  • Baseline placement: SP 800-53B Release 5.2.0 selects CA-8 and CA-8(1) only in the high baseline, so a moderate or low system does not carry them by default.
  • Independent team (CA-8(1)): this enhancement covers testing by an independent penetration testing agent or team.
  • Red team exercises (CA-8(2)): the catalog lists a red team enhancement, but the baseline selection above does not cover it, so confirm whether your overlay selects it. NIST SP 800-53 CA-8 entry
  • SA-11 activities: nine enhancements include static code analysis, threat modeling and vulnerability analyses, manual code reviews, penetration testing, attack surface reviews, dynamic code analysis and interactive application security testing.
  • Developer accountability: SA-11 assigns the testing to the developer, so your contract or internal development standard should name who runs each activity and who keeps the results.

Confirm with your authorizing official or assessor which baseline applies, which CA-8 and SA-11 enhancements appear in your system security plan, and whether any overlay changes them.

What does a penetration test vs red team exercise need from our team?

What drives cost and effort for a penetration test versus a red team exercise?

A penetration test is driven mainly by the targets, the depth of authenticated testing and the report, while a red team exercise is driven by the objective, the length of covert operations and the preparation and debrief around them. Both have one-time costs for scoping, onboarding and rules of engagement, and recurring costs for retests and repeat exercises. Costs rise when the target surface is large, when several user roles or credentials are needed, when social engineering or physical access is in scope, or when results must be re-verified after fixes. They fall when targets are documented and access is ready on day one. DeployOpen provides a quote from a written scope, so ask for each target, each test type, the phases, who performs the work and what retest is included.

How long does each approach take, and what sets the timing?

Timing is set by scope, access and the calendar, and both approaches should be agreed as fixed scope in writing before any testing starts. A penetration test has a defined set of targets and rules, so its duration follows the target count and testing depth. A red team exercise runs toward an objective over a longer active period, and TIBER-EU, for example, requires at least 12 weeks of active testing in its framework dated January 2025, which shows how regulated programs lengthen the work. Delays often come from late access approvals, unavailable contacts, change freezes and waiting on remediation before a retest. Ask for a written schedule with the start and end dates, the active testing window, the reporting and debrief dates, the retest window and the conditions that would pause work. Treat any duration you hear before scoping as a guess.

What access, contacts and rules of engagement does our team need to provide?

Your team needs to provide written authorization, named contacts, test accounts, network paths and a rules of engagement document before testing starts. NIST SP 800-115 includes a rules of engagement template in Appendix B, which is a useful reference for the document. Name at least one technical contact who can stop testing, one escalation contact for incidents and one business owner who approves scope changes. For penetration tests, you usually provide target lists, IP ranges, application accounts for each role and any test data. For red team exercises, you also agree on objectives, which systems are off limits, whether social engineering or physical access is allowed, how personal data is handled and when defenders are told. Confirm in writing how the security operations team is informed, since a covert exercise may trigger their response.

Can our internal staff run a penetration test or red team exercise?

Internal staff can run useful security testing, but independence changes what the evidence can show. An internal team testing its own systems can find many issues, but an auditor may ask whether the tester was independent of the people who built and run the system. NIST SP 800-53 control CA-8 has an enhancement for an independent penetration testing agent or team, so check whether your assessment program requires that independence. Internal staff are well placed for routine scanning, regression checks and retests, while an outside team can challenge the defenders' assumptions. The practical questions are who signs the report and who sees the findings before they are fixed. DeployOpen is a separate company from your own team, which matters for this question. Confirm in writing who can access results, how conflicts of interest are handled and which findings your auditor will accept.

Do we still need a red team exercise if a penetration test is scheduled?

Not always. A penetration test answers whether known weaknesses can be exploited within an agreed scope, while a red team exercise answers whether your people and controls detect and respond to an adversary pursuing an objective. If your scheduled penetration test covers the applications or networks you care about and your detection is working, a red team may be premature. A red team becomes more useful when you want to test detection and response, when repeated scoped tests stop surfacing new findings, or when a regulator expects an objective-led exercise. NIST SP 800-53 control CA-8 lists red team exercises as an enhancement, so your control mapping may already point to one. CIS Controls Safeguard 18.4 asks for security measures to be validated after each test so that detections cover the techniques testers used, which is a reason to plan the two together. Confirm the objective, scope and detection baseline in writing before you choose.

Does a red team exercise test our source code directly?

Usually not as its main method. A red team exercise tests whether an adversary's path to an objective is detected, and that path may use a stolen credential, a pipeline weakness or a compromised dependency. Source code review is a separate method. NIST SP 800-53 control SA-11 lists static code analysis, manual code reviews, dynamic analysis and interactive testing among developer testing enhancements. The OWASP Web Security Testing Guide notes that source code review is one of four techniques and that no single technique is enough. DORA Article 25(1) lists source code reviews where feasible among appropriate tests. OWASP ASVS 5.0.0 notes that verifying many Level 2 and Level 3 requirements needs access to documentation, source code, configuration and the development team, which goes beyond black box testing. If code and pipeline integrity matter, scope a source code review or pipeline assessment explicitly and confirm repository access, build logs and the dependency list in writing.

Does a regulator-led exercise apply to our organization?

It applies only if a regulator or competent authority designates your entity or requires the exercise. TIBER-EU is the European Central Bank's framework, applied through national authorities, and DORA Article 26 requires threat-led penetration testing at least every 3 years for entities their competent authority identifies. CBEST is the Bank of England's scheme for UK firms and financial market infrastructures, and the Bank names CREST as the accreditation and certification body for it, so tester selection follows that scheme's rules. Outside these schemes, a supervisor may still expect scenario-based testing, so ask directly. A voluntary red team may not satisfy a regulator-led requirement, so confirm that with the supervisor. Before buying, confirm in writing whether your entity is in scope, which authority oversees the test, what tester accreditation applies and how results reach the supervisor.

What will auditors accept as evidence from a penetration test or red team?

Auditors and certification bodies decide what evidence they accept, and DeployOpen does not issue audit reports, attestations or certifications. DeployOpen prepares systems, controls and evidence for those assessments, so the work should give your assessor material to review. Before testing, ask your auditor which testing standard they expect, whether they require an independent tester, how deep authenticated testing must go and how they will treat findings marked as accepted risk. NIST SP 800-115 describes assessment techniques and notes that organizations often combine them. The PCI SSC Penetration Testing Guidance v1.1 says that simply running an automated tool does not satisfy a penetration testing requirement, which shows how assessors read test depth. Get the assessor's expectations in writing, and keep the scope and rules of engagement so the evidence traces back to them.

How DeployOpen scopes and runs penetration tests and red team exercises

DeployOpen plans and runs code and supply chain testing inside your own infrastructure, using the agreed written scope as the boundary. Penetration tests and red team exercises answer different questions, so we confirm the objective, the access level and the rules of engagement before any work starts. The sections below show how each engagement is scoped, tested, handed over and supported.

How we scope

  • Engagements are fixed-scope, with scope, deliverables and timelines agreed in writing before work starts.
  • For a penetration test, the scope fixes the target list, test window and whether testers receive credentials.
  • For a red team exercise, the written scope also sets the objective, permitted techniques and out-of-bounds systems.

How we test

  • Testing starts from the agreed target list, with source code review added where repository access is granted.
  • Supply chain checks can cover build pipeline configuration, dependency sources, artifact handling and CI/CD secrets, as agreed.
  • Red team work pursues the agreed objective, with a stop procedure set in the rules of engagement.

How we hand over

  • The written scope should list each deliverable, including evidence and reproduction steps for every finding.
  • Ask for the attack narrative and detection gaps reported separately, so fixes can be assigned to owners.
  • Each finding should carry a recommended fix, and confirm whether retest is included in the written scope.

How we support

  • Ongoing support, upgrades and continuous testing are available as retainers after the initial engagement closes.
  • Retesting after fixes can be scoped as a follow-on piece of work, with its own written scope.
  • Repeat tests are a good time to confirm that the source and pipeline controls still match the last report.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.