netatlas Star on GitHub

Open workloads: what no policy restricts

An open workload is one that no policy restricts: any caller that its DENY and CUSTOM policies do not refuse may reach it. No NetworkPolicy restricts who may call it, and no Istio ALLOW AuthorizationPolicy does. netatlas finds the open workloads of every cluster, marks them on the Policy map, and starts the Overview's list of what needs attention with the open ones that have critical or high vulnerabilities.

What makes a workload open

A workload is open when neither layer restricts who may call it. The NetworkPolicy layer restricts nothing when no NetworkPolicy selects the workload for ingress, or when the ones that select it let any caller in on every port: their rules with no peers together cover every port, which the Policy map marks any caller on every port. The Istio layer restricts nothing when no ALLOW AuthorizationPolicy selects the workload, or when one that selects it has a rule that matches every request, an empty rule (rules: [{}]): ALLOW policies add up, so that rule lets every request in whatever the others say. Istio then lets in every request that the workload's DENY and CUSTOM policies do not refuse, so a workload that only such policies select is open too. A workload whose only NetworkPolicy restricts egress is open.

  • An ALLOW AuthorizationPolicy counts only for a workload in the mesh. A workload with no Istio proxy cannot enforce one, so it stays open even when an ALLOW policy selects it, and its panel on the Policy map says Istio not enforced.
  • netatlas counts the policies that select a workload, not what enforces them. The Overview's enforcer column says which network plugin netatlas found, and none found: policies may not be enforced when it found none.

Where netatlas shows them

  • Overview: a column counts each cluster's open workloads, and the list of what needs attention starts with the open and vulnerable ones (The Overview).
  • Policy map: an open workload's box is drawn as open and marked, the workload panel says why it is open, and the count is above the map (Open workloads on the map).
  • Traffic: the box under the workload's name says 2 pods · open, or 1 pod · not in the mesh · open for a workload with no proxy (The Traffic view).
  • Findings: each row has an open mark, and the filter Open only keeps the open workloads (The Workloads tab).

Open and vulnerable

A workload is open and vulnerable when it is open and has a critical or high vulnerability in its own containers. The Policy map and the Traffic view mark it open and vulnerable, its panel on the Policy map shows its findings, and the Overview counts it. When Kubescape stops answering, the marks and the count stay, from the last findings read, and each says when they were read: the panel's state line on the map reads Kubescape is not answering; findings read at 14:01, the Overview's item adds Findings read at 14:01., and both maps' legends follow the line for the mark with Kubescape is not answering; the marks are from the findings read at 14:01.

While no workload can carry the mark, each legend replaces the line for it with the reason:

  • No workload is marked open and vulnerable yet: netatlas is reading Kubescape.
  • No workload is marked open and vulnerable: Kubescape is not installed in this cluster.
  • No workload is marked open and vulnerable: netatlas may not read Kubescape's results here.
  • No workload is marked open and vulnerable: Kubescape is not answering., when no findings were read before it stopped.

Open and vulnerable needs Kubescape's results in the cluster (Install Kubescape). Without them netatlas still marks the open workloads, but cannot mark any as vulnerable.

Closing an open workload

A workload stops being open when either layer restricts who may call it: a NetworkPolicy selects it for ingress and the rules with no peers of the NetworkPolicies that select it do not together cover every port, or, for a workload in the mesh, an ALLOW AuthorizationPolicy selects it and none of those has an empty rule. Either one blocks every caller that none of its rules names, so list the callers first. The Traffic view shows which callers made calls in the last 5 minutes (Traffic).

netatlas edits a NetworkPolicy that exists and creates none, so write the new policy yourself and apply it with kubectl or from git (What the editor does not do). Kubernetes describes the fields in Network policies. netatlas watches NetworkPolicies and AuthorizationPolicies, so the mark goes once it sees the new policy.

When netatlas cannot tell

  • netatlas calls no workload open while it may not read the policies that could restrict it (A kind netatlas may not read).
  • netatlas does not evaluate a policy attached by targetRef or targetRefs, so such a policy does not close a workload: a workload that only such a policy restricts shows as open. The panels of the workloads in the policy's own namespace name it as one netatlas does not evaluate, and so does every panel when the policy is in the mesh's root namespace and names a GatewayClass. A workload that uses a waypoint of another namespace is not told about that waypoint's policies (What the map does not show yet).