feat(templates): add optional NetworkPolicy resources for production hardening - #164
Open
eddysella wants to merge 1 commit into
Open
feat(templates): add optional NetworkPolicy resources for production hardening#164eddysella wants to merge 1 commit into
eddysella wants to merge 1 commit into
Conversation
Adds Kubernetes NetworkPolicy templates for auth, kong, and rest services, controlled by networkPolicies.enabled (default: false). When enabled: - Auth: ingress from Kong only, egress to DB/DNS/SMTP/HTTPS - Kong: ingress from any namespace, egress to all enabled services - REST: ingress from Kong only, egress to DB/DNS
Author
|
Any thoughts on this? @luizfelmach |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What kind of change does this PR introduce?
Feature — production hardening
What is the current behavior?
All pods can communicate freely with each other and external services. There is no network-level isolation between Supabase components, which means a compromised pod could reach any other service in the namespace.
What is the new behavior?
Adds optional Kubernetes NetworkPolicy templates for auth, kong, and rest services, controlled by a single toggle:
networkPolicies.enabled(default:false). Existing deployments are unaffected unless explicitly opted in.When enabled, each policy enforces least-privilege network access:
Enable with:
Additional context
This is a defense-in-depth measure for production Kubernetes deployments. The policies are intentionally scoped to the three most security-sensitive services (API gateway, authentication, and database API). Additional services can be covered in follow-up PRs.
All service ports are read from
service.<svc>.portvalues rather than hardcoded, ensuring compatibility with custom port configurations.