mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2025-12-06 09:12:45 +01:00
MySQL Module - First BIG checkin
This commit is contained in:
@@ -22,10 +22,10 @@ skip-name-resolve
|
||||
datadir=/var/lib/mysql
|
||||
socket=/var/lib/mysql/mysql.sock
|
||||
secure-file-priv=/var/lib/mysql-files
|
||||
user=mysql
|
||||
user=939
|
||||
|
||||
# Disabling symbolic-links is recommended to prevent assorted security risks
|
||||
symbolic-links=0
|
||||
|
||||
log-error=/var/log/mysqld.log
|
||||
log-error=/var/log/mysql/mysqld.log
|
||||
pid-file=/var/run/mysqld/mysqld.pid
|
||||
|
||||
2
salt/mysql/etc/mypass
Normal file
2
salt/mysql/etc/mypass
Normal file
@@ -0,0 +1,2 @@
|
||||
{%- set MYSQLPASS = salt['pillar.get']('master:mysqlpass', 'iwonttellyou') %}
|
||||
{{ MYSQLPASS }}
|
||||
@@ -1,7 +1,76 @@
|
||||
{%- set MYSQLPASS = salt['pillar.get']('master:mysqlpass', 'iwonttellyou') %}
|
||||
{%- set FLEETPASS = salt['pillar.get']('master:fleetpass', 'bazinga') %}
|
||||
# MySQL Setup
|
||||
filebeatetcdir:
|
||||
mysqlpkgs:
|
||||
pkg.installed:
|
||||
- skip_suggestions: False
|
||||
- pkgs:
|
||||
{% if grains['os'] != 'CentOS' %}
|
||||
- python-mysqldb
|
||||
{% else %}
|
||||
- MySQL-python
|
||||
{% endif %}
|
||||
|
||||
mysqletcdir:
|
||||
file.directory:
|
||||
- name: /opt/so/conf/mysql/etc
|
||||
- user: 939
|
||||
- group: 939
|
||||
- makedirs: True
|
||||
|
||||
lsetcsync:
|
||||
file.recurse:
|
||||
- name: /opt/so/conf/mysql/etc
|
||||
- source: salt://mysql/etc
|
||||
- user: 939
|
||||
- group: 939
|
||||
- template: jinja
|
||||
|
||||
mysqletcdir:
|
||||
file.directory:
|
||||
- name: /opt/so/log/mysql
|
||||
- user: 939
|
||||
- group: 939
|
||||
- makedirs: True
|
||||
|
||||
mysqldatadir:
|
||||
file.directory:
|
||||
- name: /nsm/mysql
|
||||
- user: 939
|
||||
- group: 939
|
||||
- makedirs: True
|
||||
|
||||
so-mysql:
|
||||
docker_container.running:
|
||||
- image: soshybridhunter/so-redis:HH1.0.3
|
||||
- hostname: so-mysql
|
||||
- user: socore
|
||||
- port_bindings:
|
||||
- 0.0.0.0:3306:3306
|
||||
- environment:
|
||||
- MYSQL_ROOT_HOST={{ MASTERIP }}
|
||||
- MYSQL_ROOT_PASSWORD=/etc/mypass
|
||||
- binds:
|
||||
- /opt/so/conf/etc/my.cnf:/etc/my.cnf:ro
|
||||
- /opt/so/conf/etc/mypass:/etc/mypass
|
||||
- /nsm/mysql:/var/lib/mysql:rw
|
||||
- /opt/so/log/mysql:/var/log/mysql:rw
|
||||
- watch:
|
||||
- /opt/so/conf/mysql/etc
|
||||
|
||||
fleetdb:
|
||||
mysql_database.present:
|
||||
- name: fleet
|
||||
|
||||
fleetdbuser:
|
||||
mysql_user.present:
|
||||
- host: {{ MASTERIP }}
|
||||
- password: {{ FLEETPASS }}
|
||||
- connection_user: root
|
||||
- connection_pass: {{ MYSQLPASS }}
|
||||
|
||||
fleetdbpriv:
|
||||
mysql_grants.present:
|
||||
- grant: all privileges
|
||||
- database: fleet.*
|
||||
- user: fleet
|
||||
|
||||
Reference in New Issue
Block a user