↞
Back to README.md, ↞
Back to Korg.md
As a tool, Korg should be used through the command line (Bash).
The Korg usage is as follows.
python3 Korg.py --model=$1
--phi=$2
--Q=$3
--IO=$4
--max_attacks=$5
--with_recovery=$6
--name=$7
--characterize=$8
--dir=$9
We break down these arguments below. Required parameters are marked with a , while optional parameters are marked with a . Arguments may be given in any order.
$1
is the system model, e.g., TCP.pml
.
P
in the paper. $2
is the property the attacker wants to violate, e.g., phi1.pml
.
Φ
in the paper, and should be written in linear temporal logic. $3
is the vulnerable process that the attacker will replace, e.g., network.pml
.
Q
in the paper in the centralized-attacker case, as in, TM = (P, (Q), Φ)
.TM = ($1, ($3), $2)
. $4
is the IO
file.
Q
) can receive or send and over what channels. For example, see IO.txt
. $5
is the maximum number of attackers Korg should synthesize.
--max_attacks=10
. $6
is True
if you want to solve the R∃ASP
(that is, the ∃-problem with recovery), or False
if you want to solve the ∃ASP
(that is, the ∃-problem without recovery). Defaults to False
(meaning, EASP
).
$7
is the name you want to be used for the folder in out/
where all the outputs will be written.
InterpretingOutputs.md
. $8
is True
if you want to have artifacts generated with which to assess the quality and type of your synthesized attackers, or False
if you do not want to generate these artifacts. Defaults to False
.
InterpretingOutputs.md
. Note that setting this to True
will slow down Korg, possibly by quite a lot (as in TM_3
in the paper, which corresponds to phi3.pml
). I usually tun the experiment with this False
first, and then try again with it True
. $9
is a path to a directory containing phi.pml
, P.pml
, Q.pml
, and IO.txt
. If you provide this then you do not need to provide $1
, $2
, $3
, or $4
.
The syntax of the IO file is:
chan1:
I:a1,a2,...
O:b1',b2',...
chan2:
I:c1,c2,...
O:d1,d2,...
...
In other words, for each channel that the process can communicate over, you have a new line
:
followed by a newline and a tab, then I:
and a comma-seperated list of the inputs the process can hear over , followed by a newline and then a tab and then O:
and a comma-seperated list of the outputs the process can send over .
We assume that when you provide Korg with an interface, it is the interface of the Q
argument, however, we do not computationally enforce this assumption. (Your results might not make sense if this assumption is not met.)
Korg can be used as a Python library.
from Korg import *
The best way to see how to do this is to look at the unit tests, e.g., test_Korg.py
, which do exactly this.