Skip to content

Commit daf95da

Browse files
committed
fix(charts): refine egress network policy for imagebuilder
Updated egress rules to allow DNS resolution and refined access to public IPv4 and IPv6 networks, while maintaining access to specific services within the release namespace.
1 parent 65dc12a commit daf95da

1 file changed

Lines changed: 20 additions & 9 deletions

File tree

charts/imagebuilder/templates/imagebuilder-networkpolicy.yaml

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,37 +9,48 @@ spec:
99
policyTypes:
1010
- Egress
1111
egress:
12-
- to:
13-
ports:
12+
# Allow DNS resolution (UDP and TCP on port 53)
13+
- ports:
1414
- protocol: UDP
1515
port: 53
16-
- to:
17-
- ipBlock:
18-
cidr: ::/0
19-
except:
20-
- fc00::/7
16+
- protocol: TCP
17+
port: 53
18+
19+
# Allow egress to public IPv4 networks, excluding private ranges (RFC1918)
2120
- to:
2221
- ipBlock:
2322
cidr: 0.0.0.0/0
2423
except:
2524
- 10.0.0.0/8
2625
- 172.16.0.0/12
2726
- 192.168.0.0/16
27+
28+
# Allow egress to public IPv6 networks, excluding ULA and link-local ranges
29+
- to:
30+
- ipBlock:
31+
cidr: ::/0
32+
except:
33+
- fc00::/7 # Unique Local Address (cluster-internal range)
34+
- fe80::/10 # Link-local address
35+
36+
# Allow access to drycc-registry within the same release namespace
2837
- to:
2938
- namespaceSelector:
3039
matchLabels:
3140
kubernetes.io/metadata.name: {{ .Release.Name }}
32-
- podSelector:
41+
podSelector:
3342
matchLabels:
3443
app: drycc-registry
3544
ports:
3645
- protocol: TCP
3746
port: 5000
47+
48+
# Allow access to drycc-storage within the same release namespace
3849
- to:
3950
- namespaceSelector:
4051
matchLabels:
4152
kubernetes.io/metadata.name: {{ .Release.Name }}
42-
- podSelector:
53+
podSelector:
4354
matchLabels:
4455
app: drycc-storage
4556
ports:

0 commit comments

Comments
 (0)