Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
406c3d0
RBAC: migración inicial Alembic + unificación modelos/servicios y tests
Neiland85 Oct 30, 2025
9b42c19
CI: add GitHub Actions workflow (alembic upgrade head + pytest) and R…
Neiland85 Oct 30, 2025
8c0f67e
CI: add Conventional Commits check and Trivy FS scan (CRITICAL)
Neiland85 Oct 30, 2025
da45c27
Governance: add CODEOWNERS for critical paths (auth, models, alembic,…
Neiland85 Oct 30, 2025
07fcf44
style(user_service): format error messages for Ruff EM101
Neiland85 Oct 30, 2025
148320d
refactor(password): remove duplicate functions and imports
Neiland85 Oct 30, 2025
6f66db0
refactor(auth): add type hints and dependency singletons (Bandit B008)
Neiland85 Oct 30, 2025
a6efb87
refactor(users): consolidate uuid import, add type hints and dependen…
Neiland85 Oct 30, 2025
b758d9c
refactor(roles): consolidate uuid imports, add type hints and depende…
Neiland85 Oct 30, 2025
6ad0fad
refactor(operator): use absolute imports, add type hints and dependen…
Neiland85 Oct 30, 2025
dfa5dce
Fix: repair git integrity, pre-commit hooks, and YAML duplicate keys
Neiland85 Oct 30, 2025
5ab87cd
Enhance CI workflow and code quality checks; update Alembic migration…
Neiland85 Oct 30, 2025
f8015b7
Initial plan (#41)
Copilot Oct 30, 2025
414b00a
Initial plan (#43)
Copilot Oct 30, 2025
970298f
Chore: corrige formato post-ruff
Neiland85 Oct 30, 2025
bcd448d
Fix TC006: Quote type expressions in typing.cast() (#68)
Copilot Oct 30, 2025
170021c
style(black): format codebase to satisfy CI Black check
Neiland85 Oct 30, 2025
96a94ad
fix(auth): truncate to 72 bytes for bcrypt; deps: bcrypt>=4.0.0
Neiland85 Oct 30, 2025
8f168f5
chore(dependabot): enable security updates with grouped PRs for pip a…
Neiland85 Oct 30, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
140 changes: 25 additions & 115 deletions .bandit
Original file line number Diff line number Diff line change
@@ -1,115 +1,25 @@
[bandit]
# 🔒 Configuración de Bandit Security Scanner para NeuroBank FastAPI Toolkit
# Versión optimizada para aplicaciones bancarias con alta seguridad

# Excluir directorios que no requieren scanning
exclude_dirs = [
"/tests", # Tests pueden usar asserts y mocks
"/app/tests", # Tests específicos de la app
".venv", # Entorno virtual
"venv", # Alternativa de entorno virtual
"__pycache__", # Cache de Python
".pytest_cache", # Cache de pytest
"node_modules", # Si hay dependencias JS
".git" # Control de versiones
]

# Saltar tests específicos que son false positives o necesarios
skips = [
"B101", # assert_used - Los asserts son normales en tests
"B601", # paramiko_calls - No usamos paramiko
"B602", # subprocess_popen_with_shell_equals_true - Controlado
"B603", # subprocess_without_shell_equals_true - Permitido si es necesario
"B607", # start_process_with_partial_path - Paths relativos OK en algunos casos
]

# Nivel de confianza mínimo para reportar (HIGH para production banking)
confidence = "MEDIUM"

# Nivel de severidad (LOW, MEDIUM, HIGH)
severity = "LOW"

# Formato de salida (txt, json, csv, xml)
format = "json"

# Incluir archivos específicos si es necesario
# include = ["*.py"]

# Configurar plugins específicos (opcional)
# plugins = ["B301", "B302"]

# Número máximo de líneas de código por función antes de warning
max_lines_per_function = 100

# Tests adicionales específicos para aplicaciones bancarias
tests = [
"B102", # exec_used
"B103", # set_bad_file_permissions
"B104", # hardcoded_bind_all_interfaces
"B105", # hardcoded_password_string
"B106", # hardcoded_password_funcarg
"B107", # hardcoded_password_default
"B108", # hardcoded_tmp_directory
"B110", # try_except_pass
"B112", # try_except_continue
"B201", # flask_debug_true
"B301", # pickle
"B302", # pickle_loads
"B303", # md5
"B304", # md5_insecure
"B305", # cipher
"B306", # mktemp_q
"B307", # eval
"B308", # mark_safe
"B309", # httpsconnection
"B310", # urllib_urlopen
"B311", # random
"B312", # telnetlib
"B313", # xml_bad_cElementTree
"B314", # xml_bad_ElementTree
"B315", # xml_bad_expatreader
"B316", # xml_bad_expatbuilder
"B317", # xml_bad_sax
"B318", # xml_bad_minidom
"B319", # xml_bad_pulldom
"B320", # xml_bad_etree
"B321", # ftplib
"B322", # input
"B323", # unverified_context
"B324", # hashlib_insecure_functions
"B325", # tempnam
"B401", # import_telnetlib
"B402", # import_ftplib
"B403", # import_pickle
"B404", # import_subprocess
"B405", # import_xml_etree
"B406", # import_xml_sax
"B407", # import_xml_expat
"B408", # import_xml_minidom
"B409", # import_xml_pulldom
"B410", # import_lxml
"B411", # import_xmlrpclib
"B412", # import_httpoxy
"B413", # import_pycrypto
"B501", # request_with_no_cert_validation
"B502", # ssl_with_bad_version
"B503", # ssl_with_bad_defaults
"B504", # ssl_with_no_version
"B505", # weak_cryptographic_key
"B506", # yaml_load
"B507", # ssh_no_host_key_verification
"B601", # paramiko_calls
"B602", # subprocess_popen_with_shell_equals_true
"B603", # subprocess_without_shell_equals_true
"B604", # any_other_function_with_shell_equals_true
"B605", # start_process_with_a_shell
"B606", # start_process_with_no_shell
"B607", # start_process_with_partial_path
"B608", # hardcoded_sql_expressions
"B609", # linux_commands_wildcard_injection
"B610", # django_extra_used
"B611", # django_rawsql_used
"B701", # jinja2_autoescape_false
"B702", # use_of_mako_templates
"B703", # django_mark_safe
]
---
exclude_dirs:
- tests
- app/tests
- .venv
- venv
- __pycache__
- .pytest_cache
- node_modules
- .git

skips:
- B101 # assert_used - Los asserts son normales en tests
- B601 # paramiko_calls - No usamos paramiko
- B602 # subprocess_popen_with_shell_equals_true - Controlado
- B603 # subprocess_without_shell_equals_true - Permitido si es necesario
- B607 # start_process_with_partial_path - Paths relativos OK en algunos casos

confidence: MEDIUM
severity: LOW
format: json

max_lines_per_function: 100

tests: []
25 changes: 25 additions & 0 deletions .bandit.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Bandit YAML configuration for NeuroBank FastAPI Toolkit
exclude_dirs:
- tests
- app/tests
- .venv
- venv
- __pycache__
- .pytest_cache
- node_modules
- .git

skips:
- B101 # assert_used
- B601 # paramiko_calls
- B602 # subprocess_popen_with_shell_equals_true
- B603 # subprocess_without_shell_equals_true
- B607 # start_process_with_partial_path

confidence: MEDIUM
severity: LOW
format: json

# Optional includes (commented):
# include:
# - "*.py"
22 changes: 22 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Code owners for critical paths
# Syntax: https://docs.github.com/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners

# RBAC/authentication
/app/auth/* @Neiland85
/app/models.py @Neiland85
/app/security.py @Neiland85

# Database & migrations
/alembic/** @Neiland85
/app/database.py @Neiland85

# API routers for RBAC
/app/routers/auth.py @Neiland85
/app/routers/users.py @Neiland85
/app/routers/roles.py @Neiland85

# CI/CD workflows
/.github/workflows/** @Neiland85

# Docs
/docs/** @Neiland85
40 changes: 40 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Bug Report
description: Reporta un fallo reproducible en la app
labels: [bug]
title: "bug: [componente] resumen breve"
body:
- type: textarea
id: resumen
attributes:
label: Resumen
description: ¿Qué está pasando?
placeholder: Descripción breve del bug
validations:
required: true
- type: textarea
id: pasos
attributes:
label: Pasos para reproducir
description: Cómo reproducir el problema
placeholder: |
1. ...
2. ...
3. ...
validations:
required: true
- type: textarea
id: esperado
attributes:
label: Comportamiento esperado
validations:
required: true
- type: input
id: version
attributes:
label: Versión/commit
placeholder: vX.Y.Z o SHA
- type: textarea
id: logs
attributes:
label: Logs relevantes
render: shell
5 changes: 5 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
blank_issues_enabled: false
contact_links:
- name: Q&A / Soporte
url: https://github.com/OWNER/REPO/discussions
about: Usa Discussions para preguntas generales.
33 changes: 33 additions & 0 deletions .github/ISSUE_TEMPLATE/lint_error.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Lint/Build Error
description: Error de linter, type-check o build (creado desde logs)
labels: [lint, automation]
title: "lint: [tool] breve mensaje"
body:
- type: input
id: tool
attributes:
label: Herramienta
placeholder: ruff | mypy | pytest | eslint | otros
validations:
required: true
- type: input
id: archivo
attributes:
label: Archivo
placeholder: ruta/archivo:línea
- type: textarea
id: mensaje
attributes:
label: Mensaje
description: Mensaje exacto del error
validations:
required: true
- type: textarea
id: reproduccion
attributes:
label: Reproducción
description: Comando exacto para reproducir
placeholder: |
ejemplo: ruff check app/
validations:
required: true
24 changes: 24 additions & 0 deletions .github/ISSUE_TEMPLATE/tech_debt.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Tech Debt
description: Trabajo de mantenimiento o refactor sin bug directo
labels: [tech-debt]
title: "debt: [área] resumen breve"
body:
- type: textarea
id: motivacion
attributes:
label: Motivación / Riesgo
description: ¿Por qué es necesario?
validations:
required: true
- type: textarea
id: alcance
attributes:
label: Alcance
description: Qué archivos o módulos toca
validations:
required: true
- type: textarea
id: criterio
attributes:
label: Criterios de aceptación
description: Definición de Done
34 changes: 34 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
version: 2
updates:
# Dependencias Python (pip) en la raíz
- package-ecosystem: "pip"
directory: "/"
schedule:
interval: "daily" # Frecuencia recomendada para seguridad
# Limitar PRs abiertas para no saturar
open-pull-requests-limit: 5
# Solo dependencias directas (ajústalo si quieres transitivas)
allow:
- dependency-type: "direct"
# Mensaje de commit más claro
commit-message:
prefix: "deps"
include: "scope"
# Agrupar actualizaciones de seguridad en una única PR
groups:
python-security-updates:
applies-to: security-updates
patterns:
- "*"

# Acciones de GitHub (workflow) también con foco en seguridad
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
open-pull-requests-limit: 3
groups:
gha-security-updates:
applies-to: security-updates
patterns:
- "*"
6 changes: 3 additions & 3 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Este PR implementa la **solución completa para el problema de crashes de Railwa

### 🎯 **Problema Solucionado**
- ❌ **Problema**: Aplicación crashes en Railway después de exactamente 2 minutos
- ❌ **Problema**: Botones y funcionalidades del admin dashboard no operativas
- ❌ **Problema**: Botones y funcionalidades del admin dashboard no operativas
- ❌ **Problema**: Templates genéricos en lugar de específicos
- ❌ **Problema**: Configuración de despliegue incompleta

Expand Down Expand Up @@ -88,7 +88,7 @@ Este PR implementa la **solución completa para el problema de crashes de Railwa
- [ ] Variables de entorno configuradas en Railway
- [ ] `RAILWAY_TOKEN` configurado en GitHub Secrets

### **Post-merge Actions**
### **Post-merge Actions**
1. **Auto-deploy** se activará automáticamente en `main`
2. **Health check** validará despliegue exitoso
3. **Monitoring** confirmará estabilidad post-deploy
Expand Down Expand Up @@ -134,4 +134,4 @@ Este PR implementa la **solución completa para el problema de crashes de Railwa

---

**🎉 Este PR convierte NeuroBank FastAPI en una aplicación bancaria de nivel empresarial con despliegue automático y funcionalidad completa!**
**🎉 Este PR convierte NeuroBank FastAPI en una aplicación bancaria de nivel empresarial con despliegue automático y funcionalidad completa!**
Loading
Loading