Spaces:
Sleeping
Sleeping
Commit
·
551a5dc
1
Parent(s):
d4fbeb6
feat: Added AGENTS.md, changed Pipfile and fix logic in app
Browse files- AGENTS.md +20 -0
- Pipfile +2 -4
- src/streamlit_app.py +11 -6
AGENTS.md
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# AGENTS.md
|
| 2 |
+
|
| 3 |
+
## Project overview
|
| 4 |
+
This software project aims to create a web application that allows users to enter technical details of a security incident or alert and obtain a draft incident report.
|
| 5 |
+
|
| 6 |
+
The app currently uses the Streamlit framework for the graphical interface and backend logic. No data is stored, so there is no data persistence layer.
|
| 7 |
+
|
| 8 |
+
Hosted on HuggingFace.
|
| 9 |
+
|
| 10 |
+
## Setup commands
|
| 11 |
+
- Install deps: `pipenv install`
|
| 12 |
+
- Start dev server: `pipenv run streamlit run .\src\streamlit_app.py`
|
| 13 |
+
- Run tests: Tests doesn't exists yet
|
| 14 |
+
|
| 15 |
+
## Code style
|
| 16 |
+
- Python best practices: https://peps.python.org/pep-0008/
|
| 17 |
+
- Use double-quoted when possible.
|
| 18 |
+
|
| 19 |
+
## Contribution guidelines
|
| 20 |
+
- Follow the Conventional Commits guidelines when commit changes: https://www.conventionalcommits.org/
|
Pipfile
CHANGED
|
@@ -4,10 +4,8 @@ verify_ssl = true
|
|
| 4 |
name = "pypi"
|
| 5 |
|
| 6 |
[packages]
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
streamlit = "*"
|
| 10 |
-
google-genai = "*"
|
| 11 |
|
| 12 |
[dev-packages]
|
| 13 |
|
|
|
|
| 4 |
name = "pypi"
|
| 5 |
|
| 6 |
[packages]
|
| 7 |
+
streamlit = "~=1.50.0"
|
| 8 |
+
google-genai = "~=1.42.0"
|
|
|
|
|
|
|
| 9 |
|
| 10 |
[dev-packages]
|
| 11 |
|
src/streamlit_app.py
CHANGED
|
@@ -132,10 +132,10 @@ def generar_post_mortem(api_key, tipo_alerta, sistema, fecha_hora, impacto, acci
|
|
| 132 |
|
| 133 |
# 2. Definir la instrucción (System Instruction)
|
| 134 |
system_instruction = (
|
| 135 |
-
"Eres un
|
| 136 |
-
"Post-Mortem conciso y profesional, estructurado con las secciones: "
|
| 137 |
"'Resumen Ejecutivo', 'Qué Sucedió (Timeline)', 'Análisis de Causa Raíz', "
|
| 138 |
-
"'Impacto del Negocio' y 'Acciones
|
| 139 |
"Usa Markdown (##) para los encabezados y un tono técnico y formal. "
|
| 140 |
"No añadas introducciones ni conclusiones fuera del formato solicitado."
|
| 141 |
)
|
|
@@ -146,8 +146,12 @@ def generar_post_mortem(api_key, tipo_alerta, sistema, fecha_hora, impacto, acci
|
|
| 146 |
- **Tipo de Alerta/Problema Principal**: {tipo_alerta}
|
| 147 |
- **Sistema Afectado**: {sistema}
|
| 148 |
- **Fecha y Hora de Inicio**: {fecha_hora}
|
| 149 |
-
|
| 150 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 151 |
"""
|
| 152 |
|
| 153 |
try:
|
|
@@ -235,5 +239,6 @@ if submitted:
|
|
| 235 |
label="Descargar Informe (.md)",
|
| 236 |
data=informe,
|
| 237 |
file_name="post_mortem_incidencia.md",
|
| 238 |
-
mime="text/markdown"
|
|
|
|
| 239 |
)
|
|
|
|
| 132 |
|
| 133 |
# 2. Definir la instrucción (System Instruction)
|
| 134 |
system_instruction = (
|
| 135 |
+
"Eres un especialista Incident Response en Ciberseguridad. Tu tarea es generar un informe "
|
| 136 |
+
"Post-Mortem conciso y profesional de incidentes de ciberseguridad, estructurado con las secciones: "
|
| 137 |
"'Resumen Ejecutivo', 'Qué Sucedió (Timeline)', 'Análisis de Causa Raíz', "
|
| 138 |
+
"'Impacto del Negocio' y 'Acciones Realizadas'. "
|
| 139 |
"Usa Markdown (##) para los encabezados y un tono técnico y formal. "
|
| 140 |
"No añadas introducciones ni conclusiones fuera del formato solicitado."
|
| 141 |
)
|
|
|
|
| 146 |
- **Tipo de Alerta/Problema Principal**: {tipo_alerta}
|
| 147 |
- **Sistema Afectado**: {sistema}
|
| 148 |
- **Fecha y Hora de Inicio**: {fecha_hora}
|
| 149 |
+
|
| 150 |
+
## Detalles para el Informe Post-Mortem:
|
| 151 |
+
{impacto}
|
| 152 |
+
|
| 153 |
+
## Acciones realizadas:
|
| 154 |
+
{acciones}
|
| 155 |
"""
|
| 156 |
|
| 157 |
try:
|
|
|
|
| 239 |
label="Descargar Informe (.md)",
|
| 240 |
data=informe,
|
| 241 |
file_name="post_mortem_incidencia.md",
|
| 242 |
+
mime="text/markdown",
|
| 243 |
+
on_click="ignore"
|
| 244 |
)
|