Skip to content

Integrate Google Secret Manager for Hive password with logging#1390

Closed
dilipgodhia wants to merge 5 commits intomainfrom
proxyv2
Closed

Integrate Google Secret Manager for Hive password with logging#1390
dilipgodhia wants to merge 5 commits intomainfrom
proxyv2

Conversation

@dilipgodhia
Copy link
Copy Markdown
Contributor

Added a feature to allow the use of Google Secret Manager (GSM) for hive connectivity. In hive-site.xml, the property "javax.jdo.option.ConnectionPassword" will be removed since it will not be needed when GSM is used.

Dilip Godhia and others added 4 commits January 23, 2026 18:17
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: cjac <cjac@google.com>
@dilipgodhia
Copy link
Copy Markdown
Contributor Author

/gcbrun

@dilipgodhia dilipgodhia requested a review from cjac April 24, 2026 20:10
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces Secret Manager integration for Hive metastore passwords and adds a metadata option to reuse existing Hive databases. The initialization script was updated to fetch secrets, remove plaintext credentials from configuration files, and utilize idempotent SQL commands. Feedback identifies a hardcoded username bug, suggests consistent host specifications, and raises a security concern regarding shell expansion of passwords in MySQL commands.

Comment thread cloud-sql-proxy/cloud-sql-proxy.sh Outdated
Comment thread cloud-sql-proxy/cloud-sql-proxy.sh Outdated
Comment on lines +555 to +557
"CREATE USER IF NOT EXISTS '${DB_HIVE_USER}' IDENTIFIED BY '${DB_HIVE_PASSWORD}';
GRANT ALL PRIVILEGES ON ${METASTORE_DB}.* TO '${DB_HIVE_USER}'@'%';
FLUSH PRIVILEGES;"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

security-medium medium

Using ${DB_HIVE_PASSWORD} directly inside a double-quoted string passed to mysql -e is risky. If the password contains special shell characters (like $, `, or \) or a single quote ('), the command will fail or potentially lead to command injection. Since this script runs in an environment where passwords can be complex, consider using a more robust way to pass the password to the MySQL client, such as environment variables or a temporary option file.

Comment thread cloud-sql-proxy/cloud-sql-proxy.sh Outdated
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