-
Notifications
You must be signed in to change notification settings - Fork 3
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 #12 from hyakuhei/AggregatedModel
Aggregated model
- Loading branch information
Showing
10 changed files
with
266 additions
and
91 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
from fluentm import Actor, Boundary, Process, Data, DataFlow, HTTP, TLS, SQL | ||
from fluentm import report | ||
|
||
|
||
scenes = { | ||
# Example using variables, which is fine for small things but gets hard with longer flows | ||
"Towers":[ | ||
DataFlow( | ||
Process("Alice").inBoundary(Boundary("A Inner").inBoundary(Boundary("A Mid").inBoundary(Boundary("A Outer")))), | ||
Process("Bob").inBoundary(Boundary("B Inner").inBoundary(Boundary("B Mid").inBoundary(Boundary("B Outer")))), | ||
TLS("Helo"), | ||
response=TLS("Hai") | ||
) | ||
], | ||
"Enter Charlie":[ | ||
DataFlow( | ||
Process("Charlie").inBoundary(Boundary("B Outer")), | ||
Process("Alice"), | ||
TLS("Yo") | ||
) | ||
] | ||
} | ||
|
||
if __name__ == "__main__": | ||
report(scenes, outputDir="examples/nest") |
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,30 @@ | ||
digraph all { | ||
color=blue rankdir=LR | ||
node [fontname=Arial fontsize=14] | ||
subgraph "cluster_A Outer" { | ||
graph [color=red fontname=Arial fontsize=12 label="A Outer" line=dotted] | ||
subgraph "cluster_A Mid" { | ||
graph [color=red fontname=Arial fontsize=12 label="A Mid" line=dotted] | ||
subgraph "cluster_A Inner" { | ||
graph [color=red fontname=Arial fontsize=12 label="A Inner" line=dotted] | ||
Alice | ||
} | ||
} | ||
} | ||
subgraph "cluster_B Outer" { | ||
graph [color=red fontname=Arial fontsize=12 label="B Outer" line=dotted] | ||
subgraph "cluster_B Mid" { | ||
graph [color=red fontname=Arial fontsize=12 label="B Mid" line=dotted] | ||
subgraph "cluster_B Inner" { | ||
graph [color=red fontname=Arial fontsize=12 label="B Inner" line=dotted] | ||
Bob | ||
} | ||
} | ||
} | ||
subgraph "cluster_B Outer" { | ||
graph [color=red fontname=Arial fontsize=12 label="B Outer" line=dotted] | ||
Charlie | ||
} | ||
Alice -> Bob [dir=both] | ||
Charlie -> Alice [dir=forward] | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
digraph "Enter Charlie" { | ||
color=blue rankdir=LR | ||
node [fontname=Arial fontsize=14] | ||
subgraph "cluster_B Outer" { | ||
graph [color=red fontname=Arial fontsize=12 label="B Outer" line=dotted] | ||
Charlie | ||
} | ||
subgraph "cluster_A Outer" { | ||
graph [color=red fontname=Arial fontsize=12 label="A Outer" line=dotted] | ||
subgraph "cluster_A Mid" { | ||
graph [color=red fontname=Arial fontsize=12 label="A Mid" line=dotted] | ||
subgraph "cluster_A Inner" { | ||
graph [color=red fontname=Arial fontsize=12 label="A Inner" line=dotted] | ||
Alice | ||
} | ||
} | ||
} | ||
Charlie -> Alice [label="(1) Yo"] | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,126 @@ | ||
<html> | ||
<head> | ||
<title> | ||
Threat Models | ||
</title> | ||
<style> | ||
#dataFlowTable { | ||
font-family: Arial, Helvetica, sans-serif; | ||
border-collapse: collapse; | ||
width: 100%; | ||
} | ||
|
||
#dataFlowTable td, #dataFlowTable th { | ||
border: 1px solid #ddd; | ||
padding: 8px; | ||
} | ||
|
||
#dataFlowTable tr:nth-child(even){background-color: #f2f2f2;} | ||
|
||
#dataFlowTable tr:hover {background-color: #ddd;} | ||
|
||
#dataFlowTable th { | ||
padding-top: 12px; | ||
padding-bottom: 12px; | ||
text-align: left; | ||
background-color: #a34a4a; | ||
color: white; | ||
} | ||
h2 { | ||
color: rgb(48, 27, 23); | ||
font-family: verdana; | ||
font-size: 25px; | ||
} | ||
p { | ||
font-family: verdana; | ||
font-size: 15px; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<h2> Aggregated Model</h2> | ||
<p>This high level diagram gathers all flows in this model to show how components interact at a high level.</p> | ||
<img src=AggregatedDfd-dfd.png > | ||
<hr /> | ||
|
||
<h2> Towers </h2> | ||
<img src="Towers-dfd.png"> | ||
<table id="dataFlowTable"> | ||
<tr> | ||
|
||
<th>Flow ID</th> | ||
|
||
<th>Pitcher</th> | ||
|
||
<th>Catcher</th> | ||
|
||
<th>Data Flow</th> | ||
|
||
</tr> | ||
|
||
<tr> | ||
|
||
<td>1</td> | ||
|
||
<td>Alice</td> | ||
|
||
<td>Bob</td> | ||
|
||
<td>TLS( Helo )</td> | ||
|
||
</tr> | ||
|
||
|
||
<tr> | ||
|
||
<td>2</td> | ||
|
||
<td>Bob</td> | ||
|
||
<td>Alice</td> | ||
|
||
<td>TLS( Hai )</td> | ||
|
||
</tr> | ||
|
||
|
||
</table> | ||
|
||
|
||
<hr /> | ||
|
||
<h2> Enter Charlie </h2> | ||
<img src="Enter Charlie-dfd.png"> | ||
<table id="dataFlowTable"> | ||
<tr> | ||
|
||
<th>Flow ID</th> | ||
|
||
<th>Pitcher</th> | ||
|
||
<th>Catcher</th> | ||
|
||
<th>Data Flow</th> | ||
|
||
</tr> | ||
|
||
<tr> | ||
|
||
<td>1</td> | ||
|
||
<td>Charlie</td> | ||
|
||
<td>Alice</td> | ||
|
||
<td>TLS( Yo )</td> | ||
|
||
</tr> | ||
|
||
|
||
</table> | ||
|
||
|
||
<hr /> | ||
|
||
</body> | ||
</html> |
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,26 @@ | ||
digraph Towers { | ||
color=blue rankdir=LR | ||
node [fontname=Arial fontsize=14] | ||
subgraph "cluster_A Outer" { | ||
graph [color=red fontname=Arial fontsize=12 label="A Outer" line=dotted] | ||
subgraph "cluster_A Mid" { | ||
graph [color=red fontname=Arial fontsize=12 label="A Mid" line=dotted] | ||
subgraph "cluster_A Inner" { | ||
graph [color=red fontname=Arial fontsize=12 label="A Inner" line=dotted] | ||
Alice | ||
} | ||
} | ||
} | ||
subgraph "cluster_B Outer" { | ||
graph [color=red fontname=Arial fontsize=12 label="B Outer" line=dotted] | ||
subgraph "cluster_B Mid" { | ||
graph [color=red fontname=Arial fontsize=12 label="B Mid" line=dotted] | ||
subgraph "cluster_B Inner" { | ||
graph [color=red fontname=Arial fontsize=12 label="B Inner" line=dotted] | ||
Bob | ||
} | ||
} | ||
} | ||
Alice -> Bob [label="(1) Helo"] | ||
Bob -> Alice [label="(2) Hai"] | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
graphviz==0.16 | ||
Jinja2==3.0.1 | ||
black==21.7b0 |