Closed
Conversation
Adds hidden configuration setting that enforces read-only mode for all database connections using Teradata's STARTUP SQL feature. When enabled (default), the connection executes "SET SESSION CHARACTERISTICS AS TRANSACTION READ ONLY" on connection, preventing all write operations. Includes 4-phase e2e test verifying read/write behavior with enforcement enabled/disabled through outcome-based verification.
7e047be to
d17cf2f
Compare
Contributor
|
|
Contributor
|
All test cases now expect the startup and runstartup parameters in connection config since enforce_readonly_queries defaults to true. Added test case to verify parameters are not added when setting is disabled.
Codecov Report❌ Patch coverage is Additional details and impacted files🚀 New features to boost your workflow:
|
Member
Author
|
Closing for now, was exploring. |
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 PR enforces read-only mode for Teradata connections to prevent data modification through custom queries.
Motivation
Custom queries can execute write operations, posing a security risk. This change enforces read-only mode at the database connection level.
Approach
Added a hidden
enforce_readonly_queriessetting (defaults to true) that uses Teradata's STARTUP SQL feature to executeSET SESSION CHARACTERISTICS AS TRANSACTION READ ONLYat connection time in check.py:74. When enabled, all queries cannot perform write operations.Testing
Added 4-phase e2e test that verifies read/write behavior with enforcement enabled/disabled. Purely outcome-based verification (row counts, metrics).
Tradeoffs
The setting is hidden from users but can be disabled for testing. Provides security by default with minimal configuration surface.