2026-08-02 02:30:44 -03:00
|
|
|
# services/hermes/oauth2-proxy.yaml
|
|
|
|
|
apiVersion: v1
|
|
|
|
|
kind: ConfigMap
|
|
|
|
|
metadata:
|
2026-08-08 17:59:45 -03:00
|
|
|
name: hermes-owner-allowlist
|
2026-08-02 02:30:44 -03:00
|
|
|
namespace: hermes
|
|
|
|
|
data:
|
|
|
|
|
allowed-emails: |
|
|
|
|
|
brad@bstein.dev
|
|
|
|
|
---
|
|
|
|
|
apiVersion: v1
|
|
|
|
|
kind: Service
|
|
|
|
|
metadata:
|
2026-08-08 17:59:45 -03:00
|
|
|
name: oauth2-proxy-hermes-agent
|
|
|
|
|
namespace: hermes
|
|
|
|
|
spec:
|
|
|
|
|
selector:
|
|
|
|
|
app: oauth2-proxy-hermes-agent
|
|
|
|
|
ports:
|
|
|
|
|
- {name: http, port: 80, targetPort: http}
|
|
|
|
|
---
|
|
|
|
|
apiVersion: v1
|
|
|
|
|
kind: Service
|
|
|
|
|
metadata:
|
|
|
|
|
name: oauth2-proxy-hermes-triage
|
2026-08-02 02:30:44 -03:00
|
|
|
namespace: hermes
|
|
|
|
|
spec:
|
|
|
|
|
selector:
|
2026-08-08 17:59:45 -03:00
|
|
|
app: oauth2-proxy-hermes-triage
|
2026-08-02 02:30:44 -03:00
|
|
|
ports:
|
2026-08-08 17:59:45 -03:00
|
|
|
- {name: http, port: 80, targetPort: http}
|
|
|
|
|
---
|
|
|
|
|
apiVersion: v1
|
|
|
|
|
kind: Service
|
|
|
|
|
metadata:
|
|
|
|
|
name: oauth2-proxy-hermes-chat
|
|
|
|
|
namespace: hermes
|
|
|
|
|
spec:
|
|
|
|
|
selector:
|
|
|
|
|
app: oauth2-proxy-hermes-chat
|
|
|
|
|
ports:
|
|
|
|
|
- {name: http, port: 80, targetPort: http}
|
|
|
|
|
---
|
|
|
|
|
apiVersion: apps/v1
|
|
|
|
|
kind: Deployment
|
|
|
|
|
metadata:
|
|
|
|
|
name: oauth2-proxy-hermes-agent
|
|
|
|
|
namespace: hermes
|
|
|
|
|
labels:
|
|
|
|
|
app: oauth2-proxy-hermes-agent
|
|
|
|
|
spec:
|
|
|
|
|
replicas: 1
|
|
|
|
|
revisionHistoryLimit: 2
|
|
|
|
|
selector:
|
|
|
|
|
matchLabels:
|
|
|
|
|
app: oauth2-proxy-hermes-agent
|
|
|
|
|
template:
|
|
|
|
|
metadata:
|
|
|
|
|
labels:
|
|
|
|
|
app: oauth2-proxy-hermes-agent
|
|
|
|
|
annotations:
|
|
|
|
|
vault.hashicorp.com/agent-inject: "true"
|
|
|
|
|
vault.hashicorp.com/agent-pre-populate-only: "true"
|
|
|
|
|
vault.hashicorp.com/role: hermes-agent
|
|
|
|
|
vault.hashicorp.com/agent-inject-secret-oidc-config: kv/data/atlas/hermes/agent-oidc
|
|
|
|
|
vault.hashicorp.com/agent-inject-template-oidc-config: |
|
|
|
|
|
{{- with secret "kv/data/atlas/hermes/agent-oidc" -}}
|
|
|
|
|
client_id = "{{ .Data.data.client_id }}"
|
|
|
|
|
client_secret = "{{ .Data.data.client_secret }}"
|
|
|
|
|
cookie_secret = "{{ .Data.data.cookie_secret }}"
|
|
|
|
|
{{- end -}}
|
|
|
|
|
spec:
|
|
|
|
|
serviceAccountName: hermes-agent
|
|
|
|
|
automountServiceAccountToken: true
|
|
|
|
|
containers:
|
|
|
|
|
- name: oauth2-proxy
|
2026-08-09 13:49:40 -03:00
|
|
|
image: quay.io/oauth2-proxy/oauth2-proxy:v7.15.3@sha256:10a1165743a192e1940b4708fb9647027185ce11a681a1c5519b442ff7f1f561
|
2026-08-08 17:59:45 -03:00
|
|
|
imagePullPolicy: IfNotPresent
|
|
|
|
|
args:
|
|
|
|
|
- --provider=oidc
|
|
|
|
|
- --config=/vault/secrets/oidc-config
|
|
|
|
|
- --redirect-url=https://agent.hermes.bstein.dev/oauth2/callback
|
|
|
|
|
- --oidc-issuer-url=https://sso.bstein.dev/realms/atlas
|
|
|
|
|
- --user-id-claim=sub
|
|
|
|
|
- --code-challenge-method=S256
|
2026-08-08 20:08:44 -03:00
|
|
|
- --scope=openid profile email
|
2026-08-08 17:59:45 -03:00
|
|
|
- --email-domain=*
|
|
|
|
|
- --authenticated-emails-file=/etc/oauth2-proxy/allowed-emails
|
|
|
|
|
- --set-xauthrequest=true
|
|
|
|
|
- --pass-user-headers=true
|
|
|
|
|
- --pass-basic-auth=false
|
|
|
|
|
- --proxy-websockets=true
|
|
|
|
|
- --cookie-name=__Host-hermes_agent
|
|
|
|
|
- --cookie-path=/
|
|
|
|
|
- --cookie-secure=true
|
|
|
|
|
- --cookie-samesite=lax
|
2026-08-09 13:49:40 -03:00
|
|
|
- --cookie-csrf-expire=10m
|
|
|
|
|
- --cookie-csrf-per-request=true
|
|
|
|
|
- --cookie-csrf-per-request-limit=8
|
2026-08-08 17:59:45 -03:00
|
|
|
- --cookie-refresh=1h
|
|
|
|
|
- --cookie-expire=8h
|
2026-08-08 22:05:39 -03:00
|
|
|
- --upstream=http://hermes-agent.hermes.svc.cluster.local:7681
|
2026-08-08 17:59:45 -03:00
|
|
|
- --http-address=0.0.0.0:4180
|
|
|
|
|
- --skip-provider-button=true
|
|
|
|
|
- --reverse-proxy=true
|
2026-08-09 13:49:40 -03:00
|
|
|
- --trusted-proxy-ip=10.42.0.0/16
|
2026-08-08 17:59:45 -03:00
|
|
|
ports:
|
|
|
|
|
- {name: http, containerPort: 4180}
|
|
|
|
|
readinessProbe:
|
|
|
|
|
httpGet: {path: /ping, port: http}
|
|
|
|
|
initialDelaySeconds: 5
|
|
|
|
|
periodSeconds: 10
|
|
|
|
|
livenessProbe:
|
|
|
|
|
httpGet: {path: /ping, port: http}
|
|
|
|
|
initialDelaySeconds: 20
|
|
|
|
|
periodSeconds: 20
|
|
|
|
|
securityContext:
|
|
|
|
|
allowPrivilegeEscalation: false
|
|
|
|
|
capabilities:
|
|
|
|
|
drop: [ALL]
|
|
|
|
|
readOnlyRootFilesystem: true
|
|
|
|
|
runAsNonRoot: true
|
|
|
|
|
seccompProfile:
|
|
|
|
|
type: RuntimeDefault
|
|
|
|
|
resources:
|
|
|
|
|
requests: {cpu: 25m, memory: 64Mi}
|
|
|
|
|
limits: {cpu: 250m, memory: 256Mi}
|
|
|
|
|
volumeMounts:
|
|
|
|
|
- {name: allowlist, mountPath: /etc/oauth2-proxy, readOnly: true}
|
|
|
|
|
- {name: tmp, mountPath: /tmp}
|
|
|
|
|
volumes:
|
|
|
|
|
- name: allowlist
|
|
|
|
|
configMap:
|
|
|
|
|
name: hermes-owner-allowlist
|
|
|
|
|
- name: tmp
|
|
|
|
|
emptyDir: {sizeLimit: 64Mi}
|
2026-08-02 02:30:44 -03:00
|
|
|
---
|
|
|
|
|
apiVersion: apps/v1
|
|
|
|
|
kind: Deployment
|
|
|
|
|
metadata:
|
2026-08-08 17:59:45 -03:00
|
|
|
name: oauth2-proxy-hermes-triage
|
2026-08-02 02:30:44 -03:00
|
|
|
namespace: hermes
|
|
|
|
|
labels:
|
2026-08-08 17:59:45 -03:00
|
|
|
app: oauth2-proxy-hermes-triage
|
2026-08-02 02:30:44 -03:00
|
|
|
spec:
|
|
|
|
|
replicas: 1
|
|
|
|
|
revisionHistoryLimit: 2
|
|
|
|
|
selector:
|
|
|
|
|
matchLabels:
|
2026-08-08 17:59:45 -03:00
|
|
|
app: oauth2-proxy-hermes-triage
|
2026-08-02 02:30:44 -03:00
|
|
|
template:
|
|
|
|
|
metadata:
|
|
|
|
|
labels:
|
2026-08-08 17:59:45 -03:00
|
|
|
app: oauth2-proxy-hermes-triage
|
2026-08-02 02:30:44 -03:00
|
|
|
annotations:
|
|
|
|
|
vault.hashicorp.com/agent-inject: "true"
|
|
|
|
|
vault.hashicorp.com/agent-pre-populate-only: "true"
|
|
|
|
|
vault.hashicorp.com/role: hermes
|
2026-08-08 17:59:45 -03:00
|
|
|
vault.hashicorp.com/agent-inject-secret-oidc-config: kv/data/atlas/hermes/triage-oidc
|
2026-08-02 02:30:44 -03:00
|
|
|
vault.hashicorp.com/agent-inject-template-oidc-config: |
|
2026-08-08 17:59:45 -03:00
|
|
|
{{- with secret "kv/data/atlas/hermes/triage-oidc" -}}
|
2026-08-02 02:30:44 -03:00
|
|
|
client_id = "{{ .Data.data.client_id }}"
|
|
|
|
|
client_secret = "{{ .Data.data.client_secret }}"
|
|
|
|
|
cookie_secret = "{{ .Data.data.cookie_secret }}"
|
|
|
|
|
{{- end -}}
|
|
|
|
|
spec:
|
|
|
|
|
serviceAccountName: hermes-vault
|
|
|
|
|
automountServiceAccountToken: true
|
|
|
|
|
containers:
|
|
|
|
|
- name: oauth2-proxy
|
2026-08-09 13:49:40 -03:00
|
|
|
image: quay.io/oauth2-proxy/oauth2-proxy:v7.15.3@sha256:10a1165743a192e1940b4708fb9647027185ce11a681a1c5519b442ff7f1f561
|
2026-08-02 02:30:44 -03:00
|
|
|
imagePullPolicy: IfNotPresent
|
|
|
|
|
args:
|
|
|
|
|
- --provider=oidc
|
|
|
|
|
- --config=/vault/secrets/oidc-config
|
2026-08-08 17:59:45 -03:00
|
|
|
- --redirect-url=https://triage.hermes.bstein.dev/oauth2/callback
|
2026-08-02 02:30:44 -03:00
|
|
|
- --oidc-issuer-url=https://sso.bstein.dev/realms/atlas
|
2026-08-08 17:59:45 -03:00
|
|
|
- --user-id-claim=sub
|
2026-08-02 02:47:43 -03:00
|
|
|
- --code-challenge-method=S256
|
2026-08-08 20:08:44 -03:00
|
|
|
- --scope=openid profile email
|
2026-08-02 02:30:44 -03:00
|
|
|
- --email-domain=*
|
|
|
|
|
- --authenticated-emails-file=/etc/oauth2-proxy/allowed-emails
|
|
|
|
|
- --set-xauthrequest=true
|
2026-08-08 17:59:45 -03:00
|
|
|
- --pass-user-headers=true
|
|
|
|
|
- --pass-basic-auth=false
|
|
|
|
|
- --proxy-websockets=true
|
|
|
|
|
- --cookie-name=__Host-hermes_triage
|
|
|
|
|
- --cookie-path=/
|
2026-08-02 02:30:44 -03:00
|
|
|
- --cookie-secure=true
|
|
|
|
|
- --cookie-samesite=lax
|
2026-08-09 13:49:40 -03:00
|
|
|
- --cookie-csrf-expire=10m
|
|
|
|
|
- --cookie-csrf-per-request=true
|
|
|
|
|
- --cookie-csrf-per-request-limit=8
|
2026-08-08 17:59:45 -03:00
|
|
|
- --cookie-refresh=1h
|
2026-08-02 14:15:07 -03:00
|
|
|
- --cookie-expire=8h
|
2026-08-08 21:28:33 -03:00
|
|
|
- --upstream=http://hermes-triage.hermes.svc.cluster.local:8787
|
2026-08-02 02:30:44 -03:00
|
|
|
- --http-address=0.0.0.0:4180
|
|
|
|
|
- --skip-provider-button=true
|
|
|
|
|
- --reverse-proxy=true
|
2026-08-09 13:49:40 -03:00
|
|
|
- --trusted-proxy-ip=10.42.0.0/16
|
2026-08-02 02:30:44 -03:00
|
|
|
ports:
|
2026-08-08 17:59:45 -03:00
|
|
|
- {name: http, containerPort: 4180}
|
2026-08-02 02:30:44 -03:00
|
|
|
readinessProbe:
|
2026-08-08 17:59:45 -03:00
|
|
|
httpGet: {path: /ping, port: http}
|
2026-08-02 02:30:44 -03:00
|
|
|
initialDelaySeconds: 5
|
|
|
|
|
periodSeconds: 10
|
|
|
|
|
livenessProbe:
|
2026-08-08 17:59:45 -03:00
|
|
|
httpGet: {path: /ping, port: http}
|
2026-08-02 02:30:44 -03:00
|
|
|
initialDelaySeconds: 20
|
|
|
|
|
periodSeconds: 20
|
|
|
|
|
securityContext:
|
|
|
|
|
allowPrivilegeEscalation: false
|
|
|
|
|
capabilities:
|
2026-08-08 17:59:45 -03:00
|
|
|
drop: [ALL]
|
2026-08-02 02:30:44 -03:00
|
|
|
readOnlyRootFilesystem: true
|
|
|
|
|
runAsNonRoot: true
|
|
|
|
|
seccompProfile:
|
|
|
|
|
type: RuntimeDefault
|
|
|
|
|
resources:
|
2026-08-08 17:59:45 -03:00
|
|
|
requests: {cpu: 25m, memory: 64Mi}
|
|
|
|
|
limits: {cpu: 250m, memory: 256Mi}
|
2026-08-02 02:30:44 -03:00
|
|
|
volumeMounts:
|
2026-08-08 17:59:45 -03:00
|
|
|
- {name: allowlist, mountPath: /etc/oauth2-proxy, readOnly: true}
|
|
|
|
|
- {name: tmp, mountPath: /tmp}
|
2026-08-02 02:30:44 -03:00
|
|
|
volumes:
|
|
|
|
|
- name: allowlist
|
|
|
|
|
configMap:
|
2026-08-08 17:59:45 -03:00
|
|
|
name: hermes-owner-allowlist
|
|
|
|
|
- name: tmp
|
|
|
|
|
emptyDir: {sizeLimit: 64Mi}
|
|
|
|
|
---
|
|
|
|
|
apiVersion: apps/v1
|
|
|
|
|
kind: Deployment
|
|
|
|
|
metadata:
|
|
|
|
|
name: oauth2-proxy-hermes-chat
|
|
|
|
|
namespace: hermes
|
|
|
|
|
labels:
|
|
|
|
|
app: oauth2-proxy-hermes-chat
|
|
|
|
|
spec:
|
|
|
|
|
replicas: 1
|
|
|
|
|
revisionHistoryLimit: 2
|
|
|
|
|
selector:
|
|
|
|
|
matchLabels:
|
|
|
|
|
app: oauth2-proxy-hermes-chat
|
|
|
|
|
template:
|
|
|
|
|
metadata:
|
|
|
|
|
labels:
|
|
|
|
|
app: oauth2-proxy-hermes-chat
|
|
|
|
|
annotations:
|
2026-08-09 13:40:58 -03:00
|
|
|
ai.bstein.dev/config-rev: "20260809-oauth2-proxy-7-15-canary"
|
2026-08-08 17:59:45 -03:00
|
|
|
vault.hashicorp.com/agent-inject: "true"
|
|
|
|
|
vault.hashicorp.com/agent-pre-populate-only: "true"
|
|
|
|
|
vault.hashicorp.com/role: hermes-chat
|
|
|
|
|
vault.hashicorp.com/agent-inject-secret-oidc-config: kv/data/atlas/hermes/chat-oidc
|
|
|
|
|
vault.hashicorp.com/agent-inject-template-oidc-config: |
|
|
|
|
|
{{- with secret "kv/data/atlas/hermes/chat-oidc" -}}
|
|
|
|
|
client_id = "{{ .Data.data.client_id }}"
|
|
|
|
|
client_secret = "{{ .Data.data.client_secret }}"
|
|
|
|
|
cookie_secret = "{{ .Data.data.cookie_secret }}"
|
|
|
|
|
{{- end -}}
|
|
|
|
|
spec:
|
|
|
|
|
serviceAccountName: hermes-chat
|
|
|
|
|
automountServiceAccountToken: true
|
|
|
|
|
containers:
|
|
|
|
|
- name: oauth2-proxy
|
2026-08-09 13:40:58 -03:00
|
|
|
image: quay.io/oauth2-proxy/oauth2-proxy:v7.15.3@sha256:10a1165743a192e1940b4708fb9647027185ce11a681a1c5519b442ff7f1f561
|
2026-08-08 17:59:45 -03:00
|
|
|
imagePullPolicy: IfNotPresent
|
|
|
|
|
args:
|
|
|
|
|
- --provider=oidc
|
|
|
|
|
- --config=/vault/secrets/oidc-config
|
|
|
|
|
- --redirect-url=https://chat.hermes.bstein.dev/oauth2/callback
|
|
|
|
|
- --oidc-issuer-url=https://sso.bstein.dev/realms/atlas
|
|
|
|
|
- --user-id-claim=sub
|
|
|
|
|
- --code-challenge-method=S256
|
2026-08-08 20:08:44 -03:00
|
|
|
- --scope=openid profile email
|
2026-08-08 17:59:45 -03:00
|
|
|
- --email-domain=*
|
|
|
|
|
- --set-xauthrequest=true
|
|
|
|
|
- --pass-user-headers=true
|
|
|
|
|
- --pass-basic-auth=false
|
|
|
|
|
- --proxy-websockets=true
|
|
|
|
|
- --cookie-name=__Host-hermes_chat
|
|
|
|
|
- --cookie-path=/
|
|
|
|
|
- --cookie-secure=true
|
|
|
|
|
- --cookie-samesite=lax
|
2026-08-09 13:40:58 -03:00
|
|
|
- --cookie-csrf-expire=10m
|
|
|
|
|
- --cookie-csrf-per-request=true
|
|
|
|
|
- --cookie-csrf-per-request-limit=8
|
2026-08-08 17:59:45 -03:00
|
|
|
- --cookie-refresh=1h
|
|
|
|
|
- --cookie-expire=8h
|
2026-08-09 12:55:20 -03:00
|
|
|
- --custom-templates-dir=/etc/oauth2-proxy/templates
|
2026-08-09 01:08:31 -03:00
|
|
|
- '--skip-auth-route=GET=^/sw[.]js([?].*)?$'
|
2026-08-08 17:59:45 -03:00
|
|
|
- --upstream=http://hermes-chat-router.hermes.svc.cluster.local:8080
|
|
|
|
|
- --http-address=0.0.0.0:4180
|
|
|
|
|
- --skip-provider-button=true
|
|
|
|
|
- --reverse-proxy=true
|
2026-08-09 13:40:58 -03:00
|
|
|
- --trusted-proxy-ip=10.42.0.0/16
|
2026-08-08 17:59:45 -03:00
|
|
|
ports:
|
|
|
|
|
- {name: http, containerPort: 4180}
|
|
|
|
|
readinessProbe:
|
|
|
|
|
httpGet: {path: /ping, port: http}
|
|
|
|
|
initialDelaySeconds: 5
|
|
|
|
|
periodSeconds: 10
|
|
|
|
|
livenessProbe:
|
|
|
|
|
httpGet: {path: /ping, port: http}
|
|
|
|
|
initialDelaySeconds: 20
|
|
|
|
|
periodSeconds: 20
|
|
|
|
|
securityContext:
|
|
|
|
|
allowPrivilegeEscalation: false
|
|
|
|
|
capabilities:
|
|
|
|
|
drop: [ALL]
|
|
|
|
|
readOnlyRootFilesystem: true
|
|
|
|
|
runAsNonRoot: true
|
|
|
|
|
seccompProfile:
|
|
|
|
|
type: RuntimeDefault
|
|
|
|
|
resources:
|
|
|
|
|
requests: {cpu: 25m, memory: 64Mi}
|
|
|
|
|
limits: {cpu: 250m, memory: 256Mi}
|
|
|
|
|
volumeMounts:
|
2026-08-09 12:55:20 -03:00
|
|
|
- {name: templates, mountPath: /etc/oauth2-proxy/templates, readOnly: true}
|
2026-08-08 17:59:45 -03:00
|
|
|
- {name: tmp, mountPath: /tmp}
|
|
|
|
|
volumes:
|
2026-08-09 12:55:20 -03:00
|
|
|
- name: templates
|
|
|
|
|
configMap:
|
|
|
|
|
name: hermes-chat-oauth-templates
|
2026-08-02 02:30:44 -03:00
|
|
|
- name: tmp
|
2026-08-08 17:59:45 -03:00
|
|
|
emptyDir: {sizeLimit: 64Mi}
|