GuardianUnivalle-Benito-Yucra 0.1.54__py3-none-any.whl → 0.1.55__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of GuardianUnivalle-Benito-Yucra might be problematic. Click here for more details.
- GuardianUnivalle_Benito_Yucra/auditoria/registro_auditoria.py +8 -10
- {guardianunivalle_benito_yucra-0.1.54.dist-info → guardianunivalle_benito_yucra-0.1.55.dist-info}/METADATA +1 -1
- {guardianunivalle_benito_yucra-0.1.54.dist-info → guardianunivalle_benito_yucra-0.1.55.dist-info}/RECORD +6 -6
- {guardianunivalle_benito_yucra-0.1.54.dist-info → guardianunivalle_benito_yucra-0.1.55.dist-info}/WHEEL +0 -0
- {guardianunivalle_benito_yucra-0.1.54.dist-info → guardianunivalle_benito_yucra-0.1.55.dist-info}/licenses/LICENSE +0 -0
- {guardianunivalle_benito_yucra-0.1.54.dist-info → guardianunivalle_benito_yucra-0.1.55.dist-info}/top_level.txt +0 -0
|
@@ -2,9 +2,8 @@ import os
|
|
|
2
2
|
import datetime
|
|
3
3
|
import json
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
LOG_FILE = os.path.join(LOG_DIR, "auditoria_guardian.log")
|
|
5
|
+
LOG_FILE = "auditoria_guardian.log"
|
|
6
|
+
|
|
8
7
|
|
|
9
8
|
def registrar_evento(
|
|
10
9
|
tipo: str,
|
|
@@ -12,10 +11,6 @@ def registrar_evento(
|
|
|
12
11
|
severidad: str = "MEDIA",
|
|
13
12
|
extra: dict | None = None,
|
|
14
13
|
):
|
|
15
|
-
"""
|
|
16
|
-
Registra un evento de auditoría en un archivo JSON línea por línea.
|
|
17
|
-
Cada línea representa un evento.
|
|
18
|
-
"""
|
|
19
14
|
try:
|
|
20
15
|
evento = {
|
|
21
16
|
"fecha": datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S"),
|
|
@@ -25,8 +20,10 @@ def registrar_evento(
|
|
|
25
20
|
"extra": extra or {},
|
|
26
21
|
}
|
|
27
22
|
|
|
28
|
-
# ✅ Crear carpeta si
|
|
29
|
-
os.
|
|
23
|
+
# ✅ Crear carpeta solo si hay directorio en la ruta
|
|
24
|
+
log_dir = os.path.dirname(LOG_FILE)
|
|
25
|
+
if log_dir:
|
|
26
|
+
os.makedirs(log_dir, exist_ok=True)
|
|
30
27
|
|
|
31
28
|
with open(LOG_FILE, "a", encoding="utf-8") as f:
|
|
32
29
|
f.write(json.dumps(evento, ensure_ascii=False) + "\n")
|
|
@@ -34,8 +31,9 @@ def registrar_evento(
|
|
|
34
31
|
except Exception as e:
|
|
35
32
|
print(f"[Auditoría] Error al registrar evento: {e}")
|
|
36
33
|
|
|
34
|
+
|
|
37
35
|
def generar_reporte() -> str:
|
|
38
|
-
"""Devuelve el contenido
|
|
36
|
+
"""Devuelve todo el contenido del archivo de auditoría."""
|
|
39
37
|
if not os.path.exists(LOG_FILE):
|
|
40
38
|
return "No hay registros aún."
|
|
41
39
|
with open(LOG_FILE, "r", encoding="utf-8") as f:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: GuardianUnivalle-Benito-Yucra
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.55
|
|
4
4
|
Summary: Middleware y detectores de seguridad (SQLi, XSS, CSRF, DoS, Keylogger) para Django/Flask
|
|
5
5
|
Author-email: Andres Benito Calle Yucra <benitoandrescalle035@gmail.com>
|
|
6
6
|
License: MIT
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
GuardianUnivalle_Benito_Yucra/__init__.py,sha256=lbIRb8fCFYfAdyJV6NsYVZJ5pKYSJZKhhK-En9g_1M8,762
|
|
2
2
|
GuardianUnivalle_Benito_Yucra/utilidades.py,sha256=lFNVnlyTSYmQ1CqtmHx6aefK5uNw0wsMdHRQyxAIZy0,120
|
|
3
|
-
GuardianUnivalle_Benito_Yucra/auditoria/registro_auditoria.py,sha256=
|
|
3
|
+
GuardianUnivalle_Benito_Yucra/auditoria/registro_auditoria.py,sha256=NnKBOeRWkXVGaMBeQRYU528rWlaBDBPmTAzfji9n8fw,1135
|
|
4
4
|
GuardianUnivalle_Benito_Yucra/criptografia/cifrado_aead.py,sha256=wfoRpaKvOqPbollNQsDNUNWClYJlXYTKTYvv0qcR6aI,962
|
|
5
5
|
GuardianUnivalle_Benito_Yucra/criptografia/intercambio_claves.py,sha256=9djnlzb022hUhrDbQyWz7lWLbkn_vQZ4K7qar1FXYmo,829
|
|
6
6
|
GuardianUnivalle_Benito_Yucra/criptografia/kdf.py,sha256=_sbepEY1qHEKga0ExrX2WRg1HeCPY5MC5CfXZWYyl-A,709
|
|
@@ -13,8 +13,8 @@ GuardianUnivalle_Benito_Yucra/middleware_web/middleware_web.py,sha256=23pLLYqliU
|
|
|
13
13
|
GuardianUnivalle_Benito_Yucra/mitigacion/limitador_peticion.py,sha256=ipMOebYhql-6mSyHs0ddYXOcXq9w8P_IXLlpiIqGncw,246
|
|
14
14
|
GuardianUnivalle_Benito_Yucra/mitigacion/lista_bloqueo.py,sha256=6AYWII4mrmwCLHCvGTyoBxR4Oasr4raSHpFbVjqn7d8,193
|
|
15
15
|
GuardianUnivalle_Benito_Yucra/puntuacion/puntuacion_amenaza.py,sha256=Wx5XfcII4oweLvZsTBEJ7kUc9pMpP5-36RfI5C5KJXo,561
|
|
16
|
-
guardianunivalle_benito_yucra-0.1.
|
|
17
|
-
guardianunivalle_benito_yucra-0.1.
|
|
18
|
-
guardianunivalle_benito_yucra-0.1.
|
|
19
|
-
guardianunivalle_benito_yucra-0.1.
|
|
20
|
-
guardianunivalle_benito_yucra-0.1.
|
|
16
|
+
guardianunivalle_benito_yucra-0.1.55.dist-info/licenses/LICENSE,sha256=5e4IdL542v1E8Ft0A24GZjrxZeTsVK7XrS3mZEUhPtM,37
|
|
17
|
+
guardianunivalle_benito_yucra-0.1.55.dist-info/METADATA,sha256=pWt4R881V1M_duT10EjCspfWjmh1O37oDaSi4rLhPbM,1893
|
|
18
|
+
guardianunivalle_benito_yucra-0.1.55.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
19
|
+
guardianunivalle_benito_yucra-0.1.55.dist-info/top_level.txt,sha256=HTWfZM64WAV_QYr5cnXnLuabQt92dvlxqlR3pCwpbDQ,30
|
|
20
|
+
guardianunivalle_benito_yucra-0.1.55.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|