doctorlinux commited on
Commit
c9dfb34
·
verified ·
1 Parent(s): ec543fe

Upload 5 files

Browse files
Files changed (2) hide show
  1. README.md +1 -15
  2. app.py +46 -26
README.md CHANGED
@@ -10,18 +10,4 @@ pinned: false
10
 
11
  # Autoevaluación de Ciberseguridad Operativa
12
 
13
- Herramienta interactiva para evaluar tu postura de ciberseguridad con diagnóstico automatizado.
14
-
15
- ## 📋 Dominios Evaluados
16
-
17
- - 🔥 Perímetro y Firewall
18
- - 🖥️ Servidores y Hardening
19
- - 💾 Backups y Recuperación
20
- - 📊 Monitoreo y Alertas
21
- - 🌐 Red y Conectividad
22
- - 💻 Usuarios y Estaciones
23
- - 🌐 Web y Correo
24
-
25
- ---
26
-
27
- *Desarrollado por Doctor Linux - Expertos en Ciberseguridad Operativa*
 
10
 
11
  # Autoevaluación de Ciberseguridad Operativa
12
 
13
+ Herramienta profesional para evaluación de seguridad con análisis IA.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app.py CHANGED
@@ -5,8 +5,6 @@ from pydantic import BaseModel
5
  from typing import List
6
 
7
  app = FastAPI()
8
-
9
- # Servir archivos estáticos
10
  app.mount("/static", StaticFiles(directory="."), name="static")
11
 
12
  class DomainScore(BaseModel):
@@ -19,48 +17,70 @@ class AnalysisRequest(BaseModel):
19
 
20
  @app.post("/analyze")
21
  async def analyze(data: AnalysisRequest):
22
- # Análisis básico sin IA para evitar problemas
23
  analysis = f"""
24
- 🔒 **DIAGNÓSTICO DE CIBERSEGURIDAD - DOCTOR LINUX**
25
 
26
  **PUNTAJE GLOBAL:** {data.overall}%
27
 
28
- **RESUMEN:**
29
- {"✅ POSTURA SÓLIDA - Buen trabajo en controles de seguridad" if data.overall >= 80 else
30
- "⚠️ POSTURA MEDIA - Se requieren mejoras en algunos controles" if data.overall >= 60 else
31
- "🚨 RIESGO ELEVADO - Atención inmediata requerida"}
 
 
 
32
 
33
- **DETALLE POR DOMINIOS:**
34
- {chr(10).join([f"• {domain.name}: {domain.score}%" for domain in data.domains])}
35
 
36
  **RECOMENDACIONES PRIORITARIAS:**
37
- 1. Endurecer perímetro con reglas mínimas necesarias
38
- 2. Implementar estrategia de backups 3-2-1 con pruebas
39
- 3. Establecer monitoreo centralizado 24/7
40
- 4. Aplicar hardening en servidores y estaciones
41
- 5. Implementar autenticación multifactor (MFA)
42
 
43
- **PRÓXIMOS PASOS SUGERIDOS:**
44
- Solicitar diagnóstico técnico gratuito
45
- Desarrollar plan de remediación priorizado
46
- Establecer métricas de seguimiento continuo
 
47
 
48
  ---
49
- *Diagnóstico generado por Doctor Linux - Expertos en Ciberseguridad Operativa*
50
  """
51
  return {"analysis": analysis}
52
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
53
  @app.get("/")
54
  async def read_root():
55
  try:
56
  with open("index.html", "r", encoding="utf-8") as f:
57
  return HTMLResponse(content=f.read())
58
- except Exception as e:
59
- return HTMLResponse(content=f"<h1>Error cargando la aplicación</h1><p>{e}</p>")
60
-
61
- @app.get("/health")
62
- async def health_check():
63
- return {"status": "healthy", "service": "Cibertest Doctor Linux"}
64
 
65
  if __name__ == "__main__":
66
  import uvicorn
 
5
  from typing import List
6
 
7
  app = FastAPI()
 
 
8
  app.mount("/static", StaticFiles(directory="."), name="static")
9
 
10
  class DomainScore(BaseModel):
 
17
 
18
  @app.post("/analyze")
19
  async def analyze(data: AnalysisRequest):
 
20
  analysis = f"""
21
+ 🔒 **ANÁLISIS AVANZADO DE CIBERSEGURIDAD - DOCTOR LINUX**
22
 
23
  **PUNTAJE GLOBAL:** {data.overall}%
24
 
25
+ **EVALUACIÓN ESTRATÉGICA:**
26
+ {"✅ POSTURA SÓLIDA - Controles robustos implementados" if data.overall >= 80 else
27
+ "⚠️ POSTURA MEDIA - Se requieren mejoras en controles críticos" if data.overall >= 60 else
28
+ "🚨 RIESGO ELEVADO - Atención inmediata requerida en múltiples áreas"}
29
+
30
+ **ANÁLISIS DETALLADO POR DOMINIO:**
31
+ {chr(10).join([f"• {domain.name}: {domain.score}% - {get_domain_analysis(domain.name, domain.score)}" for domain in data.domains])}
32
 
33
+ **RIESGOS IDENTIFICADOS:**
34
+ {get_risk_analysis(data.domains)}
35
 
36
  **RECOMENDACIONES PRIORITARIAS:**
37
+ 1. Implementar controles básicos en áreas críticas
38
+ 2. Establecer monitoreo continuo 24/7
39
+ 3. Desarrollar plan de respuesta a incidentes
40
+ 4. Realizar auditoría de seguridad profunda
41
+ 5. Capacitar equipo en mejores prácticas
42
 
43
+ **ROADMAP SUGERIDO:**
44
+ SEMANA 1: Contención de riesgos críticos
45
+ SEMANA 2-4: Implementación controles básicos
46
+ MES 2-3: Mejora de madurez operacional
47
+ • MES 4-6: Optimización y automatización
48
 
49
  ---
50
+ *Análisis generado por Doctor Linux - Expertos en Ciberseguridad Operativa*
51
  """
52
  return {"analysis": analysis}
53
 
54
+ def get_domain_analysis(name, score):
55
+ if score >= 80:
56
+ return "Control robusto - Mantener y documentar"
57
+ elif score >= 60:
58
+ return "Control aceptable - Mejorar procesos"
59
+ else:
60
+ return "Control crítico - Acción inmediata requerida"
61
+
62
+ def get_risk_analysis(domains):
63
+ critical = [d for d in domains if d.score < 60]
64
+ medium = [d for d in domains if 60 <= d.score < 80]
65
+
66
+ analysis = ""
67
+ if critical:
68
+ analysis += "🚨 RIESGOS CRÍTICOS:\n"
69
+ analysis += chr(10).join([f" - {d.name} ({d.score}%): Exposición alta\n" for d in critical])
70
+
71
+ if medium:
72
+ analysis += "⚠️ RIESGOS MEDIOS:\n"
73
+ analysis += chr(10).join([f" - {d.name} ({d.score}%): Mejora necesaria\n" for d in medium])
74
+
75
+ return analysis
76
+
77
  @app.get("/")
78
  async def read_root():
79
  try:
80
  with open("index.html", "r", encoding="utf-8") as f:
81
  return HTMLResponse(content=f.read())
82
+ except:
83
+ return HTMLResponse(content="<h1>Error: Archivo index.html no encontrado</h1>")
 
 
 
 
84
 
85
  if __name__ == "__main__":
86
  import uvicorn