Skip to content

feat(helm): [NSoC_2026] tighten worker pod egress rules and document required endpoints (#1767) - #1805

Merged
GauravKarakoti merged 1 commit into
GauravKarakoti:mainfrom
Myparadox-creator:feat/helm-worker-egress-rules-1767
Nov 16, 2026
Merged

GauravKarakoti merged 1 commit into
GauravKarakoti:mainfrom
Myparadox-creator:feat/helm-worker-egress-rules-1767

Conversation

@Myparadox-creator

Copy link
Copy Markdown
Contributor

Description

Summary of Changes

Resolves #1767 by hardening the Kubernetes Helm chart deployment configuration with tightened, zero-trust egress rules for backend worker pods and comprehensively documenting required egress destinations in the deployment guides.

  1. Helm Chart Network Policy Updates (helm/secureflow/templates/networkpolicy.yaml):

    • Extended the *-worker-egress NetworkPolicy to support explicit whitelistedEndpoints entries, allowing operators to configure designated API endpoints (e.g., LLM providers, container registries, VCS APIs) with specific CIDR blocks and destination TCP ports.
    • Preserves strict default-deny isolation: when networkPolicy.enabled: true, external egress is blocked by default; only DNS (kube-dns), same-release PostgreSQL/Redis (when enabled), and explicitly configured endpoints are permitted.
    • Enforces canonical IPv4 CIDR validation via secureflow.publicEgressBlock, strictly rejecting dangerous private ranges (10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16) and cloud instance metadata addresses (169.254.169.254/32, 168.63.129.16/32).
    • Added support for extraEgressRules allowing custom Kubernetes NetworkPolicy egress rule objects (e.g. for private VPC database subnets or proxy gateways).
  2. Values & Schema Validation (helm/secureflow/values.yaml & values.schema.json):

    • Updated networkPolicy.workerEgress in values.yaml with whitelistedEndpoints and extraEgressRules production examples and documentation comments.
    • Enhanced values.schema.json with strict schema validation for whitelistedEndpoints (requiring name and regex-validated IPv4 cidrs, validating destination ports in range 1..65535) and extraEgressRules.
  3. Chart Verification Tests (scripts/test-helm-chart.sh):

    • Added contract tests verifying whitelistedEndpoints renders destination CIDRs and custom ports accurately in the worker egress NetworkPolicy.
    • Added negative tests verifying unsafe private/metadata CIDRs are rejected with template failure.
    • Added schema validation tests confirming invalid ports (0, 65536) and missing required fields in whitelistedEndpoints fail validation.
  4. Comprehensive Deployment Guide Documentation (helm/secureflow/README.md & docs/deployment.md):

    • Documented the default-deny egress posture, threat vector mitigation (C2 blocking, secret exfiltration prevention), and required egress rules.
    • Included the Required Egress Traffic Rules Reference Table covering:
      • Internal Cluster DNS (UDP/TCP 53)
      • In-cluster / Managed PostgreSQL (TCP 5432)
      • In-cluster / Managed Redis (TCP 6379, 6380)
      • LLM Inference Providers (Groq, OpenAI, Anthropic on TCP 443)
      • Container Image Registries for SBOM and container scanning (GHCR, Docker Hub, ECR on TCP 443, 8443)
      • GitHub API & Git content fetching (TCP 443)
      • Outbound alerting webhooks (Slack, Discord on TCP 443)
    • Updated production-values.yaml snippet to demonstrate a fully hardened enterprise deployment.
    • Created standalone docs/deployment.md and linked it from README.md.
  5. Changeset:

    • Added .changeset/worker-egress-hardening-1767.md.

PR Checklist

  • My code follows the project's style guidelines
  • I have performed a self-review of my code
  • My changes generate no new warnings/errors
  • I have added tests that prove my feature works
  • All chart linting and template rendering tests pass locally
  • Commit message follows [NSoC_2026] tag requirement
  • Added changeset for versioning

@vercel

vercel Bot commented Nov 16, 2026

Copy link
Copy Markdown

@Myparadox-creator is attempting to deploy a commit to the Gaurav's projects Team on Vercel.

A member of the Team first needs to authorize it.

@GauravKarakoti
GauravKarakoti merged commit 8b245ad into GauravKarakoti:main Nov 16, 2026
9 of 13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants