Skip to content

Remove AdminPassword from mysqldump command line#149

Open
fmount wants to merge 1 commit into
openstack-k8s-operators:mainfrom
fmount:gather-db-harden
Open

Remove AdminPassword from mysqldump command line#149
fmount wants to merge 1 commit into
openstack-k8s-operators:mainfrom
fmount:gather-db-harden

Conversation

@fmount

@fmount fmount commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

The galera Pod already has credentials available via /var/local/my.cnf/mysql_pw_cache.cnf (injected by mariadb-operator), which mysql/mysqldump auto-include through the !includedir directive in galera.cnf. Passing -p$dbpass in the command line was redundant and caused the password to appear in the kube-apiserver audit log requestURI (oc exec encodes command args as query parameters).

This patch drops the dbpass parameter from dump_db and the Secret fetch from the main loop, letting the in-pod .cnf handle authentication.

The galera pod already has credentials available via
/var/local/my.cnf/mysql_pw_cache.cnf (injected by mariadb-operator),
which mysql/mysqldump auto-include through the !includedir directive
in galera.cnf. Passing -p$dbpass on the command line was redundant
and caused the password to appear in the kube-apiserver audit log
requestURI (oc exec encodes command args as query parameters).

Drop the dbpass parameter from dump_db and the Secret fetch from
the main loop, letting the in-pod .cnf handle authentication.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Francesco Pantano <fpantano@redhat.com>
@openshift-ci openshift-ci Bot requested a review from Akrog July 6, 2026 10:55
@openshift-ci

openshift-ci Bot commented Jul 6, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign danpawlik for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci Bot requested a review from dprince July 6, 2026 10:55
@fmount fmount requested review from abays and stuggi and removed request for Akrog and dprince July 6, 2026 10:55
@fmount

fmount commented Jul 6, 2026

Copy link
Copy Markdown
Contributor Author

cifmw has https://github.com/openstack-k8s-operators/ci-framework/blob/main/roles/os_must_gather/defaults/main.yml#L42 so we should be able to see this effect from the CI job.

@abays abays left a comment

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.

/lgtm

@openshift-ci openshift-ci Bot added the lgtm label Jul 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants