-
-
Notifications
You must be signed in to change notification settings - Fork 6.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Data Flow Diagram (a la STRIDE Threat Model) #1893
Comments
You can use
where graph LR
DataStore[Database] -->|input| Process((System)) -->|output| Entity[Customer]
style DataStore stroke-dasharray: 88.5 44
which is rendered by the Mermaid Live Editor if image is copied to clipboard as PNG. However, if you copy it as markdown, the height (and width?) are somehow different 🤔 It seems that height has to be graph LR
DataStore[Database] -->|input| Process((System)) -->|output| Entity[Customer]
style DataStore stroke-dasharray: 88.5 39
As I said in the beginning, this is a hacky solution 😉 😅 |
Just one more example if anyone needs. flowchart LR
user(user)
mobile((mobile\napplication))
proxy((reverse\nproxy))
api((API))
db[|borders:tb|database]
subgraph external [Internet]
user--personal data-->mobile
mobile-->proxy
end
subgraph dmz [Internal Network]
proxy-->api
db-->api
api-->db
end
classDef boundary fill:none,stroke-dasharray: 5 5
dmz:::boundary
external:::boundary
flowchart LR
user(user)
mobile((mobile\napplication))
proxy((reverse\nproxy))
api((API))
db[|borders:tb|database]
subgraph external [Internet]
user--personal data-->mobile
mobile-->proxy
end
subgraph dmz [Internal Network]
proxy-->api
db-->api
api-->db
end
classDef boundary fill:none,stroke-dasharray: 5 5
dmz:::boundary
external:::boundary |
Is your feature request related to a problem? Please describe.
I am curious if there is a way to generate a Data Flow Diagram using Mermaid (see example screenshot below).
Data Flow Diagrams are common in software Threat Modelling, especially the STRIDE threat model methodology.
Describe the solution you'd like
A a flow
graph
orstateDiagram
are very similar in concept. In fact, if there is a way to use custom shapes and denote the type of node, then it may very well be possible to achieve this today.For example, the following Mermaid code would generate the screenshot below:
Where:
[| |]
denotes a Data Store(( ))
denotes a Process or Function[ ]
denotes an External Entity-->|label|
denotes a Data Flow labeled aslabel
Besides a few shapes that are missing (e.g. Data Store represented by horizontal parallel lines), all shapes would also need to be available in solid lines and dashed/dotted lines, which denotes being out-of-scope.
Additional context
Simple Data Flow Diagram:
The text was updated successfully, but these errors were encountered: