All Projects → dev-sec → Ansible Mysql Hardening

dev-sec / Ansible Mysql Hardening

This Ansible role provides security configuration for MySQL.

Programming Languages

ruby
36898 projects - #4 most used programming language

Projects that are alternatives of or similar to Ansible Mysql Hardening

Ansible Ssh Hardening
This Ansible role provides numerous security-related ssh configurations, providing all-round base protection.
Stars: ✭ 746 (+465.15%)
Mutual labels:  ansible, playbook, hardening, role, protection
Ansible Collection Hardening
This Ansible collection provides battle tested hardening for Linux, SSH, nginx, MySQL
Stars: ✭ 2,543 (+1826.52%)
Mutual labels:  ansible, playbook, hardening, role, protection
Ansible Role Mysql
Ansible Role - MySQL
Stars: ✭ 826 (+525.76%)
Mutual labels:  ansible, database, mysql, playbook, role
Ansible Nginx Hardening
This Ansible role provides secure nginx configurations.
Stars: ✭ 180 (+36.36%)
Mutual labels:  ansible, playbook, hardening, role, protection
Ansible Role Postgresql
Ansible Role - PostgreSQL
Stars: ✭ 310 (+134.85%)
Mutual labels:  ansible, database, role
Ansible Role Php
Ansible Role - PHP
Stars: ✭ 396 (+200%)
Mutual labels:  ansible, playbook, role
Ansible Role Memcached
Ansible Role - Memcached
Stars: ✭ 54 (-59.09%)
Mutual labels:  ansible, database, role
Ansible Role Ruby
Ansible Role - Ruby
Stars: ✭ 77 (-41.67%)
Mutual labels:  ansible, playbook, role
Bitnami Docker Mysql
Bitnami MySQL Docker Image
Stars: ✭ 116 (-12.12%)
Mutual labels:  database, mysql
Alpine Mariadb
MariaDB running on Alpine Linux [Docker]
Stars: ✭ 117 (-11.36%)
Mutual labels:  database, mysql
Sqlbuilder
A powerful, fast, cross-platform SQL Builder for PHP. Convert your structured data into SQL queries with a fluent style interface and targeting on all the mainstream database (MySQL, PostgreSQL, SQLite)
Stars: ✭ 131 (-0.76%)
Mutual labels:  database, mysql
Datax
DataX is an open source universal ETL tool that support Cassandra, ClickHouse, DBF, Hive, InfluxDB, Kudu, MySQL, Oracle, Presto(Trino), PostgreSQL, SQL Server
Stars: ✭ 116 (-12.12%)
Mutual labels:  database, mysql
Spring Boot 2 Oauth2 Authorization Jwt
Spring Boot 2 OAuth2 JWT Authorization server implementation with Database for Users and Clients (JPA, Hibernate, MySQL)
Stars: ✭ 115 (-12.88%)
Mutual labels:  database, mysql
Mysql Container
MySQL container images based on Red Hat Software Collections and intended for OpenShift and general usage. Users can choose between Red Hat Enterprise Linux, Fedora, and CentOS based images.
Stars: ✭ 117 (-11.36%)
Mutual labels:  database, mysql
Terraform Null Ansible
Terraform Module to run ansible playbooks
Stars: ✭ 114 (-13.64%)
Mutual labels:  ansible, playbook
Myblog
python写的博客,支持3种数据库,现在挂在evilbinary.org
Stars: ✭ 121 (-8.33%)
Mutual labels:  database, mysql
Casl Ansible
Ansible automation for Managing OpenShift Container Platform clusters
Stars: ✭ 123 (-6.82%)
Mutual labels:  ansible, playbook
Ansible Role Haproxy
Ansible Role - HAProxy
Stars: ✭ 112 (-15.15%)
Mutual labels:  ansible, role
Mytap
MySQL Unit Testing Suite
Stars: ✭ 118 (-10.61%)
Mutual labels:  database, mysql
Backup Manager
Database backup manager for dumping to and restoring databases from S3, Dropbox, FTP, SFTP, and Rackspace Cloud
Stars: ✭ 1,589 (+1103.79%)
Mutual labels:  database, mysql

mysql-hardening (Ansible role)

Attention: This role has been migrated to our hardening-collection:

Requirements

  • Ansible
  • Set up mysql_root_password variable

Installation

Install the role with ansible-galaxy:

ansible-galaxy install dev-sec.mysql-hardening

Example Playbook

- hosts: localhost
  roles:
    - dev-sec.mysql-hardening

This hardening role installs the hardening but expects an existing installation of MySQL, MariaDB or Percona. Please ensure that the following variables are set accordingly:

  • 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 }}"
  • mysql_hardening_user: 'mysql' The user that mysql runs as.
  • mysql_datadir: '/var/lib/mysql' The MySQL data directory
  • mysql_hardening_mysql_hardening_conf_file: '/etc/mysql/conf.d/hardening.cnf' The path to the configuration file where the hardening will be performed

Role Variables

  • mysql_hardening_chroot
    • Default: ""
    • Description: chroot
  • mysql_hardening_options.safe-user-create
  • mysql_hardening_options.secure-auth
  • mysql_hardening_options.skip-symbolic-links
  • mysql_hardening_skip_grant_tables:
  • mysql_hardening_skip_show_database
  • mysql_hardening_options.local-infile
  • mysql_hardening_options.allow-suspicious-udfs
  • mysql_hardening_chroot.automatic-sp-privileges
  • mysql_hardening_options.secure-file-priv
  • mysql_allow_remote_root
    • Default: false
    • Description: delete remote root users
  • mysql_remove_anonymous_users
    • Default: true
    • Description: remove users without authentication
  • mysql_remove_test_database
    • Default: true
    • Description: remove test database

Further information is available at Deutsche Telekom (German) and Symantec

Local Testing

The preferred way of locally testing the role is to use Docker. You will have to install Docker on your system. See Get started for a Docker package suitable to for your system.

You can also use vagrant and Virtualbox or VMWare to run tests locally. You will have to install Virtualbox and Vagrant on your system. See Vagrant Downloads for a vagrant package suitable for your system. For all our tests we use test-kitchen. If you are not familiar with test-kitchen please have a look at their guide.

Next install test-kitchen:

# Install dependencies
gem install bundler
bundle install

Testing with Docker

# list all available machines
bundle exec kitchen list

# fast test on one machine
bundle exec kitchen test mysql-centos7-ansible-latest

# test on all machines
bundle exec kitchen test

# for development
bundle exec kitchen create mysql-centos7-ansible-latest
bundle exec kitchen converge mysql-centos7-ansible-latest

Testing with Virtualbox

# fast test on one machine
KITCHEN_YAML=".kitchen.vagrant.yml" bundle exec kitchen test default-ubuntu-1404

# test on all machines
KITCHEN_YAML=".kitchen.vagrant.yml" bundle exec kitchen test

# for development
KITCHEN_YAML=".kitchen.vagrant.yml" bundle exec kitchen create default-ubuntu-1404
KITCHEN_YAML=".kitchen.vagrant.yml" bundle exec kitchen converge default-ubuntu-1404

For more information see test-kitchen

License and Author

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].