Gerador de Regras de Segurança Kubernetes NetworkPolicy YAML
Referência de engenharia para gerar manifestos declarativos de NetworkPolicy no Kubernetes, isolamento zero-trust de pods, regras de ingress/egress, blocos CIDR e múltiplas portas.
Defina quais pods no namespace "production" esta política de segurança restringe.
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: backend-api-netpol
namespace: production
labels:
tier: api
spec:
podSelector:
matchLabels:
app: backend-api
tier: api
policyTypes:
- Ingress
- Egress
ingress:
- # Allow HTTP from Frontend Pods
from:
- podSelector:
matchLabels:
app: web-frontend
ports:
- protocol: TCP
port: 8080
- # Allow Metrics Scraping from Monitoring Namespace
from:
- namespaceSelector:
matchLabels:
kubernetes.io/metadata.name: monitoring
podSelector:
matchLabels:
app: prometheus
ports:
- protocol: TCP
port: 9090
egress:
- # Allow CoreDNS Resolution in kube-system
to:
- namespaceSelector:
matchLabels:
kubernetes.io/metadata.name: kube-system
podSelector:
matchLabels:
k8s-app: kube-dns
ports:
- protocol: UDP
port: 53
- protocol: TCP
port: 53
- # Allow PostgreSQL Connection
to:
- podSelector:
matchLabels:
app: postgres
ports:
- protocol: TCP
port: 5432
- # Allow Redis Cluster Egress
to:
- podSelector:
matchLabels:
app: redis
ports:
- protocol: TCP
port: 6379Microssegmentação Zero-Trust
Políticas de rede Kubernetes conformes às especificações oficiais com podSelector, CIDR e portas restritas.
100% Privacidade no Navegador
Todas as sub-redes IP, topologias e regras de rede permanecem exclusivamente em sua máquina local.
Exportação Pronta para GitOps
Manifestos Kubernetes prontos para uso com modelos Helm parametrizados e overlays Kustomize.