Yes. Fake data does not make a build harmless. Staging runs the same third party packages as production, usually holds deploy credentials and network paths, and is where bad dependencies first execute. Scan the build that goes to staging, keep an SBOM for it, and apply the same gates you use for release.
What fake data does and does not protect
Synthetic data removes one risk: leaking real people's records. It does not remove the others.
- Code execution. A compromised package runs inside the staging environment with whatever that environment can reach.
- Credentials. Staging usually has deploy keys, registry tokens and cloud roles. If those are broad, a staging compromise becomes a production problem.
- Promotion. The artifact that passes staging often becomes the production build. A vulnerable or malicious dependency promoted unchanged is the same dependency in production.
- Trust. Test environments connect to internal tools, package registries and chat.
Define the terms
- Dependency scanning compares the packages in your build against known vulnerability data.
- SBOM is a software bill of materials, a list of components in a build.
- Reachability asks whether your code actually calls the vulnerable function, which helps rank findings.
- Gate is a rule that blocks a merge or deploy when a condition fails.
Steps
- Scan in the pipeline, before deploy to staging. The scan should run on the exact lockfile that gets built, so results match the artifact.
- Generate an SBOM per build. Store it with the artifact, so you can answer "which builds contain this package" quickly.
- Include test and tooling dependencies. Seed scripts, fixtures generators and test helpers have their own packages and run with database access. Do not exclude them by default.
- Prioritise with reachability. Of the findings, fix first those where your code reaches the vulnerable path and an exploit is known.
- Gate promotion. Block promotion to production when a critical, reachable finding is open, with a documented exception route and an expiry.
- Scope staging credentials. Give the build job least privilege, so a compromised dependency cannot reach production resources. See the related post on dev and prod parity from a security view.
- Re-scan on a schedule. Advisories appear after you ship. A nightly scan of the current staging artifact catches new ones.
Where Safeguard fits
Safeguard provides dependency scanning, SBOM generation, reachability analysis and policy gates that can run in a pull request or pipeline. You can try a free scan at gold.safeguard.sh/scan to see what a repository's dependency inventory looks like.
Try it yourself
Click through it at your own pace, or open it full screen. Look at how the inventory lists direct and transitive packages, including ones you did not choose.
Quick check
Is it enough to scan production only?
It is late. A package that is already in production has been running there. Scanning earlier lets you stop it before promotion.
Should test only packages be scanned?
Yes. They run on developer machines and in CI with access to credentials and databases, so a bad one is a real way in.
Do I need a different scan for staging?
No. Use the same policy, so the artifact that passes staging is the one that ships.
Last reviewed: 19 October 2026.