Skip to content

fix(security): ship a NetworkPolicy and drop the ingress template - #16

Open
safts wants to merge 1 commit into
mainfrom
fix/edge-129-networkpolicy
Open

safts wants to merge 1 commit into
mainfrom
fix/edge-129-networkpolicy

Conversation

@safts

@safts safts commented Oct 1, 2026

Copy link
Copy Markdown

Summary

Chart half of NOFireAI/edge#129. The agent's HTTP port had a ClusterIP Service and no NetworkPolicy, and examples/production-values.yaml enabled an nginx Ingress on / that would publish /graph to the internet.

  • New templates/networkpolicy.yaml, on by default (networkPolicy.enabled). It allows ingress to the agent pod only on config.serverPort and service.dnstapPort, with sources set in networkPolicy.httpFrom / dnstapFrom (default: any). Egress is not restricted. It excludes edge-proxy pods so their metrics port keeps working.
  • Remove templates/ingress.yaml and the ingress: values; the template only ever targeted the agent's HTTP port.
  • examples/production-values.yaml: drop the Ingress block and both webhook.site URLs.
  • Chart 0.5.2 → 0.6.0 (values removed).

Testing

helm lint (default and production values), helm template with the policy on, off and with source lists, kubeconform -strict (k8s 1.30): 14 valid, 0 invalid.

Notes

  • Deploys safely in either order with https://github.com/NOFireAI/edge/pull/149. A new chart with an old image still exposes /graph in-cluster on 8080; the protection is complete once both ship.
  • Breaking for anyone who set ingress.enabled.

Written with AI assistance (Claude Code).


Refs NOFireAI/edge#129, https://github.com/NOFireAI/edge/pull/149

The agent's HTTP port served the full resource graph, a pod-cache debug
endpoint and a log-level setter with no auth, and the production
example put that port on the internet through an nginx Ingress on `/`.
NOFireAI/edge#129 moves those endpoints to a loopback-only admin port,
leaving only /healthz and /metrics on the Service port.

Add a NetworkPolicy, enabled by default, that admits ingress to the
agent pod only on config.serverPort (kubelet probes, Prometheus) and
service.dnstapPort (CoreDNS dnstap). Egress is left open. Peers per
port are configurable and default to any source. The pod selector
excludes edge-proxy pods: they share the name/instance labels and
carry a component label, and the policy would otherwise cut off their
8081 metrics.

Delete templates/ingress.yaml and the ingress values. It only ever
targeted the agent's HTTP port, whose only remaining content is
health and metrics. Remove the Ingress block and the webhook.site
publisher URLs from examples/production-values.yaml.

Bump the chart to 0.6.0: the ingress.* values are removed.

Refs NOFireAI/edge#129

Signed-off-by: Sergios Aftsidis <sergios@nofire.ai>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant