SEC-CHECKLIST-001: Checklist de Autorizacion y Seguridad
Identificador: TECH-SEC-CHECKLIST-001
Version: 1.0.0
Fecha: 2025-12-09
Autor: SecurityDrone (MTS-DRN-SEC-001)
Refs: 04-seguridad-cliente.md, TECH-SEC-SERVER-001
Estado: Aprobado (DV2-P2)
1. Introduccion
1.1. Proposito
Este documento proporciona checklists de seguridad para:
- Validacion de autorizacion por endpoint
- Revision de seguridad pre-release
- Auditoria periodica de seguridad
- Onboarding de desarrolladores
1.2. Uso
Cada checklist debe completarse antes del evento correspondiente (PR merge, release, auditoria).
2. Checklist de Autorizacion por Endpoint
2.1. API de Sincronizacion (SYNC)
| Endpoint |
Auth |
Tier Check |
Device Check |
RLS |
Validado |
GET /sync/status |
JWT |
- |
X-Device-ID |
N/A |
[ ] |
POST /sync/push |
JWT |
Pro+ |
X-Device-ID |
user_id |
[ ] |
GET /sync/pull |
JWT |
Pro+ |
X-Device-ID |
user_id |
[ ] |
POST /sync/resolve |
JWT |
Pro+ |
X-Device-ID |
user_id |
[ ] |
GET /sync/conflicts |
JWT |
Pro+ |
X-Device-ID |
user_id |
[ ] |
POST /sync/full |
JWT |
Pro+ |
X-Device-ID |
user_id |
[ ] |
GET /sync/full/{id} |
JWT |
Pro+ |
X-Device-ID |
user_id |
[ ] |
GET /sync/health |
None |
- |
- |
N/A |
[ ] |
2.2. API de Medicamentos (MED)
| Endpoint |
Auth |
Tier Check |
Owner Check |
RLS |
Validado |
POST /medications |
JWT |
- |
N/A (create) |
user_id |
[ ] |
GET /medications |
JWT |
- |
user_id |
user_id |
[ ] |
GET /medications/{id} |
JWT |
- |
owner_check |
user_id |
[ ] |
PUT /medications/{id} |
JWT |
- |
owner_check |
user_id |
[ ] |
DELETE /medications/{id} |
JWT |
- |
owner_check |
user_id |
[ ] |
POST /medications/{id}/dose |
JWT |
- |
owner_check |
user_id |
[ ] |
2.3. API de Recetas (RX)
| Endpoint |
Auth |
Tier Check |
Owner Check |
RLS |
Validado |
POST /prescriptions |
JWT |
- |
N/A (create) |
user_id |
[ ] |
GET /prescriptions |
JWT |
- |
user_id |
user_id |
[ ] |
GET /prescriptions/{id} |
JWT |
- |
owner_check |
user_id |
[ ] |
PUT /prescriptions/{id} |
JWT |
- |
owner_check |
user_id |
[ ] |
DELETE /prescriptions/{id} |
JWT |
- |
owner_check |
user_id |
[ ] |
POST /prescriptions/ocr |
JWT |
Pro+ |
N/A |
N/A |
[ ] |
2.4. API de Alertas (ALT)
| Endpoint |
Auth |
Tier Check |
Owner Check |
RLS |
Validado |
POST /alerts |
JWT |
- |
N/A (create) |
user_id |
[ ] |
GET /alerts |
JWT |
- |
user_id |
user_id |
[ ] |
PUT /alerts/{id} |
JWT |
- |
owner_check |
user_id |
[ ] |
DELETE /alerts/{id} |
JWT |
- |
owner_check |
user_id |
[ ] |
POST /alerts/{id}/snooze |
JWT |
- |
owner_check |
user_id |
[ ] |
POST /alerts/{id}/acknowledge |
JWT |
- |
owner_check |
user_id |
[ ] |
2.5. API de Notificaciones (NTF)
| Endpoint |
Auth |
Tier Check |
Device Check |
RLS |
Validado |
POST /devices |
JWT |
- |
N/A (create) |
user_id |
[ ] |
DELETE /devices/{id} |
JWT |
- |
owner_check |
user_id |
[ ] |
GET /notifications/preferences |
JWT |
- |
- |
user_id |
[ ] |
PUT /notifications/preferences |
JWT |
- |
- |
user_id |
[ ] |
3. Checklist Pre-Release
3.1. Seguridad de Codigo
| Item |
Descripcion |
Verificado |
Notas |
| [ ] |
SAST ejecutado sin criticos |
|
|
| [ ] |
Dependencias actualizadas (no CVEs criticos) |
|
|
| [ ] |
Secrets scan limpio (no credenciales en codigo) |
|
|
| [ ] |
Input validation en todos los endpoints |
|
|
| [ ] |
Output encoding para prevenir XSS |
|
|
| [ ] |
SQL injection prevenido (prepared statements) |
|
|
3.2. Autenticacion y Autorizacion
| Item |
Descripcion |
Verificado |
Notas |
| [ ] |
JWT validacion implementada correctamente |
|
|
| [ ] |
Token expiracion configurada (1h access, 7d refresh) |
|
|
| [ ] |
Rate limiting activo en todos los endpoints |
|
|
| [ ] |
CORS configurado restrictivamente |
|
|
| [ ] |
RLS policies testeadas |
|
|
| [ ] |
Tier checks validados para features Pro/Perfect |
|
|
3.3. Criptografia
| Item |
Descripcion |
Verificado |
Notas |
| [ ] |
AES-256-GCM para cifrado E2E |
|
|
| [ ] |
Argon2id para derivacion de claves (m=64MB, t=3, p=4) |
|
|
| [ ] |
Nonces unicos por operacion (nunca reutilizados) |
|
|
| [ ] |
TLS 1.3 enforced |
|
|
| [ ] |
Certificate pinning activo |
|
|
| [ ] |
Claves almacenadas en Keychain/Keystore |
|
|
3.4. Datos Sensibles
| Item |
Descripcion |
Verificado |
Notas |
| [ ] |
PHI nunca en logs |
|
|
| [ ] |
PHI nunca en URLs |
|
|
| [ ] |
PHI nunca en analytics |
|
|
| [ ] |
PHI siempre cifrado E2E antes de sync |
|
|
| [ ] |
Backup cifrado correctamente |
|
|
| [ ] |
Borrado seguro implementado |
|
|
| Item |
iOS |
Android |
Notas |
| [ ] |
Jailbreak detection |
Root detection |
|
| [ ] |
App Transport Security |
Network Security Config |
|
| [ ] |
Keychain con Secure Enclave |
Keystore con StrongBox |
|
| [ ] |
Data Protection API |
Encrypted Shared Prefs |
|
| [ ] |
Screen capture prevention |
FLAG_SECURE |
|
4. Checklist de Auditoria Trimestral
4.1. Revision de Accesos
| Item |
Descripcion |
Completado |
Fecha |
| [ ] |
Revisar usuarios con acceso a produccion |
|
|
| [ ] |
Rotar API keys de servicios externos |
|
|
| [ ] |
Verificar MFA activo para todos los admins |
|
|
| [ ] |
Auditar logs de acceso a DB |
|
|
| [ ] |
Revisar permisos de GitHub/repos |
|
|
4.2. Pruebas de Seguridad
| Item |
Descripcion |
Completado |
Fecha |
| [ ] |
Ejecutar DAST contra staging |
|
|
| [ ] |
Revisar resultados de bug bounty (si aplica) |
|
|
| [ ] |
Test de penetracion (anual minimo) |
|
|
| [ ] |
Simular breach de servidor (datos ilegibles?) |
|
|
| [ ] |
Test de DR (disaster recovery) |
|
|
4.3. Compliance
| Item |
Descripcion |
Completado |
Fecha |
| [ ] |
Verificar cumplimiento HIPAA |
|
|
| [ ] |
Verificar cumplimiento LGPD |
|
|
| [ ] |
Actualizar privacy policy si necesario |
|
|
| [ ] |
Revisar data retention policies |
|
|
| [ ] |
Verificar BAAs con vendors vigentes |
|
|
5. Checklist de Onboarding de Desarrollador
5.1. Conocimiento Requerido
| Item |
Descripcion |
Confirmado |
| [ ] |
Leer 04-seguridad-cliente.md completo |
|
| [ ] |
Entender arquitectura Zero-Knowledge |
|
| [ ] |
Conocer clasificacion de datos PHI vs no-PHI |
|
| [ ] |
Entender flujo de cifrado E2E |
|
| [ ] |
Conocer OWASP Mobile Top 10 |
|
5.2. Herramientas y Acceso
| Item |
Descripcion |
Configurado |
| [ ] |
MFA configurado en GitHub |
|
| [ ] |
MFA configurado en Supabase |
|
| [ ] |
MFA configurado en Firebase |
|
| [ ] |
GPG key para commits firmados |
|
| [ ] |
Acceso solo a ambientes necesarios |
|
5.3. Compromisos
| Item |
Descripcion |
Firmado |
| [ ] |
No copiar datos de produccion a local |
|
| [ ] |
No exponer credenciales en codigo |
|
| [ ] |
Reportar vulnerabilidades inmediatamente |
|
| [ ] |
No deshabilitar validaciones de seguridad |
|
6. Matriz de Permisos por Rol
6.1. Roles de Usuario (App)
| Permiso |
PI (Paciente) |
PD (Dependiente) |
CS (Cuidador) |
CR (Cuidador Restringido) |
| Ver sus medicamentos |
Si |
Si |
Via permiso |
Via permiso |
| Editar medicamentos |
Si |
No |
Si/No config |
No |
| Ver historial dosis |
Si |
Si |
Via permiso |
Via permiso |
| Registrar dosis |
Si |
Si |
Si/No config |
No |
| Configurar alertas |
Si |
No |
Si/No config |
No |
| Ver recetas |
Si |
No |
Via permiso |
No |
| Agregar recetas |
Si |
No |
Si/No config |
No |
| Usar OCR servidor |
Pro/Perfect |
No |
Pro/Perfect |
No |
| Sync multi-device |
Pro/Perfect |
No |
Pro/Perfect |
No |
6.2. Roles de Backend (Operaciones)
| Permiso |
Developer |
DevOps |
Admin |
Security |
| Acceso staging |
Si |
Si |
Si |
Si |
| Acceso produccion (read) |
No |
Si |
Si |
Si |
| Acceso produccion (write) |
No |
No |
Si |
No |
| Ver logs operativos |
Si |
Si |
Si |
Si |
| Ver datos usuario |
No |
No |
No |
No |
| Modificar RLS policies |
No |
No |
Si |
Si |
| Rotar secrets |
No |
Si |
Si |
Si |
| Acceso Supabase dashboard |
No |
Si |
Si |
No |
7. Procedimiento de Reporte de Vulnerabilidad
7.1. Clasificacion de Severidad
| Severidad |
Descripcion |
Tiempo de Respuesta |
| CRITICA |
Acceso a PHI, bypass de auth, RCE |
4 horas |
| ALTA |
Escalacion de privilegios, XSS, CSRF |
24 horas |
| MEDIA |
Information disclosure (no PHI), DoS |
72 horas |
| BAJA |
Best practices, minor issues |
1 semana |
7.2. Proceso de Reporte Interno
flowchart LR
A[Detectar vulnerabilidad] --> B[Clasificar severidad]
B -->|CRITICA/ALTA| C[Notificar Security Lead inmediatamente]
B -->|MEDIA/BAJA| D[Crear issue en repo privado]
C --> E[War room si necesario]
E --> F[Desarrollar fix]
D --> F
F --> G[Code review de seguridad]
G --> H[Deploy a staging]
H --> I[Verificar fix]
I --> J[Deploy a produccion]
J --> K[Post-mortem si CRITICA]
8. Referencias