00->1
Learning pathStep 57 of 62Detection, response and testing ← All writeups

Security Testing, Explained

If you are reading this, you have probably heard "vulnerability scan", "pen test", "SAST", "DAST" and "threat model" used as if they were the same thing, or as if one tool could replace all the others, and you want to know what each one really does, when it is used, what it misses, and what you must have in place before you run any of them.

By the end you will be able to define security testing, explain why authorization and rules of engagement come first, tell a vulnerability scan from a penetration test, explain static, dynamic and interactive code analysis, describe threat modeling, follow the phases of a penetration test, and say how test results become fixes. It builds on Threats and Vulnerabilities, Security Operations and Blue, Red and Purple Teams.


1. What security testing is

NIST SP 800-115 (Technical Guide to Information Security Testing and Assessment, September 2008) starts with the bigger idea. A security assessment is "the process of determining how effectively an entity being assessed (e.g., host, system, network, procedure, person—known as the assessment object) meets specific security objectives." It names three assessment methods:

Method NIST's definition
Testing "The process of exercising one or more assessment objects under specified conditions to compare actual and expected behaviors"
Examination "The process of checking, inspecting, reviewing, observing, studying, or analyzing one or more assessment objects to facilitate understanding, achieve clarification, or obtain evidence"
Interviewing "The process of conducting discussions with individuals or groups within an organization to facilitate understanding, achieve clarification, or identify the location of evidence"

So "security testing" in everyday speech covers more than attacking things. It means checking whether the security you think you have is the security you actually have.

Three families of technical technique

SP 800-115 groups the techniques like this:

Family What it does Examples in the guide
Review techniques Examination of "systems, applications, networks, policies, and procedures to discover vulnerabilities", generally done manually Documentation review, log review, ruleset review, system configuration review, network sniffing, file integrity checking
Target identification and analysis Finds "systems, ports, services, and potential vulnerabilities", generally with automated tools Network discovery, port and service identification, vulnerability scanning, wireless scanning
Target vulnerability validation "Corroborate the existence of vulnerabilities" Password cracking, penetration testing, social engineering, application security testing

The guide's own advice: "Since no one technique can provide a complete picture of the security of a system or network, organizations should combine appropriate techniques to ensure robust security assessments." It also warns that validation "involves the greatest amount of risk in assessments, since these techniques have more potential to impact the target system or network than other techniques."

Testing across the life of a system

The OWASP Web Security Testing Guide (WSTG) argues that testing should not wait until an application is finished. Its framework places activities in five stages:

Stage Example activities (WSTG)
Before development Define a secure development life cycle, review policies and standards, plan measurements
Definition and design Review security requirements, review design and architecture, create and review threat models
Development Code walkthroughs and code reviews
Deployment Application penetration testing and configuration testing
Maintenance and operations Operational reviews, "monthly or quarterly health checks", and checking each change to confirm security was not affected

A test also has a shelf life. SP 800-115 notes that "an assessment provides a snapshot of security at a given point in time", so tests are repeated, particularly after changes.


2. Before any test: authorization and rules of engagement

Every technique in this post can be misused. The difference between a test and an attack is permission, written down and agreed in advance. That is why this section comes first.

What the standards require

  • NIST SP 800-53 (control CA-8, penetration testing): "All parties agree to the rules of engagement before commencing penetration testing scenarios."
  • NIST defines rules of engagement (ROE) as "detailed guidelines and constraints regarding the execution of information security testing. The ROE is established before the start of a security test, and gives the test team authority to conduct defined activities without the need for additional permissions."
  • The Nmap documentation, from the authors of one of the most widely used scanners: "The best way to avoid controversy when using Nmap is to always secure written authorization from the target network representatives before initiating any scanning." For a penetration test, "this authorization should be in the Statement of Work."

What a rules-of-engagement document contains

SP 800-115 includes a template (Appendix B). Its main parts:

Part What it covers
Purpose, scope, assumptions, risks Why the test is being done, its boundaries, and the risks of intrusive tests with ways to reduce them
Logistics Named people and contacts, the test schedule (for example, testing an operational site "during evening hours rather than during peak business periods"), test locations and equipment
Communication and incident handling Criteria for halting the test, what the test team does if a test "negatively impacts the network or an adversary attacks the organization while testing is underway", and the organization's incident response contacts
Target systems What may be tested, including authorized and unauthorized IP addresses or identifiers, and an "exclude list" of systems not authorized for testing
Testing execution "Allowable and unallowable activities" and the methodology

Two further points from SP 800-115:

  • Check you own the targets. "If given a list of authorized IP addresses to use as targets, assessors should verify that all public addresses (i.e., not private, unroutable addresses) are under the organization's purview before testing begins."
  • Involve legal advice for intrusive tests. The guide recommends legal advisors "always be involved for intrusive tests such as penetration testing", covering liability, nondisclosure agreements and privacy. Captured data "may include sensitive data that does not belong to the organization—or personal employee data", so packet captures should follow the legal department's requirements.

Why it matters: a real case

Nmap's legal-issues page tells the story of Scott Moulton, a consultant who had a contract to maintain a county 911 system in Georgia, USA. In December 1999, while setting up a router, he ran preliminary port scans that touched a web server owned by a competing consulting firm. That firm reported him to the police, and he was arrested for allegedly violating the US Computer Fraud and Abuse Act. In a related civil case, which was dismissed, the court held that an unauthorized port scan and throughput test did not violate that Act or the Georgia state law, and the criminal charges were eventually dropped. Nmap's account adds that he nevertheless "suffered six-figure legal bills and endured stressful years battling through the court system."

Nmap's authors state that "no United States federal laws explicitly criminalize port scanning", but add that many US states have their own computer abuse laws, that laws in other nations differ, and that you should "speak to a competent lawyer within your jurisdiction." In India, section 43 of the IT Act turns on access "without permission of the owner" (see Risk and Security Controls). The practical lesson holds everywhere: get written authorization first.

Five questions before you start

Question Why
Do I own this system, or do I have written permission? Permission is what separates testing from unauthorized access
Is the scope written down, including what is excluded? Prevents testing a neighbour's system by accident
Which activities and times are allowed? Some tests can disrupt a live service
Who do I call, and when do I stop? A test can cause an incident
Where will the data go, and who may see it? Tests can expose personal or confidential data

3. Vulnerability scanning

What it is

NIST's glossary describes vulnerability scanning as "a technique used to identify hosts/host attributes and associated vulnerabilities." SP 800-115 explains that a scanner "identifies hosts and host attributes (e.g., operating systems, applications, open ports), but it also attempts to identify vulnerabilities rather than relying on human interpretation of the scanning results." It does this "by identifying the operating systems and major software applications running on the hosts and matching them with information on known vulnerabilities stored in the scanners' vulnerability databases." It can help find "outdated software versions, missing patches, and misconfigurations."

Scanning builds on two simpler steps:

Step What it does (SP 800-115)
Network discovery Finds active, responding hosts, through passive techniques (a sniffer watching traffic, which sends no probing packets) or active ones (such as ICMP pings)
Port and service identification Uses a port scanner to find open ports and the services behind them. OS fingerprinting guesses the operating system from the responses, but "is not foolproof"

Nmap describes itself as "a free and open source utility for network discovery and security auditing."

Kinds of scan

SP 800-115 describes several ways to run one:

Kind How it works Notes
Network-based, without credentials Locates hosts and scans them from the network Can be run internally and externally. "Internal scanning usually uncovers more vulnerabilities than external scanning", but "testing from both viewpoints is important"
Network-based, with credentials The scanner has administrator-level credentials on individual hosts and can extract vulnerability information from them Gets information a scan without credentials cannot see
Local (host-based) A scanner installed on each host Detects vulnerabilities "with a higher level of detail than network-based scanning" because it has local access. It finds misconfigurations and flaws exploitable locally as well as over the network

What scanners are good at, and not

NIST calls a scanner "a relatively fast and easy way to quantify an organization's exposure to surface vulnerabilities", where a surface vulnerability is "a weakness that exists in isolation, independent from other vulnerabilities." The same guide lists the limits:

Limit Explanation (SP 800-115)
False positives Scanners "can have a high false positive error rate (i.e., reporting vulnerabilities when none exist)", so "an individual with expertise in networking and OS security should interpret the results"
Combinations Vulnerabilities "rarely exist in isolation." Several low-risk issues can be a higher risk combined, and "scanners are unable to detect vulnerabilities that are revealed only as the result of potentially unending combinations of attack patterns"
Their own risk labels Scanners "often use their own proprietary methods for defining the levels", so results are hard to compare, and a label "may not reflect the actual risk to the organization." NIST's example: a scanner calls an FTP server a moderate risk because it sends passwords in cleartext, but if it is an anonymous public server that uses no passwords, the real risk may be much lower. "Assessors should determine the appropriate risk level for each vulnerability and not simply accept the risk levels assigned by vulnerability scanners."
Active systems only Network scanning "uncovers vulnerabilities only for active systems"
Network load Scanning generates "significantly more network traffic than port scanning" and "may have a negative impact on the hosts or network being scanned"
Denial of service tests Many scanners include DoS tests which, "in the hands of an inexperienced assessor, can have a marked negative impact on scanned hosts." These can usually be suppressed

Scanning in a program

NIST SP 800-53 control RA-5 (vulnerability monitoring and scanning) says organizations should:

  • scan "when new vulnerabilities potentially affecting the system are identified and reported", not only on a schedule;
  • use tools that express vulnerabilities in standard ways, "the Common Vulnerabilities and Exposures (CVE) naming convention" among them (see Threats and Vulnerabilities);
  • analyze the results;
  • "remediate legitimate vulnerabilities" within response times set by an assessment of risk;
  • share what is learned to "help eliminate similar vulnerabilities in other systems"; and
  • keep scanning tools up to date so that "new vulnerabilities are not missed."

RA-5 also reminds readers not to forget infrastructure: "switches, routers, guards, sensors", networked printers, scanners and copiers.

What to fix first is a separate question, covered with CVSS, KEV, EPSS and CISA's BOD 26-04 in Threats and Vulnerabilities and in the patching cycle in Security Operations.

CISA offers a free Vulnerability Scanning service (part of its Cyber Hygiene services) to US federal, state, local, tribal and territorial governments and to critical infrastructure organizations. It "continuously monitors and assesses internet-accessible network assets (public, static IPv4 addresses)", with weekly reports and ad hoc alerts for urgent findings such as risky services and known exploited vulnerabilities. CISA also offers a Web Application Scanning service that checks public web applications, including for the OWASP Top Ten.

A vulnerability scan is not a penetration test

Vulnerability scan Penetration test
Core question "What known weaknesses appear to exist?" "Can these weaknesses actually be exploited, and what can an attacker reach?"
Method Mostly automated, matching against known vulnerability data Skilled people, using scan results plus manual testing
Result A list of possible findings, with false positives Verified findings and demonstrated impact
NIST's wording Scanners "check only for the possible existence of a vulnerability" The attack phase "exploits the vulnerability to confirm its existence"
Cost and risk Low effort, usually regular "Labor-intensive and requires great expertise", with more risk to the target

NIST SP 800-53 (CA-8) adds that penetration testing "goes beyond automated vulnerability scanning."


4. Testing software: code review, SAST, DAST, IAST and SCA

When an organization builds software, it can test it from the inside (the code) and from the outside (the running program). NIST SP 800-218, the Secure Software Development Framework (SSDF), asks developers to do both.

Code review and code analysis

SSDF practice PW.7 separates two ideas:

  • Code review: "a person looks directly at the code to find issues."
  • Code analysis: "tools are used to find issues in code, either in a fully automated way or in conjunction with a person."

NIST SP 800-53 (SA-11(4)) says manual code reviews "are usually reserved for the critical software and firmware components" and are "effective at identifying weaknesses that require knowledge of the application's requirements or context that, in most cases, is unavailable to automated analytic tools", for example verifying access control matrices against application controls.

The main tool-based approaches

Approach What it does Source
Static analysis (SAST) Analyzes source code or compiled code without running it OWASP: SAST tools "can help analyze source code or compiled versions of code to help find security flaws." NIST SA-11(1): static code analysis is "most effective when used early in the development process, when each code change can automatically be scanned for potential weaknesses"
Dynamic analysis (DAST) Tests a running application from the outside OWASP: web application vulnerability scanners "scan web applications, normally from the outside, to look for security vulnerabilities". NIST SA-11(8): dynamic code analysis "provides runtime verification of software programs"
Interactive testing (IAST) Watches the application from the inside while it runs under test NIST SA-11(9): "a method of detecting vulnerabilities by observing applications as they run during testing", using instrumentation
Fuzz testing Feeds the program malformed or random input to see how it fails NIST SA-11(8): fuzz testing "induces program failures by deliberately introducing malformed or random data into software programs"
Software composition analysis (SCA) Checks the third-party and open source components you use for known vulnerabilities OWASP's DevSecOps guide: "the process of automating application security for managing third-party and open source components of codebase". NIST SA-11(1) also mentions checking for libraries "with known vulnerabilities or that are out-of-date and not supported"

What each finds, and what it misses

Approach Finds well Weak at
SAST Per OWASP: "certain well-known vulnerabilities, such as" buffer overflows and SQL injection flaws; points to the file and line; "scales well" and "can be run repeatedly (as with nightly builds or continuous integration)" OWASP: authentication problems, access control issues and insecure use of cryptography are hard to find automatically; "high numbers of false positives"; "frequently unable to find configuration issues, since they are not represented in the code"; "difficult to 'prove' that an identified security issue is an actual vulnerability"
DAST Per OWASP: cross-site scripting, SQL injection, command injection, path traversal and insecure server configuration OWASP's DevSecOps guide describes DAST as black-box testing with "no visibility of the internal workings of the app", and it needs a running application
Manual review and testing Flaws that need knowledge of the application's requirements or context (NIST SA-11(4)) NIST notes manual code reviews are usually reserved for critical components

NIST adds a warning about SAST noise: "A high density of ignored findings, commonly referred to as false positives, indicates a potential problem with the analysis process or the analysis tool." The False Positives and False Negatives post explains why this trade-off cannot be removed.

The words "white box", "black box" and "gray box"

These terms appear in two slightly different ways, which confuses beginners:

Use White box Black box Gray box
How much the tester knows (NIST glossary: SP 800-137 for white box, SP 800-53A for black and gray) "Explicit and substantial knowledge of the internal structure and implementation detail of the assessment object" "No knowledge of the internal structure and implementation detail" "Some knowledge"
Application testing techniques (NIST SP 800-115, Appendix C) Direct analysis of the application's source code Tests run against the executable "without source code knowledge" Using both

SP 800-53 says a penetration test "can include white-box, gray-box, or black-box testing." SP 800-115 notes that most assessments of custom applications use white-box techniques, since source code is usually available, and that those techniques "cannot detect security defects in interfaces between components, nor can they identify security problems caused during compilation, linking, or installation-time configuration." The guide says black-box techniques "should be used primarily" to assess individual high-risk compiled components, interactions between components, and interactions between the whole system and its users, other systems and environment.

What the SSDF asks for

SSDF practice Summary
PW.7 Review and/or analyze human-readable code, and record and triage the issues found
PW.8 Test executable code. Examples in the framework include "use fuzz testing tools to find issues with input handling" and, "if resources are available, use penetration testing to simulate how an attacker might attempt to compromise the software in high-risk scenarios"
RV.1.2 "Review, analyze, and/or test the software's code to identify or confirm the presence of previously undetected vulnerabilities"
RV.1.3 Have a policy for vulnerability disclosure; for example, "establish a vulnerability disclosure program, and make it easy for security researchers to learn about your program and report possible vulnerabilities"

The OWASP Top 10 post (Web-Based Attacks and the OWASP Top 10) explains the flaw categories these tools look for.


5. Threat modeling

What it is

NIST's glossary (from SP 800-53) defines threat modeling as "a form of risk assessment that models aspects of the attack and defense sides of a logical entity, such as a piece of data, an application, a host, a system, or an environment."

The Threat Modeling Manifesto, written in 2020 by a group of practitioners, reduces it to four questions:

  1. What are we working on?
  2. What can go wrong?
  3. What are we going to do about it?
  4. Did we do a good enough job?

OWASP adds that threat modeling "is ideally performed early in the SDLC, such as during the design phase", and is not "performed once and never again": a model "should be maintained, updated and refined alongside the system." NIST SP 800-218 (practice PW.1.1) asks developers to "use forms of risk modeling – such as threat modeling, attack modeling, or attack surface mapping – to help assess the security risk for the software." NIST SP 800-53 (SA-11(2)) asks for threat modeling and vulnerability analyses during development and testing too, because "systems, system components, and system services may deviate significantly from the functional and design specifications created during the requirements and design stages."

Unlike the tests above, a threat model examines a design: it can find problems before there is code to scan.

The four steps (OWASP Threat Modeling Cheat Sheet)

Step Question What you do
1. Model the system What are we working on? Draw it. Data flow diagrams (DFDs) are "arguably the most common approach", showing "trust boundaries, data flows, data stores, processes, and the external entities which may interact with the system." These "often represent possible attack points"
2. Identify threats What can go wrong? Use prompts such as STRIDE (below) on each element, then rank threats, in theory by likelihood × impact, though OWASP admits both "can be challenging to calculate"
3. Respond What will we do? Decide a response for each threat
4. Review and validate Was it good enough? Check that the model matches the system, that every threat has a response, and that mitigations can be tested; involve all stakeholders, "not just the development or security teams"

STRIDE

STRIDE is "a mature and popular threat modeling technique and mnemonic originally developed by Microsoft employees." It has six categories, each a violation of a desirable property. OWASP's table:

Category Violates OWASP's example
Spoofing Authentication An attacker steals the authentication token of a legitimate user and uses it to impersonate the user
Tampering Integrity An attacker abuses the application to perform unintended updates to a database
Repudiation Accounting An attacker manipulates logs to cover their actions
Information disclosure Confidentiality An attacker extracts data from a database containing user account info
Denial of service Availability An attacker locks a legitimate user out of their account by performing many failed authentication attempts
Elevation of privileges Authorization An attacker tampers with a JWT to change their role

Sources name the violated property slightly differently (the CIA Triad post lists "authenticity" and "non-repudiation" for the first and third rows). The method is the same: for each part of the system, ask the six questions.

Responses

The cheat sheet lists Adam Shostack's four responses to a threat: mitigate (reduce the likelihood), eliminate (remove the feature or component causing it), transfer (shift responsibility to another entity) and accept (when none of the others is acceptable given business needs). They resemble the risk responses in Risk and Security Controls. OWASP asks teams to document each response and "why it accepts any remaining risk."

Other techniques

OWASP notes there is "no universally accepted industry standard" and suggests choosing by need: STRIDE for threats in a technical design, attack trees for a high-value attacker goal, misuse or abuse cases for abuse of a valid workflow, LINDDUN for privacy, PASTA for application threats with business impact, OCTAVE for organization-wide risk and VAST across many teams. Its advice: "Do not add techniques only to make the model appear comprehensive."

A small example

An invented example to show the method. A simple login page sends a username and password to a server, which checks a user database.

Element Example threat (STRIDE prompt) Possible response
Browser to server (data flow) Information disclosure and tampering on the network Encrypt with TLS (see Handshakes)
Login process Spoofing by guessing or reusing passwords; denial of service by locking accounts out Rate limiting, MFA, lockout design (see Brute Force vs Password Spraying)
User database (data store) Information disclosure if it is stolen Store password hashes, limit access
Logs Repudiation: no record of who did what Log sign-ins and protect the logs (Security Operations)
Admin interface (trust boundary) Elevation of privilege Separate admin accounts, access control checks (Broken Access Control)

The model's value is the list and the decisions, written down, before the code exists.


6. Penetration testing

Definitions

NIST SP 800-115: "Penetration testing is security testing in which assessors mimic real-world attacks to identify methods for circumventing the security features of an application, system, or network. It often involves launching real attacks on real systems and data that use tools and techniques commonly used by attackers. Most penetration tests involve looking for combinations of vulnerabilities on one or more systems that can be used to gain more access than could be achieved through a single vulnerability."

NIST SP 800-53 (CA-8) calls it "a specialized type of assessment" that "can be used to validate vulnerabilities or determine the degree of penetration resistance of systems to adversaries within specified constraints", conducted "by agents and teams with demonstrable skills and experience."

SP 800-115 lists what it can show:

  • how well the system tolerates real-world-style attack patterns;
  • the likely level of sophistication an attacker needs;
  • additional countermeasures that could mitigate threats; and
  • defenders' ability to detect attacks and respond appropriately.

Phases

SP 800-115 describes four phases and says there are "many acceptable ways of grouping the actions":

Phase What happens
Planning "Rules are identified, management approval is finalized and documented, and testing goals are set." "No actual testing occurs in this phase."
Discovery Information gathering and scanning (port and service identification, DNS interrogation and WHOIS queries, banner grabbing, employee names and contact details from the organization's web or directory servers), then vulnerability analysis: comparing what was found against vulnerability databases and the testers' own knowledge
Attack "Verifying previously identified potential vulnerabilities by attempting to exploit them." Success may give more access, which loops back to discovery to explore further
Reporting Done alongside the other phases; ends with a report of vulnerabilities, risk ratings and mitigation guidance

Another widely used outline, the Penetration Testing Execution Standard (PTES), has seven sections: pre-engagement interactions, intelligence gathering, threat modeling, vulnerability analysis, exploitation, post exploitation and reporting. Its site notes that it does not give technical guidelines on how to execute a test, and has a separate technical guide.

SP 800-115 lists the kinds of weakness most often exploited: misconfigurations (particularly insecure defaults), kernel flaws, buffer overflows, insufficient input validation, symbolic links, file descriptor attacks, race conditions and incorrect file and directory permissions.

Outside and inside

Scenario Starting point (SP 800-115)
External The tester knows little: "no real information about the target environment other than targeted IP addresses or address ranges", then does open source research, scanning and tries to compromise a reachable host. The guide calls it "an iterative process that leverages minimal access to gain greater access"
Internal Testers are "on the internal network (i.e., behind the firewall)" with some level of access, often a standard employee's, and try to gain more through privilege escalation (Privilege Escalation)

If both are done, external testing "usually occurs first." Tests can also simulate worst-case scenarios, "such as malicious actions by administrators."

People and places, not only networks

SP 800-115 notes penetration testing "often includes non-technical methods of attack": breaching physical security, or social engineering, such as posing as a help desk agent. It advises that "security guards should be made aware of how to verify the validity of tester activity, such as via a point of contact or documentation." The ISC2 Certified in Cybersecurity outline lists physical penetration testing with phishing, tailgating and impersonation (Phishing, Tailgating, Impersonation).

On social engineering tests, the guide stresses a principle that deserves repeating: "It is important that the results of social engineering testing are used to improve the security of the organization and not to single out individuals." Reports should list both successful and unsuccessful tactics so training can be tailored.

Risks and frequency

SP 800-115 is direct: penetration testing "poses a high risk to the organization's networks and systems because it uses real exploits and attacks against production systems and data." It says "systems may be damaged or otherwise rendered inoperable", and the risk "can never be fully eliminated." The guide also notes that testers "may be prohibited from using particular tools or techniques or may be limited to using them only during certain times", and that a test "can be designed to stop when the tester reaches a point when an additional action will cause damage."

Because of its cost and impact, "penetration testing of an organization's network and systems on an annual basis may be sufficient." NIST adds that "a well-designed program of regularly scheduled network and vulnerability scanning, interspersed with periodic penetration testing, can help prevent many types of attacks and reduce the potential impact of successful ones." NIST SP 800-53 (CA-8(1)) adds that organizations can use an independent penetration testing agent or team, one free from "perceived or actual conflicts of interest."

Penetration test, red team and bug bounty

The red team versus penetration test comparison is in the Blue, Red and Purple Teams post. In NIST SP 800-53's words, "red team exercises extend the objectives of penetration testing", while penetration testing "may be primarily laboratory-based testing." The ISC2 outline groups blue, purple and red team exercises under security readiness testing.

A vulnerability disclosure program or bug bounty is a different arrangement: outside researchers report flaws they find, under rules the organization publishes. The SSDF (RV.1.3) recommends a vulnerability disclosure program, and the NSA/DoD cyber-defense curriculum lists responsible reporting, for example through bug bounties, as part of penetration-testing education. The same rule applies: stay inside the published scope. The next stage of the path, Vulnerability Disclosure and Bug Bounty, explains how these programs work, and Zero-Day, Explained covers disclosure timelines.

What web application testing covers

The OWASP Web Security Testing Guide organizes its tests into categories, each with many specific tests:

Category Examples of what it checks
Information gathering What the application and server reveal
Configuration and deployment management HTTP methods, security headers, cloud storage, admin interfaces
Identity management Roles, registration, account enumeration
Authentication Default credentials, lockout, password reset, multi-factor authentication
Authorization Directory traversal, bypassing authorization, privilege escalation, IDOR
Session management Cookie attributes, session fixation, CSRF, logout, timeouts
Injection XSS, SQL injection, command injection, SSRF and more
Error handling, weak cryptography, business logic, client-side, API and WebAssembly testing Further categories in the guide

The guide's introduction (in its current development version) describes it as "not a rigid checklist or a compliance standard, but rather a methodology and technique reference."


7. Choosing and combining techniques

Technique Question it answers When Typical output
Threat modeling What could go wrong with this design? Design, then updated A model, a list of threats and responses
Code review / SAST / SCA Does the code or its dependencies contain known kinds of flaw? During development, on each change Findings with file and line
DAST / IAST / fuzzing Does the running application behave insecurely? In test and staging, and on a schedule Findings tied to requests and responses
Vulnerability scanning Which known weaknesses appear on our systems? Regularly, and when new flaws are published A list of possible vulnerabilities
Penetration test Can an attacker actually get in, and how far? Periodically, and after major change Verified findings, an attack path, a report
Red team exercise Would we detect and stop a realistic attacker? When basic defences are in place A story of the attack, and what was or was not detected
Review techniques (logs, rulesets, configurations) Are our controls set up and working as intended? Regularly Gaps in configuration and policy

OWASP's testing framework offers a blunt view of balance. It says that "static code reviews produce far higher quality returns than any other security review method and rely least on the skill of the reviewer", but are "not a silver bullet", and that penetration testing is "generally inefficient at finding bugs and relies excessively on the skill of the tester", so it "should only be considered as an implementation technique, or to raise awareness of production issues." Read that as OWASP's position: test early and often, and use a penetration test as a check, not as the only defence.


8. After the test: findings, root causes and fixes

A test only helps if the findings are fixed. SP 800-115 says "a security test is much more valuable if it also results in a mitigation strategy being developed and implemented." Its advice for the aftermath:

Step What it involves (SP 800-115)
Root cause analysis "Mitigation recommendations, including the outcome of the root cause analysis, should be developed for each finding", both technical (apply a patch) and non-technical (update the patch management process)
Report Identifies "system, network, and organizational vulnerabilities and their recommended mitigation actions", tailored to its audiences. Internal reports "should include test methodology, test results, analysis, and POA&M"
Plan of action and milestones (POA&M) Ensures each vulnerability is addressed "with specific, measurable, attainable, realistic, and tangible actions"
Test the fix first Mitigations should be tried "on test systems in an environment that replicates the network", because patches can have negative effects
Get approval and coordinate Changes go through configuration control, with the system owner's approval
Verify Check by audit or by retesting. "The test team will be able to verify its implementation only if a mirror copy of the original test is performed"

For a penetration test, NIST says a report is generally developed "to describe identified vulnerabilities, present a risk rating, and give guidance on how to mitigate the discovered weaknesses." Findings then enter the same vulnerability and patch cycle as scanner results (Security Operations).


9. Common mistakes

Myth The facts
"A vulnerability scan is a penetration test" A scanner checks "only for the possible existence of a vulnerability" and has high false positive rates. A penetration test exploits to confirm and combines weaknesses (NIST)
"The scanner's severity is the real risk" NIST: scanner levels are proprietary and "may not reflect the actual risk to the organization". Assessors should set the risk level themselves
"A clean scan means we are secure" Scans find known issues on active systems. NIST says they cannot detect flaws that appear only through combinations of attack patterns, and that manual review finds weaknesses requiring knowledge of the application's context
"One tool is enough" NIST: "no one technique can provide a complete picture"
"SAST/DAST output is the answer" Treat it as leads. OWASP lists high false positives and limits for SAST. A high density of ignored findings signals a process problem (NIST SA-11(1))
"Test once, at the end" OWASP and the SSDF place testing throughout the life cycle. A test is only a snapshot (NIST)
"Pen testing is safe because it's authorized" NIST: it uses real exploits on production systems and can damage or disable them. Planning, scope and halting criteria matter
"I can scan a site I find interesting, since scanning is not illegal" Nmap's authors say get written authorization, and that rules vary by country and state. Unauthorized scanning can still bring complaints, loss of service or legal action
"Threat modeling is for big companies, once" The Manifesto asks "Who should threat model? You. Everyone." and OWASP says a model should be maintained and refined alongside the system
"White box means source code, always" Two uses exist: how much the tester knows (NIST glossary) and application technique (SP 800-115). Check which one a document means
"A social engineering test is to catch people out" NIST: use the results to improve security, "not to single out individuals"
"The report is the end" Without root cause analysis, fixes, approval and retesting, the same issues return

Closing

Security testing checks whether your security works. Reviews and scans find known weaknesses quickly and regularly, code analysis (static, dynamic, interactive and dependency checks) finds flaws in software, threat modeling can find design problems before code exists, and a penetration test attempts real exploitation to show what an attacker could actually do. All of them rest on one rule: written authorization and rules of engagement first. Each technique has blind spots, so NIST's advice is to combine them, and none of it matters unless findings are traced to root causes, fixed, and retested.

Keep these points:

  • Authorization first. Written scope and rules of engagement, before any scanning or testing.
  • Scan = possible weaknesses. Pen test = verified exploitation. Scanners have false positives and their own risk labels.
  • SAST = code without running it. DAST = the running app from outside. IAST = from inside while it runs. Use several.
  • Threat modeling asks four questions: what are we working on, what can go wrong, what will we do, did we do enough.
  • Pen test phases (NIST): planning, discovery, attack, reporting.
  • No single technique gives the full picture. Combine them, and test throughout the life of the system.
  • Finish the job: root cause, fix, verify, retest.