-
Notifications
You must be signed in to change notification settings - Fork 177
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #155 from izar/update_template
TemplateEngine improvements, updated template.md
- Loading branch information
Showing
10 changed files
with
285 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,160 @@ | ||
<link href="docs/Stylesheet.css" rel="stylesheet"></link> | ||
|
||
## System Description | ||
|
||
{tm.description} | ||
|
||
## Dataflow Diagram - Level 0 DFD | ||
|
||
![](sample.png) | ||
|
||
| ||
|
||
## Dataflows | ||
|
||
Name|From|To |Data|Protocol|Port | ||
|:----:|:----:|:---:|:----:|:--------:|:----:| | ||
{dataflows:repeat:|{{item.display_name:call:}}|{{item.source.name}}|{{item.sink.name}}|{{item.data}}|{{item.protocol}}|{{item.dstPort}}| | ||
} | ||
|
||
## Data Dictionary | ||
|
||
Name|Description|Classification|Carried|Processed | ||
|:----:|:--------:|:----:|:----|:----| | ||
{data:repeat:|{{item.name}}|{{item.description}}|{{item.classification.name}}|{{item.carriedBy:repeat:{{{{item.name}}}}<br>}}|{{item.processedBy:repeat:{{{{item.name}}}}<br>}}| | ||
} | ||
|
||
## Actors | ||
|
||
{actors:repeat: | ||
Name|{{item.name}} | ||
|:----|:----| | ||
Description|{{item.description}}| | ||
Is Admin|{{item.isAdmin}} | ||
Finding Count|{{item:call:getFindingCount}}| | ||
|
||
{{item.findings:if: | ||
|
||
**Threats** | ||
|
||
{{item.findings:repeat: | ||
<details> | ||
<summary> {{{{item.id}}}} -- {{{{item.threat_id}}}} -- {{{{item.description}}}}</summary> | ||
<h6> Targeted Element </h6> | ||
<p> {{{{item.target}}}} </p> | ||
<h6> Severity </h6> | ||
<p>{{{{item.severity}}}}</p> | ||
<h6>Example Instances</h6> | ||
<p>{{{{item.example}}}}</p> | ||
<h6>Mitigations</h6> | ||
<p>{{{{item.mitigations}}}}</p> | ||
<h6>References</h6> | ||
<p>{{{{item.references}}}}</p> | ||
  | ||
</details> | ||
}} | ||
}} | ||
} | ||
|
||
## Boundaries | ||
|
||
{boundaries:repeat: | ||
Name|{{item.name}} | ||
|:----|:----| | ||
Description|{{item.description}}| | ||
In Scope|{{item.inScope}}| | ||
Immediate Parent|{{item.parents:if:{{item:call:getParentName}}}}{{item.parents:not:N/A, primary boundary}}| | ||
All Parents|{{item.parents:call:{{{{item.display_name:call:}}}}, }}| | ||
Classification|{{item.maxClassification}}| | ||
Finding Count|{{item:call:getFindingCount}}| | ||
|
||
{{item.findings:if: | ||
|
||
**Threats** | ||
|
||
{{item.findings:repeat: | ||
<details> | ||
<summary> {{{{item.id}}}} -- {{{{item.threat_id}}}} -- {{{{item.description}}}}</summary> | ||
<h6> Targeted Element </h6> | ||
<p> {{{{item.target}}}} </p> | ||
<h6> Severity </h6> | ||
<p>{{{{item.severity}}}}</p> | ||
<h6>Example Instances</h6> | ||
<p>{{{{item.example}}}}</p> | ||
<h6>Mitigations</h6> | ||
<p>{{{{item.mitigations}}}}</p> | ||
<h6>References</h6> | ||
<p>{{{{item.references}}}}</p> | ||
  | ||
</details> | ||
}} | ||
}} | ||
} | ||
|
||
## Assets | ||
|
||
{assets:repeat: | ||
Name|{{item.name}}| | ||
|:----|:----| | ||
Description|{{item.description}}| | ||
In Scope|{{item.inScope}}| | ||
Type|{{item:call:getElementType}}| | ||
Finding Count|{{item:call:getFindingCount}}| | ||
|
||
{{item.findings:if: | ||
|
||
**Threats** | ||
|
||
{{item.findings:repeat: | ||
<details> | ||
<summary> {{{{item.id}}}} -- {{{{item.threat_id}}}} -- {{{{item.description}}}}</summary> | ||
<h6> Targeted Element </h6> | ||
<p> {{{{item.target}}}} </p> | ||
<h6> Severity </h6> | ||
<p>{{{{item.severity}}}}</p> | ||
<h6>Example Instances</h6> | ||
<p>{{{{item.example}}}}</p> | ||
<h6>Mitigations</h6> | ||
<p>{{{{item.mitigations}}}}</p> | ||
<h6>References</h6> | ||
<p>{{{{item.references}}}}</p> | ||
| ||
</details> | ||
}} | ||
}} | ||
} | ||
|
||
## Data Flows | ||
|
||
{dataflows:repeat: | ||
Name|{{item.name}} | ||
|:----|:----| | ||
Description|{{item.description}}| | ||
Sink|{{item.sink}}| | ||
Source|{{item.source}}| | ||
Is Response|{{item.isResponse}}| | ||
In Scope|{{item.inScope}}| | ||
Finding Count|{{item:call:getFindingCount}}| | ||
|
||
{{item.findings:if: | ||
|
||
**Threats** | ||
|
||
{{item.findings:repeat: | ||
<details> | ||
<summary> {{{{item.id}}}} -- {{{{item.threat_id}}}} -- {{{{item.description}}}}</summary> | ||
<h6> Targeted Element </h6> | ||
<p> {{{{item.target}}}} </p> | ||
<h6> Severity </h6> | ||
<p>{{{{item.severity}}}}</p> | ||
<h6>Example Instances</h6> | ||
<p>{{{{item.example}}}}</p> | ||
<h6>Mitigations</h6> | ||
<p>{{{{item.mitigations}}}}</p> | ||
<h6>References</h6> | ||
<p>{{{{item.references}}}}</p> | ||
  | ||
</details> | ||
}} | ||
}} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
|
||
class ReportUtils: | ||
@staticmethod | ||
def getParentName(element): | ||
from pytm import Boundary | ||
if (isinstance(element, Boundary)): | ||
parent = element.inBoundary | ||
if (parent is not None): | ||
return parent.name | ||
else: | ||
return str("") | ||
else: | ||
return "ERROR: getParentName method is not valid for " + element.__class__.__name__ | ||
|
||
|
||
@staticmethod | ||
def getNamesOfParents(element): | ||
from pytm import Boundary | ||
if (isinstance(element, Boundary)): | ||
parents = [p.name for p in element.parents()] | ||
return parents | ||
else: | ||
return "ERROR: getNamesOfParents method is not valid for " + element.__class__.__name__ | ||
|
||
@staticmethod | ||
def getFindingCount(element): | ||
from pytm import Element | ||
if (isinstance(element, Element)): | ||
return str(len(list(element.findings))) | ||
else: | ||
return "ERROR: getFindingCount method is not valid for " + element.__class__.__name__ | ||
|
||
@staticmethod | ||
def getElementType(element): | ||
from pytm import Element | ||
if (isinstance(element, Element)): | ||
return str(element.__class__.__name__) | ||
else: | ||
return "ERROR: getElementType method is not valid for " + element.__class__.__name__ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters