Skip to content

Commit

Permalink
Merge pull request #126 from nineinchnick/threats-template
Browse files Browse the repository at this point in the history
render threats into a human readable format
  • Loading branch information
izar authored Oct 4, 2020
2 parents 4143867 + 9e10650 commit 3f432b5
Show file tree
Hide file tree
Showing 4 changed files with 2,657 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# 1.1.3

- Added HTML docs using pdoc [#110](https://github.com/izar/pytm/pull/110)
- Added a markdown file with threats [#126](https://github.com/izar/pytm/pull/126)
- Fixed drawing nested boudnaries [#117](https://github.com/izar/pytm/pull/117)

# 1.1.2
Expand Down
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ all: $(models:.py=/report.html) $(models:.py=/dfd.png) $(models:.py=/seq.png) do
docs/pytm/index.html: $(wildcard pytm/*.py)
PYTHONPATH=. pdoc --html --force --output-dir docs pytm

docs/threats.md: $(wildcard pytm/threatlib/*.json)
printf "# Threat database\n" > $@
jq -r ".[] | \"$$(cat docs/threats.jq)\"" $< >> $@

clean:
rm -rf dist/* build/* $(models:.py=/*)

Expand Down Expand Up @@ -52,7 +56,7 @@ image:
docker build -t $(DOCKER_IMG) .

.PHONY: docs
docs: docs/pytm/index.html
docs: docs/pytm/index.html docs/threats.md

.PHONY: fmt
fmt:
Expand Down
24 changes: 24 additions & 0 deletions docs/threats.jq
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
## \(.SID) \(.description)

\(.details)

<dl>
<dt>Severity</dt>
<dd>\(.severity)</dd>

<dt>Prerequisites</dt>
<dd>\(.prerequisites)</dd>

<dt>Example</dt>
<dd>\(.example)</dd>

<dt>Mitigations</dt>
<dd>\(.mitigations)</dd>

<dt>References</dt>
<dd>\(.references)</dd>

<dt>Condition</dt>
<dd>\(.condition)</dd>
</dl>
\n\n
Loading

0 comments on commit 3f432b5

Please sign in to comment.