feat: add initial setup wizard, workload insights, and policy audit mode
Add setup wizard with status tracking via SystemSetting model, implement /setup/status and /setup/complete endpoints to create initial admin user and optional cluster configuration, add workload insights endpoint with traffic analysis and policy matching including audit mode detection, implement enforcement_mode property on Policy model with audit/enforced states, add Modal component for dialogs, create SetupWizard page with multi
This commit is contained in:
@@ -11,6 +11,7 @@ class PolicyEngine:
|
||||
service = definition.get("service", {"protocol": "any", "ports": "any"})
|
||||
action = definition.get("action", "allow")
|
||||
direction = definition.get("direction", "ingress")
|
||||
enforcement_mode = definition.get("enforcement_mode", "enforced")
|
||||
|
||||
generated_rule = {
|
||||
"policy_id": policy.id,
|
||||
@@ -21,6 +22,8 @@ class PolicyEngine:
|
||||
"ports": service.get("ports", "any"),
|
||||
"direction": direction,
|
||||
"action": action,
|
||||
"enforcement_mode": enforcement_mode,
|
||||
"audit_only": enforcement_mode == "audit",
|
||||
"logging": bool(definition.get("logging", False)),
|
||||
"description": definition.get("description", policy.name),
|
||||
}
|
||||
@@ -32,4 +35,3 @@ class PolicyEngine:
|
||||
warnings.append("Broad allow policy uses all ports.")
|
||||
|
||||
return {"rules": [generated_rule], "warnings": warnings, "conflicts": []}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user