deploy-branch / deploy (push) Failing after 3m7s
deploy-branch / teardown (push) Skipped
tests / Unitarias + componente + build (push) Failing after 3m17s
tests / Integración (Nominatim real, opt-in) (push) Skipped
tests / Unitarias + componente + build (pull_request) Failing after 3m10s
tests / Integración (Nominatim real, opt-in) (pull_request) Skipped
Cambio openspec hide-admin-route: las rutas de administración se montan bajo LOCALESP_ADMIN_PREFIX (única variable, obligatoria, sin valor por defecto) y las rutas históricas /api/... dejan de existir (404 natural). - server: autocarga de .env (sin pisar el entorno) y fail-fast claro si falta LOCALESP_ADMIN_PREFIX; reportar/confirmar siguen públicas - frontend: src/api.js usa el prefijo expuesto por Vite (envPrefix); npm run build falla sin la variable; proxy de dev la lee vía loadEnv - .env.example como template único de configuración - tests: 109/109 en verde (rutas bajo prefijo, 404s históricos y fail-fast sin configurar) - openspec: artefactos del cambio sincronizados (design/spec/tasks)
1.3 KiB
1.3 KiB
Hide Admin Route
Why
The /api/pendientes endpoint (admin-only) and /api/reportes endpoint are currently exposed at obvious routes, making them easy targets for attackers. By default, the admin panel URL is well-known or discoverable via route enumeration (/admin, /admin/api/pendientes, /api/pendientes). This increases the attack surface of the application.
By obscuring or moving the admin route, we increase the effort required for attackers to find the admin panel, reducing the likelihood of unwanted access.
What Changes
- New capability:
route-obfuscation— middleware-based approach to hide the admin API routes by redirecting access attempts and serving a 404 or custom page. - Modify server configuration to intercept requests to known admin API routes and return a 404 or redirect to a custom page.
Capabilities
New Capabilities
- route-obfuscation: Protects admin routes (
/api/pendientes,/api/reportes,/api/locales/:id/*) by returning a 404 response when accessed without authentication, without exposing the route listing in response to global route enumeration.
Impact
- Affects the server configuration in
server/index.js. - Adds middleware to filter/admin route protection.
- Does not change the API contract for authenticated users.
- No database changes required.