☰ Menu
CLI Open source 17 installs/mo

threatcl for Mac

threatcl

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

  1. Open Terminal (press ⌘ + Space and type “Terminal”).
  2. If Homebrew is not installed yet, run the command below first.
  3. Run this command:

Latest 10 releases

Last updated 2026-11-08; current version v0.6.12, with the latest 10 releases listed.

VersionReleasedTypeSizemacOSWindowsLinux
v0.6.122026-11-08Stable19.3 MBDownloadDownloadDownload
v0.6.112026-10-22Stable19.3 MBDownloadDownloadDownload
v0.6.102026-10-15Stable19.2 MBDownloadDownloadDownload
v0.6.92026-09-11Stable19.0 MBDownloadDownloadDownload
v0.6.82026-08-28Stable18.9 MBDownloadDownloadDownload
v0.6.72026-08-16Stable18.6 MBDownloadDownloadDownload
v0.6.62026-08-15Stable18.6 MBDownloadDownloadDownload
v0.6.52026-08-01Stable18.5 MBDownloadDownloadDownload
v0.6.42026-07-28Stable18.5 MBDownloadDownloadDownload
v0.6.32026-07-17Stable18.5 MBDownloadDownloadDownload

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.

Compared with similar apps
AppVersionLicenseArchitecture30-day installs
threatclv0.6.12MITCLI17
prjtrellis1.4ISC AND MITCLI16
ahoyv3.0.2MITCLI26
openkim-models2021-08-11CDDL-1.0CLI12

Similar apps: Command-line Tools

Leave a comment

评论表单加载中…