View on GitHub

Attack Graphs Plugin for

An Attack Graphs Extension for

Aggregation Functions

This plugin allows to specify an aggregation function for any shape in the diagram. The user can access the aggregation function of a cell by clicking the handle displayed on the left-hand side of the cell.

image of cell handles

Aggregation functions take attributes of connected child cells and return the resulting attributes to the cell. There can be a default aggregation function, which will be used by default by new cells. A default aggregation function can be defined by naming a function default in the global aggregation function dialog. If no default function was specified, cells will use the None function and will not calculate aggregated attributes.

When clicking on the eye-icon displayed on the lower right-hand side of the cell, the cell can be disabled and re-enabled. If the cell is disabled (slashed eye), its values are not considered by parent cells, effectively disconnecting it from its parents.

The aggregation function dialog allows to specify a custom aggregation function or to select a global aggregation function by reference.


Predefined Properties

The following properties have a predefined meaning if they are included in the returnd object:


Indicates which outgoing edges shall be marked.

Expected value (RegEx): ^{CHILD_ID}(;{CHILD_ID})*$.

For instance, 123;456 and 123 are allowed values but not ;123 and ;.


Indicates new edge weights for outgoing edges.

Expected value (RegEx): ^{CHILD_ID}:{WEIGHT}(;{CHILD_ID}:{WEIGHT})*$.

For instance, 123:A;456:B and 123:C are allowed values but not ;123:A, ;, and 123;456:A.

Relevant data types

type KeyValuePairs = { [k: string]: string }
type GlobalAttributeDict = { [name: string]: GlobalAttribute}

type GlobalAttribute = {
  name: string,
  value: string,
  min: string,
  max: string,

type ChildCellData = {
  edgeWeight: string | null,
  attributes: KeyValuePairs,
  computedAttribute: string,
  id: string

type ChildCellDataCollection = {
  globalAttributes: GlobalAttributeDict,
  childAttributes: ChildCellData[],
  localAttributes: KeyValuePairs,
  id: string

Example of an aggregation function accessing a child’s attribute’s value

    return {'Name': collection.childAttributes[0].attributes['AttributeName'};

Example of an aggregation function accessing a child’s edge weight

    return {'Name': collection.childAttributes[0].edgeWeight};

Example of an aggregation function accessing a child’s label value

    return {'Name': collection.childAttributes[0].computedAttribute};

Example of an aggregation function accessing global attributes:

    return {'Name': collection.globalAttributes['AttributeName'].max};

Testing functions

To write working js functions more easily, you can use the provided Testbench.js file. It provides example data structured in the way aggregation functions and computed attributes functions will receive the data in an AttackGraph.

It is recommended to copy the code into the debugger of your choice, or an online tool like JSFiddle for better debugging functionality.