Safeguard
Security Guides•

New app or legacy app: which security testing comes first?

New projects can adopt every check from day one. Legacy apps need a different order to avoid a flood of old findings. Two sequences, side by side.

Safeguard Security Team
3 min read

For a new app, switch on dependency scanning and static checks at the first commit, so nothing ever builds up. For a legacy app, start with an inventory and dependency scanning, set a baseline for old findings, and enforce rules only on new code. Same methods, different order.

Why the two cases differ

A new codebase has no history. Every check starts clean, so you can fail builds on any serious finding without argument. A legacy codebase starts with years of accumulated issues. Turning on strict rules immediately produces thousands of findings, blocks every merge and teaches developers to ignore the tool.

Sequence for a new app

  1. Commit lockfiles and enable dependency scanning before the first release.
  2. Add static analysis on pull requests with a short, strict rule set.
  3. Write tests for access rules as each feature lands.
  4. Add a dynamic scan of staging once there are pages and an API to probe.
  5. Fuzz parsers when they appear.
  6. Record the baseline decisions in the repository, so later teams know why.

OWASP notes that static analysis feedback inside the development cycle can save time compared with finding problems later. A new app is where that advantage is largest.

Sequence for a legacy app

  1. Inventory first. List repositories, runtimes and packages. You cannot test what you cannot find.
  2. Run dependency scanning and sort known flaws by whether the code reaches them.
  3. Take a baseline. Record existing findings as accepted debt with an owner and a review date.
  4. Enforce on new code only. Fail builds only for findings introduced by the change in front of you.
  5. Burn down by risk, not by count. Fix issues on internet-facing and data-handling paths first.
  6. Add dynamic testing against a staging copy to learn how the old app behaves from outside.

Comparison

StepNew appLegacy app
First actionEnable scans on day oneBuild an inventory
Static findingsBlock on serious onesBaseline, then block only new
Old dependency flawsNone yetRank by reachability, fix in batches
Risk of tool fatigueLowHigh unless baselined

Pitfalls

  • Declaring a baseline and never reviewing it. Give each item an expiry.
  • Fixing the easiest findings instead of the riskiest.
  • Skipping the inventory because the team "knows what is there". Forgotten services are where old flaws hide.

Where Safeguard fits

Safeguard's asset discovery and SBOM support the inventory step, reachability analysis helps rank old dependency flaws, and gates can enforce rules on new changes. Static analysis findings come from your other tools. A free scan is at https://gold.safeguard.sh/scan.

Try it yourself

Click through it at your own pace, or open it full screen. Watch how a gate judges the change in front of it rather than the whole history.

Quick check

What is a baseline?

A recorded snapshot of existing findings, accepted for now, so that only new findings fail a build.

Should legacy apps skip static analysis?

No, but run it with a baseline and tuned rules so developers see only new, relevant results.

Sources

Last reviewed: 19 October 2026.

Never miss an update

Weekly insights on software supply chain security, delivered to your inbox.

Self-healing security runs on Safeguard.

Your first fix PR is minutes away.

No sales call required, even your agent can complete the purchase over MCP.