{"success":true,"name":"secure-the-background-doors-cron-jobs-internal-apis-and-admi","description":"App has admin pages, cron endpoints, or internal APIs beyond normal user routes","category":"ai-brimind","path":"ai-brimind/secure-the-background-doors-cron-jobs-internal-apis-and-admi/SKILL.md","file":"SKILL.md","content":"---\nname: secure-the-background-doors-cron-jobs-internal-apis-and-admi\ndescription: \"App has admin pages, cron endpoints, or internal APIs beyond normal user routes\"\n---\n\n# Secure the Background Doors: Cron Jobs, Internal APIs, and Admin Panels\n\n## When to use\nYou are adding routes not meant for normal users — admin dashboards, cron/task triggers, health checks, internal service calls — and deciding how they are protected.\n\n## Example request\nA cron endpoint at /api/cron/cleanup with no auth → anyone who finds the URL can trigger or spam the job; scheduled endpoints need a secret header or the platform's signed scheduler (protected triggers). Admin panel 'hidden' at /secret-admin → crawlers and wordlists find unlinked paths daily; admin needs real authentication and role checks, not a hidden URL (no security by obscurity). Internal service endpoints open on the public internet → what only servers should call must require service credentials or network restrictions (service-to-service auth). A verbose health/debug endpoint exposing config → monitoring endpoints leak internals; keep them minimal or protected (information exposure).\n\n## Instructions\nAct like an attacker's tour guide in reverse: walk every route that exists outside the normal user flow — admin pages, cron triggers, webhooks you created for yourself, debug and health endpoints, internal APIs — and demand each one's protection story. Being unlinked is not protection; assume every path will be discovered by automated scanners. Give each door a real lock matched to its caller: admin routes require authentication plus a server-checked admin role; cron and task endpoints require a secret token compared server-side, or better, the hosting platform's signed scheduler invocations; internal service calls require service credentials or network-level restriction so the public internet cannot reach them at all; health checks expose a plain OK, not configuration. Prefer platform mechanisms (scheduler auth, private networking, access rules) over invented ones. Then verify from outside: call each special route from a terminal with no credentials and confirm rejection. Only finish when every non-user route names its lock and survives an unauthenticated probe, and explain how each lock stops a stranger with the URL — because a URL is the one thing you must assume everyone has.\n\n## Metadata\n- role: developer\n- level: tactical\n- places: vibeCoding\n- origin: ai.brimind.pro skill #550\n","linked_files":[],"origin":"ai.brimind.pro","owner_id":null,"source":"router"}