Skip to content

Commit

Permalink
chore: Updated 0.1.5 refs to 0.1.6
Browse files Browse the repository at this point in the history
  • Loading branch information
xntrik committed Mar 21, 2023
1 parent ffd8a8c commit bb65ecc
Show file tree
Hide file tree
Showing 27 changed files with 49 additions and 31 deletions.
2 changes: 1 addition & 1 deletion cmd/hcltm/testdata/tm1.hcl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
spec_version = "0.1.5"
spec_version = "0.1.6"

threatmodel "tm1 one" {
description = <<EOT
Expand Down
2 changes: 1 addition & 1 deletion cmd/hcltm/testdata/tm1.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"spec_version": "0.1.5",
"spec_version": "0.1.6",

"threatmodel": {
"Tower of London": {
Expand Down
2 changes: 1 addition & 1 deletion cmd/hcltm/testdata/tm2.hcl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
spec_version = "0.1.5"
spec_version = "0.1.6"

threatmodel "tm2 one" {
description = "This is some arbitrary text"
Expand Down
2 changes: 1 addition & 1 deletion cmd/hcltm/testdata/tm3.hcl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
spec_version = "0.1.5"
spec_version = "0.1.6"

threatmodel "tm2 one" {
description = "This is some arbitrary text"
Expand Down
2 changes: 1 addition & 1 deletion cmd/hcltm/testdata/tm4.hcl
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
spec_version = "0.1.5"
spec_version = "0.1.6"

2 changes: 1 addition & 1 deletion cmd/hcltm/testdata/tm5.hcl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
spec_version = "0.1.5"
spec_version = "0.1.6"

threatmodel "tm2 one" {
description = "This is some arbitrary text"
Expand Down
13 changes: 11 additions & 2 deletions cmd/hcltm/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,12 @@ threatmodel "threatmodel name" {
initiative_size = "{{.DefaultInitiativeSize}}"
}
// you can set mutiple additional attribute key/value blocks as well
additional_attribute "network_segment" {
value = "DMZ"
}
// Each threatmodel may contain a number of information_assets
// the names must be unique per threatmodel though
Expand Down Expand Up @@ -225,10 +231,13 @@ EOT
}
// Each threatmodel may contain a single data_flow_diagram
// The data_flow_diagram is a HCL representation of a data flow diagram
// This format will be deprecated in the future ^
// As of 0.1.6 threatmodels may contain multiple data_flow_diagram_v2 blocks
// The data_flow_diagram_v2 is a HCL representation of a data flow diagram
// You can read more about security DFDs here https://docs.microsoft.com/en-us/learn/modules/tm-create-a-threat-model-using-foundational-data-flow-diagram-elements/
data_flow_diagram {
data_flow_diagram_v2 "level 0 diagram" {
// All blocks must have unique names
// That means that a process, data_store, or external_element can't all
Expand Down
2 changes: 1 addition & 1 deletion examples/MITRE_ATTACK_controls.hcl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//controls listed for MITRE ATT&CK

spec_version = "0.1.5"
spec_version = "0.1.6"

component "control" "Account_Use_Policies" {
description = "[M1036](https://attack.mitre.org/mitigations/M1036/) - Configure features related to account use like login attempt lockouts, specific login times, etc."
Expand Down
2 changes: 1 addition & 1 deletion examples/aws-security-checklist.hcl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
spec_version = "0.1.5"
spec_version = "0.1.6"

// These are from https://d1.awsstatic.com/whitepapers/Security/AWS_Security_Checklist.pdf

Expand Down
2 changes: 1 addition & 1 deletion examples/control-library/othercontrols.hcl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
spec_version = "0.1.5"
spec_version = "0.1.6"
component "control" "control_name" {
description = "SOMETHING HUGELY IMPORTANT HERE IN ANOTHER FOLDER"
}
Expand Down
2 changes: 1 addition & 1 deletion examples/including-example/corp-app-remote.hcl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
spec_version = "0.1.5"
spec_version = "0.1.6"

threatmodel "Tower of London" {
author = "@xntrik"
Expand Down
2 changes: 1 addition & 1 deletion examples/including-example/corp-app.hcl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
spec_version = "0.1.5"
spec_version = "0.1.6"

threatmodel "Tower of London" {

Expand Down
2 changes: 1 addition & 1 deletion examples/including-example/shared/tower.hcl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
spec_version = "0.1.5"
spec_version = "0.1.6"

threatmodel "Tower of London" {
description = "A historic castle"
Expand Down
2 changes: 1 addition & 1 deletion examples/owasp-proactive-controls.hcl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
spec_version = "0.1.5"
spec_version = "0.1.6"

// These are from https://github.com/OWASP/www-project-proactive-controls/tree/7622bebed900a6a5d7b7b9b01fb3fe2b0e695545/v3/en

Expand Down
2 changes: 1 addition & 1 deletion examples/tm1.hcl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
spec_version = "0.1.5"
spec_version = "0.1.6"

threatmodel "Tower of London" {
description = "A historic castle"
Expand Down
2 changes: 1 addition & 1 deletion examples/tm1.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"spec_version": "0.1.5",
"spec_version": "0.1.6",

"threatmodel": {
"Tower of London": {
Expand Down
2 changes: 1 addition & 1 deletion examples/tm2.hcl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
spec_version = "0.1.5"
spec_version = "0.1.6"

threatmodel "Modelly model" {
imports = ["control-library/othercontrols.hcl"]
Expand Down
2 changes: 1 addition & 1 deletion examples/tm2.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"spec_version": "0.1.5",
"spec_version": "0.1.6",

"threatmodel": {
"Modelly model": {
Expand Down
2 changes: 1 addition & 1 deletion examples/tm3.hcl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
spec_version = "0.1.5"
spec_version = "0.1.6"

threatmodel "Modelly model" {
imports = ["https://raw.githubusercontent.com/xntrik/hcltm/main/examples/aws-security-checklist.hcl", "https://raw.githubusercontent.com/xntrik/hcltm/main/examples/owasp-proactive-controls.hcl"]
Expand Down
2 changes: 1 addition & 1 deletion examples/tm4.hcl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
spec_version = "0.1.5"
spec_version = "0.1.6"

threatmodel "Sumpidy" {
author = "@xntrik"
Expand Down
2 changes: 1 addition & 1 deletion pkg/spec/testdata/including/corp-app-remote.hcl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
spec_version = "0.1.5"
spec_version = "0.1.6"

threatmodel "Tower of London" {
author = "@xntrik"
Expand Down
2 changes: 1 addition & 1 deletion pkg/spec/testdata/including/corp-app.hcl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
spec_version = "0.1.5"
spec_version = "0.1.6"

threatmodel "Tower of London" {

Expand Down
2 changes: 1 addition & 1 deletion pkg/spec/testdata/including/corp-app2.hcl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
spec_version = "0.1.5"
spec_version = "0.1.6"

threatmodel "Tower of London" {

Expand Down
2 changes: 1 addition & 1 deletion pkg/spec/testdata/including/shared/tower.hcl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
spec_version = "0.1.5"
spec_version = "0.1.6"

threatmodel "Tower of London" {
description = "A historic castle"
Expand Down
2 changes: 1 addition & 1 deletion pkg/spec/testdata/including/shared/tower2.hcl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
spec_version = "0.1.5"
spec_version = "0.1.6"

threatmodel "Tower of London" {
description = "A historic castle"
Expand Down
2 changes: 1 addition & 1 deletion pkg/spec/testdata/tm-constraint-multidfd.hcl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
spec_version = "0.1.5"
spec_version = "0.1.6"

threatmodel "tm1 one" {
description = <<EOT
Expand Down
17 changes: 13 additions & 4 deletions spec.hcl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// To cater for multiple spec versions we specify this in our HCL files
spec_version = "0.1.5"
spec_version = "0.1.6"

// You can include variables outside your threatmodel blocks

Expand Down Expand Up @@ -55,6 +55,12 @@ threatmodel "threatmodel name" {
initiative_size = "Undefined"
}

// you can set mutiple additional attribute key/value blocks as well

additional_attribute "network_segment" {
value = "DMZ"
}

// Each threatmodel may contain a number of information_assets
// the names must be unique per threatmodel though

Expand Down Expand Up @@ -190,7 +196,7 @@ threatmodel "threatmodel name" {

// An example of what may be in controls.hcl:
//
// spec_version = "0.1.5"
// spec_version = "0.1.6"
// component "control" "control_name" {
// description = "A control that can be used in multiple places"
// }
Expand All @@ -213,10 +219,13 @@ EOT
}

// Each threatmodel may contain a single data_flow_diagram
// The data_flow_diagram is a HCL representation of a data flow diagram
// This format will be deprecated in the future ^

// As of 0.1.6 threatmodels may contain multiple data_flow_diagram_v2 blocks
// The data_flow_diagram_v2 is a HCL representation of a data flow diagram
// You can read more about security DFDs here https://docs.microsoft.com/en-us/learn/modules/tm-create-a-threat-model-using-foundational-data-flow-diagram-elements/

data_flow_diagram {
data_flow_diagram_v2 "level 0 diagram" {

// All blocks must have unique names
// That means that a process, data_store, or external_element can't all
Expand Down

0 comments on commit bb65ecc

Please sign in to comment.