Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

False positives negatives rate #67

Open
wants to merge 13 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add testdata
mrkickling committed Oct 21, 2024
commit 151f4fbe72124c49e93795366dd269aed6916d38
8 changes: 5 additions & 3 deletions tests/test_scenario.py
Original file line number Diff line number Diff line change
@@ -277,14 +277,16 @@ def test_load_scenario_false_positive_negative_rate():
fp_base_rate = 0.1
fn_base_rate = 0.1
host_0_access_fp_rate = 0.2
host_1_access_fn_rate = 0.3
host_1_access_fp_rate = 0.3
host_0_access_fn_rate = 0.4
host_1_access_fn_rate = 0.5

for node in attack_graph.nodes:
if node.full_name == "Host:0:access":
assert node.extras['false_positive_rate'] == host_0_access_fp_rate
assert node.extras['false_negative_rate'] == fn_base_rate
assert node.extras['false_negative_rate'] == host_0_access_fn_rate
elif node.full_name == "Host:1:access":
assert node.extras['false_positive_rate'] == fp_base_rate
assert node.extras['false_positive_rate'] == host_1_access_fp_rate
assert node.extras['false_negative_rate'] == host_1_access_fn_rate
else:
assert node.extras['false_positive_rate'] == fp_base_rate
8 changes: 5 additions & 3 deletions tests/testdata/scenarios/traininglang_fp_fn_scenario.yml
Original file line number Diff line number Diff line change
@@ -20,13 +20,15 @@ attacker_entry_points:
attacker_agent_class: 'BreadthFirstAttacker'
defender_agent_class: 'KeyboardAgent'

# Baseline
# Baseline applies to all attack steps
false_positive_base_rate: 0.1
false_negative_base_rate: 0.1

# Specific fpr/fnr for some steps
# Specific fpr/fnr for some specific steps
false_positive_rates:
'Host:0:access': 0.2
'Host:1:access': 0.3

false_negative_rates:
'Host:1:access': 0.3
'Host:0:access': 0.4
'Host:1:access': 0.5