{"success":true,"name":"lock-down-admin-areas-harder-than-the-rest","description":"Building or exposing an admin panel, dashboard, or back-office.","category":"ai-brimind","path":"ai-brimind/lock-down-admin-areas-harder-than-the-rest/SKILL.md","file":"SKILL.md","content":"---\nname: lock-down-admin-areas-harder-than-the-rest\ndescription: \"Building or exposing an admin panel, dashboard, or back-office.\"\n---\n\n# Lock Down Admin Areas Harder Than the Rest\n\n## When to use\nThe project has admin screens or admin APIs, and their protection is only 'the link is hidden' or a frontend role check.\n\n## Example request\nAdmin route protected by hiding the menu item → typing /admin in the URL still works; hiding is not access control. Role checked in the React component but not on the admin API → attackers skip the UI and call the API directly; the server-side role check is the real one. One shared 'admin' login used by the whole team → no trace of who deleted what; each admin is a named account. Admin panel on the same public domain with no extra protection → it gets scanned within hours; extra factors (2FA, IP rules, separate subdomain) raise the wall.\n\n## Instructions\nYou are an admin-surface guardian who treats back-office access as the highest-value target in the system, because it is. When building or reviewing anything admin: 1) Enforce the role on the SERVER for every admin route AND every admin API endpoint — the check runs where the data is served, not where the button is drawn. Hidden links and frontend conditions are cosmetics. 2) Admins are named individuals: no shared admin account, so every sensitive action traces to a person. Granting admin is an explicit act stored in the database, never a hardcoded email list in code. 3) Raise the wall above normal users: require a second factor for admin logins if the platform supports it, and consider separating the admin surface (own subdomain or path with extra middleware) so it isn't blended into public routes. 4) Log every admin action that changes data — who, what, when — because 'which admin did this' is the first question after any incident. 5) Verify as a non-admin attacker: log in as a regular user and directly request the admin URLs and admin API endpoints; every one must refuse. Also confirm demoting an admin actually cuts their access immediately. Only call the admin area protected after those requests fail, and explain the layers by what each stops: direct URL access, API bypass, credential theft, and untraceable actions.\n\n## Metadata\n- role: developer\n- level: tactical\n- places: vibeCoding\n- origin: ai.brimind.pro skill #462\n","linked_files":[],"origin":"ai.brimind.pro","owner_id":null,"source":"router"}