mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2025-12-20 07:53:06 +01:00
Compare commits
738 Commits
2.4.1-2023
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
94c7dabd9e | ||
|
|
2f3b92887b | ||
|
|
d15678f638 | ||
|
|
93c29bc1da | ||
|
|
56263675f6 | ||
|
|
1599e69851 | ||
|
|
5ae7e27ace | ||
|
|
945d2abeed | ||
|
|
68eb2d3ceb | ||
|
|
595f965183 | ||
|
|
834d18b77c | ||
|
|
4849da1c11 | ||
|
|
fbbddc2aaf | ||
|
|
4b24500b79 | ||
|
|
f6a765addc | ||
|
|
8b56c0a744 | ||
|
|
b31d38e734 | ||
|
|
b1db4137d0 | ||
|
|
44ef164713 | ||
|
|
43f7dce297 | ||
|
|
4e4a4686f1 | ||
|
|
b5f44e48ab | ||
|
|
a44448519b | ||
|
|
6245ee9a5b | ||
|
|
49ca970076 | ||
|
|
f49fb7cbae | ||
|
|
7692c9be53 | ||
|
|
25ef12cdc5 | ||
|
|
2967adca90 | ||
|
|
d198458366 | ||
|
|
9e98b409a5 | ||
|
|
ba8f729976 | ||
|
|
5b67795c23 | ||
|
|
483bf60ae3 | ||
|
|
1a9350f60b | ||
|
|
f4afda0975 | ||
|
|
137372337c | ||
|
|
1521532c60 | ||
|
|
ada32967dc | ||
|
|
d5d2b5fbc7 | ||
|
|
84d6fcb752 | ||
|
|
de9e9a2716 | ||
|
|
cec6cff19d | ||
|
|
7311d6480c | ||
|
|
f967c8e362 | ||
|
|
cfad6414d2 | ||
|
|
0fdaed9cf7 | ||
|
|
1dc88781f1 | ||
|
|
0cfb8b0816 | ||
|
|
c0968d3843 | ||
|
|
3b133e87cd | ||
|
|
fee9b61ce9 | ||
|
|
57612c69fe | ||
|
|
94accb0e8c | ||
|
|
3b8d1d470e | ||
|
|
c624a44b0e | ||
|
|
bc509a0aa9 | ||
|
|
ee0ef3217f | ||
|
|
18e319cbe3 | ||
|
|
3316e1261d | ||
|
|
b7cf44466c | ||
|
|
e321aa52a5 | ||
|
|
07df045e79 | ||
|
|
7b11ddb032 | ||
|
|
ac4428940e | ||
|
|
a9457d5f53 | ||
|
|
3672701dde | ||
|
|
07ed2cb3da | ||
|
|
3839e52401 | ||
|
|
b005a10a8e | ||
|
|
752ff5917f | ||
|
|
815e5d53a6 | ||
|
|
a967db8152 | ||
|
|
7835cb6a7a | ||
|
|
07b92eef9e | ||
|
|
8855619453 | ||
|
|
7763218b71 | ||
|
|
29f12fac90 | ||
|
|
1a9f8f0bc2 | ||
|
|
3e5f354d8b | ||
|
|
a1b76d2cd3 | ||
|
|
43e402fad4 | ||
|
|
170b408feb | ||
|
|
e55725cca4 | ||
|
|
2b9f6b26d8 | ||
|
|
f10b67599e | ||
|
|
ea03613df3 | ||
|
|
8ffb6b9e1c | ||
|
|
ffadd4aa42 | ||
|
|
78ccea12b1 | ||
|
|
8bef5a84f7 | ||
|
|
679775a7d0 | ||
|
|
3f5f93059e | ||
|
|
d2ae8f81e1 | ||
|
|
fcc369d4b9 | ||
|
|
9bb28fd0b5 | ||
|
|
93c5e6a9e8 | ||
|
|
6a7e756a37 | ||
|
|
f6b9dec2ae | ||
|
|
37386057d9 | ||
|
|
800945c3b6 | ||
|
|
b56c0c5e64 | ||
|
|
01b986cd50 | ||
|
|
3e862151f3 | ||
|
|
15b3982930 | ||
|
|
3d687f0404 | ||
|
|
e74c2fa1b0 | ||
|
|
ffc91393e7 | ||
|
|
d0ab2db312 | ||
|
|
4906068c7f | ||
|
|
ef8eece53b | ||
|
|
660a50c08d | ||
|
|
5d326a3c32 | ||
|
|
2a907d3de3 | ||
|
|
33134b1814 | ||
|
|
b0962da758 | ||
|
|
8148fd9e56 | ||
|
|
1ee332b55b | ||
|
|
873632ec4f | ||
|
|
f8068d7975 | ||
|
|
a79ebea5c3 | ||
|
|
2fdc3874ca | ||
|
|
7f52c2015d | ||
|
|
548e1e6937 | ||
|
|
c949101d0f | ||
|
|
7c1f19b91f | ||
|
|
598d6b025e | ||
|
|
4d0d0714a5 | ||
|
|
cb0c078955 | ||
|
|
aa426244bf | ||
|
|
97b2ae8d82 | ||
|
|
7047125759 | ||
|
|
43f73abd4d | ||
|
|
51a8684850 | ||
|
|
b3c5239787 | ||
|
|
0f562279ee | ||
|
|
834f45c0f2 | ||
|
|
d4cf9efeca | ||
|
|
c620983b4a | ||
|
|
ed19c139ea | ||
|
|
af85c6261b | ||
|
|
e9f58269cd | ||
|
|
208c3d96e9 | ||
|
|
1e888a5d9e | ||
|
|
f7ae8d449e | ||
|
|
195274bb11 | ||
|
|
a0ac1d2274 | ||
|
|
3dd39c7f59 | ||
|
|
ba846bbf35 | ||
|
|
0baf8e9471 | ||
|
|
e30fec7af0 | ||
|
|
884f5cd3a6 | ||
|
|
11babd2f1c | ||
|
|
b440ab5c02 | ||
|
|
91d667c3ad | ||
|
|
f04c01b28c | ||
|
|
71ab8ddf1d | ||
|
|
f1f79d55dc | ||
|
|
db1bd16758 | ||
|
|
ef73834d58 | ||
|
|
3891548d6d | ||
|
|
9d6ed8b9b2 | ||
|
|
ef92815a08 | ||
|
|
19b5cdcb0e | ||
|
|
272b345892 | ||
|
|
7fad9d60ef | ||
|
|
46fc62b8dc | ||
|
|
ca9a93a4b0 | ||
|
|
aa2e18fca9 | ||
|
|
7e4ce7b81d | ||
|
|
e5c0058dd1 | ||
|
|
07c5b541a3 | ||
|
|
b756b8ea32 | ||
|
|
5b46e57ae1 | ||
|
|
924009afb8 | ||
|
|
8f5bacc510 | ||
|
|
d5e48a7eca | ||
|
|
6346a92f0f | ||
|
|
13a566a9a2 | ||
|
|
063c6599d8 | ||
|
|
9fb315c99d | ||
|
|
6e0891e586 | ||
|
|
3a96d59899 | ||
|
|
5fa945956e | ||
|
|
b0aab96cf5 | ||
|
|
11def72790 | ||
|
|
2ca2724a4c | ||
|
|
884883a225 | ||
|
|
5c8ba3af65 | ||
|
|
4b5d314adf | ||
|
|
6e637f559c | ||
|
|
cc5304e9f7 | ||
|
|
002403055d | ||
|
|
b80b80e825 | ||
|
|
c539d53a02 | ||
|
|
3a22978c2b | ||
|
|
5b1461e9a1 | ||
|
|
69f889dbd9 | ||
|
|
aefe1cceb8 | ||
|
|
b7e97eceb3 | ||
|
|
450e02e874 | ||
|
|
09bebf08d6 | ||
|
|
4dd54cea6c | ||
|
|
e07f4bd0ed | ||
|
|
6adb586bb4 | ||
|
|
2f99821736 | ||
|
|
db27c22158 | ||
|
|
2ff284fc7f | ||
|
|
5d0a3ef205 | ||
|
|
ac9c10dd3a | ||
|
|
d4d67b545d | ||
|
|
2dced35800 | ||
|
|
c2a04a79c5 | ||
|
|
d43346a084 | ||
|
|
0c4a27d120 | ||
|
|
b4530ffffe | ||
|
|
d12aa0ed56 | ||
|
|
17bcf50ccb | ||
|
|
48401f6a3f | ||
|
|
a96825f43e | ||
|
|
2d48ae7bca | ||
|
|
0ff519ed2f | ||
|
|
127533492f | ||
|
|
7d4b4a8bd4 | ||
|
|
e9fa84d71b | ||
|
|
cd8cf4a1ac | ||
|
|
9718e61a6a | ||
|
|
22ec638e85 | ||
|
|
7b0c22f967 | ||
|
|
672cab858e | ||
|
|
29312d595b | ||
|
|
b54f2e8752 | ||
|
|
1470e120ef | ||
|
|
2c747ec837 | ||
|
|
8cb5cd5fee | ||
|
|
a4bae77973 | ||
|
|
96a568f57f | ||
|
|
7dcdcc18a5 | ||
|
|
10fc8de9f9 | ||
|
|
3482df5ee1 | ||
|
|
9ea3d6bb1f | ||
|
|
a67a254edc | ||
|
|
08a5a9ab31 | ||
|
|
e3d32c7871 | ||
|
|
20d6ce1ce9 | ||
|
|
bd114eb1c4 | ||
|
|
55c6fc422b | ||
|
|
5d060f9832 | ||
|
|
edcbfd17f5 | ||
|
|
ff4850d9ce | ||
|
|
3e1a5b6329 | ||
|
|
b1709f3ea3 | ||
|
|
76a73ea35c | ||
|
|
991a6ec43c | ||
|
|
e2c0607249 | ||
|
|
82c61e6bc9 | ||
|
|
37aa779095 | ||
|
|
9e631ad63d | ||
|
|
fe6a55b58e | ||
|
|
87cebedc85 | ||
|
|
e66c995b1f | ||
|
|
e8a8f65ddc | ||
|
|
a7a15117f0 | ||
|
|
865ba4264b | ||
|
|
6985b0ab27 | ||
|
|
6e4912f759 | ||
|
|
b0d934daf7 | ||
|
|
8e50868abd | ||
|
|
aa08803f03 | ||
|
|
bb346d531d | ||
|
|
6c057d0b0a | ||
|
|
47e43e53d9 | ||
|
|
a8456a4d65 | ||
|
|
98a1fb96c2 | ||
|
|
874bbd2580 | ||
|
|
90dedbb841 | ||
|
|
df5dd5fe28 | ||
|
|
d5ab455485 | ||
|
|
20b79b7ab0 | ||
|
|
56019f48ca | ||
|
|
d7dd2d2ef8 | ||
|
|
3d431eaba9 | ||
|
|
f85fb5ecf9 | ||
|
|
1716cb0297 | ||
|
|
0ec366f075 | ||
|
|
e9b9e128c6 | ||
|
|
ef15de130a | ||
|
|
e975ee0a8e | ||
|
|
da94ddca13 | ||
|
|
6e94751c65 | ||
|
|
d48d473f43 | ||
|
|
cff5a83ad5 | ||
|
|
225b7e359c | ||
|
|
9a616caf53 | ||
|
|
0aab268801 | ||
|
|
0bb7f5c5e3 | ||
|
|
4aff1f0fdb | ||
|
|
35ca08ea88 | ||
|
|
7b05627d5c | ||
|
|
e3c1b6dbba | ||
|
|
f0c3b876a9 | ||
|
|
531423f49a | ||
|
|
dfad5a748c | ||
|
|
819b39c0bb | ||
|
|
0dd2e51e83 | ||
|
|
f7730741c2 | ||
|
|
cb2d6b7876 | ||
|
|
93ca7548f8 | ||
|
|
9cbbed1038 | ||
|
|
967fd30bb1 | ||
|
|
6c8c8a2d8e | ||
|
|
8bb3b22993 | ||
|
|
5b6182c003 | ||
|
|
69c5a9dd90 | ||
|
|
86c31c129a | ||
|
|
483a9d477f | ||
|
|
d7f60a0e58 | ||
|
|
f06443f3dd | ||
|
|
fe798138e3 | ||
|
|
e9bb60dedb | ||
|
|
992ced685f | ||
|
|
592bbf4217 | ||
|
|
eacf6238d8 | ||
|
|
0a7ada314d | ||
|
|
c8edb43748 | ||
|
|
f112663a76 | ||
|
|
a1b2c28a42 | ||
|
|
4311d5135b | ||
|
|
2b2d39c869 | ||
|
|
fcc0534572 | ||
|
|
a3f9859fdb | ||
|
|
cf5d5e4fc2 | ||
|
|
7184b9cb25 | ||
|
|
544d716c19 | ||
|
|
f1f611cede | ||
|
|
5988c12773 | ||
|
|
dc5f4ef942 | ||
|
|
91e15c233d | ||
|
|
42cde0b6f0 | ||
|
|
1279997ca9 | ||
|
|
93e0ec8696 | ||
|
|
8f0547beda | ||
|
|
6cb4c02200 | ||
|
|
8c54c44690 | ||
|
|
5d72f8d55a | ||
|
|
768225ff5a | ||
|
|
571ac4edec | ||
|
|
86cfac4983 | ||
|
|
e00a80feb4 | ||
|
|
e8e39a7105 | ||
|
|
13ea44db95 | ||
|
|
7f4f1397e7 | ||
|
|
5db3e22363 | ||
|
|
6fe2857ba5 | ||
|
|
56b0bae089 | ||
|
|
f947e501cb | ||
|
|
ff8bbc399f | ||
|
|
80226a27cc | ||
|
|
266207cc18 | ||
|
|
5255c120c5 | ||
|
|
d44f8e495b | ||
|
|
13a8cbdabb | ||
|
|
c3c505f8ff | ||
|
|
7ea0aa87e4 | ||
|
|
82317656b1 | ||
|
|
1cc5961c07 | ||
|
|
220e998b45 | ||
|
|
16cd1080be | ||
|
|
5db643e53b | ||
|
|
745cdef538 | ||
|
|
aa767b8dc1 | ||
|
|
45cdd16308 | ||
|
|
1bb76bb251 | ||
|
|
4251331bd4 | ||
|
|
124d56f4b9 | ||
|
|
02821b97ad | ||
|
|
9a50832669 | ||
|
|
cffbe757a6 | ||
|
|
14ff5670f7 | ||
|
|
92e238aa10 | ||
|
|
8462e66873 | ||
|
|
2763b5846c | ||
|
|
dd4c34397d | ||
|
|
a796fa2ff7 | ||
|
|
268253ce14 | ||
|
|
6a2f886fcc | ||
|
|
63915b0486 | ||
|
|
ce7b16a230 | ||
|
|
a4f5e7b2a6 | ||
|
|
cfbbc3a1a3 | ||
|
|
11a7f051a6 | ||
|
|
cb06269b1a | ||
|
|
d026414bcf | ||
|
|
e15ca408e7 | ||
|
|
0e2753393b | ||
|
|
b06e9e8477 | ||
|
|
45892400cb | ||
|
|
1f0c984b98 | ||
|
|
6d814d3909 | ||
|
|
9ea59355d5 | ||
|
|
c1287a61af | ||
|
|
e44c94c56b | ||
|
|
ec0cf71c3f | ||
|
|
73adc571de | ||
|
|
62c1bb2c0c | ||
|
|
692ec05b2d | ||
|
|
00078fd9e5 | ||
|
|
13c8fb0004 | ||
|
|
920b16e494 | ||
|
|
d98c57510a | ||
|
|
58aa730437 | ||
|
|
f36da68009 | ||
|
|
0091675ab6 | ||
|
|
83d25a97d3 | ||
|
|
e536568c8a | ||
|
|
a00eb9071f | ||
|
|
c39cd9a290 | ||
|
|
cb5483d401 | ||
|
|
fab0d17314 | ||
|
|
465e6c4605 | ||
|
|
a119d6a842 | ||
|
|
be8ce43b74 | ||
|
|
b2a33d4800 | ||
|
|
78fac49e66 | ||
|
|
ca08989404 | ||
|
|
4ed757916e | ||
|
|
676c543178 | ||
|
|
aa2eab5738 | ||
|
|
fe21b8bc17 | ||
|
|
33a478ff59 | ||
|
|
62fee1f420 | ||
|
|
2ada4712bc | ||
|
|
fad6c46e7c | ||
|
|
6f27c1b21e | ||
|
|
0afb20ffa8 | ||
|
|
40688a6076 | ||
|
|
9431bf1c2a | ||
|
|
9f5e75b302 | ||
|
|
3f62cddc3b | ||
|
|
085420997c | ||
|
|
723e145eeb | ||
|
|
0a1d0d35c8 | ||
|
|
9ee96f2280 | ||
|
|
3871268c19 | ||
|
|
bc620b7def | ||
|
|
5950771003 | ||
|
|
7c8ce7899b | ||
|
|
08d5f494ab | ||
|
|
13827f3be5 | ||
|
|
3a64362887 | ||
|
|
e77a60bcbf | ||
|
|
e560edf493 | ||
|
|
7caf827b77 | ||
|
|
f40ccb7eff | ||
|
|
e0cd550820 | ||
|
|
4e5106c863 | ||
|
|
5a107c63b8 | ||
|
|
8a9a13865c | ||
|
|
9cd6273beb | ||
|
|
724b26228c | ||
|
|
3c054fd133 | ||
|
|
24ee38369f | ||
|
|
0bbe642d20 | ||
|
|
8e17c23659 | ||
|
|
92170941f0 | ||
|
|
10ac789fbf | ||
|
|
db58a35562 | ||
|
|
1ad7a0db59 | ||
|
|
af626fe3a1 | ||
|
|
073f5ed789 | ||
|
|
bbcefea417 | ||
|
|
73c282595d | ||
|
|
07a53db09a | ||
|
|
80e50fa7b4 | ||
|
|
84d333e915 | ||
|
|
ae582caa55 | ||
|
|
264ae2b9ac | ||
|
|
b522c9eea4 | ||
|
|
51cc047933 | ||
|
|
2a805ac1a6 | ||
|
|
595f615ed9 | ||
|
|
aa7c39d312 | ||
|
|
2170d498c5 | ||
|
|
95a6f9aa7d | ||
|
|
ba65b351a2 | ||
|
|
4c09c8856b | ||
|
|
3afa8bd9da | ||
|
|
72eccd2649 | ||
|
|
310ea633b6 | ||
|
|
31b4d9cd70 | ||
|
|
0536d174fe | ||
|
|
96d7429a1c | ||
|
|
a54bb2bad4 | ||
|
|
d4abbd89ca | ||
|
|
bdfab6858d | ||
|
|
f80c8b89e4 | ||
|
|
29384d33e1 | ||
|
|
aebedf9ac6 | ||
|
|
40ee529c7e | ||
|
|
b9ee2f1e38 | ||
|
|
089b403a3b | ||
|
|
a28e5de5f4 | ||
|
|
2e30cefd91 | ||
|
|
33bf0c6902 | ||
|
|
13b6b43324 | ||
|
|
78bc2a95e5 | ||
|
|
5bb0e6e8c0 | ||
|
|
a278194037 | ||
|
|
1b8e546045 | ||
|
|
7319cb07e2 | ||
|
|
35e131b888 | ||
|
|
fd34eb3c26 | ||
|
|
02b00d2c87 | ||
|
|
b0e08ed749 | ||
|
|
ec3a688e66 | ||
|
|
4400c77f7e | ||
|
|
d890f75cca | ||
|
|
91b6087350 | ||
|
|
edcbcec10a | ||
|
|
18ab90288a | ||
|
|
9bf1c1e869 | ||
|
|
1e96a0b6a6 | ||
|
|
8dc08f66fd | ||
|
|
73b1e5949b | ||
|
|
2d6a4d7c28 | ||
|
|
ae389ee487 | ||
|
|
85d30520ce | ||
|
|
934ce9ba64 | ||
|
|
595a95fdf5 | ||
|
|
fc649a565c | ||
|
|
113b38056b | ||
|
|
559276534d | ||
|
|
4acd9f8816 | ||
|
|
7ee4eb6101 | ||
|
|
84b2fc9c17 | ||
|
|
a7417a7242 | ||
|
|
d18ff69ec9 | ||
|
|
5532577fdd | ||
|
|
5ebf470a86 | ||
|
|
4b39ccec6d | ||
|
|
18cd7a83c6 | ||
|
|
c5bfe6ffdb | ||
|
|
4ac365e670 | ||
|
|
ff1a903895 | ||
|
|
65f8b1ebe3 | ||
|
|
c23e8e5a7b | ||
|
|
aa4a9a093f | ||
|
|
0af813d7fe | ||
|
|
388486ec08 | ||
|
|
b1b0a7df30 | ||
|
|
f74aee6a03 | ||
|
|
4c6e66428c | ||
|
|
16d8e9e5a0 | ||
|
|
ee1f55361e | ||
|
|
cb33464668 | ||
|
|
06ddae13b5 | ||
|
|
16d3dead04 | ||
|
|
f7043f3f62 | ||
|
|
bf41f2984a | ||
|
|
86ca3602f3 | ||
|
|
416c28fded | ||
|
|
297373877a | ||
|
|
db9b93a96c | ||
|
|
5635375d8d | ||
|
|
07e72e4013 | ||
|
|
518d2aaa9c | ||
|
|
e93e2995b7 | ||
|
|
d2eb61a830 | ||
|
|
4c5a2c0610 | ||
|
|
e9e7362005 | ||
|
|
b97c822800 | ||
|
|
71e3b2d1fb | ||
|
|
326ba710ce | ||
|
|
1ea6feca37 | ||
|
|
c524442172 | ||
|
|
8e4d0db738 | ||
|
|
a170c194c8 | ||
|
|
2b51d72585 | ||
|
|
0d71006f40 | ||
|
|
a91e3b601c | ||
|
|
4940421297 | ||
|
|
58b4a8fbab | ||
|
|
bd7e12f682 | ||
|
|
64e43f07b9 | ||
|
|
2d84e2e977 | ||
|
|
465a1a82d7 | ||
|
|
61d36d584f | ||
|
|
2d343110cc | ||
|
|
4502e2c260 | ||
|
|
beb67847f9 | ||
|
|
9cdc29c482 | ||
|
|
292f66138b | ||
|
|
0087768946 | ||
|
|
01d177366d | ||
|
|
712340a027 | ||
|
|
1caac3f0b0 | ||
|
|
54a5dd6cbd | ||
|
|
6570177b0c | ||
|
|
f7ed992f24 | ||
|
|
4a18f8d18a | ||
|
|
24cf481f4a | ||
|
|
cd4e0c1f8e | ||
|
|
4a60310dc8 | ||
|
|
930620fce6 | ||
|
|
7a60d0987c | ||
|
|
9ac06057c1 | ||
|
|
e5c69c3236 | ||
|
|
39f050c6e4 | ||
|
|
4ee083759c | ||
|
|
072bfd87b7 | ||
|
|
b7aaaa80bb | ||
|
|
b8884b6ac9 | ||
|
|
05e271af47 | ||
|
|
58e80a9db8 | ||
|
|
e16fc3605e | ||
|
|
f13f05eb94 | ||
|
|
a54fc4cead | ||
|
|
2127ba90ee | ||
|
|
3373aef87d | ||
|
|
fa45e8ded7 | ||
|
|
6d0ead7b5b | ||
|
|
a2a6625f3b | ||
|
|
3c2510acd7 | ||
|
|
0d807d20f4 | ||
|
|
f4042263a3 | ||
|
|
a930f8233d | ||
|
|
7401008523 | ||
|
|
5199ea483e | ||
|
|
454a7a4799 | ||
|
|
6fb7733d8c | ||
|
|
ab17cbee31 | ||
|
|
9991f0cf95 | ||
|
|
44d46b06a2 | ||
|
|
ba7231f07d | ||
|
|
8dc11ea23a | ||
|
|
116a6a0acd | ||
|
|
311b69dc4a | ||
|
|
fd59acce5d | ||
|
|
956d3e4345 | ||
|
|
b8355b3a03 | ||
|
|
535b9f86db | ||
|
|
97c66a5404 | ||
|
|
6553beec99 | ||
|
|
e171dd52b8 | ||
|
|
27a837369d | ||
|
|
043b9f78e2 | ||
|
|
2f260a785f | ||
|
|
001b2dc6cc | ||
|
|
b13eedfbc2 | ||
|
|
dd70ef17b9 | ||
|
|
82dff3e9da | ||
|
|
d9cfd92b8f | ||
|
|
33cb771780 | ||
|
|
76cca8594d | ||
|
|
5c9c95ba1f | ||
|
|
e62bebeafe | ||
|
|
8a0e92cc6f | ||
|
|
3f9259dd0a | ||
|
|
30b9868de1 | ||
|
|
e88243c306 | ||
|
|
2128550df2 | ||
|
|
db67c0ed94 | ||
|
|
2e32c0d236 | ||
|
|
4b1ad1910d | ||
|
|
c337145b2c | ||
|
|
bd7b4c92bc | ||
|
|
33ebed3468 | ||
|
|
616bc40412 | ||
|
|
f00d9074ff | ||
|
|
9a692288e2 | ||
|
|
fea2b481e3 | ||
|
|
c17f0081ef | ||
|
|
fbf0803906 | ||
|
|
5deda45b66 | ||
|
|
3b8d8163b3 | ||
|
|
2dfd41bd3c | ||
|
|
49eead1d55 | ||
|
|
54cb3c3a5a | ||
|
|
9f2b920454 | ||
|
|
604af45661 | ||
|
|
3f435c5c1a | ||
|
|
7769af4541 | ||
|
|
9903be8120 | ||
|
|
991a601a3d | ||
|
|
86519d43dc | ||
|
|
179f669acf | ||
|
|
a02f878dcc | ||
|
|
32c29b28eb | ||
|
|
7bf2603414 | ||
|
|
4003876465 | ||
|
|
4c677961c4 | ||
|
|
e950d865d8 | ||
|
|
fd7a118664 | ||
|
|
d7906945df | ||
|
|
cb384ae024 | ||
|
|
7caead2387 | ||
|
|
4827c9e0d4 | ||
|
|
3b62fc63c9 | ||
|
|
ad32c2b1a5 | ||
|
|
f02f431dab | ||
|
|
812964e4d8 | ||
|
|
99805cc326 | ||
|
|
8d2b3f3dfe | ||
|
|
15f7fd8920 | ||
|
|
50460bf91e | ||
|
|
ee654f767a | ||
|
|
8c694a7ca3 | ||
|
|
9ac640fa67 | ||
|
|
db8d9fff2c | ||
|
|
811063268f | ||
|
|
f2b10a5a86 | ||
|
|
c69cac0e5f | ||
|
|
fed4433088 | ||
|
|
839cfcaefa | ||
|
|
3123407ef0 | ||
|
|
d24125c9e6 | ||
|
|
64dc278c95 | ||
|
|
626a824cd6 | ||
|
|
10ba3b4b5a | ||
|
|
1d059fc96e | ||
|
|
4c1585f8d8 | ||
|
|
e235957c00 | ||
|
|
2cc665bac6 | ||
|
|
d6e118dcd3 | ||
|
|
1d2534b2a1 | ||
|
|
484aa7b207 | ||
|
|
6986448239 | ||
|
|
f1d74dcd67 | ||
|
|
dd48d66c1c | ||
|
|
440f4e75c1 | ||
|
|
c795a70e9c | ||
|
|
340dbe8547 | ||
|
|
52a5e743e9 | ||
|
|
5ceff52796 | ||
|
|
f3a0ab0b2d | ||
|
|
4a7c994b66 | ||
|
|
07b8785f3d | ||
|
|
9a1092ab01 |
2
.github/.gitleaks.toml
vendored
2
.github/.gitleaks.toml
vendored
@@ -536,7 +536,7 @@ secretGroup = 4
|
|||||||
|
|
||||||
[allowlist]
|
[allowlist]
|
||||||
description = "global allow lists"
|
description = "global allow lists"
|
||||||
regexes = ['''219-09-9999''', '''078-05-1120''', '''(9[0-9]{2}|666)-\d{2}-\d{4}''', '''RPM-GPG-KEY.*''']
|
regexes = ['''219-09-9999''', '''078-05-1120''', '''(9[0-9]{2}|666)-\d{2}-\d{4}''']
|
||||||
paths = [
|
paths = [
|
||||||
'''gitleaks.toml''',
|
'''gitleaks.toml''',
|
||||||
'''(.*?)(jpg|gif|doc|pdf|bin|svg|socket)$''',
|
'''(.*?)(jpg|gif|doc|pdf|bin|svg|socket)$''',
|
||||||
|
|||||||
190
.github/DISCUSSION_TEMPLATE/2-4.yml
vendored
Normal file
190
.github/DISCUSSION_TEMPLATE/2-4.yml
vendored
Normal file
@@ -0,0 +1,190 @@
|
|||||||
|
body:
|
||||||
|
- type: markdown
|
||||||
|
attributes:
|
||||||
|
value: |
|
||||||
|
⚠️ This category is solely for conversations related to Security Onion 2.4 ⚠️
|
||||||
|
|
||||||
|
If your organization needs more immediate, enterprise grade professional support, with one-on-one virtual meetings and screensharing, contact us via our website: https://securityonion.com/support
|
||||||
|
- type: dropdown
|
||||||
|
attributes:
|
||||||
|
label: Version
|
||||||
|
description: Which version of Security Onion 2.4.x are you asking about?
|
||||||
|
options:
|
||||||
|
-
|
||||||
|
- 2.4 Pre-release (Beta, Release Candidate)
|
||||||
|
- 2.4.10
|
||||||
|
- 2.4.20
|
||||||
|
- 2.4.30
|
||||||
|
- 2.4.40
|
||||||
|
- 2.4.50
|
||||||
|
- 2.4.60
|
||||||
|
- 2.4.70
|
||||||
|
- 2.4.80
|
||||||
|
- 2.4.90
|
||||||
|
- 2.4.100
|
||||||
|
- Other (please provide detail below)
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
- type: dropdown
|
||||||
|
attributes:
|
||||||
|
label: Installation Method
|
||||||
|
description: How did you install Security Onion?
|
||||||
|
options:
|
||||||
|
-
|
||||||
|
- Security Onion ISO image
|
||||||
|
- Network installation on Red Hat derivative like Oracle, Rocky, Alma, etc.
|
||||||
|
- Network installation on Ubuntu
|
||||||
|
- Network installation on Debian
|
||||||
|
- Other (please provide detail below)
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
- type: dropdown
|
||||||
|
attributes:
|
||||||
|
label: Description
|
||||||
|
description: >
|
||||||
|
Is this discussion about installation, configuration, upgrading, or other?
|
||||||
|
options:
|
||||||
|
-
|
||||||
|
- installation
|
||||||
|
- configuration
|
||||||
|
- upgrading
|
||||||
|
- other (please provide detail below)
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
- type: dropdown
|
||||||
|
attributes:
|
||||||
|
label: Installation Type
|
||||||
|
description: >
|
||||||
|
When you installed, did you choose Import, Eval, Standalone, Distributed, or something else?
|
||||||
|
options:
|
||||||
|
-
|
||||||
|
- Import
|
||||||
|
- Eval
|
||||||
|
- Standalone
|
||||||
|
- Distributed
|
||||||
|
- other (please provide detail below)
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
- type: dropdown
|
||||||
|
attributes:
|
||||||
|
label: Location
|
||||||
|
description: >
|
||||||
|
Is this deployment in the cloud, on-prem with Internet access, or airgap?
|
||||||
|
options:
|
||||||
|
-
|
||||||
|
- cloud
|
||||||
|
- on-prem with Internet access
|
||||||
|
- airgap
|
||||||
|
- other (please provide detail below)
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
- type: dropdown
|
||||||
|
attributes:
|
||||||
|
label: Hardware Specs
|
||||||
|
description: >
|
||||||
|
Does your hardware meet or exceed the minimum requirements for your installation type as shown at https://docs.securityonion.net/en/2.4/hardware.html?
|
||||||
|
options:
|
||||||
|
-
|
||||||
|
- Meets minimum requirements
|
||||||
|
- Exceeds minimum requirements
|
||||||
|
- Does not meet minimum requirements
|
||||||
|
- other (please provide detail below)
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
- type: input
|
||||||
|
attributes:
|
||||||
|
label: CPU
|
||||||
|
description: How many CPU cores do you have?
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
- type: input
|
||||||
|
attributes:
|
||||||
|
label: RAM
|
||||||
|
description: How much RAM do you have?
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
- type: input
|
||||||
|
attributes:
|
||||||
|
label: Storage for /
|
||||||
|
description: How much storage do you have for the / partition?
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
- type: input
|
||||||
|
attributes:
|
||||||
|
label: Storage for /nsm
|
||||||
|
description: How much storage do you have for the /nsm partition?
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
- type: dropdown
|
||||||
|
attributes:
|
||||||
|
label: Network Traffic Collection
|
||||||
|
description: >
|
||||||
|
Are you collecting network traffic from a tap or span port?
|
||||||
|
options:
|
||||||
|
-
|
||||||
|
- tap
|
||||||
|
- span port
|
||||||
|
- other (please provide detail below)
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
- type: dropdown
|
||||||
|
attributes:
|
||||||
|
label: Network Traffic Speeds
|
||||||
|
description: >
|
||||||
|
How much network traffic are you monitoring?
|
||||||
|
options:
|
||||||
|
-
|
||||||
|
- Less than 1Gbps
|
||||||
|
- 1Gbps to 10Gbps
|
||||||
|
- more than 10Gbps
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
- type: dropdown
|
||||||
|
attributes:
|
||||||
|
label: Status
|
||||||
|
description: >
|
||||||
|
Does SOC Grid show all services on all nodes as running OK?
|
||||||
|
options:
|
||||||
|
-
|
||||||
|
- Yes, all services on all nodes are running OK
|
||||||
|
- No, one or more services are failed (please provide detail below)
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
- type: dropdown
|
||||||
|
attributes:
|
||||||
|
label: Salt Status
|
||||||
|
description: >
|
||||||
|
Do you get any failures when you run "sudo salt-call state.highstate"?
|
||||||
|
options:
|
||||||
|
-
|
||||||
|
- Yes, there are salt failures (please provide detail below)
|
||||||
|
- No, there are no failures
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
- type: dropdown
|
||||||
|
attributes:
|
||||||
|
label: Logs
|
||||||
|
description: >
|
||||||
|
Are there any additional clues in /opt/so/log/?
|
||||||
|
options:
|
||||||
|
-
|
||||||
|
- Yes, there are additional clues in /opt/so/log/ (please provide detail below)
|
||||||
|
- No, there are no additional clues
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
- type: textarea
|
||||||
|
attributes:
|
||||||
|
label: Detail
|
||||||
|
description: Please read our discussion guidelines at https://github.com/Security-Onion-Solutions/securityonion/discussions/1720 and then provide detailed information to help us help you.
|
||||||
|
placeholder: |-
|
||||||
|
STOP! Before typing, please read our discussion guidelines at https://github.com/Security-Onion-Solutions/securityonion/discussions/1720 in their entirety!
|
||||||
|
|
||||||
|
If your organization needs more immediate, enterprise grade professional support, with one-on-one virtual meetings and screensharing, contact us via our website: https://securityonion.com/support
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
- type: checkboxes
|
||||||
|
attributes:
|
||||||
|
label: Guidelines
|
||||||
|
options:
|
||||||
|
- label: I have read the discussion guidelines at https://github.com/Security-Onion-Solutions/securityonion/discussions/1720 and assert that I have followed the guidelines.
|
||||||
|
required: true
|
||||||
32
.github/workflows/close-threads.yml
vendored
Normal file
32
.github/workflows/close-threads.yml
vendored
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
name: 'Close Threads'
|
||||||
|
|
||||||
|
on:
|
||||||
|
schedule:
|
||||||
|
- cron: '50 1 * * *'
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
issues: write
|
||||||
|
pull-requests: write
|
||||||
|
discussions: write
|
||||||
|
|
||||||
|
concurrency:
|
||||||
|
group: lock-threads
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
close-threads:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
issues: write
|
||||||
|
pull-requests: write
|
||||||
|
steps:
|
||||||
|
- uses: actions/stale@v5
|
||||||
|
with:
|
||||||
|
days-before-issue-stale: -1
|
||||||
|
days-before-issue-close: 60
|
||||||
|
stale-issue-message: "This issue is stale because it has been inactive for an extended period. Stale issues convey that the issue, while important to someone, is not critical enough for the author, or other community members to work on, sponsor, or otherwise shepherd the issue through to a resolution."
|
||||||
|
close-issue-message: "This issue was closed because it has been stale for an extended period. It will be automatically locked in 30 days, after which no further commenting will be available."
|
||||||
|
days-before-pr-stale: 45
|
||||||
|
days-before-pr-close: 60
|
||||||
|
stale-pr-message: "This PR is stale because it has been inactive for an extended period. The longer a PR remains stale the more out of date with the main branch it becomes."
|
||||||
|
close-pr-message: "This PR was closed because it has been stale for an extended period. It will be automatically locked in 30 days. If there is still a commitment to finishing this PR re-open it before it is locked."
|
||||||
25
.github/workflows/lock-threads.yml
vendored
Normal file
25
.github/workflows/lock-threads.yml
vendored
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
name: 'Lock Threads'
|
||||||
|
|
||||||
|
on:
|
||||||
|
schedule:
|
||||||
|
- cron: '50 2 * * *'
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
issues: write
|
||||||
|
pull-requests: write
|
||||||
|
discussions: write
|
||||||
|
|
||||||
|
concurrency:
|
||||||
|
group: lock-threads
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
lock-threads:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: jertel/lock-threads@main
|
||||||
|
with:
|
||||||
|
include-discussion-currently-open: true
|
||||||
|
discussion-inactive-days: 90
|
||||||
|
issue-inactive-days: 30
|
||||||
|
pr-inactive-days: 30
|
||||||
8
.github/workflows/pythontest.yml
vendored
8
.github/workflows/pythontest.yml
vendored
@@ -1,12 +1,6 @@
|
|||||||
name: python-test
|
name: python-test
|
||||||
|
|
||||||
on:
|
on: [push, pull_request]
|
||||||
push:
|
|
||||||
paths:
|
|
||||||
- "salt/sensoroni/files/analyzers/**"
|
|
||||||
pull_request:
|
|
||||||
paths:
|
|
||||||
- "salt/sensoroni/files/analyzers/**"
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
|
|||||||
30
README.md
30
README.md
@@ -1,6 +1,20 @@
|
|||||||
## Security Onion 2.4 Beta 2
|
## Security Onion 2.3
|
||||||
|
|
||||||
Security Onion 2.4 Beta 2 is here!
|
Security Onion 2.3 is here!
|
||||||
|
|
||||||
|
## End Of Life Warning
|
||||||
|
|
||||||
|
Security Onion 2.3 reaches End Of Life (EOL) on April 6, 2024:
|
||||||
|
|
||||||
|
https://blog.securityonion.net/2023/10/6-month-eol-notice-for-security-onion-23.html
|
||||||
|
|
||||||
|
For new installations, please see the 2.4 branch of this repo:
|
||||||
|
|
||||||
|
https://github.com/Security-Onion-Solutions/securityonion/tree/2.4/main
|
||||||
|
|
||||||
|
If you have an existing 2.3 installation and would like to migrate to 2.4, please see:
|
||||||
|
|
||||||
|
https://docs.securityonion.net/en/2.4/appendix.html
|
||||||
|
|
||||||
## Screenshots
|
## Screenshots
|
||||||
|
|
||||||
@@ -18,24 +32,24 @@ Cases
|
|||||||
|
|
||||||
### Release Notes
|
### Release Notes
|
||||||
|
|
||||||
https://docs.securityonion.net/en/2.4/release-notes.html
|
https://docs.securityonion.net/en/2.3/release-notes.html
|
||||||
|
|
||||||
### Requirements
|
### Requirements
|
||||||
|
|
||||||
https://docs.securityonion.net/en/2.4/hardware.html
|
https://docs.securityonion.net/en/2.3/hardware.html
|
||||||
|
|
||||||
### Download
|
### Download
|
||||||
|
|
||||||
https://docs.securityonion.net/en/2.4/download.html
|
https://docs.securityonion.net/en/2.3/download.html
|
||||||
|
|
||||||
### Installation
|
### Installation
|
||||||
|
|
||||||
https://docs.securityonion.net/en/2.4/installation.html
|
https://docs.securityonion.net/en/2.3/installation.html
|
||||||
|
|
||||||
### FAQ
|
### FAQ
|
||||||
|
|
||||||
https://docs.securityonion.net/en/2.4/faq.html
|
https://docs.securityonion.net/en/2.3/faq.html
|
||||||
|
|
||||||
### Feedback
|
### Feedback
|
||||||
|
|
||||||
https://docs.securityonion.net/en/2.4/community-support.html
|
https://docs.securityonion.net/en/2.3/community-support.html
|
||||||
|
|||||||
@@ -4,8 +4,7 @@
|
|||||||
|
|
||||||
| Version | Supported |
|
| Version | Supported |
|
||||||
| ------- | ------------------ |
|
| ------- | ------------------ |
|
||||||
| 2.4.x | :white_check_mark: |
|
| 2.x.x | :white_check_mark: |
|
||||||
| 2.3.x | :white_check_mark: |
|
|
||||||
| 16.04.x | :x: |
|
| 16.04.x | :x: |
|
||||||
|
|
||||||
Security Onion 16.04 has reached End Of Life and is no longer supported.
|
Security Onion 16.04 has reached End Of Life and is no longer supported.
|
||||||
|
|||||||
@@ -1 +1,52 @@
|
|||||||
### An ISO will be available starting in RC1.
|
### 2.3.300-20240401 ISO image built on 2024/04/01
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Download and Verify
|
||||||
|
|
||||||
|
2.3.300-20240401 ISO image:
|
||||||
|
https://download.securityonion.net/file/securityonion/securityonion-2.3.300-20240401.iso
|
||||||
|
|
||||||
|
MD5: 5CBDA8012D773C5EC362D21C4EA3B7FB
|
||||||
|
SHA1: 7A34FAA0E11F09F529FF38EC3239211CD87CB1A7
|
||||||
|
SHA256: 123066DAFBF6F2AA0E1924296CFEFE1213002D7760E8797AB74F1FC1D683C6D7
|
||||||
|
|
||||||
|
Signature for ISO image:
|
||||||
|
https://github.com/Security-Onion-Solutions/securityonion/raw/master/sigs/securityonion-2.3.300-20240401.iso.sig
|
||||||
|
|
||||||
|
Signing key:
|
||||||
|
https://raw.githubusercontent.com/Security-Onion-Solutions/securityonion/master/KEYS
|
||||||
|
|
||||||
|
For example, here are the steps you can use on most Linux distributions to download and verify our Security Onion ISO image.
|
||||||
|
|
||||||
|
Download and import the signing key:
|
||||||
|
```
|
||||||
|
wget https://raw.githubusercontent.com/Security-Onion-Solutions/securityonion/master/KEYS -O - | gpg --import -
|
||||||
|
```
|
||||||
|
|
||||||
|
Download the signature file for the ISO:
|
||||||
|
```
|
||||||
|
wget https://github.com/Security-Onion-Solutions/securityonion/raw/master/sigs/securityonion-2.3.300-20240401.iso.sig
|
||||||
|
```
|
||||||
|
|
||||||
|
Download the ISO image:
|
||||||
|
```
|
||||||
|
wget https://download.securityonion.net/file/securityonion/securityonion-2.3.300-20240401.iso
|
||||||
|
```
|
||||||
|
|
||||||
|
Verify the downloaded ISO image using the signature file:
|
||||||
|
```
|
||||||
|
gpg --verify securityonion-2.3.300-20240401.iso.sig securityonion-2.3.300-20240401.iso
|
||||||
|
```
|
||||||
|
|
||||||
|
The output should show "Good signature" and the Primary key fingerprint should match what's shown below:
|
||||||
|
```
|
||||||
|
gpg: Signature made Wed 27 Mar 2024 05:09:33 PM 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.
|
||||||
|
Primary key fingerprint: C804 A93D 36BE 0C73 3EA1 9644 7C10 60B7 FE50 7013
|
||||||
|
```
|
||||||
|
|
||||||
|
Once you've verified the ISO image, you're ready to proceed to our Installation guide:
|
||||||
|
https://docs.securityonion.net/en/2.3/installation.html
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
{% import_yaml 'firewall/ports/ports.yaml' as default_portgroups %}
|
{% import_yaml 'firewall/portgroups.yaml' as default_portgroups %}
|
||||||
{% set default_portgroups = default_portgroups.firewall.ports %}
|
{% set default_portgroups = default_portgroups.firewall.aliases.ports %}
|
||||||
{% import_yaml 'firewall/ports/ports.local.yaml' as local_portgroups %}
|
{% import_yaml 'firewall/portgroups.local.yaml' as local_portgroups %}
|
||||||
{% if local_portgroups.firewall.ports %}
|
{% if local_portgroups.firewall.aliases.ports %}
|
||||||
{% set local_portgroups = local_portgroups.firewall.ports %}
|
{% set local_portgroups = local_portgroups.firewall.aliases.ports %}
|
||||||
{% else %}
|
{% else %}
|
||||||
{% set local_portgroups = {} %}
|
{% set local_portgroups = {} %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|||||||
82
files/firewall/hostgroups.local.yaml
Normal file
82
files/firewall/hostgroups.local.yaml
Normal file
@@ -0,0 +1,82 @@
|
|||||||
|
firewall:
|
||||||
|
hostgroups:
|
||||||
|
analyst:
|
||||||
|
ips:
|
||||||
|
delete:
|
||||||
|
insert:
|
||||||
|
beats_endpoint:
|
||||||
|
ips:
|
||||||
|
delete:
|
||||||
|
insert:
|
||||||
|
beats_endpoint_ssl:
|
||||||
|
ips:
|
||||||
|
delete:
|
||||||
|
insert:
|
||||||
|
elasticsearch_rest:
|
||||||
|
ips:
|
||||||
|
delete:
|
||||||
|
insert:
|
||||||
|
endgame:
|
||||||
|
ips:
|
||||||
|
delete:
|
||||||
|
insert:
|
||||||
|
fleet:
|
||||||
|
ips:
|
||||||
|
delete:
|
||||||
|
insert:
|
||||||
|
heavy_node:
|
||||||
|
ips:
|
||||||
|
delete:
|
||||||
|
insert:
|
||||||
|
idh:
|
||||||
|
ips:
|
||||||
|
delete:
|
||||||
|
insert:
|
||||||
|
manager:
|
||||||
|
ips:
|
||||||
|
delete:
|
||||||
|
insert:
|
||||||
|
minion:
|
||||||
|
ips:
|
||||||
|
delete:
|
||||||
|
insert:
|
||||||
|
node:
|
||||||
|
ips:
|
||||||
|
delete:
|
||||||
|
insert:
|
||||||
|
osquery_endpoint:
|
||||||
|
ips:
|
||||||
|
delete:
|
||||||
|
insert:
|
||||||
|
receiver:
|
||||||
|
ips:
|
||||||
|
delete:
|
||||||
|
insert:
|
||||||
|
search_node:
|
||||||
|
ips:
|
||||||
|
delete:
|
||||||
|
insert:
|
||||||
|
sensor:
|
||||||
|
ips:
|
||||||
|
delete:
|
||||||
|
insert:
|
||||||
|
strelka_frontend:
|
||||||
|
ips:
|
||||||
|
delete:
|
||||||
|
insert:
|
||||||
|
syslog:
|
||||||
|
ips:
|
||||||
|
delete:
|
||||||
|
insert:
|
||||||
|
wazuh_agent:
|
||||||
|
ips:
|
||||||
|
delete:
|
||||||
|
insert:
|
||||||
|
wazuh_api:
|
||||||
|
ips:
|
||||||
|
delete:
|
||||||
|
insert:
|
||||||
|
wazuh_authd:
|
||||||
|
ips:
|
||||||
|
delete:
|
||||||
|
insert:
|
||||||
3
files/firewall/portgroups.local.yaml
Normal file
3
files/firewall/portgroups.local.yaml
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
firewall:
|
||||||
|
aliases:
|
||||||
|
ports:
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
firewall:
|
|
||||||
ports:
|
|
||||||
@@ -64,4 +64,8 @@ peer:
|
|||||||
.*:
|
.*:
|
||||||
- x509.sign_remote_certificate
|
- x509.sign_remote_certificate
|
||||||
|
|
||||||
|
reactor:
|
||||||
|
- 'so/fleet':
|
||||||
|
- salt://reactor/fleet.sls
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -45,10 +45,12 @@ echo " rootfs: $ROOTFS" >> $local_salt_dir/pillar/data/$TYPE.sls
|
|||||||
echo " nsmfs: $NSM" >> $local_salt_dir/pillar/data/$TYPE.sls
|
echo " nsmfs: $NSM" >> $local_salt_dir/pillar/data/$TYPE.sls
|
||||||
if [ $TYPE == 'sensorstab' ]; then
|
if [ $TYPE == 'sensorstab' ]; then
|
||||||
echo " monint: bond0" >> $local_salt_dir/pillar/data/$TYPE.sls
|
echo " monint: bond0" >> $local_salt_dir/pillar/data/$TYPE.sls
|
||||||
|
salt-call state.apply grafana queue=True
|
||||||
fi
|
fi
|
||||||
if [ $TYPE == 'evaltab' ] || [ $TYPE == 'standalonetab' ]; then
|
if [ $TYPE == 'evaltab' ] || [ $TYPE == 'standalonetab' ]; then
|
||||||
echo " monint: bond0" >> $local_salt_dir/pillar/data/$TYPE.sls
|
echo " monint: bond0" >> $local_salt_dir/pillar/data/$TYPE.sls
|
||||||
if [ ! $10 ]; then
|
if [ ! $10 ]; then
|
||||||
|
salt-call state.apply grafana queue=True
|
||||||
salt-call state.apply utility queue=True
|
salt-call state.apply utility queue=True
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -1,6 +0,0 @@
|
|||||||
logstash:
|
|
||||||
pipelines:
|
|
||||||
fleet:
|
|
||||||
config:
|
|
||||||
- so/0012_input_elastic_agent.conf
|
|
||||||
- so/9806_output_lumberjack_fleet.conf.jinja
|
|
||||||
@@ -3,8 +3,6 @@ logstash:
|
|||||||
port_bindings:
|
port_bindings:
|
||||||
- 0.0.0.0:3765:3765
|
- 0.0.0.0:3765:3765
|
||||||
- 0.0.0.0:5044:5044
|
- 0.0.0.0:5044:5044
|
||||||
- 0.0.0.0:5055:5055
|
|
||||||
- 0.0.0.0:5056:5056
|
|
||||||
- 0.0.0.0:5644:5644
|
- 0.0.0.0:5644:5644
|
||||||
- 0.0.0.0:6050:6050
|
- 0.0.0.0:6050:6050
|
||||||
- 0.0.0.0:6051:6051
|
- 0.0.0.0:6051:6051
|
||||||
|
|||||||
@@ -2,7 +2,8 @@ logstash:
|
|||||||
pipelines:
|
pipelines:
|
||||||
manager:
|
manager:
|
||||||
config:
|
config:
|
||||||
|
- so/0009_input_beats.conf
|
||||||
|
- so/0010_input_hhbeats.conf
|
||||||
- so/0011_input_endgame.conf
|
- so/0011_input_endgame.conf
|
||||||
- so/0012_input_elastic_agent.conf
|
|
||||||
- so/0013_input_lumberjack_fleet.conf
|
|
||||||
- so/9999_output_redis.conf.jinja
|
- so/9999_output_redis.conf.jinja
|
||||||
|
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
{% set cached_grains = salt.saltutil.runner('cache.grains', tgt='*') %}
|
{% set cached_grains = salt.saltutil.runner('cache.grains', tgt='*') %}
|
||||||
{% for minionid, ip in salt.saltutil.runner(
|
{% for minionid, ip in salt.saltutil.runner(
|
||||||
'mine.get',
|
'mine.get',
|
||||||
tgt='G@role:so-manager or G@role:so-managersearch or G@role:so-standalone or G@role:so-searchnode or G@role:so-heavynode or G@role:so-receiver or G@role:so-helix ',
|
tgt='G@role:so-manager or G@role:so-managersearch or G@role:so-standalone or G@role:so-node or G@role:so-heavynode or G@role:so-receiver or G@role:so-helix',
|
||||||
fun='network.ip_addrs',
|
fun='network.ip_addrs',
|
||||||
tgt_type='compound') | dictsort()
|
tgt_type='compound') | dictsort()
|
||||||
%}
|
%}
|
||||||
|
|||||||
@@ -2,7 +2,8 @@ logstash:
|
|||||||
pipelines:
|
pipelines:
|
||||||
receiver:
|
receiver:
|
||||||
config:
|
config:
|
||||||
|
- so/0009_input_beats.conf
|
||||||
|
- so/0010_input_hhbeats.conf
|
||||||
- so/0011_input_endgame.conf
|
- so/0011_input_endgame.conf
|
||||||
- so/0012_input_elastic_agent.conf
|
|
||||||
- so/9999_output_redis.conf.jinja
|
- so/9999_output_redis.conf.jinja
|
||||||
|
|
||||||
@@ -3,5 +3,16 @@ logstash:
|
|||||||
search:
|
search:
|
||||||
config:
|
config:
|
||||||
- so/0900_input_redis.conf.jinja
|
- so/0900_input_redis.conf.jinja
|
||||||
- so/9805_output_elastic_agent.conf.jinja
|
- 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
|
||||||
|
- so/9600_output_ossec.conf.jinja
|
||||||
|
- so/9700_output_strelka.conf.jinja
|
||||||
|
- so/9800_output_logscan.conf.jinja
|
||||||
|
- so/9801_output_rita.conf.jinja
|
||||||
|
- so/9802_output_kratos.conf.jinja
|
||||||
- so/9900_output_endgame.conf.jinja
|
- so/9900_output_endgame.conf.jinja
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
{% set node_types = {} %}
|
{% set node_types = {} %}
|
||||||
{% set manage_alived = salt.saltutil.runner('manage.alived', show_ip=True) %}
|
{% set manage_alived = salt.saltutil.runner('manage.alived', show_ip=True) %}
|
||||||
|
{% set manager = grains.master %}
|
||||||
|
{% set manager_type = manager.split('_')|last %}
|
||||||
{% for minionid, ip in salt.saltutil.runner('mine.get', tgt='*', fun='network.ip_addrs', tgt_type='glob') | dictsort() %}
|
{% for minionid, ip in salt.saltutil.runner('mine.get', tgt='*', fun='network.ip_addrs', tgt_type='glob') | dictsort() %}
|
||||||
{% set hostname = minionid.split('_')[0] %}
|
{% set hostname = minionid.split('_')[0] %}
|
||||||
{% set node_type = minionid.split('_')[1] %}
|
{% set node_type = minionid.split('_')[1] %}
|
||||||
@@ -22,10 +24,10 @@
|
|||||||
|
|
||||||
node_data:
|
node_data:
|
||||||
{% for node_type, host_values in node_types.items() %}
|
{% for node_type, host_values in node_types.items() %}
|
||||||
|
{{node_type}}:
|
||||||
{% for hostname, details in host_values.items() %}
|
{% for hostname, details in host_values.items() %}
|
||||||
{{hostname}}:
|
{{hostname}}:
|
||||||
ip: {{details.ip}}
|
ip: {{details.ip}}
|
||||||
alive: {{ details.alive }}
|
alive: {{ details.alive }}
|
||||||
role: {{node_type}}
|
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|||||||
184
pillar/top.sls
184
pillar/top.sls
@@ -1,47 +1,30 @@
|
|||||||
base:
|
base:
|
||||||
'*':
|
'*':
|
||||||
- patch.needs_restarting
|
- patch.needs_restarting
|
||||||
- ntp.soc_ntp
|
|
||||||
- ntp.adv_ntp
|
|
||||||
- logrotate
|
- logrotate
|
||||||
- docker.soc_docker
|
|
||||||
- docker.adv_docker
|
|
||||||
- sensoroni.soc_sensoroni
|
|
||||||
- sensoroni.adv_sensoroni
|
|
||||||
- telegraf.soc_telegraf
|
|
||||||
- telegraf.adv_telegraf
|
|
||||||
- influxdb.token
|
|
||||||
- node_data.ips
|
|
||||||
|
|
||||||
'* and not *_eval and not *_import':
|
'* and not *_eval and not *_import':
|
||||||
- logstash.nodes
|
- logstash.nodes
|
||||||
|
|
||||||
'*_eval or *_heavynode or *_sensor or *_standalone or *_import':
|
'*_eval or *_helixsensor or *_heavynode or *_sensor or *_standalone or *_import':
|
||||||
- match: compound
|
- match: compound
|
||||||
- zeek
|
- zeek
|
||||||
- bpf.soc_bpf
|
|
||||||
- bpf.adv_bpf
|
|
||||||
|
|
||||||
'*_managersearch or *_heavynode':
|
'*_managersearch or *_heavynode':
|
||||||
- match: compound
|
- match: compound
|
||||||
- logstash
|
- logstash
|
||||||
- logstash.manager
|
- logstash.manager
|
||||||
- logstash.search
|
- logstash.search
|
||||||
- logstash.soc_logstash
|
|
||||||
- logstash.adv_logstash
|
|
||||||
- elasticsearch.index_templates
|
- elasticsearch.index_templates
|
||||||
- elasticsearch.soc_elasticsearch
|
|
||||||
- elasticsearch.adv_elasticsearch
|
|
||||||
|
|
||||||
'*_manager':
|
'*_manager':
|
||||||
- logstash
|
- logstash
|
||||||
- logstash.manager
|
- logstash.manager
|
||||||
- logstash.soc_logstash
|
|
||||||
- logstash.adv_logstash
|
|
||||||
- elasticsearch.index_templates
|
- elasticsearch.index_templates
|
||||||
|
|
||||||
'*_manager or *_managersearch':
|
'*_manager or *_managersearch':
|
||||||
- match: compound
|
- match: compound
|
||||||
|
- data.*
|
||||||
{% if salt['file.file_exists']('/opt/so/saltstack/local/pillar/elasticsearch/auth.sls') %}
|
{% if salt['file.file_exists']('/opt/so/saltstack/local/pillar/elasticsearch/auth.sls') %}
|
||||||
- elasticsearch.auth
|
- elasticsearch.auth
|
||||||
{% endif %}
|
{% endif %}
|
||||||
@@ -49,37 +32,18 @@ base:
|
|||||||
- kibana.secrets
|
- kibana.secrets
|
||||||
{% endif %}
|
{% endif %}
|
||||||
- secrets
|
- secrets
|
||||||
- global.soc_global
|
- global
|
||||||
- global.adv_global
|
|
||||||
- manager.soc_manager
|
|
||||||
- manager.adv_manager
|
|
||||||
- idstools.soc_idstools
|
|
||||||
- idstools.adv_idstools
|
|
||||||
- soc.soc_soc
|
|
||||||
- soc.adv_soc
|
|
||||||
- kratos.soc_kratos
|
|
||||||
- kratos.adv_kratos
|
|
||||||
- redis.soc_redis
|
|
||||||
- redis.adv_redis
|
|
||||||
- influxdb.soc_influxdb
|
|
||||||
- influxdb.adv_influxdb
|
|
||||||
- elasticsearch.soc_elasticsearch
|
|
||||||
- elasticsearch.adv_elasticsearch
|
|
||||||
- backup.soc_backup
|
|
||||||
- backup.adv_backup
|
|
||||||
- firewall.soc_firewall
|
|
||||||
- firewall.adv_firewall
|
|
||||||
- minions.{{ grains.id }}
|
- minions.{{ grains.id }}
|
||||||
- minions.adv_{{ grains.id }}
|
|
||||||
|
|
||||||
'*_sensor':
|
'*_sensor':
|
||||||
|
- zeeklogs
|
||||||
- healthcheck.sensor
|
- healthcheck.sensor
|
||||||
- global.soc_global
|
- global
|
||||||
- global.adv_global
|
|
||||||
- minions.{{ grains.id }}
|
- minions.{{ grains.id }}
|
||||||
- minions.adv_{{ grains.id }}
|
|
||||||
|
|
||||||
'*_eval':
|
'*_eval':
|
||||||
|
- data.*
|
||||||
|
- zeeklogs
|
||||||
- secrets
|
- secrets
|
||||||
- healthcheck.eval
|
- healthcheck.eval
|
||||||
- elasticsearch.index_templates
|
- elasticsearch.index_templates
|
||||||
@@ -89,35 +53,13 @@ base:
|
|||||||
{% if salt['file.file_exists']('/opt/so/saltstack/local/pillar/kibana/secrets.sls') %}
|
{% if salt['file.file_exists']('/opt/so/saltstack/local/pillar/kibana/secrets.sls') %}
|
||||||
- kibana.secrets
|
- kibana.secrets
|
||||||
{% endif %}
|
{% endif %}
|
||||||
- global.soc_global
|
- global
|
||||||
- global.adv_global
|
|
||||||
- kratos.soc_kratos
|
|
||||||
- elasticsearch.soc_elasticsearch
|
|
||||||
- elasticsearch.adv_elasticsearch
|
|
||||||
- manager.soc_manager
|
|
||||||
- manager.adv_manager
|
|
||||||
- idstools.soc_idstools
|
|
||||||
- idstools.adv_idstools
|
|
||||||
- soc.soc_soc
|
|
||||||
- kratos.soc_kratos
|
|
||||||
- kratos.adv_kratos
|
|
||||||
- redis.soc_redis
|
|
||||||
- redis.adv_redis
|
|
||||||
- influxdb.soc_influxdb
|
|
||||||
- influxdb.adv_influxdb
|
|
||||||
- backup.soc_backup
|
|
||||||
- backup.adv_backup
|
|
||||||
- firewall.soc_firewall
|
|
||||||
- firewall.adv_firewall
|
|
||||||
- minions.{{ grains.id }}
|
- minions.{{ grains.id }}
|
||||||
- minions.adv_{{ grains.id }}
|
|
||||||
|
|
||||||
'*_standalone':
|
'*_standalone':
|
||||||
- logstash
|
- logstash
|
||||||
- logstash.manager
|
- logstash.manager
|
||||||
- logstash.search
|
- logstash.search
|
||||||
- logstash.soc_logstash
|
|
||||||
- logstash.adv_logstash
|
|
||||||
- elasticsearch.index_templates
|
- elasticsearch.index_templates
|
||||||
{% if salt['file.file_exists']('/opt/so/saltstack/local/pillar/elasticsearch/auth.sls') %}
|
{% if salt['file.file_exists']('/opt/so/saltstack/local/pillar/elasticsearch/auth.sls') %}
|
||||||
- elasticsearch.auth
|
- elasticsearch.auth
|
||||||
@@ -125,79 +67,60 @@ base:
|
|||||||
{% if salt['file.file_exists']('/opt/so/saltstack/local/pillar/kibana/secrets.sls') %}
|
{% if salt['file.file_exists']('/opt/so/saltstack/local/pillar/kibana/secrets.sls') %}
|
||||||
- kibana.secrets
|
- kibana.secrets
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
- data.*
|
||||||
|
- zeeklogs
|
||||||
- secrets
|
- secrets
|
||||||
- healthcheck.standalone
|
- healthcheck.standalone
|
||||||
- global.soc_global
|
- global
|
||||||
- global.adv_global
|
- minions.{{ grains.id }}
|
||||||
- idstools.soc_idstools
|
|
||||||
- idstools.adv_idstools
|
'*_node':
|
||||||
- kratos.soc_kratos
|
- global
|
||||||
- kratos.adv_kratos
|
|
||||||
- redis.soc_redis
|
|
||||||
- redis.adv_redis
|
|
||||||
- influxdb.soc_influxdb
|
|
||||||
- influxdb.adv_influxdb
|
|
||||||
- elasticsearch.soc_elasticsearch
|
|
||||||
- elasticsearch.adv_elasticsearch
|
|
||||||
- manager.soc_manager
|
|
||||||
- manager.adv_manager
|
|
||||||
- soc.soc_soc
|
|
||||||
- backup.soc_backup
|
|
||||||
- backup.adv_backup
|
|
||||||
- firewall.soc_firewall
|
|
||||||
- firewall.adv_firewall
|
|
||||||
- minions.{{ grains.id }}
|
- minions.{{ grains.id }}
|
||||||
- minions.adv_{{ grains.id }}
|
|
||||||
|
|
||||||
'*_heavynode':
|
'*_heavynode':
|
||||||
|
- zeeklogs
|
||||||
- elasticsearch.auth
|
- elasticsearch.auth
|
||||||
- global.soc_global
|
- global
|
||||||
- global.adv_global
|
- minions.{{ grains.id }}
|
||||||
- redis.soc_redis
|
|
||||||
|
'*_helixsensor':
|
||||||
|
- fireeye
|
||||||
|
- zeeklogs
|
||||||
|
- logstash
|
||||||
|
- logstash.helix
|
||||||
|
- global
|
||||||
|
- minions.{{ grains.id }}
|
||||||
|
|
||||||
|
'*_fleet':
|
||||||
|
- data.*
|
||||||
|
- secrets
|
||||||
|
- global
|
||||||
- minions.{{ grains.id }}
|
- minions.{{ grains.id }}
|
||||||
- minions.adv_{{ grains.id }}
|
|
||||||
|
|
||||||
'*_idh':
|
'*_idh':
|
||||||
- global.soc_global
|
- data.*
|
||||||
- global.adv_global
|
- global
|
||||||
- idh.soc_idh
|
|
||||||
- idh.adv_idh
|
|
||||||
- minions.{{ grains.id }}
|
- minions.{{ grains.id }}
|
||||||
- minions.adv_{{ grains.id }}
|
|
||||||
|
|
||||||
'*_searchnode':
|
'*_searchnode':
|
||||||
- logstash
|
- logstash
|
||||||
- logstash.search
|
- logstash.search
|
||||||
- logstash.soc_logstash
|
|
||||||
- logstash.adv_logstash
|
|
||||||
- elasticsearch.index_templates
|
- elasticsearch.index_templates
|
||||||
- elasticsearch.soc_elasticsearch
|
|
||||||
- elasticsearch.adv_elasticsearch
|
|
||||||
{% if salt['file.file_exists']('/opt/so/saltstack/local/pillar/elasticsearch/auth.sls') %}
|
|
||||||
- elasticsearch.auth
|
- elasticsearch.auth
|
||||||
{% endif %}
|
- global
|
||||||
- redis.soc_redis
|
|
||||||
- global.soc_global
|
|
||||||
- global.adv_global
|
|
||||||
- minions.{{ grains.id }}
|
- minions.{{ grains.id }}
|
||||||
- minions.adv_{{ grains.id }}
|
- data.nodestab
|
||||||
|
|
||||||
'*_receiver':
|
'*_receiver':
|
||||||
- logstash
|
- logstash
|
||||||
- logstash.receiver
|
- logstash.receiver
|
||||||
- logstash.soc_logstash
|
|
||||||
- logstash.adv_logstash
|
|
||||||
{% if salt['file.file_exists']('/opt/so/saltstack/local/pillar/elasticsearch/auth.sls') %}
|
|
||||||
- elasticsearch.auth
|
- elasticsearch.auth
|
||||||
{% endif %}
|
- global
|
||||||
- redis.soc_redis
|
|
||||||
- redis.adv_redis
|
|
||||||
- global.soc_global
|
|
||||||
- global.adv_global
|
|
||||||
- minions.{{ grains.id }}
|
- minions.{{ grains.id }}
|
||||||
- minions.adv_{{ grains.id }}
|
|
||||||
|
|
||||||
'*_import':
|
'*_import':
|
||||||
|
- zeeklogs
|
||||||
- secrets
|
- secrets
|
||||||
- elasticsearch.index_templates
|
- elasticsearch.index_templates
|
||||||
{% if salt['file.file_exists']('/opt/so/saltstack/local/pillar/elasticsearch/auth.sls') %}
|
{% if salt['file.file_exists']('/opt/so/saltstack/local/pillar/elasticsearch/auth.sls') %}
|
||||||
@@ -206,39 +129,8 @@ base:
|
|||||||
{% if salt['file.file_exists']('/opt/so/saltstack/local/pillar/kibana/secrets.sls') %}
|
{% if salt['file.file_exists']('/opt/so/saltstack/local/pillar/kibana/secrets.sls') %}
|
||||||
- kibana.secrets
|
- kibana.secrets
|
||||||
{% endif %}
|
{% endif %}
|
||||||
- kratos.soc_kratos
|
- global
|
||||||
- elasticsearch.soc_elasticsearch
|
|
||||||
- elasticsearch.adv_elasticsearch
|
|
||||||
- manager.soc_manager
|
|
||||||
- manager.adv_manager
|
|
||||||
- soc.soc_soc
|
|
||||||
- global.soc_global
|
|
||||||
- global.adv_global
|
|
||||||
- backup.soc_backup
|
|
||||||
- backup.adv_backup
|
|
||||||
- kratos.soc_kratos
|
|
||||||
- kratos.adv_kratos
|
|
||||||
- redis.soc_redis
|
|
||||||
- redis.adv_redis
|
|
||||||
- influxdb.soc_influxdb
|
|
||||||
- influxdb.adv_influxdb
|
|
||||||
- firewall.soc_firewall
|
|
||||||
- firewall.adv_firewall
|
|
||||||
- minions.{{ grains.id }}
|
- minions.{{ grains.id }}
|
||||||
- minions.adv_{{ grains.id }}
|
|
||||||
|
|
||||||
'*_fleet':
|
|
||||||
- global.soc_global
|
|
||||||
- global.adv_global
|
|
||||||
- backup.soc_backup
|
|
||||||
- backup.adv_backup
|
|
||||||
- logstash
|
|
||||||
- logstash.fleet
|
|
||||||
- logstash.soc_logstash
|
|
||||||
- logstash.adv_logstash
|
|
||||||
- minions.{{ grains.id }}
|
|
||||||
- minions.adv_{{ grains.id }}
|
|
||||||
|
|
||||||
'*_workstation':
|
'*_workstation':
|
||||||
- minions.{{ grains.id }}
|
- minions.{{ grains.id }}
|
||||||
- minions.adv_{{ grains.id }}
|
|
||||||
|
|||||||
@@ -1 +1,70 @@
|
|||||||
zeek:
|
zeek:
|
||||||
|
zeekctl:
|
||||||
|
MailTo: root@localhost
|
||||||
|
MailConnectionSummary: 1
|
||||||
|
MinDiskSpace: 5
|
||||||
|
MailHostUpDown: 1
|
||||||
|
LogRotationInterval: 3600
|
||||||
|
LogExpireInterval: 0
|
||||||
|
StatsLogEnable: 1
|
||||||
|
StatsLogExpireInterval: 0
|
||||||
|
StatusCmdShowAll: 0
|
||||||
|
CrashExpireInterval: 0
|
||||||
|
SitePolicyScripts: local.zeek
|
||||||
|
LogDir: /nsm/zeek/logs
|
||||||
|
SpoolDir: /nsm/zeek/spool
|
||||||
|
CfgDir: /opt/zeek/etc
|
||||||
|
CompressLogs: 1
|
||||||
|
ZeekPort: 27760
|
||||||
|
local:
|
||||||
|
'@load':
|
||||||
|
- misc/loaded-scripts
|
||||||
|
- tuning/defaults
|
||||||
|
- misc/capture-loss
|
||||||
|
- misc/stats
|
||||||
|
- frameworks/software/vulnerable
|
||||||
|
- frameworks/software/version-changes
|
||||||
|
- protocols/ftp/software
|
||||||
|
- protocols/smtp/software
|
||||||
|
- protocols/ssh/software
|
||||||
|
- protocols/http/software
|
||||||
|
- protocols/dns/detect-external-names
|
||||||
|
- protocols/ftp/detect
|
||||||
|
- protocols/conn/known-hosts
|
||||||
|
- protocols/conn/known-services
|
||||||
|
- protocols/ssl/known-certs
|
||||||
|
- protocols/ssl/validate-certs
|
||||||
|
- protocols/ssl/log-hostcerts-only
|
||||||
|
- protocols/ssh/geo-data
|
||||||
|
- protocols/ssh/detect-bruteforcing
|
||||||
|
- protocols/ssh/interesting-hostnames
|
||||||
|
- protocols/http/detect-sqli
|
||||||
|
- frameworks/files/hash-all-files
|
||||||
|
- frameworks/files/detect-MHR
|
||||||
|
- policy/frameworks/notice/extend-email/hostnames
|
||||||
|
- policy/frameworks/notice/community-id
|
||||||
|
- policy/protocols/conn/community-id-logging
|
||||||
|
- ja3
|
||||||
|
- hassh
|
||||||
|
- intel
|
||||||
|
- cve-2020-0601
|
||||||
|
- securityonion/bpfconf
|
||||||
|
- securityonion/file-extraction
|
||||||
|
- oui-logging
|
||||||
|
- icsnpp-modbus
|
||||||
|
- icsnpp-dnp3
|
||||||
|
- icsnpp-bacnet
|
||||||
|
- icsnpp-ethercat
|
||||||
|
- icsnpp-enip
|
||||||
|
- icsnpp-opcua-binary
|
||||||
|
- icsnpp-bsap
|
||||||
|
- icsnpp-s7comm
|
||||||
|
- zeek-plugin-tds
|
||||||
|
- zeek-plugin-profinet
|
||||||
|
- zeek-spicy-wireguard
|
||||||
|
- zeek-spicy-stun
|
||||||
|
'@load-sigs':
|
||||||
|
- frameworks/signatures/detect-windows-shells
|
||||||
|
redef:
|
||||||
|
- LogAscii::use_json = T;
|
||||||
|
- CaptureLoss::watch_interval = 5 mins;
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ def check():
|
|||||||
if path.exists('/var/run/reboot-required'):
|
if path.exists('/var/run/reboot-required'):
|
||||||
retval = 'True'
|
retval = 'True'
|
||||||
|
|
||||||
elif os == 'Rocky':
|
elif os == 'CentOS':
|
||||||
cmd = 'needs-restarting -r > /dev/null 2>&1'
|
cmd = 'needs-restarting -r > /dev/null 2>&1'
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
|||||||
@@ -5,8 +5,6 @@ import logging
|
|||||||
def status():
|
def status():
|
||||||
return __salt__['cmd.run']('/usr/sbin/so-status')
|
return __salt__['cmd.run']('/usr/sbin/so-status')
|
||||||
|
|
||||||
def version():
|
|
||||||
return __salt__['cp.get_file_str']('/etc/soversion')
|
|
||||||
|
|
||||||
def mysql_conn(retry):
|
def mysql_conn(retry):
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
# Copyright Security Onion Solutions LLC and/or licensed to Security Onion Solutions LLC under one
|
|
||||||
# or more contributor license agreements. Licensed under the Elastic License 2.0 as shown at
|
|
||||||
# https://securityonion.net/license; you may not use this file except in compliance with the
|
|
||||||
# Elastic License 2.0.
|
|
||||||
|
|
||||||
|
|
||||||
{% set ZEEKVER = salt['pillar.get']('global:mdengine', '') %}
|
{% set ZEEKVER = salt['pillar.get']('global:mdengine', '') %}
|
||||||
|
{% set WAZUH = salt['pillar.get']('global:wazuh', '0') %}
|
||||||
{% set PLAYBOOK = salt['pillar.get']('manager:playbook', '0') %}
|
{% set PLAYBOOK = salt['pillar.get']('manager:playbook', '0') %}
|
||||||
|
{% set FREQSERVER = salt['pillar.get']('manager:freq', '0') %}
|
||||||
|
{% set DOMAINSTATS = salt['pillar.get']('manager:domainstats', '0') %}
|
||||||
|
{% set FLEETMANAGER = salt['pillar.get']('global:fleet_manager', False) %}
|
||||||
|
{% set FLEETNODE = salt['pillar.get']('global:fleet_node', False) %}
|
||||||
{% set ELASTALERT = salt['pillar.get']('elastalert:enabled', True) %}
|
{% set ELASTALERT = salt['pillar.get']('elastalert:enabled', True) %}
|
||||||
{% set ELASTICSEARCH = salt['pillar.get']('elasticsearch:enabled', True) %}
|
{% set ELASTICSEARCH = salt['pillar.get']('elasticsearch:enabled', True) %}
|
||||||
|
{% set FILEBEAT = salt['pillar.get']('filebeat:enabled', True) %}
|
||||||
{% set KIBANA = salt['pillar.get']('kibana:enabled', True) %}
|
{% set KIBANA = salt['pillar.get']('kibana:enabled', True) %}
|
||||||
{% set LOGSTASH = salt['pillar.get']('logstash:enabled', True) %}
|
{% set LOGSTASH = salt['pillar.get']('logstash:enabled', True) %}
|
||||||
{% set CURATOR = salt['pillar.get']('curator:enabled', True) %}
|
{% set CURATOR = salt['pillar.get']('curator:enabled', True) %}
|
||||||
@@ -32,9 +32,9 @@
|
|||||||
'nginx',
|
'nginx',
|
||||||
'telegraf',
|
'telegraf',
|
||||||
'influxdb',
|
'influxdb',
|
||||||
|
'grafana',
|
||||||
'soc',
|
'soc',
|
||||||
'kratos',
|
'kratos',
|
||||||
'elasticfleet',
|
|
||||||
'firewall',
|
'firewall',
|
||||||
'idstools',
|
'idstools',
|
||||||
'suricata.manager',
|
'suricata.manager',
|
||||||
@@ -45,7 +45,8 @@
|
|||||||
'schedule',
|
'schedule',
|
||||||
'soctopus',
|
'soctopus',
|
||||||
'tcpreplay',
|
'tcpreplay',
|
||||||
'docker_clean'
|
'docker_clean',
|
||||||
|
'learn'
|
||||||
],
|
],
|
||||||
'so-heavynode': [
|
'so-heavynode': [
|
||||||
'ssl',
|
'ssl',
|
||||||
@@ -76,10 +77,25 @@
|
|||||||
'tcpreplay',
|
'tcpreplay',
|
||||||
'docker_clean'
|
'docker_clean'
|
||||||
],
|
],
|
||||||
|
'so-fleet': [
|
||||||
|
'ssl',
|
||||||
|
'nginx',
|
||||||
|
'telegraf',
|
||||||
|
'firewall',
|
||||||
|
'mysql',
|
||||||
|
'redis',
|
||||||
|
'fleet',
|
||||||
|
'fleet.install_package',
|
||||||
|
'filebeat',
|
||||||
|
'schedule',
|
||||||
|
'docker_clean'
|
||||||
|
],
|
||||||
'so-idh': [
|
'so-idh': [
|
||||||
'ssl',
|
'ssl',
|
||||||
'telegraf',
|
'telegraf',
|
||||||
'firewall',
|
'firewall',
|
||||||
|
'fleet.install_package',
|
||||||
|
'filebeat',
|
||||||
'idh',
|
'idh',
|
||||||
'schedule',
|
'schedule',
|
||||||
'docker_clean'
|
'docker_clean'
|
||||||
@@ -93,8 +109,6 @@
|
|||||||
'nginx',
|
'nginx',
|
||||||
'soc',
|
'soc',
|
||||||
'kratos',
|
'kratos',
|
||||||
'influxdb',
|
|
||||||
'telegraf',
|
|
||||||
'firewall',
|
'firewall',
|
||||||
'idstools',
|
'idstools',
|
||||||
'suricata.manager',
|
'suricata.manager',
|
||||||
@@ -105,7 +119,7 @@
|
|||||||
'schedule',
|
'schedule',
|
||||||
'tcpreplay',
|
'tcpreplay',
|
||||||
'docker_clean',
|
'docker_clean',
|
||||||
'elasticfleet'
|
'learn'
|
||||||
],
|
],
|
||||||
'so-manager': [
|
'so-manager': [
|
||||||
'salt.master',
|
'salt.master',
|
||||||
@@ -116,16 +130,17 @@
|
|||||||
'nginx',
|
'nginx',
|
||||||
'telegraf',
|
'telegraf',
|
||||||
'influxdb',
|
'influxdb',
|
||||||
|
'grafana',
|
||||||
'soc',
|
'soc',
|
||||||
'kratos',
|
'kratos',
|
||||||
'elasticfleet',
|
|
||||||
'firewall',
|
'firewall',
|
||||||
'idstools',
|
'idstools',
|
||||||
'suricata.manager',
|
'suricata.manager',
|
||||||
'utility',
|
'utility',
|
||||||
'schedule',
|
'schedule',
|
||||||
'soctopus',
|
'soctopus',
|
||||||
'docker_clean'
|
'docker_clean',
|
||||||
|
'learn'
|
||||||
],
|
],
|
||||||
'so-managersearch': [
|
'so-managersearch': [
|
||||||
'salt.master',
|
'salt.master',
|
||||||
@@ -135,9 +150,9 @@
|
|||||||
'nginx',
|
'nginx',
|
||||||
'telegraf',
|
'telegraf',
|
||||||
'influxdb',
|
'influxdb',
|
||||||
|
'grafana',
|
||||||
'soc',
|
'soc',
|
||||||
'kratos',
|
'kratos',
|
||||||
'elasticfleet',
|
|
||||||
'firewall',
|
'firewall',
|
||||||
'manager',
|
'manager',
|
||||||
'idstools',
|
'idstools',
|
||||||
@@ -145,9 +160,10 @@
|
|||||||
'utility',
|
'utility',
|
||||||
'schedule',
|
'schedule',
|
||||||
'soctopus',
|
'soctopus',
|
||||||
'docker_clean'
|
'docker_clean',
|
||||||
|
'learn'
|
||||||
],
|
],
|
||||||
'so-searchnode': [
|
'so-node': [
|
||||||
'ssl',
|
'ssl',
|
||||||
'nginx',
|
'nginx',
|
||||||
'telegraf',
|
'telegraf',
|
||||||
@@ -164,9 +180,9 @@
|
|||||||
'nginx',
|
'nginx',
|
||||||
'telegraf',
|
'telegraf',
|
||||||
'influxdb',
|
'influxdb',
|
||||||
|
'grafana',
|
||||||
'soc',
|
'soc',
|
||||||
'kratos',
|
'kratos',
|
||||||
'elasticfleet',
|
|
||||||
'firewall',
|
'firewall',
|
||||||
'idstools',
|
'idstools',
|
||||||
'suricata.manager',
|
'suricata.manager',
|
||||||
@@ -177,7 +193,8 @@
|
|||||||
'schedule',
|
'schedule',
|
||||||
'soctopus',
|
'soctopus',
|
||||||
'tcpreplay',
|
'tcpreplay',
|
||||||
'docker_clean'
|
'docker_clean',
|
||||||
|
'learn'
|
||||||
],
|
],
|
||||||
'so-sensor': [
|
'so-sensor': [
|
||||||
'ssl',
|
'ssl',
|
||||||
@@ -187,20 +204,12 @@
|
|||||||
'pcap',
|
'pcap',
|
||||||
'suricata',
|
'suricata',
|
||||||
'healthcheck',
|
'healthcheck',
|
||||||
|
'wazuh',
|
||||||
|
'filebeat',
|
||||||
'schedule',
|
'schedule',
|
||||||
'tcpreplay',
|
'tcpreplay',
|
||||||
'docker_clean'
|
'docker_clean'
|
||||||
],
|
],
|
||||||
'so-fleet': [
|
|
||||||
'ssl',
|
|
||||||
'telegraf',
|
|
||||||
'firewall',
|
|
||||||
'logstash',
|
|
||||||
'healthcheck',
|
|
||||||
'schedule',
|
|
||||||
'elasticfleet',
|
|
||||||
'docker_clean'
|
|
||||||
],
|
|
||||||
'so-receiver': [
|
'so-receiver': [
|
||||||
'ssl',
|
'ssl',
|
||||||
'telegraf',
|
'telegraf',
|
||||||
@@ -212,10 +221,26 @@
|
|||||||
],
|
],
|
||||||
}, grain='role') %}
|
}, grain='role') %}
|
||||||
|
|
||||||
{% if (PLAYBOOK != 0) and grains.role in ['so-eval', 'so-manager', 'so-managersearch', 'so-standalone'] %}
|
{% if FILEBEAT and grains.role in ['so-helixsensor', 'so-eval', 'so-manager', 'so-standalone', 'so-node', 'so-managersearch', 'so-heavynode', 'so-import', 'so-receiver'] %}
|
||||||
|
{% do allowed_states.append('filebeat') %}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% if ((FLEETMANAGER or FLEETNODE) or PLAYBOOK != 0) and grains.role in ['so-eval', 'so-manager', 'so-managersearch', 'so-standalone'] %}
|
||||||
{% do allowed_states.append('mysql') %}
|
{% do allowed_states.append('mysql') %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
{% if (FLEETMANAGER or FLEETNODE) and grains.role in ['so-sensor', 'so-eval', 'so-manager', 'so-standalone', 'so-node', 'so-managersearch', 'so-heavynode', 'so-receiver'] %}
|
||||||
|
{% do allowed_states.append('fleet.install_package') %}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% if (FLEETMANAGER or FLEETNODE) and grains.role in ['so-eval', 'so-manager', 'so-standalone', 'so-managersearch', 'so-heavynode'] %}
|
||||||
|
{% do allowed_states.append('fleet') %}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% if (FLEETMANAGER or FLEETNODE) and grains.role in ['so-eval'] %}
|
||||||
|
{% do allowed_states.append('redis') %}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
{%- if ZEEKVER != 'SURICATA' and grains.role in ['so-sensor', 'so-eval', 'so-standalone', 'so-heavynode'] %}
|
{%- if ZEEKVER != 'SURICATA' and grains.role in ['so-sensor', 'so-eval', 'so-standalone', 'so-heavynode'] %}
|
||||||
{% do allowed_states.append('zeek') %}
|
{% do allowed_states.append('zeek') %}
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
@@ -224,7 +249,11 @@
|
|||||||
{% do allowed_states.append('strelka') %}
|
{% do allowed_states.append('strelka') %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% if ELASTICSEARCH and grains.role in ['so-eval', 'so-manager', 'so-standalone', 'so-searchnode', 'so-managersearch', 'so-heavynode', 'so-import'] %}
|
{% if WAZUH and grains.role in ['so-eval', 'so-manager', 'so-standalone', 'so-node', 'so-managersearch', 'so-heavynode', 'so-receiver','so-idh']%}
|
||||||
|
{% do allowed_states.append('wazuh') %}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% if ELASTICSEARCH and grains.role in ['so-eval', 'so-manager', 'so-standalone', 'so-node', 'so-managersearch', 'so-heavynode', 'so-import'] %}
|
||||||
{% do allowed_states.append('elasticsearch') %}
|
{% do allowed_states.append('elasticsearch') %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
@@ -237,7 +266,7 @@
|
|||||||
{% do allowed_states.append('kibana.secrets') %}
|
{% do allowed_states.append('kibana.secrets') %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% if grains.role in ['so-eval', 'so-standalone', 'so-managersearch', 'so-heavynode', 'so-manager'] %}
|
{% if grains.role in ['so-eval', 'so-standalone', 'so-node', 'so-managersearch', 'so-heavynode', 'so-manager'] %}
|
||||||
{% do allowed_states.append('curator') %}
|
{% do allowed_states.append('curator') %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
@@ -253,7 +282,15 @@
|
|||||||
{% do allowed_states.append('redis') %}
|
{% do allowed_states.append('redis') %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% if LOGSTASH and grains.role in ['so-helixsensor', 'so-manager', 'so-standalone', 'so-searchnode', 'so-managersearch', 'so-heavynode', 'so-receiver'] %}
|
{% if (FREQSERVER !=0) and grains.role in ['so-eval', 'so-manager', 'so-standalone', 'so-managersearch'] %}
|
||||||
|
{% do allowed_states.append('freqserver') %}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% if (DOMAINSTATS !=0) and grains.role in ['so-eval', 'so-manager', 'so-standalone', 'so-managersearch'] %}
|
||||||
|
{% do allowed_states.append('domainstats') %}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% if LOGSTASH and grains.role in ['so-helixsensor', 'so-manager', 'so-standalone', 'so-node', 'so-managersearch', 'so-heavynode', 'so-receiver'] %}
|
||||||
{% do allowed_states.append('logstash') %}
|
{% do allowed_states.append('logstash') %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
@@ -261,6 +298,13 @@
|
|||||||
{% do allowed_states.append('redis') %}
|
{% do allowed_states.append('redis') %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
{% if grains.os == 'CentOS' %}
|
||||||
|
{% if not ISAIRGAP %}
|
||||||
|
{% do allowed_states.append('yum') %}
|
||||||
|
{% endif %}
|
||||||
|
{% do allowed_states.append('yum.packages') %}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
{# all nodes on the right salt version can run the following states #}
|
{# all nodes on the right salt version can run the following states #}
|
||||||
{% do allowed_states.append('common') %}
|
{% do allowed_states.append('common') %}
|
||||||
{% do allowed_states.append('patch.os.schedule') %}
|
{% do allowed_states.append('patch.os.schedule') %}
|
||||||
|
|||||||
@@ -1,34 +0,0 @@
|
|||||||
{% from 'backup/map.jinja' import BACKUP_MERGED %}
|
|
||||||
|
|
||||||
# Lock permissions on the backup directory
|
|
||||||
backupdir:
|
|
||||||
file.directory:
|
|
||||||
- name: /nsm/backup
|
|
||||||
- user: 0
|
|
||||||
- group: 0
|
|
||||||
- makedirs: True
|
|
||||||
- mode: 700
|
|
||||||
|
|
||||||
config_backup_script:
|
|
||||||
file.managed:
|
|
||||||
- name: /usr/sbin/so-config-backup
|
|
||||||
- user: root
|
|
||||||
- group: root
|
|
||||||
- mode: 755
|
|
||||||
- template: jinja
|
|
||||||
- source: salt://backup/tools/sbin/so-config-backup.jinja
|
|
||||||
- defaults:
|
|
||||||
BACKUPLOCATIONS: {{ BACKUP_MERGED.locations }}
|
|
||||||
DESTINATION: {{ BACKUP_MERGED.destination }}
|
|
||||||
|
|
||||||
# Add config backup
|
|
||||||
so_config_backup:
|
|
||||||
cron.present:
|
|
||||||
- name: /usr/sbin/so-config-backup > /dev/null 2>&1
|
|
||||||
- identifier: so_config_backup
|
|
||||||
- user: root
|
|
||||||
- minute: '1'
|
|
||||||
- hour: '0'
|
|
||||||
- daymonth: '*'
|
|
||||||
- month: '*'
|
|
||||||
- dayweek: '*'
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
backup:
|
|
||||||
locations:
|
|
||||||
- /opt/so/saltstack/local
|
|
||||||
- /etc/pki
|
|
||||||
- /etc/salt
|
|
||||||
- /nsm/kratos
|
|
||||||
destination: "/nsm/backup"
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
{% import_yaml 'backup/defaults.yaml' as BACKUP_DEFAULTS %}
|
|
||||||
{% set BACKUP_MERGED = salt['pillar.get']('backup', BACKUP_DEFAULTS.backup, merge=true, merge_nested_lists=true) %}
|
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
backup:
|
|
||||||
locations:
|
|
||||||
description: List of locations to back up to the destination.
|
|
||||||
helpLink: backup.html
|
|
||||||
global: True
|
|
||||||
destination:
|
|
||||||
description: Directory to store the configuration backups in.
|
|
||||||
helpLink: backup.html
|
|
||||||
global: True
|
|
||||||
|
|
||||||
@@ -1,37 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
#
|
|
||||||
# Copyright Security Onion Solutions LLC and/or licensed to Security Onion Solutions LLC under one
|
|
||||||
# or more contributor license agreements. Licensed under the Elastic License 2.0 as shown at
|
|
||||||
# https://securityonion.net/license; you may not use this file except in compliance with the
|
|
||||||
# Elastic License 2.0.
|
|
||||||
|
|
||||||
. /usr/sbin/so-common
|
|
||||||
|
|
||||||
TODAY=$(date '+%Y_%m_%d')
|
|
||||||
BACKUPDIR={{ DESTINATION }}
|
|
||||||
BACKUPFILE="$BACKUPDIR/so-config-backup-$TODAY.tar"
|
|
||||||
MAXBACKUPS=7
|
|
||||||
|
|
||||||
# Create backup dir if it does not exist
|
|
||||||
mkdir -p /nsm/backup
|
|
||||||
|
|
||||||
# If we haven't already written a backup file for today, let's do so
|
|
||||||
if [ ! -f $BACKUPFILE ]; then
|
|
||||||
|
|
||||||
# Create empty backup file
|
|
||||||
tar -cf $BACKUPFILE -T /dev/null
|
|
||||||
|
|
||||||
# Loop through all paths defined in global.sls, and append them to backup file
|
|
||||||
{%- for LOCATION in BACKUPLOCATIONS %}
|
|
||||||
tar -rf $BACKUPFILE {{ LOCATION }}
|
|
||||||
{%- endfor %}
|
|
||||||
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Find oldest backup files and remove them
|
|
||||||
NUMBACKUPS=$(find /nsm/backup/ -type f -name "so-config-backup*" | wc -l)
|
|
||||||
while [ "$NUMBACKUPS" -gt "$MAXBACKUPS" ]; do
|
|
||||||
OLDESTBACKUP=$(find /nsm/backup/ -type f -name "so-config-backup*" -type f -printf '%T+ %p\n' | sort | head -n 1 | awk -F" " '{print $2}')
|
|
||||||
rm -f $OLDESTBACKUP
|
|
||||||
NUMBACKUPS=$(find /nsm/backup/ -type f -name "so-config-backup*" | wc -l)
|
|
||||||
done
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
bpf:
|
|
||||||
pcap: []
|
|
||||||
suricata: []
|
|
||||||
zeek: []
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
{% import_yaml 'bpf/defaults.yaml' as BPFDEFAULTS %}
|
|
||||||
{% set BPFMERGED = salt['pillar.get']('bpf', BPFDEFAULTS.bpf, merge=True) %}
|
|
||||||
|
|
||||||
{% set PCAPBPF = BPFMERGED.pcap %}
|
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
bpf:
|
|
||||||
pcap:
|
|
||||||
description: List of BPF filters to apply to PCAP.
|
|
||||||
multiline: True
|
|
||||||
forcedType: "[]string"
|
|
||||||
helpLink: bpf.html
|
|
||||||
suricata:
|
|
||||||
description: List of BPF filters to apply to Suricata.
|
|
||||||
multiline: True
|
|
||||||
forcedType: "[]string"
|
|
||||||
helpLink: bpf.html
|
|
||||||
zeek:
|
|
||||||
description: List of BPF filters to apply to Zeek.
|
|
||||||
multiline: True
|
|
||||||
forcedType: "[]string"
|
|
||||||
helpLink: bpf.html
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
{% import_yaml 'bpf/defaults.yaml' as BPFDEFAULTS %}
|
|
||||||
{% set BPFMERGED = salt['pillar.get']('bpf', BPFDEFAULTS.bpf, merge=True) %}
|
|
||||||
|
|
||||||
{% set SURICATABPF = BPFMERGED.suricata %}
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
{% import_yaml 'bpf/defaults.yaml' as BPFDEFAULTS %}
|
|
||||||
{% set BPFMERGED = salt['pillar.get']('bpf', BPFDEFAULTS.bpf, merge=True) %}
|
|
||||||
|
|
||||||
{% set ZEEKBPF = BPFMERGED.zeek %}
|
|
||||||
@@ -37,7 +37,7 @@ x509_signing_policies:
|
|||||||
- ST: Utah
|
- ST: Utah
|
||||||
- L: Salt Lake City
|
- L: Salt Lake City
|
||||||
- basicConstraints: "critical CA:false"
|
- basicConstraints: "critical CA:false"
|
||||||
- keyUsage: "critical keyEncipherment"
|
- keyUsage: "critical keyEncipherment, digitalSignature"
|
||||||
- subjectKeyIdentifier: hash
|
- subjectKeyIdentifier: hash
|
||||||
- authorityKeyIdentifier: keyid,issuer:always
|
- authorityKeyIdentifier: keyid,issuer:always
|
||||||
- extendedKeyUsage: serverAuth
|
- extendedKeyUsage: serverAuth
|
||||||
@@ -57,7 +57,7 @@ x509_signing_policies:
|
|||||||
- extendedKeyUsage: serverAuth
|
- extendedKeyUsage: serverAuth
|
||||||
- days_valid: 820
|
- days_valid: 820
|
||||||
- copypath: /etc/pki/issued_certs/
|
- copypath: /etc/pki/issued_certs/
|
||||||
elasticfleet:
|
fleet:
|
||||||
- minions: '*'
|
- minions: '*'
|
||||||
- signing_private_key: /etc/pki/ca.key
|
- signing_private_key: /etc/pki/ca.key
|
||||||
- signing_cert: /etc/pki/ca.crt
|
- signing_cert: /etc/pki/ca.crt
|
||||||
@@ -65,8 +65,9 @@ x509_signing_policies:
|
|||||||
- ST: Utah
|
- ST: Utah
|
||||||
- L: Salt Lake City
|
- L: Salt Lake City
|
||||||
- basicConstraints: "critical CA:false"
|
- basicConstraints: "critical CA:false"
|
||||||
- keyUsage: "digitalSignature, nonRepudiation"
|
- keyUsage: "critical keyEncipherment"
|
||||||
- subjectKeyIdentifier: hash
|
- subjectKeyIdentifier: hash
|
||||||
- authorityKeyIdentifier: keyid,issuer:always
|
- authorityKeyIdentifier: keyid,issuer:always
|
||||||
|
- extendedKeyUsage: serverAuth
|
||||||
- days_valid: 820
|
- days_valid: 820
|
||||||
- copypath: /etc/pki/issued_certs/
|
- copypath: /etc/pki/issued_certs/
|
||||||
|
|||||||
@@ -1,16 +1,10 @@
|
|||||||
# Copyright Security Onion Solutions LLC and/or licensed to Security Onion Solutions LLC under one
|
|
||||||
# or more contributor license agreements. Licensed under the Elastic License 2.0 as shown at
|
|
||||||
# https://securityonion.net/license; you may not use this file except in compliance with the
|
|
||||||
# Elastic License 2.0.
|
|
||||||
|
|
||||||
{% from 'allowed_states.map.jinja' import allowed_states %}
|
{% from 'allowed_states.map.jinja' import allowed_states %}
|
||||||
{% if sls in allowed_states %}
|
{% if sls in allowed_states %}
|
||||||
{% from 'vars/globals.map.jinja' import GLOBALS %}
|
|
||||||
|
|
||||||
|
|
||||||
include:
|
include:
|
||||||
- ca.dirs
|
- ca.dirs
|
||||||
|
|
||||||
|
{% set manager = salt['grains.get']('master') %}
|
||||||
/etc/salt/minion.d/signing_policies.conf:
|
/etc/salt/minion.d/signing_policies.conf:
|
||||||
file.managed:
|
file.managed:
|
||||||
- source: salt://ca/files/signing_policies.conf
|
- source: salt://ca/files/signing_policies.conf
|
||||||
@@ -18,7 +12,7 @@ include:
|
|||||||
pki_private_key:
|
pki_private_key:
|
||||||
x509.private_key_managed:
|
x509.private_key_managed:
|
||||||
- name: /etc/pki/ca.key
|
- name: /etc/pki/ca.key
|
||||||
- keysize: 4096
|
- bits: 4096
|
||||||
- passphrase:
|
- passphrase:
|
||||||
- cipher: aes_256_cbc
|
- cipher: aes_256_cbc
|
||||||
- backup: True
|
- backup: True
|
||||||
@@ -31,7 +25,7 @@ pki_public_ca_crt:
|
|||||||
x509.certificate_managed:
|
x509.certificate_managed:
|
||||||
- name: /etc/pki/ca.crt
|
- name: /etc/pki/ca.crt
|
||||||
- signing_private_key: /etc/pki/ca.key
|
- signing_private_key: /etc/pki/ca.key
|
||||||
- CN: {{ GLOBALS.manager }}
|
- CN: {{ manager }}
|
||||||
- C: US
|
- C: US
|
||||||
- ST: Utah
|
- ST: Utah
|
||||||
- L: Salt Lake City
|
- L: Salt Lake City
|
||||||
@@ -39,7 +33,7 @@ pki_public_ca_crt:
|
|||||||
- keyUsage: "critical cRLSign, keyCertSign"
|
- keyUsage: "critical cRLSign, keyCertSign"
|
||||||
- extendedkeyUsage: "serverAuth, clientAuth"
|
- extendedkeyUsage: "serverAuth, clientAuth"
|
||||||
- subjectKeyIdentifier: hash
|
- subjectKeyIdentifier: hash
|
||||||
- authorityKeyIdentifier: keyid:always, issuer
|
- authorityKeyIdentifier: keyid,issuer:always
|
||||||
- days_valid: 3650
|
- days_valid: 3650
|
||||||
- days_remaining: 0
|
- days_remaining: 0
|
||||||
- backup: True
|
- backup: True
|
||||||
|
|||||||
@@ -1,9 +1,7 @@
|
|||||||
{%- set DOCKERRANGE = salt['pillar.get']('docker:range', '172.17.0.0/24') %}
|
{%- set DOCKERRANGE = salt['pillar.get']('docker:range', '172.17.0.0/24') %}
|
||||||
{%- set DOCKERBIND = salt['pillar.get']('docker:bip', '172.17.0.1/24') %}
|
{%- set DOCKERBIND = salt['pillar.get']('docker:bip', '172.17.0.1/24') %}
|
||||||
{
|
{
|
||||||
"registry-mirrors": [
|
"registry-mirrors": [ "https://:5000" ],
|
||||||
"https://:5000"
|
|
||||||
],
|
|
||||||
"bip": "{{ DOCKERBIND }}",
|
"bip": "{{ DOCKERBIND }}",
|
||||||
"default-address-pools": [
|
"default-address-pools": [
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -20,3 +20,16 @@
|
|||||||
dateext
|
dateext
|
||||||
dateyesterday
|
dateyesterday
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/opt/so/log/strelka/filecheck.log
|
||||||
|
{
|
||||||
|
daily
|
||||||
|
rotate 14
|
||||||
|
missingok
|
||||||
|
copytruncate
|
||||||
|
compress
|
||||||
|
create
|
||||||
|
extension .log
|
||||||
|
dateext
|
||||||
|
dateyesterday
|
||||||
|
}
|
||||||
|
|||||||
@@ -3,3 +3,4 @@ filetype plugin indent on
|
|||||||
|
|
||||||
" Sets .sls files to use YAML syntax highlighting
|
" Sets .sls files to use YAML syntax highlighting
|
||||||
autocmd BufNewFile,BufRead *.sls set syntax=yaml
|
autocmd BufNewFile,BufRead *.sls set syntax=yaml
|
||||||
|
set number
|
||||||
@@ -1,12 +1,12 @@
|
|||||||
{% from 'allowed_states.map.jinja' import allowed_states %}
|
{% from 'allowed_states.map.jinja' import allowed_states %}
|
||||||
{% if sls in allowed_states %}
|
{% if sls in allowed_states %}
|
||||||
|
|
||||||
{% from 'vars/globals.map.jinja' import GLOBALS %}
|
{% set role = grains.id.split('_') | last %}
|
||||||
|
{% from 'elasticsearch/auth.map.jinja' import ELASTICAUTH with context %}
|
||||||
|
|
||||||
include:
|
include:
|
||||||
- common.soup_scripts
|
- common.soup_scripts
|
||||||
- common.packages
|
{% if grains.role in ['so-eval', 'so-manager', 'so-standalone', 'so-managersearch', 'so-import'] %}
|
||||||
{% if GLOBALS.role in GLOBALS.manager_roles %}
|
|
||||||
- manager.elasticsearch # needed for elastic_curl_config state
|
- manager.elasticsearch # needed for elastic_curl_config state
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
@@ -15,6 +15,11 @@ rmvariablesfile:
|
|||||||
file.absent:
|
file.absent:
|
||||||
- name: /tmp/variables.txt
|
- name: /tmp/variables.txt
|
||||||
|
|
||||||
|
dockergroup:
|
||||||
|
group.present:
|
||||||
|
- name: docker
|
||||||
|
- gid: 920
|
||||||
|
|
||||||
# Add socore Group
|
# Add socore Group
|
||||||
socoregroup:
|
socoregroup:
|
||||||
group.present:
|
group.present:
|
||||||
@@ -83,6 +88,91 @@ vimconfig:
|
|||||||
- source: salt://common/files/vimrc
|
- source: salt://common/files/vimrc
|
||||||
- replace: False
|
- replace: False
|
||||||
|
|
||||||
|
# Install common packages
|
||||||
|
{% if grains['os'] != 'CentOS' %}
|
||||||
|
commonpkgs:
|
||||||
|
pkg.installed:
|
||||||
|
- skip_suggestions: True
|
||||||
|
- pkgs:
|
||||||
|
- apache2-utils
|
||||||
|
- wget
|
||||||
|
- ntpdate
|
||||||
|
- jq
|
||||||
|
- python3-docker
|
||||||
|
- curl
|
||||||
|
- ca-certificates
|
||||||
|
- software-properties-common
|
||||||
|
- apt-transport-https
|
||||||
|
- openssl
|
||||||
|
- netcat
|
||||||
|
- python3-mysqldb
|
||||||
|
- sqlite3
|
||||||
|
- libssl-dev
|
||||||
|
- python3-dateutil
|
||||||
|
- python3-m2crypto
|
||||||
|
- python3-packaging
|
||||||
|
- python3-lxml
|
||||||
|
- git
|
||||||
|
- vim
|
||||||
|
|
||||||
|
heldpackages:
|
||||||
|
pkg.installed:
|
||||||
|
- pkgs:
|
||||||
|
{% if grains['oscodename'] == 'bionic' %}
|
||||||
|
- containerd.io: 1.4.4-1
|
||||||
|
- docker-ce: 5:20.10.5~3-0~ubuntu-bionic
|
||||||
|
- docker-ce-cli: 5:20.10.5~3-0~ubuntu-bionic
|
||||||
|
- docker-ce-rootless-extras: 5:20.10.5~3-0~ubuntu-bionic
|
||||||
|
{% elif grains['oscodename'] == 'focal' %}
|
||||||
|
- containerd.io: 1.4.9-1
|
||||||
|
- docker-ce: 5:20.10.8~3-0~ubuntu-focal
|
||||||
|
- docker-ce-cli: 5:20.10.5~3-0~ubuntu-focal
|
||||||
|
- docker-ce-rootless-extras: 5:20.10.5~3-0~ubuntu-focal
|
||||||
|
{% endif %}
|
||||||
|
- hold: True
|
||||||
|
- update_holds: True
|
||||||
|
|
||||||
|
{% else %}
|
||||||
|
commonpkgs:
|
||||||
|
pkg.installed:
|
||||||
|
- skip_suggestions: True
|
||||||
|
- pkgs:
|
||||||
|
- wget
|
||||||
|
- ntpdate
|
||||||
|
- bind-utils
|
||||||
|
- jq
|
||||||
|
- tcpdump
|
||||||
|
- httpd-tools
|
||||||
|
- net-tools
|
||||||
|
- curl
|
||||||
|
- sqlite
|
||||||
|
- mariadb-devel
|
||||||
|
- nmap-ncat
|
||||||
|
- python3
|
||||||
|
- python36-docker
|
||||||
|
- python36-dateutil
|
||||||
|
- python36-m2crypto
|
||||||
|
- python36-packaging
|
||||||
|
- python36-lxml
|
||||||
|
- yum-utils
|
||||||
|
- device-mapper-persistent-data
|
||||||
|
- lvm2
|
||||||
|
- openssl
|
||||||
|
- git
|
||||||
|
- vim-enhanced
|
||||||
|
|
||||||
|
heldpackages:
|
||||||
|
pkg.installed:
|
||||||
|
- pkgs:
|
||||||
|
- containerd.io: 1.4.4-3.1.el7
|
||||||
|
- docker-ce: 3:20.10.5-3.el7
|
||||||
|
- docker-ce-cli: 1:20.10.5-3.el7
|
||||||
|
- docker-ce-rootless-extras: 20.10.5-3.el7
|
||||||
|
- python36-mysql: 1.3.12-2.el7
|
||||||
|
- hold: True
|
||||||
|
- update_holds: True
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
# Always keep these packages up to date
|
# Always keep these packages up to date
|
||||||
|
|
||||||
alwaysupdated:
|
alwaysupdated:
|
||||||
@@ -97,8 +187,7 @@ alwaysupdated:
|
|||||||
Etc/UTC:
|
Etc/UTC:
|
||||||
timezone.system
|
timezone.system
|
||||||
|
|
||||||
# Sync curl configuration for Elasticsearch authentication
|
{% if salt['pillar.get']('elasticsearch:auth:enabled', False) %}
|
||||||
{% if GLOBALS.role in ['so-eval', 'so-heavynode', 'so-import', 'so-manager', 'so-managersearch', 'so-searchnode', 'so-standalone'] %}
|
|
||||||
elastic_curl_config:
|
elastic_curl_config:
|
||||||
file.managed:
|
file.managed:
|
||||||
- name: /opt/so/conf/elasticsearch/curl.config
|
- name: /opt/so/conf/elasticsearch/curl.config
|
||||||
@@ -106,7 +195,7 @@ elastic_curl_config:
|
|||||||
- mode: 600
|
- mode: 600
|
||||||
- show_changes: False
|
- show_changes: False
|
||||||
- makedirs: True
|
- makedirs: True
|
||||||
{% if GLOBALS.role in GLOBALS.manager_roles %}
|
{% if grains.role in ['so-eval', 'so-manager', 'so-standalone', 'so-managersearch', 'so-import'] %}
|
||||||
- require:
|
- require:
|
||||||
- file: elastic_curl_config_distributed
|
- file: elastic_curl_config_distributed
|
||||||
{% endif %}
|
{% endif %}
|
||||||
@@ -121,25 +210,20 @@ utilsyncscripts:
|
|||||||
- file_mode: 755
|
- file_mode: 755
|
||||||
- template: jinja
|
- template: jinja
|
||||||
- source: salt://common/tools/sbin
|
- source: salt://common/tools/sbin
|
||||||
|
- defaults:
|
||||||
|
ELASTICCURL: 'curl'
|
||||||
|
- context:
|
||||||
|
ELASTICCURL: {{ ELASTICAUTH.elasticcurl }}
|
||||||
- exclude_pat:
|
- exclude_pat:
|
||||||
- so-common
|
- so-common
|
||||||
- so-firewall
|
- so-firewall
|
||||||
- so-image-common
|
- so-image-common
|
||||||
- soup
|
- soup
|
||||||
- so-status
|
|
||||||
|
|
||||||
so-status_script:
|
{% if role in ['eval', 'standalone', 'sensor', 'heavynode'] %}
|
||||||
file.managed:
|
|
||||||
- name: /usr/sbin/so-status
|
|
||||||
- source: salt://common/tools/sbin/so-status
|
|
||||||
- mode: 755
|
|
||||||
|
|
||||||
{% if GLOBALS.role in GLOBALS.sensor_roles %}
|
|
||||||
# Add sensor cleanup
|
# Add sensor cleanup
|
||||||
so-sensor-clean:
|
/usr/sbin/so-sensor-clean:
|
||||||
cron.present:
|
cron.present:
|
||||||
- name: /usr/sbin/so-sensor-clean
|
|
||||||
- identifier: so-sensor-clean
|
|
||||||
- user: root
|
- user: root
|
||||||
- minute: '*'
|
- minute: '*'
|
||||||
- hour: '*'
|
- hour: '*'
|
||||||
@@ -159,10 +243,8 @@ sensorrotateconf:
|
|||||||
- source: salt://common/files/sensor-rotate.conf
|
- source: salt://common/files/sensor-rotate.conf
|
||||||
- mode: 644
|
- mode: 644
|
||||||
|
|
||||||
sensor-rotate:
|
/usr/local/bin/sensor-rotate:
|
||||||
cron.present:
|
cron.present:
|
||||||
- name: /usr/local/bin/sensor-rotate
|
|
||||||
- identifier: sensor-rotate
|
|
||||||
- user: root
|
- user: root
|
||||||
- minute: '1'
|
- minute: '1'
|
||||||
- hour: '0'
|
- hour: '0'
|
||||||
@@ -185,10 +267,8 @@ commonlogrotateconf:
|
|||||||
- template: jinja
|
- template: jinja
|
||||||
- mode: 644
|
- mode: 644
|
||||||
|
|
||||||
common-rotate:
|
/usr/local/bin/common-rotate:
|
||||||
cron.present:
|
cron.present:
|
||||||
- name: /usr/local/bin/common-rotate
|
|
||||||
- identifier: common-rotate
|
|
||||||
- user: root
|
- user: root
|
||||||
- minute: '1'
|
- minute: '1'
|
||||||
- hour: '0'
|
- hour: '0'
|
||||||
@@ -209,11 +289,9 @@ sostatus_log:
|
|||||||
- name: /opt/so/log/sostatus/status.log
|
- name: /opt/so/log/sostatus/status.log
|
||||||
- mode: 644
|
- mode: 644
|
||||||
|
|
||||||
# Install sostatus check cron. This is used to populate Grid.
|
# Install sostatus check cron
|
||||||
so-status_check_cron:
|
'/usr/sbin/so-status -q; echo $? > /opt/so/log/sostatus/status.log 2>&1':
|
||||||
cron.present:
|
cron.present:
|
||||||
- name: '/usr/sbin/so-status -j > /opt/so/log/sostatus/status.log 2>&1'
|
|
||||||
- identifier: so-status_check_cron
|
|
||||||
- user: root
|
- user: root
|
||||||
- minute: '*/1'
|
- minute: '*/1'
|
||||||
- hour: '*'
|
- hour: '*'
|
||||||
@@ -221,13 +299,36 @@ so-status_check_cron:
|
|||||||
- month: '*'
|
- month: '*'
|
||||||
- dayweek: '*'
|
- dayweek: '*'
|
||||||
|
|
||||||
remove_post_setup_cron:
|
{% if role in ['eval', 'manager', 'managersearch', 'standalone'] %}
|
||||||
cron.absent:
|
# Install cron job to determine size of influxdb for telegraf
|
||||||
- name: 'PATH=$PATH:/usr/sbin salt-call state.highstate'
|
'du -s -k /nsm/influxdb | cut -f1 > /opt/so/log/telegraf/influxdb_size.log 2>&1':
|
||||||
- identifier: post_setup_cron
|
cron.present:
|
||||||
|
- user: root
|
||||||
|
- minute: '*/1'
|
||||||
|
- hour: '*'
|
||||||
|
- daymonth: '*'
|
||||||
|
- month: '*'
|
||||||
|
- dayweek: '*'
|
||||||
|
|
||||||
{% if GLOBALS.role not in ['eval', 'manager', 'managersearch', 'standalone'] %}
|
# Lock permissions on the backup directory
|
||||||
|
backupdir:
|
||||||
|
file.directory:
|
||||||
|
- name: /nsm/backup
|
||||||
|
- user: 0
|
||||||
|
- group: 0
|
||||||
|
- makedirs: True
|
||||||
|
- mode: 700
|
||||||
|
|
||||||
|
# Add config backup
|
||||||
|
/usr/sbin/so-config-backup > /dev/null 2>&1:
|
||||||
|
cron.present:
|
||||||
|
- user: root
|
||||||
|
- minute: '1'
|
||||||
|
- hour: '0'
|
||||||
|
- daymonth: '*'
|
||||||
|
- month: '*'
|
||||||
|
- dayweek: '*'
|
||||||
|
{% else %}
|
||||||
soversionfile:
|
soversionfile:
|
||||||
file.managed:
|
file.managed:
|
||||||
- name: /etc/soversion
|
- name: /etc/soversion
|
||||||
@@ -237,8 +338,34 @@ soversionfile:
|
|||||||
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% if GLOBALS.so_model and GLOBALS.so_model not in ['SO2AMI01', 'SO2AZI01', 'SO2GCI01'] %}
|
# Manager daemon.json
|
||||||
{% if GLOBALS.os == 'Rocky' %}
|
docker_daemon:
|
||||||
|
file.managed:
|
||||||
|
- source: salt://common/files/daemon.json
|
||||||
|
- name: /etc/docker/daemon.json
|
||||||
|
- template: jinja
|
||||||
|
|
||||||
|
# Make sure Docker is always running
|
||||||
|
docker:
|
||||||
|
service.running:
|
||||||
|
- enable: True
|
||||||
|
- watch:
|
||||||
|
- file: docker_daemon
|
||||||
|
|
||||||
|
# Reserve OS ports for Docker proxy in case boot settings are not already applied/present
|
||||||
|
# 55000 = Wazuh, 57314 = Strelka, 47760-47860 = Zeek
|
||||||
|
dockerapplyports:
|
||||||
|
cmd.run:
|
||||||
|
- name: if [ ! -s /etc/sysctl.d/99-reserved-ports.conf ]; then sysctl -w net.ipv4.ip_local_reserved_ports="55000,57314,47760-47860"; fi
|
||||||
|
|
||||||
|
# Reserve OS ports for Docker proxy
|
||||||
|
dockerreserveports:
|
||||||
|
file.managed:
|
||||||
|
- source: salt://common/files/99-reserved-ports.conf
|
||||||
|
- name: /etc/sysctl.d/99-reserved-ports.conf
|
||||||
|
|
||||||
|
{% if salt['grains.get']('sosmodel', '') %}
|
||||||
|
{% if grains['os'] == 'CentOS' %}
|
||||||
# Install Raid tools
|
# Install Raid tools
|
||||||
raidpkgs:
|
raidpkgs:
|
||||||
pkg.installed:
|
pkg.installed:
|
||||||
@@ -249,10 +376,8 @@ raidpkgs:
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
# Install raid check cron
|
# Install raid check cron
|
||||||
so-raid-status:
|
/usr/sbin/so-raid-status > /dev/null 2>&1:
|
||||||
cron.present:
|
cron.present:
|
||||||
- name: '/usr/sbin/so-raid-status > /dev/null 2>&1'
|
|
||||||
- identifier: so-raid-status
|
|
||||||
- user: root
|
- user: root
|
||||||
- minute: '*/15'
|
- minute: '*/15'
|
||||||
- hour: '*'
|
- hour: '*'
|
||||||
|
|||||||
@@ -1,67 +0,0 @@
|
|||||||
{% from 'vars/globals.map.jinja' import GLOBALS %}
|
|
||||||
|
|
||||||
{% if GLOBALS.os == 'Ubuntu' %}
|
|
||||||
commonpkgs:
|
|
||||||
pkg.installed:
|
|
||||||
- skip_suggestions: True
|
|
||||||
- pkgs:
|
|
||||||
- apache2-utils
|
|
||||||
- wget
|
|
||||||
- ntpdate
|
|
||||||
- jq
|
|
||||||
- curl
|
|
||||||
- ca-certificates
|
|
||||||
- software-properties-common
|
|
||||||
- apt-transport-https
|
|
||||||
- openssl
|
|
||||||
- netcat
|
|
||||||
- sqlite3
|
|
||||||
- libssl-dev
|
|
||||||
- python3-dateutil
|
|
||||||
- python3-packaging
|
|
||||||
- python3-watchdog
|
|
||||||
- python3-lxml
|
|
||||||
- git
|
|
||||||
- vim
|
|
||||||
|
|
||||||
# since Ubuntu requires and internet connection we can use pip to install modules
|
|
||||||
python3-pip:
|
|
||||||
pkg.installed
|
|
||||||
|
|
||||||
python-rich:
|
|
||||||
pip.installed:
|
|
||||||
- name: rich
|
|
||||||
- target: /usr/local/lib/python3.8/dist-packages/
|
|
||||||
- require:
|
|
||||||
- pkg: python3-pip
|
|
||||||
|
|
||||||
|
|
||||||
{% elif GLOBALS.os == 'Rocky' %}
|
|
||||||
commonpkgs:
|
|
||||||
pkg.installed:
|
|
||||||
- skip_suggestions: True
|
|
||||||
- pkgs:
|
|
||||||
- wget
|
|
||||||
- jq
|
|
||||||
- tcpdump
|
|
||||||
- httpd-tools
|
|
||||||
- net-tools
|
|
||||||
- curl
|
|
||||||
- sqlite
|
|
||||||
- mariadb-devel
|
|
||||||
- python3-dnf-plugin-versionlock
|
|
||||||
- nmap-ncat
|
|
||||||
- yum-utils
|
|
||||||
- device-mapper-persistent-data
|
|
||||||
- lvm2
|
|
||||||
- openssl
|
|
||||||
- git
|
|
||||||
- python3-docker
|
|
||||||
- python3-m2crypto
|
|
||||||
- rsync
|
|
||||||
- python3-rich
|
|
||||||
- python3-pyyaml
|
|
||||||
- python3-watchdog
|
|
||||||
- python3-packaging
|
|
||||||
- unzip
|
|
||||||
{% endif %}
|
|
||||||
@@ -1,11 +1,207 @@
|
|||||||
#!/usr/bin/bash
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
# Copyright Security Onion Solutions LLC and/or licensed to Security Onion Solutions LLC under one
|
# Copyright 2014-2023 Security Onion Solutions, LLC
|
||||||
# or more contributor license agreements. Licensed under the Elastic License 2.0 as shown at
|
#
|
||||||
# https://securityonion.net/license; you may not use this file except in compliance with the
|
# This program is free software: you can redistribute it and/or modify
|
||||||
# Elastic License 2.0.
|
# 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/>.
|
||||||
|
|
||||||
echo "Please use the Configuration section in SOC to allow hosts"
|
import ipaddress
|
||||||
echo ""
|
import textwrap
|
||||||
echo "If you need command line options on adding hosts please run so-firewall"
|
import os
|
||||||
|
import subprocess
|
||||||
|
import sys
|
||||||
|
import argparse
|
||||||
|
import re
|
||||||
|
from lxml import etree as ET
|
||||||
|
from datetime import datetime as dt
|
||||||
|
from datetime import timezone as tz
|
||||||
|
|
||||||
|
|
||||||
|
LOCAL_SALT_DIR='/opt/so/saltstack/local'
|
||||||
|
WAZUH_CONF='/nsm/wazuh/etc/ossec.conf'
|
||||||
|
VALID_ROLES = {
|
||||||
|
'a': { 'role': 'analyst','desc': 'Analyst - 80/tcp, 443/tcp' },
|
||||||
|
'b': { 'role': 'beats_endpoint', 'desc': 'Logstash Beat - 5044/tcp' },
|
||||||
|
'e': { 'role': 'elasticsearch_rest', 'desc': 'Elasticsearch REST API - 9200/tcp' },
|
||||||
|
'f': { 'role': 'strelka_frontend', 'desc': 'Strelka frontend - 57314/tcp' },
|
||||||
|
'o': { 'role': 'osquery_endpoint', 'desc': 'Osquery endpoint - 8090/tcp' },
|
||||||
|
's': { 'role': 'syslog', 'desc': 'Syslog device - 514/tcp/udp' },
|
||||||
|
'w': { 'role': 'wazuh_agent', 'desc': 'Wazuh agent - 1514/tcp/udp' },
|
||||||
|
'p': { 'role': 'wazuh_api', 'desc': 'Wazuh API - 55000/tcp' },
|
||||||
|
'r': { 'role': 'wazuh_authd', 'desc': 'Wazuh registration service - 1515/tcp' }
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
def validate_ip_cidr(ip_cidr: str) -> bool:
|
||||||
|
try:
|
||||||
|
ipaddress.ip_address(ip_cidr)
|
||||||
|
except ValueError:
|
||||||
|
try:
|
||||||
|
ipaddress.ip_network(ip_cidr)
|
||||||
|
except ValueError:
|
||||||
|
return False
|
||||||
|
return True
|
||||||
|
|
||||||
|
|
||||||
|
def role_prompt() -> str:
|
||||||
|
print()
|
||||||
|
print('Choose the role for the IP or Range you would like to allow')
|
||||||
|
print()
|
||||||
|
for role in VALID_ROLES:
|
||||||
|
print(f'[{role}] - {VALID_ROLES[role]["desc"]}')
|
||||||
|
print()
|
||||||
|
role = input('Please enter your selection: ')
|
||||||
|
if role in VALID_ROLES.keys():
|
||||||
|
return VALID_ROLES[role]['role']
|
||||||
|
else:
|
||||||
|
print(f'Invalid role \'{role}\', please try again.', file=sys.stderr)
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
|
|
||||||
|
def ip_prompt() -> str:
|
||||||
|
ip = input('Enter a single ip address or range to allow (ex: 10.10.10.10 or 10.10.0.0/16): ')
|
||||||
|
if validate_ip_cidr(ip):
|
||||||
|
return ip
|
||||||
|
else:
|
||||||
|
print(f'Invalid IP address or CIDR block \'{ip}\', please try again.', file=sys.stderr)
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
|
|
||||||
|
def wazuh_enabled() -> bool:
|
||||||
|
file = f'{LOCAL_SALT_DIR}/pillar/global.sls'
|
||||||
|
with open(file, 'r') as pillar:
|
||||||
|
if 'wazuh: 1' in pillar.read():
|
||||||
|
return True
|
||||||
|
return False
|
||||||
|
|
||||||
|
|
||||||
|
def root_to_str(root: ET.ElementTree) -> str:
|
||||||
|
return ET.tostring(root, encoding='unicode', method='xml', xml_declaration=False, pretty_print=True)
|
||||||
|
|
||||||
|
|
||||||
|
def add_wl(ip):
|
||||||
|
parser = ET.XMLParser(remove_blank_text=True)
|
||||||
|
with open(WAZUH_CONF, 'rb') as wazuh_conf:
|
||||||
|
tree = ET.parse(wazuh_conf, parser)
|
||||||
|
root = tree.getroot()
|
||||||
|
|
||||||
|
source_comment = ET.Comment(f'Address {ip} added by /usr/sbin/so-allow on {dt.utcnow().replace(tzinfo=tz.utc).strftime("%a %b %e %H:%M:%S %Z %Y")}')
|
||||||
|
new_global = ET.Element("global")
|
||||||
|
new_wl = ET.SubElement(new_global, 'white_list')
|
||||||
|
new_wl.text = ip
|
||||||
|
|
||||||
|
root.append(source_comment)
|
||||||
|
root.append(new_global)
|
||||||
|
|
||||||
|
with open(WAZUH_CONF, 'w') as add_out:
|
||||||
|
add_out.write(root_to_str(root))
|
||||||
|
|
||||||
|
|
||||||
|
def apply(role: str, ip: str) -> int:
|
||||||
|
firewall_cmd = ['so-firewall', 'includehost', role, ip]
|
||||||
|
salt_cmd = ['salt-call', 'state.apply', '-l', 'quiet', 'firewall', 'queue=True']
|
||||||
|
restart_wazuh_cmd = ['so-wazuh-restart']
|
||||||
|
print(f'Adding {ip} to the {role} role. This can take a few seconds...')
|
||||||
|
cmd = subprocess.run(firewall_cmd)
|
||||||
|
if cmd.returncode == 0:
|
||||||
|
cmd = subprocess.run(salt_cmd, stdout=subprocess.DEVNULL)
|
||||||
|
else:
|
||||||
|
return cmd.returncode
|
||||||
|
if cmd.returncode == 0:
|
||||||
|
if wazuh_enabled() and role=='analyst':
|
||||||
|
try:
|
||||||
|
add_wl(ip)
|
||||||
|
print(f'Added whitelist entry for {ip} from {WAZUH_CONF}', file=sys.stderr)
|
||||||
|
except Exception as e:
|
||||||
|
print(f'Failed to add whitelist entry for {ip} from {WAZUH_CONF}', file=sys.stderr)
|
||||||
|
print(e)
|
||||||
|
return 1
|
||||||
|
print('Restarting OSSEC Server...')
|
||||||
|
cmd = subprocess.run(restart_wazuh_cmd)
|
||||||
|
else:
|
||||||
|
return cmd.returncode
|
||||||
|
else:
|
||||||
|
print(f'Commmand \'{" ".join(salt_cmd)}\' failed.', file=sys.stderr)
|
||||||
|
return cmd.returncode
|
||||||
|
if cmd.returncode != 0:
|
||||||
|
print('Failed to restart OSSEC server.')
|
||||||
|
return cmd.returncode
|
||||||
|
|
||||||
|
|
||||||
|
def main():
|
||||||
|
if os.geteuid() != 0:
|
||||||
|
print('You must run this script as root', file=sys.stderr)
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
|
main_parser = argparse.ArgumentParser(
|
||||||
|
formatter_class=argparse.RawDescriptionHelpFormatter,
|
||||||
|
epilog=textwrap.dedent(f'''\
|
||||||
|
additional information:
|
||||||
|
To use this script in interactive mode call it with no arguments
|
||||||
|
'''
|
||||||
|
))
|
||||||
|
|
||||||
|
group = main_parser.add_argument_group(title='roles')
|
||||||
|
group.add_argument('-a', dest='roles', action='append_const', const=VALID_ROLES['a']['role'], help="Analyst - 80/tcp, 443/tcp")
|
||||||
|
group.add_argument('-b', dest='roles', action='append_const', const=VALID_ROLES['b']['role'], help="Logstash Beat - 5044/tcp")
|
||||||
|
group.add_argument('-e', dest='roles', action='append_const', const=VALID_ROLES['e']['role'], help="Elasticsearch REST API - 9200/tcp")
|
||||||
|
group.add_argument('-f', dest='roles', action='append_const', const=VALID_ROLES['f']['role'], help="Strelka frontend - 57314/tcp")
|
||||||
|
group.add_argument('-o', dest='roles', action='append_const', const=VALID_ROLES['o']['role'], help="Osquery endpoint - 8090/tcp")
|
||||||
|
group.add_argument('-s', dest='roles', action='append_const', const=VALID_ROLES['s']['role'], help="Syslog device - 514/tcp/udp")
|
||||||
|
group.add_argument('-w', dest='roles', action='append_const', const=VALID_ROLES['w']['role'], help="Wazuh agent - 1514/tcp/udp")
|
||||||
|
group.add_argument('-p', dest='roles', action='append_const', const=VALID_ROLES['p']['role'], help="Wazuh API - 55000/tcp")
|
||||||
|
group.add_argument('-r', dest='roles', action='append_const', const=VALID_ROLES['r']['role'], help="Wazuh registration service - 1515/tcp")
|
||||||
|
|
||||||
|
ip_g = main_parser.add_argument_group(title='allow')
|
||||||
|
ip_g.add_argument('-i', help="IP or CIDR block to disallow connections from, requires at least one role argument", metavar='', dest='ip')
|
||||||
|
|
||||||
|
args = main_parser.parse_args(sys.argv[1:])
|
||||||
|
|
||||||
|
if args.roles is None:
|
||||||
|
role = role_prompt()
|
||||||
|
ip = ip_prompt()
|
||||||
|
try:
|
||||||
|
return_code = apply(role, ip)
|
||||||
|
except Exception as e:
|
||||||
|
print(f'Unexpected exception occurred: {e}', file=sys.stderr)
|
||||||
|
return_code = e.errno
|
||||||
|
sys.exit(return_code)
|
||||||
|
elif args.roles is not None and args.ip is None:
|
||||||
|
if os.environ.get('IP') is None:
|
||||||
|
main_parser.print_help()
|
||||||
|
sys.exit(1)
|
||||||
|
else:
|
||||||
|
args.ip = os.environ['IP']
|
||||||
|
|
||||||
|
if validate_ip_cidr(args.ip):
|
||||||
|
try:
|
||||||
|
for role in args.roles:
|
||||||
|
return_code = apply(role, args.ip)
|
||||||
|
if return_code > 0:
|
||||||
|
break
|
||||||
|
except Exception as e:
|
||||||
|
print(f'Unexpected exception occurred: {e}', file=sys.stderr)
|
||||||
|
return_code = e.errno
|
||||||
|
else:
|
||||||
|
print(f'Invalid IP address or CIDR block \'{args.ip}\', please try again.', file=sys.stderr)
|
||||||
|
return_code = 1
|
||||||
|
|
||||||
|
sys.exit(return_code)
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
try:
|
||||||
|
main()
|
||||||
|
except KeyboardInterrupt:
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
|
|||||||
@@ -1,11 +1,19 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# Copyright Security Onion Solutions LLC and/or licensed to Security Onion Solutions LLC under one
|
# Copyright 2014-2023 Security Onion Solutions, LLC
|
||||||
# or more contributor license agreements. Licensed under the Elastic License 2.0 as shown at
|
#
|
||||||
# https://securityonion.net/license; you may not use this file except in compliance with the
|
# This program is free software: you can redistribute it and/or modify
|
||||||
# Elastic License 2.0.
|
# 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
|
. /usr/sbin/so-common
|
||||||
|
|
||||||
|
|||||||
@@ -1,18 +1,27 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# Copyright Security Onion Solutions LLC and/or licensed to Security Onion Solutions LLC under one
|
# Copyright 2014-2023 Security Onion Solutions, LLC
|
||||||
# or more contributor license agreements. Licensed under the Elastic License 2.0 as shown at
|
|
||||||
# https://securityonion.net/license; you may not use this file except in compliance with the
|
|
||||||
# Elastic License 2.0.
|
|
||||||
|
|
||||||
|
# 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/>.
|
||||||
|
|
||||||
{# we only want the script to install the workstation if it is Rocky -#}
|
doc_workstation_url="https://docs.securityonion.net/en/2.3/analyst-vm.html"
|
||||||
{% if grains.os == 'Rocky' -%}
|
{# we only want the script to install the workstation if it is CentOS -#}
|
||||||
|
{% if grains.os == 'CentOS' -%}
|
||||||
{# if this is a manager -#}
|
{# if this is a manager -#}
|
||||||
{% if grains.master == grains.id.split('_')|first -%}
|
{% if grains.master == grains.id.split('_')|first -%}
|
||||||
|
|
||||||
source /usr/sbin/so-common
|
source /usr/sbin/so-common
|
||||||
doc_workstation_url="$DOC_BASE_URL/analyst-vm.html"
|
|
||||||
pillar_file="/opt/so/saltstack/local/pillar/minions/{{grains.id}}.sls"
|
pillar_file="/opt/so/saltstack/local/pillar/minions/{{grains.id}}.sls"
|
||||||
|
|
||||||
if [ -f "$pillar_file" ]; then
|
if [ -f "$pillar_file" ]; then
|
||||||
@@ -61,7 +70,7 @@ if [ -f "$pillar_file" ]; then
|
|||||||
|
|
||||||
reboot;
|
reboot;
|
||||||
else
|
else
|
||||||
echo "There was an issue applying the workstation state. Please review the log above or at /opt/so/log/salt/minion."
|
echo "There was an issue applying the workstation state. Please review the log above or at /opt/so/logs/salt/minion."
|
||||||
fi
|
fi
|
||||||
else # workstation is already added
|
else # workstation is already added
|
||||||
echo "The workstation pillar already exists in $pillar_file."
|
echo "The workstation pillar already exists in $pillar_file."
|
||||||
@@ -80,12 +89,12 @@ echo "Since this is not a manager, the pillar values to enable analyst workstati
|
|||||||
{#- endif if this is a manager #}
|
{#- endif if this is a manager #}
|
||||||
{% endif -%}
|
{% endif -%}
|
||||||
|
|
||||||
{#- if not Rocky #}
|
{#- if not CentOS #}
|
||||||
{%- else %}
|
{%- else %}
|
||||||
|
|
||||||
echo "The Analyst Workstation can only be installed on Rocky. Please view the documentation at $doc_workstation_url."
|
echo "The Analyst Workstation can only be installed on CentOS. Please view the documentation at $doc_workstation_url."
|
||||||
|
|
||||||
{#- endif grains.os == Rocky #}
|
{#- endif grains.os == CentOS #}
|
||||||
{% endif -%}
|
{% endif -%}
|
||||||
|
|
||||||
exit 0
|
exit 0
|
||||||
|
|||||||
@@ -1,11 +1,19 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# Copyright Security Onion Solutions LLC and/or licensed to Security Onion Solutions LLC under one
|
# Copyright 2014-2023 Security Onion Solutions, LLC
|
||||||
# or more contributor license agreements. Licensed under the Elastic License 2.0 as shown at
|
#
|
||||||
# https://securityonion.net/license; you may not use this file except in compliance with the
|
# This program is free software: you can redistribute it and/or modify
|
||||||
# Elastic License 2.0.
|
# 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
|
. /usr/sbin/so-common
|
||||||
|
|
||||||
|
|||||||
@@ -1,25 +1,27 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
#
|
#
|
||||||
# Copyright Security Onion Solutions LLC and/or licensed to Security Onion Solutions LLC under one
|
# Copyright 2014-2023 Security Onion Solutions, LLC
|
||||||
# or more contributor license agreements. Licensed under the Elastic License 2.0 as shown at
|
#
|
||||||
# https://securityonion.net/license; you may not use this file except in compliance with the
|
# This program is free software: you can redistribute it and/or modify
|
||||||
# Elastic License 2.0.
|
# 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/>.
|
||||||
|
|
||||||
DEFAULT_SALT_DIR=/opt/so/saltstack/default
|
DEFAULT_SALT_DIR=/opt/so/saltstack/default
|
||||||
DOC_BASE_URL="https://docs.securityonion.net/en/2.4"
|
|
||||||
|
|
||||||
if [ -z $NOROOT ]; then
|
|
||||||
# Check for prerequisites
|
# Check for prerequisites
|
||||||
if [ "$(id -u)" -ne 0 ]; then
|
if [ "$(id -u)" -ne 0 ]; then
|
||||||
echo "This script must be run using sudo!"
|
echo "This script must be run using sudo!"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
fi
|
|
||||||
|
|
||||||
# Ensure /usr/sbin is in path
|
|
||||||
if ! echo "$PATH" | grep -q "/usr/sbin"; then
|
|
||||||
export PATH="$PATH:/usr/sbin"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Define a banner to separate sections
|
# Define a banner to separate sections
|
||||||
banner="========================================================================="
|
banner="========================================================================="
|
||||||
@@ -54,8 +56,6 @@ add_interface_bond0() {
|
|||||||
ethtool -K "$BNIC" $i off &>/dev/null
|
ethtool -K "$BNIC" $i off &>/dev/null
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
if ! [[ $is_cloud ]]; then
|
|
||||||
# Check if the bond slave connection has already been created
|
# Check if the bond slave connection has already been created
|
||||||
nmcli -f name,uuid -p con | grep -q "bond0-slave-$BNIC"
|
nmcli -f name,uuid -p con | grep -q "bond0-slave-$BNIC"
|
||||||
local found_int=$?
|
local found_int=$?
|
||||||
@@ -73,18 +73,16 @@ add_interface_bond0() {
|
|||||||
ethernet.mtu "$MTU" \
|
ethernet.mtu "$MTU" \
|
||||||
connection.autoconnect "yes"
|
connection.autoconnect "yes"
|
||||||
fi
|
fi
|
||||||
fi
|
|
||||||
|
|
||||||
ip link set dev "$BNIC" arp off multicast off allmulticast off promisc on
|
ip link set dev "$BNIC" arp off multicast off allmulticast off promisc on
|
||||||
|
|
||||||
if ! [[ $is_cloud ]]; then
|
|
||||||
# Bring the slave interface up
|
# Bring the slave interface up
|
||||||
if [[ $verbose == true ]]; then
|
if [[ $verbose == true ]]; then
|
||||||
nmcli con up "bond0-slave-$BNIC"
|
nmcli con up "bond0-slave-$BNIC"
|
||||||
else
|
else
|
||||||
nmcli con up "bond0-slave-$BNIC" &>/dev/null
|
nmcli con up "bond0-slave-$BNIC" &>/dev/null
|
||||||
fi
|
fi
|
||||||
fi
|
|
||||||
if [ "$nic_error" != 0 ]; then
|
if [ "$nic_error" != 0 ]; then
|
||||||
return "$nic_error"
|
return "$nic_error"
|
||||||
fi
|
fi
|
||||||
@@ -160,49 +158,19 @@ disable_fastestmirror() {
|
|||||||
sed -i 's/enabled=1/enabled=0/' /etc/yum/pluginconf.d/fastestmirror.conf
|
sed -i 's/enabled=1/enabled=0/' /etc/yum/pluginconf.d/fastestmirror.conf
|
||||||
}
|
}
|
||||||
|
|
||||||
elastic_fleet_integration_create() {
|
|
||||||
|
|
||||||
JSON_STRING=$1
|
|
||||||
|
|
||||||
curl -K /opt/so/conf/elasticsearch/curl.config -L -X POST "localhost:5601/api/fleet/package_policies" -H 'kbn-xsrf: true' -H 'Content-Type: application/json' -d "$JSON_STRING"
|
|
||||||
}
|
|
||||||
|
|
||||||
elastic_fleet_policy_create() {
|
|
||||||
|
|
||||||
NAME=$1
|
|
||||||
DESC=$2
|
|
||||||
FLEETSERVER=$3
|
|
||||||
|
|
||||||
JSON_STRING=$( jq -n \
|
|
||||||
--arg NAME "$NAME" \
|
|
||||||
--arg DESC "$DESC" \
|
|
||||||
--arg FLEETSERVER "$FLEETSERVER" \
|
|
||||||
'{"name": $NAME,"id":$NAME,"description":$DESC,"namespace":"default","monitoring_enabled":["logs"],"inactivity_timeout":1209600,"has_fleet_server":$FLEETSERVER}'
|
|
||||||
)
|
|
||||||
# Create Fleet Policy
|
|
||||||
curl -K /opt/so/conf/elasticsearch/curl.config -L -X POST "localhost:5601/api/fleet/agent_policies" -H 'kbn-xsrf: true' -H 'Content-Type: application/json' -d "$JSON_STRING"
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
elastic_fleet_policy_update() {
|
|
||||||
|
|
||||||
POLICYID=$1
|
|
||||||
JSON_STRING=$2
|
|
||||||
|
|
||||||
curl -K /opt/so/conf/elasticsearch/curl.config -L -X PUT "localhost:5601/api/fleet/agent_policies/$POLICYID" -H 'kbn-xsrf: true' -H 'Content-Type: application/json' -d "$JSON_STRING"
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
elastic_license() {
|
elastic_license() {
|
||||||
|
|
||||||
read -r -d '' message <<- EOM
|
read -r -d '' message <<- EOM
|
||||||
\n
|
\n
|
||||||
Elastic Stack binaries and Security Onion components are only available under the Elastic License version 2 (ELv2):
|
Starting in Elastic Stack version 7.11, the Elastic Stack binaries are only available under the Elastic License:
|
||||||
https://securityonion.net/license/
|
https://securityonion.net/elastic-license
|
||||||
|
|
||||||
Do you agree to the terms of ELv2?
|
Please review the Elastic License:
|
||||||
|
https://www.elastic.co/licensing/elastic-license
|
||||||
|
|
||||||
If so, type AGREE to accept ELv2 and continue. Otherwise, press Enter to exit this program without making any changes.
|
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
|
EOM
|
||||||
|
|
||||||
AGREED=$(whiptail --title "$whiptail_title" --inputbox \
|
AGREED=$(whiptail --title "$whiptail_title" --inputbox \
|
||||||
@@ -231,14 +199,14 @@ get_random_value() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
gpg_rpm_import() {
|
gpg_rpm_import() {
|
||||||
if [[ "$OS" == "rocky" ]]; then
|
if [[ "$OS" == "centos" ]]; then
|
||||||
if [[ "$WHATWOULDYOUSAYYAHDOHERE" == "setup" ]]; then
|
if [[ "$WHATWOULDYOUSAYYAHDOHERE" == "setup" ]]; then
|
||||||
local RPMKEYSLOC="../salt/repo/client/files/rocky/keys"
|
local RPMKEYSLOC="../salt/repo/client/files/centos/keys"
|
||||||
else
|
else
|
||||||
local RPMKEYSLOC="$UPDATE_DIR/salt/repo/client/files/rocky/keys"
|
local RPMKEYSLOC="$UPDATE_DIR/salt/repo/client/files/centos/keys"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
RPMKEYS=('RPM-GPG-KEY-EPEL-9' 'SALT-PROJECT-GPG-PUBKEY-2023.pub' 'docker.pub' 'securityonion.pub')
|
RPMKEYS=('RPM-GPG-KEY-EPEL-7' 'GPG-KEY-WAZUH' 'docker.pub' 'SALTSTACK-GPG-KEY.pub' 'securityonion.pub')
|
||||||
|
|
||||||
for RPMKEY in "${RPMKEYS[@]}"; do
|
for RPMKEY in "${RPMKEYS[@]}"; do
|
||||||
rpm --import $RPMKEYSLOC/$RPMKEY
|
rpm --import $RPMKEYSLOC/$RPMKEY
|
||||||
@@ -269,17 +237,31 @@ init_monitor() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
is_manager_node() {
|
is_manager_node() {
|
||||||
grep "role: so-" /etc/salt/grains | grep -E "manager|eval|managersearch|standalone|import" &> /dev/null
|
# Check to see if this is a manager node
|
||||||
|
role=$(lookup_role)
|
||||||
|
is_single_node_grid && return 0
|
||||||
|
[ $role == 'manager' ] && return 0
|
||||||
|
[ $role == 'managersearch' ] && return 0
|
||||||
|
[ $role == 'helix' ] && return 0
|
||||||
|
return 1
|
||||||
}
|
}
|
||||||
|
|
||||||
is_sensor_node() {
|
is_sensor_node() {
|
||||||
# Check to see if this is a sensor (forward) node
|
# Check to see if this is a sensor (forward) node
|
||||||
|
role=$(lookup_role)
|
||||||
is_single_node_grid && return 0
|
is_single_node_grid && return 0
|
||||||
grep "role: so-" /etc/salt/grains | grep -E "sensor|heavynode|helix" &> /dev/null
|
[ $role == 'sensor' ] && return 0
|
||||||
|
[ $role == 'heavynode' ] && return 0
|
||||||
|
[ $role == 'helix' ] && return 0
|
||||||
|
return 1
|
||||||
}
|
}
|
||||||
|
|
||||||
is_single_node_grid() {
|
is_single_node_grid() {
|
||||||
grep "role: so-" /etc/salt/grains | grep -E "eval|standalone|import" &> /dev/null
|
role=$(lookup_role)
|
||||||
|
[ $role == 'eval' ] && return 0
|
||||||
|
[ $role == 'standalone' ] && return 0
|
||||||
|
[ $role == 'import' ] && return 0
|
||||||
|
return 1
|
||||||
}
|
}
|
||||||
|
|
||||||
lookup_bond_interfaces() {
|
lookup_bond_interfaces() {
|
||||||
@@ -410,14 +392,8 @@ run_check_net_err() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
salt_minion_count() {
|
|
||||||
local MINIONDIR="/opt/so/saltstack/local/pillar/minions"
|
|
||||||
MINIONCOUNT=$(ls -la $MINIONDIR/*.sls | grep -v adv_ | wc -l)
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
set_cron_service_name() {
|
set_cron_service_name() {
|
||||||
if [[ "$OS" == "rocky" ]]; then
|
if [[ "$OS" == "centos" ]]; then
|
||||||
cron_service_name="crond"
|
cron_service_name="crond"
|
||||||
else
|
else
|
||||||
cron_service_name="cron"
|
cron_service_name="cron"
|
||||||
@@ -426,7 +402,7 @@ set_cron_service_name() {
|
|||||||
|
|
||||||
set_os() {
|
set_os() {
|
||||||
if [ -f /etc/redhat-release ]; then
|
if [ -f /etc/redhat-release ]; then
|
||||||
OS=rocky
|
OS=centos
|
||||||
else
|
else
|
||||||
OS=ubuntu
|
OS=ubuntu
|
||||||
fi
|
fi
|
||||||
@@ -542,18 +518,6 @@ valid_hostname() {
|
|||||||
[[ $hostname =~ ^[a-zA-Z0-9\-]+$ ]] && [[ $hostname != 'localhost' ]] && return 0 || return 1
|
[[ $hostname =~ ^[a-zA-Z0-9\-]+$ ]] && [[ $hostname != 'localhost' ]] && return 0 || return 1
|
||||||
}
|
}
|
||||||
|
|
||||||
verify_ip4() {
|
|
||||||
local ip=$1
|
|
||||||
# Is this an IP or CIDR?
|
|
||||||
if grep -qP "^[^/]+/[^/]+$" <<< $ip; then
|
|
||||||
# Looks like a CIDR
|
|
||||||
valid_ip4_cidr_mask "$ip"
|
|
||||||
else
|
|
||||||
# We know this is not a CIDR - Is it an IP?
|
|
||||||
valid_ip4 "$ip"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
valid_ip4() {
|
valid_ip4() {
|
||||||
local ip=$1
|
local ip=$1
|
||||||
|
|
||||||
|
|||||||
50
salt/common/tools/sbin/so-config-backup
Executable file
50
salt/common/tools/sbin/so-config-backup
Executable file
@@ -0,0 +1,50 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
#
|
||||||
|
# Copyright 2014-2023 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
|
||||||
|
{% set BACKUPLOCATIONS = salt['pillar.get']('backup:locations', {}) %}
|
||||||
|
|
||||||
|
TODAY=$(date '+%Y_%m_%d')
|
||||||
|
BACKUPFILE="/nsm/backup/so-config-backup-$TODAY.tar"
|
||||||
|
MAXBACKUPS=7
|
||||||
|
|
||||||
|
# Create backup dir if it does not exist
|
||||||
|
mkdir -p /nsm/backup
|
||||||
|
|
||||||
|
# If we haven't already written a backup file for today, let's do so
|
||||||
|
if [ ! -f $BACKUPFILE ]; then
|
||||||
|
|
||||||
|
# Create empty backup file
|
||||||
|
tar -cf $BACKUPFILE -T /dev/null
|
||||||
|
|
||||||
|
# Loop through all paths defined in global.sls, and append them to backup file
|
||||||
|
{%- for LOCATION in BACKUPLOCATIONS %}
|
||||||
|
tar -rf $BACKUPFILE {{ LOCATION }}
|
||||||
|
{%- endfor %}
|
||||||
|
tar -rf $BACKUPFILE /etc/pki
|
||||||
|
tar -rf $BACKUPFILE /etc/salt
|
||||||
|
tar -rf $BACKUPFILE /nsm/kratos
|
||||||
|
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Find oldest backup files and remove them
|
||||||
|
NUMBACKUPS=$(find /nsm/backup/ -type f -name "so-config-backup*" | wc -l)
|
||||||
|
while [ "$NUMBACKUPS" -gt "$MAXBACKUPS" ]; do
|
||||||
|
OLDESTBACKUP=$(find /nsm/backup/ -type f -name "so-config-backup*" -type f -printf '%T+ %p\n' | sort | head -n 1 | awk -F" " '{print $2}')
|
||||||
|
rm -f $OLDESTBACKUP
|
||||||
|
NUMBACKUPS=$(find /nsm/backup/ -type f -name "so-config-backup*" | wc -l)
|
||||||
|
done
|
||||||
20
salt/common/tools/sbin/so-cortex-restart
Executable file
20
salt/common/tools/sbin/so-cortex-restart
Executable file
@@ -0,0 +1,20 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
#
|
||||||
|
# Copyright 2014-2023 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 "TheHive and its components are no longer part of Security Onion"
|
||||||
20
salt/common/tools/sbin/so-cortex-start
Executable file
20
salt/common/tools/sbin/so-cortex-start
Executable file
@@ -0,0 +1,20 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Copyright 2014-2023 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 "TheHive and its components are no longer part of Security Onion"
|
||||||
20
salt/common/tools/sbin/so-cortex-stop
Executable file
20
salt/common/tools/sbin/so-cortex-stop
Executable file
@@ -0,0 +1,20 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
#
|
||||||
|
# Copyright 2014-2023 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 "TheHive and its components are no longer part of Security Onion"
|
||||||
20
salt/common/tools/sbin/so-cortex-user-add
Executable file
20
salt/common/tools/sbin/so-cortex-user-add
Executable file
@@ -0,0 +1,20 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
#
|
||||||
|
# Copyright 2014-2023 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 "TheHive and its components are no longer part of Security Onion"
|
||||||
20
salt/common/tools/sbin/so-cortex-user-enable
Executable file
20
salt/common/tools/sbin/so-cortex-user-enable
Executable file
@@ -0,0 +1,20 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
#
|
||||||
|
# Copyright 2014-2023 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 "TheHive and its components are no longer part of Security Onion"
|
||||||
@@ -1,11 +1,19 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# Copyright Security Onion Solutions LLC and/or licensed to Security Onion Solutions LLC under one
|
# Copyright 2014-2023 Security Onion Solutions, LLC
|
||||||
# or more contributor license agreements. Licensed under the Elastic License 2.0 as shown at
|
#
|
||||||
# https://securityonion.net/license; you may not use this file except in compliance with the
|
# This program is free software: you can redistribute it and/or modify
|
||||||
# Elastic License 2.0.
|
# 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
|
. /usr/sbin/so-common
|
||||||
|
|
||||||
|
|||||||
@@ -1,11 +1,19 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# Copyright Security Onion Solutions LLC and/or licensed to Security Onion Solutions LLC under one
|
# Copyright 2014-2023 Security Onion Solutions, LLC
|
||||||
# or more contributor license agreements. Licensed under the Elastic License 2.0 as shown at
|
#
|
||||||
# https://securityonion.net/license; you may not use this file except in compliance with the
|
# This program is free software: you can redistribute it and/or modify
|
||||||
# Elastic License 2.0.
|
# 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
|
. /usr/sbin/so-common
|
||||||
|
|
||||||
|
|||||||
@@ -1,11 +1,19 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# Copyright Security Onion Solutions LLC and/or licensed to Security Onion Solutions LLC under one
|
# Copyright 2014-2023 Security Onion Solutions, LLC
|
||||||
# or more contributor license agreements. Licensed under the Elastic License 2.0 as shown at
|
#
|
||||||
# https://securityonion.net/license; you may not use this file except in compliance with the
|
# This program is free software: you can redistribute it and/or modify
|
||||||
# Elastic License 2.0.
|
# 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
|
. /usr/sbin/so-common
|
||||||
|
|
||||||
|
|||||||
@@ -1,11 +1,19 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
# Copyright Security Onion Solutions LLC and/or licensed to Security Onion Solutions LLC under one
|
# Copyright 2014-2023 Security Onion Solutions, LLC
|
||||||
# or more contributor license agreements. Licensed under the Elastic License 2.0 as shown at
|
#
|
||||||
# https://securityonion.net/license; you may not use this file except in compliance with the
|
# This program is free software: you can redistribute it and/or modify
|
||||||
# Elastic License 2.0.
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation, either version 3 of the License, or
|
||||||
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
import ipaddress
|
import ipaddress
|
||||||
import textwrap
|
import textwrap
|
||||||
@@ -19,12 +27,17 @@ from xml.dom import minidom
|
|||||||
|
|
||||||
|
|
||||||
LOCAL_SALT_DIR='/opt/so/saltstack/local'
|
LOCAL_SALT_DIR='/opt/so/saltstack/local'
|
||||||
|
WAZUH_CONF='/nsm/wazuh/etc/ossec.conf'
|
||||||
VALID_ROLES = {
|
VALID_ROLES = {
|
||||||
'a': { 'role': 'analyst','desc': 'Analyst - 80/tcp, 443/tcp' },
|
'a': { 'role': 'analyst','desc': 'Analyst - 80/tcp, 443/tcp' },
|
||||||
'b': { 'role': 'beats_endpoint', 'desc': 'Logstash Beat - 5044/tcp' },
|
'b': { 'role': 'beats_endpoint', 'desc': 'Logstash Beat - 5044/tcp' },
|
||||||
'e': { 'role': 'elasticsearch_rest', 'desc': 'Elasticsearch REST API - 9200/tcp' },
|
'e': { 'role': 'elasticsearch_rest', 'desc': 'Elasticsearch REST API - 9200/tcp' },
|
||||||
'f': { 'role': 'strelka_frontend', 'desc': 'Strelka frontend - 57314/tcp' },
|
'f': { 'role': 'strelka_frontend', 'desc': 'Strelka frontend - 57314/tcp' },
|
||||||
|
'o': { 'role': 'osquery_endpoint', 'desc': 'Osquery endpoint - 8090/tcp' },
|
||||||
's': { 'role': 'syslog', 'desc': 'Syslog device - 514/tcp/udp' },
|
's': { 'role': 'syslog', 'desc': 'Syslog device - 514/tcp/udp' },
|
||||||
|
'w': { 'role': 'wazuh_agent', 'desc': 'Wazuh agent - 1514/tcp/udp' },
|
||||||
|
'p': { 'role': 'wazuh_api', 'desc': 'Wazuh API - 55000/tcp' },
|
||||||
|
'r': { 'role': 'wazuh_authd', 'desc': 'Wazuh registration service - 1515/tcp' }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -63,15 +76,73 @@ def ip_prompt() -> str:
|
|||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
|
|
||||||
|
def wazuh_enabled() -> bool:
|
||||||
|
for file in os.listdir(f'{LOCAL_SALT_DIR}/pillar'):
|
||||||
|
with open(file, 'r') as pillar:
|
||||||
|
if 'wazuh: 1' in pillar.read():
|
||||||
|
return True
|
||||||
|
return False
|
||||||
|
|
||||||
|
|
||||||
|
def root_to_str(root: ET.ElementTree) -> str:
|
||||||
|
xml_str = ET.tostring(root, encoding='unicode', method='xml').replace('\n', '')
|
||||||
|
xml_str = re.sub(r'(?:(?<=>) *)', '', xml_str)
|
||||||
|
|
||||||
|
# Remove specific substrings to better format comments on intial parse/write
|
||||||
|
xml_str = re.sub(r' -', '', xml_str)
|
||||||
|
xml_str = re.sub(r' -->', ' -->', xml_str)
|
||||||
|
|
||||||
|
dom = minidom.parseString(xml_str)
|
||||||
|
return dom.toprettyxml(indent=" ")
|
||||||
|
|
||||||
|
|
||||||
|
def rem_wl(ip):
|
||||||
|
parser = ET.XMLParser(remove_blank_text=True)
|
||||||
|
with open(WAZUH_CONF, 'rb') as wazuh_conf:
|
||||||
|
tree = ET.parse(wazuh_conf, parser)
|
||||||
|
root = tree.getroot()
|
||||||
|
|
||||||
|
global_elems = root.findall(f"global/white_list[. = '{ip}']/..")
|
||||||
|
if len(global_elems) > 0:
|
||||||
|
for g_elem in global_elems:
|
||||||
|
ge_index = list(root).index(g_elem)
|
||||||
|
if ge_index > 0 and root[list(root).index(g_elem) - 1].tag == ET.Comment:
|
||||||
|
root.remove(root[ge_index - 1])
|
||||||
|
root.remove(g_elem)
|
||||||
|
|
||||||
|
with open(WAZUH_CONF, 'w') as out:
|
||||||
|
out.write(root_to_str(root))
|
||||||
|
|
||||||
|
|
||||||
def apply(role: str, ip: str) -> int:
|
def apply(role: str, ip: str) -> int:
|
||||||
firewall_cmd = ['so-firewall', 'excludehost', role, ip]
|
firewall_cmd = ['so-firewall', 'excludehost', role, ip]
|
||||||
salt_cmd = ['salt-call', 'state.apply', '-l', 'quiet', 'firewall', 'queue=True']
|
salt_cmd = ['salt-call', 'state.apply', '-l', 'quiet', 'firewall', 'queue=True']
|
||||||
|
restart_wazuh_cmd = ['so-wazuh-restart']
|
||||||
print(f'Removing {ip} from the {role} role. This can take a few seconds...')
|
print(f'Removing {ip} from the {role} role. This can take a few seconds...')
|
||||||
cmd = subprocess.run(firewall_cmd)
|
cmd = subprocess.run(firewall_cmd)
|
||||||
if cmd.returncode == 0:
|
if cmd.returncode == 0:
|
||||||
cmd = subprocess.run(salt_cmd, stdout=subprocess.DEVNULL)
|
cmd = subprocess.run(salt_cmd, stdout=subprocess.DEVNULL)
|
||||||
else:
|
else:
|
||||||
return cmd.returncode
|
return cmd.returncode
|
||||||
|
if cmd.returncode == 0:
|
||||||
|
if wazuh_enabled and role=='analyst':
|
||||||
|
try:
|
||||||
|
rem_wl(ip)
|
||||||
|
print(f'Removed whitelist entry for {ip} from {WAZUH_CONF}', file=sys.stderr)
|
||||||
|
except Exception as e:
|
||||||
|
print(f'Failed to remove whitelist entry for {ip} from {WAZUH_CONF}', file=sys.stderr)
|
||||||
|
print(e)
|
||||||
|
return 1
|
||||||
|
print('Restarting OSSEC Server...')
|
||||||
|
cmd = subprocess.run(restart_wazuh_cmd)
|
||||||
|
else:
|
||||||
|
return cmd.returncode
|
||||||
|
else:
|
||||||
|
print(f'Commmand \'{" ".join(salt_cmd)}\' failed.', file=sys.stderr)
|
||||||
|
return cmd.returncode
|
||||||
|
if cmd.returncode != 0:
|
||||||
|
print('Failed to restart OSSEC server.')
|
||||||
|
return cmd.returncode
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
@@ -92,7 +163,11 @@ def main():
|
|||||||
group.add_argument('-b', dest='roles', action='append_const', const=VALID_ROLES['b']['role'], help="Logstash Beat - 5044/tcp")
|
group.add_argument('-b', dest='roles', action='append_const', const=VALID_ROLES['b']['role'], help="Logstash Beat - 5044/tcp")
|
||||||
group.add_argument('-e', dest='roles', action='append_const', const=VALID_ROLES['e']['role'], help="Elasticsearch REST API - 9200/tcp")
|
group.add_argument('-e', dest='roles', action='append_const', const=VALID_ROLES['e']['role'], help="Elasticsearch REST API - 9200/tcp")
|
||||||
group.add_argument('-f', dest='roles', action='append_const', const=VALID_ROLES['f']['role'], help="Strelka frontend - 57314/tcp")
|
group.add_argument('-f', dest='roles', action='append_const', const=VALID_ROLES['f']['role'], help="Strelka frontend - 57314/tcp")
|
||||||
|
group.add_argument('-o', dest='roles', action='append_const', const=VALID_ROLES['o']['role'], help="Osquery endpoint - 8090/tcp")
|
||||||
group.add_argument('-s', dest='roles', action='append_const', const=VALID_ROLES['s']['role'], help="Syslog device - 514/tcp/udp")
|
group.add_argument('-s', dest='roles', action='append_const', const=VALID_ROLES['s']['role'], help="Syslog device - 514/tcp/udp")
|
||||||
|
group.add_argument('-w', dest='roles', action='append_const', const=VALID_ROLES['w']['role'], help="Wazuh agent - 1514/tcp/udp")
|
||||||
|
group.add_argument('-p', dest='roles', action='append_const', const=VALID_ROLES['p']['role'], help="Wazuh API - 55000/tcp")
|
||||||
|
group.add_argument('-r', dest='roles', action='append_const', const=VALID_ROLES['r']['role'], help="Wazuh registration service - 1515/tcp")
|
||||||
|
|
||||||
ip_g = main_parser.add_argument_group(title='allow')
|
ip_g = main_parser.add_argument_group(title='allow')
|
||||||
ip_g.add_argument('-i', help="IP or CIDR block to disallow connections from, requires at least one role argument", metavar='', dest='ip')
|
ip_g.add_argument('-i', help="IP or CIDR block to disallow connections from, requires at least one role argument", metavar='', dest='ip')
|
||||||
|
|||||||
@@ -1,11 +1,19 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
# Copyright Security Onion Solutions LLC and/or licensed to Security Onion Solutions LLC under one
|
# Copyright 2014-2023 Security Onion Solutions, LLC
|
||||||
# or more contributor license agreements. Licensed under the Elastic License 2.0 as shown at
|
#
|
||||||
# https://securityonion.net/license; you may not use this file except in compliance with the
|
# This program is free software: you can redistribute it and/or modify
|
||||||
# Elastic License 2.0.
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation, either version 3 of the License, or
|
||||||
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
import sys, argparse, re, docker
|
import sys, argparse, re, docker
|
||||||
from packaging.version import Version, InvalidVersion
|
from packaging.version import Version, InvalidVersion
|
||||||
|
|||||||
@@ -1,11 +1,19 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# Copyright Security Onion Solutions LLC and/or licensed to Security Onion Solutions LLC under one
|
# Copyright 2014-2023 Security Onion Solutions, LLC
|
||||||
# or more contributor license agreements. Licensed under the Elastic License 2.0 as shown at
|
#
|
||||||
# https://securityonion.net/license; you may not use this file except in compliance with the
|
# This program is free software: you can redistribute it and/or modify
|
||||||
# Elastic License 2.0.
|
# 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
|
. /usr/sbin/so-common
|
||||||
. /usr/sbin/so-image-common
|
. /usr/sbin/so-image-common
|
||||||
|
|||||||
@@ -1,11 +1,19 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# Copyright Security Onion Solutions LLC and/or licensed to Security Onion Solutions LLC under one
|
# Copyright 2014-2023 Security Onion Solutions, LLC
|
||||||
# or more contributor license agreements. Licensed under the Elastic License 2.0 as shown at
|
#
|
||||||
# https://securityonion.net/license; you may not use this file except in compliance with the
|
# This program is free software: you can redistribute it and/or modify
|
||||||
# Elastic License 2.0.
|
# 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
|
. /usr/sbin/so-common
|
||||||
|
|
||||||
|
|||||||
@@ -1,11 +1,19 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# Copyright Security Onion Solutions LLC and/or licensed to Security Onion Solutions LLC under one
|
# Copyright 2014-2023 Security Onion Solutions, LLC
|
||||||
# or more contributor license agreements. Licensed under the Elastic License 2.0 as shown at
|
#
|
||||||
# https://securityonion.net/license; you may not use this file except in compliance with the
|
# This program is free software: you can redistribute it and/or modify
|
||||||
# Elastic License 2.0.
|
# 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
|
. /usr/sbin/so-common
|
||||||
|
|
||||||
|
|||||||
@@ -1,11 +1,19 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# Copyright Security Onion Solutions LLC and/or licensed to Security Onion Solutions LLC under one
|
# Copyright 2014-2023 Security Onion Solutions, LLC
|
||||||
# or more contributor license agreements. Licensed under the Elastic License 2.0 as shown at
|
#
|
||||||
# https://securityonion.net/license; you may not use this file except in compliance with the
|
# This program is free software: you can redistribute it and/or modify
|
||||||
# Elastic License 2.0.
|
# 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
|
. /usr/sbin/so-common
|
||||||
|
|
||||||
|
|||||||
@@ -1,34 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
# Copyright Security Onion Solutions LLC and/or licensed to Security Onion Solutions LLC under one
|
|
||||||
# or more contributor license agreements. Licensed under the Elastic License 2.0; you may not use
|
|
||||||
# this file except in compliance with the Elastic License 2.0.
|
|
||||||
|
|
||||||
#so-elastic-agent-gen-installers $FleetHost $EnrollmentToken
|
|
||||||
|
|
||||||
{% from 'vars/globals.map.jinja' import GLOBALS %}
|
|
||||||
|
|
||||||
. /usr/sbin/so-common
|
|
||||||
|
|
||||||
ENROLLMENTOKEN=$(curl -K /opt/so/conf/elasticsearch/curl.config -L "localhost:5601/api/fleet/enrollment_api_keys" -H 'kbn-xsrf: true' -H 'Content-Type: application/json' | jq .list | jq -r -c '.[] | select(.policy_id | contains("endpoints")) | .api_key')
|
|
||||||
|
|
||||||
#FLEETHOST=$(lookup_pillar "server:url" "elasticfleet")
|
|
||||||
FLEETHOST="{{ GLOBALS.manager_ip }}"
|
|
||||||
|
|
||||||
#FLEETHOST=$1
|
|
||||||
#ENROLLMENTOKEN=$2
|
|
||||||
CONTAINERGOOS=( "linux" "darwin" "windows" )
|
|
||||||
|
|
||||||
#rm -rf /tmp/elastic-agent-workspace
|
|
||||||
#mkdir -p /tmp/elastic-agent-workspace
|
|
||||||
|
|
||||||
for OS in "${CONTAINERGOOS[@]}"
|
|
||||||
do
|
|
||||||
printf "\n\nGenerating $OS Installer..."
|
|
||||||
#cp /opt/so/saltstack/default/salt/elasticfleet/files/elastic-agent/so-elastic-agent-*-$OS-x86_64.tar.gz /tmp/elastic-agent-workspace/$OS.tar.gz
|
|
||||||
docker run -e CGO_ENABLED=0 -e GOOS=$OS \
|
|
||||||
--mount type=bind,source=/etc/ssl/certs/,target=/workspace/files/cert/ \
|
|
||||||
--mount type=bind,source=/opt/so/saltstack/local/salt/elasticfleet/files/so_agent-installers/,target=/output/ \
|
|
||||||
{{ GLOBALS.registry_host }}:5000/{{ GLOBALS.image_repo }}/so-elastic-agent-builder:{{ GLOBALS.so_version }} go build -ldflags "-X main.fleetHost=$FLEETHOST -X main.enrollmentToken=$ENROLLMENTOKEN" -o /output/so-elastic-agent_$OS
|
|
||||||
printf "\n $OS Installer Generated..."
|
|
||||||
done
|
|
||||||
67
salt/common/tools/sbin/so-elastic-auth
Executable file
67
salt/common/tools/sbin/so-elastic-auth
Executable file
@@ -0,0 +1,67 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Copyright 2014-2023 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
|
||||||
27
salt/common/tools/sbin/so-elastic-auth-password-reset
Executable file → Normal file
27
salt/common/tools/sbin/so-elastic-auth-password-reset
Executable file → Normal file
@@ -1,10 +1,19 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# Copyright Security Onion Solutions LLC and/or licensed to Security Onion Solutions LLC under one
|
# Copyright 2014-2023 Security Onion Solutions, LLC
|
||||||
# or more contributor license agreements. Licensed under the Elastic License 2.0 as shown at
|
|
||||||
# https://securityonion.net/license; you may not use this file except in compliance with the
|
|
||||||
# Elastic License 2.0.
|
|
||||||
|
|
||||||
|
# This program is free software: you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation, either version 3 of the License, or
|
||||||
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
source $(dirname $0)/so-common
|
source $(dirname $0)/so-common
|
||||||
require_manager
|
require_manager
|
||||||
@@ -89,16 +98,18 @@ function killAllSaltJobs() {
|
|||||||
function soUserSync() {
|
function soUserSync() {
|
||||||
# apply this state to update /opt/so/saltstack/local/salt/elasticsearch/curl.config on the manager
|
# apply this state to update /opt/so/saltstack/local/salt/elasticsearch/curl.config on the manager
|
||||||
salt-call state.sls_id elastic_curl_config_distributed manager queue=True
|
salt-call state.sls_id elastic_curl_config_distributed manager queue=True
|
||||||
salt -C 'G@role:so-standalone or G@role:so-eval or G@role:so-import or G@role:so-manager or G@role:so-managersearch or G@role:so-searchnode or G@role:so-heavynode' saltutil.kill_all_jobs
|
salt -C 'G@role:so-standalone or G@role:so-eval or G@role:so-import or G@role:so-manager or G@role:so-managersearch or G@role:so-node or G@role:so-heavynode' saltutil.kill_all_jobs
|
||||||
# apply this state to get the curl.config
|
# apply this state to get the curl.config
|
||||||
salt -C 'G@role:so-standalone or G@role:so-eval or G@role:so-import or G@role:so-manager or G@role:so-managersearch or G@role:so-searchnode or G@role:so-heavynode' state.sls_id elastic_curl_config common queue=True
|
salt -C 'G@role:so-standalone or G@role:so-eval or G@role:so-import or G@role:so-manager or G@role:so-managersearch or G@role:so-node or G@role:so-heavynode' state.sls_id elastic_curl_config common queue=True
|
||||||
$(dirname $0)/so-user sync
|
$(dirname $0)/so-user sync
|
||||||
printf "\nApplying logstash state to the appropriate nodes.\n\n"
|
printf "\nApplying logstash state to the appropriate nodes.\n\n"
|
||||||
salt -C 'G@role:so-standalone or G@role:so-eval or G@role:so-import or G@role:so-manager or G@role:so-managersearch or G@role:so-searchnode or G@role:so-heavynode' state.apply logstash queue=True
|
salt -C 'G@role:so-standalone or G@role:so-eval or G@role:so-import or G@role:so-manager or G@role:so-managersearch or G@role:so-node or G@role:so-heavynode' state.apply logstash queue=True
|
||||||
|
printf "\nApplying filebeat state to the appropriate nodes.\n\n"
|
||||||
|
salt -C 'G@role:so-standalone or G@role:so-eval or G@role:so-import or G@role:so-manager or G@role:so-managersearch or G@role:so-node or G@role:so-heavynode or G@role:so-sensor or G@role:so-fleet' state.apply filebeat queue=True
|
||||||
printf "\nApplying kibana state to the appropriate nodes.\n\n"
|
printf "\nApplying kibana state to the appropriate nodes.\n\n"
|
||||||
salt -C 'G@role:so-standalone or G@role:so-eval or G@role:so-import or G@role:so-manager or G@role:so-managersearch' state.apply kibana queue=True
|
salt -C 'G@role:so-standalone or G@role:so-eval or G@role:so-import or G@role:so-manager or G@role:so-managersearch' state.apply kibana queue=True
|
||||||
printf "\nApplying curator state to the appropriate nodes.\n\n"
|
printf "\nApplying curator state to the appropriate nodes.\n\n"
|
||||||
salt -C 'G@role:so-standalone or G@role:so-eval or G@role:so-import or G@role:so-manager or G@role:so-managersearch or G@role:so-searchnode or G@role:so-heavynode' state.apply curator queue=True
|
salt -C 'G@role:so-standalone or G@role:so-eval or G@role:so-import or G@role:so-manager or G@role:so-managersearch or G@role:so-node or G@role:so-heavynode' state.apply curator queue=True
|
||||||
}
|
}
|
||||||
|
|
||||||
function highstateManager() {
|
function highstateManager() {
|
||||||
|
|||||||
@@ -1,11 +1,20 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
#
|
#
|
||||||
# Copyright Security Onion Solutions LLC and/or licensed to Security Onion Solutions LLC under one
|
# Copyright 2014-2023 Security Onion Solutions, LLC
|
||||||
# or more contributor license agreements. Licensed under the Elastic License 2.0 as shown at
|
#
|
||||||
# https://securityonion.net/license; you may not use this file except in compliance with the
|
# This program is free software: you can redistribute it and/or modify
|
||||||
# Elastic License 2.0.
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation, either version 3 of the License, or
|
||||||
{%- set NODEIP = salt['pillar.get']('host:mainip', '') %}
|
# (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 NODEIP = salt['pillar.get']('elasticsearch:mainip', '') %}
|
||||||
. /usr/sbin/so-common
|
. /usr/sbin/so-common
|
||||||
|
|
||||||
SKIP=0
|
SKIP=0
|
||||||
@@ -21,33 +30,15 @@ Security Onion Elastic Clear
|
|||||||
-y Skip interactive mode
|
-y Skip interactive mode
|
||||||
EOF
|
EOF
|
||||||
}
|
}
|
||||||
while getopts "h:cdely" OPTION
|
while getopts "h:y" OPTION
|
||||||
do
|
do
|
||||||
case $OPTION in
|
case $OPTION in
|
||||||
h)
|
h)
|
||||||
usage
|
usage
|
||||||
exit 0
|
exit 0
|
||||||
;;
|
;;
|
||||||
c)
|
|
||||||
DELETE_CASES_DATA=1
|
|
||||||
SKIP=1
|
|
||||||
;;
|
|
||||||
d)
|
|
||||||
DONT_STOP_SERVICES=1
|
|
||||||
SKIP=1
|
|
||||||
;;
|
|
||||||
e)
|
|
||||||
DELETE_ELASTALERT_DATA=1
|
|
||||||
SKIP=1
|
|
||||||
;;
|
|
||||||
l)
|
|
||||||
DELETE_LOG_DATA=1
|
|
||||||
SKIP=1
|
|
||||||
;;
|
|
||||||
y)
|
y)
|
||||||
DELETE_CASES_DATA=1
|
|
||||||
DELETE_ELASTALERT_DATA=1
|
|
||||||
DELETE_LOG_DATA=1
|
|
||||||
SKIP=1
|
SKIP=1
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
@@ -59,7 +50,7 @@ done
|
|||||||
if [ $SKIP -ne 1 ]; then
|
if [ $SKIP -ne 1 ]; then
|
||||||
# List indices
|
# List indices
|
||||||
echo
|
echo
|
||||||
curl -K /opt/so/conf/elasticsearch/curl.config -k -L https://{{ NODEIP }}:9200/_cat/indices?v
|
{{ ELASTICCURL }} -k -L https://{{ NODEIP }}:9200/_cat/indices?v
|
||||||
echo
|
echo
|
||||||
# Inform user we are about to delete all data
|
# Inform user we are about to delete all data
|
||||||
echo
|
echo
|
||||||
@@ -72,83 +63,54 @@ if [ $SKIP -ne 1 ]; then
|
|||||||
if [ "$INPUT" != "AGREE" ] ; then exit 0; fi
|
if [ "$INPUT" != "AGREE" ] ; then exit 0; fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Check to see if Logstash/Filebeat are running
|
||||||
if [ -z "$DONT_STOP_SERVICES" ]; then
|
|
||||||
# Stop Elastic Agent
|
|
||||||
for i in $(pgrep elastic-agent | grep -v grep); do
|
|
||||||
kill -9 $i;
|
|
||||||
done
|
|
||||||
|
|
||||||
# Check to see if Elastic Fleet, Logstash, Elastalert are running
|
|
||||||
#EF_ENABLED=$(so-status | grep elastic-fleet)
|
|
||||||
LS_ENABLED=$(so-status | grep logstash)
|
LS_ENABLED=$(so-status | grep logstash)
|
||||||
|
FB_ENABLED=$(so-status | grep filebeat)
|
||||||
EA_ENABLED=$(so-status | grep elastalert)
|
EA_ENABLED=$(so-status | grep elastalert)
|
||||||
|
|
||||||
#if [ ! -z "$EF_ENABLED" ]; then
|
if [ ! -z "$FB_ENABLED" ]; then
|
||||||
# /usr/sbin/so-elastic-fleet-stop
|
|
||||||
#fi
|
/usr/sbin/so-filebeat-stop
|
||||||
|
|
||||||
|
fi
|
||||||
|
|
||||||
if [ ! -z "$LS_ENABLED" ]; then
|
if [ ! -z "$LS_ENABLED" ]; then
|
||||||
|
|
||||||
/usr/sbin/so-logstash-stop
|
/usr/sbin/so-logstash-stop
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ! -z "$EA_ENABLED" ]; then
|
if [ ! -z "$EA_ENABLED" ]; then
|
||||||
|
|
||||||
/usr/sbin/so-elastalert-stop
|
/usr/sbin/so-elastalert-stop
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ! -z "$DELETE_CASES_DATA" ]; then
|
# Delete data
|
||||||
# Delete Cases data
|
echo "Deleting data..."
|
||||||
echo "Deleting Cases data..."
|
|
||||||
INDXS=$(/usr/sbin/so-elasticsearch-query _cat/indices?h=index | grep "so-case")
|
INDXS=$({{ ELASTICCURL }} -s -XGET -k -L https://{{ NODEIP }}:9200/_cat/indices?v | egrep 'logstash|elastalert|so-' | awk '{ print $3 }')
|
||||||
for INDX in ${INDXS}
|
for INDX in ${INDXS}
|
||||||
do
|
do
|
||||||
echo "Deleting $INDX"
|
{{ ELASTICCURL }} -XDELETE -k -L https://"{{ NODEIP }}:9200/${INDX}" > /dev/null 2>&1
|
||||||
/usr/sbin/so-elasticsearch-query ${INDX} -XDELETE > /dev/null 2>&1
|
|
||||||
done
|
done
|
||||||
|
|
||||||
|
#Start Logstash/Filebeat
|
||||||
|
if [ ! -z "$FB_ENABLED" ]; then
|
||||||
|
|
||||||
|
/usr/sbin/so-filebeat-start
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Delete Elastalert data
|
|
||||||
if [ ! -z "$DELETE_ELASTALERT_DATA" ]; then
|
|
||||||
# Delete Elastalert data
|
|
||||||
echo "Deleting Elastalert data..."
|
|
||||||
INDXS=$(/usr/sbin/so-elasticsearch-query _cat/indices?h=index | grep "elastalert")
|
|
||||||
for INDX in ${INDXS}
|
|
||||||
do
|
|
||||||
echo "Deleting $INDX"
|
|
||||||
/usr/sbin/so-elasticsearch-query ${INDX} -XDELETE > /dev/null 2>&1
|
|
||||||
done
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Delete log data
|
|
||||||
if [ ! -z "$DELETE_LOG_DATA" ]; then
|
|
||||||
echo "Deleting log data ..."
|
|
||||||
DATASTREAMS=$(/usr/sbin/so-elasticsearch-query _data_stream | jq -r '.[] |.[].name')
|
|
||||||
for DATASTREAM in ${DATASTREAMS}
|
|
||||||
do
|
|
||||||
# Delete the data stream
|
|
||||||
echo "Deleting $DATASTREAM..."
|
|
||||||
/usr/sbin/so-elasticsearch-query _data_stream/${DATASTREAM} -XDELETE > /dev/null 2>&1
|
|
||||||
done
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -z "$DONT_STOP_SERVICES" ]; then
|
|
||||||
#Start Logstash
|
|
||||||
if [ ! -z "$LS_ENABLED" ]; then
|
if [ ! -z "$LS_ENABLED" ]; then
|
||||||
|
|
||||||
/usr/sbin/so-logstash-start
|
/usr/sbin/so-logstash-start
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#Start Elastic Fleet
|
|
||||||
#if [ ! -z "$EF_ENABLED" ]; then
|
|
||||||
# /usr/sbin/so-elastic-fleet-start
|
|
||||||
#fi
|
|
||||||
|
|
||||||
#Start Elastalert
|
|
||||||
if [ ! -z "$EA_ENABLED" ]; then
|
if [ ! -z "$EA_ENABLED" ]; then
|
||||||
|
|
||||||
/usr/sbin/so-elastalert-start
|
/usr/sbin/so-elastalert-start
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Start Elastic Agent
|
|
||||||
/usr/bin/elastic-agent restart
|
|
||||||
fi
|
|
||||||
|
|||||||
@@ -1,11 +1,19 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# Copyright Security Onion Solutions LLC and/or licensed to Security Onion Solutions LLC under one
|
# Copyright 2014-2023 Security Onion Solutions, LLC
|
||||||
# or more contributor license agreements. Licensed under the Elastic License 2.0 as shown at
|
#
|
||||||
# https://securityonion.net/license; you may not use this file except in compliance with the
|
# This program is free software: you can redistribute it and/or modify
|
||||||
# Elastic License 2.0.
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation, either version 3 of the License, or
|
||||||
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
# Source common settings
|
# Source common settings
|
||||||
. /usr/sbin/so-common
|
. /usr/sbin/so-common
|
||||||
|
|||||||
@@ -1,19 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
# Copyright Security Onion Solutions LLC and/or licensed to Security Onion Solutions LLC under one
|
|
||||||
# or more contributor license agreements. Licensed under the Elastic License 2.0 as shown at
|
|
||||||
# https://securityonion.net/license; you may not use this file except in compliance with the
|
|
||||||
# Elastic License 2.0.
|
|
||||||
|
|
||||||
. /usr/sbin/so-common
|
|
||||||
|
|
||||||
POLICY_ID=$1
|
|
||||||
|
|
||||||
# Let's snag a cookie from Kibana
|
|
||||||
SESSIONCOOKIE=$(curl -K /opt/so/conf/elasticsearch/curl.config -c - -X GET http://localhost:5601/ | grep sid | awk '{print $7}')
|
|
||||||
|
|
||||||
echo "Deleting agent policy $POLICY_ID..."
|
|
||||||
|
|
||||||
# Delete agent policy
|
|
||||||
curl -K /opt/so/conf/elasticsearch/curl.config -b "sid=$SESSIONCOOKIE" -L -X POST "localhost:5601/api/fleet/agent_policies/delete" -H 'kbn-xsrf: true' -H 'Content-Type: application/json' -d"{\"agentPolicyId\": \"$POLICY_ID\"}"
|
|
||||||
|
|
||||||
echo
|
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
# Copyright Security Onion Solutions LLC and/or licensed to Security Onion Solutions LLC under one
|
|
||||||
# or more contributor license agreements. Licensed under the Elastic License 2.0 as shown at
|
|
||||||
# https://securityonion.net/license; you may not use this file except in compliance with the
|
|
||||||
# Elastic License 2.0.
|
|
||||||
|
|
||||||
. /usr/sbin/so-common
|
|
||||||
|
|
||||||
# Let's snag a cookie from Kibana
|
|
||||||
SESSIONCOOKIE=$(curl -K /opt/so/conf/elasticsearch/curl.config -c - -X GET http://localhost:5601/ | grep sid | awk '{print $7}')
|
|
||||||
|
|
||||||
echo "Setting up default Security Onion package policies for Elastic Agent..."
|
|
||||||
|
|
||||||
# List configured agent policies
|
|
||||||
curl -K /opt/so/conf/elasticsearch/curl.config -b "sid=$SESSIONCOOKIE" -L -X GET "localhost:5601/api/fleet/agent_policies" | jq
|
|
||||||
|
|
||||||
echo
|
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
# Copyright Security Onion Solutions LLC and/or licensed to Security Onion Solutions LLC under one
|
|
||||||
# or more contributor license agreements. Licensed under the Elastic License 2.0 as shown at
|
|
||||||
# https://securityonion.net/license; you may not use this file except in compliance with the
|
|
||||||
# Elastic License 2.0.
|
|
||||||
|
|
||||||
. /usr/sbin/so-common
|
|
||||||
|
|
||||||
POLICY_ID=$1
|
|
||||||
|
|
||||||
# Let's snag a cookie from Kibana
|
|
||||||
SESSIONCOOKIE=$(curl -K /opt/so/conf/elasticsearch/curl.config -c - -X GET http://localhost:5601/ | grep sid | awk '{print $7}')
|
|
||||||
|
|
||||||
echo "Viewing agent policy $POLICY_ID"
|
|
||||||
|
|
||||||
# View agent policy
|
|
||||||
curl -K /opt/so/conf/elasticsearch/curl.config -b "sid=$SESSIONCOOKIE" -L -X GET "localhost:5601/api/fleet/agent_policies/$POLICY_ID/full" | jq
|
|
||||||
|
|
||||||
echo
|
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
# Copyright Security Onion Solutions LLC and/or licensed to Security Onion Solutions LLC under one
|
|
||||||
# or more contributor license agreements. Licensed under the Elastic License 2.0 as shown at
|
|
||||||
# https://securityonion.net/license; you may not use this file except in compliance with the
|
|
||||||
# Elastic License 2.0.
|
|
||||||
|
|
||||||
. /usr/sbin/so-common
|
|
||||||
|
|
||||||
# Let's snag a cookie from Kibana
|
|
||||||
SESSIONCOOKIE=$(curl -K /opt/so/conf/elasticsearch/curl.config -c - -X GET http://localhost:5601/ | grep sid | awk '{print $7}')
|
|
||||||
|
|
||||||
echo "Retrieving data stream information..."
|
|
||||||
|
|
||||||
# Retrieve data stream information
|
|
||||||
curl -K /opt/so/conf/elasticsearch/curl.config -b "sid=$SESSIONCOOKIE" -L -X GET "localhost:5601/api/fleet/data_streams" | jq
|
|
||||||
|
|
||||||
echo
|
|
||||||
@@ -1,23 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
# Copyright Security Onion Solutions LLC and/or licensed to Security Onion Solutions LLC under one
|
|
||||||
# or more contributor license agreements. Licensed under the Elastic License 2.0 as shown at
|
|
||||||
# https://securityonion.net/license; you may not use this file except in compliance with the
|
|
||||||
# Elastic License 2.0.
|
|
||||||
|
|
||||||
. /usr/sbin/so-common
|
|
||||||
|
|
||||||
POLICY_ID=$1
|
|
||||||
|
|
||||||
# Let's snag a cookie from Kibana
|
|
||||||
SESSIONCOOKIE=$(curl -q -K /opt/so/conf/elasticsearch/curl.config -c - -X GET http://localhost:5601/ | grep sid | awk '{print $7}')
|
|
||||||
|
|
||||||
# Get integration policies relative to agent policy
|
|
||||||
INTEGRATION_POLICY_IDS=$(curl -q -K /opt/so/conf/elasticsearch/curl.config -b "sid=$SESSIONCOOKIE" -L -X GET "localhost:5601/api/fleet/agent_policies/$POLICY_ID" | jq -r '.item.package_policies[].id')
|
|
||||||
|
|
||||||
for i in $INTEGRATION_POLICY_IDS; do
|
|
||||||
# Delete integration policies
|
|
||||||
echo "Deleting integration policy: $i..."
|
|
||||||
curl -K /opt/so/conf/elasticsearch/curl.config -b "sid=$SESSIONCOOKIE" -L -X POST "localhost:5601/api/fleet/package_policies/delete" -H 'kbn-xsrf: true' -H 'Content-Type: application/json' -d"{\"packagePolicyIds\": [\"$i\"], \"force\":true}";
|
|
||||||
echo
|
|
||||||
echo
|
|
||||||
done
|
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
# Copyright Security Onion Solutions LLC and/or licensed to Security Onion Solutions LLC under one
|
|
||||||
# or more contributor license agreements. Licensed under the Elastic License 2.0 as shown at
|
|
||||||
# https://securityonion.net/license; you may not use this file except in compliance with the
|
|
||||||
# Elastic License 2.0.
|
|
||||||
|
|
||||||
. /usr/sbin/so-common
|
|
||||||
|
|
||||||
POLICY_ID=$1
|
|
||||||
|
|
||||||
# Let's snag a cookie from Kibana
|
|
||||||
SESSIONCOOKIE=$(curl -K /opt/so/conf/elasticsearch/curl.config -c - -X GET http://localhost:5601/ | grep sid | awk '{print $7}')
|
|
||||||
|
|
||||||
echo "Deleting integration policy $POLICY_ID..."
|
|
||||||
|
|
||||||
# List configured package policies
|
|
||||||
curl -K /opt/so/conf/elasticsearch/curl.config -b "sid=$SESSIONCOOKIE" -L -X POST "localhost:5601/api/fleet/package_policies/delete" -H 'kbn-xsrf: true' -H 'Content-Type: application/json' -d"{\"packagePolicyIds\": [\"$POLICY_ID\"]}"
|
|
||||||
|
|
||||||
echo
|
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
# Copyright Security Onion Solutions LLC and/or licensed to Security Onion Solutions LLC under one
|
|
||||||
# or more contributor license agreements. Licensed under the Elastic License 2.0 as shown at
|
|
||||||
# https://securityonion.net/license; you may not use this file except in compliance with the
|
|
||||||
# Elastic License 2.0.
|
|
||||||
|
|
||||||
. /usr/sbin/so-common
|
|
||||||
|
|
||||||
# Let's snag a cookie from Kibana
|
|
||||||
SESSIONCOOKIE=$(curl -K /opt/so/conf/elasticsearch/curl.config -c - -X GET http://localhost:5601/ | grep sid | awk '{print $7}')
|
|
||||||
|
|
||||||
echo "Setting up default Security Onion package policies for Elastic Agent..."
|
|
||||||
|
|
||||||
# List configured package policies
|
|
||||||
curl -K /opt/so/conf/elasticsearch/curl.config -b "sid=$SESSIONCOOKIE" -L -X GET "localhost:5601/api/fleet/package_policies" | jq
|
|
||||||
|
|
||||||
echo
|
|
||||||
@@ -1,21 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
# Copyright Security Onion Solutions LLC and/or licensed to Security Onion Solutions LLC under one
|
|
||||||
# or more contributor license agreements. Licensed under the Elastic License 2.0 as shown at
|
|
||||||
# https://securityonion.net/license; you may not use this file except in compliance with the
|
|
||||||
# Elastic License 2.0.
|
|
||||||
|
|
||||||
. /usr/sbin/so-common
|
|
||||||
|
|
||||||
# Initial Endpoints
|
|
||||||
for INTEGRATION in /opt/so/saltstack/default/salt/elasticfleet/files/integrations/endpoints-initial/*.json
|
|
||||||
do
|
|
||||||
printf "\n\nInitial Endpoint Policy - Loading $INTEGRATION\n"
|
|
||||||
elastic_fleet_integration_create "@$INTEGRATION"
|
|
||||||
done
|
|
||||||
|
|
||||||
# Grid Nodes
|
|
||||||
for INTEGRATION in /opt/so/saltstack/default/salt/elasticfleet/files/integrations/grid-nodes/*.json
|
|
||||||
do
|
|
||||||
printf "\n\nGrid Nodes Policy - Loading $INTEGRATION\n"
|
|
||||||
elastic_fleet_integration_create "@$INTEGRATION"
|
|
||||||
done
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
# Copyright Security Onion Solutions LLC and/or licensed to Security Onion Solutions LLC under one
|
|
||||||
# or more contributor license agreements. Licensed under the Elastic License 2.0 as shown at
|
|
||||||
# https://securityonion.net/license; you may not use this file except in compliance with the
|
|
||||||
# Elastic License 2.0.
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
. /usr/sbin/so-common
|
|
||||||
|
|
||||||
/usr/sbin/so-restart elasticfleet $1
|
|
||||||
@@ -1,92 +0,0 @@
|
|||||||
|
|
||||||
#!/bin/bash
|
|
||||||
|
|
||||||
# Copyright Security Onion Solutions LLC and/or licensed to Security Onion Solutions LLC under one
|
|
||||||
# or more contributor license agreements. Licensed under the Elastic License 2.0; you may not use
|
|
||||||
# this file except in compliance with the Elastic License 2.0.
|
|
||||||
{% from 'vars/globals.map.jinja' import GLOBALS %}
|
|
||||||
|
|
||||||
. /usr/sbin/so-common
|
|
||||||
|
|
||||||
printf "\n### Create ES Token ###\n"
|
|
||||||
ESTOKEN=$(curl -K /opt/so/conf/elasticsearch/curl.config -L -X POST "localhost:5601/api/fleet/service_tokens" -H 'kbn-xsrf: true' -H 'Content-Type: application/json' | jq -r .value)
|
|
||||||
|
|
||||||
### Create Outputs & Fleet URLs ###
|
|
||||||
printf "\nAdd Manager Elasticsearch Ouput...\n"
|
|
||||||
ESCACRT=$(openssl x509 -in /etc/pki/tls/certs/intca.crt)
|
|
||||||
JSON_STRING=$( jq -n \
|
|
||||||
--arg ESCACRT "$ESCACRT" \
|
|
||||||
'{"name":"so-manager_elasticsearch","id":"so-manager_elasticsearch","type":"elasticsearch","hosts":["https://{{ GLOBALS.manager_ip }}:9200","https://{{ GLOBALS.manager }}:9200"],"is_default":true,"is_default_monitoring":true,"config_yaml":"","ssl":{"certificate_authorities": [$ESCACRT]}}' )
|
|
||||||
curl -K /opt/so/conf/elasticsearch/curl.config -L -X POST "localhost:5601/api/fleet/outputs" -H 'kbn-xsrf: true' -H 'Content-Type: application/json' -d "$JSON_STRING"
|
|
||||||
printf "\n\n"
|
|
||||||
|
|
||||||
printf "\nCreate Logstash Output if node is not an Import or Eval install\n"
|
|
||||||
{% if grains.role not in ['so-import', 'so-eval'] %}
|
|
||||||
LOGSTASHCRT=$(openssl x509 -in /etc/pki/elasticfleet-logstash.crt)
|
|
||||||
LOGSTASHKEY=$(openssl rsa -in /etc/pki/elasticfleet-logstash.key)
|
|
||||||
LOGSTASHCA=$(openssl x509 -in /etc/pki/tls/certs/intca.crt)
|
|
||||||
JSON_STRING=$( jq -n \
|
|
||||||
--arg LOGSTASHCRT "$LOGSTASHCRT" \
|
|
||||||
--arg LOGSTASHKEY "$LOGSTASHKEY" \
|
|
||||||
--arg LOGSTASHCA "$LOGSTASHCA" \
|
|
||||||
'{"name":"grid-logstash","is_default":true,"is_default_monitoring":true,"id":"so-manager_logstash","type":"logstash","hosts":["{{ GLOBALS.manager_ip }}:5055", "{{ GLOBALS.manager }}:5055"],"config_yaml":"","ssl":{"certificate": $LOGSTASHCRT,"key": $LOGSTASHKEY,"certificate_authorities":[ $LOGSTASHCA ]},"proxy_id":null}'
|
|
||||||
)
|
|
||||||
curl -K /opt/so/conf/elasticsearch/curl.config -L -X POST "localhost:5601/api/fleet/outputs" -H 'kbn-xsrf: true' -H 'Content-Type: application/json' -d "$JSON_STRING"
|
|
||||||
printf "\n\n"
|
|
||||||
{%- endif %}
|
|
||||||
|
|
||||||
printf "\nAdd SO-Manager Fleet URL\n"
|
|
||||||
## This array replaces whatever URLs are currently configured
|
|
||||||
curl -K /opt/so/conf/elasticsearch/curl.config -L -X PUT "localhost:5601/api/fleet/settings" -H 'kbn-xsrf: true' -H 'Content-Type: application/json' -d '{"fleet_server_hosts":["https://{{ GLOBALS.manager_ip }}:8220", "https://{{ GLOBALS.manager }}:8220"]}'
|
|
||||||
printf "\n\n"
|
|
||||||
|
|
||||||
|
|
||||||
### Create Policies & Associated Integration Configuration ###
|
|
||||||
|
|
||||||
# Manager Fleet Server Host
|
|
||||||
elastic_fleet_policy_create "FleetServer_{{ GLOBALS.hostname }}" "Fleet Server - {{ GLOBALS.hostname }}" "true" | jq
|
|
||||||
|
|
||||||
#Temp Fixup for ES Output bug
|
|
||||||
JSON_STRING=$( jq -n \
|
|
||||||
--arg NAME "FleetServer_{{ GLOBALS.hostname }}" \
|
|
||||||
'{"name": $NAME,"description": $NAME,"namespace":"default","monitoring_enabled":["logs"],"inactivity_timeout":120,"data_output_id":"so-manager_elasticsearch"}'
|
|
||||||
)
|
|
||||||
curl -K /opt/so/conf/elasticsearch/curl.config -L -X PUT "localhost:5601/api/fleet/agent_policies/FleetServer_{{ GLOBALS.hostname }}" -H 'kbn-xsrf: true' -H 'Content-Type: application/json' -d "$JSON_STRING"
|
|
||||||
|
|
||||||
# Initial Endpoints Policy
|
|
||||||
elastic_fleet_policy_create "endpoints-initial" "Initial Endpoint Policy" "false"
|
|
||||||
|
|
||||||
# Grid Nodes Policy
|
|
||||||
elastic_fleet_policy_create "so-grid-nodes" "SO Grid Node Policy" "false"
|
|
||||||
|
|
||||||
# Load Integrations for default policies
|
|
||||||
so-elastic-fleet-integration-policy-load
|
|
||||||
|
|
||||||
### Finalization ###
|
|
||||||
|
|
||||||
# Query for Enrollment Tokens for default policies
|
|
||||||
ENDPOINTSENROLLMENTOKEN=$(curl -K /opt/so/conf/elasticsearch/curl.config -L "localhost:5601/api/fleet/enrollment_api_keys" -H 'kbn-xsrf: true' -H 'Content-Type: application/json' | jq .list | jq -r -c '.[] | select(.policy_id | contains("endpoints-default")) | .api_key')
|
|
||||||
GRIDNODESENROLLMENTOKEN=$(curl -K /opt/so/conf/elasticsearch/curl.config -L "localhost:5601/api/fleet/enrollment_api_keys" -H 'kbn-xsrf: true' -H 'Content-Type: application/json' | jq .list | jq -r -c '.[] | select(.policy_id | contains("so-grid-nodes")) | .api_key')
|
|
||||||
|
|
||||||
# Store needed data in minion pillar
|
|
||||||
pillar_file=/opt/so/saltstack/local/pillar/minions/{{ GLOBALS.minion_id }}.sls
|
|
||||||
printf '%s\n'\
|
|
||||||
"elasticfleet:"\
|
|
||||||
" server:"\
|
|
||||||
" es_token: '$ESTOKEN'"\
|
|
||||||
" endpoints_enrollment: '$ENDPOINTSENROLLMENTOKEN'"\
|
|
||||||
" grid_enrollment: '$GRIDNODESENROLLMENTOKEN'"\
|
|
||||||
"" >> "$pillar_file"
|
|
||||||
|
|
||||||
#Store Grid Nodes Enrollment token in Global pillar
|
|
||||||
global_pillar_file=/opt/so/saltstack/local/pillar/global/soc_global.sls
|
|
||||||
printf '%s\n'\
|
|
||||||
" fleet_grid_enrollment_token: '$GRIDNODESENROLLMENTOKEN'"\
|
|
||||||
"" >> "$global_pillar_file"
|
|
||||||
|
|
||||||
# Call Elastic-Fleet Salt State
|
|
||||||
salt-call state.apply elasticfleet queue=True
|
|
||||||
|
|
||||||
# Generate installers & install Elastic Agent on the node
|
|
||||||
so-elastic-agent-gen-installers
|
|
||||||
salt-call state.apply elasticfleet.install_agent_grid queue=True
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
# Copyright Security Onion Solutions LLC and/or licensed to Security Onion Solutions LLC under one
|
|
||||||
# or more contributor license agreements. Licensed under the Elastic License 2.0 as shown at
|
|
||||||
# https://securityonion.net/license; you may not use this file except in compliance with the
|
|
||||||
# Elastic License 2.0.
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
. /usr/sbin/so-common
|
|
||||||
|
|
||||||
/usr/sbin/so-start elasticfleet $1
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
# Copyright Security Onion Solutions LLC and/or licensed to Security Onion Solutions LLC under one
|
|
||||||
# or more contributor license agreements. Licensed under the Elastic License 2.0 as shown at
|
|
||||||
# https://securityonion.net/license; you may not use this file except in compliance with the
|
|
||||||
# Elastic License 2.0.
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
. /usr/sbin/so-common
|
|
||||||
|
|
||||||
/usr/sbin/so-stop elasticfleet $1
|
|
||||||
@@ -1,16 +1,24 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# Copyright Security Onion Solutions LLC and/or licensed to Security Onion Solutions LLC under one
|
# Copyright 2014-2023 Security Onion Solutions, LLC
|
||||||
# or more contributor license agreements. Licensed under the Elastic License 2.0 as shown at
|
#
|
||||||
# https://securityonion.net/license; you may not use this file except in compliance with the
|
# This program is free software: you can redistribute it and/or modify
|
||||||
# Elastic License 2.0.
|
# 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
|
. /usr/sbin/so-common
|
||||||
|
|
||||||
|
|
||||||
{%- if grains['role'] in ['so-eval','so-manager', 'so-managersearch', 'so-standalone', 'so-heavynode', 'so-searchnode', 'so-import']%}
|
{%- if grains['role'] in ['so-eval','so-manager', 'so-managersearch', 'so-standalone', 'so-heavynode', 'so-node', 'so-import']%}
|
||||||
/usr/sbin/so-restart elasticsearch $1
|
/usr/sbin/so-restart elasticsearch $1
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
|
|
||||||
@@ -18,11 +26,15 @@
|
|||||||
/usr/sbin/so-restart kibana $1
|
/usr/sbin/so-restart kibana $1
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
|
|
||||||
{%- if grains['role'] in ['so-manager', 'so-managersearch', 'so-standalone', 'so-heavynode', 'so-searchnode']%}
|
{%- if grains['role'] in ['so-manager', 'so-managersearch', 'so-standalone', 'so-heavynode', 'so-node']%}
|
||||||
/usr/sbin/so-restart logstash $1
|
/usr/sbin/so-restart logstash $1
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
|
|
||||||
{%- if grains['role'] in ['so-manager', 'so-managersearch', 'so-standalone', 'so-heavynode', 'so-searchnode']%}
|
{%- if grains['role'] in ['so-manager', 'so-managersearch', 'so-standalone', 'so-heavynode', 'so-node', 'so-sensor']%}
|
||||||
|
/usr/sbin/so-restart filebeat $1
|
||||||
|
{%- endif %}
|
||||||
|
|
||||||
|
{%- if grains['role'] in ['so-manager', 'so-managersearch', 'so-standalone', 'so-heavynode', 'so-node']%}
|
||||||
/usr/sbin/so-restart curator $1
|
/usr/sbin/so-restart curator $1
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
|
|
||||||
|
|||||||
@@ -1,16 +1,24 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# Copyright Security Onion Solutions LLC and/or licensed to Security Onion Solutions LLC under one
|
# Copyright 2014-2023 Security Onion Solutions, LLC
|
||||||
# or more contributor license agreements. Licensed under the Elastic License 2.0 as shown at
|
#
|
||||||
# https://securityonion.net/license; you may not use this file except in compliance with the
|
# This program is free software: you can redistribute it and/or modify
|
||||||
# Elastic License 2.0.
|
# 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
|
. /usr/sbin/so-common
|
||||||
|
|
||||||
|
|
||||||
{%- if grains['role'] in ['so-eval','so-manager', 'so-managersearch', 'so-standalone', 'so-heavynode', 'so-searchnode', 'so-import']%}
|
{%- if grains['role'] in ['so-eval','so-manager', 'so-managersearch', 'so-standalone', 'so-heavynode', 'so-node', 'so-import']%}
|
||||||
/usr/sbin/so-start elasticsearch $1
|
/usr/sbin/so-start elasticsearch $1
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
|
|
||||||
@@ -18,11 +26,15 @@
|
|||||||
/usr/sbin/so-start kibana $1
|
/usr/sbin/so-start kibana $1
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
|
|
||||||
{%- if grains['role'] in ['so-manager', 'so-managersearch', 'so-standalone', 'so-heavynode', 'so-searchnode']%}
|
{%- if grains['role'] in ['so-manager', 'so-managersearch', 'so-standalone', 'so-heavynode', 'so-node']%}
|
||||||
/usr/sbin/so-start logstash $1
|
/usr/sbin/so-start logstash $1
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
|
|
||||||
{%- if grains['role'] in ['so-manager', 'so-managersearch', 'so-standalone', 'so-heavynode', 'so-searchnode']%}
|
{%- if grains['role'] in ['so-manager', 'so-managersearch', 'so-standalone', 'so-heavynode', 'so-node', 'so-sensor']%}
|
||||||
|
/usr/sbin/so-start filebeat $1
|
||||||
|
{%- endif %}
|
||||||
|
|
||||||
|
{%- if grains['role'] in ['so-manager', 'so-managersearch', 'so-standalone', 'so-heavynode', 'so-node']%}
|
||||||
/usr/sbin/so-start curator $1
|
/usr/sbin/so-start curator $1
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
|
|
||||||
|
|||||||
@@ -1,16 +1,24 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# Copyright Security Onion Solutions LLC and/or licensed to Security Onion Solutions LLC under one
|
# Copyright 2014-2023 Security Onion Solutions, LLC
|
||||||
# or more contributor license agreements. Licensed under the Elastic License 2.0 as shown at
|
#
|
||||||
# https://securityonion.net/license; you may not use this file except in compliance with the
|
# This program is free software: you can redistribute it and/or modify
|
||||||
# Elastic License 2.0.
|
# 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
|
. /usr/sbin/so-common
|
||||||
|
|
||||||
|
|
||||||
{%- if grains['role'] in ['so-eval','so-manager', 'so-managersearch', 'so-standalone', 'so-heavynode', 'so-searchnode', 'so-import']%}
|
{%- if grains['role'] in ['so-eval','so-manager', 'so-managersearch', 'so-standalone', 'so-heavynode', 'so-node', 'so-import']%}
|
||||||
/usr/sbin/so-stop elasticsearch $1
|
/usr/sbin/so-stop elasticsearch $1
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
|
|
||||||
@@ -18,11 +26,15 @@
|
|||||||
/usr/sbin/so-stop kibana $1
|
/usr/sbin/so-stop kibana $1
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
|
|
||||||
{%- if grains['role'] in ['so-manager', 'so-managersearch', 'so-standalone', 'so-heavynode', 'so-searchnode']%}
|
{%- if grains['role'] in ['so-manager', 'so-managersearch', 'so-standalone', 'so-heavynode', 'so-node']%}
|
||||||
/usr/sbin/so-stop logstash $1
|
/usr/sbin/so-stop logstash $1
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
|
|
||||||
{%- if grains['role'] in ['so-manager', 'so-managersearch', 'so-standalone', 'so-heavynode', 'so-searchnode']%}
|
{%- if grains['role'] in ['so-manager', 'so-managersearch', 'so-standalone', 'so-heavynode', 'so-node', 'so-sensor']%}
|
||||||
|
/usr/sbin/so-stop filebeat $1
|
||||||
|
{%- endif %}
|
||||||
|
|
||||||
|
{%- if grains['role'] in ['so-manager', 'so-managersearch', 'so-standalone', 'so-heavynode', 'so-node']%}
|
||||||
/usr/sbin/so-stop curator $1
|
/usr/sbin/so-stop curator $1
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
|
|
||||||
|
|||||||
@@ -1,57 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
#
|
|
||||||
# Copyright Security Onion Solutions LLC and/or licensed to Security Onion Solutions LLC under one
|
|
||||||
# or more contributor license agreements. Licensed under the Elastic License 2.0 as shown at
|
|
||||||
# https://securityonion.net/license; you may not use this file except in compliance with the
|
|
||||||
# Elastic License 2.0.
|
|
||||||
|
|
||||||
. /usr/sbin/so-common
|
|
||||||
|
|
||||||
{% from 'vars/globals.map.jinja' import GLOBALS %}
|
|
||||||
|
|
||||||
TOTAL_AVAILABLE_SPACE=0
|
|
||||||
|
|
||||||
# Wait for ElasticSearch to initialize
|
|
||||||
COUNT=0
|
|
||||||
ELASTICSEARCH_CONNECTED="no"
|
|
||||||
while [[ "$COUNT" -le 240 ]]; do
|
|
||||||
/usr/sbin/so-elasticsearch-query / -k --output /dev/null --silent --head --fail
|
|
||||||
if [ $? -eq 0 ]; then
|
|
||||||
ELASTICSEARCH_CONNECTED="yes"
|
|
||||||
break
|
|
||||||
else
|
|
||||||
((COUNT+=1))
|
|
||||||
sleep 1
|
|
||||||
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
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Set percentage of space to desired value, otherwise use a default value of 80 percent
|
|
||||||
if [[ "$1" != "" ]]; then
|
|
||||||
PERCENTAGE=$1
|
|
||||||
else
|
|
||||||
PERCENTAGE=80
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Iterate through the output of _cat/allocation for each node in the cluster to determine the total available space
|
|
||||||
{% if GLOBALS.role == 'so-manager' %}
|
|
||||||
for i in $(/usr/sbin/so-elasticsearch-query _cat/allocation | grep -v {{ GLOBALS.manager }} | awk '{print $5}'); do
|
|
||||||
{% else %}
|
|
||||||
for i in $(/usr/sbin/so-elasticsearch-query _cat/allocation | awk '{print $5}'); do
|
|
||||||
{% endif %}
|
|
||||||
size=$(echo $i | grep -oE '[0-9].*' | awk '{print int($1+0.5)}')
|
|
||||||
unit=$(echo $i | grep -oE '[A-Za-z]+')
|
|
||||||
if [ $unit = "tb" ]; then
|
|
||||||
size=$(( size * 1024 ))
|
|
||||||
fi
|
|
||||||
TOTAL_AVAILABLE_SPACE=$(( TOTAL_AVAILABLE_SPACE + size ))
|
|
||||||
done
|
|
||||||
|
|
||||||
# Calculate the percentage of available space based on our previously defined value
|
|
||||||
PERCENTAGE_AVAILABLE_SPACE=$(( TOTAL_AVAILABLE_SPACE*PERCENTAGE/100 ))
|
|
||||||
echo "$PERCENTAGE_AVAILABLE_SPACE"
|
|
||||||
@@ -1,28 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
#
|
|
||||||
# Copyright Security Onion Solutions LLC and/or licensed to Security Onion Solutions LLC under one
|
|
||||||
# or more contributor license agreements. Licensed under the Elastic License 2.0 as shown at
|
|
||||||
# https://securityonion.net/license; you may not use this file except in compliance with the
|
|
||||||
# Elastic License 2.0.
|
|
||||||
|
|
||||||
. /usr/sbin/so-common
|
|
||||||
{% from 'vars/globals.map.jinja' import GLOBALS %}
|
|
||||||
|
|
||||||
TOTAL_AVAILABLE_SPACE=0
|
|
||||||
|
|
||||||
# Iterate through the output of _cat/allocation for each node in the cluster to determine the total available space
|
|
||||||
{% if GLOBALS.role == 'so-manager' %}
|
|
||||||
for i in $(/usr/sbin/so-elasticsearch-query _cat/allocation | grep -v {{ GLOBALS.manager }} | awk '{print $3}'); do
|
|
||||||
{% else %}
|
|
||||||
for i in $(/usr/sbin/so-elasticsearch-query _cat/allocation | awk '{print $3}'); do
|
|
||||||
{% endif %}
|
|
||||||
size=$(echo $i | grep -oE '[0-9].*' | awk '{print int($1+0.5)}')
|
|
||||||
unit=$(echo $i | grep -oE '[A-Za-z]+')
|
|
||||||
if [ $unit = "tb" ]; then
|
|
||||||
size=$(( size * 1024 ))
|
|
||||||
fi
|
|
||||||
TOTAL_AVAILABLE_SPACE=$(( TOTAL_AVAILABLE_SPACE + size ))
|
|
||||||
done
|
|
||||||
|
|
||||||
# Calculate the percentage of available space based on our previously defined value
|
|
||||||
echo "$TOTAL_AVAILABLE_SPACE"
|
|
||||||
@@ -1,14 +1,23 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
#
|
#
|
||||||
# Copyright Security Onion Solutions LLC and/or licensed to Security Onion Solutions LLC under one
|
# Copyright 2014-2023 Security Onion Solutions, LLC
|
||||||
# or more contributor license agreements. Licensed under the Elastic License 2.0 as shown at
|
#
|
||||||
# https://securityonion.net/license; you may not use this file except in compliance with the
|
# This program is free software: you can redistribute it and/or modify
|
||||||
# Elastic License 2.0.
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation, either version 3 of the License, or
|
||||||
{%- set NODEIP = salt['pillar.get']('host:mainip', '') %}
|
# (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 NODEIP = salt['pillar.get']('elasticsearch:mainip', '') %}
|
||||||
. /usr/sbin/so-common
|
. /usr/sbin/so-common
|
||||||
if [ "$1" == "" ]; then
|
if [ "$1" == "" ]; then
|
||||||
curl -K /opt/so/conf/elasticsearch/curl.config -s -k -L https://{{ NODEIP }}:9200/_component_template | jq '.component_templates[] |.name'| sort
|
{{ ELASTICCURL }} -s -k -L https://{{ NODEIP }}:9200/_component_template | jq '.component_templates[] |.name'| sort
|
||||||
else
|
else
|
||||||
curl -K /opt/so/conf/elasticsearch/curl.config -s -k -L https://{{ NODEIP }}:9200/_component_template/$1 | jq
|
{{ ELASTICCURL }} -s -k -L https://{{ NODEIP }}:9200/_component_template/$1 | jq
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -1,15 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
# Copyright Security Onion Solutions LLC and/or licensed to Security Onion Solutions LLC under one
|
|
||||||
# or more contributor license agreements. Licensed under the Elastic License 2.0 as shown at
|
|
||||||
# https://securityonion.net/license; you may not use this file except in compliance with the
|
|
||||||
# Elastic License 2.0.
|
|
||||||
|
|
||||||
. /usr/sbin/so-common
|
|
||||||
|
|
||||||
{%- set NODEIP = salt['pillar.get']('host:mainip', '') %}
|
|
||||||
|
|
||||||
if [ "$1" == "" ]; then
|
|
||||||
curl -K /opt/so/conf/elasticsearch/curl.config -s -k -L https://{{ NODEIP }}:9200/_all/_ilm/explain | jq .
|
|
||||||
else
|
|
||||||
curl -K /opt/so/conf/elasticsearch/curl.config -s -k -L https://{{ NODEIP }}:9200/$1/_ilm/explain | jq .[]
|
|
||||||
fi
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
# Copyright Security Onion Solutions LLC and/or licensed to Security Onion Solutions LLC under one
|
|
||||||
# or more contributor license agreements. Licensed under the Elastic License 2.0 as shown at
|
|
||||||
# https://securityonion.net/license; you may not use this file except in compliance with the
|
|
||||||
# Elastic License 2.0.
|
|
||||||
|
|
||||||
. /usr/sbin/so-common
|
|
||||||
|
|
||||||
{%- set NODEIP = salt['pillar.get']('host:mainip', '') %}
|
|
||||||
|
|
||||||
curl -K /opt/so/conf/elasticsearch/curl.config -s -k -L -X DELETE https://{{ NODEIP }}:9200/_ilm/policy/$1
|
|
||||||
@@ -1,21 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
# Copyright Security Onion Solutions LLC and/or licensed to Security Onion Solutions LLC under one
|
|
||||||
# or more contributor license agreements. Licensed under the Elastic License 2.0 as shown at
|
|
||||||
# https://securityonion.net/license; you may not use this file except in compliance with the
|
|
||||||
# Elastic License 2.0.
|
|
||||||
|
|
||||||
. /usr/sbin/so-common
|
|
||||||
|
|
||||||
{% import_yaml 'elasticsearch/defaults.yaml' as ESCONFIG with context %}
|
|
||||||
{%- set ES_INDEX_SETTINGS = salt['pillar.get']('elasticsearch:index_settings', default=ESCONFIG.elasticsearch.index_settings, merge=True) %}
|
|
||||||
{%- set NODEIP = salt['pillar.get']('host:mainip', '') %}
|
|
||||||
|
|
||||||
{%- for index, settings in ES_INDEX_SETTINGS.items() %}
|
|
||||||
{%- if settings.policy is defined %}
|
|
||||||
echo
|
|
||||||
echo "Setting up {{ index }}-logs policy..."
|
|
||||||
curl -K /opt/so/conf/elasticsearch/curl.config -b "sid=$SESSIONCOOKIE" -s -k -L -X PUT "https://{{ NODEIP }}:9200/_ilm/policy/{{ index }}-logs" -H 'Content-Type: application/json' -d'{ "policy": {{ settings.policy | tojson(true) }} }'
|
|
||||||
echo
|
|
||||||
{%- endif %}
|
|
||||||
{%- endfor %}
|
|
||||||
echo
|
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
# Copyright Security Onion Solutions LLC and/or licensed to Security Onion Solutions LLC under one
|
|
||||||
# or more contributor license agreements. Licensed under the Elastic License 2.0 as shown at
|
|
||||||
# https://securityonion.net/license; you may not use this file except in compliance with the
|
|
||||||
# Elastic License 2.0.
|
|
||||||
|
|
||||||
. /usr/sbin/so-common
|
|
||||||
|
|
||||||
{%- set NODEIP = salt['pillar.get']('host:mainip', '') %}
|
|
||||||
|
|
||||||
if [ "$1" == "" ]; then
|
|
||||||
curl -K /opt/so/conf/elasticsearch/curl.config -s -k -L https://{{ NODEIP }}:9200/_ilm/policy | jq .
|
|
||||||
else
|
|
||||||
curl -K /opt/so/conf/elasticsearch/curl.config -s -k -L https://{{ NODEIP }}:9200/_ilm/policy/$1 | jq .[]
|
|
||||||
fi
|
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
# Copyright Security Onion Solutions LLC and/or licensed to Security Onion Solutions LLC under one
|
|
||||||
# or more contributor license agreements. Licensed under the Elastic License 2.0 as shown at
|
|
||||||
# https://securityonion.net/license; you may not use this file except in compliance with the
|
|
||||||
# Elastic License 2.0.
|
|
||||||
|
|
||||||
. /usr/sbin/so-common
|
|
||||||
|
|
||||||
so-elasticsearch-ilm-stop
|
|
||||||
so-elasticsearch-ilm-start
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
/bin/bash
|
|
||||||
# Copyright Security Onion Solutions LLC and/or licensed to Security Onion Solutions LLC under one
|
|
||||||
# or more contributor license agreements. Licensed under the Elastic License 2.0 as shown at
|
|
||||||
# https://securityonion.net/license; you may not use this file except in compliance with the
|
|
||||||
# Elastic License 2.0.
|
|
||||||
|
|
||||||
. /usr/sbin/so-common
|
|
||||||
|
|
||||||
{%- set NODEIP = salt['pillar.get']('host:mainip', '') %}
|
|
||||||
|
|
||||||
echo "Starting ILM..."
|
|
||||||
curl -K /opt/so/conf/elasticsearch/curl.config -s -k -L -X POST https://{{ NODEIP }}:9200/_ilm/start
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
/bin/bash
|
|
||||||
# Copyright Security Onion Solutions LLC and/or licensed to Security Onion Solutions LLC under one
|
|
||||||
# or more contributor license agreements. Licensed under the Elastic License 2.0 as shown at
|
|
||||||
# https://securityonion.net/license; you may not use this file except in compliance with the
|
|
||||||
# Elastic License 2.0.
|
|
||||||
|
|
||||||
. /usr/sbin/so-common
|
|
||||||
|
|
||||||
{%- set NODEIP = salt['pillar.get']('host:mainip', '') %}
|
|
||||||
|
|
||||||
curl -K /opt/so/conf/elasticsearch/curl.config -s -k -L https://{{ NODEIP }}:9200/_ilm/status | jq .
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
# Copyright Security Onion Solutions LLC and/or licensed to Security Onion Solutions LLC under one
|
|
||||||
# or more contributor license agreements. Licensed under the Elastic License 2.0 as shown at
|
|
||||||
# https://securityonion.net/license; you may not use this file except in compliance with the
|
|
||||||
# Elastic License 2.0.
|
|
||||||
|
|
||||||
. /usr/sbin/so-common
|
|
||||||
|
|
||||||
{%- set NODEIP = salt['pillar.get']('host:mainip', '') %}
|
|
||||||
|
|
||||||
echo "Stopping ILM..."
|
|
||||||
curl -K /opt/so/conf/elasticsearch/curl.config -s -k -L -X POST https://{{ NODEIP }}:9200/_ilm/stop
|
|
||||||
@@ -1,14 +1,23 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
#
|
#
|
||||||
# Copyright Security Onion Solutions LLC and/or licensed to Security Onion Solutions LLC under one
|
# Copyright 2014-2023 Security Onion Solutions, LLC
|
||||||
# or more contributor license agreements. Licensed under the Elastic License 2.0 as shown at
|
#
|
||||||
# https://securityonion.net/license; you may not use this file except in compliance with the
|
# This program is free software: you can redistribute it and/or modify
|
||||||
# Elastic License 2.0.
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation, either version 3 of the License, or
|
||||||
{%- set NODEIP = salt['pillar.get']('host:mainip', '') %}
|
# (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 NODEIP = salt['pillar.get']('elasticsearch:mainip', '') %}
|
||||||
. /usr/sbin/so-common
|
. /usr/sbin/so-common
|
||||||
if [ "$1" == "" ]; then
|
if [ "$1" == "" ]; then
|
||||||
curl -K /opt/so/conf/elasticsearch/curl.config -s -k -L https://{{ NODEIP }}:9200/_index_template | jq '.index_templates[] |.name'| sort
|
{{ ELASTICCURL }} -s -k -L https://{{ NODEIP }}:9200/_index_template | jq '.index_templates[] |.name'| sort
|
||||||
else
|
else
|
||||||
curl -K /opt/so/conf/elasticsearch/curl.config -s -k -L https://{{ NODEIP }}:9200/_index_template/$1 | jq
|
{{ ELASTICCURL }} -s -k -L https://{{ NODEIP }}:9200/_index_template/$1 | jq
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -1,12 +1,21 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
#
|
#
|
||||||
# Copyright Security Onion Solutions LLC and/or licensed to Security Onion Solutions LLC under one
|
# Copyright 2014-2023 Security Onion Solutions, LLC
|
||||||
# or more contributor license agreements. Licensed under the Elastic License 2.0 as shown at
|
#
|
||||||
# https://securityonion.net/license; you may not use this file except in compliance with the
|
# This program is free software: you can redistribute it and/or modify
|
||||||
# Elastic License 2.0.
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation, either version 3 of the License, or
|
||||||
{%- set NODEIP = salt['pillar.get']('host:mainip', '') %}
|
# (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 NODEIP = salt['pillar.get']('elasticsearch:mainip', '') %}
|
||||||
|
|
||||||
. /usr/sbin/so-common
|
. /usr/sbin/so-common
|
||||||
|
|
||||||
curl -K /opt/so/conf/elasticsearch/curl.config -s -k -L "https://{{ NODEIP }}:9200/_cat/indices?pretty&v&s=index"
|
{{ ELASTICCURL }} -s -k -L "https://{{ NODEIP }}:9200/_cat/indices?pretty&v&s=index"
|
||||||
|
|||||||
@@ -1,15 +1,23 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
# Copyright Security Onion Solutions LLC and/or licensed to Security Onion Solutions LLC under one
|
# Copyright 2014-2023 Security Onion Solutions, LLC
|
||||||
# or more contributor license agreements. Licensed under the Elastic License 2.0 as shown at
|
#
|
||||||
# https://securityonion.net/license; you may not use this file except in compliance with the
|
# This program is free software: you can redistribute it and/or modify
|
||||||
# Elastic License 2.0.
|
# 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/>.
|
||||||
IP={{ salt['grains.get']('ip_interfaces').get(salt['pillar.get']('sensor:mainint', salt['pillar.get']('manager:mainint', salt['pillar.get']('elasticsearch:mainint', salt['pillar.get']('host:mainint')))))[0] }}
|
IP={{ salt['grains.get']('ip_interfaces').get(salt['pillar.get']('sensor:mainint', salt['pillar.get']('manager:mainint', salt['pillar.get']('elasticsearch:mainint', salt['pillar.get']('host:mainint')))))[0] }}
|
||||||
ESPORT=9200
|
ESPORT=9200
|
||||||
|
|
||||||
echo "Removing read only attributes for indices..."
|
echo "Removing read only attributes for indices..."
|
||||||
echo
|
echo
|
||||||
curl -K /opt/so/conf/elasticsearch/curl.config -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 }} -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;
|
||||||
|
|||||||
@@ -1,16 +1,25 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
#
|
#
|
||||||
# Copyright Security Onion Solutions LLC and/or licensed to Security Onion Solutions LLC under one
|
# Copyright 2014-2023 Security Onion Solutions, LLC
|
||||||
# or more contributor license agreements. Licensed under the Elastic License 2.0 as shown at
|
#
|
||||||
# https://securityonion.net/license; you may not use this file except in compliance with the
|
# This program is free software: you can redistribute it and/or modify
|
||||||
# Elastic License 2.0.
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation, either version 3 of the License, or
|
||||||
{%- set NODEIP = salt['pillar.get']('host:mainip', '') %}
|
# (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 NODEIP = salt['pillar.get']('elasticsearch:mainip', '') %}
|
||||||
|
|
||||||
. /usr/sbin/so-common
|
. /usr/sbin/so-common
|
||||||
|
|
||||||
if [ "$1" == "" ]; then
|
if [ "$1" == "" ]; then
|
||||||
curl -K /opt/so/conf/elasticsearch/curl.config -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
|
else
|
||||||
curl -K /opt/so/conf/elasticsearch/curl.config -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
|
fi
|
||||||
|
|||||||
@@ -1,16 +1,25 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
#
|
#
|
||||||
# Copyright Security Onion Solutions LLC and/or licensed to Security Onion Solutions LLC under one
|
# Copyright 2014-2023 Security Onion Solutions, LLC
|
||||||
# or more contributor license agreements. Licensed under the Elastic License 2.0 as shown at
|
#
|
||||||
# https://securityonion.net/license; you may not use this file except in compliance with the
|
# This program is free software: you can redistribute it and/or modify
|
||||||
# Elastic License 2.0.
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation, either version 3 of the License, or
|
||||||
{%- set NODEIP = salt['pillar.get']('host:mainip', '') %}
|
# (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 NODEIP = salt['pillar.get']('elasticsearch:mainip', '') %}
|
||||||
|
|
||||||
. /usr/sbin/so-common
|
. /usr/sbin/so-common
|
||||||
|
|
||||||
if [ "$1" == "" ]; then
|
if [ "$1" == "" ]; then
|
||||||
curl -K /opt/so/conf/elasticsearch/curl.config -s -k -L https://{{ NODEIP }}:9200/_ingest/pipeline/* | jq .
|
{{ ELASTICCURL }} -s -k -L https://{{ NODEIP }}:9200/_ingest/pipeline/* | jq .
|
||||||
else
|
else
|
||||||
curl -K /opt/so/conf/elasticsearch/curl.config -s -k -L https://{{ NODEIP }}:9200/_ingest/pipeline/$1 | jq .[]
|
{{ ELASTICCURL }} -s -k -L https://{{ NODEIP }}:9200/_ingest/pipeline/$1 | jq .[]
|
||||||
fi
|
fi
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user