Skip to content
Merged
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
35 changes: 34 additions & 1 deletion argoproj/codex-workspace/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,25 @@ spec:
secretKeyRef:
name: codex-workspace-gemini
key: GEMINI_API_KEY
- name: CLOUDFLARE_WARP_ENABLED
value: "true"
- name: CLOUDFLARE_WARP_REQUIRED
value: "false"
- name: CLOUDFLARE_WARP_AUTH_CLIENT_ID
valueFrom:
secretKeyRef:
name: codex-workspace-cloudflare-warp
key: auth-client-id
- name: CLOUDFLARE_WARP_AUTH_CLIENT_SECRET
valueFrom:
secretKeyRef:
name: codex-workspace-cloudflare-warp
key: auth-client-secret
- name: CLOUDFLARE_WARP_ORGANIZATION
valueFrom:
secretKeyRef:
name: codex-workspace-cloudflare-warp
key: organization
- name: DOCKER_HOST
value: tcp://127.0.0.1:2375
- name: DOCKER_BUILDKIT
Expand All @@ -104,7 +123,15 @@ spec:
runAsUser: 0
allowPrivilegeEscalation: true
capabilities:
add: ["AUDIT_WRITE", "CHOWN", "FOWNER", "SETGID", "SETUID", "SYS_CHROOT"]
add:
- AUDIT_WRITE
- CHOWN
- FOWNER
- NET_ADMIN
- NET_RAW
- SETGID
- SETUID
- SYS_CHROOT
drop: ["ALL"]
readOnlyRootFilesystem: false
resources:
Expand Down Expand Up @@ -135,6 +162,8 @@ spec:
mountPath: /usr/local/bin/docker
subPath: docker
readOnly: true
- name: dev-net-tun
mountPath: /dev/net/tun
- name: obsidian-sync
image: ghcr.io/boxp/arch/codex-workspace:latest
imagePullPolicy: Always
Expand Down Expand Up @@ -248,3 +277,7 @@ spec:
emptyDir: {}
- name: docker-graph-storage
emptyDir: {}
- name: dev-net-tun
hostPath:
path: /dev/net/tun
type: CharDevice
24 changes: 24 additions & 0 deletions argoproj/codex-workspace/external-secret.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,27 @@ spec:
- secretKey: GEMINI_API_KEY
remoteRef:
key: /lolice/codex-workspace/gemini-api-key
---
apiVersion: external-secrets.io/v1
kind: ExternalSecret
metadata:
name: codex-workspace-cloudflare-warp
namespace: codex-workspace
spec:
refreshInterval: 1h
secretStoreRef:
name: parameterstore
kind: ClusterSecretStore
target:
name: codex-workspace-cloudflare-warp
creationPolicy: Owner
data:
- secretKey: auth-client-id
remoteRef:
key: /lolice/codex-workspace/cloudflare-warp-auth-client-id
- secretKey: auth-client-secret
remoteRef:
key: /lolice/codex-workspace/cloudflare-warp-auth-client-secret
- secretKey: organization
remoteRef:
key: /lolice/codex-workspace/cloudflare-warp-organization
5 changes: 5 additions & 0 deletions argoproj/codex-workspace/networkpolicy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,8 @@ spec:
- 22
- 80
- 443
- action: Allow
protocol: UDP
destination:
ports:
- 2408

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge MASQUE 用の UDP 443 も許可してください

Cloudflare WARP のデバイスプロファイルが MASQUE(FedRAMP High を含む)に設定されている環境では、WARP ingress のデフォルトが UDP/443 になると Cloudflare の公式ドキュメントに記載されています(https://developers.cloudflare.com/cloudflare-one/connections/connect-devices/warp/deployment/firewall/)。この追加は UDP/2408 だけを許可しており、既存の 443 許可は TCP のみなので、その構成ではトンネル確立パケットが NetworkPolicy で落ちて even-g2-main.b0xp.io へ到達できません。WireGuard に固定するか、Cloudflare WARP ingress 向けに UDP/443 も許可してください。

Useful? React with 👍 / 👎.

16 changes: 16 additions & 0 deletions docs/project_docs/BOXP-17-codex-workspace-warp-client/plan.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# BOXP-17: Codex workspace WARP client

Codex workspace から `even-g2-main.b0xp.io` を、`even-g2-main.even-g2-lab.svc.cluster.local` 直通ではなく Cloudflare WARP 利用者と同じ private hostname route で確認できるようにする。

## Scope

- workspace container に Cloudflare WARP enrollment 用 secret を注入する。
- workspace container に `/dev/net/tun` と `NET_ADMIN` / `NET_RAW` を付与する。
- Calico egress policy で WARP の UDP 2408 を許可する。
- `even-g2-main` Service 側の NetworkPolicy には Codex workspace 直通許可を追加しない。

## Dependencies

- `boxp/arch` 側で codex-workspace image に Cloudflare WARP client と entrypoint 起動処理を追加する。
- `boxp/arch` 側で WARP Service Token client ID / secret / organization を AWS SSM Parameter Store に用意する。
- Cloudflare Zero Trust 側で、その Service Token を許可する device enrollment policy が必要。
Loading