Skip to content

Penetration testing vs. vulnerability scanning: the differences

B2Bnetwork team · · 6 min

Security

In brief

Vulnerability scanning is automated, frequent checking of systems for known weaknesses, such as outdated software versions or misconfiguration. A penetration test is manual work by an engineer who, within an agreed scope, checks whether weaknesses can be chained into a real threat, including in business logic. A scan answers the question “what is out of date”, a test answers “what can happen”. You need both, at different rhythms.

The key differences in one table

AttributeVulnerability scanningPenetration test
Who performs ita tool, with the results reviewed by an engineeran engineer with tools
Frequencycontinuously or weeklyonce or twice a year and before a major change
Scopebroad: the whole network, all hosts and applicationsnarrow and deep: a selected application, API, or process
What it findsknown vulnerabilities, versions, configurationlogic flaws, chains of weaknesses, permission bypasses
Outputa list of findings with the tool's ratinga report with impact description, evidence, and recommendations
False positivesfrequent, must be filtered outrare, because every finding is confirmed
Unit costlowhigher, depending on scope and days of work

The simplest way to remember it: a scan is broad and shallow, a penetration test is narrow and deep.

Vulnerability scanning: what it finds and what it does not

An infrastructure scanner compares service versions and configuration against a database of known vulnerabilities (CVEs). A web application scanner, known as DAST, sends crafted requests and observes the responses. Both run quickly, so they suit a regular rhythm: weekly on the internal network, after every deployment to the test environment.

A scanner is good at detecting:

  • an outdated web server, library, or operating system with a known vulnerability,
  • weak TLS configuration, missing security headers, open ports,
  • default administration consoles and typical injection flaws in simple forms.

A scanner copes poorly with anything that requires understanding the application: whether customer A can see customer B's policy, whether the transfer approval step can be skipped, whether the transaction limit works after a currency change. Automation will not ask these questions, because it does not know what is correct in that system.

Penetration test: scope, rules, report

A penetration test starts with a document, not a tool. The parties agree on the scope (addresses, applications, test roles), the rules of engagement (time windows, environment, contacts in case of an outage, what is off limits), and the knowledge model:

  • black box: the tester knows only the address, like an outsider,
  • gray box: the tester receives accounts in several roles and the API documentation,
  • white box: the tester also has access to the code and architecture.

In business systems, gray box usually gives the most, because the testers' time goes into permission logic rather than into guessing how the application works. The methodology for testing web applications is described in the OWASP Web Security Testing Guide, and the general principles of planning and reporting technical tests in NIST SP 800-115.

A good report contains, for each finding, a description, the business impact, a severity rating, steps to reproduce for the team, a remediation recommendation, and information about retests. A retest after the fixes is part of the service: without it you do not know whether the flaw has really gone away.

How to prepare the system for a test

A few days of preparation save the testers time and you money. Before the start, prepare:

  • an environment with the same application version as production and with test data instead of real customer data,
  • accounts in every role covered by the scope, ideally two per role, to check access between customers,
  • API documentation (for example an OpenAPI file) and a description of the most important business processes,
  • a list of known issues, so you do not pay to have them discovered again,
  • a person on the team who answers questions during the test and immediately passes on critical findings.

A critical finding, for example the ability to read other people's data, is reported by the tester immediately, not only in the final report. It is worth writing this into the rules of engagement.

How to combine both in an annual plan

A sample plan for an application that serves the customers of a bank or an insurer:

  1. Continuously: dependency and image scanning in CI, DAST scan after deployment to the test environment.
  2. Weekly: infrastructure scan of the internal and external network, review of new findings by the team.
  3. Once a year: a gray box penetration test of the application and API.
  4. Before a major change: a penetration test of a new module, for example an API for third-party providers in open banking or a new SIM swap process at a telecom operator.
  5. After each test: fixes, retest, an entry in the vulnerability register.

Findings from both sources go into one process, described in the article Vulnerability management: priorities, deadlines, reporting. That way the board sees one picture of risk, not two reports in different formats.

Security testing and regulation

In the financial sector, the testing program follows directly from the rules. The DORA regulation requires financial entities to have a digital operational resilience testing program that includes, alongside scans and vulnerability assessments, penetration tests, and selected entities carry out advanced TLPT tests. We describe the details in the article Digital resilience testing under DORA. Software vendors face similar discipline under the Cyber Resilience Act, which requires vulnerability handling throughout the product's support period.

An example of such a test in practice is described in the scenario penetration tests of an API for third-party providers.

Questions and answers

Can a vulnerability scanner replace a penetration test?

No, because a scanner detects known technical weaknesses, not flaws in business logic and permissions. An application can have a clean scanner report and still let a customer read other people's data by changing an identifier. A scanner reduces the number of simple findings, so the penetration tester spends time on the harder ones.

How often should you run a penetration test?

The typical rhythm is once a year for every important application, plus before a major change is deployed: a new module, a new API for partners, a cloud migration. In regulated sectors the frequency may follow from the rules or from a customer contract, so first check what they say.

Can a penetration test harm production?

It can, which is why the rules of engagement set the environment, the time windows, and the types of testing excluded from the scope, for example load tests. Application tests are most often run in a pre-production environment with test data. When a test has to cover production, the parties agree on an emergency contact and a way to stop the work immediately.

What should a penetration test report contain?

The report has an executive summary, the scope and methodology, and for each finding a description, impact, severity rating, evidence, steps to reproduce, and a remediation recommendation. A good report also states what was checked without a result, because that shows how broadly the testers covered the system. After the fixes, the retest result is added.

What it looks like in a project

Want to check your application's security? Talk to an engineer.

Let's talk

Read more: Security