chore: update
This commit is contained in:
@@ -0,0 +1,89 @@
|
||||
# Isolation réseau du namespace monitoring (beszel-agent) — deny-by-default +
|
||||
# allowlist :
|
||||
# - Egress : HTTPS sortant vers le Hub (HUB_URL, hôte externe arbitraire —
|
||||
# voir beszel-agent-secret.yml) pour l'auto-enregistrement au démarrage.
|
||||
# - Ingress : le Hub se connecte à l'agent en SSH sur le port LISTEN
|
||||
# (45876) pour récupérer les métriques — IP du Hub non fixe/connue
|
||||
# d'avance, ouvert largement mais authentifié par TOKEN/KEY (voir
|
||||
# beszel-agent-secret.yml), pas par l'origine réseau.
|
||||
#
|
||||
# ⚠️ LIMITE IMPORTANTE : le DaemonSet tourne en hostNetwork: true (voir
|
||||
# daemonset-beszel.yml) — avec Calico (CNI de ce cluster, voir
|
||||
# deploy/cni/calico-install.yml), un NetworkPolicy standard ne s'applique en
|
||||
# général PAS aux pods hostNetwork (il faudrait un HostEndpoint/
|
||||
# GlobalNetworkPolicy Calico, une ressource différente, pour un enforcement
|
||||
# réel au niveau du nœud). Ce manifeste reste appliqué pour la correction
|
||||
# d'intention et si hostNetwork est retiré un jour, mais ne pas compter
|
||||
# dessus comme protection effective du port 45876 en l'état — un pare-feu
|
||||
# hôte (iptables/nftables/ufw) ou une GlobalNetworkPolicy Calico est
|
||||
# nécessaire pour une vraie restriction.
|
||||
|
||||
apiVersion: networking.k8s.io/v1
|
||||
kind: NetworkPolicy
|
||||
metadata:
|
||||
name: default-deny-all
|
||||
namespace: monitoring
|
||||
spec:
|
||||
podSelector: {}
|
||||
policyTypes:
|
||||
- Ingress
|
||||
- Egress
|
||||
|
||||
---
|
||||
apiVersion: networking.k8s.io/v1
|
||||
kind: NetworkPolicy
|
||||
metadata:
|
||||
name: allow-ingress-hub-ssh
|
||||
namespace: monitoring
|
||||
spec:
|
||||
podSelector: {}
|
||||
policyTypes:
|
||||
- Ingress
|
||||
ingress:
|
||||
- from: []
|
||||
ports:
|
||||
- protocol: TCP
|
||||
port: 45876
|
||||
|
||||
---
|
||||
apiVersion: networking.k8s.io/v1
|
||||
kind: NetworkPolicy
|
||||
metadata:
|
||||
name: allow-egress-dns
|
||||
namespace: monitoring
|
||||
spec:
|
||||
podSelector: {}
|
||||
policyTypes:
|
||||
- Egress
|
||||
egress:
|
||||
- to:
|
||||
- namespaceSelector:
|
||||
matchLabels:
|
||||
kubernetes.io/metadata.name: kube-system
|
||||
ports:
|
||||
- protocol: UDP
|
||||
port: 53
|
||||
- protocol: TCP
|
||||
port: 53
|
||||
|
||||
---
|
||||
apiVersion: networking.k8s.io/v1
|
||||
kind: NetworkPolicy
|
||||
metadata:
|
||||
name: allow-egress-hub-https
|
||||
namespace: monitoring
|
||||
spec:
|
||||
podSelector: {}
|
||||
policyTypes:
|
||||
- Egress
|
||||
egress:
|
||||
- to:
|
||||
- ipBlock:
|
||||
cidr: 0.0.0.0/0
|
||||
except:
|
||||
- 10.0.0.0/8
|
||||
- 172.16.0.0/12
|
||||
- 192.168.0.0/16
|
||||
ports:
|
||||
- protocol: TCP
|
||||
port: 443
|
||||
Reference in New Issue
Block a user