fix: resolve YAML malformation with special character passwords#61
fix: resolve YAML malformation with special character passwords#61safayavatsal wants to merge 2 commits intoopen-metadata:mainfrom
Conversation
Fixes open-metadata#14 ## Describe your changes: This commit resolves Issue open-metadata#14 where YAML configuration becomes malformed when passwords contain special characters like quotes, backslashes, or other YAML-unsafe characters, potentially causing deployment failures and security vulnerabilities. I worked on updating password generation across all modules to use only YAML-safe special characters because the current implementation was generating passwords that could break YAML parsing and cause deployment failures. ## Motivation and Context The random_password resources in modules/rds, modules/opensearch, and airflow_secrets.tf were generating passwords with characters that could break YAML syntax. This created: - Deployment failures when passwords contained quotes or backslashes - Security vulnerabilities due to malformed configuration files - Inconsistent behavior across different password generations This fix ensures all passwords are YAML-safe while maintaining security requirements. ## Breaking Changes None - this is a backward compatible security enhancement. ## How Has This Been Tested? - [x] Added comprehensive password security testing (test_password_security.tf) - [x] Added YAML template validation (test_yaml_template.tftpl) - [x] Validated that generated passwords contain only YAML-safe characters - [x] Tested YAML parsing with Python yaml.safe_load() function - [x] Verified no quotes, backslashes, or other problematic characters - [x] Confirmed Helm chart deployment succeeds with special character passwords ## Technical Changes: - Updated modules/rds/main.tf: YAML-safe override_special characters - Updated modules/opensearch/main.tf: Enhanced character set with YAML safety - Updated airflow_secrets.tf: Added YAML-safe character restrictions - Added test_password_security.tf: Comprehensive validation framework - Added test_yaml_template.tftpl: YAML parsing validation template Password generation now uses: "!@#$%^&*()-_=+[]{}:?" (excludes quotes, backslashes) Maintains strong passwords: 16+ chars, mixed case, numbers, symbols
Tests Executed1. Configuration Validation 2. Password Security Testing 3. YAML Template Generation & Validation 4. YAML Parsing Validation 5. Comprehensive Configuration Testing |
Key FindingsFixed Issues:
Test Infrastructure Improvements:
Security Verification The generated test password ^Og4V&K=y9PI!Vpg demonstrates:
Testing Commands Used Validation & Planning Security Testing Comprehensive Configuration Check Cleanup |
Fixes #14
Describe your changes:
This commit resolves Issue #14 where YAML configuration becomes malformed when passwords contain special characters like quotes, backslashes, or other YAML-unsafe characters, potentially causing deployment failures and security vulnerabilities.
I worked on updating password generation across all modules to use only YAML-safe special characters because the current implementation was generating passwords that could break YAML parsing and cause deployment failures.
Motivation and Context
The random_password resources in modules/rds, modules/opensearch, and airflow_secrets.tf were generating passwords with characters that could break YAML syntax. This created:
This fix ensures all passwords are YAML-safe while maintaining security requirements.
Breaking Changes
None - this is a backward compatible security enhancement.
How Has This Been Tested?
Technical Changes:
Password generation now uses: "!@#$%^&*()-_=+[]{}:?" (excludes quotes, backslashes)
Maintains strong passwords: 16+ chars, mixed case, numbers, symbols