🚨 CRITICAL: Oracle Security Fix - Remove Default Paths - #7
Conversation
…s for Oracle config - Remove hardcoded default paths that exposed system structure - Enforce all sensitive configuration via environment variables - Add validation to fail fast if required env vars are missing - No defaults for WALLET_PATH, TNS_ADMIN, or CLIENT_PATH Security improvements: - All Oracle configuration now requires explicit environment variables - Validation ensures config is complete before attempting connection - Clear error messages guide users to set required variables BREAKING CHANGE: Oracle connection now requires these environment variables: - ORACLE_USER - ORACLE_PASSWORD - ORACLE_TNS_ADMIN - ORACLE_CLIENT_PATH
|
🤖 Claude Code Review Error Sorry, I encountered an error while reviewing this PR: Please check the workflow logs for more details. |
|
❌ Claude Code Review Failed: Please check the workflow logs for details. |
There was a problem hiding this comment.
Pull Request Overview
This PR implements a critical security fix for Oracle database configuration by removing hardcoded default paths that exposed sensitive system information and enforcing the use of environment variables for all configuration values.
- Removed hardcoded default paths that exposed username, project structure, and system architecture
- Added validation method to ensure all required environment variables are set before connection attempts
- Enforced environment variable usage for Oracle client path, TNS admin path, and wallet configuration
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.
| os.environ['TNS_ADMIN'] = cls.TNS_ADMIN | ||
| # Ensure TNS_ADMIN is set in environment if available | ||
| if cls.TNS_ADMIN: | ||
| os.environ['TNS_ADMIN'] = cls.TNS_ADMIN |
There was a problem hiding this comment.
This condition check creates inconsistent behavior. The validate_config() method requires TNS_ADMIN to be set (line 40-41), but this line only sets the environment variable if it exists. This means the validation will fail if TNS_ADMIN is missing, but the connection code assumes it might be optional.
| os.environ['TNS_ADMIN'] = cls.TNS_ADMIN | |
| # Ensure TNS_ADMIN is set in environment (guaranteed by validation) | |
| os.environ['TNS_ADMIN'] = cls.TNS_ADMIN |
|
|
||
| # Ensure TNS_ADMIN is set in environment | ||
| os.environ['TNS_ADMIN'] = cls.TNS_ADMIN | ||
| # Ensure TNS_ADMIN is set in environment if available |
There was a problem hiding this comment.
The comment 'if available' is misleading since the validate_config() method now requires TNS_ADMIN to be set. The comment should reflect that this is a required configuration, not optional.
| # Ensure TNS_ADMIN is set in environment if available | |
| # Ensure TNS_ADMIN is set in environment (required) |
🔒 Critical Security Fix
This PR addresses security vulnerabilities in the Oracle database configuration by removing all default paths and enforcing environment variable usage.
Security Issues Fixed
Removed default paths that exposed system structure:
/home/sam/git/photosight/wallet(exposed username and project structure)/usr/lib(exposed system architecture)Enforced environment variables for all sensitive configuration
Added validation to fail fast if required variables are missing
Changes
validate_config()method to check required environment variablesBreaking Changes
Oracle connection now requires these environment variables:
ORACLE_USERORACLE_PASSWORDORACLE_TNS_ADMINORACLE_CLIENT_PATHMigration Guide
Set the following in your
.envfile:Testing