mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2025-12-06 17:22:49 +01:00
Compare commits
966 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5344d30d56 | ||
|
|
4051111999 | ||
|
|
316a1c02f1 | ||
|
|
c07f62f8d1 | ||
|
|
cdc7a5cc7c | ||
|
|
10a3e6f414 | ||
|
|
2a3951ab36 | ||
|
|
67a8c4e8cb | ||
|
|
177819447b | ||
|
|
3be1c9ae32 | ||
|
|
b79e1c3225 | ||
|
|
d3065005ca | ||
|
|
26e97d5875 | ||
|
|
d68726f6ef | ||
|
|
f81da406da | ||
|
|
afd466cd2b | ||
|
|
6d228a836f | ||
|
|
1805effdc0 | ||
|
|
1170b04a87 | ||
|
|
c0b43d3319 | ||
|
|
6cc9d1c076 | ||
|
|
1c55bb6db2 | ||
|
|
3d0003555a | ||
|
|
0830f63c4e | ||
|
|
adbd8d6956 | ||
|
|
80d0080f70 | ||
|
|
af6e14dc6f | ||
|
|
8b6b7cbd11 | ||
|
|
e65c53dbb1 | ||
|
|
ceef07b74b | ||
|
|
280cde43ff | ||
|
|
81b9658499 | ||
|
|
04c6bed779 | ||
|
|
6b4af30fc1 | ||
|
|
1e2b404836 | ||
|
|
276c011a4f | ||
|
|
34fd80182e | ||
|
|
57e9f69c97 | ||
|
|
0542e0aa04 | ||
|
|
d0e7b5b55a | ||
|
|
ad74b4b3e0 | ||
|
|
ce70e0a61f | ||
|
|
8a4defcffa | ||
|
|
bddc3d6df9 | ||
|
|
4bb1ad9799 | ||
|
|
bc0c395b7f | ||
|
|
67dc71ab49 | ||
|
|
c95619d335 | ||
|
|
bfbc0f354c | ||
|
|
5c6e9e0e3a | ||
|
|
7291d64e82 | ||
|
|
695cce0b50 | ||
|
|
42126f125b | ||
|
|
2bfc48be35 | ||
|
|
7d1cf56160 | ||
|
|
1fd2196dd5 | ||
|
|
65b84f1bd7 | ||
|
|
fcfd3e3758 | ||
|
|
ee3708a428 | ||
|
|
b146700303 | ||
|
|
1ec8b52353 | ||
|
|
f8346cde08 | ||
|
|
e162be2e1d | ||
|
|
4f4f64a47d | ||
|
|
4cd1086efa | ||
|
|
2184c3b8ee | ||
|
|
65d28f98b5 | ||
|
|
aa8d9c12a0 | ||
|
|
f31d459a24 | ||
|
|
88c2ee0d36 | ||
|
|
d13733e716 | ||
|
|
86922a2388 | ||
|
|
65440f9aef | ||
|
|
12c661101a | ||
|
|
79b63ed14b | ||
|
|
cc4357d567 | ||
|
|
b9267ee015 | ||
|
|
5c310327e4 | ||
|
|
4311f66110 | ||
|
|
a8644478b5 | ||
|
|
4436f02f6d | ||
|
|
3cf8afc1dd | ||
|
|
f1e33b6eea | ||
|
|
0d9b22fe2d | ||
|
|
a08923030b | ||
|
|
1ec4af1a4d | ||
|
|
5ae78d4108 | ||
|
|
3bae243915 | ||
|
|
8234b6f835 | ||
|
|
55231eab25 | ||
|
|
e956ee9324 | ||
|
|
a343e3f31e | ||
|
|
2ff738a61c | ||
|
|
c226c1d902 | ||
|
|
7a49c55ea0 | ||
|
|
cc50eba6cb | ||
|
|
5c25dcf192 | ||
|
|
c744d389f7 | ||
|
|
76c917d977 | ||
|
|
1908a68330 | ||
|
|
d22040fb5d | ||
|
|
372f694cc1 | ||
|
|
1c079f7ff4 | ||
|
|
4e6e29e7dc | ||
|
|
43a244e0da | ||
|
|
e958246457 | ||
|
|
b210092534 | ||
|
|
e820c6fa42 | ||
|
|
71a409f210 | ||
|
|
a5823be0ac | ||
|
|
13c261178a | ||
|
|
2f0eaff8b3 | ||
|
|
977eea131e | ||
|
|
fb9b07b0eb | ||
|
|
6a010bb3e6 | ||
|
|
51b3e066be | ||
|
|
7dfb8f5b12 | ||
|
|
23f2dee840 | ||
|
|
4275fcbf22 | ||
|
|
ee97f5eaac | ||
|
|
0a807621cc | ||
|
|
8577fa63a3 | ||
|
|
50175f7e42 | ||
|
|
3173c6fd3c | ||
|
|
069908ec56 | ||
|
|
09f3199cc2 | ||
|
|
adec9ad48b | ||
|
|
8b3262ce1b | ||
|
|
4fad0e3a98 | ||
|
|
fddfb8eb92 | ||
|
|
210a7bc65b | ||
|
|
8a7ff3260d | ||
|
|
2f27b6f2fa | ||
|
|
52e909007f | ||
|
|
80aeffe1ad | ||
|
|
cbca2d702f | ||
|
|
af44cce423 | ||
|
|
7d81080076 | ||
|
|
6194d85180 | ||
|
|
88675ec2ee | ||
|
|
9c0a1bc8b9 | ||
|
|
52babc686d | ||
|
|
9370e5b8bc | ||
|
|
6c1d5451eb | ||
|
|
f50e6ab929 | ||
|
|
67f18a02ea | ||
|
|
7f491545fa | ||
|
|
9b33201ba5 | ||
|
|
aefcb9a491 | ||
|
|
fee52f8b86 | ||
|
|
e434ccd3d3 | ||
|
|
70a0cbae23 | ||
|
|
04263101cf | ||
|
|
312f99966e | ||
|
|
667800d830 | ||
|
|
2fba02f71b | ||
|
|
4ce0b770a5 | ||
|
|
1de862985c | ||
|
|
4e40392c55 | ||
|
|
d1fe79b642 | ||
|
|
f96cc35d37 | ||
|
|
388f1e753d | ||
|
|
42382d00d8 | ||
|
|
b086f5e5c1 | ||
|
|
0b0f9854f9 | ||
|
|
3107f46940 | ||
|
|
202c672798 | ||
|
|
6ac1bc5623 | ||
|
|
e002015ce2 | ||
|
|
61b5e009c7 | ||
|
|
f3aadcd553 | ||
|
|
71370d4522 | ||
|
|
c287b5f826 | ||
|
|
4286ac0dfd | ||
|
|
adc937295b | ||
|
|
96bf2c57e7 | ||
|
|
5f7a28dd5d | ||
|
|
3560ba933b | ||
|
|
9c20450832 | ||
|
|
d71daef2e9 | ||
|
|
c3ae80e2c1 | ||
|
|
2098dd16ff | ||
|
|
3b4c9e02e7 | ||
|
|
adc99ff06d | ||
|
|
f9b26c9a8f | ||
|
|
41a123c22b | ||
|
|
966089e1d0 | ||
|
|
3034d5ef98 | ||
|
|
5ab169ea52 | ||
|
|
f858027da1 | ||
|
|
c7517b37fa | ||
|
|
2f315ba5a0 | ||
|
|
ed883f173b | ||
|
|
a46ad6fe81 | ||
|
|
42fc0add5e | ||
|
|
f6c2983bd1 | ||
|
|
0b8e19bfc8 | ||
|
|
bee829697e | ||
|
|
ed025851ca | ||
|
|
94ab77b14d | ||
|
|
b113dce140 | ||
|
|
a2ef12eb6a | ||
|
|
eb0b909cd2 | ||
|
|
7ef2056f17 | ||
|
|
b12f29d48a | ||
|
|
5fd1fd9b0d | ||
|
|
ad0ecff8c5 | ||
|
|
88b6ae1b2f | ||
|
|
9772fd181c | ||
|
|
cfff8319bb | ||
|
|
0dc7c8b0e7 | ||
|
|
3ccd8b40b2 | ||
|
|
ca94bd12cf | ||
|
|
d650e68472 | ||
|
|
70f9bad827 | ||
|
|
c3d6e168ae | ||
|
|
5c9c1915f1 | ||
|
|
32912f2c87 | ||
|
|
fb70e1e40c | ||
|
|
4106d88338 | ||
|
|
93f57b73e2 | ||
|
|
4fa0b6be0e | ||
|
|
7ec2d85286 | ||
|
|
763d5425a5 | ||
|
|
4be594cbb9 | ||
|
|
e6fd3160ca | ||
|
|
07871987e4 | ||
|
|
3c33a38098 | ||
|
|
b24bf9b6a9 | ||
|
|
373d9256f2 | ||
|
|
dde7e0bd11 | ||
|
|
017c9c9874 | ||
|
|
871f919c27 | ||
|
|
f67c26a8f2 | ||
|
|
038e8fceb7 | ||
|
|
8c6adc21a8 | ||
|
|
75b26fb2af | ||
|
|
8258b782fc | ||
|
|
d73542d274 | ||
|
|
1092aa2cb1 | ||
|
|
8668cf9a9c | ||
|
|
b9440364f7 | ||
|
|
4f0ebfaf1f | ||
|
|
b090656269 | ||
|
|
16e0a26869 | ||
|
|
bc362acf82 | ||
|
|
79cbc747ea | ||
|
|
2269695e75 | ||
|
|
710afe9355 | ||
|
|
ac236a0538 | ||
|
|
eb7e8079ec | ||
|
|
8512042132 | ||
|
|
a234e1c898 | ||
|
|
25c91192a1 | ||
|
|
22f19bbe9e | ||
|
|
3b31a8d8cb | ||
|
|
cd868d1edb | ||
|
|
b31ea84c00 | ||
|
|
4ed6355186 | ||
|
|
e51c2152fa | ||
|
|
7af1b7a539 | ||
|
|
debbe965fe | ||
|
|
3bbaca41c9 | ||
|
|
f2d25439e2 | ||
|
|
472fdd935e | ||
|
|
14304c0f28 | ||
|
|
6a60890c36 | ||
|
|
687120ce4a | ||
|
|
5e3f99c567 | ||
|
|
c2ed0a6c72 | ||
|
|
8ed6a3ed78 | ||
|
|
0511c851a2 | ||
|
|
0c7db56053 | ||
|
|
7fae7500e8 | ||
|
|
25b771d36f | ||
|
|
6febc290a8 | ||
|
|
9e9a023377 | ||
|
|
f069b8cced | ||
|
|
0d42bfb7f4 | ||
|
|
4ccc898054 | ||
|
|
2010712929 | ||
|
|
0ad0255e8c | ||
|
|
ca28cc7a17 | ||
|
|
0fce6823db | ||
|
|
0db072d9b2 | ||
|
|
0c3a7a6214 | ||
|
|
a58b487a0a | ||
|
|
061b8d5b9b | ||
|
|
ff1dab283c | ||
|
|
319867ef10 | ||
|
|
c21131b77a | ||
|
|
638d9ddee3 | ||
|
|
dded28a54a | ||
|
|
7132011ece | ||
|
|
3a622ee71e | ||
|
|
fdc1468a11 | ||
|
|
691f64f8a3 | ||
|
|
a29def504e | ||
|
|
8160ef104d | ||
|
|
52ee26c334 | ||
|
|
d2c1fed2df | ||
|
|
1521224100 | ||
|
|
97f5f8438c | ||
|
|
978ba5b3ad | ||
|
|
80b926bc31 | ||
|
|
a4df3623be | ||
|
|
4a80c37167 | ||
|
|
8e88c350d5 | ||
|
|
a6a9f03cb0 | ||
|
|
3a9c9e3d99 | ||
|
|
307af1248c | ||
|
|
0224adb7c8 | ||
|
|
f4a804b88c | ||
|
|
ea88fa7319 | ||
|
|
c9bfd8a253 | ||
|
|
ee0e1ce8d7 | ||
|
|
814aa85dba | ||
|
|
c5ddddda2a | ||
|
|
c75536db6d | ||
|
|
c11d8367fa | ||
|
|
8320421d42 | ||
|
|
33bf799b47 | ||
|
|
047ab95e68 | ||
|
|
2eb3378b62 | ||
|
|
a354a6279b | ||
|
|
578250a994 | ||
|
|
e68f90c3b5 | ||
|
|
5a9211693c | ||
|
|
1e2df983af | ||
|
|
d85c99abf3 | ||
|
|
c0897c7e5a | ||
|
|
b4989c6c0e | ||
|
|
7a79ef6ddb | ||
|
|
8aa3a508fa | ||
|
|
b320a1d63e | ||
|
|
2a119d7824 | ||
|
|
73c17b77ae | ||
|
|
edb0d71e87 | ||
|
|
6ff1922788 | ||
|
|
758bee3a20 | ||
|
|
529da993aa | ||
|
|
5a95159ec3 | ||
|
|
fc9c31706d | ||
|
|
9548b3df54 | ||
|
|
d3f65ac1a8 | ||
|
|
cb46c13054 | ||
|
|
a4d3e109e6 | ||
|
|
711f5ab38f | ||
|
|
ea1227de9d | ||
|
|
f9b52677d7 | ||
|
|
533a65205f | ||
|
|
ea1f53b40c | ||
|
|
0f4f029e92 | ||
|
|
da9a915421 | ||
|
|
280fc501f9 | ||
|
|
625307ac5f | ||
|
|
44677ad521 | ||
|
|
1c326f561b | ||
|
|
7b64f93bce | ||
|
|
15f243f0ce | ||
|
|
edb00c2058 | ||
|
|
9e612e98ed | ||
|
|
1fc94a8f59 | ||
|
|
c58039ab47 | ||
|
|
1fca5e65df | ||
|
|
9a59ceee4e | ||
|
|
c5bf9bf90d | ||
|
|
676b4f0777 | ||
|
|
6557155a8a | ||
|
|
d3227bbcb1 | ||
|
|
7f218e5297 | ||
|
|
b3c527e7a9 | ||
|
|
54d732a060 | ||
|
|
22b7de819c | ||
|
|
dba30fb0ed | ||
|
|
7ca8fefded | ||
|
|
95b24b1684 | ||
|
|
66cd91c0a7 | ||
|
|
64199c81e1 | ||
|
|
ae5bc297dd | ||
|
|
f5a1bd4074 | ||
|
|
407a655717 | ||
|
|
0e19594c97 | ||
|
|
ff4d7a6cb6 | ||
|
|
f647a06239 | ||
|
|
d122ca1ba3 | ||
|
|
5616aa6beb | ||
|
|
394fa727cb | ||
|
|
9960cf0592 | ||
|
|
059c4e03e1 | ||
|
|
7e578d2ce0 | ||
|
|
12125deecb | ||
|
|
51256983da | ||
|
|
0718dbbd4d | ||
|
|
6b2ab67c58 | ||
|
|
64fd27fd78 | ||
|
|
7eb0dab6c7 | ||
|
|
0caf054da0 | ||
|
|
21b284fb10 | ||
|
|
3d1412a138 | ||
|
|
c7b4a5351c | ||
|
|
a95129b8c2 | ||
|
|
695bace3e8 | ||
|
|
47cac59adb | ||
|
|
1a75ebdca3 | ||
|
|
8da070d511 | ||
|
|
d2ea197ce0 | ||
|
|
b528fe1a03 | ||
|
|
3abe8cb397 | ||
|
|
2911e37b70 | ||
|
|
4fed5c2518 | ||
|
|
a5833f1f77 | ||
|
|
b27b2e358b | ||
|
|
915aaf58f2 | ||
|
|
f058fb460d | ||
|
|
f7394559d4 | ||
|
|
ec3f35c360 | ||
|
|
fea6e6f4f9 | ||
|
|
cb75b2df65 | ||
|
|
4369b8d0f6 | ||
|
|
5cb8d0beda | ||
|
|
b4446cba9a | ||
|
|
1e41b9ba31 | ||
|
|
b2759c4c7c | ||
|
|
6b144903fc | ||
|
|
3825becd1b | ||
|
|
2aa21512e5 | ||
|
|
3150367b1d | ||
|
|
3ac9c43b7b | ||
|
|
b643363e82 | ||
|
|
8d5c29340e | ||
|
|
1e9e156a87 | ||
|
|
a364f13d24 | ||
|
|
3d70698647 | ||
|
|
e989fc7041 | ||
|
|
49af35b440 | ||
|
|
4592e2d4d7 | ||
|
|
ec64314b70 | ||
|
|
cf001875c2 | ||
|
|
c7367eea38 | ||
|
|
db31cf3083 | ||
|
|
8edb1529a9 | ||
|
|
e8616e4d46 | ||
|
|
3bf57382ce | ||
|
|
def993f4ed | ||
|
|
96ec483ae4 | ||
|
|
6169758f4e | ||
|
|
1c91e2d50b | ||
|
|
57e7e61f21 | ||
|
|
93ab4b5d4f | ||
|
|
00fc256c37 | ||
|
|
887f412e48 | ||
|
|
aa9aa59213 | ||
|
|
a859aa4f48 | ||
|
|
82a7b7e02d | ||
|
|
85ea61bf98 | ||
|
|
7f4b8e8183 | ||
|
|
1f8b139462 | ||
|
|
562a016579 | ||
|
|
e040009d0b | ||
|
|
7dca988c11 | ||
|
|
f007ef0ef5 | ||
|
|
bfe98433f6 | ||
|
|
05549a2362 | ||
|
|
7e090b0894 | ||
|
|
8a645edb34 | ||
|
|
24a54a326c | ||
|
|
184d163d65 | ||
|
|
bb0cf9b8c7 | ||
|
|
3113d5fbdb | ||
|
|
6420ee0310 | ||
|
|
033f5dbb9c | ||
|
|
1c4abcef15 | ||
|
|
2acb930a2e | ||
|
|
37c630d6ab | ||
|
|
71a260a000 | ||
|
|
b489fee8b5 | ||
|
|
91221c4332 | ||
|
|
3abd1c9f16 | ||
|
|
b14c1d0999 | ||
|
|
13be0da484 | ||
|
|
3385d98a2a | ||
|
|
361b13dc88 | ||
|
|
98c669e80b | ||
|
|
b02d434a0e | ||
|
|
3ee9f23d26 | ||
|
|
348c2feee2 | ||
|
|
b238c492e4 | ||
|
|
97207bd006 | ||
|
|
bed70ab6bf | ||
|
|
8173cb589b | ||
|
|
563a606e0e | ||
|
|
8d952eca7e | ||
|
|
8f7dffea4b | ||
|
|
7ea8dc84b6 | ||
|
|
453247971e | ||
|
|
741e17a637 | ||
|
|
fedf334ee9 | ||
|
|
8fee19ee1b | ||
|
|
697bc53aec | ||
|
|
5a705fc0f2 | ||
|
|
7b17b4abc7 | ||
|
|
a043bc7cc4 | ||
|
|
72dc267ab5 | ||
|
|
970be4d530 | ||
|
|
474c4e54b4 | ||
|
|
d4dd4aa416 | ||
|
|
5054138be9 | ||
|
|
83c23dd5de | ||
|
|
42e00514f5 | ||
|
|
e75f8ba257 | ||
|
|
564ac3a4ff | ||
|
|
c58deef2e0 | ||
|
|
0ad65c8cd4 | ||
|
|
0aaf8d6d9a | ||
|
|
37ede9b993 | ||
|
|
5395983fc7 | ||
|
|
3648e293a1 | ||
|
|
12acc2e123 | ||
|
|
8d84718c91 | ||
|
|
3809573963 | ||
|
|
571550c019 | ||
|
|
e613bb3740 | ||
|
|
4662837075 | ||
|
|
892ca294dc | ||
|
|
45fd325307 | ||
|
|
653561ad95 | ||
|
|
f75badf43a | ||
|
|
c61199618a | ||
|
|
d9c021e86a | ||
|
|
951f6ab3e2 | ||
|
|
da488945e0 | ||
|
|
b6f1cfada6 | ||
|
|
85e0b2cab3 | ||
|
|
c8a6b232d5 | ||
|
|
fdb7cb90e3 | ||
|
|
73b83584e6 | ||
|
|
801f4aae8e | ||
|
|
c066cc67dc | ||
|
|
1185e43064 | ||
|
|
51ca661219 | ||
|
|
50a767ca6c | ||
|
|
174bbc6cd9 | ||
|
|
6a08086dfa | ||
|
|
a3579b88ae | ||
|
|
6a3e921924 | ||
|
|
4a0796359b | ||
|
|
0bfdef274b | ||
|
|
92d397d573 | ||
|
|
0b6b6e38fc | ||
|
|
aa59eff1ac | ||
|
|
172ca9aa8d | ||
|
|
79c4f07ff7 | ||
|
|
460a391460 | ||
|
|
905fcd06a6 | ||
|
|
0b7f1fb189 | ||
|
|
712dc6b277 | ||
|
|
b93709e05f | ||
|
|
32294eb2ed | ||
|
|
2da656ff95 | ||
|
|
ef1e05db3e | ||
|
|
798abdbcde | ||
|
|
8805fef187 | ||
|
|
aafd365f2b | ||
|
|
5f43380aa0 | ||
|
|
844ffe8fdf | ||
|
|
1e14d66f54 | ||
|
|
e2d95e0deb | ||
|
|
4765ef5f5c | ||
|
|
d63358c8f0 | ||
|
|
d37ddf584a | ||
|
|
eaa41266a2 | ||
|
|
4a9fcfb8cf | ||
|
|
a119d8f27d | ||
|
|
ba1dfcd774 | ||
|
|
10e4248cfc | ||
|
|
42e285cfbe | ||
|
|
79854f111e | ||
|
|
a05329e7d8 | ||
|
|
47652ac080 | ||
|
|
964919109d | ||
|
|
a968e5c23f | ||
|
|
ba7b34a8ce | ||
|
|
e2f16d51a6 | ||
|
|
42a6693101 | ||
|
|
2326701cc0 | ||
|
|
6ee37977c3 | ||
|
|
1ae35a39c3 | ||
|
|
943aa82ce4 | ||
|
|
131e105106 | ||
|
|
cc56dc5a7f | ||
|
|
657e251f51 | ||
|
|
d863f26f9d | ||
|
|
a7e0df84bb | ||
|
|
1fdf431c12 | ||
|
|
35b10b1f91 | ||
|
|
36b9450a39 | ||
|
|
af9daa4d71 | ||
|
|
c81ee9621d | ||
|
|
e7401b3e0c | ||
|
|
f2125242f9 | ||
|
|
54c4ee796f | ||
|
|
8d4fd6c18d | ||
|
|
3c820365ab | ||
|
|
a106913d1a | ||
|
|
493c9a11df | ||
|
|
1283708186 | ||
|
|
2e62494793 | ||
|
|
f88403e83e | ||
|
|
a08d0c8b6f | ||
|
|
9f6fcb3763 | ||
|
|
1afa12e607 | ||
|
|
190869a1f2 | ||
|
|
f6296c095f | ||
|
|
15ea152b84 | ||
|
|
4fff105986 | ||
|
|
3f8f0da468 | ||
|
|
2456605a54 | ||
|
|
675db1da1b | ||
|
|
0f68a53af4 | ||
|
|
b004a9149e | ||
|
|
e5ece6cd50 | ||
|
|
2ad6ab7dfc | ||
|
|
a75e986836 | ||
|
|
c388966e7e | ||
|
|
0cd80de2b3 | ||
|
|
a459511812 | ||
|
|
9dc491bd71 | ||
|
|
f5ea8325fe | ||
|
|
ad50b5d640 | ||
|
|
21b1becd7e | ||
|
|
5458c57cc9 | ||
|
|
68e34b781a | ||
|
|
4c43262610 | ||
|
|
a17a2ad3de | ||
|
|
14559b081d | ||
|
|
748ff0dbeb | ||
|
|
4fc4913d1e | ||
|
|
884cc2d054 | ||
|
|
553ce3e363 | ||
|
|
e0fe63d263 | ||
|
|
f5cfd480a3 | ||
|
|
3fff1451d4 | ||
|
|
9695e63950 | ||
|
|
96083e1458 | ||
|
|
deb0f640d6 | ||
|
|
b7c4fd94c4 | ||
|
|
e4ce17d4de | ||
|
|
a7bd1c2ce5 | ||
|
|
c9c8c5e5f5 | ||
|
|
c1e6c5688d | ||
|
|
29c3948f95 | ||
|
|
31e0b5c81c | ||
|
|
73aade1223 | ||
|
|
271e40337b | ||
|
|
f6f9097cd9 | ||
|
|
3cfee82b59 | ||
|
|
87574181d5 | ||
|
|
5f15320b9d | ||
|
|
8d1ba1f4db | ||
|
|
8cfabf101c | ||
|
|
9aa4112de1 | ||
|
|
12c3c351d8 | ||
|
|
28a1f7f88a | ||
|
|
b55ffa44f8 | ||
|
|
69a04dedd3 | ||
|
|
930ec33cb7 | ||
|
|
6172268661 | ||
|
|
336400e642 | ||
|
|
ea1324e498 | ||
|
|
3f007b6af7 | ||
|
|
f5cacd66b8 | ||
|
|
40ff628c0b | ||
|
|
97fce74263 | ||
|
|
d7961fdbb8 | ||
|
|
5a8d776a62 | ||
|
|
4af87ffcbe | ||
|
|
f38519247b | ||
|
|
065fe9042d | ||
|
|
993aabedf2 | ||
|
|
06706d29f2 | ||
|
|
f41987024f | ||
|
|
1efb39a71b | ||
|
|
52e8265511 | ||
|
|
26317efe79 | ||
|
|
0795aa39ba | ||
|
|
2ad3f9da11 | ||
|
|
034750fe5b | ||
|
|
e1d8f578c2 | ||
|
|
2156adcf70 | ||
|
|
e7abbf19af | ||
|
|
0f5f781024 | ||
|
|
a6d3dcf398 | ||
|
|
5e4bbcd4ca | ||
|
|
a2e2f23a8d | ||
|
|
3ec9206b17 | ||
|
|
adf0ef87c9 | ||
|
|
7767d3897b | ||
|
|
5ada85942b | ||
|
|
2489ca608a | ||
|
|
0a982dec95 | ||
|
|
be7167d99b | ||
|
|
821ce19aad | ||
|
|
1bdc45ef0e | ||
|
|
4f8bb9c2f1 | ||
|
|
7dd839cfa2 | ||
|
|
7befff3baa | ||
|
|
7543144afe | ||
|
|
7787f81bdd | ||
|
|
8e829b47ae | ||
|
|
8540a691dc | ||
|
|
8015676e01 | ||
|
|
015a441e79 | ||
|
|
a1866e5229 | ||
|
|
1106b2bf96 | ||
|
|
f0a1457ffd | ||
|
|
d09f0f841e | ||
|
|
6f2d47cc40 | ||
|
|
2317e8b348 | ||
|
|
f96d6ae4f4 | ||
|
|
5e534571ff | ||
|
|
14dd80b410 | ||
|
|
af2df2c7d1 | ||
|
|
f95712c502 | ||
|
|
48ca2cdff1 | ||
|
|
4a236b3f75 | ||
|
|
73ce948d42 | ||
|
|
fd4bb81f29 | ||
|
|
d84f85335e | ||
|
|
8c07c098f6 | ||
|
|
350cc41740 | ||
|
|
b64a91f13c | ||
|
|
27351fa520 | ||
|
|
7d14c68d70 | ||
|
|
035d215398 | ||
|
|
51d3defe76 | ||
|
|
3d71766b64 | ||
|
|
34dfc809c7 | ||
|
|
f809cf5216 | ||
|
|
bd4292711e | ||
|
|
9737b01676 | ||
|
|
94f15c63ce | ||
|
|
a16419b997 | ||
|
|
a6a69c57d1 | ||
|
|
6cdff854f3 | ||
|
|
787f1d8732 | ||
|
|
1a2921c2bc | ||
|
|
4a5d50cf80 | ||
|
|
1b3eca80d7 | ||
|
|
5eada1cdd5 | ||
|
|
4b1a8d7512 | ||
|
|
a5f4c96db0 | ||
|
|
4eea0a464c | ||
|
|
7840002d18 | ||
|
|
85168e9318 | ||
|
|
2420cd5db1 | ||
|
|
a686704d37 | ||
|
|
706c81daca | ||
|
|
019bec992d | ||
|
|
e2a787095c | ||
|
|
acabcd27a7 | ||
|
|
24ff34ee81 | ||
|
|
2e012432b4 | ||
|
|
de9ace62d4 | ||
|
|
faf5e7a643 | ||
|
|
748dc5ba91 | ||
|
|
5dfd11a018 | ||
|
|
e6cb75ce7e | ||
|
|
f7daa391c7 | ||
|
|
a45aa43f41 | ||
|
|
63884b73e1 | ||
|
|
9f4cb42c4f | ||
|
|
575da0f9d3 | ||
|
|
f4fcc052ca | ||
|
|
bc31e19e37 | ||
|
|
6e2319f6da | ||
|
|
968dce0aee | ||
|
|
1ebe970876 | ||
|
|
6b292ea62b | ||
|
|
da8957b4f4 | ||
|
|
1970d95d5f | ||
|
|
e7cba6ba1d | ||
|
|
948e0c4c61 | ||
|
|
cf5b1245ea | ||
|
|
771d091d6e | ||
|
|
77d31cb289 | ||
|
|
203e84d2cf | ||
|
|
7b05cf4266 | ||
|
|
8a78485906 | ||
|
|
c80b6ce104 | ||
|
|
467e5b34cc | ||
|
|
20307b703e | ||
|
|
6a0f04d24a | ||
|
|
5a5007c07d | ||
|
|
fde6f128ab | ||
|
|
1be3323265 | ||
|
|
47762816a7 | ||
|
|
40647ce54c | ||
|
|
8310559273 | ||
|
|
2a100c0dcc | ||
|
|
d0c267ca90 | ||
|
|
54da2b869c | ||
|
|
ab662e9b81 | ||
|
|
db12b6f3c6 | ||
|
|
96d32fda51 | ||
|
|
15f0c98281 | ||
|
|
d0da7ade6a | ||
|
|
c4e0fa0939 | ||
|
|
e11717c4d0 | ||
|
|
76a13e99da | ||
|
|
20fd757847 | ||
|
|
39e14b3910 | ||
|
|
c7fcdc8084 | ||
|
|
4991ea8de3 | ||
|
|
36ccece724 | ||
|
|
a0432e97b0 | ||
|
|
733b1376c5 | ||
|
|
490278a4c3 | ||
|
|
bd5efbabd9 | ||
|
|
8fa426f265 | ||
|
|
9d9d3aac53 | ||
|
|
744a8bca73 | ||
|
|
8a41636e7f | ||
|
|
dc79dca7fe | ||
|
|
1c55f738ec | ||
|
|
e98012ae2c | ||
|
|
92fa33159e | ||
|
|
72c6fe2184 | ||
|
|
5730c85988 | ||
|
|
63be0734c9 | ||
|
|
5653828154 | ||
|
|
2d2f4de337 | ||
|
|
8a81a5148b | ||
|
|
98bef8fb9d | ||
|
|
eced18c3cc | ||
|
|
8e15ed56d6 | ||
|
|
76c98200f3 | ||
|
|
cc2f2de5b5 | ||
|
|
b423e8d22a | ||
|
|
1a561f6b12 | ||
|
|
a5bf4bbb35 | ||
|
|
964bad4657 | ||
|
|
e836f96c65 | ||
|
|
4851069a10 | ||
|
|
040730e8f5 | ||
|
|
afb777fc8f | ||
|
|
75d49845f2 | ||
|
|
bc19cce4c2 | ||
|
|
26781de244 | ||
|
|
2264b6e51c | ||
|
|
03b97cce75 | ||
|
|
11ae904100 | ||
|
|
6818de9e64 | ||
|
|
887937a75d | ||
|
|
596f2d31e4 | ||
|
|
3ec255ecee | ||
|
|
6361c790e9 | ||
|
|
8e80b41ca9 | ||
|
|
1454201505 | ||
|
|
3af6e9e1fe | ||
|
|
8b5ff31351 | ||
|
|
7314e2dea8 | ||
|
|
ff04bb507a | ||
|
|
5b16a65422 | ||
|
|
02d2e5e2c6 | ||
|
|
f3b8da1f9d | ||
|
|
25d4bde33b | ||
|
|
1ff20f7e27 | ||
|
|
defe832121 | ||
|
|
d8f70397f7 | ||
|
|
dac2ad5dbf | ||
|
|
c62acf5e4e | ||
|
|
10f4e09b70 | ||
|
|
00785c6ba5 | ||
|
|
0a995f4a7a | ||
|
|
85969dc16d | ||
|
|
bf99bab6c0 | ||
|
|
401764437f | ||
|
|
36019727b3 | ||
|
|
547c3ff52c | ||
|
|
7d43d48aca | ||
|
|
55058a11aa | ||
|
|
ebe00822f8 | ||
|
|
60134829d5 | ||
|
|
c7b43ac220 | ||
|
|
a7f24b62e6 | ||
|
|
9ca13ebccd | ||
|
|
c828a2ea75 | ||
|
|
8741520263 | ||
|
|
6b8b0f1b26 | ||
|
|
f77305e22f | ||
|
|
f782299281 | ||
|
|
fa6396b121 | ||
|
|
3d6c956e02 | ||
|
|
0bb1ba2853 | ||
|
|
869767d9d9 | ||
|
|
0944cd1bcd | ||
|
|
3b709e7877 | ||
|
|
6e9e4dc99c | ||
|
|
2cdf76473c | ||
|
|
053b19de11 | ||
|
|
bda9078843 | ||
|
|
0516a9ddd5 | ||
|
|
85e53c53af | ||
|
|
6a4d6f7a6d | ||
|
|
66b7678df8 | ||
|
|
3b9de2b7ca | ||
|
|
a60bf11daa | ||
|
|
05729d216a | ||
|
|
3904295137 | ||
|
|
aa7f927ffd | ||
|
|
68f18da832 | ||
|
|
dc330a774e | ||
|
|
9acf610262 | ||
|
|
d76a4b1359 | ||
|
|
11b200e9c0 | ||
|
|
20a56d0831 | ||
|
|
6bfef773f2 | ||
|
|
b3f9ee3b34 | ||
|
|
c0be252f9f | ||
|
|
04f2595fa1 | ||
|
|
e30958b9ec | ||
|
|
d9005c157d | ||
|
|
62dbe425a6 | ||
|
|
2b8b8e2f40 | ||
|
|
60daacd6dc | ||
|
|
a09002edae | ||
|
|
5b93c40ce4 | ||
|
|
3ba8f47d9c | ||
|
|
6f7dbee36e | ||
|
|
fd302c6363 | ||
|
|
70f98e2eea | ||
|
|
b32bc8b542 | ||
|
|
aca98e01f3 | ||
|
|
2f7c0c34e6 | ||
|
|
4f228c1b7c | ||
|
|
71734ddc0a | ||
|
|
57732b360e | ||
|
|
4d42d04cc3 | ||
|
|
d02c440934 | ||
|
|
77a9bf2697 | ||
|
|
18a881ccab | ||
|
|
8bb527b4f1 | ||
|
|
694635a38f | ||
|
|
0f1b92cea9 | ||
|
|
48b17ee51a | ||
|
|
d56a9e1f86 | ||
|
|
ffdf7e1db4 | ||
|
|
3cd11807cd | ||
|
|
8f4a6df53a | ||
|
|
fc51c2aef4 | ||
|
|
5b38acb64b | ||
|
|
2b155b5581 | ||
|
|
40f6fed2a5 | ||
|
|
1610445b4e | ||
|
|
0c12025599 | ||
|
|
33e381ad15 | ||
|
|
6f73d62400 | ||
|
|
a5c790c31e | ||
|
|
8b146aac32 | ||
|
|
81006ebbd0 | ||
|
|
49e5cb311e | ||
|
|
533ed395e7 | ||
|
|
a0ffe26334 | ||
|
|
0c3e35c55e | ||
|
|
cfd1b82e00 |
12
.github/ISSUE_TEMPLATE
vendored
Normal file
12
.github/ISSUE_TEMPLATE
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
PLEASE STOP AND READ THIS INFORMATION!
|
||||
|
||||
If you are creating an issue just to ask a question, you will likely get faster and better responses by posting to our discussions forum instead:
|
||||
https://securityonion.net/discuss
|
||||
|
||||
If you think you have found a possible bug or are observing a behavior that you weren't expecting, use the discussion forum to start a conversation about it instead of creating an issue.
|
||||
|
||||
If you are very familiar with the latest version of the product and are confident you have found a bug in Security Onion, you can continue with creating an issue here, but please make sure you have done the following:
|
||||
- duplicated the issue on a fresh installation of the latest version
|
||||
- provide information about your system and how you installed Security Onion
|
||||
- include relevant log files
|
||||
- include reproduction steps
|
||||
15
.github/workflows/leaktest.yml
vendored
Normal file
15
.github/workflows/leaktest.yml
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
name: leak-test
|
||||
|
||||
on: [push,pull_request]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: '0'
|
||||
|
||||
- name: Gitleaks
|
||||
uses: zricethezav/gitleaks-action@master
|
||||
1
KEYS
1
KEYS
@@ -1,4 +1,5 @@
|
||||
-----BEGIN PGP PUBLIC KEY BLOCK-----
|
||||
|
||||
mQINBF7rzwEBEADBg87uJhnC3Ls7s60hbHGaywGrPtbz2WuYA/ev3YS3X7WS75p8
|
||||
PGlzTWUCujx0pEHbK2vYfExl3zksZ8ZmLyZ9VB3oSLiWBzJgKAeB7YCFEo8te+eE
|
||||
P2Z+8c+kX4eOV+2waxZyewA2TipSkhWgStSI4Ow8SyVUcUWA3hCw7mo2duNVi7KO
|
||||
|
||||
30
README.md
30
README.md
@@ -1,37 +1,35 @@
|
||||
## Security Onion 2.2.0.rc3
|
||||
## Security Onion 2.3.10
|
||||
|
||||
Security Onion 2.2.0 RC3 is here!
|
||||
Security Onion 2.3.10 is here!
|
||||
|
||||
### Warnings and Disclaimers
|
||||
## Screenshots
|
||||
|
||||
- If this breaks your system, you get to keep both pieces!
|
||||
- This is a work in progress and is in constant flux.
|
||||
- This configuration may change drastically over time leading up to the final release.
|
||||
- Do NOT run this on a system that you care about!
|
||||
- Do NOT run this on a system that has data that you care about!
|
||||
- This script should only be run on a TEST box with TEST data!
|
||||
- Use of this script may result in nausea, vomiting, or a burning sensation.
|
||||
Alerts
|
||||

|
||||
|
||||
Hunt
|
||||

|
||||
|
||||
### Release Notes
|
||||
|
||||
https://docs.securityonion.net/en/2.2/release-notes.html
|
||||
https://docs.securityonion.net/en/2.3/release-notes.html
|
||||
|
||||
### Requirements
|
||||
|
||||
https://docs.securityonion.net/en/2.2/hardware.html
|
||||
https://docs.securityonion.net/en/2.3/hardware.html
|
||||
|
||||
### Download
|
||||
|
||||
https://docs.securityonion.net/en/2.2/download.html
|
||||
https://docs.securityonion.net/en/2.3/download.html
|
||||
|
||||
### Installation
|
||||
|
||||
https://docs.securityonion.net/en/2.2/installation.html
|
||||
https://docs.securityonion.net/en/2.3/installation.html
|
||||
|
||||
### FAQ
|
||||
|
||||
https://docs.securityonion.net/en/2.2/faq.html
|
||||
https://docs.securityonion.net/en/2.3/faq.html
|
||||
|
||||
### Feedback
|
||||
|
||||
https://docs.securityonion.net/en/2.2/community-support.html
|
||||
https://docs.securityonion.net/en/2.3/community-support.html
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
### 2.2.0-rc3 ISO image built on 2020/09/17
|
||||
### 2.3.10 ISO image built on 2020/11/19
|
||||
|
||||
### Download and Verify
|
||||
|
||||
2.2.0-rc3 ISO image:
|
||||
https://download.securityonion.net/file/securityonion/securityonion-2.2.0-rc3.iso
|
||||
2.3.10 ISO image:
|
||||
https://download.securityonion.net/file/securityonion/securityonion-2.3.10.iso
|
||||
|
||||
MD5: 051883501C905653ACBCEC513C294778
|
||||
SHA1: 0A66F6636F53B268E7FFB743A3136AC5CC3E0E96
|
||||
SHA256: 5A9F303954AF1B1D271CE526E5DCBFC28F3FFC0621B291A29F0F7F2E8EB11C43
|
||||
MD5: 55E10BAE3D90DF47CA4D5DCCDCB67A96
|
||||
SHA1: 01361123F35CEACE077803BC8074594D57EE653A
|
||||
SHA256: 772EA4EFFFF12F026593F5D1CC93DB538CC17B9BA5F60308F1976B6ED7032A8D
|
||||
|
||||
Signature for ISO image:
|
||||
https://github.com/Security-Onion-Solutions/securityonion/raw/master/sigs/securityonion-2.2.0-rc3.iso.sig
|
||||
https://github.com/Security-Onion-Solutions/securityonion/raw/master/sigs/securityonion-2.3.10.iso.sig
|
||||
|
||||
Signing key:
|
||||
https://raw.githubusercontent.com/Security-Onion-Solutions/securityonion/master/KEYS
|
||||
@@ -24,22 +24,22 @@ wget https://raw.githubusercontent.com/Security-Onion-Solutions/securityonion/ma
|
||||
|
||||
Download the signature file for the ISO:
|
||||
```
|
||||
wget https://github.com/Security-Onion-Solutions/securityonion/raw/master/sigs/securityonion-2.2.0-rc3.iso.sig
|
||||
wget https://github.com/Security-Onion-Solutions/securityonion/raw/master/sigs/securityonion-2.3.10.iso.sig
|
||||
```
|
||||
|
||||
Download the ISO image:
|
||||
```
|
||||
wget https://download.securityonion.net/file/securityonion/securityonion-2.2.0-rc3.iso
|
||||
wget https://download.securityonion.net/file/securityonion/securityonion-2.3.10.iso
|
||||
```
|
||||
|
||||
Verify the downloaded ISO image using the signature file:
|
||||
```
|
||||
gpg --verify securityonion-2.2.0-rc3.iso.sig securityonion-2.2.0-rc3.iso
|
||||
gpg --verify securityonion-2.3.10.iso.sig securityonion-2.3.10.iso
|
||||
```
|
||||
|
||||
The output should show "Good signature" and the Primary key fingerprint should match what's shown below:
|
||||
```
|
||||
gpg: Signature made Thu 17 Sep 2020 10:05:27 AM EDT using RSA key ID FE507013
|
||||
gpg: Signature made Thu 19 Nov 2020 03:38:54 PM EST using RSA key ID FE507013
|
||||
gpg: Good signature from "Security Onion Solutions, LLC <info@securityonionsolutions.com>"
|
||||
gpg: WARNING: This key is not certified with a trusted signature!
|
||||
gpg: There is no indication that the signature belongs to the owner.
|
||||
@@ -47,4 +47,4 @@ 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.2/installation.html
|
||||
https://docs.securityonion.net/en/2.3/installation.html
|
||||
|
||||
14
files/salt/master/salt-master.service
Normal file
14
files/salt/master/salt-master.service
Normal file
@@ -0,0 +1,14 @@
|
||||
[Unit]
|
||||
Description=The Salt Master Server
|
||||
Documentation=man:salt-master(1) file:///usr/share/doc/salt/html/contents.html https://docs.saltstack.com/en/latest/contents.html
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
LimitNOFILE=100000
|
||||
Type=notify
|
||||
NotifyAccess=all
|
||||
ExecStart=/usr/bin/salt-master
|
||||
Restart=always
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
13
pillar/elasticsearch/manager.sls
Normal file
13
pillar/elasticsearch/manager.sls
Normal file
@@ -0,0 +1,13 @@
|
||||
elasticsearch:
|
||||
templates:
|
||||
- so/so-beats-template.json.jinja
|
||||
- so/so-common-template.json
|
||||
- so/so-firewall-template.json.jinja
|
||||
- so/so-flow-template.json.jinja
|
||||
- so/so-ids-template.json.jinja
|
||||
- so/so-import-template.json.jinja
|
||||
- so/so-osquery-template.json.jinja
|
||||
- so/so-ossec-template.json.jinja
|
||||
- so/so-strelka-template.json.jinja
|
||||
- so/so-syslog-template.json.jinja
|
||||
- so/so-zeek-template.json.jinja
|
||||
11
pillar/logrotate/init.sls
Normal file
11
pillar/logrotate/init.sls
Normal file
@@ -0,0 +1,11 @@
|
||||
logrotate:
|
||||
conf: |
|
||||
daily
|
||||
rotate 14
|
||||
missingok
|
||||
copytruncate
|
||||
compress
|
||||
create
|
||||
extension .log
|
||||
dateext
|
||||
dateyesterday
|
||||
@@ -1,6 +1,7 @@
|
||||
base:
|
||||
'*':
|
||||
- patch.needs_restarting
|
||||
- logrotate
|
||||
|
||||
'*_eval or *_helix or *_heavynode or *_sensor or *_standalone or *_import':
|
||||
- match: compound
|
||||
@@ -13,22 +14,23 @@ base:
|
||||
- logstash.search
|
||||
- elasticsearch.search
|
||||
|
||||
'*_sensor':
|
||||
- global
|
||||
- zeeklogs
|
||||
- healthcheck.sensor
|
||||
- minions.{{ grains.id }}
|
||||
|
||||
'*_manager or *_managersearch':
|
||||
- match: compound
|
||||
- global
|
||||
- data.*
|
||||
- secrets
|
||||
- minions.{{ grains.id }}
|
||||
|
||||
'*_manager':
|
||||
- logstash
|
||||
- logstash.manager
|
||||
- elasticsearch.manager
|
||||
|
||||
'*_manager or *_managersearch':
|
||||
- match: compound
|
||||
- data.*
|
||||
- secrets
|
||||
- global
|
||||
- minions.{{ grains.id }}
|
||||
|
||||
'*_sensor':
|
||||
- zeeklogs
|
||||
- healthcheck.sensor
|
||||
- global
|
||||
- minions.{{ grains.id }}
|
||||
|
||||
'*_eval':
|
||||
- data.*
|
||||
@@ -56,29 +58,29 @@ base:
|
||||
- minions.{{ grains.id }}
|
||||
|
||||
'*_heavynode':
|
||||
- global
|
||||
- zeeklogs
|
||||
- global
|
||||
- minions.{{ grains.id }}
|
||||
|
||||
'*_helix':
|
||||
- global
|
||||
- fireeye
|
||||
- zeeklogs
|
||||
- logstash
|
||||
- logstash.helix
|
||||
- global
|
||||
- minions.{{ grains.id }}
|
||||
|
||||
'*_fleet':
|
||||
- global
|
||||
- data.*
|
||||
- secrets
|
||||
- global
|
||||
- minions.{{ grains.id }}
|
||||
|
||||
'*_searchnode':
|
||||
- global
|
||||
- logstash
|
||||
- logstash.search
|
||||
- elasticsearch.search
|
||||
- global
|
||||
- minions.{{ grains.id }}
|
||||
|
||||
'*_import':
|
||||
|
||||
@@ -52,4 +52,5 @@ zeek:
|
||||
- frameworks/signatures/detect-windows-shells
|
||||
redef:
|
||||
- LogAscii::use_json = T;
|
||||
- LogAscii::json_timestamps = JSON::TS_ISO8601;
|
||||
- LogAscii::json_timestamps = JSON::TS_ISO8601;
|
||||
- CaptureLoss::watch_interval = 5 mins;
|
||||
@@ -1,42 +0,0 @@
|
||||
zeeklogs:
|
||||
enabled:
|
||||
- conn
|
||||
- dce_rpc
|
||||
- dhcp
|
||||
- dhcpv6
|
||||
- dnp3
|
||||
- dns
|
||||
- dpd
|
||||
- files
|
||||
- ftp
|
||||
- http
|
||||
- intel
|
||||
- irc
|
||||
- kerberos
|
||||
- modbus
|
||||
- mqtt
|
||||
- notice
|
||||
- ntlm
|
||||
- openvpn
|
||||
- pe
|
||||
- radius
|
||||
- rfb
|
||||
- rdp
|
||||
- signatures
|
||||
- sip
|
||||
- smb_files
|
||||
- smb_mapping
|
||||
- smtp
|
||||
- snmp
|
||||
- software
|
||||
- ssh
|
||||
- ssl
|
||||
- syslog
|
||||
- telnet
|
||||
- tunnel
|
||||
- weird
|
||||
- mysql
|
||||
- socks
|
||||
- x509
|
||||
|
||||
disabled:
|
||||
@@ -1,4 +1,51 @@
|
||||
#!py
|
||||
|
||||
import logging
|
||||
|
||||
def status():
|
||||
return __salt__['cmd.run']('/sbin/so-status')
|
||||
return __salt__['cmd.run']('/usr/sbin/so-status')
|
||||
|
||||
|
||||
def mysql_conn(retry):
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
from time import sleep
|
||||
|
||||
try:
|
||||
from MySQLdb import _mysql
|
||||
except ImportError as e:
|
||||
log.error(e)
|
||||
return False
|
||||
|
||||
mainint = __salt__['pillar.get']('sensor:mainint', __salt__['pillar.get']('manager:mainint'))
|
||||
mainip = __salt__['grains.get']('ip_interfaces').get(mainint)[0]
|
||||
|
||||
mysql_up = False
|
||||
for i in range(0, retry):
|
||||
log.debug(f'Connection attempt {i+1}')
|
||||
try:
|
||||
db = _mysql.connect(
|
||||
host=mainip,
|
||||
user='root',
|
||||
passwd=__salt__['pillar.get']('secrets:mysql')
|
||||
)
|
||||
log.debug(f'Connected to MySQL server on {mainip} after {i} attempts.')
|
||||
|
||||
db.query("""SELECT 1;""")
|
||||
log.debug(f'Successfully completed query against MySQL server on {mainip}')
|
||||
|
||||
db.close()
|
||||
mysql_up = True
|
||||
break
|
||||
except _mysql.OperationalError as e:
|
||||
log.debug(e)
|
||||
except Exception as e:
|
||||
log.error('Unexpected error occured.')
|
||||
log.error(e)
|
||||
break
|
||||
sleep(1)
|
||||
|
||||
if not mysql_up:
|
||||
log.error(f'Could not connect to MySQL server on {mainip} after {retry} attempts.')
|
||||
|
||||
return mysql_up
|
||||
2
salt/common/cron/common-rotate
Normal file
2
salt/common/cron/common-rotate
Normal file
@@ -0,0 +1,2 @@
|
||||
#!/bin/bash
|
||||
logrotate -f /opt/so/conf/log-rotate.conf >/dev/null 2>&1
|
||||
BIN
salt/common/files/analyst/so-lockscreen.jpg
Normal file
BIN
salt/common/files/analyst/so-lockscreen.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 269 KiB |
1
salt/common/files/analyst/so-login-logo-dark.svg
Normal file
1
salt/common/files/analyst/so-login-logo-dark.svg
Normal file
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 87.86 105.22"><defs><style>.cls-1{fill:#fff;}.cls-2{fill:#1976d2;}</style></defs><g id="Layer_2" data-name="Layer 2"><g id="Layer_1-2" data-name="Layer 1"><g id="Onion"><path id="Flesh" class="cls-1" d="M43.37,71.34a1.27,1.27,0,0,0,.44-.51,4.74,4.74,0,0,0,.61-2.39c-.12-6.79-.22-12.88-4-14.46-4.05-1.72-9.38,3.14-10.71,4.35a19.84,19.84,0,0,0-6.17,12.34c-.1,1-.76,9.34,5.46,15.41s15.45,6.06,21.72,3.53A22.25,22.25,0,0,0,61.88,79.16c5.31-10,1.61-20.31.85-22.3C57.78,44,43.35,36.11,29.88,36.78c-2.17.11-15.82,1-24.16,12.42A30.55,30.55,0,0,0,0,67.36c.15,16.14,13.38,29.51,26.23,34.7,12.61,5.1,24,2.76,28.78,1.65s17.12-4,25.53-15.08a34.47,34.47,0,0,0,7.24-18.46,34.79,34.79,0,0,0-3.42-17.32c-1.11-2.3-6.16-12.09-17-17C57,31.21,48.52,34.37,45.65,29.12a8.46,8.46,0,0,1-.41-6.21,1,1,0,0,0-1.05-1.28l-1.6,0a1.07,1.07,0,0,0-1,.8c-.66,2.51-1.12,6,.51,9.17C46,39.08,56.87,35.31,67.56,42.78c8.29,5.79,14.14,16.69,13.21,27.29a28.06,28.06,0,0,1-6,14.65c-7,9-17,11.29-21.82,12.38-4,.9-13.19,2.87-23.54-.93-2.65-1-20.33-8.29-22.38-25C5.72,60.55,13,48.9,24.21,44.93c13-4.6,27.26,2.75,32.09,13.26.58,1.25,4.85,10.93-.59,18.72-4.05,5.79-13.07,9.94-19.77,6A13.48,13.48,0,0,1,30,68.25c1.42-5,6.37-8.72,8.13-7.84s2.94,6.14,3,9.85A1.39,1.39,0,0,0,43.37,71.34Z"/><path id="Stem" class="cls-2" d="M30,27.14l-4.17,1.27a1.16,1.16,0,0,1-1.49-.93l-.11-.72a26.93,26.93,0,0,0-4.53-11.09A1.13,1.13,0,0,1,20.06,14l1.06-.63a1.15,1.15,0,0,1,1.52.32c.41.58.82,1.17,1.23,1.78l1.48,2.2C28.42,7.27,37.14.12,46.21,0,58.09-.16,65.59,10.67,68,17.63a23.37,23.37,0,0,1,.94,3.64.91.91,0,0,1-1.14,1l-2.66-.73a1.47,1.47,0,0,1-1-1.08,19.71,19.71,0,0,0-1.9-4.8c-3-5.44-9.67-11.21-16.55-10.59-7.74.7-15.22,9.46-14.85,20.91A1.14,1.14,0,0,1,30,27.14Z"/></g></g></g></svg>
|
||||
|
After Width: | Height: | Size: 1.7 KiB |
1
salt/common/files/analyst/so-login-logo.svg
Normal file
1
salt/common/files/analyst/so-login-logo.svg
Normal file
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 87.86 105.22"><defs><style>.cls-1{fill:#1976d2;}</style></defs><g id="Layer_2" data-name="Layer 2"><g id="Layer_1-2" data-name="Layer 1"><g id="Onion"><path id="Flesh" d="M43.37,71.34a1.27,1.27,0,0,0,.44-.51,4.74,4.74,0,0,0,.61-2.39c-.12-6.79-.22-12.88-4-14.46-4.05-1.72-9.38,3.14-10.71,4.35a19.84,19.84,0,0,0-6.17,12.34c-.1,1-.76,9.34,5.46,15.41s15.45,6.06,21.72,3.53A22.25,22.25,0,0,0,61.88,79.16c5.31-10,1.61-20.31.85-22.3C57.78,44,43.35,36.11,29.88,36.78c-2.17.11-15.82,1-24.16,12.42A30.55,30.55,0,0,0,0,67.36c.15,16.14,13.38,29.51,26.23,34.7,12.61,5.1,24,2.76,28.78,1.65s17.12-4,25.53-15.08a34.47,34.47,0,0,0,7.24-18.46,34.79,34.79,0,0,0-3.42-17.32c-1.11-2.3-6.16-12.09-17-17C57,31.21,48.52,34.37,45.65,29.12a8.46,8.46,0,0,1-.41-6.21,1,1,0,0,0-1.05-1.28l-1.6,0a1.07,1.07,0,0,0-1,.8c-.66,2.51-1.12,6,.51,9.17C46,39.08,56.87,35.31,67.56,42.78c8.29,5.79,14.14,16.69,13.21,27.29a28.06,28.06,0,0,1-6,14.65c-7,9-17,11.29-21.82,12.38-4,.9-13.19,2.87-23.54-.93-2.65-1-20.33-8.29-22.38-25C5.72,60.55,13,48.9,24.21,44.93c13-4.6,27.26,2.75,32.09,13.26.58,1.25,4.85,10.93-.59,18.72-4.05,5.79-13.07,9.94-19.77,6A13.48,13.48,0,0,1,30,68.25c1.42-5,6.37-8.72,8.13-7.84s2.94,6.14,3,9.85A1.39,1.39,0,0,0,43.37,71.34Z"/><path id="Stem" class="cls-1" d="M30,27.14l-4.17,1.27a1.16,1.16,0,0,1-1.49-.93l-.11-.72a26.93,26.93,0,0,0-4.53-11.09A1.13,1.13,0,0,1,20.06,14l1.06-.63a1.15,1.15,0,0,1,1.52.32c.41.58.82,1.17,1.23,1.78l1.48,2.2C28.42,7.27,37.14.12,46.21,0,58.09-.16,65.59,10.67,68,17.63a23.37,23.37,0,0,1,.94,3.64.91.91,0,0,1-1.14,1l-2.66-.73a1.47,1.47,0,0,1-1-1.08,19.71,19.71,0,0,0-1.9-4.8c-3-5.44-9.67-11.21-16.55-10.59-7.74.7-15.22,9.46-14.85,20.91A1.14,1.14,0,0,1,30,27.14Z"/></g></g></g></svg>
|
||||
|
After Width: | Height: | Size: 1.7 KiB |
BIN
salt/common/files/analyst/so-wallpaper.jpg
Normal file
BIN
salt/common/files/analyst/so-wallpaper.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 319 KiB |
24
salt/common/files/log-rotate.conf
Normal file
24
salt/common/files/log-rotate.conf
Normal file
@@ -0,0 +1,24 @@
|
||||
{%- set logrotate_conf = salt['pillar.get']('logrotate:conf') %}
|
||||
|
||||
/opt/so/log/aptcacher-ng/*.log
|
||||
/opt/so/log/idstools/*.log
|
||||
/opt/so/log/nginx/*.log
|
||||
/opt/so/log/soc/*.log
|
||||
/opt/so/log/kratos/*.log
|
||||
/opt/so/log/kibana/*.log
|
||||
/opt/so/log/influxdb/*.log
|
||||
/opt/so/log/elastalert/*.log
|
||||
/opt/so/log/soctopus/*.log
|
||||
/opt/so/log/curator/*.log
|
||||
/opt/so/log/fleet/*.log
|
||||
/opt/so/log/suricata/*.log
|
||||
/opt/so/log/mysql/*.log
|
||||
/opt/so/log/playbook/*.log
|
||||
/opt/so/log/logstash/*.log
|
||||
/opt/so/log/filebeat/*.log
|
||||
/opt/so/log/telegraf/*.log
|
||||
/opt/so/log/redis/*.log
|
||||
/opt/so/log/salt/so-salt-minion-check
|
||||
{
|
||||
{{ logrotate_conf | indent(width=4) }}
|
||||
}
|
||||
@@ -32,6 +32,18 @@ soconfperms:
|
||||
- gid: 939
|
||||
- dir_mode: 770
|
||||
|
||||
sostatusconf:
|
||||
file.directory:
|
||||
- name: /opt/so/conf/so-status
|
||||
- uid: 939
|
||||
- gid: 939
|
||||
- dir_mode: 770
|
||||
|
||||
so-status.conf:
|
||||
file.touch:
|
||||
- name: /opt/so/conf/so-status/so-status.conf
|
||||
- unless: ls /opt/so/conf/so-status/so-status.conf
|
||||
|
||||
sosaltstackperms:
|
||||
file.directory:
|
||||
- name: /opt/so/saltstack
|
||||
@@ -56,6 +68,12 @@ salttmp:
|
||||
|
||||
# Install epel
|
||||
{% if grains['os'] == 'CentOS' %}
|
||||
repair_yumdb:
|
||||
cmd.run:
|
||||
- name: 'mv -f /var/lib/rpm/__db* /tmp && yum clean all'
|
||||
- onlyif:
|
||||
- 'yum check-update 2>&1 | grep "Error: rpmdb open failed"'
|
||||
|
||||
epel:
|
||||
pkg.installed:
|
||||
- skip_suggestions: True
|
||||
@@ -152,8 +170,8 @@ Etc/UTC:
|
||||
utilsyncscripts:
|
||||
file.recurse:
|
||||
- name: /usr/sbin
|
||||
- user: 0
|
||||
- group: 0
|
||||
- user: root
|
||||
- group: root
|
||||
- file_mode: 755
|
||||
- template: jinja
|
||||
- source: salt://common/tools/sbin
|
||||
@@ -192,6 +210,40 @@ sensorrotateconf:
|
||||
|
||||
{% endif %}
|
||||
|
||||
commonlogrotatescript:
|
||||
file.managed:
|
||||
- name: /usr/local/bin/common-rotate
|
||||
- source: salt://common/cron/common-rotate
|
||||
- mode: 755
|
||||
|
||||
commonlogrotateconf:
|
||||
file.managed:
|
||||
- name: /opt/so/conf/log-rotate.conf
|
||||
- source: salt://common/files/log-rotate.conf
|
||||
- template: jinja
|
||||
- mode: 644
|
||||
|
||||
/usr/local/bin/common-rotate:
|
||||
cron.present:
|
||||
- user: root
|
||||
- minute: '1'
|
||||
- hour: '0'
|
||||
- daymonth: '*'
|
||||
- month: '*'
|
||||
- dayweek: '*'
|
||||
|
||||
{% if role in ['eval', 'manager', 'managersearch', 'standalone'] %}
|
||||
# Add config backup
|
||||
/usr/sbin/so-config-backup > /dev/null 2>&1:
|
||||
cron.present:
|
||||
- user: root
|
||||
- minute: '1'
|
||||
- hour: '0'
|
||||
- daymonth: '*'
|
||||
- month: '*'
|
||||
- dayweek: '*'
|
||||
{% endif %}
|
||||
|
||||
# Make sure Docker is always running
|
||||
docker:
|
||||
service.running:
|
||||
@@ -203,4 +255,4 @@ common_state_not_allowed:
|
||||
test.fail_without_changes:
|
||||
- name: common_state_not_allowed
|
||||
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
{% set docker = {
|
||||
'containers': [
|
||||
'so-domainstats'
|
||||
]
|
||||
} %}
|
||||
@@ -1,20 +0,0 @@
|
||||
{% set docker = {
|
||||
'containers': [
|
||||
'so-filebeat',
|
||||
'so-nginx',
|
||||
'so-telegraf',
|
||||
'so-dockerregistry',
|
||||
'so-soc',
|
||||
'so-kratos',
|
||||
'so-idstools',
|
||||
'so-elasticsearch',
|
||||
'so-kibana',
|
||||
'so-steno',
|
||||
'so-suricata',
|
||||
'so-zeek',
|
||||
'so-curator',
|
||||
'so-elastalert',
|
||||
'so-soctopus',
|
||||
'so-sensoroni'
|
||||
]
|
||||
} %}
|
||||
@@ -1,10 +0,0 @@
|
||||
{% set docker = {
|
||||
'containers': [
|
||||
'so-mysql',
|
||||
'so-fleet',
|
||||
'so-redis',
|
||||
'so-filebeat',
|
||||
'so-nginx',
|
||||
'so-telegraf'
|
||||
]
|
||||
} %}
|
||||
@@ -1,7 +0,0 @@
|
||||
{% set docker = {
|
||||
'containers': [
|
||||
'so-mysql',
|
||||
'so-fleet',
|
||||
'so-redis'
|
||||
]
|
||||
} %}
|
||||
@@ -1,5 +0,0 @@
|
||||
{% set docker = {
|
||||
'containers': [
|
||||
'so-freqserver'
|
||||
]
|
||||
} %}
|
||||
@@ -1,6 +0,0 @@
|
||||
{% set docker = {
|
||||
'containers': [
|
||||
'so-influxdb',
|
||||
'so-grafana'
|
||||
]
|
||||
} %}
|
||||
@@ -1,15 +0,0 @@
|
||||
{% set docker = {
|
||||
'containers': [
|
||||
'so-nginx',
|
||||
'so-telegraf',
|
||||
'so-redis',
|
||||
'so-logstash',
|
||||
'so-elasticsearch',
|
||||
'so-curator',
|
||||
'so-steno',
|
||||
'so-suricata',
|
||||
'so-wazuh',
|
||||
'so-filebeat',
|
||||
'so-sensoroni'
|
||||
]
|
||||
} %}
|
||||
@@ -1,12 +0,0 @@
|
||||
{% set docker = {
|
||||
'containers': [
|
||||
'so-nginx',
|
||||
'so-telegraf',
|
||||
'so-idstools',
|
||||
'so-steno',
|
||||
'so-zeek',
|
||||
'so-redis',
|
||||
'so-logstash',
|
||||
'so-filebeat
|
||||
]
|
||||
} %}
|
||||
@@ -1,9 +0,0 @@
|
||||
{% set docker = {
|
||||
'containers': [
|
||||
'so-nginx',
|
||||
'so-telegraf',
|
||||
'so-logstash',
|
||||
'so-elasticsearch',
|
||||
'so-curator',
|
||||
]
|
||||
} %}
|
||||
@@ -1,10 +0,0 @@
|
||||
{% set docker = {
|
||||
'containers': [
|
||||
'so-filebeat',
|
||||
'so-nginx',
|
||||
'so-soc',
|
||||
'so-kratos',
|
||||
'so-elasticsearch',
|
||||
'so-kibana'
|
||||
]
|
||||
} %}
|
||||
@@ -1,18 +0,0 @@
|
||||
{% set docker = {
|
||||
'containers': [
|
||||
'so-dockerregistry',
|
||||
'so-nginx',
|
||||
'so-telegraf',
|
||||
'so-soc',
|
||||
'so-kratos',
|
||||
'so-aptcacherng',
|
||||
'so-idstools',
|
||||
'so-redis',
|
||||
'so-elasticsearch',
|
||||
'so-logstash',
|
||||
'so-kibana',
|
||||
'so-elastalert',
|
||||
'so-filebeat',
|
||||
'so-soctopus'
|
||||
]
|
||||
} %}
|
||||
@@ -1,18 +0,0 @@
|
||||
{% set docker = {
|
||||
'containers': [
|
||||
'so-nginx',
|
||||
'so-telegraf',
|
||||
'so-soc',
|
||||
'so-kratos',
|
||||
'so-aptcacherng',
|
||||
'so-idstools',
|
||||
'so-redis',
|
||||
'so-logstash',
|
||||
'so-elasticsearch',
|
||||
'so-curator',
|
||||
'so-kibana',
|
||||
'so-elastalert',
|
||||
'so-filebeat',
|
||||
'so-soctopus'
|
||||
]
|
||||
} %}
|
||||
@@ -1,5 +0,0 @@
|
||||
{% set docker = {
|
||||
'containers': [
|
||||
'so-zeek'
|
||||
]
|
||||
} %}
|
||||
@@ -1,5 +0,0 @@
|
||||
{% set docker = {
|
||||
'containers': [
|
||||
'so-playbook'
|
||||
]
|
||||
} %}
|
||||
@@ -1,10 +0,0 @@
|
||||
{% set docker = {
|
||||
'containers': [
|
||||
'so-nginx',
|
||||
'so-telegraf',
|
||||
'so-logstash',
|
||||
'so-elasticsearch',
|
||||
'so-curator',
|
||||
'so-filebeat'
|
||||
]
|
||||
} %}
|
||||
@@ -1,9 +0,0 @@
|
||||
{% set docker = {
|
||||
'containers': [
|
||||
'so-telegraf',
|
||||
'so-steno',
|
||||
'so-suricata',
|
||||
'so-filebeat',
|
||||
'so-sensoroni'
|
||||
]
|
||||
} %}
|
||||
@@ -1,48 +0,0 @@
|
||||
{% set role = grains.id.split('_') | last %}
|
||||
{% from 'common/maps/'~ role ~'.map.jinja' import docker with context %}
|
||||
|
||||
# Check if the service is enabled and append it's required containers
|
||||
# to the list predefined by the role / minion id affix
|
||||
{% macro append_containers(pillar_name, k, compare )%}
|
||||
{% if salt['pillar.get'](pillar_name~':'~k, {}) != compare %}
|
||||
{% if k == 'enabled' %}
|
||||
{% set k = pillar_name %}
|
||||
{% endif %}
|
||||
{% from 'common/maps/'~k~'.map.jinja' import docker as d with context %}
|
||||
{% for li in d['containers'] %}
|
||||
{{ docker['containers'].append(li) }}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% endmacro %}
|
||||
|
||||
{% set docker = salt['grains.filter_by']({
|
||||
'*_'~role: {
|
||||
'containers': docker['containers']
|
||||
}
|
||||
},grain='id', merge=salt['pillar.get']('docker')) %}
|
||||
|
||||
{% if role in ['eval', 'managersearch', 'manager', 'standalone'] %}
|
||||
{{ append_containers('manager', 'grafana', 0) }}
|
||||
{{ append_containers('global', 'fleet_manager', 0) }}
|
||||
{{ append_containers('global', 'wazuh', 0) }}
|
||||
{{ append_containers('manager', 'thehive', 0) }}
|
||||
{{ append_containers('manager', 'playbook', 0) }}
|
||||
{{ append_containers('manager', 'freq', 0) }}
|
||||
{{ append_containers('manager', 'domainstats', 0) }}
|
||||
{% endif %}
|
||||
|
||||
{% if role in ['eval', 'heavynode', 'sensor', 'standalone'] %}
|
||||
{{ append_containers('strelka', 'enabled', 0) }}
|
||||
{% endif %}
|
||||
|
||||
{% if role in ['heavynode', 'standalone'] %}
|
||||
{{ append_containers('global', 'mdengine', 'SURICATA') }}
|
||||
{% endif %}
|
||||
|
||||
{% if role == 'searchnode' %}
|
||||
{{ append_containers('manager', 'wazuh', 0) }}
|
||||
{% endif %}
|
||||
|
||||
{% if role == 'sensor' %}
|
||||
{{ append_containers('global', 'mdengine', 'SURICATA') }}
|
||||
{% endif %}
|
||||
@@ -1,22 +0,0 @@
|
||||
{% set docker = {
|
||||
'containers': [
|
||||
'so-nginx',
|
||||
'so-telegraf',
|
||||
'so-soc',
|
||||
'so-kratos',
|
||||
'so-aptcacherng',
|
||||
'so-idstools',
|
||||
'so-redis',
|
||||
'so-logstash',
|
||||
'so-elasticsearch',
|
||||
'so-curator',
|
||||
'so-kibana',
|
||||
'so-elastalert',
|
||||
'so-filebeat',
|
||||
'so-suricata',
|
||||
'so-steno',
|
||||
'so-dockerregistry',
|
||||
'so-soctopus',
|
||||
'so-sensoroni'
|
||||
]
|
||||
} %}
|
||||
@@ -1,9 +0,0 @@
|
||||
{% set docker = {
|
||||
'containers': [
|
||||
'so-strelka-coordinator',
|
||||
'so-strelka-gatekeeper',
|
||||
'so-strelka-manager',
|
||||
'so-strelka-frontend',
|
||||
'so-strelka-filestream'
|
||||
]
|
||||
} %}
|
||||
@@ -1,7 +0,0 @@
|
||||
{% set docker = {
|
||||
'containers': [
|
||||
'so-thehive',
|
||||
'so-thehive-es',
|
||||
'so-cortex'
|
||||
]
|
||||
} %}
|
||||
@@ -1,7 +0,0 @@
|
||||
{% set docker = {
|
||||
'containers': [
|
||||
'so-nginx',
|
||||
'so-telegraf',
|
||||
'so-elasticsearch'
|
||||
]
|
||||
} %}
|
||||
@@ -1,5 +0,0 @@
|
||||
{% set docker = {
|
||||
'containers': [
|
||||
'so-wazuh'
|
||||
]
|
||||
} %}
|
||||
@@ -1,8 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [ ! -f /opt/so/state/dockernet.state ]; then
|
||||
docker network create -d bridge so-elastic-net
|
||||
touch /opt/so/state/dockernet.state
|
||||
else
|
||||
exit
|
||||
fi
|
||||
23
salt/common/tools/sbin/so-allow-view
Executable file
23
salt/common/tools/sbin/so-allow-view
Executable file
@@ -0,0 +1,23 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Copyright 2014,2015,2016,2017,2018,2019,2020 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 ""
|
||||
echo "Hosts/Networks that have access to login to the Security Onion Console:"
|
||||
|
||||
so-firewall includedhosts analyst
|
||||
309
salt/common/tools/sbin/so-analyst-install
Executable file
309
salt/common/tools/sbin/so-analyst-install
Executable file
@@ -0,0 +1,309 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Copyright 2014-2020 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 [ "$(id -u)" -ne 0 ]; then
|
||||
echo "This script must be run using sudo!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
INSTALL_LOG=/root/so-analyst-install.log
|
||||
exec &> >(tee -a "$INSTALL_LOG")
|
||||
|
||||
log() {
|
||||
msg=$1
|
||||
level=${2:-I}
|
||||
now=$(TZ=GMT date +"%Y-%m-%dT%H:%M:%SZ")
|
||||
echo -e "$now | $level | $msg" >> "$INSTALL_LOG" 2>&1
|
||||
}
|
||||
|
||||
error() {
|
||||
log "$1" "E"
|
||||
}
|
||||
|
||||
info() {
|
||||
log "$1" "I"
|
||||
}
|
||||
|
||||
title() {
|
||||
echo -e "\n-----------------------------\n $1\n-----------------------------\n" >> "$INSTALL_LOG" 2>&1
|
||||
}
|
||||
|
||||
logCmd() {
|
||||
cmd=$1
|
||||
info "Executing command: $cmd"
|
||||
$cmd >> "$INSTALL_LOG" 2>&1
|
||||
}
|
||||
|
||||
analyze_system() {
|
||||
title "System Characteristics"
|
||||
logCmd "uptime"
|
||||
logCmd "uname -a"
|
||||
logCmd "free -h"
|
||||
logCmd "lscpu"
|
||||
logCmd "df -h"
|
||||
logCmd "ip a"
|
||||
}
|
||||
|
||||
analyze_system
|
||||
|
||||
OS=$(grep PRETTY_NAME /etc/os-release | grep 'CentOS Linux 7')
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "This is an unsupported OS. Please use CentOS 7 to install the analyst node."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ "$manufacturer" == "Security Onion Solutions" && "$family" == "Automated" ]]; then
|
||||
INSTALL=yes
|
||||
CURLCONTINUE=no
|
||||
else
|
||||
INSTALL=''
|
||||
CURLCONTINUE=''
|
||||
fi
|
||||
|
||||
FIRSTPASS=yes
|
||||
while [[ $INSTALL != "yes" ]] && [[ $INSTALL != "no" ]]; do
|
||||
if [[ "$FIRSTPASS" == "yes" ]]; then
|
||||
clear
|
||||
echo "###########################################"
|
||||
echo "## ** W A R N I N G ** ##"
|
||||
echo "## _______________________________ ##"
|
||||
echo "## ##"
|
||||
echo "## Installing the Security Onion ##"
|
||||
echo "## analyst node on this device will ##"
|
||||
echo "## make permanenet changes to ##"
|
||||
echo "## the system. ##"
|
||||
echo "## ##"
|
||||
echo "###########################################"
|
||||
echo "Do you wish to continue? (Type the entire word 'yes' to proceed or 'no' to exit)"
|
||||
FIRSTPASS=no
|
||||
else
|
||||
echo "Please type 'yes' to continue or 'no' to exit."
|
||||
fi
|
||||
read INSTALL
|
||||
done
|
||||
|
||||
if [[ $INSTALL == "no" ]]; then
|
||||
echo "Exiting analyst node installation."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
echo "Testing for internet connection with curl https://securityonionsolutions.com/"
|
||||
CANCURL=$(curl -sI https://securityonionsolutions.com/ | grep "200 OK")
|
||||
if [ $? -ne 0 ]; then
|
||||
FIRSTPASS=yes
|
||||
while [[ $CURLCONTINUE != "yes" ]] && [[ $CURLCONTINUE != "no" ]]; do
|
||||
if [[ "$FIRSTPASS" == "yes" ]]; then
|
||||
echo "We could not access https://securityonionsolutions.com/."
|
||||
echo "Since packages are downloaded from the internet, internet acceess is required."
|
||||
echo "If you would like to ignore this warning and continue anyway, please type 'yes'."
|
||||
echo "Otherwise, type 'no' to exit."
|
||||
FIRSTPASS=no
|
||||
else
|
||||
echo "Please type 'yes' to continue or 'no' to exit."
|
||||
fi
|
||||
read CURLCONTINUE
|
||||
done
|
||||
if [[ "$CURLCONTINUE" == "no" ]]; then
|
||||
echo "Exiting analyst node installation."
|
||||
exit 0
|
||||
fi
|
||||
else
|
||||
echo "We were able to curl https://securityonionsolutions.com/."
|
||||
sleep 3
|
||||
fi
|
||||
|
||||
# Install a GUI text editor
|
||||
yum -y install gedit
|
||||
|
||||
# Install misc utils
|
||||
yum -y install wget curl unzip epel-release yum-plugin-versionlock;
|
||||
|
||||
# Install xWindows
|
||||
yum -y groupinstall "X Window System";
|
||||
yum -y install gnome-classic-session gnome-terminal nautilus-open-terminal control-center liberation-mono-fonts;
|
||||
unlink /etc/systemd/system/default.target;
|
||||
ln -sf /lib/systemd/system/graphical.target /etc/systemd/system/default.target;
|
||||
yum -y install file-roller
|
||||
|
||||
# Install Mono - prereq for NetworkMiner
|
||||
yum -y install mono-core mono-basic mono-winforms expect
|
||||
|
||||
# Install NetworkMiner
|
||||
yum -y install libcanberra-gtk2;
|
||||
wget https://www.netresec.com/?download=NetworkMiner -O /tmp/nm.zip;
|
||||
mkdir -p /opt/networkminer/
|
||||
unzip /tmp/nm.zip -d /opt/networkminer/;
|
||||
rm /tmp/nm.zip;
|
||||
mv /opt/networkminer/NetworkMiner_*/* /opt/networkminer/
|
||||
chmod +x /opt/networkminer/NetworkMiner.exe;
|
||||
chmod -R go+w /opt/networkminer/AssembledFiles/;
|
||||
chmod -R go+w /opt/networkminer/Captures/;
|
||||
# Create networkminer shim
|
||||
cat << EOF >> /bin/networkminer
|
||||
#!/bin/bash
|
||||
/bin/mono /opt/networkminer/NetworkMiner.exe --noupdatecheck "\$@"
|
||||
EOF
|
||||
chmod +x /bin/networkminer
|
||||
# Convert networkminer ico file to png format
|
||||
yum -y install ImageMagick
|
||||
convert /opt/networkminer/networkminericon.ico /opt/networkminer/networkminericon.png
|
||||
# Create menu entry
|
||||
cat << EOF >> /usr/share/applications/networkminer.desktop
|
||||
[Desktop Entry]
|
||||
Name=NetworkMiner
|
||||
Comment=NetworkMiner
|
||||
Encoding=UTF-8
|
||||
Exec=/bin/networkminer %f
|
||||
Icon=/opt/networkminer/networkminericon-4.png
|
||||
StartupNotify=true
|
||||
Terminal=false
|
||||
X-MultipleArgs=false
|
||||
Type=Application
|
||||
MimeType=application/x-pcap;
|
||||
Categories=Network;
|
||||
EOF
|
||||
|
||||
# Set default monospace font to Liberation
|
||||
cat << EOF >> /etc/fonts/local.conf
|
||||
<match target="pattern">
|
||||
<test name="family" qual="any">
|
||||
<string>monospace</string>
|
||||
</test>
|
||||
<edit binding="strong" mode="prepend" name="family">
|
||||
<string>Liberation Mono</string>
|
||||
</edit>
|
||||
</match>
|
||||
EOF
|
||||
|
||||
# Install Wireshark for Gnome
|
||||
yum -y install wireshark-gnome;
|
||||
|
||||
# Install dnsiff
|
||||
yum -y install dsniff;
|
||||
|
||||
# Install hping3
|
||||
yum -y install hping3;
|
||||
|
||||
# Install netsed
|
||||
yum -y install netsed;
|
||||
|
||||
# Install ngrep
|
||||
yum -y install ngrep;
|
||||
|
||||
# Install scapy
|
||||
yum -y install python36-scapy;
|
||||
|
||||
# Install ssldump
|
||||
yum -y install ssldump;
|
||||
|
||||
# Install tcpdump
|
||||
yum -y install tcpdump;
|
||||
|
||||
# Install tcpflow
|
||||
yum -y install tcpflow;
|
||||
|
||||
# Install tcpxtract
|
||||
yum -y install tcpxtract;
|
||||
|
||||
# Install whois
|
||||
yum -y install whois;
|
||||
|
||||
# Install foremost
|
||||
yum -y install https://forensics.cert.org/centos/cert/7/x86_64//foremost-1.5.7-13.1.el7.x86_64.rpm;
|
||||
|
||||
# Install chromium
|
||||
yum -y install chromium;
|
||||
|
||||
# Install tcpstat
|
||||
yum -y install https://github.com/Security-Onion-Solutions/securityonion-docker-rpm/releases/download/securityonion-tcpstat-1.5.0/securityonion-tcpstat-1.5.0.rpm;
|
||||
|
||||
# Install tcptrace
|
||||
yum -y install https://github.com/Security-Onion-Solutions/securityonion-docker-rpm/releases/download/securityonion-tcptrace-6.6.7/securityonion-tcptrace-6.6.7.rpm;
|
||||
|
||||
# Install sslsplit
|
||||
yum -y install libevent;
|
||||
yum -y install sslsplit;
|
||||
|
||||
# Install Bit-Twist
|
||||
yum -y install https://github.com/Security-Onion-Solutions/securityonion-docker-rpm/releases/download/securityonion-bittwist-2.0.0/securityonion-bittwist-2.0.0.rpm;
|
||||
|
||||
# Install chaosreader
|
||||
yum -y install perl-IO-Compress perl-Net-DNS;
|
||||
yum -y install https://github.com/Security-Onion-Solutions/securityonion-docker-rpm/releases/download/securityonion-chaosreader-0.95.10/securityonion-chaosreader-0.95.10.rpm;
|
||||
chmod +x /bin/chaosreader;
|
||||
|
||||
if [ -f ../../files/analyst/README ]; then
|
||||
cp ../../files/analyst/README /;
|
||||
cp ../../files/analyst/so-wallpaper.jpg /usr/share/backgrounds/;
|
||||
cp ../../files/analyst/so-lockscreen.jpg /usr/share/backgrounds/;
|
||||
cp ../../files/analyst/so-login-logo-dark.svg /usr/share/pixmaps/;
|
||||
else
|
||||
cp /opt/so/saltstack/default/salt/common/files/analyst/README /;
|
||||
cp /opt/so/saltstack/default/salt/common/files/analyst/so-wallpaper.jpg /usr/share/backgrounds/;
|
||||
cp /opt/so/saltstack/default/salt/common/files/analyst/so-lockscreen.jpg /usr/share/backgrounds/;
|
||||
cp /opt/so/saltstack/default/salt/common/files/analyst/so-login-logo-dark.svg /usr/share/pixmaps/;
|
||||
fi
|
||||
|
||||
# Set background wallpaper
|
||||
cat << EOF >> /etc/dconf/db/local.d/00-background
|
||||
# Specify the dconf path
|
||||
[org/gnome/desktop/background]
|
||||
|
||||
# Specify the path to the desktop background image file
|
||||
picture-uri='file:///usr/share/backgrounds/so-wallpaper.jpg'
|
||||
# Specify one of the rendering options for the background image:
|
||||
# 'none', 'wallpaper', 'centered', 'scaled', 'stretched', 'zoom', 'spanned'
|
||||
picture-options='zoom'
|
||||
# Specify the left or top color when drawing gradients or the solid color
|
||||
primary-color='000000'
|
||||
# Specify the right or bottom color when drawing gradients
|
||||
secondary-color='FFFFFF'
|
||||
EOF
|
||||
|
||||
# Set lock screen
|
||||
cat << EOF >> /etc/dconf/db/local.d/00-screensaver
|
||||
[org/gnome/desktop/session]
|
||||
idle-delay=uint32 180
|
||||
|
||||
[org/gnome/desktop/screensaver]
|
||||
lock-enabled=true
|
||||
lock-delay=uint32 120
|
||||
picture-options='zoom'
|
||||
picture-uri='file:///usr/share/backgrounds/so-lockscreen.jpg'
|
||||
EOF
|
||||
|
||||
cat << EOF >> /etc/dconf/db/local.d/locks/screensaver
|
||||
/org/gnome/desktop/session/idle-delay
|
||||
/org/gnome/desktop/screensaver/lock-enabled
|
||||
/org/gnome/desktop/screensaver/lock-delay
|
||||
EOF
|
||||
|
||||
# Do not show the user list at login screen
|
||||
cat << EOF >> /etc/dconf/db/local.d/00-login-screen
|
||||
[org/gnome/login-screen]
|
||||
logo='/usr/share/pixmaps/so-login-logo-dark.svg'
|
||||
disable-user-list=true
|
||||
EOF
|
||||
|
||||
dconf update;
|
||||
|
||||
echo
|
||||
echo "Analyst workstation has been installed!"
|
||||
echo "Press ENTER to reboot or Ctrl-C to cancel."
|
||||
read pause
|
||||
|
||||
reboot;
|
||||
@@ -15,12 +15,10 @@
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
IMAGEREPO=securityonion
|
||||
|
||||
# Check for prerequisites
|
||||
if [ "$(id -u)" -ne 0 ]; then
|
||||
echo "This script must be run using sudo!"
|
||||
exit 1
|
||||
echo "This script must be run using sudo!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Define a banner to separate sections
|
||||
@@ -31,17 +29,109 @@ header() {
|
||||
printf '%s\n' "$banner" "$*" "$banner"
|
||||
}
|
||||
|
||||
lookup_salt_value() {
|
||||
key=$1
|
||||
group=$2
|
||||
kind=$3
|
||||
|
||||
if [ -z "$kind" ]; then
|
||||
kind=pillar
|
||||
fi
|
||||
|
||||
if [ -n "$group" ]; then
|
||||
group=${group}:
|
||||
fi
|
||||
|
||||
salt-call --no-color ${kind}.get ${group}${key} --out=newline_values_only
|
||||
}
|
||||
|
||||
lookup_pillar() {
|
||||
key=$1
|
||||
cat /opt/so/saltstack/local/pillar/global.sls | grep $key | awk '{print $2}'
|
||||
key=$1
|
||||
pillar=$2
|
||||
if [ -z "$pillar" ]; then
|
||||
pillar=global
|
||||
fi
|
||||
lookup_salt_value "$key" "$pillar" "pillar"
|
||||
}
|
||||
|
||||
lookup_pillar_secret() {
|
||||
key=$1
|
||||
cat /opt/so/saltstack/local/pillar/secrets.sls | grep $key | awk '{print $2}'
|
||||
lookup_pillar "$1" "secrets"
|
||||
}
|
||||
|
||||
lookup_grain() {
|
||||
lookup_salt_value "$1" "" "grains"
|
||||
}
|
||||
|
||||
lookup_role() {
|
||||
id=$(lookup_grain id)
|
||||
pieces=($(echo $id | tr '_' ' '))
|
||||
echo ${pieces[1]}
|
||||
}
|
||||
|
||||
check_container() {
|
||||
docker ps | grep "$1:" > /dev/null 2>&1
|
||||
return $?
|
||||
}
|
||||
}
|
||||
|
||||
check_password() {
|
||||
local password=$1
|
||||
echo "$password" | egrep -v "'|\"|\\$|\\\\" > /dev/null 2>&1
|
||||
return $?
|
||||
}
|
||||
|
||||
set_os() {
|
||||
if [ -f /etc/redhat-release ]; then
|
||||
OS=centos
|
||||
else
|
||||
OS=ubuntu
|
||||
fi
|
||||
}
|
||||
|
||||
set_minionid() {
|
||||
MINIONID=$(lookup_grain id)
|
||||
}
|
||||
|
||||
set_version() {
|
||||
CURRENTVERSION=0.0.0
|
||||
if [ -f /etc/soversion ]; then
|
||||
CURRENTVERSION=$(cat /etc/soversion)
|
||||
fi
|
||||
if [ -z "$VERSION" ]; then
|
||||
if [ -z "$NEWVERSION" ]; then
|
||||
if [ "$CURRENTVERSION" == "0.0.0" ]; then
|
||||
echo "ERROR: Unable to detect Security Onion version; terminating script."
|
||||
exit 1
|
||||
else
|
||||
VERSION=$CURRENTVERSION
|
||||
fi
|
||||
else
|
||||
VERSION="$NEWVERSION"
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
require_manager() {
|
||||
# Check to see if this is a manager
|
||||
MANAGERCHECK=$(cat /etc/salt/grains | grep role | awk '{print $2}')
|
||||
if [ $MANAGERCHECK == 'so-eval' ] || [ $MANAGERCHECK == 'so-manager' ] || [ $MANAGERCHECK == 'so-managersearch' ] || [ $MANAGERCHECK == 'so-standalone' ] || [ $MANAGERCHECK == 'so-helix' ] || [ $MANAGERCHECK == 'so-import' ]; then
|
||||
echo "This is a manager, We can proceed."
|
||||
else
|
||||
echo "Please run this command on the manager; the manager controls the grid."
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
is_single_node_grid() {
|
||||
role=$(lookup_role)
|
||||
if [ "$role" != "eval" ] && [ "$role" != "standalone" ] && [ "$role" != "import" ]; then
|
||||
return 1
|
||||
fi
|
||||
return 0
|
||||
}
|
||||
|
||||
fail() {
|
||||
msg=$1
|
||||
echo "ERROR: $msg"
|
||||
echo "Exiting."
|
||||
exit 1
|
||||
}
|
||||
|
||||
44
salt/common/tools/sbin/so-config-backup
Executable file
44
salt/common/tools/sbin/so-config-backup
Executable file
@@ -0,0 +1,44 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# Copyright 2014,2015,2016,2017,2018,2019,2020 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 %}
|
||||
|
||||
fi
|
||||
|
||||
# Find oldest backup file and remove it
|
||||
NUMBACKUPS=$(find /nsm/backup/ -type f -name "so-config-backup*" | wc -l)
|
||||
OLDESTBACKUP=$(find /nsm/backup/ -type f -name "so-config-backup*" | ls -1t | tail -1)
|
||||
if [ "$NUMBACKUPS" -gt "$MAXBACKUPS" ]; then
|
||||
rm -f /nsm/backup/$OLDESTBACKUP
|
||||
fi
|
||||
@@ -31,7 +31,7 @@ fi
|
||||
USER=$1
|
||||
|
||||
CORTEX_KEY=$(lookup_pillar cortexkey)
|
||||
CORTEX_IP=$(lookup_pillar managerip)
|
||||
CORTEX_API_URL="$(lookup_pillar url_base)/cortex/api"
|
||||
CORTEX_ORG_NAME=$(lookup_pillar cortexorgname)
|
||||
CORTEX_USER=$USER
|
||||
|
||||
@@ -40,10 +40,10 @@ test -t 0
|
||||
if [[ $? == 0 ]]; then
|
||||
echo "Enter new password:"
|
||||
fi
|
||||
read -s CORTEX_PASS
|
||||
read -rs CORTEX_PASS
|
||||
|
||||
# Create new user in Cortex
|
||||
resp=$(curl -sk -XPOST -H "Authorization: Bearer $CORTEX_KEY" -H "Content-Type: application/json" "https://$CORTEX_IP/cortex/api/user" -d "{\"name\": \"$CORTEX_USER\",\"roles\": [\"read\",\"analyze\",\"orgadmin\"],\"organization\": \"$CORTEX_ORG_NAME\",\"login\": \"$CORTEX_USER\",\"password\" : \"$CORTEX_PASS\" }")
|
||||
resp=$(curl -sk -XPOST -H "Authorization: Bearer $CORTEX_KEY" -H "Content-Type: application/json" -L "https://$CORTEX_API_URL/user" -d "{\"name\": \"$CORTEX_USER\",\"roles\": [\"read\",\"analyze\",\"orgadmin\"],\"organization\": \"$CORTEX_ORG_NAME\",\"login\": \"$CORTEX_USER\",\"password\" : \"$CORTEX_PASS\" }")
|
||||
if [[ "$resp" =~ \"status\":\"Ok\" ]]; then
|
||||
echo "Successfully added user to Cortex."
|
||||
else
|
||||
|
||||
@@ -31,7 +31,7 @@ fi
|
||||
USER=$1
|
||||
|
||||
CORTEX_KEY=$(lookup_pillar cortexkey)
|
||||
CORTEX_IP=$(lookup_pillar managerip)
|
||||
CORTEX_API_URL="$(lookup_pillar url_base)/cortex/api"
|
||||
CORTEX_USER=$USER
|
||||
|
||||
case "${2^^}" in
|
||||
@@ -46,7 +46,7 @@ case "${2^^}" in
|
||||
;;
|
||||
esac
|
||||
|
||||
resp=$(curl -sk -XPATCH -H "Authorization: Bearer $CORTEX_KEY" -H "Content-Type: application/json" "https://$CORTEX_IP/cortex/api/user/${CORTEX_USER}" -d "{\"status\":\"${CORTEX_STATUS}\" }")
|
||||
resp=$(curl -sk -XPATCH -H "Authorization: Bearer $CORTEX_KEY" -H "Content-Type: application/json" -L "https://$CORTEX_API_URL/user/${CORTEX_USER}" -d "{\"status\":\"${CORTEX_STATUS}\" }")
|
||||
if [[ "$resp" =~ \"status\":\"Locked\" || "$resp" =~ \"status\":\"Ok\" ]]; then
|
||||
echo "Successfully updated user in Cortex."
|
||||
else
|
||||
|
||||
@@ -16,96 +16,7 @@
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
. /usr/sbin/so-common
|
||||
. /usr/sbin/so-image-common
|
||||
|
||||
manager_check() {
|
||||
# Check to see if this is a manager
|
||||
MANAGERCHECK=$(cat /etc/salt/grains | grep role | awk '{print $2}')
|
||||
if [ $MANAGERCHECK == 'so-eval' ] || [ $MANAGERCHECK == 'so-manager' ] || [ $MANAGERCHECK == 'so-managersearch' ] || [ $MANAGERCHECK == 'so-standalone' ] || [ $MANAGERCHECK == 'so-helix' ]; then
|
||||
echo "This is a manager. We can proceed"
|
||||
else
|
||||
echo "Please run soup on the manager. The manager controls all updates."
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
update_docker_containers() {
|
||||
|
||||
# Download the containers from the interwebs
|
||||
for i in "${TRUSTED_CONTAINERS[@]}"
|
||||
do
|
||||
# Pull down the trusted docker image
|
||||
echo "Downloading $i"
|
||||
docker pull --disable-content-trust=false docker.io/$IMAGEREPO/$i
|
||||
# Tag it with the new registry destination
|
||||
docker tag $IMAGEREPO/$i $HOSTNAME:5000/$IMAGEREPO/$i
|
||||
docker push $HOSTNAME:5000/$IMAGEREPO/$i
|
||||
done
|
||||
|
||||
}
|
||||
|
||||
version_check() {
|
||||
if [ -f /etc/soversion ]; then
|
||||
VERSION=$(cat /etc/soversion)
|
||||
else
|
||||
echo "Unable to detect version. I will now terminate."
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
manager_check
|
||||
version_check
|
||||
|
||||
# Use the hostname
|
||||
HOSTNAME=$(hostname)
|
||||
# List all the containers
|
||||
if [ $MANAGERCHECK != 'so-helix' ]; then
|
||||
TRUSTED_CONTAINERS=( \
|
||||
"so-acng:$VERSION" \
|
||||
"so-thehive-cortex:$VERSION" \
|
||||
"so-curator:$VERSION" \
|
||||
"so-domainstats:$VERSION" \
|
||||
"so-elastalert:$VERSION" \
|
||||
"so-elasticsearch:$VERSION" \
|
||||
"so-filebeat:$VERSION" \
|
||||
"so-fleet:$VERSION" \
|
||||
"so-fleet-launcher:$VERSION" \
|
||||
"so-freqserver:$VERSION" \
|
||||
"so-grafana:$VERSION" \
|
||||
"so-idstools:$VERSION" \
|
||||
"so-influxdb:$VERSION" \
|
||||
"so-kibana:$VERSION" \
|
||||
"so-kratos:$VERSION" \
|
||||
"so-logstash:$VERSION" \
|
||||
"so-minio:$VERSION" \
|
||||
"so-mysql:$VERSION" \
|
||||
"so-nginx:$VERSION" \
|
||||
"so-pcaptools:$VERSION" \
|
||||
"so-playbook:$VERSION" \
|
||||
"so-redis:$VERSION" \
|
||||
"so-soc:$VERSION" \
|
||||
"so-soctopus:$VERSION" \
|
||||
"so-steno:$VERSION" \
|
||||
"so-strelka-frontend:$VERSION" \
|
||||
"so-strelka-manager:$VERSION" \
|
||||
"so-strelka-backend:$VERSION" \
|
||||
"so-strelka-filestream:$VERSION" \
|
||||
"so-suricata:$VERSION" \
|
||||
"so-telegraf:$VERSION" \
|
||||
"so-thehive:$VERSION" \
|
||||
"so-thehive-es:$VERSION" \
|
||||
"so-wazuh:$VERSION" \
|
||||
"so-zeek:$VERSION" )
|
||||
else
|
||||
TRUSTED_CONTAINERS=( \
|
||||
"so-filebeat:$VERSION" \
|
||||
"so-idstools:$VERSION" \
|
||||
"so-logstash:$VERSION" \
|
||||
"so-nginx:$VERSION" \
|
||||
"so-redis:$VERSION" \
|
||||
"so-steno:$VERSION" \
|
||||
"so-suricata:$VERSION" \
|
||||
"so-telegraf:$VERSION" \
|
||||
"so-zeek:$VERSION" )
|
||||
fi
|
||||
|
||||
update_docker_containers
|
||||
require_manager
|
||||
update_docker_containers "refresh"
|
||||
|
||||
@@ -136,7 +136,4 @@ else
|
||||
echo "Something went wrong..."
|
||||
fi
|
||||
|
||||
echo
|
||||
|
||||
|
||||
|
||||
echo
|
||||
@@ -14,7 +14,7 @@
|
||||
#
|
||||
# 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 MANAGERIP = salt['pillar.get']('global:managerip', '') -%}
|
||||
{%- set NODEIP = salt['pillar.get']('elasticsearch:mainip', '') -%}
|
||||
. /usr/sbin/so-common
|
||||
|
||||
SKIP=0
|
||||
@@ -50,7 +50,11 @@ done
|
||||
if [ $SKIP -ne 1 ]; then
|
||||
# List indices
|
||||
echo
|
||||
curl {{ MANAGERIP }}:9200/_cat/indices?v
|
||||
{% if grains['role'] in ['so-node','so-heavynode'] %}
|
||||
curl -k -L https://{{ NODEIP }}:9200/_cat/indices?v
|
||||
{% else %}
|
||||
curl -L {{ NODEIP }}:9200/_cat/indices?v
|
||||
{% endif %}
|
||||
echo
|
||||
# Inform user we are about to delete all data
|
||||
echo
|
||||
@@ -89,10 +93,18 @@ fi
|
||||
# Delete data
|
||||
echo "Deleting data..."
|
||||
|
||||
INDXS=$(curl -s -XGET {{ MANAGERIP }}:9200/_cat/indices?v | egrep 'logstash|elastalert|so-' | awk '{ print $3 }')
|
||||
{% if grains['role'] in ['so-node','so-heavynode'] %}
|
||||
INDXS=$(curl -s -XGET -k -L https://{{ NODEIP }}:9200/_cat/indices?v | egrep 'logstash|elastalert|so-' | awk '{ print $3 }')
|
||||
{% else %}
|
||||
INDXS=$(curl -s -XGET -L {{ NODEIP }}:9200/_cat/indices?v | egrep 'logstash|elastalert|so-' | awk '{ print $3 }')
|
||||
{% endif %}
|
||||
for INDX in ${INDXS}
|
||||
do
|
||||
curl -XDELETE "{{ MANAGERIP }}:9200/${INDX}" > /dev/null 2>&1
|
||||
{% if grains['role'] in ['so-node','so-heavynode'] %}
|
||||
curl -XDELETE -k -L https://"{{ NODEIP }}:9200/${INDX}" > /dev/null 2>&1
|
||||
{% else %}
|
||||
curl -XDELETE -L "{{ NODEIP }}:9200/${INDX}" > /dev/null 2>&1
|
||||
{% endif %}
|
||||
done
|
||||
|
||||
#Start Logstash/Filebeat
|
||||
|
||||
@@ -22,5 +22,5 @@ THEHIVEESPORT=9400
|
||||
echo "Removing read only attributes for indices..."
|
||||
echo
|
||||
for p in $ESPORT $THEHIVEESPORT; do
|
||||
curl -XPUT -H "Content-Type: application/json" http://$IP:$p/_all/_settings -d '{"index.blocks.read_only_allow_delete": null}' 2>&1 | if grep -q ack; then echo "Index settings updated..."; else echo "There was any issue updating the read-only attribute. Please ensure Elasticsearch is running.";fi;
|
||||
curl -XPUT -H "Content-Type: application/json" -L http://$IP:$p/_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;
|
||||
done
|
||||
|
||||
33
salt/common/tools/sbin/so-elasticsearch-pipeline-stats
Executable file
33
salt/common/tools/sbin/so-elasticsearch-pipeline-stats
Executable file
@@ -0,0 +1,33 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# Copyright 2014,2015,2016,2017,2018,2019,2020 Security Onion Solutions, LLC
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||
{%- set NODEIP = salt['pillar.get']('elasticsearch:mainip', '') -%}
|
||||
|
||||
. /usr/sbin/so-common
|
||||
|
||||
if [ "$1" == "" ]; then
|
||||
{% if grains['role'] in ['so-node','so-heavynode'] %}
|
||||
curl -s -k -L https://{{ NODEIP }}:9200/_nodes/stats | jq .nodes | jq ".[] | .ingest.pipelines"
|
||||
{% else %}
|
||||
curl -s -L {{ NODEIP }}:9200/_nodes/stats | jq .nodes | jq ".[] | .ingest.pipelines"
|
||||
{% endif %}
|
||||
else
|
||||
{% if grains['role'] in ['so-node','so-heavynode'] %}
|
||||
curl -s -k -L https://{{ NODEIP }}:9200/_nodes/stats | jq .nodes | jq ".[] | .ingest.pipelines.\"$1\""
|
||||
{% else %}
|
||||
curl -s -L {{ NODEIP }}:9200/_nodes/stats | jq .nodes | jq ".[] | .ingest.pipelines.\"$1\""
|
||||
{% endif %}
|
||||
fi
|
||||
31
salt/common/tools/sbin/so-elasticsearch-pipelines-list
Executable file
31
salt/common/tools/sbin/so-elasticsearch-pipelines-list
Executable file
@@ -0,0 +1,31 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# Copyright 2014,2015,2016,2017,2018,2019,2020 Security Onion Solutions, LLC
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
{%- set NODEIP = salt['pillar.get']('elasticsearch:mainip', '') -%}
|
||||
. /usr/sbin/so-common
|
||||
if [ "$1" == "" ]; then
|
||||
{% if grains['role'] in ['so-node','so-heavynode'] %}
|
||||
curl -s -k -L https://{{ NODEIP }}:9200/_ingest/pipeline/* | jq 'keys'
|
||||
{% else %}
|
||||
curl -s -L {{ NODEIP }}:9200/_ingest/pipeline/* | jq 'keys'
|
||||
{% endif %}
|
||||
else
|
||||
{% if grains['role'] in ['so-node','so-heavynode'] %}
|
||||
curl -s -k -L https://{{ NODEIP }}:9200/_ingest/pipeline/$1 | jq
|
||||
{% else %}
|
||||
curl -s -L {{ NODEIP }}:9200/_ingest/pipeline/$1 | jq
|
||||
{% endif %}
|
||||
fi
|
||||
31
salt/common/tools/sbin/so-elasticsearch-templates-list
Executable file
31
salt/common/tools/sbin/so-elasticsearch-templates-list
Executable file
@@ -0,0 +1,31 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# Copyright 2014,2015,2016,2017,2018,2019,2020 Security Onion Solutions, LLC
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
{%- set NODEIP = salt['pillar.get']('elasticsearch:mainip', '') -%}
|
||||
. /usr/sbin/so-common
|
||||
if [ "$1" == "" ]; then
|
||||
{% if grains['role'] in ['so-node','so-heavynode'] %}
|
||||
curl -s -k -L https://{{ NODEIP }}:9200/_template/* | jq 'keys'
|
||||
{% else %}
|
||||
curl -s -L {{ NODEIP }}:9200/_template/* | jq 'keys'
|
||||
{% endif %}
|
||||
else
|
||||
{% if grains['role'] in ['so-node','so-heavynode'] %}
|
||||
curl -s -k -L https://{{ NODEIP }}:9200/_template/$1 | jq
|
||||
{% else %}
|
||||
curl -s -L {{ NODEIP }}:9200/_template/$1 | jq
|
||||
{% endif %}
|
||||
fi
|
||||
@@ -30,7 +30,11 @@ echo -n "Waiting for ElasticSearch..."
|
||||
COUNT=0
|
||||
ELASTICSEARCH_CONNECTED="no"
|
||||
while [[ "$COUNT" -le 240 ]]; do
|
||||
curl --output /dev/null --silent --head --fail http://"$ELASTICSEARCH_HOST":"$ELASTICSEARCH_PORT"
|
||||
{% if grains['role'] in ['so-node','so-heavynode'] %}
|
||||
curl -k --output /dev/null --silent --head --fail -L https://"$ELASTICSEARCH_HOST":"$ELASTICSEARCH_PORT"
|
||||
{% else %}
|
||||
curl --output /dev/null --silent --head --fail -L http://"$ELASTICSEARCH_HOST":"$ELASTICSEARCH_PORT"
|
||||
{% endif %}
|
||||
if [ $? -eq 0 ]; then
|
||||
ELASTICSEARCH_CONNECTED="yes"
|
||||
echo "connected!"
|
||||
@@ -51,7 +55,11 @@ cd ${ELASTICSEARCH_TEMPLATES}
|
||||
|
||||
|
||||
echo "Loading templates..."
|
||||
for i in *; do TEMPLATE=$(echo $i | cut -d '-' -f2); echo "so-$TEMPLATE"; curl ${ELASTICSEARCH_AUTH} -s -XPUT http://${ELASTICSEARCH_HOST}:${ELASTICSEARCH_PORT}/_template/so-$TEMPLATE -H 'Content-Type: application/json' -d@$i 2>/dev/null; echo; done
|
||||
{% if grains['role'] in ['so-node','so-heavynode'] %}
|
||||
for i in *; do TEMPLATE=$(echo $i | cut -d '-' -f2); echo "so-$TEMPLATE"; curl -k ${ELASTICSEARCH_AUTH} -s -XPUT -L https://${ELASTICSEARCH_HOST}:${ELASTICSEARCH_PORT}/_template/so-$TEMPLATE -H 'Content-Type: application/json' -d@$i 2>/dev/null; echo; done
|
||||
{% else %}
|
||||
for i in *; do TEMPLATE=$(echo $i | cut -d '-' -f2); echo "so-$TEMPLATE"; curl ${ELASTICSEARCH_AUTH} -s -XPUT -L http://${ELASTICSEARCH_HOST}:${ELASTICSEARCH_PORT}/_template/so-$TEMPLATE -H 'Content-Type: application/json' -d@$i 2>/dev/null; echo; done
|
||||
{% endif %}
|
||||
echo
|
||||
|
||||
cd - >/dev/null
|
||||
@@ -15,6 +15,7 @@
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
. /usr/sbin/so-common
|
||||
. /usr/sbin/so-image-common
|
||||
local_salt_dir=/opt/so/saltstack/local
|
||||
|
||||
cat << EOF
|
||||
@@ -39,34 +40,14 @@ fi
|
||||
|
||||
echo "Please wait while switching to Elastic Features."
|
||||
|
||||
manager_check() {
|
||||
# Check to see if this is a manager
|
||||
MANAGERCHECK=$(cat /etc/salt/grains | grep role | awk '{print $2}')
|
||||
if [[ "$MANAGERCHECK" =~ ^('so-eval'|'so-manager'|'so-standalone'|'so-managersearch')$ ]]; then
|
||||
echo "This is a manager. We can proceed"
|
||||
else
|
||||
echo "Please run so-features-enable on the manager."
|
||||
exit 0
|
||||
fi
|
||||
}
|
||||
require_manager
|
||||
|
||||
TRUSTED_CONTAINERS=( \
|
||||
"so-elasticsearch" \
|
||||
"so-filebeat" \
|
||||
"so-kibana" \
|
||||
"so-logstash" )
|
||||
update_docker_containers "features" "-features"
|
||||
|
||||
manager_check
|
||||
VERSION=$(grep soversion $local_salt_dir/pillar/global.sls | cut -d':' -f2|sed 's/ //g')
|
||||
# Modify global.sls to enable Features
|
||||
sed -i 's/features: False/features: True/' $local_salt_dir/pillar/global.sls
|
||||
SUFFIX="-features"
|
||||
TRUSTED_CONTAINERS=( \
|
||||
"so-elasticsearch:$VERSION$SUFFIX" \
|
||||
"so-filebeat:$VERSION$SUFFIX" \
|
||||
"so-kibana:$VERSION$SUFFIX" \
|
||||
"so-logstash:$VERSION$SUFFIX" )
|
||||
|
||||
for i in "${TRUSTED_CONTAINERS[@]}"
|
||||
do
|
||||
# Pull down the trusted docker image
|
||||
echo "Downloading $i"
|
||||
docker pull --disable-content-trust=false docker.io/$IMAGEREPO/$i
|
||||
# Tag it with the new registry destination
|
||||
docker tag $IMAGEREPO/$i $HOSTNAME:5000/$IMAGEREPO/$i
|
||||
docker push $HOSTNAME:5000/$IMAGEREPO/$i
|
||||
done
|
||||
|
||||
@@ -116,7 +116,7 @@ def addhostgroup(args):
|
||||
print('Missing host group name argument', file=sys.stderr)
|
||||
showUsage(args)
|
||||
|
||||
name = args[1]
|
||||
name = args[0]
|
||||
content = loadYaml(hostgroupsFilename)
|
||||
if name in content['firewall']['hostgroups']:
|
||||
print('Already exists', file=sys.stderr)
|
||||
|
||||
@@ -39,11 +39,16 @@ test -t 0
|
||||
if [[ $? == 0 ]]; then
|
||||
echo "Enter new password:"
|
||||
fi
|
||||
read -s FLEET_PASS
|
||||
read -rs FLEET_PASS
|
||||
|
||||
if ! check_password "$FLEET_PASS"; then
|
||||
echo "Password is invalid. Please exclude single quotes, double quotes and backslashes from the password."
|
||||
exit 2
|
||||
fi
|
||||
|
||||
FLEET_HASH=$(docker exec so-soctopus python -c "import bcrypt; print(bcrypt.hashpw('$FLEET_PASS'.encode('utf-8'), bcrypt.gensalt()).decode('utf-8'));" 2>&1)
|
||||
if [[ $? -ne 0 ]]; then
|
||||
echo "Failed to generate Fleet password hash."
|
||||
echo "Failed to generate Fleet password hash"
|
||||
exit 2
|
||||
fi
|
||||
|
||||
@@ -51,9 +56,9 @@ MYSQL_OUTPUT=$(docker exec so-mysql mysql -u root --password=$MYSQL_PASS fleet -
|
||||
"INSERT INTO users (password,salt,username,email,admin,enabled) VALUES ('$FLEET_HASH','','$FLEET_USER','$FLEET_USER',1,1)" 2>&1)
|
||||
|
||||
if [[ $? -eq 0 ]]; then
|
||||
echo "Successfully added user to Fleet."
|
||||
echo "Successfully added user to Fleet"
|
||||
else
|
||||
echo "Unable to add user to Fleet; user might already exist."
|
||||
echo $resp
|
||||
echo "Unable to add user to Fleet; user might already exist"
|
||||
echo "$MYSQL_OUTPUT"
|
||||
exit 2
|
||||
fi
|
||||
@@ -20,7 +20,7 @@
|
||||
usage() {
|
||||
echo "Usage: $0 <user-name>"
|
||||
echo ""
|
||||
echo "Enables or disables a user in Fleet."
|
||||
echo "Enables or disables a user in Fleet"
|
||||
exit 1
|
||||
}
|
||||
|
||||
@@ -50,9 +50,9 @@ MYSQL_OUTPUT=$(docker exec so-mysql mysql -u root --password=$MYSQL_PASS fleet -
|
||||
"UPDATE users SET enabled=$FLEET_STATUS WHERE username='$FLEET_USER'" 2>&1)
|
||||
|
||||
if [[ $? -eq 0 ]]; then
|
||||
echo "Successfully updated user in Fleet."
|
||||
echo "Successfully updated user in Fleet"
|
||||
else
|
||||
echo "Failed to update user in Fleet."
|
||||
echo "Failed to update user in Fleet"
|
||||
echo $resp
|
||||
exit 2
|
||||
fi
|
||||
175
salt/common/tools/sbin/so-image-common
Executable file
175
salt/common/tools/sbin/so-image-common
Executable file
@@ -0,0 +1,175 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# Copyright 2014,2015,2016,2017,2018,2019,2020 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/>.
|
||||
|
||||
# NOTE: This script depends on so-common
|
||||
IMAGEREPO=securityonion
|
||||
|
||||
container_list() {
|
||||
MANAGERCHECK=$1
|
||||
if [ -z "$MANAGERCHECK" ]; then
|
||||
MANAGERCHECK=so-unknown
|
||||
if [ -f /etc/salt/grains ]; then
|
||||
MANAGERCHECK=$(cat /etc/salt/grains | grep role | awk '{print $2}')
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ $MANAGERCHECK == 'so-import' ]; then
|
||||
TRUSTED_CONTAINERS=( \
|
||||
"so-elasticsearch" \
|
||||
"so-filebeat" \
|
||||
"so-idstools" \
|
||||
"so-kibana" \
|
||||
"so-kratos" \
|
||||
"so-nginx" \
|
||||
"so-pcaptools" \
|
||||
"so-soc" \
|
||||
"so-steno" \
|
||||
"so-suricata" \
|
||||
"so-zeek" )
|
||||
elif [ $MANAGERCHECK != 'so-helix' ]; then
|
||||
TRUSTED_CONTAINERS=( \
|
||||
"so-acng" \
|
||||
"so-curator" \
|
||||
"so-domainstats" \
|
||||
"so-elastalert" \
|
||||
"so-elasticsearch" \
|
||||
"so-filebeat" \
|
||||
"so-fleet" \
|
||||
"so-fleet-launcher" \
|
||||
"so-freqserver" \
|
||||
"so-grafana" \
|
||||
"so-idstools" \
|
||||
"so-influxdb" \
|
||||
"so-kibana" \
|
||||
"so-kratos" \
|
||||
"so-logstash" \
|
||||
"so-minio" \
|
||||
"so-mysql" \
|
||||
"so-nginx" \
|
||||
"so-pcaptools" \
|
||||
"so-playbook" \
|
||||
"so-redis" \
|
||||
"so-soc" \
|
||||
"so-soctopus" \
|
||||
"so-steno" \
|
||||
"so-strelka-backend" \
|
||||
"so-strelka-filestream" \
|
||||
"so-strelka-frontend" \
|
||||
"so-strelka-manager" \
|
||||
"so-suricata" \
|
||||
"so-telegraf" \
|
||||
"so-thehive" \
|
||||
"so-thehive-cortex" \
|
||||
"so-thehive-es" \
|
||||
"so-wazuh" \
|
||||
"so-zeek" )
|
||||
else
|
||||
TRUSTED_CONTAINERS=( \
|
||||
"so-filebeat" \
|
||||
"so-idstools" \
|
||||
"so-logstash" \
|
||||
"so-nginx" \
|
||||
"so-redis" \
|
||||
"so-steno" \
|
||||
"so-suricata" \
|
||||
"so-telegraf" \
|
||||
"so-zeek" )
|
||||
fi
|
||||
}
|
||||
|
||||
update_docker_containers() {
|
||||
local CURLTYPE=$1
|
||||
local IMAGE_TAG_SUFFIX=$2
|
||||
local PROGRESS_CALLBACK=$3
|
||||
local LOG_FILE=$4
|
||||
|
||||
local CONTAINER_REGISTRY=quay.io
|
||||
local SIGNPATH=/root/sosigs
|
||||
|
||||
if [ -z "$CURLTYPE" ]; then
|
||||
CURLTYPE=unknown
|
||||
fi
|
||||
|
||||
if [ -z "$LOG_FILE" ]; then
|
||||
if [ -c /dev/tty ]; then
|
||||
LOG_FILE=/dev/tty
|
||||
else
|
||||
LOG_FILE=/dev/null
|
||||
fi
|
||||
fi
|
||||
|
||||
# Recheck the version for scenarios were the VERSION wasn't known before this script was imported
|
||||
set_version
|
||||
set_os
|
||||
|
||||
if [ -z "$TRUSTED_CONTAINERS" ]; then
|
||||
container_list
|
||||
fi
|
||||
|
||||
# Let's make sure we have the public key
|
||||
curl -sSL https://raw.githubusercontent.com/Security-Onion-Solutions/securityonion/master/KEYS | gpg --import - >> "$LOG_FILE" 2>&1
|
||||
|
||||
rm -rf $SIGNPATH >> "$LOG_FILE" 2>&1
|
||||
mkdir -p $SIGNPATH >> "$LOG_FILE" 2>&1
|
||||
|
||||
# Download the containers from the interwebs
|
||||
for i in "${TRUSTED_CONTAINERS[@]}"
|
||||
do
|
||||
if [ -z "$PROGRESS_CALLBACK" ]; then
|
||||
echo "Downloading $i" >> "$LOG_FILE" 2>&1
|
||||
else
|
||||
$PROGRESS_CALLBACK $i
|
||||
fi
|
||||
|
||||
# Pull down the trusted docker image
|
||||
local image=$i:$VERSION$IMAGE_TAG_SUFFIX
|
||||
docker pull $CONTAINER_REGISTRY/$IMAGEREPO/$image >> "$LOG_FILE" 2>&1
|
||||
|
||||
# Get signature
|
||||
curl -A "$CURLTYPE/$CURRENTVERSION/$OS/$(uname -r)" https://sigs.securityonion.net/$VERSION/$i:$VERSION$IMAGE_TAG_SUFFIX.sig --output $SIGNPATH/$image.sig >> "$LOG_FILE" 2>&1
|
||||
if [[ $? -ne 0 ]]; then
|
||||
echo "Unable to pull signature file for $image" >> "$LOG_FILE" 2>&1
|
||||
exit 1
|
||||
fi
|
||||
# Dump our hash values
|
||||
DOCKERINSPECT=$(docker inspect $CONTAINER_REGISTRY/$IMAGEREPO/$image)
|
||||
|
||||
echo "$DOCKERINSPECT" | jq ".[0].RepoDigests[] | select(. | contains(\"$CONTAINER_REGISTRY\"))" > $SIGNPATH/$image.txt
|
||||
echo "$DOCKERINSPECT" | jq ".[0].Created, .[0].RootFS.Layers" >> $SIGNPATH/$image.txt
|
||||
|
||||
if [[ $? -ne 0 ]]; then
|
||||
echo "Unable to inspect $image" >> "$LOG_FILE" 2>&1
|
||||
exit 1
|
||||
fi
|
||||
GPGTEST=$(gpg --verify $SIGNPATH/$image.sig $SIGNPATH/$image.txt 2>&1)
|
||||
if [[ $? -eq 0 ]]; then
|
||||
if [[ -z "$SKIP_TAGPUSH" ]]; then
|
||||
# Tag it with the new registry destination
|
||||
if [ -z "$HOSTNAME" ]; then
|
||||
HOSTNAME=$(hostname)
|
||||
fi
|
||||
docker tag $CONTAINER_REGISTRY/$IMAGEREPO/$image $HOSTNAME:5000/$IMAGEREPO/$image >> "$LOG_FILE" 2>&1
|
||||
docker push $HOSTNAME:5000/$IMAGEREPO/$image >> "$LOG_FILE" 2>&1
|
||||
fi
|
||||
else
|
||||
echo "There is a problem downloading the $image image. Details: " >> "$LOG_FILE" 2>&1
|
||||
echo "" >> "$LOG_FILE" 2>&1
|
||||
echo $GPGTEST >> "$LOG_FILE" 2>&1
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
}
|
||||
@@ -15,4 +15,8 @@
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
curl -X GET "localhost:9200/_cat/indices?v"
|
||||
{% if grains['role'] in ['so-node','so-heavynode'] %}
|
||||
curl -X GET -k -L https://localhost:9200/_cat/indices?v
|
||||
{% else %}
|
||||
curl -X GET -L localhost:9200/_cat/indices?v
|
||||
{% endif %}
|
||||
|
||||
59
salt/common/tools/sbin/so-ip-update
Normal file
59
salt/common/tools/sbin/so-ip-update
Normal file
@@ -0,0 +1,59 @@
|
||||
#!/bin/bash
|
||||
|
||||
. $(dirname $0)/so-common
|
||||
|
||||
if [ "$FORCE_IP_UPDATE" != "1" ]; then
|
||||
is_single_node_grid || fail "Cannot update the IP on a distributed grid"
|
||||
fi
|
||||
|
||||
echo "This tool will update a manager's IP address to the new IP assigned to the management network interface."
|
||||
|
||||
echo
|
||||
echo "WARNING: This tool is still undergoing testing, use at your own risk!"
|
||||
echo
|
||||
|
||||
if [ -z "$OLD_IP" ]; then
|
||||
OLD_IP=$(lookup_pillar "managerip")
|
||||
|
||||
if [ -z "$OLD_IP" ]; then
|
||||
fail "Unable to find old IP; possible salt system failure"
|
||||
fi
|
||||
|
||||
echo "Found old IP $OLD_IP."
|
||||
fi
|
||||
|
||||
if [ -z "$NEW_IP" ]; then
|
||||
iface=$(lookup_pillar "mainint" "host")
|
||||
NEW_IP=$(ip -4 addr list $iface | grep inet | cut -d' ' -f6 | cut -d/ -f1)
|
||||
|
||||
if [ -z "$NEW_IP" ]; then
|
||||
fail "Unable to detect new IP on interface $iface. "
|
||||
fi
|
||||
|
||||
echo "Detected new IP $NEW_IP on interface $iface."
|
||||
fi
|
||||
|
||||
if [ "$OLD_IP" == "$NEW_IP" ]; then
|
||||
fail "IP address has not changed"
|
||||
fi
|
||||
|
||||
echo "About to change old IP $OLD_IP to new IP $NEW_IP."
|
||||
|
||||
read -n 1 -p "Would you like to continue? (y/N) " CONTINUE
|
||||
echo
|
||||
|
||||
if [ "$CONTINUE" == "y" ]; then
|
||||
for file in $(grep -rlI $OLD_IP /opt/so/saltstack /etc); do
|
||||
echo "Updating file: $file"
|
||||
sed -i "s|$OLD_IP|$NEW_IP|g" $file
|
||||
done
|
||||
|
||||
echo "The IP has been changed from $OLD_IP to $NEW_IP."
|
||||
|
||||
if [ -z "$SKIP_STATE_APPLY" ]; then
|
||||
echo "Re-applying salt states."
|
||||
salt-call state.highstate queue=True
|
||||
fi
|
||||
else
|
||||
echo "Exiting without changes."
|
||||
fi
|
||||
@@ -23,7 +23,7 @@
|
||||
KIBANA_HOST={{ MANAGER }}
|
||||
KSO_PORT=5601
|
||||
OUTFILE="saved_objects.ndjson"
|
||||
curl -s -H 'kbn-xsrf: true' -H 'Content-Type: application/json' -XPOST $KIBANA_HOST:$KSO_PORT/api/saved_objects/_export -d '{ "type": [ "index-pattern", "config", "visualization", "dashboard", "search" ], "excludeExportDetails": false }' > $OUTFILE
|
||||
curl -s -H 'kbn-xsrf: true' -H 'Content-Type: application/json' -XPOST -L $KIBANA_HOST:$KSO_PORT/api/saved_objects/_export -d '{ "type": [ "index-pattern", "config", "visualization", "dashboard", "search" ], "excludeExportDetails": false }' > $OUTFILE
|
||||
|
||||
# Clean up using PLACEHOLDER
|
||||
sed -i "s/$KIBANA_HOST/PLACEHOLDER/g" $OUTFILE
|
||||
|
||||
26
salt/common/tools/sbin/so-playbook-reset
Normal file
26
salt/common/tools/sbin/so-playbook-reset
Normal file
@@ -0,0 +1,26 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# Copyright 2014,2015,2016,2017,2018,2019,2020 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
|
||||
|
||||
salt-call state.apply playbook.db_init,playbook,playbook.automation_user_create
|
||||
|
||||
/usr/sbin/so-soctopus-restart
|
||||
|
||||
echo "Importing Plays - this will take some time...."
|
||||
wait 5
|
||||
/usr/sbin/so-playbook-ruleupdate
|
||||
@@ -10,4 +10,4 @@ got_root() {
|
||||
}
|
||||
|
||||
got_root
|
||||
docker exec -d so-idstools /bin/bash -c 'cd /opt/so/idstools/etc && idstools-rulecat'
|
||||
docker exec so-idstools /bin/bash -c 'cd /opt/so/idstools/etc && idstools-rulecat'
|
||||
|
||||
104
salt/common/tools/sbin/so-salt-minion-check
Normal file
104
salt/common/tools/sbin/so-salt-minion-check
Normal file
@@ -0,0 +1,104 @@
|
||||
{% import_yaml 'salt/minion.defaults.yaml' as SALT_MINION_DEFAULTS -%}
|
||||
|
||||
#!/bin/bash
|
||||
#
|
||||
# Copyright 2014,2015,2016,2017,2018,2019,2020 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/>.
|
||||
|
||||
# this script checks the time the file /opt/so/log/salt/state-apply-test was last modified and restarts the salt-minion service if it is outside a threshold date/time
|
||||
# the file is modified via file.touch using a scheduled job healthcheck.salt-minion.state-apply-test that runs a state.apply.
|
||||
# by default the file should be updated every 5-8 minutes.
|
||||
# this allows us to test that the minion is able apply states and communicate with the master
|
||||
# if the file is unable to be touched via the state.apply, then we assume there is a possibilty that the minion is hung (though it could be possible the master is down as well)
|
||||
# we then stop the service, pkill salt-minion, the start the salt-minion service back up
|
||||
|
||||
. /usr/sbin/so-common
|
||||
|
||||
QUIET=false
|
||||
UPTIME_REQ=1800 #in seconds, how long the box has to be up before considering restarting salt-minion due to /opt/so/log/salt/state-apply-test not being touched
|
||||
CURRENT_TIME=$(date +%s)
|
||||
SYSTEM_START_TIME=$(date -d "$(</proc/uptime awk '{print $1}') seconds ago" +%s)
|
||||
LAST_HIGHSTATE_END=$([ -e "/opt/so/log/salt/lasthighstate" ] && date -r /opt/so/log/salt/lasthighstate +%s || echo 0)
|
||||
LAST_HEALTHCHECK_STATE_APPLY=$([ -e "/opt/so/log/salt/state-apply-test" ] && date -r /opt/so/log/salt/state-apply-test +%s || echo 0)
|
||||
# SETTING THRESHOLD TO ANYTHING UNDER 600 seconds may cause a lot of salt-minion restarts since the job to touch the file occurs every 5-8 minutes by default
|
||||
THRESHOLD={{SALT_MINION_DEFAULTS.salt.minion.check_threshold}} #within how many seconds the file /opt/so/log/salt/state-apply-test must have been touched/modified before the salt minion is restarted
|
||||
THRESHOLD_DATE=$((LAST_HEALTHCHECK_STATE_APPLY+THRESHOLD))
|
||||
|
||||
logCmd() {
|
||||
cmd=$1
|
||||
info "Executing command: $cmd"
|
||||
$cmd >> "/opt/so/log/salt/so-salt-minion-check"
|
||||
}
|
||||
|
||||
log() {
|
||||
msg=$1
|
||||
level=${2:-I}
|
||||
now=$(TZ=GMT date +"%Y-%m-%dT%H:%M:%SZ")
|
||||
if ! $QUIET; then
|
||||
echo $msg
|
||||
fi
|
||||
echo -e "$now | $level | $msg" >> "/opt/so/log/salt/so-salt-minion-check" 2>&1
|
||||
}
|
||||
|
||||
error() {
|
||||
log "$1" "E"
|
||||
}
|
||||
|
||||
info() {
|
||||
log "$1" "I"
|
||||
}
|
||||
|
||||
usage()
|
||||
{
|
||||
cat <<EOF
|
||||
|
||||
Check health of salt-minion and restart it if needed
|
||||
Options:
|
||||
-h This message
|
||||
-q Don't output to terminal
|
||||
|
||||
EOF
|
||||
}
|
||||
|
||||
while getopts ":q" opt; do
|
||||
case "$opt" in
|
||||
q )
|
||||
QUIET=true
|
||||
;;
|
||||
* ) usage
|
||||
exit 0
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
log "running so-salt-minion-check"
|
||||
|
||||
if [ $CURRENT_TIME -ge $((SYSTEM_START_TIME+$UPTIME_REQ)) ]; then
|
||||
if [ $THRESHOLD_DATE -le $CURRENT_TIME ]; then
|
||||
log "salt-minion is unable to apply states" E
|
||||
log "/opt/so/log/salt/healthcheck-state-apply not touched by required date: `date -d @$THRESHOLD_DATE`, last touched: `date -d @$LAST_HEALTHCHECK_STATE_APPLY`" I
|
||||
log "last highstate completed at `date -d @$LAST_HIGHSTATE_END`" I
|
||||
log "checking if any jobs are running" I
|
||||
logCmd "salt-call --local saltutil.running" I
|
||||
log "killing all salt-minion processes" I
|
||||
logCmd "pkill -9 -ef /usr/bin/salt-minion" I
|
||||
log "starting salt-minion service" I
|
||||
logCmd "systemctl start salt-minion" I
|
||||
else
|
||||
log "/opt/so/log/salt/healthcheck-state-apply last touched: `date -d @$LAST_HEALTHCHECK_STATE_APPLY` must be touched by `date -d @$THRESHOLD_DATE` to avoid salt-minion restart" I
|
||||
fi
|
||||
else
|
||||
log "system uptime only $((CURRENT_TIME-SYSTEM_START_TIME)) seconds does not meet $UPTIME_REQ second requirement." I
|
||||
fi
|
||||
@@ -23,97 +23,104 @@ CUR_USAGE=$(df -P $SENSOR_DIR | tail -1 | awk '{print $5}' | tr -d %)
|
||||
LOG="/opt/so/log/sensor_clean.log"
|
||||
TODAY=$(date -u "+%Y-%m-%d")
|
||||
|
||||
clean () {
|
||||
## find the oldest Zeek logs directory
|
||||
OLDEST_DIR=$(ls /nsm/zeek/logs/ | grep -v "current" | grep -v "stats" | grep -v "packetloss" | grep -v "zeek_clean" | sort | head -n 1)
|
||||
if [ -z "$OLDEST_DIR" -o "$OLDEST_DIR" == ".." -o "$OLDEST_DIR" == "." ]
|
||||
then
|
||||
echo "$(date) - No old Zeek logs available to clean up in /nsm/zeek/logs/" >> $LOG
|
||||
#exit 0
|
||||
else
|
||||
echo "$(date) - Removing directory: /nsm/zeek/logs/$OLDEST_DIR" >> $LOG
|
||||
rm -rf /nsm/zeek/logs/"$OLDEST_DIR"
|
||||
fi
|
||||
clean() {
|
||||
## find the oldest Zeek logs directory
|
||||
OLDEST_DIR=$(ls /nsm/zeek/logs/ | grep -v "current" | grep -v "stats" | grep -v "packetloss" | grep -v "zeek_clean" | sort | head -n 1)
|
||||
if [ -z "$OLDEST_DIR" -o "$OLDEST_DIR" == ".." -o "$OLDEST_DIR" == "." ]; then
|
||||
echo "$(date) - No old Zeek logs available to clean up in /nsm/zeek/logs/" >>$LOG
|
||||
#exit 0
|
||||
else
|
||||
echo "$(date) - Removing directory: /nsm/zeek/logs/$OLDEST_DIR" >>$LOG
|
||||
rm -rf /nsm/zeek/logs/"$OLDEST_DIR"
|
||||
fi
|
||||
|
||||
## Remarking for now, as we are moving extracted files to /nsm/strelka/processed
|
||||
## find oldest files in extracted directory and exclude today
|
||||
#OLDEST_EXTRACT=$(find /nsm/zeek/extracted/complete -type f -printf '%T+ %p\n' 2>/dev/null | sort | grep -v $TODAY | head -n 1)
|
||||
#if [ -z "$OLDEST_EXTRACT" -o "$OLDEST_EXTRACT" == ".." -o "$OLDEST_EXTRACT" == "." ]
|
||||
#then
|
||||
# echo "$(date) - No old extracted files available to clean up in /nsm/zeek/extracted/complete" >> $LOG
|
||||
#else
|
||||
# OLDEST_EXTRACT_DATE=`echo $OLDEST_EXTRACT | awk '{print $1}' | cut -d+ -f1`
|
||||
# OLDEST_EXTRACT_FILE=`echo $OLDEST_EXTRACT | awk '{print $2}'`
|
||||
# echo "$(date) - Removing extracted files for $OLDEST_EXTRACT_DATE" >> $LOG
|
||||
# find /nsm/zeek/extracted/complete -type f -printf '%T+ %p\n' | grep $OLDEST_EXTRACT_DATE | awk '{print $2}' |while read FILE
|
||||
# do
|
||||
# echo "$(date) - Removing extracted file: $FILE" >> $LOG
|
||||
# rm -f "$FILE"
|
||||
# done
|
||||
#fi
|
||||
|
||||
## Remarking for now, as we are moving extracted files to /nsm/strelka/processed
|
||||
## find oldest files in extracted directory and exclude today
|
||||
#OLDEST_EXTRACT=$(find /nsm/zeek/extracted/complete -type f -printf '%T+ %p\n' 2>/dev/null | sort | grep -v $TODAY | head -n 1)
|
||||
#if [ -z "$OLDEST_EXTRACT" -o "$OLDEST_EXTRACT" == ".." -o "$OLDEST_EXTRACT" == "." ]
|
||||
#then
|
||||
# echo "$(date) - No old extracted files available to clean up in /nsm/zeek/extracted/complete" >> $LOG
|
||||
#else
|
||||
# OLDEST_EXTRACT_DATE=`echo $OLDEST_EXTRACT | awk '{print $1}' | cut -d+ -f1`
|
||||
# OLDEST_EXTRACT_FILE=`echo $OLDEST_EXTRACT | awk '{print $2}'`
|
||||
# echo "$(date) - Removing extracted files for $OLDEST_EXTRACT_DATE" >> $LOG
|
||||
# find /nsm/zeek/extracted/complete -type f -printf '%T+ %p\n' | grep $OLDEST_EXTRACT_DATE | awk '{print $2}' |while read FILE
|
||||
# do
|
||||
# echo "$(date) - Removing extracted file: $FILE" >> $LOG
|
||||
# rm -f "$FILE"
|
||||
# done
|
||||
#fi
|
||||
|
||||
## Clean up Zeek extracted files processed by Strelka
|
||||
STRELKA_FILES='/nsm/strelka/processed'
|
||||
OLDEST_STRELKA=$(find $STRELKA_FILES -type f -printf '%T+ %p\n' | sort -n | head -n 1 )
|
||||
if [ -z "$OLDEST_STRELKA" -o "$OLDEST_STRELKA" == ".." -o "$OLDEST_STRELKA" == "." ]
|
||||
then
|
||||
echo "$(date) - No old files available to clean up in $STRELKA_FILES" >> $LOG
|
||||
else
|
||||
OLDEST_STRELKA_DATE=`echo $OLDEST_STRELKA | awk '{print $1}' | cut -d+ -f1`
|
||||
OLDEST_STRELKA_FILE=`echo $OLDEST_STRELKA | awk '{print $2}'`
|
||||
echo "$(date) - Removing extracted files for $OLDEST_STRELKA_DATE" >> $LOG
|
||||
find $STRELKA_FILES -type f -printf '%T+ %p\n' | grep $OLDEST_STRELKA_DATE | awk '{print $2}' |while read FILE
|
||||
do
|
||||
echo "$(date) - Removing file: $FILE" >> $LOG
|
||||
rm -f "$FILE"
|
||||
done
|
||||
fi
|
||||
## Clean up Zeek extracted files processed by Strelka
|
||||
STRELKA_FILES='/nsm/strelka/processed'
|
||||
OLDEST_STRELKA=$(find $STRELKA_FILES -type f -printf '%T+ %p\n' | sort -n | head -n 1)
|
||||
if [ -z "$OLDEST_STRELKA" -o "$OLDEST_STRELKA" == ".." -o "$OLDEST_STRELKA" == "." ]; then
|
||||
echo "$(date) - No old files available to clean up in $STRELKA_FILES" >>$LOG
|
||||
else
|
||||
OLDEST_STRELKA_DATE=$(echo $OLDEST_STRELKA | awk '{print $1}' | cut -d+ -f1)
|
||||
OLDEST_STRELKA_FILE=$(echo $OLDEST_STRELKA | awk '{print $2}')
|
||||
echo "$(date) - Removing extracted files for $OLDEST_STRELKA_DATE" >>$LOG
|
||||
find $STRELKA_FILES -type f -printf '%T+ %p\n' | grep $OLDEST_STRELKA_DATE | awk '{print $2}' | while read FILE; do
|
||||
echo "$(date) - Removing file: $FILE" >>$LOG
|
||||
rm -f "$FILE"
|
||||
done
|
||||
fi
|
||||
|
||||
## Clean up Suricata log files
|
||||
SURICATA_LOGS='/nsm/suricata'
|
||||
OLDEST_SURICATA=$(find $STRELKA_FILES -type f -printf '%T+ %p\n' | sort -n | head -n 1)
|
||||
if [ -z "$OLDEST_SURICATA" -o "$OLDEST_SURICATA" == ".." -o "$OLDEST_SURICATA" == "." ]
|
||||
then
|
||||
echo "$(date) - No old files available to clean up in $SURICATA_LOGS" >> $LOG
|
||||
else
|
||||
OLDEST_SURICATA_DATE=`echo $OLDEST_SURICATA | awk '{print $1}' | cut -d+ -f1`
|
||||
OLDEST_SURICATA_FILE=`echo $OLDEST_SURICATA | awk '{print $2}'`
|
||||
echo "$(date) - Removing logs for $OLDEST_SURICATA_DATE" >> $LOG
|
||||
find $SURICATA_LOGS -type f -printf '%T+ %p\n' | grep $OLDEST_SURICATA_DATE | awk '{print $2}' |while read FILE
|
||||
do
|
||||
echo "$(date) - Removing file: $FILE" >> $LOG
|
||||
rm -f "$FILE"
|
||||
done
|
||||
fi
|
||||
## Clean up Suricata log files
|
||||
SURICATA_LOGS='/nsm/suricata'
|
||||
OLDEST_SURICATA=$(find $SURICATA_LOGS -type f -printf '%T+ %p\n' | sort -n | head -n 1)
|
||||
if [[ -z "$OLDEST_SURICATA" ]] || [[ "$OLDEST_SURICATA" == ".." ]] || [[ "$OLDEST_SURICATA" == "." ]]; then
|
||||
echo "$(date) - No old files available to clean up in $SURICATA_LOGS" >>$LOG
|
||||
else
|
||||
OLDEST_SURICATA_DATE=$(echo $OLDEST_SURICATA | awk '{print $1}' | cut -d+ -f1)
|
||||
OLDEST_SURICATA_FILE=$(echo $OLDEST_SURICATA | awk '{print $2}')
|
||||
echo "$(date) - Removing logs for $OLDEST_SURICATA_DATE" >>$LOG
|
||||
find $SURICATA_LOGS -type f -printf '%T+ %p\n' | grep $OLDEST_SURICATA_DATE | awk '{print $2}' | while read FILE; do
|
||||
echo "$(date) - Removing file: $FILE" >>$LOG
|
||||
rm -f "$FILE"
|
||||
done
|
||||
fi
|
||||
|
||||
## Clean up extracted pcaps from Steno
|
||||
PCAPS='/nsm/pcapout'
|
||||
OLDEST_PCAP=$(find $PCAPS -type f -printf '%T+ %p\n' | sort -n | head -n 1 )
|
||||
if [ -z "$OLDEST_PCAP" -o "$OLDEST_PCAP" == ".." -o "$OLDEST_PCAP" == "." ]
|
||||
then
|
||||
echo "$(date) - No old files available to clean up in $PCAPS" >> $LOG
|
||||
else
|
||||
OLDEST_PCAP_DATE=`echo $OLDEST_PCAP | awk '{print $1}' | cut -d+ -f1`
|
||||
OLDEST_PCAP_FILE=`echo $OLDEST_PCAP | awk '{print $2}'`
|
||||
echo "$(date) - Removing extracted files for $OLDEST_PCAP_DATE" >> $LOG
|
||||
find $PCAPS -type f -printf '%T+ %p\n' | grep $OLDEST_PCAP_DATE | awk '{print $2}' |while read FILE
|
||||
do
|
||||
echo "$(date) - Removing file: $FILE" >> $LOG
|
||||
rm -f "$FILE"
|
||||
done
|
||||
fi
|
||||
# Clean Wazuh archives
|
||||
# Slightly different code since we have 2 files to remove (.json and .log)
|
||||
WAZUH_ARCHIVE='/nsm/wazuh/logs/archives'
|
||||
OLDEST_WAZUH=$(find $WAZUH_ARCHIVE -type f ! -name "archives.json" -printf "%T+\t%p\n" | sort -n | awk '{print $1}' | head -n 1)
|
||||
# Make sure we don't delete the current files
|
||||
find $WAZUH_ARCHIVE -type f ! -name "archives.json" -printf "%T+\t%p\n" | sort -n | awk '{print $2}' | head -n 1 >/tmp/files$$
|
||||
if [[ $(wc -l </tmp/files$$) -ge 1 ]]; then
|
||||
echo "$(date) - Removing logs for $OLDEST_WAZUH" >>$LOG
|
||||
while read -r line; do
|
||||
echo "$(date) - Removing file: $line" >>$LOG
|
||||
rm "$line"
|
||||
done </tmp/files$$
|
||||
else
|
||||
echo "$(date) - No old files available to clean up in $WAZUH_ARCHIVE" >>$LOG
|
||||
fi
|
||||
rm /tmp/files$$
|
||||
|
||||
## Clean up extracted pcaps from Steno
|
||||
PCAPS='/nsm/pcapout'
|
||||
OLDEST_PCAP=$(find $PCAPS -type f -printf '%T+ %p\n' | sort -n | head -n 1)
|
||||
if [ -z "$OLDEST_PCAP" -o "$OLDEST_PCAP" == ".." -o "$OLDEST_PCAP" == "." ]; then
|
||||
echo "$(date) - No old files available to clean up in $PCAPS" >>$LOG
|
||||
else
|
||||
OLDEST_PCAP_DATE=$(echo $OLDEST_PCAP | awk '{print $1}' | cut -d+ -f1)
|
||||
OLDEST_PCAP_FILE=$(echo $OLDEST_PCAP | awk '{print $2}')
|
||||
echo "$(date) - Removing extracted files for $OLDEST_PCAP_DATE" >>$LOG
|
||||
find $PCAPS -type f -printf '%T+ %p\n' | grep $OLDEST_PCAP_DATE | awk '{print $2}' | while read FILE; do
|
||||
echo "$(date) - Removing file: $FILE" >>$LOG
|
||||
rm -f "$FILE"
|
||||
done
|
||||
fi
|
||||
}
|
||||
|
||||
# Check to see if we are already running
|
||||
IS_RUNNING=$(ps aux | grep "sensor_clean" | grep -v grep | wc -l)
|
||||
[ "$IS_RUNNING" -gt 2 ] && echo "$(date) - $IS_RUNNING sensor clean script processes running...exiting." >> $LOG && exit 0
|
||||
[ "$IS_RUNNING" -gt 2 ] && echo "$(date) - $IS_RUNNING sensor clean script processes running...exiting." >>$LOG && exit 0
|
||||
|
||||
if [ "$CUR_USAGE" -gt "$CRIT_DISK_USAGE" ]; then
|
||||
while [ "$CUR_USAGE" -gt "$CRIT_DISK_USAGE" ];
|
||||
do
|
||||
clean
|
||||
CUR_USAGE=$(df -P $SENSOR_DIR | tail -1 | awk '{print $5}' | tr -d %)
|
||||
done
|
||||
while [ "$CUR_USAGE" -gt "$CRIT_DISK_USAGE" ]; do
|
||||
clean
|
||||
CUR_USAGE=$(df -P $SENSOR_DIR | tail -1 | awk '{print $5}' | tr -d %)
|
||||
done
|
||||
fi
|
||||
|
||||
|
||||
49
salt/common/tools/sbin/so-ssh-harden
Normal file
49
salt/common/tools/sbin/so-ssh-harden
Normal file
@@ -0,0 +1,49 @@
|
||||
#!/bin/bash
|
||||
|
||||
. /usr/sbin/so-common
|
||||
|
||||
if [[ $1 =~ ^(q|--quiet) ]]; then
|
||||
quiet=true
|
||||
fi
|
||||
|
||||
print_sshd_t() {
|
||||
local string=$1
|
||||
local state=$2
|
||||
echo "${state}:"
|
||||
sshd -T | grep "^${string}"
|
||||
}
|
||||
|
||||
if ! [[ $quiet ]]; then print_sshd_t "ciphers" "Before"; fi
|
||||
sshd -T | grep "^ciphers" | sed -e "s/\(3des-cbc\|aes128-cbc\|aes192-cbc\|aes256-cbc\|arcfour\|arcfour128\|arcfour256\|blowfish-cbc\|cast128-cbc\|rijndael-cbc@lysator.liu.se\)\,\?//g" >> /etc/ssh/sshd_config
|
||||
if ! [[ $quiet ]]; then
|
||||
print_sshd_t "ciphers" "After"
|
||||
echo ""
|
||||
fi
|
||||
|
||||
if ! [[ $quiet ]]; then print_sshd_t "kexalgorithms" "Before"; fi
|
||||
sshd -T | grep "^kexalgorithms" | sed -e "s/\(diffie-hellman-group14-sha1\|ecdh-sha2-nistp256\|diffie-hellman-group-exchange-sha256\|diffie-hellman-group1-sha1\|diffie-hellman-group-exchange-sha1\|ecdh-sha2-nistp521\|ecdh-sha2-nistp384\)\,\?//g" >> /etc/ssh/sshd_config
|
||||
if ! [[ $quiet ]]; then
|
||||
print_sshd_t "kexalgorithms" "After"
|
||||
echo ""
|
||||
fi
|
||||
|
||||
if ! [[ $quiet ]]; then print_sshd_t "macs" "Before"; fi
|
||||
sshd -T | grep "^macs" | sed -e "s/\(hmac-sha2-512,\|umac-128@openssh.com,\|hmac-sha2-256,\|umac-64@openssh.com,\|hmac-sha1,\|hmac-sha1-etm@openssh.com,\|umac-64-etm@openssh.com,\|hmac-sha1\)//g" >> /etc/ssh/sshd_config
|
||||
if ! [[ $quiet ]]; then
|
||||
print_sshd_t "macs" "After"
|
||||
echo ""
|
||||
fi
|
||||
|
||||
if ! [[ $quiet ]]; then print_sshd_t "hostkeyalgorithms" "Before"; fi
|
||||
sshd -T | grep "^hostkeyalgorithms" | sed "s|ecdsa-sha2-nistp256,||g" | sed "s|ssh-rsa,||g" >> /etc/ssh/sshd_config
|
||||
if ! [[ $quiet ]]; then
|
||||
print_sshd_t "hostkeyalgorithms" "After"
|
||||
echo ""
|
||||
fi
|
||||
|
||||
{% if grains['os'] != 'CentOS' %}
|
||||
echo "----"
|
||||
echo "[ WARNING ] Any new ssh sessions will need to remove and reaccept the ECDSA key for this server before reconnecting."
|
||||
echo "----"
|
||||
{% endif %}
|
||||
|
||||
@@ -14,8 +14,6 @@
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
{%- from 'common/maps/so-status.map.jinja' import docker with context %}
|
||||
{%- set container_list = docker['containers'] | sort | unique %}
|
||||
|
||||
if ! [ "$(id -u)" = 0 ]; then
|
||||
echo "This command must be run as root"
|
||||
@@ -23,14 +21,24 @@ if ! [ "$(id -u)" = 0 ]; then
|
||||
fi
|
||||
|
||||
# Constants
|
||||
SYSTEM_START_TIME=$(date -d "$(</proc/uptime awk '{print $1}') seconds ago" +%s)
|
||||
# file populated by salt.lasthighstate state at end of successful highstate run
|
||||
LAST_HIGHSTATE_END=$([ -e "/opt/so/log/salt/lasthighstate" ] && date -r /opt/so/log/salt/lasthighstate +%s || echo 0)
|
||||
HIGHSTATE_RUNNING=$(salt-call --local saltutil.running --out=json | jq -r '.local[].fun' | grep -q 'state.highstate' && echo $?)
|
||||
ERROR_STRING="ERROR"
|
||||
SUCCESS_STRING="OK"
|
||||
PENDING_STRING="PENDING"
|
||||
MISSING_STRING='MISSING'
|
||||
DISABLED_STRING='DISABLED'
|
||||
WAIT_START_STRING='WAIT_START'
|
||||
STARTING_STRING='STARTING'
|
||||
CALLER=$(ps -o comm= $PPID)
|
||||
declare -a BAD_STATUSES=("removing" "paused" "exited" "dead")
|
||||
declare -a PENDING_STATUSES=("paused" "created" "restarting")
|
||||
declare -a GOOD_STATUSES=("running")
|
||||
declare -a DISABLED_CONTAINERS=()
|
||||
mapfile -t DISABLED_CONTAINERS < <(sort -u /opt/so/conf/so-status/so-status.conf | grep "^\s*#" | tr -d "#")
|
||||
|
||||
|
||||
declare -a temp_container_name_list=()
|
||||
declare -a temp_container_state_list=()
|
||||
@@ -72,9 +80,9 @@ compare_lists() {
|
||||
# {% endraw %}
|
||||
|
||||
create_expected_container_list() {
|
||||
{% for item in container_list -%}
|
||||
expected_container_list+=("{{ item }}")
|
||||
{% endfor -%}
|
||||
|
||||
mapfile -t expected_container_list < <(sort -u /opt/so/conf/so-status/so-status.conf | tr -d "#")
|
||||
|
||||
}
|
||||
|
||||
populate_container_lists() {
|
||||
@@ -104,46 +112,67 @@ populate_container_lists() {
|
||||
|
||||
parse_status() {
|
||||
local container_state=${1}
|
||||
|
||||
[[ $container_state = "missing" ]] && printf $MISSING_STRING && return 1
|
||||
local service_name=${2}
|
||||
|
||||
for state in "${GOOD_STATUSES[@]}"; do
|
||||
[[ $container_state = "$state" ]] && printf $SUCCESS_STRING && return 0
|
||||
done
|
||||
|
||||
for state in "${PENDING_STATUSES[@]}"; do
|
||||
[[ $container_state = "$state" ]] && printf $PENDING_STRING && return 0
|
||||
done
|
||||
|
||||
# This is technically not needed since the default is error state
|
||||
for state in "${BAD_STATUSES[@]}"; do
|
||||
[[ $container_state = "$state" ]] && printf $ERROR_STRING && return 1
|
||||
[[ " ${DISABLED_CONTAINERS[@]} " =~ " ${service_name} " ]] && printf $DISABLED_STRING && return 0
|
||||
done
|
||||
|
||||
printf $ERROR_STRING && return 1
|
||||
# if a highstate has finished running since the system has started
|
||||
# then the containers should be running so let's check the status
|
||||
if [ $LAST_HIGHSTATE_END -ge $SYSTEM_START_TIME ]; then
|
||||
|
||||
[[ $container_state = "missing" ]] && printf $MISSING_STRING && return 1
|
||||
|
||||
for state in "${PENDING_STATUSES[@]}"; do
|
||||
[[ $container_state = "$state" ]] && printf $PENDING_STRING && return 0
|
||||
done
|
||||
|
||||
# This is technically not needed since the default is error state
|
||||
for state in "${BAD_STATUSES[@]}"; do
|
||||
[[ $container_state = "$state" ]] && printf $ERROR_STRING && return 1
|
||||
done
|
||||
|
||||
printf $ERROR_STRING && return 1
|
||||
|
||||
# if a highstate has not run since system start time, but a highstate is currently running
|
||||
# then show that the containers are STARTING
|
||||
elif [[ "$HIGHSTATE_RUNNING" == 0 ]]; then
|
||||
printf $STARTING_STRING && return 0
|
||||
|
||||
# if a highstate has not finished running since system startup and isn't currently running
|
||||
# then just show that the containers are WAIT_START; waiting to be started
|
||||
else
|
||||
printf $WAIT_START_STRING && return 1
|
||||
|
||||
fi
|
||||
}
|
||||
|
||||
# {% raw %}
|
||||
|
||||
print_line() {
|
||||
local service_name=${1}
|
||||
local service_state="$( parse_status ${2} )"
|
||||
local service_state="$( parse_status ${2} ${1} )"
|
||||
local columns=$(tput cols)
|
||||
local state_color="\e[0m"
|
||||
|
||||
local PADDING_CONSTANT=14
|
||||
local PADDING_CONSTANT=15
|
||||
|
||||
if [[ $service_state = "$ERROR_STRING" ]] || [[ $service_state = "$MISSING_STRING" ]]; then
|
||||
if [[ $service_state = "$ERROR_STRING" ]] || [[ $service_state = "$MISSING_STRING" ]] || [[ $service_state = "$WAIT_START_STRING" ]]; then
|
||||
state_color="\e[1;31m"
|
||||
elif [[ $service_state = "$SUCCESS_STRING" ]]; then
|
||||
state_color="\e[1;32m"
|
||||
elif [[ $service_state = "$PENDING_STRING" ]]; then
|
||||
elif [[ $service_state = "$PENDING_STRING" ]] || [[ $service_state = "$DISABLED_STRING" ]] || [[ $service_state = "$STARTING_STRING" ]]; then
|
||||
state_color="\e[1;33m"
|
||||
fi
|
||||
|
||||
printf " $service_name "
|
||||
for i in $(seq 0 $(( $columns - $PADDING_CONSTANT - ${#service_name} - ${#service_state} ))); do
|
||||
printf "-"
|
||||
printf "${state_color}%b\e[0m" "-"
|
||||
done
|
||||
printf " [ "
|
||||
printf "${state_color}%b\e[0m" "$service_state"
|
||||
@@ -152,12 +181,10 @@ print_line() {
|
||||
|
||||
non_term_print_line() {
|
||||
local service_name=${1}
|
||||
local service_state="$( parse_status ${2} )"
|
||||
|
||||
local PADDING_CONSTANT=10
|
||||
local service_state="$( parse_status ${2} ${1} )"
|
||||
|
||||
printf " $service_name "
|
||||
for i in $(seq 0 $(( 40 - $PADDING_CONSTANT - ${#service_name} - ${#service_state} ))); do
|
||||
for i in $(seq 0 $(( 35 - ${#service_name} - ${#service_state} ))); do
|
||||
printf "-"
|
||||
done
|
||||
printf " [ "
|
||||
|
||||
2
salt/common/tools/sbin/so-test
Normal file → Executable file
2
salt/common/tools/sbin/so-test
Normal file → Executable file
@@ -23,6 +23,8 @@ REPLAY_ENABLED=$(docker images | grep so-tcpreplay)
|
||||
REPLAY_RUNNING=$(docker ps | grep so-tcpreplay)
|
||||
|
||||
if [ "$REPLAY_ENABLED" != "" ] && [ "$REPLAY_RUNNING" != "" ]; then
|
||||
echo
|
||||
echo "Preparing to replay PCAPs..."
|
||||
docker cp so-tcpreplay:/opt/samples /opt/samples
|
||||
docker exec -it so-tcpreplay /usr/local/bin/tcpreplay -i bond0 -M10 /opt/samples/*
|
||||
echo
|
||||
|
||||
@@ -31,7 +31,7 @@ fi
|
||||
USER=$1
|
||||
|
||||
THEHIVE_KEY=$(lookup_pillar hivekey)
|
||||
THEHIVE_IP=$(lookup_pillar managerip)
|
||||
THEHVIE_API_URL="$(lookup_pillar url_base)/thehive/api"
|
||||
THEHIVE_USER=$USER
|
||||
|
||||
# Read password for new user from stdin
|
||||
@@ -39,14 +39,19 @@ test -t 0
|
||||
if [[ $? == 0 ]]; then
|
||||
echo "Enter new password:"
|
||||
fi
|
||||
read -s THEHIVE_PASS
|
||||
read -rs THEHIVE_PASS
|
||||
|
||||
if ! check_password "$THEHIVE_PASS"; then
|
||||
echo "Password is invalid. Please exclude single quotes, double quotes and backslashes from the password."
|
||||
exit 2
|
||||
fi
|
||||
|
||||
# Create new user in TheHive
|
||||
resp=$(curl -sk -XPOST -H "Authorization: Bearer $THEHIVE_KEY" -H "Content-Type: application/json" "https://$THEHIVE_IP/thehive/api/user" -d "{\"login\" : \"$THEHIVE_USER\",\"name\" : \"$THEHIVE_USER\",\"roles\" : [\"read\",\"alert\",\"write\",\"admin\"],\"preferences\" : \"{}\",\"password\" : \"$THEHIVE_PASS\"}")
|
||||
resp=$(curl -sk -XPOST -H "Authorization: Bearer $THEHIVE_KEY" -H "Content-Type: application/json" -L "https://$THEHVIE_API_URL/user" -d "{\"login\" : \"$THEHIVE_USER\",\"name\" : \"$THEHIVE_USER\",\"roles\" : [\"read\",\"alert\",\"write\",\"admin\"],\"preferences\" : \"{}\",\"password\" : \"$THEHIVE_PASS\"}")
|
||||
if [[ "$resp" =~ \"status\":\"Ok\" ]]; then
|
||||
echo "Successfully added user to TheHive."
|
||||
echo "Successfully added user to TheHive"
|
||||
else
|
||||
echo "Unable to add user to TheHive; user might already exist."
|
||||
echo "Unable to add user to TheHive; user might already exist"
|
||||
echo $resp
|
||||
exit 2
|
||||
fi
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
usage() {
|
||||
echo "Usage: $0 <user-name> <true|false>"
|
||||
echo ""
|
||||
echo "Enables or disables a user in thehive."
|
||||
echo "Enables or disables a user in TheHive."
|
||||
exit 1
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ fi
|
||||
USER=$1
|
||||
|
||||
THEHIVE_KEY=$(lookup_pillar hivekey)
|
||||
THEHIVE_IP=$(lookup_pillar managerip)
|
||||
THEHVIE_API_URL="$(lookup_pillar url_base)/thehive/api"
|
||||
THEHIVE_USER=$USER
|
||||
|
||||
case "${2^^}" in
|
||||
@@ -46,11 +46,11 @@ case "${2^^}" in
|
||||
;;
|
||||
esac
|
||||
|
||||
resp=$(curl -sk -XPATCH -H "Authorization: Bearer $THEHIVE_KEY" -H "Content-Type: application/json" "https://$THEHIVE_IP/thehive/api/user/${THEHIVE_USER}" -d "{\"status\":\"${THEHIVE_STATUS}\" }")
|
||||
resp=$(curl -sk -XPATCH -H "Authorization: Bearer $THEHIVE_KEY" -H "Content-Type: application/json" -L "https://$THEHVIE_API_URL/user/${THEHIVE_USER}" -d "{\"status\":\"${THEHIVE_STATUS}\" }")
|
||||
if [[ "$resp" =~ \"status\":\"Locked\" || "$resp" =~ \"status\":\"Ok\" ]]; then
|
||||
echo "Successfully updated user in thehive."
|
||||
echo "Successfully updated user in TheHive"
|
||||
else
|
||||
echo "Failed to update user in thehive."
|
||||
echo "Failed to update user in TheHive"
|
||||
echo "$resp"
|
||||
exit 2
|
||||
fi
|
||||
|
||||
@@ -8,9 +8,9 @@
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
. /usr/sbin/so-common
|
||||
source $(dirname $0)/so-common
|
||||
|
||||
if [[ $# < 1 || $# > 2 ]]; then
|
||||
if [[ $# -lt 1 || $# -gt 2 ]]; then
|
||||
echo "Usage: $0 <list|add|update|enable|disable|validate|valemail|valpass> [email]"
|
||||
echo ""
|
||||
echo " list: Lists all user email addresses currently defined in the identity system"
|
||||
@@ -22,7 +22,7 @@ if [[ $# < 1 || $# > 2 ]]; then
|
||||
echo " valemail: Validates that the given email address is acceptable for defining a new user; requires 'email' parameter"
|
||||
echo " valpass: Validates that a password is acceptable for defining a new user"
|
||||
echo ""
|
||||
echo " Note that the password can be piped into stdin to avoid prompting for it."
|
||||
echo " Note that the password can be piped into STDIN to avoid prompting for it"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
@@ -56,14 +56,14 @@ function verifyEnvironment() {
|
||||
require "openssl"
|
||||
require "sqlite3"
|
||||
[[ ! -f $databasePath ]] && fail "Unable to find database file; specify path via KRATOS_DB_PATH environment variable"
|
||||
response=$(curl -Ss ${kratosUrl}/)
|
||||
response=$(curl -Ss -L ${kratosUrl}/)
|
||||
[[ "$response" != "404 page not found" ]] && fail "Unable to communicate with Kratos; specify URL via KRATOS_URL environment variable"
|
||||
}
|
||||
|
||||
function findIdByEmail() {
|
||||
email=$1
|
||||
|
||||
response=$(curl -Ss ${kratosUrl}/identities)
|
||||
response=$(curl -Ss -L ${kratosUrl}/identities)
|
||||
identityId=$(echo "${response}" | jq ".[] | select(.verifiable_addresses[0].value == \"$email\") | .id")
|
||||
echo $identityId
|
||||
}
|
||||
@@ -90,14 +90,16 @@ function validateEmail() {
|
||||
function updatePassword() {
|
||||
identityId=$1
|
||||
|
||||
# Read password from stdin (show prompt only if no stdin was piped in)
|
||||
test -t 0
|
||||
if [[ $? == 0 ]]; then
|
||||
echo "Enter new password:"
|
||||
fi
|
||||
read -s password
|
||||
if [ -z "$password" ]; then
|
||||
# Read password from stdin (show prompt only if no stdin was piped in)
|
||||
test -t 0
|
||||
if [[ $? == 0 ]]; then
|
||||
echo "Enter new password:"
|
||||
fi
|
||||
read -rs password
|
||||
|
||||
validatePassword "$password"
|
||||
validatePassword "$password"
|
||||
fi
|
||||
|
||||
if [[ -n $identityId ]]; then
|
||||
# Generate password hash
|
||||
@@ -111,7 +113,7 @@ function updatePassword() {
|
||||
}
|
||||
|
||||
function listUsers() {
|
||||
response=$(curl -Ss ${kratosUrl}/identities)
|
||||
response=$(curl -Ss -L ${kratosUrl}/identities)
|
||||
[[ $? != 0 ]] && fail "Unable to communicate with Kratos"
|
||||
|
||||
echo "${response}" | jq -r ".[] | .verifiable_addresses[0].value" | sort
|
||||
@@ -129,7 +131,7 @@ function createUser() {
|
||||
EOF
|
||||
)
|
||||
|
||||
response=$(curl -Ss ${kratosUrl}/identities -d "$addUserJson")
|
||||
response=$(curl -Ss -L ${kratosUrl}/identities -d "$addUserJson")
|
||||
[[ $? != 0 ]] && fail "Unable to communicate with Kratos"
|
||||
|
||||
identityId=$(echo "${response}" | jq ".id")
|
||||
@@ -151,7 +153,7 @@ function updateStatus() {
|
||||
identityId=$(findIdByEmail "$email")
|
||||
[[ ${identityId} == "" ]] && fail "User not found"
|
||||
|
||||
response=$(curl -Ss "${kratosUrl}/identities/$identityId")
|
||||
response=$(curl -Ss -L "${kratosUrl}/identities/$identityId")
|
||||
[[ $? != 0 ]] && fail "Unable to communicate with Kratos"
|
||||
|
||||
oldConfig=$(echo "select config from identity_credentials where identity_id=${identityId};" | sqlite3 "$databasePath")
|
||||
@@ -169,7 +171,7 @@ function updateStatus() {
|
||||
fi
|
||||
|
||||
updatedJson=$(echo "$response" | jq ".traits.status = \"$status\" | del(.verifiable_addresses) | del(.id) | del(.schema_url)")
|
||||
response=$(curl -Ss -XPUT ${kratosUrl}/identities/$identityId -d "$updatedJson")
|
||||
response=$(curl -Ss -XPUT -L ${kratosUrl}/identities/$identityId -d "$updatedJson")
|
||||
[[ $? != 0 ]] && fail "Unable to mark user as locked"
|
||||
|
||||
}
|
||||
@@ -189,7 +191,7 @@ function deleteUser() {
|
||||
identityId=$(findIdByEmail "$email")
|
||||
[[ ${identityId} == "" ]] && fail "User not found"
|
||||
|
||||
response=$(curl -Ss -XDELETE "${kratosUrl}/identities/$identityId")
|
||||
response=$(curl -Ss -XDELETE -L "${kratosUrl}/identities/$identityId")
|
||||
[[ $? != 0 ]] && fail "Unable to communicate with Kratos"
|
||||
}
|
||||
|
||||
@@ -199,6 +201,7 @@ case "${operation}" in
|
||||
[[ "$email" == "" ]] && fail "Email address must be provided"
|
||||
|
||||
validateEmail "$email"
|
||||
updatePassword
|
||||
createUser "$email"
|
||||
echo "Successfully added new user to SOC"
|
||||
check_container thehive && echo $password | so-thehive-user-add "$email"
|
||||
|
||||
2
salt/common/tools/sbin/so-user-list
Executable file
2
salt/common/tools/sbin/so-user-list
Executable file
@@ -0,0 +1,2 @@
|
||||
#!/bin/bash
|
||||
so-user list
|
||||
17
salt/common/tools/sbin/so-wazuh-user-add
Normal file
17
salt/common/tools/sbin/so-wazuh-user-add
Normal file
@@ -0,0 +1,17 @@
|
||||
#!/bin/bash
|
||||
# Copyright 2014,2015,2016,2017,2018,2019,2020 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/>.
|
||||
|
||||
docker exec -it so-wazuh /usr/bin/node /var/ossec/api/configuration/auth/htpasswd /var/ossec/api/configuration/auth/user $1
|
||||
17
salt/common/tools/sbin/so-wazuh-user-passwd
Normal file
17
salt/common/tools/sbin/so-wazuh-user-passwd
Normal file
@@ -0,0 +1,17 @@
|
||||
#!/bin/bash
|
||||
# Copyright 2014,2015,2016,2017,2018,2019,2020 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/>.
|
||||
|
||||
docker exec -it so-wazuh /usr/bin/node /var/ossec/api/configuration/auth/htpasswd /var/ossec/api/configuration/auth/user $1
|
||||
17
salt/common/tools/sbin/so-wazuh-user-remove
Normal file
17
salt/common/tools/sbin/so-wazuh-user-remove
Normal file
@@ -0,0 +1,17 @@
|
||||
#!/bin/bash
|
||||
# Copyright 2014,2015,2016,2017,2018,2019,2020 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/>.
|
||||
|
||||
docker exec -it so-wazuh /usr/bin/node /var/ossec/api/configuration/auth/htpasswd -D /var/ossec/api/configuration/auth/user $1
|
||||
@@ -2,17 +2,14 @@
|
||||
local_salt_dir=/opt/so/saltstack/local
|
||||
|
||||
zeek_logs_enabled() {
|
||||
|
||||
echo "zeeklogs:" > $local_salt_dir/pillar/zeeklogs.sls
|
||||
echo " enabled:" >> $local_salt_dir/pillar/zeeklogs.sls
|
||||
for BLOG in ${BLOGS[@]}; do
|
||||
for BLOG in "${BLOGS[@]}"; do
|
||||
echo " - $BLOG" | tr -d '"' >> $local_salt_dir/pillar/zeeklogs.sls
|
||||
done
|
||||
|
||||
}
|
||||
|
||||
whiptail_manager_adv_service_zeeklogs() {
|
||||
|
||||
BLOGS=$(whiptail --title "Security Onion Setup" --checklist "Please Select Logs to Send:" 24 78 12 \
|
||||
"conn" "Connection Logging" ON \
|
||||
"dce_rpc" "RPC Logs" ON \
|
||||
@@ -52,7 +49,25 @@ whiptail_manager_adv_service_zeeklogs() {
|
||||
"mysql" "MySQL Logs" ON \
|
||||
"socks" "SOCKS Logs" ON \
|
||||
"x509" "x.509 Logs" ON 3>&1 1>&2 2>&3 )
|
||||
|
||||
local exitstatus=$?
|
||||
|
||||
IFS=' ' read -ra BLOGS <<< "$BLOGS"
|
||||
|
||||
return $exitstatus
|
||||
}
|
||||
|
||||
whiptail_manager_adv_service_zeeklogs
|
||||
zeek_logs_enabled
|
||||
return_code=$?
|
||||
case $return_code in
|
||||
1)
|
||||
whiptail --title "Security Onion Setup" --msgbox "Cancelling. No changes have been made." 8 75
|
||||
;;
|
||||
255)
|
||||
whiptail --title "Security Onion Setup" --msgbox "Whiptail error occured, exiting." 8 75
|
||||
;;
|
||||
*)
|
||||
zeek_logs_enabled
|
||||
;;
|
||||
esac
|
||||
|
||||
|
||||
@@ -16,34 +16,118 @@
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
. /usr/sbin/so-common
|
||||
|
||||
UPDATE_DIR=/tmp/sogh/securityonion
|
||||
INSTALLEDVERSION=$(cat /etc/soversion)
|
||||
INSTALLEDSALTVERSION=$(salt --versions-report | grep Salt: | awk {'print $2'})
|
||||
DEFAULT_SALT_DIR=/opt/so/saltstack/default
|
||||
BATCHSIZE=5
|
||||
SOUP_LOG=/root/soup.log
|
||||
|
||||
exec 3>&1 1>${SOUP_LOG} 2>&1
|
||||
|
||||
manager_check() {
|
||||
# Check to see if this is a manager
|
||||
MANAGERCHECK=$(cat /etc/salt/grains | grep role | awk '{print $2}')
|
||||
if [[ "$MANAGERCHECK" =~ ^('so-eval'|'so-manager'|'so-standalone'|'so-managersearch'|'so-import')$ ]]; then
|
||||
echo "This is a manager. We can proceed."
|
||||
MINIONID=$(salt-call grains.get id --out=txt|awk -F: {'print $2'}|tr -d ' ')
|
||||
add_common() {
|
||||
cp $UPDATE_DIR/salt/common/tools/sbin/so-common $DEFAULT_SALT_DIR/salt/common/tools/sbin/
|
||||
cp $UPDATE_DIR/salt/common/tools/sbin/so-image-common $DEFAULT_SALT_DIR/salt/common/tools/sbin/
|
||||
salt-call state.apply common queue=True
|
||||
echo "Run soup one more time"
|
||||
exit 0
|
||||
}
|
||||
|
||||
airgap_mounted() {
|
||||
# Let's see if the ISO is already mounted.
|
||||
if [ -f /tmp/soagupdate/SecurityOnion/VERSION ]; then
|
||||
echo "The ISO is already mounted"
|
||||
else
|
||||
echo "Please run soup on the manager. The manager controls all updates."
|
||||
exit 0
|
||||
echo ""
|
||||
echo "Looks like we need access to the upgrade content"
|
||||
echo ""
|
||||
echo "If you just copied the .iso file over you can specify the path."
|
||||
echo "If you burned the ISO to a disk the standard way you can specify the device."
|
||||
echo "Example: /home/user/securityonion-2.X.0.iso"
|
||||
echo "Example: /dev/sdx1"
|
||||
echo ""
|
||||
read -p 'Enter the location of the iso: ' ISOLOC
|
||||
if [ -f $ISOLOC ]; then
|
||||
# Mounting the ISO image
|
||||
mkdir -p /tmp/soagupdate
|
||||
mount -t iso9660 -o loop $ISOLOC /tmp/soagupdate
|
||||
# Make sure mounting was successful
|
||||
if [ ! -f /tmp/soagupdate/SecurityOnion/VERSION ]; then
|
||||
echo "Something went wrong trying to mount the ISO."
|
||||
echo "Ensure you verify the ISO that you downloaded."
|
||||
exit 0
|
||||
else
|
||||
echo "ISO has been mounted!"
|
||||
fi
|
||||
elif [ -f $ISOLOC/SecurityOnion/VERSION ]; then
|
||||
ln -s $ISOLOC /tmp/soagupdate
|
||||
echo "Found the update content"
|
||||
else
|
||||
mkdir -p /tmp/soagupdate
|
||||
mount $ISOLOC /tmp/soagupdate
|
||||
if [ ! -f /tmp/soagupdate/SecurityOnion/VERSION ]; then
|
||||
echo "Something went wrong trying to mount the device."
|
||||
echo "Ensure you verify the ISO that you downloaded."
|
||||
exit 0
|
||||
else
|
||||
echo "Device has been mounted!"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
airgap_update_dockers() {
|
||||
if [ $is_airgap -eq 0 ]; then
|
||||
# Let's copy the tarball
|
||||
if [ ! -f $AGDOCKER/registry.tar ]; then
|
||||
echo "Unable to locate registry. Exiting"
|
||||
exit 1
|
||||
else
|
||||
echo "Stopping the registry docker"
|
||||
docker stop so-dockerregistry
|
||||
docker rm so-dockerregistry
|
||||
echo "Copying the new dockers over"
|
||||
tar xvf $AGDOCKER/registry.tar -C /nsm/docker-registry/docker
|
||||
echo "Add Registry back"
|
||||
docker load -i $AGDOCKER/registry_image.tar
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
update_registry() {
|
||||
docker stop so-dockerregistry
|
||||
docker rm so-dockerregistry
|
||||
salt-call state.apply registry queue=True
|
||||
}
|
||||
|
||||
check_airgap() {
|
||||
# See if this is an airgap install
|
||||
AIRGAP=$(cat /opt/so/saltstack/local/pillar/global.sls | grep airgap | awk '{print $2}')
|
||||
if [[ "$AIRGAP" == "True" ]]; then
|
||||
is_airgap=0
|
||||
UPDATE_DIR=/tmp/soagupdate/SecurityOnion
|
||||
AGDOCKER=/tmp/soagupdate/docker
|
||||
AGREPO=/tmp/soagupdate/Packages
|
||||
else
|
||||
is_airgap=1
|
||||
fi
|
||||
}
|
||||
|
||||
check_sudoers() {
|
||||
if grep -q "so-setup" /etc/sudoers; then
|
||||
echo "There is an entry for so-setup in the sudoers file, this can be safely deleted using \"visudo\"."
|
||||
fi
|
||||
}
|
||||
|
||||
clean_dockers() {
|
||||
# Place Holder for cleaning up old docker images
|
||||
echo "Trying to clean up old dockers."
|
||||
docker system prune -a -f
|
||||
|
||||
}
|
||||
|
||||
clone_to_tmp() {
|
||||
# TODO Need to add a air gap option
|
||||
# Clean old files
|
||||
rm -rf /tmp/sogh
|
||||
# Make a temp location for the files
|
||||
@@ -63,7 +147,7 @@ clone_to_tmp() {
|
||||
|
||||
copy_new_files() {
|
||||
# Copy new files over to the salt dir
|
||||
cd /tmp/sogh/securityonion
|
||||
cd $UPDATE_DIR
|
||||
rsync -a salt $DEFAULT_SALT_DIR/
|
||||
rsync -a pillar $DEFAULT_SALT_DIR/
|
||||
chown -R socore:socore $DEFAULT_SALT_DIR/
|
||||
@@ -71,21 +155,9 @@ copy_new_files() {
|
||||
cd /tmp
|
||||
}
|
||||
|
||||
detect_os() {
|
||||
# Detect Base OS
|
||||
echo "Determining Base OS." >> "$SOUP_LOG" 2>&1
|
||||
if [ -f /etc/redhat-release ]; then
|
||||
OS="centos"
|
||||
elif [ -f /etc/os-release ]; then
|
||||
OS="ubuntu"
|
||||
fi
|
||||
echo "Found OS: $OS" >> "$SOUP_LOG" 2>&1
|
||||
}
|
||||
|
||||
highstate() {
|
||||
# Run a highstate but first cancel a running one.
|
||||
salt-call saltutil.kill_all_jobs
|
||||
salt-call state.highstate -l info
|
||||
# Run a highstate.
|
||||
salt-call state.highstate -l info queue=True
|
||||
}
|
||||
|
||||
masterlock() {
|
||||
@@ -112,7 +184,7 @@ masterunlock() {
|
||||
playbook() {
|
||||
echo "Applying playbook settings"
|
||||
if [[ "$INSTALLEDVERSION" =~ rc.1 ]]; then
|
||||
salt-call state.apply playbook.db_init
|
||||
salt-call state.apply playbook.OLD_db_init
|
||||
rm -f /opt/so/rules/elastalert/playbook/*.yaml
|
||||
so-playbook-ruleupdate >> /root/soup_playbook_rule_update.log 2>&1 &
|
||||
fi
|
||||
@@ -124,7 +196,7 @@ pillar_changes() {
|
||||
|
||||
[[ "$INSTALLEDVERSION" =~ rc.1 ]] && rc1_to_rc2
|
||||
[[ "$INSTALLEDVERSION" =~ rc.2 ]] && rc2_to_rc3
|
||||
|
||||
[[ "$INSTALLEDVERSION" =~ rc.3 ]] && rc3_to_2.3.0
|
||||
}
|
||||
|
||||
rc1_to_rc2() {
|
||||
@@ -184,6 +256,28 @@ rc2_to_rc3() {
|
||||
# Enable Strelka Rules
|
||||
sed -i "/ rules:/c\ rules: 1" /opt/so/saltstack/local/pillar/global.sls
|
||||
|
||||
INSTALLEDVERSION=rc.3
|
||||
|
||||
}
|
||||
|
||||
rc3_to_2.3.0() {
|
||||
# Fix Tab Complete
|
||||
if [ ! -f /etc/profile.d/securityonion.sh ]; then
|
||||
echo "complete -cf sudo" > /etc/profile.d/securityonion.sh
|
||||
fi
|
||||
|
||||
{
|
||||
echo "redis_settings:"
|
||||
echo " redis_maxmemory: 827"
|
||||
echo "playbook:"
|
||||
echo " api_key: de6639318502476f2fa5aa06f43f51fb389a3d7f"
|
||||
} >> /opt/so/saltstack/local/pillar/global.sls
|
||||
|
||||
sed -i 's/playbook:/playbook_db:/' /opt/so/saltstack/local/pillar/secrets.sls
|
||||
{
|
||||
echo "playbook_admin: $(tr -dc 'a-zA-Z0-9' < /dev/urandom | fold -w 20 | head -n 1)"
|
||||
echo "playbook_automation: $(tr -dc 'a-zA-Z0-9' < /dev/urandom | fold -w 20 | head -n 1)"
|
||||
} >> /opt/so/saltstack/local/pillar/secrets.sls
|
||||
}
|
||||
|
||||
space_check() {
|
||||
@@ -198,83 +292,18 @@ space_check() {
|
||||
|
||||
}
|
||||
|
||||
update_dockers() {
|
||||
# List all the containers
|
||||
if [ $MANAGERCHECK == 'so-import' ]; then
|
||||
TRUSTED_CONTAINERS=( \
|
||||
"so-idstools" \
|
||||
"so-nginx" \
|
||||
"so-filebeat" \
|
||||
"so-suricata" \
|
||||
"so-soc" \
|
||||
"so-elasticsearch" \
|
||||
"so-kibana" \
|
||||
"so-kratos" \
|
||||
"so-suricata" \
|
||||
"so-registry" \
|
||||
"so-pcaptools" \
|
||||
"so-zeek" )
|
||||
elif [ $MANAGERCHECK != 'so-helix' ]; then
|
||||
TRUSTED_CONTAINERS=( \
|
||||
"so-acng" \
|
||||
"so-thehive-cortex" \
|
||||
"so-curator" \
|
||||
"so-domainstats" \
|
||||
"so-elastalert" \
|
||||
"so-elasticsearch" \
|
||||
"so-filebeat" \
|
||||
"so-fleet" \
|
||||
"so-fleet-launcher" \
|
||||
"so-freqserver" \
|
||||
"so-grafana" \
|
||||
"so-idstools" \
|
||||
"so-influxdb" \
|
||||
"so-kibana" \
|
||||
"so-kratos" \
|
||||
"so-logstash" \
|
||||
"so-minio" \
|
||||
"so-mysql" \
|
||||
"so-nginx" \
|
||||
"so-pcaptools" \
|
||||
"so-playbook" \
|
||||
"so-redis" \
|
||||
"so-soc" \
|
||||
"so-soctopus" \
|
||||
"so-steno" \
|
||||
"so-strelka-frontend" \
|
||||
"so-strelka-manager" \
|
||||
"so-strelka-backend" \
|
||||
"so-strelka-filestream" \
|
||||
"so-suricata" \
|
||||
"so-telegraf" \
|
||||
"so-thehive" \
|
||||
"so-thehive-es" \
|
||||
"so-wazuh" \
|
||||
"so-zeek" )
|
||||
else
|
||||
TRUSTED_CONTAINERS=( \
|
||||
"so-filebeat" \
|
||||
"so-idstools" \
|
||||
"so-logstash" \
|
||||
"so-nginx" \
|
||||
"so-redis" \
|
||||
"so-steno" \
|
||||
"so-suricata" \
|
||||
"so-telegraf" \
|
||||
"so-zeek" )
|
||||
fi
|
||||
unmount_update() {
|
||||
cd /tmp
|
||||
umount /tmp/soagupdate
|
||||
}
|
||||
|
||||
# Download the containers from the interwebs
|
||||
for i in "${TRUSTED_CONTAINERS[@]}"
|
||||
do
|
||||
# Pull down the trusted docker image
|
||||
echo "Downloading $i:$NEWVERSION"
|
||||
docker pull --disable-content-trust=false docker.io/$IMAGEREPO/$i:$NEWVERSION
|
||||
# Tag it with the new registry destination
|
||||
docker tag $IMAGEREPO/$i:$NEWVERSION $HOSTNAME:5000/$IMAGEREPO/$i:$NEWVERSION
|
||||
docker push $HOSTNAME:5000/$IMAGEREPO/$i:$NEWVERSION
|
||||
done
|
||||
|
||||
update_centos_repo() {
|
||||
# Update the files in the repo
|
||||
echo "Syncing new updates to /nsm/repo"
|
||||
rsync -av $AGREPO/* /nsm/repo/
|
||||
echo "Creating repo"
|
||||
createrepo /nsm/repo
|
||||
}
|
||||
|
||||
update_version() {
|
||||
@@ -298,6 +327,10 @@ upgrade_check_salt() {
|
||||
if [ "$INSTALLEDSALTVERSION" == "$NEWSALTVERSION" ]; then
|
||||
echo "You are already running the correct version of Salt for Security Onion."
|
||||
else
|
||||
UPGRADESALT=1
|
||||
fi
|
||||
}
|
||||
upgrade_salt() {
|
||||
SALTUPGRADED=True
|
||||
echo "Performing upgrade of Salt from $INSTALLEDSALTVERSION to $NEWSALTVERSION."
|
||||
echo ""
|
||||
@@ -308,7 +341,11 @@ upgrade_check_salt() {
|
||||
yum versionlock delete "salt-*"
|
||||
echo "Updating Salt packages and restarting services."
|
||||
echo ""
|
||||
sh $UPDATE_DIR/salt/salt/scripts/bootstrap-salt.sh -F -M -x python3 stable "$NEWSALTVERSION"
|
||||
if [ $is_airgap -eq 0 ]; then
|
||||
sh $UPDATE_DIR/salt/salt/scripts/bootstrap-salt.sh -r -F -M -x python3 stable "$NEWSALTVERSION"
|
||||
else
|
||||
sh $UPDATE_DIR/salt/salt/scripts/bootstrap-salt.sh -F -M -x python3 stable "$NEWSALTVERSION"
|
||||
fi
|
||||
echo "Applying yum versionlock for Salt."
|
||||
echo ""
|
||||
yum versionlock add "salt-*"
|
||||
@@ -328,13 +365,12 @@ upgrade_check_salt() {
|
||||
apt-mark hold "salt-master"
|
||||
apt-mark hold "salt-minion"
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
verify_latest_update_script() {
|
||||
# Check to see if the update scripts match. If not run the new one.
|
||||
CURRENTSOUP=$(md5sum /opt/so/saltstack/default/salt/common/tools/sbin/soup | awk '{print $1}')
|
||||
GITSOUP=$(md5sum /tmp/sogh/securityonion/salt/common/tools/sbin/soup | awk '{print $1}')
|
||||
GITSOUP=$(md5sum $UPDATE_DIR/salt/common/tools/sbin/soup | awk '{print $1}')
|
||||
if [[ "$CURRENTSOUP" == "$GITSOUP" ]]; then
|
||||
echo "This version of the soup script is up to date. Proceeding."
|
||||
else
|
||||
@@ -365,13 +401,28 @@ done
|
||||
|
||||
echo "Checking to see if this is a manager."
|
||||
echo ""
|
||||
manager_check
|
||||
require_manager
|
||||
set_minionid
|
||||
echo "Checking to see if this is an airgap install"
|
||||
echo ""
|
||||
check_airgap
|
||||
echo "Found that Security Onion $INSTALLEDVERSION is currently installed."
|
||||
echo ""
|
||||
detect_os
|
||||
set_os
|
||||
echo ""
|
||||
echo "Cloning Security Onion github repo into $UPDATE_DIR."
|
||||
clone_to_tmp
|
||||
if [ $is_airgap -eq 0 ]; then
|
||||
# Let's mount the ISO since this is airgap
|
||||
airgap_mounted
|
||||
else
|
||||
echo "Cloning Security Onion github repo into $UPDATE_DIR."
|
||||
clone_to_tmp
|
||||
fi
|
||||
if [ -f /usr/sbin/so-image-common ]; then
|
||||
. /usr/sbin/so-image-common
|
||||
else
|
||||
add_common
|
||||
fi
|
||||
|
||||
echo ""
|
||||
echo "Verifying we have the latest soup script."
|
||||
verify_latest_update_script
|
||||
@@ -381,26 +432,62 @@ echo "Let's see if we need to update Security Onion."
|
||||
upgrade_check
|
||||
space_check
|
||||
|
||||
echo "Checking for Salt Master and Minion updates."
|
||||
upgrade_check_salt
|
||||
|
||||
echo ""
|
||||
echo "Performing upgrade from Security Onion $INSTALLEDVERSION to Security Onion $NEWVERSION."
|
||||
echo ""
|
||||
echo "Updating dockers to $NEWVERSION."
|
||||
if [ $is_airgap -eq 0 ]; then
|
||||
airgap_update_dockers
|
||||
else
|
||||
update_registry
|
||||
update_docker_containers "soup"
|
||||
fi
|
||||
echo ""
|
||||
echo "Stopping Salt Minion service."
|
||||
systemctl stop salt-minion
|
||||
echo "Killing any remaining Salt Minion processes."
|
||||
pkill -9 -ef /usr/bin/salt-minion
|
||||
echo ""
|
||||
echo "Stopping Salt Master service."
|
||||
systemctl stop salt-master
|
||||
echo ""
|
||||
echo "Checking for Salt Master and Minion updates."
|
||||
upgrade_check_salt
|
||||
|
||||
# Does salt need upgraded. If so update it.
|
||||
if [ "$UPGRADESALT" == "1" ]; then
|
||||
echo "Upgrading Salt"
|
||||
# Update the repo files so it can actually upgrade
|
||||
if [ $is_airgap -eq 0 ]; then
|
||||
update_centos_repo
|
||||
yum clean all
|
||||
fi
|
||||
upgrade_salt
|
||||
fi
|
||||
|
||||
echo "Checking if Salt was upgraded."
|
||||
echo ""
|
||||
# Check that Salt was upgraded
|
||||
if [[ $(salt --versions-report | grep Salt: | awk {'print $2'}) != "$NEWSALTVERSION" ]]; then
|
||||
echo "Salt upgrade failed. Check of indicators of failure in $SOUP_LOG."
|
||||
echo "Once the issue is resolved, run soup again."
|
||||
echo "Exiting."
|
||||
echo ""
|
||||
exit 1
|
||||
else
|
||||
echo "Salt upgrade success."
|
||||
echo ""
|
||||
fi
|
||||
|
||||
echo "Making pillar changes."
|
||||
pillar_changes
|
||||
echo ""
|
||||
|
||||
echo ""
|
||||
echo "Updating dockers to $NEWVERSION."
|
||||
update_dockers
|
||||
# Only update the repo if its airgap
|
||||
if [[ $is_airgap -eq 0 ]] && [[ "$UPGRADESALT" != "1" ]]; then
|
||||
update_centos_repo
|
||||
fi
|
||||
|
||||
echo ""
|
||||
echo "Copying new Security Onion code from $UPDATE_DIR to $DEFAULT_SALT_DIR."
|
||||
@@ -416,9 +503,19 @@ echo ""
|
||||
echo "Starting Salt Master service."
|
||||
systemctl start salt-master
|
||||
|
||||
# Only regenerate osquery packages if Fleet is enabled
|
||||
FLEET_MANAGER=$(lookup_pillar fleet_manager)
|
||||
FLEET_NODE=$(lookup_pillar fleet_node)
|
||||
if [[ "$FLEET_MANAGER" == "True" || "$FLEET_NODE" == "True" ]]; then
|
||||
echo ""
|
||||
echo "Regenerating Osquery Packages.... This will take several minutes."
|
||||
salt-call state.apply fleet.event_gen-packages -l info queue=True
|
||||
echo ""
|
||||
fi
|
||||
|
||||
echo ""
|
||||
echo "Running a highstate to complete the Security Onion upgrade on this manager. This could take several minutes."
|
||||
highstate
|
||||
salt-call state.highstate -l info queue=True
|
||||
echo ""
|
||||
echo "Upgrade from $INSTALLEDVERSION to $NEWVERSION complete."
|
||||
|
||||
@@ -431,17 +528,23 @@ masterunlock
|
||||
echo ""
|
||||
echo "Starting Salt Master service."
|
||||
systemctl start salt-master
|
||||
highstate
|
||||
echo "Running a highstate. This could take several minutes."
|
||||
salt-call state.highstate -l info queue=True
|
||||
playbook
|
||||
unmount_update
|
||||
|
||||
SALTUPGRADED="True"
|
||||
if [[ "$SALTUPGRADED" == "True" ]]; then
|
||||
if [ "$UPGRADESALT" == "1" ]; then
|
||||
echo ""
|
||||
echo "Upgrading Salt on the remaining Security Onion nodes from $INSTALLEDSALTVERSION to $NEWSALTVERSION."
|
||||
salt -C 'not *_eval and not *_helix and not *_manager and not *_managersearch and not *_standalone' -b $BATCHSIZE state.apply salt.minion
|
||||
if [ $is_airgap -eq 0 ]; then
|
||||
salt -C 'not *_eval and not *_helix and not *_manager and not *_managersearch and not *_standalone' cmd.run "yum clean all"
|
||||
fi
|
||||
salt -C 'not *_eval and not *_helix and not *_manager and not *_managersearch and not *_standalone' -b $BATCHSIZE state.apply salt.minion queue=True
|
||||
echo ""
|
||||
fi
|
||||
|
||||
check_sudoers
|
||||
|
||||
}
|
||||
|
||||
main "$@" | tee /dev/fd/3
|
||||
|
||||
@@ -1,2 +1,27 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# Copyright 2014,2015,2016,2017,2018,2019,2020 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/>.
|
||||
|
||||
APP=close
|
||||
lf=/tmp/$APP-pidLockFile
|
||||
# create empty lock file if none exists
|
||||
cat /dev/null >> $lf
|
||||
read lastPID < $lf
|
||||
# if lastPID is not null and a process with that pid exists , exit
|
||||
[ ! -z "$lastPID" -a -d /proc/$lastPID ] && exit
|
||||
echo $$ > $lf
|
||||
|
||||
/usr/sbin/so-curator-closed-delete > /dev/null 2>&1; docker exec so-curator curator --config /etc/curator/config/curator.yml /etc/curator/action/so-zeek-close.yml > /dev/null 2>&1; docker exec so-curator curator --config /etc/curator/config/curator.yml /etc/curator/action/so-beats-close.yml > /dev/null 2>&1; docker exec so-curator curator --config /etc/curator/config/curator.yml /etc/curator/action/so-firewall-close.yml > /dev/null 2>&1; docker exec so-curator curator --config /etc/curator/config/curator.yml /etc/curator/action/so-ids-close.yml > /dev/null 2>&1; docker exec so-curator curator --config /etc/curator/config/curator.yml /etc/curator/action/so-import-close.yml > /dev/null 2>&1; docker exec so-curator curator --config /etc/curator/config/curator.yml /etc/curator/action/so-osquery-close.yml > /dev/null 2>&1; docker exec so-curator curator --config /etc/curator/config/curator.yml /etc/curator/action/so-ossec-close.yml > /dev/null 2>&1; docker exec so-curator curator --config /etc/curator/config/curator.yml /etc/curator/action/so-strelka-close.yml > /dev/null 2>&1; docker exec so-curator curator --config /etc/curator/config/curator.yml /etc/curator/action/so-syslog-close.yml > /dev/null 2>&1
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# Copyright 2014,2015,2016,2017,2018 Security Onion Solutions, LLC
|
||||
# Copyright 2014,2015,2016,2017,2018,2019,2020 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
|
||||
@@ -34,6 +34,13 @@
|
||||
#fi
|
||||
|
||||
# Avoid starting multiple instances
|
||||
if ! pgrep -f "so-curator-closed-delete-delete" >/dev/null; then
|
||||
/usr/sbin/so-curator-closed-delete-delete
|
||||
fi
|
||||
APP=closeddelete
|
||||
lf=/tmp/$APP-pidLockFile
|
||||
# create empty lock file if none exists
|
||||
cat /dev/null >> $lf
|
||||
read lastPID < $lf
|
||||
# if lastPID is not null and a process with that pid exists , exit
|
||||
[ ! -z "$lastPID" -a -d /proc/$lastPID ] && exit
|
||||
echo $$ > $lf
|
||||
|
||||
/usr/sbin/so-curator-closed-delete-delete
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
|
||||
#!/bin/bash
|
||||
|
||||
{%- if grains['role'] in ['so-node', 'so-searchnode', 'so-heavynode'] %}
|
||||
{%- if grains['role'] in ['so-node', 'so-heavynode'] %}
|
||||
{%- set ELASTICSEARCH_HOST = salt['pillar.get']('elasticsearch:mainip', '') -%}
|
||||
{%- set ELASTICSEARCH_PORT = salt['pillar.get']('elasticsearch:es_port', '') -%}
|
||||
{%- set LOG_SIZE_LIMIT = salt['pillar.get']('elasticsearch:log_size_limit', '') -%}
|
||||
@@ -11,7 +11,7 @@
|
||||
{%- set LOG_SIZE_LIMIT = salt['pillar.get']('manager:log_size_limit', '') -%}
|
||||
{%- endif -%}
|
||||
|
||||
# Copyright 2014,2015,2016,2017,2018 Security Onion Solutions, LLC
|
||||
# Copyright 2014,2015,2016,2017,2018,2019,2020 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
|
||||
@@ -26,29 +26,36 @@
|
||||
# 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-elastic-common
|
||||
#. /etc/nsm/securityonion.conf
|
||||
|
||||
LOG="/opt/so/log/curator/so-curator-closed-delete.log"
|
||||
|
||||
overlimit() {
|
||||
|
||||
[[ $(du -hs --block-size=1GB /nsm/elasticsearch/nodes | awk '{print $1}' ) -gt "{{LOG_SIZE_LIMIT}}" ]]
|
||||
}
|
||||
|
||||
closedindices() {
|
||||
|
||||
INDICES=$(curl -s -k {% if grains['role'] in ['so-node','so-heavynode'] %}https://{% endif %}{{ELASTICSEARCH_HOST}}:{{ELASTICSEARCH_PORT}}/_cat/indices?h=index\&expand_wildcards=closed 2> /dev/null)
|
||||
[ $? -eq 1 ] && return false
|
||||
echo ${INDICES} | grep -q -E "(logstash-|so-)"
|
||||
}
|
||||
|
||||
# Check for 2 conditions:
|
||||
# 1. Are Elasticsearch indices using more disk space than LOG_SIZE_LIMIT?
|
||||
# 2. Are there any closed logstash-, or so- indices that we can delete?
|
||||
# 2. Are there any closed indices that we can delete?
|
||||
# If both conditions are true, keep on looping until one of the conditions is false.
|
||||
while [[ $(du -hs --block-size=1GB /nsm/elasticsearch/nodes | awk '{print $1}' ) -gt "{{LOG_SIZE_LIMIT}}" ]] &&
|
||||
curl -s {{ELASTICSEARCH_HOST}}:{{ELASTICSEARCH_PORT}}/_cat/indices | grep -E "^ close (logstash-|so-)" > /dev/null; do
|
||||
while overlimit && closedindices; do
|
||||
|
||||
# We need to determine OLDEST_INDEX.
|
||||
# First, get the list of closed indices that are prefixed with "logstash-" or "so-".
|
||||
# For example: logstash-ids-YYYY.MM.DD
|
||||
# We need to determine OLDEST_INDEX:
|
||||
# First, get the list of closed indices using _cat/indices?h=index\&expand_wildcards=closed.
|
||||
# Then, sort by date by telling sort to use hyphen as delimiter and then sort on the third field.
|
||||
# Finally, select the first entry in that sorted list.
|
||||
OLDEST_INDEX=$(curl -s {{ELASTICSEARCH_HOST}}:{{ELASTICSEARCH_PORT}}/_cat/indices | grep -E "^ close (logstash-|so-)" | awk '{print $2}' | sort -t- -k3 | head -1)
|
||||
|
||||
OLDEST_INDEX=$(curl -s -k {% if grains['role'] in ['so-node','so-heavynode'] %}https://{% endif %}{{ELASTICSEARCH_HOST}}:{{ELASTICSEARCH_PORT}}/_cat/indices?h=index\&expand_wildcards=closed | grep -E "(logstash-|so-)" | sort -t- -k3 | head -1)
|
||||
|
||||
# Now that we've determined OLDEST_INDEX, ask Elasticsearch to delete it.
|
||||
curl -XDELETE {{ELASTICSEARCH_HOST}}:{{ELASTICSEARCH_PORT}}/${OLDEST_INDEX}
|
||||
curl -XDELETE -k {% if grains['role'] in ['so-node','so-heavynode'] %}https://{% endif %}{{ELASTICSEARCH_HOST}}:{{ELASTICSEARCH_PORT}}/${OLDEST_INDEX}
|
||||
|
||||
# Finally, write a log entry that says we deleted it.
|
||||
echo "$(date) - Used disk space exceeds LOG_SIZE_LIMIT ({{LOG_SIZE_LIMIT}} GB) - Index ${OLDEST_INDEX} deleted ..." >> ${LOG}
|
||||
|
||||
done
|
||||
done
|
||||
@@ -1,2 +1,27 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# Copyright 2014,2015,2016,2017,2018,2019,2020 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/>.
|
||||
|
||||
APP=delete
|
||||
lf=/tmp/$APP-pidLockFile
|
||||
# create empty lock file if none exists
|
||||
cat /dev/null >> $lf
|
||||
read lastPID < $lf
|
||||
# if lastPID is not null and a process with that pid exists , exit
|
||||
[ ! -z "$lastPID" -a -d /proc/$lastPID ] && exit
|
||||
echo $$ > $lf
|
||||
|
||||
docker exec so-curator curator --config /etc/curator/config/curator.yml /etc/curator/action/delete.yml > /dev/null 2>&1
|
||||
|
||||
@@ -12,11 +12,11 @@ client:
|
||||
- {{elasticsearch}}
|
||||
port: 9200
|
||||
url_prefix:
|
||||
use_ssl: False
|
||||
{% if grains['role'] in ['so-node', 'so-heavynode'] %} use_ssl: True{% else %} use_ssl: False{% endif %}
|
||||
certificate:
|
||||
client_cert:
|
||||
client_key:
|
||||
ssl_no_validate: False
|
||||
{% if grains['role'] in ['so-node', 'so-heavynode'] %} ssl_no_validate: True{% else %} ssl_no_validate: False{% endif %}
|
||||
http_auth:
|
||||
timeout: 30
|
||||
master_only: False
|
||||
|
||||
@@ -127,6 +127,12 @@ so-curator:
|
||||
- /opt/so/conf/curator/curator.yml:/etc/curator/config/curator.yml:ro
|
||||
- /opt/so/conf/curator/action/:/etc/curator/action:ro
|
||||
- /opt/so/log/curator:/var/log/curator:rw
|
||||
|
||||
append_so-curator_so-status.conf:
|
||||
file.append:
|
||||
- name: /opt/so/conf/so-status/so-status.conf
|
||||
- text: so-curator
|
||||
|
||||
# Begin Curator Cron Jobs
|
||||
|
||||
# Close
|
||||
|
||||
45
salt/docker_clean/init.sls
Normal file
45
salt/docker_clean/init.sls
Normal file
@@ -0,0 +1,45 @@
|
||||
{% set IMAGEREPO = salt['pillar.get']('global:imagerepo') %}
|
||||
{% set MANAGER = salt['grains.get']('master') %}
|
||||
{% set OLDVERSIONS = ['2.0.0-rc.1','2.0.1-rc.1','2.0.2-rc.1','2.0.3-rc.1','2.1.0-rc.2','2.2.0-rc.3','2.3.0','2.3.1']%}
|
||||
|
||||
{% for VERSION in OLDVERSIONS %}
|
||||
remove_images_{{ VERSION }}:
|
||||
docker_image.absent:
|
||||
- force: True
|
||||
- images:
|
||||
- '{{ MANAGER }}:5000/{{ IMAGEREPO }}/so-acng:{{ VERSION }}'
|
||||
- '{{ MANAGER }}:5000/{{ IMAGEREPO }}/so-thehive-cortex:{{ VERSION }}'
|
||||
- '{{ MANAGER }}:5000/{{ IMAGEREPO }}/so-curator:{{ VERSION }}'
|
||||
- '{{ MANAGER }}:5000/{{ IMAGEREPO }}/so-domainstats:{{ VERSION }}'
|
||||
- '{{ MANAGER }}:5000/{{ IMAGEREPO }}/so-elastalert:{{ VERSION }}'
|
||||
- '{{ MANAGER }}:5000/{{ IMAGEREPO }}/so-elasticsearch:{{ VERSION }}'
|
||||
- '{{ MANAGER }}:5000/{{ IMAGEREPO }}/so-filebeat:{{ VERSION }}'
|
||||
- '{{ MANAGER }}:5000/{{ IMAGEREPO }}/so-fleet:{{ VERSION }}'
|
||||
- '{{ MANAGER }}:5000/{{ IMAGEREPO }}/so-fleet-launcher:{{ VERSION }}'
|
||||
- '{{ MANAGER }}:5000/{{ IMAGEREPO }}/so-freqserver:{{ VERSION }}'
|
||||
- '{{ MANAGER }}:5000/{{ IMAGEREPO }}/so-grafana:{{ VERSION }}'
|
||||
- '{{ MANAGER }}:5000/{{ IMAGEREPO }}/so-idstools:{{ VERSION }}'
|
||||
- '{{ MANAGER }}:5000/{{ IMAGEREPO }}/so-influxdb:{{ VERSION }}'
|
||||
- '{{ MANAGER }}:5000/{{ IMAGEREPO }}/so-kibana:{{ VERSION }}'
|
||||
- '{{ MANAGER }}:5000/{{ IMAGEREPO }}/so-kratos:{{ VERSION }}'
|
||||
- '{{ MANAGER }}:5000/{{ IMAGEREPO }}/so-logstash:{{ VERSION }}'
|
||||
- '{{ MANAGER }}:5000/{{ IMAGEREPO }}/so-minio:{{ VERSION }}'
|
||||
- '{{ MANAGER }}:5000/{{ IMAGEREPO }}/so-mysql:{{ VERSION }}'
|
||||
- '{{ MANAGER }}:5000/{{ IMAGEREPO }}/so-nginx:{{ VERSION }}'
|
||||
- '{{ MANAGER }}:5000/{{ IMAGEREPO }}/so-pcaptools:{{ VERSION }}'
|
||||
- '{{ MANAGER }}:5000/{{ IMAGEREPO }}/so-playbook:{{ VERSION }}'
|
||||
- '{{ MANAGER }}:5000/{{ IMAGEREPO }}/so-redis:{{ VERSION }}'
|
||||
- '{{ MANAGER }}:5000/{{ IMAGEREPO }}/so-soc:{{ VERSION }}'
|
||||
- '{{ MANAGER }}:5000/{{ IMAGEREPO }}/so-soctopus:{{ VERSION }}'
|
||||
- '{{ MANAGER }}:5000/{{ IMAGEREPO }}/so-steno:{{ VERSION }}'
|
||||
- '{{ MANAGER }}:5000/{{ IMAGEREPO }}/so-strelka-frontend:{{ VERSION }}'
|
||||
- '{{ MANAGER }}:5000/{{ IMAGEREPO }}/so-strelka-manager:{{ VERSION }}'
|
||||
- '{{ MANAGER }}:5000/{{ IMAGEREPO }}/so-strelka-backend:{{ VERSION }}'
|
||||
- '{{ MANAGER }}:5000/{{ IMAGEREPO }}/so-strelka-filestream:{{ VERSION }}'
|
||||
- '{{ MANAGER }}:5000/{{ IMAGEREPO }}/so-suricata:{{ VERSION }}'
|
||||
- '{{ MANAGER }}:5000/{{ IMAGEREPO }}/so-telegraf:{{ VERSION }}'
|
||||
- '{{ MANAGER }}:5000/{{ IMAGEREPO }}/so-thehive:{{ VERSION }}'
|
||||
- '{{ MANAGER }}:5000/{{ IMAGEREPO }}/so-thehive-es:{{ VERSION }}'
|
||||
- '{{ MANAGER }}:5000/{{ IMAGEREPO }}/so-wazuh:{{ VERSION }}'
|
||||
- '{{ MANAGER }}:5000/{{ IMAGEREPO }}/so-zeek:{{ VERSION }}'
|
||||
{% endfor %}
|
||||
@@ -43,19 +43,24 @@ dstatslogdir:
|
||||
|
||||
so-domainstatsimage:
|
||||
cmd.run:
|
||||
- name: docker pull --disable-content-trust=false docker.io/{{ IMAGEREPO }}/so-domainstats:HH1.0.3
|
||||
- name: docker pull {{ MANAGER }}:5000/{{ IMAGEREPO }}/so-domainstats:{{ VERSION }}
|
||||
|
||||
so-domainstats:
|
||||
docker_container.running:
|
||||
- require:
|
||||
- so-domainstatsimage
|
||||
- image: docker.io/{{ IMAGEREPO }}/so-domainstats:HH1.0.3
|
||||
- image: {{ MANAGER }}:5000/{{ IMAGEREPO }}/so-domainstats:{{ VERSION }}
|
||||
- hostname: domainstats
|
||||
- name: so-domainstats
|
||||
- user: domainstats
|
||||
- binds:
|
||||
- /opt/so/log/domainstats:/var/log/domain_stats
|
||||
|
||||
append_so-domainstats_so-status.conf:
|
||||
file.append:
|
||||
- name: /opt/so/conf/so-status/so-status.conf
|
||||
- text: so-domainstats
|
||||
|
||||
{% else %}
|
||||
|
||||
domainstats_state_not_allowed:
|
||||
|
||||
@@ -16,7 +16,7 @@ class PlaybookESAlerter(Alerter):
|
||||
today = strftime("%Y.%m.%d", gmtime())
|
||||
timestamp = strftime("%Y-%m-%d"'T'"%H:%M:%S", gmtime())
|
||||
headers = {"Content-Type": "application/json"}
|
||||
payload = {"rule.name": self.rule['play_title'],"event.severity": self.rule['event.severity'],"kibana_pivot": self.rule['kibana_pivot'],"soc_pivot": self.rule['soc_pivot'],"event.module": self.rule['event.module'],"event.dataset": self.rule['event.dataset'],"play_url": self.rule['play_url'],"sigma_level": self.rule['sigma_level'],"rule.category": self.rule['rule.category'],"event_data": match, "@timestamp": timestamp}
|
||||
payload = {"rule": { "name": self.rule['play_title'],"case_template": self.rule['play_id'],"uuid": self.rule['play_id'],"category": self.rule['rule.category']},"event":{ "severity": self.rule['event.severity'],"module": self.rule['event.module'],"dataset": self.rule['event.dataset'],"severity_label": self.rule['sigma_level']},"kibana_pivot": self.rule['kibana_pivot'],"soc_pivot": self.rule['soc_pivot'],"play_url": self.rule['play_url'],"sigma_level": self.rule['sigma_level'],"event_data": match, "@timestamp": timestamp}
|
||||
url = f"http://{self.rule['elasticsearch_host']}/so-playbook-alerts-{today}/_doc/"
|
||||
requests.post(url, data=json.dumps(payload), headers=headers, verify=False)
|
||||
|
||||
|
||||
@@ -1,47 +0,0 @@
|
||||
{% set es = salt['pillar.get']('global:managerip', '') %}
|
||||
{% set hivehost = salt['pillar.get']('global:managerip', '') %}
|
||||
{% set hivekey = salt['pillar.get']('global:hivekey', '') %}
|
||||
{% set MANAGER = salt['pillar.get']('global:url_base', '') %}
|
||||
|
||||
# Elastalert rule to forward Suricata alerts from Security Onion to a specified TheHive instance.
|
||||
#
|
||||
es_host: {{es}}
|
||||
es_port: 9200
|
||||
name: Suricata-Alert
|
||||
type: any
|
||||
index: "*:so-ids-*"
|
||||
buffer_time:
|
||||
minutes: 5
|
||||
query_key: ["rule.uuid","source.ip","destination.ip"]
|
||||
realert:
|
||||
days: 1
|
||||
filter:
|
||||
- query:
|
||||
query_string:
|
||||
query: "event.module: suricata AND rule.severity:(1 OR 2)"
|
||||
|
||||
alert: hivealerter
|
||||
|
||||
hive_connection:
|
||||
hive_host: http://{{hivehost}}
|
||||
hive_port: 9000/thehive
|
||||
hive_apikey: {{hivekey}}
|
||||
|
||||
hive_proxies:
|
||||
http: ''
|
||||
https: ''
|
||||
|
||||
hive_alert_config:
|
||||
title: '{match[rule][name]}'
|
||||
type: 'NIDS'
|
||||
source: 'SecurityOnion'
|
||||
description: "`SOC Hunt Pivot:` \n\n <https://{{MANAGER}}/#/hunt?q=network.community_id%3A%20%20%22{match[network][community_id]}%22%20%7C%20groupby%20source.ip%20destination.ip,event.module,%20event.dataset> \n\n `Kibana Dashboard Pivot:` \n\n <https://{{MANAGER}}/kibana/app/kibana#/dashboard/30d0ac90-729f-11ea-8dd2-9d8795a1200b?_g=(filters:!(('$state':(store:globalState),meta:(alias:!n,disabled:!f,index:'2289a0c0-6970-11ea-a0cd-ffa0f6a1bc29',key:network.community_id,negate:!f,params:(query:'{match[network][community_id]}'),type:phrase),query:(match_phrase:(network.community_id:'{match[network][community_id]}')))),refreshInterval:(pause:!t,value:0),time:(from:now-7d,to:now))> \n\n `IPs: `{match[source][ip]}:{match[source][port]} --> {match[destination][ip]}:{match[destination][port]} \n\n `Signature:`{match[rule][rule]}"
|
||||
severity: 2
|
||||
tags: ['{match[rule][uuid]}','{match[source][ip]}','{match[destination][ip]}']
|
||||
tlp: 3
|
||||
status: 'New'
|
||||
follow: True
|
||||
|
||||
hive_observable_data_mapping:
|
||||
- ip: '{match[source][ip]}'
|
||||
- ip: '{match[destination][ip]}'
|
||||
@@ -1,45 +0,0 @@
|
||||
{% set es = salt['pillar.get']('global:managerip', '') %}
|
||||
{% set hivehost = salt['pillar.get']('global:managerip', '') %}
|
||||
{% set hivekey = salt['pillar.get']('global:hivekey', '') %}
|
||||
{% set MANAGER = salt['pillar.get']('global:url_base', '') %}
|
||||
|
||||
# Elastalert rule to forward high level Wazuh alerts from Security Onion to a specified TheHive instance.
|
||||
#
|
||||
es_host: {{es}}
|
||||
es_port: 9200
|
||||
name: Wazuh-Alert
|
||||
type: any
|
||||
index: "*:so-ossec-*"
|
||||
buffer_time:
|
||||
minutes: 5
|
||||
realert:
|
||||
days: 1
|
||||
filter:
|
||||
- query:
|
||||
query_string:
|
||||
query: "event.module: ossec AND rule.level>=8"
|
||||
|
||||
alert: hivealerter
|
||||
|
||||
hive_connection:
|
||||
hive_host: http://{{hivehost}}
|
||||
hive_port: 9000/thehive
|
||||
hive_apikey: {{hivekey}}
|
||||
|
||||
hive_proxies:
|
||||
http: ''
|
||||
https: ''
|
||||
|
||||
hive_alert_config:
|
||||
title: '{match[rule][name]}'
|
||||
type: 'wazuh'
|
||||
source: 'SecurityOnion'
|
||||
description: "`SOC Hunt Pivot:` \n\n <https://{{MANAGER}}/#/hunt?q=event.module%3A%20ossec%20AND%20rule.id%3A{match[rule][id]}%20%7C%20groupby%20host.name%20rule.name> \n\n `Kibana Dashboard Pivot:` \n\n <https://{{MANAGER}}/kibana/app/kibana#/dashboard/ed6f7e20-e060-11e9-8f0c-2ddbf5ed9290?_g=(refreshInterval:(display:Off,pause:!f,value:0),time:(from:now-24h,mode:quick,to:now))&_a=(columns:!(_source),index:'*:logstash-*',interval:auto,query:(query_string:(analyze_wildcard:!t,query:'sid:')),sort:!('@timestamp',desc))>"
|
||||
severity: 2
|
||||
tags: ['{match[rule][id]}','{match[host][name]}']
|
||||
tlp: 3
|
||||
status: 'New'
|
||||
follow: True
|
||||
|
||||
hive_observable_data_mapping:
|
||||
- other: '{match[host][name]}'
|
||||
@@ -91,14 +91,6 @@ elastasomodulesync:
|
||||
- group: 933
|
||||
- makedirs: True
|
||||
|
||||
elastarulesync:
|
||||
file.recurse:
|
||||
- name: /opt/so/rules/elastalert
|
||||
- source: salt://elastalert/files/rules/so
|
||||
- user: 933
|
||||
- group: 933
|
||||
- template: jinja
|
||||
|
||||
elastaconf:
|
||||
file.managed:
|
||||
- name: /opt/so/conf/elastalert/elastalert_config.yaml
|
||||
@@ -129,6 +121,12 @@ so-elastalert:
|
||||
- {{MANAGER_URL}}:{{MANAGER_IP}}
|
||||
- require:
|
||||
- module: wait_for_elasticsearch
|
||||
|
||||
append_so-elastalert_so-status.conf:
|
||||
file.append:
|
||||
- name: /opt/so/conf/so-status/so-status.conf
|
||||
- text: so-elastalert
|
||||
|
||||
{% endif %}
|
||||
|
||||
{% else %}
|
||||
@@ -137,4 +135,4 @@ elastalert_state_not_allowed:
|
||||
test.fail_without_changes:
|
||||
- name: elastalert_state_not_allowed
|
||||
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
@@ -21,40 +21,30 @@
|
||||
"properties": ["ip", "country_iso_code", "country_name", "continent_name", "region_iso_code", "region_name", "city_name", "timezone", "location"]
|
||||
}
|
||||
},
|
||||
{
|
||||
"split": {
|
||||
"field": "_index",
|
||||
"target_field": "index_name_prefix",
|
||||
"separator": "-"
|
||||
}
|
||||
},
|
||||
{
|
||||
"date_index_name": {
|
||||
"field": "@timestamp",
|
||||
"index_name_prefix": "{{index_name_prefix.0}}-{{index_name_prefix.1}}-",
|
||||
"date_rounding": "d",
|
||||
"ignore_failure": true,
|
||||
"index_name_format": "yyyy.MM.dd"
|
||||
}
|
||||
},
|
||||
{ "set": { "if": "ctx.event?.severity == 1", "field": "event.severity_label", "value": "low", "override": true } },
|
||||
{ "set": { "if": "ctx.event?.severity == 2", "field": "event.severity_label", "value": "medium", "override": true } },
|
||||
{ "set": { "if": "ctx.event?.severity == 3", "field": "event.severity_label", "value": "high", "override": true } },
|
||||
{ "set": { "if": "ctx.event?.severity == 4", "field": "event.severity_label", "value": "critical", "override": true } },
|
||||
{ "rename": { "field": "module", "target_field": "event.module", "ignore_failure": true, "ignore_missing": true } },
|
||||
{ "rename": { "field": "dataset", "target_field": "event.dataset", "ignore_failure": true, "ignore_missing": true } },
|
||||
{ "rename": { "field": "category", "target_field": "event.category", "ignore_failure": true, "ignore_missing": true } },
|
||||
{ "rename": { "field": "message2.community_id", "target_field": "network.community_id", "ignore_failure": true, "ignore_missing": true } },
|
||||
{ "lowercase": { "field": "event.dataset", "ignore_failure": true, "ignore_missing": true } },
|
||||
{ "set": { "if": "ctx.event?.severity == 1", "field": "event.severity_label", "value": "low", "override": true } },
|
||||
{ "set": { "if": "ctx.event?.severity == 2", "field": "event.severity_label", "value": "medium", "override": true } },
|
||||
{ "set": { "if": "ctx.event?.severity == 3", "field": "event.severity_label", "value": "high", "override": true } },
|
||||
{ "set": { "if": "ctx.event?.severity == 4", "field": "event.severity_label", "value": "critical", "override": true } },
|
||||
{ "rename": { "field": "fields.category", "target_field": "event.category", "ignore_failure": true, "ignore_missing": true } },
|
||||
{ "rename": { "field": "fields.module", "target_field": "event.module", "ignore_failure": true, "ignore_missing": true } },
|
||||
{ "rename": { "field": "module", "target_field": "event.module", "ignore_failure": true, "ignore_missing": true } },
|
||||
{ "rename": { "field": "dataset", "target_field": "event.dataset", "ignore_failure": true, "ignore_missing": true } },
|
||||
{ "rename": { "field": "category", "target_field": "event.category", "ignore_failure": true, "ignore_missing": true } },
|
||||
{ "rename": { "field": "message2.community_id", "target_field": "network.community_id", "ignore_failure": true, "ignore_missing": true } },
|
||||
{ "lowercase": { "field": "event.dataset", "ignore_failure": true, "ignore_missing": true } },
|
||||
{ "convert": { "field": "destination.port", "type": "integer", "ignore_failure": true, "ignore_missing": true } },
|
||||
{ "convert": { "field": "source.port", "type": "integer", "ignore_failure": true, "ignore_missing": true } },
|
||||
{ "convert": { "field": "log.id.uid", "type": "string", "ignore_failure": true, "ignore_missing": true } },
|
||||
{ "convert": { "field": "agent.id", "type": "string", "ignore_failure": true, "ignore_missing": true } },
|
||||
{ "convert": { "field": "event.severity", "type": "integer", "ignore_failure": true, "ignore_missing": true } },
|
||||
{
|
||||
"remove": {
|
||||
"field": [ "index_name_prefix", "message2", "type" ],
|
||||
"ignore_failure": true
|
||||
{ "remove": { "field": [ "message2", "type", "fields", "category", "module", "dataset" ], "ignore_missing": true, "ignore_failure": true } },
|
||||
{
|
||||
"date_index_name": {
|
||||
"field": "@timestamp",
|
||||
"index_name_prefix": "{{ _index }}-",
|
||||
"date_rounding": "d",
|
||||
"ignore_failure": true,
|
||||
"index_name_format": "yyyy.MM.dd"
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
17
salt/elasticsearch/files/ingest/common.nids
Normal file
17
salt/elasticsearch/files/ingest/common.nids
Normal file
@@ -0,0 +1,17 @@
|
||||
{
|
||||
"description" : "common.nids",
|
||||
"processors" : [
|
||||
{ "convert": { "if": "ctx.rule.uuid != null", "field": "rule.uuid", "type": "integer" } },
|
||||
{ "set": { "if": "ctx.rule?.uuid < 1000000", "field": "rule.reference", "value": "https://www.snort.org/search?query={{rule.gid}}-{{rule.uuid}}" } },
|
||||
{ "set": { "if": "ctx.rule?.uuid > 1999999", "field": "rule.reference", "value": "https://doc.emergingthreats.net/{{rule.uuid}}" } },
|
||||
{ "convert": { "if": "ctx.rule.uuid != null", "field": "rule.uuid", "type": "string" } },
|
||||
{ "dissect": { "if": "ctx.rule.name != null", "field": "rule.name", "pattern" : "%{rule_type} %{rest_of_rulename} ", "ignore_failure": true } },
|
||||
{ "set": { "if": "ctx.rule_type == 'GPL'", "field": "rule.ruleset", "value": "Snort GPL" } },
|
||||
{ "set": { "if": "ctx.rule_type == 'ET'", "field": "rule.ruleset", "value": "Emerging Threats" } },
|
||||
{ "set": { "if": "ctx.rule.severity == 3", "field": "event.severity", "value": 1, "override": true } },
|
||||
{ "set": { "if": "ctx.rule.severity == 2", "field": "event.severity", "value": 2, "override": true } },
|
||||
{ "set": { "if": "ctx.rule.severity == 1", "field": "event.severity", "value": 3, "override": true } },
|
||||
{ "remove": { "field": ["rule_type", "rest_of_rulename"], "ignore_failure": true } },
|
||||
{ "pipeline": { "name": "common" } }
|
||||
]
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
{
|
||||
"description" : "common_nids",
|
||||
"processors" : [
|
||||
{ "convert": { "field": "sid", "type": "integer" } },
|
||||
{ "set": { "if": "ctx.sid < 1000000", "field": "signature_info", "value": "https://www.snort.org/search?query={{gid}}-{{sid}}" } },
|
||||
{ "set": { "if": "ctx.sid > 1999999", "field": "signature_info", "value": "https://doc.emergingthreats.net/{{sid}}" } },
|
||||
{ "remove": { "if": "ctx.sid > 2999999", "field": "signature_info" } },
|
||||
{ "set": { "if": "ctx.priority == '1'", "field": "severity", "value": "High" } },
|
||||
{ "set": { "if": "ctx.priority == '2'", "field": "severity", "value": "Medium" } },
|
||||
{ "set": { "if": "ctx.priority == '3'", "field": "severity", "value": "Low" } },
|
||||
{ "dissect": { "field": "alert", "pattern" : "%{rule_type} %{category} ", "ignore_failure": true } },
|
||||
{ "set": { "if": "ctx.rule_type == 'GPL'", "field": "rule_type", "value": "Snort GPL" } },
|
||||
{ "set": { "if": "ctx.rule_type == 'ET'", "field": "rule_type", "value": "Emerging Threats" } },
|
||||
{ "lowercase": { "field": "category", "ignore_failure": true } },
|
||||
{ "pipeline": { "name": "common" } }
|
||||
]
|
||||
}
|
||||
59
salt/elasticsearch/files/ingest/filterlog
Normal file
59
salt/elasticsearch/files/ingest/filterlog
Normal file
@@ -0,0 +1,59 @@
|
||||
{
|
||||
"description" : "filterlog",
|
||||
"processors" : [
|
||||
{
|
||||
"dissect": {
|
||||
"field": "real_message",
|
||||
"pattern" : "%{rule.uuid},%{rule.sub_uuid},%{firewall.anchor},%{firewall.tracker_id},%{interface.name},%{rule.reason},%{rule.action},%{network.direction},%{ip.version},%{firewall.sub_message}",
|
||||
"on_failure" : [ {"set" : {"field" : "error.message","value" : "{{ _ingest.on_failure_message }}"}}]
|
||||
}
|
||||
},
|
||||
{
|
||||
"dissect": {
|
||||
"if": "ctx.ip.version == '4'",
|
||||
"field": "firewall.sub_message",
|
||||
"pattern" : "%{ip.tos},%{ip.ecn},%{ip.ttl},%{ip.id},%{ip.offset},%{ip.flags},%{network.transport_id},%{network.transport},%{data.length},%{source.ip},%{destination.ip},%{ip_sub_msg}",
|
||||
"on_failure" : [ {"set" : {"field" : "error.message","value" : "{{ _ingest.on_failure_message }}"}}]
|
||||
}
|
||||
},
|
||||
{
|
||||
"dissect": {
|
||||
"if": "ctx.ip?.version == '6'",
|
||||
"field": "firewall.sub_message",
|
||||
"pattern" : "%{network.class},%{network.flow_label},%{network.hop_limit},%{network.transport},%{network.transport_id},%{data.length},%{source.ip},%{destination.ip},%{ip_sub_msg}",
|
||||
"on_failure" : [ {"set" : {"field" : "error.message","value" : "{{ _ingest.on_failure_message }}"}}]
|
||||
}
|
||||
},
|
||||
{
|
||||
"dissect": {
|
||||
"if": "ctx.network?.transport == 'tcp'",
|
||||
"field": "ip_sub_msg",
|
||||
"pattern" : "%{source.port},%{destination.port},%{data.length},%{tcp.flags},",
|
||||
"on_failure" : [ {"set" : {"field" : "error.message","value" : "{{ _ingest.on_failure_message }}"}}]
|
||||
}
|
||||
},
|
||||
{
|
||||
"dissect": {
|
||||
"if": "ctx.network?.transport == 'udp'",
|
||||
"field": "ip_sub_msg",
|
||||
"pattern" : "%{source.port},%{destination.port},%{data.length}",
|
||||
"on_failure" : [ {"set" : {"field" : "error.message","value" : "{{ _ingest.on_failure_message }}"}}]
|
||||
}
|
||||
},
|
||||
{
|
||||
"split": {
|
||||
"if": "ctx.ip.version =='6' && ctx.network?.transport == 'Options'",
|
||||
"field": "ip_sub_msg",
|
||||
"target_field": "ip.options",
|
||||
"separator" : ",",
|
||||
"on_failure" : [ {"set" : {"field" : "error.message","value" : "{{ _ingest.on_failure_message }}"}}]
|
||||
}
|
||||
},
|
||||
{ "set": { "field": "_index", "value": "so-firewall", "override": true } },
|
||||
{ "set": { "if": "ctx.network?.transport_id == '0'", "field": "network.transport", "value": "icmp", "override": true } },
|
||||
{"community_id": { "if": "ctx.network?.transport != null", "field":["source.ip","source.port","destination.ip","destination.port","network.transport"],"target_field":"network.community_id"}},
|
||||
{ "set": { "field": "module", "value": "pfsense", "override": true } },
|
||||
{ "set": { "field": "dataset", "value": "firewall", "override": true } },
|
||||
{ "remove": { "field": ["real_message", "ip_sub_msg", "firewall.sub_message"], "ignore_failure": true } }
|
||||
]
|
||||
}
|
||||
@@ -1,52 +1,69 @@
|
||||
{
|
||||
"description" : "ossec",
|
||||
"processors" : [
|
||||
{ "json": { "field": "message", "target_field": "message2", "ignore_failure": true } },
|
||||
{ "rename": { "field": "message2.agent", "target_field": "agent", "ignore_missing": true } },
|
||||
{ "rename": { "field": "message2.data", "target_field": "data", "ignore_missing": true } },
|
||||
{ "rename": { "field": "message2.decoder", "target_field": "decoder", "ignore_missing": true } },
|
||||
{ "rename": { "field": "message2.full_log", "target_field": "full_log", "ignore_missing": true } },
|
||||
{ "rename": { "field": "message2.id", "target_field": "log.id.id", "ignore_missing": true } },
|
||||
{ "rename": { "field": "message2.location", "target_field": "location", "ignore_missing": true } },
|
||||
{ "rename": { "field": "message2.manager", "target_field": "manager", "ignore_missing": true } },
|
||||
{ "rename": { "field": "message2.predecoder", "target_field": "predecoder", "ignore_missing": true } },
|
||||
{ "rename": { "field": "message2.timestamp", "target_field": "timestamp", "ignore_missing": true } },
|
||||
{ "rename": { "field": "message2.rule", "target_field": "rule", "ignore_missing": true } },
|
||||
{ "rename": { "field": "data.command", "target_field": "command", "ignore_missing": true } },
|
||||
{ "rename": { "field": "data.dstip", "target_field": "destination.ip", "ignore_missing": true } },
|
||||
{ "rename": { "field": "data.dstport", "target_field": "destination.port", "ignore_missing": true } },
|
||||
{ "rename": { "field": "data.dstuser", "target_field": "user.escalated", "ignore_missing": true } },
|
||||
{ "rename": { "field": "data.srcip", "target_field": "source.ip", "ignore_missing": true } },
|
||||
{ "rename": { "field": "data.srcuser", "target_field": "source.user", "ignore_missing": true } },
|
||||
{ "rename": { "field": "data.win.eventdata.destinationHostname", "target_field": "destination.hostname", "ignore_missing": true } },
|
||||
{ "rename": { "field": "data.win.eventdata.destinationIp", "target_field": "destination.ip", "ignore_missing": true } },
|
||||
{ "rename": { "field": "data.win.eventdata.destinationPort", "target_field": "destination.port", "ignore_missing": true } },
|
||||
{ "rename": { "field": "data.win.eventdata.image", "target_field": "image_path", "ignore_missing": true } },
|
||||
{ "rename": { "field": "data.win.eventdata.parentImage", "target_field": "parent_image_path", "ignore_missing": true } },
|
||||
{ "rename": { "field": "data.win.eventdata.sourceHostname", "target_field": "source.hostname", "ignore_missing": true } },
|
||||
{ "rename": { "field": "data.win.eventdata.sourceIp", "target_field": "source_ip", "ignore_missing": true } },
|
||||
{ "rename": { "field": "data.win.eventdata.sourcePort", "target_field": "source.port", "ignore_missing": true } },
|
||||
{ "rename": { "field": "data.win.eventdata.targetFilename", "target_field": "file.target", "ignore_missing": true } },
|
||||
{ "rename": { "field": "data.win.eventdata.user", "target_field": "user.name", "ignore_missing": true } },
|
||||
{ "rename": { "field": "data.win.system.eventID", "target_field": "event.code", "ignore_missing": true } },
|
||||
{ "rename": { "field": "predecoder.program_name", "target_field": "process.name", "ignore_missing": true } },
|
||||
{ "set": { "if": "ctx.rule.level == 1", "field": "rule.category", "value": "None" } },
|
||||
{ "set": { "if": "ctx.rule.level == 2", "field": "rule.category", "value": "System low priority notification" } },
|
||||
{ "set": { "if": "ctx.rule.level == 3", "field": "rule.category", "value": "Successful/authorized event" } },
|
||||
{ "set": { "if": "ctx.rule.level == 4", "field": "rule.category", "value": "System low priority error" } },
|
||||
{ "set": { "if": "ctx.rule.level == 5", "field": "rule.category", "value": "User generated error" } },
|
||||
{ "set": { "if": "ctx.rule.level == 6", "field": "rule.category", "value": "Low relevance attack" } },
|
||||
{ "set": { "if": "ctx.rule.level == 7", "field": "rule.category", "value": "\"Bad word\" matching" } },
|
||||
{ "set": { "if": "ctx.rule.level == 8", "field": "rule.category", "value": "First time seen" } },
|
||||
{ "set": { "if": "ctx.rule.level == 9", "field": "rule.category", "value": "Error from invalid source" } },
|
||||
{ "set": { "if": "ctx.rule.level == 10", "field": "rule.category", "value": "Multiple user generated errors" } },
|
||||
{ "set": { "if": "ctx.rule.level == 11", "field": "rule.category", "value": "Integrity checking warning" } },
|
||||
{ "set": { "if": "ctx.rule.level == 12", "field": "rule.category", "value": "High importance event" } },
|
||||
{ "set": { "if": "ctx.rule.level == 13", "field": "rule.category", "value": "Unusal error (high importance)" } },
|
||||
{ "set": { "if": "ctx.rule.level == 14", "field": "rule.category", "value": "High importance security event" } },
|
||||
{ "set": { "if": "ctx.rule.level == 15", "field": "rule.category", "value": "Severe attack" } },
|
||||
{ "append": { "if": "ctx.rule.level != null", "field": "tags", "value": ["alert"] } },
|
||||
{ "remove": { "field": [ "host", "predecoder", "decoder" ], "ignore_missing": true, "ignore_failure": false } },
|
||||
{ "pipeline": { "name": "common" } }
|
||||
{ "json": { "field": "message", "target_field": "message2", "ignore_failure": true } },
|
||||
{ "remove": { "field": [ "agent" ], "ignore_missing": true, "ignore_failure": true } },
|
||||
{ "rename": { "field": "message2.agent", "target_field": "agent", "ignore_missing": true } },
|
||||
{ "rename": { "field": "message2.data", "target_field": "data", "ignore_missing": true } },
|
||||
{ "rename": { "field": "message2.decoder", "target_field": "decoder", "ignore_missing": true } },
|
||||
{ "rename": { "field": "message2.full_log", "target_field": "log.full", "ignore_missing": true } },
|
||||
{ "rename": { "field": "message2.id", "target_field": "log.id.id", "ignore_missing": true } },
|
||||
{ "rename": { "field": "message2.location", "target_field": "log.location", "ignore_missing": true } },
|
||||
{ "rename": { "field": "message2.manager", "target_field": "manager", "ignore_missing": true } },
|
||||
{ "rename": { "field": "message2.predecoder", "target_field": "predecoder", "ignore_missing": true } },
|
||||
{ "rename": { "field": "message2.timestamp", "target_field": "event.timestamp", "ignore_missing": true } },
|
||||
{ "rename": { "field": "message2.previous_log", "target_field": "log.previous_log", "ignore_missing": true } },
|
||||
{ "rename": { "field": "message2.previous_output", "target_field": "log.previous_output", "ignore_missing": true } },
|
||||
{ "rename": { "field": "message2.rule", "target_field": "rule", "ignore_missing": true } },
|
||||
{ "rename": { "field": "message2.syscheck", "target_field": "host.syscheck", "ignore_missing": true } },
|
||||
{ "rename": { "field": "data.command", "target_field": "process.command_line", "ignore_missing": true } },
|
||||
{ "rename": { "field": "data.dstip", "target_field": "destination.ip", "ignore_missing": true } },
|
||||
{ "rename": { "field": "data.dstport", "target_field": "destination.port", "ignore_missing": true } },
|
||||
{ "rename": { "field": "data.dstuser", "target_field": "user.escalated", "ignore_missing": true } },
|
||||
{ "rename": { "field": "data.srcip", "target_field": "source.ip", "ignore_missing": true } },
|
||||
{ "rename": { "field": "data.process", "target_field": "process", "ignore_missing": true } },
|
||||
{ "rename": { "field": "data.program", "target_field": "program", "ignore_missing": true } },
|
||||
{ "rename": { "field": "data.win.eventdata.destinationHostname", "target_field": "destination.hostname", "ignore_missing": true } },
|
||||
{ "rename": { "field": "data.win.eventdata.destinationIp", "target_field": "destination.ip", "ignore_missing": true } },
|
||||
{ "rename": { "field": "data.win.eventdata.destinationPort", "target_field": "destination.port", "ignore_missing": true } },
|
||||
{ "rename": { "field": "data.win.eventdata.sourceHostname", "target_field": "source.hostname", "ignore_missing": true } },
|
||||
{ "rename": { "field": "data.win.eventdata.sourceIp", "target_field": "source_ip", "ignore_missing": true } },
|
||||
{ "rename": { "field": "data.win.eventdata.sourcePort", "target_field": "source.port", "ignore_missing": true } },
|
||||
{ "rename": { "field": "data.win.eventdata.targetFilename", "target_field": "file.target", "ignore_missing": true } },
|
||||
{ "rename": { "field": "data.win.eventdata.user", "target_field": "user.name", "ignore_missing": true } },
|
||||
{ "rename": { "field": "data.win.system", "target_field": "winlog", "ignore_missing": true } },
|
||||
{ "rename": { "field": "data.win.eventdata", "target_field": "winlog.event_data", "ignore_missing": true } },
|
||||
{ "rename": { "field": "winlog.eventID", "target_field": "winlog.event_id", "ignore_missing": true } },
|
||||
{ "rename": { "field": "predecoder.program_name", "target_field": "process.name", "ignore_missing": true } },
|
||||
{ "rename": { "field": "decoder.name", "target_field": "event.dataset", "ignore_missing": true } },
|
||||
{ "rename": { "field": "rule.description", "target_field": "rule.name", "ignore_missing": true } },
|
||||
{ "rename": { "field": "rule.id", "target_field": "rule.uuid", "ignore_missing": true } },
|
||||
{ "set": { "if": "ctx.rule != null && ctx.rule.level == 1", "field": "rule.category", "value": "None" } },
|
||||
{ "set": { "if": "ctx.rule != null && ctx.rule.level == 2", "field": "rule.category", "value": "System low priority notification" } },
|
||||
{ "set": { "if": "ctx.rule != null && ctx.rule.level == 3", "field": "rule.category", "value": "Successful/authorized event" } },
|
||||
{ "set": { "if": "ctx.rule != null && ctx.rule.level == 4", "field": "rule.category", "value": "System low priority error" } },
|
||||
{ "set": { "if": "ctx.rule != null && ctx.rule.level == 5", "field": "rule.category", "value": "User generated error" } },
|
||||
{ "set": { "if": "ctx.rule != null && ctx.rule.level == 6", "field": "rule.category", "value": "Low relevance attack" } },
|
||||
{ "set": { "if": "ctx.rule != null && ctx.rule.level == 7", "field": "rule.category", "value": "\"Bad word\" matching" } },
|
||||
{ "set": { "if": "ctx.rule != null && ctx.rule.level == 8", "field": "rule.category", "value": "First time seen" } },
|
||||
{ "set": { "if": "ctx.rule != null && ctx.rule.level == 9", "field": "rule.category", "value": "Error from invalid source" } },
|
||||
{ "set": { "if": "ctx.rule != null && ctx.rule.level == 10", "field": "rule.category", "value": "Multiple user generated errors" } },
|
||||
{ "set": { "if": "ctx.rule != null && ctx.rule.level == 11", "field": "rule.category", "value": "Integrity checking warning" } },
|
||||
{ "set": { "if": "ctx.rule != null && ctx.rule.level == 12", "field": "rule.category", "value": "High importance event" } },
|
||||
{ "set": { "if": "ctx.rule != null && ctx.rule.level == 13", "field": "rule.category", "value": "Unusal error (high importance)" } },
|
||||
{ "set": { "if": "ctx.rule != null && ctx.rule.level == 14", "field": "rule.category", "value": "High importance security event" } },
|
||||
{ "set": { "if": "ctx.rule != null && ctx.rule.level == 15", "field": "rule.category", "value": "Severe attack" } },
|
||||
{ "set": { "if": "ctx.rule != null && ctx.rule.level >= 1 && ctx.rule.level <=7", "field": "event.severity", "value": 1, "override": true } },
|
||||
{ "set": { "if": "ctx.rule != null && ctx.rule.level >= 8 && ctx.rule.level <=11", "field": "event.severity", "value": 2, "override": true } },
|
||||
{ "set": { "if": "ctx.rule != null && ctx.rule.level >= 12 && ctx.rule.level <=14", "field": "event.severity", "value": 3, "override": true } },
|
||||
{ "set": { "if": "ctx.rule != null && ctx.rule.level >= 15", "field": "event.severity", "value": 4, "override": true } },
|
||||
{ "rename": { "field": "rule.id", "target_field": "rule.uuid", "ignore_missing": true } },
|
||||
{ "remove": { "field": [ "predecoder" ], "ignore_failure": true } },
|
||||
{ "rename": { "field": "fields.category", "target_field": "event.category", "ignore_failure": true, "ignore_missing": true } },
|
||||
{ "rename": { "field": "fields.module", "target_field": "event.module", "ignore_failure": true, "ignore_missing": true } },
|
||||
{ "pipeline": { "if": "ctx.winlog?.channel == 'Microsoft-Windows-Sysmon/Operational'", "name": "sysmon" } },
|
||||
{ "pipeline": { "if": "ctx.winlog?.channel != 'Microsoft-Windows-Sysmon/Operational'", "name":"win.eventlogs" } },
|
||||
{ "set": { "if": "ctx.containsKey('rule') && ctx.rule != null", "field": "event.dataset", "value": "alert", "override": true } },
|
||||
{ "pipeline": { "name": "common" } }
|
||||
]
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user