Commit Graph

18 Commits (ea451f2f5bb89fe4c12e2c117ace8c021cafd914)

Author SHA1 Message Date
Manuel Aranda Rosales 1bf33e73d1 ref 2995. Actualizar roles. 2026-07-09 10:15:09 +02:00
Nicolas Arenas 3d0883a0bd fix(ogcore): corregir rutas de firewall y provider de DELETE en OUs
testing/ogcore-api/pipeline/head There was a failure building this commit Details
ogcore-debian-package/pipeline/head This commit looks good Details
testing/ogcore-api/pipeline/pr-main Build started... Details
Dos bugs introducidos en fix_permissions:

1. access_control paths incorrectos: nginx elimina el prefijo /api/ antes
   de llegar a ogcore, por lo que las rutas reales son /clients y
   /organizational-units (sin /api/). Las reglas anteriores con ^/api/clients$
   y ^/api/organizational-units$ nunca coincidían.

2. OrganizationalUnitProvider no manejaba Delete: el switch del provider
   no tenía case para Delete, devolvía null implícitamente y API Platform
   respondía 404 a cualquier usuario que intentara borrar una OU.
   Quitando el provider del DELETE, el proveedor Doctrine por defecto carga
   la entidad correctamente y la expresión security: del YAML puede evaluarse.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-16 11:20:43 +02:00
Nicolas Arenas cb3a8aa58a fix(ogcore): permitir a ogLive consultar clientes vía API key
Añade regla access_control para que ROLE_OGCLIENT_API pueda hacer GET
en /clients. Sin esta regla, ogLive no puede consultar la configuración
del equipo por IP al arrancar (el catch-all ROLE_USER bloquearía la
petición porque ogclient_api_user no tiene ese rol).

Ya existía la misma excepción para /commands.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-15 11:57:15 +02:00
Nicolas Arenas 06bca9395e fix(ogcore): bloquear creación de clientes y OUs a nivel de firewall
Añade reglas access_control al firewall de Symfony para los endpoints
POST /api/clients y POST /api/organizational-units, restringiendo el
acceso a ROLE_SUPER_ADMIN y ROLE_ORGANIZATIONAL_UNIT_ADMIN.

La comprobación a nivel de firewall se ejecuta antes de que API Platform
procese la petición (antes de deserialización y validación del DTO), lo
que garantiza un HTTP 403 inmediato sin necesidad de que el cuerpo de la
petición sea válido.

Las reglas usan el ancla $ para que no afecten a sub-rutas como
/api/clients/server/reboot, /api/clients/server/boot-client, etc.
2026-05-27 14:45:55 +02:00
Juan Manuel Bardallo 379218ef20 Modificacion en security para permitir acceso a la api al ROLE_USER en
testing/ogcore-api/pipeline/head There was a failure building this commit Details
lugar de IS_AUTHENTICATED_FULLY, ya que en ese caso un cliente con rol
ROLE_OGCLIENT_API podría acceder a toda la api y solo queremos dar
acceso a commands
2026-03-16 14:48:13 +01:00
Juan Manuel Bardallo c3a84ecbfc Añadido ApiKeyAuthenticator para acceso seguro de clientes
testing/ogcore-api/pipeline/head There was a failure building this commit Details
testing/ogcore-api/pipeline/pr-main Build started... Details
- Implementado ApiKeyAuthenticator para proteger el endpoint /commands usando la cabecera X-API-KEY.
- Añadido soporte para OGCLIENT_API_KEY en env.json para centralizar su gestión desde el oggui.
- Modificado PostAction (PxeBootFile) para inyectar la API Key en el JSON enviado a ogBoot.
2026-03-16 14:01:42 +01:00
Manuel Aranda Rosales 6abf065dec Published validate endpoint
testing/ogcore-api/pipeline/head There was a failure building this commit Details
2025-05-27 13:37:12 +02:00
Manuel Aranda Rosales 3ad5b23e67 refs #1287. Created menu templates and controller
testing/ogcore-api/pipeline/head There was a failure building this commit Details
2024-12-20 07:57:57 +01:00
Manuel Aranda Rosales 03e36f6218 refs #1087. CreateImage. Output and webhooks controllers
testing/ogcore-api/pipeline/head There was a failure building this commit Details
2024-11-15 09:39:35 +01:00
Manuel Aranda Rosales c32363c974 Updated Partition and Image. Added UDS endpoints
testing/ogcore-api/pipeline/head This commit looks good Details
2024-10-08 12:29:51 +02:00
Manuel Aranda Rosales 4cfa700e91 Merge OGBoot branch
testing/ogcore-api/pipeline/head There was a failure building this commit Details
2024-09-30 11:22:30 +02:00
Manuel Aranda Rosales ebd3d7e539 refs #658. OgBoot Webhook 2024-09-04 10:14:52 +02:00
Manuel Aranda Rosales 782c345f43 refs #624. Added ogAgent controller API 2024-08-21 09:37:17 +02:00
Manuel Aranda Rosales 7ba4deaafa refs #512. API Crud views 2024-07-18 08:24:56 +02:00
Manuel Aranda Rosales b652f70973 refs #379. Fixed error UserInput create 2024-05-29 21:48:54 +02:00
Manuel Aranda Rosales 59545b4fed Updated dockerfile, and config 2024-05-21 12:51:05 +02:00
Manuel Aranda Rosales a765da2d9c refs #381 Crear UserInterface y configurar el security.yaml 2024-05-20 10:51:46 +02:00
Manuel Aranda 558f8d12f2 First commit new symfony project OgCore 2024-05-16 15:23:44 +02:00