Skip to main content

Implementation of attack(-defense) trees.

Project description

adtrees implements some methods for qualitative and quantitative evaluation of security using attack trees and attack-defense trees.

The package is intended to be used together with the ADTool, but this is not obligatory.


Optimization problems on attack-defense trees are solved using lp_solve. For the installation of lp_solve, see Using lpsolve from Python. General information on lp_solve can be found here.

No special prerequisites for the remaining functionalities of adtrees.


pip install adtrees


import adtrees as adt

# initialize attack(-defense) tree from an output file 'tree.xml' produced by the ADTool
T = adt.ADTree('tree.xml')

# create a basic assignment of cost for the basic actions of the defender in T
ba = adt.BasicAssignment()
for b in T.basic_actions('d'):
    ba[b] = 10

# create an instance of the 'maximal coverage' optimization problem
problem = adt.ADTilp(T, costassignment=ba, budget=100, problem='coverage')

# solve the problem

# the optimal set of countermeasures and some additional information is displayed

For other functionalities and more details, refer to the walk-through examples in examples folder.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for adtrees, version 0.0.6
Filename, size & hash File type Python version Upload date
adtrees-0.0.6-py3-none-any.whl (32.7 kB) View hashes Wheel py3
adtrees-0.0.6.tar.gz (27.7 kB) View hashes Source None

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page