Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions charts/app-reverse-proxy/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ apiVersion: v2
name: charts-app-reverse-proxy
description: EcoVadis Helm chart for application exposed with nginx reverse proxy
type: application
version: 3.1.1
version: 4.0.0
appVersion: 1.16.0
dependencies:
- name: charts-core
version: 2.6.0
version: 3.0.0
repository: "https://ecovadiscode.github.io/charts/"
1 change: 0 additions & 1 deletion charts/app-reverse-proxy/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@ global:
eventHubNetworkPolicyEnabled: false
lnmElasticNetworkPolicyEnabled: false
redisNetworkPolicyEnabled: true
redisCidr: "#{redisCidr}#"
sqlNetworkPolicyEnabled: true
servicebusNetworkPolicyEnabled: true

Expand Down
2 changes: 1 addition & 1 deletion charts/core/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ apiVersion: v2
name: charts-core
description: A Helm chart for Kubernetes
type: application
version: 2.8.0
version: 3.0.0
45 changes: 45 additions & 0 deletions charts/core/templates/cilium-network-policy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{{- if .Values.global.defaultNetworkPolicyEnabled -}}
{{/*
Egress to Node IPs. Kubernetes NetworkPolicy has no way to select a node, and
Cilium resolves node addresses to the `host` / `remote-node` identities, which
CIDR and ipBlock selectors never match. The ipBlock 0.0.0.0/0 rule in
network-policy.yaml therefore does NOT cover them, despite allowing every
address - a CIDR rule can only ever match the `world` identity.

Azure NPM allowed a pod to reach its own node implicitly, so this never had to
be stated. Cilium grants nothing to nodes implicitly.

The concrete dependency is Azure IMDS at 169.254.169.254, used for managed
identity. That address is link-local and resolves to `host`, so a toCIDR rule
would not match it either - toEntities is the only construct that works.
Workload Identity reaches AAD over 443 instead, which is `world` and already
allowed, but both paths are covered here.

Egress only. These pods sit behind Traefik on a ClusterIP Service, so nothing
arrives from a node address. A workload exposed directly through a
LoadBalancer or NodePort Service with externalTrafficPolicy: Cluster sees the
client SNATed to a node IP and would additionally need
`fromEntities: [host, remote-node]`.

Rendered under the same switch as the NetworkPolicy: a pod that is not policed
needs no CiliumNetworkPolicy either.

Reference:
https://learn.microsoft.com/en-us/azure/aks/migrate-from-npm-to-cilium-network-policy
*/}}
apiVersion: cilium.io/v2
kind: CiliumNetworkPolicy
metadata:
name: {{ include "charts-core.fullname" . }}-node-egress
labels:
{{- include "charts-core.labels" . | nindent 4 }}
networkPolicyType: default
spec:
endpointSelector:
matchLabels:
{{- include "charts-core.selectorLabels" . | nindent 6 }}
egress:
- toEntities:
- host
- remote-node
{{- end -}}
15 changes: 14 additions & 1 deletion charts/core/templates/network-policy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@ spec:
- from: #outside world - sentry, optimizely, etc
- ipBlock:
cidr: 0.0.0.0/0
# Cilium never matches Pod IPs through ipBlock, so without these peers
# in-cluster clients lose access to the ports below. Under NPM they change
# nothing: 0.0.0.0/0 already covers Pods. Reference:
# https://learn.microsoft.com/en-us/azure/aks/migrate-from-npm-to-cilium-network-policy
- namespaceSelector: {}
- podSelector: {}
ports:
- port: 443
- port: 80
Expand Down Expand Up @@ -80,10 +86,17 @@ spec:
- to: #outside world - sentry, optimizely, etc
- ipBlock:
cidr: 0.0.0.0/0
# Cilium never matches Pod IPs through ipBlock, so without these peers
# in-cluster destinations lose access to the ports below. Under NPM they
# change nothing: 0.0.0.0/0 already covers Pods.
# https://learn.microsoft.com/en-us/azure/aks/migrate-from-npm-to-cilium-network-policy
- namespaceSelector: {}
- podSelector: {}
ports:
- port: 443
- port: 80
- port: 8433
- port: 8433 # DEPRECATED: typo for 8443, kept until confirmed unused
- port: 8443
- port: 8000
- port: 8200
- port: 53
Expand Down
Loading
Loading