OWASP Threat Dragon Documentation
repository·main·Indexed 23 days ago
https://github.com/owasp/threat-dragonA free, open-source, cross-platform threat modeling tool used to create data flow diagrams and identify potential threats and mitigations. Documentation covers building version 2.x from source, running via Docker, configuring environment variables for GitHub, Bitbucket, and GitLab, and developing the Express-based backend (td.server) and Vue/Electron frontend (td.vue).
What's inside OWASP Threat Dragon
- OWASP Threat Dragon is an open-source threat modeling tool used to create threat models as data-flow diagrams. It allows users to associate threats and remediations with diagrams, using categorization frameworks such as STRIDE, LINDDUN, CIA, CIA-DIE, and PLOT4ai.
Choose a Threat Dragon deployment variant
mainThreat Dragon is available in two primary variants depending on your storage and environment needs:
Web application: Can be run from source or via a Docker container. It supports storing threat model files on the local filesystem or via various repository providers:
- GitHub / GitHub Enterprise
- Bitbucket / Bitbucket Enterprise
- GitLab
Desktop application: Available as installers for Windows, Mac OSX, and Linux. This variant stores model files on the local filesystem only.
Configure environment variables for repository access
mainThe Threat Dragon web application uses environment variables to determine which repository types are accessible. Configuring these variables allows the application to connect to:
- GitHub
- Bitbucket
- GitLab
- GitHub Enterprise
- The client's local file system
Refer to the configuration documentation for specific variable names and values.
How Threat Dragon handles security incidents
mainThreat Dragon uses GitHub Issues to provide transparency regarding high-impact or high-profile security incidents. When an incident is relevant to the community, maintainers will create a pinned GitHub Issue with thesecuritylabel. This issue serves as a transparency report rather than a real-time incident response feed.How locale resolution works
mainThe application determines the active locale using a multi-step pipeline (defined in
td.vue/src/service/locale/locale-resolver.jsand orchestrated bytd.vue/src/store/modules/locale.js):- Saved preference: If the user has a previously selected locale that is still allowed by the server, it is restored.
- Browser languages: If no preference exists, the app checks
navigator.languagesand selects the first match from the supported locales. - Server default: If no browser match is found, the app uses the
defaultLocaleconfigured on the server via theLOCALE_DEFAULTenvironment variable. - Fallback: If all else fails, the hardcoded
DEFAULT_LOCALE('en') is used.
Select and switch diagram threat types
mainThreat Dragon supports multiple threat categorization frameworks. You select the diagram type as part of the diagram attributes when editing a model.
Supported types include:
- STRIDE
- LINDDUN
- CIA
- CIA-DIE
- PLOT4ai
- Generic
Key Behavior:
- Persistence: Changing the diagram type does not delete existing threats. If you add CIA threats and then switch the diagram type to LINDDUN, the CIA threats remain in the model and can still be edited.
- Mixing Types: You can have diagrams of different types within the same model.
- Generic Mode: If you need to associate a threat category with an element that is normally restricted by the current framework (e.g., assigning a STRIDE threat to an element where it isn't typically suggested), switch the diagram type to Generic. This allows you to select any threat type for any element. You can switch back to a specific framework like STRIDE or LINDDUN later.
Mark elements as Out of Scope
mainProcesses, data stores, actors, and data flows can be marked as Out of Scope. This is useful for elements that provide context to the diagram but do not require threat modeling.
- Visual Indicator: Out of scope elements are displayed with dashed lines.
- Behavior: Threat generation is automatically disabled for any element marked as out of scope.
- Documentation: You can specify a
Reason for out of scopein the element properties to assist reviewers.
Understand container vulnerability scanning with Trivy
mainThreat Dragon uses Trivy to identify known vulnerable packages within containers. Scanning occurs during:
- Every commit and pull-request.
- A nightly cron job against the default branch.
Strict Failure Policy: The GitHub action is designed to fail if Trivy identifies any vulnerabilities. When vulnerabilities are found, maintainers are notified via the GitHub security tab.
How locale identifiers are formatted
mainThreat Dragon uses IETF BCP 47 language tags for all locale identifiers. These tags are case-insensitive, but the application uses the canonical form internally for
messagesobject keys and theSUPPORTED_LOCALESarray.- Language: ISO 639-1 two-letter code (lowercase), e.g.,
en,pt,zh. - Region (optional): ISO 3166-1 alpha-2 country code (uppercase), e.g.,
BR,US,GB.
Example:
pt-BR(Brazilian Portuguese). If no region variant is needed, use only the language code (e.g.,es).- Language: ISO 639-1 two-letter code (lowercase), e.g.,
Use Styles and Bootstrap in Threat Dragon
mainThe project uses SCSS and Bootstrap-Vue:
- SCSS: You can use scoped
<style scss>blocks within.vuefiles. For global variables and mixins, place them in thesrc/stylesdirectory to make them available across all components. - Bootstrap: The project uses
bootstrap-vue, which is available globally throughout the application.
- SCSS: You can use scoped
Understand Dynamic Application Security Testing (DAST) in Threat Dragon
mainThreat Dragon utilizes ZAP to perform Dynamic Application Security Testing (DAST). This process tests running code to identify potential vulnerabilities and misconfigurations. In the Threat Dragon workflow, ZAP scans are executed as part of every commit, and the resulting scan results are attached to the output of the action.Requirement for signed commits
mainThe Threat Dragonmainbranch requires all commits to be signed. Contributions with unsigned commits will be rejected. This is a security measure to verify the identity of contributors and prevent malicious activity.