Remediation scope
kimera generate writes NetworkPolicy remediation either for the one workload an exploit ran from or for the whole namespace. Targeted scope constrains only the source workload. Namespace scope constrains every pod.
Choosing the scope
Section titled “Choosing the scope”kimera -n unguard exploit missing-network-policies --json > findings.jsonkimera -n unguard generate --from-findings findings.json # targeted scope--scope takes targeted or namespace. It defaults to targeted when --from-findings is given and to namespace otherwise. --scope targeted without findings exits non-zero.
The findings must come from the namespace given with -n, and their source workload must still exist there. Otherwise generation stops.
--scope applies to remediation only. --mode exploit ignores it.
DENY, KEEP and REVIEW
Section titled “DENY, KEEP and REVIEW”With findings, every observed path from the source workload is classified and printed before the set is written. The first rule that matches decides.
- A path whose result is unknown is listed as not measured and left unclassified.
- Port 53 is KEEP, because every targeted set permits DNS.
- A destination declared for the source in
network_topologyis KEEP. - An undeclared data-store port (3306, 5432, 6379, 27017) is DENY.
- A destination outside the namespace is DENY.
- Any other in-namespace destination is REVIEW. It is denied and listed for a decision; declaring it and regenerating keeps it.
A source’s declared dependencies are the workloads whose allowed_ingress_from selectors match the source’s labels.
Targeted enforcement
Section titled “Targeted enforcement”The model’s output is reduced to what the finding justifies, and every change is logged as a warning:
- Documents that are not NetworkPolicies are dropped.
- A policy with no
matchLabels, which would select every pod, is dropped. Targeted scope emits no default-deny. - A policy selecting another workload is dropped.
- If no policy selects the source, one is built.
The egress of the first remaining policy is then replaced with DNS, the declared dependencies on their ports, and the declared external destinations. Nothing else is permitted.
Only that first policy is rewritten. If the model emits a second policy selecting the source, its egress rules stay as written, and NetworkPolicy egress rules add up. Ingress rules stay as the model wrote them.
Namespace scope
Section titled “Namespace scope”Namespace scope keeps the full set the model writes. For missing-network-policies and all, a deterministic pass adds egress rules for declared flows the set denies and for declared external destinations.
Network topology
Section titled “Network topology”network_topology in a profile drives generation. The map key names the workload an entry applies to.
network_topology: unguard-mariadb: allowed_ingress_from: # omit the key to leave ingress undeclared; - {app.kubernetes.io/name: like-service} # an empty list means block all ingress unguard-user-simulator: allowed_egress_to: # destinations outside the namespace - cidr: 0.0.0.0/0 except: [10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16, 169.254.169.254/32] ports: [80, 443] protocol: TCPallowed_ingress_fromis a list of pod label selectors. An omitted key leaves ingress undeclared. An empty list blocks all ingress.allowed_egress_tolists destinations outside the namespace. Each has acidr, an optionalexceptlist, at least one port in 1 to 65535, andprotocolTCPorUDP(defaultTCP).
A workload with an external dependency needs allowed_egress_to, or a default-deny set severs it. The workload then fails to start while every app-to-app flow still passes, which can be mistaken for a segmentation failure. Nothing is inferred: an undeclared destination is not permitted.
kimera validate-control --type network-policy reports a declared flow that the applied set severs as ERROR. The defense validation page lists the checks.
Applying the result
Section titled “Applying the result”generate writes kimera-remediations.yaml by default and applies nothing. --apply applies the file after a confirmation prompt, which --yes or --dry-run skips. kimera apply <file> applies an existing file.
The applier creates NetworkPolicies only and skips other kinds. It adds the label app.kubernetes.io/managed-by: kimera and fills in the namespace when it is missing. Each apply is recorded in the operation journal.
kimera revert removes applied policies by that label. It deletes every Kimera-labelled NetworkPolicy in the namespace, including policies from earlier runs. The safety model describes the journal.
All product names and logos are trademarks of their respective owners, used for identification only. No endorsement is implied.
