-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpolicy_engine.py
More file actions
27 lines (24 loc) · 890 Bytes
/
Copy pathpolicy_engine.py
File metadata and controls
27 lines (24 loc) · 890 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
def get_policy_for_decision(classification: str, risk_score: int, entities: list) -> dict:
"""
Leitet aus Klassifikation, Risk-Score und Entitäten die Policy ab.
"""
policy = {
"encrypt": False,
"target_dir": None,
"log_only": False,
}
if classification == "PUBLIC":
policy["log_only"] = True
elif classification == "INTERNAL":
policy["log_only"] = True
elif classification == "CONFIDENTIAL":
policy["encrypt"] = True
policy["target_dir"] = "SecureArchive/CONFIDENTIAL"
elif classification == "HIGHLY_CONFIDENTIAL":
policy["encrypt"] = True
policy["target_dir"] = "SecureArchive/HIGHLY_CONFIDENTIAL"
if risk_score >= 85:
policy["encrypt"] = True
if policy["target_dir"] is None:
policy["target_dir"] = "SecureArchive/HIGH_RISK"
return policy