threatcl for Mac
Threat Modeling with HCL
threatcl — overview
Threat Modeling with HCL
What happened to hcltm?
hcltm has been renamed to threatcl. Welcome!
Overview [!TIP] Want to read the new documentation? Head over to threatcl.dev
There are many different ways in which a threat model can be documented. From a simple text file, to more in-depth word documents, to fully instrumented threat models in a centralised solution. Two of the most valuable attributes of a threat model are being able to clearly document the threats, and to be able to drive valuable change.
threatcl aims to provide a DevOps-first approach to documenting a system threat model by focusing on the following goals: Simple text-file format Simple cli-driven user experience Integration into version control systems (VCS)
This repository is the home of the threatcl cli software. The threatcl spec is based on HCL2, HashiCorp's Configuration Language, which aims to be "_pleasant to read and write for humans, and a JSON-based variant that is easier for machines to generate and parse_". The threatcl spec lives at github.com/threatcl/spec. Combining the threatcl cli software and the threatcl spec allows practitioners to define a system threat model in HCL, for example:
See Data Flow Diagram for more information on how to construct data flow diagrams that may be converted to PNGs automatically.
To see an example of how to reference pre-defined control libraries for the OWASP Proactive Controls and AWS Security Checklist see examples/tm3.hcl. We also have the MITRE ATT&CK Controls here.
You can also include an external threatmodel into your own, to reference and use all its information. You can see examples/including-example/corp-app.hcl as an example.
To see a full description of the spec, see here or run:
threatcl will also process JSON files, but the only caveat is that import modules and variables won't work. You can see examples/tm1.json as an example.
Why HCL?
HCL is the primary configuration language used in the products by HashiCorp, in-particularly, Terraform - their open-source Infrastructure-as-Code software. I worked at HashiCorp for a while and the language really grew on me, plus, if DevOps and Software engineers are using the language, then simplifying how they document threat models aligns with threatcl's goals.
You can use threatcl with JSON, but you lose some of the features. For more, see the examples/ folder.
Why not just document them in MD?
I liked the idea of using a format that could be programmatically interacted with.
Kudos and References
One of the features of threatcl is the automatic generation of data flow diagrams from HCL files. This leverages the go-dfd package by Marqeta and Blake Hitchcock. Definitely check out their blog post on Threat models at the speed of DevOps.
Additionally I'd like to extend thanks to Jamie Finnigan and Talha Tariq at HashiCorp for allowing me to continue working on this open-source tool even after I'd finished up with HashiCorp.
Details
使用 HCL 记录你的威胁模型
How to install threatcl
- Open Terminal (press ⌘ + Space and type “Terminal”).
- If Homebrew is not installed yet, run the command below first.
- Run this command:
Latest 10 releases
Last updated 2026-11-08; current version v0.6.12, with the latest 10 releases listed.
| Version | Released | Type | Size | macOS | Windows | Linux |
|---|---|---|---|---|---|---|
| v0.6.12 | 2026-11-08 | Stable | 19.3 MB | Download | Download | Download |
| v0.6.11 | 2026-10-22 | Stable | 19.3 MB | Download | Download | Download |
| v0.6.10 | 2026-10-15 | Stable | 19.2 MB | Download | Download | Download |
| v0.6.9 | 2026-09-11 | Stable | 19.0 MB | Download | Download | Download |
| v0.6.8 | 2026-08-28 | Stable | 18.9 MB | Download | Download | Download |
| v0.6.7 | 2026-08-16 | Stable | 18.6 MB | Download | Download | Download |
| v0.6.6 | 2026-08-15 | Stable | 18.6 MB | Download | Download | Download |
| v0.6.5 | 2026-08-01 | Stable | 18.5 MB | Download | Download | Download |
| v0.6.4 | 2026-07-28 | Stable | 18.5 MB | Download | Download | Download |
| v0.6.3 | 2026-07-17 | Stable | 18.5 MB | Download | Download | Download |
Data from GitHub Releases; stable releases first, each group sorted newest first.
Prebuilt bottle platforms
Official Homebrew bottles cover:
- Apple silicon · latest macOS
- Apple silicon · macOS 26 Tahoe
- Apple silicon · macOS 15 Sequoia
- Linux · ARM64
- Linux · x86_64
⚠️ No prebuilt bottle for Intel Macs; Intel users need brew install --build-from-source to build from source.
Compared with similar apps
Only public metadata is compared, with no subjective recommendation; see the compare pages for field-by-field comparisons.
| App | Version | License | Architecture | 30-day installs |
|---|---|---|---|---|
| threatcl | v0.6.12 | MIT | CLI | 17 |
| prjtrellis | 1.4 | ISC AND MIT | CLI | 16 |
| ahoy | v3.0.2 | MIT | CLI | 26 |
| openkim-models | 2021-08-11 | CDDL-1.0 | CLI | 12 |
Similar apps: Command-line Tools
prjtrellis
Project Trellis For FPGA Toolchain Usersahoy
Creates self documenting CLI programs from commands in YAML filesopenkim-models
openkim-models brings together all OpenKIM models compatible with kim-api, serving researchers…inframap
Read your tfstate or HCL to generate a graph specific for each provider, showing only the…structurizr
Software architecture models as codeopenssl@4
Cryptography and SSL/TLS ToolkitCategories: Command-line Tools