Update audit user access for Mariadb

The audit user is granted SELECT permission
for all Mariadb databases and tables.

Change-Id: I621325e4a9d27d3ab0d0bc30b4926ea0fa3fd17e
This commit is contained in:
Huang, Sophie (sh879n) 2020-01-28 17:04:58 +00:00 committed by Sophie Huang
parent 376bd5c066
commit d135e2c964
2 changed files with 3 additions and 3 deletions

View File

@ -284,7 +284,7 @@ def mysqld_bootstrap():
"CREATE OR REPLACE USER '{2}'@'127.0.0.1' IDENTIFIED BY '{3}' ;\n"
"GRANT PROCESS, RELOAD, LOCK TABLES, REPLICATION CLIENT ON *.* TO '{2}'@'127.0.0.1' ;\n"
"CREATE OR REPLACE USER '{4}'@'%' IDENTIFIED BY '{5}' ;\n"
"GRANT SELECT ON mysql.user TO '{4}'@'%' ;\n"
"GRANT SELECT ON *.* TO '{4}'@'%' ;\n"
"FLUSH PRIVILEGES ;\n"
"SHUTDOWN ;".format(mysql_dbadmin_username, mysql_dbadmin_password,
mysql_dbsst_username, mysql_dbsst_password,
@ -768,7 +768,7 @@ def run_mysqld(cluster='existing'):
"CREATE OR REPLACE USER '{2}'@'127.0.0.1' IDENTIFIED BY '{3}' ;\n"
"GRANT PROCESS, RELOAD, LOCK TABLES, REPLICATION CLIENT ON *.* TO '{2}'@'127.0.0.1' ;\n"
"CREATE OR REPLACE USER '{4}'@'%' IDENTIFIED BY '{5}' ;\n"
"GRANT SELECT ON mysql.user TO '{4}'@'%' ;\n"
"GRANT SELECT ON *.* TO '{4}'@'%' ;\n"
"FLUSH PRIVILEGES ;\n"
"SHUTDOWN ;".format(mysql_dbadmin_username, mysql_dbadmin_password,
mysql_dbsst_username, mysql_dbsst_password,

View File

@ -163,7 +163,7 @@ spec:
secretKeyRef:
name: mariadb-dbsst-password
key: MYSQL_DBSST_PASSWORD
{{- if .Values.endpoints.oslo_db.auth.audit.username }}
{{- if .Values.manifests.secret_dbaudit_password }}
- name: MYSQL_DBAUDIT_USERNAME
value: {{ .Values.endpoints.oslo_db.auth.audit.username }}
- name: MYSQL_DBAUDIT_PASSWORD