[Security audit] Replace silent core exception handling with narrow logging #255

Closed
opened 2026-07-13 20:10:14 +02:00 by zemion · 1 comment
Owner

Bandit/Ruff flag production try/except blocks that silently pass or continue.

Source report: /mnt/DATA/git/govoplan/audit-reports/govoplan-full-20260713-1949/bandit.json

Observed locations include:

  • src/govoplan_core/core/install_config.py
  • src/govoplan_core/core/module_installer.py
  • src/govoplan_core/security/secrets.py
  • src/govoplan_core/db/migrations.py

Acceptance criteria:

  • Replace silent handling with narrow exception types where possible.
  • Add debug or warning logging when the exception matters operationally.
  • Keep intentional best-effort behavior where startup/install flows must continue.
  • Add noqa/nosec only with a local explanation where silence is intentional.
<!-- codex-security-audit-fingerprint:security-audit-20260713-core-silent-exceptions --> Bandit/Ruff flag production `try`/`except` blocks that silently pass or continue. Source report: `/mnt/DATA/git/govoplan/audit-reports/govoplan-full-20260713-1949/bandit.json` Observed locations include: - `src/govoplan_core/core/install_config.py` - `src/govoplan_core/core/module_installer.py` - `src/govoplan_core/security/secrets.py` - `src/govoplan_core/db/migrations.py` Acceptance criteria: - Replace silent handling with narrow exception types where possible. - Add debug or warning logging when the exception matters operationally. - Keep intentional best-effort behavior where startup/install flows must continue. - Add `noqa`/`nosec` only with a local explanation where silence is intentional.
Author
Owner

Codex State: done

Summary

  • Replaced core silent best-effort exception handling with narrow exceptions, explicit fallback returns, or debug logging.

Changed Files

  • src/govoplan_core/core/install_config.py
  • src/govoplan_core/security/secrets.py
  • src/govoplan_core/core/module_installer.py
  • src/govoplan_core/db/migrations.py

Verification

  • /mnt/DATA/git/govoplan/.venv/bin/python -m py_compile src/govoplan_core/core/install_config.py src/govoplan_core/security/secrets.py src/govoplan_core/core/module_installer.py src/govoplan_core/db/migrations.py
  • git diff --check -- src/govoplan_core/core/install_config.py src/govoplan_core/security/secrets.py src/govoplan_core/core/module_installer.py src/govoplan_core/db/migrations.py
  • /mnt/DATA/git/govoplan/.venv/bin/python -m unittest tests.test_module_system.ModuleSystemTests.test_module_installer_request_queue_round_trips tests.test_module_system.ModuleSystemTests.test_module_installer_external_database_restore_command_runs_on_rollback tests.test_module_system.ModuleSystemTests.test_module_installer_dry_run_writes_run_record_without_applying
  • PYTHONPATH=all local govoplan*/src /mnt/DATA/git/govoplan/.venv/bin/python -m unittest tests.test_database_migrations

Next / Blocked

  • A migration test run without sibling module PYTHONPATH failed on missing optional idm; the all-module rerun passed.
## Codex State: done ### Summary - Replaced core silent best-effort exception handling with narrow exceptions, explicit fallback returns, or debug logging. ### Changed Files - `src/govoplan_core/core/install_config.py` - `src/govoplan_core/security/secrets.py` - `src/govoplan_core/core/module_installer.py` - `src/govoplan_core/db/migrations.py` ### Verification - `/mnt/DATA/git/govoplan/.venv/bin/python -m py_compile src/govoplan_core/core/install_config.py src/govoplan_core/security/secrets.py src/govoplan_core/core/module_installer.py src/govoplan_core/db/migrations.py` - `git diff --check -- src/govoplan_core/core/install_config.py src/govoplan_core/security/secrets.py src/govoplan_core/core/module_installer.py src/govoplan_core/db/migrations.py` - `/mnt/DATA/git/govoplan/.venv/bin/python -m unittest tests.test_module_system.ModuleSystemTests.test_module_installer_request_queue_round_trips tests.test_module_system.ModuleSystemTests.test_module_installer_external_database_restore_command_runs_on_rollback tests.test_module_system.ModuleSystemTests.test_module_installer_dry_run_writes_run_record_without_applying` - `PYTHONPATH=all local govoplan*/src /mnt/DATA/git/govoplan/.venv/bin/python -m unittest tests.test_database_migrations` ### Next / Blocked - A migration test run without sibling module PYTHONPATH failed on missing optional idm; the all-module rerun passed.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: add-ideas/govoplan-core#255
No description provided.