Learning objectives
After reading this article you will be able to:
- Tell apart a dependency scanner (SCA), a dynamic scanner (DAST) and a manual pentest
- Understand how each one is billed and what it costs per year in an example
- Build a security plan that fits the size of your project
"Vulnerability scanner" and "pentest" often show up as if they were two versions of the same thing, a cheap one and an expensive one. They aren't. A scanner is a program that compares your project against a list of known problems and finishes in minutes. A pentest is a person trying to break into your application for days. They find different things, so the right question isn't which one to pick, but how much of each your project needs.
The numbers in this article are hypothetical, picked to keep the math simple. They are not any firm's or tool's prices; real figures live on the official pages listed in the sources.
What does each one do?#
Dependency scanner (SCA)#
Software composition analysis (SCA) reads your project's manifest and lockfile and checks every package and version against published vulnerability databases, such as the GitHub Advisory Database, the PyPA advisory database and OSV.dev. It finds libraries with known CVEs, including transitive dependencies, the ones you never installed on purpose. It doesn't look at the code you wrote.
The most common tools: npm audit sends a description of your project's dependencies to the registry and gets back a report of known vulnerabilities; pip-audit, maintained by PyPA, does the same for Python; Google's OSV-Scanner queries OSV.dev and covers several ecosystems at once. The full comparison is in best dependency scanner.
Dynamic scanner (DAST)#
Dynamic testing (DAST) examines the running application from the outside, without seeing the code. It crawls pages, sends requests and watches the responses: missing security headers, cookies without the right flags, error messages that leak details, some injection and XSS cases. ZAP is the best-known open source dynamic scanner. Its baseline scan crawls the site for 1 minute and only observes, without attacking, so its documentation calls it suitable even against production sites. The active scan sends real attacks and should run only against an environment you own, such as staging.
Manual pentest#
NIST defines penetration testing as testing in which evaluators mimic real-world attacks to find ways to get around the security features of an application, system or network. In practice, a tester gets a scope, rules of engagement and often test accounts, and spends days trying to chain flaws together, following methodologies such as the OWASP Web Security Testing Guide. They find what no scanner describes: user A seeing user B's order by changing an ID in the URL, a discount applied twice, a password reset flow you can skip. The deliverable is a report with reproduction steps, severity and a recommended fix.
What does each one find and miss?#
| Dependency scanner (SCA) | Dynamic scanner (DAST) | Manual pentest | |
|---|---|---|---|
| Looks at | lockfile and installed packages | the running application, from outside | the whole application, with business context |
| Finds | CVEs in libraries, transitive ones included | missing headers, insecure cookies, obvious injections | logic flaws, access control, chained flaws |
| Misses | flaws in your own code | business logic and authorization between users | whatever is out of scope |
| Takes | seconds | minutes to hours | days |
| Common cadence | every push or deploy | weekly or every release | yearly or after big changes |
There is also static analysis (SAST), which reads your source code looking for dangerous patterns. It sits between SCA and a pentest: it sees your code, but not how the running application behaves.
How is each one billed?#
SCA. The open source tools have no license: npm audit ships with npm, pip-audit and OSV-Scanner are Apache 2.0, and Dependabot alerts are available on every GitHub plan. The cost is the time to run them in CI and to update what they flag. Commercial tools add prioritization, a web interface and automatic fixes. Snyk, for example, has a no-cost plan with a test quota, and on its enterprise plan the bill grows with the number of developers contributing code.
DAST. ZAP is free and open source. Burp Suite has a no-cost Community Edition and a paid Professional edition. The real cost is setting up a staging environment and triaging alerts, because dynamic scanners produce many low-severity findings and some false positives.
Pentest. It is people's work, billed per fixed-scope project or per tester-day. The price goes up with the number of applications, routes and user roles, with the type of test (black box, with no information, or gray box, with accounts and documentation), with urgency and with retesting your fixes.
What does it cost per year for a small project?#
Hypothetical example: a Node.js API with a web front end, two user roles and card payments. Made-up figures, to compare orders of magnitude:
| Item | License | Time per year | Yearly cost (at $50 an hour, a hypothetical rate) |
|---|---|---|---|
| SCA in CI on every push | none | 12 hours of updates | $600 |
| Weekly DAST baseline | none | 4 hours of setup and 12 of triage | $800 |
| 5-day pentest, plus 1 day of retest | not applicable | 6 days at $1,000 a day (hypothetical) | $6,000 |
The two scanners add up to $1,400 of time and run all year. The pentest costs $6,000 and is a picture of a single week: next month, a new dependency can open a flaw it never saw. That is why one doesn't replace the other.
The commands to get started, none of them licensed:
# npm dependencies: fail only from high severity up (good for CI)
npm audit --audit-level=high
# Python dependencies
pip-audit -r requirements.txt
# Several ecosystems at once, using the OSV.dev database
osv-scanner scan source -r .
# Passive DAST: crawls for 1 minute and only observes, no attacks
docker run -t ghcr.io/zaproxy/zaproxy:stable zap-baseline.py -t https://staging.example.comTo run the first three on every push, see deploy with GitHub Actions.
What makes sense for a small project?#
An order that spends little and covers what is most likely:
- Get secrets out of your code. A leaked key is among the easiest flaws to exploit. See how to keep secrets out of code and, if it already happened, what to do when an API key is exposed on GitHub.
- Run SCA on every push. It costs no license and catches flaws already published for your dependencies.
- Run a DAST baseline every week against staging, and fix headers and cookies.
- Go through the deploy security checklist, with a WAF in front of public routes.
- Hire a pentest when the risk calls for it: payments, sensitive data, an enterprise customer whose contract requires a report, or a big change to login.
To bring the pentest price down, fix everything the scanners find first, so the paid days go to business logic, and hand over test accounts and documentation (gray box), so the tester doesn't spend days discovering what you could have told them. Paying an expert to find an outdated package is the most expensive way to run npm audit. And if your application has already been breached, the playbook is different: see my app was hacked: what to do.
How to do this on Square Cloud#
On Square Cloud, Cubic runs a read-only security check-up on every plan: type /checkup in the chat (up to 3 every 10 minutes). It covers the dependency side: it checks your packages against OSV.dev (GitHub Advisory Database, PyPA, Go vulnerability database, RustSec and others) for npm, PyPI, Composer, Go modules, crates.io, RubyGems and Hex, reading the lockfiles at the root and what the application installed, so transitive dependencies are included. Each finding comes with severity, advisory and CVE ids and the version that fixes it; a known malicious package shows up as critical.
Beyond dependencies, it flags credentials written in the code (file and line, never the value), the RAM peak of the last 24 hours against the limit and automatic restart turned off. Only the ecosystem, name and version of each package go to OSV.dev, and whatever couldn't be read shows up as "not verified", never as "all clear".
The check-up is not a pentest or an audit: it is a dependency and configuration check. Testing the running application (DAST) and the pentest stay with the tools and professionals from the sections above. See what it checks on the vulnerability scanning page.
Infrastructure
L3/L4/L7 DDoS mitigation and a WAF on every plan
FAQs
Does a vulnerability scanner replace a pentest?
No. A scanner compares what it finds against databases of known flaws and attack patterns. A pentest is a person trying to get around your application's security, which finds logic and authorization flaws that no database describes.
What drives the price of a pentest?
The scope: how many applications, routes and user roles are included, how much access the tester gets and how many days the work takes. Firms bill per fixed-scope project or per tester-day, and retesting your fixes may be billed separately.
Is npm audit enough?
For npm dependencies, it is a good start and costs nothing beyond the time to update. It doesn't look at your own code, your server configuration or your authorization logic: that is where DAST, code review and, when the risk justifies it, a pentest come in.
How often should you run each one?
Dependency scanners run on every push or deploy, because new flaws are published all the time. A passive DAST fits a weekly routine. A pentest is usually yearly or after big changes, such as a new login or payment flow.
More in Security
See all 24 articles- Authentication vs authorization: the difference in practiceAuthentication confirms who you are; authorization decides what you can do. Learn 401 vs 403, roles, scopes and the bug of checking only the login, with code.
- JWT vs cookie sessions: which to use for loginWith sessions, state lives on the server and the cookie holds an ID; with JWT, the data travels in the token. Compare logout, CSRF, XSS and multiple instances.
- What is SQL injection and how to prevent itSQL injection happens when user input becomes part of a SQL query. See how the attack works and how to prevent it with parameterized queries in Node.js and Python.
- What is a brute force attack and how to defend against itA brute force attack tests passwords in bulk until one works. Learn the types (spraying, credential stuffing), how they work and the defenses, with code that runs.