The client port cannot be restricted: the rendered NetworkPolicy admits it from anywhere #67
Labels
No labels
accessibility
bug
dependencies
documentation
duplicate
enhancement
go
good first issue
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
mikluko/nats-operator#67
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
With
monitor.networkPolicyon, the default, the NetworkPolicy the cluster controller renders admits the client port, and the gateway and leafnode ports when they are set, with nofrom(networkPolicyininternal/natscluster/netpol.go). Any pod in the Kubernetes cluster can connect.NetworkPolicies are additive, so a second policy over the same pods cannot narrow that rule. The only way to restrict clients is
monitor.networkPolicy: falseand a hand-written policy covering routes and monitoring as well.This matters most for a
NatsClusterwithoutauth, whose servers take any client unauthenticated.To reproduce: apply a
NatsClusterwith noauthand nomonitor, then from a pod in any other namespace:The server answers with
INFO.Expected: a way to name the peers admitted on the client port, as
exporter.fromdoes for the metrics port; absent, the port stays open to anyone, as now.