Skip to main content

SKY-D410 · Deployment and infrastructure

Kubernetes pod shares the node's process, IPC or network namespace

High

Namespaces are how Linux keeps a container's processes, shared memory and network separate from the host. SKY-D410 reports a Kubernetes pod spec that sets hostPID, hostIPC or hostNetwork to true, which puts the pod in the node's own namespace.

Languages
Kubernetes YAML
Quality gate
counted toward the gate limits (full and diff scans). Reported under security (danger). It counts toward max_high and max_security; the rule never reports CRITICAL.
Finding type
review
Catalog name
Kubernetes host namespace access
Wrong result? Report itA false positive, a missed case or a confusing message: it goes privately to the founder.

Why it matters

With hostPID the pod sees and can signal every process on the node, and can read their environment variables and secrets. With hostNetwork it can reach services bound to the node's localhost and sniff its traffic. Each one removes a wall an attacker would otherwise have to break.

What Skylos flags

deploy/node-agent.yaml · YAMLReported on line 15
apiVersion: apps/v1kind: DaemonSetmetadata:  name: node-agent  namespace: monitoringspec:  selector:    matchLabels:      app: node-agent  template:    metadata:      labels:        app: node-agent    spec:      hostPID: true      containers:        - name: agent          image: registry.example.com/node-agent:2.4.1

What Skylos leaves alone

deploy/node-agent.yaml · YAML
apiVersion: apps/v1kind: DaemonSetmetadata:  name: node-agent  namespace: monitoringspec:  selector:    matchLabels:      app: node-agent  template:    metadata:      labels:        app: node-agent    spec:      shareProcessNamespace: true      containers:        - name: agent          image: registry.example.com/node-agent:2.4.1

Why Skylos leaves it alone

shareProcessNamespace lets the containers of this pod see each other's processes, for example for a debugging sidecar. It does not reach the node's processes.

How Skylos decides

  1. Runs with --danger (or -a). Reads every .yaml and .yml file that declares an apiVersion and a kind, skipping .git, node_modules, build and virtual-environment folders. It never renders Helm templates or Kustomize overlays and never contacts a cluster.
  2. Checks the pod spec of Pod, PodTemplate, ReplicationController, Deployment, DaemonSet, ReplicaSet, StatefulSet, Job and CronJob, including items of a v1 List. Values containing template markers such as {{ or ${ are treated as unknown and never reported.
  3. Checks hostPID, hostIPC and hostNetwork in the pod spec.
  4. Reports each one that is the boolean true, as its own finding, HIGH, on that line. false or a missing value pass; a value that is not a boolean is not judged.

How to fix it

Remove the flag. A monitoring agent that needs node metrics can usually read them from /proc through a read-only mount, or from the kubelet's metrics endpoint.

deploy/node-agent.yaml · YAML · the fix, against the flagged file
apiVersion: apps/v1kind: DaemonSetmetadata:  name: node-agent  namespace: monitoringspec:  selector:    matchLabels:      app: node-agent  template:    metadata:      labels:        app: node-agent    spec:Removed:       hostPID: true      containers:        - name: agent          image: registry.example.com/node-agent:2.4.1

When it can be wrong

  • Node-level agents such as CNI plugins, kube-proxy and some monitoring agents need hostNetwork or hostPID by design.
  • hostPort on a container port also exposes the pod on the node, but it is not a namespace setting and is not reported.
  • Helm chart templates are not rendered. A value written as {{ .Values.x }} is not judged, and a template file that is not valid YAML on its own (most are not) stops the scan as incomplete, exit 2, with a Kubernetes parse error. Exclude the chart's templates folder and scan the output of helm template instead.

Seeing a case that isn't listed here? Report the wrong result so the rule can be fixed. Don't paste company code: describe the shape of it.

How to silence it

  • The Kubernetes rules read no inline marker: # skylos: ignore[SKY-D410] on the reported line does not hide the finding.

  • [tool.skylos] ignore = ["SKY-D410"] turns the rule off for the project.

  • A baseline (skylos baseline ., then --baseline) accepts the workloads that exist today and reports new ones.

From the Skylos rule handbook, Skylos 5.8.0 (commit 5b880b0). All rules.