Skip to content

[REVIEW] segmentation: add service-mesh bypass and host-network gates #1916

@wangedmund77-cmyk

Description

@wangedmund77-cmyk

Skill Being Reviewed

Skill name: segmentation
Skill path: skills/network/segmentation/SKILL.md

False Positive Analysis

Benign code/config that can be over-flagged:

namespace=payments
default_deny_network_policy=true
istio_peer_authentication=STRICT
pods_hostNetwork=false
sidecar_injection=required

Why this is a false positive:
A Kubernetes namespace with strict mTLS, default-deny policy, and no host-network pods should not be scored as flat simply because services share a cluster. The assessment should verify mesh and network-policy enforcement before flagging co-residency.

Coverage Gaps

Missed variant 1:

Pod runs with hostNetwork or hostPort and bypasses service mesh sidecar policy, reaching node or VPC resources outside intended namespace segmentation.

Why it should be caught:
This creates a lateral path that ordinary namespace-level service-mesh policy may not control.

Missed variant 2:

Namespace has Istio AuthorizationPolicy, but no Kubernetes default-deny NetworkPolicy, so traffic that bypasses the sidecar or targets non-mesh workloads remains open.

Why it should be caught:
Mesh policy and network policy are complementary; relying on one without the other leaves bypass paths.

Edge Cases

Init containers, CNI failures, debug pods, node-local services, and DaemonSets can legitimately need different paths. They require explicit exceptions, owner, expiry, and evidence that host-level routes cannot reach protected zones.

Remediation Quality

  • Fix resolves the vulnerability
  • Fix doesn't introduce new security issues
  • Fix doesn't break functionality
  • Issues found: Add gates for hostNetwork/hostPort use, sidecar injection coverage, mTLS strictness, default-deny NetworkPolicy, CNI enforcement status, node-local bypass paths, and exception expiry.

Comparison to Other Tools

Tool Catches this? Notes
Istio/Linkerd policy Partial Enforces mesh traffic but may not cover host-network or non-mesh paths.
Kubernetes NetworkPolicy Partial Controls pod traffic if CNI supports it, but not all host-level flows.
Cilium/Calico Partial Can enforce both, but configuration evidence must be checked.

Overall Assessment

Strengths:
The skill already covers zones, east-west traffic, Kubernetes NetworkPolicy, Calico, Cilium, and service mesh readiness.

Needs improvement:
It should explicitly test mesh bypass paths where workload identity policy and network enforcement diverge.

Priority recommendations:

  1. Add a service-mesh bypass checklist to intra-zone evaluation.
  2. Require default-deny network policy and sidecar coverage evidence together.
  3. Track hostNetwork/hostPort exceptions with owner, expiry, and allowed destination.

Bounty Info

  • I have read and agree to the CONTRIBUTING.md bounty terms
  • Preferred payment method: Crypto or PayPal after maintainer acceptance.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions