An Attack Graphs Extension for Draw.io

Overview

Attack Graphs Plugin for draw.io

Installation and User Guide

Please find the detailed documentation here.

Technical Documentation

Development

This is a standard npm project using Typescript to produce a single script artifact under dist/attackgraphs.js.

Use npm install and npm start, to compile the plugin and start a development web server.

Then, open http://localhost:8000 and configure the plugin (Extras > Plugins... > Add... > Custom... > http://localhost:8000/attackgraphs.js > Add > Apply > Reload).

draw.io Desktop

When adding the file, it is copied into %APPDATA%\draw.io\plugins (on Windows), ~/.config/draw.io/plugins (on Linux), or ~/Library/Application\ Support/draw.io/plugins (on Mac). By updating the attackgraphs.js in this location, you can avoid removing and re-adding the new version using the GUI.

Tests

The included Playwright tests can be run using the following command:

npx playwright test --project chrome
Comments
  • Bump jgraph/drawio from 18.1.3 to 19.0.3 in /docs

    Bump jgraph/drawio from 18.1.3 to 19.0.3 in /docs

    Bumps jgraph/drawio from 18.1.3 to 19.0.3.

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies docker 
    opened by dependabot[bot] 5
  • Forward attributes across pages

    Forward attributes across pages

    Summary: This enhancement allows to split attack graphs over several pages and makes functions and default attributes available on every page.

    This PR introduces a special "link" node that connects two nodes on different pages together. It is depicted as a circle and contains a label (content of the node). In order to connect the two nodes, both the source and destination link node must have the same label. Furthermore, the source node (with an incoming edge) must have a link to the page where the destination link node resides. Creating the link is possible by right-clicking on the source link node and selecting Edit Link. In the drop-down menu (2nd bullet point) select the corresponding page.

    Source link node (label A, link to Sub-Step 1): Attack graph with source link node

    Destiantion link node (label A, stored on page Sub-Step 1): Attack graph with destination link node

    Closes #17.

    Furthermore, this PR makes the default attributes, computed attributes functions, and aggregation functions available on every page of the diagram. They are not copied and hence changing them on one page also changes them on the other pages.

    Closes #6.

    The following TODOs must be completed before this PR can be merged:

    • [x] Update sensitivity analysis to cache and write to cells across all pages
    • [x] Changes to default attributes, aggregation functions, and computed attributes functions are only saved when saving on the first page
    • [x] Update templates and define default functions for the new link node
    • [x] Indicate whether a source link node is connected to a destination link node.
    • [x] Create documenation on link nodes and how to use them in attack graphs
    • [x] Moving the first page causes trouble for the default attributes, aggregation functions, and computed attributes functions
    • [x] Display the source pages on destination link nodes, e.g., inside the tooltip
    • [ ] (optional) Create test cases for this new feature
    • [ ] (optional) Find a better way to store the default attributes, aggregation functions, and computed attributes functions for global access
    enhancement 
    opened by tobi18991 3
  • Default attributes with default values trigger comparison in non-leave nodes

    Default attributes with default values trigger comparison in non-leave nodes

    The plugin conveniently adds some templates already containing the configured default attributes to draw.io's sidebar.

    grafik

    However, also non-leave nodes (currently, only the one marked in the figure) have the default attributes pre-configured which disturbes the workflow of creating an attack graph. If non-leave nodes have attributes and the attributes have default values configured, the comparison is unnecessarily activated.

    grafik

    Example Graph
    <mxGraphModel dx="1102" dy="857" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="583" pageHeight="827" math="0" shadow="0">
      <root>
        <object id="0">
          <ag_global_attributes>
            <ag_global_attribute name="Testattribut" value="0" iconName="" min="0" max="4" />
          </ag_global_attributes>
          <ag_attributes />
          <ag_computed_attributes />
          <mxCell />
        </object>
        <object id="1">
          <ag_attributes />
          <ag_computed_attributes />
          <mxCell parent="0" />
        </object>
        <object label="Activity" Testattribut="3" id="tVLiphedjEk2YKl1oAa3-1">
          <ag_attributes />
          <ag_computed_attributes />
          <mxCell style="shape=attackgraphs.node;" parent="1" vertex="1">
            <mxGeometry x="210" y="250" width="150" height="75" as="geometry" />
          </mxCell>
        </object>
        <object id="tVLiphedjEk2YKl1oAa3-3">
          <ag_attributes />
          <ag_computed_attributes />
          <mxCell style="rounded=0;orthogonalLoop=1;jettySize=auto;html=1;strokeWidth=2;" parent="1" source="tVLiphedjEk2YKl1oAa3-4" target="tVLiphedjEk2YKl1oAa3-1" edge="1">
            <mxGeometry relative="1" as="geometry" />
          </mxCell>
        </object>
        <object label="Activity" Testattribut="0" id="tVLiphedjEk2YKl1oAa3-4">
          <ag_attributes Testattribut="3" />
          <ag_computed_attributes />
          <ag_aggregation_custom_function ag_aggregation_custom_function="function(c){&#xa;    var result = 0;&#xa;    c.childAttributes.forEach(function(child){&#xa;        result += parseInt(child.attributes[&quot;Testattribut&quot;]);&#xa;    })&#xa;    return {&quot;Testattribut&quot;: result};&#xa;}" />
          <mxCell style="shape=attackgraphs.node;" vertex="1" parent="1">
            <mxGeometry x="210" y="130" width="150" height="75" as="geometry" />
          </mxCell>
        </object>
      </root>
    </mxGraphModel>
    
    opened by Mq89 3
  • Add support to highlight critical paths

    Add support to highlight critical paths

    This PR introduces a feature to highlight critical paths in an attack graph. Aggregtation functions can set a hidden attribute _marking with the ID of the child node to mark the edge from the node to the specified child node. Therefore, the collection object passed to the aggregation functions now includes the ID of all child nodes and the ID of the node itself.

    Markings are only shown if a node is selected. Additionally, it only shows the critical path from the selected node "downwards". The following shows how an examplary marking looks when selecting a node: Attack graph with a critical path marked

    The aggregation functions for the TS 50701 template were updated to include the _marking attribute in aggregations. For the AND function all outgoing edges are marked because it doesn't make sense to mark a specific child node as critical for the worst likelihood/risk. Hence, all outgoing edges are marked to show also the influence of critical nodes below an AND node: Screenshot 2022-08-10 165855

    Note: The aggregation functions for the RKL template shall be updated before merging this PR.

    Closes #57.

    enhancement 
    opened by tobi18991 2
  • Highlight critical paths

    Highlight critical paths

    The child node of each node that is currently responsible for the worst risk should be highlighted or highlightable. This could be done by drawing the respective edge thicker or in a different color (coordinate with #58), or draw the child node with a thicker border. Responsibility is only valid for some logical connections (e.g., OR. For AND it does not make sense as all child nodes contribute to the risk semantically). Responsibility is determined by the aggregation function, thus somehow the API would change to tell Drawio from the aggregation function which edge (or child node) to highlight (is there a way around that?).

    enhancement 
    opened by Mq89 2
  • Attributes Predefined Selection

    Attributes Predefined Selection

    Enable feature for Attribute values to not be freely selected inside of a range, but pre select certain values that then can be selected when values are given.

    duplicate 
    opened by JR-XR 1
  • Start a Changelog and versioning

    Start a Changelog and versioning

    As more and more features keep beeing added, should we start keeping a changelog and introduce version numbers?

    @tobi18991

    If we do, this is the relevant reference:

    • https://keepachangelog.com/en/1.0.0/
    • https://semver.org/

    We should then extend the contex menu to present the version number in addition to the commit hash.

    enhancement 
    opened by Mq89 1
  • Check interference when resizeing or moving a node

    Check interference when resizeing or moving a node

    Resizing and moving attack graph nodes can be very slow in sufficiently large graphs with aggregation functions to be evaluated.

    My uneducated guess is that recalculations or redrawings are triggered to often. Eg., every time the node is moved by 1px (which would be unnecessary). Please have a look at the code. Maybe you can find a cause for the behaviour.

    A strategy could also be to be more conservative with triggering recalculations and instead provide a context menu option to force calculations.

    opened by Mq89 1
  • Bump jgraph/drawio from 18.1.3 to 19.0.2 in /docs

    Bump jgraph/drawio from 18.1.3 to 19.0.2 in /docs

    Bumps jgraph/drawio from 18.1.3 to 19.0.2.

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies docker 
    opened by dependabot[bot] 1
  • Bump jgraph/drawio from 18.1.3 to 19.0.1 in /docs

    Bump jgraph/drawio from 18.1.3 to 19.0.1 in /docs

    Bumps jgraph/drawio from 18.1.3 to 19.0.1.

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies docker 
    opened by dependabot[bot] 1
  • Bump jgraph/drawio from 18.0.1 to 18.0.7 in /docs

    Bump jgraph/drawio from 18.0.1 to 18.0.7 in /docs

    Bumps jgraph/drawio from 18.0.1 to 18.0.7.

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies docker 
    opened by dependabot[bot] 1
  • Reconnecting nodes does not trigger recalculation

    Reconnecting nodes does not trigger recalculation

    Directly moving an edge from one node to another does not update the values in the first node (see video). However dropping the end of the edge somewhere and then attaching it to the other node results in updated values (second part in the video).

    This is valid also for attack step nodes, not only for security controls as in the video.

    Values should also be updated when dragging an edge from one node and dropping it to another.

    https://user-images.githubusercontent.com/4853357/210347898-7168d1ca-0b06-4a2f-b5b6-75fecd46d168.mp4

    opened by Mq89 0
  • Bulk PNG export

    Bulk PNG export

    Enable bulk export for attack graphs to PNG including all diagram pages. In combination with #17 this makes exporting attack graphs for other uses, e.g., to include them in Word documents, much easier. Right now, every page must be exported on its own.

    The idea is to add a sub menu item below Attack Graphs. When clicked, all diagram pages are exported to PNG into a folder that can be chosen by the user, e.g., using the Save as... dialog feature.

    enhancement 
    opened by tobi18991 0
  • Enable enumerations for default attributes

    Enable enumerations for default attributes

    In some cases, attributes can only have specific values assigned to them, e.g., 1,4 or 7. However, arbitrary values can be assigned to attributes via the Edit Data dialog of draw.io.

    Therefore, enable in the DefaultAttributesDialog the option to set an enumeration of possible values. While modeling and changing the data of nodes via the Edit Data dialog, only present the enumeration to users.

    enhancement 
    opened by tobi18991 0
  • Create test cases for new features

    Create test cases for new features

    Extend the already existing test suite to also test for new features included in the plugin.

    The following list enumerates all features that are untested right now (13th Oct 2022). Please check them when test cases exist for them. Also link the corresponding issue if on exists.

    • [ ] #14
    • [ ] #15
    • [ ] #19
    • [ ] #43
    • [ ] #45
    • [ ] #55
    • [ ] #57
    • [ ] #58
    • [ ] AND and OR nodes are labeled

    Please never close this issue to allow tracking of untested functionality!

    opened by tobi18991 0
  • Add feature to disable and enable security measures on the fly

    Add feature to disable and enable security measures on the fly

    While adding security measures to the attack graph, the modeller might be interested in how measures are influencing the attack steps, consequences, and the resulting risk. Adding a feature to disable and enable measures individually while leaving the measures connected to the nodes they mitigate, would ease the analysis.

    enhancement 
    opened by tobi18991 0
Releases(v1.2.0)
  • v1.2.0(Nov 11, 2022)

    2022-11-11

    Added

    • Splitting attack graphs over several pages and linking them together with link nodes
    • Documentation on how to link attack graphs on different pages together

    Fixes and Improvements

    • Exporting attack graphs to PNG does not cut off attack graph nodes anymore
    • Changed computed attributes batch from a bubble to a square
    • Made default attributes, aggregation functions, and computed attributes functions available on every page of a diagram
    • Sensitivity analysis can now operate on diagrams with several pages
    • Update templates for new feature (splitting attack graphs over several diagram pages)
    Source code(tar.gz)
    Source code(zip)
    attackgraphs.js(1.37 MB)
    AttackGraphTemplate_RKL.drawio(25.31 KB)
    AttackGraphTemplate_TS50701.drawio(28.11 KB)
  • v1.1.0(Nov 10, 2022)

    2022-11-10

    Start of keeping a changelog, which is based on Keep a Changelog. This version contains several backwards compatible new features and bug fixes. The versioning of the attack graphs plugin will adhere to Semantic Versioning beginning with this version.

    Added

    • CHANGELOG.md to keep record of future changes to the plugin
    • Semantic versioning (SemVer) starting with this release
    • Version of the plugin shown in the Attack Graphs menu (together with the current hash)
    • Ordering of default attributes can be changed in the Default Attributes... dialog
    • Default aggregation function can be set individually for every attack graph node type
    • Default computed attributes function can be set individually for every attack graph node type
    • Bubble color can be set by computed attributes functions
    • Highlight incoming and outgoing edges of a selected attack graph node
    • Highlight critical paths
    • Progress bar showing whether background worker are still evaluating the graph
    • Set attackgraph shape context menu item to convert selected nodes to attack graph nodes

    Fixes and Improvements

    • Resizing and moving nodes is faster even in larger graphs (in the order of milliseconds)
    • Default attributes are displayed in nodes in the same order as they appear in the Default Attributes... dialog
    • Playwright tests use a Docker container with the web version of draw.io.
    • Improved npm run scripts
    • Nodes do not disappear anymore if attributes have an empty value
    • AND and OR nodes are labeled by default
    • Allow for non-integer edge weights

    Removed

    • Enable Sensitivity Analysis menu item from the Attack Graphs menu
    • Default attributes are not added to white attack step nodes when adding them from the Sidebar.
    Source code(tar.gz)
    Source code(zip)
    attackgraphs.js(1.37 MB)
    AttackGraphTemplate_RKL.drawio(19.89 KB)
    AttackGraphTemplate_TS50701.drawio(24.80 KB)
  • v1.0.0(Nov 10, 2022)

    2022-02-07

    First release of the Attack Graphs Plugin for draw.io.

    Added

    • Shapes for different attack graph node types (Consequence, Attack Step, Security Measure, AND, OR)
    • Icon legend listing default attributes together with their icon
    • Computed attributes functions
    • Aggregation functions
    • Sensitivity Analysis
    • Dialogs for setting the aggregation function and computed attributes function for individual attack graph nodes
    • Global dialog to add, edit, and delete default attributes, aggregation functions, and computed attributes functions
    Source code(tar.gz)
    Source code(zip)
    AttackGraphTemplate.drawio(3.03 KB)
Pretty time-series line graphs

Morris.js - pretty time-series line graphs Morris.js is the library that powers the graphs on http://howmanyleft.co.uk/. It's a very simple API for dr

null 7k Dec 24, 2022
JavaScript toolkit for creating interactive real-time graphs

Rickshaw Rickshaw is a JavaScript toolkit for creating interactive time series graphs, developed at Shutterstock Table of Contents Getting Started Ins

Shutterstock 6.5k Dec 28, 2022
Easy-to-use js library for building graphs using svg.

LineChart Easy-to-use js library for building graphs using svg. Examples How to use Just add linechart.js from 'src' directory to your project. And ad

Korpusov Maxim 8 Nov 21, 2022
JAVASCRIPT library with which you can easily draw CANVAS HTML

easycanvas Quick start Documentation: gaidadei.ru/easycanvas Download: gaidadei.ru/easycanvas/easyc.zip Buy premium: gaidadei.ru/easycanvas/premium (A

null 18 Nov 12, 2022
Chart.js plugin to calculate and draw statistical linear, exponential, power, logarithmic, and polynomial regressions.

chartjs-plugin-regression Chart.js plugin to calculate and draw statistical linear, exponential, power, logarithmic, and polynomial regressions using

Wilfredo Pomier 14 Dec 18, 2022
A lightweight graphic library providing 2d draw for Apache ECharts

ZRender A lightweight graphic library which provides 2d draw for Apache ECharts. Documentation https://ecomfe.github.io/zrender-doc/public/ License BS

Baidu EFE team 5.5k Dec 30, 2022
A repostory of samples, which demonstrates, how to use the 'Power Tools' extension for Visual Studio Code.

vscode-powertools-samples A repository of samples, which demonstrates, how to use the Power Tools extension for Visual Studio Code. Apps data-url-conv

e.GO Mobile 7 Feb 3, 2022
Plug is a browser extension for users of the Internet Computer that allows you to access your ICP, Cycles, and other tokens as well as log into IC apps with one click.

Plug Introduction Welcome to Plug! An Internet Computer crypto wallet and authentication provider as a browser extension. Find our latest version in t

Psychedelic 150 Dec 23, 2022
Bar Funnel Chart extension for Chart.js

Chart.BarFunnel.js Provides a Bar Funnel Chart for use with Chart.js Documentation To create a Bar Funnel Chart, include Chart.BarFunnel.js after Char

Chart.js 58 Nov 24, 2022
A web app that shows visualizations of the most used graphs algorithms such as BFS, DFS, Dijsktra, Minimum spanning tree, etc. It allows you to draw your own graph.

Graph Visualizer Draw your own graphs and visualize the most common graph algorithms This web application allows you to draw a graph from zero, with p

Gonzalo Pereira 31 Jul 29, 2022
This is collection of the CNCF logos packed into a draw.io importable file to draw cloud native architectures

draw-io-cncf-shape This is collection of the CNCF logos packed into a draw.io importable file to draw cloud native architectures How to embed the shap

Jan-Otto Kröpke 10 Dec 26, 2022
Grupprojekt för kurserna 'Javascript med Ramverk' och 'Agil Utveckling'

JavaScript-med-Ramverk-Laboration-3 Grupprojektet för kurserna Javascript med Ramverk och Agil Utveckling. Utvecklingsguide För information om hur utv

Svante Jonsson IT-Högskolan 3 May 18, 2022
Hemsida för personer i Sverige som kan och vill erbjuda boende till människor på flykt

Getting Started with Create React App This project was bootstrapped with Create React App. Available Scripts In the project directory, you can run: np

null 4 May 3, 2022
Kurs-repo för kursen Webbserver och Databaser

Webbserver och databaser This repository is meant for CME students to access exercises and codealongs that happen throughout the course. I hope you wi

null 14 Jan 3, 2023
'Neko Mezashi Attack' - a simple but cute action game made with Vite and TypeScript

'Neko Mezashi Attack' is a simple but cute action game made with Vite and TypeScript. This app is packed all resources including style, graphics and audio into 4KB(4096 chars) JS. No runtime libraries or external resources are required.

yuneco 10 Dec 1, 2022
Browser In The Browser (BITB) attack is a sophisticated phishing and hard to detect.

BITB Browser In The Browser (BITB) attack is a sophisticated phishing and hard to detect. Goto: ?? MacOS-Chrome-DarkMode ?? MacOS-Chrome-LightMode ??

Lục Thiên Phong 18 Dec 4, 2022
This project will be using various AI and Rule Engine algorithm to detect various attack against a company!

?? Introduction This project will be using various AI and Rule Engine algorithm to detect various attack against a website! ?? Mission After starting

Harish S.G 4 Apr 29, 2022
Security tool + attack database used to take quick action against newly-discovered vulnerabilities in the blockchain.

SolidGuard Version: v1.0.1 SolidGuard is a Blockchain Security tool catered towards organizations who manages decentralized applications on the Ethere

Team SolidGuard 4 Jan 3, 2023
Zed Attack Proxy Scripts for finding CVEs and Secrets.

zap-scripts Zed Attack Proxy Scripts for finding CVEs and Secrets. Building This project uses Gradle to build the ZAP add-on, simply run: ./gradlew bu

Sepehrdad 115 Jan 3, 2023
Rainbow Table attack to break zkcrush.xyz and reveal your crush.

ZK-Crush-Break Rainbow Table attack to break zkcrush.xyz and reveal your crush. Background Amir released a project called zkcrush.xyz that allowed a u

Verumlotus 4 Jul 1, 2022