Merge pull request #4371 from Security-Onion-Solutions/pipeline_userpass

Pipeline userpass
This commit is contained in:
Josh Patterson
2021-06-01 17:01:51 -04:00
committed by GitHub
8 changed files with 37 additions and 3 deletions

View File

@@ -67,3 +67,7 @@ peer:
reactor: reactor:
- 'so/fleet': - 'so/fleet':
- salt://reactor/fleet.sls - salt://reactor/fleet.sls
- salt/beacon/*/watch_sqlite_db//opt/so/conf/kratos/db/sqlite.db
- salt://reactor/kratos.sls

View File

@@ -174,6 +174,7 @@ elastic_curl_config:
- source: salt://elasticsearch/curl.config - source: salt://elasticsearch/curl.config
- mode: 600 - mode: 600
- show_changes: False - show_changes: False
- makedirs: True
# Sync some Utilities # Sync some Utilities
utilsyncscripts: utilsyncscripts:

View File

@@ -0,0 +1,7 @@
beacons:
watch_sqlite_db:
- files:
/opt/so/conf/kratos/db/sqlite.db:
mask:
- modify
- beacon_module: inotify

View File

@@ -22,6 +22,7 @@
include: include:
- elasticsearch.auth - elasticsearch.auth
- salt.minion
socore_own_saltstack: socore_own_saltstack:
file.directory: file.directory:
@@ -121,6 +122,13 @@ syncesusers:
- /opt/so/saltstack/local/salt/elasticsearch/files/users - /opt/so/saltstack/local/salt/elasticsearch/files/users
- /opt/so/saltstack/local/salt/elasticsearch/files/users_roles - /opt/so/saltstack/local/salt/elasticsearch/files/users_roles
beacons_config:
file.managed:
- name: /etc/salt/minion.d/beacons.conf
- source: salt://manager/files/beacons.conf
- onchanges_in:
- service: salt_minion_service
{% else %} {% else %}
{{sls}}_state_not_allowed: {{sls}}_state_not_allowed:

5
salt/reactor/kratos.sls Normal file
View File

@@ -0,0 +1,5 @@
so_user_sync:
local.cmd.run:
- tgt: {{ data['data']['id'] }}
- arg:
- /usr/sbin/so-user sync

View File

@@ -1,3 +1,10 @@
{% from 'salt/map.jinja' import PYINOTIFYPACKAGE with context%}
{% from 'salt/map.jinja' import PYTHONINSTALLER with context%}
patch_package: patch_package:
pkg.installed: pkg.installed:
- name: patch - name: patch
pyinotify:
{{PYTHONINSTALLER}}.installed:
- name: {{ PYINOTIFYPACKAGE }}

View File

@@ -11,6 +11,7 @@
{% set PYTHON3INFLUX= 'influxdb == ' ~ PYTHONINFLUXVERSION %} {% set PYTHON3INFLUX= 'influxdb == ' ~ PYTHONINFLUXVERSION %}
{% set PYTHON3INFLUXDEPS= ['certifi', 'chardet', 'python-dateutil', 'pytz', 'requests'] %} {% set PYTHON3INFLUXDEPS= ['certifi', 'chardet', 'python-dateutil', 'pytz', 'requests'] %}
{% set PYTHONINSTALLER = 'pip' %} {% set PYTHONINSTALLER = 'pip' %}
{% set PYINOTIFYPACKAGE = 'pyinotify' %}
{% else %} {% else %}
{% set SPLITCHAR = '-' %} {% set SPLITCHAR = '-' %}
{% set SALTNOTHELD = salt['cmd.run']('yum versionlock list | grep -q salt ; echo $?', python_shell=True) %} {% set SALTNOTHELD = salt['cmd.run']('yum versionlock list | grep -q salt ; echo $?', python_shell=True) %}
@@ -21,6 +22,7 @@
{% set PYTHON3INFLUX= 'securityonion-python3-influxdb' %} {% set PYTHON3INFLUX= 'securityonion-python3-influxdb' %}
{% set PYTHON3INFLUXDEPS= ['python36-certifi', 'python36-chardet', 'python36-dateutil', 'python36-pytz', 'python36-requests'] %} {% set PYTHON3INFLUXDEPS= ['python36-certifi', 'python36-chardet', 'python36-dateutil', 'python36-pytz', 'python36-requests'] %}
{% set PYTHONINSTALLER = 'pkg' %} {% set PYTHONINSTALLER = 'pkg' %}
{% set PYINOTIFYPACKAGE = 'securityonion-python3-pyinotify' %}
{% endif %} {% endif %}
{% set INSTALLEDSALTVERSION = salt['pkg.version']('salt-minion').split(SPLITCHAR)[0] %} {% set INSTALLEDSALTVERSION = salt['pkg.version']('salt-minion').split(SPLITCHAR)[0] %}
@@ -33,4 +35,4 @@
{% endif %} {% endif %}
{% else %} {% else %}
{% set UPGRADECOMMAND = 'echo Already running Salt Minion version ' ~ SALTVERSION %} {% set UPGRADECOMMAND = 'echo Already running Salt Minion version ' ~ SALTVERSION %}
{% endif %} {% endif %}

View File

@@ -260,7 +260,7 @@ base:
- filebeat - filebeat
{%- endif %} {%- endif %}
{%- if CURATOR %} {%- if CURATOR %}
- curator0 - curator
{%- endif %} {%- endif %}
{%- if ELASTALERT %} {%- if ELASTALERT %}
- elastalert - elastalert