1. What is Threat Modeling?
In the simplest words:
Threat modeling is the process of looking at an application before or during development and asking: “How can this system be attacked, what could go wrong, and how can we prevent it?”
Think of it as a security review of your application design.
Normal development thinking
A developer may think:
“How do I make this feature work?”
Threat modeling adds:
“How could someone misuse or attack this feature?”
2. Simple Example
Imagine you’re building an online shopping application:
Customer
|
โ
Web Application
|
โ
Database
A developer thinks:
Customer logs in โ browses products โ places order โ data goes into database.
A security engineer asks:
What if someone sends a fake request?
What if someone steals another user’s session?
What if someone modifies the price?
What if someone accesses the database directly?
What if someone sends thousands of requests and brings the application down?
Those questions are threat modeling.
3. Threat Modeling in One Sentence
Remember this:
Threat Modeling = Understand the system โ Identify what can go wrong โ Assess the risk โ Decide how to protect it.
4. When Should We Do Threat Modeling?
Ideally, before the application is built.
Requirement
โ
Architecture
โ
๐ก๏ธ Threat Modeling
โ
Development
โ
Testing
โ
Deployment
โ
Production
But you can also perform it on an existing application.
It’s particularly useful when:
- Designing a new application
- Adding a major feature
- Adding a new API
- Introducing a payment system
- Adding a third-party service
- Changing authentication
- Moving to cloud/Kubernetes
- Handling sensitive information
- Changing architecture
5. What is OWASP Threat Dragon?
Now introduce the tool.
OWASP Threat Dragon is an open-source tool that helps you perform and document threat modeling visually.
The important point:
Threat Dragon does not replace threat modeling.
It helps you draw the system, identify threats, document them, and track mitigations.
Think:
Threat Modeling
+
Threat Dragon
โ
Visual + Documented Threat Model
6. Why Not Just Use Excel?
Excellent questionโand this should actually be discussed in a good tutorial.
You absolutely can use Excel, Notion, Markdown, Miro, etc.
For example:
| Threat | Risk | Mitigation |
|---|---|---|
| SQL Injection | High | Parameterized queries |
| Data leakage | High | Encryption |
| Unauthorized access | High | RBAC |
| DoS | Medium | Rate limiting |
That’s perfectly valid.
But when the architecture becomes larger:
Internet
โ
CloudFront
โ
WAF
โ
ALB
โ
EKS
โโโผโโโโโโโโโโโโโโโโ
โ โ โ
API Redis Worker
โ โ
RDS S3
โ
Payment Gateway
visual modeling becomes much more useful.
Threat Dragon helps you see the system and the security boundaries, rather than just maintaining a list.
7. The Core Threat Modeling Process
A practical gold-standard workflow is:
1. Understand the system
โ
2. Draw the architecture
โ
3. Identify trust boundaries
โ
4. Identify assets/data
โ
5. Identify threats
โ
6. Analyze risk
โ
7. Define mitigations
โ
8. Document
โ
9. Review
โ
10. Update when architecture changes
This is more important than learning the Threat Dragon buttons.
8. Step 1 โ Understand the System
Before opening Threat Dragon, understand what you’re building.
For example:
Online Banking Application
User
โ
Web Application
โ
Authentication Service
โ
Banking API
โ
Database
Ask:
- Who uses the system?
- What data does it handle?
- What are the important components?
- Which systems are external?
- Where does sensitive data travel?
- Who can access what?
9. Step 2 โ Draw the System
Now create a Data Flow Diagram (DFD).
For example:
Internet
|
โ
[User]
|
โ
[Web Server]
|
โ
[API]
/ \
/ \
โ โ
[Database] [Payment API]
This is where Threat Dragon becomes useful.
10. Step 3 โ Identify Trust Boundaries
This is one of the most important concepts.
A trust boundary is a place where the level of trust changes.
For example:
INTERNET
|
================================
TRUST BOUNDARY
================================
|
Application
|
================================
TRUST BOUNDARY
================================
|
Database
For example:
Internet โ Application
The Internet is untrusted.
Your application cannot simply trust everything coming from the Internet.
11. Step 4 โ Identify Important Assets
Ask:
“What are we trying to protect?”
Examples:
- Passwords
- Personal information
- Credit-card information
- API keys
- Authentication tokens
- Customer records
- Business data
- Source code
- Financial transactions
These are your assets.
12. Step 5 โ Identify Threats
Now ask:
“What could an attacker do?”
This is where STRIDE becomes useful.
STRIDE
| Letter | Threat | Simple Question |
|---|---|---|
| S | Spoofing | Can someone pretend to be another user? |
| T | Tampering | Can someone modify data? |
| R | Repudiation | Can someone deny an action? |
| I | Information Disclosure | Can someone access private information? |
| D | Denial of Service | Can someone make the system unavailable? |
| E | Elevation of Privilege | Can someone gain unauthorized privileges? |
Example
For:
User โ Login API
you might identify:
Spoofing
Attacker obtains another user’s credentials and logs in.
Mitigation:
MFA + strong authentication + session controls.
13. Step 6 โ Analyze the Risk
Not every threat has the same importance.
For example:
| Threat | Likelihood | Impact | Priority |
|---|---|---|---|
| SQL Injection | High | High | ๐ด Critical |
| Information disclosure | Medium | High | ๐ High |
| DoS | Medium | Medium | ๐ก Medium |
| Minor UI issue | Low | Low | ๐ข Low |
The purpose isn’t to create 100 threats just because you can.
The goal is:
Find the threats that actually matter and prioritize them.
14. Step 7 โ Define Mitigations
For every meaningful threat, ask:
“What are we going to do about it?”
Example:
Threat:
SQL Injection
Risk:
High
Mitigation:
- Parameterized queries
- ORM
- Input validation
- Least-privilege database account
- Security testing
Another:
Threat:
Credential theft
Mitigation:
- MFA
- Password hashing
- Secure session management
- Rate limiting
- Account lockout/risk controls
15. Step 8 โ Put It Into Threat Dragon
Now the tool becomes useful.
You create your model and add components such as:
User
Process
Data Store
External Entity
Data Flow
Trust Boundary
Then document threats against the relevant components or data flows.
For example:
User
|
| HTTPS
โ
โโโโโโโโโโโ
โ API โ
โโโโโโฌโโโโโ
|
| SQL
โ
โโโโโโโโโโโ
โ RDS โ
โโโโโโโโโโโ
Threat:
SQL Injection
Mitigation:
Parameterized queries
Now you have an architecture + threats + mitigations in one model.
16. What Threat Dragon Should NOT Become
This is very important for a gold-standard tutorial.
Don’t teach:
“Every project must have a 200-page threat model.”
โ That’s bureaucracy.
Instead:
Threat modeling should be proportional to the risk and complexity of the system.
A small internal application might need:
30-minute threat-modeling exercise
+
simple checklist
A large banking platform might require:
Multiple architecture diagrams
+
trust boundaries
+
detailed threat analysis
+
risk assessment
+
mitigation tracking
+
security review
17. The DevSecOps Connection
Threat modeling fits very early in DevSecOps.
DEVSECOPS
Plan
โ
Requirements
โ
๐ฐ Threat Modeling
โ
Design
โ
Code
โ
SAST
โ
SCA
โ
Build
โ
Container Security
โ
IaC Security
โ
DAST
โ
Deploy
โ
Runtime Security
โ
Monitoring
Notice something important:
Threat modeling happens before most security testing.
Why?
Because testing can find vulnerabilities in an implementation.
Threat modeling can identify security problems in the design itself.
18. Threat Modeling vs SAST vs SCA
This distinction is excellent for students:
| Practice | Main Question |
|---|---|
| Threat Modeling | How could our system be attacked? |
| SAST | Is there a security problem in our source code? |
| SCA | Are our third-party dependencies vulnerable? |
| DAST | Can our running application be attacked? |
| Container Security | Is our container/image secure? |
| IaC Security | Is our infrastructure configuration secure? |
So:
Threat Modeling
โ
Find design-level risks
SAST
โ
Find code-level risks
SCA
โ
Find dependency risks
DAST
โ
Find runtime/application risks
They complement each other.
19. The Golden Mental Model
If you’re teaching this, I’d make students remember this:
THREAT MODELING
"What are we building?"
โ
"What do we need to protect?"
โ
"How could it be attacked?"
โ
"What is the risk?"
โ
"How will we mitigate it?"
โ
"Did we document it?"
โ
"Did the architecture change?"
โ
Repeat
And finally:
Threat Dragon is the tool. Threat modeling is the security practice.
That’s the distinction I’d make very clear in a professional DevSecOps course.
I’m Rajesh Kumar, a DevOps, SRE, DevSecOps, Cloud, and Platform Engineering expert passionate about sharing practical knowledge, real-world experiences, and industry best practices. I have worked at Cotocus and regularly write about technology, travel, investing, health, product reviews, and digital marketing through my various platforms.
I publish technical articles at DevOps School, travel stories at Holiday Landmark, stock market insights at Stocks Mantra, health and fitness guidance at My Medic Plus, product reviews at TrueReviewNow, and SEO and digital marketing strategies at Wizbrand.
Find Trusted Cardiac Hospitals
Compare heart hospitals by city and services โ all in one place.
Explore Hospitals