Repository navigation
security(connectors): complete Phase 5.6 read-only enforcement and safety qualification - #48
Closed
krishanth7 wants to merge 2 commits into
Conversation
Finishing Touches: 💡 1
Comment |
…fety qualification
krishanth7
force-pushed
the
security/phase-5.6-connector-safety
branch
from
October 27, 2026 15:38
3552578 to
027c52c
Compare
The cross-engine connector safety regression tests added in Phase 5.6 import dera_connectors (packages/connectors/src) but the schema-regression workflow only exposed packages/core/src and apps/api/src on PYTHONPATH, causing a ModuleNotFoundError and CI failure on PR #48. Changes: - Add packages/connectors/src to PYTHONPATH env for the regression step - Install asyncpg/aiomysql/aiosqlite/cryptography before running tests - Extend path triggers to include packages/connectors/src/** so the regression suite re-runs whenever connector source files change
Owner
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This pull request completes Phase 5.6: Read-Only Enforcement, Timeouts & Safety and achieves final milestone certification for Phase 5: Database Connectors & Metadata Inspection for DERA (Database Engineering & Reverse Analysis). It establishes a unified, fail-closed security subsystem across PostgreSQL, Supabase, SQLite, MySQL, and MariaDB connectors, guaranteeing read-only metadata inspection, SSRF egress protection, DNS rebinding defense, SQLite filesystem containment, multi-tenant workspace isolation, centralized timeout budgets, and cooperative cancellation.
Change Type
feat)fix)docs)refactor)perf)test)ci,build)security)!)Related Issues
Closes #42
Completes Phase 5.6 Engineering Implementation Directive
Certifies Phase 5 Completion (
docs/audit/PHASE_5_COMPLETION.md)Implementation Details
packages/connectors/src/dera_connectors/security/:policy.py: UnifiedConnectorSecurityPolicyorchestrating tenant authorization, destination validation, and query allowlists.readonly.py: Static lexical analysis, comment stripping (/* ... */,--,#), single-quote literal replacement, and DDL/DML mutation keyword blocking.query_policy.py:ApprovedMetadataQueryRegistrygoverning pre-registered catalog queries with parameter validation and row caps.destinations.py: Strict SSRF boundaries blocking cloud metadata (169.254.169.254), loopbacks, private subnets, dangerous service ports, and destination IP pinning.credentials.py: SafeDatabaseCredentialscontainer withrepr=False, null byte detection, and ephemeral resolution.authorization.py: Multi-tenant workspace authorization (validate_workspace_authorization) enforced before secret resolution.isolation.py: SQLite path canonicalization (os.path.realpath), approved storage root containment, symlink escape checks, Windows device blocking (CON,PRN,NUL), and deterministicmode=roURI generation.timeouts.py:TimeoutBudgetand monotonicDeadlineTrackerpropagating overall deadlines (default 120s) across multi-step inspections.cancellation.py:EnhancedCancellationTokensupporting parent-child propagation, driver interrupt callbacks, and transaction rollbacks.resource_limits.py: Explicit caps on result rows (50,000), identifier lengths (1,024), SQL definition sizes (1MB), and total schema entities (100,000).redaction.py: Recursive credential scrubbing (sanitize_diagnostics) and regex masking (mask_sensitive_strings).audit.py: Structured security audit logging (log_security_audit_event) capturing forensic records without secret leakage.docs/security/.docs/audit/PHASE_5_6_SECURITY_BASELINE.md,docs/audit/PHASE_5_6_SECURITY_ACCEPTANCE.md, anddocs/audit/PHASE_5_COMPLETION.md.Testing
python scripts/development/dev.py allortest)Test evidence & notes:
tests/security/connectors/: 23 passedtests/security/network/: 8 passedtests/security/filesystem/: 7 passedtests/security/tenancy/: 4 passedtests/integration/connector_safety/: 7 passedtests/regression/connectors/: 4 passedtests/security/(platform security): 20 passednpm run docs:lint) passed with 0 issues in 291 files.python scripts/ci/validate_docs.py) passed.Documentation Impact
docs/updated or verified where requirednpm run docs:check)Security Impact & Deterministic Engineering
.envsecrets are committed.Security Assessment Note:
docs/security/CONNECTOR_THREAT_MODEL.md).Breaking Changes
Contributor Checklist
mainbranch.feat(connectors): add SQLite metadata support).