You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- add role argument spec for os, ssh, mysql [\#687](https://github.com/dev-sec/ansible-collection-hardening/pull/687)[[mysql_hardening](https://github.com/dev-sec/ansible-collection-hardening/labels/mysql_hardening)][[os_hardening](https://github.com/dev-sec/ansible-collection-hardening/labels/os_hardening)][[ssh_hardening](https://github.com/dev-sec/ansible-collection-hardening/labels/ssh_hardening)][[nginx_hardening](https://github.com/dev-sec/ansible-collection-hardening/labels/nginx_hardening)] ([rndmh3ro](https://github.com/rndmh3ro))
- Removes anonymous users, users without a password or authentication_string and test databases
13
13
- various hardening options inside MySQL
14
14
15
+
Changes of options `log_error` or `datadir` in `mysql_hardening_options` will not be checked for correct permissions. Please change/set `log_error` or `datadir` with the installation role of MySQL before running this role, or you can run this role twice.
16
+
17
+
Further information is available at [Deutsche Telekom (German)](http://www.telekom.com/static/-/155996/7/technische-sicherheitsanforderungen-si) and [Symantec](http://www.symantec.com/connect/articles/securing-mysql-step-step)
18
+
15
19
## Requirements
16
20
17
-
- Ansible 2.9.0
18
-
- An existing MySQL installation
21
+
- An existing installation of MySQL or MariaDB.
19
22
- python-jmespath on the ansible host
20
23
21
-
### Example playbook
24
+
<!-- BEGIN_ANSIBLE_DOCS -->
22
25
23
-
```yml
24
-
- hosts: localhost
25
-
collections:
26
-
- devsec.hardening
27
-
roles:
28
-
- mysql_hardening
29
-
```
26
+
## Supported Operating Systems
30
27
31
-
This role expects an existing installation of MySQL or MariaDB. Changes of options `log_error` or `datadir` in `mysql_hardening_options` will not be checked for correct permissions. Please change/set `log_error` or `datadir` with the installation role of MySQL before running this role, or you can run this role twice.
32
-
Please ensure that the following variables are set accordingly:
33
-
34
-
- `mysql_hardening_enabled: yes` role is enabled by default and can be disabled without removing it from a playbook. You can use conditional variable, for example: `mysql_hardening_enabled: "{{ true if mysql_enabled else false }}"`
35
-
- `mysql_hardening_user: 'mysql'` The user that mysql runs as.
36
-
- `mysql_hardening_mysql_hardening_conf_file: '/etc/mysql/conf.d/hardening.cnf'` The path to the configuration file where the hardening will be performed
37
-
- _deprecated: `mysql_datadir: '/var/lib/mysql'`The MySQL data directory_
38
-
- `mysql_datadir`is no longer necessary, as MySQL data directory is automatically taken from `mysql_info`. But it can still be defined and will also be checked for correct permissions.
28
+
| Platform | Versions |
29
+
| -------- | -------------------- |
30
+
| EL | 7, 8, 9 |
31
+
| Ubuntu | bionic, focal, jammy |
32
+
| Debian | bullseye, buster |
33
+
| Amazon ||
34
+
| opensuse ||
39
35
40
36
## Role Variables
41
37
38
+
-`mysql_daemon_enabled`
39
+
- Default: `true`
40
+
- Description: Whether to enable the MySQL-service so it starts on boot
- Description: The default password. Please change or overwrite it
121
+
- Type: str
122
+
- Required: no
123
+
-`mysql_user_home`
124
+
- Default: `{{ ansible_env.HOME }}`
125
+
- Description: The path where the `.my.cnf` will be stored
126
+
- Type: str
127
+
- Required: no
84
128
85
-
Further information is available at [Deutsche Telekom (German)](http://www.telekom.com/static/-/155996/7/technische-sicherheitsanforderungen-si) and [Symantec](http://www.symantec.com/connect/articles/securing-mysql-step-step)
0 commit comments