docs(osint): admin login, osint-admin Secret, and the known Secure-cookie gap
This commit is contained in:
parent
5b9d179239
commit
28f09d5809
1 changed files with 31 additions and 2 deletions
|
|
@ -10,7 +10,7 @@ instead of a host Docker container on the Pi.
|
||||||
|---|---|---|
|
|---|---|---|
|
||||||
| `osint-db` | `forgejo…/sirius/osint-dashboard-pg:amd64-c48788d4b614-r2` | TimescaleDB 2 + PostGIS 3 on Postgres 16, `local-path` PVC `osint-pgdata` 15 Gi |
|
| `osint-db` | `forgejo…/sirius/osint-dashboard-pg:amd64-c48788d4b614-r2` | TimescaleDB 2 + PostGIS 3 on Postgres 16, `local-path` PVC `osint-pgdata` 15 Gi |
|
||||||
| `osint-nats` | `forgejo…/sirius/nats:2.10` | JetStream event bus (`-js -m 8222`) |
|
| `osint-nats` | `forgejo…/sirius/nats:2.10` | JetStream event bus (`-js -m 8222`) |
|
||||||
| `osint-app` | `forgejo…/sirius/osint-dashboard:amd64-c48788d4b614` | FastAPI + static HUD; runs `alembic upgrade heads` on start |
|
| `osint-app` | `forgejo…/sirius/osint-dashboard:amd64-d8113b37b8ac-r1` | FastAPI + static HUD; runs `alembic upgrade heads` on start; single-admin auth (`app/auth.py`) — public read-only site, admin-only keys/settings/mutations |
|
||||||
| `osint-ingester` | same app image | RSS/GDELT/USGS/FIRMS/vessel ingest → NATS → Postgres |
|
| `osint-ingester` | same app image | RSS/GDELT/USGS/FIRMS/vessel ingest → NATS → Postgres |
|
||||||
| `osint-camera-service` | same app image | public-camera discovery + snapshots (PVC `osint-camera-snapshots` 3 Gi, shared with the app) |
|
| `osint-camera-service` | same app image | public-camera discovery + snapshots (PVC `osint-camera-snapshots` 3 Gi, shared with the app) |
|
||||||
| `osint-titiler` | `forgejo…/sirius/titiler:0.26.0` | SAR COG tile proxy, exposed same-origin at `/titiler` |
|
| `osint-titiler` | `forgejo…/sirius/titiler:0.26.0` | SAR COG tile proxy, exposed same-origin at `/titiler` |
|
||||||
|
|
@ -57,7 +57,36 @@ too (`ALTER ROLE osint PASSWORD …`), not just the Secret.
|
||||||
API keys (Nous Portal `NOUS_API_KEY`, FIRMS, AISStream, VesselAPI) are **not**
|
API keys (Nous Portal `NOUS_API_KEY`, FIRMS, AISStream, VesselAPI) are **not**
|
||||||
Kubernetes Secrets: they live in the dashboard's `api_keys` table and are set
|
Kubernetes Secrets: they live in the dashboard's `api_keys` table and are set
|
||||||
from the Keys page in the UI (`GET/PUT /api/keys`). The summarizer reads
|
from the Keys page in the UI (`GET/PUT /api/keys`). The summarizer reads
|
||||||
`NOUS_API_KEY` from the env first, then from that table.
|
`NOUS_API_KEY` from the env first, then from that table. Since the auth change
|
||||||
|
the Keys page is **admin-only**, so set them while signed in (`/login`).
|
||||||
|
|
||||||
|
### Admin login (`osint-admin`)
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# password -> pbkdf2 hash (from a checkout of sirius/osint-dashboard)
|
||||||
|
python app/auth.py hash '<password>'
|
||||||
|
python -c 'import secrets; print(secrets.token_urlsafe(48))' # session secret
|
||||||
|
|
||||||
|
kubectl -n osint create secret generic osint-admin \
|
||||||
|
--from-literal=ADMIN_USER=lance \
|
||||||
|
--from-literal=ADMIN_PASSWORD_HASH='pbkdf2_sha256$…' \
|
||||||
|
--from-literal=ADMIN_SESSION_SECRET='…'
|
||||||
|
kubectl -n osint rollout restart deploy/osint-app # env is fixed at container start
|
||||||
|
```
|
||||||
|
|
||||||
|
`ADMIN_USER=lance`; the current password lives in
|
||||||
|
`~/.hermes/secrets/osint_admin_password` (0600, Legion) — never in git. The
|
||||||
|
three refs in `app-deployment.yaml` are `optional: true` on purpose: a missing
|
||||||
|
Secret must not block startup, and the app then **fails closed** (admin routes
|
||||||
|
`403 {"detail":"admin auth not configured"}`) while the public HUD keeps
|
||||||
|
serving.
|
||||||
|
|
||||||
|
Known gap: the session cookie is `HttpOnly` + `SameSite=Lax` but **not
|
||||||
|
`Secure`**, because the tunnel origins at plain HTTP and Cilium Envoy rewrites
|
||||||
|
`X-Forwarded-Proto` to `http`, so `app/auth.py::_is_https()` never sees https
|
||||||
|
(an explicit request header is discarded too). Fix is carded upstream
|
||||||
|
(`ADMIN_COOKIE_SECURE`). Until it lands, the zone's **Always Use HTTPS** is what
|
||||||
|
keeps the cookie off plaintext requests.
|
||||||
|
|
||||||
## Analyst model
|
## Analyst model
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue