fix: harden proxy auth and deployment security
This commit is contained in:
1 parent
f5e8dde608
commit
ebf5d45491
14 files changed
+172
-44
No files matched your search
@@ -10,6 +10,7 @@
|
||||
- Keep VK tokens and group IDs out of the repository; use environment variables or Kubernetes Secrets.
|
||||
- Keep `VK_CALLBACK_SECRET` private as well: VK sends it in the top-level `secret` field, it is at most 50 characters, and it must never appear in URLs, logs, responses, or committed documentation.
|
||||
- Production manifests are already applied in namespace `belki`; CI deploys them from `main` using the namespace-scoped RBAC in [`deploy/k8s/rbac.yaml`](./deploy/k8s/rbac.yaml).
|
||||
- CI may only read and patch the existing `belki-runtime` Secret; it cannot list Secrets or create new ones. Bootstrap that Secret out of band before the first deploy. The multi-proxy ingress chain hides the real client IP from the app, so `BELKI_ADMIN_RATE_LIMIT_EXEMPT_PROXY_CIDRS` skips the app's shared login lockout for proxy peers. Enforce public rate limiting at the outermost proxy, and review the pod CIDR exemption against live networking after cluster changes. Never trust forwarded client-IP headers in the app for this purpose.
|
||||
- The production build uses the GitLab runner tag `fast`, a privileged Docker executor, and an explicit `docker:29.6.1-dind` service alias over TCP.
|
||||
- Production images and Kubernetes workloads are amd64-only. Preserve `linux/amd64` in Dockerfiles, CI build commands, and workload node selectors; do not reintroduce the arm64-only Python base tag.
|
||||
- When adding, removing, or updating a runtime dependency, rebuild and push the matching immutable base image to `reg.nyan404.ru`, then update its tag in the final Dockerfile before running CI. `requirements.txt` maps to `Dockerfile.base`; `nginx.conf` maps to `Dockerfile.gateway-base`.
|
||||
@@ -31,9 +32,9 @@
|
||||
- VK scheduler lives in `app/belki/vk_scheduler.py`; use `BELKI_DATABASE_URL` in production and `BELKI_HISTORY_DB` for local SQLite checks. Keep mailing disabled until an administrator explicitly enables a conversation and schedule.
|
||||
- VK Callback API and dialog durability live across `app/belki/vk_bot.py`, `app/belki/vk_callback.py`, and `app/belki/vk_scheduler.py`. The bot listens on callback port 8081; preserve `vk_dialog_states` and `vk_callback_events` when changing dialog steps, attachments, or event dispatch. Validate with `python -m unittest tests.test_vk_bot tests.test_vk_conversation -q`. Production uses `/api/vk/callback` on the existing public host and routes that exact path to the `belki-bot` Service.
|
||||
- The build job waits for the DinD daemon and runs `docker info` before building.
|
||||
- The deploy job requires protected CI variables `VK_CALLBACK_SECRET` and `VK_CALLBACK_CONFIRMATION` and writes both into `belki-runtime` before applying the bot Deployment.
|
||||
- The deploy job requires protected CI variables `VK_CALLBACK_SECRET` and `VK_CALLBACK_CONFIRMATION` and patches both into the existing `belki-runtime` before applying the bot Deployment.
|
||||
- Never commit `.env` or `.gitlab.variables.env`; the latter contains the GitLab Variable handoff and a namespace-scoped kubeconfig.
|
||||
- Private image storage is the separate Kubernetes Secret `belki-image-store`, not the CI-recreated `belki-runtime`. It contains only the internal MinIO endpoints and bucket-scoped credentials; keep MinIO private and preserve the `/api/images/<id>` Belki proxy when changing upload flows.
|
||||
- Private image storage is the separate Kubernetes Secret `belki-image-store`, not `belki-runtime`. It contains only the internal MinIO endpoints and bucket-scoped credentials; keep MinIO private and preserve the `/api/images/<id>` Belki proxy when changing upload flows.
|
||||
|
||||
## Agent Rules
|
||||
- Zod `.describe()` on optional fields: always append `.optional()` — e.g. `zod.string().describe("…").optional()` — to avoid validation failures when the field is absent.
|
||||
|
||||
Reference in new issue
Block a user