Read a sample: 1. Think Before You Test
A security test can begin with a tool, but it should begin with a question.
Imagine that you have been asked to assess an appointment-booking application. You can see a sign-in page, a calendar, and a form for creating appointments. A scanner might quickly generate a long list of observations about the application. Some may be useful. Others may have little to do with what the organization needs to protect.
Before opening a tool, consider a different starting point: Who uses the application? What information passes through it? Which actions matter most? Where does one person’s access end and another person’s begin? What have you actually been authorized to examine?
Those questions form the beginning of a threat model. They do not replace testing. They help you decide what testing should accomplish, what evidence would matter, and where your understanding is still incomplete.
This chapter introduces the habits you will use throughout the book. We will work with a fictional appointment-booking application, distinguish threats from vulnerabilities and other commonly confused terms, and build a small first view of the system. You do not need a specialized modeling tool or a complete architectural diagram to begin. You do need curiosity, a willingness to record uncertainty, and respect for the limits of your authorization.
Threat modeling is a structured way to think about what could go wrong in a system, why it would matter, and what you should investigate or improve. The model might be a diagram, a table, a set of notes, or a combination of these. Its value comes from the reasoning it makes visible.
A useful model connects several ideas:
- The system: What is the application supposed to do, and what components and people are involved?
- The assets: What information, capabilities, and services are worth protecting?
- The boundaries: Where do identity, privilege, network location, or responsibility change?
- The scenarios: How might an actor or event affect an asset in an unwanted way?
- The evidence: What do you know, what are you assuming, and what remains unanswered?
- The response: Which questions deserve attention first, and what work is authorized?
These are not rigid stages that must be completed once and never revisited. You may identify an important asset while tracing a data flow, or discover during an approved test that a component works differently from your diagram. When that happens, you update the model.
For an ethical hacker, threat modeling turns “test the application” into more useful objectives. Instead of attempting every familiar technique against every visible page, you can ask whether the application enforces the intended separation between two users’ appointments. You can then determine whether you have suitable accounts, permission to perform the check, and a way to collect evidence without exposing unnecessary information.
The model also helps people who are not conducting tests. A developer can use it to question a design before implementation. An analyst can use it to explain why a particular risk deserves attention. An application owner can use it to identify a missing decision about who should have access to sensitive information. The same model can support several conversations, provided its purpose and limitations are clear.
Our recurring example is a fictional service called Harbor Appointments. It allows customers to book appointments with a small service provider. Customers use a web application to sign in, view available times, and manage their bookings. Staff members use the application to manage the schedule. The service also sends appointment notifications through an external notification provider.
That description is enough to begin asking questions, but not enough to make confident claims about the implementation. We do not yet know exactly how staff roles are assigned, which details appear in a notification, or how the application communicates with the external provider. We should not fill those gaps with guesses and then treat the guesses as architecture.
Even so, we can identify candidate assets:
- Appointment details, including the association between a customer and a booking.
- Customer account information and sign-in credentials.
- Staff capabilities to view and change the schedule.
- The accuracy of appointment times and assigned services.
- The availability of the booking function.
- Credentials or configuration used to connect to the notification provider.
An asset is not necessarily secret data. A schedule that customers rely on has integrity value: unauthorized changes could cause missed appointments or confusion even if no information is disclosed. The ability to book an appointment has availability value. A staff account has value because of the actions its holder may be able to perform.
At this point, the word candidate matters. The application owner may tell us that some information is more sensitive than we first thought, or that a listed capability works differently from our description. A threat model improves when people can correct it.
Security discussions often use threat, vulnerability, and risk as if they mean the same thing. Keeping them separate makes your reasoning and reporting more precise.
A threat is a potential cause of an unwanted outcome. In a practical threat model, it is often most useful to describe a threat as a scenario: an actor takes an action under certain conditions, affecting an asset and causing a consequence.
For Harbor Appointments, a threat scenario might be:
> A signed-in customer attempts to view another customer’s appointment, potentially exposing private booking information.
This is a scenario worth considering. It…