What is SQL Injection?
https://medium.com/@kaorrosi/what-is-sql-injection-4cce5d52bdb?source=rss------bug_bounty-5
___________________________
@hacking_Attack
@Hacking_Video
https://medium.com/@kaorrosi/what-is-sql-injection-4cce5d52bdb?source=rss------bug_bounty-5
___________________________
@hacking_Attack
@Hacking_Video
Medium
What is SQL Injection?
What is It?
What is It?Continue reading on Medium » (https://medium.com/@kaorrosi/what-is-sql-injection-4cce5d52bdb?source=rss------bug_bounty-5)
___________________________
@hacking_Attack
@Hacking_Video
___________________________
@hacking_Attack
@Hacking_Video
Medium
What is SQL Injection?
What is It?
Hcltm - Documenting Your Threat Models With HCL
http://www.kitploit.com/2022/04/hcltm-documenting-your-threat-models.html
___________________________
@hacking_Attack
@Hacking_Video
http://www.kitploit.com/2022/04/hcltm-documenting-your-threat-models.html
___________________________
@hacking_Attack
@Hacking_Video
KitPloit - PenTest & Hacking Tools
Hcltm - Documenting Your Threat Models With HCL
description = "Someone who isn't the Queen steals the crown"
impacts = ["Confidentiality"]
control = "Lots of guards"
}
data_flow_diagram {
// ... see below for more information
}
} See Data Flow Diagram (https://github.com/xntrik/hcltm#data-flow-diagram) for more information on how to construct data flow diagrams that are converted to PNGs automatically. To see an example of how to reference pre-defined control libraries for the OWASP Proactive Controls (https://owasp.org/www-project-proactive-controls/) and AWS Security Checklist (https://d1.awsstatic.com/whitepapers/Security/AWS_Security_Checklist.pdf) see examples/tm3.hcl (https://github.com/xntrik/hcltm/blob/main/examples/tm3.hcl). We also have the MITRE ATT&CK Controls (https://attack.mitre.org/mitigations/enterprise/) here (https://github.com/xntrik/hcltm/blob/main/examples/MITRE_ATTACK_controls.hcl). To see a full description of the spec, see here (https://github.com/xntrik/hcltm/blob/main/spec.hcl) or run: hcltm generate boilerplate hcltm will also process JSON files, but the only caveat is that import modules and variables won't work. You can see examples/tm1.json (https://github.com/xntrik/hcltm/blob/main/examples/tm1.json) as an example. Why HCL? HCL is the primary configuration language used in the products by HashiCorp, in-particularly, Terraform (https://www.terraform.io/) - 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/ (https://github.com/xntrik/hcltm/blob/main/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 hcltm is the automatic generation of data flow diagrams (https://github.com/xntrik/hcltm#data-flow-diagram) from HCL files. This leverages the go-dfd (https://github.com/marqeta/go-dfd) package by Marqeta and Blake Hitchcock (https://github.com/rbhitchcock). Definitely check out their blog post on Threat models at the speed of DevOps (https://community.marqeta.com/t5/engineering-blogs/threat-models-at-the-speed-of-devops/ba-p/40). Additionally I'd like to extend thanks to Jamie Finnigan (https://twitter.com/chair6) and Talha Tariq (https://twitter.com/0xtbt) at HashiCorp for allowing me to continue working on this open-source tool even after I'd finished up with HashiCorp. hcltm cli Installation Download the latest version from releases (https://github.com/xntrik/hcltm/releases) and move the hcltm binary into your PATH. Install with Homebrew The following will add a local tap, and install hcltm with Homebrew (https://brew.sh/) brew install xntrik/repo/hcltm Run with Docker docker run --rm -it xntrik/hcltm Run with GitHub Actions hcltm can be integrated directly into your GitHub repos with https://github.com/xntrik/hcltm-action. This is one of the ideal methods to manage your threat models, and helps meet the goal of integrating into your version control systems. Building from Source Clone this repository. Change into the directory, hcltm make bootstrap make dev For further help on contributing to hcltm please see the CHANGELOG.md (https://github.com/xntrik/hcltm/blob/main/CHANGELOG.md). Usage For help on any subcommands use the -h flag. [] Available commands are: dashboard Generate markdown files from existing HCL threatmodel file(s) dfd Generate Data Flow Diagram PNG files from existing HCL threatmodel file(s) generate Generate an HCL Threat Model list List Threatmodels found in HCL file(s) validate Validate existing HCL Threatmodel file(s) view View existing HCL Threatmodel file(s) ">$ hcltm
___________________________
@hacking_Attack
@Hacking_Video
impacts = ["Confidentiality"]
control = "Lots of guards"
}
data_flow_diagram {
// ... see below for more information
}
} See Data Flow Diagram (https://github.com/xntrik/hcltm#data-flow-diagram) for more information on how to construct data flow diagrams that are converted to PNGs automatically. To see an example of how to reference pre-defined control libraries for the OWASP Proactive Controls (https://owasp.org/www-project-proactive-controls/) and AWS Security Checklist (https://d1.awsstatic.com/whitepapers/Security/AWS_Security_Checklist.pdf) see examples/tm3.hcl (https://github.com/xntrik/hcltm/blob/main/examples/tm3.hcl). We also have the MITRE ATT&CK Controls (https://attack.mitre.org/mitigations/enterprise/) here (https://github.com/xntrik/hcltm/blob/main/examples/MITRE_ATTACK_controls.hcl). To see a full description of the spec, see here (https://github.com/xntrik/hcltm/blob/main/spec.hcl) or run: hcltm generate boilerplate hcltm will also process JSON files, but the only caveat is that import modules and variables won't work. You can see examples/tm1.json (https://github.com/xntrik/hcltm/blob/main/examples/tm1.json) as an example. Why HCL? HCL is the primary configuration language used in the products by HashiCorp, in-particularly, Terraform (https://www.terraform.io/) - 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/ (https://github.com/xntrik/hcltm/blob/main/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 hcltm is the automatic generation of data flow diagrams (https://github.com/xntrik/hcltm#data-flow-diagram) from HCL files. This leverages the go-dfd (https://github.com/marqeta/go-dfd) package by Marqeta and Blake Hitchcock (https://github.com/rbhitchcock). Definitely check out their blog post on Threat models at the speed of DevOps (https://community.marqeta.com/t5/engineering-blogs/threat-models-at-the-speed-of-devops/ba-p/40). Additionally I'd like to extend thanks to Jamie Finnigan (https://twitter.com/chair6) and Talha Tariq (https://twitter.com/0xtbt) at HashiCorp for allowing me to continue working on this open-source tool even after I'd finished up with HashiCorp. hcltm cli Installation Download the latest version from releases (https://github.com/xntrik/hcltm/releases) and move the hcltm binary into your PATH. Install with Homebrew The following will add a local tap, and install hcltm with Homebrew (https://brew.sh/) brew install xntrik/repo/hcltm Run with Docker docker run --rm -it xntrik/hcltm Run with GitHub Actions hcltm can be integrated directly into your GitHub repos with https://github.com/xntrik/hcltm-action. This is one of the ideal methods to manage your threat models, and helps meet the goal of integrating into your version control systems. Building from Source Clone this repository. Change into the directory, hcltm make bootstrap make dev For further help on contributing to hcltm please see the CHANGELOG.md (https://github.com/xntrik/hcltm/blob/main/CHANGELOG.md). Usage For help on any subcommands use the -h flag. [] Available commands are: dashboard Generate markdown files from existing HCL threatmodel file(s) dfd Generate Data Flow Diagram PNG files from existing HCL threatmodel file(s) generate Generate an HCL Threat Model list List Threatmodels found in HCL file(s) validate Validate existing HCL Threatmodel file(s) view View existing HCL Threatmodel file(s) ">$ hcltm
___________________________
@hacking_Attack
@Hacking_Video
GitHub
GitHub - xntrik/hcltm: Documenting your Threat Models with HCL
Documenting your Threat Models with HCL. Contribute to xntrik/hcltm development by creating an account on GitHub.
Usage: hcltm [--version] [--help] []
Available commands are:
dashboard Generate markdown files from existing HCL threatmodel file(s)
dfd Generate Data Flow Diagram PNG files from existing HCL threatmodel file(s)
generate Generate an HCL Threat Model
list List Threatmodels found in HCL file(s)
validate Validate existing HCL Threatmodel file(s)
view View existing HCL Threatmodel file(s)
Config file Most of the hcltm commands have a -config flag that allows you to specify a config.hcl file. HCL within this file may be used to overwrite some of hcltm's default attributes. These are listed below: Initiative Sizes - defaults to "Undefined", "Small", "Medium", "Large" Default Initiative Size - defaults to "Undefined Information Classifications - defaults to "Restricted", "Confidential", "Public" Default Information Classification - defaults to "Confidential" Impact Types - defaults to "Confidentiality", "Integrity", "Availability" STRIDE Elements - defaults to "Spoofing", "Tampering", "Info Disclosure", "Denial Of Service", "Elevation Of Privilege" Uptime Dependency Classifications - defaults to "none", "degraded", "hard", "operational" Default Uptime Depency Classification - defaults to "none" For example: initiative_sizes = ["S", "M", "L"]
default_initiative_size = "M"
info_classifications = ["1", "2"]
default_info_classification = "1"
impact_types = ["big", "small"]
strides = ["S", "T"]
uptime_dep_classifications = ["N", "D"]
default_uptime_dep_classification = "N" If you modify these attributes, you'll need to remember to provide the config file for other operations, as this may impact validation or dashboard creation. List and View The hcltm list and hcltm view commands can be used to list and view data from hcltm spec HCL files. $ hcltm list examples/*
# File Threatmodel Author
1 examples/tm1.hcl Tower of London @xntrik
2 examples/tm1.hcl Fort Knox @xntrik
3 examples/tm2.hcl Modelly model @xntrik Validate The hcltm validate command is used to validate a hcltm spec HCL file. $ hcltm validate examples/*
Validated 3 threatmodels in 3 files Generate The hcltm generate command is used to either output a generic boilerplate hcltm spec HCL file, or, interactively ask the user questions to then output a hcltm spec HCL file. Generate Interactive See the following example of: hcltm generate interactive
___________________________
@hacking_Attack
@Hacking_Video
Available commands are:
dashboard Generate markdown files from existing HCL threatmodel file(s)
dfd Generate Data Flow Diagram PNG files from existing HCL threatmodel file(s)
generate Generate an HCL Threat Model
list List Threatmodels found in HCL file(s)
validate Validate existing HCL Threatmodel file(s)
view View existing HCL Threatmodel file(s)
Config file Most of the hcltm commands have a -config flag that allows you to specify a config.hcl file. HCL within this file may be used to overwrite some of hcltm's default attributes. These are listed below: Initiative Sizes - defaults to "Undefined", "Small", "Medium", "Large" Default Initiative Size - defaults to "Undefined Information Classifications - defaults to "Restricted", "Confidential", "Public" Default Information Classification - defaults to "Confidential" Impact Types - defaults to "Confidentiality", "Integrity", "Availability" STRIDE Elements - defaults to "Spoofing", "Tampering", "Info Disclosure", "Denial Of Service", "Elevation Of Privilege" Uptime Dependency Classifications - defaults to "none", "degraded", "hard", "operational" Default Uptime Depency Classification - defaults to "none" For example: initiative_sizes = ["S", "M", "L"]
default_initiative_size = "M"
info_classifications = ["1", "2"]
default_info_classification = "1"
impact_types = ["big", "small"]
strides = ["S", "T"]
uptime_dep_classifications = ["N", "D"]
default_uptime_dep_classification = "N" If you modify these attributes, you'll need to remember to provide the config file for other operations, as this may impact validation or dashboard creation. List and View The hcltm list and hcltm view commands can be used to list and view data from hcltm spec HCL files. $ hcltm list examples/*
# File Threatmodel Author
1 examples/tm1.hcl Tower of London @xntrik
2 examples/tm1.hcl Fort Knox @xntrik
3 examples/tm2.hcl Modelly model @xntrik Validate The hcltm validate command is used to validate a hcltm spec HCL file. $ hcltm validate examples/*
Validated 3 threatmodels in 3 files Generate The hcltm generate command is used to either output a generic boilerplate hcltm spec HCL file, or, interactively ask the user questions to then output a hcltm spec HCL file. Generate Interactive See the following example of: hcltm generate interactive
___________________________
@hacking_Attack
@Hacking_Video
Created the 'dashboard-example' directory
Writing dashboard markdown files to 'dashboard-example' and overwriting existing files
Successfully wrote to 'dashboard-example/tm1-toweroflondon.md'
Successfully wrote to 'dashboard-example/tm1-fortknox.md'
Successfully wrote to 'dashboard-example/tm2-modellymodel.png'
Successfully wrote to 'dashboard-example/tm2-modellymodel.md'
Successfully wrote to 'dashboard-example/dashboard.md' Custom Markdown (https://www.kitploit.com/search/label/Markdown) Templates The hcltm dashboard command can also take optional flags to specify custom templates (as per Golang's text/template (https://pkg.go.dev/text/template)). To specify a dashboard template file, use the -dashboard-template flag. For an example, see dashboard-template.tpl (https://github.com/xntrik/hcltm/blob/main/examples/dashboard-template.tpl). To specify a threatmodel template file, use the -threatmodel-template flag. For an example, see threatmodel-template.tpl (https://github.com/xntrik/hcltm/blob/main/examples/threatmodel-template.tpl). Custom Filename for the Dashboard (https://www.kitploit.com/search/label/Dashboard) Index file The hcltm dashboard command can also take an optional flag to specify a filename for the "index" generated dashboard file. By default this file is dashboard.md. Use the -dashboard-filename flag without an extension to change this filename. Data Flow Diagram As per the spec (https://github.com/xntrik/hcltm/blob/main/spec.hcl), a threatmodel may include a single data_flow_diagram. An example of a simple DFD is available here (https://github.com/xntrik/hcltm/blob/main/examples/tm2.hcl). The hcltm dfd command takes hcltm spec HCL files, and generates a number of png files, dropping them into a selected folder. If the HCL file doesn't include a threatmodel block with a data_flow_diagram block, then nothing is output. The command itself is very similar to the Dashboard command. $ hcltm dfd -overwrite -outdir testout examples/*
Successfully created 'testout/tm2-modellymodel.png' If your threatmodel doesn't include a diagram_link, but does include a data_flow_diagram, then this will also be rendered when running hcltm dashboard. Terraform The hcltm terraform command is able to extract data resources from the terraform show -json docs here (https://www.terraform.io/docs/cli/commands/show.html) output of plan files, or active (https://www.kitploit.com/search/label/Active) state files, and convert these into drafted information_asset blocks for inclusion in hcltm files. If you're in a folder with existing state, you can execute the following: terraform show -json | hcltm terraform -stdin This will output something similar to this: information_asset "aws_rds_cluster default" {
description = "cluster_identifier: aurora-cluster-demo, database_name: mydb"
information_classification = ""
source = "terraform state"
}
information_asset "aws_s3_bucket example" {
description = "bucket: terraform-20211107232017071500000001"
information_classification = ""
source = "terraform state"
} You can also see similar output from a plan file that hasn't yet been applied with Terraform (https://www.kitploit.com/search/label/Terraform) by running: terraform show -json | hcltm terraform -stdin If you want to update an existing hcltm threat model file ("threatmodel.hcl") you can with: terraform show -json | hcltm terraform -stdin -add-to-existing=threatmodel.hcl > new-threatmodel.hcl With the -add-to-existing flag, you can also specify -tm-name= if you need to specify a particular threat model from the source file, if there are multiple. And you can also apply a default classification, with the -default-classification=Confidential flag. These commands can also take a file as input too, in which case, omit the -stdin flag.
___________________________
@hacking_Attack
@Hacking_Video
Writing dashboard markdown files to 'dashboard-example' and overwriting existing files
Successfully wrote to 'dashboard-example/tm1-toweroflondon.md'
Successfully wrote to 'dashboard-example/tm1-fortknox.md'
Successfully wrote to 'dashboard-example/tm2-modellymodel.png'
Successfully wrote to 'dashboard-example/tm2-modellymodel.md'
Successfully wrote to 'dashboard-example/dashboard.md' Custom Markdown (https://www.kitploit.com/search/label/Markdown) Templates The hcltm dashboard command can also take optional flags to specify custom templates (as per Golang's text/template (https://pkg.go.dev/text/template)). To specify a dashboard template file, use the -dashboard-template flag. For an example, see dashboard-template.tpl (https://github.com/xntrik/hcltm/blob/main/examples/dashboard-template.tpl). To specify a threatmodel template file, use the -threatmodel-template flag. For an example, see threatmodel-template.tpl (https://github.com/xntrik/hcltm/blob/main/examples/threatmodel-template.tpl). Custom Filename for the Dashboard (https://www.kitploit.com/search/label/Dashboard) Index file The hcltm dashboard command can also take an optional flag to specify a filename for the "index" generated dashboard file. By default this file is dashboard.md. Use the -dashboard-filename flag without an extension to change this filename. Data Flow Diagram As per the spec (https://github.com/xntrik/hcltm/blob/main/spec.hcl), a threatmodel may include a single data_flow_diagram. An example of a simple DFD is available here (https://github.com/xntrik/hcltm/blob/main/examples/tm2.hcl). The hcltm dfd command takes hcltm spec HCL files, and generates a number of png files, dropping them into a selected folder. If the HCL file doesn't include a threatmodel block with a data_flow_diagram block, then nothing is output. The command itself is very similar to the Dashboard command. $ hcltm dfd -overwrite -outdir testout examples/*
Successfully created 'testout/tm2-modellymodel.png' If your threatmodel doesn't include a diagram_link, but does include a data_flow_diagram, then this will also be rendered when running hcltm dashboard. Terraform The hcltm terraform command is able to extract data resources from the terraform show -json docs here (https://www.terraform.io/docs/cli/commands/show.html) output of plan files, or active (https://www.kitploit.com/search/label/Active) state files, and convert these into drafted information_asset blocks for inclusion in hcltm files. If you're in a folder with existing state, you can execute the following: terraform show -json | hcltm terraform -stdin This will output something similar to this: information_asset "aws_rds_cluster default" {
description = "cluster_identifier: aurora-cluster-demo, database_name: mydb"
information_classification = ""
source = "terraform state"
}
information_asset "aws_s3_bucket example" {
description = "bucket: terraform-20211107232017071500000001"
information_classification = ""
source = "terraform state"
} You can also see similar output from a plan file that hasn't yet been applied with Terraform (https://www.kitploit.com/search/label/Terraform) by running: terraform show -json | hcltm terraform -stdin If you want to update an existing hcltm threat model file ("threatmodel.hcl") you can with: terraform show -json | hcltm terraform -stdin -add-to-existing=threatmodel.hcl > new-threatmodel.hcl With the -add-to-existing flag, you can also specify -tm-name= if you need to specify a particular threat model from the source file, if there are multiple. And you can also apply a default classification, with the -default-classification=Confidential flag. These commands can also take a file as input too, in which case, omit the -stdin flag.
___________________________
@hacking_Attack
@Hacking_Video
KitPloit - PenTest & Hacking Tools
Leading source of security tools, hacking tools, cybersecurity and network security. Learn about new tools and updates in one place.
Hacker Interview #2: Alvin “Steiner254”
https://medium.com/hackenproof/hacker-interview-2-alvin-steiner254-56ce7731e33f?source=rss------bug_bounty-5
___________________________
@hacking_Attack
@Hacking_Video
https://medium.com/hackenproof/hacker-interview-2-alvin-steiner254-56ce7731e33f?source=rss------bug_bounty-5
___________________________
@hacking_Attack
@Hacking_Video
Medium
Hacker Interview #2: Alvin “Steiner254”
Learning cybersecurity comes in many forms: technical practice, lab workshops, and also writeups. Bug bounty hunter Alvin, going by the…
Learning cybersecurity comes in many forms: technical practice, lab workshops, and also writeups. Bug bounty hunter Alvin, going by the…Continue reading on HackenProof » (https://medium.com/hackenproof/hacker-interview-2-alvin-steiner254-56ce7731e33f?source=rss------bug_bounty-5)
___________________________
@hacking_Attack
@Hacking_Video
___________________________
@hacking_Attack
@Hacking_Video
Medium
Hacker Interview #2: Alvin “Steiner254”
Learning cybersecurity comes in many forms: technical practice, lab workshops, and also writeups. Bug bounty hunter Alvin, going by the…
Hacking on Medium
What is SQL Injection?
https://cdn-images-1.medium.com/max/2600/1*YerC98lFXER3hF5C1ZWm1A.jpeg
What is It?
Continue reading on Medium »
___________________________
@hacking_Attack
@Hacking_Video
What is SQL Injection?
https://cdn-images-1.medium.com/max/2600/1*YerC98lFXER3hF5C1ZWm1A.jpeg
What is It?
Continue reading on Medium »
___________________________
@hacking_Attack
@Hacking_Video
Medium
What is SQL Injection?
What is It?
Hacking on Medium
“Ninguna Tecnología está libre de Riesgo” (Guerra de Rusia Vs Ucrania también ocurre en Internet —…
https://cdn-images-1.medium.com/max/1280/0*HkhHh1MtE_PYj0-c.jpg
Los consejos de ciberseguridad ante la guerra en Ucrania: “Ningún servicio o sistema tecnológico está realmente libre de riesgos”
Continue reading on Medium »
___________________________
@hacking_Attack
@Hacking_Video
“Ninguna Tecnología está libre de Riesgo” (Guerra de Rusia Vs Ucrania también ocurre en Internet —…
https://cdn-images-1.medium.com/max/1280/0*HkhHh1MtE_PYj0-c.jpg
Los consejos de ciberseguridad ante la guerra en Ucrania: “Ningún servicio o sistema tecnológico está realmente libre de riesgos”
Continue reading on Medium »
___________________________
@hacking_Attack
@Hacking_Video
Medium
“Ninguna Tecnología está libre de Riesgo” (Guerra de Rusia Vs Ucrania también ocurre en Internet — Parte 09)
Los consejos de ciberseguridad ante la guerra en Ucrania: “Ningún servicio o sistema tecnológico está realmente libre de riesgos”
Hacking on Medium
Wolverine Security CTF
https://cdn-images-1.medium.com/max/600/1*AsBvCghIsz9sSVrx9STyIg.png
SSRF 101
Continue reading on Medium »
___________________________
@hacking_Attack
@Hacking_Video
Wolverine Security CTF
https://cdn-images-1.medium.com/max/600/1*AsBvCghIsz9sSVrx9STyIg.png
SSRF 101
Continue reading on Medium »
___________________________
@hacking_Attack
@Hacking_Video
Medium
Wolverine Security CTF
SSRF 101
Hacking Articles Tips Tricks Videos Tutorials
Photo
KitPloit - PenTest Tools!
Hcltm - Documenting Your Threat Models With HCL
https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgFIDKhZNpsGTVemA6vZyMVxJiq1oGEzlFSWGjeqEYnD_6GqFMJvqLTzZj8zRF7okHasxQG-bGgNEWePCss_cvlW4i8JF_f31N8xvz5k9SZP_e2X6Ux57cOajVtUYccHs4W_Hx0nFrwMNEwgZ-FqCFDPxPiFY2pyMx4LHdDHz4OK4sxvYgnolWdsHzf/w640-h452/hcltm.png Threat Modeling with HCL OverviewThere 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.
* Simple text-file format
* Simple cli-driven user experience
* Integration into version control systems (VCS)
This repository is the home of the
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.
To see a full description of the spec, see here or run:
You can use
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. hcltm cliInstallationDownload the latest version from releases and move the
___________________________
@hacking_Attack
@Hacking_Video
Hcltm - Documenting Your Threat Models With HCL
https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgFIDKhZNpsGTVemA6vZyMVxJiq1oGEzlFSWGjeqEYnD_6GqFMJvqLTzZj8zRF7okHasxQG-bGgNEWePCss_cvlW4i8JF_f31N8xvz5k9SZP_e2X6Ux57cOajVtUYccHs4W_Hx0nFrwMNEwgZ-FqCFDPxPiFY2pyMx4LHdDHz4OK4sxvYgnolWdsHzf/w640-h452/hcltm.png Threat Modeling with HCL OverviewThere 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.
hcltmaims 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
hcltmcli software. The hcltmspec 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 hcltmcli software and the hcltmspec allows practitioners to define a system threat model in HCL, for example: threatmodel "Tower of London" {
description = "A historic castle"
author = "@xntrik"
attributes {
new_initiative = "true"
internet_facing = "true"
initiative_size = "Small"
}
information_asset "crown jewels" {
description = "including the imperial state crown"
information_classification = "Confidential"
}
usecase {
description = "The Queen can fetch the crown"
}
third_party_dependency "community watch" {
description = "The community watch helps guard the premise"
uptime_dependency = "degraded"
}
threat {
description = "Someone who isn't the Queen steals the crown"
impacts = ["Confidentiality"]
control = "Lots of guards"
}
data_flow_diagram {
// ... see below for more information
}
}See Data Flow Diagram for more information on how to construct data flow diagrams that are 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.
To see a full description of the spec, see here or run:
hcltm generate boilerplatehcltmwill 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 hcltm's goals.You can use
hcltmwith 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 ReferencesOne of the features of hcltmis 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. hcltm cliInstallationDownload the latest version from releases and move the
hcltmbinary into yo[...]___________________________
@hacking_Attack
@Hacking_Video
KitPloit - PenTest & Hacking Tools
Hcltm - Documenting Your Threat Models With HCL
Hacking Articles Tips Tricks Videos Tutorials
KitPloit - PenTest Tools! Hcltm - Documenting Your Threat Models With HCL https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgFIDKhZNpsGTVemA6vZyMVxJiq1oGEzlFSWGjeqEYnD_6GqFMJvqLTzZj8zRF7okHasxQG-bGgNEWePCss_cvlW4i8JF_f31N8xvz5k9SZP_e2X6Ux57cOajV…
ur PATH. Install with HomebrewThe following will add a local tap, and install
2. Change into the directory,
Diagram PNG files from existing HCL threatmodel file(s) generate Generate an HCL Threat Model list List Threatmodels found in HCL file(s) validate Validate existing HCL Threatmodel file(s) view View existing HCL Threatmodel file(s) ">$ hcltm
Usage: hcltm [--version] [--help] [ Config fileMost of the
* Initiative Sizes - defaults to "Undefined", "Small", "Medium", "Large"
* Default Initiative Size - defaults to "Undefined
* Information Classifications - defaults to "Restricted", "Confidential", "Public"
* Default Information Classification - defaults to "Confidential"
* Impact Types - defaults to "Confidentiality", "Integrity", "Availability"
* STRIDE Elements - defaults to "Spoofing", "Tampering", "Info Disclosure", "Denial Of Service", "Elevation Of Privilege"
* Uptime Dependency Classifications - defaults to "none", "degraded", "hard", "operational"
* Default Uptime Depency Classification - defaults to "none"
For example:
___________________________
@hacking_Attack
@Hacking_Video
hcltmwith Homebrew brew install xntrik/repo/hcltmRun with Dockerdocker run --rm -it xntrik/hcltmRun with GitHub Actionshcltmcan be integrated directly into your GitHub repos with https://github.com/xntrik/hcltm-action. This is one of the ideal methods to manage your threat models, and helps meet the goal of integrating into your version control systems. Building from Source1. Clone this repository.2. Change into the directory,
hcltm3. make bootstrap4. make devFor further help on contributing to hcltmplease see the CHANGELOG.md. UsageFor help on any subcommands use the -hflag.Diagram PNG files from existing HCL threatmodel file(s) generate Generate an HCL Threat Model list List Threatmodels found in HCL file(s) validate Validate existing HCL Threatmodel file(s) view View existing HCL Threatmodel file(s) ">$ hcltm
Usage: hcltm [--version] [--help] [ Config fileMost of the
hcltmcommands have a -configflag that allows you to specify a config.hclfile. HCL within this file may be used to overwrite some of hcltm's default attributes. These are listed below:* Initiative Sizes - defaults to "Undefined", "Small", "Medium", "Large"
* Default Initiative Size - defaults to "Undefined
* Information Classifications - defaults to "Restricted", "Confidential", "Public"
* Default Information Classification - defaults to "Confidential"
* Impact Types - defaults to "Confidentiality", "Integrity", "Availability"
* STRIDE Elements - defaults to "Spoofing", "Tampering", "Info Disclosure", "Denial Of Service", "Elevation Of Privilege"
* Uptime Dependency Classifications - defaults to "none", "degraded", "hard", "operational"
* Default Uptime Depency Classification - defaults to "none"
For example:
initiative_sizes = ["S", "M", "L"]
default_initiative_size = "M"
info_classifications = ["1", "2"]
default_info_classification = "1"
impact_types = ["big", "small"]
strides = ["S", "T"]
uptime_dep_classifications = ["N", "D"]
default_uptime_dep_classification = "N"If you modify these attributes, you'll need to remember to provide the config file for other operations, as this may impact validation or dashboard creation. List and ViewThe hcltm listand hcltm viewcommands can be used to list and view data from hcltmspec HCL files. $ hcltm list examples/*
# File Threatmodel Author
1 examples/tm1.hcl Tower of London @xntrik
2 examples/tm1.hcl Fort Knox @xntrik
3 examples/tm2.hcl Modelly model @xntrikValidateThe hcltm validatecommand is used to validate a hcltmspec HCL file. $ hcltm validate examples/*
Validated 3 threatmodels in 3 filesGenerateThe hcltm generatecommand is used to either output a generic boilerplatehcltmspec HCL file, or, interactively ask the user questions to then output a hcltmspec HCL file. Generate InteractiveSee the following example of: hcltm generate interactivehttps://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgFIDKhZNpsGTVemA6vZyMVxJiq1oGEzlFSWGjeqEYnD_6GqFMJvqLTzZj8zRF7okHasxQG-bGgNEWePCss_cvlW4i8JF_f31N8xvz5k9SZP_e2X6Ux57cOajVtUYccHs4W_Hx0nFrwMNEwgZ-FqCFDPxPiFY2pyMx4LHdDHz4OK4s[...]___________________________
@hacking_Attack
@Hacking_Video
GitHub
GitHub - xntrik/hcltm-action: Run hcltm within your GitHub Actions
Run hcltm within your GitHub Actions. Contribute to xntrik/hcltm-action development by creating an account on GitHub.
Hacking Articles Tips Tricks Videos Tutorials
ur PATH. Install with HomebrewThe following will add a local tap, and install hcltmwith Homebrew brew install xntrik/repo/hcltmRun with Dockerdocker run --rm -it xntrik/hcltmRun with GitHub Actionshcltmcan be integrated directly into your GitHub repos with…
xvYgnolWdsHzf/w640-h452/hcltm.png Generate Interactive EditorIf you prefer to work directly in your
To specify a dashboard template file, use the
To specify a threatmodel template file, use the
The
If the HCL file doesn't include a
The command itself is very similar to the Dashboard command.
If you're in a folder with existing state, you can execute the following:
___________________________
@hacking_Attack
@Hacking_Video
$EDITORthen run: hcltm generate interactive editorThis will open your editor with a barebones HCL threat model. If you want to validate the model after creation, then use the -validateflag. DashboardThe hcltm dashboardcommand takes hcltmspec HCL files, and generates a number of markdown and png files, dropping them into a selected folder. $ hcltm dashboard -overwrite -outdir=dashboard-example examples/*
Created the 'dashboard-example' directory
Writing dashboard markdown files to 'dashboard-example' and overwriting existing files
Successfully wrote to 'dashboard-example/tm1-toweroflondon.md'
Successfully wrote to 'dashboard-example/tm1-fortknox.md'
Successfully wrote to 'dashboard-example/tm2-modellymodel.png'
Successfully wrote to 'dashboard-example/tm2-modellymodel.md'
Successfully wrote to 'dashboard-example/dashboard.md'Custom Markdown TemplatesThe hcltm dashboardcommand can also take optional flags to specify custom templates (as per Golang's text/template).To specify a dashboard template file, use the
-dashboard-templateflag. For an example, see dashboard-template.tpl.To specify a threatmodel template file, use the
-threatmodel-templateflag. For an example, see threatmodel-template.tpl. Custom Filename for the Dashboard Index fileThe hcltm dashboardcommand can also take an optional flag to specify a filename for the "index" generated dashboard file. By default this file is dashboard.md. Use the -dashboard-filenameflag without an extension to change this filename. Data Flow DiagramAs per the spec, a threatmodelmay include a single data_flow_diagram. An example of a simple DFD is available here.The
hcltm dfdcommand takes hcltmspec HCL files, and generates a number of png files, dropping them into a selected folder.If the HCL file doesn't include a
threatmodelblock with a data_flow_diagramblock, then nothing is output.The command itself is very similar to the Dashboard command.
$ hcltm dfd -overwrite -outdir testout examples/*
Successfully created 'testout/tm2-modellymodel.png'If your threatmodeldoesn't include a diagram_link, but does include a data_flow_diagram, then this will also be rendered when running hcltm dashboard. TerraformThe hcltm terraformcommand is able to extract data resources from the terraform show -jsondocs here output of plan files, or active state files, and convert these into drafted information_assetblocks for inclusion in hcltmfiles.If you're in a folder with existing state, you can execute the following:
terraform show -json | hcltm terraform -stdinThis will output something similar to this: information_asset "aws_rds_cluster default" {
description = "cluster_identifier: aurora-cluster-demo, database_name: mydb"
information_classification = ""
source = "terraform state"
}
information_asset "aws_s3_bucket example" {
description = "bucket: terraform-20211107232017071500000001"
information_classification = ""
source = "terraform state"
}You can also see similar output from a plan file that hasn't yet been applied with Terraform by running: terraform show -json If you want to update an existing hcltmthreat model file ("threatmodel.hcl") you can with: terraform show -json new-threatmodel.hclWith the -add-to-existingflag, you can also specify -tm-name=if you [...]___________________________
@hacking_Attack
@Hacking_Video