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
Signed-off-by: Sebastian Gumprich <sebastian.gumprich@t-systems.com>
* add role argument spec for os, ssh, mysql
Signed-off-by: Sebastian Gumprich <sebastian.gumprich@t-systems.com>
* remove variable in variable as it cannot be used in argument spec
Signed-off-by: Sebastian Gumprich <sebastian.gumprich@t-systems.com>
* fix wrong syntax
* fix spelling errors
Signed-off-by: Sebastian Gumprich <sebastian.gumprich@t-systems.com>
* cannot use vars before arg-spec validation
Signed-off-by: Sebastian Gumprich <sebastian.gumprich@t-systems.com>
* yamllint the arg-spec
Signed-off-by: Sebastian Gumprich <sebastian.gumprich@t-systems.com>
* add back variable
Signed-off-by: Sebastian Gumprich <sebastian.gumprich@t-systems.com>
* remove redundant setting in tests
* fix descriptions in mysql hardening to betterreflect what they do
Signed-off-by: Sebastian Gumprich <sebastian.gumprich@t-systems.com>
* remove duplicate empty line
Signed-off-by: Sebastian Gumprich <sebastian.gumprich@t-systems.com>
* set correct defaults on to ssl options
Signed-off-by: Sebastian Gumprich <sebastian.gumprich@t-systems.com>
* remove left-over hidepid argument spec
Signed-off-by: Sebastian Gumprich <sebastian.gumprich@t-systems.com>
* remove license and author infos, this lives in the collection readme
Signed-off-by: Sebastian Gumprich <sebastian.gumprich@t-systems.com>
* fix styling
Signed-off-by: Sebastian Gumprich <sebastian.gumprich@t-systems.com>
* update some descriptions and sort them in the readme
Signed-off-by: Sebastian Gumprich <sebastian.gumprich@t-systems.com>
* some more linting
Signed-off-by: Sebastian Gumprich <sebastian.gumprich@t-systems.com>
---------
Signed-off-by: Sebastian Gumprich <sebastian.gumprich@t-systems.com>
Co-authored-by: Sebastian Gumprich <sebastian.gumprich@t-systems.com>
- 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 -->
25
+
## Supported Operating Systems
26
+
| Platform | Versions |
27
+
| -------- | -------- |
28
+
| EL | 7, 8, 9 |
29
+
| Ubuntu | bionic, focal, jammy |
30
+
| Debian | bullseye, buster |
31
+
| Amazon ||
32
+
| opensuse ||
22
33
23
-
```yml
24
-
- hosts: localhost
25
-
collections:
26
-
- devsec.hardening
27
-
roles:
28
-
- mysql_hardening
29
-
```
34
+
## Role Variables
30
35
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:
36
+
*`mysql_daemon_enabled`
37
+
* Default: `true`
38
+
* Description: Whether to enable the MySQL-service so it starts on boot
* Description: The default password. Please change or overwrite it
119
+
* Type: str
120
+
* Required: no
121
+
*`mysql_user_home`
122
+
* Default: `{{ ansible_env.HOME }}`
123
+
* Description: The path where the `.my.cnf` will be stored
124
+
* Type: str
125
+
* Required: no
33
126
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.
- Description: remove users without authentication
78
-
- `mysql_remove_test_database`
79
-
- Default: true
80
-
- Description: remove test database
81
-
- `mysql_hardening_restart_mysql`
82
-
- Default: true
83
-
- Description: Restart mysql after running this role
131
+
## Example Playbook
132
+
133
+
```
134
+
- hosts: all
135
+
roles:
136
+
- name: devsec.hardening.mysql_hardening
137
+
```
138
+
<!-- END_ANSIBLE_DOCS -->
84
139
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