mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2026-03-23 21:12:39 +01:00
Compare commits
88 Commits
stenoclean
...
customulim
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
057ec6f0f1 | ||
|
|
cacae12ba3 | ||
|
|
e19e83bebb | ||
|
|
341471d38e | ||
|
|
2349750e13 | ||
|
|
00986dc2fd | ||
|
|
d60bef1371 | ||
|
|
5806a85214 | ||
|
|
2d97dfc8a1 | ||
|
|
d6263812a6 | ||
|
|
ef7d1771ab | ||
|
|
4dc377c99f | ||
|
|
4bb61d999d | ||
|
|
e0e0e3e97b | ||
|
|
6b039b3f94 | ||
|
|
d2d2f0cb5f | ||
|
|
e6ee7dac7c | ||
|
|
7bf63b822d | ||
|
|
1a7d72c630 | ||
|
|
4224713cc6 | ||
|
|
b452e70419 | ||
|
|
6809497730 | ||
|
|
70597a77ab | ||
|
|
f5faf86cb3 | ||
|
|
be4e253620 | ||
|
|
ebc1152376 | ||
|
|
625bfb3ba7 | ||
|
|
c11b83c712 | ||
|
|
a3b471c1d1 | ||
|
|
64bb0dfb5b | ||
|
|
ddb26a9f42 | ||
|
|
744d8fdd5e | ||
|
|
6feb06e623 | ||
|
|
afc14ec29d | ||
|
|
59134c65d0 | ||
|
|
614537998a | ||
|
|
d2cee468a0 | ||
|
|
94f454c311 | ||
|
|
17881c9a36 | ||
|
|
5b2def6fdd | ||
|
|
9b6d29212d | ||
|
|
c1bff03b1c | ||
|
|
b00f113658 | ||
|
|
7dcd923ebf | ||
|
|
1fcd8a7c1a | ||
|
|
4a89f7f26b | ||
|
|
a9196348ab | ||
|
|
12dec366e0 | ||
|
|
1713f6af76 | ||
|
|
7f4adb70bd | ||
|
|
e2483e4be0 | ||
|
|
322c0b8d56 | ||
|
|
81c1d8362d | ||
|
|
d1156ee3fd | ||
|
|
18f971954b | ||
|
|
e55ac7062c | ||
|
|
c178eada22 | ||
|
|
92213e302f | ||
|
|
72193b0249 | ||
|
|
066d7106b0 | ||
|
|
589de8e361 | ||
|
|
914cd8b611 | ||
|
|
845290595e | ||
|
|
544b60d111 | ||
|
|
aa0787b0ff | ||
|
|
89f144df75 | ||
|
|
cfccbe2bed | ||
|
|
3dd9a06d67 | ||
|
|
4bfe9039ed | ||
|
|
75cddbf444 | ||
|
|
89b18341c5 | ||
|
|
90137f7093 | ||
|
|
480187b1f5 | ||
|
|
0360d4145c | ||
|
|
2bec5afcdd | ||
|
|
4539024280 | ||
|
|
398bd0c1da | ||
|
|
91759587f5 | ||
|
|
bc9841ea8c | ||
|
|
32241faf55 | ||
|
|
685e22bd68 | ||
|
|
88de779ff7 | ||
|
|
d452694c55 | ||
|
|
7fba8ac2b4 | ||
|
|
d78a5867b8 | ||
|
|
6809a40257 | ||
|
|
cea55a72c3 | ||
|
|
e38a4a21ee |
2
.github/DISCUSSION_TEMPLATE/2-4.yml
vendored
2
.github/DISCUSSION_TEMPLATE/2-4.yml
vendored
@@ -33,7 +33,7 @@ body:
|
|||||||
- 2.4.200
|
- 2.4.200
|
||||||
- 2.4.201
|
- 2.4.201
|
||||||
- 2.4.210
|
- 2.4.210
|
||||||
- 3.0.0
|
- 2.4.211
|
||||||
- Other (please provide detail below)
|
- Other (please provide detail below)
|
||||||
validations:
|
validations:
|
||||||
required: true
|
required: true
|
||||||
|
|||||||
177
.github/DISCUSSION_TEMPLATE/3-0.yml
vendored
Normal file
177
.github/DISCUSSION_TEMPLATE/3-0.yml
vendored
Normal file
@@ -0,0 +1,177 @@
|
|||||||
|
body:
|
||||||
|
- type: markdown
|
||||||
|
attributes:
|
||||||
|
value: |
|
||||||
|
If your organization needs more immediate, enterprise grade professional support, with one-on-one virtual meetings and screensharing, contact us via our website: https://securityonion.com/support
|
||||||
|
- type: dropdown
|
||||||
|
attributes:
|
||||||
|
label: Version
|
||||||
|
description: Which version of Security Onion are you asking about?
|
||||||
|
options:
|
||||||
|
-
|
||||||
|
- 3.0.0
|
||||||
|
- Other (please provide detail below)
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
- type: dropdown
|
||||||
|
attributes:
|
||||||
|
label: Installation Method
|
||||||
|
description: How did you install Security Onion?
|
||||||
|
options:
|
||||||
|
-
|
||||||
|
- Security Onion ISO image
|
||||||
|
- Cloud image (Amazon, Azure, Google)
|
||||||
|
- Network installation on Oracle 9 (unsupported)
|
||||||
|
- Other (please provide detail below)
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
- type: dropdown
|
||||||
|
attributes:
|
||||||
|
label: Description
|
||||||
|
description: >
|
||||||
|
Is this discussion about installation, configuration, upgrading, or other?
|
||||||
|
options:
|
||||||
|
-
|
||||||
|
- installation
|
||||||
|
- configuration
|
||||||
|
- upgrading
|
||||||
|
- other (please provide detail below)
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
- type: dropdown
|
||||||
|
attributes:
|
||||||
|
label: Installation Type
|
||||||
|
description: >
|
||||||
|
When you installed, did you choose Import, Eval, Standalone, Distributed, or something else?
|
||||||
|
options:
|
||||||
|
-
|
||||||
|
- Import
|
||||||
|
- Eval
|
||||||
|
- Standalone
|
||||||
|
- Distributed
|
||||||
|
- other (please provide detail below)
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
- type: dropdown
|
||||||
|
attributes:
|
||||||
|
label: Location
|
||||||
|
description: >
|
||||||
|
Is this deployment in the cloud, on-prem with Internet access, or airgap?
|
||||||
|
options:
|
||||||
|
-
|
||||||
|
- cloud
|
||||||
|
- on-prem with Internet access
|
||||||
|
- airgap
|
||||||
|
- other (please provide detail below)
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
- type: dropdown
|
||||||
|
attributes:
|
||||||
|
label: Hardware Specs
|
||||||
|
description: >
|
||||||
|
Does your hardware meet or exceed the minimum requirements for your installation type as shown at https://securityonion.net/docs/hardware?
|
||||||
|
options:
|
||||||
|
-
|
||||||
|
- Meets minimum requirements
|
||||||
|
- Exceeds minimum requirements
|
||||||
|
- Does not meet minimum requirements
|
||||||
|
- other (please provide detail below)
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
- type: input
|
||||||
|
attributes:
|
||||||
|
label: CPU
|
||||||
|
description: How many CPU cores do you have?
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
- type: input
|
||||||
|
attributes:
|
||||||
|
label: RAM
|
||||||
|
description: How much RAM do you have?
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
- type: input
|
||||||
|
attributes:
|
||||||
|
label: Storage for /
|
||||||
|
description: How much storage do you have for the / partition?
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
- type: input
|
||||||
|
attributes:
|
||||||
|
label: Storage for /nsm
|
||||||
|
description: How much storage do you have for the /nsm partition?
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
- type: dropdown
|
||||||
|
attributes:
|
||||||
|
label: Network Traffic Collection
|
||||||
|
description: >
|
||||||
|
Are you collecting network traffic from a tap or span port?
|
||||||
|
options:
|
||||||
|
-
|
||||||
|
- tap
|
||||||
|
- span port
|
||||||
|
- other (please provide detail below)
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
- type: dropdown
|
||||||
|
attributes:
|
||||||
|
label: Network Traffic Speeds
|
||||||
|
description: >
|
||||||
|
How much network traffic are you monitoring?
|
||||||
|
options:
|
||||||
|
-
|
||||||
|
- Less than 1Gbps
|
||||||
|
- 1Gbps to 10Gbps
|
||||||
|
- more than 10Gbps
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
- type: dropdown
|
||||||
|
attributes:
|
||||||
|
label: Status
|
||||||
|
description: >
|
||||||
|
Does SOC Grid show all services on all nodes as running OK?
|
||||||
|
options:
|
||||||
|
-
|
||||||
|
- Yes, all services on all nodes are running OK
|
||||||
|
- No, one or more services are failed (please provide detail below)
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
- type: dropdown
|
||||||
|
attributes:
|
||||||
|
label: Salt Status
|
||||||
|
description: >
|
||||||
|
Do you get any failures when you run "sudo salt-call state.highstate"?
|
||||||
|
options:
|
||||||
|
-
|
||||||
|
- Yes, there are salt failures (please provide detail below)
|
||||||
|
- No, there are no failures
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
- type: dropdown
|
||||||
|
attributes:
|
||||||
|
label: Logs
|
||||||
|
description: >
|
||||||
|
Are there any additional clues in /opt/so/log/?
|
||||||
|
options:
|
||||||
|
-
|
||||||
|
- Yes, there are additional clues in /opt/so/log/ (please provide detail below)
|
||||||
|
- No, there are no additional clues
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
- type: textarea
|
||||||
|
attributes:
|
||||||
|
label: Detail
|
||||||
|
description: Please read our discussion guidelines at https://github.com/Security-Onion-Solutions/securityonion/discussions/1720 and then provide detailed information to help us help you.
|
||||||
|
placeholder: |-
|
||||||
|
STOP! Before typing, please read our discussion guidelines at https://github.com/Security-Onion-Solutions/securityonion/discussions/1720 in their entirety!
|
||||||
|
|
||||||
|
If your organization needs more immediate, enterprise grade professional support, with one-on-one virtual meetings and screensharing, contact us via our website: https://securityonion.com/support
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
- type: checkboxes
|
||||||
|
attributes:
|
||||||
|
label: Guidelines
|
||||||
|
options:
|
||||||
|
- label: I have read the discussion guidelines at https://github.com/Security-Onion-Solutions/securityonion/discussions/1720 and assert that I have followed the guidelines.
|
||||||
|
required: true
|
||||||
2
.github/workflows/pythontest.yml
vendored
2
.github/workflows/pythontest.yml
vendored
@@ -13,7 +13,7 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
python-version: ["3.13"]
|
python-version: ["3.14"]
|
||||||
python-code-path: ["salt/sensoroni/files/analyzers", "salt/manager/tools/sbin"]
|
python-code-path: ["salt/sensoroni/files/analyzers", "salt/manager/tools/sbin"]
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
|
|||||||
@@ -1,24 +1,14 @@
|
|||||||
from os import path
|
|
||||||
import subprocess
|
import subprocess
|
||||||
|
|
||||||
def check():
|
def check():
|
||||||
|
|
||||||
osfam = __grains__['os_family']
|
|
||||||
retval = 'False'
|
retval = 'False'
|
||||||
|
|
||||||
if osfam == 'Debian':
|
cmd = 'needs-restarting -r > /dev/null 2>&1'
|
||||||
if path.exists('/var/run/reboot-required'):
|
|
||||||
retval = 'True'
|
|
||||||
|
|
||||||
elif osfam == 'RedHat':
|
try:
|
||||||
cmd = 'needs-restarting -r > /dev/null 2>&1'
|
needs_restarting = subprocess.check_call(cmd, shell=True)
|
||||||
|
except subprocess.CalledProcessError:
|
||||||
try:
|
retval = 'True'
|
||||||
needs_restarting = subprocess.check_call(cmd, shell=True)
|
|
||||||
except subprocess.CalledProcessError:
|
|
||||||
retval = 'True'
|
|
||||||
|
|
||||||
else:
|
|
||||||
retval = 'Unsupported OS: %s' % os
|
|
||||||
|
|
||||||
return retval
|
return retval
|
||||||
|
|||||||
@@ -3,8 +3,6 @@
|
|||||||
# https://securityonion.net/license; you may not use this file except in compliance with the
|
# https://securityonion.net/license; you may not use this file except in compliance with the
|
||||||
# Elastic License 2.0.
|
# Elastic License 2.0.
|
||||||
|
|
||||||
{% from 'vars/globals.map.jinja' import GLOBALS %}
|
|
||||||
|
|
||||||
include:
|
include:
|
||||||
- docker
|
- docker
|
||||||
|
|
||||||
@@ -18,9 +16,3 @@ trusttheca:
|
|||||||
- show_changes: False
|
- show_changes: False
|
||||||
- makedirs: True
|
- makedirs: True
|
||||||
|
|
||||||
{% if GLOBALS.os_family == 'Debian' %}
|
|
||||||
symlinkca:
|
|
||||||
file.symlink:
|
|
||||||
- target: /etc/pki/tls/certs/intca.crt
|
|
||||||
- name: /etc/ssl/certs/intca.crt
|
|
||||||
{% endif %}
|
|
||||||
|
|||||||
@@ -1,12 +0,0 @@
|
|||||||
{
|
|
||||||
"registry-mirrors": [
|
|
||||||
"https://:5000"
|
|
||||||
],
|
|
||||||
"bip": "172.17.0.1/24",
|
|
||||||
"default-address-pools": [
|
|
||||||
{
|
|
||||||
"base": "172.17.0.0/24",
|
|
||||||
"size": 24
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
@@ -20,11 +20,6 @@ kernel.printk:
|
|||||||
sysctl.present:
|
sysctl.present:
|
||||||
- value: "3 4 1 3"
|
- value: "3 4 1 3"
|
||||||
|
|
||||||
# Remove variables.txt from /tmp - This is temp
|
|
||||||
rmvariablesfile:
|
|
||||||
file.absent:
|
|
||||||
- name: /tmp/variables.txt
|
|
||||||
|
|
||||||
# Add socore Group
|
# Add socore Group
|
||||||
socoregroup:
|
socoregroup:
|
||||||
group.present:
|
group.present:
|
||||||
@@ -149,28 +144,6 @@ common_sbin_jinja:
|
|||||||
- so-import-pcap
|
- so-import-pcap
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% if GLOBALS.role == 'so-heavynode' %}
|
|
||||||
remove_so-pcap-import_heavynode:
|
|
||||||
file.absent:
|
|
||||||
- name: /usr/sbin/so-pcap-import
|
|
||||||
|
|
||||||
remove_so-import-pcap_heavynode:
|
|
||||||
file.absent:
|
|
||||||
- name: /usr/sbin/so-import-pcap
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
{% if not GLOBALS.is_manager%}
|
|
||||||
# prior to 2.4.50 these scripts were in common/tools/sbin on the manager because of soup and distributed to non managers
|
|
||||||
# these two states remove the scripts from non manager nodes
|
|
||||||
remove_soup:
|
|
||||||
file.absent:
|
|
||||||
- name: /usr/sbin/soup
|
|
||||||
|
|
||||||
remove_so-firewall:
|
|
||||||
file.absent:
|
|
||||||
- name: /usr/sbin/so-firewall
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
so-status_script:
|
so-status_script:
|
||||||
file.managed:
|
file.managed:
|
||||||
- name: /usr/sbin/so-status
|
- name: /usr/sbin/so-status
|
||||||
|
|||||||
@@ -1,52 +1,5 @@
|
|||||||
# we cannot import GLOBALS from vars/globals.map.jinja in this state since it is called in setup.virt.init
|
# we cannot import GLOBALS from vars/globals.map.jinja in this state since it is called in setup.virt.init
|
||||||
# since it is early in setup of a new VM, the pillars imported in GLOBALS are not yet defined
|
# since it is early in setup of a new VM, the pillars imported in GLOBALS are not yet defined
|
||||||
{% if grains.os_family == 'Debian' %}
|
|
||||||
commonpkgs:
|
|
||||||
pkg.installed:
|
|
||||||
- skip_suggestions: True
|
|
||||||
- pkgs:
|
|
||||||
- apache2-utils
|
|
||||||
- wget
|
|
||||||
- ntpdate
|
|
||||||
- jq
|
|
||||||
- curl
|
|
||||||
- ca-certificates
|
|
||||||
- software-properties-common
|
|
||||||
- apt-transport-https
|
|
||||||
- openssl
|
|
||||||
- netcat-openbsd
|
|
||||||
- sqlite3
|
|
||||||
- libssl-dev
|
|
||||||
- procps
|
|
||||||
- python3-dateutil
|
|
||||||
- python3-docker
|
|
||||||
- python3-packaging
|
|
||||||
- python3-lxml
|
|
||||||
- git
|
|
||||||
- rsync
|
|
||||||
- vim
|
|
||||||
- tar
|
|
||||||
- unzip
|
|
||||||
- bc
|
|
||||||
{% if grains.oscodename != 'focal' %}
|
|
||||||
- python3-rich
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
{% if grains.oscodename == 'focal' %}
|
|
||||||
# since Ubuntu requires and internet connection we can use pip to install modules
|
|
||||||
python3-pip:
|
|
||||||
pkg.installed
|
|
||||||
|
|
||||||
python-rich:
|
|
||||||
pip.installed:
|
|
||||||
- name: rich
|
|
||||||
- target: /usr/local/lib/python3.8/dist-packages/
|
|
||||||
- require:
|
|
||||||
- pkg: python3-pip
|
|
||||||
{% endif %}
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
{% if grains.os_family == 'RedHat' %}
|
|
||||||
|
|
||||||
remove_mariadb:
|
remove_mariadb:
|
||||||
pkg.removed:
|
pkg.removed:
|
||||||
@@ -84,5 +37,3 @@ commonpkgs:
|
|||||||
- unzip
|
- unzip
|
||||||
- wget
|
- wget
|
||||||
- yum-utils
|
- yum-utils
|
||||||
|
|
||||||
{% endif %}
|
|
||||||
|
|||||||
@@ -11,14 +11,6 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
{% set SOVERSION = salt['file.read']('/etc/soversion').strip() %}
|
{% set SOVERSION = salt['file.read']('/etc/soversion').strip() %}
|
||||||
|
|
||||||
remove_common_soup:
|
|
||||||
file.absent:
|
|
||||||
- name: /opt/so/saltstack/default/salt/common/tools/sbin/soup
|
|
||||||
|
|
||||||
remove_common_so-firewall:
|
|
||||||
file.absent:
|
|
||||||
- name: /opt/so/saltstack/default/salt/common/tools/sbin/so-firewall
|
|
||||||
|
|
||||||
# This section is used to put the scripts in place in the Salt file system
|
# This section is used to put the scripts in place in the Salt file system
|
||||||
# in case a state run tries to overwrite what we do in the next section.
|
# in case a state run tries to overwrite what we do in the next section.
|
||||||
copy_so-common_common_tools_sbin:
|
copy_so-common_common_tools_sbin:
|
||||||
|
|||||||
@@ -349,21 +349,16 @@ get_random_value() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
gpg_rpm_import() {
|
gpg_rpm_import() {
|
||||||
if [[ $is_oracle ]]; then
|
if [[ "$WHATWOULDYOUSAYYAHDOHERE" == "setup" ]]; then
|
||||||
if [[ "$WHATWOULDYOUSAYYAHDOHERE" == "setup" ]]; then
|
local RPMKEYSLOC="../salt/repo/client/files/$OS/keys"
|
||||||
local RPMKEYSLOC="../salt/repo/client/files/$OS/keys"
|
else
|
||||||
else
|
local RPMKEYSLOC="$UPDATE_DIR/salt/repo/client/files/$OS/keys"
|
||||||
local RPMKEYSLOC="$UPDATE_DIR/salt/repo/client/files/$OS/keys"
|
|
||||||
fi
|
|
||||||
RPMKEYS=('RPM-GPG-KEY-oracle' 'RPM-GPG-KEY-EPEL-9' 'SALT-PROJECT-GPG-PUBKEY-2023.pub' 'docker.pub' 'securityonion.pub')
|
|
||||||
for RPMKEY in "${RPMKEYS[@]}"; do
|
|
||||||
rpm --import $RPMKEYSLOC/$RPMKEY
|
|
||||||
echo "Imported $RPMKEY"
|
|
||||||
done
|
|
||||||
elif [[ $is_rpm ]]; then
|
|
||||||
echo "Importing the security onion GPG key"
|
|
||||||
rpm --import ../salt/repo/client/files/oracle/keys/securityonion.pub
|
|
||||||
fi
|
fi
|
||||||
|
RPMKEYS=('RPM-GPG-KEY-oracle' 'RPM-GPG-KEY-EPEL-9' 'SALT-PROJECT-GPG-PUBKEY-2023.pub' 'docker.pub' 'securityonion.pub')
|
||||||
|
for RPMKEY in "${RPMKEYS[@]}"; do
|
||||||
|
rpm --import $RPMKEYSLOC/$RPMKEY
|
||||||
|
echo "Imported $RPMKEY"
|
||||||
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
header() {
|
header() {
|
||||||
@@ -615,69 +610,19 @@ salt_minion_count() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
set_os() {
|
set_os() {
|
||||||
if [ -f /etc/redhat-release ]; then
|
if [ -f /etc/redhat-release ] && grep -q "Red Hat Enterprise Linux release 9" /etc/redhat-release && [ -f /etc/oracle-release ]; then
|
||||||
if grep -q "Rocky Linux release 9" /etc/redhat-release; then
|
OS=oracle
|
||||||
OS=rocky
|
OSVER=9
|
||||||
OSVER=9
|
is_oracle=true
|
||||||
is_rocky=true
|
is_rpm=true
|
||||||
is_rpm=true
|
|
||||||
elif grep -q "CentOS Stream release 9" /etc/redhat-release; then
|
|
||||||
OS=centos
|
|
||||||
OSVER=9
|
|
||||||
is_centos=true
|
|
||||||
is_rpm=true
|
|
||||||
elif grep -q "AlmaLinux release 9" /etc/redhat-release; then
|
|
||||||
OS=alma
|
|
||||||
OSVER=9
|
|
||||||
is_alma=true
|
|
||||||
is_rpm=true
|
|
||||||
elif grep -q "Red Hat Enterprise Linux release 9" /etc/redhat-release; then
|
|
||||||
if [ -f /etc/oracle-release ]; then
|
|
||||||
OS=oracle
|
|
||||||
OSVER=9
|
|
||||||
is_oracle=true
|
|
||||||
is_rpm=true
|
|
||||||
else
|
|
||||||
OS=rhel
|
|
||||||
OSVER=9
|
|
||||||
is_rhel=true
|
|
||||||
is_rpm=true
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
cron_service_name="crond"
|
|
||||||
elif [ -f /etc/os-release ]; then
|
|
||||||
if grep -q "UBUNTU_CODENAME=focal" /etc/os-release; then
|
|
||||||
OSVER=focal
|
|
||||||
UBVER=20.04
|
|
||||||
OS=ubuntu
|
|
||||||
is_ubuntu=true
|
|
||||||
is_deb=true
|
|
||||||
elif grep -q "UBUNTU_CODENAME=jammy" /etc/os-release; then
|
|
||||||
OSVER=jammy
|
|
||||||
UBVER=22.04
|
|
||||||
OS=ubuntu
|
|
||||||
is_ubuntu=true
|
|
||||||
is_deb=true
|
|
||||||
elif grep -q "VERSION_CODENAME=bookworm" /etc/os-release; then
|
|
||||||
OSVER=bookworm
|
|
||||||
DEBVER=12
|
|
||||||
is_debian=true
|
|
||||||
OS=debian
|
|
||||||
is_deb=true
|
|
||||||
fi
|
|
||||||
cron_service_name="cron"
|
|
||||||
fi
|
fi
|
||||||
|
cron_service_name="crond"
|
||||||
}
|
}
|
||||||
|
|
||||||
set_minionid() {
|
set_minionid() {
|
||||||
MINIONID=$(lookup_grain id)
|
MINIONID=$(lookup_grain id)
|
||||||
}
|
}
|
||||||
|
|
||||||
set_palette() {
|
|
||||||
if [[ $is_deb ]]; then
|
|
||||||
update-alternatives --set newt-palette /etc/newt/palette.original
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
set_version() {
|
set_version() {
|
||||||
CURRENTVERSION=0.0.0
|
CURRENTVERSION=0.0.0
|
||||||
|
|||||||
@@ -1,34 +0,0 @@
|
|||||||
# Copyright Security Onion Solutions LLC and/or licensed to Security Onion Solutions LLC under one
|
|
||||||
# or more contributor license agreements. Licensed under the Elastic License 2.0 as shown at
|
|
||||||
# https://securityonion.net/license; you may not use this file except in compliance with the
|
|
||||||
# Elastic License 2.0.
|
|
||||||
|
|
||||||
so-curator:
|
|
||||||
docker_container.absent:
|
|
||||||
- force: True
|
|
||||||
|
|
||||||
so-curator_so-status.disabled:
|
|
||||||
file.line:
|
|
||||||
- name: /opt/so/conf/so-status/so-status.conf
|
|
||||||
- match: ^so-curator$
|
|
||||||
- mode: delete
|
|
||||||
|
|
||||||
so-curator-cluster-close:
|
|
||||||
cron.absent:
|
|
||||||
- identifier: so-curator-cluster-close
|
|
||||||
|
|
||||||
so-curator-cluster-delete:
|
|
||||||
cron.absent:
|
|
||||||
- identifier: so-curator-cluster-delete
|
|
||||||
|
|
||||||
delete_curator_configuration:
|
|
||||||
file.absent:
|
|
||||||
- name: /opt/so/conf/curator
|
|
||||||
- recurse: True
|
|
||||||
|
|
||||||
{% set files = salt.file.find(path='/usr/sbin', name='so-curator*') %}
|
|
||||||
{% if files|length > 0 %}
|
|
||||||
delete_curator_scripts:
|
|
||||||
file.absent:
|
|
||||||
- names: {{files|yaml}}
|
|
||||||
{% endif %}
|
|
||||||
@@ -1,6 +1,10 @@
|
|||||||
docker:
|
docker:
|
||||||
range: '172.17.1.0/24'
|
range: '172.17.1.0/24'
|
||||||
gateway: '172.17.1.1'
|
gateway: '172.17.1.1'
|
||||||
|
ulimits:
|
||||||
|
- name: nofile
|
||||||
|
soft: 1048576
|
||||||
|
hard: 1048576
|
||||||
containers:
|
containers:
|
||||||
'so-dockerregistry':
|
'so-dockerregistry':
|
||||||
final_octet: 20
|
final_octet: 20
|
||||||
@@ -9,6 +13,7 @@ docker:
|
|||||||
custom_bind_mounts: []
|
custom_bind_mounts: []
|
||||||
extra_hosts: []
|
extra_hosts: []
|
||||||
extra_env: []
|
extra_env: []
|
||||||
|
ulimits: []
|
||||||
'so-elastic-fleet':
|
'so-elastic-fleet':
|
||||||
final_octet: 21
|
final_octet: 21
|
||||||
port_bindings:
|
port_bindings:
|
||||||
@@ -16,6 +21,7 @@ docker:
|
|||||||
custom_bind_mounts: []
|
custom_bind_mounts: []
|
||||||
extra_hosts: []
|
extra_hosts: []
|
||||||
extra_env: []
|
extra_env: []
|
||||||
|
ulimits: []
|
||||||
'so-elasticsearch':
|
'so-elasticsearch':
|
||||||
final_octet: 22
|
final_octet: 22
|
||||||
port_bindings:
|
port_bindings:
|
||||||
@@ -24,6 +30,16 @@ docker:
|
|||||||
custom_bind_mounts: []
|
custom_bind_mounts: []
|
||||||
extra_hosts: []
|
extra_hosts: []
|
||||||
extra_env: []
|
extra_env: []
|
||||||
|
ulimits:
|
||||||
|
- name: memlock
|
||||||
|
soft: -1
|
||||||
|
hard: -1
|
||||||
|
- name: nofile
|
||||||
|
soft: 65536
|
||||||
|
hard: 65536
|
||||||
|
- name: nproc
|
||||||
|
soft: 4096
|
||||||
|
hard: 4096
|
||||||
'so-influxdb':
|
'so-influxdb':
|
||||||
final_octet: 26
|
final_octet: 26
|
||||||
port_bindings:
|
port_bindings:
|
||||||
@@ -31,6 +47,7 @@ docker:
|
|||||||
custom_bind_mounts: []
|
custom_bind_mounts: []
|
||||||
extra_hosts: []
|
extra_hosts: []
|
||||||
extra_env: []
|
extra_env: []
|
||||||
|
ulimits: []
|
||||||
'so-kibana':
|
'so-kibana':
|
||||||
final_octet: 27
|
final_octet: 27
|
||||||
port_bindings:
|
port_bindings:
|
||||||
@@ -38,6 +55,7 @@ docker:
|
|||||||
custom_bind_mounts: []
|
custom_bind_mounts: []
|
||||||
extra_hosts: []
|
extra_hosts: []
|
||||||
extra_env: []
|
extra_env: []
|
||||||
|
ulimits: []
|
||||||
'so-kratos':
|
'so-kratos':
|
||||||
final_octet: 28
|
final_octet: 28
|
||||||
port_bindings:
|
port_bindings:
|
||||||
@@ -46,6 +64,7 @@ docker:
|
|||||||
custom_bind_mounts: []
|
custom_bind_mounts: []
|
||||||
extra_hosts: []
|
extra_hosts: []
|
||||||
extra_env: []
|
extra_env: []
|
||||||
|
ulimits: []
|
||||||
'so-hydra':
|
'so-hydra':
|
||||||
final_octet: 30
|
final_octet: 30
|
||||||
port_bindings:
|
port_bindings:
|
||||||
@@ -54,6 +73,7 @@ docker:
|
|||||||
custom_bind_mounts: []
|
custom_bind_mounts: []
|
||||||
extra_hosts: []
|
extra_hosts: []
|
||||||
extra_env: []
|
extra_env: []
|
||||||
|
ulimits: []
|
||||||
'so-logstash':
|
'so-logstash':
|
||||||
final_octet: 29
|
final_octet: 29
|
||||||
port_bindings:
|
port_bindings:
|
||||||
@@ -70,6 +90,7 @@ docker:
|
|||||||
custom_bind_mounts: []
|
custom_bind_mounts: []
|
||||||
extra_hosts: []
|
extra_hosts: []
|
||||||
extra_env: []
|
extra_env: []
|
||||||
|
ulimits: []
|
||||||
'so-nginx':
|
'so-nginx':
|
||||||
final_octet: 31
|
final_octet: 31
|
||||||
port_bindings:
|
port_bindings:
|
||||||
@@ -81,6 +102,7 @@ docker:
|
|||||||
custom_bind_mounts: []
|
custom_bind_mounts: []
|
||||||
extra_hosts: []
|
extra_hosts: []
|
||||||
extra_env: []
|
extra_env: []
|
||||||
|
ulimits: []
|
||||||
'so-nginx-fleet-node':
|
'so-nginx-fleet-node':
|
||||||
final_octet: 31
|
final_octet: 31
|
||||||
port_bindings:
|
port_bindings:
|
||||||
@@ -88,6 +110,7 @@ docker:
|
|||||||
custom_bind_mounts: []
|
custom_bind_mounts: []
|
||||||
extra_hosts: []
|
extra_hosts: []
|
||||||
extra_env: []
|
extra_env: []
|
||||||
|
ulimits: []
|
||||||
'so-redis':
|
'so-redis':
|
||||||
final_octet: 33
|
final_octet: 33
|
||||||
port_bindings:
|
port_bindings:
|
||||||
@@ -96,11 +119,13 @@ docker:
|
|||||||
custom_bind_mounts: []
|
custom_bind_mounts: []
|
||||||
extra_hosts: []
|
extra_hosts: []
|
||||||
extra_env: []
|
extra_env: []
|
||||||
|
ulimits: []
|
||||||
'so-sensoroni':
|
'so-sensoroni':
|
||||||
final_octet: 99
|
final_octet: 99
|
||||||
custom_bind_mounts: []
|
custom_bind_mounts: []
|
||||||
extra_hosts: []
|
extra_hosts: []
|
||||||
extra_env: []
|
extra_env: []
|
||||||
|
ulimits: []
|
||||||
'so-soc':
|
'so-soc':
|
||||||
final_octet: 34
|
final_octet: 34
|
||||||
port_bindings:
|
port_bindings:
|
||||||
@@ -108,16 +133,19 @@ docker:
|
|||||||
custom_bind_mounts: []
|
custom_bind_mounts: []
|
||||||
extra_hosts: []
|
extra_hosts: []
|
||||||
extra_env: []
|
extra_env: []
|
||||||
|
ulimits: []
|
||||||
'so-strelka-backend':
|
'so-strelka-backend':
|
||||||
final_octet: 36
|
final_octet: 36
|
||||||
custom_bind_mounts: []
|
custom_bind_mounts: []
|
||||||
extra_hosts: []
|
extra_hosts: []
|
||||||
extra_env: []
|
extra_env: []
|
||||||
|
ulimits: []
|
||||||
'so-strelka-filestream':
|
'so-strelka-filestream':
|
||||||
final_octet: 37
|
final_octet: 37
|
||||||
custom_bind_mounts: []
|
custom_bind_mounts: []
|
||||||
extra_hosts: []
|
extra_hosts: []
|
||||||
extra_env: []
|
extra_env: []
|
||||||
|
ulimits: []
|
||||||
'so-strelka-frontend':
|
'so-strelka-frontend':
|
||||||
final_octet: 38
|
final_octet: 38
|
||||||
port_bindings:
|
port_bindings:
|
||||||
@@ -125,11 +153,13 @@ docker:
|
|||||||
custom_bind_mounts: []
|
custom_bind_mounts: []
|
||||||
extra_hosts: []
|
extra_hosts: []
|
||||||
extra_env: []
|
extra_env: []
|
||||||
|
ulimits: []
|
||||||
'so-strelka-manager':
|
'so-strelka-manager':
|
||||||
final_octet: 39
|
final_octet: 39
|
||||||
custom_bind_mounts: []
|
custom_bind_mounts: []
|
||||||
extra_hosts: []
|
extra_hosts: []
|
||||||
extra_env: []
|
extra_env: []
|
||||||
|
ulimits: []
|
||||||
'so-strelka-gatekeeper':
|
'so-strelka-gatekeeper':
|
||||||
final_octet: 40
|
final_octet: 40
|
||||||
port_bindings:
|
port_bindings:
|
||||||
@@ -137,6 +167,7 @@ docker:
|
|||||||
custom_bind_mounts: []
|
custom_bind_mounts: []
|
||||||
extra_hosts: []
|
extra_hosts: []
|
||||||
extra_env: []
|
extra_env: []
|
||||||
|
ulimits: []
|
||||||
'so-strelka-coordinator':
|
'so-strelka-coordinator':
|
||||||
final_octet: 41
|
final_octet: 41
|
||||||
port_bindings:
|
port_bindings:
|
||||||
@@ -144,11 +175,13 @@ docker:
|
|||||||
custom_bind_mounts: []
|
custom_bind_mounts: []
|
||||||
extra_hosts: []
|
extra_hosts: []
|
||||||
extra_env: []
|
extra_env: []
|
||||||
|
ulimits: []
|
||||||
'so-elastalert':
|
'so-elastalert':
|
||||||
final_octet: 42
|
final_octet: 42
|
||||||
custom_bind_mounts: []
|
custom_bind_mounts: []
|
||||||
extra_hosts: []
|
extra_hosts: []
|
||||||
extra_env: []
|
extra_env: []
|
||||||
|
ulimits: []
|
||||||
'so-elastic-fleet-package-registry':
|
'so-elastic-fleet-package-registry':
|
||||||
final_octet: 44
|
final_octet: 44
|
||||||
port_bindings:
|
port_bindings:
|
||||||
@@ -156,11 +189,13 @@ docker:
|
|||||||
custom_bind_mounts: []
|
custom_bind_mounts: []
|
||||||
extra_hosts: []
|
extra_hosts: []
|
||||||
extra_env: []
|
extra_env: []
|
||||||
|
ulimits: []
|
||||||
'so-idh':
|
'so-idh':
|
||||||
final_octet: 45
|
final_octet: 45
|
||||||
custom_bind_mounts: []
|
custom_bind_mounts: []
|
||||||
extra_hosts: []
|
extra_hosts: []
|
||||||
extra_env: []
|
extra_env: []
|
||||||
|
ulimits: []
|
||||||
'so-elastic-agent':
|
'so-elastic-agent':
|
||||||
final_octet: 46
|
final_octet: 46
|
||||||
port_bindings:
|
port_bindings:
|
||||||
@@ -169,23 +204,34 @@ docker:
|
|||||||
custom_bind_mounts: []
|
custom_bind_mounts: []
|
||||||
extra_hosts: []
|
extra_hosts: []
|
||||||
extra_env: []
|
extra_env: []
|
||||||
|
ulimits: []
|
||||||
'so-telegraf':
|
'so-telegraf':
|
||||||
final_octet: 99
|
final_octet: 99
|
||||||
custom_bind_mounts: []
|
custom_bind_mounts: []
|
||||||
extra_hosts: []
|
extra_hosts: []
|
||||||
extra_env: []
|
extra_env: []
|
||||||
|
ulimits: []
|
||||||
'so-suricata':
|
'so-suricata':
|
||||||
final_octet: 99
|
final_octet: 99
|
||||||
custom_bind_mounts: []
|
custom_bind_mounts: []
|
||||||
extra_hosts: []
|
extra_hosts: []
|
||||||
extra_env: []
|
extra_env: []
|
||||||
ulimits:
|
ulimits:
|
||||||
- memlock=524288000
|
- name: memlock
|
||||||
|
soft: 524288000
|
||||||
|
hard: 524288000
|
||||||
'so-zeek':
|
'so-zeek':
|
||||||
final_octet: 99
|
final_octet: 99
|
||||||
custom_bind_mounts: []
|
custom_bind_mounts: []
|
||||||
extra_hosts: []
|
extra_hosts: []
|
||||||
extra_env: []
|
extra_env: []
|
||||||
|
ulimits:
|
||||||
|
- name: core
|
||||||
|
soft: 0
|
||||||
|
hard: 0
|
||||||
|
- name: nofile
|
||||||
|
soft: 1048576
|
||||||
|
hard: 1048576
|
||||||
'so-kafka':
|
'so-kafka':
|
||||||
final_octet: 88
|
final_octet: 88
|
||||||
port_bindings:
|
port_bindings:
|
||||||
@@ -196,3 +242,4 @@ docker:
|
|||||||
custom_bind_mounts: []
|
custom_bind_mounts: []
|
||||||
extra_hosts: []
|
extra_hosts: []
|
||||||
extra_env: []
|
extra_env: []
|
||||||
|
ulimits: []
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
{% import_yaml 'docker/defaults.yaml' as DOCKERDEFAULTS %}
|
{% import_yaml 'docker/defaults.yaml' as DOCKERDEFAULTS %}
|
||||||
{% set DOCKER = salt['pillar.get']('docker', DOCKERDEFAULTS.docker, merge=True) %}
|
{% set DOCKERMERGED = salt['pillar.get']('docker', DOCKERDEFAULTS.docker, merge=True) %}
|
||||||
{% set RANGESPLIT = DOCKER.range.split('.') %}
|
{% set RANGESPLIT = DOCKERMERGED.range.split('.') %}
|
||||||
{% set FIRSTTHREE = RANGESPLIT[0] ~ '.' ~ RANGESPLIT[1] ~ '.' ~ RANGESPLIT[2] ~ '.' %}
|
{% set FIRSTTHREE = RANGESPLIT[0] ~ '.' ~ RANGESPLIT[1] ~ '.' ~ RANGESPLIT[2] ~ '.' %}
|
||||||
|
|
||||||
{% for container, vals in DOCKER.containers.items() %}
|
{% for container, vals in DOCKERMERGED.containers.items() %}
|
||||||
{% do DOCKER.containers[container].update({'ip': FIRSTTHREE ~ DOCKER.containers[container].final_octet}) %}
|
{% do DOCKERMERGED.containers[container].update({'ip': FIRSTTHREE ~ DOCKERMERGED.containers[container].final_octet}) %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|||||||
24
salt/docker/files/daemon.json.jinja
Normal file
24
salt/docker/files/daemon.json.jinja
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
{% from 'docker/docker.map.jinja' import DOCKERMERGED -%}
|
||||||
|
{
|
||||||
|
"registry-mirrors": [
|
||||||
|
"https://:5000"
|
||||||
|
],
|
||||||
|
"bip": "172.17.0.1/24",
|
||||||
|
"default-address-pools": [
|
||||||
|
{
|
||||||
|
"base": "172.17.0.0/24",
|
||||||
|
"size": 24
|
||||||
|
}
|
||||||
|
]
|
||||||
|
{%- if DOCKERMERGED.ulimits %},
|
||||||
|
"default-ulimits": {
|
||||||
|
{%- for ULIMIT in DOCKERMERGED.ulimits %}
|
||||||
|
"{{ ULIMIT.name }}": {
|
||||||
|
"Name": "{{ ULIMIT.name }}",
|
||||||
|
"Soft": {{ ULIMIT.soft }},
|
||||||
|
"Hard": {{ ULIMIT.hard }}
|
||||||
|
}{{ "," if not loop.last else "" }}
|
||||||
|
{%- endfor %}
|
||||||
|
}
|
||||||
|
{%- endif %}
|
||||||
|
}
|
||||||
@@ -3,7 +3,7 @@
|
|||||||
# https://securityonion.net/license; you may not use this file except in compliance with the
|
# https://securityonion.net/license; you may not use this file except in compliance with the
|
||||||
# Elastic License 2.0.
|
# Elastic License 2.0.
|
||||||
|
|
||||||
{% from 'docker/docker.map.jinja' import DOCKER %}
|
{% from 'docker/docker.map.jinja' import DOCKERMERGED %}
|
||||||
{% from 'vars/globals.map.jinja' import GLOBALS %}
|
{% from 'vars/globals.map.jinja' import GLOBALS %}
|
||||||
|
|
||||||
# docker service requires the ca.crt
|
# docker service requires the ca.crt
|
||||||
@@ -15,39 +15,6 @@ dockergroup:
|
|||||||
- name: docker
|
- name: docker
|
||||||
- gid: 920
|
- gid: 920
|
||||||
|
|
||||||
{% if GLOBALS.os_family == 'Debian' %}
|
|
||||||
{% if grains.oscodename == 'bookworm' %}
|
|
||||||
dockerheldpackages:
|
|
||||||
pkg.installed:
|
|
||||||
- pkgs:
|
|
||||||
- containerd.io: 2.2.1-1~debian.12~bookworm
|
|
||||||
- docker-ce: 5:29.2.1-1~debian.12~bookworm
|
|
||||||
- docker-ce-cli: 5:29.2.1-1~debian.12~bookworm
|
|
||||||
- docker-ce-rootless-extras: 5:29.2.1-1~debian.12~bookworm
|
|
||||||
- hold: True
|
|
||||||
- update_holds: True
|
|
||||||
{% elif grains.oscodename == 'jammy' %}
|
|
||||||
dockerheldpackages:
|
|
||||||
pkg.installed:
|
|
||||||
- pkgs:
|
|
||||||
- containerd.io: 2.2.1-1~ubuntu.22.04~jammy
|
|
||||||
- docker-ce: 5:29.2.1-1~ubuntu.22.04~jammy
|
|
||||||
- docker-ce-cli: 5:29.2.1-1~ubuntu.22.04~jammy
|
|
||||||
- docker-ce-rootless-extras: 5:29.2.1-1~ubuntu.22.04~jammy
|
|
||||||
- hold: True
|
|
||||||
- update_holds: True
|
|
||||||
{% else %}
|
|
||||||
dockerheldpackages:
|
|
||||||
pkg.installed:
|
|
||||||
- pkgs:
|
|
||||||
- containerd.io: 1.7.21-1
|
|
||||||
- docker-ce: 5:27.2.0-1~ubuntu.20.04~focal
|
|
||||||
- docker-ce-cli: 5:27.2.0-1~ubuntu.20.04~focal
|
|
||||||
- docker-ce-rootless-extras: 5:27.2.0-1~ubuntu.20.04~focal
|
|
||||||
- hold: True
|
|
||||||
- update_holds: True
|
|
||||||
{% endif %}
|
|
||||||
{% else %}
|
|
||||||
dockerheldpackages:
|
dockerheldpackages:
|
||||||
pkg.installed:
|
pkg.installed:
|
||||||
- pkgs:
|
- pkgs:
|
||||||
@@ -57,7 +24,6 @@ dockerheldpackages:
|
|||||||
- docker-ce-rootless-extras: 29.2.1-1.el9
|
- docker-ce-rootless-extras: 29.2.1-1.el9
|
||||||
- hold: True
|
- hold: True
|
||||||
- update_holds: True
|
- update_holds: True
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
#disable docker from managing iptables
|
#disable docker from managing iptables
|
||||||
iptables_disabled:
|
iptables_disabled:
|
||||||
@@ -75,10 +41,9 @@ dockeretc:
|
|||||||
file.directory:
|
file.directory:
|
||||||
- name: /etc/docker
|
- name: /etc/docker
|
||||||
|
|
||||||
# Manager daemon.json
|
|
||||||
docker_daemon:
|
docker_daemon:
|
||||||
file.managed:
|
file.managed:
|
||||||
- source: salt://common/files/daemon.json
|
- source: salt://docker/files/daemon.json.jinja
|
||||||
- name: /etc/docker/daemon.json
|
- name: /etc/docker/daemon.json
|
||||||
- template: jinja
|
- template: jinja
|
||||||
|
|
||||||
@@ -109,8 +74,8 @@ dockerreserveports:
|
|||||||
sos_docker_net:
|
sos_docker_net:
|
||||||
docker_network.present:
|
docker_network.present:
|
||||||
- name: sobridge
|
- name: sobridge
|
||||||
- subnet: {{ DOCKER.range }}
|
- subnet: {{ DOCKERMERGED.range }}
|
||||||
- gateway: {{ DOCKER.gateway }}
|
- gateway: {{ DOCKERMERGED.gateway }}
|
||||||
- options:
|
- options:
|
||||||
com.docker.network.bridge.name: 'sobridge'
|
com.docker.network.bridge.name: 'sobridge'
|
||||||
com.docker.network.driver.mtu: '1500'
|
com.docker.network.driver.mtu: '1500'
|
||||||
|
|||||||
@@ -7,6 +7,25 @@ docker:
|
|||||||
description: Default docker IP range for containers.
|
description: Default docker IP range for containers.
|
||||||
helpLink: docker.html
|
helpLink: docker.html
|
||||||
advanced: True
|
advanced: True
|
||||||
|
ulimits:
|
||||||
|
description: |
|
||||||
|
Default ulimit settings applied to all containers via the Docker daemon. Each entry specifies a resource name (e.g. nofile, memlock, core, nproc) with soft and hard limits. Individual container ulimits override these defaults. Valid resource names include: cpu, fsize, data, stack, core, rss, nproc, nofile, memlock, as, locks, sigpending, msgqueue, nice, rtprio, rttime.
|
||||||
|
forcedType: "[]{}"
|
||||||
|
syntax: json
|
||||||
|
advanced: True
|
||||||
|
helpLink: docker.html
|
||||||
|
uiElements:
|
||||||
|
- field: name
|
||||||
|
label: Resource Name
|
||||||
|
required: True
|
||||||
|
regex: ^(cpu|fsize|data|stack|core|rss|nproc|nofile|memlock|as|locks|sigpending|msgqueue|nice|rtprio|rttime)$
|
||||||
|
regexFailureMessage: You must enter a valid ulimit name (cpu, fsize, data, stack, core, rss, nproc, nofile, memlock, as, locks, sigpending, msgqueue, nice, rtprio, rttime).
|
||||||
|
- field: soft
|
||||||
|
label: Soft Limit
|
||||||
|
forcedType: int
|
||||||
|
- field: hard
|
||||||
|
label: Hard Limit
|
||||||
|
forcedType: int
|
||||||
containers:
|
containers:
|
||||||
so-dockerregistry: &dockerOptions
|
so-dockerregistry: &dockerOptions
|
||||||
final_octet:
|
final_octet:
|
||||||
@@ -39,6 +58,25 @@ docker:
|
|||||||
helpLink: docker.html
|
helpLink: docker.html
|
||||||
multiline: True
|
multiline: True
|
||||||
forcedType: "[]string"
|
forcedType: "[]string"
|
||||||
|
ulimits:
|
||||||
|
description: |
|
||||||
|
Ulimit settings for the container. Each entry specifies a resource name (e.g. nofile, memlock, core, nproc) with optional soft and hard limits. Valid resource names include: cpu, fsize, data, stack, core, rss, nproc, nofile, memlock, as, locks, sigpending, msgqueue, nice, rtprio, rttime.
|
||||||
|
advanced: True
|
||||||
|
helpLink: docker.html
|
||||||
|
forcedType: "[]{}"
|
||||||
|
syntax: json
|
||||||
|
uiElements:
|
||||||
|
- field: name
|
||||||
|
label: Resource Name
|
||||||
|
required: True
|
||||||
|
regex: ^(cpu|fsize|data|stack|core|rss|nproc|nofile|memlock|as|locks|sigpending|msgqueue|nice|rtprio|rttime)$
|
||||||
|
regexFailureMessage: You must enter a valid ulimit name (cpu, fsize, data, stack, core, rss, nproc, nofile, memlock, as, locks, sigpending, msgqueue, nice, rtprio, rttime).
|
||||||
|
- field: soft
|
||||||
|
label: Soft Limit
|
||||||
|
forcedType: int
|
||||||
|
- field: hard
|
||||||
|
label: Hard Limit
|
||||||
|
forcedType: int
|
||||||
so-elastic-fleet: *dockerOptions
|
so-elastic-fleet: *dockerOptions
|
||||||
so-elasticsearch: *dockerOptions
|
so-elasticsearch: *dockerOptions
|
||||||
so-influxdb: *dockerOptions
|
so-influxdb: *dockerOptions
|
||||||
@@ -62,42 +100,6 @@ docker:
|
|||||||
so-idh: *dockerOptions
|
so-idh: *dockerOptions
|
||||||
so-elastic-agent: *dockerOptions
|
so-elastic-agent: *dockerOptions
|
||||||
so-telegraf: *dockerOptions
|
so-telegraf: *dockerOptions
|
||||||
so-suricata:
|
so-suricata: *dockerOptions
|
||||||
final_octet:
|
|
||||||
description: Last octet of the container IP address.
|
|
||||||
helpLink: docker.html
|
|
||||||
readonly: True
|
|
||||||
advanced: True
|
|
||||||
global: True
|
|
||||||
port_bindings:
|
|
||||||
description: List of port bindings for the container.
|
|
||||||
helpLink: docker.html
|
|
||||||
advanced: True
|
|
||||||
multiline: True
|
|
||||||
forcedType: "[]string"
|
|
||||||
custom_bind_mounts:
|
|
||||||
description: List of custom local volume bindings.
|
|
||||||
advanced: True
|
|
||||||
helpLink: docker.html
|
|
||||||
multiline: True
|
|
||||||
forcedType: "[]string"
|
|
||||||
extra_hosts:
|
|
||||||
description: List of additional host entries for the container.
|
|
||||||
advanced: True
|
|
||||||
helpLink: docker.html
|
|
||||||
multiline: True
|
|
||||||
forcedType: "[]string"
|
|
||||||
extra_env:
|
|
||||||
description: List of additional ENV entries for the container.
|
|
||||||
advanced: True
|
|
||||||
helpLink: docker.html
|
|
||||||
multiline: True
|
|
||||||
forcedType: "[]string"
|
|
||||||
ulimits:
|
|
||||||
description: Ulimits for the container, in bytes.
|
|
||||||
advanced: True
|
|
||||||
helpLink: docker.html
|
|
||||||
multiline: True
|
|
||||||
forcedType: "[]string"
|
|
||||||
so-zeek: *dockerOptions
|
so-zeek: *dockerOptions
|
||||||
so-kafka: *dockerOptions
|
so-kafka: *dockerOptions
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
{% from 'allowed_states.map.jinja' import allowed_states %}
|
{% from 'allowed_states.map.jinja' import allowed_states %}
|
||||||
{% if sls.split('.')[0] in allowed_states %}
|
{% if sls.split('.')[0] in allowed_states %}
|
||||||
{% from 'vars/globals.map.jinja' import GLOBALS %}
|
{% from 'vars/globals.map.jinja' import GLOBALS %}
|
||||||
{% from 'docker/docker.map.jinja' import DOCKER %}
|
{% from 'docker/docker.map.jinja' import DOCKERMERGED %}
|
||||||
|
|
||||||
include:
|
include:
|
||||||
- elastalert.config
|
- elastalert.config
|
||||||
@@ -24,7 +24,7 @@ so-elastalert:
|
|||||||
- user: so-elastalert
|
- user: so-elastalert
|
||||||
- networks:
|
- networks:
|
||||||
- sobridge:
|
- sobridge:
|
||||||
- ipv4_address: {{ DOCKER.containers['so-elastalert'].ip }}
|
- ipv4_address: {{ DOCKERMERGED.containers['so-elastalert'].ip }}
|
||||||
- detach: True
|
- detach: True
|
||||||
- binds:
|
- binds:
|
||||||
- /opt/so/rules/elastalert:/opt/elastalert/rules/:ro
|
- /opt/so/rules/elastalert:/opt/elastalert/rules/:ro
|
||||||
@@ -33,24 +33,30 @@ so-elastalert:
|
|||||||
- /opt/so/conf/elastalert/predefined/:/opt/elastalert/predefined/:ro
|
- /opt/so/conf/elastalert/predefined/:/opt/elastalert/predefined/:ro
|
||||||
- /opt/so/conf/elastalert/custom/:/opt/elastalert/custom/:ro
|
- /opt/so/conf/elastalert/custom/:/opt/elastalert/custom/:ro
|
||||||
- /opt/so/conf/elastalert/elastalert_config.yaml:/opt/elastalert/config.yaml:ro
|
- /opt/so/conf/elastalert/elastalert_config.yaml:/opt/elastalert/config.yaml:ro
|
||||||
{% if DOCKER.containers['so-elastalert'].custom_bind_mounts %}
|
{% if DOCKERMERGED.containers['so-elastalert'].custom_bind_mounts %}
|
||||||
{% for BIND in DOCKER.containers['so-elastalert'].custom_bind_mounts %}
|
{% for BIND in DOCKERMERGED.containers['so-elastalert'].custom_bind_mounts %}
|
||||||
- {{ BIND }}
|
- {{ BIND }}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
- extra_hosts:
|
- extra_hosts:
|
||||||
- {{ GLOBALS.manager }}:{{ GLOBALS.manager_ip }}
|
- {{ GLOBALS.manager }}:{{ GLOBALS.manager_ip }}
|
||||||
{% if DOCKER.containers['so-elastalert'].extra_hosts %}
|
{% if DOCKERMERGED.containers['so-elastalert'].extra_hosts %}
|
||||||
{% for XTRAHOST in DOCKER.containers['so-elastalert'].extra_hosts %}
|
{% for XTRAHOST in DOCKERMERGED.containers['so-elastalert'].extra_hosts %}
|
||||||
- {{ XTRAHOST }}
|
- {{ XTRAHOST }}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if DOCKER.containers['so-elastalert'].extra_env %}
|
{% if DOCKERMERGED.containers['so-elastalert'].extra_env %}
|
||||||
- environment:
|
- environment:
|
||||||
{% for XTRAENV in DOCKER.containers['so-elastalert'].extra_env %}
|
{% for XTRAENV in DOCKERMERGED.containers['so-elastalert'].extra_env %}
|
||||||
- {{ XTRAENV }}
|
- {{ XTRAENV }}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
{% if DOCKERMERGED.containers['so-elastalert'].ulimits %}
|
||||||
|
- ulimits:
|
||||||
|
{% for ULIMIT in DOCKERMERGED.containers['so-elastalert'].ulimits %}
|
||||||
|
- {{ ULIMIT.name }}={{ ULIMIT.soft }}:{{ ULIMIT.hard }}
|
||||||
|
{% endfor %}
|
||||||
|
{% endif %}
|
||||||
- require:
|
- require:
|
||||||
- cmd: wait_for_elasticsearch
|
- cmd: wait_for_elasticsearch
|
||||||
- file: elastarules
|
- file: elastarules
|
||||||
|
|||||||
@@ -1 +0,0 @@
|
|||||||
THIS IS A PLACEHOLDER FILE
|
|
||||||
@@ -6,7 +6,7 @@
|
|||||||
{% from 'allowed_states.map.jinja' import allowed_states %}
|
{% from 'allowed_states.map.jinja' import allowed_states %}
|
||||||
{% if sls.split('.')[0] in allowed_states %}
|
{% if sls.split('.')[0] in allowed_states %}
|
||||||
{% from 'vars/globals.map.jinja' import GLOBALS %}
|
{% from 'vars/globals.map.jinja' import GLOBALS %}
|
||||||
{% from 'docker/docker.map.jinja' import DOCKER %}
|
{% from 'docker/docker.map.jinja' import DOCKERMERGED %}
|
||||||
|
|
||||||
include:
|
include:
|
||||||
- elastic-fleet-package-registry.config
|
- elastic-fleet-package-registry.config
|
||||||
@@ -21,30 +21,36 @@ so-elastic-fleet-package-registry:
|
|||||||
- user: 948
|
- user: 948
|
||||||
- networks:
|
- networks:
|
||||||
- sobridge:
|
- sobridge:
|
||||||
- ipv4_address: {{ DOCKER.containers['so-elastic-fleet-package-registry'].ip }}
|
- ipv4_address: {{ DOCKERMERGED.containers['so-elastic-fleet-package-registry'].ip }}
|
||||||
- extra_hosts:
|
- extra_hosts:
|
||||||
- {{ GLOBALS.hostname }}:{{ GLOBALS.node_ip }}
|
- {{ GLOBALS.hostname }}:{{ GLOBALS.node_ip }}
|
||||||
{% if DOCKER.containers['so-elastic-fleet-package-registry'].extra_hosts %}
|
{% if DOCKERMERGED.containers['so-elastic-fleet-package-registry'].extra_hosts %}
|
||||||
{% for XTRAHOST in DOCKER.containers['so-elastic-fleet-package-registry'].extra_hosts %}
|
{% for XTRAHOST in DOCKERMERGED.containers['so-elastic-fleet-package-registry'].extra_hosts %}
|
||||||
- {{ XTRAHOST }}
|
- {{ XTRAHOST }}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
- port_bindings:
|
- port_bindings:
|
||||||
{% for BINDING in DOCKER.containers['so-elastic-fleet-package-registry'].port_bindings %}
|
{% for BINDING in DOCKERMERGED.containers['so-elastic-fleet-package-registry'].port_bindings %}
|
||||||
- {{ BINDING }}
|
- {{ BINDING }}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% if DOCKER.containers['so-elastic-fleet-package-registry'].custom_bind_mounts %}
|
{% if DOCKERMERGED.containers['so-elastic-fleet-package-registry'].custom_bind_mounts %}
|
||||||
- binds:
|
- binds:
|
||||||
{% for BIND in DOCKER.containers['so-elastic-fleet-package-registry'].custom_bind_mounts %}
|
{% for BIND in DOCKERMERGED.containers['so-elastic-fleet-package-registry'].custom_bind_mounts %}
|
||||||
- {{ BIND }}
|
- {{ BIND }}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if DOCKER.containers['so-elastic-fleet-package-registry'].extra_env %}
|
{% if DOCKERMERGED.containers['so-elastic-fleet-package-registry'].extra_env %}
|
||||||
- environment:
|
- environment:
|
||||||
{% for XTRAENV in DOCKER.containers['so-elastic-fleet-package-registry'].extra_env %}
|
{% for XTRAENV in DOCKERMERGED.containers['so-elastic-fleet-package-registry'].extra_env %}
|
||||||
- {{ XTRAENV }}
|
- {{ XTRAENV }}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
{% if DOCKERMERGED.containers['so-elastic-fleet-package-registry'].ulimits %}
|
||||||
|
- ulimits:
|
||||||
|
{% for ULIMIT in DOCKERMERGED.containers['so-elastic-fleet-package-registry'].ulimits %}
|
||||||
|
- {{ ULIMIT.name }}={{ ULIMIT.soft }}:{{ ULIMIT.hard }}
|
||||||
|
{% endfor %}
|
||||||
|
{% endif %}
|
||||||
delete_so-elastic-fleet-package-registry_so-status.disabled:
|
delete_so-elastic-fleet-package-registry_so-status.disabled:
|
||||||
file.uncomment:
|
file.uncomment:
|
||||||
- name: /opt/so/conf/so-status/so-status.conf
|
- name: /opt/so/conf/so-status/so-status.conf
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
{% from 'allowed_states.map.jinja' import allowed_states %}
|
{% from 'allowed_states.map.jinja' import allowed_states %}
|
||||||
{% if sls.split('.')[0] in allowed_states %}
|
{% if sls.split('.')[0] in allowed_states %}
|
||||||
{% from 'vars/globals.map.jinja' import GLOBALS %}
|
{% from 'vars/globals.map.jinja' import GLOBALS %}
|
||||||
{% from 'docker/docker.map.jinja' import DOCKER %}
|
{% from 'docker/docker.map.jinja' import DOCKERMERGED %}
|
||||||
|
|
||||||
include:
|
include:
|
||||||
- ca
|
- ca
|
||||||
@@ -22,17 +22,17 @@ so-elastic-agent:
|
|||||||
- user: 949
|
- user: 949
|
||||||
- networks:
|
- networks:
|
||||||
- sobridge:
|
- sobridge:
|
||||||
- ipv4_address: {{ DOCKER.containers['so-elastic-agent'].ip }}
|
- ipv4_address: {{ DOCKERMERGED.containers['so-elastic-agent'].ip }}
|
||||||
- extra_hosts:
|
- extra_hosts:
|
||||||
- {{ GLOBALS.manager }}:{{ GLOBALS.manager_ip }}
|
- {{ GLOBALS.manager }}:{{ GLOBALS.manager_ip }}
|
||||||
- {{ GLOBALS.hostname }}:{{ GLOBALS.node_ip }}
|
- {{ GLOBALS.hostname }}:{{ GLOBALS.node_ip }}
|
||||||
{% if DOCKER.containers['so-elastic-agent'].extra_hosts %}
|
{% if DOCKERMERGED.containers['so-elastic-agent'].extra_hosts %}
|
||||||
{% for XTRAHOST in DOCKER.containers['so-elastic-agent'].extra_hosts %}
|
{% for XTRAHOST in DOCKERMERGED.containers['so-elastic-agent'].extra_hosts %}
|
||||||
- {{ XTRAHOST }}
|
- {{ XTRAHOST }}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
- port_bindings:
|
- port_bindings:
|
||||||
{% for BINDING in DOCKER.containers['so-elastic-agent'].port_bindings %}
|
{% for BINDING in DOCKERMERGED.containers['so-elastic-agent'].port_bindings %}
|
||||||
- {{ BINDING }}
|
- {{ BINDING }}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
- binds:
|
- binds:
|
||||||
@@ -41,19 +41,25 @@ so-elastic-agent:
|
|||||||
- /etc/pki/tls/certs/intca.crt:/etc/pki/tls/certs/intca.crt:ro
|
- /etc/pki/tls/certs/intca.crt:/etc/pki/tls/certs/intca.crt:ro
|
||||||
- /nsm:/nsm:ro
|
- /nsm:/nsm:ro
|
||||||
- /opt/so/log:/opt/so/log:ro
|
- /opt/so/log:/opt/so/log:ro
|
||||||
{% if DOCKER.containers['so-elastic-agent'].custom_bind_mounts %}
|
{% if DOCKERMERGED.containers['so-elastic-agent'].custom_bind_mounts %}
|
||||||
{% for BIND in DOCKER.containers['so-elastic-agent'].custom_bind_mounts %}
|
{% for BIND in DOCKERMERGED.containers['so-elastic-agent'].custom_bind_mounts %}
|
||||||
- {{ BIND }}
|
- {{ BIND }}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
- environment:
|
- environment:
|
||||||
- FLEET_CA=/etc/pki/tls/certs/intca.crt
|
- FLEET_CA=/etc/pki/tls/certs/intca.crt
|
||||||
- LOGS_PATH=logs
|
- LOGS_PATH=logs
|
||||||
{% if DOCKER.containers['so-elastic-agent'].extra_env %}
|
{% if DOCKERMERGED.containers['so-elastic-agent'].extra_env %}
|
||||||
{% for XTRAENV in DOCKER.containers['so-elastic-agent'].extra_env %}
|
{% for XTRAENV in DOCKERMERGED.containers['so-elastic-agent'].extra_env %}
|
||||||
- {{ XTRAENV }}
|
- {{ XTRAENV }}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
{% if DOCKERMERGED.containers['so-elastic-agent'].ulimits %}
|
||||||
|
- ulimits:
|
||||||
|
{% for ULIMIT in DOCKERMERGED.containers['so-elastic-agent'].ulimits %}
|
||||||
|
- {{ ULIMIT.name }}={{ ULIMIT.soft }}:{{ ULIMIT.hard }}
|
||||||
|
{% endfor %}
|
||||||
|
{% endif %}
|
||||||
- require:
|
- require:
|
||||||
- file: create-elastic-agent-config
|
- file: create-elastic-agent-config
|
||||||
- file: trusttheca
|
- file: trusttheca
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
{% from 'allowed_states.map.jinja' import allowed_states %}
|
{% from 'allowed_states.map.jinja' import allowed_states %}
|
||||||
{% if sls.split('.')[0] in allowed_states %}
|
{% if sls.split('.')[0] in allowed_states %}
|
||||||
{% from 'vars/globals.map.jinja' import GLOBALS %}
|
{% from 'vars/globals.map.jinja' import GLOBALS %}
|
||||||
{% from 'docker/docker.map.jinja' import DOCKER %}
|
{% from 'docker/docker.map.jinja' import DOCKERMERGED %}
|
||||||
{% from 'elasticfleet/map.jinja' import ELASTICFLEETMERGED %}
|
{% from 'elasticfleet/map.jinja' import ELASTICFLEETMERGED %}
|
||||||
|
|
||||||
{# This value is generated during node install and stored in minion pillar #}
|
{# This value is generated during node install and stored in minion pillar #}
|
||||||
@@ -94,17 +94,17 @@ so-elastic-fleet:
|
|||||||
- user: 947
|
- user: 947
|
||||||
- networks:
|
- networks:
|
||||||
- sobridge:
|
- sobridge:
|
||||||
- ipv4_address: {{ DOCKER.containers['so-elastic-fleet'].ip }}
|
- ipv4_address: {{ DOCKERMERGED.containers['so-elastic-fleet'].ip }}
|
||||||
- extra_hosts:
|
- extra_hosts:
|
||||||
- {{ GLOBALS.manager }}:{{ GLOBALS.manager_ip }}
|
- {{ GLOBALS.manager }}:{{ GLOBALS.manager_ip }}
|
||||||
- {{ GLOBALS.hostname }}:{{ GLOBALS.node_ip }}
|
- {{ GLOBALS.hostname }}:{{ GLOBALS.node_ip }}
|
||||||
{% if DOCKER.containers['so-elastic-fleet'].extra_hosts %}
|
{% if DOCKERMERGED.containers['so-elastic-fleet'].extra_hosts %}
|
||||||
{% for XTRAHOST in DOCKER.containers['so-elastic-fleet'].extra_hosts %}
|
{% for XTRAHOST in DOCKERMERGED.containers['so-elastic-fleet'].extra_hosts %}
|
||||||
- {{ XTRAHOST }}
|
- {{ XTRAHOST }}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
- port_bindings:
|
- port_bindings:
|
||||||
{% for BINDING in DOCKER.containers['so-elastic-fleet'].port_bindings %}
|
{% for BINDING in DOCKERMERGED.containers['so-elastic-fleet'].port_bindings %}
|
||||||
- {{ BINDING }}
|
- {{ BINDING }}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
- binds:
|
- binds:
|
||||||
@@ -112,8 +112,8 @@ so-elastic-fleet:
|
|||||||
- /etc/pki/elasticfleet-server.key:/etc/pki/elasticfleet-server.key:ro
|
- /etc/pki/elasticfleet-server.key:/etc/pki/elasticfleet-server.key:ro
|
||||||
- /etc/pki/tls/certs/intca.crt:/etc/pki/tls/certs/intca.crt:ro
|
- /etc/pki/tls/certs/intca.crt:/etc/pki/tls/certs/intca.crt:ro
|
||||||
- /opt/so/log/elasticfleet:/usr/share/elastic-agent/logs
|
- /opt/so/log/elasticfleet:/usr/share/elastic-agent/logs
|
||||||
{% if DOCKER.containers['so-elastic-fleet'].custom_bind_mounts %}
|
{% if DOCKERMERGED.containers['so-elastic-fleet'].custom_bind_mounts %}
|
||||||
{% for BIND in DOCKER.containers['so-elastic-fleet'].custom_bind_mounts %}
|
{% for BIND in DOCKERMERGED.containers['so-elastic-fleet'].custom_bind_mounts %}
|
||||||
- {{ BIND }}
|
- {{ BIND }}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
@@ -128,11 +128,17 @@ so-elastic-fleet:
|
|||||||
- FLEET_CA=/etc/pki/tls/certs/intca.crt
|
- FLEET_CA=/etc/pki/tls/certs/intca.crt
|
||||||
- FLEET_SERVER_ELASTICSEARCH_CA=/etc/pki/tls/certs/intca.crt
|
- FLEET_SERVER_ELASTICSEARCH_CA=/etc/pki/tls/certs/intca.crt
|
||||||
- LOGS_PATH=logs
|
- LOGS_PATH=logs
|
||||||
{% if DOCKER.containers['so-elastic-fleet'].extra_env %}
|
{% if DOCKERMERGED.containers['so-elastic-fleet'].extra_env %}
|
||||||
{% for XTRAENV in DOCKER.containers['so-elastic-fleet'].extra_env %}
|
{% for XTRAENV in DOCKERMERGED.containers['so-elastic-fleet'].extra_env %}
|
||||||
- {{ XTRAENV }}
|
- {{ XTRAENV }}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
{% if DOCKERMERGED.containers['so-elastic-fleet'].ulimits %}
|
||||||
|
- ulimits:
|
||||||
|
{% for ULIMIT in DOCKERMERGED.containers['so-elastic-fleet'].ulimits %}
|
||||||
|
- {{ ULIMIT.name }}={{ ULIMIT.soft }}:{{ ULIMIT.hard }}
|
||||||
|
{% endfor %}
|
||||||
|
{% endif %}
|
||||||
- watch:
|
- watch:
|
||||||
- file: trusttheca
|
- file: trusttheca
|
||||||
- x509: etc_elasticfleet_key
|
- x509: etc_elasticfleet_key
|
||||||
|
|||||||
@@ -6,8 +6,6 @@
|
|||||||
{% from 'vars/globals.map.jinja' import GLOBALS %}
|
{% from 'vars/globals.map.jinja' import GLOBALS %}
|
||||||
{% import_yaml 'elasticsearch/defaults.yaml' as ELASTICSEARCHDEFAULTS with context %}
|
{% import_yaml 'elasticsearch/defaults.yaml' as ELASTICSEARCHDEFAULTS with context %}
|
||||||
|
|
||||||
{% set HIGHLANDER = salt['pillar.get']('global:highlander', False) %}
|
|
||||||
|
|
||||||
{# this is a list of dicts containing hostname:ip for elasticsearch nodes that need to know about each other for cluster #}
|
{# this is a list of dicts containing hostname:ip for elasticsearch nodes that need to know about each other for cluster #}
|
||||||
{% set ELASTICSEARCH_SEED_HOSTS = [] %}
|
{% set ELASTICSEARCH_SEED_HOSTS = [] %}
|
||||||
{% set node_data = salt['pillar.get']('elasticsearch:nodes', {GLOBALS.role.split('-')[1]: {GLOBALS.hostname: {'ip': GLOBALS.node_ip}}}) %}
|
{% set node_data = salt['pillar.get']('elasticsearch:nodes', {GLOBALS.role.split('-')[1]: {GLOBALS.hostname: {'ip': GLOBALS.node_ip}}}) %}
|
||||||
@@ -36,14 +34,8 @@
|
|||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% elif grains.id.split('_') | last == 'searchnode' %}
|
{% elif grains.id.split('_') | last == 'searchnode' %}
|
||||||
{% if HIGHLANDER %}
|
|
||||||
{% do ELASTICSEARCHDEFAULTS.elasticsearch.config.node.roles.extend(['ml', 'master', 'transform']) %}
|
|
||||||
{% endif %}
|
|
||||||
{% do ELASTICSEARCHDEFAULTS.elasticsearch.config.update({'discovery': {'seed_hosts': [GLOBALS.manager]}}) %}
|
{% do ELASTICSEARCHDEFAULTS.elasticsearch.config.update({'discovery': {'seed_hosts': [GLOBALS.manager]}}) %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if HIGHLANDER %}
|
|
||||||
{% do ELASTICSEARCHDEFAULTS.elasticsearch.config.xpack.ml.update({'enabled': true}) %}
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
{% do ELASTICSEARCHDEFAULTS.elasticsearch.config.node.update({'name': GLOBALS.hostname}) %}
|
{% do ELASTICSEARCHDEFAULTS.elasticsearch.config.node.update({'name': GLOBALS.hostname}) %}
|
||||||
{% do ELASTICSEARCHDEFAULTS.elasticsearch.config.cluster.update({'name': GLOBALS.hostname}) %}
|
{% do ELASTICSEARCHDEFAULTS.elasticsearch.config.cluster.update({'name': GLOBALS.hostname}) %}
|
||||||
|
|||||||
@@ -98,10 +98,6 @@ esrolesdir:
|
|||||||
- group: 939
|
- group: 939
|
||||||
- makedirs: True
|
- makedirs: True
|
||||||
|
|
||||||
eslibdir:
|
|
||||||
file.absent:
|
|
||||||
- name: /opt/so/conf/elasticsearch/lib
|
|
||||||
|
|
||||||
esingestdynamicconf:
|
esingestdynamicconf:
|
||||||
file.recurse:
|
file.recurse:
|
||||||
- name: /opt/so/conf/elasticsearch/ingest
|
- name: /opt/so/conf/elasticsearch/ingest
|
||||||
@@ -119,11 +115,6 @@ esingestconf:
|
|||||||
- group: 939
|
- group: 939
|
||||||
- show_changes: False
|
- show_changes: False
|
||||||
|
|
||||||
# Remove .fleet_final_pipeline-1 because we are using global@custom now
|
|
||||||
so-fleet-final-pipeline-remove:
|
|
||||||
file.absent:
|
|
||||||
- name: /opt/so/conf/elasticsearch/ingest/.fleet_final_pipeline-1
|
|
||||||
|
|
||||||
# Auto-generate Elasticsearch ingest node pipelines from pillar
|
# Auto-generate Elasticsearch ingest node pipelines from pillar
|
||||||
{% for pipeline, config in ELASTICSEARCHMERGED.pipelines.items() %}
|
{% for pipeline, config in ELASTICSEARCHMERGED.pipelines.items() %}
|
||||||
es_ingest_conf_{{pipeline}}:
|
es_ingest_conf_{{pipeline}}:
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
{% from 'allowed_states.map.jinja' import allowed_states %}
|
{% from 'allowed_states.map.jinja' import allowed_states %}
|
||||||
{% if sls.split('.')[0] in allowed_states %}
|
{% if sls.split('.')[0] in allowed_states %}
|
||||||
{% from 'vars/globals.map.jinja' import GLOBALS %}
|
{% from 'vars/globals.map.jinja' import GLOBALS %}
|
||||||
{% from 'docker/docker.map.jinja' import DOCKER %}
|
{% from 'docker/docker.map.jinja' import DOCKERMERGED %}
|
||||||
{% from 'elasticsearch/config.map.jinja' import ELASTICSEARCH_NODES %}
|
{% from 'elasticsearch/config.map.jinja' import ELASTICSEARCH_NODES %}
|
||||||
{% from 'elasticsearch/config.map.jinja' import ELASTICSEARCH_SEED_HOSTS %}
|
{% from 'elasticsearch/config.map.jinja' import ELASTICSEARCH_SEED_HOSTS %}
|
||||||
{% from 'elasticsearch/config.map.jinja' import ELASTICSEARCHMERGED %}
|
{% from 'elasticsearch/config.map.jinja' import ELASTICSEARCHMERGED %}
|
||||||
@@ -28,15 +28,15 @@ so-elasticsearch:
|
|||||||
- user: elasticsearch
|
- user: elasticsearch
|
||||||
- networks:
|
- networks:
|
||||||
- sobridge:
|
- sobridge:
|
||||||
- ipv4_address: {{ DOCKER.containers['so-elasticsearch'].ip }}
|
- ipv4_address: {{ DOCKERMERGED.containers['so-elasticsearch'].ip }}
|
||||||
- extra_hosts:
|
- extra_hosts:
|
||||||
{% for node in ELASTICSEARCH_NODES %}
|
{% for node in ELASTICSEARCH_NODES %}
|
||||||
{% for hostname, ip in node.items() %}
|
{% for hostname, ip in node.items() %}
|
||||||
- {{hostname}}:{{ip}}
|
- {{hostname}}:{{ip}}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% if DOCKER.containers['so-elasticsearch'].extra_hosts %}
|
{% if DOCKERMERGED.containers['so-elasticsearch'].extra_hosts %}
|
||||||
{% for XTRAHOST in DOCKER.containers['so-elasticsearch'].extra_hosts %}
|
{% for XTRAHOST in DOCKERMERGED.containers['so-elasticsearch'].extra_hosts %}
|
||||||
- {{ XTRAHOST }}
|
- {{ XTRAHOST }}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
@@ -45,17 +45,19 @@ so-elasticsearch:
|
|||||||
- discovery.type=single-node
|
- discovery.type=single-node
|
||||||
{% endif %}
|
{% endif %}
|
||||||
- ES_JAVA_OPTS=-Xms{{ GLOBALS.elasticsearch.es_heap }} -Xmx{{ GLOBALS.elasticsearch.es_heap }} -Des.transport.cname_in_publish_address=true -Dlog4j2.formatMsgNoLookups=true
|
- ES_JAVA_OPTS=-Xms{{ GLOBALS.elasticsearch.es_heap }} -Xmx{{ GLOBALS.elasticsearch.es_heap }} -Des.transport.cname_in_publish_address=true -Dlog4j2.formatMsgNoLookups=true
|
||||||
ulimits:
|
{% if DOCKERMERGED.containers['so-elasticsearch'].extra_env %}
|
||||||
- memlock=-1:-1
|
{% for XTRAENV in DOCKERMERGED.containers['so-elasticsearch'].extra_env %}
|
||||||
- nofile=65536:65536
|
|
||||||
- nproc=4096
|
|
||||||
{% if DOCKER.containers['so-elasticsearch'].extra_env %}
|
|
||||||
{% for XTRAENV in DOCKER.containers['so-elasticsearch'].extra_env %}
|
|
||||||
- {{ XTRAENV }}
|
- {{ XTRAENV }}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
{% if DOCKERMERGED.containers['so-elasticsearch'].ulimits %}
|
||||||
|
- ulimits:
|
||||||
|
{% for ULIMIT in DOCKERMERGED.containers['so-elasticsearch'].ulimits %}
|
||||||
|
- {{ ULIMIT.name }}={{ ULIMIT.soft }}:{{ ULIMIT.hard }}
|
||||||
|
{% endfor %}
|
||||||
|
{% endif %}
|
||||||
- port_bindings:
|
- port_bindings:
|
||||||
{% for BINDING in DOCKER.containers['so-elasticsearch'].port_bindings %}
|
{% for BINDING in DOCKERMERGED.containers['so-elasticsearch'].port_bindings %}
|
||||||
- {{ BINDING }}
|
- {{ BINDING }}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
- binds:
|
- binds:
|
||||||
@@ -75,8 +77,8 @@ so-elasticsearch:
|
|||||||
- {{ repo }}:{{ repo }}:rw
|
- {{ repo }}:{{ repo }}:rw
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if DOCKER.containers['so-elasticsearch'].custom_bind_mounts %}
|
{% if DOCKERMERGED.containers['so-elasticsearch'].custom_bind_mounts %}
|
||||||
{% for BIND in DOCKER.containers['so-elasticsearch'].custom_bind_mounts %}
|
{% for BIND in DOCKERMERGED.containers['so-elasticsearch'].custom_bind_mounts %}
|
||||||
- {{ BIND }}
|
- {{ BIND }}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|||||||
0
salt/elasticsearch/files/ingest-dynamic/.gitkeep
Normal file
0
salt/elasticsearch/files/ingest-dynamic/.gitkeep
Normal file
@@ -1,5 +1,3 @@
|
|||||||
{%- set HIGHLANDER = salt['pillar.get']('global:highlander', False) -%}
|
|
||||||
{%- raw -%}
|
|
||||||
{
|
{
|
||||||
"description" : "common",
|
"description" : "common",
|
||||||
"processors" : [
|
"processors" : [
|
||||||
@@ -67,19 +65,7 @@
|
|||||||
{ "append": { "if": "ctx.dataset_tag_temp != null", "field": "tags", "value": "{{dataset_tag_temp.1}}" } },
|
{ "append": { "if": "ctx.dataset_tag_temp != null", "field": "tags", "value": "{{dataset_tag_temp.1}}" } },
|
||||||
{ "grok": { "if": "ctx.http?.response?.status_code != null", "field": "http.response.status_code", "patterns": ["%{NUMBER:http.response.status_code:long} %{GREEDYDATA}"]} },
|
{ "grok": { "if": "ctx.http?.response?.status_code != null", "field": "http.response.status_code", "patterns": ["%{NUMBER:http.response.status_code:long} %{GREEDYDATA}"]} },
|
||||||
{ "set": { "if": "ctx?.metadata?.kafka != null" , "field": "kafka.id", "value": "{{metadata.kafka.partition}}{{metadata.kafka.offset}}{{metadata.kafka.timestamp}}", "ignore_failure": true } },
|
{ "set": { "if": "ctx?.metadata?.kafka != null" , "field": "kafka.id", "value": "{{metadata.kafka.partition}}{{metadata.kafka.offset}}{{metadata.kafka.timestamp}}", "ignore_failure": true } },
|
||||||
{ "remove": { "field": [ "message2", "type", "fields", "category", "module", "dataset", "dataset_tag_temp", "event.dataset_temp" ], "ignore_missing": true, "ignore_failure": true } }
|
{ "remove": { "field": [ "message2", "type", "fields", "category", "module", "dataset", "dataset_tag_temp", "event.dataset_temp" ], "ignore_missing": true, "ignore_failure": true } },
|
||||||
{%- endraw %}
|
|
||||||
{%- if HIGHLANDER %}
|
|
||||||
,
|
|
||||||
{
|
|
||||||
"pipeline": {
|
|
||||||
"name": "ecs"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
{%- endif %}
|
|
||||||
{%- raw %}
|
|
||||||
,
|
|
||||||
{ "pipeline": { "name": "global@custom", "ignore_missing_pipeline": true, "description": "[Fleet] Global pipeline for all data streams" } }
|
{ "pipeline": { "name": "global@custom", "ignore_missing_pipeline": true, "description": "[Fleet] Global pipeline for all data streams" } }
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
{% endraw %}
|
|
||||||
@@ -27,14 +27,12 @@ iptables_config:
|
|||||||
- source: salt://firewall/iptables.jinja
|
- source: salt://firewall/iptables.jinja
|
||||||
- template: jinja
|
- template: jinja
|
||||||
|
|
||||||
{% if grains.os_family == 'RedHat' %}
|
|
||||||
disable_firewalld:
|
disable_firewalld:
|
||||||
service.dead:
|
service.dead:
|
||||||
- name: firewalld
|
- name: firewalld
|
||||||
- enable: False
|
- enable: False
|
||||||
- require:
|
- require:
|
||||||
- file: iptables_config
|
- file: iptables_config
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
iptables_restore:
|
iptables_restore:
|
||||||
cmd.run:
|
cmd.run:
|
||||||
@@ -44,7 +42,6 @@ iptables_restore:
|
|||||||
- onlyif:
|
- onlyif:
|
||||||
- iptables-restore --test {{ iptmap.configfile }}
|
- iptables-restore --test {{ iptmap.configfile }}
|
||||||
|
|
||||||
{% if grains.os_family == 'RedHat' %}
|
|
||||||
enable_firewalld:
|
enable_firewalld:
|
||||||
service.running:
|
service.running:
|
||||||
- name: firewalld
|
- name: firewalld
|
||||||
@@ -52,7 +49,6 @@ enable_firewalld:
|
|||||||
- onfail:
|
- onfail:
|
||||||
- file: iptables_config
|
- file: iptables_config
|
||||||
- cmd: iptables_restore
|
- cmd: iptables_restore
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
{% else %}
|
{% else %}
|
||||||
|
|
||||||
|
|||||||
@@ -1,14 +1,6 @@
|
|||||||
{% set iptmap = salt['grains.filter_by']({
|
{% set iptmap = {
|
||||||
'Debian': {
|
'service': 'iptables',
|
||||||
'service': 'netfilter-persistent',
|
'iptpkg': 'iptables-nft',
|
||||||
'iptpkg': 'iptables',
|
'persistpkg': 'iptables-nft-services',
|
||||||
'persistpkg': 'iptables-persistent',
|
'configfile': '/etc/sysconfig/iptables'
|
||||||
'configfile': '/etc/iptables/rules.v4'
|
} %}
|
||||||
},
|
|
||||||
'RedHat': {
|
|
||||||
'service': 'iptables',
|
|
||||||
'iptpkg': 'iptables-nft',
|
|
||||||
'persistpkg': 'iptables-nft-services',
|
|
||||||
'configfile': '/etc/sysconfig/iptables'
|
|
||||||
},
|
|
||||||
}) %}
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
{%- from 'vars/globals.map.jinja' import GLOBALS %}
|
{%- from 'vars/globals.map.jinja' import GLOBALS %}
|
||||||
{%- from 'docker/docker.map.jinja' import DOCKER %}
|
{%- from 'docker/docker.map.jinja' import DOCKERMERGED %}
|
||||||
{%- from 'firewall/map.jinja' import FIREWALL_MERGED %}
|
{%- from 'firewall/map.jinja' import FIREWALL_MERGED %}
|
||||||
{%- set role = GLOBALS.role.split('-')[1] %}
|
{%- set role = GLOBALS.role.split('-')[1] %}
|
||||||
{%- from 'firewall/containers.map.jinja' import NODE_CONTAINERS %}
|
{%- from 'firewall/containers.map.jinja' import NODE_CONTAINERS %}
|
||||||
@@ -8,9 +8,9 @@
|
|||||||
{%- set D1 = [] %}
|
{%- set D1 = [] %}
|
||||||
{%- set D2 = [] %}
|
{%- set D2 = [] %}
|
||||||
{%- for container in NODE_CONTAINERS %}
|
{%- for container in NODE_CONTAINERS %}
|
||||||
{%- set IP = DOCKER.containers[container].ip %}
|
{%- set IP = DOCKERMERGED.containers[container].ip %}
|
||||||
{%- if DOCKER.containers[container].port_bindings is defined %}
|
{%- if DOCKERMERGED.containers[container].port_bindings is defined %}
|
||||||
{%- for binding in DOCKER.containers[container].port_bindings %}
|
{%- for binding in DOCKERMERGED.containers[container].port_bindings %}
|
||||||
{#- cant split int so we convert to string #}
|
{#- cant split int so we convert to string #}
|
||||||
{%- set binding = binding|string %}
|
{%- set binding = binding|string %}
|
||||||
{#- split the port binding by /. if proto not specified, default is tcp #}
|
{#- split the port binding by /. if proto not specified, default is tcp #}
|
||||||
@@ -33,13 +33,13 @@
|
|||||||
{%- set hostPort = bsa[0] %}
|
{%- set hostPort = bsa[0] %}
|
||||||
{%- set containerPort = bsa[1] %}
|
{%- set containerPort = bsa[1] %}
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
{%- do PR.append("-A POSTROUTING -s " ~ DOCKER.containers[container].ip ~ "/32 -d " ~ DOCKER.containers[container].ip ~ "/32 -p " ~ proto ~ " -m " ~ proto ~ " --dport " ~ containerPort ~ " -j MASQUERADE") %}
|
{%- do PR.append("-A POSTROUTING -s " ~ DOCKERMERGED.containers[container].ip ~ "/32 -d " ~ DOCKERMERGED.containers[container].ip ~ "/32 -p " ~ proto ~ " -m " ~ proto ~ " --dport " ~ containerPort ~ " -j MASQUERADE") %}
|
||||||
{%- if bindip | length and bindip != '0.0.0.0' %}
|
{%- if bindip | length and bindip != '0.0.0.0' %}
|
||||||
{%- do D1.append("-A DOCKER -d " ~ bindip ~ "/32 ! -i sobridge -p " ~ proto ~ " -m " ~ proto ~ " --dport " ~ hostPort ~ " -j DNAT --to-destination " ~ DOCKER.containers[container].ip ~ ":" ~ containerPort) %}
|
{%- do D1.append("-A DOCKER -d " ~ bindip ~ "/32 ! -i sobridge -p " ~ proto ~ " -m " ~ proto ~ " --dport " ~ hostPort ~ " -j DNAT --to-destination " ~ DOCKERMERGED.containers[container].ip ~ ":" ~ containerPort) %}
|
||||||
{%- else %}
|
{%- else %}
|
||||||
{%- do D1.append("-A DOCKER ! -i sobridge -p " ~ proto ~ " -m " ~ proto ~ " --dport " ~ hostPort ~ " -j DNAT --to-destination " ~ DOCKER.containers[container].ip ~ ":" ~ containerPort) %}
|
{%- do D1.append("-A DOCKER ! -i sobridge -p " ~ proto ~ " -m " ~ proto ~ " --dport " ~ hostPort ~ " -j DNAT --to-destination " ~ DOCKERMERGED.containers[container].ip ~ ":" ~ containerPort) %}
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
{%- do D2.append("-A DOCKER -d " ~ DOCKER.containers[container].ip ~ "/32 ! -i sobridge -o sobridge -p " ~ proto ~ " -m " ~ proto ~ " --dport " ~ containerPort ~ " -j ACCEPT") %}
|
{%- do D2.append("-A DOCKER -d " ~ DOCKERMERGED.containers[container].ip ~ "/32 ! -i sobridge -o sobridge -p " ~ proto ~ " -m " ~ proto ~ " --dport " ~ containerPort ~ " -j ACCEPT") %}
|
||||||
{%- endfor %}
|
{%- endfor %}
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
{%- endfor %}
|
{%- endfor %}
|
||||||
@@ -52,7 +52,7 @@
|
|||||||
:DOCKER - [0:0]
|
:DOCKER - [0:0]
|
||||||
-A PREROUTING -m addrtype --dst-type LOCAL -j DOCKER
|
-A PREROUTING -m addrtype --dst-type LOCAL -j DOCKER
|
||||||
-A OUTPUT ! -d 127.0.0.0/8 -m addrtype --dst-type LOCAL -j DOCKER
|
-A OUTPUT ! -d 127.0.0.0/8 -m addrtype --dst-type LOCAL -j DOCKER
|
||||||
-A POSTROUTING -s {{DOCKER.range}} ! -o sobridge -j MASQUERADE
|
-A POSTROUTING -s {{DOCKERMERGED.range}} ! -o sobridge -j MASQUERADE
|
||||||
{%- for rule in PR %}
|
{%- for rule in PR %}
|
||||||
{{ rule }}
|
{{ rule }}
|
||||||
{%- endfor %}
|
{%- endfor %}
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
{% from 'vars/globals.map.jinja' import GLOBALS %}
|
{% from 'vars/globals.map.jinja' import GLOBALS %}
|
||||||
{% from 'docker/docker.map.jinja' import DOCKER %}
|
{% from 'docker/docker.map.jinja' import DOCKERMERGED %}
|
||||||
{% import_yaml 'firewall/defaults.yaml' as FIREWALL_DEFAULT %}
|
{% import_yaml 'firewall/defaults.yaml' as FIREWALL_DEFAULT %}
|
||||||
|
|
||||||
{# add our ip to self #}
|
{# add our ip to self #}
|
||||||
{% do FIREWALL_DEFAULT.firewall.hostgroups.self.append(GLOBALS.node_ip) %}
|
{% do FIREWALL_DEFAULT.firewall.hostgroups.self.append(GLOBALS.node_ip) %}
|
||||||
{# add dockernet range #}
|
{# add dockernet range #}
|
||||||
{% do FIREWALL_DEFAULT.firewall.hostgroups.dockernet.append(DOCKER.range) %}
|
{% do FIREWALL_DEFAULT.firewall.hostgroups.dockernet.append(DOCKERMERGED.range) %}
|
||||||
|
|
||||||
{% if GLOBALS.role == 'so-idh' %}
|
{% if GLOBALS.role == 'so-idh' %}
|
||||||
{% from 'idh/opencanary_config.map.jinja' import IDH_PORTGROUPS %}
|
{% from 'idh/opencanary_config.map.jinja' import IDH_PORTGROUPS %}
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
|
|
||||||
{% from 'allowed_states.map.jinja' import allowed_states %}
|
{% from 'allowed_states.map.jinja' import allowed_states %}
|
||||||
{% if sls.split('.')[0] in allowed_states %}
|
{% if sls.split('.')[0] in allowed_states %}
|
||||||
{% from 'docker/docker.map.jinja' import DOCKER %}
|
{% from 'docker/docker.map.jinja' import DOCKERMERGED %}
|
||||||
{% from 'vars/globals.map.jinja' import GLOBALS %}
|
{% from 'vars/globals.map.jinja' import GLOBALS %}
|
||||||
{% if 'api' in salt['pillar.get']('features', []) %}
|
{% if 'api' in salt['pillar.get']('features', []) %}
|
||||||
|
|
||||||
@@ -26,32 +26,38 @@ so-hydra:
|
|||||||
- name: so-hydra
|
- name: so-hydra
|
||||||
- networks:
|
- networks:
|
||||||
- sobridge:
|
- sobridge:
|
||||||
- ipv4_address: {{ DOCKER.containers['so-hydra'].ip }}
|
- ipv4_address: {{ DOCKERMERGED.containers['so-hydra'].ip }}
|
||||||
- binds:
|
- binds:
|
||||||
- /opt/so/conf/hydra/:/hydra-conf:ro
|
- /opt/so/conf/hydra/:/hydra-conf:ro
|
||||||
- /opt/so/log/hydra/:/hydra-log:rw
|
- /opt/so/log/hydra/:/hydra-log:rw
|
||||||
- /nsm/hydra/db:/hydra-data:rw
|
- /nsm/hydra/db:/hydra-data:rw
|
||||||
{% if DOCKER.containers['so-hydra'].custom_bind_mounts %}
|
{% if DOCKERMERGED.containers['so-hydra'].custom_bind_mounts %}
|
||||||
{% for BIND in DOCKER.containers['so-hydra'].custom_bind_mounts %}
|
{% for BIND in DOCKERMERGED.containers['so-hydra'].custom_bind_mounts %}
|
||||||
- {{ BIND }}
|
- {{ BIND }}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
- port_bindings:
|
- port_bindings:
|
||||||
{% for BINDING in DOCKER.containers['so-hydra'].port_bindings %}
|
{% for BINDING in DOCKERMERGED.containers['so-hydra'].port_bindings %}
|
||||||
- {{ BINDING }}
|
- {{ BINDING }}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% if DOCKER.containers['so-hydra'].extra_hosts %}
|
{% if DOCKERMERGED.containers['so-hydra'].extra_hosts %}
|
||||||
- extra_hosts:
|
- extra_hosts:
|
||||||
{% for XTRAHOST in DOCKER.containers['so-hydra'].extra_hosts %}
|
{% for XTRAHOST in DOCKERMERGED.containers['so-hydra'].extra_hosts %}
|
||||||
- {{ XTRAHOST }}
|
- {{ XTRAHOST }}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if DOCKER.containers['so-hydra'].extra_env %}
|
{% if DOCKERMERGED.containers['so-hydra'].extra_env %}
|
||||||
- environment:
|
- environment:
|
||||||
{% for XTRAENV in DOCKER.containers['so-hydra'].extra_env %}
|
{% for XTRAENV in DOCKERMERGED.containers['so-hydra'].extra_env %}
|
||||||
- {{ XTRAENV }}
|
- {{ XTRAENV }}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
{% if DOCKERMERGED.containers['so-hydra'].ulimits %}
|
||||||
|
- ulimits:
|
||||||
|
{% for ULIMIT in DOCKERMERGED.containers['so-hydra'].ulimits %}
|
||||||
|
- {{ ULIMIT.name }}={{ ULIMIT.soft }}:{{ ULIMIT.hard }}
|
||||||
|
{% endfor %}
|
||||||
|
{% endif %}
|
||||||
- restart_policy: unless-stopped
|
- restart_policy: unless-stopped
|
||||||
- watch:
|
- watch:
|
||||||
- file: hydraconfig
|
- file: hydraconfig
|
||||||
@@ -67,7 +73,7 @@ delete_so-hydra_so-status.disabled:
|
|||||||
|
|
||||||
wait_for_hydra:
|
wait_for_hydra:
|
||||||
http.wait_for_successful_query:
|
http.wait_for_successful_query:
|
||||||
- name: 'http://{{ GLOBALS.manager }}:4444/'
|
- name: 'http://{{ GLOBALS.manager }}:4444/health/alive'
|
||||||
- ssl: True
|
- ssl: True
|
||||||
- verify_ssl: False
|
- verify_ssl: False
|
||||||
- status:
|
- status:
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
{% from 'allowed_states.map.jinja' import allowed_states %}
|
{% from 'allowed_states.map.jinja' import allowed_states %}
|
||||||
{% if sls.split('.')[0] in allowed_states %}
|
{% if sls.split('.')[0] in allowed_states %}
|
||||||
{% from 'vars/globals.map.jinja' import GLOBALS %}
|
{% from 'vars/globals.map.jinja' import GLOBALS %}
|
||||||
{% from 'docker/docker.map.jinja' import DOCKER %}
|
{% from 'docker/docker.map.jinja' import DOCKERMERGED %}
|
||||||
|
|
||||||
include:
|
include:
|
||||||
- idh.config
|
- idh.config
|
||||||
@@ -22,23 +22,29 @@ so-idh:
|
|||||||
- /nsm/idh:/var/tmp:rw
|
- /nsm/idh:/var/tmp:rw
|
||||||
- /opt/so/conf/idh/http-skins:/usr/local/lib/python3.12/site-packages/opencanary/modules/data/http/skin:ro
|
- /opt/so/conf/idh/http-skins:/usr/local/lib/python3.12/site-packages/opencanary/modules/data/http/skin:ro
|
||||||
- /opt/so/conf/idh/opencanary.conf:/etc/opencanaryd/opencanary.conf:ro
|
- /opt/so/conf/idh/opencanary.conf:/etc/opencanaryd/opencanary.conf:ro
|
||||||
{% if DOCKER.containers['so-idh'].custom_bind_mounts %}
|
{% if DOCKERMERGED.containers['so-idh'].custom_bind_mounts %}
|
||||||
{% for BIND in DOCKER.containers['so-idh'].custom_bind_mounts %}
|
{% for BIND in DOCKERMERGED.containers['so-idh'].custom_bind_mounts %}
|
||||||
- {{ BIND }}
|
- {{ BIND }}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if DOCKER.containers['so-idh'].extra_hosts %}
|
{% if DOCKERMERGED.containers['so-idh'].extra_hosts %}
|
||||||
- extra_hosts:
|
- extra_hosts:
|
||||||
{% for XTRAHOST in DOCKER.containers['so-idh'].extra_hosts %}
|
{% for XTRAHOST in DOCKERMERGED.containers['so-idh'].extra_hosts %}
|
||||||
- {{ XTRAHOST }}
|
- {{ XTRAHOST }}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if DOCKER.containers['so-idh'].extra_env %}
|
{% if DOCKERMERGED.containers['so-idh'].extra_env %}
|
||||||
- environment:
|
- environment:
|
||||||
{% for XTRAENV in DOCKER.containers['so-idh'].extra_env %}
|
{% for XTRAENV in DOCKERMERGED.containers['so-idh'].extra_env %}
|
||||||
- {{ XTRAENV }}
|
- {{ XTRAENV }}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
{% if DOCKERMERGED.containers['so-idh'].ulimits %}
|
||||||
|
- ulimits:
|
||||||
|
{% for ULIMIT in DOCKERMERGED.containers['so-idh'].ulimits %}
|
||||||
|
- {{ ULIMIT.name }}={{ ULIMIT.soft }}:{{ ULIMIT.hard }}
|
||||||
|
{% endfor %}
|
||||||
|
{% endif %}
|
||||||
- watch:
|
- watch:
|
||||||
- file: opencanary_config
|
- file: opencanary_config
|
||||||
- require:
|
- require:
|
||||||
|
|||||||
@@ -3,7 +3,6 @@
|
|||||||
include:
|
include:
|
||||||
- idh.openssh
|
- idh.openssh
|
||||||
|
|
||||||
{% if grains.os_family == 'RedHat' %}
|
|
||||||
idh_sshd_selinux:
|
idh_sshd_selinux:
|
||||||
selinux.port_policy_present:
|
selinux.port_policy_present:
|
||||||
- port: {{ openssh_map.config.port }}
|
- port: {{ openssh_map.config.port }}
|
||||||
@@ -13,7 +12,6 @@ idh_sshd_selinux:
|
|||||||
- file: openssh_config
|
- file: openssh_config
|
||||||
- require:
|
- require:
|
||||||
- pkg: python_selinux_mgmt_tools
|
- pkg: python_selinux_mgmt_tools
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
openssh_config:
|
openssh_config:
|
||||||
file.replace:
|
file.replace:
|
||||||
|
|||||||
@@ -16,8 +16,6 @@ openssh:
|
|||||||
- name: {{ openssh_map.service }}
|
- name: {{ openssh_map.service }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% if grains.os_family == 'RedHat' %}
|
|
||||||
python_selinux_mgmt_tools:
|
python_selinux_mgmt_tools:
|
||||||
pkg.installed:
|
pkg.installed:
|
||||||
- name: policycoreutils-python-utils
|
- name: policycoreutils-python-utils
|
||||||
{% endif %}
|
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
{% from 'allowed_states.map.jinja' import allowed_states %}
|
{% from 'allowed_states.map.jinja' import allowed_states %}
|
||||||
{% if sls.split('.')[0] in allowed_states %}
|
{% if sls.split('.')[0] in allowed_states %}
|
||||||
{% from 'vars/globals.map.jinja' import GLOBALS %}
|
{% from 'vars/globals.map.jinja' import GLOBALS %}
|
||||||
{% from 'docker/docker.map.jinja' import DOCKER %}
|
{% from 'docker/docker.map.jinja' import DOCKERMERGED %}
|
||||||
{% set PASSWORD = salt['pillar.get']('secrets:influx_pass') %}
|
{% set PASSWORD = salt['pillar.get']('secrets:influx_pass') %}
|
||||||
{% set TOKEN = salt['pillar.get']('influxdb:token') %}
|
{% set TOKEN = salt['pillar.get']('influxdb:token') %}
|
||||||
|
|
||||||
@@ -21,7 +21,7 @@ so-influxdb:
|
|||||||
- hostname: influxdb
|
- hostname: influxdb
|
||||||
- networks:
|
- networks:
|
||||||
- sobridge:
|
- sobridge:
|
||||||
- ipv4_address: {{ DOCKER.containers['so-influxdb'].ip }}
|
- ipv4_address: {{ DOCKERMERGED.containers['so-influxdb'].ip }}
|
||||||
- environment:
|
- environment:
|
||||||
- INFLUXD_CONFIG_PATH=/conf/config.yaml
|
- INFLUXD_CONFIG_PATH=/conf/config.yaml
|
||||||
- INFLUXDB_HTTP_LOG_ENABLED=false
|
- INFLUXDB_HTTP_LOG_ENABLED=false
|
||||||
@@ -31,8 +31,8 @@ so-influxdb:
|
|||||||
- DOCKER_INFLUXDB_INIT_ORG=Security Onion
|
- DOCKER_INFLUXDB_INIT_ORG=Security Onion
|
||||||
- DOCKER_INFLUXDB_INIT_BUCKET=telegraf/so_short_term
|
- DOCKER_INFLUXDB_INIT_BUCKET=telegraf/so_short_term
|
||||||
- DOCKER_INFLUXDB_INIT_ADMIN_TOKEN={{ TOKEN }}
|
- DOCKER_INFLUXDB_INIT_ADMIN_TOKEN={{ TOKEN }}
|
||||||
{% if DOCKER.containers['so-influxdb'].extra_env %}
|
{% if DOCKERMERGED.containers['so-influxdb'].extra_env %}
|
||||||
{% for XTRAENV in DOCKER.containers['so-influxdb'].extra_env %}
|
{% for XTRAENV in DOCKERMERGED.containers['so-influxdb'].extra_env %}
|
||||||
- {{ XTRAENV }}
|
- {{ XTRAENV }}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
@@ -43,21 +43,27 @@ so-influxdb:
|
|||||||
- /nsm/influxdb:/var/lib/influxdb2:rw
|
- /nsm/influxdb:/var/lib/influxdb2:rw
|
||||||
- /etc/pki/influxdb.crt:/conf/influxdb.crt:ro
|
- /etc/pki/influxdb.crt:/conf/influxdb.crt:ro
|
||||||
- /etc/pki/influxdb.key:/conf/influxdb.key:ro
|
- /etc/pki/influxdb.key:/conf/influxdb.key:ro
|
||||||
{% if DOCKER.containers['so-influxdb'].custom_bind_mounts %}
|
{% if DOCKERMERGED.containers['so-influxdb'].custom_bind_mounts %}
|
||||||
{% for BIND in DOCKER.containers['so-influxdb'].custom_bind_mounts %}
|
{% for BIND in DOCKERMERGED.containers['so-influxdb'].custom_bind_mounts %}
|
||||||
- {{ BIND }}
|
- {{ BIND }}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
- port_bindings:
|
- port_bindings:
|
||||||
{% for BINDING in DOCKER.containers['so-influxdb'].port_bindings %}
|
{% for BINDING in DOCKERMERGED.containers['so-influxdb'].port_bindings %}
|
||||||
- {{ BINDING }}
|
- {{ BINDING }}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% if DOCKER.containers['so-influxdb'].extra_hosts %}
|
{% if DOCKERMERGED.containers['so-influxdb'].extra_hosts %}
|
||||||
- extra_hosts:
|
- extra_hosts:
|
||||||
{% for XTRAHOST in DOCKER.containers['so-influxdb'].extra_hosts %}
|
{% for XTRAHOST in DOCKERMERGED.containers['so-influxdb'].extra_hosts %}
|
||||||
- {{ XTRAHOST }}
|
- {{ XTRAHOST }}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
{% if DOCKERMERGED.containers['so-influxdb'].ulimits %}
|
||||||
|
- ulimits:
|
||||||
|
{% for ULIMIT in DOCKERMERGED.containers['so-influxdb'].ulimits %}
|
||||||
|
- {{ ULIMIT.name }}={{ ULIMIT.soft }}:{{ ULIMIT.hard }}
|
||||||
|
{% endfor %}
|
||||||
|
{% endif %}
|
||||||
- watch:
|
- watch:
|
||||||
- file: influxdbconf
|
- file: influxdbconf
|
||||||
- x509: influxdb_key
|
- x509: influxdb_key
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
{% from 'allowed_states.map.jinja' import allowed_states %}
|
{% from 'allowed_states.map.jinja' import allowed_states %}
|
||||||
{% if sls.split('.')[0] in allowed_states %}
|
{% if sls.split('.')[0] in allowed_states %}
|
||||||
{% from 'vars/globals.map.jinja' import GLOBALS %}
|
{% from 'vars/globals.map.jinja' import GLOBALS %}
|
||||||
{% from 'docker/docker.map.jinja' import DOCKER %}
|
{% from 'docker/docker.map.jinja' import DOCKERMERGED %}
|
||||||
{% set KAFKANODES = salt['pillar.get']('kafka:nodes') %}
|
{% set KAFKANODES = salt['pillar.get']('kafka:nodes') %}
|
||||||
{% set KAFKA_EXTERNAL_ACCESS = salt['pillar.get']('kafka:config:external_access:enabled', default=False) %}
|
{% set KAFKA_EXTERNAL_ACCESS = salt['pillar.get']('kafka:config:external_access:enabled', default=False) %}
|
||||||
{% if 'gmd' in salt['pillar.get']('features', []) %}
|
{% if 'gmd' in salt['pillar.get']('features', []) %}
|
||||||
@@ -31,22 +31,22 @@ so-kafka:
|
|||||||
- name: so-kafka
|
- name: so-kafka
|
||||||
- networks:
|
- networks:
|
||||||
- sobridge:
|
- sobridge:
|
||||||
- ipv4_address: {{ DOCKER.containers['so-kafka'].ip }}
|
- ipv4_address: {{ DOCKERMERGED.containers['so-kafka'].ip }}
|
||||||
- user: kafka
|
- user: kafka
|
||||||
- environment:
|
- environment:
|
||||||
KAFKA_HEAP_OPTS: -Xmx2G -Xms1G
|
KAFKA_HEAP_OPTS: -Xmx2G -Xms1G
|
||||||
KAFKA_OPTS: "-javaagent:/opt/jolokia/agents/jolokia-agent-jvm-javaagent.jar=port=8778,host={{ DOCKER.containers['so-kafka'].ip }},policyLocation=file:/opt/jolokia/jolokia.xml {%- if KAFKA_EXTERNAL_ACCESS %} -Djava.security.auth.login.config=/opt/kafka/config/kafka_server_jaas.conf {% endif -%}"
|
KAFKA_OPTS: "-javaagent:/opt/jolokia/agents/jolokia-agent-jvm-javaagent.jar=port=8778,host={{ DOCKERMERGED.containers['so-kafka'].ip }},policyLocation=file:/opt/jolokia/jolokia.xml {%- if KAFKA_EXTERNAL_ACCESS %} -Djava.security.auth.login.config=/opt/kafka/config/kafka_server_jaas.conf {% endif -%}"
|
||||||
- extra_hosts:
|
- extra_hosts:
|
||||||
{% for node in KAFKANODES %}
|
{% for node in KAFKANODES %}
|
||||||
- {{ node }}:{{ KAFKANODES[node].ip }}
|
- {{ node }}:{{ KAFKANODES[node].ip }}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% if DOCKER.containers['so-kafka'].extra_hosts %}
|
{% if DOCKERMERGED.containers['so-kafka'].extra_hosts %}
|
||||||
{% for XTRAHOST in DOCKER.containers['so-kafka'].extra_hosts %}
|
{% for XTRAHOST in DOCKERMERGED.containers['so-kafka'].extra_hosts %}
|
||||||
- {{ XTRAHOST }}
|
- {{ XTRAHOST }}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
- port_bindings:
|
- port_bindings:
|
||||||
{% for BINDING in DOCKER.containers['so-kafka'].port_bindings %}
|
{% for BINDING in DOCKERMERGED.containers['so-kafka'].port_bindings %}
|
||||||
- {{ BINDING }}
|
- {{ BINDING }}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
- binds:
|
- binds:
|
||||||
@@ -60,6 +60,12 @@ so-kafka:
|
|||||||
{% if KAFKA_EXTERNAL_ACCESS %}
|
{% if KAFKA_EXTERNAL_ACCESS %}
|
||||||
- /opt/so/conf/kafka/kafka_server_jaas.conf:/opt/kafka/config/kafka_server_jaas.conf:ro
|
- /opt/so/conf/kafka/kafka_server_jaas.conf:/opt/kafka/config/kafka_server_jaas.conf:ro
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
{% if DOCKERMERGED.containers['so-kafka'].ulimits %}
|
||||||
|
- ulimits:
|
||||||
|
{% for ULIMIT in DOCKERMERGED.containers['so-kafka'].ulimits %}
|
||||||
|
- {{ ULIMIT.name }}={{ ULIMIT.soft }}:{{ ULIMIT.hard }}
|
||||||
|
{% endfor %}
|
||||||
|
{% endif %}
|
||||||
- watch:
|
- watch:
|
||||||
{% for sc in ['server', 'client'] %}
|
{% for sc in ['server', 'client'] %}
|
||||||
- file: kafka_kraft_{{sc}}_properties
|
- file: kafka_kraft_{{sc}}_properties
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
{% from 'allowed_states.map.jinja' import allowed_states %}
|
{% from 'allowed_states.map.jinja' import allowed_states %}
|
||||||
{% if sls.split('.')[0] in allowed_states %}
|
{% if sls.split('.')[0] in allowed_states %}
|
||||||
{% from 'docker/docker.map.jinja' import DOCKER %}
|
{% from 'docker/docker.map.jinja' import DOCKERMERGED %}
|
||||||
{% from 'vars/globals.map.jinja' import GLOBALS %}
|
{% from 'vars/globals.map.jinja' import GLOBALS %}
|
||||||
|
|
||||||
include:
|
include:
|
||||||
@@ -20,20 +20,20 @@ so-kibana:
|
|||||||
- user: kibana
|
- user: kibana
|
||||||
- networks:
|
- networks:
|
||||||
- sobridge:
|
- sobridge:
|
||||||
- ipv4_address: {{ DOCKER.containers['so-kibana'].ip }}
|
- ipv4_address: {{ DOCKERMERGED.containers['so-kibana'].ip }}
|
||||||
- environment:
|
- environment:
|
||||||
- ELASTICSEARCH_HOST={{ GLOBALS.manager }}
|
- ELASTICSEARCH_HOST={{ GLOBALS.manager }}
|
||||||
- ELASTICSEARCH_PORT=9200
|
- ELASTICSEARCH_PORT=9200
|
||||||
- MANAGER={{ GLOBALS.manager }}
|
- MANAGER={{ GLOBALS.manager }}
|
||||||
{% if DOCKER.containers['so-kibana'].extra_env %}
|
{% if DOCKERMERGED.containers['so-kibana'].extra_env %}
|
||||||
{% for XTRAENV in DOCKER.containers['so-kibana'].extra_env %}
|
{% for XTRAENV in DOCKERMERGED.containers['so-kibana'].extra_env %}
|
||||||
- {{ XTRAENV }}
|
- {{ XTRAENV }}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
- extra_hosts:
|
- extra_hosts:
|
||||||
- {{ GLOBALS.manager }}:{{ GLOBALS.manager_ip }}
|
- {{ GLOBALS.manager }}:{{ GLOBALS.manager_ip }}
|
||||||
{% if DOCKER.containers['so-kibana'].extra_hosts %}
|
{% if DOCKERMERGED.containers['so-kibana'].extra_hosts %}
|
||||||
{% for XTRAHOST in DOCKER.containers['so-kibana'].extra_hosts %}
|
{% for XTRAHOST in DOCKERMERGED.containers['so-kibana'].extra_hosts %}
|
||||||
- {{ XTRAHOST }}
|
- {{ XTRAHOST }}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
@@ -42,15 +42,21 @@ so-kibana:
|
|||||||
- /opt/so/log/kibana:/var/log/kibana:rw
|
- /opt/so/log/kibana:/var/log/kibana:rw
|
||||||
- /opt/so/conf/kibana/customdashboards:/usr/share/kibana/custdashboards:ro
|
- /opt/so/conf/kibana/customdashboards:/usr/share/kibana/custdashboards:ro
|
||||||
- /sys/fs/cgroup:/sys/fs/cgroup:ro
|
- /sys/fs/cgroup:/sys/fs/cgroup:ro
|
||||||
{% if DOCKER.containers['so-kibana'].custom_bind_mounts %}
|
{% if DOCKERMERGED.containers['so-kibana'].custom_bind_mounts %}
|
||||||
{% for BIND in DOCKER.containers['so-kibana'].custom_bind_mounts %}
|
{% for BIND in DOCKERMERGED.containers['so-kibana'].custom_bind_mounts %}
|
||||||
- {{ BIND }}
|
- {{ BIND }}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
- port_bindings:
|
- port_bindings:
|
||||||
{% for BINDING in DOCKER.containers['so-kibana'].port_bindings %}
|
{% for BINDING in DOCKERMERGED.containers['so-kibana'].port_bindings %}
|
||||||
- {{ BINDING }}
|
- {{ BINDING }}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
{% if DOCKERMERGED.containers['so-kibana'].ulimits %}
|
||||||
|
- ulimits:
|
||||||
|
{% for ULIMIT in DOCKERMERGED.containers['so-kibana'].ulimits %}
|
||||||
|
- {{ ULIMIT.name }}={{ ULIMIT.soft }}:{{ ULIMIT.hard }}
|
||||||
|
{% endfor %}
|
||||||
|
{% endif %}
|
||||||
- watch:
|
- watch:
|
||||||
- file: kibanaconfig
|
- file: kibanaconfig
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,6 @@
|
|||||||
|
|
||||||
{% from 'vars/globals.map.jinja' import GLOBALS %}
|
{% from 'vars/globals.map.jinja' import GLOBALS %}
|
||||||
{% import_yaml 'kibana/defaults.yaml' as KIBANADEFAULTS with context %}
|
{% import_yaml 'kibana/defaults.yaml' as KIBANADEFAULTS with context %}
|
||||||
{% set HIGHLANDER = salt['pillar.get']('global:highlander', False) %}
|
|
||||||
|
|
||||||
{% do KIBANADEFAULTS.kibana.config.server.update({'publicBaseUrl': 'https://' ~ GLOBALS.url_base ~ '/kibana'}) %}
|
{% do KIBANADEFAULTS.kibana.config.server.update({'publicBaseUrl': 'https://' ~ GLOBALS.url_base ~ '/kibana'}) %}
|
||||||
{% do KIBANADEFAULTS.kibana.config.elasticsearch.update({'hosts': ['https://' ~ GLOBALS.manager ~ ':9200']}) %}
|
{% do KIBANADEFAULTS.kibana.config.elasticsearch.update({'hosts': ['https://' ~ GLOBALS.manager ~ ':9200']}) %}
|
||||||
|
|||||||
@@ -3,7 +3,6 @@
|
|||||||
# https://securityonion.net/license; you may not use this file except in compliance with the
|
# https://securityonion.net/license; you may not use this file except in compliance with the
|
||||||
# Elastic License 2.0.
|
# Elastic License 2.0.
|
||||||
|
|
||||||
{% set HIGHLANDER = salt['pillar.get']('global:highlander', False) %}
|
|
||||||
include:
|
include:
|
||||||
- kibana.enabled
|
- kibana.enabled
|
||||||
|
|
||||||
@@ -29,27 +28,3 @@ so-kibana-dashboard-load:
|
|||||||
- require:
|
- require:
|
||||||
- sls: kibana.enabled
|
- sls: kibana.enabled
|
||||||
- file: dashboard_saved_objects_template
|
- file: dashboard_saved_objects_template
|
||||||
{%- if HIGHLANDER %}
|
|
||||||
dashboard_saved_objects_template_hl:
|
|
||||||
file.managed:
|
|
||||||
- name: /opt/so/conf/kibana/hl.ndjson.template
|
|
||||||
- source: salt://kibana/files/hl.ndjson
|
|
||||||
- user: 932
|
|
||||||
- group: 939
|
|
||||||
- show_changes: False
|
|
||||||
|
|
||||||
dashboard_saved_objects_hl_changes:
|
|
||||||
file.absent:
|
|
||||||
- names:
|
|
||||||
- /opt/so/state/kibana_hl.txt
|
|
||||||
- onchanges:
|
|
||||||
- file: dashboard_saved_objects_template_hl
|
|
||||||
|
|
||||||
so-kibana-dashboard-load_hl:
|
|
||||||
cmd.run:
|
|
||||||
- name: /usr/sbin/so-kibana-config-load -i /opt/so/conf/kibana/hl.ndjson.template
|
|
||||||
- cwd: /opt/so
|
|
||||||
- require:
|
|
||||||
- sls: kibana.enabled
|
|
||||||
- file: dashboard_saved_objects_template_hl
|
|
||||||
{%- endif %}
|
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
. /usr/sbin/so-common
|
. /usr/sbin/so-common
|
||||||
{% set HIGHLANDER = salt['pillar.get']('global:highlander', False) %}
|
|
||||||
wait_for_web_response "http://localhost:5601/api/spaces/space/default" "default" 300 "curl -K /opt/so/conf/elasticsearch/curl.config"
|
wait_for_web_response "http://localhost:5601/api/spaces/space/default" "default" 300 "curl -K /opt/so/conf/elasticsearch/curl.config"
|
||||||
## This hackery will be removed if using Elastic Auth ##
|
## This hackery will be removed if using Elastic Auth ##
|
||||||
|
|
||||||
@@ -9,10 +8,6 @@ SESSIONCOOKIE=$(curl -K /opt/so/conf/elasticsearch/curl.config -c - -X GET http:
|
|||||||
|
|
||||||
# Disable certain Features from showing up in the Kibana UI
|
# Disable certain Features from showing up in the Kibana UI
|
||||||
echo
|
echo
|
||||||
echo "Setting up default Space:"
|
echo "Setting up default Kibana Space:"
|
||||||
{% if HIGHLANDER %}
|
|
||||||
curl -K /opt/so/conf/elasticsearch/curl.config -b "sid=$SESSIONCOOKIE" -L -X PUT "localhost:5601/api/spaces/space/default" -H 'kbn-xsrf: true' -H 'Content-Type: application/json' -d' {"id":"default","name":"Default","disabledFeatures":["enterpriseSearch"]} ' >> /opt/so/log/kibana/misc.log
|
|
||||||
{% else %}
|
|
||||||
curl -K /opt/so/conf/elasticsearch/curl.config -b "sid=$SESSIONCOOKIE" -L -X PUT "localhost:5601/api/spaces/space/default" -H 'kbn-xsrf: true' -H 'Content-Type: application/json' -d' {"id":"default","name":"Default","disabledFeatures":["ml","enterpriseSearch","logs","infrastructure","apm","uptime","monitoring","stackAlerts","actions","securitySolutionCasesV3","inventory","dataQuality","searchSynonyms","enterpriseSearchApplications","enterpriseSearchAnalytics","securitySolutionTimeline","securitySolutionNotes","entityManager"]} ' >> /opt/so/log/kibana/misc.log
|
curl -K /opt/so/conf/elasticsearch/curl.config -b "sid=$SESSIONCOOKIE" -L -X PUT "localhost:5601/api/spaces/space/default" -H 'kbn-xsrf: true' -H 'Content-Type: application/json' -d' {"id":"default","name":"Default","disabledFeatures":["ml","enterpriseSearch","logs","infrastructure","apm","uptime","monitoring","stackAlerts","actions","securitySolutionCasesV3","inventory","dataQuality","searchSynonyms","enterpriseSearchApplications","enterpriseSearchAnalytics","securitySolutionTimeline","securitySolutionNotes","entityManager"]} ' >> /opt/so/log/kibana/misc.log
|
||||||
{% endif %}
|
|
||||||
echo
|
echo
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
{% from 'allowed_states.map.jinja' import allowed_states %}
|
{% from 'allowed_states.map.jinja' import allowed_states %}
|
||||||
{% if sls.split('.')[0] in allowed_states %}
|
{% if sls.split('.')[0] in allowed_states %}
|
||||||
{% from 'docker/docker.map.jinja' import DOCKER %}
|
{% from 'docker/docker.map.jinja' import DOCKERMERGED %}
|
||||||
{% from 'vars/globals.map.jinja' import GLOBALS %}
|
{% from 'vars/globals.map.jinja' import GLOBALS %}
|
||||||
|
|
||||||
include:
|
include:
|
||||||
@@ -19,32 +19,38 @@ so-kratos:
|
|||||||
- name: so-kratos
|
- name: so-kratos
|
||||||
- networks:
|
- networks:
|
||||||
- sobridge:
|
- sobridge:
|
||||||
- ipv4_address: {{ DOCKER.containers['so-kratos'].ip }}
|
- ipv4_address: {{ DOCKERMERGED.containers['so-kratos'].ip }}
|
||||||
- binds:
|
- binds:
|
||||||
- /opt/so/conf/kratos/:/kratos-conf:ro
|
- /opt/so/conf/kratos/:/kratos-conf:ro
|
||||||
- /opt/so/log/kratos/:/kratos-log:rw
|
- /opt/so/log/kratos/:/kratos-log:rw
|
||||||
- /nsm/kratos/db:/kratos-data:rw
|
- /nsm/kratos/db:/kratos-data:rw
|
||||||
{% if DOCKER.containers['so-kratos'].custom_bind_mounts %}
|
{% if DOCKERMERGED.containers['so-kratos'].custom_bind_mounts %}
|
||||||
{% for BIND in DOCKER.containers['so-kratos'].custom_bind_mounts %}
|
{% for BIND in DOCKERMERGED.containers['so-kratos'].custom_bind_mounts %}
|
||||||
- {{ BIND }}
|
- {{ BIND }}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
- port_bindings:
|
- port_bindings:
|
||||||
{% for BINDING in DOCKER.containers['so-kratos'].port_bindings %}
|
{% for BINDING in DOCKERMERGED.containers['so-kratos'].port_bindings %}
|
||||||
- {{ BINDING }}
|
- {{ BINDING }}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% if DOCKER.containers['so-kratos'].extra_hosts %}
|
{% if DOCKERMERGED.containers['so-kratos'].extra_hosts %}
|
||||||
- extra_hosts:
|
- extra_hosts:
|
||||||
{% for XTRAHOST in DOCKER.containers['so-kratos'].extra_hosts %}
|
{% for XTRAHOST in DOCKERMERGED.containers['so-kratos'].extra_hosts %}
|
||||||
- {{ XTRAHOST }}
|
- {{ XTRAHOST }}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if DOCKER.containers['so-kratos'].extra_env %}
|
{% if DOCKERMERGED.containers['so-kratos'].extra_env %}
|
||||||
- environment:
|
- environment:
|
||||||
{% for XTRAENV in DOCKER.containers['so-kratos'].extra_env %}
|
{% for XTRAENV in DOCKERMERGED.containers['so-kratos'].extra_env %}
|
||||||
- {{ XTRAENV }}
|
- {{ XTRAENV }}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
{% if DOCKERMERGED.containers['so-kratos'].ulimits %}
|
||||||
|
- ulimits:
|
||||||
|
{% for ULIMIT in DOCKERMERGED.containers['so-kratos'].ulimits %}
|
||||||
|
- {{ ULIMIT.name }}={{ ULIMIT.soft }}:{{ ULIMIT.hard }}
|
||||||
|
{% endfor %}
|
||||||
|
{% endif %}
|
||||||
- restart_policy: unless-stopped
|
- restart_policy: unless-stopped
|
||||||
- watch:
|
- watch:
|
||||||
- file: kratosschema
|
- file: kratosschema
|
||||||
|
|||||||
@@ -36,10 +36,6 @@ logstash:
|
|||||||
- gid: 931
|
- gid: 931
|
||||||
- home: /opt/so/conf/logstash
|
- home: /opt/so/conf/logstash
|
||||||
|
|
||||||
lslibdir:
|
|
||||||
file.absent:
|
|
||||||
- name: /opt/so/conf/logstash/lib
|
|
||||||
|
|
||||||
logstash_sbin:
|
logstash_sbin:
|
||||||
file.recurse:
|
file.recurse:
|
||||||
- name: /usr/sbin
|
- name: /usr/sbin
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
{% from 'allowed_states.map.jinja' import allowed_states %}
|
{% from 'allowed_states.map.jinja' import allowed_states %}
|
||||||
{% if sls.split('.')[0] in allowed_states %}
|
{% if sls.split('.')[0] in allowed_states %}
|
||||||
{% from 'vars/globals.map.jinja' import GLOBALS %}
|
{% from 'vars/globals.map.jinja' import GLOBALS %}
|
||||||
{% from 'docker/docker.map.jinja' import DOCKER %}
|
{% from 'docker/docker.map.jinja' import DOCKERMERGED %}
|
||||||
{% from 'logstash/map.jinja' import LOGSTASH_MERGED %}
|
{% from 'logstash/map.jinja' import LOGSTASH_MERGED %}
|
||||||
{% from 'logstash/map.jinja' import LOGSTASH_NODES %}
|
{% from 'logstash/map.jinja' import LOGSTASH_NODES %}
|
||||||
{% set lsheap = LOGSTASH_MERGED.settings.lsheap %}
|
{% set lsheap = LOGSTASH_MERGED.settings.lsheap %}
|
||||||
@@ -32,7 +32,7 @@ so-logstash:
|
|||||||
- name: so-logstash
|
- name: so-logstash
|
||||||
- networks:
|
- networks:
|
||||||
- sobridge:
|
- sobridge:
|
||||||
- ipv4_address: {{ DOCKER.containers['so-logstash'].ip }}
|
- ipv4_address: {{ DOCKERMERGED.containers['so-logstash'].ip }}
|
||||||
- user: logstash
|
- user: logstash
|
||||||
- extra_hosts:
|
- extra_hosts:
|
||||||
{% for node in LOGSTASH_NODES %}
|
{% for node in LOGSTASH_NODES %}
|
||||||
@@ -40,20 +40,20 @@ so-logstash:
|
|||||||
- {{hostname}}:{{ip}}
|
- {{hostname}}:{{ip}}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% if DOCKER.containers['so-logstash'].extra_hosts %}
|
{% if DOCKERMERGED.containers['so-logstash'].extra_hosts %}
|
||||||
{% for XTRAHOST in DOCKER.containers['so-logstash'].extra_hosts %}
|
{% for XTRAHOST in DOCKERMERGED.containers['so-logstash'].extra_hosts %}
|
||||||
- {{ XTRAHOST }}
|
- {{ XTRAHOST }}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
- environment:
|
- environment:
|
||||||
- LS_JAVA_OPTS=-Xms{{ lsheap }} -Xmx{{ lsheap }}
|
- LS_JAVA_OPTS=-Xms{{ lsheap }} -Xmx{{ lsheap }}
|
||||||
{% if DOCKER.containers['so-logstash'].extra_env %}
|
{% if DOCKERMERGED.containers['so-logstash'].extra_env %}
|
||||||
{% for XTRAENV in DOCKER.containers['so-logstash'].extra_env %}
|
{% for XTRAENV in DOCKERMERGED.containers['so-logstash'].extra_env %}
|
||||||
- {{ XTRAENV }}
|
- {{ XTRAENV }}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
- port_bindings:
|
- port_bindings:
|
||||||
{% for BINDING in DOCKER.containers['so-logstash'].port_bindings %}
|
{% for BINDING in DOCKERMERGED.containers['so-logstash'].port_bindings %}
|
||||||
- {{ BINDING }}
|
- {{ BINDING }}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
- binds:
|
- binds:
|
||||||
@@ -91,11 +91,17 @@ so-logstash:
|
|||||||
- /opt/so/log/fleet/:/osquery/logs:ro
|
- /opt/so/log/fleet/:/osquery/logs:ro
|
||||||
- /opt/so/log/strelka:/strelka:ro
|
- /opt/so/log/strelka:/strelka:ro
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if DOCKER.containers['so-logstash'].custom_bind_mounts %}
|
{% if DOCKERMERGED.containers['so-logstash'].custom_bind_mounts %}
|
||||||
{% for BIND in DOCKER.containers['so-logstash'].custom_bind_mounts %}
|
{% for BIND in DOCKERMERGED.containers['so-logstash'].custom_bind_mounts %}
|
||||||
- {{ BIND }}
|
- {{ BIND }}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
{% if DOCKERMERGED.containers['so-logstash'].ulimits %}
|
||||||
|
- ulimits:
|
||||||
|
{% for ULIMIT in DOCKERMERGED.containers['so-logstash'].ulimits %}
|
||||||
|
- {{ ULIMIT.name }}={{ ULIMIT.soft }}:{{ ULIMIT.hard }}
|
||||||
|
{% endfor %}
|
||||||
|
{% endif %}
|
||||||
- watch:
|
- watch:
|
||||||
- file: lsetcsync
|
- file: lsetcsync
|
||||||
- file: trusttheca
|
- file: trusttheca
|
||||||
|
|||||||
@@ -63,11 +63,9 @@ yara_log_dir:
|
|||||||
- user
|
- user
|
||||||
- group
|
- group
|
||||||
|
|
||||||
{% if GLOBALS.os_family == 'RedHat' %}
|
|
||||||
install_createrepo:
|
install_createrepo:
|
||||||
pkg.installed:
|
pkg.installed:
|
||||||
- name: createrepo_c
|
- name: createrepo_c
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
repo_conf_dir:
|
repo_conf_dir:
|
||||||
file.directory:
|
file.directory:
|
||||||
|
|||||||
@@ -134,8 +134,8 @@ function require() {
|
|||||||
function verifyEnvironment() {
|
function verifyEnvironment() {
|
||||||
require "jq"
|
require "jq"
|
||||||
require "curl"
|
require "curl"
|
||||||
response=$(curl -Ss -L ${hydraUrl}/)
|
response=$(curl -Ss -L ${hydraUrl}/health/alive)
|
||||||
[[ "$response" != *"Error 404"* ]] && fail "Unable to communicate with Hydra; specify URL via HYDRA_URL environment variable"
|
[[ "$response" != '{"status":"ok"}' ]] && fail "Unable to communicate with Hydra; specify URL via HYDRA_URL environment variable"
|
||||||
}
|
}
|
||||||
|
|
||||||
function createFile() {
|
function createFile() {
|
||||||
|
|||||||
@@ -462,19 +462,14 @@ function add_sensor_to_minion() {
|
|||||||
echo " lb_procs: '$CORECOUNT'"
|
echo " lb_procs: '$CORECOUNT'"
|
||||||
echo "suricata:"
|
echo "suricata:"
|
||||||
echo " enabled: True "
|
echo " enabled: True "
|
||||||
|
echo " pcap:"
|
||||||
|
echo " enabled: True"
|
||||||
if [[ $is_pcaplimit ]]; then
|
if [[ $is_pcaplimit ]]; then
|
||||||
echo " pcap:"
|
|
||||||
echo " maxsize: $MAX_PCAP_SPACE"
|
echo " maxsize: $MAX_PCAP_SPACE"
|
||||||
fi
|
fi
|
||||||
echo " config:"
|
echo " config:"
|
||||||
echo " af-packet:"
|
echo " af-packet:"
|
||||||
echo " threads: '$CORECOUNT'"
|
echo " threads: '$CORECOUNT'"
|
||||||
echo "pcap:"
|
|
||||||
echo " enabled: True"
|
|
||||||
if [[ $is_pcaplimit ]]; then
|
|
||||||
echo " config:"
|
|
||||||
echo " diskfreepercentage: $DFREEPERCENT"
|
|
||||||
fi
|
|
||||||
echo " "
|
echo " "
|
||||||
} >> $PILLARFILE
|
} >> $PILLARFILE
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ def showUsage(args):
|
|||||||
print(' removelistitem - Remove a list item from a yaml key, if it exists and is a list. Requires KEY and LISTITEM args.', file=sys.stderr)
|
print(' removelistitem - Remove a list item from a yaml key, if it exists and is a list. Requires KEY and LISTITEM args.', file=sys.stderr)
|
||||||
print(' replacelistobject - Replace a list object based on a condition. Requires KEY, CONDITION_FIELD, CONDITION_VALUE, and JSON_OBJECT args.', file=sys.stderr)
|
print(' replacelistobject - Replace a list object based on a condition. Requires KEY, CONDITION_FIELD, CONDITION_VALUE, and JSON_OBJECT args.', file=sys.stderr)
|
||||||
print(' add - Add a new key and set its value. Fails if key already exists. Requires KEY and VALUE args.', file=sys.stderr)
|
print(' add - Add a new key and set its value. Fails if key already exists. Requires KEY and VALUE args.', file=sys.stderr)
|
||||||
print(' get - Displays (to stdout) the value stored in the given key. Requires KEY arg.', file=sys.stderr)
|
print(' get [-r] - Displays (to stdout) the value stored in the given key. Requires KEY arg. Use -r for raw output without YAML formatting.', file=sys.stderr)
|
||||||
print(' remove - Removes a yaml key, if it exists. Requires KEY arg.', file=sys.stderr)
|
print(' remove - Removes a yaml key, if it exists. Requires KEY arg.', file=sys.stderr)
|
||||||
print(' replace - Replaces (or adds) a new key and set its value. Requires KEY and VALUE args.', file=sys.stderr)
|
print(' replace - Replaces (or adds) a new key and set its value. Requires KEY and VALUE args.', file=sys.stderr)
|
||||||
print(' help - Prints this usage information.', file=sys.stderr)
|
print(' help - Prints this usage information.', file=sys.stderr)
|
||||||
@@ -256,7 +256,7 @@ def replacelistobject(args):
|
|||||||
def addKey(content, key, value):
|
def addKey(content, key, value):
|
||||||
pieces = key.split(".", 1)
|
pieces = key.split(".", 1)
|
||||||
if len(pieces) > 1:
|
if len(pieces) > 1:
|
||||||
if not pieces[0] in content:
|
if pieces[0] not in content or content[pieces[0]] is None:
|
||||||
content[pieces[0]] = {}
|
content[pieces[0]] = {}
|
||||||
addKey(content[pieces[0]], pieces[1], value)
|
addKey(content[pieces[0]], pieces[1], value)
|
||||||
elif key in content:
|
elif key in content:
|
||||||
@@ -332,6 +332,11 @@ def getKeyValue(content, key):
|
|||||||
|
|
||||||
|
|
||||||
def get(args):
|
def get(args):
|
||||||
|
raw = False
|
||||||
|
if len(args) > 0 and args[0] == '-r':
|
||||||
|
raw = True
|
||||||
|
args = args[1:]
|
||||||
|
|
||||||
if len(args) != 2:
|
if len(args) != 2:
|
||||||
print('Missing filename or key arg', file=sys.stderr)
|
print('Missing filename or key arg', file=sys.stderr)
|
||||||
showUsage(None)
|
showUsage(None)
|
||||||
@@ -346,7 +351,15 @@ def get(args):
|
|||||||
print(f"Key '{key}' not found by so-yaml.py", file=sys.stderr)
|
print(f"Key '{key}' not found by so-yaml.py", file=sys.stderr)
|
||||||
return 2
|
return 2
|
||||||
|
|
||||||
print(yaml.safe_dump(output))
|
if raw:
|
||||||
|
if isinstance(output, bool):
|
||||||
|
print(str(output).lower())
|
||||||
|
elif isinstance(output, (dict, list)):
|
||||||
|
print(yaml.safe_dump(output).strip())
|
||||||
|
else:
|
||||||
|
print(output)
|
||||||
|
else:
|
||||||
|
print(yaml.safe_dump(output))
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -395,6 +395,17 @@ class TestRemove(unittest.TestCase):
|
|||||||
self.assertEqual(result, 0)
|
self.assertEqual(result, 0)
|
||||||
self.assertIn("45\n...", mock_stdout.getvalue())
|
self.assertIn("45\n...", mock_stdout.getvalue())
|
||||||
|
|
||||||
|
def test_get_int_raw(self):
|
||||||
|
with patch('sys.stdout', new=StringIO()) as mock_stdout:
|
||||||
|
filename = "/tmp/so-yaml_test-get.yaml"
|
||||||
|
file = open(filename, "w")
|
||||||
|
file.write("{key1: { child1: 123, child2: { deep1: 45 } }, key2: false, key3: [e,f,g]}")
|
||||||
|
file.close()
|
||||||
|
|
||||||
|
result = soyaml.get(["-r", filename, "key1.child2.deep1"])
|
||||||
|
self.assertEqual(result, 0)
|
||||||
|
self.assertEqual("45\n", mock_stdout.getvalue())
|
||||||
|
|
||||||
def test_get_str(self):
|
def test_get_str(self):
|
||||||
with patch('sys.stdout', new=StringIO()) as mock_stdout:
|
with patch('sys.stdout', new=StringIO()) as mock_stdout:
|
||||||
filename = "/tmp/so-yaml_test-get.yaml"
|
filename = "/tmp/so-yaml_test-get.yaml"
|
||||||
@@ -406,6 +417,51 @@ class TestRemove(unittest.TestCase):
|
|||||||
self.assertEqual(result, 0)
|
self.assertEqual(result, 0)
|
||||||
self.assertIn("hello\n...", mock_stdout.getvalue())
|
self.assertIn("hello\n...", mock_stdout.getvalue())
|
||||||
|
|
||||||
|
def test_get_str_raw(self):
|
||||||
|
with patch('sys.stdout', new=StringIO()) as mock_stdout:
|
||||||
|
filename = "/tmp/so-yaml_test-get.yaml"
|
||||||
|
file = open(filename, "w")
|
||||||
|
file.write("{key1: { child1: 123, child2: { deep1: \"hello\" } }, key2: false, key3: [e,f,g]}")
|
||||||
|
file.close()
|
||||||
|
|
||||||
|
result = soyaml.get(["-r", filename, "key1.child2.deep1"])
|
||||||
|
self.assertEqual(result, 0)
|
||||||
|
self.assertEqual("hello\n", mock_stdout.getvalue())
|
||||||
|
|
||||||
|
def test_get_bool(self):
|
||||||
|
with patch('sys.stdout', new=StringIO()) as mock_stdout:
|
||||||
|
filename = "/tmp/so-yaml_test-get.yaml"
|
||||||
|
file = open(filename, "w")
|
||||||
|
file.write("{key1: { child1: 123, child2: { deep1: 45 } }, key2: false, key3: [e,f,g]}")
|
||||||
|
file.close()
|
||||||
|
|
||||||
|
result = soyaml.get([filename, "key2"])
|
||||||
|
self.assertEqual(result, 0)
|
||||||
|
self.assertIn("false\n...", mock_stdout.getvalue())
|
||||||
|
|
||||||
|
def test_get_bool_raw(self):
|
||||||
|
with patch('sys.stdout', new=StringIO()) as mock_stdout:
|
||||||
|
filename = "/tmp/so-yaml_test-get.yaml"
|
||||||
|
file = open(filename, "w")
|
||||||
|
file.write("{key1: { child1: 123, child2: { deep1: 45 } }, key2: false, key3: [e,f,g]}")
|
||||||
|
file.close()
|
||||||
|
|
||||||
|
result = soyaml.get(["-r", filename, "key2"])
|
||||||
|
self.assertEqual(result, 0)
|
||||||
|
self.assertEqual("false\n", mock_stdout.getvalue())
|
||||||
|
|
||||||
|
def test_get_dict_raw(self):
|
||||||
|
with patch('sys.stdout', new=StringIO()) as mock_stdout:
|
||||||
|
filename = "/tmp/so-yaml_test-get.yaml"
|
||||||
|
file = open(filename, "w")
|
||||||
|
file.write("{key1: { child1: 123, child2: { deep1: 45 } }, key2: false, key3: [e,f,g]}")
|
||||||
|
file.close()
|
||||||
|
|
||||||
|
result = soyaml.get(["-r", filename, "key1"])
|
||||||
|
self.assertEqual(result, 0)
|
||||||
|
self.assertIn("child1: 123", mock_stdout.getvalue())
|
||||||
|
self.assertNotIn("...", mock_stdout.getvalue())
|
||||||
|
|
||||||
def test_get_list(self):
|
def test_get_list(self):
|
||||||
with patch('sys.stdout', new=StringIO()) as mock_stdout:
|
with patch('sys.stdout', new=StringIO()) as mock_stdout:
|
||||||
filename = "/tmp/so-yaml_test-get.yaml"
|
filename = "/tmp/so-yaml_test-get.yaml"
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -6,7 +6,7 @@
|
|||||||
{% from 'allowed_states.map.jinja' import allowed_states %}
|
{% from 'allowed_states.map.jinja' import allowed_states %}
|
||||||
{% if sls.split('.')[0] in allowed_states %}
|
{% if sls.split('.')[0] in allowed_states %}
|
||||||
{% from 'vars/globals.map.jinja' import GLOBALS %}
|
{% from 'vars/globals.map.jinja' import GLOBALS %}
|
||||||
{% from 'docker/docker.map.jinja' import DOCKER %}
|
{% from 'docker/docker.map.jinja' import DOCKERMERGED %}
|
||||||
{% from 'nginx/map.jinja' import NGINXMERGED %}
|
{% from 'nginx/map.jinja' import NGINXMERGED %}
|
||||||
|
|
||||||
include:
|
include:
|
||||||
@@ -37,11 +37,11 @@ so-nginx:
|
|||||||
- hostname: so-nginx
|
- hostname: so-nginx
|
||||||
- networks:
|
- networks:
|
||||||
- sobridge:
|
- sobridge:
|
||||||
- ipv4_address: {{ DOCKER.containers[container_config].ip }}
|
- ipv4_address: {{ DOCKERMERGED.containers[container_config].ip }}
|
||||||
- extra_hosts:
|
- extra_hosts:
|
||||||
- {{ GLOBALS.manager }}:{{ GLOBALS.manager_ip }}
|
- {{ GLOBALS.manager }}:{{ GLOBALS.manager_ip }}
|
||||||
{% if DOCKER.containers[container_config].extra_hosts %}
|
{% if DOCKERMERGED.containers[container_config].extra_hosts %}
|
||||||
{% for XTRAHOST in DOCKER.containers[container_config].extra_hosts %}
|
{% for XTRAHOST in DOCKERMERGED.containers[container_config].extra_hosts %}
|
||||||
- {{ XTRAHOST }}
|
- {{ XTRAHOST }}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
@@ -64,20 +64,26 @@ so-nginx:
|
|||||||
- /opt/so/rules/nids/suri:/surirules:ro
|
- /opt/so/rules/nids/suri:/surirules:ro
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if DOCKER.containers[container_config].custom_bind_mounts %}
|
{% if DOCKERMERGED.containers[container_config].custom_bind_mounts %}
|
||||||
{% for BIND in DOCKER.containers[container_config].custom_bind_mounts %}
|
{% for BIND in DOCKERMERGED.containers[container_config].custom_bind_mounts %}
|
||||||
- {{ BIND }}
|
- {{ BIND }}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if DOCKER.containers[container_config].extra_env %}
|
{% if DOCKERMERGED.containers[container_config].extra_env %}
|
||||||
- environment:
|
- environment:
|
||||||
{% for XTRAENV in DOCKER.containers[container_config].extra_env %}
|
{% for XTRAENV in DOCKERMERGED.containers[container_config].extra_env %}
|
||||||
- {{ XTRAENV }}
|
- {{ XTRAENV }}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
{% if DOCKERMERGED.containers[container_config].ulimits %}
|
||||||
|
- ulimits:
|
||||||
|
{% for ULIMIT in DOCKERMERGED.containers[container_config].ulimits %}
|
||||||
|
- {{ ULIMIT.name }}={{ ULIMIT.soft }}:{{ ULIMIT.hard }}
|
||||||
|
{% endfor %}
|
||||||
|
{% endif %}
|
||||||
- cap_add: NET_BIND_SERVICE
|
- cap_add: NET_BIND_SERVICE
|
||||||
- port_bindings:
|
- port_bindings:
|
||||||
{% for BINDING in DOCKER.containers[container_config].port_bindings %}
|
{% for BINDING in DOCKERMERGED.containers[container_config].port_bindings %}
|
||||||
- {{ BINDING }}
|
- {{ BINDING }}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
- watch:
|
- watch:
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
{%- from 'vars/globals.map.jinja' import GLOBALS %}
|
{%- from 'vars/globals.map.jinja' import GLOBALS %}
|
||||||
{%- from 'docker/docker.map.jinja' import DOCKER %}
|
{%- from 'docker/docker.map.jinja' import DOCKERMERGED %}
|
||||||
{%- from 'nginx/map.jinja' import NGINXMERGED %}
|
{%- from 'nginx/map.jinja' import NGINXMERGED %}
|
||||||
{%- set role = grains.id.split('_') | last %}
|
{%- set role = grains.id.split('_') | last %}
|
||||||
{%- set influxpass = salt['pillar.get']('secrets:influx_pass') %}
|
{%- set influxpass = salt['pillar.get']('secrets:influx_pass') %}
|
||||||
@@ -387,15 +387,13 @@ http {
|
|||||||
error_page 429 = @error429;
|
error_page 429 = @error429;
|
||||||
|
|
||||||
location @error401 {
|
location @error401 {
|
||||||
if ($request_uri ~* (^/connect/.*|^/oauth2/.*)) {
|
if ($request_uri ~* (^/api/.*|^/connect/.*|^/oauth2/.*)) {
|
||||||
return 401;
|
return 401;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($request_uri ~* ^/(?!(^/api/.*))) {
|
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains";
|
||||||
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains";
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($request_uri ~* ^/(?!(api/|login|auth|oauth2|$))) {
|
if ($request_uri ~* ^/(?!(login|auth|oauth2|$))) {
|
||||||
add_header Set-Cookie "AUTH_REDIRECT=$request_uri;Path=/;Max-Age=14400";
|
add_header Set-Cookie "AUTH_REDIRECT=$request_uri;Path=/;Max-Age=14400";
|
||||||
}
|
}
|
||||||
return 302 /auth/self-service/login/browser;
|
return 302 /auth/self-service/login/browser;
|
||||||
|
|||||||
@@ -2,7 +2,6 @@
|
|||||||
# or more contributor license agreements. Licensed under the Elastic License 2.0 as shown at
|
# or more contributor license agreements. Licensed under the Elastic License 2.0 as shown at
|
||||||
# https://securityonion.net/license; you may not use this file except in compliance with the
|
# https://securityonion.net/license; you may not use this file except in compliance with the
|
||||||
# Elastic License 2.0.
|
# Elastic License 2.0.
|
||||||
{% from 'vars/globals.map.jinja' import GLOBALS %}
|
|
||||||
{% from 'ntp/config.map.jinja' import NTPCONFIG %}
|
{% from 'ntp/config.map.jinja' import NTPCONFIG %}
|
||||||
|
|
||||||
chrony_pkg:
|
chrony_pkg:
|
||||||
@@ -17,11 +16,7 @@ chronyconf:
|
|||||||
- defaults:
|
- defaults:
|
||||||
NTPCONFIG: {{ NTPCONFIG }}
|
NTPCONFIG: {{ NTPCONFIG }}
|
||||||
|
|
||||||
{% if GLOBALS.os_family == 'RedHat' %}
|
|
||||||
chronyd:
|
chronyd:
|
||||||
{% else %}
|
|
||||||
chrony:
|
|
||||||
{% endif %}
|
|
||||||
service.running:
|
service.running:
|
||||||
- enable: True
|
- enable: True
|
||||||
- watch:
|
- watch:
|
||||||
|
|||||||
@@ -1,17 +0,0 @@
|
|||||||
[Unit]
|
|
||||||
Description=Podman API Service
|
|
||||||
Requires=podman.socket
|
|
||||||
After=podman.socket
|
|
||||||
Documentation=man:podman-api(1)
|
|
||||||
StartLimitIntervalSec=0
|
|
||||||
|
|
||||||
[Service]
|
|
||||||
Type=oneshot
|
|
||||||
Environment=REGISTRIES_CONFIG_PATH=/etc/containers/registries.conf
|
|
||||||
ExecStart=/usr/bin/podman system service
|
|
||||||
TimeoutStopSec=30
|
|
||||||
KillMode=process
|
|
||||||
|
|
||||||
[Install]
|
|
||||||
WantedBy=multi-user.target
|
|
||||||
Also=podman.socket
|
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
[Unit]
|
|
||||||
Description=Podman API Socket
|
|
||||||
Documentation=man:podman-api(1)
|
|
||||||
|
|
||||||
[Socket]
|
|
||||||
ListenStream=%t/podman/podman.sock
|
|
||||||
SocketMode=0660
|
|
||||||
|
|
||||||
[Install]
|
|
||||||
WantedBy=sockets.target
|
|
||||||
@@ -1,48 +0,0 @@
|
|||||||
{
|
|
||||||
"args": {
|
|
||||||
"podman_options": {
|
|
||||||
"isolate": "true",
|
|
||||||
"mtu": "1500"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"cniVersion": "0.4.0",
|
|
||||||
"name": "sobridge",
|
|
||||||
"plugins": [
|
|
||||||
{
|
|
||||||
"type": "bridge",
|
|
||||||
"bridge": "sobridge",
|
|
||||||
"isGateway": true,
|
|
||||||
"ipMasq": false,
|
|
||||||
"mtu": 1500,
|
|
||||||
"hairpinMode": false,
|
|
||||||
"ipam": {
|
|
||||||
"type": "host-local",
|
|
||||||
"routes": [
|
|
||||||
{
|
|
||||||
"dst": "0.0.0.0/0"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"ranges": [
|
|
||||||
[
|
|
||||||
{
|
|
||||||
"subnet": "172.17.1.0/24",
|
|
||||||
"gateway": "172.17.1.1"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"capabilities": {
|
|
||||||
"ips": true
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "portmap",
|
|
||||||
"capabilities": {
|
|
||||||
"portMappings": false
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "tuning"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
@@ -1,56 +0,0 @@
|
|||||||
{% from 'docker/docker.map.jinja' import DOCKER %}
|
|
||||||
|
|
||||||
Podman pkg:
|
|
||||||
pkg.installed:
|
|
||||||
- name: podman
|
|
||||||
|
|
||||||
cnipkg:
|
|
||||||
pkg.installed:
|
|
||||||
- name: containernetworking-plugins
|
|
||||||
|
|
||||||
{#
|
|
||||||
Podman service:
|
|
||||||
file.managed:
|
|
||||||
- name: /usr/lib/systemd/system/podman.service
|
|
||||||
- source: salt://podman/podman.service
|
|
||||||
#}
|
|
||||||
|
|
||||||
sobridgeconf:
|
|
||||||
file.managed:
|
|
||||||
- name: /etc/cni/net.d/sobridge.conflist
|
|
||||||
- source: salt://podman/files/sobridge.conflist
|
|
||||||
|
|
||||||
Podman_socket_service:
|
|
||||||
service.running:
|
|
||||||
- name: podman.socket
|
|
||||||
- enable: true
|
|
||||||
|
|
||||||
Podman_service:
|
|
||||||
service.running:
|
|
||||||
- name: podman.service
|
|
||||||
- enable: true
|
|
||||||
|
|
||||||
Docker socket:
|
|
||||||
file.symlink:
|
|
||||||
- name: /var/run/docker.sock
|
|
||||||
- target: /var/run/podman/podman.sock
|
|
||||||
|
|
||||||
podman_docker_symlink:
|
|
||||||
file.symlink:
|
|
||||||
- name: /usr/bin/docker
|
|
||||||
- target: /usr/bin/podman
|
|
||||||
|
|
||||||
{#
|
|
||||||
sos_docker_net:
|
|
||||||
docker_network.present:
|
|
||||||
- name: sobridge
|
|
||||||
- subnet: {{ DOCKER.range }}
|
|
||||||
- gateway: {{ DOCKER.bip }}
|
|
||||||
- options:
|
|
||||||
com.docker.network.bridge.name: 'sobridge'
|
|
||||||
com.docker.network.driver.mtu: '1500'
|
|
||||||
com.docker.network.bridge.enable_ip_masquerade: 'true'
|
|
||||||
com.docker.network.bridge.enable_icc: 'true'
|
|
||||||
com.docker.network.bridge.host_binding_ipv4: '0.0.0.0'
|
|
||||||
- unless: 'docker network ls | grep sobridge'
|
|
||||||
#}
|
|
||||||
@@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
{% from 'allowed_states.map.jinja' import allowed_states %}
|
{% from 'allowed_states.map.jinja' import allowed_states %}
|
||||||
{% if sls.split('.')[0] in allowed_states %}
|
{% if sls.split('.')[0] in allowed_states %}
|
||||||
{% from 'docker/docker.map.jinja' import DOCKER %}
|
{% from 'docker/docker.map.jinja' import DOCKERMERGED %}
|
||||||
{% from 'vars/globals.map.jinja' import GLOBALS %}
|
{% from 'vars/globals.map.jinja' import GLOBALS %}
|
||||||
|
|
||||||
include:
|
include:
|
||||||
@@ -21,9 +21,9 @@ so-redis:
|
|||||||
- user: socore
|
- user: socore
|
||||||
- networks:
|
- networks:
|
||||||
- sobridge:
|
- sobridge:
|
||||||
- ipv4_address: {{ DOCKER.containers['so-redis'].ip }}
|
- ipv4_address: {{ DOCKERMERGED.containers['so-redis'].ip }}
|
||||||
- port_bindings:
|
- port_bindings:
|
||||||
{% for BINDING in DOCKER.containers['so-redis'].port_bindings %}
|
{% for BINDING in DOCKERMERGED.containers['so-redis'].port_bindings %}
|
||||||
- {{ BINDING }}
|
- {{ BINDING }}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
- binds:
|
- binds:
|
||||||
@@ -34,23 +34,29 @@ so-redis:
|
|||||||
- /etc/pki/redis.crt:/certs/redis.crt:ro
|
- /etc/pki/redis.crt:/certs/redis.crt:ro
|
||||||
- /etc/pki/redis.key:/certs/redis.key:ro
|
- /etc/pki/redis.key:/certs/redis.key:ro
|
||||||
- /etc/pki/tls/certs/intca.crt:/certs/ca.crt:ro
|
- /etc/pki/tls/certs/intca.crt:/certs/ca.crt:ro
|
||||||
{% if DOCKER.containers['so-redis'].custom_bind_mounts %}
|
{% if DOCKERMERGED.containers['so-redis'].custom_bind_mounts %}
|
||||||
{% for BIND in DOCKER.containers['so-redis'].custom_bind_mounts %}
|
{% for BIND in DOCKERMERGED.containers['so-redis'].custom_bind_mounts %}
|
||||||
- {{ BIND }}
|
- {{ BIND }}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if DOCKER.containers['so-redis'].extra_hosts %}
|
{% if DOCKERMERGED.containers['so-redis'].extra_hosts %}
|
||||||
- extra_hosts:
|
- extra_hosts:
|
||||||
{% for XTRAHOST in DOCKER.containers['so-redis'].extra_hosts %}
|
{% for XTRAHOST in DOCKERMERGED.containers['so-redis'].extra_hosts %}
|
||||||
- {{ XTRAHOST }}
|
- {{ XTRAHOST }}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if DOCKER.containers['so-redis'].extra_env %}
|
{% if DOCKERMERGED.containers['so-redis'].extra_env %}
|
||||||
- environment:
|
- environment:
|
||||||
{% for XTRAENV in DOCKER.containers['so-redis'].extra_env %}
|
{% for XTRAENV in DOCKERMERGED.containers['so-redis'].extra_env %}
|
||||||
- {{ XTRAENV }}
|
- {{ XTRAENV }}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
{% if DOCKERMERGED.containers['so-redis'].ulimits %}
|
||||||
|
- ulimits:
|
||||||
|
{% for ULIMIT in DOCKERMERGED.containers['so-redis'].ulimits %}
|
||||||
|
- {{ ULIMIT.name }}={{ ULIMIT.soft }}:{{ ULIMIT.hard }}
|
||||||
|
{% endfor %}
|
||||||
|
{% endif %}
|
||||||
- entrypoint: "redis-server /usr/local/etc/redis/redis.conf"
|
- entrypoint: "redis-server /usr/local/etc/redis/redis.conf"
|
||||||
- watch:
|
- watch:
|
||||||
- file: trusttheca
|
- file: trusttheca
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
{% from 'allowed_states.map.jinja' import allowed_states %}
|
{% from 'allowed_states.map.jinja' import allowed_states %}
|
||||||
{% if sls.split('.')[0] in allowed_states %}
|
{% if sls.split('.')[0] in allowed_states %}
|
||||||
{% from 'vars/globals.map.jinja' import GLOBALS %}
|
{% from 'vars/globals.map.jinja' import GLOBALS %}
|
||||||
{% from 'docker/docker.map.jinja' import DOCKER %}
|
{% from 'docker/docker.map.jinja' import DOCKERMERGED %}
|
||||||
|
|
||||||
include:
|
include:
|
||||||
- registry.ssl
|
- registry.ssl
|
||||||
@@ -20,10 +20,10 @@ so-dockerregistry:
|
|||||||
- hostname: so-registry
|
- hostname: so-registry
|
||||||
- networks:
|
- networks:
|
||||||
- sobridge:
|
- sobridge:
|
||||||
- ipv4_address: {{ DOCKER.containers['so-dockerregistry'].ip }}
|
- ipv4_address: {{ DOCKERMERGED.containers['so-dockerregistry'].ip }}
|
||||||
- restart_policy: always
|
- restart_policy: always
|
||||||
- port_bindings:
|
- port_bindings:
|
||||||
{% for BINDING in DOCKER.containers['so-dockerregistry'].port_bindings %}
|
{% for BINDING in DOCKERMERGED.containers['so-dockerregistry'].port_bindings %}
|
||||||
- {{ BINDING }}
|
- {{ BINDING }}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
- binds:
|
- binds:
|
||||||
@@ -32,25 +32,31 @@ so-dockerregistry:
|
|||||||
- /nsm/docker-registry/docker:/var/lib/registry/docker:rw
|
- /nsm/docker-registry/docker:/var/lib/registry/docker:rw
|
||||||
- /etc/pki/registry.crt:/etc/pki/registry.crt:ro
|
- /etc/pki/registry.crt:/etc/pki/registry.crt:ro
|
||||||
- /etc/pki/registry.key:/etc/pki/registry.key:ro
|
- /etc/pki/registry.key:/etc/pki/registry.key:ro
|
||||||
{% if DOCKER.containers['so-dockerregistry'].custom_bind_mounts %}
|
{% if DOCKERMERGED.containers['so-dockerregistry'].custom_bind_mounts %}
|
||||||
{% for BIND in DOCKER.containers['so-dockerregistry'].custom_bind_mounts %}
|
{% for BIND in DOCKERMERGED.containers['so-dockerregistry'].custom_bind_mounts %}
|
||||||
- {{ BIND }}
|
- {{ BIND }}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if DOCKER.containers['so-dockerregistry'].extra_hosts %}
|
{% if DOCKERMERGED.containers['so-dockerregistry'].extra_hosts %}
|
||||||
- extra_hosts:
|
- extra_hosts:
|
||||||
{% for XTRAHOST in DOCKER.containers['so-dockerregistry'].extra_hosts %}
|
{% for XTRAHOST in DOCKERMERGED.containers['so-dockerregistry'].extra_hosts %}
|
||||||
- {{ XTRAHOST }}
|
- {{ XTRAHOST }}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
- client_timeout: 180
|
- client_timeout: 180
|
||||||
- environment:
|
- environment:
|
||||||
- HOME=/root
|
- HOME=/root
|
||||||
{% if DOCKER.containers['so-dockerregistry'].extra_env %}
|
{% if DOCKERMERGED.containers['so-dockerregistry'].extra_env %}
|
||||||
{% for XTRAENV in DOCKER.containers['so-dockerregistry'].extra_env %}
|
{% for XTRAENV in DOCKERMERGED.containers['so-dockerregistry'].extra_env %}
|
||||||
- {{ XTRAENV }}
|
- {{ XTRAENV }}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
{% if DOCKERMERGED.containers['so-dockerregistry'].ulimits %}
|
||||||
|
- ulimits:
|
||||||
|
{% for ULIMIT in DOCKERMERGED.containers['so-dockerregistry'].ulimits %}
|
||||||
|
- {{ ULIMIT.name }}={{ ULIMIT.soft }}:{{ ULIMIT.hard }}
|
||||||
|
{% endfor %}
|
||||||
|
{% endif %}
|
||||||
- retry:
|
- retry:
|
||||||
attempts: 5
|
attempts: 5
|
||||||
interval: 30
|
interval: 30
|
||||||
|
|||||||
@@ -1,43 +1,29 @@
|
|||||||
{% from 'vars/globals.map.jinja' import GLOBALS %}
|
{% set REPOPATH = '/etc/yum.repos.d/' %}
|
||||||
|
{% set ABSENTFILES = [
|
||||||
{% if GLOBALS.os_family == 'RedHat' %}
|
'centos-addons.repo',
|
||||||
{% set REPOPATH = '/etc/yum.repos.d/' %}
|
'centos-devel.repo',
|
||||||
{% if GLOBALS.os == 'OEL' %}
|
'centos-extras.repo',
|
||||||
{% set ABSENTFILES = [
|
'centos.repo',
|
||||||
'centos-addons.repo',
|
'docker-ce.repo',
|
||||||
'centos-devel.repo',
|
'epel.repo',
|
||||||
'centos-extras.repo',
|
'epel-testing.repo',
|
||||||
'centos.repo',
|
'saltstack.repo',
|
||||||
'docker-ce.repo',
|
'salt-latest.repo',
|
||||||
'epel.repo',
|
'wazuh.repo'
|
||||||
'epel-testing.repo',
|
'Rocky-Base.repo',
|
||||||
'saltstack.repo',
|
'Rocky-CR.repo',
|
||||||
'salt-latest.repo',
|
'Rocky-Debuginfo.repo',
|
||||||
'wazuh.repo'
|
'Rocky-fasttrack.repo',
|
||||||
'Rocky-Base.repo',
|
'Rocky-Media.repo',
|
||||||
'Rocky-CR.repo',
|
'Rocky-Sources.repo',
|
||||||
'Rocky-Debuginfo.repo',
|
'Rocky-Vault.repo',
|
||||||
'Rocky-fasttrack.repo',
|
'Rocky-x86_64-kernel.repo',
|
||||||
'Rocky-Media.repo',
|
'rocky-addons.repo',
|
||||||
'Rocky-Sources.repo',
|
'rocky-devel.repo',
|
||||||
'Rocky-Vault.repo',
|
'rocky-extras.repo',
|
||||||
'Rocky-x86_64-kernel.repo',
|
'rocky.repo',
|
||||||
'rocky-addons.repo',
|
'oracle-linux-ol9.repo',
|
||||||
'rocky-devel.repo',
|
'uek-ol9.repo',
|
||||||
'rocky-extras.repo',
|
'virt-ol9.repo'
|
||||||
'rocky.repo',
|
]
|
||||||
'oracle-linux-ol9.repo',
|
%}
|
||||||
'uek-ol9.repo',
|
|
||||||
'virt-ol9.repo'
|
|
||||||
]
|
|
||||||
%}
|
|
||||||
{% else %}
|
|
||||||
{% set ABSENTFILES = [] %}
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
{% else %}
|
|
||||||
|
|
||||||
{% set REPOPATH = '/etc/apt/sources.list.d/' %}
|
|
||||||
{% set ABSENTFILES = [] %}
|
|
||||||
|
|
||||||
{% endif %}
|
|
||||||
|
|||||||
@@ -29,7 +29,11 @@ sool9_{{host}}:
|
|||||||
hypervisor_host: {{host ~ "_" ~ role}}
|
hypervisor_host: {{host ~ "_" ~ role}}
|
||||||
preflight_cmds:
|
preflight_cmds:
|
||||||
- |
|
- |
|
||||||
tee -a /etc/hosts <<< "{{ MANAGERIP }} {{ MANAGERHOSTNAME }}"
|
{%- set hostnames = [MANAGERHOSTNAME] %}
|
||||||
|
{%- if not (URL_BASE | ipaddr) and URL_BASE != MANAGERHOSTNAME %}
|
||||||
|
{%- do hostnames.append(URL_BASE) %}
|
||||||
|
{%- endif %}
|
||||||
|
tee -a /etc/hosts <<< "{{ MANAGERIP }} {{ hostnames | join(' ') }}"
|
||||||
- |
|
- |
|
||||||
timeout 600 bash -c 'trap "echo \"Preflight Check: Failed to establish repo connectivity\"; exit 1" TERM; \
|
timeout 600 bash -c 'trap "echo \"Preflight Check: Failed to establish repo connectivity\"; exit 1" TERM; \
|
||||||
while ! dnf makecache --repoid=securityonion >/dev/null 2>&1; do echo "Preflight Check: Waiting for repo connectivity..."; \
|
while ! dnf makecache --repoid=securityonion >/dev/null 2>&1; do echo "Preflight Check: Waiting for repo connectivity..."; \
|
||||||
|
|||||||
@@ -14,6 +14,7 @@
|
|||||||
{% if 'vrt' in salt['pillar.get']('features', []) %}
|
{% if 'vrt' in salt['pillar.get']('features', []) %}
|
||||||
{% set HYPERVISORS = salt['pillar.get']('hypervisor:nodes', {} ) %}
|
{% set HYPERVISORS = salt['pillar.get']('hypervisor:nodes', {} ) %}
|
||||||
{% from 'salt/map.jinja' import SALTVERSION %}
|
{% from 'salt/map.jinja' import SALTVERSION %}
|
||||||
|
{% from 'vars/globals.map.jinja' import GLOBALS %}
|
||||||
|
|
||||||
{% if HYPERVISORS %}
|
{% if HYPERVISORS %}
|
||||||
cloud_providers:
|
cloud_providers:
|
||||||
@@ -34,6 +35,7 @@ cloud_profiles:
|
|||||||
MANAGERHOSTNAME: {{ grains.host }}
|
MANAGERHOSTNAME: {{ grains.host }}
|
||||||
MANAGERIP: {{ pillar.host.mainip }}
|
MANAGERIP: {{ pillar.host.mainip }}
|
||||||
SALTVERSION: {{ SALTVERSION }}
|
SALTVERSION: {{ SALTVERSION }}
|
||||||
|
URL_BASE: {{ GLOBALS.url_base }}
|
||||||
- template: jinja
|
- template: jinja
|
||||||
- makedirs: True
|
- makedirs: True
|
||||||
{% else %}
|
{% else %}
|
||||||
|
|||||||
@@ -805,11 +805,6 @@ def process_vm_creation(hypervisor_path: str, vm_config: dict) -> None:
|
|||||||
mark_invalid_hardware(hypervisor_path, vm_name, vm_config,
|
mark_invalid_hardware(hypervisor_path, vm_name, vm_config,
|
||||||
{'nsm_size': 'Invalid nsm_size: must be positive integer'})
|
{'nsm_size': 'Invalid nsm_size: must be positive integer'})
|
||||||
return
|
return
|
||||||
if size > 10000: # 10TB reasonable maximum
|
|
||||||
log.error("VM: %s - nsm_size %dGB exceeds reasonable maximum (10000GB)", vm_name, size)
|
|
||||||
mark_invalid_hardware(hypervisor_path, vm_name, vm_config,
|
|
||||||
{'nsm_size': f'Invalid nsm_size: {size}GB exceeds maximum (10000GB)'})
|
|
||||||
return
|
|
||||||
log.debug("VM: %s - nsm_size validated: %dGB", vm_name, size)
|
log.debug("VM: %s - nsm_size validated: %dGB", vm_name, size)
|
||||||
except (ValueError, TypeError) as e:
|
except (ValueError, TypeError) as e:
|
||||||
log.error("VM: %s - nsm_size must be a valid integer, got: %s", vm_name, vm_config.get('nsm_size'))
|
log.error("VM: %s - nsm_size must be a valid integer, got: %s", vm_name, vm_config.get('nsm_size'))
|
||||||
|
|||||||
@@ -1,10 +1,3 @@
|
|||||||
{% if grains.oscodename == 'focal' %}
|
|
||||||
saltpymodules:
|
|
||||||
pkg.installed:
|
|
||||||
- pkgs:
|
|
||||||
- python3-docker
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
# distribute to minions for salt upgrades
|
# distribute to minions for salt upgrades
|
||||||
salt_bootstrap:
|
salt_bootstrap:
|
||||||
file.managed:
|
file.managed:
|
||||||
|
|||||||
@@ -17,22 +17,12 @@
|
|||||||
{% set SALTVERSION = saltminion.salt.minion.version | string %}
|
{% set SALTVERSION = saltminion.salt.minion.version | string %}
|
||||||
{% set INSTALLEDSALTVERSION = grains.saltversion | string %}
|
{% set INSTALLEDSALTVERSION = grains.saltversion | string %}
|
||||||
|
|
||||||
{% if grains.os_family == 'Debian' %}
|
{% set SPLITCHAR = '-' %}
|
||||||
{% set SPLITCHAR = '+' %}
|
{% set SALTPACKAGES = ['salt', 'salt-master', 'salt-minion', 'salt-cloud'] %}
|
||||||
{% set SALTPACKAGES = ['salt-common', 'salt-master', 'salt-minion', 'salt-cloud'] %}
|
{% set SYSTEMD_UNIT_FILE = '/usr/lib/systemd/system/salt-minion.service' %}
|
||||||
{% set SYSTEMD_UNIT_FILE = '/lib/systemd/system/salt-minion.service' %}
|
|
||||||
{% else %}
|
|
||||||
{% set SPLITCHAR = '-' %}
|
|
||||||
{% set SALTPACKAGES = ['salt', 'salt-master', 'salt-minion', 'salt-cloud'] %}
|
|
||||||
{% set SYSTEMD_UNIT_FILE = '/usr/lib/systemd/system/salt-minion.service' %}
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
{% if INSTALLEDSALTVERSION != SALTVERSION %}
|
{% if INSTALLEDSALTVERSION != SALTVERSION %}
|
||||||
{% if grains.os_family|lower == 'redhat' %}
|
{% set UPGRADECOMMAND = 'yum clean all ; /usr/sbin/bootstrap-salt.sh -X -r -F stable ' ~ SALTVERSION %}
|
||||||
{% set UPGRADECOMMAND = 'yum clean all ; /usr/sbin/bootstrap-salt.sh -X -r -F stable ' ~ SALTVERSION %}
|
|
||||||
{% elif grains.os_family|lower == 'debian' %}
|
|
||||||
{% set UPGRADECOMMAND = '/usr/sbin/bootstrap-salt.sh -X -F stable ' ~ SALTVERSION %}
|
|
||||||
{% endif %}
|
|
||||||
{% else %}
|
{% else %}
|
||||||
{% set UPGRADECOMMAND = 'echo Already running Salt Minion version ' ~ SALTVERSION %}
|
{% set UPGRADECOMMAND = 'echo Already running Salt Minion version ' ~ SALTVERSION %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|||||||
@@ -23,15 +23,6 @@ sync_runners:
|
|||||||
- name: saltutil.sync_runners
|
- name: saltutil.sync_runners
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
# prior to 2.4.30 this engine ran on the manager with salt-minion
|
|
||||||
# this has changed to running with the salt-master in 2.4.30
|
|
||||||
remove_engines_config:
|
|
||||||
file.absent:
|
|
||||||
- name: /etc/salt/minion.d/engines.conf
|
|
||||||
- source: salt://salt/files/engines.conf
|
|
||||||
- watch_in:
|
|
||||||
- service: salt_minion_service
|
|
||||||
|
|
||||||
checkmine_engine:
|
checkmine_engine:
|
||||||
file.managed:
|
file.managed:
|
||||||
- name: /etc/salt/engines/checkmine.py
|
- name: /etc/salt/engines/checkmine.py
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
# Elastic License 2.0.
|
# Elastic License 2.0.
|
||||||
|
|
||||||
{% from 'vars/globals.map.jinja' import GLOBALS %}
|
{% from 'vars/globals.map.jinja' import GLOBALS %}
|
||||||
{% from 'docker/docker.map.jinja' import DOCKER %}
|
{% from 'docker/docker.map.jinja' import DOCKERMERGED %}
|
||||||
|
|
||||||
|
|
||||||
include:
|
include:
|
||||||
@@ -23,23 +23,29 @@ so-sensoroni:
|
|||||||
- /opt/so/conf/sensoroni/templates:/opt/sensoroni/templates:ro
|
- /opt/so/conf/sensoroni/templates:/opt/sensoroni/templates:ro
|
||||||
- /opt/so/log/sensoroni:/opt/sensoroni/logs:rw
|
- /opt/so/log/sensoroni:/opt/sensoroni/logs:rw
|
||||||
- /nsm/suripcap/:/nsm/suripcap:rw
|
- /nsm/suripcap/:/nsm/suripcap:rw
|
||||||
{% if DOCKER.containers['so-sensoroni'].custom_bind_mounts %}
|
{% if DOCKERMERGED.containers['so-sensoroni'].custom_bind_mounts %}
|
||||||
{% for BIND in DOCKER.containers['so-sensoroni'].custom_bind_mounts %}
|
{% for BIND in DOCKERMERGED.containers['so-sensoroni'].custom_bind_mounts %}
|
||||||
- {{ BIND }}
|
- {{ BIND }}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if DOCKER.containers['so-sensoroni'].extra_hosts %}
|
{% if DOCKERMERGED.containers['so-sensoroni'].extra_hosts %}
|
||||||
- extra_hosts:
|
- extra_hosts:
|
||||||
{% for XTRAHOST in DOCKER.containers['so-sensoroni'].extra_hosts %}
|
{% for XTRAHOST in DOCKERMERGED.containers['so-sensoroni'].extra_hosts %}
|
||||||
- {{ XTRAHOST }}
|
- {{ XTRAHOST }}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if DOCKER.containers['so-sensoroni'].extra_env %}
|
{% if DOCKERMERGED.containers['so-sensoroni'].extra_env %}
|
||||||
- environment:
|
- environment:
|
||||||
{% for XTRAENV in DOCKER.containers['so-sensoroni'].extra_env %}
|
{% for XTRAENV in DOCKERMERGED.containers['so-sensoroni'].extra_env %}
|
||||||
- {{ XTRAENV }}
|
- {{ XTRAENV }}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
{% if DOCKERMERGED.containers['so-sensoroni'].ulimits %}
|
||||||
|
- ulimits:
|
||||||
|
{% for ULIMIT in DOCKERMERGED.containers['so-sensoroni'].ulimits %}
|
||||||
|
- {{ ULIMIT.name }}={{ ULIMIT.soft }}:{{ ULIMIT.hard }}
|
||||||
|
{% endfor %}
|
||||||
|
{% endif %}
|
||||||
- watch:
|
- watch:
|
||||||
- file: /opt/so/conf/sensoroni/sensoroni.json
|
- file: /opt/so/conf/sensoroni/sensoroni.json
|
||||||
- require:
|
- require:
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user