Skip to content

Check for MariaDB Version when selecting users without passwords #444

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

Merged
merged 3 commits into from
Apr 28, 2021

Conversation

neubi4
Copy link
Contributor

@neubi4 neubi4 commented Apr 28, 2021

MariaDB uses the authentication_string field since 10.4.0, added this in version check in query for users to delete.

https://mariadb.com/kb/en/authentication-from-mariadb-104/

Without these changes, the role assumes 10.3 >= 5.7.6 and drops all users with empty authentication_string. Since authentication_string is not used in this versions (Password field is used, authentication_string is always empty), the role simply drops all users.

MariaDB Uses the authentication_string field since 10.4.0, added this in version check in query for users to delete

Signed-off-by: Martin Neubert <[email protected]>
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.

Thanks, looks good to me. Can you add the suggestions I added, please? I noticed that the task-names were wrong.

We need to write some tests for this!
Also checking the docs you linked, we probably can change our tests for mariadb >= 10.4 regarding the root user.

@rndmh3ro rndmh3ro merged commit 0324273 into dev-sec:master Apr 28, 2021
divialth pushed a commit to divialth/ansible-collection-hardening that referenced this pull request Aug 3, 2022
…-sec#444)

* added version check for MariaDB in Query

MariaDB Uses the authentication_string field since 10.4.0, added this in version check in query for users to delete

Signed-off-by: Martin Neubert <[email protected]>

* Update roles/mysql_hardening/tasks/mysql_secure_installation.yml

Co-authored-by: Sebastian Gumprich <[email protected]>

* Update roles/mysql_hardening/tasks/mysql_secure_installation.yml

Co-authored-by: Sebastian Gumprich <[email protected]>

Co-authored-by: Sebastian Gumprich <[email protected]>
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