Skip to content

feat: add in-container OPA authz and gated write mode#6

Open
jrhuerta wants to merge 4 commits intomainfrom
checkpoint/opa-in-container-authz
Open

feat: add in-container OPA authz and gated write mode#6
jrhuerta wants to merge 4 commits intomainfrom
checkpoint/opa-in-container-authz

Conversation

@jrhuerta
Copy link
Owner

Summary

  • Add in-container OPA authorization integration, ACL data support, and fail-closed decision handling across MCP tools.
  • Introduce gated write-mode support (INSERT/UPDATE/DELETE) with parser-derived write facts, explicit config brakes, and Rego write_constraints guardrails.
  • Expand coverage with unit/security tests plus Docker+OPA integration matrix scenarios and policy authoring/design docs.

Test plan

  • python -m pytest -q tests/test_config.py tests/test_opa_policy.py tests/test_write_facts.py tests/test_mcp_interface.py tests/test_query_validator_security.py tests/test_mcp_stdio_security.py
  • python -m pytest -q -m "docker_integration and smoke" tests/integration/docker/test_mcp_docker_opa_matrix.py

Auto-inject async SQLAlchemy drivers for bare postgresql/mysql/sqlite URLs so acc castledm dsn output works directly as DATABASE_URL. Add MySQL dialect/session handling and test coverage to preserve read-only enforcement across backends.
Keep the README provider-agnostic by removing the CastleDM DSN integration section while preserving the general DATABASE_URL behavior documentation.
Run OPA locally in the container and move authorization decisions to composed Rego policies so baseline constraints and ACL checks both gate access. This keeps enforcement fail-closed while preserving existing SQL safety semantics and tool contracts.
Introduce policy-governed INSERT/UPDATE/DELETE support behind explicit runtime gates and Rego write constraints to preserve deny-by-default behavior. Add coverage across validator, MCP interface, and Docker+OPA integration paths to harden authorization and fail-closed behavior.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant