hcltm: Threat Modeling with HCL

hcltm

Threat Modeling with HCL

Threat Modeling

Overview

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.

hcltm 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 hcltm cli software. The hcltm  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“. Combining the hcltm cli software and the hcltm spec allows practitioners to define a system threat model in HCL, for example:

[pastacode lang=”markup” message=”” highlight=”” provider=”manual” manual=”threatmodel%20%22Tower%20of%20London%22%20%7B%0A%20%20description%20%3D%20%22A%20historic%20castle%22%0A%20%20author%20%3D%20%22%40xntrik%22%0A%0A%20%20attributes%20%7B%0A%20%20%20%20new_initiative%20%3D%20%22true%22%0A%20%20%20%20internet_facing%20%3D%20%22true%22%0A%20%20%20%20initiative_size%20%3D%20%22Small%22%0A%20%20%7D%0A%0A%20%20information_asset%20%22crown%20jewels%22%20%7B%0A%20%20%20%20description%20%3D%20%22including%20the%20imperial%20state%20crown%22%0A%20%20%20%20information_classification%20%3D%20%22Confidential%22%0A%20%20%7D%0A%0A%20%20usecase%20%7B%0A%20%20%20%20description%20%3D%20%22The%20Queen%20can%20fetch%20the%20crown%22%0A%20%20%7D%0A%0A%20%20third_party_dependency%20%22community%20watch%22%20%7B%0A%20%20%20%20description%20%3D%20%22The%20community%20watch%20helps%20guard%20the%20premise%22%0A%20%20%20%20uptime_dependency%20%3D%20%22degraded%22%0A%20%20%7D%0A%0A%20%20threat%20%7B%0A%20%20%20%20description%20%3D%20%22Someone%20who%20isn’t%20the%20Queen%20steals%20the%20crown%22%0A%20%20%20%20impacts%20%3D%20%5B%22Confidentiality%22%5D%0A%20%20%20%20control%20%3D%20%22Lots%20of%20guards%22%0A%20%20%7D%0A%0A%20%20data_flow_diagram%20%7B%0A%20%20%20%20%2F%2F%20…%20see%20below%20for%20more%20information%0A%20%20%7D%0A%0A%7D”/]

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 hcltm‘s goals.

You can use hcltm with JSON, but you lose some of the features. For more, see the examples/ folder.

Install & Use

Copyright (c) 2021 Christian Frichot

Support Our Threat Intelligence

If you find our technology report and cybersecurity news helpful, consider supporting our work.

Crypto QR Code
USDT (TRC20):
TN8BdV8cp4T1Cd28gK9qTAnZknzzuwyUtm
USDT (ERC20):
0x3725e1a7d3bc5765499fa6aaafe307fabcd75bce