Skip to content

Commit

Permalink
Merge pull request #229 from izar/colormap
Browse files Browse the repository at this point in the history
Colormap
  • Loading branch information
colesmj authored Feb 25, 2024
2 parents 8a16480 + eb9af4a commit 4890300
Show file tree
Hide file tree
Showing 12 changed files with 360 additions and 71 deletions.
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ optional arguments:
--exclude EXCLUDE specify threat IDs to be ignored
--seq output sequential diagram
--list list all available threats
--colormap color the risk in the diagram
--describe DESCRIBE describe the properties available for a given element
--list-elements list all elements which can be part of a threat model
--json JSON output a JSON file
Expand Down Expand Up @@ -113,6 +114,9 @@ Element class attributes:
```

The *colormap* argument, used together with *dfd*, outputs a color-coded DFD where the elements are painted red, yellow or green depending on their risk level (as identified by running the rules).


## Creating a Threat Model

The following is a sample `tm.py` file that describes a simple application where a User logs into the application
Expand Down Expand Up @@ -200,6 +204,8 @@ tm.process()

```

You also have the option of using [pytmGPT](https://chat.openai.com/g/g-soISG24ix-pytmgpt) to create your models from prose!

### Generating Diagrams

Diagrams are output as [Dot](https://graphviz.gitlab.io/) and [PlantUML](https://plantuml.com/).
Expand Down Expand Up @@ -303,10 +309,13 @@ user_to_web.overrides = [
threat_id="INP02",
cvss="9.3",
response="""**To Mitigate**: run a memory sanitizer to validate the binary""",
severity="Very High",
)
]
```

If you are adding a Finding, make sure to add a severity: "Very High", "High", "Medium", "Low", "Very Low".

## Threats database

For the security practitioner, you may supply your own threats file by setting `TM.threatsFile`. It should contain entries like:
Expand Down
Binary file added pytm/images/datastore_black.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added pytm/images/datastore_darkgreen.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added pytm/images/datastore_firebrick3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added pytm/images/datastore_gold.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 4890300

Please sign in to comment.