Compare commits

..

567 Commits

Author SHA1 Message Date
Mike Reeves
e054fdb464 Merge pull request #4680 from Security-Onion-Solutions/dev
ECSFIX HOTFIX
2021-07-02 11:16:49 -04:00
Mike Reeves
3c8ad18693 Merge pull request #4683 from Security-Onion-Solutions/2.3.60ecs
2.3.60 ECSFIX
2021-07-02 11:05:17 -04:00
Mike Reeves
0a91f571c1 2.3.60 ECSFIX 2021-07-02 10:41:15 -04:00
Mike Reeves
8db5284f6e Merge pull request #4679 from Security-Onion-Solutions/TOoSmOotH-patch-1
Update telegraf.conf
2021-07-02 09:48:33 -04:00
Mike Reeves
22aa695508 Update telegraf.conf 2021-07-02 09:47:31 -04:00
Mike Reeves
af7d6c8cb5 Merge pull request #4678 from Security-Onion-Solutions/ecsfix1
ECS Hotfix
2021-07-02 09:14:42 -04:00
Mike Reeves
693f455862 ECS hotfix 2021-07-02 08:55:49 -04:00
Mike Reeves
b0abd290a9 Merge branch 'dev' of https://github.com/Security-Onion-Solutions/securityonion into dev 2021-07-02 08:47:02 -04:00
Mike Reeves
0a9686f584 Merge pull request #4669 from Security-Onion-Solutions/TOoSmOotH-patch-1
2.3.70
2021-07-01 14:39:01 -04:00
Mike Reeves
0b11bf6266 Update VERSION 2021-07-01 14:37:56 -04:00
Mike Reeves
d26056d272 Merge pull request #4655 from Security-Onion-Solutions/dev
2.3.60
2021-07-01 14:31:04 -04:00
Mike Reeves
724f9ec76f Merge pull request #4667 from Security-Onion-Solutions/2.3.60v2
2.3.60
2021-07-01 13:11:10 -04:00
Mike Reeves
d583c79936 2.3.60 2021-07-01 13:09:09 -04:00
Mike Reeves
73b47716bc Merge branch 'dev' of https://github.com/Security-Onion-Solutions/securityonion into dev 2021-07-01 13:00:30 -04:00
Josh Patterson
4eaef94454 Merge pull request #4664 from Security-Onion-Solutions/influx_scripts
so-influxdb-downsample script improvements
2021-07-01 10:28:21 -04:00
m0duspwnens
21c9c7b8f4 only render main script if a manager type node 2021-07-01 07:56:45 -04:00
m0duspwnens
108fb12612 s/Migrating/Downsampling 2021-06-30 17:53:09 -04:00
m0duspwnens
eb8a030966 reset vars in jinja loop 2021-06-30 17:41:38 -04:00
m0duspwnens
9235bb35a1 fix jinja whatspace and add defaults 2021-06-30 17:30:33 -04:00
m0duspwnens
7b281abf0c migrate script now goes through each day and measurement 2021-06-30 17:21:18 -04:00
Mike Reeves
b5fecd30cf Merge branch 'dev' of https://github.com/Security-Onion-Solutions/securityonion into dev 2021-06-30 17:05:17 -04:00
Mike Reeves
26ff50f85c Merge pull request #4659 from Security-Onion-Solutions/kilo 2021-06-30 16:34:16 -04:00
Mike Reeves
2eb1ba565f Merge pull request #4658 from Security-Onion-Solutions/fix/so-docker-prune 2021-06-30 16:34:05 -04:00
William Wernert
4dbb869952 Fix typo 2021-06-30 16:21:09 -04:00
Jason Ertel
f3041a8d7e Ensure all curl's to Kibana are properly sessioned and/or authenticated depending on elastic auth toggle 2021-06-30 16:09:08 -04:00
William Wernert
4109cdec53 Refactor so-docker-prune to prevent exceptions when removing images
* Prune containers at beginning of script so stopped containers using old images are removed
* Add force=True arg to remove() call to ensure an image is still deleted on the off chance a container is still using that image
* Add exception handling to continue removing containers instead of exiting if the script fails to remove a container
2021-06-30 15:35:01 -04:00
Josh Patterson
cdced887d1 Merge pull request #4654 from Security-Onion-Solutions/2.3.60
2.3.60
2021-06-30 12:40:00 -04:00
Mike Reeves
77ca922f62 2.3.60 2021-06-30 12:37:30 -04:00
Mike Reeves
a08166f27d Merge branch 'dev' of https://github.com/Security-Onion-Solutions/securityonion into dev 2021-06-30 11:38:15 -04:00
Mike Reeves
b9c56d1885 Merge pull request #4647 from Security-Onion-Solutions/fb-module-template 2021-06-30 09:38:20 -04:00
weslambert
fcbacd473d Add ELK, redis 2021-06-30 09:34:56 -04:00
weslambert
06d77d9972 Update so-common-template.json 2021-06-30 09:31:32 -04:00
Mike Reeves
ee9c4f130e Merge pull request #4646 from Security-Onion-Solutions/influx_scripts 2021-06-30 08:58:33 -04:00
m0duspwnens
ada729087d add script to drop autogen, rename so-influxdb-migrate to so-influxdb-downsample 2021-06-30 08:14:52 -04:00
m0duspwnens
aa47a72656 source common to require root 2021-06-30 07:25:51 -04:00
Jason Ertel
857ec70abb Merge pull request #4639 from Security-Onion-Solutions/issue/4609
grafana dashboards with trends
2021-06-29 22:23:31 -04:00
m0duspwnens
149f837223 Merge remote-tracking branch 'remotes/origin/dev' into issue/4609 2021-06-29 22:20:28 -04:00
m0duspwnens
37d6529ae0 fix load panel for manager graf 2021-06-29 22:18:17 -04:00
m0duspwnens
8d3ae65e04 fix load graf standalone 2021-06-29 22:13:51 -04:00
m0duspwnens
649e539ca6 add trends to sensor dash 2021-06-29 22:08:29 -04:00
m0duspwnens
45e90750a0 add trends for searchnode grafs 2021-06-29 21:37:20 -04:00
Mike Reeves
ce2a8917a6 Merge pull request #4635 from Security-Onion-Solutions/kilo 2021-06-29 21:21:55 -04:00
m0duspwnens
b22cd2d27c managersearch dash with trends 2021-06-29 21:07:02 -04:00
m0duspwnens
813ef7d81a new eval dashboard with trends 2021-06-29 20:23:27 -04:00
m0duspwnens
88275cd968 remove trend zeek capture loss, turn on line and points for capture loss standalone graf 2021-06-29 19:50:53 -04:00
m0duspwnens
3a47563b27 remove queries manager dashboard 2021-06-29 19:26:40 -04:00
m0duspwnens
ebb45a866b remove queries from standalone dashboard 2021-06-29 19:20:29 -04:00
Mike Reeves
1433822437 Merge pull request #4637 from Security-Onion-Solutions/influxdb_cqs
Influxdb cqs - fix the query groupby
2021-06-29 19:08:56 -04:00
m0duspwnens
4a5b416a0b Merge remote-tracking branch 'remotes/origin/influxdb_cqs' into issue/4609 2021-06-29 18:55:38 -04:00
Jason Ertel
cad4efdded Fixed PCAP files are readable by root only, which prevents Suricata from being able to scan the file during import 2021-06-29 17:51:04 -04:00
m0duspwnens
f73a8d4d80 Merge remote-tracking branch 'remotes/origin/dev' into influxdb_cqs 2021-06-29 17:15:14 -04:00
m0duspwnens
dac19d224f update cq 2021-06-29 17:15:00 -04:00
m0duspwnens
fa3e5eebe2 update manager dashboard 2021-06-29 15:11:31 -04:00
Jason Ertel
b64749c9d7 Merge pull request #4630 from Security-Onion-Solutions/dougburks-patch-1
Move salt lines after shebang
2021-06-29 13:33:00 -04:00
Doug Burks
822165f168 Move salt lines after shebang 2021-06-29 13:32:02 -04:00
m0duspwnens
2d16463fc6 Merge remote-tracking branch 'remotes/origin/dev' into issue/4609 2021-06-29 12:05:12 -04:00
m0duspwnens
3d8cbe9427 add trend lines 2021-06-29 11:22:14 -04:00
m0duspwnens
f18b64faaf new standalone dashboard 2021-06-29 11:11:23 -04:00
Jason Ertel
95c7a7e9de Merge pull request #4629 from Security-Onion-Solutions/influxdb_cqs
Influxdb cqs
2021-06-29 10:01:07 -04:00
m0duspwnens
ca152ab04c redefine measurements 2021-06-29 09:54:17 -04:00
m0duspwnens
bf8bba7b84 only set measurements if conditions are met 2021-06-29 08:57:51 -04:00
m0duspwnens
3f2f699449 Merge remote-tracking branch 'remotes/origin/dev' into influxdb_cqs 2021-06-29 07:46:42 -04:00
m0duspwnens
6b68a39cbe handle senario where there are no measurements 2021-06-29 07:46:25 -04:00
Jason Ertel
8867840215 Merge pull request #4628 from Security-Onion-Solutions/influxdb_cqs
Influxdb cqs
2021-06-28 17:10:27 -04:00
m0duspwnens
1c516daa96 fix measurement list 2021-06-28 17:05:32 -04:00
m0duspwnens
21c9388ee6 generate measurement list and cq for each 2021-06-28 16:12:36 -04:00
m0duspwnens
c72146587a standalone dashboard 2021-06-28 16:07:32 -04:00
m0duspwnens
0ba685d0e2 change time filter 2021-06-28 12:36:06 -04:00
m0duspwnens
ce98f46331 update standalone dashboard for new influx 2021-06-28 08:49:02 -04:00
m0duspwnens
d6aa672556 updating standalone dashboard 2021-06-25 17:30:25 -04:00
Jason Ertel
6d2761b155 Merge pull request #4625 from Security-Onion-Solutions/foxtrot
Add Elasticsearch and Kibana to list of services that use webuser creds
2021-06-25 15:58:56 -04:00
Doug Burks
127afe1582 Merge pull request #4624 from Security-Onion-Solutions/fix/soup-grammar
fix soup grammar
2021-06-25 11:19:22 -04:00
doug
a3d7f4e35d fix grammar 2021-06-25 11:16:26 -04:00
Mike Reeves
8eb163532d Merge pull request #4620 from Security-Onion-Solutions/modulefix
Fix filebeat modules
2021-06-24 15:59:16 -04:00
Mike Reeves
ea50023ca5 Fix filebeat modules 2021-06-24 15:53:14 -04:00
Mike Reeves
846aef1bd6 Merge branch 'dev' of https://github.com/Security-Onion-Solutions/securityonion into dev 2021-06-24 14:54:51 -04:00
Mike Reeves
143f2eb1a8 Merge pull request #4616 from Security-Onion-Solutions/airsoup
remove some debug statements
2021-06-24 13:31:17 -04:00
Mike Reeves
3f8cb23cf6 remove some debug statements 2021-06-24 13:29:16 -04:00
Mike Reeves
f92709b03b Merge pull request #4614 from Security-Onion-Solutions/airsoup
Airsoup
2021-06-24 11:37:16 -04:00
Mike Reeves
81bb7c6534 remove a net check 2021-06-24 11:32:01 -04:00
Mike Reeves
bdd1074be7 remove a net check 2021-06-24 11:24:12 -04:00
Mike Reeves
42a63f8ea5 remove a net check 2021-06-24 11:15:16 -04:00
Mike Reeves
3c85db1769 Fix regression 2021-06-24 11:04:56 -04:00
Mike Reeves
930d5b3627 Revert "Move up script verification"
This reverts commit 66e88cef42.
2021-06-24 10:52:53 -04:00
Mike Reeves
a1ec40b547 Revert "Move up script verification"
This reverts commit 2681903c93.
2021-06-24 10:52:27 -04:00
William Wernert
022f9ea76e Add Elasticsearch and Kibana to list of services that use webuser creds 2021-06-24 10:45:12 -04:00
Mike Reeves
2681903c93 Move up script verification 2021-06-24 10:24:00 -04:00
Jason Ertel
403d10cc75 Merge pull request #4611 from Security-Onion-Solutions/airsoup
Move up script verification
2021-06-24 10:05:05 -04:00
Mike Reeves
66e88cef42 Move up script verification 2021-06-24 10:03:38 -04:00
Jason Ertel
8f9d1b99e2 Merge pull request #4610 from Security-Onion-Solutions/airsoup
Fix airgap check
2021-06-24 09:51:47 -04:00
Mike Reeves
4af2f6d84a Fix airgap check 2021-06-24 09:49:57 -04:00
Mike Reeves
78fa4feac6 Merge branch 'dev' of https://github.com/Security-Onion-Solutions/securityonion into dev 2021-06-23 15:38:38 -04:00
Jason Ertel
5189f38766 Merge pull request #4601 from Security-Onion-Solutions/kilo
Elastic auth related adjustments; Soup error handling corrections, ES pipeline load improvements
2021-06-23 14:46:05 -04:00
Jason Ertel
243e888717 Add queue=True -- needed for all salt commands, not just state changes 2021-06-23 14:41:38 -04:00
weslambert
c5b81f2f4b Fix output so that it can be redirected to local file with appropriate syntax 2021-06-23 14:41:38 -04:00
Mike Reeves
caa14e0cad Fix Retry Spam 2021-06-23 14:41:38 -04:00
weslambert
d411a9e1ff Merge pull request #4597 from Security-Onion-Solutions/fix/pipeline-view-output
Fix output so that it can be redirected to local file with appropriat…
2021-06-23 09:24:41 -04:00
weslambert
3fbc850774 Fix output so that it can be redirected to local file with appropriate syntax 2021-06-23 09:17:37 -04:00
Jason Ertel
d16febcae1 Merge pull request #4591 from Security-Onion-Solutions/kilo
Require either true | false in parameter to so-elastic-auth and ensur…
2021-06-22 15:31:48 -04:00
Jason Ertel
26bb6cc011 Require either true | false in parameter to so-elastic-auth and ensure all minions are fully updated with the new auth setting 2021-06-22 15:29:48 -04:00
Jason Ertel
bc80ef9a80 Merge pull request #4590 from Security-Onion-Solutions/kilo
only attempt to upgrade salt on minions if the minion count it > 1
2021-06-22 11:36:37 -04:00
m0duspwnens
9fad0876c5 only attempt to upgrade salt on minions if the minion count it > 1 2021-06-22 11:31:31 -04:00
Jason Ertel
914e635b4a Merge pull request #4589 from Security-Onion-Solutions/TOoSmOotH-patch-1
Fix Retry Spam
2021-06-22 10:15:39 -04:00
Mike Reeves
85bb234cf9 Fix Retry Spam 2021-06-22 10:14:33 -04:00
Mike Reeves
f7675a5dea Merge pull request #4588 from Security-Onion-Solutions/souperduper
let the first highstate pass
2021-06-22 09:58:00 -04:00
Josh Patterson
7b662055dd Merge pull request #4587 from Security-Onion-Solutions/kilo
fix timeout for docker_container.running for so-dockerregistry
2021-06-22 09:56:24 -04:00
m0duspwnens
d78c6f1a74 Merge branch 'kilo' of https://github.com/Security-Onion-Solutions/securityonion into kilo 2021-06-22 09:54:35 -04:00
m0duspwnens
9fa83d1cee change to client_timeout 2021-06-22 09:54:25 -04:00
Mike Reeves
6e780164ea Merge branch 'dev' of https://github.com/Security-Onion-Solutions/securityonion into dev 2021-06-22 09:52:44 -04:00
Jason Ertel
2ca8da0710 Merge pull request #4585 from Security-Onion-Solutions/kilo
Kilo
2021-06-22 08:38:39 -04:00
Jason Ertel
c3deabae36 Update init.sls 2021-06-22 08:30:54 -04:00
m0duspwnens
9cdbcb72ac Merge branch 'kilo' of https://github.com/Security-Onion-Solutions/securityonion into kilo 2021-06-22 08:23:26 -04:00
m0duspwnens
bc86590411 only add sosyncuser cron if startup_states: highstate is set in minion config 2021-06-22 08:23:16 -04:00
Jason Ertel
cb167f3d74 Merge pull request #4584 from Security-Onion-Solutions/kilo
retry on so-dockerregistry
2021-06-22 08:08:28 -04:00
Jason Ertel
8ddc99e91f Allow for adjusting SOC session timeout 2021-06-22 08:07:52 -04:00
Jason Ertel
dcc9af946a Avoid logging when sync is unnecessary due to cronjob log output spam 2021-06-22 08:07:52 -04:00
m0duspwnens
e4e3b199fc retry on so-dockerregistry 2021-06-22 08:05:08 -04:00
Josh Patterson
bf61c82cf2 Merge pull request #4581 from Security-Onion-Solutions/kilo
adding elasticsearch.auth to heavynode and searchnode
2021-06-21 14:48:32 -04:00
m0duspwnens
c9ee28ce01 adding elasticsearch.auth to heavynode and searchnode 2021-06-21 14:47:24 -04:00
Jason Ertel
5135beb036 Merge pull request #4579 from Security-Onion-Solutions/kilo
Improve user sync algorithm
2021-06-21 12:40:27 -04:00
Jason Ertel
f36ef86ccc Improve algorithm for determining if a user sync is necessary; Apply salt state in foreground to avoid collisions with setup salt states. 2021-06-21 12:38:02 -04:00
Jason Ertel
5e042bf4b8 Improve algorithm for determining if a user sync is necessary; Apply salt state in foreground to avoid collisions with setup salt states. 2021-06-21 12:16:47 -04:00
Josh Brower
130ce34686 Merge pull request #4578 from Security-Onion-Solutions/fix/esAlerter
esalerter ES creds fix
2021-06-21 11:08:59 -04:00
Josh Brower
591ef540a6 esalerter ES creds fix 2021-06-21 10:50:09 -04:00
Josh Patterson
697f6ab538 Merge pull request #4577 from Security-Onion-Solutions/issue/1333
remove the salt-minion check for schedules
2021-06-21 09:05:18 -04:00
m0duspwnens
ba5b5db2c4 remove the salt-minion check for schedules 2021-06-21 08:56:24 -04:00
Jason Ertel
e7afbab6a1 Merge pull request #4576 from Security-Onion-Solutions/kilo
Fix intermittent 'like' failures; Ensure bash is on first line of loa…
2021-06-21 07:09:10 -04:00
Jason Ertel
5298cb8cfb Update copyrights 2021-06-21 07:06:49 -04:00
Jason Ertel
777bece2eb Fix intermittent 'like' failures; Ensure bash is on first line of load templates script 2021-06-20 22:14:13 -04:00
Mike Reeves
7daad1a52a Merge pull request #4571 from Security-Onion-Solutions/kilo
Ensure htpasswd exists earlier in the install process
2021-06-18 21:45:29 -04:00
Jason Ertel
60fd3c6bd3 Ensure htpasswd exists earlier in the install process 2021-06-18 20:01:32 -04:00
Josh Patterson
dc1c82f347 Merge pull request #4567 from Security-Onion-Solutions/issue/1333
Issue/1333
2021-06-18 16:12:42 -04:00
m0duspwnens
c7a58816b6 move condition to avoid wrong notic about schedule not set in pillar 2021-06-18 15:30:51 -04:00
m0duspwnens
48c3cb4816 if the salt-minion service isnt running when the state is rendered, dont try to apply schedule - https://github.com/Security-Onion-Solutions/securityonion/issues/1333 2021-06-18 14:56:01 -04:00
Jason Ertel
6e7f2107cb Merge pull request #4566 from Security-Onion-Solutions/kilo
Remove unused mode
2021-06-18 14:45:02 -04:00
Jason Ertel
101b835cf6 Remove unused mode 2021-06-18 14:34:42 -04:00
Jason Ertel
558a90aaf8 Merge pull request #4563 from Security-Onion-Solutions/kilo
Disable HaveIBeenPwned API (pwnedpasswords.com)
2021-06-18 08:41:23 -04:00
Jason Ertel
1d4161ba31 Disable HaveIBeenPwned API (pwnedpasswords.com) 2021-06-18 08:36:36 -04:00
Mike Reeves
78d53af27c Merge pull request #4562 from Security-Onion-Solutions/kilo
Fix wrong grep file
2021-06-17 21:19:05 -04:00
Jason Ertel
188b4424e4 Fix wrong grep file 2021-06-17 21:00:56 -04:00
Mike Reeves
0615d635eb let the first highstate pass 2021-06-17 16:12:39 -04:00
Mike Reeves
85d7e75fb1 Merge branch 'dev' of https://github.com/Security-Onion-Solutions/securityonion into dev 2021-06-17 16:09:11 -04:00
Jason Ertel
833559dde6 Merge pull request #4559 from Security-Onion-Solutions/kilo
Kilo
2021-06-17 15:55:28 -04:00
Jason Ertel
b294cee278 Remove passwords from soctopus templates since these are the basis for elastalert rules, which will use the user/pass at the elastalert global config level 2021-06-17 15:53:07 -04:00
Jason Ertel
afe7ddb480 Remove passwords from soctopus templates since these are the basis for elastalert rules, which will use the user/pass at the elastalert global config level 2021-06-17 15:51:53 -04:00
Jason Ertel
98526af82a Merge pull request #4558 from Security-Onion-Solutions/kilo
Lock so-user to avoid two processes from overwriting eachother
2021-06-17 15:23:42 -04:00
Jason Ertel
0cb4562254 Lock so-user to avoid two processes from overwriting eachother 2021-06-17 15:19:39 -04:00
Josh Patterson
70f0ee719c Merge pull request #4557 from Security-Onion-Solutions/fix_soup_elasticcurl
Fix soup elasticcurl
2021-06-17 15:02:27 -04:00
m0duspwnens
63b120e9e2 use just curl for elastic in soup 2021-06-17 14:56:05 -04:00
m0duspwnens
d587120613 set ELASTICCUURL default as curl 2021-06-17 14:42:04 -04:00
Mike Reeves
0dc4bc3cee Merge branch 'dev' of https://github.com/Security-Onion-Solutions/securityonion into dev 2021-06-17 13:30:58 -04:00
Josh Patterson
79aad225a4 Merge pull request #4552 from Security-Onion-Solutions/kilo
Kilo
2021-06-17 09:38:41 -04:00
m0duspwnens
8cd2bc7c13 adding so-eval to ES_INCLUDED_NODES 2021-06-17 09:37:21 -04:00
m0duspwnens
2a5198cae4 change perms to resolve error about module-setup.yml being 660 2021-06-17 08:49:21 -04:00
Jason Ertel
b8c463db82 Merge pull request #4551 from Security-Onion-Solutions/kilo
Fix require statement
2021-06-16 21:49:47 -04:00
Jason Ertel
059b016c62 Fix require statement 2021-06-16 21:48:31 -04:00
Jason Ertel
f1429632d2 Merge pull request #4549 from Security-Onion-Solutions/kilo
Elastic auth: Fun with Salt
2021-06-16 17:57:58 -04:00
Jason Ertel
2d34208269 Elastic auth: Fun with Salt 2021-06-16 17:52:22 -04:00
Jason Ertel
36c9054744 Merge pull request #4547 from Security-Onion-Solutions/kilo
Kilo
2021-06-16 14:55:27 -04:00
William Wernert
5e11efb0b9 Merge pull request #4548 from Security-Onion-Solutions/fix/soup-merge-fix
Fix merge issue in soup
2021-06-16 14:36:24 -04:00
William Wernert
703988b376 Fix merge issue in soup 2021-06-16 14:28:20 -04:00
Jason Ertel
fefd2677fb Only include so-common if available. It only is used for requiring root, but since this script is needed before common is installed, we can safely assume that it's being run as root already (during the install) 2021-06-16 14:26:26 -04:00
Jason Ertel
a323aeb8fa Allow so-elastic-auth to run before common even though the script has dependency on a common-provided script (benign error). This is needed first since common will need to know if auth is enabled 2021-06-16 14:23:58 -04:00
Mike Reeves
8d6b0e23ce Merge branch 'dev' of https://github.com/Security-Onion-Solutions/securityonion into dev 2021-06-16 13:23:44 -04:00
Jason Ertel
edac99e5a9 Merge pull request #4546 from Security-Onion-Solutions/kilo
Accept either 200 or 401 instead of wasting 3 minutes waiting for thi…
2021-06-16 11:41:23 -04:00
Jason Ertel
dd14235e31 Accept either 200 or 401 instead of wasting 3 minutes waiting for this to timeout 2021-06-16 11:39:21 -04:00
Jason Ertel
15eadd4f89 Merge pull request #4545 from Security-Onion-Solutions/kilo
Merge kilo to dev for additional ES Auth changes
2021-06-16 11:04:39 -04:00
Jason Ertel
09fbb045a1 If ES auth disabled ensure user/pass are blank 2021-06-16 09:59:57 -04:00
Josh Patterson
7bdd0d3bf1 Merge pull request #4543 from Security-Onion-Solutions/issue/2977
Issue/2977
2021-06-16 08:16:36 -04:00
m0duspwnens
ebea9a7198 remove space 2021-06-16 08:07:28 -04:00
m0duspwnens
ad9441bb60 prevent suricata state from running on manager and managersearch https://github.com/Security-Onion-Solutions/securityonion/issues/2977 2021-06-16 08:06:26 -04:00
Jason Ertel
989f9dce42 Ensure sqlite.db exists before querying it; Execute so-elastic-auth after common state has been applied and redirect output to setup log 2021-06-15 16:57:13 -04:00
Jason Ertel
b95437347e Upgrade ES to 7.13.2 2021-06-15 12:50:57 -04:00
Jason Ertel
2d27e0d9a9 Merge pull request #4530 from Security-Onion-Solutions/kilo
Elastic auth
2021-06-15 11:15:19 -04:00
Jason Ertel
c3c078e5be Merge pull request #4522 from Security-Onion-Solutions/feature/contributing-md
Add CONTRIBUTING.md
2021-06-15 10:25:07 -04:00
Jason Ertel
dd8eb29a18 Continue merge of ECS into Elastic Auth 2021-06-15 09:11:58 -04:00
William Wernert
2d5591a87f Remove draft label 2021-06-14 16:33:52 -04:00
William Wernert
71b079eb54 Add bullet detailing linking pull request to issue 2021-06-14 16:04:22 -04:00
William Wernert
ca6f3807fc Don't use idioms, and remove TBD lines 2021-06-14 15:58:21 -04:00
Doug Burks
c2f6a6983d Merge pull request #4521 from Security-Onion-Solutions/feature/security-md
Create SECURITY.md
2021-06-14 15:51:55 -04:00
Jason Ertel
3891ca2929 Use correct mode param to file.recurse 2021-06-14 15:46:25 -04:00
Doug Burks
20437ef2c7 Create SECURITY.md 2021-06-14 15:42:18 -04:00
William Wernert
7de02d541f Increase width of verified commit screenshot 2021-06-14 15:28:44 -04:00
William Wernert
68e4c5e469 Add CONTRIBUTING.md draft, move markdown images to assets/images 2021-06-14 15:21:46 -04:00
Jason Ertel
62187807f0 Specify elastic creds for playbook alert templates 2021-06-14 14:08:14 -04:00
Jason Ertel
37f4caf536 Make new ECS changes Elastic-auth compatible 2021-06-14 12:13:50 -04:00
Jason Ertel
fca1c6e957 Merge branch 'dev' into kilo 2021-06-14 10:40:04 -04:00
Josh Patterson
0de7e71fa0 Merge pull request #4517 from Security-Onion-Solutions/fix/filebeat
update roles that include es state
2021-06-14 10:02:50 -04:00
m0duspwnens
fd5d540c78 update roles that include es state 2021-06-14 10:00:19 -04:00
m0duspwnens
d2069dc5f2 update roles that include es state 2021-06-14 09:58:50 -04:00
Mike Reeves
2ac832678f Merge pull request #4513 from Security-Onion-Solutions/fix/filebeat
fix two bugs
2021-06-14 08:53:13 -04:00
m0duspwnens
5941332d49 fix two bugs 2021-06-14 08:51:29 -04:00
Josh Patterson
45732bd87a Merge pull request #4494 from Security-Onion-Solutions/fix_module_config_jinja
dont loop if modules arent defined for the node
2021-06-11 13:54:15 -04:00
m0duspwnens
f7600af89b dont loop if modules arent defined for the node 2021-06-11 13:52:33 -04:00
Josh Patterson
5108121b59 Merge pull request #4489 from Security-Onion-Solutions/hotfix/soup_salt
Hotfix/soup salt
2021-06-10 16:04:27 -04:00
Josh Patterson
c2339c84e7 Merge branch 'dev' into hotfix/soup_salt 2021-06-10 15:48:00 -04:00
Jason Ertel
7205c5cb7b Provide timestamp as arg to SOC PCAP pivots 2021-06-10 15:21:03 -04:00
m0duspwnens
ff807c9a6f empty hotfix file for merge into dev 2021-06-10 14:06:24 -04:00
Mike Reeves
0341eb5d8f Merge pull request #4479 from Security-Onion-Solutions/hotfix/soup_salt
Hotfix/soup salt
2021-06-10 13:44:10 -04:00
Mike Reeves
a2e1b1de3a Merge pull request #4484 from Security-Onion-Solutions/pipeline
Pipeline
2021-06-10 13:41:14 -04:00
m0duspwnens
e64059bd7b remove unneeded function 2021-06-10 09:31:10 -04:00
m0duspwnens
46b1de97f5 change function name 2021-06-10 09:30:03 -04:00
Mike Reeves
ca7d2c6d64 Merge branch 'pipeline' of https://github.com/Security-Onion-Solutions/securityonion into pipeline 2021-06-10 09:20:38 -04:00
Mike Reeves
12d4d4a4f7 Dynamix Pipelines take 2 2021-06-10 09:19:15 -04:00
m0duspwnens
7c92054f13 soup hotfix to updating repos for earlier versions of SO so salt will isntall 2021-06-10 09:13:15 -04:00
weslambert
1bef1d5652 Update to apply to any so-prefixed index 2021-06-10 08:16:00 -04:00
Jason Ertel
89a02383b8 Correct cronjob path issue for sysctl; suppress diff outputs from users/roles files; suppress salt state output during user sync 2021-06-09 16:31:32 -04:00
Mike Reeves
7fba904f75 Dynamix Pipelines take 1 2021-06-09 15:32:39 -04:00
Mike Reeves
1c7741fdbe Add templates for SO logs 2021-06-09 12:38:19 -04:00
Mike Reeves
4c90a0ed7e Add templates for SO logs 2021-06-09 12:04:32 -04:00
m0duspwnens
a82b174826 perform the repo changes for any upgrade 2021-06-09 11:53:10 -04:00
Mike Reeves
579ff8c0b4 Add verbosity to checkin 2021-06-09 11:40:17 -04:00
Mike Reeves
264080546c Add log path 2021-06-09 11:37:27 -04:00
Jason Ertel
a0c65e2333 Ensure elastic minions also update their auth files 2021-06-09 09:38:50 -04:00
Jason Ertel
dd73ad544c Rename PATH var to avoid collision with OS PATH var; wrapped password var in quotes to support spaces in Fleet/TheHive passwords 2021-06-09 09:06:29 -04:00
Mike Reeves
33db9023eb Revert to SO taxonomy for zeek and suricata 2021-06-08 13:50:39 -04:00
Mike Reeves
88eea03f97 Revert to SO taxonomy for zeek and suricata 2021-06-08 13:36:50 -04:00
Mike Reeves
a959ec1eb1 Revert to SO taxonomy for zeek and suricata 2021-06-08 13:23:31 -04:00
Mike Reeves
3e138cbc6d Revert to SO taxonomy for zeek and suricata 2021-06-08 13:14:46 -04:00
Jason Ertel
9b61723194 Merge branch 'dev' into kilo 2021-06-08 11:04:09 -04:00
Jason Ertel
d2381b0209 Ensure empty/aborted users/roles files do not get copied onto final filenames 2021-06-08 11:03:56 -04:00
Mike Reeves
4972f69dd6 Merge remote-tracking branch 'remotes/origin/dev' into pipeline 2021-06-08 11:03:14 -04:00
Mike Reeves
56eb220ed6 Revert to SO taxonomy for zeek and suricata 2021-06-08 09:52:05 -04:00
Jason Ertel
343c47d67a Add so-elasticsearch-query tool 2021-06-07 17:26:07 -04:00
Jason Ertel
e53f2217ec Add so-elasticsearch-query tool 2021-06-07 17:24:22 -04:00
Mike Reeves
016a5a5914 Merge pull request #4432 from Security-Onion-Solutions/merge_2.3.52
Merge 2.3.52
2021-06-07 14:10:16 -04:00
William Wernert
9f2adfb67a Merge branch 'master' into merge_2.3.52
# Conflicts:
#	VERSION
2021-06-07 14:08:17 -04:00
Mike Reeves
6e92e7283d Merge pull request #4411 from Security-Onion-Solutions/hotfix-0528
2.3.52
2021-06-07 13:55:51 -04:00
Mike Reeves
e3c16147ce 2.3.52 2021-06-07 09:34:22 -04:00
Jason Ertel
14aa9805b4 Stop failing an install because salt is already running when a highstate is applied at 95% 2021-06-06 18:20:57 -04:00
Jason Ertel
fdab17a3b9 Due to dir ownership restrictions need to run crossthestreams and eval as root 2021-06-06 16:36:35 -04:00
Jason Ertel
bebba7d280 Switch ownership of curl config to socore 2021-06-06 07:43:53 -04:00
Jason Ertel
11b2b2a893 Switch ownership of curl config to socore 2021-06-06 05:42:34 -04:00
Jason Ertel
84141082ab Avoid applying state when adding web user 2021-06-05 08:41:48 -04:00
Jason Ertel
ba29b5e036 Do not apply salt state if already applying a state 2021-06-04 21:56:41 -04:00
Jason Ertel
e22421ec99 Refactor users/roles management via salt due to Salt's clobbering of the inode which breaks Docker mounts 2021-06-04 20:01:30 -04:00
Jason Ertel
416b38fc71 Use cronjob to ensure user synchronization 2021-06-04 11:24:58 -04:00
William Wernert
fd5fcfeaae Merge pull request #4402 from Security-Onion-Solutions/foxtrot
Use variable for whiptail title and make sure all menus in setup have the same title
2021-06-04 11:10:01 -04:00
Mike Reeves
75ff268ecc 2.3.52 2021-06-04 11:03:08 -04:00
Mike Reeves
9f98b8ad2f 2.3.52 2021-06-04 10:59:18 -04:00
Jason Ertel
316035910f Remove inotify beacon due to it not functioning as documented; Add back so-user changes to sync upon so-user changes 2021-06-03 15:15:35 -04:00
William Wernert
d1d09d4aab Remove useless variable assignment 2021-06-03 14:20:52 -04:00
Mike Reeves
31365b266a Update so-zeek-stats 2021-06-03 13:53:11 -04:00
Mike Reeves
2f34e7eeed Update HOTFIX 2021-06-03 11:04:10 -04:00
William Wernert
3aff3ac7e4 Change logic to check for unmanaged nics
Resolves issue mentioned in #4327
2021-06-03 11:00:20 -04:00
William Wernert
d1a185aaae Further standardize whiptail titles 2021-06-03 10:59:14 -04:00
Mike Reeves
ff10432124 Update VERSION 2021-06-03 10:57:20 -04:00
William Wernert
bb5b805983 Merge branch 'fix/missing-version-string' into foxtrot 2021-06-03 10:45:02 -04:00
Jason Ertel
58ae3479dc Fix mispelled db filename; ensure ELASTICCURL is used for loading config objects 2021-06-03 10:11:10 -04:00
William Wernert
d55e007032 Merge pull request #4386 from Security-Onion-Solutions/foxtrot
Update wording for iso location prompt in soup
2021-06-03 09:55:15 -04:00
Jason Ertel
2af43d62eb Wrap curl param in quotes for function call 2021-06-03 08:53:59 -04:00
Jason Ertel
5c527b2c48 Rename username param to user since logstash is 'unique' 2021-06-03 07:51:43 -04:00
Jason Ertel
e6165f0046 Update kibana config load for auth changes 2021-06-03 07:47:32 -04:00
Jason Ertel
70427bc676 Merge branch 'dev' into kilo 2021-06-03 07:41:35 -04:00
Mike Reeves
9ec7cbef8e Merge pull request #4391 from Security-Onion-Solutions/es-7.13.1
Es 7.13.1 saved objects update
2021-06-02 20:23:40 -04:00
Jason Ertel
719d841353 Update saved objects 2021-06-02 20:15:03 -04:00
Jason Ertel
fa6af06204 Avoid running highstate during setup when flipping auth flag 2021-06-02 17:13:59 -04:00
weslambert
cba719b3a0 Remove extra comma 2021-06-02 16:42:09 -04:00
weslambert
4241bb08b8 Add suricata/zeek until we migrate templates 2021-06-02 16:37:43 -04:00
Jason Ertel
901242f7e9 remove extra parenthesis 2021-06-02 16:23:45 -04:00
weslambert
4c74e7f308 Add event.kind and set name to module[dot]dataset 2021-06-02 15:35:26 -04:00
weslambert
db48c15f1d Create event.kind field and rename dataset to be module[dot]dataset 2021-06-02 15:33:18 -04:00
weslambert
a1b34e7a88 Fix Suricata index name 2021-06-02 15:30:14 -04:00
Jason Ertel
fc6b3726a4 Fix missing colon for mode 2021-06-02 15:23:16 -04:00
Mike Reeves
9c9bcac61b Update DNS queries 2021-06-02 15:01:14 -04:00
Jason Ertel
588da4d7dc Resolve salt pillar/state/jinja race condition 2021-06-02 14:34:21 -04:00
Mike Reeves
e42db3cd2d Fix some hunt queries 2021-06-02 14:05:02 -04:00
Mike Reeves
e8cc88174f Fix some hunt queries 2021-06-02 13:55:05 -04:00
Mike Reeves
7b7111e12c Fix some hunt queries 2021-06-02 13:53:39 -04:00
William Wernert
b3f2c60065 Whiptail title fixes
- Use a variable for the title
- Fix cases where the whiptail title wasn't changed previously
2021-06-02 12:38:32 -04:00
Jason Ertel
20e896cacf Update all configs to pass user/pass to ES 2021-06-02 12:17:15 -04:00
William Wernert
afbf7de9e3 Remove empty lines in iso location prompt 2021-06-02 11:05:43 -04:00
Jason Ertel
4ff85ab0c4 Merge branch 'dev' into kilo 2021-06-02 10:39:51 -04:00
Jason Ertel
dd7388e577 Merge pull request #4382 from Security-Onion-Solutions/jertel/timeouts
Increase SOC API timeouts and ES timeout from 2m to 5m
2021-06-02 10:28:36 -04:00
Mike Reeves
77f13961ad Merge remote-tracking branch 'remotes/origin/dev' into pipeline 2021-06-02 10:12:17 -04:00
Mike Reeves
e00fe0a732 Enable for all modes 2021-06-02 10:02:11 -04:00
Jason Ertel
c757d21360 Increase default SOC API and ES timeouts from 2m to 5m 2021-06-02 09:38:59 -04:00
Jason Ertel
3a134cc706 fix merge conflicts 2021-06-02 09:16:28 -04:00
Jason Ertel
7aede4d058 Persist chown/chmod settings on users/roles files 2021-06-02 09:01:16 -04:00
Mike Reeves
5983eae3a8 fix filebeat module syntax 2021-06-01 17:47:13 -04:00
Josh Patterson
9d6dca9c64 Merge pull request #4372 from Security-Onion-Solutions/pipeline_userpass
fix typo
2021-06-01 17:46:41 -04:00
m0duspwnens
7b68c1bc9b fix typo 2021-06-01 17:45:52 -04:00
Josh Patterson
9d905368ca Merge pull request #4371 from Security-Onion-Solutions/pipeline_userpass
Pipeline userpass
2021-06-01 17:01:51 -04:00
m0duspwnens
867613669d changes for syncing users 2021-06-01 17:01:03 -04:00
Mike Reeves
fd1de624c8 Disable TTY for filebeat script 2021-06-01 14:50:21 -04:00
Jason Ertel
2a2247e1da Additional so-user sync adjustments 2021-06-01 14:45:01 -04:00
Jason Ertel
7a59bee315 Add so-elastic-auth script 2021-06-01 12:48:53 -04:00
William Wernert
91c8a7c65b Use correct syntax for tar to drop directory structure 2021-06-01 12:16:56 -04:00
Mike Reeves
73a0b31380 elastic pipeline enable 2021-06-01 12:12:20 -04:00
m0duspwnens
ef00695b07 fix typo 2021-06-01 11:31:50 -04:00
m0duspwnens
bfaffbc87e add reactor and beacon for sqlite db 2021-06-01 11:15:28 -04:00
William Wernert
e800d62df4 Merge branch 'dev' into fix/update-iso-soup-wording 2021-06-01 11:12:17 -04:00
Josh Patterson
6fe765434e Merge pull request #4362 from Security-Onion-Solutions/pipeline_userpass
Pipeline userpass
2021-06-01 10:56:29 -04:00
m0duspwnens
7e48740ea7 fix merge conflict 2021-06-01 10:56:02 -04:00
m0duspwnens
d25a439bd4 more changes 2021-06-01 10:53:58 -04:00
Jason Ertel
ed8c85df2b Only sync web users if teh sqlite db exists 2021-06-01 10:26:33 -04:00
Josh Patterson
c4ae8c3418 Merge pull request #4359 from Security-Onion-Solutions/pipeline_userpass
generate pillar file if auth enabled or not
2021-06-01 09:38:34 -04:00
m0duspwnens
f87dce8ec1 generate pillar file if auth enabled or not 2021-06-01 09:38:07 -04:00
Josh Patterson
5d2f1c8e11 Merge pull request #4357 from Security-Onion-Solutions/pipeline_userpass
fix logic
2021-06-01 08:36:48 -04:00
m0duspwnens
1aa2852ed6 fix logic 2021-06-01 08:35:43 -04:00
Jason Ertel
a42a406f53 Remove extra users file mounts; disable elastic anon access when auth enabled 2021-05-29 07:52:08 -04:00
Jason Ertel
47b56e78b3 Fix missing endif 2021-05-28 20:07:51 -04:00
Josh Patterson
52db7b32ef Merge pull request #4335 from Security-Onion-Solutions/pipeline_userpass
fix logic on password created in pillar and fix how me manage
2021-05-28 18:29:59 -04:00
m0duspwnens
3aad5a30e9 fix logic on password created in pillar and fix how me manage 2021-05-28 18:28:53 -04:00
Jason Ertel
b8a10f2e86 Support multiple elastic system users 2021-05-28 15:59:51 -04:00
Josh Patterson
4e8dc0e3b9 Merge pull request #4334 from Security-Onion-Solutions/pipeline_userpass
Pipeline userpass
2021-05-28 15:29:07 -04:00
m0duspwnens
edf60f80f7 manager and common states now require elasticsearch.auth state 2021-05-28 15:26:26 -04:00
William Wernert
a94c598d00 Merge pull request #4333 from Security-Onion-Solutions/feature/show-version-in-setup
Show version in setup
2021-05-28 15:15:43 -04:00
m0duspwnens
68abaa5e3c update auth.map and curl.config to use new elasticsearch:auth pillar format 2021-05-28 14:03:21 -04:00
m0duspwnens
63b31de2b8 add additional users - manage file if user name isnt returned from grepping the file 2021-05-28 13:58:03 -04:00
Mike Reeves
eac5c604bd Update packetloss.sh 2021-05-28 12:57:35 -04:00
Mike Reeves
e7d8df499c Update HOTFIX 2021-05-28 12:55:57 -04:00
Josh Patterson
35845440c6 Merge pull request #4330 from Security-Onion-Solutions/pipeline_userpass
remove unneeded curl.config template
2021-05-28 10:38:43 -04:00
m0duspwnens
18926009d3 remove unneeded curl.config template 2021-05-28 10:38:06 -04:00
William Wernert
d55a9e6274 Add version to all whiptail titles 2021-05-28 10:20:19 -04:00
William Wernert
ba011581ef Add version to ending summary 2021-05-28 10:14:58 -04:00
Jason Ertel
1788ceccea Merge pull request #4329 from Security-Onion-Solutions/fix/kibana_7.13.0
bump Kibana version to 7.13.0
2021-05-28 09:14:18 -04:00
doug
ada8255af0 bump version to 7.13.0 2021-05-28 08:59:40 -04:00
Josh Patterson
f1a6f66d49 Merge pull request #4317 from Security-Onion-Solutions/pipeline_userpass
remove vault pg from when i was testing
2021-05-27 13:55:01 -04:00
m0duspwnens
423793ecf9 remove vault pg from testing 2021-05-27 13:50:22 -04:00
Josh Patterson
94cfa3c9d0 Merge pull request #4314 from Security-Onion-Solutions/pipeline_userpass
Pipeline userpass
2021-05-27 11:34:34 -04:00
m0duspwnens
0134ceef16 merge and resolve conflict in elasticsearch state 2021-05-27 11:33:44 -04:00
m0duspwnens
b23ce7462e add depenency 2021-05-27 11:26:25 -04:00
Doug Burks
cf3dda6869 Merge pull request #4300 from j-bernal/patch-1
Update so-whiptail
2021-05-27 07:58:16 -04:00
m0duspwnens
dc8520df42 user curl.config for curl and elasticscripts 2021-05-26 18:04:30 -04:00
Jason Ertel
d9c5976ed0 Merge pull request #4304 from Security-Onion-Solutions/feature/1596
add menu.actions.json and update soc.json
2021-05-26 16:41:30 -04:00
doug
aeea5701e4 completely disable both alerts.actions.json and hunt.actions.json 2021-05-26 16:34:05 -04:00
m0duspwnens
7263e35a89 happy little comment 2021-05-26 14:52:59 -04:00
m0duspwnens
4d991d3773 propogate users and users_roles 2021-05-26 14:52:10 -04:00
Mike Reeves
bfcde15a24 elastic pipeline test 2021-05-26 14:22:14 -04:00
doug
ee675546ac add menu.actions.json and update soc.json 2021-05-26 14:09:00 -04:00
Jason Ertel
b43e6c5d6b Salt will handle auto-sync 2021-05-26 13:51:24 -04:00
Jason Ertel
c531ef0773 Move user sync'd files to saltstack for grid propagation 2021-05-26 13:44:30 -04:00
Jason Ertel
a6a4c03029 Improve error scenarios for user sync; Ensure user sync runs before Elastic container starts 2021-05-26 12:08:10 -04:00
Mike Reeves
b525cfc787 Remove old modules 2021-05-26 11:07:53 -04:00
m0duspwnens
842aa97f7e load filebeat modules when es container starts and if fb container is running 2021-05-26 11:00:18 -04:00
Mike Reeves
34d4eedf67 Remove old modules 2021-05-26 10:11:47 -04:00
Josh Brower
4a109d6af1 Merge pull request #4299 from Security-Onion-Solutions/feature/so-pcap-pull
Feature/so-pcap-export
2021-05-26 09:59:45 -04:00
John Bernal
cb40a76247 Update so-whiptail
Updated Zeek capitalization when prompting for the number of processes.
2021-05-26 09:55:14 -04:00
Josh Brower
ed249600d3 Merge remote-tracking branch 'remotes/origin/dev' into feature/so-pcap-pull 2021-05-26 09:52:58 -04:00
Josh Brower
0187c9d6df Adds so-pcap-export 2021-05-26 09:51:37 -04:00
William Wernert
6da37966d9 Update wording for iso location prompt in soup 2021-05-26 09:32:25 -04:00
m0duspwnens
525d4325c7 define ZEEKLOGLOOKUP in the yaml 2021-05-25 17:18:58 -04:00
m0duspwnens
ecf7e25a51 fix merge conflict 2021-05-25 17:16:44 -04:00
Jason Ertel
ec2f8fe6c8 Synchronize SOC passwords with Elastic 2021-05-25 17:16:05 -04:00
m0duspwnens
dfaf40f583 add zeekloglookup to translate zeeklogs to filebeat filesets 2021-05-25 17:14:26 -04:00
Mike Reeves
543154f037 Remove old modules 2021-05-25 16:58:18 -04:00
Mike Reeves
cd3e355f84 Fix zeek depth 2021-05-25 16:54:20 -04:00
m0duspwnens
2eee6b45bc Merge branch 'pipeline' of https://github.com/Security-Onion-Solutions/securityonion into pipeline 2021-05-25 16:52:08 -04:00
m0duspwnens
0de5c6f204 fix sodefault modules 2021-05-25 16:52:02 -04:00
Mike Reeves
9363fc153c Fix pillar for module 2021-05-25 16:44:13 -04:00
m0duspwnens
2aacd5b9b6 so defaults filebeat modules 2021-05-25 16:40:50 -04:00
m0duspwnens
c3b2e1e8b2 dont show changes 2021-05-25 16:16:57 -04:00
m0duspwnens
e261c197f3 add elasticsearch.auth state to statnalone node 2021-05-25 13:46:18 -04:00
m0duspwnens
747dc77c92 comment out the hackery 2021-05-25 13:23:26 -04:00
m0duspwnens
35cc7b27e9 remove extra quote 2021-05-25 13:12:30 -04:00
William Wernert
67828a86c1 Merge pull request #4289 from Security-Onion-Solutions/foxtrot
Soup error handling, reorder sensoroni state
2021-05-25 12:42:01 -04:00
m0duspwnens
58ec31d6c7 pass ELASTICAUTH to script 2021-05-25 12:02:41 -04:00
m0duspwnens
6da0b57ce1 fix file.file_exists 2021-05-25 11:55:22 -04:00
m0duspwnens
8d9d5a267a generate elasticsearch.auth pillar if it doesnt exist 2021-05-25 11:52:58 -04:00
William Wernert
94af55a951 Fix typo 2021-05-25 11:25:37 -04:00
William Wernert
192cec1825 Change how version with dashes are handled by so-docker-prune 2021-05-25 11:25:12 -04:00
Mike Reeves
1e564c2140 Fix zeek jinja 2021-05-25 10:22:36 -04:00
William Wernert
7e008378ba Replace string with variable, remove unnecessary text 2021-05-25 09:23:44 -04:00
William Wernert
dbc4ffd69a Fix typo 2021-05-25 09:20:45 -04:00
m0duspwnens
5a1e8d9fe9 update kibana scripts for elastic auth 2021-05-25 08:50:55 -04:00
Mike Reeves
5e5d30a377 Fix 3rd party modules 2021-05-25 08:26:25 -04:00
William Wernert
3bc0def02a Add failure message to salt-master check 2021-05-24 16:45:05 -04:00
m0duspwnens
bd301880ad define the default 2021-05-24 16:32:30 -04:00
m0duspwnens
2deb703272 map users_roles and users conf into docker container 2021-05-24 16:30:55 -04:00
Jason Ertel
8c6489a49a Initial pass at synchronizing users file 2021-05-24 15:48:05 -04:00
m0duspwnens
87609ba5d1 fix elasticcurl if auth is enabled 2021-05-24 15:44:01 -04:00
m0duspwnens
ba3a51387c set default to False 2021-05-24 15:31:46 -04:00
William Wernert
ffd5bfc480 Force images from automated branches to a very high semver 2021-05-24 15:25:03 -04:00
m0duspwnens
a4226cc39a use elastic map file 2021-05-24 15:14:05 -04:00
William Wernert
dcb89b704a Move sensoroni state out of the * block of top.sls
Resolves #3559
2021-05-24 13:45:12 -04:00
William Wernert
686c7c5a6c Add exception handling for docker API error to so-docker-prune 2021-05-24 13:26:43 -04:00
Jason Ertel
409eea677d Continue removal of argon hashing 2021-05-24 11:50:53 -04:00
William Wernert
99d41d1606 Add ending newline to soup 2021-05-24 11:29:40 -04:00
Jason Ertel
915b7aa2df Switch Kratos config from argon2 to bcrypt12 2021-05-24 10:52:54 -04:00
m0duspwnens
e2d5102a0e changes for script to auth to elastic 2021-05-24 10:13:29 -04:00
Mike Reeves
e5a41b60ef Merge remote-tracking branch 'remotes/origin/dev' into pipeline 2021-05-24 09:14:03 -04:00
Jason Ertel
0572ea4095 Fail curl command if a failing status code is returned by the remote server 2021-05-21 17:27:11 -04:00
Jason Ertel
71032150c5 Add secure HTTP headers to all SO application responses to reduce exposure to browser and other HTTP-related vulnerabilities 2021-05-21 17:27:00 -04:00
Jason Ertel
36d13dd414 Merge branch 'dev' into kilo 2021-05-21 17:26:50 -04:00
William Wernert
946e369a44 Merge branch 'dev' into foxtrot 2021-05-21 15:26:24 -04:00
Mike Reeves
18922ed6f5 Merge pull request #4263 from Security-Onion-Solutions/feature/merge-2.3.51
Merge 2.3.51 into dev
2021-05-21 12:47:15 -04:00
William Wernert
c1dd4dafe4 Fix influx state 2021-05-21 12:41:10 -04:00
William Wernert
fe3aec173f Merge branch 'master' into feature/merge-2.3.51
# Conflicts:
#	VERSION
#	salt/influxdb/init.sls
2021-05-21 12:31:54 -04:00
Mike Reeves
de4fde4ee3 Merge pull request #4248 from Masaya-A/MAC-Address
Showing Mac Address to select suitable NICs (Discussions #4214)
2021-05-19 21:18:15 -04:00
Masaya-A
3450219bc7 Drop error to /dev/null 2021-05-20 09:33:14 +09:00
Masaya-A
6af126b872 Fix array 2021-05-19 10:02:19 +09:00
Masaya-A
ac42cba50b Adding MAC Address for NIC List 2021-05-19 09:06:02 +09:00
Masaya-A
5d263f63cb Merge pull request #10 from Security-Onion-Solutions/dev
Dev Sync
2021-05-19 08:59:49 +09:00
William Wernert
f445186f1e Remove redundant error messages 2021-05-18 13:38:55 -04:00
William Wernert
bdd53ed5e3 Change retry delay + count 2021-05-18 12:23:40 -04:00
William Wernert
dbd5ef70c9 Change retry delay + count 2021-05-17 16:19:31 -04:00
William Wernert
ce9554281e Fix backwards logic 2021-05-17 16:08:34 -04:00
William Wernert
4e1fba5b38 Only echo error code if not using retry 2021-05-17 16:04:13 -04:00
William Wernert
3f238f7a4a Set flag so trap doesn't repeat info 2021-05-17 16:02:52 -04:00
William Wernert
b89091cc7d Try retrying in curl instead of shell function 2021-05-17 15:58:25 -04:00
William Wernert
992b76a0f0 Remove debug lines 2021-05-17 15:38:10 -04:00
William Wernert
2bcd51b21c Fix error message 2021-05-17 15:10:57 -04:00
William Wernert
3625453668 Don't unmount airgap directory if not airgap 2021-05-17 11:00:28 -04:00
William Wernert
5821a122cc Merge branch 'dev' into issue/3220 2021-05-17 10:58:06 -04:00
Josh Patterson
891e414cb6 Merge pull request #4202 from Security-Onion-Solutions/issue/3264
Issue/3264
2021-05-14 16:30:16 -04:00
m0duspwnens
54f9e3ff9d remove leading space on comment line 2021-05-14 16:24:16 -04:00
m0duspwnens
1c0cc15fdb Merge remote-tracking branch 'remotes/origin/dev' into issue/3264 2021-05-14 15:19:58 -04:00
m0duspwnens
231e07dbbd circumvent file.patch putting ERROR in log if patch doesnt need applied 2021-05-14 15:19:45 -04:00
m0duspwnens
3859f6464a dont be quiet on first grep 2021-05-14 08:56:42 -04:00
Mike Reeves
71a74a6656 Added updated script and core modules 2021-05-13 13:07:16 -04:00
Josh Patterson
3668d1aadf Merge pull request #4188 from Security-Onion-Solutions/issue/3264
install influxdb and grafana during setup prior to final highstate
2021-05-13 11:46:57 -04:00
m0duspwnens
d3af06e7a4 handle exception if influxdb module doesnt exist 2021-05-13 11:00:42 -04:00
m0duspwnens
74f2a61b25 install influxdb and grafana during setup prior to final highstate 2021-05-13 09:06:47 -04:00
Mike Reeves
68a667ee7c Add thirfpartydefaults.yml 2021-05-12 15:31:19 -04:00
William Wernert
192b5db25a Add true to end of functions ending with shorthand comparison
Functions ending with test using [[ <false> ]] && <cmd> will trip set -e, so adding true to the last line of the function will prevent the function from returning a nonzero code
2021-05-12 15:26:39 -04:00
William Wernert
9ced391c11 Fix indent in main(), re-add trap, remove ERR_HANDLED variable 2021-05-12 13:20:59 -04:00
William Wernert
807b525c79 Temp remove exit on failure + bash trap 2021-05-12 11:19:33 -04:00
William Wernert
7bd04deae7 Unset exit on failure for pkill command 2021-05-12 10:45:03 -04:00
William Wernert
c379822bf0 Set variable to skip trap if error already handled 2021-05-11 12:59:49 -04:00
m0duspwnens
ad67167e97 remove whitespace control 2021-05-11 12:58:21 -04:00
m0duspwnens
4012a8276c add template for module .yml file 2021-05-11 12:22:25 -04:00
m0duspwnens
efc028d0a5 handle the docker port bindings for filebeat modules 2021-05-10 18:08:47 -04:00
Mike Reeves
01a121e029 Add defaults.yml 2021-05-10 15:29:50 -04:00
William Wernert
f793450d97 Return actual exit code from retry 2021-05-10 13:22:13 -04:00
William Wernert
fec868432f Try to fix bash trap 2021-05-10 11:59:22 -04:00
William Wernert
d3b08beb53 Only cat file if it exists 2021-05-10 11:11:54 -04:00
William Wernert
a75d4841d0 Add debug lines 2021-05-10 11:05:24 -04:00
William Wernert
8b3730748b Add debug line and remove exit command on retry failure 2021-05-10 10:58:29 -04:00
William Wernert
de5552c91a Merge branch 'dev' into issue/3220 2021-05-10 10:33:52 -04:00
m0duspwnens
a7e6dec51d Merge remote-tracking branch 'remotes/origin/dev' into kilo 2021-05-10 09:57:50 -04:00
Josh Patterson
26335a9b42 Merge pull request #4140 from Security-Onion-Solutions/issue/3264
https://github.com/Security-Onion-Solutions/securityonion/issues/3264
2021-05-10 08:14:12 -04:00
William Wernert
f8dd6890b2 Unset/set exit on command fail for retries 2021-05-07 16:50:59 -04:00
m0duspwnens
1c103f92f2 Merge remote-tracking branch 'remotes/origin/issue/3264' into kilo 2021-05-07 14:48:42 -04:00
m0duspwnens
e3ce683970 Merge remote-tracking branch 'remotes/origin/dev' into issue/3264 2021-05-07 14:48:16 -04:00
m0duspwnens
9eb63b17f9 exit if retry fails 2021-05-07 14:48:02 -04:00
m0duspwnens
755370eff0 Merge remote-tracking branch 'remotes/origin/dev' into kilo 2021-05-07 14:46:08 -04:00
Jason Ertel
407ad51244 Merge pull request #4139 from Security-Onion-Solutions/issue/4081
FEATURE: Pivot from Alerts/Hunt to CyberChef #4081
2021-05-07 13:31:21 -04:00
Doug Burks
293fb0a76d FEATURE: Pivot from Alerts/Hunt to CyberChef #4081 2021-05-07 13:23:46 -04:00
Doug Burks
2e228c8355 FEATURE: Pivot from Alerts/Hunt to CyberChef #4081 2021-05-07 13:22:03 -04:00
m0duspwnens
009f7617c1 check salt-master is responding 2021-05-07 12:47:22 -04:00
m0duspwnens
b39c8c1f1f exit after 50 tries if manager cant connect to iteself via salt 2021-05-07 11:02:23 -04:00
William Wernert
7b29c6427b Add preliminary error handling in soup 2021-05-07 10:55:17 -04:00
m0duspwnens
d0e084b8ea change command to test if salt-master is accepting connections 2021-05-07 10:20:04 -04:00
m0duspwnens
46223e0b30 add quotes around minionid 2021-05-07 08:59:47 -04:00
m0duspwnens
5d3b147b42 change retry command 2021-05-06 20:32:26 -04:00
m0duspwnens
6474c296e1 dont need to specify dest rp 2021-05-06 20:26:13 -04:00
m0duspwnens
b8ad80ae35 update comment 2021-05-06 17:49:40 -04:00
m0duspwnens
78240b4b52 change retry command 2021-05-06 17:49:02 -04:00
m0duspwnens
e7c716ede4 merge with dev, use retry to check if manager up instead of sleep in soup 2021-05-06 16:44:34 -04:00
m0duspwnens
da528e802f ensure migration script doesnt migrate the current days data and fix downsample cq to move from so_short_term rp 2021-05-06 12:52:47 -04:00
Josh Brower
23b4327c28 Merge pull request #4072 from petiepooo/fix-sleep
fix 5-second sleep
2021-05-06 12:48:34 -04:00
William Wernert
9f6dfa4d2e Merge pull request #4112 from Security-Onion-Solutions/master
Bring hotfix changes into dev
2021-05-06 10:44:25 -04:00
Wes Lambert
728d1f7540 Make Zeek and Suricata great again 2021-05-06 14:06:17 +00:00
Wes Lambert
ee92ba20b0 Add modules path reference 2021-05-06 13:56:39 +00:00
Wes Lambert
1b749cf004 Additional config 2021-05-06 13:55:07 +00:00
Wes Lambert
37929dbd7d Add additional config for Filebeat modules 2021-05-06 13:54:28 +00:00
Wes Lambert
865ba912f8 Merge remote-tracking branch 'remotes/origin/dev' into pipeline 2021-05-06 13:19:31 +00:00
m0duspwnens
9dbb9f519b create so_short_term rp as default so that autogen can just be dropped once data is downsampled 2021-05-06 09:14:49 -04:00
m0duspwnens
20188549f7 add the logic for so-influxdb-migrate 2021-05-05 19:28:16 -04:00
m0duspwnens
925be17d51 clean some commas in so-influxdb-clean 2021-05-05 15:59:18 -04:00
m0duspwnens
0ea4c99102 remove support for months as it isnt supported in InfluxQL 2021-05-05 15:32:53 -04:00
m0duspwnens
db98b7ed27 verify with user before proceedig to clean 2021-05-05 15:08:11 -04:00
m0duspwnens
44de611097 rename to so-influxdb-clean 2021-05-05 14:57:39 -04:00
m0duspwnens
a5ee8fb59d fix the issues with so-influxdb-clear 2021-05-05 14:56:53 -04:00
m0duspwnens
e532804474 move to proper dir 2021-05-05 13:42:21 -04:00
m0duspwnens
ce24781446 first take at so-infludb-clean 2021-05-05 13:29:24 -04:00
weslambert
c867d6648a Merge pull request #4098 from Security-Onion-Solutions/delta
Add ignore above for message keyword field
2021-05-05 08:53:39 -04:00
m0duspwnens
8ae5ae7e57 Merge remote-tracking branch 'remotes/origin/dev' into issue/3264 2021-05-05 08:33:47 -04:00
m0duspwnens
6a639edb05 have cq created once again 2021-05-05 08:33:31 -04:00
Wes Lambert
a1a79719fc Add ignore above for message keyword field 2021-05-05 12:07:30 +00:00
m0duspwnens
c5f99b012e comment out creation of cq to test data migration 2021-05-04 13:58:53 -04:00
m0duspwnens
fcd1bea4a3 remove auto data migration, change duration from 0s to 0d 2021-05-04 12:06:03 -04:00
Mike Reeves
0622c77a7f Add filebeat modules 2021-05-04 10:50:13 -04:00
Mike Reeves
8aaf3e1052 Merge branch 'dev' of https://github.com/Security-Onion-Solutions/securityonion into dev 2021-05-04 10:44:13 -04:00
m0duspwnens
3dcaa1f6fb more logging for influxdb migration 2021-05-04 10:37:25 -04:00
m0duspwnens
2d91e509fa update wording 2021-05-04 10:34:13 -04:00
m0duspwnens
a0f1839162 run in background 2021-05-04 09:59:16 -04:00
m0duspwnens
e2f52765e4 add newline 2021-05-04 09:34:42 -04:00
m0duspwnens
f186a3dde9 make sure user sees influxdb migration message by requiring enter to be pressed to continue 2021-05-04 09:30:38 -04:00
m0duspwnens
9b065155f4 log iunfluxdb migration to new log 2021-05-04 08:56:13 -04:00
m0duspwnens
12306368cf add post upgrade function for 2.3.60 soup to migrate influxdb data 2021-05-04 08:37:52 -04:00
weslambert
d4e8ea8e72 Merge pull request #4079 from Security-Onion-Solutions/delta
Add event_data to common template so elastalert/playbook event_data f…
2021-05-03 13:45:17 -04:00
Wes Lambert
619402cc67 Add event_data to common template so elastalert/playbook event_data fields can be indexed and searchable 2021-05-03 17:03:30 +00:00
m0duspwnens
b01bfda862 Merge remote-tracking branch 'remotes/origin/dev' into issue/3264 2021-05-03 11:49:09 -04:00
William Wernert
da19df5174 Merge pull request #4076 from Security-Onion-Solutions/issue/4004
Don't ask for node description on eval and import installs
2021-05-03 11:43:37 -04:00
William Wernert
19dd9b97d2 Don't ask for node description on eval and import installs 2021-05-03 09:40:53 -04:00
Mike Reeves
21b92ac077 Merge branch 'dev' of https://github.com/Security-Onion-Solutions/securityonion into dev 2021-05-02 13:06:29 -04:00
Pete
b80dd1ef3e fix 5-second sleep
using wait here instead of sleep tries to wait until pid 5 exits and generates the error
> /usr/sbin/so-playbook-reset: line 25: wait: pid 5 is not a child of this shell
2021-04-30 20:21:50 +00:00
m0duspwnens
d6b9154a88 change how version to be installed is defined to work with centos 2021-04-30 14:48:51 -04:00
m0duspwnens
f9573f7972 Merge remote-tracking branch 'remotes/origin/dev' into issue/3264 2021-04-30 13:33:47 -04:00
m0duspwnens
038cadeae8 change version to 2.3.60 to prepare to push to dev 2021-04-30 12:31:57 -04:00
m0duspwnens
e32ca284c5 ensure proper version of python3-influxdb is installed prior to running the states that require it 2021-04-30 11:10:31 -04:00
Mike Reeves
a56426010d Merge pull request #4057 from Security-Onion-Solutions/kilo 2021-04-29 17:46:26 -04:00
Jason Ertel
dda07af4d4 Update Kibana config defaults 2021-04-29 17:44:15 -04:00
Mike Reeves
81bfb202f7 Merge pull request #4055 from Security-Onion-Solutions/kilo 2021-04-29 15:37:34 -04:00
Jason Ertel
b6561fd8e2 Update defaultRoute with new path structure 2021-04-29 15:35:22 -04:00
m0duspwnens
d475e50bef add deps for ubuntu 2021-04-29 13:49:15 -04:00
m0duspwnens
689a01423f fix deps 2021-04-29 13:28:31 -04:00
m0duspwnens
888d637b67 add %} 2021-04-29 13:26:24 -04:00
m0duspwnens
e7660d68cb add %} 2021-04-29 13:25:29 -04:00
m0duspwnens
450a01784b support installing via pip for ubuntu 2021-04-29 13:22:31 -04:00
Mike Reeves
5d8cb511be Merge pull request #4046 from Security-Onion-Solutions/kilo
Switch to the ES-included community_id plugin
2021-04-29 12:11:44 -04:00
Jason Ertel
44ad8ce888 Switch to the ES-included community_id plugin 2021-04-29 12:08:07 -04:00
Jason Ertel
14572d9eab Merge pull request #4045 from Security-Onion-Solutions/ktbackup
Add Grid nodeid fix and Kratos backup to include Kratos
2021-04-29 11:55:46 -04:00
Mike Reeves
76d735ff43 Add ID Fix to nodeID 2021-04-29 11:49:20 -04:00
Mike Reeves
02b621bd2c Add Kratos to Backups 2021-04-29 11:29:07 -04:00
Mike Reeves
96eab86bc6 Merge branch 'dev' of https://github.com/Security-Onion-Solutions/securityonion into dev 2021-04-29 11:19:19 -04:00
m0duspwnens
93ee96b1cd Ignore "Status .* was not found" due to output from salt http.query or http.wait_for_successful_query states used with retry 2021-04-29 10:19:42 -04:00
m0duspwnens
907dbe6388 for for influx to be up so the reliant states dont fail 2021-04-29 08:47:33 -04:00
m0duspwnens
f8e01d5d53 let the state retry incase influxdb isnt fully up yet 2021-04-29 06:43:05 -04:00
m0duspwnens
454b541a2e merge with dev, change version so test box doesnt try to upgrade to 2.3.60 2021-04-28 18:04:14 -04:00
m0duspwnens
2b9b22cd90 Merge remote-tracking branch 'remotes/origin/dev' into issue/3264 2021-04-28 18:02:01 -04:00
m0duspwnens
5584c4f1ae define and install the dependencies for python36-influxdb 2021-04-28 18:01:33 -04:00
Mike Reeves
9830f661c8 Merge pull request #4031 from Security-Onion-Solutions/kilo
Remove unused and incorrectly formatted osraid metric
2021-04-28 13:34:57 -04:00
Jason Ertel
7a21c44727 Remove unused and incorrectly formatted osraid metric 2021-04-28 13:27:11 -04:00
Mike Reeves
4c55e5a6cc Merge branch 'dev' of https://github.com/Security-Onion-Solutions/securityonion into dev 2021-04-28 10:27:55 -04:00
Mike Reeves
f0012015e6 Merge pull request #4018 from Security-Onion-Solutions/TOoSmOotH-patch-2
Update raid.sh
2021-04-28 10:27:35 -04:00
Mike Reeves
14557983e1 Update raid.sh 2021-04-28 10:24:39 -04:00
Jason Ertel
865e5cb120 Merge pull request #4017 from Security-Onion-Solutions/TOoSmOotH-patch-1
Update VERSION
2021-04-28 10:19:07 -04:00
m0duspwnens
d9cb018a7d merge with dev, resolve conflicts 2021-04-28 10:19:01 -04:00
Mike Reeves
8dd9564171 Update VERSION 2021-04-28 10:17:37 -04:00
Mike Reeves
77533f7873 Repo Fix 2021-04-27 15:45:35 -04:00
Mike Reeves
a6b2eefee1 Prompt airgap to update 2021-04-27 15:33:52 -04:00
Mike Reeves
4cea08c080 Prompt airgap to update 2021-04-27 15:32:00 -04:00
Mike Reeves
d56e66917a 2.3.50 sig files 2021-04-26 09:18:15 -04:00
m0duspwnens
28982e0e0b fix requirement 2021-04-21 19:22:07 -04:00
m0duspwnens
1fbf77d090 fix state name 2021-04-21 18:53:00 -04:00
m0duspwnens
6c8a2e68d9 Merge remote-tracking branch 'remotes/origin/dev' into issue/3264 2021-04-21 18:24:07 -04:00
m0duspwnens
f5ddb084b6 create salt.helper-packages state, use it to install the patch package 2021-04-21 18:22:44 -04:00
m0duspwnens
21077ef26e undo path change 2021-04-21 18:09:11 -04:00
m0duspwnens
5cedf98f55 change path 2021-04-21 18:05:52 -04:00
m0duspwnens
a7247e9812 update package name 2021-04-21 17:17:49 -04:00
m0duspwnens
c9298137b5 adding docker-ce.repo to delete list 2021-04-21 17:08:35 -04:00
m0duspwnens
17c95723ec update package name 2021-04-21 16:44:40 -04:00
m0duspwnens
1f654d4444 fix the state apply 2021-04-21 12:04:58 -04:00
m0duspwnens
0a01d7b041 fix var 2021-04-21 11:14:13 -04:00
m0duspwnens
b53017ee87 ensure salt python modules are installed and patched during soup 2021-04-21 10:44:46 -04:00
m0duspwnens
af86a9dac0 handle different paths for salt states/modules based on os 2021-04-21 09:52:22 -04:00
m0duspwnens
d792c65ce3 change how influx is patch and python3-influxdb is installed 2021-04-21 09:25:25 -04:00
m0duspwnens
8eef574342 install python3-influxdb and create requires 2021-04-21 08:28:01 -04:00
m0duspwnens
2d0594398c Merge remote-tracking branch 'remotes/origin/dev' into issue/3264 2021-04-20 15:53:34 -04:00
m0duspwnens
115764ae38 merge with dev and fix merge conflict in so-functions https://github.com/Security-Onion-Solutions/securityonion/issues/3264 2021-04-20 10:03:15 -04:00
m0duspwnens
5cda35db0a change defaults for testing - https://github.com/Security-Onion-Solutions/securityonion/issues/3264 2021-04-01 10:45:54 -04:00
m0duspwnens
4f3b3a787c change defaults for testing, remove measurements list since cq uses wildcard now - https://github.com/Security-Onion-Solutions/securityonion/issues/3264 2021-04-01 10:18:29 -04:00
m0duspwnens
8e55e0b994 start graphing data from so_long_term 2021-03-30 13:36:52 -04:00
m0duspwnens
30c6d4756a change default long term resolution to 5m 2021-03-30 09:38:37 -04:00
m0duspwnens
d1150f150f loop through the rps 2021-03-29 10:59:18 -04:00
m0duspwnens
e0f4abaa09 try to do it with just 1 cq, modify defaults for testing 2021-03-29 10:36:56 -04:00
m0duspwnens
889e624a8c add shard_duration to state and defaults - https://github.com/Security-Onion-Solutions/securityonion/issues/3264 2021-03-25 09:33:10 -04:00
m0duspwnens
cd0ab5c709 add support for shard_duration to influxdb module and influxdb_retention_policy state - https://github.com/Security-Onion-Solutions/securityonion/issues/3264 2021-03-25 08:50:32 -04:00
m0duspwnens
d75fafb19c add support for shard_duration to influxdb module and influxdb_retention_policy state - https://github.com/Security-Onion-Solutions/securityonion/issues/3264 2021-03-24 17:30:27 -04:00
m0duspwnens
11c3f14b42 end patch files with newline 2021-03-24 10:35:20 -04:00
m0duspwnens
53528d486c remove minio 2021-03-24 09:44:56 -04:00
m0duspwnens
3a8aea0de6 removing domainstats and freqserver from so-image-common 2021-03-24 09:11:48 -04:00
m0duspwnens
a3e11f017b merge with 2.3.40 2021-03-23 14:34:52 -04:00
m0duspwnens
c4da576030 ensure the presence of the telegraf database 2021-03-11 12:20:32 -05:00
m0duspwnens
465253a769 Merge remote-tracking branch 'remotes/origin/dev' into issue/3264 2021-03-11 10:55:19 -05:00
m0duspwnens
3b74d987c1 fix retry in ca state. add subjectAltName to influxdb.crt 2021-03-11 10:49:15 -05:00
m0duspwnens
3385ba2ca2 verify ssl 2021-03-11 09:35:54 -05:00
m0duspwnens
6dba2879c5 change so_long_term rp to 6h for tetsing 2021-03-11 09:25:44 -05:00
m0duspwnens
8fc1656939 fix timeouts / retries in ssl state 2021-03-11 09:24:57 -05:00
m0duspwnens
75012cdcba create rps and cqs 2021-03-10 15:20:11 -05:00
m0duspwnens
c1e4c4cb30 fix pip and python-influxdb install 2021-03-09 11:50:27 -05:00
m0duspwnens
a3a0af64ce Merge remote-tracking branch 'remotes/origin/dev' into issue/3264 2021-03-09 10:34:39 -05:00
m0duspwnens
1f9e5ca3cc install influxdb python module add test retention policies 2021-03-09 10:31:59 -05:00
m0duspwnens
7409f15752 update all grafana queries that were using autogen to use default 2021-03-05 13:59:29 -05:00
144 changed files with 16423 additions and 1932 deletions

39
CONTRIBUTING.md Normal file
View File

@@ -0,0 +1,39 @@
# Contributing to Security Onion
### Questions, suggestions, and general comments
* Security Onion uses GitHub's [Discussions](https://github.com/Security-Onion-Solutions/securityonion/discussions) to provide a forum where the community and developers can interact as well as ask and answer questions.
### Reporting a bug
* The primary place to report unexpected behavior or possible bugs is the repo's [Discussions forum](https://github.com/Security-Onion-Solutions/securityonion/discussions).
* **If you are familiar with the current version of Security Onion and are confident you've discovered a bug**, first ensure there is not already an issue present by searching the open [issues](https://github.com/Security-Onion-Solutions/securityonion/issues). If there is, a thumbs up :+1: is a great way to show this bug is affecting you too.
* If an issue doesn't exist, [open a new one](https://github.com/Security-Onion-Solutions/securityonion/issues/new), following the directions in the issue template. This means including:
* **System information** and how Security Onion was installed
* **Log files** relevant to the bug report
* **Reproduction steps**
### 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:
<img src="./assets/images/verified-commit-1.png" width="450">
* If an issue does not already exist for the bug or feature for which you are submitting a pull request, [create one](https://github.com/Security-Onion-Solutions/securityonion/issues/new) with the relevant prefix. (**`FIX:`** for bug fixes, **`FEATURE:`** for new features.)
* Link the PR to the related issue, either using [keywords](https://docs.github.com/en/issues/tracking-your-work-with-issues/creating-issues/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword) in the PR description, or [manually](https://docs.github.com/en/issues/tracking-your-work-with-issues/creating-issues/linking-a-pull-request-to-an-issue#manually-linking-a-pull-request-to-an-issue).
* **Pull requests should be opened against the `dev` branch of this repo**, and should clearly describe the problem and solution.
* Be sure you have tested your changes and are confident they will not break other parts of the product.
* See this document's [code styling and conventions section](#code-style-and-conventions) below to be sure your PR fits our code requirements prior to submitting.
### Code style and conventions
* **Keep code [DRY](https://en.wikipedia.org/wiki/Don%27t_repeat_yourself)**. For example, Bash code used by multiple scripts will likely best be added to <span style="white-space: nowrap;">[`so-common`](salt/common/tools/sbin/so-common)</span>.
* All new Bash code should pass [ShellCheck](https://www.shellcheck.net/) analysis. Where errors can be *safely* [ignored](https://github.com/koalaman/shellcheck/wiki/Ignore), the relevant disable directive should be accompanied by a brief explanation as to why the error is being ignored.
* **Ensure all YAML (this includes Salt states and pillars) is properly formatted**. The spec for YAML v1.2 can be found [here](https://yaml.org/spec/1.2/spec.html), however there are numerous online resources with simpler descriptions of its formatting rules.

1
HOTFIX
View File

@@ -0,0 +1 @@
ECSFIX

View File

@@ -1,14 +1,14 @@
## Security Onion 2.3.51
## Security Onion 2.3.60
Security Onion 2.3.51 is here!
Security Onion 2.3.60 is here!
## Screenshots
Alerts
![Alerts](https://raw.githubusercontent.com/security-onion-solutions/securityonion/master/screenshots/alerts-1.png)
![Alerts](./assets/images/screenshots/alerts-1.png)
Hunt
![Hunt](https://raw.githubusercontent.com/security-onion-solutions/securityonion/master/screenshots/hunt-1.png)
![Hunt](./assets/images/screenshots/hunt-1.png)
### Release Notes

21
SECURITY.md Normal file
View File

@@ -0,0 +1,21 @@
# Security Policy
## Supported Versions
| Version | Supported |
| ------- | ------------------ |
| 2.x.x | :white_check_mark: |
| 16.04.x | :x: |
Security Onion 16.04 has reached End Of Life and is no longer supported.
## Reporting a Vulnerability
If you have any security concerns regarding Security Onion or believe you have uncovered a vulnerability, please follow these steps:
- send an email to security@securityonion.net
- include a description of the issue and steps to reproduce
- please use plain text format (no Word documents or PDF files)
- please do not disclose publicly until we have had sufficient time to resolve the issue
This security address should be used only for undisclosed vulnerabilities. Dealing with fixed issues or general questions on how to use Security Onion should be handled via the normal support channels.

View File

@@ -1,17 +1,18 @@
### 2.3.51 ISO image built on 2021/04/27
### 2.3.60-ECSFIX ISO image built on 2021/07/02
### Download and Verify
2.3.51 ISO image:
https://download.securityonion.net/file/securityonion/securityonion-2.3.51.iso
2.3.60-ECSFIX ISO image:
https://download.securityonion.net/file/securityonion/securityonion-2.3.60-ECSFIX.iso
MD5: 7CFB525BEFC0A9F2ED148F5831E387FA
SHA1: 8CC34FCCC36822B309B8168AA706B3D1EC7F3BFD
SHA256: 9892C2546C9AE5A48015160F379B070F0BE30C89693B97F3F1E1592DDCE1DEE0
MD5: BCD2C449BD3B65D96A0D1E479C0414F9
SHA1: 18FB8F33C19980992B291E5A7EC23D5E13853933
SHA256: AD3B750E7FC4CA0D58946D8FEB703AE9B01508E314967566B06CFE5D8A8086E9
Signature for ISO image:
https://github.com/Security-Onion-Solutions/securityonion/raw/master/sigs/securityonion-2.3.51.iso.sig
https://github.com/Security-Onion-Solutions/securityonion/raw/master/sigs/securityonion-2.3.60-ECSFIX.iso.sig
Signing key:
https://raw.githubusercontent.com/Security-Onion-Solutions/securityonion/master/KEYS
@@ -25,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.51.iso.sig
wget https://github.com/Security-Onion-Solutions/securityonion/raw/master/sigs/securityonion-2.3.60-ECSFIX.iso.sig
```
Download the ISO image:
```
wget https://download.securityonion.net/file/securityonion/securityonion-2.3.51.iso
wget https://download.securityonion.net/file/securityonion/securityonion-2.3.60-ECSFIX.iso
```
Verify the downloaded ISO image using the signature file:
```
gpg --verify securityonion-2.3.51.iso.sig securityonion-2.3.51.iso
gpg --verify securityonion-2.3.60-ECSFIX.iso.sig securityonion-2.3.60-ECSFIX.iso
```
The output should show "Good signature" and the Primary key fingerprint should match what's shown below:
```
gpg: Signature made Thu 20 May 2021 07:49:57 AM EDT using RSA key ID FE507013
gpg: Signature made Fri 02 Jul 2021 10:15:04 AM EDT 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.51
2.3.60

View File

Before

Width:  |  Height:  |  Size: 245 KiB

After

Width:  |  Height:  |  Size: 245 KiB

View File

Before

Width:  |  Height:  |  Size: 168 KiB

After

Width:  |  Height:  |  Size: 168 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

View File

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

View File

@@ -7,6 +7,7 @@ logstash:
- so/9000_output_zeek.conf.jinja
- so/9002_output_import.conf.jinja
- so/9034_output_syslog.conf.jinja
- so/9050_output_filebeatmodules.conf.jinja
- so/9100_output_osquery.conf.jinja
- so/9400_output_suricata.conf.jinja
- so/9500_output_beats.conf.jinja

View File

@@ -22,6 +22,9 @@ base:
'*_manager or *_managersearch':
- match: compound
- data.*
{% if salt['file.file_exists']('/opt/so/saltstack/local/pillar/elasticsearch/auth.sls') %}
- elasticsearch.auth
{% endif %}
- secrets
- global
- minions.{{ grains.id }}
@@ -38,6 +41,9 @@ base:
- secrets
- healthcheck.eval
- elasticsearch.eval
{% if salt['file.file_exists']('/opt/so/saltstack/local/pillar/elasticsearch/auth.sls') %}
- elasticsearch.auth
{% endif %}
- global
- minions.{{ grains.id }}
@@ -46,6 +52,9 @@ base:
- logstash.manager
- logstash.search
- elasticsearch.search
{% if salt['file.file_exists']('/opt/so/saltstack/local/pillar/elasticsearch/auth.sls') %}
- elasticsearch.auth
{% endif %}
- data.*
- zeeklogs
- secrets
@@ -59,6 +68,7 @@ base:
'*_heavynode':
- zeeklogs
- elasticsearch.auth
- global
- minions.{{ grains.id }}
@@ -80,6 +90,7 @@ base:
- logstash
- logstash.search
- elasticsearch.search
- elasticsearch.auth
- global
- minions.{{ grains.id }}
- data.nodestab
@@ -88,5 +99,8 @@ base:
- zeeklogs
- secrets
- elasticsearch.eval
{% if salt['file.file_exists']('/opt/so/saltstack/local/pillar/elasticsearch/auth.sls') %}
- elasticsearch.auth
{% endif %}
- global
- minions.{{ grains.id }}
- minions.{{ grains.id }}

View File

@@ -52,5 +52,4 @@ zeek:
- frameworks/signatures/detect-windows-shells
redef:
- LogAscii::use_json = T;
- LogAscii::json_timestamps = JSON::TS_ISO8601;
- CaptureLoss::watch_interval = 5 mins;
- CaptureLoss::watch_interval = 5 mins;

View File

@@ -2,6 +2,7 @@
{% if sls in allowed_states %}
{% set role = grains.id.split('_') | last %}
{% from 'elasticsearch/auth.map.jinja' import ELASTICAUTH with context %}
# Remove variables.txt from /tmp - This is temp
rmvariablesfile:
@@ -95,7 +96,6 @@ commonpkgs:
- netcat
- python3-mysqldb
- sqlite3
- argon2
- libssl-dev
- python3-dateutil
- python3-m2crypto
@@ -128,7 +128,6 @@ commonpkgs:
- net-tools
- curl
- sqlite
- argon2
- mariadb-devel
- nmap-ncat
- python3
@@ -169,6 +168,14 @@ alwaysupdated:
Etc/UTC:
timezone.system
elastic_curl_config:
file.managed:
- name: /opt/so/conf/elasticsearch/curl.config
- source: salt://elasticsearch/curl.config
- mode: 600
- show_changes: False
- makedirs: True
# Sync some Utilities
utilsyncscripts:
file.recurse:
@@ -178,6 +185,10 @@ utilsyncscripts:
- file_mode: 755
- template: jinja
- source: salt://common/tools/sbin
- defaults:
ELASTICCURL: 'curl'
- context:
ELASTICCURL: {{ ELASTICAUTH.elasticcurl }}
{% if role in ['eval', 'standalone', 'sensor', 'heavynode'] %}
# Add sensor cleanup

0
salt/common/tools/sbin/so-airgap-hotfixapply Normal file → Executable file
View File

0
salt/common/tools/sbin/so-airgap-hotfixdownload Normal file → Executable file
View File

View File

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

View File

@@ -88,19 +88,6 @@ add_interface_bond0() {
fi
}
check_airgap() {
# See if this is an airgap install
AIRGAP=$(cat /opt/so/saltstack/local/pillar/global.sls | grep airgap: | awk '{print $2}')
if [[ "$AIRGAP" == "True" ]]; then
is_airgap=0
UPDATE_DIR=/tmp/soagupdate/SecurityOnion
AGDOCKER=/tmp/soagupdate/docker
AGREPO=/tmp/soagupdate/Packages
else
is_airgap=1
fi
}
check_container() {
docker ps | grep "$1:" > /dev/null 2>&1
return $?
@@ -153,16 +140,16 @@ Do you agree to the terms of the Elastic License?
If so, type AGREE to accept the Elastic License and continue. Otherwise, press Enter to exit this program without making any changes.
EOM
AGREED=$(whiptail --title "Security Onion Setup" --inputbox \
"$message" 20 75 3>&1 1>&2 2>&3)
AGREED=$(whiptail --title "$whiptail_title" --inputbox \
"$message" 20 75 3>&1 1>&2 2>&3)
if [ "${AGREED^^}" = 'AGREE' ]; then
mkdir -p /opt/so/state
touch /opt/so/state/yeselastic.txt
else
echo "Starting in 2.3.40 you must accept the Elastic license if you want to run Security Onion."
exit 1
fi
if [ "${AGREED^^}" = 'AGREE' ]; then
mkdir -p /opt/so/state
touch /opt/so/state/yeselastic.txt
else
echo "Starting in 2.3.40 you must accept the Elastic license if you want to run Security Onion."
exit 1
fi
}
@@ -252,6 +239,7 @@ lookup_salt_value() {
key=$1
group=$2
kind=$3
output=${4:-newline_values_only}
if [ -z "$kind" ]; then
kind=pillar
@@ -261,7 +249,7 @@ lookup_salt_value() {
group=${group}:
fi
salt-call --no-color ${kind}.get ${group}${key} --out=newline_values_only
salt-call --no-color ${kind}.get ${group}${key} --out=${output}
}
lookup_pillar() {
@@ -289,7 +277,7 @@ lookup_role() {
require_manager() {
if is_manager_node; then
echo "This is a manager, We can proceed."
echo "This is a manager, so we can proceed."
else
echo "Please run this command on the manager; the manager controls the grid."
exit 1
@@ -302,6 +290,7 @@ retry() {
cmd=$3
expectedOutput=$4
attempt=0
local exitcode=0
while [[ $attempt -lt $maxAttempts ]]; do
attempt=$((attempt+1))
echo "Executing command with retry support: $cmd"
@@ -321,7 +310,29 @@ retry() {
sleep $sleepDelay
done
echo "Command continues to fail; giving up."
return 1
return $exitcode
}
run_check_net_err() {
local cmd=$1
local err_msg=${2:-"Unknown error occured, please check /root/$WHATWOULDYOUSAYYAHDOHERE.log for details."} # Really need to rename that variable
local no_retry=$3
local exit_code
if [[ -z $no_retry ]]; then
retry 5 60 "$cmd"
exit_code=$?
else
eval "$cmd"
exit_code=$?
fi
if [[ $exit_code -ne 0 ]]; then
ERR_HANDLED=true
[[ -z $no_retry ]] || echo "Command failed with error $exit_code"
echo "$err_msg"
exit $exit_code
fi
}
set_os() {
@@ -486,13 +497,14 @@ wait_for_web_response() {
url=$1
expected=$2
maxAttempts=${3:-300}
curlcmd=${4:-curl}
logfile=/root/wait_for_web_response.log
truncate -s 0 "$logfile"
attempt=0
while [[ $attempt -lt $maxAttempts ]]; do
attempt=$((attempt+1))
echo "Waiting for value '$expected' at '$url' ($attempt/$maxAttempts)"
result=$(curl -ks -L $url)
result=$($curlcmd -ks -L $url)
exitcode=$?
echo "--------------------------------------------------" >> $logfile

View File

@@ -35,6 +35,7 @@ if [ ! -f $BACKUPFILE ]; then
{%- endfor %}
tar -rf $BACKUPFILE /etc/pki
tar -rf $BACKUPFILE /etc/salt
tar -rf $BACKUPFILE /opt/so/conf/kratos
fi

View File

@@ -32,19 +32,25 @@ def get_image_version(string) -> str:
ver = string.split(':')[-1]
if ver == 'latest':
# Version doesn't like "latest", so use a high semver
return '999999.9.9'
return '99999.9.9'
else:
try:
Version(ver)
except InvalidVersion:
# Strip the last substring following a hyphen for automated branches
ver = '-'.join(ver.split('-')[:-1])
# Also return a very high semver for any version
# with a dash in it since it will likely be a dev version of some kind
if '-' in ver:
return '999999.9.9'
return ver
def main(quiet):
client = docker.from_env()
# Prune old/stopped containers
if not quiet: print('Pruning old containers')
client.containers.prune()
image_list = client.images.list(filters={ 'dangling': False })
# Map list of image objects to flattened list of tags (format: "name:version")
@@ -72,9 +78,16 @@ def main(quiet):
for group in grouped_t_list[2:]:
for tag in group:
if not quiet: print(f'Removing image {tag}')
client.images.remove(tag)
except InvalidVersion as e:
print(f'so-{get_so_image_basename(t_list[0])}: {e.args[0]}', file=sys.stderr)
try:
client.images.remove(tag, force=True)
except docker.errors.ClientError as e:
print(f'Could not remove image {tag}, continuing...')
except (docker.errors.APIError, InvalidVersion) as e:
print(f'so-{get_so_image_basename(t_list[0])}: {e}', file=sys.stderr)
exit(1)
except Exception as e:
print('Unhandled exception occurred:')
print(f'so-{get_so_image_basename(t_list[0])}: {e}', file=sys.stderr)
exit(1)
if no_prunable and not quiet:
@@ -86,4 +99,4 @@ if __name__ == "__main__":
main_parser.add_argument('-q', '--quiet', action='store_const', const=True, required=False)
args = main_parser.parse_args(sys.argv[1:])
main(args.quiet)
main(args.quiet)

View File

@@ -145,9 +145,9 @@ EOF
rulename=$(echo ${raw_rulename,,} | sed 's/ /_/g')
cat << EOF >> "$rulename.yaml"
# Elasticsearch Host
es_host: elasticsearch
es_port: 9200
# Elasticsearch Host Override (optional)
# es_host: elasticsearch
# es_port: 9200
# (Required)
# Rule name, must be unique

View File

@@ -0,0 +1,67 @@
#!/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/>.
if [ -f "/usr/sbin/so-common" ]; then
. /usr/sbin/so-common
fi
ES_AUTH_PILLAR=${ELASTIC_AUTH_PILLAR:-/opt/so/saltstack/local/pillar/elasticsearch/auth.sls}
ES_USERS_FILE=${ELASTIC_USERS_FILE:-/opt/so/saltstack/local/salt/elasticsearch/files/users}
authEnable=$1
if ! grep -q "enabled: " "$ES_AUTH_PILLAR"; then
echo "Elastic auth pillar file is invalid. Unable to proceed."
exit 1
fi
function restart() {
if [[ -z "$ELASTIC_AUTH_SKIP_HIGHSTATE" ]]; then
echo "Elasticsearch on all affected minions will now be stopped and then restarted..."
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' cmd.run so-elastic-stop queue=True
echo "Applying highstate to all affected minions..."
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.highstate queue=True
fi
}
if [[ "$authEnable" == "true" ]]; then
if grep -q "enabled: False" "$ES_AUTH_PILLAR"; then
sed -i 's/enabled: False/enabled: True/g' "$ES_AUTH_PILLAR"
restart
echo "Elastic auth is now enabled."
if grep -q "argon" "$ES_USERS_FILE"; then
echo ""
echo "IMPORTANT: The following users will need to change their password, after logging into SOC, in order to access Kibana:"
grep argon "$ES_USERS_FILE" | cut -d ":" -f 1
fi
else
echo "Auth is already enabled."
fi
elif [[ "$authEnable" == "false" ]]; then
if grep -q "enabled: True" "$ES_AUTH_PILLAR"; then
sed -i 's/enabled: True/enabled: False/g' "$ES_AUTH_PILLAR"
restart
echo "Elastic auth is now disabled."
else
echo "Auth is already disabled."
fi
else
echo "Usage: $0 <true|false>"
echo ""
echo "Toggles Elastic authentication. Elasticsearch will be restarted on each affected minion."
echo ""
fi

View File

@@ -50,7 +50,7 @@ done
if [ $SKIP -ne 1 ]; then
# List indices
echo
curl -k -L https://{{ NODEIP }}:9200/_cat/indices?v
{{ ELASTICCURL }} -k -L https://{{ NODEIP }}:9200/_cat/indices?v
echo
# Inform user we are about to delete all data
echo
@@ -89,10 +89,10 @@ fi
# Delete data
echo "Deleting data..."
INDXS=$(curl -s -XGET -k -L https://{{ NODEIP }}:9200/_cat/indices?v | egrep 'logstash|elastalert|so-' | awk '{ print $3 }')
INDXS=$({{ ELASTICCURL }} -s -XGET -k -L https://{{ NODEIP }}:9200/_cat/indices?v | egrep 'logstash|elastalert|so-' | awk '{ print $3 }')
for INDX in ${INDXS}
do
curl -XDELETE -k -L https://"{{ NODEIP }}:9200/${INDX}" > /dev/null 2>&1
{{ ELASTICCURL }} -XDELETE -k -L https://"{{ NODEIP }}:9200/${INDX}" > /dev/null 2>&1
done
#Start Logstash/Filebeat

View File

@@ -18,4 +18,4 @@
. /usr/sbin/so-common
curl -s -k -L https://{{ NODEIP }}:9200/_cat/indices?pretty
{{ ELASTICCURL }} -s -k -L https://{{ NODEIP }}:9200/_cat/indices?pretty

View File

@@ -21,5 +21,5 @@ THEHIVEESPORT=9400
echo "Removing read only attributes for indices..."
echo
curl -s -k -XPUT -H "Content-Type: application/json" -L https://$IP:9200/_all/_settings -d '{"index.blocks.read_only_allow_delete": null}' 2>&1 | if grep -q ack; then echo "Index settings updated..."; else echo "There was any issue updating the read-only attribute. Please ensure Elasticsearch is running.";fi;
curl -XPUT -H "Content-Type: application/json" -L http://$IP:9400/_all/_settings -d '{"index.blocks.read_only_allow_delete": null}' 2>&1 | if grep -q ack; then echo "Index settings updated..."; else echo "There was any issue updating the read-only attribute. Please ensure Elasticsearch is running.";fi;
{{ ELASTICCURL }} -s -k -XPUT -H "Content-Type: application/json" -L https://$IP:9200/_all/_settings -d '{"index.blocks.read_only_allow_delete": null}' 2>&1 | if grep -q ack; then echo "Index settings updated..."; else echo "There was any issue updating the read-only attribute. Please ensure Elasticsearch is running.";fi;
{{ ELASTICCURL }} -XPUT -H "Content-Type: application/json" -L http://$IP:9400/_all/_settings -d '{"index.blocks.read_only_allow_delete": null}' 2>&1 | if grep -q ack; then echo "Index settings updated..."; else echo "There was any issue updating the read-only attribute. Please ensure Elasticsearch is running.";fi;

View File

@@ -19,7 +19,7 @@
. /usr/sbin/so-common
if [ "$1" == "" ]; then
curl -s -k -L https://{{ NODEIP }}:9200/_nodes/stats | jq .nodes | jq ".[] | .ingest.pipelines"
{{ ELASTICCURL }} -s -k -L https://{{ NODEIP }}:9200/_nodes/stats | jq .nodes | jq ".[] | .ingest.pipelines"
else
curl -s -k -L https://{{ NODEIP }}:9200/_nodes/stats | jq .nodes | jq ".[] | .ingest.pipelines.\"$1\""
{{ ELASTICCURL }} -s -k -L https://{{ NODEIP }}:9200/_nodes/stats | jq .nodes | jq ".[] | .ingest.pipelines.\"$1\""
fi

View File

@@ -19,7 +19,7 @@
. /usr/sbin/so-common
if [ "$1" == "" ]; then
curl -s -k -L https://{{ NODEIP }}:9200/_ingest/pipeline/* | jq .
{{ ELASTICCURL }} -s -k -L https://{{ NODEIP }}:9200/_ingest/pipeline/* | jq .
else
curl -s -k -L https://{{ NODEIP }}:9200/_ingest/pipeline/$1 | jq .
{{ ELASTICCURL }} -s -k -L https://{{ NODEIP }}:9200/_ingest/pipeline/$1 | jq .[]
fi

View File

@@ -17,7 +17,7 @@
{%- set NODEIP = salt['pillar.get']('elasticsearch:mainip', '') -%}
. /usr/sbin/so-common
if [ "$1" == "" ]; then
curl -s -k -L https://{{ NODEIP }}:9200/_ingest/pipeline/* | jq 'keys'
{{ ELASTICCURL }} -s -k -L https://{{ NODEIP }}:9200/_ingest/pipeline/* | jq 'keys'
else
curl -s -k -L https://{{ NODEIP }}:9200/_ingest/pipeline/$1 | jq
{{ ELASTICCURL }} -s -k -L https://{{ NODEIP }}:9200/_ingest/pipeline/$1 | jq
fi

View File

@@ -0,0 +1,37 @@
#!/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
if [[ $# -lt 1 ]]; then
echo "Submit a cURL request to the local Security Onion Elasticsearch host."
echo ""
echo "Usage: $0 <PATH> [ARGS,...]"
echo ""
echo "Where "
echo " PATH represents the elastic function being requested."
echo " ARGS is used to specify additional, optional curl parameters."
echo ""
echo "Examples:"
echo " $0 /"
echo " $0 '*:so-*/_search' -d '{\"query\": {\"match_all\": {}},\"size\": 1}' | jq"
exit 1
fi
QUERYPATH=$1
shift
{{ ELASTICCURL }} -s -k -L -H "Content-Type: application/json" "https://localhost:9200/${QUERYPATH}" "$@"

View File

@@ -18,4 +18,4 @@
. /usr/sbin/so-common
curl -s -k -L https://{{ NODEIP }}:9200/_cat/shards?pretty
{{ ELASTICCURL }} -s -k -L https://{{ NODEIP }}:9200/_cat/shards?pretty

View File

@@ -18,4 +18,4 @@
. /usr/sbin/so-common
curl -s -k -L -XDELETE https://{{ NODEIP }}:9200/_template/$1
{{ ELASTICCURL }} -s -k -L -XDELETE https://{{ NODEIP }}:9200/_template/$1

View File

@@ -19,7 +19,7 @@
. /usr/sbin/so-common
if [ "$1" == "" ]; then
curl -s -k -L https://{{ NODEIP }}:9200/_template/* | jq .
{{ ELASTICCURL }} -s -k -L https://{{ NODEIP }}:9200/_template/* | jq .
else
curl -s -k -L https://{{ NODEIP }}:9200/_template/$1 | jq .
{{ ELASTICCURL }} -s -k -L https://{{ NODEIP }}:9200/_template/$1 | jq .
fi

View File

@@ -17,7 +17,7 @@
{%- set NODEIP = salt['pillar.get']('elasticsearch:mainip', '') -%}
. /usr/sbin/so-common
if [ "$1" == "" ]; then
curl -s -k -L https://{{ NODEIP }}:9200/_template/* | jq 'keys'
{{ ELASTICCURL }} -s -k -L https://{{ NODEIP }}:9200/_template/* | jq 'keys'
else
curl -s -k -L https://{{ NODEIP }}:9200/_template/$1 | jq
{{ ELASTICCURL }} -s -k -L https://{{ NODEIP }}:9200/_template/$1 | jq
fi

View File

@@ -1,8 +1,5 @@
{%- set mainint = salt['pillar.get']('host:mainint') %}
{%- set MYIP = salt['grains.get']('ip_interfaces:' ~ mainint)[0] %}
#!/bin/bash
# Copyright 2014,2015,2016,2017,2018,2019 Security Onion Solutions, LLC
# 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
@@ -17,6 +14,9 @@
# 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
@@ -30,7 +30,7 @@ echo -n "Waiting for ElasticSearch..."
COUNT=0
ELASTICSEARCH_CONNECTED="no"
while [[ "$COUNT" -le 240 ]]; do
curl -k --output /dev/null --silent --head --fail -L https://"$ELASTICSEARCH_HOST":"$ELASTICSEARCH_PORT"
{{ ELASTICCURL }} -k --output /dev/null --silent --head --fail -L https://"$ELASTICSEARCH_HOST":"$ELASTICSEARCH_PORT"
if [ $? -eq 0 ]; then
ELASTICSEARCH_CONNECTED="yes"
echo "connected!"
@@ -51,7 +51,7 @@ cd ${ELASTICSEARCH_TEMPLATES}
echo "Loading templates..."
for i in *; do TEMPLATE=$(echo $i | cut -d '-' -f2); echo "so-$TEMPLATE"; curl -k ${ELASTICSEARCH_AUTH} -s -XPUT -L https://${ELASTICSEARCH_HOST}:${ELASTICSEARCH_PORT}/_template/so-$TEMPLATE -H 'Content-Type: application/json' -d@$i 2>/dev/null; echo; done
for i in *; do TEMPLATE=$(echo $i | cut -d '-' -f2); echo "so-$TEMPLATE"; {{ ELASTICCURL }} -k ${ELASTICSEARCH_AUTH} -s -XPUT -L https://${ELASTICSEARCH_HOST}:${ELASTICSEARCH_PORT}/_template/so-$TEMPLATE -H 'Content-Type: application/json' -d@$i 2>/dev/null; echo; done
echo
cd - >/dev/null

View File

@@ -0,0 +1,5 @@
#!/bin/bash
. /usr/sbin/so-common
wait_for_web_response "https://localhost:9200/_cat/indices/.kibana*" "green open" 300 "{{ ELASTICCURL }}"

View File

@@ -0,0 +1,67 @@
#!/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
#ELASTICSEARCH_AUTH=""
# Define a default directory to load pipelines from
FB_MODULE_YML="/usr/share/filebeat/module-setup.yml"
# 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
echo "Testing to see if the pipelines are already applied"
ESVER=$({{ ELASTICCURL }} -sk https://"$ELASTICSEARCH_HOST":"$ELASTICSEARCH_PORT" |jq .version.number |tr -d \")
PIPELINES=$({{ ELASTICCURL }} -sk https://"$ELASTICSEARCH_HOST":"$ELASTICSEARCH_PORT"/_ingest/pipeline/filebeat-$ESVER-suricata-eve-pipeline | jq . | wc -c)
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
do
echo "Loading $MODULE"
docker exec -i so-filebeat filebeat setup modules -pipelines -modules $MODULE -c $FB_MODULE_YML
sleep 2
done
else
exit 0
fi

View File

@@ -18,6 +18,7 @@
# NOTE: This script depends on so-common
IMAGEREPO=security-onion-solutions
# shellcheck disable=SC2120
container_list() {
MANAGERCHECK=$1
@@ -128,13 +129,13 @@ update_docker_containers() {
mkdir -p $SIGNPATH >> "$LOG_FILE" 2>&1
# Let's make sure we have the public key
retry 50 10 "curl -sSL https://raw.githubusercontent.com/Security-Onion-Solutions/securityonion/master/KEYS -o $SIGNPATH/KEYS" >> "$LOG_FILE" 2>&1
run_check_net_err \
"curl --retry 5 --retry-delay 60 -sSL https://raw.githubusercontent.com/Security-Onion-Solutions/securityonion/master/KEYS -o $SIGNPATH/KEYS" \
"Could not pull signature key file, please ensure connectivity to https://raw.gihubusercontent.com" \
noretry >> "$LOG_FILE" 2>&1
result=$?
if [[ $result -eq 0 ]]; then
cat $SIGNPATH/KEYS | gpg --import - >> "$LOG_FILE" 2>&1
else
echo "Failed to pull signature key file: $result"
exit 1
fi
# Download the containers from the interwebs
@@ -148,14 +149,15 @@ update_docker_containers() {
# Pull down the trusted docker image
local image=$i:$VERSION$IMAGE_TAG_SUFFIX
retry 50 10 "docker pull $CONTAINER_REGISTRY/$IMAGEREPO/$image" >> "$LOG_FILE" 2>&1
run_check_net_err \
"docker pull $CONTAINER_REGISTRY/$IMAGEREPO/$image" \
"Could not pull $image, please ensure connectivity to $CONTAINER_REGISTRY" >> "$LOG_FILE" 2>&1
# Get signature
retry 50 10 "curl -A '$CURLTYPE/$CURRENTVERSION/$OS/$(uname -r)' https://sigs.securityonion.net/$VERSION/$i:$VERSION$IMAGE_TAG_SUFFIX.sig --output $SIGNPATH/$image.sig" >> "$LOG_FILE" 2>&1
if [[ $? -ne 0 ]]; then
echo "Unable to pull signature file for $image" >> "$LOG_FILE" 2>&1
exit 1
fi
run_check_net_err \
"curl --retry 5 --retry-delay 60 -A '$CURLTYPE/$CURRENTVERSION/$OS/$(uname -r)' https://sigs.securityonion.net/$VERSION/$i:$VERSION$IMAGE_TAG_SUFFIX.sig --output $SIGNPATH/$image.sig" \
"Could not pull signature file for $image, please ensure connectivity to https://sigs.securityonion.net " \
noretry >> "$LOG_FILE" 2>&1
# Dump our hash values
DOCKERINSPECT=$(docker inspect $CONTAINER_REGISTRY/$IMAGEREPO/$image)

View File

@@ -132,6 +132,8 @@ for PCAP in "$@"; do
PCAP_FIXED=`mktemp /tmp/so-import-pcap-XXXXXXXXXX.pcap`
echo "- attempting to recover corrupted PCAP file"
pcapfix "${PCAP}" "${PCAP_FIXED}"
# Make fixed file world readable since the Suricata docker container will runas a non-root user
chmod a+r "${PCAP_FIXED}"
PCAP="${PCAP_FIXED}"
TEMP_PCAPS+=(${PCAP_FIXED})
fi

View File

@@ -15,4 +15,4 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
curl -X GET -k -L "https://localhost:9200/_cat/indices?v&s=index"
{{ ELASTICCURL }} -X GET -k -L "https://localhost:9200/_cat/indices?v&s=index"

View File

@@ -0,0 +1,53 @@
#!/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
wdurregex="^[0-9]+w$"
ddurregex="^[0-9]+d$"
echo -e "\nThis script is used to reduce the size of InfluxDB by removing old data and retaining only the duration specified."
echo "The duration will need to be specified as an integer followed by the duration unit without a space."
echo -e "\nFor example, to purge all data but retain the past 12 weeks, specify 12w for the duration."
echo "The duration units are as follows:"
echo " w - week(s)"
echo " d - day(s)"
while true; do
echo ""
read -p 'Enter the duration of past data that you would like to retain: ' duration
duration=$(echo $duration | tr '[:upper:]' '[:lower:]')
if [[ "$duration" =~ $wdurregex ]] || [[ "$duration" =~ $ddurregex ]]; then
break
fi
echo -e "\nInvalid duration."
done
echo -e "\nInfluxDB will now be cleaned and leave only the past $duration worth of data."
read -r -p "Are you sure you want to continue? [y/N] " yorn
if [[ "$yorn" =~ ^([yY][eE][sS]|[yY])$ ]]; then
echo -e "\nCleaning InfluxDb and saving only the past $duration. This may could take several minutes depending on how much data needs to be cleaned."
if docker exec -t so-influxdb /bin/bash -c "influx -ssl -unsafeSsl -database telegraf -execute \"DELETE FROM /.*/ WHERE \"time\" >= '2020-01-01T00:00:00.0000000Z' AND \"time\" <= now() - $duration\""; then
echo -e "\nInfluxDb clean complete."
else
echo -e "\nSomething went wrong with cleaning InfluxDB. Please verify that the so-influxdb Docker container is running, and check the log at /opt/so/log/influxdb/influxdb.log for any details."
fi
else
echo -e "\nExiting as requested."
fi

View File

@@ -0,0 +1,63 @@
#!/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 role = grains.id.split('_') | last %}
{%- if role in ['manager', 'managersearch', 'eval', 'standalone'] %}
{%- import_yaml 'influxdb/defaults.yaml' as default_settings %}
{%- set influxdb = salt['grains.filter_by'](default_settings, default='influxdb', merge=salt['pillar.get']('influxdb', {})) %}
. /usr/sbin/so-common
echo -e "\nThis script is used to reduce the size of InfluxDB by downsampling old data into the so_long_term retention policy."
echo -e "\nInfluxDB will now be downsampled. This could take a few hours depending on how large the database is and hardware resources available."
read -r -p "Are you sure you want to continue? [y/N] " yorn
if [[ "$yorn" =~ ^([yY][eE][sS]|[yY])$ ]]; then
echo -e "\nDownsampling InfluxDb started at `date`. This may take several hours depending on how much data needs to be downsampled."
{% for dest_rp in influxdb.downsample.keys() -%}
{% for measurement in influxdb.downsample[dest_rp].get('measurements', []) -%}
day=0
startdate=`date`
while docker exec -t so-influxdb /bin/bash -c "influx -ssl -unsafeSsl -database telegraf -execute \"SELECT mean(*) INTO \"so_long_term\".\"{{measurement}}\" FROM \"autogen\".\"{{measurement}}\" WHERE \"time\" >= '2020-07-21T00:00:00.0000000Z' + ${day}d AND \"time\" <= '2020-07-21T00:00:00.0000000Z' + $((day+1))d GROUP BY time(5m),*\""; do
# why 2020-07-21?
migrationdate=`date -d "2020-07-21 + ${day} days" +"%y-%m-%d"`
echo "Downsampling of measurement: {{measurement}} from $migrationdate started at $startdate and completed at `date`."
newdaytomigrate=$(date -d "$migrationdate + 1 days" +"%s")
today=$(date +"%s")
if [ $newdaytomigrate -ge $today ]; then
break
else
((day=day+1))
startdate=`date`
echo -e "\nDownsampling the next day's worth of data for measurement: {{measurement}}."
fi
done
{% endfor -%}
{% endfor -%}
echo -e "\nInfluxDb data downsampling complete."
else
echo -e "\nExiting as requested."
fi
{%- else %}
echo -e "\nThis script can only be run on a node running InfluxDB."
{%- endif %}

View File

@@ -0,0 +1,34 @@
#!/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
echo -e "\nThis script is used to reduce the size of InfluxDB by dropping the autogen retention policy."
echo "If you want to retain historical data prior to 2.3.60, then this should only be run after you have downsampled your data using so-influxdb-downsample."
echo -e "\nThe autogen retention policy will now be dropped from InfluxDB."
read -r -p "Are you sure you want to continue? [y/N] " yorn
if [[ "$yorn" =~ ^([yY][eE][sS]|[yY])$ ]]; then
echo -e "\nDropping autogen retention policy."
if docker exec -t so-influxdb influx -format json -ssl -unsafeSsl -execute "drop retention policy autogen on telegraf"; then
echo -e "\nAutogen retention policy dropped from InfluxDb."
else
echo -e "\nSomething went wrong dropping then autogen retention policy from InfluxDB. Please verify that the so-influxdb Docker container is running, and check the log at /opt/so/log/influxdb/influxdb.log for any details."
fi
else
echo -e "\nExiting as requested."
fi

View File

@@ -23,7 +23,9 @@
KIBANA_HOST={{ MANAGER }}
KSO_PORT=5601
OUTFILE="saved_objects.ndjson"
curl -s -H 'kbn-xsrf: true' -H 'Content-Type: application/json' -XPOST -L $KIBANA_HOST:$KSO_PORT/api/saved_objects/_export -d '{ "type": [ "index-pattern", "config", "visualization", "dashboard", "search" ], "excludeExportDetails": false }' > $OUTFILE
SESSIONCOOKIE=$({{ ELASTICCURL }} -c - -X GET http://$KIBANA_HOST:$KSO_PORT/ | grep sid | awk '{print $7}')
{{ ELASTICCURL }} -b "sid=$SESSIONCOOKIE" -s -H 'kbn-xsrf: true' -H 'Content-Type: application/json' -XPOST -L $KIBANA_HOST:$KSO_PORT/api/saved_objects/_export -d '{ "type": [ "index-pattern", "config", "visualization", "dashboard", "search" ], "excludeExportDetails": false }' > $OUTFILE
# Clean up using PLACEHOLDER
sed -i "s/$KIBANA_HOST/PLACEHOLDER/g" $OUTFILE

View File

@@ -1,13 +1,13 @@
. /usr/sbin/so-common
wait_for_web_response "http://localhost:5601/app/kibana" "Elastic"
wait_for_web_response "http://localhost:5601/app/kibana" "Elastic" 300 "{{ ELASTICCURL }}"
## This hackery will be removed if using Elastic Auth ##
# Let's snag a cookie from Kibana
THECOOKIE=$(curl -c - -X GET http://localhost:5601/ | grep sid | awk '{print $7}')
SESSIONCOOKIE=$({{ ELASTICCURL }} -c - -X GET http://localhost:5601/ | grep sid | awk '{print $7}')
# Disable certain Features from showing up in the Kibana UI
echo
echo "Setting up default Space:"
curl -b "sid=$THECOOKIE" -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
echo
{{ 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
echo

View File

@@ -0,0 +1,26 @@
#!/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/>.
if [ $# -lt 2 ]; then
echo "Usage: $0 <steno-query> Output-Filename"
exit 1
fi
docker exec -it so-sensoroni scripts/stenoquery.sh "$1" -w /nsm/pcapout/$2.pcap
echo ""
echo "If successful, the output was written to: /nsm/pcapout/$2.pcap"

View File

@@ -22,5 +22,5 @@ salt-call state.apply playbook.db_init,playbook,playbook.automation_user_create
/usr/sbin/so-soctopus-restart
echo "Importing Plays - this will take some time...."
wait 5
/usr/sbin/so-playbook-ruleupdate
sleep 5
/usr/sbin/so-playbook-ruleupdate

View File

@@ -17,18 +17,6 @@
. /usr/sbin/so-common
#check_boss_raid() {
# BOSSBIN=/opt/boss/mvcli
# BOSSRC=$($BOSSBIN info -o vd | grep functional)
#
# if [[ $BOSSRC ]]; then
# # Raid is good
# BOSSRAID=0
# else
# BOSSRAID=1
# fi
#}
check_lsi_raid() {
# For use for LSI on Ubuntu
#MEGA=/opt/MegaRAID/MegeCli/MegaCli64
@@ -66,13 +54,11 @@ mkdir -p /opt/so/log/raid
{%- if grains['sosmodel'] in ['SOSMN', 'SOSSNNV'] %}
#check_boss_raid
check_software_raid
#echo "osraid=$BOSSRAID nsmraid=$SWRAID" > /opt/so/log/raid/status.log
echo "osraid=1 nsmraid=$SWRAID" > /opt/so/log/raid/status.log
echo "nsmraid=$SWRAID" > /opt/so/log/raid/status.log
{%- elif grains['sosmodel'] in ['SOS1000F', 'SOS1000', 'SOSSN7200', 'SOS10K', 'SOS4000'] %}
#check_boss_raid
check_lsi_raid
#echo "osraid=$BOSSRAID nsmraid=$LSIRAID" > /opt/so/log/raid/status.log
echo "osraid=1 nsmraid=$LSIRAID" > /opt/so/log/raid/status.log
echo "nsmraid=$LSIRAID" > /opt/so/log/raid/status.log
{%- else %}
exit 0
{%- endif %}

View File

@@ -23,6 +23,11 @@ TESTPCAP=$2
. /usr/sbin/so-common
if [ $# -lt 2 ]; then
echo "Usage: $0 <CustomRule> <TargetPCAP>"
exit 1
fi
echo ""
echo "==============="
echo "Running all.rules and $TESTRULE against the following pcap: $TESTPCAP"

View File

@@ -39,10 +39,18 @@ email=$2
kratosUrl=${KRATOS_URL:-http://127.0.0.1:4434}
databasePath=${KRATOS_DB_PATH:-/opt/so/conf/kratos/db/db.sqlite}
argon2Iterations=${ARGON2_ITERATIONS:-3}
argon2Memory=${ARGON2_MEMORY:-14}
argon2Parallelism=${ARGON2_PARALLELISM:-2}
argon2HashSize=${ARGON2_HASH_SIZE:-32}
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}
esUID=${ELASTIC_UID:-930}
esGID=${ELASTIC_GID:-930}
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 fail() {
msg=$1
@@ -58,7 +66,7 @@ function require() {
# Verify this environment is capable of running this script
function verifyEnvironment() {
require "argon2"
require "htpasswd"
require "jq"
require "curl"
require "openssl"
@@ -95,6 +103,16 @@ function validateEmail() {
fi
}
function hashPassword() {
password=$1
passwordHash=$(echo "${password}" | htpasswd -niBC $bcryptRounds SOUSER)
passwordHash=$(echo "$passwordHash" | cut -c 11-)
passwordHash="\$2a${passwordHash}" # still waiting for https://github.com/elastic/elasticsearch/issues/51132
echo "$passwordHash"
}
function updatePassword() {
identityId=$1
@@ -111,15 +129,125 @@ function updatePassword() {
if [[ -n $identityId ]]; then
# Generate password hash
salt=$(openssl rand -hex 8)
passwordHash=$(echo "${password}" | argon2 ${salt} -id -t $argon2Iterations -m $argon2Memory -p $argon2Parallelism -l $argon2HashSize -e)
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() {
filename=$1
tmpFile=${filename}
truncate -s 0 "$tmpFile"
chmod 600 "$tmpFile"
chown "${esUID}:${esGID}" "$tmpFile"
}
function syncElasticSystemUser() {
json=$1
userid=$2
usersFile=$3
user=$(echo "$json" | jq -r ".local.users.$userid.user")
pass=$(echo "$json" | jq -r ".local.users.$userid.pass")
[[ -z "$user" || -z "$pass" ]] && fail "Elastic auth credentials for system user '$userid' are missing"
hash=$(hashPassword "$pass")
echo "${user}:${hash}" >> "$usersFile"
}
function syncElasticSystemRole() {
json=$1
userid=$2
role=$3
rolesFile=$4
user=$(echo "$json" | jq -r ".local.users.$userid.user")
[[ -z "$user" ]] && fail "Elastic auth credentials for system user '$userid' are missing"
echo "${role}:${user}" >> "$rolesFile"
}
function syncElastic() {
echo "Syncing users between SOC and Elastic..."
usersTmpFile="${elasticUsersFile}.tmp"
rolesTmpFile="${elasticRolesFile}.tmp"
createElasticFile "${usersTmpFile}"
createElasticFile "${rolesTmpFile}"
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_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
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') " \
"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"
else
echo "Database file does not exist yet, skipping users export"
fi
if [[ -s "${usersTmpFile}" ]]; then
mv "${usersTmpFile}" "${elasticUsersFile}"
mv "${rolesTmpFile}" "${elasticRolesFile}"
if [[ -z "$SKIP_STATE_APPLY" ]]; then
echo "Elastic state will be re-applied to affected minions. This may take several minutes..."
echo "Applying elastic state to elastic minions at $(date)" >> /opt/so/log/soc/sync.log 2>&1
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 elasticsearch queue=True >> /opt/so/log/soc/sync.log 2>&1
fi
else
echo "Newly generated users/roles files are incomplete; aborting."
fi
}
function syncAll() {
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
return 1
fi
fi
syncElastic
return 0
}
function listUsers() {
response=$(curl -Ss -L ${kratosUrl}/identities)
[[ $? != 0 ]] && fail "Unable to communicate with Kratos"
@@ -208,12 +336,14 @@ case "${operation}" in
verifyEnvironment
[[ "$email" == "" ]] && fail "Email address must be provided"
lock
validateEmail "$email"
updatePassword
createUser "$email"
syncAll
echo "Successfully added new user to SOC"
check_container thehive && echo $password | so-thehive-user-add "$email"
check_container fleet && echo $password | so-fleet-user-add "$email"
check_container thehive && echo "$password" | so-thehive-user-add "$email"
check_container fleet && echo "$password" | so-fleet-user-add "$email"
;;
"list")
@@ -225,7 +355,9 @@ case "${operation}" in
verifyEnvironment
[[ "$email" == "" ]] && fail "Email address must be provided"
lock
updateUser "$email"
syncAll
echo "Successfully updated user"
;;
@@ -233,7 +365,9 @@ case "${operation}" in
verifyEnvironment
[[ "$email" == "" ]] && fail "Email address must be provided"
lock
updateStatus "$email" 'active'
syncAll
echo "Successfully enabled user"
check_container thehive && so-thehive-user-enable "$email" true
check_container fleet && so-fleet-user-enable "$email" true
@@ -243,7 +377,9 @@ case "${operation}" in
verifyEnvironment
[[ "$email" == "" ]] && fail "Email address must be provided"
lock
updateStatus "$email" 'locked'
syncAll
echo "Successfully disabled user"
check_container thehive && so-thehive-user-enable "$email" false
check_container fleet && so-fleet-user-enable "$email" false
@@ -253,12 +389,19 @@ case "${operation}" in
verifyEnvironment
[[ "$email" == "" ]] && fail "Email address must be provided"
lock
deleteUser "$email"
syncAll
echo "Successfully deleted user"
check_container thehive && so-thehive-user-enable "$email" false
check_container fleet && so-fleet-user-enable "$email" false
;;
"sync")
lock
syncAll
;;
"validate")
validateEmail "$email"
updatePassword
@@ -280,4 +423,4 @@ case "${operation}" in
;;
esac
exit 0
exit 0

View File

@@ -10,11 +10,10 @@ zeek_logs_enabled() {
}
whiptail_manager_adv_service_zeeklogs() {
BLOGS=$(whiptail --title "Security Onion Setup" --checklist "Please Select Logs to Send:" 24 78 12 \
BLOGS=$(whiptail --title "so-zeek-logs" --checklist "Please Select Logs to Send:" 24 78 12 \
"conn" "Connection Logging" ON \
"dce_rpc" "RPC Logs" ON \
"dhcp" "DHCP Logs" ON \
"dhcpv6" "DHCP IPv6 Logs" ON \
"dnp3" "DNP3 Logs" ON \
"dns" "DNS Logs" ON \
"dpd" "DPD Logs" ON \
@@ -25,25 +24,20 @@ whiptail_manager_adv_service_zeeklogs() {
"irc" "IRC Chat Logs" ON \
"kerberos" "Kerberos Logs" ON \
"modbus" "MODBUS Logs" ON \
"mqtt" "MQTT Logs" ON \
"notice" "Zeek Notice Logs" ON \
"ntlm" "NTLM Logs" ON \
"openvpn" "OPENVPN Logs" ON \
"pe" "PE Logs" ON \
"radius" "Radius Logs" ON \
"rfb" "RFB Logs" ON \
"rdp" "RDP Logs" ON \
"signatures" "Signatures Logs" ON \
"sip" "SIP Logs" ON \
"smb_files" "SMB Files Logs" ON \
"smb_mapping" "SMB Mapping Logs" ON \
"smtp" "SMTP Logs" ON \
"snmp" "SNMP Logs" ON \
"software" "Software Logs" ON \
"ssh" "SSH Logs" ON \
"ssl" "SSL Logs" ON \
"syslog" "Syslog Logs" ON \
"telnet" "Telnet Logs" ON \
"tunnel" "Tunnel Logs" ON \
"weird" "Zeek Weird Logs" ON \
"mysql" "MySQL Logs" ON \
@@ -61,10 +55,10 @@ whiptail_manager_adv_service_zeeklogs
return_code=$?
case $return_code in
1)
whiptail --title "Security Onion Setup" --msgbox "Cancelling. No changes have been made." 8 75
whiptail --title "so-zeek-logs" --msgbox "Cancelling. No changes have been made." 8 75
;;
255)
whiptail --title "Security Onion Setup" --msgbox "Whiptail error occured, exiting." 8 75
whiptail --title "so-zeek-logs" --msgbox "Whiptail error occured, exiting." 8 75
;;
*)
zeek_logs_enabled

View File

@@ -24,11 +24,11 @@ show_stats() {
echo
echo "Average throughput:"
echo
docker exec so-zeek env -i PATH=/bin:/usr/bin:/sbin:/usr/sbin:/opt/bin:/usr/local/bin:/usr/local/sbin runuser -l zeek -c '/opt/zeek/bin/zeekctl capstats'
docker exec so-zeek env -i PATH=/bin:/usr/bin:/sbin:/usr/sbin:/opt/bin:/usr/local/bin:/usr/local/sbin /opt/zeek/bin/zeekctl capstats
echo
echo "Average packet loss:"
echo
docker exec so-zeek env -i PATH=/bin:/usr/bin:/sbin:/usr/sbin:/opt/bin:/usr/local/bin:/usr/local/sbin runuser -l zeek -c '/opt/zeek/bin/zeekctl netstats'
docker exec so-zeek env -i PATH=/bin:/usr/bin:/sbin:/usr/sbin:/opt/bin:/usr/local/bin:/usr/local/sbin /opt/zeek/bin/zeekctl netstats
echo
}

View File

@@ -18,12 +18,82 @@
. /usr/sbin/so-common
UPDATE_DIR=/tmp/sogh/securityonion
DEFAULT_SALT_DIR=/opt/so/saltstack/default
INSTALLEDVERSION=$(cat /etc/soversion)
POSTVERSION=$INSTALLEDVERSION
INSTALLEDSALTVERSION=$(salt --versions-report | grep Salt: | awk {'print $2'})
INSTALLEDSALTVERSION=$(salt --versions-report | grep Salt: | awk '{print $2}')
BATCHSIZE=5
SOUP_LOG=/root/soup.log
INFLUXDB_MIGRATION_LOG=/opt/so/log/influxdb/soup_migration.log
WHATWOULDYOUSAYYAHDOHERE=soup
whiptail_title='Security Onion UPdater'
check_err() {
local exit_code=$1
local err_msg="Unhandled error occured, please check $SOUP_LOG for details."
[[ $ERR_HANDLED == true ]] && exit $exit_code
if [[ $exit_code -ne 0 ]]; then
printf '%s' "Soup failed with error $exit_code: "
case $exit_code in
2)
echo 'No such file or directory'
;;
5)
echo 'Interrupted system call'
;;
12)
echo 'Out of memory'
;;
28)
echo 'No space left on device'
echo 'Likely ran out of space on disk, please review hardware requirements for Security Onion: https://docs.securityonion.net/en/2.3/hardware.html'
;;
30)
echo 'Read-only file system'
;;
35)
echo 'Resource temporarily unavailable'
;;
64)
echo 'Machine is not on the network'
;;
67)
echo 'Link has been severed'
;;
100)
echo 'Network is down'
;;
101)
echo 'Network is unreachable'
;;
102)
echo 'Network reset'
;;
110)
echo 'Connection timed out'
;;
111)
echo 'Connection refused'
;;
112)
echo 'Host is down'
;;
113)
echo 'No route to host'
;;
*)
echo 'Unhandled error'
echo "$err_msg"
;;
esac
if [[ $exit_code -ge 64 && $exit_code -le 113 ]]; then
echo "$err_msg"
fi
exit $exit_code
fi
}
add_common() {
cp $UPDATE_DIR/salt/common/tools/sbin/so-common $DEFAULT_SALT_DIR/salt/common/tools/sbin/
@@ -39,15 +109,14 @@ airgap_mounted() {
echo "The ISO is already mounted"
else
echo ""
echo "Looks like we need access to the upgrade content"
echo ""
echo "If you just copied the .iso file over you can specify the path."
echo "If you burned the ISO to a disk the standard way you can specify the device."
echo "Example: /home/user/securityonion-2.X.0.iso"
echo "Example: /dev/sdx1"
echo ""
read -p 'Enter the location of the iso: ' ISOLOC
if [ -f $ISOLOC ]; then
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
if [[ -f $ISOLOC ]]; then
# Mounting the ISO image
mkdir -p /tmp/soagupdate
mount -t iso9660 -o loop $ISOLOC /tmp/soagupdate
@@ -59,7 +128,7 @@ airgap_mounted() {
else
echo "ISO has been mounted!"
fi
elif [ -f $ISOLOC/SecurityOnion/VERSION ]; then
elif [[ -f $ISOLOC/SecurityOnion/VERSION ]]; then
ln -s $ISOLOC /tmp/soagupdate
echo "Found the update content"
else
@@ -77,9 +146,9 @@ airgap_mounted() {
}
airgap_update_dockers() {
if [ $is_airgap -eq 0 ]; then
if [[ $is_airgap -eq 0 ]]; then
# Let's copy the tarball
if [ ! -f $AGDOCKER/registry.tar ]; then
if [[ ! -f $AGDOCKER/registry.tar ]]; then
echo "Unable to locate registry. Exiting"
exit 1
else
@@ -87,9 +156,9 @@ airgap_update_dockers() {
docker stop so-dockerregistry
docker rm so-dockerregistry
echo "Copying the new dockers over"
tar xvf $AGDOCKER/registry.tar -C /nsm/docker-registry/docker
tar xvf "$AGDOCKER/registry.tar" -C /nsm/docker-registry/docker
echo "Add Registry back"
docker load -i $AGDOCKER/registry_image.tar
docker load -i "$AGDOCKER/registry_image.tar"
fi
fi
}
@@ -100,10 +169,23 @@ update_registry() {
salt-call state.apply registry queue=True
}
check_airgap() {
# See if this is an airgap install
AIRGAP=$(cat /opt/so/saltstack/local/pillar/global.sls | grep airgap: | awk '{print $2}')
if [[ "$AIRGAP" == "True" ]]; then
is_airgap=0
UPDATE_DIR=/tmp/soagupdate/SecurityOnion
AGDOCKER=/tmp/soagupdate/docker
AGREPO=/tmp/soagupdate/Packages
else
is_airgap=1
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\"."
fi
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\"."
fi
}
check_log_size_limit() {
@@ -177,7 +259,9 @@ check_os_updates() {
echo "Continuing without updating packages"
elif [[ "$confirm" == [uU] ]]; then
echo "Applying Grid Updates"
salt \* -b 5 state.apply patch.os queue=True
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
echo "Exiting soup"
exit 0
@@ -217,7 +301,7 @@ generate_and_clean_tarballs() {
local new_version
new_version=$(cat $UPDATE_DIR/VERSION)
[ -d /opt/so/repo ] || mkdir -p /opt/so/repo
tar -czf "/opt/so/repo/$new_version.tar.gz" "$UPDATE_DIR"
tar -czf "/opt/so/repo/$new_version.tar.gz" -C "$UPDATE_DIR" .
find "/opt/so/repo" -type f -not -name "$new_version.tar.gz" -exec rm -rf {} \;
}
@@ -247,13 +331,6 @@ masterunlock() {
fi
}
preupgrade_changes_2.3.50_repo() {
# We made repo changes in 2.3.50 and this prepares for that on upgrade
echo "Checking to see if 2.3.50 repo changes are needed."
[[ "$INSTALLEDVERSION" == 2.3.30 || "$INSTALLEDVERSION" == 2.3.40 ]] && up_2.3.3X_to_2.3.50_repo
}
preupgrade_changes() {
# This function is to add any new pillar items if needed.
echo "Checking to see if changes are needed."
@@ -264,6 +341,7 @@ preupgrade_changes() {
[[ "$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
true
}
postupgrade_changes() {
@@ -273,6 +351,8 @@ postupgrade_changes() {
[[ "$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
true
}
post_rc1_to_2.3.21() {
@@ -293,6 +373,10 @@ post_2.3.30_to_2.3.40() {
POSTVERSION=2.3.40
}
post_2.3.5X_to_2.3.60() {
POSTVERSION=2.3.60
}
rc1_to_rc2() {
@@ -426,7 +510,7 @@ up_2.3.2X_to_2.3.30() {
sed -i "/ imagerepo: securityonion/c\ imagerepo: 'security-onion-solutions'" /opt/so/saltstack/local/pillar/global.sls
# Strelka rule repo pillar addition
if [ $is_airgap -eq 0 ]; then
if [[ $is_airgap -eq 0 ]]; then
# Add manager as default Strelka YARA rule repo
sed -i "/^strelka:/a \\ repos: \n - https://$HOSTNAME/repo/rules/strelka" /opt/so/saltstack/local/pillar/global.sls;
else
@@ -437,8 +521,8 @@ up_2.3.2X_to_2.3.30() {
INSTALLEDVERSION=2.3.30
}
up_2.3.3X_to_2.3.50_repo() {
echo "Performing 2.3.50 repo actions."
upgrade_to_2.3.50_repo() {
echo "Performing repo changes."
if [[ "$OS" == "centos" ]]; then
# Import GPG Keys
gpg_rpm_import
@@ -453,7 +537,7 @@ up_2.3.3X_to_2.3.50_repo() {
rm -f "/etc/yum.repos.d/$DELREPO.repo"
fi
done
if [ $is_airgap -eq 1 ]; then
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
@@ -569,7 +653,7 @@ upgrade_check() {
# Let's make sure we actually need to update.
NEWVERSION=$(cat $UPDATE_DIR/VERSION)
HOTFIXVERSION=$(cat $UPDATE_DIR/HOTFIX)
CURRENTHOTFIX=$(cat /etc/sohotfix 2>/dev/null)
[[ -f /etc/sohotfix ]] && CURRENTHOTFIX=$(cat /etc/sohotfix)
if [ "$INSTALLEDVERSION" == "$NEWVERSION" ]; then
echo "Checking to see if there are hotfixes needed"
if [ "$HOTFIXVERSION" == "$CURRENTHOTFIX" ]; then
@@ -586,13 +670,14 @@ upgrade_check() {
}
upgrade_check_salt() {
NEWSALTVERSION=$(grep version: $UPDATE_DIR/salt/salt/master.defaults.yaml | awk {'print $2'})
NEWSALTVERSION=$(grep version: $UPDATE_DIR/salt/salt/master.defaults.yaml | awk '{print $2}')
if [ "$INSTALLEDSALTVERSION" == "$NEWSALTVERSION" ]; then
echo "You are already running the correct version of Salt for Security Onion."
else
UPGRADESALT=1
fi
}
upgrade_salt() {
SALTUPGRADED=True
echo "Performing upgrade of Salt from $INSTALLEDSALTVERSION to $NEWSALTVERSION."
@@ -604,7 +689,11 @@ upgrade_salt() {
yum versionlock delete "salt-*"
echo "Updating Salt packages and restarting services."
echo ""
sh $UPDATE_DIR/salt/salt/scripts/bootstrap-salt.sh -r -F -M -x python3 stable "$NEWSALTVERSION"
set +e
run_check_net_err \
"sh $UPDATE_DIR/salt/salt/scripts/bootstrap-salt.sh -r -F -M -x python3 stable \"$NEWSALTVERSION\"" \
"Could not update salt, please check $SOUP_LOG for details."
set -e
echo "Applying yum versionlock for Salt."
echo ""
yum versionlock add "salt-*"
@@ -617,7 +706,11 @@ upgrade_salt() {
apt-mark unhold "salt-minion"
echo "Updating Salt packages and restarting services."
echo ""
sh $UPDATE_DIR/salt/salt/scripts/bootstrap-salt.sh -F -M -x python3 stable "$NEWSALTVERSION"
set +e
run_check_net_err \
"sh $UPDATE_DIR/salt/salt/scripts/bootstrap-salt.sh -F -M -x python3 stable \"$NEWSALTVERSION\"" \
"Could not update salt, please check $SOUP_LOG for details."
set -e
echo "Applying apt hold for Salt."
echo ""
apt-mark hold "salt-common"
@@ -642,222 +735,248 @@ verify_latest_update_script() {
cp $UPDATE_DIR/salt/common/tools/sbin/soup $DEFAULT_SALT_DIR/salt/common/tools/sbin/
cp $UPDATE_DIR/salt/common/tools/sbin/so-common $DEFAULT_SALT_DIR/salt/common/tools/sbin/
cp $UPDATE_DIR/salt/common/tools/sbin/so-image-common $DEFAULT_SALT_DIR/salt/common/tools/sbin/
salt-call state.apply common queue=True
salt-call state.apply -l info common queue=True
echo ""
echo "soup has been updated. Please run soup again."
exit 0
fi
}
main () {
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
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 ""
set_os
set_palette
check_elastic_license
echo ""
if [ $is_airgap -eq 0 ]; then
# Let's mount the ISO since this is airgap
airgap_mounted
else
echo "Cloning Security Onion github repo into $UPDATE_DIR."
echo "Removing previous upgrade sources."
rm -rf $UPDATE_DIR
clone_to_tmp
fi
check_os_updates
echo ""
echo "Verifying we have the latest soup script."
verify_latest_update_script
echo ""
echo "Generating new repo archive"
generate_and_clean_tarballs
if [ -f /usr/sbin/so-image-common ]; then
. /usr/sbin/so-image-common
else
add_common
fi
echo "Let's see if we need to update Security Onion."
upgrade_check
upgrade_space
echo "Checking for Salt Master and Minion updates."
upgrade_check_salt
if [ "$is_hotfix" == "true" ]; then
echo "Applying $HOTFIXVERSION"
copy_new_files
echo ""
update_version
salt-call state.highstate -l info queue=True
main() {
set -e
set +e
trap 'check_err $?' EXIT
else
echo ""
echo "Performing upgrade from Security Onion $INSTALLEDVERSION to Security Onion $NEWVERSION."
echo ""
echo "Updating dockers to $NEWVERSION."
if [ $is_airgap -eq 0 ]; then
airgap_update_dockers
update_centos_repo
yum clean all
check_os_updates
else
update_registry
update_docker_containers "soup"
fi
echo ""
echo "Stopping Salt Minion service."
systemctl stop salt-minion
echo "Killing any remaining Salt Minion processes."
pkill -9 -ef /usr/bin/salt-minion
echo ""
echo "Stopping Salt Master service."
systemctl stop salt-master
echo ""
preupgrade_changes_2.3.50_repo
# Does salt need upgraded. If so update it.
if [ "$UPGRADESALT" == "1" ]; then
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 ""
fi
preupgrade_changes
echo ""
if [ $is_airgap -eq 0 ]; then
echo "Updating Rule Files to the Latest."
update_airgap_rules
fi
# Only update the repo if its airgap
if [[ $is_airgap -eq 0 ]] && [[ "$UPGRADESALT" != "1" ]]; then
update_centos_repo
fi
echo ""
echo "Copying new Security Onion code from $UPDATE_DIR to $DEFAULT_SALT_DIR."
copy_new_files
echo ""
update_version
echo ""
echo "Locking down Salt Master for upgrade"
masterlock
echo ""
echo "Starting Salt Master service."
systemctl start salt-master
# Only regenerate osquery packages if Fleet is enabled
FLEET_MANAGER=$(lookup_pillar fleet_manager)
FLEET_NODE=$(lookup_pillar fleet_node)
if [[ "$FLEET_MANAGER" == "True" || "$FLEET_NODE" == "True" ]]; then
echo ""
echo "Regenerating Osquery Packages.... This will take several minutes."
salt-call state.apply fleet.event_gen-packages -l info queue=True
echo ""
fi
echo ""
echo "Running a highstate to complete the Security Onion upgrade on this manager. This could take several minutes."
salt-call state.highstate -l info queue=True
echo ""
echo "Upgrade from $INSTALLEDVERSION to $NEWVERSION complete."
echo ""
echo "Stopping Salt Master to remove ACL"
systemctl stop salt-master
masterunlock
echo ""
echo "Starting Salt Master service."
systemctl start salt-master
echo "Running a highstate. This could take several minutes."
salt-call state.highstate -l info queue=True
postupgrade_changes
unmount_update
thehive_maint
if [ "$UPGRADESALT" == "1" ]; then
if [ $is_airgap -eq 0 ]; then
echo ""
echo "Cleaning repos on remote Security Onion nodes."
salt -C 'not *_eval and not *_helixsensor and not *_manager and not *_managersearch and not *_standalone and G@os:CentOS' cmd.run "yum clean all"
echo ""
fi
fi
check_sudoers
if [[ -n $lsl_msg ]]; then
case $lsl_msg in
'distributed')
echo "[INFO] The value of log_size_limit in any heavy node minion pillars may be incorrect."
echo " -> We recommend checking and adjusting the values as necessary."
echo " -> Minion pillar directory: /opt/so/saltstack/local/pillar/minions/"
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
;;
'single-node')
# We can assume the lsl_details array has been set if lsl_msg has this value
echo "[WARNING] The value of log_size_limit (${lsl_details[0]}) does not match the recommended value of ${lsl_details[1]}."
echo " -> We recommend checking and adjusting the value as necessary."
echo " -> File: /opt/so/saltstack/local/pillar/minions/${lsl_details[2]}.sls"
\? )
echo "Usage: cmd [-b]"
;;
esac
done
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."
echo "Removing previous upgrade sources."
rm -rf $UPDATE_DIR
echo "Cloning the Security Onion Repo."
clone_to_tmp
fi
echo "Verifying we have the latest soup script."
verify_latest_update_script
echo ""
set_os
set_palette
check_elastic_license
echo ""
check_os_updates
echo "Generating new repo archive"
generate_and_clean_tarballs
if [ -f /usr/sbin/so-image-common ]; then
. /usr/sbin/so-image-common
else
add_common
fi
NUM_MINIONS=$(ls /opt/so/saltstack/local/pillar/minions/*_*.sls | wc -l)
echo "Let's see if we need to update Security Onion."
upgrade_check
upgrade_space
if [ $NUM_MINIONS -gt 1 ]; then
echo "Checking for Salt Master and Minion updates."
upgrade_check_salt
set -e
cat << EOF
if [ "$is_hotfix" == "true" ]; then
echo "Applying $HOTFIXVERSION"
copy_new_files
echo ""
update_version
salt-call state.highstate -l info queue=True
else
echo ""
echo "Performing upgrade from Security Onion $INSTALLEDVERSION to Security Onion $NEWVERSION."
echo ""
echo "Updating dockers to $NEWVERSION."
if [[ $is_airgap -eq 0 ]]; then
airgap_update_dockers
update_centos_repo
yum clean all
check_os_updates
else
update_registry
set +e
update_docker_containers "soup"
set -e
fi
echo ""
echo "Stopping Salt Minion service."
systemctl stop salt-minion
echo "Killing any remaining Salt Minion processes."
set +e
pkill -9 -ef /usr/bin/salt-minion
set -e
echo ""
echo "Stopping Salt Master service."
systemctl stop salt-master
echo ""
upgrade_to_2.3.50_repo
# Does salt need upgraded. If so update it.
if [[ $UPGRADESALT -eq 1 ]]; then
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 ""
fi
preupgrade_changes
echo ""
if [[ $is_airgap -eq 0 ]]; then
echo "Updating Rule Files to the Latest."
update_airgap_rules
fi
# Only update the repo if its airgap
if [[ $is_airgap -eq 0 && $UPGRADESALT -ne 1 ]]; then
update_centos_repo
fi
echo ""
echo "Copying new Security Onion code from $UPDATE_DIR to $DEFAULT_SALT_DIR."
copy_new_files
echo ""
update_version
echo ""
echo "Locking down Salt Master for upgrade"
masterlock
echo ""
echo "Starting Salt Master service."
systemctl start salt-master
# Testing that salt-master is up by checking that is it connected to itself
set +e
echo "Waiting on the Salt Master service to be ready."
salt-call state.show_top -l error queue=True || fail "salt-master could not be reached. Check $SOUP_LOG for details."
set -e
echo ""
echo "Ensuring python modules for Salt are installed and patched."
salt-call state.apply salt.python3-influxdb -l info queue=True
echo ""
# Only regenerate osquery packages if Fleet is enabled
FLEET_MANAGER=$(lookup_pillar fleet_manager)
FLEET_NODE=$(lookup_pillar fleet_node)
if [[ "$FLEET_MANAGER" == "True" || "$FLEET_NODE" == "True" ]]; then
echo ""
echo "Regenerating Osquery Packages.... This will take several minutes."
salt-call state.apply fleet.event_gen-packages -l info queue=True
echo ""
fi
echo ""
echo "Running a highstate to complete the Security Onion upgrade on this manager. This could take several minutes."
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"
systemctl stop salt-master
masterunlock
echo ""
echo "Starting Salt Master service."
systemctl start salt-master
set +e
echo "Waiting on the Salt Master service to be ready."
salt-call state.show_top -l error queue=True || fail "salt-master could not be reached. Check $SOUP_LOG for details."
set -e
echo "Running a highstate. This could take several minutes."
salt-call state.highstate -l info queue=True
postupgrade_changes
[[ $is_airgap -eq 0 ]] && unmount_update
thehive_maint
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
echo ""
echo "Cleaning repos on remote Security Onion nodes."
salt -C 'not *_eval and not *_helixsensor and not *_manager and not *_managersearch and not *_standalone and G@os:CentOS' cmd.run "yum clean all"
echo ""
fi
fi
check_sudoers
if [[ -n $lsl_msg ]]; then
case $lsl_msg in
'distributed')
echo "[INFO] The value of log_size_limit in any heavy node minion pillars may be incorrect."
echo " -> We recommend checking and adjusting the values as necessary."
echo " -> Minion pillar directory: /opt/so/saltstack/local/pillar/minions/"
;;
'single-node')
# We can assume the lsl_details array has been set if lsl_msg has this value
echo "[WARNING] The value of log_size_limit (${lsl_details[0]}) does not match the recommended value of ${lsl_details[1]}."
echo " -> We recommend checking and adjusting the value as necessary."
echo " -> File: /opt/so/saltstack/local/pillar/minions/${lsl_details[2]}.sls"
;;
esac
fi
if [[ $NUM_MINIONS -gt 1 ]]; then
cat << EOF
@@ -871,10 +990,10 @@ For more information, please see https://docs.securityonion.net/en/2.3/soup.html
EOF
fi
fi
fi
echo "### soup has been served at `date` ###"
echo "### soup has been served at $(date) ###"
}
cat << EOF
@@ -889,6 +1008,7 @@ Press Enter to continue or Ctrl-C to cancel.
EOF
read input
read -r input
main "$@" | tee -a $SOUP_LOG

View File

@@ -34,7 +34,7 @@ overlimit() {
closedindices() {
INDICES=$(curl -s -k https://{{ELASTICSEARCH_HOST}}:{{ELASTICSEARCH_PORT}}/_cat/indices?h=index\&expand_wildcards=closed 2> /dev/null)
INDICES=$({{ ELASTICCURL }} -s -k https://{{ELASTICSEARCH_HOST}}:{{ELASTICSEARCH_PORT}}/_cat/indices?h=index\&expand_wildcards=closed 2> /dev/null)
[ $? -eq 1 ] && return false
echo ${INDICES} | grep -q -E "(logstash-|so-)"
}
@@ -49,10 +49,10 @@ while overlimit && closedindices; do
# First, get the list of closed indices using _cat/indices?h=index\&expand_wildcards=closed.
# Then, sort by date by telling sort to use hyphen as delimiter and then sort on the third field.
# Finally, select the first entry in that sorted list.
OLDEST_INDEX=$(curl -s -k https://{{ELASTICSEARCH_HOST}}:{{ELASTICSEARCH_PORT}}/_cat/indices?h=index\&expand_wildcards=closed | grep -E "(logstash-|so-)" | sort -t- -k3 | head -1)
OLDEST_INDEX=$({{ ELASTICCURL }} -s -k https://{{ELASTICSEARCH_HOST}}:{{ELASTICSEARCH_PORT}}/_cat/indices?h=index\&expand_wildcards=closed | grep -E "(logstash-|so-)" | sort -t- -k3 | head -1)
# Now that we've determined OLDEST_INDEX, ask Elasticsearch to delete it.
curl -XDELETE -k https://{{ELASTICSEARCH_HOST}}:{{ELASTICSEARCH_PORT}}/${OLDEST_INDEX}
{{ ELASTICCURL }} -XDELETE -k https://{{ELASTICSEARCH_HOST}}:{{ELASTICSEARCH_PORT}}/${OLDEST_INDEX}
# Finally, write a log entry that says we deleted it.
echo "$(date) - Used disk space exceeds LOG_SIZE_LIMIT ({{LOG_SIZE_LIMIT}} GB) - Index ${OLDEST_INDEX} deleted ..." >> ${LOG}

View File

@@ -3,6 +3,13 @@
{% elif grains['role'] in ['so-eval', 'so-managersearch', 'so-standalone'] %}
{%- set elasticsearch = salt['pillar.get']('manager:mainip', '') -%}
{%- endif %}
{%- if salt['pillar.get']('elasticsearch:auth:enabled') is sameas true %}
{%- set ES_USER = salt['pillar.get']('elasticsearch:auth:users:so_elastic_user:user', '') %}
{%- set ES_PASS = salt['pillar.get']('elasticsearch:auth:users:so_elastic_user:pass', '') %}
{%- else %}
{%- set ES_USER = '' %}
{%- set ES_PASS = '' %}
{%- endif %}
---
# Remember, leave a key empty if there is no value. None will be a string,
@@ -11,6 +18,10 @@ client:
hosts:
- {{elasticsearch}}
port: 9200
{% if salt['pillar.get']('elasticsearch:auth:enabled') is sameas true %}
username: {{ ES_USER }}
password: {{ ES_PASS }}
{% endif %}
url_prefix:
use_ssl: True
certificate:

View File

@@ -5,6 +5,7 @@
{% set IMAGEREPO = salt['pillar.get']('global:imagerepo') %}
{% set MANAGER = salt['grains.get']('master') %}
{% if grains['role'] in ['so-eval', 'so-node', 'so-managersearch', 'so-heavynode', 'so-standalone'] %}
{% from 'elasticsearch/auth.map.jinja' import ELASTICAUTH with context %}
# Curator
# Create the group
curatorgroup:
@@ -48,6 +49,7 @@ curconf:
- source: salt://curator/files/curator.yml
- user: 934
- group: 939
- mode: 660
- template: jinja
curcloseddel:
@@ -66,6 +68,8 @@ curcloseddeldel:
- group: 939
- mode: 755
- template: jinja
- defaults:
ELASTICCURL: {{ ELASTICAUTH.elasticcurl }}
curclose:
file.managed:
@@ -147,4 +151,4 @@ append_so-curator_so-status.conf:
test.fail_without_changes:
- name: {{sls}}_state_not_allowed
{% endif %}
{% endif %}

View File

@@ -1,3 +1,5 @@
{%- set ES_USER = salt['pillar.get']('elasticsearch:auth:users:so_elastic_user:user', '') %}
{%- set ES_PASS = salt['pillar.get']('elasticsearch:auth:users:so_elastic_user:pass', '') %}
elastalert:
config:
rules_folder: /opt/elastalert/rules/
@@ -19,8 +21,10 @@ elastalert:
use_ssl: true
verify_certs: false
#es_send_get_body_as: GET
#es_username: someusername
#es_password: somepassword
{%- if salt['pillar.get']('elasticsearch:auth:enabled') is sameas true %}
es_username: {{ ES_USER }}
es_password: {{ ES_PASS }}
{%- endif %}
writeback_index: elastalert_status
alert_time_limit:
days: 2
@@ -45,4 +49,4 @@ elastalert:
level: INFO
handlers:
- file
propagate: false
propagate: false

View File

@@ -12,16 +12,21 @@ class PlaybookESAlerter(Alerter):
Use matched data to create alerts in elasticsearch
"""
required_options = set(['play_title','play_url','sigma_level','elasticsearch_host'])
required_options = set(['play_title','play_url','sigma_level'])
def alert(self, matches):
for match in matches:
today = strftime("%Y.%m.%d", gmtime())
timestamp = strftime("%Y-%m-%d"'T'"%H:%M:%S"'.000Z', gmtime())
headers = {"Content-Type": "application/json"}
creds = None
if 'es_username' in self.rule and 'es_password' in self.rule:
creds = (self.rule['es_username'], self.rule['es_password'])
payload = {"rule": { "name": self.rule['play_title'],"case_template": self.rule['play_id'],"uuid": self.rule['play_id'],"category": self.rule['rule.category']},"event":{ "severity": self.rule['event.severity'],"module": self.rule['event.module'],"dataset": self.rule['event.dataset'],"severity_label": self.rule['sigma_level']},"kibana_pivot": self.rule['kibana_pivot'],"soc_pivot": self.rule['soc_pivot'],"play_url": self.rule['play_url'],"sigma_level": self.rule['sigma_level'],"event_data": match, "@timestamp": timestamp}
url = f"https://{self.rule['elasticsearch_host']}/so-playbook-alerts-{today}/_doc/"
requests.post(url, data=json.dumps(payload), headers=headers, verify=False)
url = f"https://{self.rule['es_host']}:{self.rule['es_port']}/so-playbook-alerts-{today}/_doc/"
requests.post(url, data=json.dumps(payload), headers=headers, verify=False, auth=creds)
def get_info(self):
return {'type': 'PlaybookESAlerter'}

View File

@@ -99,14 +99,12 @@ elastaconf:
elastalert_config: {{ elastalert_config.elastalert.config }}
- user: 933
- group: 933
- mode: 660
- template: jinja
wait_for_elasticsearch:
module.run:
- http.wait_for_successful_query:
- url: 'https://{{MANAGER}}:9200/_cat/indices/.kibana*'
- wait_for: 180
- verify_ssl: False
cmd.run:
- name: so-elasticsearch-wait
so-elastalert:
docker_container.running:
@@ -123,7 +121,7 @@ so-elastalert:
- extra_hosts:
- {{MANAGER_URL}}:{{MANAGER_IP}}
- require:
- module: wait_for_elasticsearch
- cmd: wait_for_elasticsearch
- watch:
- file: elastaconf

View File

@@ -0,0 +1,7 @@
{% set ELASTICAUTH = salt['pillar.filter_by']({
True: {
'user': salt['pillar.get']('elasticsearch:auth:users:so_elastic_user:user'),
'pass': salt['pillar.get']('elasticsearch:auth:users:so_elastic_user:pass'),
'elasticcurl':'curl -K /opt/so/conf/elasticsearch/curl.config' },
False: {'elasticcurl': 'curl'},
}, pillar='elasticsearch:auth:enabled', default=False) %}

View File

@@ -0,0 +1,39 @@
{% set so_elastic_user_pass = salt['random.get_str'](20) %}
{% set so_kibana_user_pass = salt['random.get_str'](20) %}
{% set so_logstash_user_pass = salt['random.get_str'](20) %}
{% set so_beats_user_pass = salt['random.get_str'](20) %}
{% set so_monitor_user_pass = salt['random.get_str'](20) %}
elastic_auth_pillar:
file.managed:
- name: /opt/so/saltstack/local/pillar/elasticsearch/auth.sls
- mode: 600
- reload_pillar: True
- contents: |
elasticsearch:
auth:
enabled: False
users:
so_elastic_user:
user: so_elastic
pass: {{ so_elastic_user_pass }}
so_kibana_user:
user: so_kibana
pass: {{ so_kibana_user_pass }}
so_logstash_user:
user: so_logstash
pass: {{ so_logstash_user_pass }}
so_beats_user:
user: so_beats
pass: {{ so_beats_user_pass }}
so_monitor_user:
user: so_monitor
pass: {{ so_monitor_user_pass }}
# since we are generating a random password, and we don't want that to happen everytime
# a highstate runs, we only manage the file each user isn't present in the file. if the
# pillar file doesn't exists, then the default vault provided to pillar.get should not
# be within the file either, so it should then be created
- unless:
{% for so_app_user, values in salt['pillar.get']('elasticsearch:auth:users', {'so_noapp_user': {'user': 'r@NDumu53Rd0NtDOoP'}}).items() %}
- grep {{ values.user }} /opt/so/saltstack/local/pillar/elasticsearch/auth.sls
{% endfor%}

View File

@@ -0,0 +1 @@
user = "{{ salt['pillar.get']('elasticsearch:auth:users:so_elastic_user:user') }}:{{ salt['pillar.get']('elasticsearch:auth:users:so_elastic_user:pass') }}"

View File

@@ -30,13 +30,15 @@ xpack.security.http.ssl.client_authentication: none
xpack.security.http.ssl.key: /usr/share/elasticsearch/config/elasticsearch.key
xpack.security.http.ssl.certificate: /usr/share/elasticsearch/config/elasticsearch.crt
xpack.security.http.ssl.certificate_authorities: /usr/share/elasticsearch/config/ca.crt
{% if not salt['pillar.get']('elasticsearch:auth:enabled', False) %}
xpack.security.authc:
anonymous:
username: anonymous_user
roles: superuser
authz_exception: true
{% endif %}
node.name: {{ grains.host }}
script.max_compilations_rate: 1000/1m
script.max_compilations_rate: 20000/1m
{%- if TRUECLUSTER is sameas true %}
{%- if grains.role == 'so-manager' %}
{%- if salt['pillar.get']('nodestab', {}) %}

View File

@@ -51,7 +51,7 @@
},
{ "set": { "field": "_index", "value": "so-firewall", "override": true } },
{ "set": { "if": "ctx.network?.transport_id == '0'", "field": "network.transport", "value": "icmp", "override": true } },
{"community_id": { "if": "ctx.network?.transport != null", "field":["source.ip","source.port","destination.ip","destination.port","network.transport"],"target_field":"network.community_id"}},
{"community_id": {} },
{ "set": { "field": "module", "value": "pfsense", "override": true } },
{ "set": { "field": "dataset", "value": "firewall", "override": true } },
{ "remove": { "field": ["real_message", "ip_sub_msg", "firewall.sub_message"], "ignore_failure": true } }

View File

@@ -1,7 +1,6 @@
{
"description" : "sysmon",
"processors" : [
{"community_id": {"if": "ctx.winlog.event_data?.Protocol != null", "field":["winlog.event_data.SourceIp","winlog.event_data.SourcePort","winlog.event_data.DestinationIp","winlog.event_data.DestinationPort","winlog.event_data.Protocol"],"target_field":"network.community_id"}},
{ "set": { "field": "event.code", "value": "{{winlog.event_id}}", "override": true } },
{ "set": { "field": "event.module", "value": "sysmon", "override": true } },
{ "set": { "if": "ctx.winlog?.computer_name != null", "field": "observer.name", "value": "{{winlog.computer_name}}", "override": true } },
@@ -64,6 +63,7 @@
{ "rename": { "field": "winlog.event_data.SourceIp", "target_field": "source.ip", "ignore_missing": true } },
{ "rename": { "field": "winlog.event_data.SourcePort", "target_field": "source.port", "ignore_missing": true } },
{ "rename": { "field": "winlog.event_data.targetFilename", "target_field": "file.target", "ignore_missing": true } },
{ "rename": { "field": "winlog.event_data.TargetFilename", "target_field": "file.target", "ignore_missing": true } }
{ "rename": { "field": "winlog.event_data.TargetFilename", "target_field": "file.target", "ignore_missing": true } },
{ "community_id": {} }
]
}

View File

@@ -8,11 +8,11 @@
{ "dot_expander": { "field": "id.orig_p", "path": "message2", "ignore_failure": true } },
{ "dot_expander": { "field": "id.resp_h", "path": "message2", "ignore_failure": true } },
{ "dot_expander": { "field": "id.resp_p", "path": "message2", "ignore_failure": true } },
{"community_id": {"if": "ctx.network?.transport != null", "field":["message2.id.orig_h","message2.id.orig_p","message2.id.resp_h","message2.id.resp_p","network.transport"],"target_field":"network.community_id"}},
{ "rename": { "field": "message2.id.orig_h", "target_field": "source.ip", "ignore_missing": true } },
{ "rename": { "field": "message2.id.orig_p", "target_field": "source.port", "ignore_missing": true } },
{ "rename": { "field": "message2.id.resp_h", "target_field": "destination.ip", "ignore_missing": true } },
{ "rename": { "field": "message2.id.resp_p", "target_field": "destination.port", "ignore_missing": true } },
{ "community_id": {} },
{ "set": { "if": "ctx.source?.ip != null", "field": "client.ip", "value": "{{source.ip}}" } },
{ "set": { "if": "ctx.source?.port != null", "field": "client.port", "value": "{{source.port}}" } },
{ "set": { "if": "ctx.destination?.ip != null", "field": "server.ip", "value": "{{destination.ip}}" } },

View File

@@ -1,6 +1,6 @@
#!/bin/bash
#
# Copyright 2014,2015,2016,2017,2018,2019 Security Onion Solutions, LLC
# 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

View File

@@ -1,6 +1,6 @@
#!/bin/bash
#
# Copyright 2014,2015,2016,2017,2018,2019 Security Onion Solutions, LLC
# 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
@@ -27,7 +27,7 @@ echo -n "Waiting for ElasticSearch..."
COUNT=0
ELASTICSEARCH_CONNECTED="no"
while [[ "$COUNT" -le 240 ]]; do
curl ${ELASTICSEARCH_AUTH} -k --output /dev/null --silent --head --fail -L https://"$ELASTICSEARCH_HOST":"$ELASTICSEARCH_PORT"
{{ ELASTICCURL }} -k --output /dev/null --silent --head --fail -L https://"$ELASTICSEARCH_HOST":"$ELASTICSEARCH_PORT"
if [ $? -eq 0 ]; then
ELASTICSEARCH_CONNECTED="yes"
echo "connected!"
@@ -47,9 +47,9 @@ fi
cd ${ELASTICSEARCH_INGEST_PIPELINES}
echo "Loading pipelines..."
for i in *; do echo $i; RESPONSE=$(curl ${ELASTICSEARCH_AUTH} -k -XPUT -L https://${ELASTICSEARCH_HOST}:${ELASTICSEARCH_PORT}/_ingest/pipeline/$i -H 'Content-Type: application/json' -d@$i 2>/dev/null); echo $RESPONSE; if [[ "$RESPONSE" == *"error"* ]]; then RETURN_CODE=1; fi; done
for i in *; do echo $i; RESPONSE=$({{ ELASTICCURL }} -k -XPUT -L https://${ELASTICSEARCH_HOST}:${ELASTICSEARCH_PORT}/_ingest/pipeline/$i -H 'Content-Type: application/json' -d@$i 2>/dev/null); echo $RESPONSE; if [[ "$RESPONSE" == *"error"* ]]; then RETURN_CODE=1; fi; done
echo
cd - >/dev/null
exit $RETURN_CODE
exit $RETURN_CODE

View File

@@ -35,6 +35,8 @@
{% endif %}
{% set TEMPLATES = salt['pillar.get']('elasticsearch:templates', {}) %}
{% from 'elasticsearch/auth.map.jinja' import ELASTICAUTH with context %}
vm.max_map_count:
sysctl.present:
@@ -169,6 +171,40 @@ eslogdir:
- group: 939
- makedirs: True
auth_users:
file.managed:
- name: /opt/so/conf/elasticsearch/users.tmp
- source: salt://elasticsearch/files/users
- user: 930
- group: 930
- mode: 600
- show_changes: False
auth_users_roles:
file.managed:
- name: /opt/so/conf/elasticsearch/users_roles.tmp
- source: salt://elasticsearch/files/users_roles
- user: 930
- group: 930
- mode: 600
- show_changes: False
auth_users_inode:
require:
- file: auth_users
cmd.run:
- name: cat /opt/so/conf/elasticsearch/users.tmp > /opt/so/conf/elasticsearch/users && chown 930:930 /opt/so/conf/elasticsearch/users && chmod 600 /opt/so/conf/elasticsearch/users
- onchanges:
- file: /opt/so/conf/elasticsearch/users.tmp
auth_users_roles_inode:
require:
- file: auth_users_roles
cmd.run:
- name: cat /opt/so/conf/elasticsearch/users_roles.tmp > /opt/so/conf/elasticsearch/users_roles && chown 930:930 /opt/so/conf/elasticsearch/users_roles && chmod 600 /opt/so/conf/elasticsearch/users_roles
- onchanges:
- file: /opt/so/conf/elasticsearch/users_roles.tmp
so-elasticsearch:
docker_container.running:
- image: {{ MANAGER }}:5000/{{ IMAGEREPO }}/so-elasticsearch:{{ VERSION }}
@@ -213,6 +249,10 @@ so-elasticsearch:
- /etc/pki/elasticsearch.crt:/usr/share/elasticsearch/config/elasticsearch.crt:ro
- /etc/pki/elasticsearch.key:/usr/share/elasticsearch/config/elasticsearch.key:ro
- /etc/pki/elasticsearch.p12:/usr/share/elasticsearch/config/elasticsearch.p12:ro
{% if salt['pillar.get']('elasticsearch:auth:enabled', False) %}
- /opt/so/conf/elasticsearch/users_roles:/usr/share/elasticsearch/config/users_roles:ro
- /opt/so/conf/elasticsearch/users:/usr/share/elasticsearch/config/users:ro
{% endif %}
- watch:
- file: cacertz
- file: esyml
@@ -232,6 +272,8 @@ so-elasticsearch-pipelines-file:
- group: 939
- mode: 754
- template: jinja
- defaults:
ELASTICCURL: {{ ELASTICAUTH.elasticcurl }}
so-elasticsearch-pipelines:
cmd.run:

View File

@@ -1,5 +1,5 @@
{
"index_patterns": ["so-ids-*", "so-firewall-*", "so-syslog-*", "so-zeek-*", "so-import-*", "so-ossec-*", "so-strelka-*", "so-beats-*", "so-osquery-*","so-playbook-*"],
"index_patterns": ["so-*"],
"version":50001,
"order":10,
"settings":{
@@ -228,7 +228,11 @@
"event":{
"type":"object",
"dynamic": true
},
},
"event_data":{
"type":"object",
"dynamic": true
},
"file":{
"type":"object",
"dynamic": true
@@ -316,7 +320,8 @@
"type":"text",
"fields":{
"keyword":{
"type":"keyword"
"type":"keyword",
"ignore_above": 32766
}
}
},
@@ -522,11 +527,159 @@
"version":{
"type":"long"
}
}
},
}
},
"x509":{
"type":"object",
"dynamic": true
},
"suricata":{
"type":"object",
"dynamic": true
},
"zeek":{
"type":"object",
"dynamic": true
},
"aws":{
"type":"object",
"dynamic": true
},
"azure":{
"type":"object",
"dynamic": true
},
"barracuda":{
"type":"object",
"dynamic": true
},
"bluecoat":{
"type":"object",
"dynamic": true
},
"cef":{
"type":"object",
"dynamic": true
},
"checkpoint":{
"type":"object",
"dynamic": true
},
"cisco":{
"type":"object",
"dynamic": true
},
"cyberark":{
"type":"object",
"dynamic": true
},
"cylance":{
"type":"object",
"dynamic": true
},
"f5":{
"type":"object",
"dynamic": true
},
"fortinet":{
"type":"object",
"dynamic": true
},
"gcp":{
"type":"object",
"dynamic": true
},
"google_workspace":{
"type":"object",
"dynamic": true
},
"imperva":{
"type":"object",
"dynamic": true
},
"infoblox":{
"type":"object",
"dynamic": true
},
"juniper":{
"type":"object",
"dynamic": true
},
"microsoft":{
"type":"object",
"dynamic": true
},
"misp":{
"type":"object",
"dynamic": true
},
"netflow":{
"type":"object",
"dynamic": true
},
"netscout":{
"type":"object",
"dynamic": true
},
"o365":{
"type":"object",
"dynamic": true
},
"okta":{
"type":"object",
"dynamic": true
},
"proofpoint":{
"type":"object",
"dynamic": true
},
"radware":{
"type":"object",
"dynamic": true
},
"snort":{
"type":"object",
"dynamic": true
},
"snyk":{
"type":"object",
"dynamic": true
},
"sonicwall":{
"type":"object",
"dynamic": true
},
"sophos":{
"type":"object",
"dynamic": true
},
"squid":{
"type":"object",
"dynamic": true
},
"tomcat":{
"type":"object",
"dynamic": true
},
"zcaler":{
"type":"object",
"dynamic": true
},
"elasticsearch":{
"type":"object",
"dynamic": true
},
"kibana":{
"type":"object",
"dynamic": true
},
"logstash":{
"type":"object",
"dynamic": true
},
"redis":{
"type":"object",
"dynamic": true
}
}
}

View File

@@ -3,7 +3,8 @@
{%- else %}
{%- set MANAGER = salt['grains.get']('master') %}
{%- endif %}
{%- set ES_USER = salt['pillar.get']('elasticsearch:auth:users:so_elastic_user:user', '') %}
{%- set ES_PASS = salt['pillar.get']('elasticsearch:auth:users:so_elastic_user:pass', '') %}
{%- set HOSTNAME = salt['grains.get']('host', '') %}
{%- set ZEEKVER = salt['pillar.get']('global:mdengine', 'COMMUNITY') %}
@@ -71,7 +72,13 @@ logging.files:
# Set to true to log messages in json format.
#logging.json: false
#========================== Modules configuration ============================
filebeat.config.modules:
enabled: true
path: ${path.config}/modules.d/*.yml
filebeat.modules:
#=========================== Filebeat prospectors =============================
@@ -183,7 +190,6 @@ filebeat.inputs:
fields_under_root: true
clean_removed: false
close_removed: false
{%- if STRELKAENABLED == 1 %}
- type: log
paths:
@@ -261,6 +267,10 @@ output.{{ type }}:
output.elasticsearch:
enabled: true
hosts: ["https://{{ MANAGER }}:9200"]
{%- if salt['pillar.get']('elasticsearch:auth:enabled') is sameas true %}
username: "{{ ES_USER }}"
password: "{{ ES_PASS }}"
{%- endif %}
ssl.certificate_authorities: ["/usr/share/filebeat/intraca.crt"]
pipelines:
- pipeline: "%{[module]}.%{[dataset]}"

View File

@@ -0,0 +1,16 @@
{%- if grains['role'] in ['so-managersearch', 'so-heavynode', 'so-node'] %}
{%- set MANAGER = salt['grains.get']('host' '') %}
{%- else %}
{%- set MANAGER = salt['grains.get']('master') %}
{%- endif %}
{%- set ES_USER = salt['pillar.get']('elasticsearch:auth:users:so_elastic_user:user', '') %}
{%- set ES_PASS = salt['pillar.get']('elasticsearch:auth:users:so_elastic_user:pass', '') %}
output.elasticsearch:
enabled: true
hosts: ["https://{{ MANAGER }}:9200"]
{% if salt['pillar.get']('elasticsearch:auth:enabled') is sameas true %}
username: "{{ ES_USER }}"
password: "{{ ES_PASS }}"
{% endif %}
ssl.certificate_authorities: ["/usr/share/filebeat/intraca.crt"]

View File

@@ -0,0 +1,18 @@
# DO NOT EDIT THIS FILE
{%- if MODULES.modules is iterable and MODULES.modules is not string and MODULES.modules|length > 0%}
{%- for module in MODULES.modules.keys() %}
- module: {{ module }}
{%- for fileset in MODULES.modules[module] %}
{{ fileset }}:
enabled: {{ MODULES.modules[module][fileset].enabled|string|lower }}
{#- only manage the settings if the fileset is enabled #}
{%- if MODULES.modules[module][fileset].enabled %}
{%- for var, value in MODULES.modules[module][fileset].items() %}
{%- if var|lower != 'enabled' %}
{{ var }}: {{ value }}
{%- endif %}
{%- endfor %}
{%- endif %}
{%- endfor %}
{%- endfor %}
{% endif %}

View File

@@ -1,3 +1,4 @@
# 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
@@ -20,18 +21,37 @@
{% set LOCALHOSTIP = salt['grains.get']('ip_interfaces').get(MAININT)[0] %}
{% set MANAGER = salt['grains.get']('master') %}
{% set MANAGERIP = salt['pillar.get']('global:managerip', '') %}
{% from 'filebeat/map.jinja' import THIRDPARTY with context %}
{% from 'filebeat/map.jinja' import SO with context %}
{% set ES_INCLUDED_NODES = ['so-eval', 'so-standalone', 'so-managersearch', 'so-node', 'so-heavynode', 'so-import'] %}
#only include elastic state for certain nodes
{% if grains.role in ES_INCLUDED_NODES %}
include:
- elasticsearch
{% endif %}
filebeatetcdir:
file.directory:
- name: /opt/so/conf/filebeat/etc
- user: 939
- group: 939
- makedirs: True
filebeatmoduledir:
file.directory:
- name: /opt/so/conf/filebeat/modules
- user: root
- group: root
- makedirs: True
filebeatlogdir:
file.directory:
- name: /opt/so/log/filebeat
- user: 939
- group: 939
- makedirs: True
filebeatpkidir:
file.directory:
- name: /opt/so/conf/filebeat/etc/pki
@@ -44,6 +64,7 @@ fileregistrydir:
- user: 939
- group: 939
- makedirs: True
# This needs to be owned by root
filebeatconfsync:
file.managed:
@@ -55,6 +76,33 @@ filebeatconfsync:
- defaults:
INPUTS: {{ salt['pillar.get']('filebeat:config:inputs', {}) }}
OUTPUT: {{ salt['pillar.get']('filebeat:config:output', {}) }}
# Filebeat module config file
filebeatmoduleconfsync:
file.managed:
- name: /opt/so/conf/filebeat/etc/module-setup.yml
- source: salt://filebeat/etc/module-setup.yml
- user: root
- group: root
- mode: 640
- template: jinja
sodefaults_module_conf:
file.managed:
- name: /opt/so/conf/filebeat/modules/securityonion.yml
- source: salt://filebeat/etc/module_config.yml.jinja
- template: jinja
- defaults:
MODULES: {{ SO }}
thirdparty_module_conf:
file.managed:
- name: /opt/so/conf/filebeat/modules/thirdparty.yml
- source: salt://filebeat/etc/module_config.yml.jinja
- template: jinja
- defaults:
MODULES: {{ THIRDPARTY }}
so-filebeat:
docker_container.running:
- image: {{ MANAGER }}:5000/{{ IMAGEREPO }}/so-filebeat:{{ VERSION }}
@@ -65,19 +113,41 @@ so-filebeat:
- /nsm:/nsm:ro
- /opt/so/log/filebeat:/usr/share/filebeat/logs:rw
- /opt/so/conf/filebeat/etc/filebeat.yml:/usr/share/filebeat/filebeat.yml:ro
- /opt/so/conf/filebeat/etc/module-setup.yml:/usr/share/filebeat/module-setup.yml:ro
- /nsm/wazuh/logs/alerts:/wazuh/alerts:ro
- /nsm/wazuh/logs/archives:/wazuh/archives:ro
- /opt/so/conf/filebeat/modules:/usr/share/filebeat/modules.d
- /opt/so/conf/filebeat/etc/pki/filebeat.crt:/usr/share/filebeat/filebeat.crt:ro
- /opt/so/conf/filebeat/etc/pki/filebeat.key:/usr/share/filebeat/filebeat.key:ro
- /opt/so/conf/filebeat/registry:/usr/share/filebeat/data/registry:rw
- /etc/ssl/certs/intca.crt:/usr/share/filebeat/intraca.crt:ro
- /opt/so/log:/logs:ro
- port_bindings:
- 0.0.0.0:514:514/udp
- 0.0.0.0:514:514/tcp
- 0.0.0.0:5066:5066/tcp
{% for module in THIRDPARTY.modules.keys() %}
{% for submodule in THIRDPARTY.modules[module] %}
{% if THIRDPARTY.modules[module][submodule].enabled and THIRDPARTY.modules[module][submodule]["var.syslog_port"] is defined %}
- {{ THIRDPARTY.modules[module][submodule].get("var.syslog_host", "0.0.0.0") }}:{{ THIRDPARTY.modules[module][submodule]["var.syslog_port"] }}:{{ THIRDPARTY.modules[module][submodule]["var.syslog_port"] }}/tcp
- {{ THIRDPARTY.modules[module][submodule].get("var.syslog_host", "0.0.0.0") }}:{{ THIRDPARTY.modules[module][submodule]["var.syslog_port"] }}:{{ THIRDPARTY.modules[module][submodule]["var.syslog_port"] }}/udp
{% endif %}
{% endfor %}
{% endfor %}
- watch:
- file: /opt/so/conf/filebeat/etc/filebeat.yml
{% if grains.role in ES_INCLUDED_NODES %}
run_module_setup:
cmd.run:
- name: /usr/sbin/so-filebeat-module-setup
- require:
- file: filebeatmoduleconfsync
- docker_container: so-filebeat
- onchanges:
- docker_container: so-elasticsearch
{% endif %}
append_so-filebeat_so-status.conf:
file.append:
- name: /opt/so/conf/so-status/so-status.conf

6
salt/filebeat/map.jinja Normal file
View File

@@ -0,0 +1,6 @@
{% import_yaml 'filebeat/thirdpartydefaults.yaml' as TPDEFAULTS %}
{% set THIRDPARTY = salt['pillar.get']('filebeat:third_party_filebeat', default=TPDEFAULTS.third_party_filebeat, merge=True) %}
{% import_yaml 'filebeat/securityoniondefaults.yaml' as SODEFAULTS %}
{% set SO = SODEFAULTS.securityonion_filebeat %}
{#% set SO = salt['pillar.get']('filebeat:third_party_filebeat', default=SODEFAULTS.third_party_filebeat, merge=True) %#}

View File

@@ -0,0 +1,31 @@
{%- set ZEEKVER = salt['pillar.get']('global:mdengine', '') %}
{% set ZEEKLOGLOOKUP = {
'conn': 'connection',
} %}
securityonion_filebeat:
modules:
{%- if grains['role'] in ['so-manager', 'so-eval', 'so-managersearch', 'so-standalone','so-node', 'so-hotnode', 'so-warmnode', 'so-heavynode'] %}
elasticsearch:
server:
enabled: true
var.paths: ["/logs/elasticsearch/*.log"]
logstash:
log:
enabled: true
var.paths: ["/logs/logstash.log"]
{%- endif %}
{%- if grains['role'] in ['so-manager', 'so-eval', 'so-managersearch', 'so-standalone'] %}
kibana:
log:
enabled: true
var.paths: ["/logs/kibana/kibana.log"]
{%- endif %}
{%- if grains['role'] in ['so-manager', 'so-eval', 'so-managersearch', 'so-standalone', 'so-heavynode'] %}
redis:
log:
enabled: true
var.paths: ["/logs/redis.log"]
slowlog:
enabled: false
{%- endif %}

View File

@@ -0,0 +1,252 @@
third_party_filebeat:
modules:
aws:
cloudtrail:
enabled: false
cloudwatch:
enabled: false
ec2:
enabled: false
elb:
enabled: false
s3access:
enabled: false
vpcflow:
enabled: false
azure:
activitylogs:
enabled: false
platformlogs:
enabled: false
auditlogs:
enabled: false
signinlogs:
enabled: false
barracuda:
waf:
enabled: false
var.input: udp
var.syslog_host: 0.0.0.0
var.syslog_port: 9503
spamfirewall:
enabled: false
var.input: udp
var.syslog_host: 0.0.0.0
var.syslog_port: 9524
bluecoat:
director:
enabled: false
var.input: udp
var.syslog_host: 0.0.0.0
var.syslog_port: 9505
cef:
log:
enabled: false
var.syslog_host: 0.0.0.0
var.syslog_port: 9003
checkpoint:
firewall:
enabled: false
var.syslog_host: 0.0.0.0
var.syslog_port: 9505
cisco:
asa:
enabled: false
var.syslog_host: 0.0.0.0
var.syslog_port: 9001
ftd:
enabled: false
var.syslog_host: 0.0.0.0
var.syslog_port: 9003
ios:
enabled: false
var.syslog_host: 0.0.0.0
var.syslog_port: 9002
nexus:
enabled: false
var.syslog_host: 0.0.0.0
var.syslog_port: 9506
meraki:
enabled: false
var.syslog_host: 0.0.0.0
var.syslog_port: 9525
umbrella:
enabled: false
amp:
enabled: false
cyberark:
corepas:
enabled: false
var.input: udp
var.syslog_host: 0.0.0.0
var.syslog_port: 9527
cylance:
protect:
enabled: false
var.input: udp
var.syslog_host: 0.0.0.0
var.syslog_port: 9508
f5:
bigipapm:
enabled: false
var.input: udp
var.syslog_host: 0.0.0.0
var.syslog_port: 9504
bigipafm:
enabled: false
var.input: udp
var.syslog_host: 0.0.0.0
var.syslog_port: 9528
fortinet:
firewall:
enabled: false
var.input: udp
var.syslog_host: 0.0.0.0
var.syslog_port: 9004
clientendpoint:
enabled: false
var.input: udp
var.syslog_host: 0.0.0.0
var.syslog_port: 9510
fortimail:
enabled: false
var.input: udp
var.syslog_port: 9350
gcp:
vpcflow:
enabled: false
firewall:
enabled: false
audit:
enabled: false
google_workspace:
saml:
enabled: false
user_accounts:
enabled: false
login:
enabled: false
admin:
enabled: false
drive:
enabled: false
groups:
enabled: false
imperva:
securesphere:
enabled: false
var.input: udp
var.syslog_host: 0.0.0.0
var.syslog_port: 9511
infoblox:
nios:
enabled: false
var.input: udp
var.syslog_host: 0.0.0.0
var.syslog_port: 9512
juniper:
junos:
enabled: false
var.input: udp
var.syslog_host: 0.0.0.0
var.syslog_port: 9513
netscreen:
enabled: false
var.input: udp
var.syslog_host: 0.0.0.0
var.syslog_port: 9523
srx:
enabled: false
var.input: udp
var.syslog_host: 0.0.0.0
var.syslog_port: 9006
microsoft:
defender_atp:
enabled: false
m365_defender:
enabled: false
dhcp:
enabled: false
var.input: udp
var.syslog_host: 0.0.0.0
var.syslog_port: 9515
misp:
threat:
enabled: false
netflow:
log:
enabled: false
var.netflow_host: 0.0.0.0
var.netflow_port: 2055
var.internal_networks:
- private
netscout:
sightline:
enabled: false
var.input: udp
var.syslog_host: 0.0.0.0
var.syslog_port: 9502
o365:
audit:
enabled: false
okta:
system:
enabled: false
proofpoint:
emailsecurity:
enabled: false
var.input: udp
var.syslog_host: 0.0.0.0
var.syslog_port: 9531
radware:
defensepro:
enabled: false
var.input: udp
var.syslog_host: 0.0.0.0
var.syslog_port: 9518
snort:
log:
enabled: false
var.input: udp
var.syslog_host: 0.0.0.0
var.syslog_port: 9532
snyk:
audit:
enabled: false
vulnerabilities:
enabled: false
sonicwall:
firewall:
enabled: false
var.input: udp
var.syslog_host: 0.0.0.0
var.syslog_port: 9519
sophos:
xg:
enabled: false
var.input: udp
var.syslog_host: 0.0.0.0
var.syslog_port: 9005
utm:
enabled: false
var.input: udp
var.syslog_host: 0.0.0.0
var.syslog_port: 9533
squid:
log:
enabled: false
var.input: udp
var.syslog_host: 0.0.0.0
var.syslog_port: 9520
tomcat:
log:
enabled: false
var.input: udp
var.syslog_host: 0.0.0.0
var.syslog_port: 9501
zscaler:
zia:
enabled: false
var.input: udp
var.syslog_host: 0.0.0.0
var.syslog_port: 9521

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,21 @@
{% set measurements = salt['cmd.shell']('docker exec -t so-influxdb influx -format json -ssl -unsafeSsl -database telegraf -execute "show measurements" 2> /root/measurement_query.log | jq -r .results[0].series[0].values[]?[0] 2>> /root/measurement_query.log') %}
influxdb:
retention_policies:
so_short_term:
default: True
duration: 30d
shard_duration: 1d
so_long_term:
default: False
duration: 0d
shard_duration: 7d
downsample:
so_long_term:
resolution: 5m
{% if measurements|length > 0 %}
measurements:
{% for measurement in measurements.splitlines() %}
- {{ measurement }}
{% endfor %}
{% endif %}

View File

@@ -2,12 +2,21 @@
{% if sls in allowed_states %}
{% set GRAFANA = salt['pillar.get']('manager:grafana', '0') %}
{% set MANAGER = salt['grains.get']('master') %}
{% set VERSION = salt['pillar.get']('global:soversion', 'HH1.2.2') %}
{% set IMAGEREPO = salt['pillar.get']('global:imagerepo') %}
{% if grains['role'] in ['so-manager', 'so-managersearch', 'so-standalone'] or (grains.role == 'so-eval' and GRAFANA == 1) %}
{% set MANAGER = salt['grains.get']('master') %}
{% set VERSION = salt['pillar.get']('global:soversion', 'HH1.2.2') %}
{% set IMAGEREPO = salt['pillar.get']('global:imagerepo') %}
{% import_yaml 'influxdb/defaults.yaml' as default_settings %}
{% set influxdb = salt['grains.filter_by'](default_settings, default='influxdb', merge=salt['pillar.get']('influxdb', {})) %}
{% from 'salt/map.jinja' import PYTHON3INFLUX with context %}
{% from 'salt/map.jinja' import PYTHONINFLUXVERSION with context %}
{% set PYTHONINFLUXVERSIONINSTALLED = salt['cmd.run']("python3 -c \"exec('try:import influxdb; print (influxdb.__version__)\\nexcept:print(\\'Module Not Found\\')')\"", python_shell=True) %}
include:
- salt.minion
- salt.python3-influxdb
# Influx DB
influxconfdir:
file.directory:
@@ -57,6 +66,71 @@ append_so-influxdb_so-status.conf:
- name: /opt/so/conf/so-status/so-status.conf
- text: so-influxdb
# We have to make sure the influxdb module is the right version prior to state run since reload_modules is bugged
{% if PYTHONINFLUXVERSIONINSTALLED == PYTHONINFLUXVERSION %}
wait_for_influxdb:
http.query:
- name: 'https://{{MANAGER}}:8086/query?q=SHOW+DATABASES'
- ssl: True
- verify_ssl: False
- status: 200
- timeout: 30
- retry:
attempts: 5
interval: 60
telegraf_database:
influxdb_database.present:
- name: telegraf
- database: telegraf
- ssl: True
- verify_ssl: /etc/pki/ca.crt
- cert: ['/etc/pki/influxdb.crt', '/etc/pki/influxdb.key']
- influxdb_host: {{ MANAGER }}
- require:
- docker_container: so-influxdb
- sls: salt.python3-influxdb
- http: wait_for_influxdb
{% for rp in influxdb.retention_policies.keys() %}
{{rp}}_retention_policy:
influxdb_retention_policy.present:
- name: {{rp}}
- database: telegraf
- duration: {{influxdb.retention_policies[rp].duration}}
- shard_duration: {{influxdb.retention_policies[rp].shard_duration}}
- replication: 1
- default: {{influxdb.retention_policies[rp].get('default', 'False')}}
- ssl: True
- verify_ssl: /etc/pki/ca.crt
- cert: ['/etc/pki/influxdb.crt', '/etc/pki/influxdb.key']
- influxdb_host: {{ MANAGER }}
- require:
- docker_container: so-influxdb
- influxdb_database: telegraf_database
- file: influxdb_retention_policy.present_patch
- sls: salt.python3-influxdb
{% endfor %}
{% for dest_rp in influxdb.downsample.keys() %}
{% for measurement in influxdb.downsample[dest_rp].get('measurements', []) %}
so_downsample_{{measurement}}_cq:
influxdb_continuous_query.present:
- name: so_downsample_{{measurement}}_cq
- database: telegraf
- query: SELECT mean(*) INTO "{{dest_rp}}"."{{measurement}}" FROM "{{measurement}}" GROUP BY time({{influxdb.downsample[dest_rp].resolution}}),*
- ssl: True
- verify_ssl: /etc/pki/ca.crt
- cert: ['/etc/pki/influxdb.crt', '/etc/pki/influxdb.key']
- influxdb_host: {{ MANAGER }}
- require:
- docker_container: so-influxdb
- influxdb_database: telegraf_database
- file: influxdb_continuous_query.present_patch
{% endfor %}
{% endfor %}
{% endif %}
{% endif %}
{% else %}

View File

@@ -1,6 +1,4 @@
#!/bin/bash
# {%- set FLEET_MANAGER = salt['pillar.get']('global:fleet_manager', False) -%}
# {%- set FLEET_NODE = salt['pillar.get']('global:fleet_node', False) -%}
# {%- set MANAGER = salt['pillar.get']('global:url_base', '') %}
. /usr/sbin/so-common
@@ -8,19 +6,12 @@
# Copy template file
cp /opt/so/conf/kibana/saved_objects.ndjson.template /opt/so/conf/kibana/saved_objects.ndjson
# {% if FLEET_NODE or FLEET_MANAGER %}
# Fleet IP
#sed -i "s/FLEETPLACEHOLDER/{{ MANAGER }}/g" /opt/so/conf/kibana/saved_objects.ndjson
# {% endif %}
# SOCtopus and Manager
sed -i "s/PLACEHOLDER/{{ MANAGER }}/g" /opt/so/conf/kibana/saved_objects.ndjson
wait_for_web_response "http://localhost:5601/app/kibana" "Elastic"
## This hackery will be removed if using Elastic Auth ##
wait_for_web_response "http://localhost:5601/app/kibana" "Elastic" 300 "{{ ELASTICCURL }}"
# Let's snag a cookie from Kibana
THECOOKIE=$(curl -c - -X GET http://localhost:5601/ | grep sid | awk '{print $7}')
SESSIONCOOKIE=$({{ ELASTICCURL }} -c - -X GET http://localhost:5601/ | grep sid | awk '{print $7}')
# Load saved objects
curl -b "sid=$THECOOKIE" -L -X POST "localhost:5601/api/saved_objects/_import?overwrite=true" -H "kbn-xsrf: true" --form file=@/opt/so/conf/kibana/saved_objects.ndjson >> /opt/so/log/kibana/misc.log
{{ ELASTICCURL }} -b "sid=$SESSIONCOOKIE" -L -X POST "localhost:5601/api/saved_objects/_import?overwrite=true" -H "kbn-xsrf: true" --form file=@/opt/so/conf/kibana/saved_objects.ndjson >> /opt/so/log/kibana/misc.log

View File

@@ -1,10 +0,0 @@
{ "attributes":
{
"defaultIndex": "2289a0c0-6970-11ea-a0cd-ffa0f6a1bc29",
"defaultRoute":"/app/kibana#/dashboard/a8411b30-6d03-11ea-b301-3d6c35840645",
"discover:sampleSize":"100",
"dashboard:defaultDarkTheme":true,
"theme:darkMode":true,
"timepicker:timeDefaults":"{\n \"from\": \"now-24h\",\n \"to\": \"now\"\n}"
}
}

View File

@@ -1,20 +1,26 @@
---
# Default Kibana configuration from kibana-docker.
{%- set ES = salt['pillar.get']('manager:mainip', '') -%}
{%- set ES_USER = salt['pillar.get']('elasticsearch:auth:users:so_elastic_user:user', '') %}
{%- set ES_PASS = salt['pillar.get']('elasticsearch:auth:users:so_elastic_user:pass', '') %}
server.name: kibana
server.host: "0"
server.basePath: /kibana
elasticsearch.hosts: [ "https://{{ ES }}:9200" ]
elasticsearch.ssl.verificationMode: none
#kibana.index: ".kibana"
#elasticsearch.username: elastic
#elasticsearch.password: changeme
{% if salt['pillar.get']('elasticsearch:auth:enabled') is sameas true %}
elasticsearch.username: {{ ES_USER }}
elasticsearch.password: {{ ES_PASS }}
{% endif %}
#xpack.monitoring.ui.container.elasticsearch.enabled: true
elasticsearch.requestTimeout: 90000
logging.dest: /var/log/kibana/kibana.log
telemetry.enabled: false
security.showInsecureClusterWarning: false
{% if not salt['pillar.get']('elasticsearch:auth:enabled', False) %}
xpack.security.authc.providers:
anonymous.anonymous1:
order: 0
credentials: "elasticsearch_anonymous_user"
{% endif %}

View File

@@ -460,7 +460,7 @@
{"attributes":{"description":"","hits":0,"kibanaSavedObjectMeta":{"searchSourceJSON":"{\"highlightAll\":true,\"version\":true,\"query\":{\"query\":{\"query_string\":{\"analyze_wildcard\":true,\"query\":\"*\",\"default_field\":\"*\",\"time_zone\":\"America/New_York\"}},\"language\":\"lucene\"},\"filter\":[]}"},"optionsJSON":"{\"darkTheme\":true,\"useMargins\":true}","panelsJSON":"[{\"version\":\"7.9.0\",\"gridData\":{\"w\":8,\"h\":48,\"x\":0,\"y\":0,\"i\":\"1\"},\"panelIndex\":\"1\",\"embeddableConfig\":{\"enhancements\":{}},\"panelRefName\":\"panel_0\"},{\"version\":\"7.9.0\",\"gridData\":{\"w\":32,\"h\":8,\"x\":16,\"y\":0,\"i\":\"2\"},\"panelIndex\":\"2\",\"embeddableConfig\":{\"enhancements\":{}},\"panelRefName\":\"panel_1\"},{\"version\":\"7.9.0\",\"gridData\":{\"w\":48,\"h\":24,\"x\":0,\"y\":96,\"i\":\"6\"},\"panelIndex\":\"6\",\"embeddableConfig\":{\"enhancements\":{}},\"panelRefName\":\"panel_2\"},{\"version\":\"7.9.0\",\"gridData\":{\"w\":20,\"h\":28,\"x\":8,\"y\":20,\"i\":\"7\"},\"panelIndex\":\"7\",\"embeddableConfig\":{\"enhancements\":{}},\"panelRefName\":\"panel_3\"},{\"version\":\"7.9.0\",\"gridData\":{\"w\":20,\"h\":28,\"x\":28,\"y\":20,\"i\":\"8\"},\"panelIndex\":\"8\",\"embeddableConfig\":{\"enhancements\":{}},\"panelRefName\":\"panel_4\"},{\"version\":\"7.9.0\",\"gridData\":{\"w\":16,\"h\":24,\"x\":0,\"y\":72,\"i\":\"9\"},\"panelIndex\":\"9\",\"embeddableConfig\":{\"enhancements\":{}},\"panelRefName\":\"panel_5\"},{\"version\":\"7.9.0\",\"gridData\":{\"w\":48,\"h\":24,\"x\":0,\"y\":48,\"i\":\"10\"},\"panelIndex\":\"10\",\"embeddableConfig\":{\"enhancements\":{}},\"panelRefName\":\"panel_6\"},{\"version\":\"7.9.0\",\"gridData\":{\"w\":20,\"h\":12,\"x\":8,\"y\":8,\"i\":\"11\"},\"panelIndex\":\"11\",\"embeddableConfig\":{\"enhancements\":{}},\"panelRefName\":\"panel_7\"},{\"version\":\"7.9.0\",\"gridData\":{\"w\":32,\"h\":24,\"x\":16,\"y\":72,\"i\":\"12\"},\"panelIndex\":\"12\",\"embeddableConfig\":{\"enhancements\":{}},\"panelRefName\":\"panel_8\"},{\"version\":\"7.9.0\",\"gridData\":{\"w\":20,\"h\":12,\"x\":28,\"y\":8,\"i\":\"13\"},\"panelIndex\":\"13\",\"embeddableConfig\":{\"enhancements\":{}},\"panelRefName\":\"panel_9\"},{\"version\":\"7.9.0\",\"gridData\":{\"w\":48,\"h\":24,\"x\":0,\"y\":120,\"i\":\"14\"},\"panelIndex\":\"14\",\"embeddableConfig\":{\"columns\":[\"event_type\",\"source_ip\",\"source_port\",\"destination_ip\",\"destination_port\",\"_id\"],\"sort\":[\"@timestamp\",\"desc\"],\"enhancements\":{}},\"panelRefName\":\"panel_10\"},{\"version\":\"7.9.0\",\"gridData\":{\"w\":8,\"h\":8,\"x\":8,\"y\":0,\"i\":\"15\"},\"panelIndex\":\"15\",\"embeddableConfig\":{\"enhancements\":{}},\"panelRefName\":\"panel_11\"}]","timeRestore":false,"title":"z16.04 - Sysmon - Logs","version":1},"id":"6d189680-6d62-11e7-8ddb-e71eb260f4a3","migrationVersion":{"dashboard":"7.11.0"},"references":[{"id":"b3b449d0-3429-11e7-9d52-4f090484f59e","name":"panel_0","type":"visualization"},{"id":"8cfdeff0-6d6b-11e7-ad64-15aa071374a6","name":"panel_1","type":"visualization"},{"id":"0eb1fd80-6d70-11e7-b09b-f57b22df6524","name":"panel_2","type":"visualization"},{"id":"3072c750-6d71-11e7-b09b-f57b22df6524","name":"panel_3","type":"visualization"},{"id":"7bc74b40-6d71-11e7-b09b-f57b22df6524","name":"panel_4","type":"visualization"},{"id":"13ed0810-6d72-11e7-b09b-f57b22df6524","name":"panel_5","type":"visualization"},{"id":"3b6c92c0-6d72-11e7-b09b-f57b22df6524","name":"panel_6","type":"visualization"},{"id":"e09f6010-6d72-11e7-b09b-f57b22df6524","name":"panel_7","type":"visualization"},{"id":"29611940-6d75-11e7-b09b-f57b22df6524","name":"panel_8","type":"visualization"},{"id":"6b70b840-6d75-11e7-b09b-f57b22df6524","name":"panel_9","type":"visualization"},{"id":"248c1d20-6d6b-11e7-ad64-15aa071374a6","name":"panel_10","type":"search"},{"id":"AWDHHk1sxQT5EBNmq43Y","name":"panel_11","type":"visualization"}],"type":"dashboard","updated_at":"2021-03-19T14:35:12.119Z","version":"WzcwMTQyLDRd"}
{"attributes":{"description":"","kibanaSavedObjectMeta":{"searchSourceJSON":"{\"filter\":[],\"query\":{\"query\":\"\",\"language\":\"lucene\"}}"},"savedSearchRefName":"search_0","title":"SMB - Action (Pie Chart)","uiStateJSON":"{}","version":1,"visState":"{\"title\":\"SMB - Action (Pie Chart)\",\"type\":\"pie\",\"params\":{\"addTooltip\":true,\"addLegend\":true,\"legendPosition\":\"right\",\"isDonut\":true,\"type\":\"pie\",\"labels\":{\"show\":false,\"values\":true,\"last_level\":true,\"truncate\":100}},\"aggs\":[{\"id\":\"1\",\"enabled\":true,\"type\":\"count\",\"schema\":\"metric\",\"params\":{}},{\"id\":\"2\",\"enabled\":true,\"type\":\"terms\",\"schema\":\"segment\",\"params\":{\"field\":\"action.keyword\",\"otherBucket\":false,\"otherBucketLabel\":\"Other\",\"missingBucket\":false,\"missingBucketLabel\":\"Missing\",\"size\":20,\"order\":\"desc\",\"orderBy\":\"1\"}}]}"},"id":"6f883480-3aad-11e7-8b17-0d8709b02c80","migrationVersion":{"visualization":"7.11.0"},"references":[{"id":"19849f30-3aab-11e7-8b17-0d8709b02c80","name":"search_0","type":"search"}],"type":"visualization","updated_at":"2021-03-19T14:35:12.119Z","version":"WzcwMTQzLDRd"}
{"attributes":{"description":"","kibanaSavedObjectMeta":{"searchSourceJSON":"{\"indexRefName\":\"kibanaSavedObjectMeta.searchSourceJSON.index\"}"},"title":"Security Onion - SSL - Subject","uiStateJSON":"{\"vis\":{\"params\":{\"sort\":{\"columnIndex\":null,\"direction\":null}}}}","version":1,"visState":"{\"title\":\"Security Onion - SSL - Subject\",\"type\":\"table\",\"params\":{\"perPage\":10,\"showPartialRows\":false,\"showMetricsAtAllLevels\":false,\"sort\":{\"columnIndex\":null,\"direction\":null},\"showTotal\":false,\"totalFunc\":\"sum\",\"percentageCol\":\"\",\"dimensions\":{\"metrics\":[{\"accessor\":1,\"format\":{\"id\":\"number\"},\"params\":{},\"label\":\"Count\",\"aggType\":\"count\"}],\"buckets\":[{\"accessor\":0,\"format\":{\"id\":\"terms\",\"params\":{\"id\":\"string\",\"otherBucketLabel\":\"Other\",\"missingBucketLabel\":\"Missing\",\"parsedUrl\":{\"origin\":\"https://PLACEHOLDER\",\"pathname\":\"/kibana/app/kibana\",\"basePath\":\"/kibana\"}}},\"params\":{},\"label\":\"ssl.certificate.subject.keyword: Descending\",\"aggType\":\"terms\"}]},\"showToolbar\":true},\"aggs\":[{\"id\":\"1\",\"enabled\":true,\"type\":\"count\",\"schema\":\"metric\",\"params\":{}},{\"id\":\"2\",\"enabled\":true,\"type\":\"terms\",\"schema\":\"bucket\",\"params\":{\"field\":\"ssl.certificate.subject.keyword\",\"orderBy\":\"1\",\"order\":\"desc\",\"size\":100,\"otherBucket\":false,\"otherBucketLabel\":\"Other\",\"missingBucket\":false,\"missingBucketLabel\":\"Missing\",\"customLabel\":\"Subject\"}}]}"},"id":"6fccb600-75ec-11ea-9565-7315f4ee5cac","migrationVersion":{"visualization":"7.11.0"},"references":[{"id":"2289a0c0-6970-11ea-a0cd-ffa0f6a1bc29","name":"kibanaSavedObjectMeta.searchSourceJSON.index","type":"index-pattern"}],"type":"visualization","updated_at":"2021-03-19T14:35:12.119Z","version":"WzcwMTQ0LDRd"}
{"attributes":{"buildNum":33984,"dashboard:defaultDarkTheme":true,"defaultIndex":"2289a0c0-6970-11ea-a0cd-ffa0f6a1bc29","defaultRoute":"/app/dashboards#/view/a8411b30-6d03-11ea-b301-3d6c35840645","discover:sampleSize":"100","theme:darkMode":true,"timepicker:timeDefaults":"{\n \"from\": \"now-24h\",\n \"to\": \"now\"\n}"},"id":"7.11.2","migrationVersion":{"config":"7.9.0"},"references":[],"type":"config","updated_at":"2021-03-19T14:35:12.119Z","version":"WzcwMTQ1LDRd"}
{"attributes":{"buildNum":39457,"defaultIndex":"2289a0c0-6970-11ea-a0cd-ffa0f6a1bc29","defaultRoute":"/app/dashboards#/view/a8411b30-6d03-11ea-b301-3d6c35840645","discover:sampleSize":100,"theme:darkMode":true,"timepicker:timeDefaults":"{\n \"from\": \"now-24h\",\n \"to\": \"now\"\n}"},"coreMigrationVersion":"7.13.2","id":"7.13.2","migrationVersion":{"config":"7.12.0"},"references":[],"type":"config","updated_at":"2021-04-29T21:42:52.430Z","version":"WzY3NTUsM10="}
{"attributes":{"description":"","kibanaSavedObjectMeta":{"searchSourceJSON":"{\"indexRefName\":\"kibanaSavedObjectMeta.searchSourceJSON.index\"}"},"title":"Strelka - File - MIME Flavors","uiStateJSON":"{\"vis\":{\"params\":{\"sort\":{\"columnIndex\":null,\"direction\":null}}}}","version":1,"visState":"{\"title\":\"Strelka - File - MIME Flavors\",\"type\":\"table\",\"params\":{\"perPage\":10,\"showPartialRows\":false,\"showMetricsAtAllLevels\":false,\"sort\":{\"columnIndex\":null,\"direction\":null},\"showTotal\":false,\"totalFunc\":\"sum\",\"percentageCol\":\"\",\"dimensions\":{\"metrics\":[{\"accessor\":0,\"format\":{\"id\":\"number\"},\"params\":{},\"label\":\"Count\",\"aggType\":\"count\"}],\"buckets\":[]},\"showToolbar\":true},\"aggs\":[{\"id\":\"1\",\"enabled\":true,\"type\":\"count\",\"schema\":\"metric\",\"params\":{}},{\"id\":\"2\",\"enabled\":true,\"type\":\"terms\",\"schema\":\"bucket\",\"params\":{\"field\":\"file.flavors.mime.keyword\",\"orderBy\":\"1\",\"order\":\"desc\",\"size\":100,\"otherBucket\":false,\"otherBucketLabel\":\"Other\",\"missingBucket\":false,\"missingBucketLabel\":\"Missing\"}}]}"},"id":"70243970-772c-11ea-bee5-af7f7c7b8e05","migrationVersion":{"visualization":"7.11.0"},"references":[{"id":"2289a0c0-6970-11ea-a0cd-ffa0f6a1bc29","name":"kibanaSavedObjectMeta.searchSourceJSON.index","type":"index-pattern"}],"type":"visualization","updated_at":"2021-03-19T14:35:12.119Z","version":"WzcwMTQ2LDRd"}
{"attributes":{"description":"","kibanaSavedObjectMeta":{"searchSourceJSON":"{\"filter\":[]}"},"savedSearchRefName":"search_0","title":"Modbus - Log Count","uiStateJSON":"{\"vis\":{\"defaultColors\":{\"0 - 100\":\"rgb(0,104,55)\"}}}","version":1,"visState":"{\"title\":\"Modbus - Log Count\",\"type\":\"metric\",\"params\":{\"addTooltip\":true,\"addLegend\":false,\"type\":\"gauge\",\"gauge\":{\"verticalSplit\":false,\"autoExtend\":false,\"percentageMode\":false,\"gaugeType\":\"Metric\",\"gaugeStyle\":\"Full\",\"backStyle\":\"Full\",\"orientation\":\"vertical\",\"colorSchema\":\"Green to Red\",\"gaugeColorMode\":\"None\",\"useRange\":false,\"colorsRange\":[{\"from\":0,\"to\":100}],\"invertColors\":false,\"labels\":{\"show\":false,\"color\":\"black\"},\"scale\":{\"show\":false,\"labels\":false,\"color\":\"#333\",\"width\":2},\"type\":\"simple\",\"style\":{\"fontSize\":\"30\",\"bgColor\":false,\"labelColor\":false,\"subText\":\"\",\"bgFill\":\"#FB9E00\"}}},\"aggs\":[{\"id\":\"1\",\"enabled\":true,\"type\":\"count\",\"schema\":\"metric\",\"params\":{}}],\"listeners\":{}}"},"id":"AWDG_9KpxQT5EBNmq4Oo","migrationVersion":{"visualization":"7.11.0"},"references":[{"id":"52dc9fe0-342e-11e7-9e93-53b62e1857b2","name":"search_0","type":"search"}],"type":"visualization","updated_at":"2021-03-19T14:35:12.119Z","version":"WzcwMTQ3LDRd"}
{"attributes":{"description":"","hits":0,"kibanaSavedObjectMeta":{"searchSourceJSON":"{\"highlightAll\":true,\"version\":true,\"query\":{\"query\":{\"query_string\":{\"analyze_wildcard\":true,\"query\":\"*\",\"default_field\":\"*\"}},\"language\":\"lucene\"},\"filter\":[]}"},"optionsJSON":"{\"darkTheme\":true,\"useMargins\":true}","panelsJSON":"[{\"version\":\"7.9.0\",\"gridData\":{\"w\":8,\"h\":56,\"x\":0,\"y\":0,\"i\":\"2\"},\"panelIndex\":\"2\",\"embeddableConfig\":{\"enhancements\":{}},\"panelRefName\":\"panel_0\"},{\"version\":\"7.9.0\",\"gridData\":{\"w\":32,\"h\":8,\"x\":16,\"y\":0,\"i\":\"3\"},\"panelIndex\":\"3\",\"embeddableConfig\":{\"enhancements\":{}},\"panelRefName\":\"panel_1\"},{\"version\":\"7.9.0\",\"gridData\":{\"w\":12,\"h\":24,\"x\":8,\"y\":32,\"i\":\"5\"},\"panelIndex\":\"5\",\"embeddableConfig\":{\"enhancements\":{}},\"panelRefName\":\"panel_2\"},{\"version\":\"7.9.0\",\"gridData\":{\"w\":12,\"h\":24,\"x\":20,\"y\":32,\"i\":\"6\"},\"panelIndex\":\"6\",\"embeddableConfig\":{\"enhancements\":{}},\"panelRefName\":\"panel_3\"},{\"version\":\"7.9.0\",\"gridData\":{\"w\":48,\"h\":24,\"x\":0,\"y\":56,\"i\":\"8\"},\"panelIndex\":\"8\",\"embeddableConfig\":{\"columns\":[\"source_ip\",\"source_port\",\"destination_ip\",\"destination_port\",\"uid\",\"_id\"],\"sort\":[\"@timestamp\",\"desc\"],\"enhancements\":{}},\"panelRefName\":\"panel_4\"},{\"version\":\"7.9.0\",\"gridData\":{\"w\":16,\"h\":24,\"x\":32,\"y\":32,\"i\":\"9\"},\"panelIndex\":\"9\",\"embeddableConfig\":{\"enhancements\":{}},\"panelRefName\":\"panel_5\"},{\"version\":\"7.9.0\",\"gridData\":{\"w\":8,\"h\":8,\"x\":8,\"y\":0,\"i\":\"10\"},\"panelIndex\":\"10\",\"embeddableConfig\":{\"enhancements\":{}},\"panelRefName\":\"panel_6\"},{\"version\":\"7.9.0\",\"gridData\":{\"w\":40,\"h\":24,\"x\":8,\"y\":8,\"i\":\"11\"},\"panelIndex\":\"11\",\"embeddableConfig\":{\"enhancements\":{}},\"panelRefName\":\"panel_7\"}]","timeRestore":false,"title":"z16.04 - Bro - Modbus","version":1},"id":"70c005f0-3583-11e7-a588-05992195c551","migrationVersion":{"dashboard":"7.11.0"},"references":[{"id":"b3b449d0-3429-11e7-9d52-4f090484f59e","name":"panel_0","type":"visualization"},{"id":"0d168a30-363f-11e7-a6f7-4f44d7bf1c33","name":"panel_1","type":"visualization"},{"id":"20eabd60-380b-11e7-a1cc-ebc6a7e70e84","name":"panel_2","type":"visualization"},{"id":"3c65f500-380b-11e7-a1cc-ebc6a7e70e84","name":"panel_3","type":"visualization"},{"id":"52dc9fe0-342e-11e7-9e93-53b62e1857b2","name":"panel_4","type":"search"},{"id":"178209e0-6e1b-11e7-b553-7f80727663c1","name":"panel_5","type":"visualization"},{"id":"AWDG_9KpxQT5EBNmq4Oo","name":"panel_6","type":"visualization"},{"id":"453f8b90-4a58-11e8-9b0a-f1d33346f773","name":"panel_7","type":"visualization"}],"type":"dashboard","updated_at":"2021-03-19T14:35:12.119Z","version":"WzcwMTQ4LDRd"}
@@ -730,4 +730,4 @@
{"attributes":{"description":"","kibanaSavedObjectMeta":{"searchSourceJSON":"{\"query\":{\"query\":\"\",\"language\":\"kuery\"},\"filter\":[],\"indexRefName\":\"kibanaSavedObjectMeta.searchSourceJSON.index\"}"},"title":"Security Onion - Syslog - Severity (Donut)","uiStateJSON":"{}","version":1,"visState":"{\"type\":\"pie\",\"aggs\":[{\"id\":\"1\",\"enabled\":true,\"type\":\"count\",\"schema\":\"metric\",\"params\":{}},{\"id\":\"2\",\"enabled\":true,\"type\":\"terms\",\"schema\":\"segment\",\"params\":{\"field\":\"syslog.severity.keyword\",\"orderBy\":\"1\",\"order\":\"desc\",\"size\":25,\"otherBucket\":false,\"otherBucketLabel\":\"Other\",\"missingBucket\":false,\"missingBucketLabel\":\"Missing\",\"customLabel\":\"Severity\"}}],\"params\":{\"type\":\"pie\",\"addTooltip\":true,\"addLegend\":true,\"legendPosition\":\"right\",\"isDonut\":true,\"labels\":{\"show\":false,\"values\":true,\"last_level\":true,\"truncate\":100},\"dimensions\":{\"metric\":{\"accessor\":1,\"format\":{\"id\":\"number\"},\"params\":{},\"label\":\"Count\",\"aggType\":\"count\"},\"buckets\":[{\"accessor\":0,\"format\":{\"id\":\"terms\",\"params\":{\"id\":\"string\",\"otherBucketLabel\":\"Other\",\"missingBucketLabel\":\"Missing\",\"parsedUrl\":{\"origin\":\"https://PLACEHOLDER\",\"pathname\":\"/kibana/app/kibana\",\"basePath\":\"/kibana\"}}},\"params\":{},\"label\":\"syslog.severity.keyword: Descending\",\"aggType\":\"terms\"}]}},\"title\":\"Security Onion - Syslog - Severity (Donut)\"}"},"id":"fc8d41a0-777b-11ea-bee5-af7f7c7b8e05","migrationVersion":{"visualization":"7.11.0"},"references":[{"id":"2289a0c0-6970-11ea-a0cd-ffa0f6a1bc29","name":"kibanaSavedObjectMeta.searchSourceJSON.index","type":"index-pattern"}],"type":"visualization","updated_at":"2021-03-19T14:35:12.119Z","version":"WzcwNDExLDRd"}
{"attributes":{"description":"","kibanaSavedObjectMeta":{"searchSourceJSON":"{}"},"savedSearchRefName":"search_0","title":"Security Onion - Connections - Top Source IPs","uiStateJSON":"{\"vis\":{\"params\":{\"sort\":{\"columnIndex\":null,\"direction\":null}}}}","version":1,"visState":"{\"title\":\"Security Onion - Connections - Top Source IPs\",\"type\":\"table\",\"params\":{\"perPage\":10,\"showPartialRows\":false,\"showMetricsAtAllLevels\":false,\"sort\":{\"columnIndex\":null,\"direction\":null},\"showTotal\":false,\"totalFunc\":\"sum\",\"percentageCol\":\"\",\"dimensions\":{\"metrics\":[{\"accessor\":1,\"format\":{\"id\":\"number\"},\"params\":{},\"label\":\"Count\",\"aggType\":\"count\"}],\"buckets\":[{\"accessor\":0,\"format\":{\"id\":\"terms\",\"params\":{\"id\":\"string\",\"otherBucketLabel\":\"Other\",\"missingBucketLabel\":\"Missing\",\"parsedUrl\":{\"origin\":\"https://PLACEHOLDER\",\"pathname\":\"/kibana/app/kibana\",\"basePath\":\"/kibana\"}}},\"params\":{},\"label\":\"source.ip: Descending\",\"aggType\":\"terms\"}]},\"showToolbar\":true},\"aggs\":[{\"id\":\"1\",\"enabled\":true,\"type\":\"count\",\"schema\":\"metric\",\"params\":{}},{\"id\":\"2\",\"enabled\":true,\"type\":\"terms\",\"schema\":\"bucket\",\"params\":{\"field\":\"source.ip\",\"orderBy\":\"1\",\"order\":\"desc\",\"size\":10,\"otherBucket\":false,\"otherBucketLabel\":\"Other\",\"missingBucket\":false,\"missingBucketLabel\":\"Missing\",\"customLabel\":\"Source IP\"}}]}"},"id":"fd8b4640-6e9f-11ea-9266-1fd14ca6af34","migrationVersion":{"visualization":"7.11.0"},"references":[{"id":"9b333020-6e9f-11ea-9266-1fd14ca6af34","name":"search_0","type":"search"}],"type":"visualization","updated_at":"2021-03-19T14:35:12.119Z","version":"WzcwNDEyLDRd"}
{"attributes":{"description":"","hits":0,"kibanaSavedObjectMeta":{"searchSourceJSON":"{\"query\":{\"language\":\"kuery\",\"query\":\"event.module:strelka\"},\"filter\":[]}"},"optionsJSON":"{\"hidePanelTitles\":false,\"useMargins\":true}","panelsJSON":"[{\"version\":\"7.6.1\",\"gridData\":{\"x\":0,\"y\":0,\"w\":8,\"h\":7,\"i\":\"a2e0a619-a5c5-40d9-8593-e60f13ae22bf\"},\"panelIndex\":\"a2e0a619-a5c5-40d9-8593-e60f13ae22bf\",\"embeddableConfig\":{\"enhancements\":{}},\"panelRefName\":\"panel_0\"},{\"version\":\"7.6.1\",\"gridData\":{\"x\":8,\"y\":0,\"w\":21,\"h\":7,\"i\":\"566a9d04-f2dc-4868-9625-97a19d985703\"},\"panelIndex\":\"566a9d04-f2dc-4868-9625-97a19d985703\",\"embeddableConfig\":{\"enhancements\":{}},\"panelRefName\":\"panel_1\"},{\"version\":\"7.6.1\",\"gridData\":{\"x\":29,\"y\":0,\"w\":19,\"h\":7,\"i\":\"f247ec64-c278-4e05-ac4d-983bea9dfb7d\"},\"panelIndex\":\"f247ec64-c278-4e05-ac4d-983bea9dfb7d\",\"embeddableConfig\":{\"enhancements\":{}},\"panelRefName\":\"panel_2\"},{\"version\":\"7.6.1\",\"gridData\":{\"x\":0,\"y\":7,\"w\":12,\"h\":20,\"i\":\"6e80a142-ab0e-4fd3-891c-e495b78a1625\"},\"panelIndex\":\"6e80a142-ab0e-4fd3-891c-e495b78a1625\",\"embeddableConfig\":{\"enhancements\":{}},\"panelRefName\":\"panel_3\"},{\"version\":\"7.6.1\",\"gridData\":{\"x\":12,\"y\":7,\"w\":11,\"h\":20,\"i\":\"292cc879-6bc0-4541-ba92-3b3c5f4e3368\"},\"panelIndex\":\"292cc879-6bc0-4541-ba92-3b3c5f4e3368\",\"embeddableConfig\":{\"enhancements\":{}},\"panelRefName\":\"panel_4\"},{\"version\":\"7.6.1\",\"gridData\":{\"x\":23,\"y\":7,\"w\":14,\"h\":20,\"i\":\"66979b2c-e7c1-4291-91ac-16537b7f9ec3\"},\"panelIndex\":\"66979b2c-e7c1-4291-91ac-16537b7f9ec3\",\"embeddableConfig\":{\"enhancements\":{}},\"panelRefName\":\"panel_5\"},{\"version\":\"7.6.1\",\"gridData\":{\"x\":37,\"y\":7,\"w\":11,\"h\":20,\"i\":\"8bb1cf98-0401-4a2d-9dd8-deca08205a22\"},\"panelIndex\":\"8bb1cf98-0401-4a2d-9dd8-deca08205a22\",\"embeddableConfig\":{\"enhancements\":{}},\"panelRefName\":\"panel_6\"},{\"version\":\"7.6.1\",\"gridData\":{\"x\":0,\"y\":27,\"w\":8,\"h\":20,\"i\":\"393f3cec-3ee0-4275-b319-f307e7a260c6\"},\"panelIndex\":\"393f3cec-3ee0-4275-b319-f307e7a260c6\",\"embeddableConfig\":{\"enhancements\":{}},\"panelRefName\":\"panel_7\"},{\"version\":\"7.6.1\",\"gridData\":{\"x\":8,\"y\":27,\"w\":15,\"h\":20,\"i\":\"0e8800a9-a6f5-4a79-8370-61713f584886\"},\"panelIndex\":\"0e8800a9-a6f5-4a79-8370-61713f584886\",\"embeddableConfig\":{\"enhancements\":{}},\"panelRefName\":\"panel_8\"},{\"version\":\"7.6.1\",\"gridData\":{\"x\":23,\"y\":27,\"w\":25,\"h\":20,\"i\":\"be9a0a2a-d8c6-4d15-b5d7-d5599d0482a3\"},\"panelIndex\":\"be9a0a2a-d8c6-4d15-b5d7-d5599d0482a3\",\"embeddableConfig\":{\"enhancements\":{}},\"panelRefName\":\"panel_9\"},{\"version\":\"7.6.1\",\"gridData\":{\"x\":0,\"y\":47,\"w\":48,\"h\":27,\"i\":\"40296d2b-cb6f-423f-989c-3fdaa82d2aad\"},\"panelIndex\":\"40296d2b-cb6f-423f-989c-3fdaa82d2aad\",\"embeddableConfig\":{\"enhancements\":{}},\"panelRefName\":\"panel_10\"}]","timeRestore":false,"title":"Security Onion - Strelka","version":1},"id":"ff689c50-75f3-11ea-9565-7315f4ee5cac","migrationVersion":{"dashboard":"7.11.0"},"references":[{"id":"8cfec8c0-6ec2-11ea-9266-1fd14ca6af34","name":"panel_0","type":"visualization"},{"id":"d04b5130-6e99-11ea-9266-1fd14ca6af34","name":"panel_1","type":"visualization"},{"id":"23ed13a0-6e9a-11ea-9266-1fd14ca6af34","name":"panel_2","type":"visualization"},{"id":"7a88adc0-75f0-11ea-9565-7315f4ee5cac","name":"panel_3","type":"visualization"},{"id":"49cfe850-772c-11ea-bee5-af7f7c7b8e05","name":"panel_4","type":"visualization"},{"id":"70243970-772c-11ea-bee5-af7f7c7b8e05","name":"panel_5","type":"visualization"},{"id":"ce9e03f0-772c-11ea-bee5-af7f7c7b8e05","name":"panel_6","type":"visualization"},{"id":"a7ebb450-772c-11ea-bee5-af7f7c7b8e05","name":"panel_7","type":"visualization"},{"id":"08c0b770-772e-11ea-bee5-af7f7c7b8e05","name":"panel_8","type":"visualization"},{"id":"e087c7d0-772d-11ea-bee5-af7f7c7b8e05","name":"panel_9","type":"visualization"},{"id":"8b6f3150-72a2-11ea-8dd2-9d8795a1200b","name":"panel_10","type":"search"}],"type":"dashboard","updated_at":"2021-03-19T14:35:12.119Z","version":"WzcwNDEzLDRd"}
{"exportedCount":732,"missingRefCount":0,"missingReferences":[]}
{"exportedCount":732,"missingRefCount":0,"missingReferences":[]}

View File

@@ -4,6 +4,7 @@
{% set VERSION = salt['pillar.get']('global:soversion', 'HH1.2.2') %}
{% set IMAGEREPO = salt['pillar.get']('global:imagerepo') %}
{% set MANAGER = salt['grains.get']('master') %}
{% from 'elasticsearch/auth.map.jinja' import ELASTICAUTH with context %}
# Add ES Group
kibanasearchgroup:
@@ -34,6 +35,7 @@ synckibanaconfig:
- source: salt://kibana/etc
- user: 932
- group: 939
- file_mode: 660
- template: jinja
kibanalogdir:
@@ -63,6 +65,8 @@ kibanabin:
- source: salt://kibana/bin/so-kibana-config-load
- mode: 755
- template: jinja
- defaults:
ELASTICCURL: {{ ELASTICAUTH.elasticcurl }}
# Start the kibana docker
so-kibana:
@@ -113,4 +117,4 @@ so-kibana-config-load:
test.fail_without_changes:
- name: {{sls}}_state_not_allowed
{% endif %}
{% endif %}

View File

@@ -78,6 +78,7 @@ ls_pipeline_{{PL}}_{{CONFIGFILE.split('.')[0] | replace("/","_") }}:
{% endif %}
- user: 931
- group: 939
- mode: 660
- makedirs: True
{% endfor %}

View File

@@ -3,4 +3,9 @@ input {
port => "5044"
tags => [ "beat-ext" ]
}
}
filter {
mutate {
rename => {"@metadata" => "metadata"}
}
}

View File

@@ -3,11 +3,17 @@
{%- else %}
{%- set ES = salt['pillar.get']('elasticsearch:mainip', '') -%}
{%- endif %}
{%- set ES_USER = salt['pillar.get']('elasticsearch:auth:users:so_elastic_user:user', '') %}
{%- set ES_PASS = salt['pillar.get']('elasticsearch:auth:users:so_elastic_user:pass', '') %}
output {
if [module] =~ "zeek" and "import" not in [tags] {
elasticsearch {
pipeline => "%{module}.%{dataset}"
hosts => "{{ ES }}"
{% if salt['pillar.get']('elasticsearch:auth:enabled') is sameas true %}
user => "{{ ES_USER }}"
password => "{{ ES_PASS }}"
{% endif %}
index => "so-zeek"
template_name => "so-zeek"
template => "/templates/so-zeek-template.json"

View File

@@ -3,11 +3,17 @@
{%- else %}
{%- set ES = salt['pillar.get']('elasticsearch:mainip', '') -%}
{%- endif %}
{%- set ES_USER = salt['pillar.get']('elasticsearch:auth:users:so_elastic_user:user', '') %}
{%- set ES_PASS = salt['pillar.get']('elasticsearch:auth:users:so_elastic_user:pass', '') %}
output {
if "import" in [tags] {
elasticsearch {
pipeline => "%{module}.%{dataset}"
hosts => "{{ ES }}"
{% if salt['pillar.get']('elasticsearch:auth:enabled') is sameas true %}
user => "{{ ES_USER }}"
password => "{{ ES_PASS }}"
{% endif %}
index => "so-import"
template_name => "so-import"
template => "/templates/so-import-template.json"

View File

@@ -3,10 +3,16 @@
{%- else %}
{%- set ES = salt['pillar.get']('elasticsearch:mainip', '') -%}
{%- endif %}
{%- set ES_USER = salt['pillar.get']('elasticsearch:auth:users:so_elastic_user:user', '') %}
{%- set ES_PASS = salt['pillar.get']('elasticsearch:auth:users:so_elastic_user:pass', '') %}
output {
if [event_type] == "sflow" {
elasticsearch {
hosts => "{{ ES }}"
{% if salt['pillar.get']('elasticsearch:auth:enabled') is sameas true %}
user => "{{ ES_USER }}"
password => "{{ ES_PASS }}"
{% endif %}
index => "so-flow"
template_name => "so-flow"
template => "/templates/so-flow-template.json"

View File

@@ -3,10 +3,16 @@
{%- else %}
{%- set ES = salt['pillar.get']('elasticsearch:mainip', '') -%}
{%- endif %}
{%- set ES_USER = salt['pillar.get']('elasticsearch:auth:users:so_elastic_user:user', '') %}
{%- set ES_PASS = salt['pillar.get']('elasticsearch:auth:users:so_elastic_user:pass', '') %}
output {
if [event_type] == "ids" and "import" not in [tags] {
elasticsearch {
hosts => "{{ ES }}"
{% if salt['pillar.get']('elasticsearch:auth:enabled') is sameas true %}
user => "{{ ES_USER }}"
password => "{{ ES_PASS }}"
{% endif %}
index => "so-ids"
template_name => "so-ids"
template => "/templates/so-ids-template.json"

View File

@@ -3,11 +3,17 @@
{%- else %}
{%- set ES = salt['pillar.get']('elasticsearch:mainip', '') -%}
{%- endif %}
{%- set ES_USER = salt['pillar.get']('elasticsearch:auth:users:so_elastic_user:user', '') %}
{%- set ES_PASS = salt['pillar.get']('elasticsearch:auth:users:so_elastic_user:pass', '') %}
output {
if [module] =~ "syslog" {
elasticsearch {
pipeline => "%{module}"
hosts => "{{ ES }}"
{% if salt['pillar.get']('elasticsearch:auth:enabled') is sameas true %}
user => "{{ ES_USER }}"
password => "{{ ES_PASS }}"
{% endif %}
index => "so-syslog"
template_name => "so-syslog"
template => "/templates/so-syslog-template.json"

View File

@@ -0,0 +1,26 @@
{%- if grains['role'] == 'so-eval' -%}
{%- set ES = salt['pillar.get']('manager:mainip', '') -%}
{%- else %}
{%- set ES = salt['pillar.get']('elasticsearch:mainip', '') -%}
{%- endif %}
{%- set ES_USER = salt['pillar.get']('elasticsearch:auth:users:so_elastic_user:user', '') %}
{%- set ES_PASS = salt['pillar.get']('elasticsearch:auth:users:so_elastic_user:pass', '') %}
output {
if [metadata][pipeline] {
elasticsearch {
id => "filebeat_modules_metadata_pipeline"
pipeline => "%{[metadata][pipeline]}"
hosts => "{{ ES }}"
{% if salt['pillar.get']('elasticsearch:auth:enabled') is sameas true %}
user => "{{ ES_USER }}"
password => "{{ ES_PASS }}"
{% endif %}
index => "so-%{[event][module]}-%{+YYYY.MM.dd}"
template_name => "so-common"
template => "/templates/so-common-template.json"
template_overwrite => true
ssl => true
ssl_certificate_verification => false
}
}
}

View File

@@ -3,11 +3,17 @@
{%- else %}
{%- set ES = salt['pillar.get']('elasticsearch:mainip', '') -%}
{%- endif %}
{%- set ES_USER = salt['pillar.get']('elasticsearch:auth:users:so_elastic_user:user', '') %}
{%- set ES_PASS = salt['pillar.get']('elasticsearch:auth:users:so_elastic_user:pass', '') %}
output {
if [module] =~ "osquery" and "live_query" not in [dataset] {
elasticsearch {
pipeline => "%{module}.%{dataset}"
hosts => "{{ ES }}"
{% if salt['pillar.get']('elasticsearch:auth:enabled') is sameas true %}
user => "{{ ES_USER }}"
password => "{{ ES_PASS }}"
{% endif %}
index => "so-osquery"
template_name => "so-osquery"
template => "/templates/so-osquery-template.json"

View File

@@ -3,7 +3,9 @@
{%- else %}
{%- set ES = salt['pillar.get']('elasticsearch:mainip', '') -%}
{%- endif %}
{% set FEATURES = salt['pillar.get']('elastic:features', False) %}
{%- set FEATURES = salt['pillar.get']('elastic:features', False) %}
{%- set ES_USER = salt['pillar.get']('elasticsearch:auth:users:so_elastic_user:user', '') %}
{%- set ES_PASS = salt['pillar.get']('elasticsearch:auth:users:so_elastic_user:pass', '') %}
filter {
if [type] =~ "live_query" {
@@ -30,6 +32,10 @@ output {
elasticsearch {
pipeline => "osquery.live_query"
hosts => "{{ ES }}"
{% if salt['pillar.get']('elasticsearch:auth:enabled') is sameas true %}
user => "{{ ES_USER }}"
password => "{{ ES_PASS }}"
{% endif %}
index => "so-osquery"
template_name => "so-osquery"
template => "/templates/so-osquery-template.json"

View File

@@ -3,10 +3,16 @@
{%- else %}
{%- set ES = salt['pillar.get']('elasticsearch:mainip', '') -%}
{%- endif %}
{%- set ES_USER = salt['pillar.get']('elasticsearch:auth:users:so_elastic_user:user', '') %}
{%- set ES_PASS = salt['pillar.get']('elasticsearch:auth:users:so_elastic_user:pass', '') %}
output {
if [dataset] =~ "firewall" {
elasticsearch {
hosts => "{{ ES }}"
{% if salt['pillar.get']('elasticsearch:auth:enabled') is sameas true %}
user => "{{ ES_USER }}"
password => "{{ ES_PASS }}"
{% endif %}
index => "so-firewall"
template_name => "so-firewall"
template => "/templates/so-firewall-template.json"

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