Compare commits

...

687 Commits

Author SHA1 Message Date
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
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
Mike Reeves
d3f25f8d74 Merge pull request #6293 from Security-Onion-Solutions/fix/fleet-stats
Fix FleetDM - disable stats
2021-11-19 09:53:26 -05:00
Josh Brower
8bd4ba3acd Fix FleetDM - disable stats 2021-11-19 09:49:34 -05:00
Josh Patterson
e5927d0bf7 Merge pull request #6290 from Security-Onion-Solutions/fleet_startup_eval
run redis state before fleet state for eval highstate
2021-11-18 17:54:26 -05:00
m0duspwnens
9dd89f6be7 run redis state before fleet state for eval highstate 2021-11-18 17:41:56 -05:00
Mike Reeves
796eb59dc6 Merge pull request #6288 from Security-Onion-Solutions/syncesusers_so-kratos
wait for up to 5 minutes for kratos to respond before proceeding
2021-11-18 16:42:18 -05:00
m0duspwnens
55fed43469 wait for up to 5 minutes for kratos to respond before proceeding 2021-11-18 16:35:35 -05:00
William Wernert
af83019427 Merge pull request #6287 from Security-Onion-Solutions/feat/cidr-extra-validation
Check for more invalid cidr syntax
2021-11-18 15:21:58 -05:00
William Wernert
4149236cda Check for more invalid cidr syntax 2021-11-18 15:18:12 -05:00
Josh Patterson
825106d074 Merge pull request #6286 from Security-Onion-Solutions/fix/docker-upgrade
Prevent downgrade of docker, containerd, and docker-cli
2021-11-18 15:15:37 -05:00
William Wernert
1a3324868a Specify version of docker-ce-rootless-extras 2021-11-18 15:12:47 -05:00
William Wernert
bc87bb4770 Specify docker cli version as well 2021-11-18 14:51:26 -05:00
William Wernert
6aae48bdae Don't upgrade docker or containerd before versionlock is applied 2021-11-18 14:14:18 -05:00
Mike Reeves
a0425a48e6 Merge pull request #6282 from Security-Onion-Solutions/syncesusers_so-kratos
remove restart policy for kratos container
2021-11-18 11:43:16 -05:00
m0duspwnens
4b89bf7bbc remove restart policy for kratos container 2021-11-18 11:41:07 -05:00
Mike Reeves
5fc5afa9ea Merge pull request #6281 from Security-Onion-Solutions/syncesusers_so-kratos
install specific docker verison
2021-11-18 11:32:38 -05:00
m0duspwnens
ddec8e4da0 install specific docker verison 2021-11-18 11:29:22 -05:00
Jason Ertel
9c0e8cedba Merge pull request #6279 from Security-Onion-Solutions/syncesusers_so-kratos
restart kratos if failure
2021-11-18 10:49:12 -05:00
m0duspwnens
5054da0027 restart kratos if failure 2021-11-18 10:48:06 -05:00
Jason Ertel
96f1f0174b Merge pull request #6275 from Security-Onion-Solutions/syncesusers_so-kratos
break kratos state out from soc state
2021-11-18 09:13:10 -05:00
m0duspwnens
cd1f0c0440 break kratos state out from soc state 2021-11-18 09:10:00 -05:00
Mike Reeves
12546a8efa Merge pull request #6271 from Security-Onion-Solutions/fix/fleet-users
Fix soup - fleetdm SA user
2021-11-17 19:48:15 -05:00
Josh Brower
3f5956b56d Fix soup - fleetdm SA user 2021-11-17 19:47:16 -05:00
Mike Reeves
6e49ab0558 Merge pull request #6270 from Security-Onion-Solutions/fix/whiptail-text
Fix text cutoff
2021-11-17 19:18:46 -05:00
William Wernert
c52df32f05 Fix text cutoff 2021-11-17 19:08:10 -05:00
Josh Patterson
c0602f4222 Merge pull request #6269 from Security-Onion-Solutions/syncesusers_so-kratos
run elasticsearch.auth state and so-elastic-auth true before manager …
2021-11-17 18:41:18 -05:00
m0duspwnens
d4b412bcbe run elasticsearch.auth state and so-elastic-auth true before manager in setup for syncesusers in manager state 2021-11-17 18:38:13 -05:00
Josh Brower
66e2de0934 Merge pull request #6268 from Security-Onion-Solutions/fix/fleet-users
Fix soup - fleetdm SA user
2021-11-17 18:26:11 -05:00
Josh Brower
c93794a402 Fix soup - fleetdm SA user 2021-11-17 18:22:34 -05:00
Josh Patterson
98efc6f2ed Merge pull request #6267 from Security-Onion-Solutions/syncesusers_so-kratos
syncesusers require so-kratos
2021-11-17 18:20:53 -05:00
m0duspwnens
59ef734064 syncesusers require so-kratos 2021-11-17 18:16:06 -05:00
Josh Brower
922657afbc Merge pull request #6266 from Security-Onion-Solutions/fix/fleet-users
Unset pw reset for new Fleet users
2021-11-17 17:10:27 -05:00
Josh Brower
5f3601ac78 Unset pw reset for new Fleet users 2021-11-17 17:06:01 -05:00
Josh Brower
2fe4fa06a6 Merge pull request #6265 from Security-Onion-Solutions/fix/fleet-users
Fix FleetDM SA Creation for SOUP
2021-11-17 14:09:59 -05:00
Josh Brower
773c580e77 Fix FleetDM SA Creation for SOUP 2021-11-17 14:08:34 -05:00
Mike Reeves
aca684d55a Merge pull request #6264 from Security-Onion-Solutions/fix/fleet-users
Migrate FleetDM user mgt to fleetctl
2021-11-17 13:16:05 -05:00
Josh Brower
6f391dbe50 Migrate FleetDM user mgt to fleetctl 2021-11-17 13:13:25 -05:00
William Wernert
8d033264e7 Merge pull request #6262 from Security-Onion-Solutions/fix/new-cidr-test
Add new ipv4 address w/ cidr mask validator
2021-11-17 13:09:04 -05:00
William Wernert
262d2023b5 Add new ipv4 address w/ cidr mask validator 2021-11-17 12:41:25 -05:00
Josh Patterson
d143a309a1 Merge pull request #6261 from Security-Onion-Solutions/soup_soc_endgame
change how soc endgame added to manager pillar in soup
2021-11-17 11:12:17 -05:00
m0duspwnens
ac400f1c41 change how soc endgame added to manager pillar in soup 2021-11-17 11:07:12 -05:00
William Wernert
df495c0017 Merge pull request #6258 from Security-Onion-Solutions/fix/nm-conf
Run `check_network_manager_conf()` later in setup
2021-11-17 08:44:25 -05:00
William Wernert
8c454973ad Run check_network_manager_conf() later in setup
The directory was being overwritten when network-manager was installed later
2021-11-17 08:42:27 -05:00
Josh Patterson
a16e6aca22 Merge pull request #6257 from Security-Onion-Solutions/es_soup_ingest
escape raw and endraw
2021-11-17 07:56:01 -05:00
m0duspwnens
ce21ae11f5 escape raw and endraw 2021-11-17 07:53:15 -05:00
Mike Reeves
fdd9706669 Merge pull request #6255 from Security-Onion-Solutions/kilo 2021-11-16 18:09:40 -05:00
Jason Ertel
8fa9a180b2 Refactor upgrade and post-upgrade version to function mappings; fix missing version upgrades from older 2.3.61 releases and earlier; Drop support for upgrading ancient RC releases 2021-11-16 18:08:28 -05:00
Josh Patterson
6288365a50 Merge pull request #6254 from Security-Onion-Solutions/es_soup_ingest
wrap common ingest in raw endraw since json and no jinja
2021-11-16 16:47:53 -05:00
m0duspwnens
5448107310 wrap common ingest in raw endraw since json and no jinja 2021-11-16 16:43:33 -05:00
Mike Reeves
adaf3faf90 Merge pull request #6253 from Security-Onion-Solutions/kilo 2021-11-16 16:13:31 -05:00
Jason Ertel
1bd8e226b4 Force DB migration since installations on 2.3.50 or earlier will skip the Kratos 0.6 version 2021-11-16 15:58:04 -05:00
Josh Patterson
f60f0b5b6d Merge pull request #6246 from Security-Onion-Solutions/es_soup_ingest
soup for es ingest common and watch esingestdynamicconf for so-elastic docker
2021-11-16 14:05:15 -05:00
William Wernert
adc867846c Merge pull request #6245 from Security-Onion-Solutions/fix/ubuntu-nic-unmanaged
Modify network-manager conf earlier in setup
2021-11-16 14:00:58 -05:00
m0duspwnens
5945326817 soup for es ingest common and watch esingestdynamicconf for so-elastic docker 2021-11-16 14:00:41 -05:00
William Wernert
90cbb5d00e Modify network-manager conf earlier in setup 2021-11-16 13:30:09 -05:00
Josh Brower
8bb2789c6f Merge pull request #6237 from Security-Onion-Solutions/kilo
Migrate to email field instead of username due to breaking change in …
2021-11-16 12:06:08 -05:00
Jason Ertel
11fc0da971 Migrate to email field instead of username due to breaking change in FleetDM 4.x 2021-11-16 12:03:46 -05:00
William Wernert
76a1d767f2 Merge pull request #6235 from Security-Onion-Solutions/feature/preflight-retry
Retry failed URLs in so-preflight + improve logging clarity
2021-11-16 11:11:02 -05:00
William Wernert
a2152446ea Pad count string to align text 2021-11-16 11:08:13 -05:00
William Wernert
d4d9032bfc Remove confusing punctuation 2021-11-16 10:56:49 -05:00
William Wernert
4e3f43bee4 Fix variable name 2021-11-16 10:53:22 -05:00
William Wernert
57377e0a0e Add retry support + more precise logging to so-preflight 2021-11-16 10:46:48 -05:00
Mike Reeves
2514d36ccd Merge pull request #6232 from Security-Onion-Solutions/TOoSmOotH-patch-3
Update init.sls
2021-11-15 17:11:08 -05:00
Mike Reeves
809dbc0a48 Merge pull request #6233 from Security-Onion-Solutions/TOoSmOotH-patch-4
Update soup
2021-11-15 17:10:52 -05:00
Mike Reeves
b51405d5e8 Update soup 2021-11-15 17:04:46 -05:00
Mike Reeves
d1cfc4a8dc Merge pull request #6231 from Security-Onion-Solutions/fix/whiptail-cutoff
Fix whiptail description text
2021-11-15 17:02:00 -05:00
Mike Reeves
731bbabe4c Update init.sls 2021-11-15 17:00:34 -05:00
William Wernert
d4509ff4d8 Fix whiptail description text 2021-11-15 16:29:26 -05:00
Mike Reeves
85c0b0818b Merge pull request #6230 from Security-Onion-Solutions/fix/cidr-full-validation-bash
Check CIDR validity completely
2021-11-15 15:43:58 -05:00
William Wernert
f674555290 Check CIDR validity completely 2021-11-15 15:43:05 -05:00
Josh Patterson
a8aae544d5 Merge pull request #6229 from Security-Onion-Solutions/kibana_json_logging
change kibana logging to json
2021-11-15 14:27:04 -05:00
m0duspwnens
6f9db25ea7 change kibana logging to json 2021-11-15 14:23:47 -05:00
Mike Reeves
405e78858a Merge pull request #6228 from Security-Onion-Solutions/TOoSmOotH-patch-2
Update soup
2021-11-15 14:07:23 -05:00
Mike Reeves
146e1f4297 Update soup 2021-11-15 14:05:29 -05:00
Mike Reeves
f78e0fb7b9 Merge pull request #6227 from Security-Onion-Solutions/fix/fleetlogging
Fix env var for logging
2021-11-15 14:00:31 -05:00
Josh Brower
6e6d2d1949 Fix env var for logging 2021-11-15 13:52:35 -05:00
Josh Patterson
ca5d20fecb Merge pull request #6225 from Security-Onion-Solutions/clean_meta_data
clean metadata with cmd.run instead of pkg module due to False return…
2021-11-15 11:03:41 -05:00
m0duspwnens
dcfaece8b1 clean metadata with cmd.run instead of pkg module due to False return from module 2021-11-15 11:00:31 -05:00
Mike Reeves
af0e062193 Merge pull request #6221 from Security-Onion-Solutions/fix/var-reference
Fix variable reference in so-functions
2021-11-15 09:49:07 -05:00
Mike Reeves
56acedfbf7 Merge pull request #6220 from Security-Onion-Solutions/fix/revert-python-validation
Fix/revert python validation
2021-11-15 09:44:31 -05:00
William Wernert
4b0a5c3a17 Un-revert validation test script 2021-11-15 09:43:43 -05:00
William Wernert
052192e1d6 Revert "Use python lib to make cidr validation more strict"
This reverts commit 569cb24861.
2021-11-15 09:43:18 -05:00
weslambert
92131d4bb7 Merge pull request #6215 from Security-Onion-Solutions/fix/eg_spelling
Fix spelling
2021-11-12 21:13:28 -05:00
weslambert
9ac1cb0e76 Fix spelling 2021-11-12 21:12:09 -05:00
Josh Patterson
ffbb04bb5a Merge pull request #6213 from Security-Onion-Solutions/issue/5809
Issue/5809
2021-11-12 15:07:54 -05:00
m0duspwnens
cc1dea446c Merge branch 'dev' of https://github.com/Security-Onion-Solutions/securityonion into issue/5809 2021-11-12 15:02:22 -05:00
m0duspwnens
7f3379e034 verify manager pillars can be rendered before proceeding with soup - https://github.com/Security-Onion-Solutions/securityonion/issues/5809 2021-11-12 15:02:16 -05:00
weslambert
8c46a2d1db Merge pull request #6210 from Security-Onion-Solutions/fix/soc_pillar_soup
Add SOC pillar entry
2021-11-12 13:35:46 -05:00
William Wernert
ba621639bd Merge pull request #6201 from Security-Onion-Solutions/fix/cidr-ip-validation
Improve cidr validation in setup and match ip validation to similar method
2021-11-12 13:34:19 -05:00
Wes Lambert
2fb9196604 Move logic above version declaration 2021-11-12 18:26:21 +00:00
Wes Lambert
48c71c8b12 Add soc pillar entry 2021-11-12 18:23:09 +00:00
weslambert
8d185ced61 Merge pull request #6209 from Security-Onion-Solutions/fix/endgame_setup
Adjust manager pillar config for Endgame and defaults
2021-11-12 12:27:55 -05:00
William Wernert
9141c271f0 Fix indent 2021-11-12 12:25:32 -05:00
weslambert
bc2e470da9 Fix indentation 2021-11-12 12:20:00 -05:00
weslambert
0f817cd735 Merge pull request #6208 from Security-Onion-Solutions/fix/endgame_pivot
Make Endgame pivot independent
2021-11-12 12:17:24 -05:00
weslambert
df5901a65d Adjust how manager pillar is populated for ENDGAME and default SOC config 2021-11-12 12:16:26 -05:00
weslambert
3cd1b5687e Make pivot condition independent for ENDGAMEHOST 2021-11-12 12:06:39 -05:00
Josh Patterson
86a42addf0 Merge pull request #6207 from Security-Onion-Solutions/so_elastic_auth_password_reset
https://github.com/Security-Onion-Solutions/securityonion/issues/6206
2021-11-12 11:43:31 -05:00
m0duspwnens
6bf4d5a576 https://github.com/Security-Onion-Solutions/securityonion/issues/6206 2021-11-12 11:37:55 -05:00
William Wernert
efa5eb9f7f Merge pull request #6184 from Security-Onion-Solutions/foxtrot
Whiptail changes
2021-11-11 13:57:07 -05:00
Josh Patterson
22959f0260 Merge pull request #6195 from Security-Onion-Solutions/issue/6146
Issue/6146
2021-11-11 11:47:33 -05:00
m0duspwnens
8da2133cff give kibana.secrets pillar to import node 2021-11-11 11:31:07 -05:00
William Wernert
1472af4fc3 Merge branch 'dev' into foxtrot 2021-11-11 09:03:05 -05:00
Josh Brower
f91a6d3cb6 Merge pull request #6194 from Security-Onion-Solutions/fix/fleetstandalone
Add Fleet Standalone Node to manager ssl
2021-11-11 08:52:29 -05:00
Josh Brower
96f427d924 Add so-fleet to cert requirements 2021-11-11 08:45:22 -05:00
Josh Brower
184356618c Add Fleet Standalone Node to manager ssl 2021-11-11 08:28:22 -05:00
William Wernert
ed3b2e4569 Put entire ref to doc page on new line 2021-11-10 17:46:35 -05:00
William Wernert
62b41af069 Fix docs link being cut off 2021-11-10 17:17:19 -05:00
William Wernert
569cb24861 Use python lib to make cidr validation more strict
Also update ipv4 validation to match the method used to validate cidr strings
2021-11-10 16:53:01 -05:00
William Wernert
ac22df8381 Merge branch 'dev' into foxtrot 2021-11-10 16:51:31 -05:00
Mike Reeves
446d6bd532 Merge pull request #6189 from Security-Onion-Solutions/soup2390
Soup2390
2021-11-10 16:49:46 -05:00
Mike Reeves
fcf889be2f Add soup to 2.3.90 2021-11-10 16:46:24 -05:00
Mike Reeves
8168f19b31 Add soup to 2.3.90 2021-11-10 16:37:54 -05:00
Mike Reeves
ba553d971c Add soup to 2.3.90 2021-11-10 16:31:44 -05:00
Mike Reeves
9137454a25 Add soup placeholders 2021-11-10 16:08:07 -05:00
m0duspwnens
7ebd861e32 enable secureCookies, security.encryptionKey and reporting.encryptionKey - https://github.com/Security-Onion-Solutions/securityonion/issues/6146 2021-11-10 16:05:40 -05:00
William Wernert
d110b63050 Merge pull request #6187 from Security-Onion-Solutions/fix/so-rule-modify-example
Fix `so-rule modify` example
2021-11-10 14:31:28 -05:00
William Wernert
3806f10f8b Fix so-rule modify example 2021-11-10 14:18:32 -05:00
Jason Ertel
83bd314a63 Merge pull request #6186 from Security-Onion-Solutions/kilo
Upgrade to ES 7.15.2
2021-11-10 14:06:08 -05:00
Jason Ertel
6cd7b252df Upgrade to ES 7.15.2 2021-11-10 13:59:55 -05:00
Jason Ertel
dea03bbf5e Upgrade to ES 7.15.2 2021-11-10 13:44:20 -05:00
Josh Brower
9edc543262 Merge pull request #6183 from Security-Onion-Solutions/delta
Upgrade FleetDM to 4.5
2021-11-10 11:35:12 -05:00
Josh Brower
d3dc5ffc5a Fix salt syntax 2021-11-10 11:28:48 -05:00
William Wernert
2c296e832f Remove references to CURCLOSEDAYS in setup
Curator is configured differently now so the variable set during setup is no longer in use
2021-11-10 11:25:51 -05:00
Josh Brower
b350174df1 Merge remote-tracking branch 'remotes/origin/dev' into delta 2021-11-10 11:08:36 -05:00
Josh Brower
67ebfeab16 Disable FleetDM usage stats 2021-11-10 10:49:56 -05:00
Josh Brower
435f430747 Fix enroll secret parsing 2021-11-10 10:24:53 -05:00
Josh Patterson
aa9e1701f0 Merge pull request #6180 from Security-Onion-Solutions/issue/5794
timeout wazuh-register-agent faster
2021-11-10 09:58:05 -05:00
m0duspwnens
02d9b87f66 https://github.com/Security-Onion-Solutions/securityonion/issues/5794 2021-11-10 09:54:51 -05:00
Josh Patterson
cfd46c1e58 Merge pull request #6176 from Security-Onion-Solutions/bravo
Grafana improvements, pillarize kibana
2021-11-10 09:18:47 -05:00
m0duspwnens
392305e4ed add engame changes that were missing from merge somehow 2021-11-10 09:01:42 -05:00
m0duspwnens
5ff14ab652 Merge remote-tracking branch 'origin/issue/6007' into bravo 2021-11-09 18:31:56 -05:00
m0duspwnens
1890c7244a set elasticsearch:auth to persist through user pw change 2021-11-09 18:25:17 -05:00
m0duspwnens
a8c4ed7bbf set elasticsearch:auth:enabled True in auth pillar 2021-11-09 18:05:05 -05:00
m0duspwnens
91f54537d7 handle elasticsearch.auth state like kibana.secrets 2021-11-09 17:52:38 -05:00
m0duspwnens
7e3a4656aa change xpack update 2021-11-09 17:33:09 -05:00
m0duspwnens
8a04fcd919 change how key is added 2021-11-09 17:07:20 -05:00
m0duspwnens
409ab623a5 ensure kibana pillar dir exists 2021-11-09 16:49:45 -05:00
m0duspwnens
ac85d1598e dont show changes 2021-11-09 16:44:54 -05:00
m0duspwnens
4c8e68e014 Merge remote-tracking branch 'remotes/origin/dev' into issue/3933 2021-11-09 16:42:47 -05:00
m0duspwnens
57c6e26634 encrypt kibana saved objects - https://github.com/Security-Onion-Solutions/securityonion/issues/6146 2021-11-09 16:41:25 -05:00
m0duspwnens
b6a1d7418e fix typo, dont show changes for kibana.yaml or dashboard so 2021-11-09 16:14:48 -05:00
weslambert
6eb1a0b0ae Merge pull request #6169 from Security-Onion-Solutions/fix/ingest_dynamic_ref
Add dynamic conf to config change check
2021-11-09 16:11:38 -05:00
weslambert
9301b8f5b9 Add dynamic conf to config change check 2021-11-09 15:56:52 -05:00
m0duspwnens
202977a323 create so script to load saved object defaults 2021-11-09 15:54:15 -05:00
weslambert
9597373e4a Merge pull request #6167 from Security-Onion-Solutions/ecs_pipeline_common
Add config for dynamically formatted ingest pipelines
2021-11-09 15:41:43 -05:00
Wes Lambert
f80b70e008 Add config for dynamically formatted ingest pipelines 2021-11-09 20:07:53 +00:00
William Wernert
04d2b52306 Fix IP route whiptail error 2021-11-09 14:03:32 -05:00
m0duspwnens
af7830c2be remove reference to saved_objects in defaults 2021-11-09 13:52:47 -05:00
m0duspwnens
3c3cb47b88 merge with dev 2021-11-09 13:07:35 -05:00
m0duspwnens
da4e92a7a3 change config id 2021-11-09 12:13:28 -05:00
Mike Reeves
3afb0bd263 Merge pull request #6161 from Security-Onion-Solutions/sslchange
Enable Subject Alt Name for registry
2021-11-09 10:53:38 -05:00
Josh Brower
f6e6b20392 Add Name and OrgName to Fleet setup 2021-11-09 09:20:47 -05:00
William Wernert
3835a4401e Merge pull request #6157 from Security-Onion-Solutions/foxtrot
Fix preflight script on centos
2021-11-09 08:49:46 -05:00
William Wernert
4bae57d994 Fix preflight printing to log 2021-11-09 08:34:02 -05:00
William Wernert
ea7289d92e Fix preflight script on centos 2021-11-09 08:20:19 -05:00
m0duspwnens
48eaf190e9 Merge remote-tracking branch 'remotes/origin/dev' into issue/6007 2021-11-08 17:00:06 -05:00
m0duspwnens
497de0fede hide vars on pipeline overview 2021-11-08 16:54:39 -05:00
m0duspwnens
70e3bc7eb8 hide vars on pipeline overview 2021-11-08 16:52:15 -05:00
Mike Reeves
eefc9cfcb6 Enable Subject Alt Name for registry 2021-11-08 16:50:43 -05:00
m0duspwnens
42b8955883 panel cleanup 2021-11-08 16:33:57 -05:00
m0duspwnens
f6b753b805 panel cleanup 2021-11-08 16:26:41 -05:00
m0duspwnens
17fc03a553 pipleine overview tc changes 2021-11-08 16:15:42 -05:00
weslambert
8bf88043ac Merge pull request #6149 from Security-Onion-Solutions/add_test_pipeline
Add ECS testing pipeline
2021-11-08 15:43:03 -05:00
m0duspwnens
79640342f2 update redis queue query 2021-11-08 15:20:28 -05:00
Mike Reeves
3ad47742bd Merge pull request #6150 from Security-Onion-Solutions/TOoSmOotH-patch-1
Update acng.conf
2021-11-08 15:18:35 -05:00
Mike Reeves
a8c02252dc Update acng.conf 2021-11-08 15:16:05 -05:00
m0duspwnens
fbef420155 update redis queue query 2021-11-08 15:15:53 -05:00
m0duspwnens
ccd84e441d add redis queue to pipeline overview 2021-11-08 15:09:46 -05:00
Wes Lambert
46d3eb452d Add ECS testing pipeline 2021-11-08 20:08:56 +00:00
Josh Brower
083d467aa9 Update to FleetDM 4.5 2021-11-08 15:05:58 -05:00
m0duspwnens
f026ac1b41 pipeline overview tc changes 2021-11-08 15:02:52 -05:00
m0duspwnens
9ea292b11e fix query 2021-11-08 13:48:33 -05:00
m0duspwnens
e2ee460fdd fix gridPos 2021-11-08 12:39:23 -05:00
m0duspwnens
5b70ff61d1 fix gridPos 2021-11-08 12:37:03 -05:00
m0duspwnens
3b2ca89852 use endif not fi 2021-11-08 12:20:07 -05:00
m0duspwnens
199c97684c fix nontc name in defaults 2021-11-08 12:10:23 -05:00
m0duspwnens
d67e34dac4 add pipeline overview for true cluster 2021-11-08 12:09:35 -05:00
William Wernert
49a573074e Merge pull request #6142 from Security-Onion-Solutions/foxtrot
Whiptail changes
2021-11-08 11:29:58 -05:00
William Wernert
6c16d6d222 Update invalid hostname message 2021-11-08 11:15:28 -05:00
William Wernert
acba82d194 Update dist install menus' top text 2021-11-08 11:04:51 -05:00
William Wernert
f66d915f5d Normal hostname check already checks for localhost 2021-11-08 10:38:30 -05:00
William Wernert
ee2dd75dfd Fix variable ref 2021-11-08 10:36:36 -05:00
William Wernert
50b7779d6e Make manager hostname error more specific 2021-11-08 10:35:28 -05:00
William Wernert
ad71485361 Fix whiptail height 2021-11-08 10:21:55 -05:00
William Wernert
8b2cccdf4a More whiptail formatting 2021-11-08 10:21:17 -05:00
William Wernert
dbe4a7de63 Fix new whiptail layouts 2021-11-08 10:19:38 -05:00
William Wernert
9c4bba9ac9 Fix variable reference 2021-11-08 10:08:23 -05:00
Doug Burks
b3fd7c548c Merge pull request #6135 from Security-Onion-Solutions/dougburks-patch-1
Improve clarity in CONTRIBUTING.md
2021-11-08 08:53:50 -05:00
Doug Burks
dcf6dfb676 Improve clarity 2021-11-08 06:38:16 -05:00
William Wernert
246d41c552 Add additional checks for manager hostname + ip
Check for current hostname, ip, and localhost (ip + string) when setting the manager ip and hostname
2021-11-05 15:56:08 -04:00
William Wernert
988932293f Whiptail changes
* Ask whether to join to or create new dist install
* Also add links to architecture on install type prompts
2021-11-05 15:54:17 -04:00
m0duspwnens
0b28e89f3c change how telegraf script determine if there is already and instance of the script already running 2021-11-04 23:22:13 -04:00
m0duspwnens
665732bd32 dont show points 2021-11-04 14:23:11 -04:00
m0duspwnens
b599b49630 enable beat input plugin for telegraf 2021-11-04 13:52:45 -04:00
m0duspwnens
edb3b602a9 pipeline overview dashboard changs 2021-11-04 10:59:01 -04:00
William Wernert
a4289b7ab9 Merge pull request #6107 from Security-Onion-Solutions/foxtrot
Manage docker gid and run preflight check during setup
2021-11-04 10:07:05 -04:00
Mike Reeves
9b0ce8b395 Merge pull request #6090 from Security-Onion-Solutions/commonupdate
Make common template honor replicas
2021-11-03 14:04:19 -04:00
m0duspwnens
05456b38d1 update panel 2021-11-03 13:54:05 -04:00
m0duspwnens
4fc58e7a5a update panel 2021-11-03 13:51:57 -04:00
Mike Reeves
dc07aba63d Update so-common-template.json.jinja 2021-11-03 13:50:31 -04:00
m0duspwnens
f1d66e2d51 change searchnode var 2021-11-03 13:40:09 -04:00
m0duspwnens
fab0dd2bad add repeating es ingest panel for nontc 2021-11-03 13:25:42 -04:00
Mike Reeves
747f14d60e Make common template honor replicas 2021-11-03 13:11:38 -04:00
William Wernert
fb35ff40b4 Just hide whiptail cancel message on test installs 2021-11-03 10:41:44 -04:00
m0duspwnens
2cb31a4c05 fix query 2021-11-03 09:27:02 -04:00
m0duspwnens
32f986c505 change panel 2021-11-03 09:23:21 -04:00
m0duspwnens
c8ee67f354 update panel for pipeline_overview 2021-11-03 09:12:32 -04:00
m0duspwnens
db80315c06 rename panel 2021-11-03 08:37:33 -04:00
m0duspwnens
8e3b08a831 start of pipeline dashboard 2021-11-03 08:33:20 -04:00
m0duspwnens
677f62ebd1 dont show changes for telegraf conf 2021-11-02 18:22:37 -04:00
William Wernert
d927e79154 Exit on failed preflight check during testing 2021-11-02 16:17:08 -04:00
William Wernert
8670aa6cd8 Run check-update in preflight instead of update 2021-11-02 14:29:58 -04:00
William Wernert
7c7c225a41 Fix tmp file check 2021-11-02 14:01:21 -04:00
m0duspwnens
54b034b537 fix spacing on es input 2021-11-02 13:43:59 -04:00
m0duspwnens
2232759fa4 rename file 2021-11-02 12:21:54 -04:00
m0duspwnens
f65eea6a03 rename file 2021-11-02 12:09:32 -04:00
William Wernert
e4a77acfe6 Move whiptail menus outside of progress func 2021-11-02 12:03:42 -04:00
William Wernert
9671dab2a3 Make so-preflight executable 2021-11-02 11:48:24 -04:00
William Wernert
e6adb46364 Run so-preflight during setup 2021-11-02 11:18:23 -04:00
m0duspwnens
7abb2e5935 monitor interface graph total 2021-11-02 11:07:29 -04:00
m0duspwnens
561f86eac8 change eps graphs to use logstash data and not consumptioneps script 2021-11-02 11:06:29 -04:00
William Wernert
9a9d1480de Manage docker group's gid to prevent gid overlap 2021-11-02 10:41:36 -04:00
Josh Brower
8b52f87a60 Merge pull request #6066 from Security-Onion-Solutions/fix/evtx-import-elastic-creds
Fix/evtx import elastic creds
2021-11-02 09:25:25 -04:00
Josh Brower
a6f399acf4 Fix evtx import logging 2021-11-02 09:19:32 -04:00
Josh Brower
3534256517 Add evtx import logging 2021-11-02 09:03:52 -04:00
m0duspwnens
b109d95d6f add max to zeek capture loss legend 2021-11-02 09:02:48 -04:00
Josh Brower
b756c0cd38 Pull ES Creds at Runtime 2021-11-02 08:57:11 -04:00
m0duspwnens
3517ea3f2a select last value for cpucount var 2021-11-02 08:41:57 -04:00
m0duspwnens
5d414c8bdd remove logstash row from manager 2021-11-02 08:36:13 -04:00
Josh Brower
2b56b53c15 Merge pull request #6064 from Security-Onion-Solutions/feature/support_non-wel_beats
Support non-WEL Beats
2021-11-02 08:29:48 -04:00
Josh Brower
2ba619144c Support non-WEL Beats 2021-11-02 08:23:29 -04:00
m0duspwnens
a9be0a0409 create and add mon traffic combined graph to sensor dash 2021-11-02 07:55:39 -04:00
m0duspwnens
bf116d210e mostly overview dash panel changes 2021-11-01 17:48:02 -04:00
William Wernert
f8b62b63f9 Merge pull request #6061 from Security-Onion-Solutions/foxtrot
Fix NIC string values for VLAN tagged interfaces
2021-11-01 16:43:52 -04:00
m0duspwnens
f4d9455872 revert to b63b50d98c 2021-11-01 16:10:13 -04:00
m0duspwnens
936c796b9d Revert "graph changes"
This reverts commit 8857fca797.
2021-11-01 15:19:50 -04:00
m0duspwnens
8ff122262c Revert "update many panels"
This reverts commit b63b50d98c.
2021-11-01 14:50:57 -04:00
m0duspwnens
c4a1fbd82a remove old json 2021-11-01 14:39:03 -04:00
m0duspwnens
8857fca797 graph changes 2021-11-01 14:36:41 -04:00
m0duspwnens
b63b50d98c update many panels 2021-11-01 14:06:01 -04:00
William Wernert
c17187708e Merge branch 'dev' into foxtrot 2021-11-01 12:46:43 -04:00
Mike Reeves
095e6bd48c Merge pull request #6044 from Burak-PLT/patch-1
Update auth.sls
2021-11-01 10:22:16 -04:00
m0duspwnens
c4b9244f9a add gridPos 2021-10-29 17:24:50 -04:00
m0duspwnens
2ba548fcfc grafana bug fixes and improvements - https://github.com/Security-Onion-Solutions/securityonion/issues/6007 2021-10-29 17:11:51 -04:00
William Wernert
f76a52b2ee Fix NIC string values for VLAN tagged interfaces 2021-10-29 13:34:23 -04:00
William Wernert
b555ad16da Merge pull request #6052 from Security-Onion-Solutions/foxtrot
Foxtrot
2021-10-29 10:52:51 -04:00
William Wernert
b1c67f696e Re-order logic to maintain backwards compatibility 2021-10-29 10:47:05 -04:00
William Wernert
d08149f728 Don't set INTERWEBS variable on automated minions 2021-10-29 10:11:47 -04:00
William Wernert
a5cba5ecf8 Merge branch 'dev' into foxtrot 2021-10-29 10:01:46 -04:00
Burak-PLT
f081938be5 Update auth.sls
Change default password lengths to 72 characters from 20.
2021-10-28 16:00:58 -04:00
William Wernert
c2b18efdbb Minions still need to be ISO installs to be airgap 2021-10-28 11:59:42 -04:00
William Wernert
6b480a5ba4 Change airgap check to something that doesn't require root 2021-10-28 11:51:50 -04:00
William Wernert
d6eeb0b735 Gen ssh key sooner 2021-10-28 10:04:03 -04:00
Josh Patterson
3000c57428 Merge pull request #6039 from Security-Onion-Solutions/issue/5759
Issue/5759
2021-10-28 09:24:44 -04:00
m0duspwnens
5c5b4004e9 Merge remote-tracking branch 'remotes/origin/dev' into issue/5759 2021-10-28 08:52:04 -04:00
Josh Patterson
05e0f92ec5 Merge pull request #6036 from Security-Onion-Solutions/issue/5955
include ssl state in telegraf state
2021-10-28 08:50:57 -04:00
m0duspwnens
0cea5e8f22 include ssl state in telegraf state 2021-10-28 08:46:27 -04:00
m0duspwnens
7eb42fa6bd change boolean 2021-10-28 08:43:03 -04:00
m0duspwnens
18ce9c7819 disable zeekpacketlosscron and telegraf checks if zeek is diabled via pillar 2021-10-28 07:46:02 -04:00
Mike Reeves
b3e5319806 Merge pull request #6028 from Security-Onion-Solutions/telecluster
Enable cluster stats
2021-10-27 16:37:42 -04:00
Mike Reeves
c8c8cf203f Enable cluster stats 2021-10-27 15:44:52 -04:00
Josh Patterson
19056b9177 Merge pull request #6027 from Security-Onion-Solutions/issue/5955
Issue/5955
2021-10-27 15:07:22 -04:00
William Wernert
75490a2536 Fix typo 2021-10-27 14:59:24 -04:00
William Wernert
eee612e73d Make folder/file states explicit
Rather than using /nsm/zeek (max_depth: 1) create explicit states for /nsm/zeek/spool and /nsm/zeek/spool/state.db that set correct ownership
2021-10-27 11:43:09 -04:00
William Wernert
9e9079f9cb Reorder airgap prompt and add additional logic
Setup should now only ask the user whether to setup as airgap on manager-type installs. For all distributed minions setup will now inherit the airgap boolean from the manager.
2021-10-27 11:03:00 -04:00
William Wernert
331801eec2 Merge branch 'dev' into foxtrot 2021-10-27 10:58:16 -04:00
William Wernert
a0216cea57 Merge pull request #6021 from Security-Onion-Solutions/fix/update-mysql-root-user
Update ip for root user in mysql when running so-ip-update
2021-10-27 10:55:11 -04:00
m0duspwnens
e7f43cff5e limit nodes that bind filebeat certs in so-logstash 2021-10-27 10:45:10 -04:00
William Wernert
90d473f2d6 Update ip for root user in mysql when running so-ip-update 2021-10-27 10:42:33 -04:00
m0duspwnens
bf403a8307 only manager nodes get cert, key and att&ck binds 2021-10-27 09:47:12 -04:00
m0duspwnens
58d62f29ea include ssl state in registry state 2021-10-26 11:55:47 -04:00
Mike Reeves
bcf03773c0 Merge pull request #6009 from Security-Onion-Solutions/stenoports
Remove port bindings for steno
2021-10-26 10:58:11 -04:00
m0duspwnens
c0dd9efd9b change so-thehive-es binds and requires 2021-10-26 10:50:16 -04:00
m0duspwnens
36ae07b78e change timeout from 60 to 120 2021-10-26 10:49:50 -04:00
Mike Reeves
d77328608e Remove port bindings for steno
Steno runs in host mode so port bindings are not required
2021-10-26 10:23:33 -04:00
m0duspwnens
682cbfd223 remove the mode 2021-10-26 09:23:24 -04:00
m0duspwnens
fa2edb2b59 make cortex_init and hive_init time out after 1 minutes vs 5 minutes 2021-10-26 08:39:30 -04:00
m0duspwnens
0c679b62b2 Merge remote-tracking branch 'remotes/origin/dev' into issue/5955 2021-10-25 16:29:41 -04:00
m0duspwnens
7e8d74e770 just use mode 2021-10-25 15:50:27 -04:00
m0duspwnens
9a78d13bee change perms on mysql 2021-10-25 15:37:23 -04:00
Jason Ertel
c469d12a49 Merge pull request #6002 from Security-Onion-Solutions/kilo
Update whiptail links to use latest docs
2021-10-25 15:08:31 -04:00
Jason Ertel
d5f42e0d7c Update whiptail links to use latest docs 2021-10-25 15:06:42 -04:00
weslambert
926551d398 Merge pull request #5998 from Security-Onion-Solutions/fix/hl_host_name
Rename HTTP client headers and host
2021-10-25 13:21:11 -04:00
weslambert
3be0d05eea Update field removal based on HTTP input changes 2021-10-25 13:16:30 -04:00
weslambert
7fa43a276a Rename default headers and host for HTTP input 2021-10-25 13:15:20 -04:00
William Wernert
2bfedbd581 Merge pull request #5996 from Security-Onion-Solutions/fix/escape-node-desc
Escape single quotes and allow for any character in node description
2021-10-25 10:53:36 -04:00
William Wernert
dca30146ab Merge branch 'dev' into foxtrot 2021-10-25 10:50:25 -04:00
William Wernert
6e34905b42 Escape single quotes and allow for any character in node description 2021-10-25 10:48:09 -04:00
m0duspwnens
ee7e714f43 change to file_mode 2021-10-22 16:55:23 -04:00
m0duspwnens
d7e5377a44 more requires 2021-10-22 16:46:45 -04:00
William Wernert
38b16a507b Update ip for root user in mysql when running so-ip-update 2021-10-22 15:29:32 -04:00
William Wernert
17af513692 Escape single quotes and allow for any character in node description 2021-10-22 15:28:37 -04:00
m0duspwnens
283f7296bc fix require 2021-10-22 14:45:22 -04:00
m0duspwnens
9f6407fcb0 fix dupe ids 2021-10-22 14:26:04 -04:00
m0duspwnens
f61400680d fix dupe ids 2021-10-22 14:22:15 -04:00
m0duspwnens
fed8bfac67 more requires on docker containers 2021-10-22 14:10:59 -04:00
William Wernert
62971d8c15 Add Fleet custom hostname to end summary 2021-10-22 11:57:47 -04:00
William Wernert
352e30f9e1 Add CUSTOM_FLEET_HOSTNAME to subjectAltName of fleet.key
Resolves #4319
2021-10-22 11:16:29 -04:00
m0duspwnens
451b19dc4d change from file to x509 2021-10-22 09:53:20 -04:00
William Wernert
d5d970672d Merge pull request #5974 from Security-Onion-Solutions/foxtrot
Add so-deny script + rewrite so-allow to match
2021-10-21 16:37:05 -04:00
m0duspwnens
f93c6146f5 docker binds requires 2021-10-21 15:24:55 -04:00
weslambert
40dd33affe Merge pull request #5971 from Security-Onion-Solutions/feature/es_templates
Add .keyword subfield for conflict fields
2021-10-21 15:07:00 -04:00
William Wernert
f374dcbb58 Check for IP environment variable in so-allow and so-deny 2021-10-21 13:54:06 -04:00
weslambert
77ee1db44c Add .keyword subfield for conflict fields 2021-10-21 12:56:03 -04:00
Josh Patterson
8784d65023 Merge pull request #5967 from Security-Onion-Solutions/issue/5954
require files before starting soc or kratos
2021-10-21 11:15:36 -04:00
William Wernert
15fe7512b7 Install lxml during setup and in common state 2021-10-21 10:49:41 -04:00
William Wernert
0beeeb94bf Actually add new so-allow script 2021-10-21 10:48:17 -04:00
m0duspwnens
928aed27c5 require files before starting soc or kratos 2021-10-20 17:04:02 -04:00
William Wernert
387d4d6ad5 Add so-deny script + rewrite so-allow to match so-deny 2021-10-20 16:44:57 -04:00
William Wernert
adf6cb4b3c Merge branch 'dev' into foxtrot 2021-10-20 16:44:50 -04:00
William Wernert
0ed2ce0766 Fix validation.sh tests 2021-10-20 16:44:09 -04:00
William Wernert
b5cb47e066 Fix sbin perms 2021-10-20 16:43:55 -04:00
Josh Patterson
8061508330 Merge pull request #5961 from Security-Onion-Solutions/issue/5960
Issue/5960
2021-10-20 16:08:50 -04:00
m0duspwnens
adffb11800 fix redis port 2021-10-20 15:39:21 -04:00
m0duspwnens
8619af59cc servers to list format 2021-10-20 15:02:33 -04:00
m0duspwnens
7ecfb55b70 fix pillar call 2021-10-20 14:50:50 -04:00
m0duspwnens
b496810b63 add redis and logstash input plugins to telegraf 2021-10-20 14:46:47 -04:00
Mike Reeves
e1ad02c28d Merge pull request #5949 from Security-Onion-Solutions/kilo
Fix Docker-created corruption of SOC user roles file
2021-10-19 18:37:37 -04:00
Jason Ertel
2f8bb5a2a6 Fix Docker-created corruption of SOC user roles file 2021-10-19 16:04:10 -04:00
weslambert
6f3e441bf7 Merge pull request #5945 from Security-Onion-Solutions/fix/soc_index_pattern
Remove space to allow pattern(s) to be correctly interpreted
2021-10-19 13:05:40 -04:00
Mike Reeves
7f1585dcc0 Merge pull request #5942 from Security-Onion-Solutions/tunesteno
Fix Steno Math for PL
2021-10-19 13:03:50 -04:00
weslambert
9453ed7fa1 Remove space to allow pattern(s) to be correctly interpreted 2021-10-19 13:01:40 -04:00
Mike Reeves
64f25961b0 Fix Steno Math for PL 2021-10-19 11:15:58 -04:00
Mike Reeves
b9a3d3a6a9 Fix Steno Math for PL 2021-10-19 11:14:02 -04:00
m0duspwnens
36cb0d6c42 remove space 2021-10-18 14:34:33 -04:00
m0duspwnens
1b2268dfe5 load kibana configs during setup 2021-10-18 14:30:47 -04:00
Mike Reeves
00e5b54dda Merge pull request #5911 from Security-Onion-Solutions/tunesteno
Add Steno Tuning Options
2021-10-18 09:01:14 -04:00
Mike Reeves
4016b416ec Merge pull request #5923 from Security-Onion-Solutions/kilo
Upgrade to ES 7.15.1
2021-10-16 09:15:06 -04:00
weslambert
7590728a0b Merge pull request #5915 from Security-Onion-Solutions/feature/ti_module
Add TI module
2021-10-15 17:17:33 -04:00
weslambert
bb36fc1ed8 Add TI module defaults 2021-10-15 17:16:38 -04:00
weslambert
d0a6dafc8b Add TI module 2021-10-15 17:09:59 -04:00
m0duspwnens
76097476d3 remove includes 2021-10-15 16:57:38 -04:00
m0duspwnens
8b3b0bf160 fix opts 2021-10-15 16:51:11 -04:00
m0duspwnens
f19680b3e6 fix opts 2021-10-15 16:50:03 -04:00
m0duspwnens
7e1bbe3cc2 define MAANGER 2021-10-15 16:14:14 -04:00
m0duspwnens
947285e932 update cmd.run amd s_o files 2021-10-15 16:06:25 -04:00
m0duspwnens
1741f5068a update config-load to do an update or import 2021-10-15 15:35:30 -04:00
Mike Reeves
a9f6c84d7c Add Steno Tuning Options 2021-10-15 14:17:54 -04:00
weslambert
59852841ff Add keyword subfield for event.module 2021-10-15 13:29:50 -04:00
weslambert
6f1f7d2a63 Merge pull request #5905 from Security-Onion-Solutions/feature/soc_es_index_pattern
Allow setting ES index patterns for SOC in pillar
2021-10-15 13:28:04 -04:00
Jason Ertel
8de8d58155 Upgrade to ES 7.15.1 2021-10-15 13:27:08 -04:00
Wes Lambert
8feeff97b5 Add EG index pattern during setup (if enabled) 2021-10-15 16:19:19 +00:00
Wes Lambert
032373187c Allow setting ES index patterns for SOC in pillar 2021-10-15 16:02:53 +00:00
William Wernert
db2b70f655 Merge pull request #5900 from Security-Onion-Solutions/foxtrot
Replace rather than append to Kibana misc log
2021-10-15 10:27:25 -04:00
Jason Ertel
1800ec4570 Upgrade to Elastalert 2 v2.2.2 2021-10-15 09:25:44 -04:00
Mike Reeves
8a5960c220 Merge pull request #5896 from Security-Onion-Solutions/kilo 2021-10-14 18:05:33 -04:00
Jason Ertel
9797a15218 Fix issue with 'so-user delete' resetting all user roles - note that this function is not technically supported or published since it's not intended for production use 2021-10-14 17:23:18 -04:00
William Wernert
c7b15a9b1f Replace rather than append to Kibana misc log 2021-10-14 15:13:55 -04:00
William Wernert
cba97802fe Fix indent 2021-10-14 15:13:34 -04:00
William Wernert
025256aeaf Merge pull request #5890 from Security-Onion-Solutions/foxtrot
Misc setup changes
2021-10-14 14:55:24 -04:00
weslambert
490f7eaf81 Merge pull request #5886 from Security-Onion-Solutions/feature/eg_pivot
Add EG pivot
2021-10-14 14:49:38 -04:00
m0duspwnens
6a2bf11a75 change format of file 2021-10-14 13:43:39 -04:00
m0duspwnens
78d30285b1 seperate securitySolutions load 2021-10-14 13:24:51 -04:00
Wes Lambert
f1fafa015e Add EG to list of groups to include 127.0.0.1 2021-10-14 16:27:28 +00:00
Wes Lambert
6cdc214582 Add pillar in setup and change name of EG variable 2021-10-14 15:33:37 +00:00
Wes Lambert
15049f44b9 Add EG pivot 2021-10-14 15:15:23 +00:00
Doug Burks
42a642b85c Merge pull request #5873 from petiepooo/enh-rediscount-tty
featreq: remove tty flag in redis-count script
2021-10-14 10:07:07 -04:00
weslambert
3b45e68ead Merge pull request #5885 from Security-Onion-Solutions/feature/jinjafy_soc_actions
Allow SOC actions to use Jinja
2021-10-14 10:03:12 -04:00
Wes Lambert
5ee0ea3fe7 Allow SOC actions to use Jinja 2021-10-14 13:59:55 +00:00
weslambert
55c60f485c Merge pull request #5884 from Security-Onion-Solutions/feature/hl_eg
Add EG firewall allowance via setup
2021-10-14 09:55:07 -04:00
Wes Lambert
78e88e0765 Add EG firewall allowance via setup 2021-10-13 21:42:54 +00:00
Wes Lambert
a9b250c0f4 Add EG firewall config 2021-10-13 21:37:59 +00:00
m0duspwnens
ae9753326a fix var, quote vars 2021-10-13 16:38:01 -04:00
m0duspwnens
c8fb504ee0 Revert "Merge remote-tracking branch 'remotes/origin/dev' into issue/3933"
This reverts commit 54eec92621, reversing
changes made to 7832e59629.
2021-10-13 15:22:46 -04:00
m0duspwnens
54eec92621 Merge remote-tracking branch 'remotes/origin/dev' into issue/3933 2021-10-13 15:19:33 -04:00
m0duspwnens
7832e59629 only load default kibana saved_objects during setup 2021-10-13 15:19:20 -04:00
weslambert
f9001654bb Merge pull request #5871 from Security-Onion-Solutions/feature/hl_eg
Initial EG stuff
2021-10-13 15:07:03 -04:00
Wes Lambert
2a504a061b Add Curator action files for EG indices 2021-10-13 18:40:34 +00:00
m0duspwnens
bb9c6446e4 Merge remote-tracking branch 'remotes/origin/dev' into issue/3933 2021-10-13 14:01:36 -04:00
Pete
e7581036f7 remove tty/interactive flags
This call to docker exec simply returns a number.  No interaction (stdin) or tty is required.  Specifically, having the -t option prevents running via salt using a command such as:

> salt '*' cmd.run 'so-redis-count'
2021-10-13 13:51:05 -04:00
Wes Lambert
e1629d7ec4 Initial EG stuff 2021-10-13 17:13:07 +00:00
Josh Patterson
b4873bd296 Merge pull request #5868 from Security-Onion-Solutions/issue/5818
Issue/5818
2021-10-13 12:52:48 -04:00
m0duspwnens
3044edb104 update comment 2021-10-13 12:38:58 -04:00
m0duspwnens
a495779552 only 3 attempts with 120s max attemps 2021-10-13 12:34:56 -04:00
m0duspwnens
880c1b97b0 remove $ from var 2021-10-13 12:25:11 -04:00
m0duspwnens
7a4fa8879c change count, attempts and timeout 2021-10-13 12:13:24 -04:00
m0duspwnens
adb8292814 add missing ) 2021-10-13 10:37:18 -04:00
m0duspwnens
6e7a5fa326 add timeouts to check_salt_minion_status and check_salt_master_status - https://github.com/Security-Onion-Solutions/securityonion/issues/5818 2021-10-13 09:45:15 -04:00
m0duspwnens
23ea53248d single line format 2021-10-12 14:15:37 -04:00
m0duspwnens
f1a5991699 add securitySolution.defaultIndex to defaults 2021-10-12 12:35:13 -04:00
m0duspwnens
c69ad091f7 update saved_objects config 2021-10-12 12:02:30 -04:00
William Wernert
b97361fab9 Remove references to xenial in setup
Resolves #4292
2021-10-12 10:23:39 -04:00
William Wernert
36e1795295 Add end of setup log messages per #5032 2021-10-12 10:19:47 -04:00
m0duspwnens
498e385484 change name to SAVED_OBJECTS 2021-10-12 10:15:39 -04:00
William Wernert
af687b0706 Remove all holds on Ubuntu reinstall 2021-10-12 10:10:34 -04:00
m0duspwnens
19489f3626 Merge remote-tracking branch 'remotes/origin/dev' into issue/3933 2021-10-12 10:07:40 -04:00
m0duspwnens
89d1df8a1d change name to SAVED_OBJECTS 2021-10-12 10:07:26 -04:00
William Wernert
946cf81a27 If ANALYST is selected immediately quit setup 2021-10-12 09:48:38 -04:00
Mike Reeves
2561480371 Merge pull request #5850 from Security-Onion-Solutions/kilo
Upgrade to Kratos 0.7.6-alpha.1
2021-10-12 08:19:25 -04:00
Jason Ertel
d21dee162d Add Note field to user traits; Enforce max length restrictions on email, firstname, lastname, and note fields 2021-10-08 12:39:17 -04:00
Mike Reeves
444d067112 Merge pull request #5813 from Security-Onion-Solutions/macleod
Highlander changes
2021-10-08 10:06:18 -04:00
Mike Reeves
2a82373051 highlander fixes 2021-10-08 09:32:13 -04:00
Mike Reeves
64758a534c Set ml to true 2021-10-08 08:42:26 -04:00
m0duspwnens
7517a63008 disabled ml 2021-10-07 13:06:52 -04:00
m0duspwnens
b2facdf31c add securitySolutions advanced setting 2021-10-07 12:57:28 -04:00
m0duspwnens
4c54d6309c change host to 0.0.0.0 2021-10-07 09:59:29 -04:00
Jason Ertel
62c3afc81d Migrate users from locked to inactive during soup 2021-10-06 15:45:35 -04:00
Jason Ertel
7d8c8144b0 Drop obsolete status trait 2021-10-06 12:52:41 -04:00
Jason Ertel
a2c4fce1ef Switch to use state attribute in identities for enabling/disabling users 2021-10-06 11:53:10 -04:00
m0duspwnens
599aba43d9 restart so-kibaba if config changes 2021-10-06 09:51:16 -04:00
m0duspwnens
fa4f92cdda change defaults 2021-10-05 17:35:44 -04:00
m0duspwnens
5d98c0d14c fix dict update 2021-10-05 15:57:57 -04:00
Mike Reeves
27614569e3 Fix set 2021-10-05 14:32:02 -04:00
m0duspwnens
ec357cca3c fix cars 2021-10-05 12:57:30 -04:00
m0duspwnens
26681ac98a var for dash saved objevs 2021-10-05 12:46:21 -04:00
m0duspwnens
748f0f2a1d Merge remote-tracking branch 'remotes/origin/dev' into issue/3933 2021-10-05 12:12:56 -04:00
Mike Reeves
869af548af Fix spaces for highlander 2021-10-05 11:06:13 -04:00
Mike Reeves
2fd344822d Add additional roles for highlander 2021-10-05 10:40:40 -04:00
Mike Reeves
a3e0fb127a Merge pull request #5069 from datlife/datlife/asn-annotation
Add ASN annotation for IP
2021-10-05 06:50:31 -04:00
Dat
9569e73bd0 Added ASN annotation for IP 2021-10-04 12:41:20 -07:00
m0duspwnens
96d783b158 merge with dev 2021-10-04 10:39:48 -04:00
m0duspwnens
e0c097c270 add dashboard theme defaults 2021-10-04 10:36:58 -04:00
Mike Reeves
e6fce4cf3e Merge pull request #5749 from Security-Onion-Solutions/kilo
Use safe_load to avoid warnings - credit to @clairmont32
2021-10-04 08:55:53 -04:00
Jason Ertel
6ef9a5c95d Use safe_load to avoid warnings - credit to @clairmont32 2021-10-04 08:53:25 -04:00
Mike Reeves
727613b6e1 Merge pull request #5601 from Security-Onion-Solutions/special
Ubuntu 20.04 Beta
2021-10-04 08:51:01 -04:00
Mike Reeves
5013aa8490 Merge pull request #5748 from Security-Onion-Solutions/kilo
Merge ES Upgrade, Version Bump into dev
2021-10-04 08:48:07 -04:00
Jason Ertel
72a1b299ac Bump to 2.3.90 2021-10-04 08:44:51 -04:00
Mike Reeves
cfaa0e679c Merge pull request #5739 from Security-Onion-Solutions/dev
2.3.80
2021-10-01 15:15:54 -04:00
Mike Reeves
4ddf2b49ce Merge pull request #5669 from Security-Onion-Solutions/2.3.80
2.3.80
2021-10-01 15:11:03 -04:00
m0duspwnens
bb95963d73 add missing {{}} 2021-09-30 14:40:13 -04:00
m0duspwnens
dfa9afde0e change to mode 2021-09-30 14:33:52 -04:00
m0duspwnens
fa2333b9ef change t file.managed 2021-09-30 14:32:28 -04:00
m0duspwnens
8b9c43915d fix source 2021-09-30 14:30:00 -04:00
m0duspwnens
36832139b2 pillarize kibana 2021-09-30 14:28:31 -04:00
m0duspwnens
c3bf835566 kibana config 2021-09-30 14:23:49 -04:00
m0duspwnens
39d3c7c6ed begin pillarization of kibana 2021-09-30 11:48:42 -04:00
Jason Ertel
b1a5527e82 Update ElastAlert to use ElastAlert 2 2021-09-28 07:01:47 -04:00
Jason Ertel
d0592c4293 Update ElastAlert to use ElastAlert 2 2021-09-28 00:51:29 -04:00
Mike Reeves
b1d0e3e93f 2.3.80 2021-09-27 12:32:45 -04:00
Mike Reeves
b069377c8a 2.3.80 2021-09-27 10:13:42 -04:00
Jason Ertel
e9a44c6e1b Merge pull request #5662 from Security-Onion-Solutions/TOoSmOotH-patch-1
Update README.md
2021-09-27 09:28:46 -04:00
Mike Reeves
275163f85d Update README.md 2021-09-27 07:36:54 -04:00
William Wernert
98f74c25ba Fix variable reference in so-functions 2021-09-24 12:32:56 -04:00
William Wernert
3064800820 Merge pull request #5636 from Security-Onion-Solutions/fix/soup-2.3.80
Misc. soup fixes
2021-09-23 13:03:43 -04:00
William Wernert
f8bea82430 Make redirect consistent with setup 2021-09-23 12:57:08 -04:00
William Wernert
8b905b585d Fix redirect to append 2021-09-23 12:55:06 -04:00
William Wernert
b44358fc26 Add set +e after final upgrade steps and before post-upgrade checks 2021-09-23 12:49:42 -04:00
William Wernert
8a9dcb7fdb Fix "upgrade to" message
Only specify "to" version and change when the upgrade message occurs
2021-09-23 12:47:22 -04:00
William Wernert
a01d49981c Redirect thehive/cortex migrate curl output to soup log 2021-09-23 12:45:44 -04:00
William Wernert
b8b1867e52 Tell user what soup is doing at end of upgrade 2021-09-23 12:43:23 -04:00
William Wernert
292ce37ce4 Merge pull request #5632 from Security-Onion-Solutions/fix/logscan-soup
Add logscan to images for pull during soup if it's enabled
2021-09-23 10:13:20 -04:00
William Wernert
73dacdcbff Add logscan to images for pull during soup if it's enabled 2021-09-23 09:52:23 -04:00
Josh Patterson
bea7555464 Merge pull request #5631 from Security-Onion-Solutions/80soup
80soup
2021-09-22 16:01:45 -04:00
m0duspwnens
52c1298b9b notify of custom es config 2021-09-22 15:16:07 -04:00
m0duspwnens
cdb9dcbaec notify of custom es config 2021-09-22 15:07:36 -04:00
Mike Reeves
37153288e8 Merge pull request #5627 from Security-Onion-Solutions/80soup
ignore manager pillar file for noderoutetype
2021-09-22 12:03:55 -04:00
m0duspwnens
edf75255cf ignore manager pillar file for noderoutetype 2021-09-22 12:01:32 -04:00
Jason Ertel
9eb6f5942e Merge pull request #5623 from Security-Onion-Solutions/kilo
Prevent email addresses from having uppercase characters
2021-09-22 09:10:38 -04:00
Jason Ertel
dae41d279a Prevent emails addresses from having uppercase characters 2021-09-22 08:25:55 -04:00
Mike Reeves
07288367cf Merge pull request #5611 from Security-Onion-Solutions/80soup
match elasticsearch at beginning of line
2021-09-21 15:42:09 -04:00
m0duspwnens
f4186feffa move node_route_type 2021-09-21 15:40:49 -04:00
m0duspwnens
d82e91f69e match elasticsearch at beginning of line 2021-09-21 13:54:45 -04:00
Josh Patterson
a2680fad0a Merge pull request #5605 from Security-Onion-Solutions/80soup
fi xquotes
2021-09-21 13:02:58 -04:00
m0duspwnens
5c2be487f5 fi xquotes 2021-09-21 13:01:40 -04:00
Mike Reeves
531c9de488 Merge pull request #5600 from petiepooo/petiepooo-raidstat-fix
missing dollarsign
2021-09-21 11:35:57 -04:00
Pete
19efa493ad missing dollarsign 2021-09-21 11:21:07 -04:00
Mike Reeves
0db3f14261 Merge pull request #5598 from Security-Onion-Solutions/80soup
Soup Changes for True Clusters
2021-09-21 09:57:12 -04:00
Mike Reeves
ed28e4d000 Soup Changes for True Clusters 2021-09-21 09:55:49 -04:00
Mike Reeves
2c8cbf0db1 Soup Changes for True Clusters 2021-09-21 09:53:09 -04:00
Mike Reeves
c1537335b1 Fix Python Problem 2021-09-20 19:05:01 -04:00
Mike Reeves
5f475ff9cb Fix Python Problem 2021-09-20 18:46:43 -04:00
Mike Reeves
481ffb1cda Fix Grain 2021-09-20 18:12:18 -04:00
Mike Reeves
50b78681f2 Ubuntu 20.04 Support 2021-09-20 17:24:47 -04:00
Jason Ertel
3924b8f5db Merge pull request #5586 from Security-Onion-Solutions/kilo
Ensure identity ID parm is quoted now that it doesn't have embedded quotes in the value
2021-09-20 13:56:30 -04:00
Jason Ertel
a9049eccd4 Ensure identity ID parm is quoted now that it doesn't have embedded quotes in the value 2021-09-20 13:30:05 -04:00
Mike Reeves
1a7237bcdf Merge pull request #5583 from Security-Onion-Solutions/TOoSmOotH-patch-1
Update soup
2021-09-20 10:44:20 -04:00
Mike Reeves
1e5e1c9ef0 Update soup 2021-09-20 10:42:55 -04:00
Josh Patterson
47cd1ddc0a Merge pull request #5580 from Security-Onion-Solutions/issue/1257
Issue/1257 - Pillarize ES
2021-09-20 09:31:03 -04:00
m0duspwnens
aed73511e4 file cleanup, comment cleanup 2021-09-20 09:24:03 -04:00
Jason Ertel
a3f62c81c3 Merge pull request #5577 from Security-Onion-Solutions/kilo
Continuation of auth enhancements
2021-09-20 06:30:36 -04:00
Jason Ertel
730503b69c Ensure highstate migrates user roles 2021-09-18 23:17:49 -04:00
Jason Ertel
3508f3d8c1 Ensure ES user/role files are generated even if the primary admin user isn't yet created, since the system users are necessary for other installation functions 2021-09-18 19:20:43 -04:00
Jason Ertel
5704906b11 Create empty files for Docker to mount while installation continues 2021-09-18 15:49:05 -04:00
Jason Ertel
357c1db445 Recover from situation where roles file is corrupted 2021-09-18 11:08:35 -04:00
Jason Ertel
5377a1a85e Recover from situation where roles file is corrupted 2021-09-18 11:06:54 -04:00
Jason Ertel
7f2d7eb038 Continue migration of user emails to IDs 2021-09-18 07:20:34 -04:00
Jason Ertel
30e781d076 Use user ID instead of email as role master 2021-09-17 17:54:38 -04:00
m0duspwnens
01323cc192 fix clustername redirect 2021-09-17 15:44:54 -04:00
m0duspwnens
109c83d8c3 move custom es cluster name pillar location 2021-09-17 15:29:41 -04:00
m0duspwnens
e864bc5404 move custom es cluster name pillar location 2021-09-17 15:28:35 -04:00
Josh Brower
22eb82e950 Merge pull request #5566 from Security-Onion-Solutions/feature/disable_services
Add support for disabling Zeek and Suricata
2021-09-17 14:18:03 -04:00
m0duspwnens
b877aa44bc update dict 2021-09-17 14:10:45 -04:00
Josh Brower
4d307c53e8 Add support for disabling Zeek and Suricata 2021-09-17 13:01:50 -04:00
m0duspwnens
d0c87cd317 allow for pillar override of defaults 2021-09-17 12:11:12 -04:00
m0duspwnens
0d074dafd4 add missing defaults 2021-09-17 09:52:50 -04:00
m0duspwnens
5b77dc109f Merge remote-tracking branch 'remotes/origin/dev' into issue/1257 2021-09-16 16:54:23 -04:00
m0duspwnens
3ce48acadd change cluster_settings to config 2021-09-16 16:44:31 -04:00
Jason Ertel
fbd9bab2f1 Split apart roles and users into separate maps 2021-09-16 16:08:55 -04:00
m0duspwnens
5526a2bc3a reduce defaults.yaml 2021-09-16 15:32:08 -04:00
weslambert
18d81352c6 Merge pull request #5537 from Security-Onion-Solutions/delta
Add improved ignore functionality for YARA rules used by Strelka and add default ignored rules that break compilation
2021-09-16 10:38:49 -04:00
m0duspwnens
889d235c45 no box type more manager in true cluster 2021-09-16 09:15:24 -04:00
Jason Ertel
3fc26312e0 Remove x-user-id header from unauthenticated proxied requests 2021-09-16 08:52:31 -04:00
Jason Ertel
b81d38e392 Merge branch 'dev' into kilo 2021-09-16 07:44:35 -04:00
Jason Ertel
82da0041a4 Add limited roles with restricted visibility 2021-09-16 07:44:15 -04:00
m0duspwnens
782b01e76f seed_hosts to list 2021-09-15 17:07:52 -04:00
m0duspwnens
3bf9685df8 fix seed_hosts append 2021-09-15 17:00:16 -04:00
m0duspwnens
4cf91f6c86 fix dict update 2021-09-15 15:51:00 -04:00
m0duspwnens
a43b37f234 fix dict update 2021-09-15 15:49:18 -04:00
m0duspwnens
e0dc62b6e9 fix dict update 2021-09-15 15:43:47 -04:00
m0duspwnens
c213834316 update the dict 2021-09-15 15:24:40 -04:00
Josh Brower
c06668c68e Merge pull request #5527 from Security-Onion-Solutions/feature/so-import-evtx
Feature/so import evtx
2021-09-15 14:17:15 -04:00
Josh Brower
a75238bc3f so-import-evtx - fix ingest formatting 2021-09-15 14:13:16 -04:00
Josh Brower
ac417867ed so-import-evtx - final fixes 2021-09-15 14:06:08 -04:00
m0duspwnens
1614b70853 update cluster name if true cluster 2021-09-15 13:45:43 -04:00
Mike Reeves
0882158e03 Merge pull request #5525 from Security-Onion-Solutions/soup80
soup changes 2.3.80
2021-09-15 13:44:54 -04:00
m0duspwnens
1a03853a7c fix extend 2021-09-15 13:38:29 -04:00
Mike Reeves
aff571faf2 soup changes 2.3.80 2021-09-15 13:32:52 -04:00
m0duspwnens
e0faa4c75b Merge branch 'issue/1257' of https://github.com/Security-Onion-Solutions/securityonion into issue/1257 2021-09-15 13:09:35 -04:00
m0duspwnens
e3e2e1d851 logic for truecluster to map file 2021-09-15 13:09:04 -04:00
weslambert
2affaf07a2 Merge pull request #5521 from Security-Onion-Solutions/fix/strelka-yara
Fix/strelka yara
2021-09-15 11:33:44 -04:00
weslambert
39e5ded58d Refactor ignore list and only ignore for signature-base for now 2021-09-15 11:32:29 -04:00
weslambert
4d41d3aee1 Ignore these rules by default because they are causing issues with YARA compilation with Strelka 2021-09-15 10:29:11 -04:00
weslambert
5c8067728e Remove unnecessary logic 2021-09-15 10:22:17 -04:00
Josh Brower
1d905124d3 Merge pull request #5519 from Security-Onion-Solutions/fix/fleet-link
Fix Fleet Link Logic
2021-09-15 09:30:21 -04:00
Josh Brower
e0a289182f Fix Fleet Link Logic 2021-09-15 09:28:23 -04:00
m0duspwnens
551dba955c set roles empty list 2021-09-15 09:20:33 -04:00
Jason Ertel
9970e54081 Adjust custom_role examples to be more realistic 2021-09-14 14:03:22 -04:00
Jason Ertel
ff989b1c73 Include wording in so-user relating to optional role parameter 2021-09-14 14:03:00 -04:00
Mike Reeves
2ffb723bbd Rename so-common-template.json to so-common-template.json.jinja 2021-09-14 13:58:45 -04:00
Mike Reeves
6ae2fba71f Update search.sls 2021-09-14 13:57:26 -04:00
Mike Reeves
2cc25587d9 Update eval.sls 2021-09-14 13:57:04 -04:00
Mike Reeves
614a6dc9fe Update manager.sls 2021-09-14 13:56:43 -04:00
Josh Brower
4b7667d87f Merge pull request #5508 from Security-Onion-Solutions/fix/fleet-link
Fleet SA - SOC Link Fix
2021-09-14 13:29:20 -04:00
Josh Brower
74b0b365bd Fleet SA - SOC Link Fix 2021-09-14 13:23:07 -04:00
Josh Brower
0b0d508585 so-import-evtx - tweaks 2021-09-14 12:01:14 -04:00
m0duspwnens
0534a2dda3 Merge remote-tracking branch 'remotes/origin/dev' into issue/1257 2021-09-13 15:04:50 -04:00
m0duspwnens
f8ab0ac8a9 config changes 2021-09-13 15:04:39 -04:00
m0duspwnens
0ae09cc630 config changes 2021-09-13 09:49:56 -04:00
Mike Reeves
332c4dda22 Merge pull request #5469 from Security-Onion-Solutions/fix/idstools-rule-clear
Allow so-rule-update to accept any number of args
2021-09-10 14:41:55 -04:00
William Wernert
679faddd52 Update so-rule-update to pass all args to docker exec
Instead of passing $1, build a string from all args and add that to the command string for the docker exec statement
2021-09-10 13:44:37 -04:00
William Wernert
0b42b19763 Update so-rule-update to source so-common 2021-09-10 13:41:58 -04:00
William Wernert
943bd3e902 Merge pull request #5468 from Security-Onion-Solutions/fix/idstools-rule-clear
Add `--force` flag to idstools-rulecat under so-rule-update
2021-09-10 13:17:16 -04:00
Mike Reeves
4af6a901a1 Merge pull request #5461 from Security-Onion-Solutions/truclusterrator
Add new hunt fields
2021-09-10 13:17:01 -04:00
William Wernert
9c310de459 Add --force flag to idstools-rulecat under so-rule-update
This forces idstools to pull from the url each time, which prevents it from clearing all.rules if idstools-rulecat is run twice within 15 minutes by any method (either restarting the container or running so-rule-update)
2021-09-10 13:15:09 -04:00
Mike Reeves
4f6a3269cb Add more detail to syscollector 2021-09-10 09:59:47 -04:00
Doug Burks
6a2e1df7d4 Merge pull request #5460 from Security-Onion-Solutions/feature/welcome-link-docs
FEATURE: Add docs link to Setup #5459
2021-09-10 07:27:48 -04:00
doug
db50ef71b4 FEATURE: Add docs link to Setup #5459 2021-09-10 06:19:16 -04:00
Jason Ertel
4e2d5018a2 Merge pull request #5455 from Security-Onion-Solutions/kilo
Consolidate whiptail screens
2021-09-09 14:57:28 -04:00
Jason Ertel
94688a9adb Eliminate adv component popup 2021-09-09 14:29:09 -04:00
Jason Ertel
63f67b3500 Rephrase screen that warns about more RAM requirements 2021-09-09 14:16:05 -04:00
Mike Reeves
eaa5e41651 Merge pull request #5450 from Security-Onion-Solutions/TOoSmOotH-patch-1
Fix Raid Status for cloud
2021-09-09 11:09:49 -04:00
Mike Reeves
c83f119cc0 Update so-raid-status 2021-09-09 10:59:35 -04:00
Mike Reeves
5d235e932c Fix Raid Status for cloud 2021-09-09 10:46:28 -04:00
m0duspwnens
93f2cd75a4 add the jinja template 2021-09-09 10:19:46 -04:00
m0duspwnens
f06ab8b77d testing defaults.yaml 2021-09-09 08:55:36 -04:00
weslambert
03b45512fa Merge pull request #5436 from Security-Onion-Solutions/fix/kibana_server_url
Incude server.publicBaseUrl
2021-09-08 12:13:48 -04:00
weslambert
b8600be0f1 Incude server.publicBaseUrl 2021-09-08 12:12:09 -04:00
Jason Ertel
19a02baa7c Merge pull request #5425 from Security-Onion-Solutions/kilo
Auth enhancements
2021-09-07 13:10:36 -04:00
Jason Ertel
3c59579f99 Add maintenance privilege for analysts to refresh indices 2021-09-07 13:03:30 -04:00
Mike Reeves
3f989590ad Merge pull request #5402 from Security-Onion-Solutions/TOoSmOotH-patch-6
Enable index sorting by default but allow it to be disabled
2021-09-07 11:28:40 -04:00
Jason Ertel
72cff7ec7a Merge branch 'dev' into kilo 2021-09-07 10:49:08 -04:00
Mike Reeves
e3900606dc Enable index sorting by default but allow it to be disabled 2021-09-04 10:42:18 -04:00
Mike Reeves
a2fd8ae200 Merge pull request #5401 from rwaight/dev
Enable index sorting in `so-common-template.json`
2021-09-04 10:32:57 -04:00
Rob Waight
b7591093cf Add index sorting to so-common-template.json
Add index sorting to so-common-template.json
2021-09-04 09:45:03 -04:00
Rob Waight
51439cd1ab Merge pull request #1 from Security-Onion-Solutions/dev
sync with SO/Dev
2021-09-04 09:43:23 -04:00
Jason Ertel
94ea1f856b Add auditor role; update analyst role with correct syntax 2021-09-03 15:59:48 -04:00
Jason Ertel
fbbb7f4e85 Add auditor role; update analyst role with correct syntax 2021-09-03 15:54:05 -04:00
Mike Reeves
7b3a0cd1e4 Merge pull request #5394 from Security-Onion-Solutions/TOoSmOotH-patch-5
Add maxfiles to the steno config
2021-09-03 10:49:59 -04:00
Mike Reeves
9fb28709d5 Add maxfiles to the steno config 2021-09-03 10:47:00 -04:00
Jason Ertel
649f339934 Correct typo 2021-09-02 20:30:48 -04:00
Jason Ertel
f659079542 Consolidate password validation messaging 2021-09-02 19:12:32 -04:00
Jason Ertel
ce70380f0f resolve so-user errors from recent auth changes 2021-09-02 17:59:33 -04:00
Jason Ertel
c4d402d8b4 Ensure role file exists before ES state is run 2021-09-02 15:45:47 -04:00
Mike Reeves
9f5dafd560 More Event Fields 2021-09-02 13:48:18 -04:00
Mike Reeves
1cee603ee4 Squid event fields 2021-09-02 13:24:04 -04:00
William Wernert
a14854d56d Merge pull request #5383 from Security-Onion-Solutions/feature/soup-y
Add logic to check unattended flag when checking OS updates
2021-09-02 11:50:45 -04:00
Mike Reeves
2bf471054b Cloudtrail Event Fields 2021-09-02 11:46:18 -04:00
William Wernert
56894b9581 Add logic to check unattended flag when checking if updates are available 2021-09-02 11:15:32 -04:00
Jason Ertel
10126bb7ef Auth enhancements 2021-09-02 09:44:57 -04:00
Jason Ertel
6dfc943e8c Merge pull request #5382 from Security-Onion-Solutions/kilo
Correct invalid password message
2021-09-02 07:15:09 -04:00
Jason Ertel
84ecc3cba7 Merge branch 'dev' into kilo 2021-09-02 07:09:36 -04:00
Jason Ertel
0ad3d826eb Invalid password message should also mention that dollar signs are not allowed 2021-09-02 07:07:36 -04:00
William Wernert
d785dafe2f Merge pull request #5374 from Security-Onion-Solutions/feature/soup-y
Add unattended soup flag, and iso location argument for air gap
2021-09-01 16:48:55 -04:00
Mike Reeves
e3dffcc2cb Merge pull request #5373 from Security-Onion-Solutions/truclusterrator
Add eventfields for new default logs
2021-09-01 16:48:51 -04:00
Mike Reeves
556bad6925 Add eventfields for new default logs 2021-09-01 15:13:43 -04:00
William Wernert
446821e9fd Use exit code 0 when printing error message before exiting soup 2021-09-01 15:11:18 -04:00
William Wernert
576c893eb3 Exit on missing file argument 2021-09-01 15:08:53 -04:00
Mike Reeves
34a5d6e56a Merge pull request #5367 from Security-Onion-Solutions/truclusterrator
Allow closing of fb module indices in global
2021-09-01 10:54:02 -04:00
Mike Reeves
324e6b12e2 Add jinja template 2021-09-01 09:32:32 -04:00
Mike Reeves
007b15979a Non Cluster honor closed indices values 2021-09-01 09:25:14 -04:00
Mike Reeves
c168703e9f Merge pull request #5362 from Security-Onion-Solutions/truclusterrator
True Cluster Curator Overhaul
2021-08-31 17:17:47 -04:00
Mike Reeves
527a793e94 Only enable curator on Manager in true cluster 2021-08-31 16:59:41 -04:00
Mike Reeves
61ebedc0e9 Only enable curator on Manager in true cluster 2021-08-31 16:56:08 -04:00
Mike Reeves
e09aa4e5d4 Only enable curator on Manager in true cluster 2021-08-31 16:35:19 -04:00
Mike Reeves
e7b04b862f Only enable curator on Manager in true cluster 2021-08-31 16:21:48 -04:00
Mike Reeves
62edfd0b7f Only enable curator on Manager in true cluster 2021-08-31 16:20:42 -04:00
Mike Reeves
958575c22a Only enable curator on Manager in true cluster 2021-08-31 16:17:55 -04:00
Mike Reeves
0c8e11dc9f Only enable curator on Manager in true cluster 2021-08-31 16:13:05 -04:00
Mike Reeves
5b9ef3bc0d Only enable curator on Manager in true cluster 2021-08-31 15:55:44 -04:00
Mike Reeves
c12f380bc3 Only enable curator on Manager in true cluster 2021-08-31 15:51:34 -04:00
Mike Reeves
dc25ed2594 Add logic for cronjobs 2021-08-31 15:43:48 -04:00
Mike Reeves
9f51f02ab4 Add logic for cronjobs 2021-08-31 15:40:09 -04:00
Mike Reeves
f6f4375e13 Add logic for cronjobs 2021-08-31 15:34:26 -04:00
Mike Reeves
ed116cf850 Add Actions for warm indices 2021-08-31 15:09:26 -04:00
Mike Reeves
476ecccbc1 Add Actions for warm indices 2021-08-31 15:08:10 -04:00
Mike Reeves
c09cebbd6b Add Actions for close and delete in cluster mode 2021-08-31 13:42:11 -04:00
Mike Reeves
0ed92fd9bd Merge pull request #5359 from Security-Onion-Solutions/kilo
Merge 2.3.70 Wazuh hotfix into dev
2021-08-31 13:39:21 -04:00
Jason Ertel
c3454c9e8a Merge branch 'master' into kilo 2021-08-31 13:37:46 -04:00
Mike Reeves
3425a0fe78 Delete Curators for all modules 2021-08-31 11:12:21 -04:00
Mike Reeves
9605eda559 Close Curators for all modules 2021-08-31 10:49:39 -04:00
Mike Reeves
ff09d9ca58 Merge pull request #5355 from Security-Onion-Solutions/TOoSmOotH-patch-5
Update VERIFY_ISO.md
2021-08-31 10:06:12 -04:00
Mike Reeves
77b82bf2c0 Update VERIFY_ISO.md 2021-08-31 10:01:32 -04:00
Mike Reeves
ccc8f9ff0a Merge pull request #5353 from Security-Onion-Solutions/hotfix/2.3.70 2021-08-31 09:57:05 -04:00
Mike Reeves
43d20226a8 Merge pull request #5352 from Security-Onion-Solutions/wazhf
2.3.70 WAZUH Hotfix sigs
2021-08-31 08:47:14 -04:00
Mike Reeves
4fe0a1d7b4 2.3.70 WAZUH Hotfix sigs 2021-08-31 08:39:37 -04:00
Mike Reeves
7a48a94624 Merge branch 'dev' of https://github.com/Security-Onion-Solutions/securityonion into truclusterrator 2021-08-31 08:22:55 -04:00
Mike Reeves
1aacc27cd4 Merge pull request #5340 from Security-Onion-Solutions/TOoSmOotH-patch-4
Update HOTFIX
2021-08-30 17:48:53 -04:00
Mike Reeves
92858cd13a Update HOTFIX 2021-08-30 17:38:29 -04:00
Mike Reeves
99cb38362a Merge pull request #5339 from Security-Onion-Solutions/hotfix/wazuh-update-exclude
wazuh-agent fix + pull in master
2021-08-30 17:37:47 -04:00
William Wernert
bfd632e20a Add wazuh to exclude arg when running yum update 2021-08-30 14:21:13 -04:00
Mike Reeves
518f9fceb0 Merge pull request #5337 from Security-Onion-Solutions/TOoSmOotH-patch-3
Update HOTFIX
2021-08-30 12:33:43 -04:00
Mike Reeves
2b34da0fee Update HOTFIX 2021-08-30 12:32:44 -04:00
William Wernert
72859adb13 Fix typo in so-checkin 2021-08-27 15:23:01 -04:00
Mike Reeves
a27263435a Add Templates for all filebeat modules 2021-08-27 14:41:04 -04:00
Mike Reeves
f8cdf5bca3 Add Templates for all filebeat modules 2021-08-27 14:39:02 -04:00
William Wernert
ca5339341f Fix batch size regex to disallow 0 2021-08-27 11:34:28 -04:00
William Wernert
c5d120293d Initial work to add unattended option to soup 2021-08-27 11:33:51 -04:00
Jason Ertel
12b5c0899b merge 2021-08-27 08:20:23 -04:00
Jason Ertel
09d5097837 Remove unused automation files 2021-08-25 21:08:49 -04:00
Jason Ertel
de5f823abf Add automation for deploy-vader env 2021-08-25 18:28:17 -04:00
Josh Brower
7b93f355e2 so-import-evtx - timestamp extraction 2021-08-25 15:17:19 -04:00
m0duspwnens
a27569f20b remove source when contents provided 2021-08-25 12:32:17 -04:00
m0duspwnens
fd1e632386 cleanup yaml 2021-08-25 12:08:43 -04:00
m0duspwnens
0681d29bb0 starting es pillarization 2021-08-25 10:23:06 -04:00
Josh Brower
ef650c6ee6 Merge pull request #5235 from Security-Onion-Solutions/feature/so-playbook-import
Initial version so-playbook-import
2021-08-24 10:40:07 -04:00
Mike Reeves
24f36bb4c9 Merge pull request #5284 from Security-Onion-Solutions/kilo
Merge 2.3.70 GRAFANA hotfix to dev
2021-08-24 10:27:09 -04:00
m0duspwnens
9783d13ea3 remove identifier from HOTFIX file 2021-08-24 10:22:01 -04:00
m0duspwnens
427ec98ce5 fix merge conflict in HOTFIX file 2021-08-24 10:20:42 -04:00
Josh Patterson
72ba29fb7b Merge pull request #5282 from Security-Onion-Solutions/hotfix/2.3.70
Hotfix/2.3.70
2021-08-24 10:15:33 -04:00
Josh Patterson
2859bff0e4 Merge pull request #5281 from Security-Onion-Solutions/grafana_fleet_hotfix
sig files and iso info
2021-08-24 10:01:10 -04:00
Mike Reeves
6e921415ea sig files and iso info 2021-08-24 10:00:06 -04:00
Mike Reeves
2f8b68e67a sig files and iso info 2021-08-24 09:58:28 -04:00
Mike Reeves
e762491039 Merge branch 'dev' of https://github.com/Security-Onion-Solutions/securityonion into truclusterrator 2021-08-24 09:50:41 -04:00
Mike Reeves
11381e304b Merge pull request #5273 from Security-Onion-Solutions/kilo
Switch to new Curator auth params
2021-08-24 08:29:47 -04:00
Jason Ertel
6d49bca0ac Switch to new auth params 2021-08-23 15:36:11 -04:00
Josh Patterson
8ea89932ae Merge pull request #5270 from Security-Onion-Solutions/grafana_fleet_hotfix
Grafana fleet hotfix
2021-08-23 13:10:35 -04:00
m0duspwnens
f87cf123b0 fix typo - https://github.com/Security-Onion-Solutions/securityonion/issues/5268 2021-08-23 13:08:11 -04:00
m0duspwnens
80f4d03254 place unique identifier on same line for hotfix - https://github.com/Security-Onion-Solutions/securityonion/issues/5268 2021-08-23 13:05:28 -04:00
m0duspwnens
a9cc68f89e add unique identifier for hotfix - https://github.com/Security-Onion-Solutions/securityonion/issues/5268 2021-08-23 13:02:49 -04:00
m0duspwnens
b053f29a89 only create dashboards for certain node types - https://github.com/Security-Onion-Solutions/securityonion/issues/5268 2021-08-23 12:58:52 -04:00
Mike Reeves
19cfce5e0b Add curator delete yml files 2021-08-23 10:47:41 -04:00
Mike Reeves
c4a32ca631 Merge pull request #5259 from Security-Onion-Solutions/kilo
Merge 2.3.70 CURATOR Hotfix to Dev
2021-08-23 09:37:50 -04:00
Jason Ertel
b78da5c237 Merge hotfix to dev; reset to .80 2021-08-23 09:36:20 -04:00
Josh Brower
aa420b914b Initial version so-playbook-import 2021-08-20 16:27:09 -04:00
399 changed files with 21576 additions and 8154 deletions

View File

@@ -15,7 +15,7 @@
### Contributing code
* **All commits must be signed** with a valid key that has been added to your GitHub account. The commits should have all the "**Verified**" tag when viewed on GitHub as shown below:
* **All commits must be signed** with a valid key that has been added to your GitHub account. Each commit should have the "**Verified**" tag when viewed on GitHub as shown below:
<img src="./assets/images/verified-commit-1.png" width="450">

3
HOTFIX
View File

@@ -1,2 +1 @@
CURATOR
WAZUH AIRGAPFIX

View File

@@ -1,6 +1,6 @@
## Security Onion 2.3.70
## Security Onion 2.3.90-WAZUH
Security Onion 2.3.70 is here!
Security Onion 2.3.90-AIRGAPFIX is here!
## Screenshots

View File

@@ -1,18 +1,18 @@
### 2.3.70-CURATOR ISO image built on 2021/08/20
### 2.3.90-AIRGAPFIX ISO image built on 2021/12/01
### Download and Verify
2.3.70-CURATOR ISO image:
https://download.securityonion.net/file/securityonion/securityonion-2.3.70-CURATOR.iso
2.3.90-AIRGAPFIX ISO image:
https://download.securityonion.net/file/securityonion/securityonion-2.3.90-AIRGAPFIX.iso
MD5: E0F7882E37B1B6BC4F9A6C8FD6F213F6
SHA1: 82E1204BAD9489B275A083A642F175E352F9A332
SHA256: 147CA7F5082273EDCC32EF6322D86A04CCB2E96B3A7F0B01EFA8A029BD84C3D7
MD5: A87EEF66FEB2ED6E20ABD4ADDA4899C6
SHA1: D1AD74D1481E9FF6F1A79D27DC569DA6749EC54B
SHA256: E4FC40340357B098E881F13BC4960AA8CB5F5AC73C05E077C993078ED7F46D59
Signature for ISO image:
https://github.com/Security-Onion-Solutions/securityonion/raw/master/sigs/securityonion-2.3.70-CURATOR.iso.sig
https://github.com/Security-Onion-Solutions/securityonion/raw/master/sigs/securityonion-2.3.90-AIRGAPFIX.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.70-CURATOR.iso.sig
wget https://github.com/Security-Onion-Solutions/securityonion/raw/master/sigs/securityonion-2.3.90-AIRGAPFIX.iso.sig
```
Download the ISO image:
```
wget https://download.securityonion.net/file/securityonion/securityonion-2.3.70-CURATOR.iso
wget https://download.securityonion.net/file/securityonion/securityonion-2.3.90-AIRGAPFIX.iso
```
Verify the downloaded ISO image using the signature file:
```
gpg --verify securityonion-2.3.70-CURATOR.iso.sig securityonion-2.3.70-CURATOR.iso
gpg --verify securityonion-2.3.90-AIRGAPFIX.iso.sig securityonion-2.3.90-AIRGAPFIX.iso
```
The output should show "Good signature" and the Primary key fingerprint should match what's shown below:
```
gpg: Signature made Fri 20 Aug 2021 01:23:59 PM EDT using RSA key ID FE507013
gpg: Signature made Wed 01 Dec 2021 11:07:16 AM 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.70
2.3.90

View File

@@ -16,6 +16,10 @@ firewall:
ips:
delete:
insert:
endgame:
ips:
delete:
insert:
fleet:
ips:
delete:

View File

@@ -1,7 +1,7 @@
elasticsearch:
templates:
- so/so-beats-template.json.jinja
- so/so-common-template.json
- so/so-common-template.json.jinja
- so/so-firewall-template.json.jinja
- so/so-flow-template.json.jinja
- so/so-ids-template.json.jinja
@@ -10,4 +10,4 @@ elasticsearch:
- so/so-ossec-template.json.jinja
- so/so-strelka-template.json.jinja
- so/so-syslog-template.json.jinja
- so/so-zeek-template.json.jinja
- so/so-zeek-template.json.jinja

View File

@@ -1,7 +1,8 @@
elasticsearch:
templates:
- so/so-beats-template.json.jinja
- so/so-common-template.json
- so/so-common-template.json.jinja
- so/so-endgame-template.json.jinja
- so/so-firewall-template.json.jinja
- so/so-flow-template.json.jinja
- so/so-ids-template.json.jinja

View File

@@ -1,7 +1,8 @@
elasticsearch:
templates:
- so/so-beats-template.json.jinja
- so/so-common-template.json
- so/so-common-template.json.jinja
- so/so-endgame-template.json.jinja
- so/so-firewall-template.json.jinja
- so/so-flow-template.json.jinja
- so/so-ids-template.json.jinja

View File

@@ -1,6 +1,7 @@
logstash:
docker_options:
port_bindings:
- 0.0.0.0:3765:3765
- 0.0.0.0:5044:5044
- 0.0.0.0:5644:5644
- 0.0.0.0:6050:6050

View File

@@ -5,5 +5,6 @@ logstash:
config:
- so/0009_input_beats.conf
- so/0010_input_hhbeats.conf
- so/0011_input_endgame.conf
- so/9999_output_redis.conf.jinja

View File

@@ -14,3 +14,4 @@ logstash:
- so/9600_output_ossec.conf.jinja
- so/9700_output_strelka.conf.jinja
- so/9800_output_logscan.conf.jinja
- so/9900_output_endgame.conf.jinja

View File

@@ -24,6 +24,9 @@ base:
- data.*
{% if salt['file.file_exists']('/opt/so/saltstack/local/pillar/elasticsearch/auth.sls') %}
- elasticsearch.auth
{% endif %}
{% if salt['file.file_exists']('/opt/so/saltstack/local/pillar/kibana/secrets.sls') %}
- kibana.secrets
{% endif %}
- secrets
- global
@@ -43,6 +46,9 @@ base:
- elasticsearch.eval
{% if salt['file.file_exists']('/opt/so/saltstack/local/pillar/elasticsearch/auth.sls') %}
- elasticsearch.auth
{% endif %}
{% if salt['file.file_exists']('/opt/so/saltstack/local/pillar/kibana/secrets.sls') %}
- kibana.secrets
{% endif %}
- global
- minions.{{ grains.id }}
@@ -54,6 +60,9 @@ base:
- elasticsearch.search
{% if salt['file.file_exists']('/opt/so/saltstack/local/pillar/elasticsearch/auth.sls') %}
- elasticsearch.auth
{% endif %}
{% if salt['file.file_exists']('/opt/so/saltstack/local/pillar/kibana/secrets.sls') %}
- kibana.secrets
{% endif %}
- data.*
- zeeklogs
@@ -101,6 +110,9 @@ base:
- elasticsearch.eval
{% if salt['file.file_exists']('/opt/so/saltstack/local/pillar/elasticsearch/auth.sls') %}
- elasticsearch.auth
{% endif %}
{% if salt['file.file_exists']('/opt/so/saltstack/local/pillar/kibana/secrets.sls') %}
- kibana.secrets
{% endif %}
- global
- minions.{{ grains.id }}

View File

@@ -35,6 +35,7 @@
'influxdb',
'grafana',
'soc',
'kratos',
'firewall',
'idstools',
'suricata.manager',
@@ -100,6 +101,7 @@
'manager',
'nginx',
'soc',
'kratos',
'firewall',
'idstools',
'suricata.manager',
@@ -123,6 +125,7 @@
'influxdb',
'grafana',
'soc',
'kratos',
'firewall',
'idstools',
'suricata.manager',
@@ -142,6 +145,7 @@
'influxdb',
'grafana',
'soc',
'kratos',
'firewall',
'manager',
'idstools',
@@ -172,6 +176,7 @@
'influxdb',
'grafana',
'soc',
'kratos',
'firewall',
'idstools',
'suricata.manager',
@@ -238,8 +243,13 @@
{% do allowed_states.append('elasticsearch') %}
{% endif %}
{% if ELASTICSEARCH and grains.role in ['so-eval', 'so-manager', 'so-standalone', 'so-managersearch', 'so-import'] %}
{% do allowed_states.append('elasticsearch.auth') %}
{% endif %}
{% if KIBANA and grains.role in ['so-eval', 'so-manager', 'so-standalone', 'so-managersearch', 'so-import'] %}
{% do allowed_states.append('kibana') %}
{% do allowed_states.append('kibana.secrets') %}
{% endif %}
{% if grains.role in ['so-eval', 'so-standalone', 'so-node', 'so-managersearch', 'so-heavynode', 'so-manager'] %}

View File

@@ -24,8 +24,9 @@ pki_private_key:
- x509: /etc/pki/ca.crt
{%- endif %}
/etc/pki/ca.crt:
pki_public_ca_crt:
x509.certificate_managed:
- name: /etc/pki/ca.crt
- signing_private_key: /etc/pki/ca.key
- CN: {{ manager }}
- C: US
@@ -66,4 +67,4 @@ cakeyperms:
test.fail_without_changes:
- name: {{sls}}_state_not_allowed
{% endif %}
{% endif %}

View File

@@ -9,6 +9,11 @@ rmvariablesfile:
file.absent:
- name: /tmp/variables.txt
dockergroup:
group.present:
- name: docker
- gid: 920
# Add socore Group
socoregroup:
group.present:
@@ -101,16 +106,24 @@ commonpkgs:
- python3-m2crypto
- python3-mysqldb
- python3-packaging
- python3-lxml
- git
- vim
heldpackages:
pkg.installed:
- pkgs:
{% if grains['oscodename'] == 'bionic' %}
- containerd.io: 1.4.4-1
- docker-ce: 5:20.10.5~3-0~ubuntu-bionic
- docker-ce-cli: 5:20.10.5~3-0~ubuntu-bionic
- docker-ce-rootless-extras: 5:20.10.5~3-0~ubuntu-bionic
{% elif grains['oscodename'] == 'focal' %}
- containerd.io: 1.4.9-1
- docker-ce: 5:20.10.8~3-0~ubuntu-focal
- docker-ce-cli: 5:20.10.5~3-0~ubuntu-focal
- docker-ce-rootless-extras: 5:20.10.5~3-0~ubuntu-focal
{% endif %}
- hold: True
- update_holds: True
@@ -136,6 +149,7 @@ commonpkgs:
- python36-m2crypto
- python36-mysql
- python36-packaging
- python36-lxml
- yum-utils
- device-mapper-persistent-data
- lvm2

View File

@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env python3
# Copyright 2014,2015,2016,2017,2018,2019,2020,2021 Security Onion Solutions, LLC
#
@@ -15,152 +15,193 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
. /usr/sbin/so-common
import ipaddress
import textwrap
import os
import subprocess
import sys
import argparse
import re
from lxml import etree as ET
from datetime import datetime as dt
from datetime import timezone as tz
local_salt_dir=/opt/so/saltstack/local
SKIP=0
function usage {
cat << EOF
Usage: $0 [-abefhoprsw] [ -i IP ]
This program allows you to add a firewall rule to allow connections from a new IP address or CIDR range.
If you run this program with no arguments, it will present a menu for you to choose your options.
If you want to automate and skip the menu, you can pass the desired options as command line arguments.
EXAMPLES
To add 10.1.2.3 to the analyst role:
so-allow -a -i 10.1.2.3
To add 10.1.2.0/24 to the osquery role:
so-allow -o -i 10.1.2.0/24
EOF
LOCAL_SALT_DIR='/opt/so/saltstack/local'
WAZUH_CONF='/nsm/wazuh/etc/ossec.conf'
VALID_ROLES = {
'a': { 'role': 'analyst','desc': 'Analyst - 80/tcp, 443/tcp' },
'b': { 'role': 'beats_endpoint', 'desc': 'Logstash Beat - 5044/tcp' },
'e': { 'role': 'elasticsearch_rest', 'desc': 'Elasticsearch REST API - 9200/tcp' },
'f': { 'role': 'strelka_frontend', 'desc': 'Strelka frontend - 57314/tcp' },
'o': { 'role': 'osquery_endpoint', 'desc': 'Osquery endpoint - 8090/tcp' },
's': { 'role': 'syslog', 'desc': 'Syslog device - 514/tcp/udp' },
'w': { 'role': 'wazuh_agent', 'desc': 'Wazuh agent - 1514/tcp/udp' },
'p': { 'role': 'wazuh_api', 'desc': 'Wazuh API - 55000/tcp' },
'r': { 'role': 'wazuh_authd', 'desc': 'Wazuh registration service - 1515/tcp' }
}
while getopts "ahfesprbowi:" OPTION
do
case $OPTION in
h)
usage
exit 0
;;
a)
FULLROLE="analyst"
SKIP=1
;;
b)
FULLROLE="beats_endpoint"
SKIP=1
;;
e)
FULLROLE="elasticsearch_rest"
SKIP=1
;;
f)
FULLROLE="strelka_frontend"
SKIP=1
;;
i) IP=$OPTARG
;;
o)
FULLROLE="osquery_endpoint"
SKIP=1
;;
w)
FULLROLE="wazuh_agent"
SKIP=1
;;
s)
FULLROLE="syslog"
SKIP=1
;;
p)
FULLROLE="wazuh_api"
SKIP=1
;;
r)
FULLROLE="wazuh_authd"
SKIP=1
;;
*)
usage
exit 0
;;
esac
done
if [ "$SKIP" -eq 0 ]; then
def validate_ip_cidr(ip_cidr: str) -> bool:
try:
ipaddress.ip_address(ip_cidr)
except ValueError:
try:
ipaddress.ip_network(ip_cidr)
except ValueError:
return False
return True
echo "This program allows you to add a firewall rule to allow connections from a new IP address."
echo ""
echo "Choose the role for the IP or Range you would like to add"
echo ""
echo "[a] - Analyst - ports 80/tcp and 443/tcp"
echo "[b] - Logstash Beat - port 5044/tcp"
echo "[e] - Elasticsearch REST API - port 9200/tcp"
echo "[f] - Strelka frontend - port 57314/tcp"
echo "[o] - Osquery endpoint - port 8090/tcp"
echo "[s] - Syslog device - 514/tcp/udp"
echo "[w] - Wazuh agent - port 1514/tcp/udp"
echo "[p] - Wazuh API - port 55000/tcp"
echo "[r] - Wazuh registration service - 1515/tcp"
echo ""
echo "Please enter your selection:"
read -r ROLE
echo "Enter a single ip address or range to allow (example: 10.10.10.10 or 10.10.0.0/16):"
read -r IP
if [ "$ROLE" == "a" ]; then
FULLROLE=analyst
elif [ "$ROLE" == "b" ]; then
FULLROLE=beats_endpoint
elif [ "$ROLE" == "e" ]; then
FULLROLE=elasticsearch_rest
elif [ "$ROLE" == "f" ]; then
FULLROLE=strelka_frontend
elif [ "$ROLE" == "o" ]; then
FULLROLE=osquery_endpoint
elif [ "$ROLE" == "w" ]; then
FULLROLE=wazuh_agent
elif [ "$ROLE" == "s" ]; then
FULLROLE=syslog
elif [ "$ROLE" == "p" ]; then
FULLROLE=wazuh_api
elif [ "$ROLE" == "r" ]; then
FULLROLE=wazuh_authd
else
echo "I don't recognize that role"
exit 1
fi
def role_prompt() -> str:
print()
print('Choose the role for the IP or Range you would like to allow')
print()
for role in VALID_ROLES:
print(f'[{role}] - {VALID_ROLES[role]["desc"]}')
print()
role = input('Please enter your selection: ')
if role in VALID_ROLES.keys():
return VALID_ROLES[role]['role']
else:
print(f'Invalid role \'{role}\', please try again.', file=sys.stderr)
sys.exit(1)
fi
def ip_prompt() -> str:
ip = input('Enter a single ip address or range to allow (ex: 10.10.10.10 or 10.10.0.0/16): ')
if validate_ip_cidr(ip):
return ip
else:
print(f'Invalid IP address or CIDR block \'{ip}\', please try again.', file=sys.stderr)
sys.exit(1)
echo "Adding $IP to the $FULLROLE role. This can take a few seconds"
/usr/sbin/so-firewall includehost $FULLROLE $IP
salt-call state.apply firewall queue=True
# Check if Wazuh enabled
if grep -q -R "wazuh: 1" $local_salt_dir/pillar/*; then
# If analyst, add to Wazuh AR whitelist
if [ "$FULLROLE" == "analyst" ]; then
WAZUH_MGR_CFG="/nsm/wazuh/etc/ossec.conf"
if ! grep -q "<white_list>$IP</white_list>" $WAZUH_MGR_CFG ; then
DATE=$(date)
sed -i 's/<\/ossec_config>//' $WAZUH_MGR_CFG
sed -i '/^$/N;/^\n$/D' $WAZUH_MGR_CFG
echo -e "<!--Address $IP added by /usr/sbin/so-allow on \"$DATE\"-->\n <global>\n <white_list>$IP</white_list>\n </global>\n</ossec_config>" >> $WAZUH_MGR_CFG
echo "Added whitelist entry for $IP in $WAZUH_MGR_CFG."
echo
echo "Restarting OSSEC Server..."
/usr/sbin/so-wazuh-restart
fi
fi
fi
def wazuh_enabled() -> bool:
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:
return ET.tostring(root, encoding='unicode', method='xml', xml_declaration=False, pretty_print=True)
def add_wl(ip):
parser = ET.XMLParser(remove_blank_text=True)
with open(WAZUH_CONF, 'rb') as wazuh_conf:
tree = ET.parse(wazuh_conf, parser)
root = tree.getroot()
source_comment = ET.Comment(f'Address {ip} added by /usr/sbin/so-allow on {dt.utcnow().replace(tzinfo=tz.utc).strftime("%a %b %e %H:%M:%S %Z %Y")}')
new_global = ET.Element("global")
new_wl = ET.SubElement(new_global, 'white_list')
new_wl.text = ip
root.append(source_comment)
root.append(new_global)
with open(WAZUH_CONF, 'w') as add_out:
add_out.write(root_to_str(root))
def apply(role: str, ip: str) -> int:
firewall_cmd = ['so-firewall', 'includehost', role, ip]
salt_cmd = ['salt-call', 'state.apply', '-l', 'quiet', 'firewall', 'queue=True']
restart_wazuh_cmd = ['so-wazuh-restart']
print(f'Adding {ip} to the {role} role. This can take a few seconds...')
cmd = subprocess.run(firewall_cmd)
if cmd.returncode == 0:
cmd = subprocess.run(salt_cmd, stdout=subprocess.DEVNULL)
else:
return cmd.returncode
if cmd.returncode == 0:
if wazuh_enabled() and role=='analyst':
try:
add_wl(ip)
print(f'Added whitelist entry for {ip} from {WAZUH_CONF}', file=sys.stderr)
except Exception as e:
print(f'Failed to add whitelist entry for {ip} from {WAZUH_CONF}', file=sys.stderr)
print(e)
return 1
print('Restarting OSSEC Server...')
cmd = subprocess.run(restart_wazuh_cmd)
else:
return cmd.returncode
else:
print(f'Commmand \'{" ".join(salt_cmd)}\' failed.', file=sys.stderr)
return cmd.returncode
if cmd.returncode != 0:
print('Failed to restart OSSEC server.')
return cmd.returncode
def main():
if os.geteuid() != 0:
print('You must run this script as root', file=sys.stderr)
sys.exit(1)
main_parser = argparse.ArgumentParser(
formatter_class=argparse.RawDescriptionHelpFormatter,
epilog=textwrap.dedent(f'''\
additional information:
To use this script in interactive mode call it with no arguments
'''
))
group = main_parser.add_argument_group(title='roles')
group.add_argument('-a', dest='roles', action='append_const', const=VALID_ROLES['a']['role'], help="Analyst - 80/tcp, 443/tcp")
group.add_argument('-b', dest='roles', action='append_const', const=VALID_ROLES['b']['role'], help="Logstash Beat - 5044/tcp")
group.add_argument('-e', dest='roles', action='append_const', const=VALID_ROLES['e']['role'], help="Elasticsearch REST API - 9200/tcp")
group.add_argument('-f', dest='roles', action='append_const', const=VALID_ROLES['f']['role'], help="Strelka frontend - 57314/tcp")
group.add_argument('-o', dest='roles', action='append_const', const=VALID_ROLES['o']['role'], help="Osquery endpoint - 8090/tcp")
group.add_argument('-s', dest='roles', action='append_const', const=VALID_ROLES['s']['role'], help="Syslog device - 514/tcp/udp")
group.add_argument('-w', dest='roles', action='append_const', const=VALID_ROLES['w']['role'], help="Wazuh agent - 1514/tcp/udp")
group.add_argument('-p', dest='roles', action='append_const', const=VALID_ROLES['p']['role'], help="Wazuh API - 55000/tcp")
group.add_argument('-r', dest='roles', action='append_const', const=VALID_ROLES['r']['role'], help="Wazuh registration service - 1515/tcp")
ip_g = main_parser.add_argument_group(title='allow')
ip_g.add_argument('-i', help="IP or CIDR block to disallow connections from, requires at least one role argument", metavar='', dest='ip')
args = main_parser.parse_args(sys.argv[1:])
if args.roles is None:
role = role_prompt()
ip = ip_prompt()
try:
return_code = apply(role, ip)
except Exception as e:
print(f'Unexpected exception occurred: {e}', file=sys.stderr)
return_code = e.errno
sys.exit(return_code)
elif args.roles is not None and args.ip is None:
if os.environ.get('IP') is None:
main_parser.print_help()
sys.exit(1)
else:
args.ip = os.environ['IP']
if validate_ip_cidr(args.ip):
try:
for role in args.roles:
return_code = apply(role, args.ip)
if return_code > 0:
break
except Exception as e:
print(f'Unexpected exception occurred: {e}', file=sys.stderr)
return_code = e.errno
else:
print(f'Invalid IP address or CIDR block \'{args.ip}\', please try again.', file=sys.stderr)
return_code = 1
sys.exit(return_code)
if __name__ == '__main__':
try:
main()
except KeyboardInterrupt:
sys.exit(1)

View File

@@ -17,4 +17,4 @@
. /usr/sbin/so-common
salt-call state.highstate -linfo
salt-call state.highstate -l info

View File

@@ -99,6 +99,15 @@ check_password() {
return $?
}
check_password_and_exit() {
local password=$1
if ! check_password "$password"; then
echo "Password is invalid. Do not include single quotes, double quotes, dollar signs, and backslashes in the password."
exit 2
fi
return 0
}
check_elastic_license() {
[ -n "$TESTING" ] && return
@@ -383,15 +392,18 @@ has_uppercase() {
valid_cidr() {
# Verify there is a backslash in the string
echo "$1" | grep -qP "^[^/]+/[^/]+$" || return 1
local cidr
local ip
cidr=$(echo "$1" | sed 's/.*\///')
ip=$(echo "$1" | sed 's/\/.*//' )
valid_ip4_cidr_mask "$1" && return 0 || return 1
local cidr="$1"
local ip
ip=$(echo "$cidr" | sed 's/\/.*//' )
if valid_ip4 "$ip"; then
[[ $cidr =~ ([0-9]|[1-2][0-9]|3[0-2]) ]] && return 0 || return 1
local ip1 ip2 ip3 ip4 N
IFS="./" read -r ip1 ip2 ip3 ip4 N <<< "$cidr"
ip_total=$((ip1 * 256 ** 3 + ip2 * 256 ** 2 + ip3 * 256 + ip4))
[[ $((ip_total % 2**(32-N))) == 0 ]] && return 0 || return 1
else
return 1
fi
@@ -441,6 +453,23 @@ valid_ip4() {
echo "$ip" | grep -qP '^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$' && return 0 || return 1
}
valid_ip4_cidr_mask() {
# Verify there is a backslash in the string
echo "$1" | grep -qP "^[^/]+/[^/]+$" || return 1
local cidr
local ip
cidr=$(echo "$1" | sed 's/.*\///')
ip=$(echo "$1" | sed 's/\/.*//' )
if valid_ip4 "$ip"; then
[[ $cidr =~ ^([0-9]|[1-2][0-9]|3[0-2])$ ]] && return 0 || return 1
else
return 1
fi
}
valid_int() {
local num=$1
local min=${2:-1}

213
salt/common/tools/sbin/so-deny Executable file
View File

@@ -0,0 +1,213 @@
#!/usr/bin/env python3
# Copyright 2014,2015,2016,2017,2018,2019,2020,2021 Security Onion Solutions, LLC
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import ipaddress
import textwrap
import os
import subprocess
import sys
import argparse
import re
from lxml import etree as ET
from xml.dom import minidom
LOCAL_SALT_DIR='/opt/so/saltstack/local'
WAZUH_CONF='/nsm/wazuh/etc/ossec.conf'
VALID_ROLES = {
'a': { 'role': 'analyst','desc': 'Analyst - 80/tcp, 443/tcp' },
'b': { 'role': 'beats_endpoint', 'desc': 'Logstash Beat - 5044/tcp' },
'e': { 'role': 'elasticsearch_rest', 'desc': 'Elasticsearch REST API - 9200/tcp' },
'f': { 'role': 'strelka_frontend', 'desc': 'Strelka frontend - 57314/tcp' },
'o': { 'role': 'osquery_endpoint', 'desc': 'Osquery endpoint - 8090/tcp' },
's': { 'role': 'syslog', 'desc': 'Syslog device - 514/tcp/udp' },
'w': { 'role': 'wazuh_agent', 'desc': 'Wazuh agent - 1514/tcp/udp' },
'p': { 'role': 'wazuh_api', 'desc': 'Wazuh API - 55000/tcp' },
'r': { 'role': 'wazuh_authd', 'desc': 'Wazuh registration service - 1515/tcp' }
}
def validate_ip_cidr(ip_cidr: str) -> bool:
try:
ipaddress.ip_address(ip_cidr)
except ValueError:
try:
ipaddress.ip_network(ip_cidr)
except ValueError:
return False
return True
def role_prompt() -> str:
print()
print('Choose the role for the IP or Range you would like to deny')
print()
for role in VALID_ROLES:
print(f'[{role}] - {VALID_ROLES[role]["desc"]}')
print()
role = input('Please enter your selection: ')
if role in VALID_ROLES.keys():
return VALID_ROLES[role]['role']
else:
print(f'Invalid role \'{role}\', please try again.', file=sys.stderr)
sys.exit(1)
def ip_prompt() -> str:
ip = input('Enter a single ip address or range to deny (ex: 10.10.10.10 or 10.10.0.0/16): ')
if validate_ip_cidr(ip):
return ip
else:
print(f'Invalid IP address or CIDR block \'{ip}\', please try again.', file=sys.stderr)
sys.exit(1)
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
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)
# Remove specific substrings to better format comments on intial parse/write
xml_str = re.sub(r' -', '', xml_str)
xml_str = re.sub(r' -->', ' -->', xml_str)
dom = minidom.parseString(xml_str)
return dom.toprettyxml(indent=" ")
def rem_wl(ip):
parser = ET.XMLParser(remove_blank_text=True)
with open(WAZUH_CONF, 'rb') as wazuh_conf:
tree = ET.parse(wazuh_conf, parser)
root = tree.getroot()
global_elems = root.findall(f"global/white_list[. = '{ip}']/..")
if len(global_elems) > 0:
for g_elem in global_elems:
ge_index = list(root).index(g_elem)
if ge_index > 0 and root[list(root).index(g_elem) - 1].tag == ET.Comment:
root.remove(root[ge_index - 1])
root.remove(g_elem)
with open(WAZUH_CONF, 'w') as out:
out.write(root_to_str(root))
def apply(role: str, ip: str) -> int:
firewall_cmd = ['so-firewall', 'excludehost', role, ip]
salt_cmd = ['salt-call', 'state.apply', '-l', 'quiet', 'firewall', 'queue=True']
restart_wazuh_cmd = ['so-wazuh-restart']
print(f'Removing {ip} from the {role} role. This can take a few seconds...')
cmd = subprocess.run(firewall_cmd)
if cmd.returncode == 0:
cmd = subprocess.run(salt_cmd, stdout=subprocess.DEVNULL)
else:
return cmd.returncode
if cmd.returncode == 0:
if wazuh_enabled and role=='analyst':
try:
rem_wl(ip)
print(f'Removed whitelist entry for {ip} from {WAZUH_CONF}', file=sys.stderr)
except Exception as e:
print(f'Failed to remove whitelist entry for {ip} from {WAZUH_CONF}', file=sys.stderr)
print(e)
return 1
print('Restarting OSSEC Server...')
cmd = subprocess.run(restart_wazuh_cmd)
else:
return cmd.returncode
else:
print(f'Commmand \'{" ".join(salt_cmd)}\' failed.', file=sys.stderr)
return cmd.returncode
if cmd.returncode != 0:
print('Failed to restart OSSEC server.')
return cmd.returncode
def main():
if os.geteuid() != 0:
print('You must run this script as root', file=sys.stderr)
sys.exit(1)
main_parser = argparse.ArgumentParser(
formatter_class=argparse.RawDescriptionHelpFormatter,
epilog=textwrap.dedent(f'''\
additional information:
To use this script in interactive mode call it with no arguments
'''
))
group = main_parser.add_argument_group(title='roles')
group.add_argument('-a', dest='roles', action='append_const', const=VALID_ROLES['a']['role'], help="Analyst - 80/tcp, 443/tcp")
group.add_argument('-b', dest='roles', action='append_const', const=VALID_ROLES['b']['role'], help="Logstash Beat - 5044/tcp")
group.add_argument('-e', dest='roles', action='append_const', const=VALID_ROLES['e']['role'], help="Elasticsearch REST API - 9200/tcp")
group.add_argument('-f', dest='roles', action='append_const', const=VALID_ROLES['f']['role'], help="Strelka frontend - 57314/tcp")
group.add_argument('-o', dest='roles', action='append_const', const=VALID_ROLES['o']['role'], help="Osquery endpoint - 8090/tcp")
group.add_argument('-s', dest='roles', action='append_const', const=VALID_ROLES['s']['role'], help="Syslog device - 514/tcp/udp")
group.add_argument('-w', dest='roles', action='append_const', const=VALID_ROLES['w']['role'], help="Wazuh agent - 1514/tcp/udp")
group.add_argument('-p', dest='roles', action='append_const', const=VALID_ROLES['p']['role'], help="Wazuh API - 55000/tcp")
group.add_argument('-r', dest='roles', action='append_const', const=VALID_ROLES['r']['role'], help="Wazuh registration service - 1515/tcp")
ip_g = main_parser.add_argument_group(title='allow')
ip_g.add_argument('-i', help="IP or CIDR block to disallow connections from, requires at least one role argument", metavar='', dest='ip')
args = main_parser.parse_args(sys.argv[1:])
if args.roles is None:
role = role_prompt()
ip = ip_prompt()
try:
return_code = apply(role, ip)
except Exception as e:
print(f'Unexpected exception occurred: {e}', file=sys.stderr)
return_code = e.errno
sys.exit(return_code)
elif args.roles is not None and args.ip is None:
if os.environ.get('IP') is None:
main_parser.print_help()
sys.exit(1)
else:
args.ip = os.environ['IP']
if validate_ip_cidr(args.ip):
try:
for role in args.roles:
return_code = apply(role, args.ip)
if return_code > 0:
break
except Exception as e:
print(f'Unexpected exception occurred: {e}', file=sys.stderr)
return_code = e.errno
else:
print(f'Invalid IP address or CIDR block \'{args.ip}\', please try again.', file=sys.stderr)
return_code = 1
sys.exit(return_code)
if __name__ == '__main__':
try:
main()
except KeyboardInterrupt:
sys.exit(1)

View File

@@ -70,7 +70,7 @@ do
done
docker_exec(){
CMD="docker exec -it so-elastalert elastalert-test-rule /opt/elastalert/rules/$RULE_NAME --config /opt/config/elastalert_config.yaml $OPTIONS"
CMD="docker exec -it so-elastalert elastalert-test-rule /opt/elastalert/rules/$RULE_NAME --config /opt/elastalert/config.yaml $OPTIONS"
if [ "${RESULTS_TO_LOG,,}" = "y" ] ; then
$CMD > "$FILE_SAVE_LOCATION"
else

View File

@@ -0,0 +1,155 @@
#!/bin/bash
# Copyright 2014,2015,2016,2017,2018,2019,2020,2021 Security Onion Solutions, LLC
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
source $(dirname $0)/so-common
require_manager
user=$1
elasticUsersFile=${ELASTIC_USERS_FILE:-/opt/so/saltstack/local/salt/elasticsearch/files/users}
elasticAuthPillarFile=${ELASTIC_AUTH_PILLAR_FILE:-/opt/so/saltstack/local/pillar/elasticsearch/auth.sls}
if [[ $# -ne 1 ]]; then
echo "Usage: $0 <user>"
echo ""
echo " where <user> is one of the following:"
echo ""
echo " all: Reset the password for the so_elastic, so_kibana, so_logstash, so_beats, and so_monitor users"
echo " so_elastic: Reset the password for the so_elastic user"
echo " so_kibana: Reset the password for the so_kibana user"
echo " so_logstash: Reset the password for the so_logstash user"
echo " so_beats: Reset the password for the so_beats user"
echo " so_monitor: Reset the password for the so_monitor user"
echo ""
exit 1
fi
# function to create a lock so that the so-user sync cronjob can't run while this is running
function lock() {
# Obtain file descriptor lock
exec 99>/var/tmp/so-user.lock || fail "Unable to create lock descriptor; if the system was not shutdown gracefully you may need to remove /var/tmp/so-user.lock manually."
flock -w 10 99 || fail "Another process is using so-user; if the system was not shutdown gracefully you may need to remove /var/tmp/so-user.lock manually."
trap 'rm -f /var/tmp/so-user.lock' EXIT
}
function unlock() {
rm -f /var/tmp/so-user.lock
}
function fail() {
msg=$1
echo "$1"
exit 1
}
function removeSingleUserPass() {
local user=$1
sed -i '/user: '"${user}"'/{N;/pass: /d}' "${elasticAuthPillarFile}"
}
function removeAllUserPass() {
local userList=("so_elastic" "so_kibana" "so_logstash" "so_beats" "so_monitor")
for u in ${userList[@]}; do
removeSingleUserPass "$u"
done
}
function removeElasticUsersFile() {
rm -f "$elasticUsersFile"
}
function createElasticAuthPillar() {
salt-call state.apply elasticsearch.auth queue=True
}
# this will disable highstate to prevent a highstate from starting while the script is running
# will also disable salt.minion-state-apply-test allow so-salt-minion-check cronjob to restart salt-minion service incase
function disableSaltStates() {
printf "\nDisabling salt.minion-state-apply-test and highstate from running.\n\n"
salt-call state.disable salt.minion-state-apply-test
salt-call state.disable highstate
}
function enableSaltStates() {
printf "\nEnabling salt.minion-state-apply-test and highstate.\n\n"
salt-call state.enable salt.minion-state-apply-test
salt-call state.enable highstate
}
function killAllSaltJobs() {
printf "\nKilling all running salt jobs.\n\n"
salt-call saltutil.kill_all_jobs
}
function soUserSync() {
# apply this state to update /opt/so/saltstack/local/salt/elasticsearch/curl.config on the manager
salt-call state.sls_id elastic_curl_config_distributed manager queue=True
salt -C 'G@role:so-standalone or G@role:so-eval or G@role:so-import or G@role:so-manager or G@role:so-managersearch or G@role:so-node or G@role:so-heavynode' saltutil.kill_all_jobs
# apply this state to get the curl.config
salt -C 'G@role:so-standalone or G@role:so-eval or G@role:so-import or G@role:so-manager or G@role:so-managersearch or G@role:so-node or G@role:so-heavynode' state.sls_id elastic_curl_config common queue=True
$(dirname $0)/so-user sync
printf "\nApplying logstash state to the appropriate nodes.\n\n"
salt -C 'G@role:so-standalone or G@role:so-eval or G@role:so-import or G@role:so-manager or G@role:so-managersearch or G@role:so-node or G@role:so-heavynode' state.apply logstash queue=True
printf "\nApplying filebeat state to the appropriate nodes.\n\n"
salt -C 'G@role:so-standalone or G@role:so-eval or G@role:so-import or G@role:so-manager or G@role:so-managersearch or G@role:so-node or G@role:so-heavynode or G@role:so-sensor or G@role:so-fleet' state.apply filebeat queue=True
printf "\nApplying kibana state to the appropriate nodes.\n\n"
salt -C 'G@role:so-standalone or G@role:so-eval or G@role:so-import or G@role:so-manager or G@role:so-managersearch' state.apply kibana queue=True
printf "\nApplying curator state to the appropriate nodes.\n\n"
salt -C 'G@role:so-standalone or G@role:so-eval or G@role:so-import or G@role:so-manager or G@role:so-managersearch or G@role:so-node or G@role:so-heavynode' state.apply curator queue=True
}
function highstateManager() {
killAllSaltJobs
printf "\nRunning highstate on the manager to finalize password reset.\n\n"
salt-call state.highstate -linfo queue=True
}
case "${user}" in
so_elastic | so_kibana | so_logstash | so_beats | so_monitor)
lock
killAllSaltJobs
disableSaltStates
removeSingleUserPass "$user"
createElasticAuthPillar
removeElasticUsersFile
unlock
soUserSync
enableSaltStates
highstateManager
;;
all)
lock
killAllSaltJobs
disableSaltStates
removeAllUserPass
createElasticAuthPillar
removeElasticUsersFile
unlock
soUserSync
enableSaltStates
highstateManager
;;
*)
fail "Unsupported user: $user"
;;
esac
exit 0

View File

@@ -0,0 +1,57 @@
#!/bin/bash
# Copyright 2014,2015,2016,2017,2018,2019,2020,2021 Security Onion Solutions, LLC
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
{%- set mainint = salt['pillar.get']('host:mainint') %}
{%- set MYIP = salt['grains.get']('ip_interfaces:' ~ mainint)[0] %}
default_conf_dir=/opt/so/conf
ELASTICSEARCH_HOST="{{ MYIP }}"
ELASTICSEARCH_PORT=9200
# Define a default directory to load roles from
ELASTICSEARCH_ROLES="$default_conf_dir/elasticsearch/roles/"
# Wait for ElasticSearch to initialize
echo -n "Waiting for ElasticSearch..."
COUNT=0
ELASTICSEARCH_CONNECTED="no"
while [[ "$COUNT" -le 240 ]]; do
{{ ELASTICCURL }} -k --output /dev/null --silent --head --fail -L https://"$ELASTICSEARCH_HOST":"$ELASTICSEARCH_PORT"
if [ $? -eq 0 ]; then
ELASTICSEARCH_CONNECTED="yes"
echo "connected!"
break
else
((COUNT+=1))
sleep 1
echo -n "."
fi
done
if [ "$ELASTICSEARCH_CONNECTED" == "no" ]; then
echo
echo -e "Connection attempt timed out. Unable to connect to ElasticSearch. \nPlease try: \n -checking log(s) in /var/log/elasticsearch/\n -running 'sudo docker ps' \n -running 'sudo so-elastic-restart'"
echo
fi
cd ${ELASTICSEARCH_ROLES}
echo "Loading templates..."
for role in *; do
name=$(echo "$role" | cut -d. -f1)
so-elasticsearch-query _security/role/$name -XPUT -d @"$role"
done
cd - >/dev/null

View File

@@ -54,7 +54,7 @@ PIPELINES=$({{ ELASTICCURL }} -sk https://"$ELASTICSEARCH_HOST":"$ELASTICSEARCH_
if [[ "$PIPELINES" -lt 5 ]]; then
echo "Setting up ingest pipeline(s)"
for MODULE in activemq apache auditd aws azure barracuda bluecoat cef checkpoint cisco coredns crowdstrike cyberark cylance elasticsearch envoyproxy f5 fortinet gcp google_workspace googlecloud gsuite haproxy ibmmq icinga iis imperva infoblox iptables juniper kafka kibana logstash microsoft misp mongodb mssql mysql nats netscout nginx o365 okta osquery panw postgresql rabbitmq radware redis santa snort snyk sonicwall sophos squid suricata system tomcat traefik zeek zscaler
for MODULE in activemq apache auditd aws azure barracuda bluecoat cef checkpoint cisco coredns crowdstrike cyberark cylance elasticsearch envoyproxy f5 fortinet gcp google_workspace googlecloud gsuite haproxy ibmmq icinga iis imperva infoblox iptables juniper kafka kibana logstash microsoft mongodb mssql mysql nats netscout nginx o365 okta osquery panw postgresql rabbitmq radware redis santa snort snyk sonicwall sophos squid suricata system threatintel tomcat traefik zeek zscaler
do
echo "Loading $MODULE"
docker exec -i so-filebeat filebeat setup modules -pipelines -modules $MODULE -c $FB_MODULE_YML

View File

@@ -71,7 +71,7 @@ def checkApplyOption(options):
def loadYaml(filename):
file = open(filename, "r")
return yaml.load(file.read())
return yaml.safe_load(file.read())
def writeYaml(filename, content):
file = open(filename, "w")

View File

@@ -2,11 +2,16 @@
#so-fleet-setup $FleetEmail $FleetPassword
. /usr/sbin/so-common
if [[ $# -ne 2 ]] ; then
echo "Username or Password was not set - exiting now."
exit 1
fi
USER_EMAIL=$1
USER_PW=$2
# Checking to see if required containers are started...
if [ ! "$(docker ps -q -f name=so-fleet)" ]; then
echo "Starting Docker Containers..."
@@ -17,8 +22,16 @@ fi
docker exec so-fleet fleetctl config set --address https://127.0.0.1:8080 --tls-skip-verify --url-prefix /fleet
docker exec so-fleet bash -c 'while [[ "$(curl -s -o /dev/null --insecure -w ''%{http_code}'' https://127.0.0.1:8080/fleet)" != "301" ]]; do sleep 5; done'
docker exec so-fleet fleetctl setup --email $1 --password $2
# Create Security Onion Fleet Service Account + Setup Fleet
FLEET_SA_EMAIL=$(lookup_pillar_secret fleet_sa_email)
FLEET_SA_PW=$(lookup_pillar_secret fleet_sa_password)
docker exec so-fleet fleetctl setup --email $FLEET_SA_EMAIL --password $FLEET_SA_PW --name SO_ServiceAccount --org-name SO
# Create User Account
echo "$USER_PW" | so-fleet-user-add "$USER_EMAIL"
# Import Packs & Configs
docker exec so-fleet fleetctl apply -f /packs/palantir/Fleet/Endpoints/MacOS/osquery.yaml
docker exec so-fleet fleetctl apply -f /packs/palantir/Fleet/Endpoints/Windows/osquery.yaml
docker exec so-fleet fleetctl apply -f /packs/so/so-default.yml

View File

@@ -18,7 +18,7 @@
. /usr/sbin/so-common
usage() {
echo "Usage: $0 <new-user-name>"
echo "Usage: $0 <new-user-email>"
echo ""
echo "Adds a new user to Fleet. The new password will be read from STDIN."
exit 1
@@ -28,37 +28,42 @@ if [ $# -ne 1 ]; then
usage
fi
USER=$1
MYSQL_PASS=$(lookup_pillar_secret mysql)
FLEET_IP=$(lookup_pillar fleet_ip)
FLEET_USER=$USER
USER_EMAIL=$1
FLEET_SA_EMAIL=$(lookup_pillar_secret fleet_sa_email)
FLEET_SA_PW=$(lookup_pillar_secret fleet_sa_password)
MYSQL_PW=$(lookup_pillar_secret mysql)
# Read password for new user from stdin
test -t 0
if [[ $? == 0 ]]; then
echo "Enter new password:"
fi
read -rs FLEET_PASS
read -rs USER_PASS
if ! check_password "$FLEET_PASS"; then
echo "Password is invalid. Please exclude single quotes, double quotes and backslashes from the password."
exit 2
fi
check_password_and_exit "$USER_PASS"
# Config fleetctl & login with the SO Service Account
CONFIG_OUTPUT=$(docker exec so-fleet fleetctl config set --address https://127.0.0.1:8080 --tls-skip-verify --url-prefix /fleet 2>&1 )
SALOGIN_OUTPUT=$(docker exec so-fleet fleetctl login --email $FLEET_SA_EMAIL --password $FLEET_SA_PW 2>&1)
FLEET_HASH=$(docker exec so-soctopus python -c "import bcrypt; print(bcrypt.hashpw('$FLEET_PASS'.encode('utf-8'), bcrypt.gensalt()).decode('utf-8'));" 2>&1)
if [[ $? -ne 0 ]]; then
echo "Failed to generate Fleet password hash"
exit 2
echo "Unable to add user to Fleet; Fleet Service account login failed"
echo "$SALOGIN_OUTPUT"
exit 2
fi
MYSQL_OUTPUT=$(docker exec so-mysql mysql -u root --password=$MYSQL_PASS fleet -e \
"INSERT INTO users (password,salt,username,email,admin,enabled) VALUES ('$FLEET_HASH','','$FLEET_USER','$FLEET_USER',1,1)" 2>&1)
# Create New User
CREATE_OUTPUT=$(docker exec so-fleet fleetctl user create --email $USER_EMAIL --name $USER_EMAIL --password $USER_PASS --global-role admin 2>&1)
if [[ $? -eq 0 ]]; then
echo "Successfully added user to Fleet"
else
echo "Unable to add user to Fleet; user might already exist"
echo "$MYSQL_OUTPUT"
echo "$CREATE_OUTPUT"
exit 2
fi
fi
# Disable forced password reset
MYSQL_OUTPUT=$(docker exec so-mysql mysql -u root --password=$MYSQL_PW fleet -e \
"UPDATE users SET admin_forced_password_reset = 0 WHERE email = '$USER_EMAIL'" 2>&1)

View File

@@ -0,0 +1,56 @@
#!/bin/bash
#
# Copyright 2014,2015,2016,2017,2018,2019,2020,2021 Security Onion Solutions, LLC
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
. /usr/sbin/so-common
usage() {
echo "Usage: $0 <user-email>"
echo ""
echo "Deletes a user in Fleet"
exit 1
}
if [ $# -ne 1 ]; then
usage
fi
USER_EMAIL=$1
FLEET_SA_EMAIL=$(lookup_pillar_secret fleet_sa_email)
FLEET_SA_PW=$(lookup_pillar_secret fleet_sa_password)
# Config fleetctl & login with the SO Service Account
CONFIG_OUTPUT=$(docker exec so-fleet fleetctl config set --address https://127.0.0.1:8080 --tls-skip-verify --url-prefix /fleet 2>&1 )
SALOGIN_OUTPUT=$(docker exec so-fleet fleetctl login --email $FLEET_SA_EMAIL --password $FLEET_SA_PW 2>&1)
if [[ $? -ne 0 ]]; then
echo "Unable to delete user from Fleet; Fleet Service account login failed"
echo "$SALOGIN_OUTPUT"
exit 2
fi
# Delete User
DELETE_OUTPUT=$(docker exec so-fleet fleetctl user delete --email $USER_EMAIL 2>&1)
if [[ $? -eq 0 ]]; then
echo "Successfully deleted user from Fleet"
else
echo "Unable to delete user from Fleet"
echo "$DELETE_OUTPUT"
exit 2
fi

View File

@@ -36,9 +36,9 @@ FLEET_USER=$USER
# test existence of user
MYSQL_OUTPUT=$(docker exec so-mysql mysql -u root --password=$MYSQL_PASS fleet -e \
"SELECT count(1) FROM users WHERE username='$FLEET_USER'" 2>/dev/null | tail -1)
"SELECT count(1) FROM users WHERE email='$FLEET_USER'" 2>/dev/null | tail -1)
if [[ $? -ne 0 ]] || [[ $MYSQL_OUTPUT -ne 1 ]] ; then
echo "Test for username [${FLEET_USER}] failed"
echo "Test for email [${FLEET_USER}] failed"
echo " expect 1 hit in users database, return $MYSQL_OUTPUT hit(s)."
echo "Unable to update Fleet user password."
exit 2
@@ -52,7 +52,7 @@ fi
read -rs FLEET_PASS
if ! check_password "$FLEET_PASS"; then
echo "Password is invalid. Please exclude single quotes, double quotes and backslashes from the password."
echo "Password is invalid. Please exclude single quotes, double quotes, dollar signs, and backslashes from the password."
exit 2
fi
@@ -64,7 +64,7 @@ fi
MYSQL_OUTPUT=$(docker exec so-mysql mysql -u root --password=$MYSQL_PASS fleet -e \
"UPDATE users SET password='$FLEET_HASH', salt='' where username='$FLEET_USER'" 2>&1)
"UPDATE users SET password='$FLEET_HASH', salt='' where email='$FLEET_USER'" 2>&1)
if [[ $? -eq 0 ]]; then
echo "Successfully updated Fleet user password"

View File

@@ -17,6 +17,7 @@
# NOTE: This script depends on so-common
IMAGEREPO=security-onion-solutions
STATUS_CONF='/opt/so/conf/so-status/so-status.conf'
# shellcheck disable=SC2120
container_list() {
@@ -137,6 +138,11 @@ update_docker_containers() {
if [[ $result -eq 0 ]]; then
cat $SIGNPATH/KEYS | gpg --import - >> "$LOG_FILE" 2>&1
fi
# If downloading for soup, check if any optional images need to be pulled
if [[ $CURLTYPE == 'soup' ]]; then
grep -q "so-logscan" "$STATUS_CONF" && TRUSTED_CONTAINERS+=("so-logscan")
fi
# Download the containers from the interwebs
for i in "${TRUSTED_CONTAINERS[@]}"

View File

@@ -0,0 +1,176 @@
#!/bin/bash
#
# Copyright 2014,2015,2016,2017,2018,2019,2020,2021 Security Onion Solutions, LLC
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
{%- set MANAGER = salt['grains.get']('master') %}
{%- set VERSION = salt['pillar.get']('global:soversion') %}
{%- set IMAGEREPO = salt['pillar.get']('global:imagerepo') %}
{%- set MANAGERIP = salt['pillar.get']('global:managerip') -%}
{%- set URLBASE = salt['pillar.get']('global:url_base') %}
{% set ES_USER = salt['pillar.get']('elasticsearch:auth:users:so_elastic_user:user', '') %}
{% set ES_PW = salt['pillar.get']('elasticsearch:auth:users:so_elastic_user:pass', '') %}
INDEX_DATE=$(date +'%Y.%m.%d')
RUNID=$(cat /dev/urandom | tr -dc 'a-z0-9' | fold -w 8 | head -n 1)
LOG_FILE=/nsm/import/evtx-import.log
. /usr/sbin/so-common
function usage {
cat << EOF
Usage: $0 <evtx-file-1> [evtx-file-2] [evtx-file-*]
Imports one or more evtx files into Security Onion. The evtx files will be analyzed and made available for review in the Security Onion toolset.
EOF
}
function evtx2es() {
EVTX=$1
HASH=$2
ES_PW=$(lookup_pillar "auth:users:so_elastic_user:pass" "elasticsearch")
ES_USER=$(lookup_pillar "auth:users:so_elastic_user:user" "elasticsearch")
docker run --rm \
-v "$EVTX:/tmp/$RUNID.evtx" \
--entrypoint evtx2es \
{{ MANAGER }}:5000/{{ IMAGEREPO }}/so-pcaptools:{{ VERSION }} \
--host {{ MANAGERIP }} --scheme https \
--index so-beats-$INDEX_DATE --pipeline import.wel \
--login $ES_USER --pwd $ES_PW \
"/tmp/$RUNID.evtx" >> $LOG_FILE 2>&1
docker run --rm \
-v "$EVTX:/tmp/import.evtx" \
-v "/nsm/import/evtx-end_newest:/tmp/newest" \
-v "/nsm/import/evtx-start_oldest:/tmp/oldest" \
--entrypoint '/evtx_calc_timestamps.sh' \
{{ MANAGER }}:5000/{{ IMAGEREPO }}/so-pcaptools:{{ VERSION }}
}
# if no parameters supplied, display usage
if [ $# -eq 0 ]; then
usage
exit 1
fi
# ensure this is a Manager node
require_manager
# verify that all parameters are files
for i in "$@"; do
if ! [ -f "$i" ]; then
usage
echo "\"$i\" is not a valid file!"
exit 2
fi
done
# track if we have any valid or invalid evtx
INVALID_EVTXS="no"
VALID_EVTXS="no"
# track oldest start and newest end so that we can generate the Kibana search hyperlink at the end
START_OLDEST="2050-12-31"
END_NEWEST="1971-01-01"
touch /nsm/import/evtx-start_oldest
touch /nsm/import/evtx-end_newest
echo $START_OLDEST > /nsm/import/evtx-start_oldest
echo $END_NEWEST > /nsm/import/evtx-end_newest
# paths must be quoted in case they include spaces
for EVTX in "$@"; do
EVTX=$(/usr/bin/realpath "$EVTX")
echo "Processing Import: ${EVTX}"
# generate a unique hash to assist with dedupe checks
HASH=$(md5sum "${EVTX}" | awk '{ print $1 }')
HASH_DIR=/nsm/import/${HASH}
echo "- assigning unique identifier to import: $HASH"
if [ -d $HASH_DIR ]; then
echo "- this EVTX has already been imported; skipping"
INVALID_EVTXS="yes"
else
VALID_EVTXS="yes"
EVTX_DIR=$HASH_DIR/evtx
mkdir -p $EVTX_DIR
# import evtx and write them to import ingest pipeline
echo "- importing logs to Elasticsearch..."
evtx2es "${EVTX}" $HASH
# compare $START to $START_OLDEST
START=$(cat /nsm/import/evtx-start_oldest)
START_COMPARE=$(date -d $START +%s)
START_OLDEST_COMPARE=$(date -d $START_OLDEST +%s)
if [ $START_COMPARE -lt $START_OLDEST_COMPARE ]; then
START_OLDEST=$START
fi
# compare $ENDNEXT to $END_NEWEST
END=$(cat /nsm/import/evtx-end_newest)
ENDNEXT=`date +%Y-%m-%d --date="$END 1 day"`
ENDNEXT_COMPARE=$(date -d $ENDNEXT +%s)
END_NEWEST_COMPARE=$(date -d $END_NEWEST +%s)
if [ $ENDNEXT_COMPARE -gt $END_NEWEST_COMPARE ]; then
END_NEWEST=$ENDNEXT
fi
cp -f "${EVTX}" "${EVTX_DIR}"/data.evtx
chmod 644 "${EVTX_DIR}"/data.evtx
fi # end of valid evtx
echo
done # end of for-loop processing evtx files
# remove temp files
echo "Cleaning up:"
for TEMP_EVTX in ${TEMP_EVTXS[@]}; do
echo "- removing temporary evtx $TEMP_EVTX"
rm -f $TEMP_EVTX
done
# output final messages
if [ "$INVALID_EVTXS" = "yes" ]; then
echo
echo "Please note! One or more evtx was invalid! You can scroll up to see which ones were invalid."
fi
START_OLDEST_FORMATTED=`date +%Y-%m-%d --date="$START_OLDEST"`
START_OLDEST_SLASH=$(echo $START_OLDEST_FORMATTED | sed -e 's/-/%2F/g')
END_NEWEST_SLASH=$(echo $END_NEWEST | sed -e 's/-/%2F/g')
if [ "$VALID_EVTXS" = "yes" ]; then
cat << EOF
Import complete!
You can use the following hyperlink to view data in the time range of your import. You can triple-click to quickly highlight the entire hyperlink and you can then copy it into your browser:
https://{{ URLBASE }}/#/hunt?q=import.id:${RUNID}%20%7C%20groupby%20event.module%20event.dataset&t=${START_OLDEST_SLASH}%2000%3A00%3A00%20AM%20-%20${END_NEWEST_SLASH}%2000%3A00%3A00%20AM&z=UTC
or you can manually set your Time Range to be (in UTC):
From: $START_OLDEST_FORMATTED To: $END_NEWEST
Please note that it may take 30 seconds or more for events to appear in Hunt.
EOF
fi

View File

@@ -8,9 +8,9 @@ fi
echo "This tool will update a manager's IP address to the new IP assigned to the management network interface."
echo
echo ""
echo "WARNING: This tool is still undergoing testing, use at your own risk!"
echo
echo ""
if [ -z "$OLD_IP" ]; then
OLD_IP=$(lookup_pillar "managerip")
@@ -27,7 +27,7 @@ if [ -z "$NEW_IP" ]; then
NEW_IP=$(ip -4 addr list $iface | grep inet | cut -d' ' -f6 | cut -d/ -f1)
if [ -z "$NEW_IP" ]; then
fail "Unable to detect new IP on interface $iface. "
fail "Unable to detect new IP on interface $iface."
fi
echo "Detected new IP $NEW_IP on interface $iface."
@@ -39,15 +39,20 @@ fi
echo "About to change old IP $OLD_IP to new IP $NEW_IP."
echo
echo ""
read -n 1 -p "Would you like to continue? (y/N) " CONTINUE
echo
echo ""
if [ "$CONTINUE" == "y" ]; then
for file in $(grep -rlI $OLD_IP /opt/so/saltstack /etc); do
echo "Updating file: $file"
sed -i "s|$OLD_IP|$NEW_IP|g" $file
done
for file in $(grep -rlI $OLD_IP /opt/so/saltstack /etc); do
echo "Updating file: $file"
sed -i "s|$OLD_IP|$NEW_IP|g" $file
done
echo "Granting MySQL root user permissions on $NEW_IP"
docker exec -i so-mysql mysql --user=root --password=$(lookup_pillar_secret 'mysql') -e "GRANT ALL PRIVILEGES ON *.* TO 'root'@'$NEW_IP' IDENTIFIED BY '$(lookup_pillar_secret 'mysql')' WITH GRANT OPTION;" &> /dev/null
echo "Removing MySQL root user from $OLD_IP"
docker exec -i so-mysql mysql --user=root --password=$(lookup_pillar_secret 'mysql') -e "DROP USER 'root'@'$OLD_IP';" &> /dev/null
echo "The IP has been changed from $OLD_IP to $NEW_IP."
@@ -60,4 +65,4 @@ if [ "$CONTINUE" == "y" ]; then
fi
else
echo "Exiting without changes."
fi
fi

View File

@@ -1,5 +1,5 @@
#!/bin/bash
#
# Copyright 2014,2015,2016,2017,2018,2019,2020,2021 Security Onion Solutions, LLC
#
# This program is free software: you can redistribute it and/or modify
@@ -17,42 +17,14 @@
. /usr/sbin/so-common
usage() {
echo "Usage: $0 <user-name>"
echo ""
echo "Enables or disables a user in Fleet"
exit 1
}
echo $banner
echo "Running kibana.so_savedobjects_defaults Salt state to restore default saved objects."
printf "This could take a while if another Salt job is running. \nRun this command with --force to stop all Salt jobs before proceeding.\n"
echo $banner
if [ $# -ne 2 ]; then
usage
fi
if [ "$1" = "--force" ]; then
printf "\nForce-stopping all Salt jobs before proceeding\n\n"
salt-call saltutil.kill_all_jobs
fi
USER=$1
MYSQL_PASS=$(lookup_pillar_secret mysql)
FLEET_IP=$(lookup_pillar fleet_ip)
FLEET_USER=$USER
case "${2^^}" in
FALSE | NO | 0)
FLEET_STATUS=0
;;
TRUE | YES | 1)
FLEET_STATUS=1
;;
*)
usage
;;
esac
MYSQL_OUTPUT=$(docker exec so-mysql mysql -u root --password=$MYSQL_PASS fleet -e \
"UPDATE users SET enabled=$FLEET_STATUS WHERE username='$FLEET_USER'" 2>&1)
if [[ $? -eq 0 ]]; then
echo "Successfully updated user in Fleet"
else
echo "Failed to update user in Fleet"
echo $resp
exit 2
fi
salt-call state.apply kibana.so_savedobjects_defaults -linfo queue=True

View File

@@ -1,5 +1,5 @@
. /usr/sbin/so-common
{% set HIGHLANDER = salt['pillar.get']('global:highlander', False) %}
wait_for_web_response "http://localhost:5601/app/kibana" "Elastic" 300 "{{ ELASTICCURL }}"
## This hackery will be removed if using Elastic Auth ##
@@ -9,5 +9,9 @@ SESSIONCOOKIE=$({{ ELASTICCURL }} -c - -X GET http://localhost:5601/ | grep sid
# Disable certain Features from showing up in the Kibana UI
echo
echo "Setting up default Space:"
{% if HIGHLANDER %}
{{ ELASTICCURL }} -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 %}
{{ ELASTICCURL }} -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","siem","logs","infrastructure","apm","uptime","monitoring","stackAlerts","actions","fleet"]} ' >> /opt/so/log/kibana/misc.log
{% endif %}
echo

View File

@@ -0,0 +1,22 @@
#!/bin/bash
# Copyright 2014,2015,2016,2017,2018,2019,2020,2021 Security Onion Solutions, LLC
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
. /usr/sbin/so-common
ENABLEPLAY=${1:-False}
docker exec so-soctopus /usr/local/bin/python -c "import playbook; print(playbook.play_import($ENABLEPLAY))"

View File

@@ -20,6 +20,9 @@
appliance_check() {
{%- if salt['grains.get']('sosmodel', '') %}
APPLIANCE=1
{%- if grains['sosmodel'] in ['SO2AMI01', 'SO2GCI01', 'SO2AZI01'] %}
exit 0
{%- endif %}
DUDEYOUGOTADELL=$(dmidecode |grep Dell)
if [[ -n $DUDEYOUGOTADELL ]]; then
APPTYPE=dell
@@ -90,7 +93,7 @@ check_software_raid
{%- endif %}
if [[ -n $SWRAID ]]; then
if [[ $SWRAID == '0' && BOSSRAID == '0' ]]; then
if [[ $SWRAID == '0' && $BOSSRAID == '0' ]]; then
RAIDSTATUS=0
else
RAIDSTATUS=1

View File

@@ -17,4 +17,4 @@
. /usr/sbin/so-common
docker exec -it so-redis redis-cli llen logstash:unparsed
docker exec so-redis redis-cli llen logstash:unparsed

View File

@@ -405,7 +405,7 @@ def main():
enabled_list.set_defaults(func=list_enabled_rules)
search_term_help='A quoted regex search term (ex: "\$EXTERNAL_NET")'
search_term_help='A properly escaped regex search term (ex: "\\\$EXTERNAL_NET")'
replace_term_help='The text to replace the search term with'
# Modify actions

View File

@@ -1,13 +1,10 @@
#!/bin/bash
got_root() {
# Make sure you are root
if [ "$(id -u)" -ne 0 ]; then
echo "This script must be run using sudo!"
exit 1
fi
. /usr/sbin/so-common
}
argstr=""
for arg in "$@"; do
argstr="${argstr} \"${arg}\""
done
got_root
docker exec so-idstools /bin/bash -c "cd /opt/so/idstools/etc && idstools-rulecat $1"
docker exec so-idstools /bin/bash -c "cd /opt/so/idstools/etc && idstools-rulecat --force ${argstr}"

View File

@@ -92,6 +92,10 @@ if [ $CURRENT_TIME -ge $((SYSTEM_START_TIME+$UPTIME_REQ)) ]; then
log "last highstate completed at `date -d @$LAST_HIGHSTATE_END`" I
log "checking if any jobs are running" I
logCmd "salt-call --local saltutil.running" I
log "ensure salt.minion-state-apply-test is enabled" I
logCmd "salt-call state.enable salt.minion-state-apply-test" I
log "ensure highstate is enabled" I
logCmd "salt-call state.enable highstate" I
log "killing all salt-minion processes" I
logCmd "pkill -9 -ef /usr/bin/salt-minion" I
log "starting salt-minion service" I
@@ -101,4 +105,4 @@ if [ $CURRENT_TIME -ge $((SYSTEM_START_TIME+$UPTIME_REQ)) ]; then
fi
else
log "system uptime only $((CURRENT_TIME-SYSTEM_START_TIME)) seconds does not meet $UPTIME_REQ second requirement." I
fi
fi

View File

@@ -41,10 +41,7 @@ if [[ $? == 0 ]]; then
fi
read -rs THEHIVE_PASS
if ! check_password "$THEHIVE_PASS"; then
echo "Password is invalid. Please exclude single quotes, double quotes and backslashes from the password."
exit 2
fi
check_password_and_exit "$THEHIVE_PASS"
# Create new user in TheHive
resp=$(curl -sk -XPOST -H "Authorization: Bearer $THEHIVE_KEY" -H "Content-Type: application/json" -L "https://$THEHVIE_API_URL/user" -d "{\"login\" : \"$THEHIVE_USER\",\"name\" : \"$THEHIVE_USER\",\"roles\" : [\"read\",\"alert\",\"write\",\"admin\"],\"preferences\" : \"{}\",\"password\" : \"$THEHIVE_PASS\"}")

View File

@@ -42,7 +42,7 @@ fi
read -rs THEHIVE_PASS
if ! check_password "$THEHIVE_PASS"; then
echo "Password is invalid. Please exclude single quotes, double quotes and backslashes from the password."
echo "Password is invalid. Please exclude single quotes, double quotes, dollar signs, and backslashes from the password."
exit 2
fi

View File

@@ -18,11 +18,17 @@
source $(dirname $0)/so-common
if [[ $# -lt 1 || $# -gt 2 ]]; then
echo "Usage: $0 <list|add|update|enable|disable|validate|valemail|valpass> [email]"
DEFAULT_ROLE=analyst
if [[ $# -lt 1 || $# -gt 3 ]]; then
echo "Usage: $0 <operation> [email] [role]"
echo ""
echo " where <operation> is one of the following:"
echo ""
echo " list: Lists all user email addresses currently defined in the identity system"
echo " add: Adds a new user to the identity system; requires 'email' parameter"
echo " add: Adds a new user to the identity system; requires 'email' parameter, while 'role' parameter is optional and defaults to $DEFAULT_ROLE"
echo " addrole: Grants a role to an existing user; requires 'email' and 'role' parameters"
echo " delrole: Removes a role from an existing user; requires 'email' and 'role' parameters"
echo " update: Updates a user's password; requires 'email' parameter"
echo " enable: Enables a user; requires 'email' parameter"
echo " disable: Disables a user; requires 'email' parameter"
@@ -36,14 +42,18 @@ fi
operation=$1
email=$2
role=$3
kratosUrl=${KRATOS_URL:-http://127.0.0.1:4434}
databasePath=${KRATOS_DB_PATH:-/opt/so/conf/kratos/db/db.sqlite}
bcryptRounds=${BCRYPT_ROUNDS:-12}
elasticUsersFile=${ELASTIC_USERS_FILE:-/opt/so/saltstack/local/salt/elasticsearch/files/users}
elasticRolesFile=${ELASTIC_ROLES_FILE:-/opt/so/saltstack/local/salt/elasticsearch/files/users_roles}
socRolesFile=${SOC_ROLES_FILE:-/opt/so/conf/soc/soc_users_roles}
esUID=${ELASTIC_UID:-930}
esGID=${ELASTIC_GID:-930}
soUID=${SOCORE_UID:-939}
soGID=${SOCORE_GID:-939}
function lock() {
# Obtain file descriptor lock
@@ -80,7 +90,7 @@ function findIdByEmail() {
email=$1
response=$(curl -Ss -L ${kratosUrl}/identities)
identityId=$(echo "${response}" | jq ".[] | select(.verifiable_addresses[0].value == \"$email\") | .id")
identityId=$(echo "${response}" | jq -r ".[] | select(.verifiable_addresses[0].value == \"$email\") | .id")
echo $identityId
}
@@ -89,17 +99,23 @@ function validatePassword() {
len=$(expr length "$password")
if [[ $len -lt 6 ]]; then
echo "Password does not meet the minimum requirements"
exit 2
fail "Password does not meet the minimum requirements"
fi
if [[ $len -gt 72 ]]; then
fail "Password is too long (max: 72)"
fi
check_password_and_exit "$password"
}
function validateEmail() {
email=$1
# (?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:(2(5[0-5]|[0-4][0-9])|1[0-9][0-9]|[1-9]?[0-9]))\.){3}(?:(2(5[0-5]|[0-4][0-9])|1[0-9][0-9]|[1-9]?[0-9])|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])
if [[ ! "$email" =~ ^[[:alnum:]._%+-]+@[[:alnum:].-]+\.[[:alpha:]]{2,}$ ]]; then
echo "Email address is invalid"
exit 3
fail "Email address is invalid"
fi
if [[ "$email" =~ [A-Z] ]]; then
fail "Email addresses cannot contain uppercase letters"
fi
}
@@ -127,21 +143,51 @@ function updatePassword() {
validatePassword "$password"
fi
if [[ -n $identityId ]]; then
if [[ -n "$identityId" ]]; then
# Generate password hash
passwordHash=$(hashPassword "$password")
# Update DB with new hash
echo "update identity_credentials set config=CAST('{\"hashed_password\":\"$passwordHash\"}' as BLOB) where identity_id=${identityId};" | sqlite3 "$databasePath"
echo "update identity_credentials set config=CAST('{\"hashed_password\":\"$passwordHash\"}' as BLOB) where identity_id='${identityId}';" | sqlite3 "$databasePath"
[[ $? != 0 ]] && fail "Unable to update password"
fi
}
function createElasticFile() {
function createFile() {
filename=$1
tmpFile=${filename}
truncate -s 0 "$tmpFile"
chmod 600 "$tmpFile"
chown "${esUID}:${esGID}" "$tmpFile"
uid=$2
gid=$3
mkdir -p $(dirname "$filename")
truncate -s 0 "$filename"
chmod 600 "$filename"
chown "${uid}:${gid}" "$filename"
}
function ensureRoleFileExists() {
if [[ ! -f "$socRolesFile" || ! -s "$socRolesFile" ]]; then
# Generate the new users file
rolesTmpFile="${socRolesFile}.tmp"
createFile "$rolesTmpFile" "$soUID" "$soGID"
if [[ -f "$databasePath" ]]; then
echo "Migrating roles to new file: $socRolesFile"
echo "select 'superuser:' || id from identities;" | sqlite3 "$databasePath" \
>> "$rolesTmpFile"
[[ $? != 0 ]] && fail "Unable to read identities from database"
echo "The following users have all been migrated with the super user role:"
cat "${rolesTmpFile}"
else
echo "Database file does not exist yet, installation is likely not yet complete."
fi
if [[ -d "$socRolesFile" ]]; then
echo "Removing invalid roles directory created by Docker"
rm -fr "$socRolesFile"
fi
mv "${rolesTmpFile}" "${socRolesFile}"
fi
}
function syncElasticSystemUser() {
@@ -172,53 +218,56 @@ function syncElasticSystemRole() {
}
function syncElastic() {
echo "Syncing users between SOC and Elastic..."
echo "Syncing users and roles between SOC and Elastic..."
usersTmpFile="${elasticUsersFile}.tmp"
createFile "${usersTmpFile}" "$esUID" "$esGID"
rolesTmpFile="${elasticRolesFile}.tmp"
createElasticFile "${usersTmpFile}"
createElasticFile "${rolesTmpFile}"
createFile "${rolesTmpFile}" "$esUID" "$esGID"
authPillarJson=$(lookup_salt_value "auth" "elasticsearch" "pillar" "json")
syncElasticSystemUser "$authPillarJson" "so_elastic_user" "$usersTmpFile"
syncElasticSystemRole "$authPillarJson" "so_elastic_user" "superuser" "$rolesTmpFile"
syncElasticSystemUser "$authPillarJson" "so_kibana_user" "$usersTmpFile"
syncElasticSystemRole "$authPillarJson" "so_kibana_user" "superuser" "$rolesTmpFile"
syncElasticSystemUser "$authPillarJson" "so_logstash_user" "$usersTmpFile"
syncElasticSystemRole "$authPillarJson" "so_logstash_user" "superuser" "$rolesTmpFile"
syncElasticSystemUser "$authPillarJson" "so_beats_user" "$usersTmpFile"
syncElasticSystemRole "$authPillarJson" "so_beats_user" "superuser" "$rolesTmpFile"
syncElasticSystemUser "$authPillarJson" "so_monitor_user" "$usersTmpFile"
syncElasticSystemRole "$authPillarJson" "so_elastic_user" "superuser" "$rolesTmpFile"
syncElasticSystemRole "$authPillarJson" "so_kibana_user" "superuser" "$rolesTmpFile"
syncElasticSystemRole "$authPillarJson" "so_logstash_user" "superuser" "$rolesTmpFile"
syncElasticSystemRole "$authPillarJson" "so_beats_user" "superuser" "$rolesTmpFile"
syncElasticSystemRole "$authPillarJson" "so_monitor_user" "remote_monitoring_collector" "$rolesTmpFile"
syncElasticSystemRole "$authPillarJson" "so_monitor_user" "remote_monitoring_agent" "$rolesTmpFile"
syncElasticSystemRole "$authPillarJson" "so_monitor_user" "monitoring_user" "$rolesTmpFile"
if [[ -f "$databasePath" ]]; then
# Generate the new users file
if [[ -f "$databasePath" && -f "$socRolesFile" ]]; then
# Append the SOC users
echo "select '{\"user\":\"' || ici.identifier || '\", \"data\":' || ic.config || '}'" \
"from identity_credential_identifiers ici, identity_credentials ic " \
"where ici.identity_credential_id=ic.id and instr(ic.config, 'hashed_password') " \
"from identity_credential_identifiers ici, identity_credentials ic, identities i " \
"where " \
" ici.identity_credential_id=ic.id " \
" and ic.identity_id=i.id " \
" and instr(ic.config, 'hashed_password') " \
" and i.state == 'active' " \
"order by ici.identifier;" | \
sqlite3 "$databasePath" | \
jq -r '.user + ":" + .data.hashed_password' \
>> "$usersTmpFile"
[[ $? != 0 ]] && fail "Unable to read credential hashes from database"
# Generate the new users_roles file
echo "select 'superuser:' || ici.identifier " \
"from identity_credential_identifiers ici, identity_credentials ic " \
"where ici.identity_credential_id=ic.id and instr(ic.config, 'hashed_password') " \
"order by ici.identifier;" | \
sqlite3 "$databasePath" \
>> "$rolesTmpFile"
[[ $? != 0 ]] && fail "Unable to read credential IDs from database"
# Append the user roles
while IFS="" read -r rolePair || [ -n "$rolePair" ]; do
userId=$(echo "$rolePair" | cut -d: -f2)
role=$(echo "$rolePair" | cut -d: -f1)
echo "select '$role:' || ici.identifier " \
"from identity_credential_identifiers ici, identity_credentials ic " \
"where ici.identity_credential_id=ic.id and ic.identity_id = '$userId';" | \
sqlite3 "$databasePath" >> "$rolesTmpFile"
done < "$socRolesFile"
else
echo "Database file does not exist yet, skipping users export"
echo "Database file or soc roles file does not exist yet, skipping users export"
fi
if [[ -s "${usersTmpFile}" ]]; then
@@ -236,15 +285,22 @@ function syncElastic() {
}
function syncAll() {
ensureRoleFileExists
# Check if a sync is needed. Sync is not needed if the following are true:
# - user database entries are all older than the elastic users file
# - soc roles file last modify date is older than the elastic roles file
if [[ -z "$FORCE_SYNC" && -f "$databasePath" && -f "$elasticUsersFile" ]]; then
usersFileAgeSecs=$(echo $(($(date +%s) - $(date +%s -r "$elasticUsersFile"))))
staleCount=$(echo "select count(*) from identity_credentials where updated_at >= Datetime('now', '-${usersFileAgeSecs} seconds');" \
| sqlite3 "$databasePath")
if [[ "$staleCount" == "0" ]]; then
if [[ "$staleCount" == "0" && "$elasticRolesFile" -nt "$socRolesFile" ]]; then
return 1
fi
fi
syncElastic
return 0
}
@@ -252,11 +308,64 @@ function listUsers() {
response=$(curl -Ss -L ${kratosUrl}/identities)
[[ $? != 0 ]] && fail "Unable to communicate with Kratos"
echo "${response}" | jq -r ".[] | .verifiable_addresses[0].value" | sort
users=$(echo "${response}" | jq -r ".[] | .verifiable_addresses[0].value" | sort)
for user in $users; do
roles=$(grep "$user" "$elasticRolesFile" | cut -d: -f1 | tr '\n' ' ')
echo "$user: $roles"
done
}
function addUserRole() {
email=$1
role=$2
adjustUserRole "$email" "$role" "add"
}
function deleteUserRole() {
email=$1
role=$2
adjustUserRole "$email" "$role" "del"
}
function adjustUserRole() {
email=$1
role=$2
op=$3
identityId=$(findIdByEmail "$email")
[[ ${identityId} == "" ]] && fail "User not found"
ensureRoleFileExists
filename="$socRolesFile"
hasRole=0
grep "$role:" "$socRolesFile" | grep -q "$identityId" && hasRole=1
if [[ "$op" == "add" ]]; then
if [[ "$hasRole" == "1" ]]; then
echo "User '$email' already has the role: $role"
return 1
else
echo "$role:$identityId" >> "$filename"
fi
elif [[ "$op" == "del" ]]; then
if [[ "$hasRole" -ne 1 ]]; then
fail "User '$email' does not have the role: $role"
else
sed "/^$role:$identityId\$/d" "$filename" > "$filename.tmp"
cat "$filename".tmp > "$filename"
rm -f "$filename".tmp
fi
else
fail "Unsupported role adjustment operation: $op"
fi
return 0
}
function createUser() {
email=$1
role=$2
now=$(date -u +%FT%TZ)
addUserJson=$(cat <<EOF
@@ -270,16 +379,30 @@ EOF
response=$(curl -Ss -L ${kratosUrl}/identities -d "$addUserJson")
[[ $? != 0 ]] && fail "Unable to communicate with Kratos"
identityId=$(echo "${response}" | jq ".id")
if [[ ${identityId} == "null" ]]; then
identityId=$(echo "${response}" | jq -r ".id")
if [[ "${identityId}" == "null" ]]; then
code=$(echo "${response}" | jq ".error.code")
[[ "${code}" == "409" ]] && fail "User already exists"
reason=$(echo "${response}" | jq ".error.message")
[[ $? == 0 ]] && fail "Unable to add user: ${reason}"
else
updatePassword "$identityId"
addUserRole "$email" "$role"
fi
}
updatePassword $identityId
function migrateLockedUsers() {
# This is a migration function to convert locked users from prior to 2.3.90
# to inactive users using the newer Kratos functionality. This should only
# find locked users once.
lockedEmails=$(curl -s http://localhost:4434/identities | jq -r '.[] | select(.traits.status == "locked") | .traits.email')
if [[ -n "$lockedEmails" ]]; then
echo "Disabling locked users..."
for email in $lockedEmails; do
updateStatus "$email" locked
done
fi
}
function updateStatus() {
@@ -292,24 +415,18 @@ function updateStatus() {
response=$(curl -Ss -L "${kratosUrl}/identities/$identityId")
[[ $? != 0 ]] && fail "Unable to communicate with Kratos"
oldConfig=$(echo "select config from identity_credentials where identity_id=${identityId};" | sqlite3 "$databasePath")
schemaId=$(echo "$response" | jq -r .schema_id)
# Capture traits and remove obsolete 'status' trait if exists
traitBlock=$(echo "$response" | jq -c .traits | sed -re 's/,?"status":".*?"//')
state="active"
if [[ "$status" == "locked" ]]; then
config=$(echo $oldConfig | sed -e 's/hashed/locked/')
echo "update identity_credentials set config=CAST('${config}' as BLOB) where identity_id=${identityId};" | sqlite3 "$databasePath"
[[ $? != 0 ]] && fail "Unable to lock credential record"
echo "delete from sessions where identity_id=${identityId};" | sqlite3 "$databasePath"
[[ $? != 0 ]] && fail "Unable to invalidate sessions"
else
config=$(echo $oldConfig | sed -e 's/locked/hashed/')
echo "update identity_credentials set config=CAST('${config}' as BLOB) where identity_id=${identityId};" | sqlite3 "$databasePath"
[[ $? != 0 ]] && fail "Unable to unlock credential record"
fi
updatedJson=$(echo "$response" | jq ".traits.status = \"$status\" | del(.verifiable_addresses) | del(.id) | del(.schema_url) | del(.created_at) | del(.updated_at)")
response=$(curl -Ss -XPUT -L ${kratosUrl}/identities/$identityId -d "$updatedJson")
[[ $? != 0 ]] && fail "Unable to mark user as locked"
state="inactive"
fi
body="{ \"schema_id\": \"$schemaId\", \"state\": \"$state\", \"traits\": $traitBlock }"
response=$(curl -fSsL -XPUT "${kratosUrl}/identities/$identityId" -d "$body")
[[ $? != 0 ]] && fail "Unable to update user"
}
function updateUser() {
@@ -318,7 +435,7 @@ function updateUser() {
identityId=$(findIdByEmail "$email")
[[ ${identityId} == "" ]] && fail "User not found"
updatePassword $identityId
updatePassword "$identityId"
}
function deleteUser() {
@@ -329,6 +446,11 @@ function deleteUser() {
response=$(curl -Ss -XDELETE -L "${kratosUrl}/identities/$identityId")
[[ $? != 0 ]] && fail "Unable to communicate with Kratos"
rolesTmpFile="${socRolesFile}.tmp"
createFile "$rolesTmpFile" "$soUID" "$soGID"
grep -v "$identityId" "$socRolesFile" > "$rolesTmpFile"
mv "$rolesTmpFile" "$socRolesFile"
}
case "${operation}" in
@@ -339,7 +461,7 @@ case "${operation}" in
lock
validateEmail "$email"
updatePassword
createUser "$email"
createUser "$email" "${role:-$DEFAULT_ROLE}"
syncAll
echo "Successfully added new user to SOC"
check_container thehive && echo "$password" | so-thehive-user-add "$email"
@@ -351,6 +473,31 @@ case "${operation}" in
listUsers
;;
"addrole")
verifyEnvironment
[[ "$email" == "" ]] && fail "Email address must be provided"
[[ "$role" == "" ]] && fail "Role must be provided"
lock
validateEmail "$email"
if addUserRole "$email" "$role"; then
syncElastic
echo "Successfully added role to user"
fi
;;
"delrole")
verifyEnvironment
[[ "$email" == "" ]] && fail "Email address must be provided"
[[ "$role" == "" ]] && fail "Role must be provided"
lock
validateEmail "$email"
deleteUserRole "$email" "$role"
syncElastic
echo "Successfully removed role from user"
;;
"update")
verifyEnvironment
[[ "$email" == "" ]] && fail "Email address must be provided"
@@ -370,7 +517,7 @@ case "${operation}" in
syncAll
echo "Successfully enabled user"
check_container thehive && so-thehive-user-enable "$email" true
check_container fleet && so-fleet-user-enable "$email" true
echo "Fleet user will need to be recreated manually with so-fleet-user-add"
;;
"disable")
@@ -382,7 +529,7 @@ case "${operation}" in
syncAll
echo "Successfully disabled user"
check_container thehive && so-thehive-user-enable "$email" false
check_container fleet && so-fleet-user-enable "$email" false
check_container fleet && so-fleet-user-delete "$email"
;;
"delete")
@@ -394,7 +541,7 @@ case "${operation}" in
syncAll
echo "Successfully deleted user"
check_container thehive && so-thehive-user-enable "$email" false
check_container fleet && so-fleet-user-enable "$email" false
check_container fleet && so-fleet-user-delete "$email"
;;
"sync")
@@ -418,6 +565,11 @@ case "${operation}" in
echo "Password is acceptable"
;;
"migrate")
migrateLockedUsers
echo "User migration complete"
;;
*)
fail "Unsupported operation: $operation"
;;

View File

@@ -1,5 +1,4 @@
#!/bin/bash
# Copyright 2014,2015,2016,2017,2018,2019,2020,2021 Security Onion Solutions, LLC
#
# This program is free software: you can redistribute it and/or modify
@@ -20,13 +19,8 @@ echo "Starting to check for yara rule updates at $(date)..."
output_dir="/opt/so/saltstack/default/salt/strelka/rules"
mkdir -p $output_dir
repos="$output_dir/repos.txt"
ignorefile="$output_dir/ignore.txt"
deletecounter=0
newcounter=0
updatecounter=0
{% if ISAIRGAP is sameas true %}
@@ -35,58 +29,21 @@ echo "Airgap mode enabled."
clone_dir="/nsm/repo/rules/strelka"
repo_name="signature-base"
mkdir -p /opt/so/saltstack/default/salt/strelka/rules/signature-base
# Ensure a copy of the license is available for the rules
[ -f $clone_dir/LICENSE ] && cp $clone_dir/$repo_name/LICENSE $output_dir/$repo_name
# Copy over rules
for i in $(find $clone_dir/yara -name "*.yar*"); do
rule_name=$(echo $i | awk -F '/' '{print $NF}')
repo_sum=$(sha256sum $i | awk '{print $1}')
# Check rules against those in ignore list -- don't copy if ignored.
if ! grep -iq $rule_name $ignorefile; then
existing_rules=$(find $output_dir/$repo_name/ -name $rule_name | wc -l)
# For existing rules, check to see if they need to be updated, by comparing checksums
if [ $existing_rules -gt 0 ];then
local_sum=$(sha256sum $output_dir/$repo_name/$rule_name | awk '{print $1}')
if [ "$repo_sum" != "$local_sum" ]; then
echo "Checksums do not match!"
echo "Updating $rule_name..."
cp $i $output_dir/$repo_name;
((updatecounter++))
fi
else
# If rule doesn't exist already, we'll add it
echo "Adding new rule: $rule_name..."
cp $i $output_dir/$repo_name
((newcounter++))
fi
fi;
done
# Check to see if we have any old rules that need to be removed
for i in $(find $output_dir/$repo_name -name "*.yar*" | awk -F '/' '{print $NF}'); do
is_repo_rule=$(find $clone_dir -name "$i" | wc -l)
if [ $is_repo_rule -eq 0 ]; then
echo "Could not find $i in source $repo_name repo...removing from $output_dir/$repo_name..."
rm $output_dir/$repo_name/$i
((deletecounter++))
fi
echo "Adding rule: $rule_name..."
cp $i $output_dir/$repo_name
((newcounter++))
done
echo "Done!"
if [ "$newcounter" -gt 0 ];then
echo "$newcounter new rules added."
fi
if [ "$updatecounter" -gt 0 ];then
echo "$updatecounter rules updated."
fi
if [ "$deletecounter" -gt 0 ];then
echo "$deletecounter rules removed because they were deprecated or don't exist in the source repo."
echo "$newcounter rules added."
fi
{% else %}
@@ -99,69 +56,32 @@ if [ "$gh_status" == "200" ] || [ "$gh_status" == "301" ]; then
if ! $(echo "$repo" | grep -qE '^#'); then
# Remove old repo if existing bc of previous error condition or unexpected disruption
repo_name=`echo $repo | awk -F '/' '{print $NF}'`
[ -d $repo_name ] && rm -rf $repo_name
[ -d $output_dir/$repo_name ] && rm -rf $output_dir/$repo_name
# Clone repo and make appropriate directories for rules
git clone $repo $clone_dir/$repo_name
echo "Analyzing rules from $clone_dir/$repo_name..."
mkdir -p $output_dir/$repo_name
# Ensure a copy of the license is available for the rules
[ -f $clone_dir/$repo_name/LICENSE ] && cp $clone_dir/$repo_name/LICENSE $output_dir/$repo_name
# Copy over rules
for i in $(find $clone_dir/$repo_name -name "*.yar*"); do
rule_name=$(echo $i | awk -F '/' '{print $NF}')
repo_sum=$(sha256sum $i | awk '{print $1}')
# Check rules against those in ignore list -- don't copy if ignored.
if ! grep -iq $rule_name $ignorefile; then
existing_rules=$(find $output_dir/$repo_name/ -name $rule_name | wc -l)
# For existing rules, check to see if they need to be updated, by comparing checksums
if [ $existing_rules -gt 0 ];then
local_sum=$(sha256sum $output_dir/$repo_name/$rule_name | awk '{print $1}')
if [ "$repo_sum" != "$local_sum" ]; then
echo "Checksums do not match!"
echo "Updating $rule_name..."
cp $i $output_dir/$repo_name;
((updatecounter++))
fi
else
# If rule doesn't exist already, we'll add it
echo "Adding new rule: $rule_name..."
cp $i $output_dir/$repo_name
((newcounter++))
fi
fi;
done
# Check to see if we have any old rules that need to be removed
for i in $(find $output_dir/$repo_name -name "*.yar*" | awk -F '/' '{print $NF}'); do
is_repo_rule=$(find $clone_dir/$repo_name -name "$i" | wc -l)
if [ $is_repo_rule -eq 0 ]; then
echo "Could not find $i in source $repo_name repo...removing from $output_dir/$repo_name..."
rm $output_dir/$repo_name/$i
((deletecounter++))
fi
done
rm -rf $clone_dir/$repo_name
fi
done < $repos
echo "Adding rule: $rule_name..."
cp $i $output_dir/$repo_name
((newcounter++))
done
rm -rf $clone_dir/$repo_name
fi
done < $repos
echo "Done!"
if [ "$newcounter" -gt 0 ];then
echo "$newcounter new rules added."
echo "$newcounter rules added."
fi
if [ "$updatecounter" -gt 0 ];then
echo "$updatecounter rules updated."
fi
if [ "$deletecounter" -gt 0 ];then
echo "$deletecounter rules removed because they were deprecated or don't exist in the source repo."
fi
else
echo "Server returned $gh_status status code."
echo "No connectivity to Github...exiting..."

View File

@@ -27,6 +27,7 @@ SOUP_LOG=/root/soup.log
INFLUXDB_MIGRATION_LOG=/opt/so/log/influxdb/soup_migration.log
WHATWOULDYOUSAYYAHDOHERE=soup
whiptail_title='Security Onion UPdater'
NOTIFYCUSTOMELASTICCONFIG=false
check_err() {
local exit_code=$1
@@ -105,17 +106,20 @@ add_common() {
airgap_mounted() {
# Let's see if the ISO is already mounted.
if [ -f /tmp/soagupdate/SecurityOnion/VERSION ]; then
if [[ -f /tmp/soagupdate/SecurityOnion/VERSION ]]; then
echo "The ISO is already mounted"
else
echo ""
cat << EOF
if [[ -z $ISOLOC ]]; then
echo "This is airgap. Ask for a location."
echo ""
cat << EOF
In order for soup to proceed, the path to the downloaded Security Onion ISO file, or the path to the CD-ROM or equivalent device containing the ISO media must be provided.
For example, if you have copied the new Security Onion ISO file to your home directory, then the path might look like /home/myuser/securityonion-2.x.y.iso.
Or, if you have burned the new ISO onto an optical disk then the path might look like /dev/cdrom.
EOF
read -rp 'Enter the path to the new Security Onion ISO content: ' ISOLOC
read -rp 'Enter the path to the new Security Onion ISO content: ' ISOLOC
fi
if [[ -f $ISOLOC ]]; then
# Mounting the ISO image
mkdir -p /tmp/soagupdate
@@ -131,7 +135,7 @@ EOF
elif [[ -f $ISOLOC/SecurityOnion/VERSION ]]; then
ln -s $ISOLOC /tmp/soagupdate
echo "Found the update content"
else
elif [[ -b $ISOLOC ]]; then
mkdir -p /tmp/soagupdate
mount $ISOLOC /tmp/soagupdate
if [ ! -f /tmp/soagupdate/SecurityOnion/VERSION ]; then
@@ -140,7 +144,11 @@ EOF
exit 0
else
echo "Device has been mounted!"
fi
fi
else
echo "Could not find Security Onion ISO content at ${ISOLOC}"
echo "Ensure the path you entered is correct, and that you verify the ISO that you downloaded."
exit 0
fi
fi
}
@@ -150,7 +158,7 @@ airgap_update_dockers() {
# Let's copy the tarball
if [[ ! -f $AGDOCKER/registry.tar ]]; then
echo "Unable to locate registry. Exiting"
exit 1
exit 0
else
echo "Stopping the registry docker"
docker stop so-dockerregistry
@@ -213,6 +221,19 @@ check_local_mods() {
# {% endraw %}
check_pillar_items() {
local pillar_output=$(salt-call pillar.items --out=json)
cond=$(jq '.local | has("_errors")' <<< "$pillar_output")
if [[ "$cond" == "true" ]]; then
printf "\nThere is an issue rendering the manager's pillars. Please correct the issues in the sls files mentioned below before running SOUP again.\n\n"
jq '.local._errors[]' <<< "$pillar_output"
exit 0
else
printf "\nThe manager's pillars can be rendered. We can proceed with SOUP.\n\n"
fi
}
check_sudoers() {
if grep -q "so-setup" /etc/sudoers; then
echo "There is an entry for so-setup in the sudoers file, this can be safely deleted using \"visudo\"."
@@ -282,25 +303,31 @@ check_os_updates() {
OSUPDATES=$(yum -q list updates | wc -l)
fi
if [[ "$OSUPDATES" -gt 0 ]]; then
echo $NEEDUPDATES
echo ""
read -p "Press U to update OS packages (recommended), C to continue without updates, or E to exit: " confirm
if [[ "$confirm" == [cC] ]]; then
if [[ -z $UNATTENDED ]]; then
echo "$NEEDUPDATES"
echo ""
read -rp "Press U to update OS packages (recommended), C to continue without updates, or E to exit: " confirm
if [[ "$confirm" == [cC] ]]; then
echo "Continuing without updating packages"
elif [[ "$confirm" == [uU] ]]; then
elif [[ "$confirm" == [uU] ]]; then
echo "Applying Grid Updates"
set +e
run_check_net_err "salt '*' -b 5 state.apply patch.os queue=True" 'Could not apply OS updates, please check your network connection.'
set -e
else
update_flag=true
else
echo "Exiting soup"
exit 0
fi
else
update_flag=true
fi
else
echo "Looks like you have an updated OS"
echo "Looks like you have an updated OS"
fi
if [[ $update_flag == true ]]; then
set +e
run_check_net_err "salt '*' -b 5 state.apply patch.os queue=True" 'Could not apply OS updates, please check your network connection.'
set -e
fi
}
clean_dockers() {
@@ -366,12 +393,11 @@ preupgrade_changes() {
# This function is to add any new pillar items if needed.
echo "Checking to see if changes are needed."
[[ "$INSTALLEDVERSION" =~ rc.1 ]] && rc1_to_rc2
[[ "$INSTALLEDVERSION" =~ rc.2 ]] && rc2_to_rc3
[[ "$INSTALLEDVERSION" =~ rc.3 ]] && rc3_to_2.3.0
[[ "$INSTALLEDVERSION" == 2.3.0 || "$INSTALLEDVERSION" == 2.3.1 || "$INSTALLEDVERSION" == 2.3.2 || "$INSTALLEDVERSION" == 2.3.10 ]] && up_2.3.0_to_2.3.20
[[ "$INSTALLEDVERSION" == 2.3.20 || "$INSTALLEDVERSION" == 2.3.21 ]] && up_2.3.2X_to_2.3.30
[[ "$INSTALLEDVERSION" == 2.3.30 || "$INSTALLEDVERSION" == 2.3.40 ]] && up_2.3.3X_to_2.3.50
[[ "$INSTALLEDVERSION" == 2.3.0 || "$INSTALLEDVERSION" == 2.3.1 || "$INSTALLEDVERSION" == 2.3.2 || "$INSTALLEDVERSION" == 2.3.10 ]] && up_to_2.3.20
[[ "$INSTALLEDVERSION" == 2.3.20 || "$INSTALLEDVERSION" == 2.3.21 ]] && up_to_2.3.30
[[ "$INSTALLEDVERSION" == 2.3.30 || "$INSTALLEDVERSION" == 2.3.40 ]] && up_to_2.3.50
[[ "$INSTALLEDVERSION" == 2.3.50 || "$INSTALLEDVERSION" == 2.3.51 || "$INSTALLEDVERSION" == 2.3.52 || "$INSTALLEDVERSION" == 2.3.60 || "$INSTALLEDVERSION" == 2.3.61 || "$INSTALLEDVERSION" == 2.3.70 ]] && up_to_2.3.80
[[ "$INSTALLEDVERSION" == 2.3.80 ]] && up_to_2.3.90
true
}
@@ -379,119 +405,66 @@ postupgrade_changes() {
# This function is to add any new pillar items if needed.
echo "Running post upgrade processes."
[[ "$POSTVERSION" =~ rc.1 ]] && post_rc1_to_rc2
[[ "$POSTVERSION" == 2.3.20 || "$POSTVERSION" == 2.3.21 ]] && post_2.3.2X_to_2.3.30
[[ "$POSTVERSION" == 2.3.30 ]] && post_2.3.30_to_2.3.40
[[ "$POSTVERSION" == 2.3.50 ]] && post_2.3.5X_to_2.3.60
[[ "$POSTVERSION" == 2.3.0 || "$POSTVERSION" == 2.3.1 || "$POSTVERSION" == 2.3.2 || "$POSTVERSION" == 2.3.10 || "$POSTVERSION" == 2.3.20 ]] && post_to_2.3.21
[[ "$POSTVERSION" == 2.3.21 || "$POSTVERSION" == 2.3.30 ]] && post_to_2.3.40
[[ "$POSTVERSION" == 2.3.40 || "$POSTVERSION" == 2.3.50 || "$POSTVERSION" == 2.3.51 || "$POSTVERSION" == 2.3.52 ]] && post_to_2.3.60
[[ "$POSTVERSION" == 2.3.60 || "$POSTVERSION" == 2.3.61 || "$POSTVERSION" == 2.3.70 || "$POSTVERSION" == 2.3.80 ]] && post_to_2.3.90
true
}
post_rc1_to_2.3.21() {
post_to_2.3.21() {
salt-call state.apply playbook.OLD_db_init
rm -f /opt/so/rules/elastalert/playbook/*.yaml
so-playbook-ruleupdate >> /root/soup_playbook_rule_update.log 2>&1 &
POSTVERSION=2.3.21
}
post_2.3.2X_to_2.3.30() {
so-playbook-sigma-refresh >> /root/soup_playbook_sigma_refresh.log 2>&1 &
POSTVERSION=2.3.30
}
post_2.3.30_to_2.3.40() {
post_to_2.3.40() {
so-playbook-sigma-refresh >> /root/soup_playbook_sigma_refresh.log 2>&1 &
so-kibana-space-defaults
POSTVERSION=2.3.40
}
post_2.3.5X_to_2.3.60() {
post_to_2.3.60() {
for table in identity_recovery_addresses selfservice_recovery_flows selfservice_registration_flows selfservice_verification_flows identities identity_verification_tokens identity_credentials selfservice_settings_flows identity_recovery_tokens continuity_containers identity_credential_identifiers identity_verifiable_addresses courier_messages selfservice_errors sessions selfservice_login_flows
do
echo "Forcing Kratos network migration: $table"
sqlite3 /opt/so/conf/kratos/db/db.sqlite "update $table set nid=(select id from networks limit 1);"
done
POSTVERSION=2.3.60
}
post_to_2.3.90() {
# Do Kibana dashboard things
salt-call state.apply kibana.so_savedobjects_defaults queue=True
rc1_to_rc2() {
# Create FleetDM service account
FLEET_MANAGER=$(lookup_pillar fleet_manager)
if [[ "$FLEET_MANAGER" == "True" ]]; then
FLEET_SA_EMAIL=$(lookup_pillar_secret fleet_sa_email)
FLEET_SA_PW=$(lookup_pillar_secret fleet_sa_password)
MYSQL_PW=$(lookup_pillar_secret mysql)
# Move the static file to global.sls
echo "Migrating static.sls to global.sls"
mv -v /opt/so/saltstack/local/pillar/static.sls /opt/so/saltstack/local/pillar/global.sls >> "$SOUP_LOG" 2>&1
sed -i '1c\global:' /opt/so/saltstack/local/pillar/global.sls >> "$SOUP_LOG" 2>&1
FLEET_HASH=$(docker exec so-soctopus python -c "import bcrypt; print(bcrypt.hashpw('$FLEET_SA_PW'.encode('utf-8'), bcrypt.gensalt()).decode('utf-8'));" 2>&1)
MYSQL_OUTPUT=$(docker exec so-mysql mysql -u root --password=$MYSQL_PW fleet -e \
"INSERT INTO users (password,salt,email,name,global_role) VALUES ('$FLEET_HASH','','$FLEET_SA_EMAIL','$FLEET_SA_EMAIL','admin')" 2>&1)
# Moving baseurl from minion sls file to inside global.sls
local line=$(grep '^ url_base:' /opt/so/saltstack/local/pillar/minions/$MINIONID.sls)
sed -i '/^ url_base:/d' /opt/so/saltstack/local/pillar/minions/$MINIONID.sls;
sed -i "/^global:/a \\$line" /opt/so/saltstack/local/pillar/global.sls;
if [[ $? -eq 0 ]]; then
echo "Successfully added service account to Fleet"
else
echo "Unable to add service account to Fleet"
echo "$MYSQL_OUTPUT"
fi
fi
# Adding play values to the global.sls
local HIVEPLAYSECRET=$(get_random_value)
local CORTEXPLAYSECRET=$(get_random_value)
sed -i "/^global:/a \\ hiveplaysecret: $HIVEPLAYSECRET" /opt/so/saltstack/local/pillar/global.sls;
sed -i "/^global:/a \\ cortexplaysecret: $CORTEXPLAYSECRET" /opt/so/saltstack/local/pillar/global.sls;
# Move storage nodes to hostname for SSL
# Get a list we can use:
grep -A1 searchnode /opt/so/saltstack/local/pillar/data/nodestab.sls | grep -v '\-\-' | sed '$!N;s/\n/ /' | awk '{print $1,$3}' | awk '/_searchnode:/{gsub(/\_searchnode:/, "_searchnode"); print}' >/tmp/nodes.txt
# Remove the nodes from cluster settings
while read p; do
local NAME=$(echo $p | awk '{print $1}')
local IP=$(echo $p | awk '{print $2}')
echo "Removing the old cross cluster config for $NAME"
curl -XPUT -H 'Content-Type: application/json' http://localhost:9200/_cluster/settings -d '{"persistent":{"cluster":{"remote":{"'$NAME'":{"skip_unavailable":null,"seeds":null}}}}}'
done </tmp/nodes.txt
# Add the nodes back using hostname
while read p; do
local NAME=$(echo $p | awk '{print $1}')
local EHOSTNAME=$(echo $p | awk -F"_" '{print $1}')
local IP=$(echo $p | awk '{print $2}')
echo "Adding the new cross cluster config for $NAME"
curl -XPUT http://localhost:9200/_cluster/settings -H'Content-Type: application/json' -d '{"persistent": {"search": {"remote": {"'$NAME'": {"skip_unavailable": "true", "seeds": ["'$EHOSTNAME':9300"]}}}}}'
done </tmp/nodes.txt
INSTALLEDVERSION=rc.2
}
rc2_to_rc3() {
# move location of local.rules
cp /opt/so/saltstack/default/salt/idstools/localrules/local.rules /opt/so/saltstack/local/salt/idstools/local.rules
if [ -f /opt/so/saltstack/local/salt/idstools/localrules/local.rules ]; then
cat /opt/so/saltstack/local/salt/idstools/localrules/local.rules >> /opt/so/saltstack/local/salt/idstools/local.rules
fi
rm -rf /opt/so/saltstack/local/salt/idstools/localrules
rm -rf /opt/so/saltstack/default/salt/idstools/localrules
# Rename mdengine to MDENGINE
sed -i "s/ zeekversion/ mdengine/g" /opt/so/saltstack/local/pillar/global.sls
# Enable Strelka Rules
sed -i "/ rules:/c\ rules: 1" /opt/so/saltstack/local/pillar/global.sls
INSTALLEDVERSION=rc.3
POSTVERSION=2.3.90
}
rc3_to_2.3.0() {
# Fix Tab Complete
if [ ! -f /etc/profile.d/securityonion.sh ]; then
echo "complete -cf sudo" > /etc/profile.d/securityonion.sh
fi
{
echo "redis_settings:"
echo " redis_maxmemory: 827"
echo "playbook:"
echo " api_key: de6639318502476f2fa5aa06f43f51fb389a3d7f"
} >> /opt/so/saltstack/local/pillar/global.sls
sed -i 's/playbook:/playbook_db:/' /opt/so/saltstack/local/pillar/secrets.sls
{
echo "playbook_admin: $(get_random_value)"
echo "playbook_automation: $(get_random_value)"
} >> /opt/so/saltstack/local/pillar/secrets.sls
INSTALLEDVERSION=2.3.0
}
up_2.3.0_to_2.3.20(){
up_to_2.3.20(){
DOCKERSTUFFBIP=$(echo $DOCKERSTUFF | awk -F'.' '{print $1,$2,$3,1}' OFS='.')/24
# Remove PCAP from global
sed '/pcap:/d' /opt/so/saltstack/local/pillar/global.sls
@@ -529,7 +502,7 @@ up_2.3.0_to_2.3.20(){
INSTALLEDVERSION=2.3.20
}
up_2.3.2X_to_2.3.30() {
up_to_2.3.30() {
# Replace any curly brace scalars with the same scalar in single quotes
readarray -t minion_pillars <<< "$(find /opt/so/saltstack/local/pillar/minions -type f -name '*.sls')"
for pillar in "${minion_pillars[@]}"; do
@@ -552,32 +525,7 @@ up_2.3.2X_to_2.3.30() {
INSTALLEDVERSION=2.3.30
}
upgrade_to_2.3.50_repo() {
echo "Performing repo changes."
if [[ "$OS" == "centos" ]]; then
# Import GPG Keys
gpg_rpm_import
echo "Disabling fastestmirror."
disable_fastestmirror
echo "Deleting unneeded repo files."
DELREPOS=('CentOS-Base' 'CentOS-CR' 'CentOS-Debuginfo' 'docker-ce' 'CentOS-fasttrack' 'CentOS-Media' 'CentOS-Sources' 'CentOS-Vault' 'CentOS-x86_64-kernel' 'epel' 'epel-testing' 'saltstack' 'wazuh')
for DELREPO in "${DELREPOS[@]}"; do
if [[ -f "/etc/yum.repos.d/$DELREPO.repo" ]]; then
echo "Deleting $DELREPO.repo"
rm -f "/etc/yum.repos.d/$DELREPO.repo"
fi
done
if [[ $is_airgap -eq 1 ]]; then
# Copy the new repo file if not airgap
cp $UPDATE_DIR/salt/repo/client/files/centos/securityonion.repo /etc/yum.repos.d/
yum clean all
yum repolist
fi
fi
}
up_2.3.3X_to_2.3.50() {
up_to_2.3.50() {
cat <<EOF > /tmp/supersed.txt
/so-zeek:/ {
@@ -609,6 +557,91 @@ EOF
INSTALLEDVERSION=2.3.50
}
up_to_2.3.80() {
# Remove watermark settings from global.sls
sed -i '/ cluster_routing_allocation_disk/d' /opt/so/saltstack/local/pillar/global.sls
# Add new indices to the global
sed -i '/ index_settings:/a \\ so-elasticsearch: \n shards: 1 \n warm: 7 \n close: 30 \n delete: 365' /opt/so/saltstack/local/pillar/global.sls
sed -i '/ index_settings:/a \\ so-logstash: \n shards: 1 \n warm: 7 \n close: 30 \n delete: 365' /opt/so/saltstack/local/pillar/global.sls
sed -i '/ index_settings:/a \\ so-kibana: \n shards: 1 \n warm: 7 \n close: 30 \n delete: 365' /opt/so/saltstack/local/pillar/global.sls
sed -i '/ index_settings:/a \\ so-redis: \n shards: 1 \n warm: 7 \n close: 30 \n delete: 365' /opt/so/saltstack/local/pillar/global.sls
# Do some pillar formatting
tc=$(grep -w true_cluster /opt/so/saltstack/local/pillar/global.sls | awk -F: {'print tolower($2)'}| xargs)
if [[ "$tc" == "true" ]]; then
tcname=$(grep -w true_cluster_name /opt/so/saltstack/local/pillar/global.sls | awk -F: {'print $2'})
sed -i "/^elasticsearch:/a \\ config: \n cluster: \n name: $tcname" /opt/so/saltstack/local/pillar/global.sls
sed -i '/ true_cluster_name/d' /opt/so/saltstack/local/pillar/global.sls
sed -i '/ esclustername/d' /opt/so/saltstack/local/pillar/global.sls
for file in /opt/so/saltstack/local/pillar/minions/*.sls; do
if [[ ${file} != *"manager.sls"* ]]; then
noderoutetype=$(grep -w node_route_type $file | awk -F: {'print $2'})
if [ -n "$noderoutetype" ]; then
sed -i "/^elasticsearch:/a \\ config: \n node: \n attr: \n box_type: $noderoutetype" $file
sed -i '/ node_route_type/d' $file
noderoutetype=''
fi
fi
done
fi
# check for local es config to inform user that the config in local is now ignored and those options need to be placed in the pillar
if [ -f "/opt/so/saltstack/local/salt/elasticsearch/files/elasticsearch.yml" ]; then
NOTIFYCUSTOMELASTICCONFIG=true
fi
INSTALLEDVERSION=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"; 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
fi
done
# Create Endgame Hostgroup
so-firewall addhostgroup endgame
# 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
# remove old common ingest pipeline in default
rm -vf /opt/so/saltstack/default/salt/elasticsearch/files/ingest/common
# if custom common, move from local ingest to local ingest-dynamic
mkdir -vp /opt/so/saltstack/local/salt/elasticsearch/files/ingest-dynamic
if [[ -f "/opt/so/saltstack/local/salt/elasticsearch/files/ingest/common" ]]; then
mv -v /opt/so/saltstack/local/salt/elasticsearch/files/ingest/common /opt/so/saltstack/local/salt/elasticsearch/files/ingest-dynamic/common
# since json file, we need to wrap with raw
sed -i '1s/^/{{'{% raw %}'}}\n/' /opt/so/saltstack/local/salt/elasticsearch/files/ingest-dynamic/common
sed -i -e '$a{{'{% endraw %}'}}\n' /opt/so/saltstack/local/salt/elasticsearch/files/ingest-dynamic/common
fi
# Generate FleetDM Service Account creds if they do not exist
if grep -q "fleet_sa_email" /opt/so/saltstack/local/pillar/secrets.sls; then
echo "FleetDM Service Account credentials already created..."
else
echo "Generating FleetDM Service Account credentials..."
FLEETSAPASS=$(get_random_value)
printf '%s\n'\
" fleet_sa_email: service.account@securityonion.invalid"\
" fleet_sa_password: $FLEETSAPASS"\
>> /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
}
verify_upgradespace() {
CURRENTSPACE=$(df -BG / | grep -v Avail | awk '{print $4}' | sed 's/.$//')
if [ "$CURRENTSPACE" -lt "10" ]; then
@@ -624,7 +657,7 @@ upgrade_space() {
clean_dockers
if ! verify_upgradespace; then
echo "There is not enough space to perform the upgrade. Please free up space and try again"
exit 1
exit 0
fi
else
echo "You have enough space for upgrade. Proceeding with soup."
@@ -649,8 +682,8 @@ thehive_maint() {
done
if [ "$THEHIVE_CONNECTED" == "yes" ]; then
echo "Migrating thehive databases if needed."
curl -v -k -XPOST -L "https://localhost/thehive/api/maintenance/migrate"
curl -v -k -XPOST -L "https://localhost/cortex/api/maintenance/migrate"
curl -v -k -XPOST -L "https://localhost/thehive/api/maintenance/migrate" >> "$SOUP_LOG" 2>&1
curl -v -k -XPOST -L "https://localhost/cortex/api/maintenance/migrate" >> "$SOUP_LOG" 2>&1
fi
}
@@ -750,17 +783,48 @@ upgrade_salt() {
fi
}
upgrade_to_2.3.50_repo() {
echo "Performing repo changes."
if [[ "$OS" == "centos" ]]; then
# Import GPG Keys
gpg_rpm_import
echo "Disabling fastestmirror."
disable_fastestmirror
echo "Deleting unneeded repo files."
DELREPOS=('CentOS-Base' 'CentOS-CR' 'CentOS-Debuginfo' 'docker-ce' 'CentOS-fasttrack' 'CentOS-Media' 'CentOS-Sources' 'CentOS-Vault' 'CentOS-x86_64-kernel' 'epel' 'epel-testing' 'saltstack' 'wazuh')
for DELREPO in "${DELREPOS[@]}"; do
if [[ -f "/etc/yum.repos.d/$DELREPO.repo" ]]; then
echo "Deleting $DELREPO.repo"
rm -f "/etc/yum.repos.d/$DELREPO.repo"
fi
done
if [[ $is_airgap -eq 1 ]]; then
# Copy the new repo file if not airgap
cp $UPDATE_DIR/salt/repo/client/files/centos/securityonion.repo /etc/yum.repos.d/
yum clean all
yum repolist
fi
fi
}
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/
@@ -773,40 +837,43 @@ verify_latest_update_script() {
fi
}
apply_hotfix() {
if [[ "$INSTALLEDVERSION" == "2.3.90" && "$HOTFIXVERSION" == "WAZUH" ]] ; 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 "Skipping ossec.conf check ($INSTALLEDVERSION/$HOTFIXVERSION)"
fi
}
main() {
set -e
set +e
trap 'check_err $?' EXIT
echo "### Preparing soup at $(date) ###"
while getopts ":b" opt; do
case "$opt" in
b ) # process option b
shift
BATCHSIZE=$1
if ! [[ "$BATCHSIZE" =~ ^[0-9]+$ ]]; then
echo "Batch size must be a number greater than 0."
exit 1
fi
;;
\? )
echo "Usage: cmd [-b]"
;;
esac
done
check_pillar_items
echo "Checking to see if this is an airgap install."
echo ""
check_airgap
if [[ $is_airgap -eq 0 && $UNATTENDED == true && -z $ISOLOC ]]; then
echo "Missing file argument (-f <FILENAME>) for unattended airgap upgrade."
exit 0
fi
echo "Checking to see if this is a manager."
echo ""
require_manager
set_minionid
echo "Checking to see if this is an airgap install."
echo ""
check_airgap
echo "Found that Security Onion $INSTALLEDVERSION is currently installed."
echo ""
if [[ $is_airgap -eq 0 ]]; then
# Let's mount the ISO since this is airgap
echo "This is airgap. Ask for a location."
airgap_mounted
else
echo "Cloning Security Onion github repo into $UPDATE_DIR."
@@ -841,9 +908,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
@@ -883,21 +951,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 1
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
@@ -953,8 +1021,6 @@ main() {
set +e
salt-call state.highstate -l info queue=True
set -e
echo ""
echo "Upgrade from $INSTALLEDVERSION to $NEWVERSION complete."
echo ""
echo "Stopping Salt Master to remove ACL"
@@ -977,6 +1043,13 @@ main() {
[[ $is_airgap -eq 0 ]] && unmount_update
thehive_maint
echo ""
echo "Upgrade to $NEWVERSION complete."
# Everything beyond this is post-upgrade checking, don't fail past this point if something here causes an error
set +e
echo "Checking the number of minions."
NUM_MINIONS=$(ls /opt/so/saltstack/local/pillar/minions/*_*.sls | wc -l)
if [[ $UPGRADESALT -eq 1 ]] && [[ $NUM_MINIONS -gt 1 ]]; then
if [[ $is_airgap -eq 0 ]]; then
@@ -987,10 +1060,15 @@ main() {
fi
fi
echo "Checking for local modifications."
check_local_mods
echo "Checking sudoers file."
check_sudoers
echo "Checking for necessary user migrations."
so-user migrate
if [[ -n $lsl_msg ]]; then
case $lsl_msg in
'distributed')
@@ -1026,10 +1104,56 @@ EOF
fi
fi
if [ "$NOTIFYCUSTOMELASTICCONFIG" = true ] ; then
cat << EOF
A custom Elasticsearch configuration has been found at /opt/so/saltstack/local/elasticsearch/files/elasticsearch.yml. This file is no longer referenced in Security Onion versions >= 2.3.80.
If you still need those customizations, you'll need to manually migrate them to the new Elasticsearch config as shown at https://docs.securityonion.net/en/2.3/elasticsearch.html.
EOF
fi
echo "### soup has been served at $(date) ###"
}
cat << EOF
while getopts ":b:f:y" opt; do
case ${opt} in
b )
BATCHSIZE="$OPTARG"
if ! [[ "$BATCHSIZE" =~ ^[1-9][0-9]*$ ]]; then
echo "Batch size must be a number greater than 0."
exit 1
fi
;;
y )
if [[ ! -f /opt/so/state/yeselastic.txt ]]; then
echo "Cannot run soup in unattended mode. You must run soup manually to accept the Elastic License."
exit 1
else
UNATTENDED=true
fi
;;
f )
ISOLOC="$OPTARG"
;;
\? )
echo "Usage: soup [-b] [-y] [-f <iso location>]"
exit 1
;;
: )
echo "Invalid option: $OPTARG requires an argument"
exit 1
;;
esac
done
shift $((OPTIND - 1))
if [[ -z $UNATTENDED ]]; then
cat << EOF
SOUP - Security Onion UPdater
@@ -1041,7 +1165,8 @@ Press Enter to continue or Ctrl-C to cancel.
EOF
read -r input
read -r input
fi
echo "### Preparing soup at $(date) ###"
main "$@" | tee -a $SOUP_LOG

View File

@@ -0,0 +1,29 @@
{%- set cur_close_days = salt['pillar.get']('elasticsearch:index_settings:so-aws:close', 30) -%}
---
# Remember, leave a key empty if there is no value. None will be a string,
# not a Python "NoneType"
#
# Also remember that all examples have 'disable_action' set to True. If you
# want to use this action as a template, be sure to set this to False after
# copying it.
actions:
1:
action: close
description: >-
Close aws indices older than {{cur_close_days}} days.
options:
delete_aliases: False
timeout_override:
continue_if_exception: False
disable_action: False
filters:
- filtertype: pattern
kind: regex
value: '^(logstash-aws.*|so-aws.*)$'
- filtertype: age
source: name
direction: older
timestring: '%Y.%m.%d'
unit: days
unit_count: {{cur_close_days}}
exclude:

View File

@@ -0,0 +1,29 @@
{%- set DELETE_DAYS = salt['pillar.get']('elasticsearch:index_settings:so-aws:delete', 365) -%}
---
# Remember, leave a key empty if there is no value. None will be a string,
# not a Python "NoneType"
#
# Also remember that all examples have 'disable_action' set to True. If you
# want to use this action as a template, be sure to set this to False after
# copying it.
actions:
1:
action: delete_indices
description: >-
Delete aws indices when older than {{ DELETE_DAYS }} days.
options:
ignore_empty_list: True
disable_action: False
filters:
- filtertype: pattern
kind: regex
value: '^(logstash-aws.*|so-aws.*)$'
- filtertype: age
source: name
direction: older
timestring: '%Y.%m.%d'
unit: days
unit_count: {{ DELETE_DAYS }}
exclude:

View File

@@ -0,0 +1,24 @@
{%- set WARM_DAYS = salt['pillar.get']('elasticsearch:index_settings:so-aws:warm', 7) -%}
actions:
1:
action: allocation
description: "Apply shard allocation filtering rules to the specified indices"
options:
key: box_type
value: warm
allocation_type: require
wait_for_completion: true
timeout_override:
continue_if_exception: false
disable_action: false
filters:
- filtertype: pattern
kind: prefix
value: so-aws
- filtertype: age
source: name
direction: older
timestring: '%Y.%m.%d'
unit: days
unit_count: {{ WARM_DAYS }}

View File

@@ -0,0 +1,29 @@
{%- set cur_close_days = salt['pillar.get']('elasticsearch:index_settings:so-azure:close', 30) -%}
---
# Remember, leave a key empty if there is no value. None will be a string,
# not a Python "NoneType"
#
# Also remember that all examples have 'disable_action' set to True. If you
# want to use this action as a template, be sure to set this to False after
# copying it.
actions:
1:
action: close
description: >-
Close azure indices older than {{cur_close_days}} days.
options:
delete_aliases: False
timeout_override:
continue_if_exception: False
disable_action: False
filters:
- filtertype: pattern
kind: regex
value: '^(logstash-azure.*|so-azure.*)$'
- filtertype: age
source: name
direction: older
timestring: '%Y.%m.%d'
unit: days
unit_count: {{cur_close_days}}
exclude:

View File

@@ -0,0 +1,29 @@
{%- set DELETE_DAYS = salt['pillar.get']('elasticsearch:index_settings:so-azure:delete', 365) -%}
---
# Remember, leave a key empty if there is no value. None will be a string,
# not a Python "NoneType"
#
# Also remember that all examples have 'disable_action' set to True. If you
# want to use this action as a template, be sure to set this to False after
# copying it.
actions:
1:
action: delete_indices
description: >-
Delete azure indices when older than {{ DELETE_DAYS }} days.
options:
ignore_empty_list: True
disable_action: False
filters:
- filtertype: pattern
kind: regex
value: '^(logstash-azure.*|so-azure.*)$'
- filtertype: age
source: name
direction: older
timestring: '%Y.%m.%d'
unit: days
unit_count: {{ DELETE_DAYS }}
exclude:

View File

@@ -0,0 +1,24 @@
{%- set WARM_DAYS = salt['pillar.get']('elasticsearch:index_settings:so-azure:warm', 7) -%}
actions:
1:
action: allocation
description: "Apply shard allocation filtering rules to the specified indices"
options:
key: box_type
value: warm
allocation_type: require
wait_for_completion: true
timeout_override:
continue_if_exception: false
disable_action: false
filters:
- filtertype: pattern
kind: prefix
value: so-azure
- filtertype: age
source: name
direction: older
timestring: '%Y.%m.%d'
unit: days
unit_count: {{ WARM_DAYS }}

View File

@@ -0,0 +1,29 @@
{%- set cur_close_days = salt['pillar.get']('elasticsearch:index_settings:so-barracuda:close', 30) -%}
---
# Remember, leave a key empty if there is no value. None will be a string,
# not a Python "NoneType"
#
# Also remember that all examples have 'disable_action' set to True. If you
# want to use this action as a template, be sure to set this to False after
# copying it.
actions:
1:
action: close
description: >-
Close barracuda indices older than {{cur_close_days}} days.
options:
delete_aliases: False
timeout_override:
continue_if_exception: False
disable_action: False
filters:
- filtertype: pattern
kind: regex
value: '^(logstash-barracuda.*|so-barracuda.*)$'
- filtertype: age
source: name
direction: older
timestring: '%Y.%m.%d'
unit: days
unit_count: {{cur_close_days}}
exclude:

View File

@@ -0,0 +1,29 @@
{%- set DELETE_DAYS = salt['pillar.get']('elasticsearch:index_settings:so-barracuda:delete', 365) -%}
---
# Remember, leave a key empty if there is no value. None will be a string,
# not a Python "NoneType"
#
# Also remember that all examples have 'disable_action' set to True. If you
# want to use this action as a template, be sure to set this to False after
# copying it.
actions:
1:
action: delete_indices
description: >-
Delete barracuda indices when older than {{ DELETE_DAYS }} days.
options:
ignore_empty_list: True
disable_action: False
filters:
- filtertype: pattern
kind: regex
value: '^(logstash-barracuda.*|so-barracuda.*)$'
- filtertype: age
source: name
direction: older
timestring: '%Y.%m.%d'
unit: days
unit_count: {{ DELETE_DAYS }}
exclude:

View File

@@ -0,0 +1,24 @@
{%- set WARM_DAYS = salt['pillar.get']('elasticsearch:index_settings:so-barracuda:warm', 7) -%}
actions:
1:
action: allocation
description: "Apply shard allocation filtering rules to the specified indices"
options:
key: box_type
value: warm
allocation_type: require
wait_for_completion: true
timeout_override:
continue_if_exception: false
disable_action: false
filters:
- filtertype: pattern
kind: prefix
value: so-barracuda
- filtertype: age
source: name
direction: older
timestring: '%Y.%m.%d'
unit: days
unit_count: {{ WARM_DAYS }}

View File

@@ -0,0 +1,29 @@
{%- set DELETE_DAYS = salt['pillar.get']('elasticsearch:index_settings:so-beats:delete', 365) -%}
---
# Remember, leave a key empty if there is no value. None will be a string,
# not a Python "NoneType"
#
# Also remember that all examples have 'disable_action' set to True. If you
# want to use this action as a template, be sure to set this to False after
# copying it.
actions:
1:
action: delete_indices
description: >-
Delete beats indices when older than {{ DELETE_DAYS }} days.
options:
ignore_empty_list: True
disable_action: False
filters:
- filtertype: pattern
kind: regex
value: '^(logstash-beats.*|so-beats.*)$'
- filtertype: age
source: name
direction: older
timestring: '%Y.%m.%d'
unit: days
unit_count: {{ DELETE_DAYS }}
exclude:

View File

@@ -0,0 +1,24 @@
{%- set WARM_DAYS = salt['pillar.get']('elasticsearch:index_settings:so-beats:warm', 7) -%}
actions:
1:
action: allocation
description: "Apply shard allocation filtering rules to the specified indices"
options:
key: box_type
value: warm
allocation_type: require
wait_for_completion: true
timeout_override:
continue_if_exception: false
disable_action: false
filters:
- filtertype: pattern
kind: prefix
value: so-beats
- filtertype: age
source: name
direction: older
timestring: '%Y.%m.%d'
unit: days
unit_count: {{ WARM_DAYS }}

View File

@@ -0,0 +1,29 @@
{%- set cur_close_days = salt['pillar.get']('elasticsearch:index_settings:so-bluecoat:close', 30) -%}
---
# Remember, leave a key empty if there is no value. None will be a string,
# not a Python "NoneType"
#
# Also remember that all examples have 'disable_action' set to True. If you
# want to use this action as a template, be sure to set this to False after
# copying it.
actions:
1:
action: close
description: >-
Close bluecoat indices older than {{cur_close_days}} days.
options:
delete_aliases: False
timeout_override:
continue_if_exception: False
disable_action: False
filters:
- filtertype: pattern
kind: regex
value: '^(logstash-bluecoat.*|so-bluecoat.*)$'
- filtertype: age
source: name
direction: older
timestring: '%Y.%m.%d'
unit: days
unit_count: {{cur_close_days}}
exclude:

View File

@@ -0,0 +1,29 @@
{%- set DELETE_DAYS = salt['pillar.get']('elasticsearch:index_settings:so-bluecoat:delete', 365) -%}
---
# Remember, leave a key empty if there is no value. None will be a string,
# not a Python "NoneType"
#
# Also remember that all examples have 'disable_action' set to True. If you
# want to use this action as a template, be sure to set this to False after
# copying it.
actions:
1:
action: delete_indices
description: >-
Delete bluecoat indices when older than {{ DELETE_DAYS }} days.
options:
ignore_empty_list: True
disable_action: False
filters:
- filtertype: pattern
kind: regex
value: '^(logstash-bluecoat.*|so-bluecoat.*)$'
- filtertype: age
source: name
direction: older
timestring: '%Y.%m.%d'
unit: days
unit_count: {{ DELETE_DAYS }}
exclude:

View File

@@ -0,0 +1,24 @@
{%- set WARM_DAYS = salt['pillar.get']('elasticsearch:index_settings:so-bluecoat:warm', 7) -%}
actions:
1:
action: allocation
description: "Apply shard allocation filtering rules to the specified indices"
options:
key: box_type
value: warm
allocation_type: require
wait_for_completion: true
timeout_override:
continue_if_exception: false
disable_action: false
filters:
- filtertype: pattern
kind: prefix
value: so-bluecoat
- filtertype: age
source: name
direction: older
timestring: '%Y.%m.%d'
unit: days
unit_count: {{ WARM_DAYS }}

View File

@@ -0,0 +1,29 @@
{%- set cur_close_days = salt['pillar.get']('elasticsearch:index_settings:so-cef:close', 30) -%}
---
# Remember, leave a key empty if there is no value. None will be a string,
# not a Python "NoneType"
#
# Also remember that all examples have 'disable_action' set to True. If you
# want to use this action as a template, be sure to set this to False after
# copying it.
actions:
1:
action: close
description: >-
Close cef indices older than {{cur_close_days}} days.
options:
delete_aliases: False
timeout_override:
continue_if_exception: False
disable_action: False
filters:
- filtertype: pattern
kind: regex
value: '^(logstash-cef.*|so-cef.*)$'
- filtertype: age
source: name
direction: older
timestring: '%Y.%m.%d'
unit: days
unit_count: {{cur_close_days}}
exclude:

View File

@@ -0,0 +1,29 @@
{%- set DELETE_DAYS = salt['pillar.get']('elasticsearch:index_settings:so-cef:delete', 365) -%}
---
# Remember, leave a key empty if there is no value. None will be a string,
# not a Python "NoneType"
#
# Also remember that all examples have 'disable_action' set to True. If you
# want to use this action as a template, be sure to set this to False after
# copying it.
actions:
1:
action: delete_indices
description: >-
Delete cef indices when older than {{ DELETE_DAYS }} days.
options:
ignore_empty_list: True
disable_action: False
filters:
- filtertype: pattern
kind: regex
value: '^(logstash-cef.*|so-cef.*)$'
- filtertype: age
source: name
direction: older
timestring: '%Y.%m.%d'
unit: days
unit_count: {{ DELETE_DAYS }}
exclude:

View File

@@ -0,0 +1,24 @@
{%- set WARM_DAYS = salt['pillar.get']('elasticsearch:index_settings:so-cef:warm', 7) -%}
actions:
1:
action: allocation
description: "Apply shard allocation filtering rules to the specified indices"
options:
key: box_type
value: warm
allocation_type: require
wait_for_completion: true
timeout_override:
continue_if_exception: false
disable_action: false
filters:
- filtertype: pattern
kind: prefix
value: so-cef
- filtertype: age
source: name
direction: older
timestring: '%Y.%m.%d'
unit: days
unit_count: {{ WARM_DAYS }}

View File

@@ -0,0 +1,29 @@
{%- set cur_close_days = salt['pillar.get']('elasticsearch:index_settings:so-checkpoint:close', 30) -%}
---
# Remember, leave a key empty if there is no value. None will be a string,
# not a Python "NoneType"
#
# Also remember that all examples have 'disable_action' set to True. If you
# want to use this action as a template, be sure to set this to False after
# copying it.
actions:
1:
action: close
description: >-
Close checkpoint indices older than {{cur_close_days}} days.
options:
delete_aliases: False
timeout_override:
continue_if_exception: False
disable_action: False
filters:
- filtertype: pattern
kind: regex
value: '^(logstash-checkpoint.*|so-checkpoint.*)$'
- filtertype: age
source: name
direction: older
timestring: '%Y.%m.%d'
unit: days
unit_count: {{cur_close_days}}
exclude:

View File

@@ -0,0 +1,29 @@
{%- set DELETE_DAYS = salt['pillar.get']('elasticsearch:index_settings:so-checkpoint:delete', 365) -%}
---
# Remember, leave a key empty if there is no value. None will be a string,
# not a Python "NoneType"
#
# Also remember that all examples have 'disable_action' set to True. If you
# want to use this action as a template, be sure to set this to False after
# copying it.
actions:
1:
action: delete_indices
description: >-
Delete checkpoint indices when older than {{ DELETE_DAYS }} days.
options:
ignore_empty_list: True
disable_action: False
filters:
- filtertype: pattern
kind: regex
value: '^(logstash-checkpoint.*|so-checkpoint.*)$'
- filtertype: age
source: name
direction: older
timestring: '%Y.%m.%d'
unit: days
unit_count: {{ DELETE_DAYS }}
exclude:

View File

@@ -0,0 +1,24 @@
{%- set WARM_DAYS = salt['pillar.get']('elasticsearch:index_settings:so-checkpoint:warm', 7) -%}
actions:
1:
action: allocation
description: "Apply shard allocation filtering rules to the specified indices"
options:
key: box_type
value: warm
allocation_type: require
wait_for_completion: true
timeout_override:
continue_if_exception: false
disable_action: false
filters:
- filtertype: pattern
kind: prefix
value: so-checkpoint
- filtertype: age
source: name
direction: older
timestring: '%Y.%m.%d'
unit: days
unit_count: {{ WARM_DAYS }}

View File

@@ -0,0 +1,29 @@
{%- set cur_close_days = salt['pillar.get']('elasticsearch:index_settings:so-cisco:close', 30) -%}
---
# Remember, leave a key empty if there is no value. None will be a string,
# not a Python "NoneType"
#
# Also remember that all examples have 'disable_action' set to True. If you
# want to use this action as a template, be sure to set this to False after
# copying it.
actions:
1:
action: close
description: >-
Close cisco indices older than {{cur_close_days}} days.
options:
delete_aliases: False
timeout_override:
continue_if_exception: False
disable_action: False
filters:
- filtertype: pattern
kind: regex
value: '^(logstash-cisco.*|so-cisco.*)$'
- filtertype: age
source: name
direction: older
timestring: '%Y.%m.%d'
unit: days
unit_count: {{cur_close_days}}
exclude:

View File

@@ -0,0 +1,29 @@
{%- set DELETE_DAYS = salt['pillar.get']('elasticsearch:index_settings:so-cisco:delete', 365) -%}
---
# Remember, leave a key empty if there is no value. None will be a string,
# not a Python "NoneType"
#
# Also remember that all examples have 'disable_action' set to True. If you
# want to use this action as a template, be sure to set this to False after
# copying it.
actions:
1:
action: delete_indices
description: >-
Delete cisco indices when older than {{ DELETE_DAYS }} days.
options:
ignore_empty_list: True
disable_action: False
filters:
- filtertype: pattern
kind: regex
value: '^(logstash-cisco.*|so-cisco.*)$'
- filtertype: age
source: name
direction: older
timestring: '%Y.%m.%d'
unit: days
unit_count: {{ DELETE_DAYS }}
exclude:

View File

@@ -0,0 +1,24 @@
{%- set WARM_DAYS = salt['pillar.get']('elasticsearch:index_settings:so-cisco:warm', 7) -%}
actions:
1:
action: allocation
description: "Apply shard allocation filtering rules to the specified indices"
options:
key: box_type
value: warm
allocation_type: require
wait_for_completion: true
timeout_override:
continue_if_exception: false
disable_action: false
filters:
- filtertype: pattern
kind: prefix
value: so-cisco
- filtertype: age
source: name
direction: older
timestring: '%Y.%m.%d'
unit: days
unit_count: {{ WARM_DAYS }}

View File

@@ -0,0 +1,29 @@
{%- set cur_close_days = salt['pillar.get']('elasticsearch:index_settings:so-cyberark:close', 30) -%}
---
# Remember, leave a key empty if there is no value. None will be a string,
# not a Python "NoneType"
#
# Also remember that all examples have 'disable_action' set to True. If you
# want to use this action as a template, be sure to set this to False after
# copying it.
actions:
1:
action: close
description: >-
Close cyberark indices older than {{cur_close_days}} days.
options:
delete_aliases: False
timeout_override:
continue_if_exception: False
disable_action: False
filters:
- filtertype: pattern
kind: regex
value: '^(logstash-cyberark.*|so-cyberark.*)$'
- filtertype: age
source: name
direction: older
timestring: '%Y.%m.%d'
unit: days
unit_count: {{cur_close_days}}
exclude:

View File

@@ -0,0 +1,29 @@
{%- set DELETE_DAYS = salt['pillar.get']('elasticsearch:index_settings:so-cyberark:delete', 365) -%}
---
# Remember, leave a key empty if there is no value. None will be a string,
# not a Python "NoneType"
#
# Also remember that all examples have 'disable_action' set to True. If you
# want to use this action as a template, be sure to set this to False after
# copying it.
actions:
1:
action: delete_indices
description: >-
Delete cyberark indices when older than {{ DELETE_DAYS }} days.
options:
ignore_empty_list: True
disable_action: False
filters:
- filtertype: pattern
kind: regex
value: '^(logstash-cyberark.*|so-cyberark.*)$'
- filtertype: age
source: name
direction: older
timestring: '%Y.%m.%d'
unit: days
unit_count: {{ DELETE_DAYS }}
exclude:

View File

@@ -0,0 +1,24 @@
{%- set WARM_DAYS = salt['pillar.get']('elasticsearch:index_settings:so-cyberark:warm', 7) -%}
actions:
1:
action: allocation
description: "Apply shard allocation filtering rules to the specified indices"
options:
key: box_type
value: warm
allocation_type: require
wait_for_completion: true
timeout_override:
continue_if_exception: false
disable_action: false
filters:
- filtertype: pattern
kind: prefix
value: so-cyberark
- filtertype: age
source: name
direction: older
timestring: '%Y.%m.%d'
unit: days
unit_count: {{ WARM_DAYS }}

View File

@@ -0,0 +1,29 @@
{%- set cur_close_days = salt['pillar.get']('elasticsearch:index_settings:so-cylance:close', 30) -%}
---
# Remember, leave a key empty if there is no value. None will be a string,
# not a Python "NoneType"
#
# Also remember that all examples have 'disable_action' set to True. If you
# want to use this action as a template, be sure to set this to False after
# copying it.
actions:
1:
action: close
description: >-
Close cylance indices older than {{cur_close_days}} days.
options:
delete_aliases: False
timeout_override:
continue_if_exception: False
disable_action: False
filters:
- filtertype: pattern
kind: regex
value: '^(logstash-cylance.*|so-cylance.*)$'
- filtertype: age
source: name
direction: older
timestring: '%Y.%m.%d'
unit: days
unit_count: {{cur_close_days}}
exclude:

View File

@@ -0,0 +1,29 @@
{%- set DELETE_DAYS = salt['pillar.get']('elasticsearch:index_settings:so-cylance:delete', 365) -%}
---
# Remember, leave a key empty if there is no value. None will be a string,
# not a Python "NoneType"
#
# Also remember that all examples have 'disable_action' set to True. If you
# want to use this action as a template, be sure to set this to False after
# copying it.
actions:
1:
action: delete_indices
description: >-
Delete cylance indices when older than {{ DELETE_DAYS }} days.
options:
ignore_empty_list: True
disable_action: False
filters:
- filtertype: pattern
kind: regex
value: '^(logstash-cylance.*|so-cylance.*)$'
- filtertype: age
source: name
direction: older
timestring: '%Y.%m.%d'
unit: days
unit_count: {{ DELETE_DAYS }}
exclude:

View File

@@ -0,0 +1,24 @@
{%- set WARM_DAYS = salt['pillar.get']('elasticsearch:index_settings:so-cylance:warm', 7) -%}
actions:
1:
action: allocation
description: "Apply shard allocation filtering rules to the specified indices"
options:
key: box_type
value: warm
allocation_type: require
wait_for_completion: true
timeout_override:
continue_if_exception: false
disable_action: false
filters:
- filtertype: pattern
kind: prefix
value: so-cylance
- filtertype: age
source: name
direction: older
timestring: '%Y.%m.%d'
unit: days
unit_count: {{ WARM_DAYS }}

View File

@@ -0,0 +1,29 @@
{%- set cur_close_days = salt['pillar.get']('elasticsearch:index_settings:so-elasticsearch:close', 30) -%}
---
# Remember, leave a key empty if there is no value. None will be a string,
# not a Python "NoneType"
#
# Also remember that all examples have 'disable_action' set to True. If you
# want to use this action as a template, be sure to set this to False after
# copying it.
actions:
1:
action: close
description: >-
Close elasticsearch indices older than {{cur_close_days}} days.
options:
delete_aliases: False
timeout_override:
continue_if_exception: False
disable_action: False
filters:
- filtertype: pattern
kind: regex
value: '^(logstash-elasticsearch.*|so-elasticsearch.*)$'
- filtertype: age
source: name
direction: older
timestring: '%Y.%m.%d'
unit: days
unit_count: {{cur_close_days}}
exclude:

View File

@@ -0,0 +1,29 @@
{%- set DELETE_DAYS = salt['pillar.get']('elasticsearch:index_settings:so-elasticsearch:delete', 365) -%}
---
# Remember, leave a key empty if there is no value. None will be a string,
# not a Python "NoneType"
#
# Also remember that all examples have 'disable_action' set to True. If you
# want to use this action as a template, be sure to set this to False after
# copying it.
actions:
1:
action: delete_indices
description: >-
Delete elasticsearch indices when older than {{ DELETE_DAYS }} days.
options:
ignore_empty_list: True
disable_action: False
filters:
- filtertype: pattern
kind: regex
value: '^(logstash-elasticsearch.*|so-elasticsearch.*)$'
- filtertype: age
source: name
direction: older
timestring: '%Y.%m.%d'
unit: days
unit_count: {{ DELETE_DAYS }}
exclude:

View File

@@ -0,0 +1,24 @@
{%- set WARM_DAYS = salt['pillar.get']('elasticsearch:index_settings:so-elasticsearch:warm', 7) -%}
actions:
1:
action: allocation
description: "Apply shard allocation filtering rules to the specified indices"
options:
key: box_type
value: warm
allocation_type: require
wait_for_completion: true
timeout_override:
continue_if_exception: false
disable_action: false
filters:
- filtertype: pattern
kind: prefix
value: so-elasticsearch
- filtertype: age
source: name
direction: older
timestring: '%Y.%m.%d'
unit: days
unit_count: {{ WARM_DAYS }}

View File

@@ -0,0 +1,29 @@
{%- set cur_close_days = salt['pillar.get']('elasticsearch:index_settings:so-endgame:close', 30) -%}
---
# Remember, leave a key empty if there is no value. None will be a string,
# not a Python "NoneType"
#
# Also remember that all examples have 'disable_action' set to True. If you
# want to use this action as a template, be sure to set this to False after
# copying it.
actions:
1:
action: close
description: >-
Close Endgame indices older than {{cur_close_days}} days.
options:
delete_aliases: False
timeout_override:
continue_if_exception: False
disable_action: False
filters:
- filtertype: pattern
kind: regex
value: '^(logstash-endgame.*|so-endgame.*|endgame.*)$'
- filtertype: age
source: name
direction: older
timestring: '%Y.%m.%d'
unit: days
unit_count: {{cur_close_days}}
exclude:

View File

@@ -0,0 +1,27 @@
{%- set DELETE_DAYS = salt['pillar.get']('elasticsearch:index_settings:so-endgame:delete', 365) -%}
---
# Remember, leave a key empty if there is no value. None will be a string,
# not a Python "NoneType"
#
# Also remember that all examples have 'disable_action' set to True. If you
# want to use this action as a template, be sure to set this to False after
# copying it.
actions:
1:
action: delete_indices
description: >-
Delete Endgame indices when older than {{ DELETE_DAYS }} days.
options:
ignore_empty_list: True
disable_action: False
filters:
- filtertype: pattern
kind: regex
value: '^(logstash-endgame.*|so-endgame.*|endgame.*)$'
- filtertype: age
source: name
direction: older
timestring: '%Y.%m.%d'
unit: days
unit_count: {{ DELETE_DAYS }}
exclude:

View File

@@ -0,0 +1,23 @@
{%- set WARM_DAYS = salt['pillar.get']('elasticsearch:index_settings:so-endgame:warm', 7) -%}
actions:
1:
action: allocation
description: "Apply shard allocation filtering rules to the specified indices"
options:
key: box_type
value: warm
allocation_type: require
wait_for_completion: true
timeout_override:
continue_if_exception: false
disable_action: false
filters:
- filtertype: pattern
kind: regex
value: '^(logstash-endgame.*|so-endgame.*|endgame.*)$'
- filtertype: age
source: name
direction: older
timestring: '%Y.%m.%d'
unit: days
unit_count: {{ WARM_DAYS }}

View File

@@ -0,0 +1,29 @@
{%- set cur_close_days = salt['pillar.get']('elasticsearch:index_settings:so-f5:close', 30) -%}
---
# Remember, leave a key empty if there is no value. None will be a string,
# not a Python "NoneType"
#
# Also remember that all examples have 'disable_action' set to True. If you
# want to use this action as a template, be sure to set this to False after
# copying it.
actions:
1:
action: close
description: >-
Close f5 indices older than {{cur_close_days}} days.
options:
delete_aliases: False
timeout_override:
continue_if_exception: False
disable_action: False
filters:
- filtertype: pattern
kind: regex
value: '^(logstash-f5.*|so-f5.*)$'
- filtertype: age
source: name
direction: older
timestring: '%Y.%m.%d'
unit: days
unit_count: {{cur_close_days}}
exclude:

View File

@@ -0,0 +1,29 @@
{%- set DELETE_DAYS = salt['pillar.get']('elasticsearch:index_settings:so-f5:delete', 365) -%}
---
# Remember, leave a key empty if there is no value. None will be a string,
# not a Python "NoneType"
#
# Also remember that all examples have 'disable_action' set to True. If you
# want to use this action as a template, be sure to set this to False after
# copying it.
actions:
1:
action: delete_indices
description: >-
Delete f5 indices when older than {{ DELETE_DAYS }} days.
options:
ignore_empty_list: True
disable_action: False
filters:
- filtertype: pattern
kind: regex
value: '^(logstash-f5.*|so-f5.*)$'
- filtertype: age
source: name
direction: older
timestring: '%Y.%m.%d'
unit: days
unit_count: {{ DELETE_DAYS }}
exclude:

View File

@@ -0,0 +1,24 @@
{%- set WARM_DAYS = salt['pillar.get']('elasticsearch:index_settings:so-f5:warm', 7) -%}
actions:
1:
action: allocation
description: "Apply shard allocation filtering rules to the specified indices"
options:
key: box_type
value: warm
allocation_type: require
wait_for_completion: true
timeout_override:
continue_if_exception: false
disable_action: false
filters:
- filtertype: pattern
kind: prefix
value: so-f5
- filtertype: age
source: name
direction: older
timestring: '%Y.%m.%d'
unit: days
unit_count: {{ WARM_DAYS }}

View File

@@ -0,0 +1,29 @@
{%- set DELETE_DAYS = salt['pillar.get']('elasticsearch:index_settings:so-firewall:delete', 365) -%}
---
# Remember, leave a key empty if there is no value. None will be a string,
# not a Python "NoneType"
#
# Also remember that all examples have 'disable_action' set to True. If you
# want to use this action as a template, be sure to set this to False after
# copying it.
actions:
1:
action: delete_indices
description: >-
Delete firewall indices when older than {{ DELETE_DAYS }} days.
options:
ignore_empty_list: True
disable_action: False
filters:
- filtertype: pattern
kind: regex
value: '^(logstash-firewall.*|so-firewall.*)$'
- filtertype: age
source: name
direction: older
timestring: '%Y.%m.%d'
unit: days
unit_count: {{ DELETE_DAYS }}
exclude:

View File

@@ -0,0 +1,24 @@
{%- set WARM_DAYS = salt['pillar.get']('elasticsearch:index_settings:so-firewall:warm', 7) -%}
actions:
1:
action: allocation
description: "Apply shard allocation filtering rules to the specified indices"
options:
key: box_type
value: warm
allocation_type: require
wait_for_completion: true
timeout_override:
continue_if_exception: false
disable_action: false
filters:
- filtertype: pattern
kind: prefix
value: so-firewall
- filtertype: age
source: name
direction: older
timestring: '%Y.%m.%d'
unit: days
unit_count: {{ WARM_DAYS }}

View File

@@ -0,0 +1,29 @@
{%- set cur_close_days = salt['pillar.get']('elasticsearch:index_settings:so-fortinet:close', 30) -%}
---
# Remember, leave a key empty if there is no value. None will be a string,
# not a Python "NoneType"
#
# Also remember that all examples have 'disable_action' set to True. If you
# want to use this action as a template, be sure to set this to False after
# copying it.
actions:
1:
action: close
description: >-
Close fortinet indices older than {{cur_close_days}} days.
options:
delete_aliases: False
timeout_override:
continue_if_exception: False
disable_action: False
filters:
- filtertype: pattern
kind: regex
value: '^(logstash-fortinet.*|so-fortinet.*)$'
- filtertype: age
source: name
direction: older
timestring: '%Y.%m.%d'
unit: days
unit_count: {{cur_close_days}}
exclude:

View File

@@ -0,0 +1,29 @@
{%- set DELETE_DAYS = salt['pillar.get']('elasticsearch:index_settings:so-fortinet:delete', 365) -%}
---
# Remember, leave a key empty if there is no value. None will be a string,
# not a Python "NoneType"
#
# Also remember that all examples have 'disable_action' set to True. If you
# want to use this action as a template, be sure to set this to False after
# copying it.
actions:
1:
action: delete_indices
description: >-
Delete fortinet indices when older than {{ DELETE_DAYS }} days.
options:
ignore_empty_list: True
disable_action: False
filters:
- filtertype: pattern
kind: regex
value: '^(logstash-fortinet.*|so-fortinet.*)$'
- filtertype: age
source: name
direction: older
timestring: '%Y.%m.%d'
unit: days
unit_count: {{ DELETE_DAYS }}
exclude:

View File

@@ -0,0 +1,24 @@
{%- set WARM_DAYS = salt['pillar.get']('elasticsearch:index_settings:so-fortinet:warm', 7) -%}
actions:
1:
action: allocation
description: "Apply shard allocation filtering rules to the specified indices"
options:
key: box_type
value: warm
allocation_type: require
wait_for_completion: true
timeout_override:
continue_if_exception: false
disable_action: false
filters:
- filtertype: pattern
kind: prefix
value: so-fortinet
- filtertype: age
source: name
direction: older
timestring: '%Y.%m.%d'
unit: days
unit_count: {{ WARM_DAYS }}

View File

@@ -0,0 +1,29 @@
{%- set cur_close_days = salt['pillar.get']('elasticsearch:index_settings:so-gcp:close', 30) -%}
---
# Remember, leave a key empty if there is no value. None will be a string,
# not a Python "NoneType"
#
# Also remember that all examples have 'disable_action' set to True. If you
# want to use this action as a template, be sure to set this to False after
# copying it.
actions:
1:
action: close
description: >-
Close gcp indices older than {{cur_close_days}} days.
options:
delete_aliases: False
timeout_override:
continue_if_exception: False
disable_action: False
filters:
- filtertype: pattern
kind: regex
value: '^(logstash-gcp.*|so-gcp.*)$'
- filtertype: age
source: name
direction: older
timestring: '%Y.%m.%d'
unit: days
unit_count: {{cur_close_days}}
exclude:

View File

@@ -0,0 +1,29 @@
{%- set DELETE_DAYS = salt['pillar.get']('elasticsearch:index_settings:so-gcp:delete', 365) -%}
---
# Remember, leave a key empty if there is no value. None will be a string,
# not a Python "NoneType"
#
# Also remember that all examples have 'disable_action' set to True. If you
# want to use this action as a template, be sure to set this to False after
# copying it.
actions:
1:
action: delete_indices
description: >-
Delete gcp indices when older than {{ DELETE_DAYS }} days.
options:
ignore_empty_list: True
disable_action: False
filters:
- filtertype: pattern
kind: regex
value: '^(logstash-gcp.*|so-gcp.*)$'
- filtertype: age
source: name
direction: older
timestring: '%Y.%m.%d'
unit: days
unit_count: {{ DELETE_DAYS }}
exclude:

View File

@@ -0,0 +1,24 @@
{%- set WARM_DAYS = salt['pillar.get']('elasticsearch:index_settings:so-gcp:warm', 7) -%}
actions:
1:
action: allocation
description: "Apply shard allocation filtering rules to the specified indices"
options:
key: box_type
value: warm
allocation_type: require
wait_for_completion: true
timeout_override:
continue_if_exception: false
disable_action: false
filters:
- filtertype: pattern
kind: prefix
value: so-gcp
- filtertype: age
source: name
direction: older
timestring: '%Y.%m.%d'
unit: days
unit_count: {{ WARM_DAYS }}

View File

@@ -0,0 +1,29 @@
{%- set cur_close_days = salt['pillar.get']('elasticsearch:index_settings:so-google_workspace:close', 30) -%}
---
# Remember, leave a key empty if there is no value. None will be a string,
# not a Python "NoneType"
#
# Also remember that all examples have 'disable_action' set to True. If you
# want to use this action as a template, be sure to set this to False after
# copying it.
actions:
1:
action: close
description: >-
Close google_workspace indices older than {{cur_close_days}} days.
options:
delete_aliases: False
timeout_override:
continue_if_exception: False
disable_action: False
filters:
- filtertype: pattern
kind: regex
value: '^(logstash-google_workspace.*|so-google_workspace.*)$'
- filtertype: age
source: name
direction: older
timestring: '%Y.%m.%d'
unit: days
unit_count: {{cur_close_days}}
exclude:

View File

@@ -0,0 +1,29 @@
{%- set DELETE_DAYS = salt['pillar.get']('elasticsearch:index_settings:so-google_workspace:delete', 365) -%}
---
# Remember, leave a key empty if there is no value. None will be a string,
# not a Python "NoneType"
#
# Also remember that all examples have 'disable_action' set to True. If you
# want to use this action as a template, be sure to set this to False after
# copying it.
actions:
1:
action: delete_indices
description: >-
Delete google_workspace indices when older than {{ DELETE_DAYS }} days.
options:
ignore_empty_list: True
disable_action: False
filters:
- filtertype: pattern
kind: regex
value: '^(logstash-google_workspace.*|so-google_workspace.*)$'
- filtertype: age
source: name
direction: older
timestring: '%Y.%m.%d'
unit: days
unit_count: {{ DELETE_DAYS }}
exclude:

View File

@@ -0,0 +1,24 @@
{%- set WARM_DAYS = salt['pillar.get']('elasticsearch:index_settings:so-google_workspace:warm', 7) -%}
actions:
1:
action: allocation
description: "Apply shard allocation filtering rules to the specified indices"
options:
key: box_type
value: warm
allocation_type: require
wait_for_completion: true
timeout_override:
continue_if_exception: false
disable_action: false
filters:
- filtertype: pattern
kind: prefix
value: so-google_workspace
- filtertype: age
source: name
direction: older
timestring: '%Y.%m.%d'
unit: days
unit_count: {{ WARM_DAYS }}

View File

@@ -0,0 +1,29 @@
{%- set DELETE_DAYS = salt['pillar.get']('elasticsearch:index_settings:so-ids:delete', 365) -%}
---
# Remember, leave a key empty if there is no value. None will be a string,
# not a Python "NoneType"
#
# Also remember that all examples have 'disable_action' set to True. If you
# want to use this action as a template, be sure to set this to False after
# copying it.
actions:
1:
action: delete_indices
description: >-
Delete IDS indices when older than {{ DELETE_DAYS }} days.
options:
ignore_empty_list: True
disable_action: False
filters:
- filtertype: pattern
kind: regex
value: '^(logstash-ids.*|so-ids.*)$'
- filtertype: age
source: name
direction: older
timestring: '%Y.%m.%d'
unit: days
unit_count: {{ DELETE_DAYS }}
exclude:

View File

@@ -0,0 +1,24 @@
{%- set WARM_DAYS = salt['pillar.get']('elasticsearch:index_settings:so-ids:warm', 7) -%}
actions:
1:
action: allocation
description: "Apply shard allocation filtering rules to the specified indices"
options:
key: box_type
value: warm
allocation_type: require
wait_for_completion: true
timeout_override:
continue_if_exception: false
disable_action: false
filters:
- filtertype: pattern
kind: prefix
value: so-ids
- filtertype: age
source: name
direction: older
timestring: '%Y.%m.%d'
unit: days
unit_count: {{ WARM_DAYS }}

View File

@@ -0,0 +1,29 @@
{%- set cur_close_days = salt['pillar.get']('elasticsearch:index_settings:so-imperva:close', 30) -%}
---
# Remember, leave a key empty if there is no value. None will be a string,
# not a Python "NoneType"
#
# Also remember that all examples have 'disable_action' set to True. If you
# want to use this action as a template, be sure to set this to False after
# copying it.
actions:
1:
action: close
description: >-
Close imperva indices older than {{cur_close_days}} days.
options:
delete_aliases: False
timeout_override:
continue_if_exception: False
disable_action: False
filters:
- filtertype: pattern
kind: regex
value: '^(logstash-imperva.*|so-imperva.*)$'
- filtertype: age
source: name
direction: older
timestring: '%Y.%m.%d'
unit: days
unit_count: {{cur_close_days}}
exclude:

View File

@@ -0,0 +1,29 @@
{%- set DELETE_DAYS = salt['pillar.get']('elasticsearch:index_settings:so-imperva:delete', 365) -%}
---
# Remember, leave a key empty if there is no value. None will be a string,
# not a Python "NoneType"
#
# Also remember that all examples have 'disable_action' set to True. If you
# want to use this action as a template, be sure to set this to False after
# copying it.
actions:
1:
action: delete_indices
description: >-
Delete imperva indices when older than {{ DELETE_DAYS }} days.
options:
ignore_empty_list: True
disable_action: False
filters:
- filtertype: pattern
kind: regex
value: '^(logstash-imperva.*|so-imperva.*)$'
- filtertype: age
source: name
direction: older
timestring: '%Y.%m.%d'
unit: days
unit_count: {{ DELETE_DAYS }}
exclude:

View File

@@ -0,0 +1,24 @@
{%- set WARM_DAYS = salt['pillar.get']('elasticsearch:index_settings:so-imperva:warm', 7) -%}
actions:
1:
action: allocation
description: "Apply shard allocation filtering rules to the specified indices"
options:
key: box_type
value: warm
allocation_type: require
wait_for_completion: true
timeout_override:
continue_if_exception: false
disable_action: false
filters:
- filtertype: pattern
kind: prefix
value: so-imperva
- filtertype: age
source: name
direction: older
timestring: '%Y.%m.%d'
unit: days
unit_count: {{ WARM_DAYS }}

View File

@@ -0,0 +1,29 @@
{%- set DELETE_DAYS = salt['pillar.get']('elasticsearch:index_settings:so-import:delete', 365) -%}
---
# Remember, leave a key empty if there is no value. None will be a string,
# not a Python "NoneType"
#
# Also remember that all examples have 'disable_action' set to True. If you
# want to use this action as a template, be sure to set this to False after
# copying it.
actions:
1:
action: delete_indices
description: >-
Delete import indices when older than {{ DELETE_DAYS }} days.
options:
ignore_empty_list: True
disable_action: False
filters:
- filtertype: pattern
kind: regex
value: '^(logstash-import.*|so-import.*)$'
- filtertype: age
source: name
direction: older
timestring: '%Y.%m.%d'
unit: days
unit_count: {{ DELETE_DAYS }}
exclude:

Some files were not shown because too many files have changed in this diff Show More