Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

simplify MySQL queries for user deletion #641

Merged
merged 13 commits into from Mar 1, 2023
Merged

simplify MySQL queries for user deletion #641

merged 13 commits into from Mar 1, 2023

Conversation

schurzi
Copy link
Contributor

@schurzi schurzi commented Feb 23, 2023

No description provided.

Signed-off-by: Martin Schurz <Martin.Schurz@t-systems.com>
Signed-off-by: Martin Schurz <Martin.Schurz@t-systems.com>
Signed-off-by: Martin Schurz <Martin.Schurz@t-systems.com>
Signed-off-by: Martin Schurz <Martin.Schurz@t-systems.com>
Signed-off-by: Martin Schurz <Martin.Schurz@t-systems.com>
Signed-off-by: Martin Schurz <Martin.Schurz@t-systems.com>
Signed-off-by: Martin Schurz <Martin.Schurz@t-systems.com>
@schurzi schurzi force-pushed the simplify_mysql branch 5 times, most recently from 2fc1570 to 00d1bdc Compare February 23, 2023 23:53
Signed-off-by: Martin Schurz <Martin.Schurz@t-systems.com>
@schurzi
Copy link
Contributor Author

schurzi commented Feb 24, 2023

I moved the deletion of users into a loop inside Ansible, this is slower if it needs to delete a lot of users, but it is also logged better at execution time:

  TASK [devsec.hardening.mysql_hardening : Ensure that there are no users without password or authentication_string] ***
  Friday 24 February 2023  00:03:46 +0000 (0:00:00.053)       0:00:18.832 *******
  changed: [instance] => (item='foo'@'bar')

Signed-off-by: Martin Schurz <Martin.Schurz@t-systems.com>
@schurzi schurzi marked this pull request as ready for review February 24, 2023 00:16
@schurzi schurzi added the patch label Feb 24, 2023
@schurzi
Copy link
Contributor Author

schurzi commented Feb 24, 2023

this might fix the problem in #640 but I suspect a different error there

Signed-off-by: Martin Schurz <Martin.Schurz@t-systems.com>
Signed-off-by: Martin Schurz <Martin.Schurz@t-systems.com>
Signed-off-by: Martin Schurz <Martin.Schurz@t-systems.com>
Copy link
Member

@rndmh3ro rndmh3ro left a comment

Choose a reason for hiding this comment

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

Great simplification! I didn't know the mysql_query module was capable of this.

roles/mysql_hardening/tasks/mysql_secure_installation.yml Outdated Show resolved Hide resolved
roles/mysql_hardening/tasks/mysql_secure_installation.yml Outdated Show resolved Hide resolved
roles/mysql_hardening/tasks/mysql_secure_installation.yml Outdated Show resolved Hide resolved
Signed-off-by: Martin Schurz <Martin.Schurz@t-systems.com>
@rndmh3ro rndmh3ro merged commit 6e5621c into master Mar 1, 2023
@rndmh3ro rndmh3ro deleted the simplify_mysql branch March 1, 2023 13:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants