forked from AErmie/DevSecOps
-
Notifications
You must be signed in to change notification settings - Fork 4
53 lines (42 loc) · 1.57 KB
/
pytm-workflow.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
name: "Threat Model - Python Threat Model (PyTM)"
on:
workflow_dispatch: # allows to manually trigger the workflow from the Actions tab
push:
paths:
- 'ThreatModeling/pytm/pytm.py' # useful to filter this job to execute only when the threat model changes
jobs:
pytm_job:
runs-on: ubuntu-latest
name: Threat Model Analysis
steps:
# Checkout the repo
- name: Checkout Workspace
uses: actions/checkout@v2
- name: Setup GraphViz
uses: ts-graphviz/setup-graphviz@v1
- name: Setup PanDoc
uses: r-lib/actions/setup-pandoc@v2
# with:
# pandoc-version: '2.7.3' # The pandoc version to download (if necessary) and use.
- name: Download pytm source code
run: |
git clone https://github.com/izar/pytm.git && cd pytm
pip3 install -r requirements.txt
- name: Generate Data Flow Diagram
run: |
python ./ThreatModeling/pytm/pytm.py --dfd | dot -Tpng -o DataFlowDiagram.png
- name: Generate List of Threats
if: always()
run: |
python ./ThreatModeling/pytm/pytm.py --json ListOfThreats.json
- name: Generate Threat Model Reports
if: always()
run: |
python ./ThreatModeling/pytm/pytm.py --report docs/basic_template.md | pandoc -f markdown -t html > ThreatModelReports.html
# Archive resulting files as artifacts
- name: Archive Results
uses: actions/upload-artifact@v2
if: always()
with:
name: pyTM-report
path: pytm