Skip to content

Commit 6f0eb1d

Browse files
p-rogPrzemyslaw Roguski
andauthored
Vault network policy - update (#128)
* Fixing db network policy bug, adding new qtodo egress network policies and default deny network policy * cleaning all changes * db network policy file change * feat: add qtodo egress NetworkPolicy (port-restricted, no default-deny) * fixing the namespace name * changing the ingress policy, to allow qtodo correct network communication * NP tweaks * removing egress qtodo network policies due to problems with OVN-K and later broken DNS * sync with PR#125 * Pushing correct, fully covered network polices, with correct DNS port and Keycloak port * openshift-ingress labels update, because policy-group.network.openshift.io/ingress: triggers OVN-K's special ACL handling for host-network traffic * changing the namespaceSelector: for Keycloak, because here Keycloak asnwers on both an internal hostname (for back-channel) and an external hostname (for browser redirects) * Adding default deny policy * Testing Vault ingress/egress network policies * Testing Vault network policies * adding Vault network policies --------- Co-authored-by: Przemyslaw Roguski <proguski@proguski-thinkpadp1gen7.rmtpl.csb>
1 parent 0123194 commit 6f0eb1d

2 files changed

Lines changed: 74 additions & 0 deletions

File tree

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
defaultDenyNetworkPolicy:
2+
enabled: true
3+
4+
vault:
5+
server:
6+
networkPolicy:
7+
enabled: true
8+
ingress:
9+
# OCP router — vault Route (reencrypt TLS, UI and API)
10+
# Router pods use hostNetwork:true — requires OVN-K policy-group label
11+
- ports:
12+
- protocol: TCP
13+
port: 8200
14+
from:
15+
- namespaceSelector:
16+
matchLabels:
17+
policy-group.network.openshift.io/ingress: ""
18+
# qtodo namespace — spiffe-vault-client sidecar authenticates via SPIFFE JWT
19+
- ports:
20+
- protocol: TCP
21+
port: 8200
22+
from:
23+
- namespaceSelector:
24+
matchLabels:
25+
kubernetes.io/metadata.name: qtodo
26+
# Vault cluster replication port — HA readiness
27+
- ports:
28+
- protocol: TCP
29+
port: 8201
30+
from:
31+
- podSelector:
32+
matchLabels:
33+
app.kubernetes.io/name: vault
34+
component: server
35+
egress:
36+
# DNS resolution via CoreDNS — OCP uses port 5353
37+
- ports:
38+
- protocol: UDP
39+
port: 5353
40+
- protocol: TCP
41+
port: 5353
42+
to:
43+
- namespaceSelector:
44+
matchLabels:
45+
kubernetes.io/metadata.name: openshift-dns
46+
# SPIRE OIDC discovery provider — Vault JWT auth fetches JWKS
47+
# Service port 443 -> pod port 8443, both included for OVN-K DNAT
48+
- ports:
49+
- protocol: TCP
50+
port: 443
51+
- protocol: TCP
52+
port: 8443
53+
to:
54+
- namespaceSelector:
55+
matchLabels:
56+
kubernetes.io/metadata.name: zero-trust-workload-identity-manager
57+
# Vault cluster replication — outbound to peer Vault pods (HA readiness)
58+
- ports:
59+
- protocol: TCP
60+
port: 8201
61+
to:
62+
- podSelector:
63+
matchLabels:
64+
app.kubernetes.io/name: vault
65+
component: server
66+
# Kubernetes API server — TokenReview for ESO service account validation
67+
# ClusterIP service is 172.x:443, DNAT to node IPs on 6443
68+
- ports:
69+
- protocol: TCP
70+
port: 443
71+
- protocol: TCP
72+
port: 6443

values-hub.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -320,6 +320,8 @@ clusterGroup:
320320
project: hub
321321
chart: hashicorp-vault
322322
chartVersion: 0.1.*
323+
extraValueFiles:
324+
- /overrides/values-vault-network-policy.yaml
323325
annotations:
324326
argocd.argoproj.io/sync-wave: "25"
325327
# Custom Vault policies for least-privilege access

0 commit comments

Comments
 (0)