# Amlsec | Automated Security Risk Identification Using AutomationML-based Engineering Data

**URL:** <https://onehack.st/t/amlsec-automated-security-risk-identification-using-automationml-based-engineering-data/199111>\
**Category:** Tools & Scripts\
**Tags:** tools, programming\
**Created:** [August 24, 2021, 9:24pm UTC](https://onehack.st/t/amlsec-automated-security-risk-identification-using-automationml-based-engineering-data/199111 "2021-08-24T21:24:48Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![TheStrength](https://onehack.st/user_avatar/onehack.st/thestrength/32/46753_2.png) [@TheStrength](https://onehack.st/u/TheStrength)\
**Post date:** [August 24, 2021, 9:24pm UTC](https://onehack.st/t/amlsec-automated-security-risk-identification-using-automationml-based-engineering-data/199111/1 "2021-08-24T21:24:48Z")

</div>

[![Cyber-Physical Attack Graph](https://github.com/sbaresearch/amlsec/raw/master/amlsec-base-dir/pruned_ag.svg?sanitize=true)](https://github.com/sbaresearch/amlsec/blob/master/amlsec-base-dir/pruned_ag.svg?sanitize=true)

# Automated Security Risk Identification Using AutomationML-based Engineering Data

This prototype identifies security risk sources (i.e., threats and vulnerabilities) and types of attack consequences based on AutomationML (AML) artifacts. The results of the risk identification process can be used to generate cyber-physical attack graphs, which model multistage cyber attacks that potentially lead to physical damage.

## Installation

1. Build AML2OWL

This prototype depends on a forked version of the [implementation of the bidirectional translation between AML and OWL](https://github.com/sbaresearch/ETFA2019) for the ETFA 2019 paper [“Interpreting OWL Complex Classes in AutomationML based on Bidirectional Translation”](https://arxiv.org/abs/1906.04240) by Hua and Hein. Clone the [repository](https://github.com/sbaresearch/ETFA2019), compile the projects, and assemble an application bundle of `aml_owl`:

```auto
$ cd aml_models
$ mvn clean compile install
$ cd ../aml_io
$ mvn clean compile install
$ cd ../aml_owl
$ mvn clean compile install assembly:single

```

1. Setup the AMLsec Base Directory

Clone this repository, create the application base directory (usually located in the user’s home directory), and place the files located in [amlsec-base-dir](https://github.com/sbaresearch/amlsec/blob/master/amlsec-base-dir) and the assembled AML2OWL JAR (located in `aml_owl/target/`) there. The AMLsec base directory and the path to the AML2OWL JAR must be set in the [configuration file](https://github.com/sbaresearch/amlsec/blob/master/amlsec/src/main/resources/application.conf) using the keys `baseDir` and `amlToOwlProgram`, respectively.

1. Setup Apache Jena Fuseki

Install and start [Apache Jena Fuseki](https://jena.apache.org/documentation/fuseki2/):

```auto
$ java -jar <path_to_apache-jena-fuseki-X.Y.Z>/fuseki-server.jar --update

```

1. Build AMLsec

Finally, build and start the app by using [sbt](https://www.scala-sbt.org/).

```auto
$ sbt "runMain org.sba_research.worker.Main"

```

## Usage

The implemented method utilizes a semantic information mapping mechanism realized by means of AML libraries. These [AML security extension libraries](https://github.com/sbaresearch/amlsec/tree/master/amlsec-libs) can be easily reused in engineering projects by importing them into AML files.

The capabilities of this prototype are demonstrated in a [case study](https://github.com/sbaresearch/amlsec/blob/master/amlsec-base-dir/case-study/CaseStudy_A.aml). Running this prototype as is will yield the knowledge base (can be accessed via Fuseki), which also includes the results of the risk identification process, and the following pruned cyber-physical attack graph:

[![Cyber-Physical Attack Graph](https://github.com/sbaresearch/amlsec/raw/master/amlsec-base-dir/pruned_ag.svg?sanitize=true)](https://github.com/sbaresearch/amlsec/blob/master/amlsec-base-dir/pruned_ag.svg?sanitize=true)

### Cluster

The prototype utilizes the [Akka](https://akka.io/) framework and is able to distribute the risk identification workload among multiple nodes. The [Akka distributed workers sample](https://github.com/akka/akka-samples/tree/2.6/akka-sample-distributed-workers-scala) was used as a template.

To run the cluster with multiple nodes:

1. Start Cassandra:

```auto
$ sbt "runMain org.sba_research.worker.Main cassandra"

```

1. Start the first seed node:

```auto
$ sbt "runMain org.sba_research.worker.Main 2551"

```

1. Start a front-end node:

```auto
$ sbt "runMain org.sba_research.worker.Main 3001"

```

1. Start a worker node (the second parameter denotes the number of worker actors, e.g., 3):

```auto
$ sbt "runMain org.sba_research.worker.Main 5001 3"

```

If you run the nodes on separate machines, you will have to adapt the Akka settings in the [configuration file](https://github.com/sbaresearch/amlsec/blob/master/amlsec/src/main/resources/application.conf).

## Performance Assessment

The measurements and log files obtained during the performance assessment are available upon request.

## GitHub:

> **[GitHub - sbaresearch/amlsec: Automated Security Risk Identification Using...](https://github.com/sbaresearch/amlsec)**
>
> Automated Security Risk Identification Using AutomationML-based Engineering Data
