Skip to content

fix: require auth for /api/status, add unauthenticated /api/health probe#48

Open
shellus wants to merge 1 commit into
CloakHQ:mainfrom
shellus:fix/protect-status-endpoint
Open

fix: require auth for /api/status, add unauthenticated /api/health probe#48
shellus wants to merge 1 commit into
CloakHQ:mainfrom
shellus:fix/protect-status-endpoint

Conversation

@shellus

@shellus shellus commented Jun 29, 2026

Copy link
Copy Markdown

Problem

/api/status is in the auth-exempt set so the Docker healthcheck can reach it. But with AUTH_TOKEN set, it still returns running_count, binary_version and profiles_total without authentication. This is an information-disclosure endpoint that scanners (e.g. fofa) use to fingerprint exposed Manager instances and learn how many profiles exist.

Change

  • Add a dedicated GET /api/health probe that returns only {"status": "ok"} with no system details, and keep it auth-exempt.
  • Remove /api/status from the exempt set, so it now requires the token like /api/profiles.
  • Point the Dockerfile HEALTHCHECK at /api/health.
  • Update the README auth section and tests.

Tests

  • test_healthcheck_always_accessible now probes /api/health.
  • New test_status_requires_auth: /api/status returns 401 without a token and 200 with the correct Bearer token.
  • Full test_auth.py + test_api.py suite passes (60 passed).

No frontend impact: the dashboard determines auth state via /api/auth/status, and getStatus() (which calls /api/status) runs only inside the authenticated app.

/api/status was exempt from the AUTH_TOKEN middleware so the Docker
healthcheck could reach it, but it leaks running_count, binary_version
and profiles_total without authentication. Scanners (e.g. fofa) use it
to fingerprint exposed instances.

Move /api/status behind auth (same as /api/profiles) and add a dedicated
/api/health probe that returns only {"status": "ok"} with no system
details. Point the Dockerfile healthcheck at /api/health and update the
exempt set, README and tests accordingly.
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.

1 participant