Compare commits

..

103 Commits

Author SHA1 Message Date
Doug Burks
c8de36d467 Merge pull request #6646 from Security-Onion-Solutions/patch/2.3.91
Patch/2.3.91
2021-12-21 09:27:14 -05:00
doug
284e0e9108 fix hashes in VERIFY_ISO.md 2021-12-20 17:27:19 -05:00
doug
e66b023c9c update README.md for 2.3.91 2021-12-20 17:23:52 -05:00
doug
9f47522591 add sig for 2.3.91 ISO and update VERIFY_ISO.md 2021-12-20 17:21:53 -05:00
Jason Ertel
35617acaeb Update cacerts to reflect new path; this changed due to ES 7.16.2 2021-12-20 12:12:00 -05:00
Jason Ertel
6f116a2d01 Switch to new Ubuntu SSL dir 2021-12-20 09:43:59 -05:00
Jason Ertel
d6c651af1c Remove old patch dir from previously-patched installations 2021-12-20 09:42:27 -05:00
Jason Ertel
203e8a7873 Bump version to 2.3.91 2021-12-20 09:33:20 -05:00
Jason Ertel
b8fcec04b8 Remove patched jar due to upgrade of Elastic images to 7.16.2 2021-12-20 09:27:03 -05:00
Jason Ertel
6556a37869 Merge branch 'master' into patch/1.3.91 2021-12-20 09:20:03 -05:00
Jason Ertel
5af2bd8fa4 Upgrade to Elastic 7.16.2 2021-12-20 09:16:28 -05:00
Mike Reeves
85cf096322 Merge pull request #6541 from Security-Onion-Solutions/hotfix/2.3.90
Hotfix/2.3.90
2021-12-13 12:41:24 -05:00
Mike Reeves
4eaf3f8d8b Merge pull request #6540 from Security-Onion-Solutions/2390hotfix3
2.3.90-20211213 Hotfix
2021-12-13 12:12:03 -05:00
Mike Reeves
d90904b4d4 2.3.90-20211213 Hotfix 2021-12-13 12:09:09 -05:00
Mike Reeves
65cc9930e7 Merge pull request #6537 from Security-Onion-Solutions/TOoSmOotH-patch-1
Update HOTFIX
2021-12-13 11:13:40 -05:00
Mike Reeves
7f982d2824 Update HOTFIX 2021-12-13 11:12:18 -05:00
Mike Reeves
d3ac1f7994 Merge pull request #6533 from Security-Onion-Solutions/jertel/hotfix-20211213
Add missing logstash lib
2021-12-13 09:30:32 -05:00
Jason Ertel
c94d5fa9dc Strip JndiLookup.class from log4j-core jars, to match Elastic's mitigation approach 2021-12-13 09:27:13 -05:00
Mike Reeves
83d1cdad90 Merge pull request #6532 from Security-Onion-Solutions/jertel/hotfix-20211213
Strip JndiLookup.class from log4j-core jars, to match Elastic's mitigation approach
2021-12-13 09:05:30 -05:00
Jason Ertel
8365b5f140 Strip JndiLookup.class from log4j-core jars, to match Elastic's mitigation approach 2021-12-13 09:02:41 -05:00
Mike Reeves
4d6cd66d9d Merge pull request #6521 from Security-Onion-Solutions/hotfix/2.3.90
Hotfix/2.3.90
2021-12-10 16:20:29 -05:00
Mike Reeves
1946965c5f Merge pull request #6520 from Security-Onion-Solutions/2390hotfix0day
2.3.90-20211210 Hotfix
2021-12-10 15:49:38 -05:00
Mike Reeves
c9a14788ed 2.3.90-20211210 Hotfix 2021-12-10 15:42:53 -05:00
Mike Reeves
ce963a02d9 Merge pull request #6517 from Security-Onion-Solutions/ES0day2
Add JVM Options for logstash
2021-12-10 14:25:52 -05:00
Mike Reeves
dcd56de890 Update log4j2.properties 2021-12-10 14:23:38 -05:00
Mike Reeves
3d7b963912 Update log4j2.properties 2021-12-10 14:16:16 -05:00
Mike Reeves
09253b637e Create jvm.options 2021-12-10 14:12:43 -05:00
Mike Reeves
c81ce48bff Update log4j2.properties 2021-12-10 14:10:35 -05:00
Mike Reeves
73ec595baa Update init.sls 2021-12-10 14:10:05 -05:00
Mike Reeves
04862fcc06 Merge pull request #6514 from Security-Onion-Solutions/ES0day2
Throw the log4j into the java options
2021-12-10 12:04:31 -05:00
Mike Reeves
45346b6318 Update log4j2.properties 2021-12-10 12:01:39 -05:00
Mike Reeves
e48de18480 Update init.sls 2021-12-10 12:00:12 -05:00
Mike Reeves
66c8cc6e86 Update init.sls 2021-12-10 11:59:12 -05:00
Mike Reeves
8dcb64d87c Update init.sls 2021-12-10 11:56:33 -05:00
Mike Reeves
ae3e980852 Merge pull request #6513 from Security-Onion-Solutions/EShotfix
Update log4j2.properties
2021-12-10 10:35:43 -05:00
Mike Reeves
11f1fe7ab1 Update HOTFIX 2021-12-10 10:21:50 -05:00
Mike Reeves
4561e13871 Update log4j2.properties 2021-12-10 10:19:58 -05:00
Mike Reeves
ea26e402c8 Update log4j2.properties 2021-12-10 10:17:49 -05:00
Mike Reeves
9f41df641e Merge pull request #6470 from Security-Onion-Solutions/hotfix/2.3.90
HOTFIX: 2.3.90-20211206
2021-12-07 09:51:01 -05:00
Mike Reeves
9f94ecfab7 Merge pull request #6466 from Security-Onion-Solutions/2390updates3
2.3.90 hotfix 20211206
2021-12-06 11:07:14 -05:00
Mike Reeves
4188282724 2.3.90 hotfix 20211206 2021-12-06 11:03:49 -05:00
Mike Reeves
3945933dec Merge pull request #6446 from Security-Onion-Solutions/TOoSmOotH-patch-4
Update HOTFIX
2021-12-06 09:38:02 -05:00
Mike Reeves
73a1a3878f Update HOTFIX 2021-12-06 09:37:07 -05:00
weslambert
ff25d6f80b Merge pull request #6447 from Security-Onion-Solutions/eg_dashes
Add initial EG dashboards
2021-12-03 18:05:22 -05:00
Wes Lambert
0571612ea1 Add initial EG dashes 2021-12-03 22:38:30 +00:00
Mike Reeves
f697d88090 Update HOTFIX 2021-12-03 15:36:16 -05:00
Mike Reeves
ad03241910 Merge pull request #6445 from Security-Onion-Solutions/TOoSmOotH-patch-3
Apply hotfix to all 2.3.90 installs
2021-12-03 15:24:33 -05:00
Mike Reeves
f82d204c0e Update soup 2021-12-03 15:20:33 -05:00
Mike Reeves
780daf8aa7 Apply hotfix to all 2.3.90 installs 2021-12-03 15:15:45 -05:00
Josh Patterson
5008b647b0 Merge pull request #6441 from Security-Onion-Solutions/hf/soc_append2.3.90
export LC_CTYPE="en_US.UTF-8" in soup
2021-12-03 15:10:12 -05:00
m0duspwnens
65b1ab833d run salt-call locally as if no Salt master were present during reinstall - https://github.com/Security-Onion-Solutions/securityonion/discussions/6435 2021-12-03 12:00:29 -05:00
m0duspwnens
c6773a0bbc move "Preparing soup" to main so shows in soup.log 2021-12-03 10:26:22 -05:00
m0duspwnens
ff2d2c7c04 export LC_CTYPE="en_US.UTF-8" - https://github.com/Security-Onion-Solutions/securityonion/discussions/6431 2021-12-02 16:39:32 -05:00
Mike Reeves
6c7a1f23f5 Merge pull request #6440 from Security-Onion-Solutions/TOoSmOotH-patch-2
Fix for the clustername used in wrong context
2021-12-02 15:35:26 -05:00
Mike Reeves
f5761c73a5 Fix for the clustername used in wrong context 2021-12-02 15:30:35 -05:00
Mike Reeves
8448778ecd Merge pull request #6438 from Security-Onion-Solutions/hf/soc_append2.3.90
hf/soc append2.3.90
2021-12-02 15:10:51 -05:00
m0duspwnens
8d667795a7 only add soc:es_index_patterns to pillar if not already present 2021-12-02 10:28:17 -05:00
m0duspwnens
7a664ab8f7 more error proof up_to_2.3.90 function 2021-12-02 10:02:26 -05:00
m0duspwnens
5e0ac89841 merge with master 2021-12-01 14:27:58 -05:00
Mike Reeves
8990a09d92 Merge pull request #6418 from Security-Onion-Solutions/hotfix/2.3.90
Hotfix/2.3.90
2021-12-01 13:24:19 -05:00
Mike Reeves
946673dc3b Merge pull request #6417 from Security-Onion-Solutions/2390updates2
2.3.90 hotfix airgap
2021-12-01 13:20:41 -05:00
m0duspwnens
c571b2c499 handle redirect if more than 1 match from compgen 2021-12-01 13:17:14 -05:00
Mike Reeves
80c569317f 2.3.90 hotfix airgap 2021-12-01 13:16:13 -05:00
Mike Reeves
5f121f3b99 Merge pull request #6411 from Security-Onion-Solutions/m0duspwnens-patch-1/hotfix/2.3.90
remove redirect to /dev/null for compgen
2021-12-01 10:17:29 -05:00
Josh Patterson
63cb486698 remove redirect to /dev/null for compgen 2021-12-01 10:16:04 -05:00
William Wernert
1a31e60e47 Merge pull request #6402 from Security-Onion-Solutions/fix/airgap-check
Fix/airgap check
2021-11-30 15:57:02 -05:00
William Wernert
168f860c87 Add hotfix string to HOTFIX 2021-11-30 15:49:41 -05:00
William Wernert
8d87fae6a8 Remove airgap repo file if it shouldn't exist 2021-11-30 15:46:22 -05:00
William Wernert
739efc22d2 Fix airgap check logic 2021-11-30 15:46:18 -05:00
Mike Reeves
4c6786a412 Merge pull request #6335 from Security-Onion-Solutions/hotfix/2.3.90
Hotfix/2.3.90
2021-11-23 16:51:27 -05:00
Mike Reeves
5062e910e2 Merge pull request #6334 from Security-Onion-Solutions/2390updates
2.3.90 hotfix soup
2021-11-23 15:41:21 -05:00
Mike Reeves
1f9dc0db1f 2.3.90 hotfix soup 2021-11-23 15:40:04 -05:00
Mike Reeves
c536e11383 2.3.90 hotfix soup 2021-11-23 15:32:41 -05:00
Mike Reeves
faa8464b60 Merge pull request #6333 from Security-Onion-Solutions/kilo
Correct if check to inline the command instead of checking for emptin…
2021-11-23 14:53:24 -05:00
Jason Ertel
4f283c2d86 Suppres grep output 2021-11-23 14:52:40 -05:00
Jason Ertel
801d42ed20 Correct if check to inline the command instead of checking for emptiness of a variable 2021-11-23 14:51:06 -05:00
Mike Reeves
30a1ffc1c7 Merge pull request #6329 from Security-Onion-Solutions/kilo
2.3.90 WAZUH
2021-11-23 13:37:41 -05:00
Jason Ertel
59fc122eec Force restart of wazuh since conf file is changing 2021-11-23 13:29:04 -05:00
Jason Ertel
52ffa27eda Update hotfix file 2021-11-23 13:22:47 -05:00
Jason Ertel
bd59d65f02 Strip trailing newlines from version and hotfix files 2021-11-23 13:12:27 -05:00
Jason Ertel
01ceded223 Handle CRs in hotfix 2021-11-23 13:03:40 -05:00
Jason Ertel
3c37bd61ab Add debug logging 2021-11-23 12:46:59 -05:00
Jason Ertel
a35670c889 Merge branch 'hotfix/1.3.90' into kilo 2021-11-23 12:38:57 -05:00
Jason Ertel
7627d37386 Add 2.3.90 WAZUH hotfix corrective function 2021-11-23 12:21:28 -05:00
Jason Ertel
273842eb43 Merge pull request #6328 from Security-Onion-Solutions/kilo
WAZUH hotfix
2021-11-23 12:06:34 -05:00
Jason Ertel
0dd251e2a9 Fix typo in whiptail prompt 2021-11-23 11:19:53 -05:00
Josh Patterson
c67b2b6936 Update soup
only check if salt was upgraded if upgrade_salt function was called
2021-11-23 11:14:10 -05:00
Jason Ertel
af4c04be59 Fix #6325 - Prevent XML header from outputting to ossec.conf 2021-11-23 10:57:21 -05:00
Jason Ertel
4672b0c15c Fix #6317 - Do not attempt to whitelist when wazuh isn't enabled 2021-11-23 10:06:14 -05:00
Jason Ertel
9737a4088c Merge pull request #6327 from Security-Onion-Solutions/TOoSmOotH-patch-1
Update HOTFIX
2021-11-23 09:25:43 -05:00
Mike Reeves
d8d429c71a Update HOTFIX 2021-11-23 09:19:41 -05:00
Mike Reeves
3bfc3b8943 Merge pull request #6301 from Security-Onion-Solutions/dev
2.3.90
2021-11-22 13:15:23 -05:00
Mike Reeves
4ad6d616ae Merge pull request #6313 from Security-Onion-Solutions/2390update
2390update
2021-11-22 09:04:16 -05:00
Mike Reeves
759c0b858a 2.3.90 2021-11-22 09:01:12 -05:00
Mike Reeves
c17a49a730 Merge pull request #6302 from Security-Onion-Solutions/fix/md5soup
Fix/md5soup
2021-11-19 16:45:02 -05:00
m0duspwnens
c0f183fb5e add comment 2021-11-19 16:37:27 -05:00
m0duspwnens
d602339c45 render and md5sum soup and so-common 2021-11-19 16:32:59 -05:00
Mike Reeves
0122e62920 Merge pull request #6300 from Security-Onion-Solutions/2390
2.3.90
2021-11-19 14:09:02 -05:00
Mike Reeves
1634105780 2.3.90 2021-11-19 14:07:03 -05:00
Josh Patterson
198a690ba1 Merge pull request #6298 from Security-Onion-Solutions/fix/soup-script-check
Check soup in /usr/sbin rather than the saltstack default dir
2021-11-19 11:24:48 -05:00
William Wernert
bebd62187d Check soup in /usr/sbin rather than the saltstack default dir 2021-11-19 11:23:32 -05:00
Mike Reeves
a91564605c Merge pull request #6297 from Security-Onion-Solutions/fix/soup-playbook-secrets
Fix indent on playbook_admin and playbook_automation secrets
2021-11-19 10:28:11 -05:00
William Wernert
23b91ee7e5 Fix indent on playbook_admin and playbook_automation secrets 2021-11-19 10:27:11 -05:00
32 changed files with 127 additions and 280 deletions

1
HOTFIX
View File

@@ -0,0 +1 @@

View File

@@ -1,6 +1,6 @@
## Security Onion 2.3.80
## Security Onion 2.3.91
Security Onion 2.3.80 is here!
Security Onion 2.3.91 is here!
## Screenshots

View File

@@ -1,18 +1,18 @@
### 2.3.80 ISO image built on 2021/09/27
### 2.3.91 ISO image built on 2021/12/20
### Download and Verify
2.3.80 ISO image:
https://download.securityonion.net/file/securityonion/securityonion-2.3.80.iso
2.3.91 ISO image:
https://download.securityonion.net/file/securityonion/securityonion-2.3.91.iso
MD5: 24F38563860416F4A8ABE18746913E14
SHA1: F923C005F54EA2A17AB225ADA0DA46042707AAD9
SHA256: 8E95D10AF664D9A406C168EC421D943CB23F0D0C1813C6C2DBA9B4E131984018
MD5: CD979038EC60318B7C7F8BA278A12D04
SHA1: 9FB2AC07FCD24A4993B3F61FC2B2863510650520
SHA256: BAA8BEF574ECCB9ADC326D736A00C00AAF940FC6AD68CF491FF1F0AB6C5BAA64
Signature for ISO image:
https://github.com/Security-Onion-Solutions/securityonion/raw/master/sigs/securityonion-2.3.80.iso.sig
https://github.com/Security-Onion-Solutions/securityonion/raw/master/sigs/securityonion-2.3.91.iso.sig
Signing key:
https://raw.githubusercontent.com/Security-Onion-Solutions/securityonion/master/KEYS
@@ -26,22 +26,22 @@ wget https://raw.githubusercontent.com/Security-Onion-Solutions/securityonion/ma
Download the signature file for the ISO:
```
wget https://github.com/Security-Onion-Solutions/securityonion/raw/master/sigs/securityonion-2.3.80.iso.sig
wget https://github.com/Security-Onion-Solutions/securityonion/raw/master/sigs/securityonion-2.3.91.iso.sig
```
Download the ISO image:
```
wget https://download.securityonion.net/file/securityonion/securityonion-2.3.80.iso
wget https://download.securityonion.net/file/securityonion/securityonion-2.3.91.iso
```
Verify the downloaded ISO image using the signature file:
```
gpg --verify securityonion-2.3.80.iso.sig securityonion-2.3.80.iso
gpg --verify securityonion-2.3.91.iso.sig securityonion-2.3.91.iso
```
The output should show "Good signature" and the Primary key fingerprint should match what's shown below:
```
gpg: Signature made Mon 27 Sep 2021 08:55:01 AM EDT using RSA key ID FE507013
gpg: Signature made Mon 20 Dec 2021 12:37:42 PM EST using RSA key ID FE507013
gpg: Good signature from "Security Onion Solutions, LLC <info@securityonionsolutions.com>"
gpg: WARNING: This key is not certified with a trusted signature!
gpg: There is no indication that the signature belongs to the owner.

View File

@@ -1 +1 @@
2.3.90
2.3.91

View File

@@ -2,7 +2,6 @@ base:
'*':
- patch.needs_restarting
- logrotate
- users
'*_eval or *_helixsensor or *_heavynode or *_sensor or *_standalone or *_import':
- match: compound

View File

@@ -1,2 +0,0 @@
# users pillar goes in /opt/so/saltstack/local/pillar/users/init.sls
# the users directory may need to be created under /opt/so/saltstack/local/pillar

View File

@@ -1,19 +0,0 @@
users:
sclapton:
# required fields
status: present
# node_access determines which node types the user can access.
# this can either be by grains.role or by final part of the minion id after the _
node_access:
- standalone
- searchnode
# optional fields
fullname: Stevie Claptoon
uid: 1001
gid: 1001
homephone: does not have a phone
groups:
- mygroup1
- mygroup2
- wheel # give sudo access

View File

@@ -1,20 +0,0 @@
users:
sclapton:
# required fields
status: <present | absent>
# node_access determines which node types the user can access.
# this can either be by grains.role or by final part of the minion id after the _
node_access:
- standalone
- searchnode
# optional fields
fullname: <string>
uid: <integer>
gid: <integer>
roomnumber: <string>
workphone: <string>
homephone: <string>
groups:
- <string>
- <string>
- wheel # give sudo access

View File

@@ -23,7 +23,6 @@ import sys
import argparse
import re
from lxml import etree as ET
from xml.dom import minidom
from datetime import datetime as dt
from datetime import timezone as tz
@@ -79,20 +78,15 @@ def ip_prompt() -> str:
def wazuh_enabled() -> bool:
for file in os.listdir(f'{LOCAL_SALT_DIR}/pillar'):
with open(file, 'r') as pillar:
if 'wazuh: 1' in pillar.read():
return True
file = f'{LOCAL_SALT_DIR}/pillar/global.sls'
with open(file, 'r') as pillar:
if 'wazuh: 1' in pillar.read():
return True
return False
def root_to_str(root: ET.ElementTree) -> str:
xml_str = ET.tostring(root, encoding='unicode', method='xml').replace('\n', '')
xml_str = re.sub(r'(?:(?<=>) *)', '', xml_str)
xml_str = re.sub(r' -', '', xml_str)
xml_str = re.sub(r' -->', ' -->', xml_str)
dom = minidom.parseString(xml_str)
return dom.toprettyxml(indent=" ")
return ET.tostring(root, encoding='unicode', method='xml', xml_declaration=False, pretty_print=True)
def add_wl(ip):
@@ -124,7 +118,7 @@ def apply(role: str, ip: str) -> int:
else:
return cmd.returncode
if cmd.returncode == 0:
if wazuh_enabled and role=='analyst':
if wazuh_enabled() and role=='analyst':
try:
add_wl(ip)
print(f'Added whitelist entry for {ip} from {WAZUH_CONF}', file=sys.stderr)

View File

@@ -16,6 +16,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
. /usr/sbin/so-common
export LC_CTYPE="en_US.UTF-8"
UPDATE_DIR=/tmp/sogh/securityonion
DEFAULT_SALT_DIR=/opt/so/saltstack/default
@@ -599,18 +600,33 @@ up_to_2.3.80() {
up_to_2.3.90() {
for i in manager managersearch eval standalone; do
if compgen -G "/opt/so/saltstack/local/pillar/minions/*_$i.sls" > /dev/null; then
echo "soc:" >> /opt/so/saltstack/local/pillar/minions/*_$i.sls
sed -i "/^soc:/a \\ es_index_patterns: '*:so-*,*:endgame-*'" /opt/so/saltstack/local/pillar/minions/*_$i.sls
echo "Checking for compgen match of /opt/so/saltstack/local/pillar/minions/*_$i.sls"
if compgen -G "/opt/so/saltstack/local/pillar/minions/*_$i.sls"; then
echo "Found compgen match for /opt/so/saltstack/local/pillar/minions/*_$i.sls"
for f in $(compgen -G "/opt/so/saltstack/local/pillar/minions/*_$i.sls"); do
if grep -qozP "^soc:\n.*es_index_patterns: '\*:so-\*,\*:endgame-\*'" "$f"; then
echo "soc:es_index_patterns already present in $f"
else
echo "Appending soc pillar data to $f"
echo "soc:" >> "$f"
sed -i "/^soc:/a \\ es_index_patterns: '*:so-*,*:endgame-*'" "$f"
fi
done
fi
done
# Create Endgame Hostgroup
so-firewall addhostgroup endgame
echo "Adding endgame hostgroup with so-firewall"
if so-firewall addhostgroup endgame 2>&1 | grep -q 'Already exists'; then
echo 'endgame hostgroup already exists'
else
echo 'endgame hostgroup added'
fi
# Force influx to generate a new cert
mv /etc/pki/influxdb.crt /etc/pki/influxdb.crt.2390upgrade
mv /etc/pki/influxdb.key /etc/pki/influxdb.key.2390upgrade
echo "Moving influxdb.crt and influxdb.key to generate new certs"
mv -vf /etc/pki/influxdb.crt /etc/pki/influxdb.crt.2390upgrade
mv -vf /etc/pki/influxdb.key /etc/pki/influxdb.key.2390upgrade
# remove old common ingest pipeline in default
rm -vf /opt/so/saltstack/default/salt/elasticsearch/files/ingest/common
@@ -635,6 +651,8 @@ up_to_2.3.90() {
>> /opt/so/saltstack/local/pillar/secrets.sls
fi
sed -i -re 's/^(playbook_admin.*|playbook_automation.*)/ \1/g' /opt/so/saltstack/local/pillar/secrets.sls
INSTALLEDVERSION=2.3.90
}
@@ -807,16 +825,22 @@ upgrade_to_2.3.50_repo() {
}
verify_latest_update_script() {
#we need to render soup and so-common first since they contain jinja
salt-call slsutil.renderer $UPDATE_DIR/salt/common/tools/sbin/soup default_renderer='jinja' --local --out=newline_values_only --out-indent=-4 --out-file=/tmp/soup
sed -i -e '$a\' /tmp/soup
salt-call slsutil.renderer $UPDATE_DIR/salt/common/tools/sbin/so-common default_renderer='jinja' --local --out=newline_values_only --out-indent=-4 --out-file=/tmp/so-common
sed -i -e '$a\' /tmp/so-common
# Check to see if the update scripts match. If not run the new one.
CURRENTSOUP=$(md5sum /opt/so/saltstack/default/salt/common/tools/sbin/soup | awk '{print $1}')
GITSOUP=$(md5sum $UPDATE_DIR/salt/common/tools/sbin/soup | awk '{print $1}')
CURRENTCMN=$(md5sum /opt/so/saltstack/default/salt/common/tools/sbin/so-common | awk '{print $1}')
GITCMN=$(md5sum $UPDATE_DIR/salt/common/tools/sbin/so-common | awk '{print $1}')
CURRENTIMGCMN=$(md5sum /opt/so/saltstack/default/salt/common/tools/sbin/so-image-common | awk '{print $1}')
CURRENTSOUP=$(md5sum /usr/sbin/soup | awk '{print $1}')
GITSOUP=$(md5sum /tmp/soup | awk '{print $1}')
CURRENTCMN=$(md5sum /usr/sbin/so-common | awk '{print $1}')
GITCMN=$(md5sum /tmp/so-common | awk '{print $1}')
CURRENTIMGCMN=$(md5sum /usr/sbin/so-image-common | awk '{print $1}')
GITIMGCMN=$(md5sum $UPDATE_DIR/salt/common/tools/sbin/so-image-common | awk '{print $1}')
if [[ "$CURRENTSOUP" == "$GITSOUP" && "$CURRENTCMN" == "$GITCMN" && "$CURRENTIMGCMN" == "$GITIMGCMN" ]]; then
echo "This version of the soup script is up to date. Proceeding."
rm -f /tmp/soup /tmp/so-common
else
echo "You are not running the latest soup version. Updating soup and its components. Might take multiple runs to complete"
cp $UPDATE_DIR/salt/common/tools/sbin/soup $DEFAULT_SALT_DIR/salt/common/tools/sbin/
@@ -829,9 +853,27 @@ verify_latest_update_script() {
fi
}
apply_hotfix() {
if [[ "$INSTALLEDVERSION" == "2.3.90" ]] ; then
FILE="/nsm/wazuh/etc/ossec.conf"
echo "Detecting if ossec.conf needs corrected..."
if head -1 $FILE | grep -q "xml version"; then
echo "$FILE has an XML header; removing"
sed -i 1d $FILE
so-wazuh-restart
else
echo "$FILE does not have an XML header, so no changes are necessary."
fi
else
echo "No actions required. ($INSTALLEDVERSION/$HOTFIXVERSION)"
fi
}
main() {
trap 'check_err $?' EXIT
echo "### Preparing soup at $(date) ###"
check_pillar_items
echo "Checking to see if this is an airgap install."
@@ -883,9 +925,10 @@ main() {
set -e
if [ "$is_hotfix" == "true" ]; then
echo "Applying $HOTFIXVERSION"
echo "Applying $HOTFIXVERSION hotfix"
copy_new_files
echo ""
apply_hotfix
echo "Hotfix applied"
update_version
salt-call state.highstate -l info queue=True
else
@@ -925,21 +968,21 @@ main() {
echo "Upgrading Salt"
# Update the repo files so it can actually upgrade
upgrade_salt
fi
echo "Checking if Salt was upgraded."
echo ""
# Check that Salt was upgraded
SALTVERSIONPOSTUPGRADE=$(salt --versions-report | grep Salt: | awk '{print $2}')
if [[ "$SALTVERSIONPOSTUPGRADE" != "$NEWSALTVERSION" ]]; then
echo "Salt upgrade failed. Check of indicators of failure in $SOUP_LOG."
echo "Once the issue is resolved, run soup again."
echo "Exiting."
echo ""
exit 0
else
echo "Salt upgrade success."
echo "Checking if Salt was upgraded."
echo ""
# Check that Salt was upgraded
SALTVERSIONPOSTUPGRADE=$(salt --versions-report | grep Salt: | awk '{print $2}')
if [[ "$SALTVERSIONPOSTUPGRADE" != "$NEWSALTVERSION" ]]; then
echo "Salt upgrade failed. Check of indicators of failure in $SOUP_LOG."
echo "Once the issue is resolved, run soup again."
echo "Exiting."
echo ""
exit 0
else
echo "Salt upgrade success."
echo ""
fi
fi
preupgrade_changes
@@ -1142,6 +1185,4 @@ EOF
read -r input
fi
echo "### Preparing soup at $(date) ###"
main "$@" | tee -a $SOUP_LOG

View File

@@ -24,9 +24,9 @@ set -e
# Check to see if we have extracted the ca cert.
if [ ! -f /opt/so/saltstack/local/salt/common/cacerts ]; then
docker run -v /etc/pki/ca.crt:/etc/pki/ca.crt --name so-elasticsearchca --user root --entrypoint jdk/bin/keytool {{ MANAGER }}:5000/{{ IMAGEREPO }}/so-elasticsearch:{{ VERSION }} -keystore /etc/pki/ca-trust/extracted/java/cacerts -alias SOSCA -import -file /etc/pki/ca.crt -storepass changeit -noprompt
docker cp so-elasticsearchca:/etc/pki/ca-trust/extracted/java/cacerts /opt/so/saltstack/local/salt/common/cacerts
docker cp so-elasticsearchca:/etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem /opt/so/saltstack/local/salt/common/tls-ca-bundle.pem
docker run -v /etc/pki/ca.crt:/etc/ssl/ca.crt --name so-elasticsearchca --user root --entrypoint jdk/bin/keytool {{ MANAGER }}:5000/{{ IMAGEREPO }}/so-elasticsearch:{{ VERSION }} -keystore /usr/share/elasticsearch/jdk/lib/security/cacerts -alias SOSCA -import -file /etc/ssl/ca.crt -storepass changeit -noprompt
docker cp so-elasticsearchca:/usr/share/elasticsearch/jdk/lib/security/cacerts /opt/so/saltstack/local/salt/common/cacerts
docker cp so-elasticsearchca:/etc/ssl/certs/ca-certificates.crt /opt/so/saltstack/local/salt/common/tls-ca-bundle.pem
docker rm so-elasticsearchca
echo "" >> /opt/so/saltstack/local/salt/common/tls-ca-bundle.pem
echo "sosca" >> /opt/so/saltstack/local/salt/common/tls-ca-bundle.pem

View File

@@ -131,6 +131,10 @@ esrolesdir:
- group: 939
- makedirs: True
eslibdir:
file.absent:
- name: /opt/so/conf/elasticsearch/lib
esingestdynamicconf:
file.recurse:
- name: /opt/so/conf/elasticsearch/ingest
@@ -258,7 +262,7 @@ so-elasticsearch:
{% if TRUECLUSTER is sameas false or (TRUECLUSTER is sameas true and not salt['pillar.get']('nodestab', {})) %}
- discovery.type=single-node
{% endif %}
- ES_JAVA_OPTS=-Xms{{ esheap }} -Xmx{{ esheap }} -Des.transport.cname_in_publish_address=true
- ES_JAVA_OPTS=-Xms{{ esheap }} -Xmx{{ esheap }} -Des.transport.cname_in_publish_address=true -Dlog4j2.formatMsgNoLookups=true
ulimits:
- memlock=-1:-1
- nofile=65536:65536
@@ -271,7 +275,7 @@ so-elasticsearch:
- /opt/so/conf/elasticsearch/log4j2.properties:/usr/share/elasticsearch/config/log4j2.properties:ro
- /nsm/elasticsearch:/usr/share/elasticsearch/data:rw
- /opt/so/log/elasticsearch:/var/log/elasticsearch:rw
- /opt/so/conf/ca/cacerts:/etc/pki/ca-trust/extracted/java/cacerts:ro
- /opt/so/conf/ca/cacerts:/usr/share/elasticsearch/jdk/lib/security/cacerts:ro
{% if ismanager %}
- /etc/pki/ca.crt:/usr/share/elasticsearch/config/ca.crt:ro
{% else %}
@@ -327,7 +331,7 @@ so-elasticsearch-pipelines-file:
so-elasticsearch-pipelines:
cmd.run:
- name: /opt/so/conf/elasticsearch/so-elasticsearch-pipelines {{ esclustername }}
- name: /opt/so/conf/elasticsearch/so-elasticsearch-pipelines {{ grains.host }}
- onchanges:
- file: esingestconf
- file: esingestdynamicconf

View File

@@ -35,7 +35,7 @@ update() {
wait_for_web_response "http://localhost:5601/app/kibana" "Elastic" 300 "{{ ELASTICCURL }}"
IFS=$'\r\n' GLOBIGNORE='*' command eval 'LINES=($(cat $1))'
for i in "${LINES[@]}"; do
{{ ELASTICCURL }} -X PUT "localhost:5601/api/saved_objects/config/7.15.2" -H 'kbn-xsrf: true' -H 'Content-Type: application/json' -d " $i "
{{ ELASTICCURL }} -X PUT "localhost:5601/api/saved_objects/config/7.16.2" -H 'kbn-xsrf: true' -H 'Content-Type: application/json' -d " $i "
done
}

View File

@@ -1 +1 @@
{"attributes": {"buildNum": 39457,"defaultIndex": "2289a0c0-6970-11ea-a0cd-ffa0f6a1bc29","defaultRoute": "/app/dashboards#/view/a8411b30-6d03-11ea-b301-3d6c35840645","discover:sampleSize": 100,"theme:darkMode": true,"timepicker:timeDefaults": "{\n \"from\": \"now-24h\",\n \"to\": \"now\"\n}"},"coreMigrationVersion": "7.15.2","id": "7.15.2","migrationVersion": {"config": "7.13.0"},"references": [],"type": "config","updated_at": "2021-10-10T10:10:10.105Z","version": "WzI5NzUsMl0="}
{"attributes": {"buildNum": 39457,"defaultIndex": "2289a0c0-6970-11ea-a0cd-ffa0f6a1bc29","defaultRoute": "/app/dashboards#/view/a8411b30-6d03-11ea-b301-3d6c35840645","discover:sampleSize": 100,"theme:darkMode": true,"timepicker:timeDefaults": "{\n \"from\": \"now-24h\",\n \"to\": \"now\"\n}"},"coreMigrationVersion": "7.16.2","id": "7.16.2","migrationVersion": {"config": "7.13.0"},"references": [],"type": "config","updated_at": "2021-10-10T10:10:10.105Z","version": "WzI5NzUsMl0="}

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1 @@
-Dlog4j2.formatMsgNoLookups=true

View File

@@ -61,6 +61,10 @@ logstash:
- gid: 931
- home: /opt/so/conf/logstash
lslibdir:
file.absent:
- name: /opt/so/conf/logstash/lib
lsetcdir:
file.directory:
- name: /opt/so/conf/logstash/etc

View File

@@ -65,6 +65,10 @@ yumconf:
- mode: 644
- template: jinja
- show_changes: False
cleanairgap:
file.absent:
- name: /etc/yum.repos.d/airgap_repo.repo
{% endif %}
cleanyum:

View File

@@ -95,7 +95,7 @@ so-thehive-es:
- /opt/so/conf/thehive/etc/es/log4j2.properties:/usr/share/elasticsearch/config/log4j2.properties:ro
- /opt/so/log/thehive:/var/log/elasticsearch:rw
- environment:
- ES_JAVA_OPTS=-Xms512m -Xmx512m
- ES_JAVA_OPTS=-Xms512m -Xmx512m -Dlog4j2.formatMsgNoLookups=true
- port_bindings:
- 0.0.0.0:9400:9400
- 0.0.0.0:9500:9500

View File

@@ -34,7 +34,6 @@ base:
- match: compound
- salt.minion
- common
- users
- patch.os.schedule
- motd
- salt.minion-check

View File

@@ -1,110 +0,0 @@
# The creation of a user will require a pub key placed in /opt/so/saltstack/local/salt/users/authorized_keys/<username>
# If a user is changed from present to absent, their usergroup will be removed, but any additional usergroups that were created
# for that user will remain.
{% from 'users/map.jinja' import reserved_usernames with context %}
{% for username, userdeets in pillar.get('users', {}).items() if username not in reserved_usernames %}
{% if 'status' in userdeets %}
{% if userdeets.status == 'absent' %}
remove_user_{{username}}:
user.absent:
- name: {{ username }}
{% if 'purge' in userdeets %}
- purge: {{ userdeets.purge }}
{% endif %}
- force: True
{% elif userdeets.status == 'present' %}
{% if 'node_access' in userdeets %}
{% if grains.role in userdeets.node_access or grains.id.split('_')|last in userdeets.node_access %}
add_user_group_{{username}}:
group.present:
- name: {{ username }}
{% if 'uid' in userdeets %}
- gid: {{ userdeets.uid }}
{% endif %}
add_user_{{username}}:
user.present:
- name: {{ username }}
- home: {{ userdeets.get('home', "/home/%s" % username) }}
- shell: {{ userdeets.get('shell', '/bin/bash') }}
- usergroup: True
{% if 'fullname' in userdeets %}
- fullname: {{ userdeets.fullname }}
{% endif %}
{% if 'uid' in userdeets %}
- uid: {{ userdeets.uid }}
{% endif %}
{% if 'gid' in userdeets %}
- gid: {{ userdeets.gid }}
{% endif %}
{% if 'roomnumber' in userdeets %}
- roomnumber: {{ userdeets.roomnumber }}
{% endif %}
{% if 'workphone' in userdeets %}
- workphone: {{ userdeets.workphone }}
{% endif %}
{% if 'homephone' in userdeets %}
- homephone: {{ userdeets.homephone }}
{% endif %}
{% if 'groups' in userdeets %}
- groups:
{% for group in userdeets.groups %}
- {{ group }}
{% endfor %}
{% endif %}
{{username}}_authorized_keys:
file.managed:
- name: /home/{{username}}/.ssh/authorized_keys
- source: salt://users/authorized_keys/{{username}}
- user: {{username}}
- group: {{username}}
- mode: 644
- show_diff: False
- makedirs: True
- require:
- user: add_user_{{username}}
{% endif %}
{% endif %}
{% else %}
unknown_status_or_password_not_provided_for_user_{{username}}:
test.fail_without_changes:
- comment: "Verify status is 'present' or 'absent' and a password is provided for {{username}} in the users pillar."
{% endif %}
{% else %}
status_not_provided_for_user_{{username}}:
test.fail_without_changes:
- comment: "Status should be 'present' or 'absent'."
{% endif %}
{% endfor %}
disable_wheel_pwd_required:
file.comment:
- name: /etc/sudoers
- regex: "%wheel\\s+ALL=\\(ALL\\)\\s+ALL"
allow_wheel_no_pwd:
file.uncomment:
- name: /etc/sudoers
- regex: "%wheel\\s+ALL=\\(ALL\\)\\s+NOPASSWD: ALL"

View File

@@ -1,58 +0,0 @@
{% set reserved_usernames = [
'root',
'bin',
'daemon',
'adm',
'lp',
'sync',
'shutdown',
'halt',
'mail',
'operator',
'games',
'ftp',
'nobody',
'systemd-network',
'dbus',
'polkitd',
'tss',
'sshd',
'ossec',
'postfix',
'chrony',
'ntp',
'tcpdump',
'socore',
'soremote',
'elasticsearch',
'stenographer',
'suricata',
'zeek',
'curator',
'kratos',
'kibana',
'elastalert',
'ossecm',
'ossecr',
'logstash',
'sys',
'man',
'news',
'uucp',
'proxy',
'www-data',
'backup',
'list',
'irc',
'gnats',
'systemd-resolve',
'syslog',
'messagebus',
'_apt',
'lxd',
'uuidd',
'dnsmasq',
'landscape',
'pollinate',
'ossec'
] %}

View File

@@ -2016,10 +2016,10 @@ reinstall_init() {
{
if command -v salt-call &> /dev/null && grep -q "master:" /etc/salt/minion 2> /dev/null; then
# Disable schedule so highstate doesn't start running during the install
salt-call -l info schedule.disable
salt-call -l info schedule.disable --local
# Kill any currently running salt jobs, also to prevent issues with highstate.
salt-call -l info saltutil.kill_all_jobs
salt-call -l info saltutil.kill_all_jobs --local
fi
# Kill any salt processes (safely)

View File

@@ -318,7 +318,7 @@ if ! [[ -f $install_opt_file ]]; then
elif [[ $is_minion && $is_iso ]]; then
$sshcmd -i /root/.ssh/so.key soremote@"$MSRV" [[ -f /etc/yum.repos.d/airgap_repo.repo ]] >> $setup_log 2>&1
airgap_check=$?
[[ $airgap_check ]] && is_airgap=true >> $setup_log 2>&1
[[ $airgap_check == 0 ]] && is_airgap=true >> $setup_log 2>&1
fi
reset_proxy

View File

@@ -753,7 +753,7 @@ whiptail_install_type_dist() {
dist_option=$(whiptail --title "$whiptail_title" --menu "Do you want to start a new deployment or join this box to \nan existing deployment?" 11 75 2 \
"New Deployment " "Create a new Security Onion deployment" \
"Existing Deployment " "Join to an exisiting Security Onion deployment " \
"Existing Deployment " "Join to an existing Security Onion deployment " \
3>&1 1>&2 2>&3
)
local exitstatus=$?

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.