Skip to content

Commit 5fd3f30

Browse files
committed
fix: lockdown hydra admin endpoint
1 parent 3994496 commit 5fd3f30

1 file changed

Lines changed: 30 additions & 1 deletion

File tree

deploy/kubernetes/charts/greptile/templates/deployment-hydra.yaml

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ spec:
115115
readinessProbe:
116116
httpGet:
117117
path: /health/ready
118-
port: http-admin
118+
port: http-public
119119
initialDelaySeconds: 5
120120
periodSeconds: 10
121121
resources:
@@ -146,4 +146,33 @@ spec:
146146
selector:
147147
{{- include "greptile.selectorLabels" . | nindent 4 }}
148148
app.kubernetes.io/component: hydra
149+
---
150+
# The admin API (token introspection, consent, client management) is unauthenticated;
151+
# only auth-v2 may reach it. The public port stays open for the ingress and services.
152+
apiVersion: networking.k8s.io/v1
153+
kind: NetworkPolicy
154+
metadata:
155+
name: {{ include "greptile.fullname" . }}-hydra
156+
labels:
157+
{{- include "greptile.labels" . | nindent 4 }}
158+
app.kubernetes.io/component: hydra
159+
spec:
160+
podSelector:
161+
matchLabels:
162+
{{- include "greptile.selectorLabels" . | nindent 6 }}
163+
app.kubernetes.io/component: hydra
164+
policyTypes:
165+
- Ingress
166+
ingress:
167+
- ports:
168+
- port: {{ .Values.authV2.hydra.publicPort }}
169+
protocol: TCP
170+
- from:
171+
- podSelector:
172+
matchLabels:
173+
{{- include "greptile.selectorLabels" . | nindent 14 }}
174+
app.kubernetes.io/component: auth-v2
175+
ports:
176+
- port: {{ .Values.authV2.hydra.adminPort }}
177+
protocol: TCP
149178
{{- end }}

0 commit comments

Comments
 (0)