攻击(防御)树的实现。
adtrees的Python项目详细描述
adtrees
使用attack trees实现一些安全性定性和定量评估方法
以及attack-defense trees。
该包打算与ADTool一起使用,但这不是必需的。
先决条件
利用lp_solve求解攻防树优化问题。有关lp_solve的安装,请参见Using lpsolve from Python。有关lp_solve的一般信息可以在here中找到。
对于adtrees
的其余功能没有特殊的先决条件。
安装
pip install adtrees
示例
importadtreesasadt# initialize attack(-defense) tree from an output file 'tree.xml' produced by the ADToolT=adt.ADTree('tree.xml')# create a basic assignment of cost for the basic actions of the defender in Tba=adt.BasicAssignment()forbinT.basic_actions('d'):ba[b]=10# create an instance of the 'maximal coverage' optimization problemproblem=adt.ADTilp(T,costassignment=ba,budget=100,problem='coverage')# solve the problemproblem.solve()# the optimal set of countermeasures and some additional information is displayed
有关其他功能和更多详细信息,请参阅examples folder中的演练示例。