Skip to content

fix(security): minimal /health; runtime status behind auth at /status (Fixes #225) - #235

Merged
OkiriGabriel merged 1 commit into
mainfrom
fix/minimal-health-225
Nov 27, 2026
Merged

OkiriGabriel merged 1 commit into
mainfrom
fix/minimal-health-225

Conversation

@OkiriGabriel

Copy link
Copy Markdown
Collaborator

Fixes #225.

Problem

GET /health needs no token (it's the liveness probe, and the IP allowlist skips it), but it returned auto_apply, emergency_stop, storage_provider, org_id and queue_worker. Anyone who could reach the agent learned whether it would run changes without approval and whether the emergency stop was on.

Change

Endpoint Auth Response
GET /health none {"status": "ok"} only
GET /status (new) viewer, approver or admin token for the org (?org_id=, default ORG_ID), the same as /audit the fields /health used to return, with org_id set to the requested org

The Docker HEALTHCHECK, the k8s probes and CI's curl -f /health only check the status code, so they're unchanged.

Docs

docs/API_REFERENCE.md (auth table, /health, new /status) and docs/API_TESTING.md are updated. The website's API page should mention /status once this merges.

Note on #203

#203 (cloudgpuapp) adds "version" to /health. If both merge, the version should go in /status instead, to keep the unauthenticated probe minimal. I'll mention it on #203.

Tests

  • tests/test_health_status.py:
    • /health is minimal and contains none of the sensitive keys;
    • /status without a token gives 401;
    • a viewer token sees the fields;
    • another org's token gets 403, and gets 200 when it asks for its own org;
    • the admin token can read any org.
  • test_security.py's emergency-stop check now uses /status, and also asserts that /health doesn't reveal it.
  • Full suite: 1485 passed, 4 skipped. Flake8 (CI selection) and bandit are clean.

…nticated /status (#225)

- GET /health (unauthenticated liveness probe, skipped by the IP allowlist)
  now returns only {"status": "ok"}. It used to expose AUTO_APPLY, the
  emergency stop, the storage backend, the org ID and queue state.
- New GET /status with the previous fields, behind a viewer (or higher)
  token for the org, the same as /audit; org_id query parameter.
- Probes, Docker HEALTHCHECK and CI keep using /health unchanged.
- API reference and API testing guide updated.

Fixes #225
@OkiriGabriel
OkiriGabriel merged commit cc07eca into main Nov 27, 2026
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[SECURITY] Unauthenticated /health exposes AUTO_APPLY, emergency stop, storage and org ID

1 participant