mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2025-12-19 07:23:06 +01:00
Compare commits
2029 Commits
2.4.90-202
...
fixsource
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3910e83436 | ||
|
|
26b329a9bd | ||
|
|
506cbc62bb | ||
|
|
285b0e4af9 | ||
|
|
f9edfd6391 | ||
|
|
f6301bc3e5 | ||
|
|
6c5c176b7d | ||
|
|
c6d52b5eb1 | ||
|
|
7cac528389 | ||
|
|
6fe817ca4a | ||
|
|
cb9a6fac25 | ||
|
|
a945768251 | ||
|
|
c6646e3821 | ||
|
|
99dc72cece | ||
|
|
04d6cca204 | ||
|
|
5ab6bda639 | ||
|
|
f433de7e12 | ||
|
|
8ef6c2f91d | ||
|
|
7575218697 | ||
|
|
dc945dad00 | ||
|
|
ddcd74ffd2 | ||
|
|
e105bd12e6 | ||
|
|
f5688175b6 | ||
|
|
72a4ba405f | ||
|
|
94694d394e | ||
|
|
03dd746601 | ||
|
|
eec3373ae7 | ||
|
|
db45ce07ed | ||
|
|
ba49765312 | ||
|
|
72c8c2371e | ||
|
|
80411ab6cf | ||
|
|
0ff8fa57e7 | ||
|
|
411f28a049 | ||
|
|
0f42233092 | ||
|
|
2dd49f6d9b | ||
|
|
271f545f4f | ||
|
|
c4a70b540e | ||
|
|
bef85772e3 | ||
|
|
a6b19c4a6c | ||
|
|
44f5e6659b | ||
|
|
3f9a9b7019 | ||
|
|
b7ad985c7a | ||
|
|
dba087ae25 | ||
|
|
bbc4b1b502 | ||
|
|
9304513ce8 | ||
|
|
0b127582cb | ||
|
|
6e9b8791c8 | ||
|
|
ef87ad77c3 | ||
|
|
8477420911 | ||
|
|
f5741e318f | ||
|
|
e010b5680a | ||
|
|
8620d3987e | ||
|
|
30487a54c1 | ||
|
|
f15a39c153 | ||
|
|
aed27fa111 | ||
|
|
822c411e83 | ||
|
|
41b3ac7554 | ||
|
|
23575fdf6c | ||
|
|
52f70dc49a | ||
|
|
79c9749ff7 | ||
|
|
8d2701e143 | ||
|
|
877444ac29 | ||
|
|
b0d9426f1b | ||
|
|
18accae47e | ||
|
|
55e3a2c6b6 | ||
|
|
ef092e2893 | ||
|
|
89eb95c077 | ||
|
|
e871ec358e | ||
|
|
271a2f74ad | ||
|
|
d6bd951c37 | ||
|
|
8abd4c9c78 | ||
|
|
45a8c0acd1 | ||
|
|
c372cd533d | ||
|
|
999f83ce57 | ||
|
|
6fbed2dd9f | ||
|
|
875de88cb4 | ||
|
|
63bb44886e | ||
|
|
bda83a47a2 | ||
|
|
e96cfd35f7 | ||
|
|
65c96b2edf | ||
|
|
87477ae4f6 | ||
|
|
89a9106d79 | ||
|
|
1284150382 | ||
|
|
edf3c9464f | ||
|
|
4bb0a7c9d9 | ||
|
|
ced3af818c | ||
|
|
cc8fb96047 | ||
|
|
3339b50daf | ||
|
|
415ea07a4f | ||
|
|
b80ec95fa8 | ||
|
|
99cb51482f | ||
|
|
90638f7a43 | ||
|
|
1fb00c8eb6 | ||
|
|
4490ea7635 | ||
|
|
bce7a20d8b | ||
|
|
9c06713f32 | ||
|
|
23da0d4ba0 | ||
|
|
d5f2cfb354 | ||
|
|
fb5ad4193d | ||
|
|
1f5f283c06 | ||
|
|
cf048030c4 | ||
|
|
2d716b44a8 | ||
|
|
d70d652310 | ||
|
|
c5db7c8752 | ||
|
|
6f42ff3442 | ||
|
|
433dab7376 | ||
|
|
97c1a46013 | ||
|
|
fbe97221bb | ||
|
|
841ce6b6ec | ||
|
|
dd0b4c3820 | ||
|
|
b52dd53e29 | ||
|
|
a155f45036 | ||
|
|
b407c68d88 | ||
|
|
5b6a7035af | ||
|
|
12d490ad4a | ||
|
|
76cbd18d2c | ||
|
|
148ef7ef21 | ||
|
|
1b55642c86 | ||
|
|
af7f7d0728 | ||
|
|
a7337c95e1 | ||
|
|
3f7c3326ea | ||
|
|
bf41de8c14 | ||
|
|
de4424fab0 | ||
|
|
136a829509 | ||
|
|
bcec999be4 | ||
|
|
7c73b4713f | ||
|
|
45b4b1d963 | ||
|
|
fcfd74ec1e | ||
|
|
68b0cd7549 | ||
|
|
715d801ce8 | ||
|
|
4a810696e7 | ||
|
|
6b525a2c21 | ||
|
|
a5d8385f07 | ||
|
|
211bf7e77b | ||
|
|
1542b74133 | ||
|
|
431e5abf89 | ||
|
|
4314c79f85 | ||
|
|
da9717bc79 | ||
|
|
f047677d8a | ||
|
|
045cf7866c | ||
|
|
431e0b0780 | ||
|
|
e782266caa | ||
|
|
a4666b2c08 | ||
|
|
dcc3206e51 | ||
|
|
8358b6ea6f | ||
|
|
d1a66a91c6 | ||
|
|
7fdcb92614 | ||
|
|
cec1890b6b | ||
|
|
b2606b6094 | ||
|
|
b1b66045ea | ||
|
|
33b22bf2e4 | ||
|
|
3a38886345 | ||
|
|
7be70faab6 | ||
|
|
2729fdbea6 | ||
|
|
bfd08d1d2e | ||
|
|
37b3fd9b7b | ||
|
|
573dded921 | ||
|
|
fed75c7b39 | ||
|
|
3427df2a54 | ||
|
|
be11c718f6 | ||
|
|
235dfd78f1 | ||
|
|
7c8b9b4374 | ||
|
|
81d7c313af | ||
|
|
9a6ff75793 | ||
|
|
1f24796eba | ||
|
|
7762faf075 | ||
|
|
80fbb31372 | ||
|
|
7c45db2295 | ||
|
|
0545e1d33b | ||
|
|
55bbbdb58d | ||
|
|
3a8a6bf5ff | ||
|
|
13789bc56f | ||
|
|
11518f6eea | ||
|
|
08147e27b0 | ||
|
|
c9153617be | ||
|
|
245ceb2d49 | ||
|
|
4c65975907 | ||
|
|
dfef7036ce | ||
|
|
44594ba726 | ||
|
|
1876c4d9df | ||
|
|
a2ff66b5d0 | ||
|
|
e3972dc5af | ||
|
|
18c0f197b2 | ||
|
|
5b371c220c | ||
|
|
78c193f0a2 | ||
|
|
274295bc97 | ||
|
|
6c7ef622c1 | ||
|
|
da1cac0d53 | ||
|
|
a84df14137 | ||
|
|
4a49f9d004 | ||
|
|
1eb4b5379a | ||
|
|
35c7fc06d7 | ||
|
|
b69d453a68 | ||
|
|
2f6fb717c1 | ||
|
|
b7e1989d45 | ||
|
|
202b03b32b | ||
|
|
1aa871ec94 | ||
|
|
4ffbb0bbd9 | ||
|
|
f859fe6517 | ||
|
|
021b425b8b | ||
|
|
d95122ca01 | ||
|
|
81d3c7351b | ||
|
|
ccb8ffd6eb | ||
|
|
5a8ea57a1b | ||
|
|
60228ec6e6 | ||
|
|
574703e551 | ||
|
|
fa154f1a8f | ||
|
|
635545630b | ||
|
|
df8afda999 | ||
|
|
f80b090c93 | ||
|
|
806173f7e3 | ||
|
|
2f6c1b82a6 | ||
|
|
b8c2808abe | ||
|
|
9027e4e065 | ||
|
|
8ca5276a0e | ||
|
|
ee45a5524d | ||
|
|
70d4223a75 | ||
|
|
7ab2840381 | ||
|
|
78c951cb70 | ||
|
|
a0a3a80151 | ||
|
|
3ecffd5588 | ||
|
|
8ea66bb0e9 | ||
|
|
9359fbbad6 | ||
|
|
1949be90c2 | ||
|
|
30970acfaf | ||
|
|
6d12a8bfa1 | ||
|
|
2fb41c8d65 | ||
|
|
835b2609b6 | ||
|
|
10ae53f108 | ||
|
|
68bfceb727 | ||
|
|
f348c7168f | ||
|
|
627d9bf45d | ||
|
|
2aee8ab511 | ||
|
|
de9d3c9726 | ||
|
|
39572f36f4 | ||
|
|
0994cd515a | ||
|
|
bdcd1e099d | ||
|
|
c64760b5f4 | ||
|
|
d2aa60b961 | ||
|
|
83d615d236 | ||
|
|
e910de0a06 | ||
|
|
26b80aba38 | ||
|
|
ee617eeff4 | ||
|
|
463766782c | ||
|
|
d9f70898dd | ||
|
|
7e15c89510 | ||
|
|
ed5bd19f0e | ||
|
|
feba97738f | ||
|
|
348809bdbb | ||
|
|
ca0edb1cab | ||
|
|
0172f64f15 | ||
|
|
48f8944e3b | ||
|
|
3e22043ea6 | ||
|
|
e572b854b9 | ||
|
|
c8aad2b03b | ||
|
|
8773ebc3dc | ||
|
|
2baf2478da | ||
|
|
378d37d74e | ||
|
|
f8c8e5d8e5 | ||
|
|
dca38c286a | ||
|
|
860710f5f9 | ||
|
|
d56af4acab | ||
|
|
793e98f75c | ||
|
|
f9c5aa3fef | ||
|
|
254e782da6 | ||
|
|
fe3caf66a1 | ||
|
|
09d699432a | ||
|
|
79b44586ce | ||
|
|
feddd90e41 | ||
|
|
ca935e4272 | ||
|
|
8f75bfb0a4 | ||
|
|
e551c6e037 | ||
|
|
1c5a72ee85 | ||
|
|
8a8ea04088 | ||
|
|
92be8df95d | ||
|
|
f730e23e30 | ||
|
|
a3e7649a3c | ||
|
|
af42c31740 | ||
|
|
a22c9f6bcf | ||
|
|
bad9a16ebb | ||
|
|
7827e05c24 | ||
|
|
e45b0bf871 | ||
|
|
659c039ba8 | ||
|
|
c7edaac42a | ||
|
|
a1a8f75409 | ||
|
|
23e25fa2d7 | ||
|
|
f077484121 | ||
|
|
c16bf50493 | ||
|
|
564374a8fb | ||
|
|
4ab4264f77 | ||
|
|
60cccb21b4 | ||
|
|
39432198cc | ||
|
|
7af95317db | ||
|
|
8675193d1f | ||
|
|
ac0d6c57e1 | ||
|
|
3db6542398 | ||
|
|
9fd1b9aec1 | ||
|
|
e5563eb9b8 | ||
|
|
e8de9e3c26 | ||
|
|
c8a3603577 | ||
|
|
05321cf1ed | ||
|
|
7deef44ff6 | ||
|
|
9752d61699 | ||
|
|
6b8e2e2643 | ||
|
|
b1acbf3114 | ||
|
|
e3ac1dd1b4 | ||
|
|
86eca53d4b | ||
|
|
bfd3d822b1 | ||
|
|
030e4961d7 | ||
|
|
14bd92067b | ||
|
|
066e227325 | ||
|
|
f1cfb9cd91 | ||
|
|
5a2e704909 | ||
|
|
f04e54d1d5 | ||
|
|
e9af46a8cb | ||
|
|
b4b051908b | ||
|
|
0148e5638c | ||
|
|
c8814d0632 | ||
|
|
6c892fed78 | ||
|
|
8043e09ec1 | ||
|
|
e775299480 | ||
|
|
c4ca9c62aa | ||
|
|
c37aeff364 | ||
|
|
cdac49052f | ||
|
|
8e5fa9576c | ||
|
|
25c746bb14 | ||
|
|
cd04d1e5a7 | ||
|
|
1fb558cc77 | ||
|
|
7f1b76912c | ||
|
|
3a2ceb0b6f | ||
|
|
1345756fce | ||
|
|
d81d9a0722 | ||
|
|
55074fda69 | ||
|
|
23e12811a1 | ||
|
|
5d1edf6d86 | ||
|
|
a91e8b26f6 | ||
|
|
c836dd2acd | ||
|
|
e826ea5d04 | ||
|
|
3a87af805f | ||
|
|
328ac329ec | ||
|
|
a3401aad11 | ||
|
|
5a67b89a80 | ||
|
|
431f71cc82 | ||
|
|
23a9780ebb | ||
|
|
4587301cca | ||
|
|
9cb8ebbaa7 | ||
|
|
14ddbd32ad | ||
|
|
4599b95ae7 | ||
|
|
c92dc580a2 | ||
|
|
4666aa9818 | ||
|
|
f066baf6ba | ||
|
|
ba710c9944 | ||
|
|
198695af03 | ||
|
|
fec78f5fb5 | ||
|
|
d03dd7ac2d | ||
|
|
d2dd52b42a | ||
|
|
c9db52433f | ||
|
|
138849d258 | ||
|
|
a9ec12e402 | ||
|
|
87281efc24 | ||
|
|
29ac4f23c6 | ||
|
|
878a3f8962 | ||
|
|
21e27bce87 | ||
|
|
336ca0dbbd | ||
|
|
d9eba3cd0e | ||
|
|
81b7e2b420 | ||
|
|
cd5483623b | ||
|
|
faa112eddf | ||
|
|
f663f22628 | ||
|
|
8b07ff453d | ||
|
|
24a0fa3f6d | ||
|
|
a5011b398d | ||
|
|
5b70398c0a | ||
|
|
f3aaee1e41 | ||
|
|
d0e875928d | ||
|
|
3e16bc8335 | ||
|
|
c1d85493df | ||
|
|
e01d0f81ea | ||
|
|
376d0f3295 | ||
|
|
4418623f73 | ||
|
|
d1f4e26e29 | ||
|
|
5166db1caa | ||
|
|
ff5ad586af | ||
|
|
9e24d21282 | ||
|
|
5806999f63 | ||
|
|
4dae1afe0b | ||
|
|
456cad1ada | ||
|
|
ded520c2c1 | ||
|
|
a77157391c | ||
|
|
063a2b3348 | ||
|
|
bcd2e95fbe | ||
|
|
94e8cd84e6 | ||
|
|
948d72c282 | ||
|
|
bdeb92ab05 | ||
|
|
fdb5ad810a | ||
|
|
f588a80ec7 | ||
|
|
562b7e54cb | ||
|
|
3c847bca8b | ||
|
|
ce2cc26224 | ||
|
|
f3c574679c | ||
|
|
5da3fed1ce | ||
|
|
e6bcf5db6b | ||
|
|
4d24c57903 | ||
|
|
0606c0a454 | ||
|
|
bb984e05e3 | ||
|
|
b35b0aaf2c | ||
|
|
62f04fa5dd | ||
|
|
d89df5f0dd | ||
|
|
f0c1922600 | ||
|
|
ab2cdd18ed | ||
|
|
889bb7ddf4 | ||
|
|
a959f90d0b | ||
|
|
a54cd004d6 | ||
|
|
5100032fbd | ||
|
|
0f235baa7e | ||
|
|
e5660b8c8e | ||
|
|
588a1b86d1 | ||
|
|
46f0afa24b | ||
|
|
a7651b2734 | ||
|
|
890f76e45c | ||
|
|
03892bad5e | ||
|
|
e6eecc93c8 | ||
|
|
8dc0f8d20e | ||
|
|
fbdc0c4705 | ||
|
|
d1a2b57aa2 | ||
|
|
f5ec1d4b7c | ||
|
|
0aa556e375 | ||
|
|
d9e86c15bc | ||
|
|
4107fa006f | ||
|
|
29980ea958 | ||
|
|
8f36d2ec00 | ||
|
|
10511b8431 | ||
|
|
2535ae953d | ||
|
|
2f68cd7483 | ||
|
|
6655276410 | ||
|
|
9f7bcb0f7d | ||
|
|
aa43177d8c | ||
|
|
12959d114c | ||
|
|
855b489c4b | ||
|
|
673f9cb544 | ||
|
|
0a3ff47008 | ||
|
|
834e34128d | ||
|
|
73776f8d11 | ||
|
|
120e61e45c | ||
|
|
fc2d450de0 | ||
|
|
cea4eaf081 | ||
|
|
b1753f86f9 | ||
|
|
6323fbf46b | ||
|
|
ba601c39b3 | ||
|
|
ec27517bdd | ||
|
|
624ec3c93e | ||
|
|
f318a84c18 | ||
|
|
8cca58dba9 | ||
|
|
6c196ea61a | ||
|
|
207572f2f9 | ||
|
|
4afc986f48 | ||
|
|
ba5d140d4b | ||
|
|
348f9dcaec | ||
|
|
915b9e7bd7 | ||
|
|
dfec29d18e | ||
|
|
77fef02116 | ||
|
|
38ef4a6046 | ||
|
|
f3328c41fb | ||
|
|
a007fa6505 | ||
|
|
1a32a0897c | ||
|
|
e26310d172 | ||
|
|
c7cdb0b466 | ||
|
|
df0b484b45 | ||
|
|
2181cddf49 | ||
|
|
a2b6968cef | ||
|
|
285fbc2783 | ||
|
|
94c5a1fd98 | ||
|
|
19362fe5e5 | ||
|
|
a7a81e9825 | ||
|
|
31484d1158 | ||
|
|
f51cd008f2 | ||
|
|
a5675a79fe | ||
|
|
1ea7b3c09f | ||
|
|
d9127a288f | ||
|
|
23ae259c82 | ||
|
|
ebb78bc9bd | ||
|
|
e5920b6465 | ||
|
|
153a99a002 | ||
|
|
69a5e1e2f5 | ||
|
|
0858160be2 | ||
|
|
ccd79c814d | ||
|
|
45f25ca62d | ||
|
|
a8a01b8191 | ||
|
|
ac2c044a94 | ||
|
|
e10d00d114 | ||
|
|
cbdd369a18 | ||
|
|
b2e7f58b3d | ||
|
|
a6600b8762 | ||
|
|
5479d49379 | ||
|
|
304985b61e | ||
|
|
d6c725299b | ||
|
|
d99857002d | ||
|
|
2a6c74917e | ||
|
|
9f0bd4bad3 | ||
|
|
924b06976c | ||
|
|
1357f19e48 | ||
|
|
c91e9ea4e0 | ||
|
|
c2c96dad6e | ||
|
|
1a08833e77 | ||
|
|
d16dfcf4e8 | ||
|
|
b79c7b0540 | ||
|
|
9f45792217 | ||
|
|
d3108c3549 | ||
|
|
7d883cb5e0 | ||
|
|
ebd81c1df9 | ||
|
|
418dbee9fa | ||
|
|
cccc3bf625 | ||
|
|
a3e0072631 | ||
|
|
220e485312 | ||
|
|
67f8fca043 | ||
|
|
0e0ab8384c | ||
|
|
58228f70ca | ||
|
|
7968de06b4 | ||
|
|
87fdd90f56 | ||
|
|
65e7e56fbe | ||
|
|
424fdff934 | ||
|
|
f72996d9d1 | ||
|
|
d77556c672 | ||
|
|
c412e9bad2 | ||
|
|
87a28e8ce7 | ||
|
|
9ca0c7d53a | ||
|
|
2e94e452ed | ||
|
|
6a0d40ee0d | ||
|
|
0cebcf4432 | ||
|
|
ed0e24fcaf | ||
|
|
24be2f869b | ||
|
|
f8058a4a3a | ||
|
|
d0ba6df2fc | ||
|
|
95bee91b12 | ||
|
|
751b5bd556 | ||
|
|
77273449c9 | ||
|
|
46e1f1bc5c | ||
|
|
884bec7465 | ||
|
|
8d3220f94b | ||
|
|
9cb42911dc | ||
|
|
a3cc6f025e | ||
|
|
6fae4a9974 | ||
|
|
f7a1a3a172 | ||
|
|
292e1ad782 | ||
|
|
af1fe86586 | ||
|
|
97100cdfdd | ||
|
|
5f60ef1541 | ||
|
|
c7e7a0a871 | ||
|
|
f09eff530e | ||
|
|
50b34a116a | ||
|
|
42874fb0d0 | ||
|
|
482847187c | ||
|
|
a19b99268d | ||
|
|
3c5a03d7b6 | ||
|
|
c1a5c2b2d1 | ||
|
|
baf0f7ba95 | ||
|
|
ee27965314 | ||
|
|
d02093295b | ||
|
|
6381444fdc | ||
|
|
01b313868d | ||
|
|
3859ebd69c | ||
|
|
9753e431e3 | ||
|
|
b307667ae2 | ||
|
|
5d7dcbbcee | ||
|
|
281b395053 | ||
|
|
3518f39d39 | ||
|
|
ae0ffc4977 | ||
|
|
bc2f716c99 | ||
|
|
9617da1791 | ||
|
|
2ba5d7d64b | ||
|
|
437b9016ca | ||
|
|
c5db0a7195 | ||
|
|
82894d88b6 | ||
|
|
4a4146f515 | ||
|
|
59a4d0129f | ||
|
|
5cf2149218 | ||
|
|
453c32df0d | ||
|
|
1df10b80b2 | ||
|
|
9d96a11753 | ||
|
|
e9e3252bb5 | ||
|
|
930c8147e7 | ||
|
|
378ecad94c | ||
|
|
02299a6742 | ||
|
|
15cbc626c4 | ||
|
|
8720a4540a | ||
|
|
7b5980bfe5 | ||
|
|
ebfb670f6a | ||
|
|
c98042fa80 | ||
|
|
70181e3e08 | ||
|
|
adb1e01c7a | ||
|
|
cdb7f0602c | ||
|
|
d52e817dd5 | ||
|
|
07305d8799 | ||
|
|
fbf5bafae7 | ||
|
|
d49cd3cb85 | ||
|
|
b60b9e7743 | ||
|
|
26fd8562c5 | ||
|
|
84b38daf62 | ||
|
|
a0f9d5dc61 | ||
|
|
e8c25d157f | ||
|
|
214f4f0f0c | ||
|
|
7ae0369a3b | ||
|
|
2e5682f11c | ||
|
|
2e7cb0e362 | ||
|
|
56748ea6e7 | ||
|
|
621f03994c | ||
|
|
ab8ad72920 | ||
|
|
3fc244ee85 | ||
|
|
4728b96c51 | ||
|
|
f303363a73 | ||
|
|
2a166af524 | ||
|
|
ab4d055fd1 | ||
|
|
af49a8e4ef | ||
|
|
669d219fdc | ||
|
|
442aecb9f4 | ||
|
|
beda0bc89c | ||
|
|
64fd6bf979 | ||
|
|
1955434416 | ||
|
|
ab6a083fa8 | ||
|
|
eabca5df18 | ||
|
|
5dac3ff2a6 | ||
|
|
93024738d3 | ||
|
|
05a368681a | ||
|
|
246161018c | ||
|
|
f27714890a | ||
|
|
47831eb300 | ||
|
|
0b1f2252ee | ||
|
|
3ce6b555f7 | ||
|
|
c29f11863e | ||
|
|
952403b696 | ||
|
|
b3eb06f53e | ||
|
|
5198d0cdf0 | ||
|
|
e61e2f04b3 | ||
|
|
1aa876f4eb | ||
|
|
a3fb2f13be | ||
|
|
9e77eae71e | ||
|
|
cd5de5cd05 | ||
|
|
98a67530f5 | ||
|
|
58ffe576d7 | ||
|
|
b0a515f2c3 | ||
|
|
a037421809 | ||
|
|
6bb6c24641 | ||
|
|
617834a044 | ||
|
|
2c5c0e7830 | ||
|
|
81d2c52867 | ||
|
|
4f8bd16910 | ||
|
|
ab9d03bc2e | ||
|
|
10bf3e8fab | ||
|
|
f8108e93d5 | ||
|
|
3108556495 | ||
|
|
f97b2444e7 | ||
|
|
415f456661 | ||
|
|
e49b3fc260 | ||
|
|
9b125fbe53 | ||
|
|
10e3b32fed | ||
|
|
5386c07b66 | ||
|
|
7149d20b42 | ||
|
|
8a57b79b77 | ||
|
|
a4e8e7ea53 | ||
|
|
95ba327eb3 | ||
|
|
3056410fd1 | ||
|
|
bf8da60605 | ||
|
|
226f858866 | ||
|
|
317d7dea7d | ||
|
|
4e548ceb6e | ||
|
|
d846fe55e1 | ||
|
|
3b2942651e | ||
|
|
fa6f4100dd | ||
|
|
33e2d18aa7 | ||
|
|
a03764d956 | ||
|
|
3fb703cd22 | ||
|
|
f1cbe23f57 | ||
|
|
07a22a0b4b | ||
|
|
b9d813cef2 | ||
|
|
76ab0eac03 | ||
|
|
08a2ad2c40 | ||
|
|
47bbc9987e | ||
|
|
59628ec8b7 | ||
|
|
bef2fa9e8d | ||
|
|
d4f0cbcb67 | ||
|
|
9e96b12e94 | ||
|
|
42552810fb | ||
|
|
4bf2c931e9 | ||
|
|
beda6ac20d | ||
|
|
d8be6e42e1 | ||
|
|
4fb7fe9e45 | ||
|
|
6d7066c381 | ||
|
|
d003e1380f | ||
|
|
ef8badaef1 | ||
|
|
dea9c149d7 | ||
|
|
56c9fa3129 | ||
|
|
a86105294b | ||
|
|
33c23c30d3 | ||
|
|
fe76a79ebd | ||
|
|
5035ec2539 | ||
|
|
9f35b20664 | ||
|
|
b93c6c0270 | ||
|
|
e5dd403dd1 | ||
|
|
493359e5a2 | ||
|
|
b0f5218775 | ||
|
|
8fdc7049f9 | ||
|
|
d79d7e2ba1 | ||
|
|
596b3e2614 | ||
|
|
59f8544324 | ||
|
|
daaad3699c | ||
|
|
1e9f3a65a4 | ||
|
|
b2acf2f807 | ||
|
|
34e561f358 | ||
|
|
e5a07170b3 | ||
|
|
02dbbc5289 | ||
|
|
5e62d3ecb2 | ||
|
|
373ef9fe91 | ||
|
|
2f1e6fd625 | ||
|
|
6b8ef43cc1 | ||
|
|
7e746b87c5 | ||
|
|
2ad2a3110c | ||
|
|
bc24a6c574 | ||
|
|
b25bb0faf0 | ||
|
|
38c74b46b6 | ||
|
|
fbb6d8146a | ||
|
|
83ecc02589 | ||
|
|
21d9964827 | ||
|
|
f3b6d9febb | ||
|
|
b052a75e64 | ||
|
|
0602601655 | ||
|
|
480e248131 | ||
|
|
6fc7c930a6 | ||
|
|
31cd5b1365 | ||
|
|
19fb081fa0 | ||
|
|
d3b1a4f928 | ||
|
|
4729e194a0 | ||
|
|
ab6060c484 | ||
|
|
0b65021f75 | ||
|
|
bd4f2093db | ||
|
|
48dfcab9f0 | ||
|
|
849f8f13bc | ||
|
|
07359ad6ec | ||
|
|
1e2453eddf | ||
|
|
4c9773c68d | ||
|
|
4666670f4f | ||
|
|
0f71b45e0f | ||
|
|
92e9bd43ca | ||
|
|
a600c64229 | ||
|
|
121dec0180 | ||
|
|
b451c4c034 | ||
|
|
dbdbffa4b0 | ||
|
|
f360c6ecbc | ||
|
|
b9ea151846 | ||
|
|
b428573a0a | ||
|
|
350e1c9d91 | ||
|
|
a3b5db5945 | ||
|
|
3efe0eac13 | ||
|
|
aca54b4645 | ||
|
|
643afeeae7 | ||
|
|
d9fb79403b | ||
|
|
2ef89be67d | ||
|
|
43e994f2c2 | ||
|
|
ab89858d04 | ||
|
|
395c4e37ba | ||
|
|
3da2c7cabc | ||
|
|
832d66052e | ||
|
|
add538f6dd | ||
|
|
fc9107f129 | ||
|
|
d9790b04f6 | ||
|
|
88fa04b0f6 | ||
|
|
d240fca721 | ||
|
|
4d6171bde6 | ||
|
|
6238a5b3ed | ||
|
|
061600fa7a | ||
|
|
1b89cc6818 | ||
|
|
6e1e617124 | ||
|
|
7f8bf850a2 | ||
|
|
0277891392 | ||
|
|
08d99a3890 | ||
|
|
773606d876 | ||
|
|
bf38055a6c | ||
|
|
90b8d6b2f7 | ||
|
|
2d78fa1a41 | ||
|
|
45d541d4f2 | ||
|
|
b3c48674c5 | ||
|
|
8d42739030 | ||
|
|
27358137f2 | ||
|
|
a54b9ddbe4 | ||
|
|
58936b31d5 | ||
|
|
fcdacc3b0d | ||
|
|
40531dd919 | ||
|
|
05dfce62fb | ||
|
|
9df9cc2247 | ||
|
|
d3ee5ed7b8 | ||
|
|
502e1e1f1b | ||
|
|
e5b12ecdb9 | ||
|
|
be5e41227f | ||
|
|
08f208cd38 | ||
|
|
db08ac9022 | ||
|
|
ad5a27f991 | ||
|
|
07ec302267 | ||
|
|
112704e340 | ||
|
|
e6753440f8 | ||
|
|
18d899a7f9 | ||
|
|
b2650da057 | ||
|
|
31df0b5d7d | ||
|
|
a430a47a30 | ||
|
|
00f811ce31 | ||
|
|
ddd023c69a | ||
|
|
2911025c0c | ||
|
|
2e8ab648fd | ||
|
|
b753d40861 | ||
|
|
a32aac7111 | ||
|
|
2fff6232c1 | ||
|
|
f751c82e1c | ||
|
|
39f74fe547 | ||
|
|
11fb33fdeb | ||
|
|
58f4db95ea | ||
|
|
b55cb257b6 | ||
|
|
b0a8191f59 | ||
|
|
28aedcf50b | ||
|
|
6988f03ebc | ||
|
|
2948577b0e | ||
|
|
870a9ff80c | ||
|
|
689db57f5f | ||
|
|
2768722132 | ||
|
|
df103b3dca | ||
|
|
0542c77137 | ||
|
|
9022dc24fb | ||
|
|
78b7068638 | ||
|
|
70339b9a94 | ||
|
|
5c8460fd26 | ||
|
|
69e90e1e70 | ||
|
|
8c5ea19d3c | ||
|
|
82562f89f6 | ||
|
|
ede36b5ef8 | ||
|
|
fd00a4db85 | ||
|
|
510c7a0c19 | ||
|
|
2a7365c7d7 | ||
|
|
f7ca3e45ac | ||
|
|
0172272e1b | ||
|
|
776f574427 | ||
|
|
a0aafb7c51 | ||
|
|
09ec14acd8 | ||
|
|
61f8b251f0 | ||
|
|
75dd04c398 | ||
|
|
e2ef544bfc | ||
|
|
daad99a0b6 | ||
|
|
fdeee45d3f | ||
|
|
7fe9e2cbfd | ||
|
|
74d557a5e0 | ||
|
|
82f9043a14 | ||
|
|
a8cb18bb2e | ||
|
|
e1d31c895e | ||
|
|
e661c73583 | ||
|
|
42ba778740 | ||
|
|
204d53e4a7 | ||
|
|
d47a798645 | ||
|
|
9e0f13cce5 | ||
|
|
68ea229a1c | ||
|
|
1ecf2b29fc | ||
|
|
8c37a4454c | ||
|
|
ef436026d5 | ||
|
|
a595bc4b31 | ||
|
|
8a321e3f15 | ||
|
|
b4214f73f4 | ||
|
|
b9da7eb35b | ||
|
|
d6139d0f19 | ||
|
|
d2fe8da082 | ||
|
|
1931de2e52 | ||
|
|
d68a14d789 | ||
|
|
f988af52f6 | ||
|
|
fd02950864 | ||
|
|
a167e5e520 | ||
|
|
26d7ceebb2 | ||
|
|
382c3328df | ||
|
|
92d8985f3c | ||
|
|
c2d9523e09 | ||
|
|
c34914c8de | ||
|
|
d020bf5504 | ||
|
|
95d8e0f318 | ||
|
|
be4df48742 | ||
|
|
ba4df4c8b6 | ||
|
|
86eab6fda2 | ||
|
|
5d2bed950e | ||
|
|
e5c0f8a46c | ||
|
|
044d230158 | ||
|
|
5965459423 | ||
|
|
3a31d80a85 | ||
|
|
5a8e542f96 | ||
|
|
7a60afdd5a | ||
|
|
c3b3e0ab21 | ||
|
|
b918a5e256 | ||
|
|
1ddc653a52 | ||
|
|
85f5f75c84 | ||
|
|
3cb3281cd5 | ||
|
|
6246e25fbe | ||
|
|
b858543a60 | ||
|
|
5ecb483596 | ||
|
|
102ddaf262 | ||
|
|
151db2af30 | ||
|
|
e9a4668c63 | ||
|
|
5f45327372 | ||
|
|
ac8ac23522 | ||
|
|
b2bd8577b9 | ||
|
|
4df3070a1d | ||
|
|
142609ea67 | ||
|
|
46779513de | ||
|
|
e27a0d8f7a | ||
|
|
9e4c456eb9 | ||
|
|
400739736d | ||
|
|
196e0c1486 | ||
|
|
76d63bb2ad | ||
|
|
ed80c4e13b | ||
|
|
69c904548c | ||
|
|
272410ecae | ||
|
|
19514a969b | ||
|
|
77f88371b8 | ||
|
|
559190aee3 | ||
|
|
8c4cf0ba08 | ||
|
|
e17fea849a | ||
|
|
b2c09d6fd9 | ||
|
|
30c4acb828 | ||
|
|
4ec185a9c7 | ||
|
|
166e4e0ebc | ||
|
|
4b7478654f | ||
|
|
5bd84c4e30 | ||
|
|
f5a8e917a4 | ||
|
|
4e6c707067 | ||
|
|
c89adce3a1 | ||
|
|
af1bee4c68 | ||
|
|
e3c8d22cac | ||
|
|
285d73d526 | ||
|
|
0bcb6040c9 | ||
|
|
3f13f8deae | ||
|
|
13d96ae5af | ||
|
|
3b447b343f | ||
|
|
d0375d3c7e | ||
|
|
b607689993 | ||
|
|
8f1e528f1c | ||
|
|
2f8d8d2d96 | ||
|
|
366e39950a | ||
|
|
5fd7bf311d | ||
|
|
152fdaa7bb | ||
|
|
07ef3d632c | ||
|
|
7f5cde9a1c | ||
|
|
58df566c79 | ||
|
|
395b81ffc6 | ||
|
|
e3d5829b89 | ||
|
|
df31c349b0 | ||
|
|
759d5f76cd | ||
|
|
240484deea | ||
|
|
ceabb673e0 | ||
|
|
f1070992a8 | ||
|
|
c0f9c344bb | ||
|
|
21bb325157 | ||
|
|
00029e6f83 | ||
|
|
9459bf8a27 | ||
|
|
96e99fc442 | ||
|
|
4b14bf90a3 | ||
|
|
2cb002668f | ||
|
|
c11a10638b | ||
|
|
6fe240de45 | ||
|
|
ecd7da540a | ||
|
|
2a43a6f37e | ||
|
|
4cdfb6e3eb | ||
|
|
1edd13523c | ||
|
|
4217e23272 | ||
|
|
f94c81a041 | ||
|
|
4c3518385b | ||
|
|
1429226667 | ||
|
|
888ab162bd | ||
|
|
5498673fc3 | ||
|
|
96c56297ce | ||
|
|
8ab38956d1 | ||
|
|
0f120f7500 | ||
|
|
f6a0e62853 | ||
|
|
cc0e91aa96 | ||
|
|
bf9f92b04e | ||
|
|
270958ddfc | ||
|
|
b99bb0b004 | ||
|
|
8f3664f26c | ||
|
|
445afca6ee | ||
|
|
3083e3bc63 | ||
|
|
9c455badb9 | ||
|
|
9e16c03d25 | ||
|
|
275489b8a3 | ||
|
|
cd6deae0a7 | ||
|
|
0b8a7f5b67 | ||
|
|
3c342bb90d | ||
|
|
ba10228fef | ||
|
|
71f146d1d9 | ||
|
|
b22fe5bd3d | ||
|
|
a60e55e5cd | ||
|
|
e7aa4428de | ||
|
|
64f71143dc | ||
|
|
72fd25dcaf | ||
|
|
eef4b82afb | ||
|
|
1d4d442554 | ||
|
|
02ad08035e | ||
|
|
335d8851e6 | ||
|
|
e4d2513609 | ||
|
|
7aad298720 | ||
|
|
22fae2e98d | ||
|
|
3850558be3 | ||
|
|
5b785d3ef8 | ||
|
|
8b874e46d0 | ||
|
|
4165b33995 | ||
|
|
3e10c95b7b | ||
|
|
1d058729e5 | ||
|
|
f9bf4e4130 | ||
|
|
056a29ea89 | ||
|
|
667e66bbef | ||
|
|
595ff8dce2 | ||
|
|
99aa383e01 | ||
|
|
5f116b3e43 | ||
|
|
bb8f0605e1 | ||
|
|
5836bc5bd1 | ||
|
|
55c815cae8 | ||
|
|
79388af645 | ||
|
|
d7e831fbeb | ||
|
|
8f40b66e3b | ||
|
|
0fe3038802 | ||
|
|
cd9b04e1bb | ||
|
|
0fbb6afee1 | ||
|
|
402e26fc19 | ||
|
|
b6e10b1de7 | ||
|
|
54f3a8cb91 | ||
|
|
1f98cef816 | ||
|
|
7a71a5369c | ||
|
|
964b631d58 | ||
|
|
dcb667b32d | ||
|
|
e61d37893a | ||
|
|
60bd960251 | ||
|
|
b974c6e8df | ||
|
|
7484495021 | ||
|
|
0952b7528f | ||
|
|
14c95a5fe0 | ||
|
|
d0bb86a24f | ||
|
|
749825af19 | ||
|
|
844283cc38 | ||
|
|
ae0bf1ccdf | ||
|
|
a0637fa25d | ||
|
|
d2a21c1e4c | ||
|
|
ed23340157 | ||
|
|
ef6dbf9e46 | ||
|
|
1236c8c1f2 | ||
|
|
51625e19ad | ||
|
|
760ff1e45b | ||
|
|
5b3fa17f81 | ||
|
|
053eadbb39 | ||
|
|
540b0de00c | ||
|
|
c30cbf9af0 | ||
|
|
41c0a91d77 | ||
|
|
6e1e5a2ee6 | ||
|
|
aa8fd647b6 | ||
|
|
8feae6ba11 | ||
|
|
028297cef8 | ||
|
|
19755d4077 | ||
|
|
cd655e6adb | ||
|
|
2be143d902 | ||
|
|
1b98f9f313 | ||
|
|
762ccdd222 | ||
|
|
277504fff6 | ||
|
|
3f3e7ea1e8 | ||
|
|
4d7fdd390c | ||
|
|
269919b980 | ||
|
|
05c93e3796 | ||
|
|
fe21a19c5c | ||
|
|
af6245f19d | ||
|
|
ad8f3dfde7 | ||
|
|
2dc977ddd8 | ||
|
|
28c7362cfa | ||
|
|
c93a5de460 | ||
|
|
44a5b3b1e5 | ||
|
|
d23b6958c1 | ||
|
|
60b1535018 | ||
|
|
758c6728f9 | ||
|
|
5234b21743 | ||
|
|
7d73f6cfd7 | ||
|
|
fb54c2f533 | ||
|
|
e20364cdf5 | ||
|
|
a9484b4ca9 | ||
|
|
ae94722eda | ||
|
|
ae993c47c1 | ||
|
|
c784a6e440 | ||
|
|
c66cd3b2f3 | ||
|
|
6081c46d7f | ||
|
|
4dd72ad15c | ||
|
|
4893eda4fe | ||
|
|
2af05b9a23 | ||
|
|
0bb76aecb3 | ||
|
|
53ab7a223d | ||
|
|
3037dc7c38 | ||
|
|
bde8a965f3 | ||
|
|
14e95f4898 | ||
|
|
bad0031829 | ||
|
|
f30938ed59 | ||
|
|
630140b979 | ||
|
|
cce94d96d1 | ||
|
|
bcea02b059 | ||
|
|
03ebc2d86e | ||
|
|
3021ed5d36 | ||
|
|
e59ebc89f8 | ||
|
|
6a5377ceac | ||
|
|
515cb3aea8 | ||
|
|
b51aa56e86 | ||
|
|
d2884ef00b | ||
|
|
0f16b00563 | ||
|
|
b01fb733a9 | ||
|
|
945a467ec8 | ||
|
|
67f9cd39db | ||
|
|
72ffef9433 | ||
|
|
cf536469e6 | ||
|
|
c7c6d3e556 | ||
|
|
3a465c2e69 | ||
|
|
21a64b6c1d | ||
|
|
6c472dd383 | ||
|
|
2c5861a0c2 | ||
|
|
2f6c7d2643 | ||
|
|
c6c67f4d06 | ||
|
|
f35930317b | ||
|
|
11dc004811 | ||
|
|
966503d875 | ||
|
|
124bf266b5 | ||
|
|
75e3bba9f5 | ||
|
|
0ff4fc101b | ||
|
|
85450693a2 | ||
|
|
0047246cf2 | ||
|
|
95d3a2d834 | ||
|
|
e1c8bee71a | ||
|
|
1c96449ad9 | ||
|
|
44535cba8c | ||
|
|
3f4a5a1b28 | ||
|
|
4bd83f8983 | ||
|
|
206acbe618 | ||
|
|
e53f4fd1f1 | ||
|
|
8047e196fe | ||
|
|
c6c979dc19 | ||
|
|
573a2a5595 | ||
|
|
9bc64bf453 | ||
|
|
c8a1c8377a | ||
|
|
2ffaf2f601 | ||
|
|
4696152f78 | ||
|
|
a0944f8359 | ||
|
|
1fdbe987b8 | ||
|
|
40303c2d78 | ||
|
|
4b5048bd80 | ||
|
|
9d31050907 | ||
|
|
e930d1dec6 | ||
|
|
1d3bae4a7a | ||
|
|
d950e4ebb3 | ||
|
|
3ba82bd5a4 | ||
|
|
bc969c1ca2 | ||
|
|
772aa7379f | ||
|
|
4e954c24f7 | ||
|
|
6c00cdd726 | ||
|
|
52839e2a7d | ||
|
|
1a9d5f151f | ||
|
|
8bc500e4da | ||
|
|
25217c3262 | ||
|
|
0c2797ecdc | ||
|
|
101f6e744a | ||
|
|
c5e0b8a42e | ||
|
|
6d7e0a7a72 | ||
|
|
2bc2e86b01 | ||
|
|
6fec217068 | ||
|
|
ee1af39c55 | ||
|
|
a5ae481ea4 | ||
|
|
f8d19301be | ||
|
|
d6f527881a | ||
|
|
80fed1e045 | ||
|
|
a94d657251 | ||
|
|
9dafa062f8 | ||
|
|
5811b184be | ||
|
|
e0a3b51ca2 | ||
|
|
b5276a6a1d | ||
|
|
c8a6aa42fb | ||
|
|
17edc06987 | ||
|
|
cc1b030c00 | ||
|
|
c896785480 | ||
|
|
0006948c29 | ||
|
|
6ac14f832e | ||
|
|
a60afdbaa5 | ||
|
|
e2772e899e | ||
|
|
43f86e5e37 | ||
|
|
d7c06e5ff4 | ||
|
|
3f2b0973af | ||
|
|
ac841077c2 | ||
|
|
fd9a4966ec | ||
|
|
6d0350793d | ||
|
|
d74f9183a0 | ||
|
|
7155ccaf96 | ||
|
|
64996db86b | ||
|
|
c1282e77a0 | ||
|
|
3246176c0a | ||
|
|
b68f561e6f | ||
|
|
79574b31b0 | ||
|
|
22f3865602 | ||
|
|
f51d255c98 | ||
|
|
66a2ec7e21 | ||
|
|
fc12b1f09b | ||
|
|
69b559fb26 | ||
|
|
637ed59567 | ||
|
|
df350b5a56 | ||
|
|
3b6344e7f0 | ||
|
|
cee9f66689 | ||
|
|
5dc9200ee7 | ||
|
|
2be5384980 | ||
|
|
25dfc182a9 | ||
|
|
145648431f | ||
|
|
14e7e411c0 | ||
|
|
c9b41e2eb1 | ||
|
|
7c2118f2f6 | ||
|
|
499d473b9d | ||
|
|
41147ae7f3 | ||
|
|
c6d72d31cb | ||
|
|
bb101ef95e | ||
|
|
64f6a2d81e | ||
|
|
45c66b93d7 | ||
|
|
a3dba9b566 | ||
|
|
f991d8a10a | ||
|
|
2b7ebf08cb | ||
|
|
23ab8983f7 | ||
|
|
b25b6f7bf2 | ||
|
|
b8b77693e1 | ||
|
|
19593cd771 | ||
|
|
1be8de7acb | ||
|
|
564d8c2868 | ||
|
|
8033cdbc89 | ||
|
|
7dd64380cc | ||
|
|
5c3e28535a | ||
|
|
21ed1439e2 | ||
|
|
c1c72ddd9b | ||
|
|
235a8e3934 | ||
|
|
3530bff320 | ||
|
|
12f0195f29 | ||
|
|
85dcfbf368 | ||
|
|
8568c372f6 | ||
|
|
8ffd4fc664 | ||
|
|
f46548ed88 | ||
|
|
0d335e3056 | ||
|
|
6ff701bd5c | ||
|
|
c34be5313d | ||
|
|
ec2fc0a5f2 | ||
|
|
ad54afe39a | ||
|
|
eb4cd75218 | ||
|
|
a84f5a1e32 | ||
|
|
e193347fb4 | ||
|
|
ad27c8674b | ||
|
|
810abba83e | ||
|
|
03b76cbcf5 | ||
|
|
c711ffe6c5 | ||
|
|
8094bf9c7c | ||
|
|
09c7b31918 | ||
|
|
d1e98d0849 | ||
|
|
40cb3a53ae | ||
|
|
5123a86062 | ||
|
|
e9e7434c69 | ||
|
|
d2ac6ec10f | ||
|
|
4f19884c8d | ||
|
|
16c332ad2e | ||
|
|
d430dd2b73 | ||
|
|
43a0020a9e | ||
|
|
b0e82cd59b | ||
|
|
237370f0c7 | ||
|
|
69be367acf | ||
|
|
cdf8943f24 | ||
|
|
fb0cd436d3 | ||
|
|
33f145a40b | ||
|
|
3b69ff9fc9 | ||
|
|
66bc0d487c | ||
|
|
9bde70a8e2 | ||
|
|
010c205eec | ||
|
|
322941f29a | ||
|
|
dd17ee7665 | ||
|
|
160c84ec1a | ||
|
|
924c0b63bd | ||
|
|
9b8dce0c77 | ||
|
|
7159678385 | ||
|
|
4b51066327 | ||
|
|
bf19c6e730 | ||
|
|
12a2b491c3 | ||
|
|
4636a8d9b1 | ||
|
|
abbb0db1ff | ||
|
|
95fe212202 | ||
|
|
fbb9bf14e9 | ||
|
|
23ebe966e0 | ||
|
|
d0fa6eaf83 | ||
|
|
c8e232c598 | ||
|
|
7a0309cdf4 | ||
|
|
b874619f0d | ||
|
|
a3013ff85b | ||
|
|
65c5abfa88 | ||
|
|
0114e36cfa | ||
|
|
5c56e0f498 | ||
|
|
61992ae787 | ||
|
|
08bbeedbd7 | ||
|
|
a5f2db8c80 | ||
|
|
8d1ce0460f | ||
|
|
028c73fd3a | ||
|
|
27e9773782 | ||
|
|
7ae128dec6 | ||
|
|
fe4129c8e0 | ||
|
|
3c85b48291 | ||
|
|
ea2e026c56 | ||
|
|
8b3f310212 | ||
|
|
87136e9e2b | ||
|
|
5a6a9d6ec2 | ||
|
|
d3b3a0eb8a | ||
|
|
91fc59cffc | ||
|
|
e32dbad0d0 | ||
|
|
8828a3049d | ||
|
|
d74b69d84d | ||
|
|
b66aafd168 | ||
|
|
2cd0f69069 | ||
|
|
0177f641c8 | ||
|
|
abcfe638c9 | ||
|
|
49ab0751c0 | ||
|
|
e994f3a220 | ||
|
|
38b0276458 | ||
|
|
a373d96c3c | ||
|
|
b3969a6ce0 | ||
|
|
ab97d3b8b7 | ||
|
|
97a3f130c8 | ||
|
|
5b8f8fb62f | ||
|
|
213df68d04 | ||
|
|
9738ef382c | ||
|
|
ca0c1170ab | ||
|
|
db9387764d | ||
|
|
e0039a08ef | ||
|
|
09df4a5771 | ||
|
|
81ac1ebc08 | ||
|
|
c2f5c2226f | ||
|
|
d779f7ae7f | ||
|
|
d26c7e6f9b | ||
|
|
6331298eac | ||
|
|
76abf37351 | ||
|
|
9db3cd901c | ||
|
|
64c9230423 | ||
|
|
17943ef0db | ||
|
|
8ed3f0b1cc | ||
|
|
7c50a5e17b | ||
|
|
c13c85bd2d | ||
|
|
ae01dc9639 | ||
|
|
a74ed0daf0 | ||
|
|
60387651d2 | ||
|
|
3a78be68d6 | ||
|
|
a896332db3 | ||
|
|
54eeb0e327 | ||
|
|
704e30219a | ||
|
|
1396083b7d | ||
|
|
7017024ba7 | ||
|
|
942c1aa3a6 | ||
|
|
d35ffef503 | ||
|
|
7705f45d78 | ||
|
|
964bbe6aa5 | ||
|
|
01a2e4cd4f | ||
|
|
1f13554bd9 | ||
|
|
9032d7d7bc | ||
|
|
d573c0922d | ||
|
|
45d3438d18 | ||
|
|
4cc3691489 | ||
|
|
24eadf2507 | ||
|
|
a274bfb744 | ||
|
|
2277c792b9 | ||
|
|
61f5614ac9 | ||
|
|
6367aed62a | ||
|
|
739f592061 | ||
|
|
116c2b73c1 | ||
|
|
58be7ae5db | ||
|
|
0e0fb885d2 | ||
|
|
e8546b82f8 | ||
|
|
837fbab96d | ||
|
|
cbd2d88000 | ||
|
|
6c80fd0e18 | ||
|
|
01ac1cdcca | ||
|
|
b3b7fb8f29 | ||
|
|
d101fda423 | ||
|
|
b1d523a4e6 | ||
|
|
dab56f0882 | ||
|
|
161e8a6c21 | ||
|
|
2e3c1adc63 | ||
|
|
846f2485db | ||
|
|
107ca38268 | ||
|
|
35547b476f | ||
|
|
ad765200c3 | ||
|
|
4618256442 | ||
|
|
323ef1d5d6 | ||
|
|
a5b1648b68 | ||
|
|
14c920a258 | ||
|
|
4f92b7ced1 | ||
|
|
5ec2006c9e | ||
|
|
dcdf31eee8 | ||
|
|
3ab1b907e4 | ||
|
|
e60a1e4357 | ||
|
|
776afa4a36 | ||
|
|
3cac19d498 | ||
|
|
2ba8a87c9d | ||
|
|
d677dc51de | ||
|
|
ebbfcd169c | ||
|
|
574d2994d1 | ||
|
|
ecc5d64584 | ||
|
|
6888682f92 | ||
|
|
0197cdb33d | ||
|
|
2de1f0464f | ||
|
|
bcb92b63e3 | ||
|
|
412397fa7b | ||
|
|
0e87351a9c | ||
|
|
71f4150c27 | ||
|
|
a2caf7425d | ||
|
|
6fa11a38ef | ||
|
|
e3f75215b6 | ||
|
|
06983948b0 | ||
|
|
a21535b0a2 | ||
|
|
d14b6e6d7d | ||
|
|
bd96b5d722 | ||
|
|
b431fb1e49 | ||
|
|
b97619b8f9 | ||
|
|
3d3f0460fa | ||
|
|
37d67ee9d0 | ||
|
|
0d49dee46e | ||
|
|
9fe3f6042f | ||
|
|
cdd4a1ff1f | ||
|
|
8408a53b82 | ||
|
|
5969e9accc | ||
|
|
927b618ec9 | ||
|
|
9f83853922 | ||
|
|
ecf094f684 | ||
|
|
8f5634d958 | ||
|
|
7237b8971e | ||
|
|
33239219cb | ||
|
|
09ef096620 | ||
|
|
3c59858f70 | ||
|
|
6f0161e9da | ||
|
|
6c19a4c68a | ||
|
|
b8afef1ee4 | ||
|
|
f2bd735f51 | ||
|
|
7a8fd8c3e5 | ||
|
|
b24aa2f797 | ||
|
|
b3436415dc | ||
|
|
16a819ff4f | ||
|
|
157185c370 | ||
|
|
ace6c5c9e4 | ||
|
|
4a4c8eace2 | ||
|
|
8183dcf363 | ||
|
|
d4f1772d2e | ||
|
|
dc1c7d8bd2 | ||
|
|
9c10094914 | ||
|
|
72fed8d6a7 | ||
|
|
ec90adc6d9 | ||
|
|
93f3171a63 | ||
|
|
7d4c6b1174 | ||
|
|
3e04bfbd21 | ||
|
|
c6ebebc4d0 | ||
|
|
17405b849a | ||
|
|
897e8f6883 | ||
|
|
5e4f1fc279 | ||
|
|
e779d180f9 | ||
|
|
7d06dd4b1d | ||
|
|
5bc9fb19a8 | ||
|
|
607aa1b992 | ||
|
|
e4db2f4819 | ||
|
|
a84a32c075 | ||
|
|
9475211417 | ||
|
|
5649986834 | ||
|
|
7eaa8d54dc | ||
|
|
61a1fbde6e | ||
|
|
a0a18973d8 | ||
|
|
9bc20c26bb | ||
|
|
14cb41ea87 | ||
|
|
edd90cbed4 | ||
|
|
1de20e9d43 | ||
|
|
ad8b339a3b | ||
|
|
9532f21c7b | ||
|
|
754d28e95d | ||
|
|
e3b7d82a8f | ||
|
|
888145a2ed | ||
|
|
726bdd8735 | ||
|
|
5b9f6b2d52 | ||
|
|
aabff98bea | ||
|
|
aade3db80d | ||
|
|
129c10dde5 | ||
|
|
993d56cb58 | ||
|
|
efa6a533c3 | ||
|
|
04ffdf9b15 | ||
|
|
f61bf1bd67 | ||
|
|
b1c4e32123 | ||
|
|
8958da83b3 | ||
|
|
3fcf197bc1 | ||
|
|
532dfd7f5a | ||
|
|
92ddf2ec6c | ||
|
|
a703f46a0a | ||
|
|
d86c009f55 | ||
|
|
56d6857cd6 | ||
|
|
52bc9be6b6 | ||
|
|
918f26962a | ||
|
|
3bf7870729 | ||
|
|
0eebe48492 | ||
|
|
e02cb30f1b | ||
|
|
d005f0d7d6 | ||
|
|
cc44558f40 | ||
|
|
73521dd7a7 | ||
|
|
3041d7d2b1 | ||
|
|
b6ab5249f1 | ||
|
|
dc838e7148 | ||
|
|
f290e52fbd | ||
|
|
e4de376394 | ||
|
|
44ec237447 | ||
|
|
ec5a6aec41 | ||
|
|
7f96d20eb4 | ||
|
|
dfd9108f39 | ||
|
|
e07c1e6958 | ||
|
|
1113c3924f | ||
|
|
b1ddaa7211 | ||
|
|
ff00ddeb3c | ||
|
|
ba7a6dbbf0 | ||
|
|
f3a88de0c3 | ||
|
|
4e0b5569dc | ||
|
|
a4d763c1e5 | ||
|
|
33fdc23965 | ||
|
|
aaf9f53695 | ||
|
|
59cf049a06 | ||
|
|
5b74a55c3c | ||
|
|
f2ce070833 | ||
|
|
ce9bd18947 | ||
|
|
9e5d0e88de | ||
|
|
43f7989d73 | ||
|
|
69245e4fad | ||
|
|
f8f496da73 | ||
|
|
6dbe0645e5 | ||
|
|
d4ed34d0ea | ||
|
|
7875406da1 | ||
|
|
57a9992a3d | ||
|
|
b3ce624fff | ||
|
|
ee4405e75e | ||
|
|
f7c3957a43 | ||
|
|
dcbb0e48d4 | ||
|
|
74b95a0bcc | ||
|
|
8b70aa9f0e | ||
|
|
9095595db1 | ||
|
|
8334fd9c46 | ||
|
|
31cf6a2ebc | ||
|
|
97f4cbdade | ||
|
|
ba0abb156a | ||
|
|
47f9b0021c | ||
|
|
f5bd8ab585 | ||
|
|
356236ba4c | ||
|
|
28d468dd41 | ||
|
|
80b82b0bd6 | ||
|
|
039d5c22ac | ||
|
|
07b867df76 | ||
|
|
52a144c052 | ||
|
|
25d55feeef | ||
|
|
5e48ccafce | ||
|
|
69dd35c30a | ||
|
|
d37a8d51fa | ||
|
|
6e14f7b626 | ||
|
|
e8ab7bce0c | ||
|
|
083c678400 | ||
|
|
efbf62f56a | ||
|
|
7442ffc7d8 | ||
|
|
25479ca71f | ||
|
|
c9f6b5206a | ||
|
|
755cfb4e13 | ||
|
|
fb73517fc1 | ||
|
|
825dbb36dd | ||
|
|
cd2e5bf2d0 | ||
|
|
520c9d8d51 | ||
|
|
370b117938 | ||
|
|
6ab05e7c05 | ||
|
|
7896f951f3 | ||
|
|
01932d873f | ||
|
|
84a8477c5d | ||
|
|
6b468eaed3 | ||
|
|
a146153ee9 | ||
|
|
c509dab5f1 | ||
|
|
1940901386 | ||
|
|
36fc3bbd6d | ||
|
|
5406a263d5 | ||
|
|
3f3ac21f50 | ||
|
|
11820a16f0 | ||
|
|
39391c8088 | ||
|
|
ac359839e2 | ||
|
|
9ac5ef09ad | ||
|
|
3394588602 | ||
|
|
4c5099d429 | ||
|
|
c64a05f2ff | ||
|
|
0c4426a55e | ||
|
|
1243c7588b | ||
|
|
624c4855c8 | ||
|
|
12a76a9d35 | ||
|
|
6a3e5415cf | ||
|
|
2c4f65009c | ||
|
|
f3ca5b1c42 | ||
|
|
feb700393e | ||
|
|
640f53d085 | ||
|
|
1aa9d87c5d | ||
|
|
e11c562022 | ||
|
|
a76a2d8e9f | ||
|
|
d503c09ef2 | ||
|
|
6ce52bf9ab | ||
|
|
f67fcecc6e | ||
|
|
b7c392a244 | ||
|
|
ad0b0a5e95 | ||
|
|
c77b0afd8e | ||
|
|
04ebe4efea | ||
|
|
cbb4d6846f | ||
|
|
ba699b8d06 | ||
|
|
a0558ace16 | ||
|
|
ca793966a8 | ||
|
|
d9273ec369 | ||
|
|
cacd5b0643 | ||
|
|
7c405ff9d7 | ||
|
|
5e6dd2e8b3 | ||
|
|
dbc533e976 | ||
|
|
4d902da931 | ||
|
|
578a18acbe | ||
|
|
17ba048b50 | ||
|
|
36a2bffdc7 | ||
|
|
8cc530dd4c | ||
|
|
1df104967e | ||
|
|
7a0f6d5e93 | ||
|
|
8d2ae23ae6 | ||
|
|
21f359456c | ||
|
|
0476585370 | ||
|
|
2b4dfbe2ca | ||
|
|
cf95af66c6 | ||
|
|
b95563bdf1 | ||
|
|
4d093735ec | ||
|
|
cd5d5b4bb0 | ||
|
|
8b11019712 | ||
|
|
1930740d10 | ||
|
|
39230159ae | ||
|
|
4611ef3713 | ||
|
|
1537b69457 | ||
|
|
25fe83cd40 | ||
|
|
435b9b14e3 | ||
|
|
76ff0c56cd | ||
|
|
17870bcab8 | ||
|
|
5fb660bc9a | ||
|
|
f713dbacf8 | ||
|
|
73ce526467 | ||
|
|
0ba6df3b23 | ||
|
|
322199358d | ||
|
|
dcdfaf66f4 | ||
|
|
d8546bf747 | ||
|
|
1e5bf3aa98 | ||
|
|
647f057714 | ||
|
|
523ff66389 | ||
|
|
15c32f9103 | ||
|
|
12168531a1 | ||
|
|
a3933bdc79 | ||
|
|
ebd21f3f53 | ||
|
|
ce6c7c3b91 | ||
|
|
c2e46932ee | ||
|
|
c46fb7e74c | ||
|
|
ac6637c6ab | ||
|
|
cc19b60146 | ||
|
|
dcc1738978 | ||
|
|
d2bd9c0e26 | ||
|
|
7a1edb3833 | ||
|
|
ec7fa5e24a | ||
|
|
295353e804 | ||
|
|
1cef75d6d3 | ||
|
|
0c4cb863a3 | ||
|
|
404f9a4eb3 | ||
|
|
04e33a6443 | ||
|
|
787336725c | ||
|
|
b7255f72bb | ||
|
|
e2da31c2b7 | ||
|
|
915c3f3c95 | ||
|
|
c58ed45cf0 | ||
|
|
69857b6b5c | ||
|
|
0b0ff62bc5 | ||
|
|
2381260a55 | ||
|
|
ba4fbb9953 | ||
|
|
7b006fb721 | ||
|
|
f42d82e8df | ||
|
|
d5df002f98 | ||
|
|
a136bef668 | ||
|
|
bbc65c32b6 | ||
|
|
0ec136d227 | ||
|
|
20127e6b1d | ||
|
|
24817a3919 | ||
|
|
f448cc9c7d | ||
|
|
4913df2297 | ||
|
|
9f76371449 | ||
|
|
8521123d19 | ||
|
|
3567dfc0dc | ||
|
|
500811d5ea | ||
|
|
d86694a01c | ||
|
|
421120024a | ||
|
|
fe860481c5 | ||
|
|
8af086c2a1 | ||
|
|
778d5be407 | ||
|
|
8e8e584087 | ||
|
|
aacd715379 | ||
|
|
efb9778459 | ||
|
|
073fb16e20 | ||
|
|
31d8593c8e | ||
|
|
445a9679bd | ||
|
|
0bcf9e6be7 | ||
|
|
50ae37c160 | ||
|
|
b24c7fbf93 | ||
|
|
48aff374a3 | ||
|
|
0ff9153d1a | ||
|
|
d2397c3c1c | ||
|
|
0a74a53254 | ||
|
|
01f87218de | ||
|
|
5286739414 | ||
|
|
9c7bedb715 | ||
|
|
70c5a07913 | ||
|
|
da3be8d8be | ||
|
|
5cc8198302 | ||
|
|
41112a59ec | ||
|
|
2a890a35a0 | ||
|
|
219cb5e044 | ||
|
|
ef003ffbb5 | ||
|
|
50bd8448cc | ||
|
|
0b326370bd | ||
|
|
d0963baad4 | ||
|
|
074cc8e6ff | ||
|
|
75e8c60fe2 | ||
|
|
97569a1e9d | ||
|
|
b4bc0f4719 | ||
|
|
385054b7b8 | ||
|
|
442f7a914a | ||
|
|
764eb98bc2 | ||
|
|
4575b502a8 | ||
|
|
cf0d56eee7 | ||
|
|
b7fd19dcfd | ||
|
|
60dfa0f87e | ||
|
|
cce9e162d4 | ||
|
|
0ab2695ceb | ||
|
|
56666ad82c | ||
|
|
cb41be9e85 | ||
|
|
0566f46d5b | ||
|
|
b4e8dd8a7b | ||
|
|
1f6735a14d | ||
|
|
e0c499645d | ||
|
|
217bb388a0 | ||
|
|
5c8772774f | ||
|
|
e7ea27a1b3 | ||
|
|
57e06dced2 | ||
|
|
973b93e332 | ||
|
|
bc71af7a1f | ||
|
|
fa33348910 | ||
|
|
da47d247c9 | ||
|
|
9bd7909983 | ||
|
|
06c0d5b0f5 | ||
|
|
662f906f9d | ||
|
|
2e85dcc36a | ||
|
|
2ec3f52ea6 | ||
|
|
a12e2e2022 | ||
|
|
11a60dbdbf | ||
|
|
ff33cb62df | ||
|
|
cac1539094 | ||
|
|
3e768bccb8 | ||
|
|
1463b35e2e | ||
|
|
6518088de7 | ||
|
|
31d190cbf4 | ||
|
|
24504dcc87 | ||
|
|
742fa4cbd6 | ||
|
|
7f65d122a8 | ||
|
|
602158aa56 | ||
|
|
4c9bbeb5b7 | ||
|
|
f2bb54d993 | ||
|
|
fbf0a9652a | ||
|
|
f0e4e52364 | ||
|
|
e4fa47f27e | ||
|
|
061f42626c | ||
|
|
5112f5c9ce | ||
|
|
409612ff1f | ||
|
|
8b8737221d | ||
|
|
cabba5e70d | ||
|
|
da5e91ee03 | ||
|
|
6e2c319e7e | ||
|
|
eab7828bfe | ||
|
|
38619ae023 | ||
|
|
e7a7a8609a | ||
|
|
8702d95434 | ||
|
|
3b5af6bdd4 | ||
|
|
25a9fb9b5c | ||
|
|
0984d1587a | ||
|
|
7123c62876 | ||
|
|
db1713dbde | ||
|
|
b150969986 | ||
|
|
56aa57dab2 | ||
|
|
ba24c5b219 | ||
|
|
43c2436385 | ||
|
|
ba0779ea1e | ||
|
|
2e379dd29c | ||
|
|
331f63eadd | ||
|
|
fc25bfe0df | ||
|
|
576d218cd9 | ||
|
|
b9d93118b9 | ||
|
|
5625771ffb | ||
|
|
c85e5643db | ||
|
|
21473aba9e | ||
|
|
ad39bc176d | ||
|
|
5a1d61a042 | ||
|
|
8adeb8a120 | ||
|
|
6581979506 | ||
|
|
df14cbad44 | ||
|
|
72f3eaa8f6 | ||
|
|
f106191e72 | ||
|
|
62b185fd32 | ||
|
|
7d9b3b1f28 | ||
|
|
71f6b44c0c | ||
|
|
e14b7bc2fb | ||
|
|
94e9772cf6 | ||
|
|
2b807c2409 | ||
|
|
0af2e85f91 | ||
|
|
2394488c92 | ||
|
|
cfdc8ede90 | ||
|
|
83aa4c9a53 | ||
|
|
c20ac6c2d8 | ||
|
|
7311773c20 | ||
|
|
5472d2586c | ||
|
|
6d7b76115f | ||
|
|
a920adcf7f | ||
|
|
529844eb36 | ||
|
|
fd187b11f9 | ||
|
|
f6cfd2349b | ||
|
|
9e2e676cc2 | ||
|
|
5811ee5897 | ||
|
|
a11e78176f | ||
|
|
db4c373c45 | ||
|
|
5be17330d1 | ||
|
|
a7de6993f9 | ||
|
|
d7446c2a3f | ||
|
|
f319f0803a | ||
|
|
9eb76a95ca | ||
|
|
afcb30be03 | ||
|
|
b9f817201c | ||
|
|
f17e3e91ec | ||
|
|
121a64ba57 | ||
|
|
a9f2dfc4b8 | ||
|
|
b7e047d149 | ||
|
|
f69137b38d | ||
|
|
aaa48f6a1a | ||
|
|
edce5186b9 | ||
|
|
306bd8faaa | ||
|
|
0766a5da91 | ||
|
|
9746f6e5e2 | ||
|
|
89a1e2500e | ||
|
|
267d1a27ac | ||
|
|
f5e6e49075 | ||
|
|
d44ce0a070 | ||
|
|
9ddccba780 | ||
|
|
394ce29ea3 | ||
|
|
f19a35ff06 | ||
|
|
8943e88ca8 | ||
|
|
18774aa0a7 | ||
|
|
af80a78406 | ||
|
|
6043da4424 | ||
|
|
301894f6e8 | ||
|
|
a425a7fda2 | ||
|
|
21c3835322 | ||
|
|
75086bac7f | ||
|
|
726df310ee | ||
|
|
b952728b2c | ||
|
|
1cac2ff1d4 | ||
|
|
a93c77a1cc | ||
|
|
dd09f5b153 | ||
|
|
4c10282f40 | ||
|
|
29f996de66 | ||
|
|
c575e02fbb | ||
|
|
e96a0108c3 | ||
|
|
e86fce692c | ||
|
|
8d35c7c139 | ||
|
|
0a5725a62e | ||
|
|
1c6f5126db | ||
|
|
1ec5e3bf2a | ||
|
|
d29727c869 | ||
|
|
eabb894580 | ||
|
|
96339f0de6 | ||
|
|
d7e3e134a5 | ||
|
|
dfb0ff7a98 | ||
|
|
48f1e24bf5 | ||
|
|
cf47508185 | ||
|
|
2a024039bf | ||
|
|
212cc478de | ||
|
|
88ea60df2a | ||
|
|
c1b7232a88 | ||
|
|
04577a48be | ||
|
|
18ef37a2d0 | ||
|
|
4108e67178 | ||
|
|
ff479de7bd | ||
|
|
4afac201b9 | ||
|
|
c30537fe6a | ||
|
|
7fbf448b22 | ||
|
|
cd9c9a25d3 | ||
|
|
da1671fdf1 | ||
|
|
1ed73b6f8e | ||
|
|
3d61897522 | ||
|
|
f01825166d | ||
|
|
d110503639 | ||
|
|
64bf7eb363 | ||
|
|
07f8bda27e | ||
|
|
e3ecc9d4be | ||
|
|
ca209ed54c | ||
|
|
205560cc95 | ||
|
|
df6ff027b5 | ||
|
|
e772497e12 | ||
|
|
205bbd9c61 | ||
|
|
224bc6b429 | ||
|
|
7698243caf | ||
|
|
67f0934930 | ||
|
|
30e998edf7 | ||
|
|
dc197f6a5c | ||
|
|
f182833a8d | ||
|
|
61ab1f1ef2 | ||
|
|
e664f2df28 | ||
|
|
dea582f24a | ||
|
|
b860bf753a | ||
|
|
b5690f6879 | ||
|
|
a39ad55578 | ||
|
|
4c276d1211 | ||
|
|
5f74b1b730 | ||
|
|
b9040eb0de | ||
|
|
ab63d5dbdb | ||
|
|
f233f13637 | ||
|
|
c8a8236401 | ||
|
|
2a35e45920 | ||
|
|
aa5de9f7bd | ||
|
|
f5603b1274 | ||
|
|
1d27fcc50e | ||
|
|
dd2926201d | ||
|
|
f9eeb76518 | ||
|
|
ebcef8adbd | ||
|
|
957235a656 | ||
|
|
64a0c171f3 | ||
|
|
ff14217d38 | ||
|
|
46596f01fa | ||
|
|
c1388a68f0 | ||
|
|
a28ac3bee6 | ||
|
|
374da11037 | ||
|
|
caa8d9ecb0 | ||
|
|
02c7de6b1a | ||
|
|
c71b9f6e8f | ||
|
|
8c1feccbe0 | ||
|
|
5ee15c8b41 | ||
|
|
5328f55322 | ||
|
|
712f904c43 | ||
|
|
ccd7d86302 | ||
|
|
3643303a51 | ||
|
|
81d407f0ff | ||
|
|
d29b0660f0 | ||
|
|
59b94177d6 | ||
|
|
9d2c5d54b0 | ||
|
|
fc89604982 | ||
|
|
09f7329a21 | ||
|
|
cfd6676583 | ||
|
|
a6f1a0245a | ||
|
|
3713ee9d93 | ||
|
|
009c8d55c3 | ||
|
|
c0c01f0d17 | ||
|
|
2fe5dccbb4 | ||
|
|
c83a143eef | ||
|
|
fcf859ffed | ||
|
|
56ef2a4e1c | ||
|
|
c36e8abc19 | ||
|
|
e76293acdb | ||
|
|
5bdb4ed51b | ||
|
|
fe3f87e1fd | ||
|
|
aaf5d76071 | ||
|
|
d9a696a411 | ||
|
|
76ab4c92f0 | ||
|
|
60beaf51bc | ||
|
|
9ab17ff79c | ||
|
|
1a363790a0 | ||
|
|
d488bb6393 | ||
|
|
114ad779b4 | ||
|
|
49d2ac2b13 | ||
|
|
5a24a7775e | ||
|
|
52e52f35f7 | ||
|
|
810be2c9d2 | ||
|
|
8e4777a5ff | ||
|
|
9a2252ed3f | ||
|
|
9264a03dbc | ||
|
|
fb2a42a9af | ||
|
|
63531cdbb6 | ||
|
|
bae348bef7 | ||
|
|
bd223d8643 | ||
|
|
3fa6c72620 | ||
|
|
2b90bdc86a | ||
|
|
6831b72804 | ||
|
|
5e12b928d9 | ||
|
|
0453f51e64 | ||
|
|
9594e4115c | ||
|
|
201e14f287 | ||
|
|
d833bd0d55 | ||
|
|
46eeb014af | ||
|
|
8e7a2cf353 | ||
|
|
2c528811cc | ||
|
|
3130b56d58 | ||
|
|
b466d83625 | ||
|
|
6d008546f1 | ||
|
|
c60b14e2e7 | ||
|
|
c753a7cffa | ||
|
|
5cba4d7d9b | ||
|
|
685df9e5ea | ||
|
|
ef5a42cf40 | ||
|
|
45ab6c7309 | ||
|
|
1b54a109d5 | ||
|
|
f2ad4c40e6 | ||
|
|
8538f2eca2 | ||
|
|
c55fa6dc6a | ||
|
|
17f37750e5 | ||
|
|
e789c17bc3 | ||
|
|
6f44d39b18 | ||
|
|
dd85249781 | ||
|
|
bdba621442 | ||
|
|
034315ed85 | ||
|
|
af0425b8f1 | ||
|
|
6cf0a0bb42 | ||
|
|
612716ee69 | ||
|
|
f78a5d1a78 | ||
|
|
2d0de87530 | ||
|
|
c0bb395571 | ||
|
|
f051ddc7f0 | ||
|
|
38e7da1334 | ||
|
|
678b232c24 | ||
|
|
fbd0dbd048 | ||
|
|
1df19faf5c | ||
|
|
8ec5794833 | ||
|
|
72146d9566 | ||
|
|
9af3e364aa | ||
|
|
229cb1e9ef | ||
|
|
21f78a039a | ||
|
|
6069c586d3 | ||
|
|
3bdc0340b8 |
5
.github/.gitleaks.toml
vendored
5
.github/.gitleaks.toml
vendored
@@ -536,10 +536,11 @@ secretGroup = 4
|
|||||||
|
|
||||||
[allowlist]
|
[allowlist]
|
||||||
description = "global allow lists"
|
description = "global allow lists"
|
||||||
regexes = ['''219-09-9999''', '''078-05-1120''', '''(9[0-9]{2}|666)-\d{2}-\d{4}''', '''RPM-GPG-KEY.*''', '''.*:.*StrelkaHexDump.*''', '''.*:.*PLACEHOLDER.*''', '''ssl_.*password''']
|
regexes = ['''219-09-9999''', '''078-05-1120''', '''(9[0-9]{2}|666)-\d{2}-\d{4}''', '''RPM-GPG-KEY.*''', '''.*:.*StrelkaHexDump.*''', '''.*:.*PLACEHOLDER.*''', '''ssl_.*password''', '''integration_key\s=\s"so-logs-"''']
|
||||||
paths = [
|
paths = [
|
||||||
'''gitleaks.toml''',
|
'''gitleaks.toml''',
|
||||||
'''(.*?)(jpg|gif|doc|pdf|bin|svg|socket)$''',
|
'''(.*?)(jpg|gif|doc|pdf|bin|svg|socket)$''',
|
||||||
'''(go.mod|go.sum)$''',
|
'''(go.mod|go.sum)$''',
|
||||||
'''salt/nginx/files/enterprise-attack.json'''
|
'''salt/nginx/files/enterprise-attack.json''',
|
||||||
|
'''(.*?)whl$'''
|
||||||
]
|
]
|
||||||
|
|||||||
20
.github/DISCUSSION_TEMPLATE/2-4.yml
vendored
20
.github/DISCUSSION_TEMPLATE/2-4.yml
vendored
@@ -11,7 +11,6 @@ body:
|
|||||||
description: Which version of Security Onion 2.4.x are you asking about?
|
description: Which version of Security Onion 2.4.x are you asking about?
|
||||||
options:
|
options:
|
||||||
-
|
-
|
||||||
- 2.4 Pre-release (Beta, Release Candidate)
|
|
||||||
- 2.4.10
|
- 2.4.10
|
||||||
- 2.4.20
|
- 2.4.20
|
||||||
- 2.4.30
|
- 2.4.30
|
||||||
@@ -22,6 +21,18 @@ body:
|
|||||||
- 2.4.80
|
- 2.4.80
|
||||||
- 2.4.90
|
- 2.4.90
|
||||||
- 2.4.100
|
- 2.4.100
|
||||||
|
- 2.4.110
|
||||||
|
- 2.4.111
|
||||||
|
- 2.4.120
|
||||||
|
- 2.4.130
|
||||||
|
- 2.4.140
|
||||||
|
- 2.4.141
|
||||||
|
- 2.4.150
|
||||||
|
- 2.4.160
|
||||||
|
- 2.4.170
|
||||||
|
- 2.4.180
|
||||||
|
- 2.4.190
|
||||||
|
- 2.4.200
|
||||||
- Other (please provide detail below)
|
- Other (please provide detail below)
|
||||||
validations:
|
validations:
|
||||||
required: true
|
required: true
|
||||||
@@ -32,9 +43,10 @@ body:
|
|||||||
options:
|
options:
|
||||||
-
|
-
|
||||||
- Security Onion ISO image
|
- Security Onion ISO image
|
||||||
- Network installation on Red Hat derivative like Oracle, Rocky, Alma, etc.
|
- Cloud image (Amazon, Azure, Google)
|
||||||
- Network installation on Ubuntu
|
- Network installation on Red Hat derivative like Oracle, Rocky, Alma, etc. (unsupported)
|
||||||
- Network installation on Debian
|
- Network installation on Ubuntu (unsupported)
|
||||||
|
- Network installation on Debian (unsupported)
|
||||||
- Other (please provide detail below)
|
- Other (please provide detail below)
|
||||||
validations:
|
validations:
|
||||||
required: true
|
required: true
|
||||||
|
|||||||
12
.github/ISSUE_TEMPLATE
vendored
12
.github/ISSUE_TEMPLATE
vendored
@@ -1,12 +0,0 @@
|
|||||||
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
|
|
||||||
38
.github/ISSUE_TEMPLATE/bug_report.md
vendored
Normal file
38
.github/ISSUE_TEMPLATE/bug_report.md
vendored
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
---
|
||||||
|
name: Bug report
|
||||||
|
about: This option is for experienced community members to report a confirmed, reproducible bug
|
||||||
|
title: ''
|
||||||
|
labels: ''
|
||||||
|
assignees: ''
|
||||||
|
|
||||||
|
---
|
||||||
|
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 at 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 at https://securityonion.net/discuss 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
|
||||||
|
|
||||||
|
**Describe the bug**
|
||||||
|
A clear and concise description of what the bug is.
|
||||||
|
|
||||||
|
**To Reproduce**
|
||||||
|
Steps to reproduce the behavior:
|
||||||
|
1. Go to '...'
|
||||||
|
2. Click on '....'
|
||||||
|
3. Scroll down to '....'
|
||||||
|
4. See error
|
||||||
|
|
||||||
|
**Expected behavior**
|
||||||
|
A clear and concise description of what you expected to happen.
|
||||||
|
|
||||||
|
**Screenshots**
|
||||||
|
If applicable, add screenshots to help explain your problem.
|
||||||
|
|
||||||
|
**Additional context**
|
||||||
|
Add any other context about the problem here.
|
||||||
5
.github/ISSUE_TEMPLATE/config.yml
vendored
Normal file
5
.github/ISSUE_TEMPLATE/config.yml
vendored
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
blank_issues_enabled: false
|
||||||
|
contact_links:
|
||||||
|
- name: Security Onion Discussions
|
||||||
|
url: https://securityonion.com/discussions
|
||||||
|
about: Please ask and answer questions here
|
||||||
2
.github/workflows/contrib.yml
vendored
2
.github/workflows/contrib.yml
vendored
@@ -18,7 +18,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
path-to-signatures: 'signatures_v1.json'
|
path-to-signatures: 'signatures_v1.json'
|
||||||
path-to-document: 'https://securityonionsolutions.com/cla'
|
path-to-document: 'https://securityonionsolutions.com/cla'
|
||||||
allowlist: dependabot[bot],jertel,dougburks,TOoSmOotH,weslambert,defensivedepth,m0duspwnens
|
allowlist: dependabot[bot],jertel,dougburks,TOoSmOotH,defensivedepth,m0duspwnens
|
||||||
remote-organization-name: Security-Onion-Solutions
|
remote-organization-name: Security-Onion-Solutions
|
||||||
remote-repository-name: licensing
|
remote-repository-name: licensing
|
||||||
|
|
||||||
|
|||||||
10
.github/workflows/pythontest.yml
vendored
10
.github/workflows/pythontest.yml
vendored
@@ -1,14 +1,10 @@
|
|||||||
name: python-test
|
name: python-test
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
|
||||||
paths:
|
|
||||||
- "salt/sensoroni/files/analyzers/**"
|
|
||||||
- "salt/manager/tools/sbin"
|
|
||||||
pull_request:
|
pull_request:
|
||||||
paths:
|
paths:
|
||||||
- "salt/sensoroni/files/analyzers/**"
|
- "salt/sensoroni/files/analyzers/**"
|
||||||
- "salt/manager/tools/sbin"
|
- "salt/manager/tools/sbin/**"
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
@@ -17,7 +13,7 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
python-version: ["3.10"]
|
python-version: ["3.13"]
|
||||||
python-code-path: ["salt/sensoroni/files/analyzers", "salt/manager/tools/sbin"]
|
python-code-path: ["salt/sensoroni/files/analyzers", "salt/manager/tools/sbin"]
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
@@ -36,4 +32,4 @@ jobs:
|
|||||||
flake8 ${{ matrix.python-code-path }} --show-source --max-complexity=12 --doctests --max-line-length=200 --statistics
|
flake8 ${{ matrix.python-code-path }} --show-source --max-complexity=12 --doctests --max-line-length=200 --statistics
|
||||||
- name: Test with pytest
|
- name: Test with pytest
|
||||||
run: |
|
run: |
|
||||||
pytest ${{ matrix.python-code-path }} --cov=${{ matrix.python-code-path }} --doctest-modules --cov-report=term --cov-fail-under=100 --cov-config=pytest.ini
|
PYTHONPATH=${{ matrix.python-code-path }} pytest ${{ matrix.python-code-path }} --cov=${{ matrix.python-code-path }} --doctest-modules --cov-report=term --cov-fail-under=100 --cov-config=pytest.ini
|
||||||
|
|||||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
# Created by https://www.gitignore.io/api/macos,windows
|
# Created by https://www.gitignore.io/api/macos,windows
|
||||||
# Edit at https://www.gitignore.io/?templates=macos,windows
|
# Edit at https://www.gitignore.io/?templates=macos,windows
|
||||||
|
|
||||||
|
|||||||
@@ -1,17 +1,17 @@
|
|||||||
### 2.4.90-20240729 ISO image released on 2024/07/29
|
### 2.4.190-20251024 ISO image released on 2025/10/24
|
||||||
|
|
||||||
|
|
||||||
### Download and Verify
|
### Download and Verify
|
||||||
|
|
||||||
2.4.90-20240729 ISO image:
|
2.4.190-20251024 ISO image:
|
||||||
https://download.securityonion.net/file/securityonion/securityonion-2.4.90-20240729.iso
|
https://download.securityonion.net/file/securityonion/securityonion-2.4.190-20251024.iso
|
||||||
|
|
||||||
MD5: 9A7714F5922EE555F08675D25E6237D5
|
MD5: 25358481FB876226499C011FC0710358
|
||||||
SHA1: D3B331452627DB716906BA9F3922574DFA3852DC
|
SHA1: 0B26173C0CE136F2CA40A15046D1DFB78BCA1165
|
||||||
SHA256: 5B0CE32543944DBC50C4E906857384211E1BE83EF409619778F18FC62017E0E0
|
SHA256: 4FD9F62EDA672408828B3C0C446FE5EA9FF3C4EE8488A7AB1101544A3C487872
|
||||||
|
|
||||||
Signature for ISO image:
|
Signature for ISO image:
|
||||||
https://github.com/Security-Onion-Solutions/securityonion/raw/2.4/main/sigs/securityonion-2.4.90-20240729.iso.sig
|
https://github.com/Security-Onion-Solutions/securityonion/raw/2.4/main/sigs/securityonion-2.4.190-20251024.iso.sig
|
||||||
|
|
||||||
Signing key:
|
Signing key:
|
||||||
https://raw.githubusercontent.com/Security-Onion-Solutions/securityonion/2.4/main/KEYS
|
https://raw.githubusercontent.com/Security-Onion-Solutions/securityonion/2.4/main/KEYS
|
||||||
@@ -25,22 +25,22 @@ wget https://raw.githubusercontent.com/Security-Onion-Solutions/securityonion/2.
|
|||||||
|
|
||||||
Download the signature file for the ISO:
|
Download the signature file for the ISO:
|
||||||
```
|
```
|
||||||
wget https://github.com/Security-Onion-Solutions/securityonion/raw/2.4/main/sigs/securityonion-2.4.90-20240729.iso.sig
|
wget https://github.com/Security-Onion-Solutions/securityonion/raw/2.4/main/sigs/securityonion-2.4.190-20251024.iso.sig
|
||||||
```
|
```
|
||||||
|
|
||||||
Download the ISO image:
|
Download the ISO image:
|
||||||
```
|
```
|
||||||
wget https://download.securityonion.net/file/securityonion/securityonion-2.4.90-20240729.iso
|
wget https://download.securityonion.net/file/securityonion/securityonion-2.4.190-20251024.iso
|
||||||
```
|
```
|
||||||
|
|
||||||
Verify the downloaded ISO image using the signature file:
|
Verify the downloaded ISO image using the signature file:
|
||||||
```
|
```
|
||||||
gpg --verify securityonion-2.4.90-20240729.iso.sig securityonion-2.4.90-20240729.iso
|
gpg --verify securityonion-2.4.190-20251024.iso.sig securityonion-2.4.190-20251024.iso
|
||||||
```
|
```
|
||||||
|
|
||||||
The output should show "Good signature" and the Primary key fingerprint should match what's shown below:
|
The output should show "Good signature" and the Primary key fingerprint should match what's shown below:
|
||||||
```
|
```
|
||||||
gpg: Signature made Thu 25 Jul 2024 06:51:11 PM EDT using RSA key ID FE507013
|
gpg: Signature made Thu 23 Oct 2025 07:21:46 AM EDT using RSA key ID FE507013
|
||||||
gpg: Good signature from "Security Onion Solutions, LLC <info@securityonionsolutions.com>"
|
gpg: Good signature from "Security Onion Solutions, LLC <info@securityonionsolutions.com>"
|
||||||
gpg: WARNING: This key is not certified with a trusted signature!
|
gpg: WARNING: This key is not certified with a trusted signature!
|
||||||
gpg: There is no indication that the signature belongs to the owner.
|
gpg: There is no indication that the signature belongs to the owner.
|
||||||
|
|||||||
53
LICENSE
Normal file
53
LICENSE
Normal file
@@ -0,0 +1,53 @@
|
|||||||
|
Elastic License 2.0 (ELv2)
|
||||||
|
|
||||||
|
Acceptance
|
||||||
|
|
||||||
|
By using the software, you agree to all of the terms and conditions below.
|
||||||
|
|
||||||
|
Copyright License
|
||||||
|
|
||||||
|
The licensor grants you a non-exclusive, royalty-free, worldwide, non-sublicensable, non-transferable license to use, copy, distribute, make available, and prepare derivative works of the software, in each case subject to the limitations and conditions below.
|
||||||
|
|
||||||
|
Limitations
|
||||||
|
|
||||||
|
You may not provide the software to third parties as a hosted or managed service, where the service provides users with access to any substantial set of the features or functionality of the software.
|
||||||
|
|
||||||
|
You may not move, change, disable, or circumvent the license key functionality in the software, and you may not remove or obscure any functionality in the software that is protected by the license key.
|
||||||
|
|
||||||
|
You may not alter, remove, or obscure any licensing, copyright, or other notices of the licensor in the software. Any use of the licensor’s trademarks is subject to applicable law.
|
||||||
|
|
||||||
|
Patents
|
||||||
|
|
||||||
|
The licensor grants you a license, under any patent claims the licensor can license, or becomes able to license, to make, have made, use, sell, offer for sale, import and have imported the software, in each case subject to the limitations and conditions in this license. This license does not cover any patent claims that you cause to be infringed by modifications or additions to the software. If you or your company make any written claim that the software infringes or contributes to infringement of any patent, your patent license for the software granted under these terms ends immediately. If your company makes such a claim, your patent license ends immediately for work on behalf of your company.
|
||||||
|
|
||||||
|
Notices
|
||||||
|
|
||||||
|
You must ensure that anyone who gets a copy of any part of the software from you also gets a copy of these terms.
|
||||||
|
|
||||||
|
If you modify the software, you must include in any modified copies of the software prominent notices stating that you have modified the software.
|
||||||
|
|
||||||
|
No Other Rights
|
||||||
|
|
||||||
|
These terms do not imply any licenses other than those expressly granted in these terms.
|
||||||
|
|
||||||
|
Termination
|
||||||
|
|
||||||
|
If you use the software in violation of these terms, such use is not licensed, and your licenses will automatically terminate. If the licensor provides you with a notice of your violation, and you cease all violation of this license no later than 30 days after you receive that notice, your licenses will be reinstated retroactively. However, if you violate these terms after such reinstatement, any additional violation of these terms will cause your licenses to terminate automatically and permanently.
|
||||||
|
|
||||||
|
No Liability
|
||||||
|
|
||||||
|
As far as the law allows, the software comes as is, without any warranty or condition, and the licensor will not be liable to you for any damages arising out of these terms or the use or nature of the software, under any kind of legal claim.
|
||||||
|
|
||||||
|
Definitions
|
||||||
|
|
||||||
|
The licensor is the entity offering these terms, and the software is the software the licensor makes available under these terms, including any portion of it.
|
||||||
|
|
||||||
|
you refers to the individual or entity agreeing to these terms.
|
||||||
|
|
||||||
|
your company is any legal entity, sole proprietorship, or other kind of organization that you work for, plus all organizations that have control over, are under the control of, or are under common control with that organization. control means ownership of substantially all the assets of an entity, or the power to direct its management and policies by vote, contract, or otherwise. Control can be direct or indirect.
|
||||||
|
|
||||||
|
your licenses are all the licenses granted to you for the software under these terms.
|
||||||
|
|
||||||
|
use means anything you do with the software requiring one of your licenses.
|
||||||
|
|
||||||
|
trademark means trademarks, service marks, and similar rights.
|
||||||
@@ -5,9 +5,11 @@
|
|||||||
| Version | Supported |
|
| Version | Supported |
|
||||||
| ------- | ------------------ |
|
| ------- | ------------------ |
|
||||||
| 2.4.x | :white_check_mark: |
|
| 2.4.x | :white_check_mark: |
|
||||||
| 2.3.x | :white_check_mark: |
|
| 2.3.x | :x: |
|
||||||
| 16.04.x | :x: |
|
| 16.04.x | :x: |
|
||||||
|
|
||||||
|
Security Onion 2.3 has reached End Of Life and is no longer supported.
|
||||||
|
|
||||||
Security Onion 16.04 has reached End Of Life and is no longer supported.
|
Security Onion 16.04 has reached End Of Life and is no longer supported.
|
||||||
|
|
||||||
## Reporting a Vulnerability
|
## Reporting a Vulnerability
|
||||||
|
|||||||
34
pillar/hypervisor/nodes.sls
Normal file
34
pillar/hypervisor/nodes.sls
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
{% set node_types = {} %}
|
||||||
|
{% for minionid, ip in salt.saltutil.runner(
|
||||||
|
'mine.get',
|
||||||
|
tgt='G@role:so-hypervisor or G@role:so-managerhype',
|
||||||
|
fun='network.ip_addrs',
|
||||||
|
tgt_type='compound') | dictsort()
|
||||||
|
%}
|
||||||
|
|
||||||
|
# only add a node to the pillar if it returned an ip from the mine
|
||||||
|
{% if ip | length > 0%}
|
||||||
|
{% set hostname = minionid.split('_') | first %}
|
||||||
|
{% set node_type = minionid.split('_') | last %}
|
||||||
|
{% if node_type not in node_types.keys() %}
|
||||||
|
{% do node_types.update({node_type: {hostname: ip[0]}}) %}
|
||||||
|
{% else %}
|
||||||
|
{% if hostname not in node_types[node_type] %}
|
||||||
|
{% do node_types[node_type].update({hostname: ip[0]}) %}
|
||||||
|
{% else %}
|
||||||
|
{% do node_types[node_type][hostname].update(ip[0]) %}
|
||||||
|
{% endif %}
|
||||||
|
{% endif %}
|
||||||
|
{% endif %}
|
||||||
|
{% endfor %}
|
||||||
|
|
||||||
|
|
||||||
|
hypervisor:
|
||||||
|
nodes:
|
||||||
|
{% for node_type, values in node_types.items() %}
|
||||||
|
{{node_type}}:
|
||||||
|
{% for hostname, ip in values.items() %}
|
||||||
|
{{hostname}}:
|
||||||
|
ip: {{ip}}
|
||||||
|
{% endfor %}
|
||||||
|
{% endfor %}
|
||||||
@@ -24,6 +24,7 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
||||||
|
{% if node_types %}
|
||||||
node_data:
|
node_data:
|
||||||
{% for node_type, host_values in node_types.items() %}
|
{% for node_type, host_values in node_types.items() %}
|
||||||
{% for hostname, details in host_values.items() %}
|
{% for hostname, details in host_values.items() %}
|
||||||
@@ -33,3 +34,6 @@ node_data:
|
|||||||
role: {{node_type}}
|
role: {{node_type}}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
{% else %}
|
||||||
|
node_data: False
|
||||||
|
{% endif %}
|
||||||
|
|||||||
@@ -16,16 +16,24 @@ base:
|
|||||||
- sensoroni.adv_sensoroni
|
- sensoroni.adv_sensoroni
|
||||||
- telegraf.soc_telegraf
|
- telegraf.soc_telegraf
|
||||||
- telegraf.adv_telegraf
|
- telegraf.adv_telegraf
|
||||||
|
- versionlock.soc_versionlock
|
||||||
|
- versionlock.adv_versionlock
|
||||||
|
- soc.license
|
||||||
|
|
||||||
'* and not *_desktop':
|
'* and not *_desktop':
|
||||||
- firewall.soc_firewall
|
- firewall.soc_firewall
|
||||||
- firewall.adv_firewall
|
- firewall.adv_firewall
|
||||||
- nginx.soc_nginx
|
- nginx.soc_nginx
|
||||||
- nginx.adv_nginx
|
- nginx.adv_nginx
|
||||||
- node_data.ips
|
|
||||||
|
|
||||||
'*_manager or *_managersearch':
|
'salt-cloud:driver:libvirt':
|
||||||
|
- match: grain
|
||||||
|
- vm.soc_vm
|
||||||
|
- vm.adv_vm
|
||||||
|
|
||||||
|
'*_manager or *_managersearch or *_managerhype':
|
||||||
- match: compound
|
- match: compound
|
||||||
|
- node_data.ips
|
||||||
{% if salt['file.file_exists']('/opt/so/saltstack/local/pillar/elasticsearch/auth.sls') %}
|
{% if salt['file.file_exists']('/opt/so/saltstack/local/pillar/elasticsearch/auth.sls') %}
|
||||||
- elasticsearch.auth
|
- elasticsearch.auth
|
||||||
{% endif %}
|
{% endif %}
|
||||||
@@ -35,18 +43,17 @@ base:
|
|||||||
- secrets
|
- secrets
|
||||||
- manager.soc_manager
|
- manager.soc_manager
|
||||||
- manager.adv_manager
|
- manager.adv_manager
|
||||||
- idstools.soc_idstools
|
|
||||||
- idstools.adv_idstools
|
|
||||||
- logstash.nodes
|
- logstash.nodes
|
||||||
- logstash.soc_logstash
|
- logstash.soc_logstash
|
||||||
- logstash.adv_logstash
|
- logstash.adv_logstash
|
||||||
- soc.soc_soc
|
- soc.soc_soc
|
||||||
- soc.adv_soc
|
- soc.adv_soc
|
||||||
- soc.license
|
|
||||||
- kibana.soc_kibana
|
- kibana.soc_kibana
|
||||||
- kibana.adv_kibana
|
- kibana.adv_kibana
|
||||||
- kratos.soc_kratos
|
- kratos.soc_kratos
|
||||||
- kratos.adv_kratos
|
- kratos.adv_kratos
|
||||||
|
- hydra.soc_hydra
|
||||||
|
- hydra.adv_hydra
|
||||||
- redis.nodes
|
- redis.nodes
|
||||||
- redis.soc_redis
|
- redis.soc_redis
|
||||||
- redis.adv_redis
|
- redis.adv_redis
|
||||||
@@ -66,6 +73,9 @@ base:
|
|||||||
- kafka.nodes
|
- kafka.nodes
|
||||||
- kafka.soc_kafka
|
- kafka.soc_kafka
|
||||||
- kafka.adv_kafka
|
- kafka.adv_kafka
|
||||||
|
- hypervisor.nodes
|
||||||
|
- hypervisor.soc_hypervisor
|
||||||
|
- hypervisor.adv_hypervisor
|
||||||
- stig.soc_stig
|
- stig.soc_stig
|
||||||
|
|
||||||
'*_sensor':
|
'*_sensor':
|
||||||
@@ -83,9 +93,9 @@ base:
|
|||||||
- minions.{{ grains.id }}
|
- minions.{{ grains.id }}
|
||||||
- minions.adv_{{ grains.id }}
|
- minions.adv_{{ grains.id }}
|
||||||
- stig.soc_stig
|
- stig.soc_stig
|
||||||
- soc.license
|
|
||||||
|
|
||||||
'*_eval':
|
'*_eval':
|
||||||
|
- node_data.ips
|
||||||
- secrets
|
- secrets
|
||||||
- healthcheck.eval
|
- healthcheck.eval
|
||||||
- elasticsearch.index_templates
|
- elasticsearch.index_templates
|
||||||
@@ -96,6 +106,7 @@ base:
|
|||||||
- kibana.secrets
|
- kibana.secrets
|
||||||
{% endif %}
|
{% endif %}
|
||||||
- kratos.soc_kratos
|
- kratos.soc_kratos
|
||||||
|
- kratos.adv_kratos
|
||||||
- elasticsearch.soc_elasticsearch
|
- elasticsearch.soc_elasticsearch
|
||||||
- elasticsearch.adv_elasticsearch
|
- elasticsearch.adv_elasticsearch
|
||||||
- elasticfleet.soc_elasticfleet
|
- elasticfleet.soc_elasticfleet
|
||||||
@@ -104,17 +115,14 @@ base:
|
|||||||
- elastalert.adv_elastalert
|
- elastalert.adv_elastalert
|
||||||
- manager.soc_manager
|
- manager.soc_manager
|
||||||
- manager.adv_manager
|
- manager.adv_manager
|
||||||
- idstools.soc_idstools
|
|
||||||
- idstools.adv_idstools
|
|
||||||
- soc.soc_soc
|
- soc.soc_soc
|
||||||
- soc.adv_soc
|
- soc.adv_soc
|
||||||
- soc.license
|
|
||||||
- kibana.soc_kibana
|
- kibana.soc_kibana
|
||||||
- kibana.adv_kibana
|
- kibana.adv_kibana
|
||||||
- strelka.soc_strelka
|
- strelka.soc_strelka
|
||||||
- strelka.adv_strelka
|
- strelka.adv_strelka
|
||||||
- kratos.soc_kratos
|
- hydra.soc_hydra
|
||||||
- kratos.adv_kratos
|
- hydra.adv_hydra
|
||||||
- redis.soc_redis
|
- redis.soc_redis
|
||||||
- redis.adv_redis
|
- redis.adv_redis
|
||||||
- influxdb.soc_influxdb
|
- influxdb.soc_influxdb
|
||||||
@@ -133,6 +141,7 @@ base:
|
|||||||
- minions.adv_{{ grains.id }}
|
- minions.adv_{{ grains.id }}
|
||||||
|
|
||||||
'*_standalone':
|
'*_standalone':
|
||||||
|
- node_data.ips
|
||||||
- logstash.nodes
|
- logstash.nodes
|
||||||
- logstash.soc_logstash
|
- logstash.soc_logstash
|
||||||
- logstash.adv_logstash
|
- logstash.adv_logstash
|
||||||
@@ -145,10 +154,10 @@ base:
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
- secrets
|
- secrets
|
||||||
- healthcheck.standalone
|
- healthcheck.standalone
|
||||||
- idstools.soc_idstools
|
|
||||||
- idstools.adv_idstools
|
|
||||||
- kratos.soc_kratos
|
- kratos.soc_kratos
|
||||||
- kratos.adv_kratos
|
- kratos.adv_kratos
|
||||||
|
- hydra.soc_hydra
|
||||||
|
- hydra.adv_hydra
|
||||||
- redis.nodes
|
- redis.nodes
|
||||||
- redis.soc_redis
|
- redis.soc_redis
|
||||||
- redis.adv_redis
|
- redis.adv_redis
|
||||||
@@ -165,7 +174,6 @@ base:
|
|||||||
- manager.adv_manager
|
- manager.adv_manager
|
||||||
- soc.soc_soc
|
- soc.soc_soc
|
||||||
- soc.adv_soc
|
- soc.adv_soc
|
||||||
- soc.license
|
|
||||||
- kibana.soc_kibana
|
- kibana.soc_kibana
|
||||||
- kibana.adv_kibana
|
- kibana.adv_kibana
|
||||||
- strelka.soc_strelka
|
- strelka.soc_strelka
|
||||||
@@ -231,7 +239,6 @@ base:
|
|||||||
- minions.{{ grains.id }}
|
- minions.{{ grains.id }}
|
||||||
- minions.adv_{{ grains.id }}
|
- minions.adv_{{ grains.id }}
|
||||||
- stig.soc_stig
|
- stig.soc_stig
|
||||||
- soc.license
|
|
||||||
- kafka.nodes
|
- kafka.nodes
|
||||||
- kafka.soc_kafka
|
- kafka.soc_kafka
|
||||||
- kafka.adv_kafka
|
- kafka.adv_kafka
|
||||||
@@ -249,10 +256,12 @@ base:
|
|||||||
- minions.adv_{{ grains.id }}
|
- minions.adv_{{ grains.id }}
|
||||||
- kafka.nodes
|
- kafka.nodes
|
||||||
- kafka.soc_kafka
|
- kafka.soc_kafka
|
||||||
- kafka.adv_kafka
|
- stig.soc_stig
|
||||||
- soc.license
|
- elasticfleet.soc_elasticfleet
|
||||||
|
- elasticfleet.adv_elasticfleet
|
||||||
|
|
||||||
'*_import':
|
'*_import':
|
||||||
|
- node_data.ips
|
||||||
- secrets
|
- secrets
|
||||||
- elasticsearch.index_templates
|
- elasticsearch.index_templates
|
||||||
{% if salt['file.file_exists']('/opt/so/saltstack/local/pillar/elasticsearch/auth.sls') %}
|
{% if salt['file.file_exists']('/opt/so/saltstack/local/pillar/elasticsearch/auth.sls') %}
|
||||||
@@ -262,6 +271,7 @@ base:
|
|||||||
- kibana.secrets
|
- kibana.secrets
|
||||||
{% endif %}
|
{% endif %}
|
||||||
- kratos.soc_kratos
|
- kratos.soc_kratos
|
||||||
|
- kratos.adv_kratos
|
||||||
- elasticsearch.soc_elasticsearch
|
- elasticsearch.soc_elasticsearch
|
||||||
- elasticsearch.adv_elasticsearch
|
- elasticsearch.adv_elasticsearch
|
||||||
- elasticfleet.soc_elasticfleet
|
- elasticfleet.soc_elasticfleet
|
||||||
@@ -272,13 +282,12 @@ base:
|
|||||||
- manager.adv_manager
|
- manager.adv_manager
|
||||||
- soc.soc_soc
|
- soc.soc_soc
|
||||||
- soc.adv_soc
|
- soc.adv_soc
|
||||||
- soc.license
|
|
||||||
- kibana.soc_kibana
|
- kibana.soc_kibana
|
||||||
- kibana.adv_kibana
|
- kibana.adv_kibana
|
||||||
- backup.soc_backup
|
- backup.soc_backup
|
||||||
- backup.adv_backup
|
- backup.adv_backup
|
||||||
- kratos.soc_kratos
|
- hydra.soc_hydra
|
||||||
- kratos.adv_kratos
|
- hydra.adv_hydra
|
||||||
- redis.soc_redis
|
- redis.soc_redis
|
||||||
- redis.adv_redis
|
- redis.adv_redis
|
||||||
- influxdb.soc_influxdb
|
- influxdb.soc_influxdb
|
||||||
@@ -297,6 +306,7 @@ base:
|
|||||||
- minions.adv_{{ grains.id }}
|
- minions.adv_{{ grains.id }}
|
||||||
|
|
||||||
'*_fleet':
|
'*_fleet':
|
||||||
|
- node_data.ips
|
||||||
- backup.soc_backup
|
- backup.soc_backup
|
||||||
- backup.adv_backup
|
- backup.adv_backup
|
||||||
- logstash.nodes
|
- logstash.nodes
|
||||||
@@ -306,7 +316,15 @@ base:
|
|||||||
- elasticfleet.adv_elasticfleet
|
- elasticfleet.adv_elasticfleet
|
||||||
- minions.{{ grains.id }}
|
- minions.{{ grains.id }}
|
||||||
- minions.adv_{{ grains.id }}
|
- minions.adv_{{ grains.id }}
|
||||||
|
- stig.soc_stig
|
||||||
|
|
||||||
|
'*_hypervisor':
|
||||||
|
- minions.{{ grains.id }}
|
||||||
|
- minions.adv_{{ grains.id }}
|
||||||
|
- stig.soc_stig
|
||||||
|
|
||||||
'*_desktop':
|
'*_desktop':
|
||||||
- minions.{{ grains.id }}
|
- minions.{{ grains.id }}
|
||||||
- minions.adv_{{ grains.id }}
|
- minions.adv_{{ grains.id }}
|
||||||
|
- stig.soc_stig
|
||||||
|
|
||||||
|
|||||||
91
salt/_modules/hypervisor.py
Normal file
91
salt/_modules/hypervisor.py
Normal file
@@ -0,0 +1,91 @@
|
|||||||
|
#!/opt/saltstack/salt/bin/python3
|
||||||
|
|
||||||
|
# Copyright Security Onion Solutions LLC and/or licensed to Security Onion Solutions LLC under one
|
||||||
|
# or more contributor license agreements. Licensed under the Elastic License 2.0 as shown at
|
||||||
|
# https://securityonion.net/license; you may not use this file except in compliance with the
|
||||||
|
# Elastic License 2.0.
|
||||||
|
#
|
||||||
|
# Note: Per the Elastic License 2.0, the second limitation states:
|
||||||
|
#
|
||||||
|
# "You may not move, change, disable, or circumvent the license key functionality
|
||||||
|
# in the software, and you may not remove or obscure any functionality in the
|
||||||
|
# software that is protected by the license key."
|
||||||
|
|
||||||
|
"""
|
||||||
|
Salt execution module for hypervisor operations.
|
||||||
|
|
||||||
|
This module provides functions for managing hypervisor configurations,
|
||||||
|
including VM file management.
|
||||||
|
"""
|
||||||
|
|
||||||
|
import json
|
||||||
|
import logging
|
||||||
|
import os
|
||||||
|
|
||||||
|
log = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
__virtualname__ = 'hypervisor'
|
||||||
|
|
||||||
|
|
||||||
|
def __virtual__():
|
||||||
|
"""
|
||||||
|
Only load this module if we're on a system that can manage hypervisors.
|
||||||
|
"""
|
||||||
|
return __virtualname__
|
||||||
|
|
||||||
|
|
||||||
|
def remove_vm_from_vms_file(vms_file_path, vm_hostname, vm_role):
|
||||||
|
"""
|
||||||
|
Remove a VM entry from the hypervisorVMs file.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
vms_file_path (str): Path to the hypervisorVMs file
|
||||||
|
vm_hostname (str): Hostname of the VM to remove (without role suffix)
|
||||||
|
vm_role (str): Role of the VM
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
dict: Result dictionary with success status and message
|
||||||
|
|
||||||
|
CLI Example:
|
||||||
|
salt '*' hypervisor.remove_vm_from_vms_file /opt/so/saltstack/local/salt/hypervisor/hosts/hypervisor1VMs node1 nsm
|
||||||
|
"""
|
||||||
|
try:
|
||||||
|
# Check if file exists
|
||||||
|
if not os.path.exists(vms_file_path):
|
||||||
|
msg = f"VMs file not found: {vms_file_path}"
|
||||||
|
log.error(msg)
|
||||||
|
return {'result': False, 'comment': msg}
|
||||||
|
|
||||||
|
# Read current VMs
|
||||||
|
with open(vms_file_path, 'r') as f:
|
||||||
|
content = f.read().strip()
|
||||||
|
vms = json.loads(content) if content else []
|
||||||
|
|
||||||
|
# Find and remove the VM entry
|
||||||
|
original_count = len(vms)
|
||||||
|
vms = [vm for vm in vms if not (vm.get('hostname') == vm_hostname and vm.get('role') == vm_role)]
|
||||||
|
|
||||||
|
if len(vms) < original_count:
|
||||||
|
# VM was found and removed, write back to file
|
||||||
|
with open(vms_file_path, 'w') as f:
|
||||||
|
json.dump(vms, f, indent=2)
|
||||||
|
|
||||||
|
# Set socore:socore ownership (939:939)
|
||||||
|
os.chown(vms_file_path, 939, 939)
|
||||||
|
|
||||||
|
msg = f"Removed VM {vm_hostname}_{vm_role} from {vms_file_path}"
|
||||||
|
log.info(msg)
|
||||||
|
return {'result': True, 'comment': msg}
|
||||||
|
else:
|
||||||
|
msg = f"VM {vm_hostname}_{vm_role} not found in {vms_file_path}"
|
||||||
|
log.warning(msg)
|
||||||
|
return {'result': False, 'comment': msg}
|
||||||
|
|
||||||
|
except json.JSONDecodeError as e:
|
||||||
|
msg = f"Failed to parse JSON in {vms_file_path}: {str(e)}"
|
||||||
|
log.error(msg)
|
||||||
|
return {'result': False, 'comment': msg}
|
||||||
|
except Exception as e:
|
||||||
|
msg = f"Failed to remove VM {vm_hostname}_{vm_role} from {vms_file_path}: {str(e)}"
|
||||||
|
log.error(msg)
|
||||||
|
return {'result': False, 'comment': msg}
|
||||||
335
salt/_modules/qcow2.py
Normal file
335
salt/_modules/qcow2.py
Normal file
@@ -0,0 +1,335 @@
|
|||||||
|
#!py
|
||||||
|
|
||||||
|
# Copyright Security Onion Solutions LLC and/or licensed to Security Onion Solutions LLC under one
|
||||||
|
# or more contributor license agreements. Licensed under the Elastic License 2.0 as shown at
|
||||||
|
# https://securityonion.net/license; you may not use this file except in compliance with the
|
||||||
|
# Elastic License 2.0.
|
||||||
|
|
||||||
|
"""
|
||||||
|
Salt module for managing QCOW2 image configurations and VM hardware settings. This module provides functions
|
||||||
|
for modifying network configurations within QCOW2 images, adjusting virtual machine hardware settings, and
|
||||||
|
creating virtual storage volumes. It serves as a Salt interface to the so-qcow2-modify-network,
|
||||||
|
so-kvm-modify-hardware, and so-kvm-create-volume scripts.
|
||||||
|
|
||||||
|
The module offers three main capabilities:
|
||||||
|
1. Network Configuration: Modify network settings (DHCP/static IP) within QCOW2 images
|
||||||
|
2. Hardware Configuration: Adjust VM hardware settings (CPU, memory, PCI passthrough)
|
||||||
|
3. Volume Management: Create and attach virtual storage volumes for NSM data
|
||||||
|
|
||||||
|
This module is intended to work with Security Onion's virtualization infrastructure and is typically
|
||||||
|
used in conjunction with salt-cloud for VM provisioning and management.
|
||||||
|
"""
|
||||||
|
|
||||||
|
import logging
|
||||||
|
import subprocess
|
||||||
|
import shlex
|
||||||
|
|
||||||
|
log = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
__virtualname__ = 'qcow2'
|
||||||
|
|
||||||
|
def __virtual__():
|
||||||
|
return __virtualname__
|
||||||
|
|
||||||
|
def modify_network_config(image, interface, mode, vm_name, ip4=None, gw4=None, dns4=None, search4=None):
|
||||||
|
'''
|
||||||
|
Usage:
|
||||||
|
salt '*' qcow2.modify_network_config image=<path> interface=<iface> mode=<mode> vm_name=<name> [ip4=<addr>] [gw4=<addr>] [dns4=<servers>] [search4=<domain>]
|
||||||
|
|
||||||
|
Options:
|
||||||
|
image
|
||||||
|
Path to the QCOW2 image file that will be modified
|
||||||
|
interface
|
||||||
|
Network interface name to configure (e.g., 'enp1s0')
|
||||||
|
mode
|
||||||
|
Network configuration mode, either 'dhcp4' or 'static4'
|
||||||
|
vm_name
|
||||||
|
Full name of the VM (hostname_role)
|
||||||
|
ip4
|
||||||
|
IPv4 address with CIDR notation (e.g., '192.168.1.10/24')
|
||||||
|
Required when mode='static4'
|
||||||
|
gw4
|
||||||
|
IPv4 gateway address (e.g., '192.168.1.1')
|
||||||
|
Required when mode='static4'
|
||||||
|
dns4
|
||||||
|
Comma-separated list of IPv4 DNS servers (e.g., '8.8.8.8,8.8.4.4')
|
||||||
|
Optional for both DHCP and static configurations
|
||||||
|
search4
|
||||||
|
DNS search domain for IPv4 (e.g., 'example.local')
|
||||||
|
Optional for both DHCP and static configurations
|
||||||
|
|
||||||
|
Examples:
|
||||||
|
1. **Configure DHCP:**
|
||||||
|
```bash
|
||||||
|
salt '*' qcow2.modify_network_config image='/nsm/libvirt/images/sool9/sool9.qcow2' interface='enp1s0' mode='dhcp4'
|
||||||
|
```
|
||||||
|
This configures enp1s0 to use DHCP for IP assignment
|
||||||
|
|
||||||
|
2. **Configure Static IP:**
|
||||||
|
```bash
|
||||||
|
salt '*' qcow2.modify_network_config image='/nsm/libvirt/images/sool9/sool9.qcow2' interface='enp1s0' mode='static4' ip4='192.168.1.10/24' gw4='192.168.1.1' dns4='192.168.1.1,8.8.8.8' search4='example.local'
|
||||||
|
```
|
||||||
|
This sets a static IP configuration with DNS servers and search domain
|
||||||
|
|
||||||
|
Notes:
|
||||||
|
- The QCOW2 image must be accessible and writable by the salt minion
|
||||||
|
- The image should not be in use by a running VM when modified
|
||||||
|
- Network changes take effect on next VM boot
|
||||||
|
- Requires so-qcow2-modify-network script to be installed
|
||||||
|
|
||||||
|
Description:
|
||||||
|
This function modifies network configuration within a QCOW2 image file by executing
|
||||||
|
the so-qcow2-modify-network script. It supports both DHCP and static IPv4 configuration.
|
||||||
|
The script mounts the image, modifies the network configuration files, and unmounts
|
||||||
|
safely. All operations are logged for troubleshooting purposes.
|
||||||
|
|
||||||
|
Exit Codes:
|
||||||
|
0: Success
|
||||||
|
1: Invalid parameters or configuration
|
||||||
|
2: Image access or mounting error
|
||||||
|
3: Network configuration error
|
||||||
|
4: System command error
|
||||||
|
255: Unexpected error
|
||||||
|
|
||||||
|
Logging:
|
||||||
|
- All operations are logged to the salt minion log
|
||||||
|
- Log entries are prefixed with 'qcow2 module:'
|
||||||
|
- Error conditions include detailed error messages and stack traces
|
||||||
|
- Success/failure status is logged for verification
|
||||||
|
'''
|
||||||
|
|
||||||
|
cmd = ['/usr/sbin/so-qcow2-modify-network', '-I', image, '-i', interface, '-n', vm_name]
|
||||||
|
|
||||||
|
if mode.lower() == 'dhcp4':
|
||||||
|
cmd.append('--dhcp4')
|
||||||
|
elif mode.lower() == 'static4':
|
||||||
|
cmd.append('--static4')
|
||||||
|
if not ip4 or not gw4:
|
||||||
|
raise ValueError('Both ip4 and gw4 are required for static configuration.')
|
||||||
|
cmd.extend(['--ip4', ip4, '--gw4', gw4])
|
||||||
|
if dns4:
|
||||||
|
cmd.extend(['--dns4', dns4])
|
||||||
|
if search4:
|
||||||
|
cmd.extend(['--search4', search4])
|
||||||
|
else:
|
||||||
|
raise ValueError("Invalid mode '{}'. Expected 'dhcp4' or 'static4'.".format(mode))
|
||||||
|
|
||||||
|
log.info('qcow2 module: Executing command: {}'.format(' '.join(shlex.quote(arg) for arg in cmd)))
|
||||||
|
|
||||||
|
try:
|
||||||
|
result = subprocess.run(cmd, capture_output=True, text=True, check=False)
|
||||||
|
ret = {
|
||||||
|
'retcode': result.returncode,
|
||||||
|
'stdout': result.stdout,
|
||||||
|
'stderr': result.stderr
|
||||||
|
}
|
||||||
|
if result.returncode != 0:
|
||||||
|
log.error('qcow2 module: Script execution failed with return code {}: {}'.format(result.returncode, result.stderr))
|
||||||
|
else:
|
||||||
|
log.info('qcow2 module: Script executed successfully.')
|
||||||
|
return ret
|
||||||
|
except Exception as e:
|
||||||
|
log.error('qcow2 module: An error occurred while executing the script: {}'.format(e))
|
||||||
|
raise
|
||||||
|
|
||||||
|
def modify_hardware_config(vm_name, cpu=None, memory=None, pci=None, start=False):
|
||||||
|
'''
|
||||||
|
Usage:
|
||||||
|
salt '*' qcow2.modify_hardware_config vm_name=<name> [cpu=<count>] [memory=<size>] [pci=<id>] [pci=<id>] [start=<bool>]
|
||||||
|
|
||||||
|
Options:
|
||||||
|
vm_name
|
||||||
|
Name of the virtual machine to modify
|
||||||
|
cpu
|
||||||
|
Number of virtual CPUs to assign (positive integer)
|
||||||
|
Optional - VM's current CPU count retained if not specified
|
||||||
|
memory
|
||||||
|
Amount of memory to assign in MiB (positive integer)
|
||||||
|
Optional - VM's current memory size retained if not specified
|
||||||
|
pci
|
||||||
|
PCI hardware ID(s) to passthrough to the VM (e.g., '0000:c7:00.0')
|
||||||
|
Can be specified multiple times for multiple devices
|
||||||
|
Optional - no PCI passthrough if not specified
|
||||||
|
start
|
||||||
|
Boolean flag to start the VM after modification
|
||||||
|
Optional - defaults to False
|
||||||
|
|
||||||
|
Examples:
|
||||||
|
1. **Modify CPU and Memory:**
|
||||||
|
```bash
|
||||||
|
salt '*' qcow2.modify_hardware_config vm_name='sensor1' cpu=4 memory=8192
|
||||||
|
```
|
||||||
|
This assigns 4 CPUs and 8GB memory to the VM
|
||||||
|
|
||||||
|
2. **Enable PCI Passthrough:**
|
||||||
|
```bash
|
||||||
|
salt '*' qcow2.modify_hardware_config vm_name='sensor1' pci='0000:c7:00.0' pci='0000:c4:00.0' start=True
|
||||||
|
```
|
||||||
|
This configures PCI passthrough and starts the VM
|
||||||
|
|
||||||
|
3. **Complete Hardware Configuration:**
|
||||||
|
```bash
|
||||||
|
salt '*' qcow2.modify_hardware_config vm_name='sensor1' cpu=8 memory=16384 pci='0000:c7:00.0' start=True
|
||||||
|
```
|
||||||
|
This sets CPU, memory, PCI passthrough, and starts the VM
|
||||||
|
|
||||||
|
Notes:
|
||||||
|
- VM must be stopped before modification unless only the start flag is set
|
||||||
|
- Memory is specified in MiB (1024 = 1GB)
|
||||||
|
- PCI devices must be available and not in use by the host
|
||||||
|
- CPU count should align with host capabilities
|
||||||
|
- Requires so-kvm-modify-hardware script to be installed
|
||||||
|
|
||||||
|
Description:
|
||||||
|
This function modifies the hardware configuration of a KVM virtual machine using
|
||||||
|
the so-kvm-modify-hardware script. It can adjust CPU count, memory allocation,
|
||||||
|
and PCI device passthrough. Changes are applied to the VM's libvirt configuration.
|
||||||
|
The VM can optionally be started after modifications are complete.
|
||||||
|
|
||||||
|
Exit Codes:
|
||||||
|
0: Success
|
||||||
|
1: Invalid parameters
|
||||||
|
2: VM state error (running when should be stopped)
|
||||||
|
3: Hardware configuration error
|
||||||
|
4: System command error
|
||||||
|
255: Unexpected error
|
||||||
|
|
||||||
|
Logging:
|
||||||
|
- All operations are logged to the salt minion log
|
||||||
|
- Log entries are prefixed with 'qcow2 module:'
|
||||||
|
- Hardware configuration changes are logged
|
||||||
|
- Errors include detailed messages and stack traces
|
||||||
|
- Final status of modification is logged
|
||||||
|
'''
|
||||||
|
|
||||||
|
cmd = ['/usr/sbin/so-kvm-modify-hardware', '-v', vm_name]
|
||||||
|
|
||||||
|
if cpu is not None:
|
||||||
|
if isinstance(cpu, int) and cpu > 0:
|
||||||
|
cmd.extend(['-c', str(cpu)])
|
||||||
|
else:
|
||||||
|
raise ValueError('cpu must be a positive integer.')
|
||||||
|
if memory is not None:
|
||||||
|
if isinstance(memory, int) and memory > 0:
|
||||||
|
cmd.extend(['-m', str(memory)])
|
||||||
|
else:
|
||||||
|
raise ValueError('memory must be a positive integer.')
|
||||||
|
if pci:
|
||||||
|
# Handle PCI IDs (can be a single device or comma-separated list)
|
||||||
|
if isinstance(pci, str):
|
||||||
|
devices = [dev.strip() for dev in pci.split(',') if dev.strip()]
|
||||||
|
elif isinstance(pci, list):
|
||||||
|
devices = pci
|
||||||
|
else:
|
||||||
|
devices = [pci]
|
||||||
|
|
||||||
|
# Add each device with its own -p flag
|
||||||
|
for device in devices:
|
||||||
|
cmd.extend(['-p', str(device)])
|
||||||
|
if start:
|
||||||
|
cmd.append('-s')
|
||||||
|
|
||||||
|
log.info('qcow2 module: Executing command: {}'.format(' '.join(shlex.quote(arg) for arg in cmd)))
|
||||||
|
|
||||||
|
try:
|
||||||
|
result = subprocess.run(cmd, capture_output=True, text=True, check=False)
|
||||||
|
ret = {
|
||||||
|
'retcode': result.returncode,
|
||||||
|
'stdout': result.stdout,
|
||||||
|
'stderr': result.stderr
|
||||||
|
}
|
||||||
|
if result.returncode != 0:
|
||||||
|
log.error('qcow2 module: Script execution failed with return code {}: {}'.format(result.returncode, result.stderr))
|
||||||
|
else:
|
||||||
|
log.info('qcow2 module: Script executed successfully.')
|
||||||
|
return ret
|
||||||
|
except Exception as e:
|
||||||
|
log.error('qcow2 module: An error occurred while executing the script: {}'.format(e))
|
||||||
|
raise
|
||||||
|
|
||||||
|
def create_volume_config(vm_name, size_gb, start=False):
|
||||||
|
'''
|
||||||
|
Usage:
|
||||||
|
salt '*' qcow2.create_volume_config vm_name=<name> size_gb=<size> [start=<bool>]
|
||||||
|
|
||||||
|
Options:
|
||||||
|
vm_name
|
||||||
|
Name of the virtual machine to attach the volume to
|
||||||
|
size_gb
|
||||||
|
Volume size in GB (positive integer)
|
||||||
|
This determines the capacity of the virtual storage volume
|
||||||
|
start
|
||||||
|
Boolean flag to start the VM after volume creation
|
||||||
|
Optional - defaults to False
|
||||||
|
|
||||||
|
Examples:
|
||||||
|
1. **Create 500GB Volume:**
|
||||||
|
```bash
|
||||||
|
salt '*' qcow2.create_volume_config vm_name='sensor1_sensor' size_gb=500
|
||||||
|
```
|
||||||
|
This creates a 500GB virtual volume for NSM storage
|
||||||
|
|
||||||
|
2. **Create 1TB Volume and Start VM:**
|
||||||
|
```bash
|
||||||
|
salt '*' qcow2.create_volume_config vm_name='sensor1_sensor' size_gb=1000 start=True
|
||||||
|
```
|
||||||
|
This creates a 1TB volume and starts the VM after attachment
|
||||||
|
|
||||||
|
Notes:
|
||||||
|
- VM must be stopped before volume creation
|
||||||
|
- Volume is created as a qcow2 image and attached to the VM
|
||||||
|
- This is an alternative to disk passthrough via modify_hardware_config
|
||||||
|
- Volume is automatically attached to the VM's libvirt configuration
|
||||||
|
- Requires so-kvm-create-volume script to be installed
|
||||||
|
- Volume files are stored in the hypervisor's VM storage directory
|
||||||
|
|
||||||
|
Description:
|
||||||
|
This function creates and attaches a virtual storage volume to a KVM virtual machine
|
||||||
|
using the so-kvm-create-volume script. It creates a qcow2 disk image of the specified
|
||||||
|
size and attaches it to the VM for NSM (Network Security Monitoring) storage purposes.
|
||||||
|
This provides an alternative to physical disk passthrough, allowing flexible storage
|
||||||
|
allocation without requiring dedicated hardware. The VM can optionally be started
|
||||||
|
after the volume is successfully created and attached.
|
||||||
|
|
||||||
|
Exit Codes:
|
||||||
|
0: Success
|
||||||
|
1: Invalid parameters
|
||||||
|
2: VM state error (running when should be stopped)
|
||||||
|
3: Volume creation error
|
||||||
|
4: System command error
|
||||||
|
255: Unexpected error
|
||||||
|
|
||||||
|
Logging:
|
||||||
|
- All operations are logged to the salt minion log
|
||||||
|
- Log entries are prefixed with 'qcow2 module:'
|
||||||
|
- Volume creation and attachment operations are logged
|
||||||
|
- Errors include detailed messages and stack traces
|
||||||
|
- Final status of volume creation is logged
|
||||||
|
'''
|
||||||
|
|
||||||
|
# Validate size_gb parameter
|
||||||
|
if not isinstance(size_gb, int) or size_gb <= 0:
|
||||||
|
raise ValueError('size_gb must be a positive integer.')
|
||||||
|
|
||||||
|
cmd = ['/usr/sbin/so-kvm-create-volume', '-v', vm_name, '-s', str(size_gb)]
|
||||||
|
|
||||||
|
if start:
|
||||||
|
cmd.append('-S')
|
||||||
|
|
||||||
|
log.info('qcow2 module: Executing command: {}'.format(' '.join(shlex.quote(arg) for arg in cmd)))
|
||||||
|
|
||||||
|
try:
|
||||||
|
result = subprocess.run(cmd, capture_output=True, text=True, check=False)
|
||||||
|
ret = {
|
||||||
|
'retcode': result.returncode,
|
||||||
|
'stdout': result.stdout,
|
||||||
|
'stderr': result.stderr
|
||||||
|
}
|
||||||
|
if result.returncode != 0:
|
||||||
|
log.error('qcow2 module: Script execution failed with return code {}: {}'.format(result.returncode, result.stderr))
|
||||||
|
else:
|
||||||
|
log.info('qcow2 module: Script executed successfully.')
|
||||||
|
return ret
|
||||||
|
except Exception as e:
|
||||||
|
log.error('qcow2 module: An error occurred while executing the script: {}'.format(e))
|
||||||
|
raise
|
||||||
1171
salt/_runners/setup_hypervisor.py
Normal file
1171
salt/_runners/setup_hypervisor.py
Normal file
File diff suppressed because it is too large
Load Diff
@@ -1,258 +1,178 @@
|
|||||||
# Copyright Security Onion Solutions LLC and/or licensed to Security Onion Solutions LLC under one
|
{# Copyright Security Onion Solutions LLC and/or licensed to Security Onion Solutions LLC under one
|
||||||
# or more contributor license agreements. Licensed under the Elastic License 2.0 as shown at
|
or more contributor license agreements. Licensed under the Elastic License 2.0 as shown at
|
||||||
# https://securityonion.net/license; you may not use this file except in compliance with the
|
https://securityonion.net/license; you may not use this file except in compliance with the
|
||||||
# Elastic License 2.0.
|
Elastic License 2.0. #}
|
||||||
|
|
||||||
{% set ISAIRGAP = salt['pillar.get']('global:airgap', False) %}
|
{% set ISAIRGAP = salt['pillar.get']('global:airgap', False) %}
|
||||||
{% import_yaml 'salt/minion.defaults.yaml' as saltversion %}
|
{% import_yaml 'salt/minion.defaults.yaml' as saltversion %}
|
||||||
{% set saltversion = saltversion.salt.minion.version %}
|
{% set saltversion = saltversion.salt.minion.version %}
|
||||||
|
|
||||||
{# this is the list we are returning from this map file, it gets built below #}
|
{# Define common state groups to reduce redundancy #}
|
||||||
{% set allowed_states= [] %}
|
{% set base_states = [
|
||||||
|
'common',
|
||||||
|
'patch.os.schedule',
|
||||||
|
'motd',
|
||||||
|
'salt.minion-check',
|
||||||
|
'sensoroni',
|
||||||
|
'salt.lasthighstate',
|
||||||
|
'salt.minion'
|
||||||
|
] %}
|
||||||
|
|
||||||
|
{% set ssl_states = [
|
||||||
|
'ssl',
|
||||||
|
'telegraf',
|
||||||
|
'firewall',
|
||||||
|
'schedule',
|
||||||
|
'docker_clean'
|
||||||
|
] %}
|
||||||
|
|
||||||
|
{% set manager_states = [
|
||||||
|
'salt.master',
|
||||||
|
'ca',
|
||||||
|
'registry',
|
||||||
|
'manager',
|
||||||
|
'nginx',
|
||||||
|
'influxdb',
|
||||||
|
'soc',
|
||||||
|
'kratos',
|
||||||
|
'hydra',
|
||||||
|
'elasticfleet',
|
||||||
|
'elastic-fleet-package-registry',
|
||||||
|
'utility'
|
||||||
|
] %}
|
||||||
|
|
||||||
|
{% set sensor_states = [
|
||||||
|
'pcap',
|
||||||
|
'suricata',
|
||||||
|
'healthcheck',
|
||||||
|
'tcpreplay',
|
||||||
|
'zeek',
|
||||||
|
'strelka'
|
||||||
|
] %}
|
||||||
|
|
||||||
|
{% set kafka_states = [
|
||||||
|
'kafka'
|
||||||
|
] %}
|
||||||
|
|
||||||
|
{% set stig_states = [
|
||||||
|
'stig'
|
||||||
|
] %}
|
||||||
|
|
||||||
|
{% set elastic_stack_states = [
|
||||||
|
'elasticsearch',
|
||||||
|
'elasticsearch.auth',
|
||||||
|
'kibana',
|
||||||
|
'kibana.secrets',
|
||||||
|
'elastalert',
|
||||||
|
'logstash',
|
||||||
|
'redis'
|
||||||
|
] %}
|
||||||
|
|
||||||
|
{# Initialize the allowed_states list #}
|
||||||
|
{% set allowed_states = [] %}
|
||||||
|
|
||||||
{% if grains.saltversion | string == saltversion | string %}
|
{% if grains.saltversion | string == saltversion | string %}
|
||||||
|
{# Map role-specific states #}
|
||||||
|
{% set role_states = {
|
||||||
|
'so-eval': (
|
||||||
|
ssl_states +
|
||||||
|
manager_states +
|
||||||
|
sensor_states +
|
||||||
|
elastic_stack_states | reject('equalto', 'logstash') | list
|
||||||
|
),
|
||||||
|
'so-heavynode': (
|
||||||
|
ssl_states +
|
||||||
|
sensor_states +
|
||||||
|
['elasticagent', 'elasticsearch', 'logstash', 'redis', 'nginx']
|
||||||
|
),
|
||||||
|
'so-idh': (
|
||||||
|
ssl_states +
|
||||||
|
['idh']
|
||||||
|
),
|
||||||
|
'so-import': (
|
||||||
|
ssl_states +
|
||||||
|
manager_states +
|
||||||
|
sensor_states | reject('equalto', 'strelka') | reject('equalto', 'healthcheck') | list +
|
||||||
|
['elasticsearch', 'elasticsearch.auth', 'kibana', 'kibana.secrets', 'strelka.manager']
|
||||||
|
),
|
||||||
|
'so-manager': (
|
||||||
|
ssl_states +
|
||||||
|
manager_states +
|
||||||
|
['salt.cloud', 'libvirt.packages', 'libvirt.ssh.users', 'strelka.manager'] +
|
||||||
|
stig_states +
|
||||||
|
kafka_states +
|
||||||
|
elastic_stack_states
|
||||||
|
),
|
||||||
|
'so-managerhype': (
|
||||||
|
ssl_states +
|
||||||
|
manager_states +
|
||||||
|
['salt.cloud', 'strelka.manager', 'hypervisor', 'libvirt'] +
|
||||||
|
stig_states +
|
||||||
|
kafka_states +
|
||||||
|
elastic_stack_states
|
||||||
|
),
|
||||||
|
'so-managersearch': (
|
||||||
|
ssl_states +
|
||||||
|
manager_states +
|
||||||
|
['salt.cloud', 'libvirt.packages', 'libvirt.ssh.users', 'strelka.manager'] +
|
||||||
|
stig_states +
|
||||||
|
kafka_states +
|
||||||
|
elastic_stack_states
|
||||||
|
),
|
||||||
|
'so-searchnode': (
|
||||||
|
ssl_states +
|
||||||
|
['kafka.ca', 'kafka.ssl', 'elasticsearch', 'logstash', 'nginx'] +
|
||||||
|
stig_states
|
||||||
|
),
|
||||||
|
'so-standalone': (
|
||||||
|
ssl_states +
|
||||||
|
manager_states +
|
||||||
|
['salt.cloud', 'libvirt.packages', 'libvirt.ssh.users'] +
|
||||||
|
sensor_states +
|
||||||
|
stig_states +
|
||||||
|
kafka_states +
|
||||||
|
elastic_stack_states
|
||||||
|
),
|
||||||
|
'so-sensor': (
|
||||||
|
ssl_states +
|
||||||
|
sensor_states +
|
||||||
|
['nginx'] +
|
||||||
|
stig_states
|
||||||
|
),
|
||||||
|
'so-fleet': (
|
||||||
|
ssl_states +
|
||||||
|
stig_states +
|
||||||
|
['logstash', 'nginx', 'healthcheck', 'elasticfleet']
|
||||||
|
),
|
||||||
|
'so-receiver': (
|
||||||
|
ssl_states +
|
||||||
|
kafka_states +
|
||||||
|
stig_states +
|
||||||
|
['logstash', 'redis']
|
||||||
|
),
|
||||||
|
'so-hypervisor': (
|
||||||
|
ssl_states +
|
||||||
|
stig_states +
|
||||||
|
['hypervisor', 'libvirt']
|
||||||
|
),
|
||||||
|
'so-desktop': (
|
||||||
|
['ssl', 'docker_clean', 'telegraf'] +
|
||||||
|
stig_states
|
||||||
|
)
|
||||||
|
} %}
|
||||||
|
|
||||||
{% set allowed_states= salt['grains.filter_by']({
|
{# Get states for the current role #}
|
||||||
'so-eval': [
|
{% if grains.role in role_states %}
|
||||||
'salt.master',
|
{% set allowed_states = role_states[grains.role] %}
|
||||||
'ca',
|
{% endif %}
|
||||||
'ssl',
|
|
||||||
'registry',
|
|
||||||
'manager',
|
|
||||||
'nginx',
|
|
||||||
'telegraf',
|
|
||||||
'influxdb',
|
|
||||||
'soc',
|
|
||||||
'kratos',
|
|
||||||
'elasticfleet',
|
|
||||||
'elastic-fleet-package-registry',
|
|
||||||
'firewall',
|
|
||||||
'idstools',
|
|
||||||
'suricata.manager',
|
|
||||||
'healthcheck',
|
|
||||||
'pcap',
|
|
||||||
'suricata',
|
|
||||||
'utility',
|
|
||||||
'schedule',
|
|
||||||
'tcpreplay',
|
|
||||||
'docker_clean'
|
|
||||||
],
|
|
||||||
'so-heavynode': [
|
|
||||||
'ssl',
|
|
||||||
'nginx',
|
|
||||||
'telegraf',
|
|
||||||
'firewall',
|
|
||||||
'pcap',
|
|
||||||
'suricata',
|
|
||||||
'healthcheck',
|
|
||||||
'elasticagent',
|
|
||||||
'schedule',
|
|
||||||
'tcpreplay',
|
|
||||||
'docker_clean'
|
|
||||||
],
|
|
||||||
'so-idh': [
|
|
||||||
'ssl',
|
|
||||||
'telegraf',
|
|
||||||
'firewall',
|
|
||||||
'idh',
|
|
||||||
'schedule',
|
|
||||||
'docker_clean'
|
|
||||||
],
|
|
||||||
'so-import': [
|
|
||||||
'salt.master',
|
|
||||||
'ca',
|
|
||||||
'ssl',
|
|
||||||
'registry',
|
|
||||||
'manager',
|
|
||||||
'nginx',
|
|
||||||
'strelka.manager',
|
|
||||||
'soc',
|
|
||||||
'kratos',
|
|
||||||
'influxdb',
|
|
||||||
'telegraf',
|
|
||||||
'firewall',
|
|
||||||
'idstools',
|
|
||||||
'suricata.manager',
|
|
||||||
'pcap',
|
|
||||||
'utility',
|
|
||||||
'suricata',
|
|
||||||
'zeek',
|
|
||||||
'schedule',
|
|
||||||
'tcpreplay',
|
|
||||||
'docker_clean',
|
|
||||||
'elasticfleet',
|
|
||||||
'elastic-fleet-package-registry'
|
|
||||||
],
|
|
||||||
'so-manager': [
|
|
||||||
'salt.master',
|
|
||||||
'ca',
|
|
||||||
'ssl',
|
|
||||||
'registry',
|
|
||||||
'manager',
|
|
||||||
'nginx',
|
|
||||||
'telegraf',
|
|
||||||
'influxdb',
|
|
||||||
'strelka.manager',
|
|
||||||
'soc',
|
|
||||||
'kratos',
|
|
||||||
'elasticfleet',
|
|
||||||
'elastic-fleet-package-registry',
|
|
||||||
'firewall',
|
|
||||||
'idstools',
|
|
||||||
'suricata.manager',
|
|
||||||
'utility',
|
|
||||||
'schedule',
|
|
||||||
'docker_clean',
|
|
||||||
'stig',
|
|
||||||
'kafka'
|
|
||||||
],
|
|
||||||
'so-managersearch': [
|
|
||||||
'salt.master',
|
|
||||||
'ca',
|
|
||||||
'ssl',
|
|
||||||
'registry',
|
|
||||||
'nginx',
|
|
||||||
'telegraf',
|
|
||||||
'influxdb',
|
|
||||||
'strelka.manager',
|
|
||||||
'soc',
|
|
||||||
'kratos',
|
|
||||||
'elastic-fleet-package-registry',
|
|
||||||
'elasticfleet',
|
|
||||||
'firewall',
|
|
||||||
'manager',
|
|
||||||
'idstools',
|
|
||||||
'suricata.manager',
|
|
||||||
'utility',
|
|
||||||
'schedule',
|
|
||||||
'docker_clean',
|
|
||||||
'stig',
|
|
||||||
'kafka'
|
|
||||||
],
|
|
||||||
'so-searchnode': [
|
|
||||||
'ssl',
|
|
||||||
'nginx',
|
|
||||||
'telegraf',
|
|
||||||
'firewall',
|
|
||||||
'schedule',
|
|
||||||
'docker_clean',
|
|
||||||
'stig',
|
|
||||||
'kafka.ca',
|
|
||||||
'kafka.ssl'
|
|
||||||
],
|
|
||||||
'so-standalone': [
|
|
||||||
'salt.master',
|
|
||||||
'ca',
|
|
||||||
'ssl',
|
|
||||||
'registry',
|
|
||||||
'manager',
|
|
||||||
'nginx',
|
|
||||||
'telegraf',
|
|
||||||
'influxdb',
|
|
||||||
'soc',
|
|
||||||
'kratos',
|
|
||||||
'elastic-fleet-package-registry',
|
|
||||||
'elasticfleet',
|
|
||||||
'firewall',
|
|
||||||
'idstools',
|
|
||||||
'suricata.manager',
|
|
||||||
'pcap',
|
|
||||||
'suricata',
|
|
||||||
'healthcheck',
|
|
||||||
'utility',
|
|
||||||
'schedule',
|
|
||||||
'tcpreplay',
|
|
||||||
'docker_clean',
|
|
||||||
'stig',
|
|
||||||
'kafka'
|
|
||||||
],
|
|
||||||
'so-sensor': [
|
|
||||||
'ssl',
|
|
||||||
'telegraf',
|
|
||||||
'firewall',
|
|
||||||
'nginx',
|
|
||||||
'pcap',
|
|
||||||
'suricata',
|
|
||||||
'healthcheck',
|
|
||||||
'schedule',
|
|
||||||
'tcpreplay',
|
|
||||||
'docker_clean',
|
|
||||||
'stig'
|
|
||||||
],
|
|
||||||
'so-fleet': [
|
|
||||||
'ssl',
|
|
||||||
'telegraf',
|
|
||||||
'firewall',
|
|
||||||
'logstash',
|
|
||||||
'nginx',
|
|
||||||
'healthcheck',
|
|
||||||
'schedule',
|
|
||||||
'elasticfleet',
|
|
||||||
'docker_clean'
|
|
||||||
],
|
|
||||||
'so-receiver': [
|
|
||||||
'ssl',
|
|
||||||
'telegraf',
|
|
||||||
'firewall',
|
|
||||||
'schedule',
|
|
||||||
'docker_clean',
|
|
||||||
'kafka',
|
|
||||||
'stig'
|
|
||||||
],
|
|
||||||
'so-desktop': [
|
|
||||||
'ssl',
|
|
||||||
'docker_clean',
|
|
||||||
'telegraf'
|
|
||||||
],
|
|
||||||
}, grain='role') %}
|
|
||||||
|
|
||||||
{%- if grains.role in ['so-sensor', 'so-eval', 'so-standalone', 'so-heavynode'] %}
|
|
||||||
{% do allowed_states.append('zeek') %}
|
|
||||||
{%- endif %}
|
|
||||||
|
|
||||||
{% if grains.role in ['so-sensor', 'so-eval', 'so-standalone', 'so-heavynode'] %}
|
|
||||||
{% do allowed_states.append('strelka') %}
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
{% if grains.role in ['so-eval', 'so-manager', 'so-standalone', 'so-searchnode', 'so-managersearch', 'so-heavynode', 'so-import'] %}
|
|
||||||
{% do allowed_states.append('elasticsearch') %}
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
{% if grains.role in ['so-eval', 'so-manager', 'so-standalone', 'so-managersearch', 'so-import'] %}
|
|
||||||
{% do allowed_states.append('elasticsearch.auth') %}
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
{% if grains.role in ['so-eval', 'so-manager', 'so-standalone', 'so-managersearch', 'so-import'] %}
|
|
||||||
{% do allowed_states.append('kibana') %}
|
|
||||||
{% do allowed_states.append('kibana.secrets') %}
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
{% if grains.role in ['so-eval', 'so-manager', 'so-standalone', 'so-managersearch'] %}
|
|
||||||
{% do allowed_states.append('elastalert') %}
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
{% if grains.role in ['so-manager', 'so-standalone', 'so-searchnode', 'so-managersearch', 'so-heavynode', 'so-receiver'] %}
|
|
||||||
{% do allowed_states.append('logstash') %}
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
{% if grains.role in ['so-manager', 'so-standalone', 'so-managersearch', 'so-heavynode', 'so-receiver', 'so-eval'] %}
|
|
||||||
{% do allowed_states.append('redis') %}
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
{# all nodes on the right salt version can run the following states #}
|
|
||||||
{% do allowed_states.append('common') %}
|
|
||||||
{% do allowed_states.append('patch.os.schedule') %}
|
|
||||||
{% do allowed_states.append('motd') %}
|
|
||||||
{% do allowed_states.append('salt.minion-check') %}
|
|
||||||
{% do allowed_states.append('sensoroni') %}
|
|
||||||
{% do allowed_states.append('salt.lasthighstate') %}
|
|
||||||
|
|
||||||
|
{# Add base states that apply to all roles #}
|
||||||
|
{% for state in base_states %}
|
||||||
|
{% do allowed_states.append(state) %}
|
||||||
|
{% endfor %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
{# Add airgap state if needed #}
|
||||||
{% if ISAIRGAP %}
|
{% if ISAIRGAP %}
|
||||||
{% do allowed_states.append('airgap') %}
|
{% do allowed_states.append('airgap') %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{# all nodes can always run salt.minion state #}
|
|
||||||
{% do allowed_states.append('salt.minion') %}
|
|
||||||
|
|||||||
@@ -4,4 +4,5 @@ backup:
|
|||||||
- /etc/pki
|
- /etc/pki
|
||||||
- /etc/salt
|
- /etc/salt
|
||||||
- /nsm/kratos
|
- /nsm/kratos
|
||||||
|
- /nsm/hydra
|
||||||
destination: "/nsm/backup"
|
destination: "/nsm/backup"
|
||||||
@@ -11,6 +11,10 @@ TODAY=$(date '+%Y_%m_%d')
|
|||||||
BACKUPDIR={{ DESTINATION }}
|
BACKUPDIR={{ DESTINATION }}
|
||||||
BACKUPFILE="$BACKUPDIR/so-config-backup-$TODAY.tar"
|
BACKUPFILE="$BACKUPDIR/so-config-backup-$TODAY.tar"
|
||||||
MAXBACKUPS=7
|
MAXBACKUPS=7
|
||||||
|
EXCLUSIONS=(
|
||||||
|
"--exclude=/opt/so/saltstack/local/salt/elasticfleet/files/so_agent-installers"
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
# Create backup dir if it does not exist
|
# Create backup dir if it does not exist
|
||||||
mkdir -p /nsm/backup
|
mkdir -p /nsm/backup
|
||||||
@@ -23,7 +27,7 @@ if [ ! -f $BACKUPFILE ]; then
|
|||||||
|
|
||||||
# Loop through all paths defined in global.sls, and append them to backup file
|
# Loop through all paths defined in global.sls, and append them to backup file
|
||||||
{%- for LOCATION in BACKUPLOCATIONS %}
|
{%- for LOCATION in BACKUPLOCATIONS %}
|
||||||
tar -rf $BACKUPFILE {{ LOCATION }}
|
tar -rf $BACKUPFILE "${EXCLUSIONS[@]}" {{ LOCATION }}
|
||||||
{%- endfor %}
|
{%- endfor %}
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -1,4 +1,7 @@
|
|||||||
{% from 'vars/globals.map.jinja' import GLOBALS %}
|
{% from 'vars/globals.map.jinja' import GLOBALS %}
|
||||||
|
{% set PCAP_BPF_STATUS = 0 %}
|
||||||
|
{% set STENO_BPF_COMPILED = "" %}
|
||||||
|
|
||||||
{% if GLOBALS.pcap_engine == "TRANSITION" %}
|
{% if GLOBALS.pcap_engine == "TRANSITION" %}
|
||||||
{% set PCAPBPF = ["ip and host 255.255.255.1 and port 1"] %}
|
{% set PCAPBPF = ["ip and host 255.255.255.1 and port 1"] %}
|
||||||
{% else %}
|
{% else %}
|
||||||
@@ -8,3 +11,11 @@
|
|||||||
{{ MACROS.remove_comments(BPFMERGED, 'pcap') }}
|
{{ MACROS.remove_comments(BPFMERGED, 'pcap') }}
|
||||||
{% set PCAPBPF = BPFMERGED.pcap %}
|
{% set PCAPBPF = BPFMERGED.pcap %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
{% if PCAPBPF %}
|
||||||
|
{% set PCAP_BPF_CALC = salt['cmd.run_all']('/usr/sbin/so-bpf-compile ' ~ GLOBALS.sensor.interface ~ ' ' ~ PCAPBPF|join(" "), cwd='/root') %}
|
||||||
|
{% if PCAP_BPF_CALC['retcode'] == 0 %}
|
||||||
|
{% set PCAP_BPF_STATUS = 1 %}
|
||||||
|
{% set STENO_BPF_COMPILED = ",\\\"--filter=" + PCAP_BPF_CALC['stdout'] + "\\\"" %}
|
||||||
|
{% endif %}
|
||||||
|
{% endif %}
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
bpf:
|
bpf:
|
||||||
pcap:
|
pcap:
|
||||||
description: List of BPF filters to apply to Stenographer.
|
description: List of BPF filters to apply to the PCAP engine.
|
||||||
multiline: True
|
multiline: True
|
||||||
forcedType: "[]string"
|
forcedType: "[]string"
|
||||||
helpLink: bpf.html
|
helpLink: bpf.html
|
||||||
suricata:
|
suricata:
|
||||||
description: List of BPF filters to apply to Suricata.
|
description: List of BPF filters to apply to Suricata. This will apply to alerts and, if enabled, to metadata and PCAP logs generated by Suricata.
|
||||||
multiline: True
|
multiline: True
|
||||||
forcedType: "[]string"
|
forcedType: "[]string"
|
||||||
helpLink: bpf.html
|
helpLink: bpf.html
|
||||||
|
|||||||
@@ -1,7 +1,16 @@
|
|||||||
|
{% from 'vars/globals.map.jinja' import GLOBALS %}
|
||||||
{% import_yaml 'bpf/defaults.yaml' as BPFDEFAULTS %}
|
{% import_yaml 'bpf/defaults.yaml' as BPFDEFAULTS %}
|
||||||
{% set BPFMERGED = salt['pillar.get']('bpf', BPFDEFAULTS.bpf, merge=True) %}
|
{% set BPFMERGED = salt['pillar.get']('bpf', BPFDEFAULTS.bpf, merge=True) %}
|
||||||
|
{% set SURICATA_BPF_STATUS = 0 %}
|
||||||
{% import 'bpf/macros.jinja' as MACROS %}
|
{% import 'bpf/macros.jinja' as MACROS %}
|
||||||
|
|
||||||
{{ MACROS.remove_comments(BPFMERGED, 'suricata') }}
|
{{ MACROS.remove_comments(BPFMERGED, 'suricata') }}
|
||||||
|
|
||||||
{% set SURICATABPF = BPFMERGED.suricata %}
|
{% set SURICATABPF = BPFMERGED.suricata %}
|
||||||
|
|
||||||
|
{% if SURICATABPF %}
|
||||||
|
{% set SURICATA_BPF_CALC = salt['cmd.run_all']('/usr/sbin/so-bpf-compile ' ~ GLOBALS.sensor.interface ~ ' ' ~ SURICATABPF|join(" "), cwd='/root') %}
|
||||||
|
{% if SURICATA_BPF_CALC['retcode'] == 0 %}
|
||||||
|
{% set SURICATA_BPF_STATUS = 1 %}
|
||||||
|
{% endif %}
|
||||||
|
{% endif %}
|
||||||
|
|||||||
@@ -1,7 +1,16 @@
|
|||||||
|
{% from 'vars/globals.map.jinja' import GLOBALS %}
|
||||||
{% import_yaml 'bpf/defaults.yaml' as BPFDEFAULTS %}
|
{% import_yaml 'bpf/defaults.yaml' as BPFDEFAULTS %}
|
||||||
{% set BPFMERGED = salt['pillar.get']('bpf', BPFDEFAULTS.bpf, merge=True) %}
|
{% set BPFMERGED = salt['pillar.get']('bpf', BPFDEFAULTS.bpf, merge=True) %}
|
||||||
|
{% set ZEEK_BPF_STATUS = 0 %}
|
||||||
{% import 'bpf/macros.jinja' as MACROS %}
|
{% import 'bpf/macros.jinja' as MACROS %}
|
||||||
|
|
||||||
{{ MACROS.remove_comments(BPFMERGED, 'zeek') }}
|
{{ MACROS.remove_comments(BPFMERGED, 'zeek') }}
|
||||||
|
|
||||||
{% set ZEEKBPF = BPFMERGED.zeek %}
|
{% set ZEEKBPF = BPFMERGED.zeek %}
|
||||||
|
|
||||||
|
{% if ZEEKBPF %}
|
||||||
|
{% set ZEEK_BPF_CALC = salt['cmd.run_all']('/usr/sbin/so-bpf-compile ' ~ GLOBALS.sensor.interface ~ ' ' ~ ZEEKBPF|join(" "), cwd='/root') %}
|
||||||
|
{% if ZEEK_BPF_CALC['retcode'] == 0 %}
|
||||||
|
{% set ZEEK_BPF_STATUS = 1 %}
|
||||||
|
{% endif %}
|
||||||
|
{% endif %}
|
||||||
|
|||||||
21
salt/common/grains.sls
Normal file
21
salt/common/grains.sls
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
# Copyright Security Onion Solutions LLC and/or licensed to Security Onion Solutions LLC under one
|
||||||
|
# or more contributor license agreements. Licensed under the Elastic License 2.0 as shown at
|
||||||
|
# https://securityonion.net/license; you may not use this file except in compliance with the
|
||||||
|
# Elastic License 2.0.
|
||||||
|
|
||||||
|
{% set nsm_exists = salt['file.directory_exists']('/nsm') %}
|
||||||
|
{% if nsm_exists %}
|
||||||
|
{% set nsm_total = salt['cmd.shell']('df -BG /nsm | tail -1 | awk \'{print $2}\'') %}
|
||||||
|
|
||||||
|
nsm_total:
|
||||||
|
grains.present:
|
||||||
|
- name: nsm_total
|
||||||
|
- value: {{ nsm_total }}
|
||||||
|
|
||||||
|
{% else %}
|
||||||
|
|
||||||
|
nsm_missing:
|
||||||
|
test.succeed_without_changes:
|
||||||
|
- name: /nsm does not exist, skipping grain assignment
|
||||||
|
|
||||||
|
{% endif %}
|
||||||
@@ -4,6 +4,7 @@
|
|||||||
{% from 'vars/globals.map.jinja' import GLOBALS %}
|
{% from 'vars/globals.map.jinja' import GLOBALS %}
|
||||||
|
|
||||||
include:
|
include:
|
||||||
|
- common.grains
|
||||||
- common.packages
|
- common.packages
|
||||||
{% if GLOBALS.role in GLOBALS.manager_roles %}
|
{% if GLOBALS.role in GLOBALS.manager_roles %}
|
||||||
- manager.elasticsearch # needed for elastic_curl_config state
|
- manager.elasticsearch # needed for elastic_curl_config state
|
||||||
@@ -14,6 +15,11 @@ net.core.wmem_default:
|
|||||||
sysctl.present:
|
sysctl.present:
|
||||||
- value: 26214400
|
- value: 26214400
|
||||||
|
|
||||||
|
# Users are not a fan of console messages
|
||||||
|
kernel.printk:
|
||||||
|
sysctl.present:
|
||||||
|
- value: "3 4 1 3"
|
||||||
|
|
||||||
# Remove variables.txt from /tmp - This is temp
|
# Remove variables.txt from /tmp - This is temp
|
||||||
rmvariablesfile:
|
rmvariablesfile:
|
||||||
file.absent:
|
file.absent:
|
||||||
@@ -101,7 +107,7 @@ Etc/UTC:
|
|||||||
timezone.system
|
timezone.system
|
||||||
|
|
||||||
# Sync curl configuration for Elasticsearch authentication
|
# Sync curl configuration for Elasticsearch authentication
|
||||||
{% if GLOBALS.role in ['so-eval', 'so-heavynode', 'so-import', 'so-manager', 'so-managersearch', 'so-searchnode', 'so-standalone'] %}
|
{% if GLOBALS.is_manager or GLOBALS.role in ['so-heavynode', 'so-searchnode'] %}
|
||||||
elastic_curl_config:
|
elastic_curl_config:
|
||||||
file.managed:
|
file.managed:
|
||||||
- name: /opt/so/conf/elasticsearch/curl.config
|
- name: /opt/so/conf/elasticsearch/curl.config
|
||||||
@@ -123,6 +129,11 @@ common_sbin:
|
|||||||
- user: 939
|
- user: 939
|
||||||
- group: 939
|
- group: 939
|
||||||
- file_mode: 755
|
- file_mode: 755
|
||||||
|
- show_changes: False
|
||||||
|
{% if GLOBALS.role == 'so-heavynode' %}
|
||||||
|
- exclude_pat:
|
||||||
|
- so-pcap-import
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
common_sbin_jinja:
|
common_sbin_jinja:
|
||||||
file.recurse:
|
file.recurse:
|
||||||
@@ -132,6 +143,21 @@ common_sbin_jinja:
|
|||||||
- group: 939
|
- group: 939
|
||||||
- file_mode: 755
|
- file_mode: 755
|
||||||
- template: jinja
|
- template: jinja
|
||||||
|
- show_changes: False
|
||||||
|
{% if GLOBALS.role == 'so-heavynode' %}
|
||||||
|
- exclude_pat:
|
||||||
|
- so-import-pcap
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% if GLOBALS.role == 'so-heavynode' %}
|
||||||
|
remove_so-pcap-import_heavynode:
|
||||||
|
file.absent:
|
||||||
|
- name: /usr/sbin/so-pcap-import
|
||||||
|
|
||||||
|
remove_so-import-pcap_heavynode:
|
||||||
|
file.absent:
|
||||||
|
- name: /usr/sbin/so-import-pcap
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
{% if not GLOBALS.is_manager%}
|
{% if not GLOBALS.is_manager%}
|
||||||
# prior to 2.4.50 these scripts were in common/tools/sbin on the manager because of soup and distributed to non managers
|
# prior to 2.4.50 these scripts were in common/tools/sbin on the manager because of soup and distributed to non managers
|
||||||
@@ -177,6 +203,7 @@ sostatus_log:
|
|||||||
file.managed:
|
file.managed:
|
||||||
- name: /opt/so/log/sostatus/status.log
|
- name: /opt/so/log/sostatus/status.log
|
||||||
- mode: 644
|
- mode: 644
|
||||||
|
- replace: False
|
||||||
|
|
||||||
# Install sostatus check cron. This is used to populate Grid.
|
# Install sostatus check cron. This is used to populate Grid.
|
||||||
so-status_check_cron:
|
so-status_check_cron:
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{% from 'vars/globals.map.jinja' import GLOBALS %}
|
# we cannot import GLOBALS from vars/globals.map.jinja in this state since it is called in setup.virt.init
|
||||||
|
# since it is early in setup of a new VM, the pillars imported in GLOBALS are not yet defined
|
||||||
{% if GLOBALS.os_family == 'Debian' %}
|
{% if grains.os_family == 'Debian' %}
|
||||||
commonpkgs:
|
commonpkgs:
|
||||||
pkg.installed:
|
pkg.installed:
|
||||||
- skip_suggestions: True
|
- skip_suggestions: True
|
||||||
@@ -27,6 +27,7 @@ commonpkgs:
|
|||||||
- vim
|
- vim
|
||||||
- tar
|
- tar
|
||||||
- unzip
|
- unzip
|
||||||
|
- bc
|
||||||
{% if grains.oscodename != 'focal' %}
|
{% if grains.oscodename != 'focal' %}
|
||||||
- python3-rich
|
- python3-rich
|
||||||
{% endif %}
|
{% endif %}
|
||||||
@@ -45,7 +46,7 @@ python-rich:
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% if GLOBALS.os_family == 'RedHat' %}
|
{% if grains.os_family == 'RedHat' %}
|
||||||
|
|
||||||
remove_mariadb:
|
remove_mariadb:
|
||||||
pkg.removed:
|
pkg.removed:
|
||||||
@@ -56,6 +57,7 @@ commonpkgs:
|
|||||||
- skip_suggestions: True
|
- skip_suggestions: True
|
||||||
- pkgs:
|
- pkgs:
|
||||||
- python3-dnf-plugin-versionlock
|
- python3-dnf-plugin-versionlock
|
||||||
|
- bc
|
||||||
- curl
|
- curl
|
||||||
- device-mapper-persistent-data
|
- device-mapper-persistent-data
|
||||||
- fuse
|
- fuse
|
||||||
|
|||||||
@@ -11,6 +11,7 @@
|
|||||||
{% else %}
|
{% else %}
|
||||||
{% set UPDATE_DIR='/tmp/sogh/securityonion' %}
|
{% set UPDATE_DIR='/tmp/sogh/securityonion' %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
{% set SOVERSION = salt['file.read']('/etc/soversion').strip() %}
|
||||||
|
|
||||||
remove_common_soup:
|
remove_common_soup:
|
||||||
file.absent:
|
file.absent:
|
||||||
@@ -63,6 +64,12 @@ copy_so-repo-sync_manager_tools_sbin:
|
|||||||
- source: {{UPDATE_DIR}}/salt/manager/tools/sbin/so-repo-sync
|
- source: {{UPDATE_DIR}}/salt/manager/tools/sbin/so-repo-sync
|
||||||
- preserve: True
|
- preserve: True
|
||||||
|
|
||||||
|
copy_bootstrap-salt_manager_tools_sbin:
|
||||||
|
file.copy:
|
||||||
|
- name: /opt/so/saltstack/default/salt/salt/scripts/bootstrap-salt.sh
|
||||||
|
- source: {{UPDATE_DIR}}/salt/salt/scripts/bootstrap-salt.sh
|
||||||
|
- preserve: True
|
||||||
|
|
||||||
# This section is used to put the new script in place so that it can be called during soup.
|
# This section is used to put the new script in place so that it can be called during soup.
|
||||||
# It is faster than calling the states that normally manage them to put them in place.
|
# It is faster than calling the states that normally manage them to put them in place.
|
||||||
copy_so-common_sbin:
|
copy_so-common_sbin:
|
||||||
@@ -107,6 +114,24 @@ copy_so-repo-sync_sbin:
|
|||||||
- force: True
|
- force: True
|
||||||
- preserve: True
|
- preserve: True
|
||||||
|
|
||||||
|
copy_bootstrap-salt_sbin:
|
||||||
|
file.copy:
|
||||||
|
- name: /usr/sbin/bootstrap-salt.sh
|
||||||
|
- source: {{UPDATE_DIR}}/salt/salt/scripts/bootstrap-salt.sh
|
||||||
|
- force: True
|
||||||
|
- preserve: True
|
||||||
|
|
||||||
|
{# this is added in 2.4.120 to remove salt repo files pointing to saltproject.io to accomodate the move to broadcom and new bootstrap-salt script #}
|
||||||
|
{% if salt['pkg.version_cmp'](SOVERSION, '2.4.120') == -1 %}
|
||||||
|
{% set saltrepofile = '/etc/yum.repos.d/salt.repo' %}
|
||||||
|
{% if grains.os_family == 'Debian' %}
|
||||||
|
{% set saltrepofile = '/etc/apt/sources.list.d/salt.list' %}
|
||||||
|
{% endif %}
|
||||||
|
remove_saltproject_io_repo_manager:
|
||||||
|
file.absent:
|
||||||
|
- name: {{ saltrepofile }}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
{% else %}
|
{% else %}
|
||||||
fix_23_soup_sbin:
|
fix_23_soup_sbin:
|
||||||
cmd.run:
|
cmd.run:
|
||||||
|
|||||||
@@ -29,9 +29,26 @@ fi
|
|||||||
|
|
||||||
interface="$1"
|
interface="$1"
|
||||||
shift
|
shift
|
||||||
tcpdump -i $interface -ddd $@ | tail -n+2 |
|
|
||||||
while read line; do
|
# Capture tcpdump output and exit code
|
||||||
|
tcpdump_output=$(tcpdump -i "$interface" -ddd "$@" 2>&1)
|
||||||
|
tcpdump_exit=$?
|
||||||
|
|
||||||
|
if [ $tcpdump_exit -ne 0 ]; then
|
||||||
|
echo "$tcpdump_output" >&2
|
||||||
|
exit $tcpdump_exit
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Process the output, skipping the first line
|
||||||
|
echo "$tcpdump_output" | tail -n+2 | while read -r line; do
|
||||||
cols=( $line )
|
cols=( $line )
|
||||||
printf "%04x%02x%02x%08x" ${cols[0]} ${cols[1]} ${cols[2]} ${cols[3]}
|
printf "%04x%02x%02x%08x" "${cols[0]}" "${cols[1]}" "${cols[2]}" "${cols[3]}"
|
||||||
done
|
done
|
||||||
|
|
||||||
|
# Check if the pipeline succeeded
|
||||||
|
if [ "${PIPESTATUS[0]}" -ne 0 ]; then
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
echo ""
|
echo ""
|
||||||
|
exit 0
|
||||||
|
|||||||
@@ -8,12 +8,6 @@
|
|||||||
# Elastic agent is not managed by salt. Because of this we must store this base information in a
|
# Elastic agent is not managed by salt. Because of this we must store this base information in a
|
||||||
# script that accompanies the soup system. Since so-common is one of those special soup files,
|
# script that accompanies the soup system. Since so-common is one of those special soup files,
|
||||||
# and since this same logic is required during installation, it's included in this file.
|
# and since this same logic is required during installation, it's included in this file.
|
||||||
ELASTIC_AGENT_TARBALL_VERSION="8.10.4"
|
|
||||||
ELASTIC_AGENT_URL="https://repo.securityonion.net/file/so-repo/prod/2.4/elasticagent/elastic-agent_SO-$ELASTIC_AGENT_TARBALL_VERSION.tar.gz"
|
|
||||||
ELASTIC_AGENT_MD5_URL="https://repo.securityonion.net/file/so-repo/prod/2.4/elasticagent/elastic-agent_SO-$ELASTIC_AGENT_TARBALL_VERSION.md5"
|
|
||||||
ELASTIC_AGENT_FILE="/nsm/elastic-fleet/artifacts/elastic-agent_SO-$ELASTIC_AGENT_TARBALL_VERSION.tar.gz"
|
|
||||||
ELASTIC_AGENT_MD5="/nsm/elastic-fleet/artifacts/elastic-agent_SO-$ELASTIC_AGENT_TARBALL_VERSION.md5"
|
|
||||||
ELASTIC_AGENT_EXPANSION_DIR=/nsm/elastic-fleet/artifacts/beats/elastic-agent
|
|
||||||
|
|
||||||
DEFAULT_SALT_DIR=/opt/so/saltstack/default
|
DEFAULT_SALT_DIR=/opt/so/saltstack/default
|
||||||
DOC_BASE_URL="https://docs.securityonion.net/en/2.4"
|
DOC_BASE_URL="https://docs.securityonion.net/en/2.4"
|
||||||
@@ -105,6 +99,17 @@ add_interface_bond0() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
airgap_playbooks() {
|
||||||
|
SRC_DIR=$1
|
||||||
|
# Copy playbooks if using airgap
|
||||||
|
mkdir -p /nsm/airgap-resources
|
||||||
|
# Purge old airgap playbooks to ensure SO only uses the latest released playbooks
|
||||||
|
rm -fr /nsm/airgap-resources/playbooks
|
||||||
|
tar xf $SRC_DIR/airgap-resources/playbooks.tgz -C /nsm/airgap-resources/
|
||||||
|
chown -R socore:socore /nsm/airgap-resources/playbooks
|
||||||
|
git config --global --add safe.directory /nsm/airgap-resources/playbooks
|
||||||
|
}
|
||||||
|
|
||||||
check_container() {
|
check_container() {
|
||||||
docker ps | grep "$1:" > /dev/null 2>&1
|
docker ps | grep "$1:" > /dev/null 2>&1
|
||||||
return $?
|
return $?
|
||||||
@@ -174,13 +179,63 @@ check_salt_minion_status() {
|
|||||||
return $status
|
return $status
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Compare es versions and return the highest version
|
||||||
|
compare_es_versions() {
|
||||||
|
# Save the original IFS
|
||||||
|
local OLD_IFS="$IFS"
|
||||||
|
|
||||||
|
IFS=.
|
||||||
|
local i ver1=($1) ver2=($2)
|
||||||
|
|
||||||
|
# Restore the original IFS
|
||||||
|
IFS="$OLD_IFS"
|
||||||
|
|
||||||
|
# Determine the maximum length between the two version arrays
|
||||||
|
local max_len=${#ver1[@]}
|
||||||
|
if [[ ${#ver2[@]} -gt $max_len ]]; then
|
||||||
|
max_len=${#ver2[@]}
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Compare each segment of the versions
|
||||||
|
for ((i=0; i<max_len; i++)); do
|
||||||
|
# If a segment in ver1 or ver2 is missing, set it to 0
|
||||||
|
if [[ -z ${ver1[i]} ]]; then
|
||||||
|
ver1[i]=0
|
||||||
|
fi
|
||||||
|
if [[ -z ${ver2[i]} ]]; then
|
||||||
|
ver2[i]=0
|
||||||
|
fi
|
||||||
|
if ((10#${ver1[i]} > 10#${ver2[i]})); then
|
||||||
|
echo "$1"
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
if ((10#${ver1[i]} < 10#${ver2[i]})); then
|
||||||
|
echo "$2"
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
echo "$1" # If versions are equal, return either
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
copy_new_files() {
|
copy_new_files() {
|
||||||
|
# Define files to exclude from deletion (relative to their respective base directories)
|
||||||
|
local EXCLUDE_FILES=(
|
||||||
|
"salt/hypervisor/soc_hypervisor.yaml"
|
||||||
|
)
|
||||||
|
|
||||||
|
# Build rsync exclude arguments
|
||||||
|
local EXCLUDE_ARGS=()
|
||||||
|
for file in "${EXCLUDE_FILES[@]}"; do
|
||||||
|
EXCLUDE_ARGS+=(--exclude="$file")
|
||||||
|
done
|
||||||
|
|
||||||
# Copy new files over to the salt dir
|
# Copy new files over to the salt dir
|
||||||
cd $UPDATE_DIR
|
cd $UPDATE_DIR
|
||||||
rsync -a salt $DEFAULT_SALT_DIR/ --delete
|
rsync -a salt $DEFAULT_SALT_DIR/ --delete "${EXCLUDE_ARGS[@]}"
|
||||||
rsync -a pillar $DEFAULT_SALT_DIR/ --delete
|
rsync -a pillar $DEFAULT_SALT_DIR/ --delete "${EXCLUDE_ARGS[@]}"
|
||||||
chown -R socore:socore $DEFAULT_SALT_DIR/
|
chown -R socore:socore $DEFAULT_SALT_DIR/
|
||||||
chmod 755 $DEFAULT_SALT_DIR/pillar/firewall/addfirewall.sh
|
|
||||||
cd /tmp
|
cd /tmp
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -192,7 +247,7 @@ create_local_directories() {
|
|||||||
for d in $(find $PILLARSALTDIR/$i -type d); do
|
for d in $(find $PILLARSALTDIR/$i -type d); do
|
||||||
suffixdir=${d//$PILLARSALTDIR/}
|
suffixdir=${d//$PILLARSALTDIR/}
|
||||||
if [ ! -d "$local_salt_dir/$suffixdir" ]; then
|
if [ ! -d "$local_salt_dir/$suffixdir" ]; then
|
||||||
mkdir -pv $local_salt_dir$suffixdir
|
mkdir -p $local_salt_dir$suffixdir
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
chown -R socore:socore $local_salt_dir/$i
|
chown -R socore:socore $local_salt_dir/$i
|
||||||
@@ -263,19 +318,36 @@ fail() {
|
|||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
get_random_value() {
|
|
||||||
length=${1:-20}
|
|
||||||
head -c 5000 /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w $length | head -n 1
|
|
||||||
}
|
|
||||||
|
|
||||||
get_agent_count() {
|
get_agent_count() {
|
||||||
if [ -f /opt/so/log/agents/agentstatus.log ]; then
|
if [ -f /opt/so/log/agents/agentstatus.log ]; then
|
||||||
AGENTCOUNT=$(cat /opt/so/log/agents/agentstatus.log | grep -wF active | awk '{print $2}')
|
AGENTCOUNT=$(cat /opt/so/log/agents/agentstatus.log | grep -wF active | awk '{print $2}' | sed 's/,//')
|
||||||
|
[[ -z "$AGENTCOUNT" ]] && AGENTCOUNT="0"
|
||||||
else
|
else
|
||||||
AGENTCOUNT=0
|
AGENTCOUNT=0
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get_elastic_agent_vars() {
|
||||||
|
local path="${1:-/opt/so/saltstack/default}"
|
||||||
|
local defaultsfile="${path}/salt/elasticsearch/defaults.yaml"
|
||||||
|
|
||||||
|
if [ -f "$defaultsfile" ]; then
|
||||||
|
ELASTIC_AGENT_TARBALL_VERSION=$(egrep " +version: " $defaultsfile | awk -F: '{print $2}' | tr -d '[:space:]')
|
||||||
|
ELASTIC_AGENT_URL="https://repo.securityonion.net/file/so-repo/prod/2.4/elasticagent/elastic-agent_SO-$ELASTIC_AGENT_TARBALL_VERSION.tar.gz"
|
||||||
|
ELASTIC_AGENT_MD5_URL="https://repo.securityonion.net/file/so-repo/prod/2.4/elasticagent/elastic-agent_SO-$ELASTIC_AGENT_TARBALL_VERSION.md5"
|
||||||
|
ELASTIC_AGENT_FILE="/nsm/elastic-fleet/artifacts/elastic-agent_SO-$ELASTIC_AGENT_TARBALL_VERSION.tar.gz"
|
||||||
|
ELASTIC_AGENT_MD5="/nsm/elastic-fleet/artifacts/elastic-agent_SO-$ELASTIC_AGENT_TARBALL_VERSION.md5"
|
||||||
|
ELASTIC_AGENT_EXPANSION_DIR=/nsm/elastic-fleet/artifacts/beats/elastic-agent
|
||||||
|
else
|
||||||
|
fail "Could not find salt/elasticsearch/defaults.yaml"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
get_random_value() {
|
||||||
|
length=${1:-20}
|
||||||
|
head -c 5000 /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w $length | head -n 1
|
||||||
|
}
|
||||||
|
|
||||||
gpg_rpm_import() {
|
gpg_rpm_import() {
|
||||||
if [[ $is_oracle ]]; then
|
if [[ $is_oracle ]]; then
|
||||||
if [[ "$WHATWOULDYOUSAYYAHDOHERE" == "setup" ]]; then
|
if [[ "$WHATWOULDYOUSAYYAHDOHERE" == "setup" ]]; then
|
||||||
@@ -323,7 +395,7 @@ is_manager_node() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
is_sensor_node() {
|
is_sensor_node() {
|
||||||
# Check to see if this is a sensor (forward) node
|
# Check to see if this is a sensor node
|
||||||
is_single_node_grid && return 0
|
is_single_node_grid && return 0
|
||||||
grep "role: so-" /etc/salt/grains | grep -E "sensor|heavynode" &> /dev/null
|
grep "role: so-" /etc/salt/grains | grep -E "sensor|heavynode" &> /dev/null
|
||||||
}
|
}
|
||||||
@@ -379,8 +451,7 @@ lookup_grain() {
|
|||||||
|
|
||||||
lookup_role() {
|
lookup_role() {
|
||||||
id=$(lookup_grain id)
|
id=$(lookup_grain id)
|
||||||
pieces=($(echo $id | tr '_' ' '))
|
echo "${id##*_}"
|
||||||
echo ${pieces[1]}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
is_feature_enabled() {
|
is_feature_enabled() {
|
||||||
@@ -627,6 +698,8 @@ has_uppercase() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
update_elastic_agent() {
|
update_elastic_agent() {
|
||||||
|
local path="${1:-/opt/so/saltstack/default}"
|
||||||
|
get_elastic_agent_vars "$path"
|
||||||
echo "Checking if Elastic Agent update is necessary..."
|
echo "Checking if Elastic Agent update is necessary..."
|
||||||
download_and_verify "$ELASTIC_AGENT_URL" "$ELASTIC_AGENT_MD5_URL" "$ELASTIC_AGENT_FILE" "$ELASTIC_AGENT_MD5" "$ELASTIC_AGENT_EXPANSION_DIR"
|
download_and_verify "$ELASTIC_AGENT_URL" "$ELASTIC_AGENT_MD5_URL" "$ELASTIC_AGENT_FILE" "$ELASTIC_AGENT_MD5" "$ELASTIC_AGENT_EXPANSION_DIR"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ def check_for_fps():
|
|||||||
result = subprocess.run([feat_full + '-mode-setup', '--is-enabled'], stdout=subprocess.PIPE)
|
result = subprocess.run([feat_full + '-mode-setup', '--is-enabled'], stdout=subprocess.PIPE)
|
||||||
if result.returncode == 0:
|
if result.returncode == 0:
|
||||||
fps = 1
|
fps = 1
|
||||||
except FileNotFoundError:
|
except:
|
||||||
fn = '/proc/sys/crypto/' + feat_full + '_enabled'
|
fn = '/proc/sys/crypto/' + feat_full + '_enabled'
|
||||||
try:
|
try:
|
||||||
with open(fn, 'r') as f:
|
with open(fn, 'r') as f:
|
||||||
|
|||||||
@@ -4,22 +4,16 @@
|
|||||||
# or more contributor license agreements. Licensed under the Elastic License 2.0 as shown at
|
# or more contributor license agreements. Licensed under the Elastic License 2.0 as shown at
|
||||||
# https://securityonion.net/license; you may not use this file except in compliance with the
|
# https://securityonion.net/license; you may not use this file except in compliance with the
|
||||||
# Elastic License 2.0.
|
# Elastic License 2.0.
|
||||||
|
import sys, argparse, re, subprocess, json
|
||||||
|
|
||||||
|
|
||||||
import sys, argparse, re, docker
|
|
||||||
from packaging.version import Version, InvalidVersion
|
from packaging.version import Version, InvalidVersion
|
||||||
from itertools import groupby, chain
|
from itertools import groupby, chain
|
||||||
|
|
||||||
|
|
||||||
def get_image_name(string) -> str:
|
def get_image_name(string) -> str:
|
||||||
return ':'.join(string.split(':')[:-1])
|
return ':'.join(string.split(':')[:-1])
|
||||||
|
|
||||||
|
|
||||||
def get_so_image_basename(string) -> str:
|
def get_so_image_basename(string) -> str:
|
||||||
return get_image_name(string).split('/so-')[-1]
|
return get_image_name(string).split('/so-')[-1]
|
||||||
|
|
||||||
|
|
||||||
def get_image_version(string) -> str:
|
def get_image_version(string) -> str:
|
||||||
ver = string.split(':')[-1]
|
ver = string.split(':')[-1]
|
||||||
if ver == 'latest':
|
if ver == 'latest':
|
||||||
@@ -35,56 +29,75 @@ def get_image_version(string) -> str:
|
|||||||
return '999999.9.9'
|
return '999999.9.9'
|
||||||
return ver
|
return ver
|
||||||
|
|
||||||
|
def run_command(command):
|
||||||
|
process = subprocess.run(command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True)
|
||||||
|
if process.returncode != 0:
|
||||||
|
print(f"Error executing command: {command}", file=sys.stderr)
|
||||||
|
print(f"Error message: {process.stderr}", file=sys.stderr)
|
||||||
|
exit(1)
|
||||||
|
return process.stdout
|
||||||
|
|
||||||
def main(quiet):
|
def main(quiet):
|
||||||
client = docker.from_env()
|
|
||||||
|
|
||||||
# Prune old/stopped containers
|
|
||||||
if not quiet: print('Pruning old containers')
|
|
||||||
client.containers.prune()
|
|
||||||
|
|
||||||
image_list = client.images.list(filters={ 'dangling': False })
|
|
||||||
|
|
||||||
# Map list of image objects to flattened list of tags (format: "name:version")
|
|
||||||
tag_list = list(chain.from_iterable(list(map(lambda x: x.attrs.get('RepoTags'), image_list))))
|
|
||||||
|
|
||||||
# Filter to only SO images (base name begins with "so-")
|
|
||||||
tag_list = list(filter(lambda x: re.match(r'^.*\/so-[^\/]*$', get_image_name(x)), tag_list))
|
|
||||||
|
|
||||||
# Group tags into lists by base name (sort by same projection first)
|
|
||||||
tag_list.sort(key=lambda x: get_so_image_basename(x))
|
|
||||||
grouped_tag_lists = [ list(it) for _, it in groupby(tag_list, lambda x: get_so_image_basename(x)) ]
|
|
||||||
|
|
||||||
no_prunable = True
|
|
||||||
for t_list in grouped_tag_lists:
|
|
||||||
try:
|
try:
|
||||||
# Group tags by version, in case multiple images exist with the same version string
|
# Prune old/stopped containers using docker CLI
|
||||||
t_list.sort(key=lambda x: Version(get_image_version(x)), reverse=True)
|
if not quiet: print('Pruning old containers')
|
||||||
grouped_t_list = [ list(it) for _,it in groupby(t_list, lambda x: get_image_version(x)) ]
|
run_command('docker container prune -f')
|
||||||
|
|
||||||
# Keep the 2 most current version groups
|
# Get list of images using docker CLI
|
||||||
if len(grouped_t_list) <= 2:
|
images_json = run_command('docker images --format "{{json .}}"')
|
||||||
continue
|
|
||||||
else:
|
# Parse the JSON output
|
||||||
no_prunable = False
|
image_list = []
|
||||||
for group in grouped_t_list[2:]:
|
for line in images_json.strip().split('\n'):
|
||||||
for tag in group:
|
if line: # Skip empty lines
|
||||||
if not quiet: print(f'Removing image {tag}')
|
image_list.append(json.loads(line))
|
||||||
|
|
||||||
|
# Extract tags in the format "name:version"
|
||||||
|
tag_list = []
|
||||||
|
for img in image_list:
|
||||||
|
# Skip dangling images
|
||||||
|
if img.get('Repository') != "<none>" and img.get('Tag') != "<none>":
|
||||||
|
tag = f"{img.get('Repository')}:{img.get('Tag')}"
|
||||||
|
# Filter to only SO images (base name begins with "so-")
|
||||||
|
if re.match(r'^.*\/so-[^\/]*$', get_image_name(tag)):
|
||||||
|
tag_list.append(tag)
|
||||||
|
|
||||||
|
# Group tags into lists by base name (sort by same projection first)
|
||||||
|
tag_list.sort(key=lambda x: get_so_image_basename(x))
|
||||||
|
grouped_tag_lists = [list(it) for k, it in groupby(tag_list, lambda x: get_so_image_basename(x))]
|
||||||
|
|
||||||
|
no_prunable = True
|
||||||
|
for t_list in grouped_tag_lists:
|
||||||
try:
|
try:
|
||||||
client.images.remove(tag, force=True)
|
# Group tags by version, in case multiple images exist with the same version string
|
||||||
except docker.errors.ClientError as e:
|
t_list.sort(key=lambda x: Version(get_image_version(x)), reverse=True)
|
||||||
print(f'Could not remove image {tag}, continuing...')
|
grouped_t_list = [list(it) for k, it in groupby(t_list, lambda x: get_image_version(x))]
|
||||||
except (docker.errors.APIError, InvalidVersion) as e:
|
# Keep the 2 most current version groups
|
||||||
print(f'so-{get_so_image_basename(t_list[0])}: {e}', file=sys.stderr)
|
if len(grouped_t_list) <= 2:
|
||||||
exit(1)
|
continue
|
||||||
|
else:
|
||||||
|
no_prunable = False
|
||||||
|
for group in grouped_t_list[2:]:
|
||||||
|
for tag in group:
|
||||||
|
if not quiet: print(f'Removing image {tag}')
|
||||||
|
try:
|
||||||
|
run_command(f'docker rmi -f {tag}')
|
||||||
|
except Exception as e:
|
||||||
|
print(f'Could not remove image {tag}, continuing...')
|
||||||
|
except (InvalidVersion) as e:
|
||||||
|
print(f'so-{get_so_image_basename(t_list[0])}: {e}', file=sys.stderr)
|
||||||
|
exit(1)
|
||||||
|
except Exception as e:
|
||||||
|
print('Unhandled exception occurred:')
|
||||||
|
print(f'so-{get_so_image_basename(t_list[0])}: {e}', file=sys.stderr)
|
||||||
|
exit(1)
|
||||||
|
|
||||||
|
if no_prunable and not quiet:
|
||||||
|
print('No Security Onion images to prune')
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print('Unhandled exception occurred:')
|
print(f"Error: {e}", file=sys.stderr)
|
||||||
print(f'so-{get_so_image_basename(t_list[0])}: {e}', file=sys.stderr)
|
exit(1)
|
||||||
exit(1)
|
|
||||||
|
|
||||||
if no_prunable and not quiet:
|
|
||||||
print('No Security Onion images to prune')
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
main_parser = argparse.ArgumentParser(add_help=False)
|
main_parser = argparse.ArgumentParser(add_help=False)
|
||||||
|
|||||||
@@ -25,10 +25,10 @@ container_list() {
|
|||||||
if [ $MANAGERCHECK == 'so-import' ]; then
|
if [ $MANAGERCHECK == 'so-import' ]; then
|
||||||
TRUSTED_CONTAINERS=(
|
TRUSTED_CONTAINERS=(
|
||||||
"so-elasticsearch"
|
"so-elasticsearch"
|
||||||
"so-idstools"
|
|
||||||
"so-influxdb"
|
"so-influxdb"
|
||||||
"so-kibana"
|
"so-kibana"
|
||||||
"so-kratos"
|
"so-kratos"
|
||||||
|
"so-hydra"
|
||||||
"so-nginx"
|
"so-nginx"
|
||||||
"so-pcaptools"
|
"so-pcaptools"
|
||||||
"so-soc"
|
"so-soc"
|
||||||
@@ -48,11 +48,11 @@ container_list() {
|
|||||||
"so-elastic-fleet-package-registry"
|
"so-elastic-fleet-package-registry"
|
||||||
"so-elasticsearch"
|
"so-elasticsearch"
|
||||||
"so-idh"
|
"so-idh"
|
||||||
"so-idstools"
|
|
||||||
"so-influxdb"
|
"so-influxdb"
|
||||||
"so-kafka"
|
"so-kafka"
|
||||||
"so-kibana"
|
"so-kibana"
|
||||||
"so-kratos"
|
"so-kratos"
|
||||||
|
"so-hydra"
|
||||||
"so-logstash"
|
"so-logstash"
|
||||||
"so-nginx"
|
"so-nginx"
|
||||||
"so-pcaptools"
|
"so-pcaptools"
|
||||||
@@ -60,8 +60,6 @@ container_list() {
|
|||||||
"so-soc"
|
"so-soc"
|
||||||
"so-steno"
|
"so-steno"
|
||||||
"so-strelka-backend"
|
"so-strelka-backend"
|
||||||
"so-strelka-filestream"
|
|
||||||
"so-strelka-frontend"
|
|
||||||
"so-strelka-manager"
|
"so-strelka-manager"
|
||||||
"so-suricata"
|
"so-suricata"
|
||||||
"so-telegraf"
|
"so-telegraf"
|
||||||
@@ -69,7 +67,6 @@ container_list() {
|
|||||||
)
|
)
|
||||||
else
|
else
|
||||||
TRUSTED_CONTAINERS=(
|
TRUSTED_CONTAINERS=(
|
||||||
"so-idstools"
|
|
||||||
"so-elasticsearch"
|
"so-elasticsearch"
|
||||||
"so-logstash"
|
"so-logstash"
|
||||||
"so-nginx"
|
"so-nginx"
|
||||||
@@ -112,6 +109,10 @@ update_docker_containers() {
|
|||||||
container_list
|
container_list
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# all the images using ELASTICSEARCHDEFAULTS.elasticsearch.version
|
||||||
|
# does not include so-elastic-fleet since that container uses so-elastic-agent image
|
||||||
|
local IMAGES_USING_ES_VERSION=("so-elasticsearch")
|
||||||
|
|
||||||
rm -rf $SIGNPATH >> "$LOG_FILE" 2>&1
|
rm -rf $SIGNPATH >> "$LOG_FILE" 2>&1
|
||||||
mkdir -p $SIGNPATH >> "$LOG_FILE" 2>&1
|
mkdir -p $SIGNPATH >> "$LOG_FILE" 2>&1
|
||||||
|
|
||||||
@@ -139,15 +140,36 @@ update_docker_containers() {
|
|||||||
$PROGRESS_CALLBACK $i
|
$PROGRESS_CALLBACK $i
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [[ " ${IMAGES_USING_ES_VERSION[*]} " =~ [[:space:]]${i}[[:space:]] ]]; then
|
||||||
|
# this is an es container so use version defined in elasticsearch defaults.yaml
|
||||||
|
local UPDATE_DIR='/tmp/sogh/securityonion'
|
||||||
|
if [ ! -d "$UPDATE_DIR" ]; then
|
||||||
|
UPDATE_DIR=/securityonion
|
||||||
|
fi
|
||||||
|
local v1=0
|
||||||
|
local v2=0
|
||||||
|
if [[ -f "$UPDATE_DIR/salt/elasticsearch/defaults.yaml" ]]; then
|
||||||
|
v1=$(egrep " +version: " "$UPDATE_DIR/salt/elasticsearch/defaults.yaml" | awk -F: '{print $2}' | tr -d '[:space:]')
|
||||||
|
fi
|
||||||
|
if [[ -f "$DEFAULT_SALT_DIR/salt/elasticsearch/defaults.yaml" ]]; then
|
||||||
|
v2=$(egrep " +version: " "$DEFAULT_SALT_DIR/salt/elasticsearch/defaults.yaml" | awk -F: '{print $2}' | tr -d '[:space:]')
|
||||||
|
fi
|
||||||
|
local highest_es_version=$(compare_es_versions "$v1" "$v2")
|
||||||
|
local image=$i:$highest_es_version$IMAGE_TAG_SUFFIX
|
||||||
|
local sig_url=https://sigs.securityonion.net/es-$highest_es_version/$image.sig
|
||||||
|
else
|
||||||
|
# this is not an es container so use the so version for the version
|
||||||
|
local image=$i:$VERSION$IMAGE_TAG_SUFFIX
|
||||||
|
local sig_url=https://sigs.securityonion.net/$VERSION/$image.sig
|
||||||
|
fi
|
||||||
# Pull down the trusted docker image
|
# Pull down the trusted docker image
|
||||||
local image=$i:$VERSION$IMAGE_TAG_SUFFIX
|
|
||||||
run_check_net_err \
|
run_check_net_err \
|
||||||
"docker pull $CONTAINER_REGISTRY/$IMAGEREPO/$image" \
|
"docker pull $CONTAINER_REGISTRY/$IMAGEREPO/$image" \
|
||||||
"Could not pull $image, please ensure connectivity to $CONTAINER_REGISTRY" >> "$LOG_FILE" 2>&1
|
"Could not pull $image, please ensure connectivity to $CONTAINER_REGISTRY" >> "$LOG_FILE" 2>&1
|
||||||
|
|
||||||
# Get signature
|
# Get signature
|
||||||
run_check_net_err \
|
run_check_net_err \
|
||||||
"curl --retry 5 --retry-delay 60 -A '$CURLTYPE/$CURRENTVERSION/$OS/$(uname -r)' https://sigs.securityonion.net/$VERSION/$i:$VERSION$IMAGE_TAG_SUFFIX.sig --output $SIGNPATH/$image.sig" \
|
"curl --retry 5 --retry-delay 60 -A '$CURLTYPE/$CURRENTVERSION/$OS/$(uname -r)' $sig_url --output $SIGNPATH/$image.sig" \
|
||||||
"Could not pull signature file for $image, please ensure connectivity to https://sigs.securityonion.net " \
|
"Could not pull signature file for $image, please ensure connectivity to https://sigs.securityonion.net " \
|
||||||
noretry >> "$LOG_FILE" 2>&1
|
noretry >> "$LOG_FILE" 2>&1
|
||||||
# Dump our hash values
|
# Dump our hash values
|
||||||
|
|||||||
@@ -95,6 +95,8 @@ if [[ $EXCLUDE_STARTUP_ERRORS == 'Y' ]]; then
|
|||||||
EXCLUDED_ERRORS="$EXCLUDED_ERRORS|shutdown process" # server not yet ready (logstash waiting on elastic)
|
EXCLUDED_ERRORS="$EXCLUDED_ERRORS|shutdown process" # server not yet ready (logstash waiting on elastic)
|
||||||
EXCLUDED_ERRORS="$EXCLUDED_ERRORS|contain valid certificates" # server not yet ready (logstash waiting on elastic)
|
EXCLUDED_ERRORS="$EXCLUDED_ERRORS|contain valid certificates" # server not yet ready (logstash waiting on elastic)
|
||||||
EXCLUDED_ERRORS="$EXCLUDED_ERRORS|failedaction" # server not yet ready (logstash waiting on elastic)
|
EXCLUDED_ERRORS="$EXCLUDED_ERRORS|failedaction" # server not yet ready (logstash waiting on elastic)
|
||||||
|
EXCLUDED_ERRORS="$EXCLUDED_ERRORS|block in start_workers" # server not yet ready (logstash waiting on elastic)
|
||||||
|
EXCLUDED_ERRORS="$EXCLUDED_ERRORS|block in buffer_initialize" # server not yet ready (logstash waiting on elastic)
|
||||||
EXCLUDED_ERRORS="$EXCLUDED_ERRORS|no route to host" # server not yet ready
|
EXCLUDED_ERRORS="$EXCLUDED_ERRORS|no route to host" # server not yet ready
|
||||||
EXCLUDED_ERRORS="$EXCLUDED_ERRORS|not running" # server not yet ready
|
EXCLUDED_ERRORS="$EXCLUDED_ERRORS|not running" # server not yet ready
|
||||||
EXCLUDED_ERRORS="$EXCLUDED_ERRORS|unavailable" # server not yet ready
|
EXCLUDED_ERRORS="$EXCLUDED_ERRORS|unavailable" # server not yet ready
|
||||||
@@ -123,6 +125,10 @@ if [[ $EXCLUDE_STARTUP_ERRORS == 'Y' ]]; then
|
|||||||
EXCLUDED_ERRORS="$EXCLUDED_ERRORS|tls handshake error" # Docker registry container when new node comes onlines
|
EXCLUDED_ERRORS="$EXCLUDED_ERRORS|tls handshake error" # Docker registry container when new node comes onlines
|
||||||
EXCLUDED_ERRORS="$EXCLUDED_ERRORS|Unable to get license information" # Logstash trying to contact ES before it's ready
|
EXCLUDED_ERRORS="$EXCLUDED_ERRORS|Unable to get license information" # Logstash trying to contact ES before it's ready
|
||||||
EXCLUDED_ERRORS="$EXCLUDED_ERRORS|process already finished" # Telegraf script finished just as the auto kill timeout kicked in
|
EXCLUDED_ERRORS="$EXCLUDED_ERRORS|process already finished" # Telegraf script finished just as the auto kill timeout kicked in
|
||||||
|
EXCLUDED_ERRORS="$EXCLUDED_ERRORS|No shard available" # Typical error when making a query before ES has finished loading all indices
|
||||||
|
EXCLUDED_ERRORS="$EXCLUDED_ERRORS|responded with status-code 503" # telegraf getting 503 from ES during startup
|
||||||
|
EXCLUDED_ERRORS="$EXCLUDED_ERRORS|process_cluster_event_timeout_exception" # logstash waiting for elasticsearch to start
|
||||||
|
EXCLUDED_ERRORS="$EXCLUDED_ERRORS|not configured for GeoIP" # SO does not bundle the maxminddb with Zeek
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ $EXCLUDE_FALSE_POSITIVE_ERRORS == 'Y' ]]; then
|
if [[ $EXCLUDE_FALSE_POSITIVE_ERRORS == 'Y' ]]; then
|
||||||
@@ -147,6 +153,13 @@ if [[ $EXCLUDE_FALSE_POSITIVE_ERRORS == 'Y' ]]; then
|
|||||||
EXCLUDED_ERRORS="$EXCLUDED_ERRORS|status 200" # false positive (request successful, contained error string in content)
|
EXCLUDED_ERRORS="$EXCLUDED_ERRORS|status 200" # false positive (request successful, contained error string in content)
|
||||||
EXCLUDED_ERRORS="$EXCLUDED_ERRORS|app_layer.error" # false positive (suricata 7) in stats.log e.g. app_layer.error.imap.parser | Total | 0
|
EXCLUDED_ERRORS="$EXCLUDED_ERRORS|app_layer.error" # false positive (suricata 7) in stats.log e.g. app_layer.error.imap.parser | Total | 0
|
||||||
EXCLUDED_ERRORS="$EXCLUDED_ERRORS|is not an ip string literal" # false positive (Open Canary logging out blank IP addresses)
|
EXCLUDED_ERRORS="$EXCLUDED_ERRORS|is not an ip string literal" # false positive (Open Canary logging out blank IP addresses)
|
||||||
|
EXCLUDED_ERRORS="$EXCLUDED_ERRORS|syncing rule" # false positive (rule sync log line includes rule name which can contain 'error')
|
||||||
|
EXCLUDED_ERRORS="$EXCLUDED_ERRORS|request_unauthorized" # false positive (login failures to Hydra result in an 'error' log)
|
||||||
|
EXCLUDED_ERRORS="$EXCLUDED_ERRORS|adding index lifecycle policy" # false positive (elasticsearch policy names contain 'error')
|
||||||
|
EXCLUDED_ERRORS="$EXCLUDED_ERRORS|adding ingest pipeline" # false positive (elasticsearch ingest pipeline names contain 'error')
|
||||||
|
EXCLUDED_ERRORS="$EXCLUDED_ERRORS|updating index template" # false positive (elasticsearch index or template names contain 'error')
|
||||||
|
EXCLUDED_ERRORS="$EXCLUDED_ERRORS|updating component template" # false positive (elasticsearch index or template names contain 'error')
|
||||||
|
EXCLUDED_ERRORS="$EXCLUDED_ERRORS|upgrading composable template" # false positive (elasticsearch composable template names contain 'error')
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ $EXCLUDE_KNOWN_ERRORS == 'Y' ]]; then
|
if [[ $EXCLUDE_KNOWN_ERRORS == 'Y' ]]; then
|
||||||
@@ -170,6 +183,7 @@ if [[ $EXCLUDE_KNOWN_ERRORS == 'Y' ]]; then
|
|||||||
EXCLUDED_ERRORS="$EXCLUDED_ERRORS|cannot join on an empty table" # InfluxDB flux query, import nodes
|
EXCLUDED_ERRORS="$EXCLUDED_ERRORS|cannot join on an empty table" # InfluxDB flux query, import nodes
|
||||||
EXCLUDED_ERRORS="$EXCLUDED_ERRORS|exhausting result iterator" # InfluxDB flux query mismatched table results (temporary data issue)
|
EXCLUDED_ERRORS="$EXCLUDED_ERRORS|exhausting result iterator" # InfluxDB flux query mismatched table results (temporary data issue)
|
||||||
EXCLUDED_ERRORS="$EXCLUDED_ERRORS|failed to finish run" # InfluxDB rare error, self-recoverable
|
EXCLUDED_ERRORS="$EXCLUDED_ERRORS|failed to finish run" # InfluxDB rare error, self-recoverable
|
||||||
|
EXCLUDED_ERRORS="$EXCLUDED_ERRORS|Unable to gather disk name" # InfluxDB known error, can't read disks because the container doesn't have them mounted
|
||||||
EXCLUDED_ERRORS="$EXCLUDED_ERRORS|iteration"
|
EXCLUDED_ERRORS="$EXCLUDED_ERRORS|iteration"
|
||||||
EXCLUDED_ERRORS="$EXCLUDED_ERRORS|communication packets"
|
EXCLUDED_ERRORS="$EXCLUDED_ERRORS|communication packets"
|
||||||
EXCLUDED_ERRORS="$EXCLUDED_ERRORS|use of closed"
|
EXCLUDED_ERRORS="$EXCLUDED_ERRORS|use of closed"
|
||||||
@@ -205,6 +219,10 @@ if [[ $EXCLUDE_KNOWN_ERRORS == 'Y' ]]; then
|
|||||||
EXCLUDED_ERRORS="$EXCLUDED_ERRORS|detect-parse" # Suricata encountering a malformed rule
|
EXCLUDED_ERRORS="$EXCLUDED_ERRORS|detect-parse" # Suricata encountering a malformed rule
|
||||||
EXCLUDED_ERRORS="$EXCLUDED_ERRORS|integrity check failed" # Detections: Exclude false positive due to automated testing
|
EXCLUDED_ERRORS="$EXCLUDED_ERRORS|integrity check failed" # Detections: Exclude false positive due to automated testing
|
||||||
EXCLUDED_ERRORS="$EXCLUDED_ERRORS|syncErrors" # Detections: Not an actual error
|
EXCLUDED_ERRORS="$EXCLUDED_ERRORS|syncErrors" # Detections: Not an actual error
|
||||||
|
EXCLUDED_ERRORS="$EXCLUDED_ERRORS|Initialized license manager" # SOC log: before fields.status was changed to fields.licenseStatus
|
||||||
|
EXCLUDED_ERRORS="$EXCLUDED_ERRORS|from NIC checksum offloading" # zeek reporter.log
|
||||||
|
EXCLUDED_ERRORS="$EXCLUDED_ERRORS|marked for removal" # docker container getting recycled
|
||||||
|
EXCLUDED_ERRORS="$EXCLUDED_ERRORS|tcp 127.0.0.1:6791: bind: address already in use" # so-elastic-fleet agent restarting. Seen starting w/ 8.18.8 https://github.com/elastic/kibana/issues/201459
|
||||||
fi
|
fi
|
||||||
|
|
||||||
RESULT=0
|
RESULT=0
|
||||||
@@ -243,11 +261,21 @@ exclude_log "agentstatus.log" # ignore this log since it tracks agents in error
|
|||||||
exclude_log "detections_runtime-status_yara.log" # temporarily ignore this log until Detections is more stable
|
exclude_log "detections_runtime-status_yara.log" # temporarily ignore this log until Detections is more stable
|
||||||
exclude_log "/nsm/kafka/data/" # ignore Kafka data directory from log check.
|
exclude_log "/nsm/kafka/data/" # ignore Kafka data directory from log check.
|
||||||
|
|
||||||
|
# Include Zeek reporter.log to detect errors after running known good pcap(s) through sensor
|
||||||
|
echo "/nsm/zeek/spool/logger/reporter.log" >> /tmp/log_check_files
|
||||||
|
|
||||||
for log_file in $(cat /tmp/log_check_files); do
|
for log_file in $(cat /tmp/log_check_files); do
|
||||||
status "Checking log file $log_file"
|
status "Checking log file $log_file"
|
||||||
tail -n $RECENT_LOG_LINES $log_file > /tmp/log_check
|
tail -n $RECENT_LOG_LINES $log_file > /tmp/log_check
|
||||||
check_for_errors
|
check_for_errors
|
||||||
done
|
done
|
||||||
|
# Look for OOM specific errors in /var/log/messages which can lead to odd behavior / test failures
|
||||||
|
if [[ -f /var/log/messages ]]; then
|
||||||
|
status "Checking log file /var/log/messages"
|
||||||
|
if journalctl --since "24 hours ago" | grep -iE 'out of memory|oom-kill'; then
|
||||||
|
RESULT=1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
# Cleanup temp files
|
# Cleanup temp files
|
||||||
rm -f /tmp/log_check_files
|
rm -f /tmp/log_check_files
|
||||||
|
|||||||
53
salt/common/tools/sbin/so_logging_utils.py
Normal file
53
salt/common/tools/sbin/so_logging_utils.py
Normal file
@@ -0,0 +1,53 @@
|
|||||||
|
#!/usr/bin/python3
|
||||||
|
|
||||||
|
# Copyright Security Onion Solutions LLC and/or licensed to Security Onion Solutions LLC under one
|
||||||
|
# or more contributor license agreements. Licensed under the Elastic License 2.0 as shown at
|
||||||
|
# https://securityonion.net/license; you may not use this file except in compliance with the
|
||||||
|
# Elastic License 2.0.
|
||||||
|
|
||||||
|
import logging
|
||||||
|
import os
|
||||||
|
import sys
|
||||||
|
|
||||||
|
def setup_logging(logger_name, log_file_path, log_level=logging.INFO, format_str='%(asctime)s - %(levelname)s - %(message)s'):
|
||||||
|
"""
|
||||||
|
Sets up logging for a script.
|
||||||
|
|
||||||
|
Parameters:
|
||||||
|
logger_name (str): The name of the logger.
|
||||||
|
log_file_path (str): The file path for the log file.
|
||||||
|
log_level (int): The logging level (e.g., logging.INFO, logging.DEBUG).
|
||||||
|
format_str (str): The format string for log messages.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
logging.Logger: Configured logger object.
|
||||||
|
"""
|
||||||
|
logger = logging.getLogger(logger_name)
|
||||||
|
logger.setLevel(log_level)
|
||||||
|
|
||||||
|
# Create directory for log file if it doesn't exist
|
||||||
|
log_file_dir = os.path.dirname(log_file_path)
|
||||||
|
if log_file_dir and not os.path.exists(log_file_dir):
|
||||||
|
try:
|
||||||
|
os.makedirs(log_file_dir)
|
||||||
|
except OSError as e:
|
||||||
|
print(f"Error creating directory {log_file_dir}: {e}")
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
|
# Create handlers
|
||||||
|
c_handler = logging.StreamHandler()
|
||||||
|
f_handler = logging.FileHandler(log_file_path)
|
||||||
|
c_handler.setLevel(log_level)
|
||||||
|
f_handler.setLevel(log_level)
|
||||||
|
|
||||||
|
# Create formatter and add it to handlers
|
||||||
|
formatter = logging.Formatter(format_str)
|
||||||
|
c_handler.setFormatter(formatter)
|
||||||
|
f_handler.setFormatter(formatter)
|
||||||
|
|
||||||
|
# Add handlers to the logger if they are not already added
|
||||||
|
if not logger.hasHandlers():
|
||||||
|
logger.addHandler(c_handler)
|
||||||
|
logger.addHandler(f_handler)
|
||||||
|
|
||||||
|
return logger
|
||||||
@@ -63,7 +63,7 @@ function status {
|
|||||||
function pcapinfo() {
|
function pcapinfo() {
|
||||||
PCAP=$1
|
PCAP=$1
|
||||||
ARGS=$2
|
ARGS=$2
|
||||||
docker run --rm -v "$PCAP:/input.pcap" --entrypoint capinfos {{ MANAGER }}:5000/{{ IMAGEREPO }}/so-pcaptools:{{ VERSION }} /input.pcap $ARGS
|
docker run --rm -v "$PCAP:/input.pcap" --entrypoint capinfos {{ MANAGER }}:5000/{{ IMAGEREPO }}/so-pcaptools:{{ VERSION }} /input.pcap -ae $ARGS
|
||||||
}
|
}
|
||||||
|
|
||||||
function pcapfix() {
|
function pcapfix() {
|
||||||
@@ -85,7 +85,7 @@ function suricata() {
|
|||||||
docker run --rm \
|
docker run --rm \
|
||||||
-v /opt/so/conf/suricata/suricata.yaml:/etc/suricata/suricata.yaml:ro \
|
-v /opt/so/conf/suricata/suricata.yaml:/etc/suricata/suricata.yaml:ro \
|
||||||
-v /opt/so/conf/suricata/threshold.conf:/etc/suricata/threshold.conf:ro \
|
-v /opt/so/conf/suricata/threshold.conf:/etc/suricata/threshold.conf:ro \
|
||||||
-v /opt/so/conf/suricata/rules:/etc/suricata/rules:ro \
|
-v /opt/so/rules/suricata/:/etc/suricata/rules:ro \
|
||||||
-v ${LOG_PATH}:/var/log/suricata/:rw \
|
-v ${LOG_PATH}:/var/log/suricata/:rw \
|
||||||
-v ${NSM_PATH}/:/nsm/:rw \
|
-v ${NSM_PATH}/:/nsm/:rw \
|
||||||
-v "$PCAP:/input.pcap:ro" \
|
-v "$PCAP:/input.pcap:ro" \
|
||||||
@@ -173,7 +173,7 @@ for PCAP in $INPUT_FILES; do
|
|||||||
status "- assigning unique identifier to import: $HASH"
|
status "- assigning unique identifier to import: $HASH"
|
||||||
|
|
||||||
pcap_data=$(pcapinfo "${PCAP}")
|
pcap_data=$(pcapinfo "${PCAP}")
|
||||||
if ! echo "$pcap_data" | grep -q "First packet time:" || echo "$pcap_data" |egrep -q "Last packet time: 1970-01-01|Last packet time: n/a"; then
|
if ! echo "$pcap_data" | grep -q "Earliest packet time:" || echo "$pcap_data" |egrep -q "Latest packet time: 1970-01-01|Latest packet time: n/a"; then
|
||||||
status "- this PCAP file is invalid; skipping"
|
status "- this PCAP file is invalid; skipping"
|
||||||
INVALID_PCAPS_COUNT=$((INVALID_PCAPS_COUNT + 1))
|
INVALID_PCAPS_COUNT=$((INVALID_PCAPS_COUNT + 1))
|
||||||
else
|
else
|
||||||
@@ -205,8 +205,8 @@ for PCAP in $INPUT_FILES; do
|
|||||||
HASHES="${HASHES} ${HASH}"
|
HASHES="${HASHES} ${HASH}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
START=$(pcapinfo "${PCAP}" -a |grep "First packet time:" | awk '{print $4}')
|
START=$(pcapinfo "${PCAP}" -a |grep "Earliest packet time:" | awk '{print $4}')
|
||||||
END=$(pcapinfo "${PCAP}" -e |grep "Last packet time:" | awk '{print $4}')
|
END=$(pcapinfo "${PCAP}" -e |grep "Latest packet time:" | awk '{print $4}')
|
||||||
status "- found PCAP data spanning dates $START through $END"
|
status "- found PCAP data spanning dates $START through $END"
|
||||||
|
|
||||||
# compare $START to $START_OLDEST
|
# compare $START to $START_OLDEST
|
||||||
@@ -248,7 +248,7 @@ fi
|
|||||||
START_OLDEST_SLASH=$(echo $START_OLDEST | sed -e 's/-/%2F/g')
|
START_OLDEST_SLASH=$(echo $START_OLDEST | sed -e 's/-/%2F/g')
|
||||||
END_NEWEST_SLASH=$(echo $END_NEWEST | sed -e 's/-/%2F/g')
|
END_NEWEST_SLASH=$(echo $END_NEWEST | sed -e 's/-/%2F/g')
|
||||||
if [[ $VALID_PCAPS_COUNT -gt 0 ]] || [[ $SKIPPED_PCAPS_COUNT -gt 0 ]]; then
|
if [[ $VALID_PCAPS_COUNT -gt 0 ]] || [[ $SKIPPED_PCAPS_COUNT -gt 0 ]]; then
|
||||||
URL="https://{{ URLBASE }}/#/dashboards?q=$HASH_FILTERS%20%7C%20groupby%20event.module*%20%7C%20groupby%20-sankey%20event.module*%20event.dataset%20%7C%20groupby%20event.dataset%20%7C%20groupby%20source.ip%20%7C%20groupby%20destination.ip%20%7C%20groupby%20destination.port%20%7C%20groupby%20network.protocol%20%7C%20groupby%20rule.name%20rule.category%20event.severity_label%20%7C%20groupby%20dns.query.name%20%7C%20groupby%20file.mime_type%20%7C%20groupby%20http.virtual_host%20http.uri%20%7C%20groupby%20notice.note%20notice.message%20notice.sub_message%20%7C%20groupby%20ssl.server_name%20%7C%20groupby%20source_geo.organization_name%20source.geo.country_name%20%7C%20groupby%20destination_geo.organization_name%20destination.geo.country_name&t=${START_OLDEST_SLASH}%2000%3A00%3A00%20AM%20-%20${END_NEWEST_SLASH}%2000%3A00%3A00%20AM&z=UTC"
|
URL="https://{{ URLBASE }}/#/dashboards?q=$HASH_FILTERS%20%7C%20groupby%20event.module*%20%7C%20groupby%20-sankey%20event.module*%20event.dataset%20%7C%20groupby%20event.dataset%20%7C%20groupby%20source.ip%20%7C%20groupby%20destination.ip%20%7C%20groupby%20destination.port%20%7C%20groupby%20network.protocol%20%7C%20groupby%20rule.name%20rule.category%20event.severity_label%20%7C%20groupby%20dns.query.name%20%7C%20groupby%20file.mime_type%20%7C%20groupby%20http.virtual_host%20http.uri%20%7C%20groupby%20notice.note%20notice.message%20notice.sub_message%20%7C%20groupby%20ssl.server_name%20%7C%20groupby%20source.as.organization.name%20source.geo.country_name%20%7C%20groupby%20destination.as.organization.name%20destination.geo.country_name&t=${START_OLDEST_SLASH}%2000%3A00%3A00%20AM%20-%20${END_NEWEST_SLASH}%2000%3A00%3A00%20AM&z=UTC"
|
||||||
|
|
||||||
status "Import complete!"
|
status "Import complete!"
|
||||||
status
|
status
|
||||||
|
|||||||
@@ -9,6 +9,9 @@
|
|||||||
|
|
||||||
. /usr/sbin/so-common
|
. /usr/sbin/so-common
|
||||||
|
|
||||||
|
software_raid=("SOSMN" "SOSMN-DE02" "SOSSNNV" "SOSSNNV-DE02" "SOS10k-DE02" "SOS10KNV" "SOS10KNV-DE02" "SOS10KNV-DE02" "SOS2000-DE02" "SOS-GOFAST-LT-DE02" "SOS-GOFAST-MD-DE02" "SOS-GOFAST-HV-DE02")
|
||||||
|
hardware_raid=("SOS1000" "SOS1000F" "SOSSN7200" "SOS5000" "SOS4000")
|
||||||
|
|
||||||
{%- if salt['grains.get']('sosmodel', '') %}
|
{%- if salt['grains.get']('sosmodel', '') %}
|
||||||
{%- set model = salt['grains.get']('sosmodel') %}
|
{%- set model = salt['grains.get']('sosmodel') %}
|
||||||
model={{ model }}
|
model={{ model }}
|
||||||
@@ -16,25 +19,35 @@ model={{ model }}
|
|||||||
if [[ $model =~ ^(SO2AMI01|SO2AZI01|SO2GCI01)$ ]]; then
|
if [[ $model =~ ^(SO2AMI01|SO2AZI01|SO2GCI01)$ ]]; then
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
for i in "${software_raid[@]}"; do
|
||||||
|
if [[ "$model" == $i ]]; then
|
||||||
|
is_softwareraid=true
|
||||||
|
is_hwraid=false
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
for i in "${hardware_raid[@]}"; do
|
||||||
|
if [[ "$model" == $i ]]; then
|
||||||
|
is_softwareraid=false
|
||||||
|
is_hwraid=true
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
{%- else %}
|
{%- else %}
|
||||||
echo "This is not an appliance"
|
echo "This is not an appliance"
|
||||||
exit 0
|
exit 0
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
if [[ $model =~ ^(SOS10K|SOS500|SOS1000|SOS1000F|SOS4000|SOSSN7200|SOSSNNV|SOSMN)$ ]]; then
|
|
||||||
is_bossraid=true
|
|
||||||
fi
|
|
||||||
if [[ $model =~ ^(SOSSNNV|SOSMN)$ ]]; then
|
|
||||||
is_swraid=true
|
|
||||||
fi
|
|
||||||
if [[ $model =~ ^(SOS10K|SOS500|SOS1000|SOS1000F|SOS4000|SOSSN7200)$ ]]; then
|
|
||||||
is_hwraid=true
|
|
||||||
fi
|
|
||||||
|
|
||||||
check_nsm_raid() {
|
check_nsm_raid() {
|
||||||
PERCCLI=$(/opt/raidtools/perccli/perccli64 /c0/v0 show|grep RAID|grep Optl)
|
PERCCLI=$(/opt/raidtools/perccli/perccli64 /c0/v0 show|grep RAID|grep Optl)
|
||||||
MEGACTL=$(/opt/raidtools/megasasctl |grep optimal)
|
MEGACTL=$(/opt/raidtools/megasasctl |grep optimal)
|
||||||
|
if [[ "$model" == "SOS500" || "$model" == "SOS500-DE02" ]]; then
|
||||||
if [[ $APPLIANCE == '1' ]]; then
|
#This doesn't have raid
|
||||||
|
HWRAID=0
|
||||||
|
else
|
||||||
if [[ -n $PERCCLI ]]; then
|
if [[ -n $PERCCLI ]]; then
|
||||||
HWRAID=0
|
HWRAID=0
|
||||||
elif [[ -n $MEGACTL ]]; then
|
elif [[ -n $MEGACTL ]]; then
|
||||||
@@ -42,7 +55,6 @@ check_nsm_raid() {
|
|||||||
else
|
else
|
||||||
HWRAID=1
|
HWRAID=1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -50,17 +62,27 @@ check_nsm_raid() {
|
|||||||
check_boss_raid() {
|
check_boss_raid() {
|
||||||
MVCLI=$(/usr/local/bin/mvcli info -o vd |grep status |grep functional)
|
MVCLI=$(/usr/local/bin/mvcli info -o vd |grep status |grep functional)
|
||||||
MVTEST=$(/usr/local/bin/mvcli info -o vd | grep "No adapter")
|
MVTEST=$(/usr/local/bin/mvcli info -o vd | grep "No adapter")
|
||||||
|
BOSSNVMECLI=$(/usr/local/bin/mnv_cli info -o vd -i 0 | grep Functional)
|
||||||
|
|
||||||
# Check to see if this is a SM based system
|
# Is this NVMe Boss Raid?
|
||||||
if [[ -z $MVTEST ]]; then
|
if [[ "$model" =~ "-DE02" ]]; then
|
||||||
if [[ -n $MVCLI ]]; then
|
if [[ -n $BOSSNVMECLI ]]; then
|
||||||
BOSSRAID=0
|
BOSSRAID=0
|
||||||
else
|
else
|
||||||
BOSSRAID=1
|
BOSSRAID=1
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
# This doesn't have boss raid so lets make it 0
|
# Check to see if this is a SM based system
|
||||||
BOSSRAID=0
|
if [[ -z $MVTEST ]]; then
|
||||||
|
if [[ -n $MVCLI ]]; then
|
||||||
|
BOSSRAID=0
|
||||||
|
else
|
||||||
|
BOSSRAID=1
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
# This doesn't have boss raid so lets make it 0
|
||||||
|
BOSSRAID=0
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -79,14 +101,13 @@ SWRAID=0
|
|||||||
BOSSRAID=0
|
BOSSRAID=0
|
||||||
HWRAID=0
|
HWRAID=0
|
||||||
|
|
||||||
if [[ $is_hwraid ]]; then
|
if [[ "$is_hwraid" == "true" ]]; then
|
||||||
check_nsm_raid
|
check_nsm_raid
|
||||||
|
check_boss_raid
|
||||||
fi
|
fi
|
||||||
if [[ $is_bossraid ]]; then
|
if [[ "$is_softwareraid" == "true" ]]; then
|
||||||
check_boss_raid
|
|
||||||
fi
|
|
||||||
if [[ $is_swraid ]]; then
|
|
||||||
check_software_raid
|
check_software_raid
|
||||||
|
check_boss_raid
|
||||||
fi
|
fi
|
||||||
|
|
||||||
sum=$(($SWRAID + $BOSSRAID + $HWRAID))
|
sum=$(($SWRAID + $BOSSRAID + $HWRAID))
|
||||||
|
|||||||
@@ -0,0 +1,132 @@
|
|||||||
|
#!/opt/saltstack/salt/bin/python3
|
||||||
|
|
||||||
|
# Copyright Security Onion Solutions LLC and/or licensed to Security Onion Solutions LLC under one
|
||||||
|
# or more contributor license agreements. Licensed under the Elastic License 2.0 as shown at
|
||||||
|
# https://securityonion.net/license; you may not use this file except in compliance with the
|
||||||
|
# Elastic License 2.0.
|
||||||
|
#
|
||||||
|
# Note: Per the Elastic License 2.0, the second limitation states:
|
||||||
|
#
|
||||||
|
# "You may not move, change, disable, or circumvent the license key functionality
|
||||||
|
# in the software, and you may not remove or obscure any functionality in the
|
||||||
|
# software that is protected by the license key."
|
||||||
|
|
||||||
|
{% if 'vrt' in salt['pillar.get']('features', []) -%}
|
||||||
|
|
||||||
|
"""
|
||||||
|
Script for emitting VM deployment status events to the Salt event bus.
|
||||||
|
|
||||||
|
This script provides functionality to emit status events for VM deployment operations,
|
||||||
|
used by various Security Onion VM management tools.
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
so-salt-emit-vm-deployment-status-event -v <vm_name> -H <hypervisor> -s <status>
|
||||||
|
|
||||||
|
Arguments:
|
||||||
|
-v, --vm-name Name of the VM (hostname_role)
|
||||||
|
-H, --hypervisor Name of the hypervisor
|
||||||
|
-s, --status Current deployment status of the VM
|
||||||
|
|
||||||
|
Example:
|
||||||
|
so-salt-emit-vm-deployment-status-event -v sensor1_sensor -H hypervisor1 -s "Creating"
|
||||||
|
"""
|
||||||
|
|
||||||
|
import sys
|
||||||
|
import argparse
|
||||||
|
import logging
|
||||||
|
import salt.client
|
||||||
|
from typing import Dict, Any
|
||||||
|
|
||||||
|
# Configure logging
|
||||||
|
logging.basicConfig(
|
||||||
|
level=logging.INFO,
|
||||||
|
format='%(asctime)s - %(levelname)s - %(message)s'
|
||||||
|
)
|
||||||
|
log = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
def emit_event(vm_name: str, hypervisor: str, status: str) -> bool:
|
||||||
|
"""
|
||||||
|
Emit a VM deployment status event to the salt event bus.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
vm_name: Name of the VM (hostname_role)
|
||||||
|
hypervisor: Name of the hypervisor
|
||||||
|
status: Current deployment status of the VM
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
bool: True if event was sent successfully, False otherwise
|
||||||
|
|
||||||
|
Raises:
|
||||||
|
ValueError: If status is not a valid deployment status
|
||||||
|
"""
|
||||||
|
log.info("Attempting to emit deployment event...")
|
||||||
|
|
||||||
|
try:
|
||||||
|
caller = salt.client.Caller()
|
||||||
|
event_data = {
|
||||||
|
'vm_name': vm_name,
|
||||||
|
'hypervisor': hypervisor,
|
||||||
|
'status': status
|
||||||
|
}
|
||||||
|
|
||||||
|
# Use consistent event tag structure
|
||||||
|
event_tag = f'soc/dyanno/hypervisor/{status.lower()}'
|
||||||
|
|
||||||
|
ret = caller.cmd(
|
||||||
|
'event.send',
|
||||||
|
event_tag,
|
||||||
|
event_data
|
||||||
|
)
|
||||||
|
|
||||||
|
if not ret:
|
||||||
|
log.error("Failed to emit VM deployment status event: %s", event_data)
|
||||||
|
return False
|
||||||
|
|
||||||
|
log.info("Successfully emitted VM deployment status event: %s", event_data)
|
||||||
|
return True
|
||||||
|
|
||||||
|
except Exception as e:
|
||||||
|
log.error("Error emitting VM deployment status event: %s", str(e))
|
||||||
|
return False
|
||||||
|
|
||||||
|
def parse_args():
|
||||||
|
"""Parse command line arguments."""
|
||||||
|
parser = argparse.ArgumentParser(
|
||||||
|
description='Emit VM deployment status events to the Salt event bus.'
|
||||||
|
)
|
||||||
|
parser.add_argument('-v', '--vm-name', required=True,
|
||||||
|
help='Name of the VM (hostname_role)')
|
||||||
|
parser.add_argument('-H', '--hypervisor', required=True,
|
||||||
|
help='Name of the hypervisor')
|
||||||
|
parser.add_argument('-s', '--status', required=True,
|
||||||
|
help='Current deployment status of the VM')
|
||||||
|
return parser.parse_args()
|
||||||
|
|
||||||
|
def main():
|
||||||
|
"""Main entry point for the script."""
|
||||||
|
try:
|
||||||
|
args = parse_args()
|
||||||
|
|
||||||
|
success = emit_event(
|
||||||
|
vm_name=args.vm_name,
|
||||||
|
hypervisor=args.hypervisor,
|
||||||
|
status=args.status
|
||||||
|
)
|
||||||
|
|
||||||
|
if not success:
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
|
except Exception as e:
|
||||||
|
log.error("Failed to emit status event: %s", str(e))
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
main()
|
||||||
|
|
||||||
|
{%- else -%}
|
||||||
|
|
||||||
|
echo "Hypervisor nodes are a feature supported only for customers with a valid license. \
|
||||||
|
Contact Security Onion Solutions, LLC via our website at https://securityonionsolutions.com \
|
||||||
|
for more information about purchasing a license to enable this feature."
|
||||||
|
|
||||||
|
{% endif -%}
|
||||||
@@ -24,11 +24,6 @@ docker:
|
|||||||
custom_bind_mounts: []
|
custom_bind_mounts: []
|
||||||
extra_hosts: []
|
extra_hosts: []
|
||||||
extra_env: []
|
extra_env: []
|
||||||
'so-idstools':
|
|
||||||
final_octet: 25
|
|
||||||
custom_bind_mounts: []
|
|
||||||
extra_hosts: []
|
|
||||||
extra_env: []
|
|
||||||
'so-influxdb':
|
'so-influxdb':
|
||||||
final_octet: 26
|
final_octet: 26
|
||||||
port_bindings:
|
port_bindings:
|
||||||
@@ -51,6 +46,14 @@ docker:
|
|||||||
custom_bind_mounts: []
|
custom_bind_mounts: []
|
||||||
extra_hosts: []
|
extra_hosts: []
|
||||||
extra_env: []
|
extra_env: []
|
||||||
|
'so-hydra':
|
||||||
|
final_octet: 30
|
||||||
|
port_bindings:
|
||||||
|
- 0.0.0.0:4444:4444
|
||||||
|
- 0.0.0.0:4445:4445
|
||||||
|
custom_bind_mounts: []
|
||||||
|
extra_hosts: []
|
||||||
|
extra_env: []
|
||||||
'so-logstash':
|
'so-logstash':
|
||||||
final_octet: 29
|
final_octet: 29
|
||||||
port_bindings:
|
port_bindings:
|
||||||
@@ -74,6 +77,7 @@ docker:
|
|||||||
- 443:443
|
- 443:443
|
||||||
- 8443:8443
|
- 8443:8443
|
||||||
- 7788:7788
|
- 7788:7788
|
||||||
|
- 7789:7789
|
||||||
custom_bind_mounts: []
|
custom_bind_mounts: []
|
||||||
extra_hosts: []
|
extra_hosts: []
|
||||||
extra_env: []
|
extra_env: []
|
||||||
@@ -191,6 +195,7 @@ docker:
|
|||||||
final_octet: 88
|
final_octet: 88
|
||||||
port_bindings:
|
port_bindings:
|
||||||
- 0.0.0.0:9092:9092
|
- 0.0.0.0:9092:9092
|
||||||
|
- 0.0.0.0:29092:29092
|
||||||
- 0.0.0.0:9093:9093
|
- 0.0.0.0:9093:9093
|
||||||
- 0.0.0.0:8778:8778
|
- 0.0.0.0:8778:8778
|
||||||
custom_bind_mounts: []
|
custom_bind_mounts: []
|
||||||
|
|||||||
@@ -20,41 +20,41 @@ dockergroup:
|
|||||||
dockerheldpackages:
|
dockerheldpackages:
|
||||||
pkg.installed:
|
pkg.installed:
|
||||||
- pkgs:
|
- pkgs:
|
||||||
- containerd.io: 1.6.33-1
|
- containerd.io: 1.7.21-1
|
||||||
- docker-ce: 5:26.1.4-1~debian.12~bookworm
|
- docker-ce: 5:27.2.0-1~debian.12~bookworm
|
||||||
- docker-ce-cli: 5:26.1.4-1~debian.12~bookworm
|
- docker-ce-cli: 5:27.2.0-1~debian.12~bookworm
|
||||||
- docker-ce-rootless-extras: 5:26.1.4-1~debian.12~bookworm
|
- docker-ce-rootless-extras: 5:27.2.0-1~debian.12~bookworm
|
||||||
- hold: True
|
- hold: True
|
||||||
- update_holds: True
|
- update_holds: True
|
||||||
{% elif grains.oscodename == 'jammy' %}
|
{% elif grains.oscodename == 'jammy' %}
|
||||||
dockerheldpackages:
|
dockerheldpackages:
|
||||||
pkg.installed:
|
pkg.installed:
|
||||||
- pkgs:
|
- pkgs:
|
||||||
- containerd.io: 1.6.33-1
|
- containerd.io: 1.7.21-1
|
||||||
- docker-ce: 5:26.1.4-1~ubuntu.22.04~jammy
|
- docker-ce: 5:27.2.0-1~ubuntu.22.04~jammy
|
||||||
- docker-ce-cli: 5:26.1.4-1~ubuntu.22.04~jammy
|
- docker-ce-cli: 5:27.2.0-1~ubuntu.22.04~jammy
|
||||||
- docker-ce-rootless-extras: 5:26.1.4-1~ubuntu.22.04~jammy
|
- docker-ce-rootless-extras: 5:27.2.0-1~ubuntu.22.04~jammy
|
||||||
- hold: True
|
- hold: True
|
||||||
- update_holds: True
|
- update_holds: True
|
||||||
{% else %}
|
{% else %}
|
||||||
dockerheldpackages:
|
dockerheldpackages:
|
||||||
pkg.installed:
|
pkg.installed:
|
||||||
- pkgs:
|
- pkgs:
|
||||||
- containerd.io: 1.6.33-1
|
- containerd.io: 1.7.21-1
|
||||||
- docker-ce: 5:26.1.4-1~ubuntu.20.04~focal
|
- docker-ce: 5:27.2.0-1~ubuntu.20.04~focal
|
||||||
- docker-ce-cli: 5:26.1.4-1~ubuntu.20.04~focal
|
- docker-ce-cli: 5:27.2.0-1~ubuntu.20.04~focal
|
||||||
- docker-ce-rootless-extras: 5:26.1.4-1~ubuntu.20.04~focal
|
- docker-ce-rootless-extras: 5:27.2.0-1~ubuntu.20.04~focal
|
||||||
- hold: True
|
- hold: True
|
||||||
- update_holds: True
|
- update_holds: True
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% else %}
|
{% else %}
|
||||||
dockerheldpackages:
|
dockerheldpackages:
|
||||||
pkg.installed:
|
pkg.installed:
|
||||||
- pkgs:
|
- pkgs:
|
||||||
- containerd.io: 1.6.33-3.1.el9
|
- containerd.io: 1.7.21-3.1.el9
|
||||||
- docker-ce: 3:26.1.4-1.el9
|
- docker-ce: 3:27.2.0-1.el9
|
||||||
- docker-ce-cli: 1:26.1.4-1.el9
|
- docker-ce-cli: 1:27.2.0-1.el9
|
||||||
- docker-ce-rootless-extras: 26.1.4-1.el9
|
- docker-ce-rootless-extras: 27.2.0-1.el9
|
||||||
- hold: True
|
- hold: True
|
||||||
- update_holds: True
|
- update_holds: True
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|||||||
@@ -41,10 +41,10 @@ docker:
|
|||||||
forcedType: "[]string"
|
forcedType: "[]string"
|
||||||
so-elastic-fleet: *dockerOptions
|
so-elastic-fleet: *dockerOptions
|
||||||
so-elasticsearch: *dockerOptions
|
so-elasticsearch: *dockerOptions
|
||||||
so-idstools: *dockerOptions
|
|
||||||
so-influxdb: *dockerOptions
|
so-influxdb: *dockerOptions
|
||||||
so-kibana: *dockerOptions
|
so-kibana: *dockerOptions
|
||||||
so-kratos: *dockerOptions
|
so-kratos: *dockerOptions
|
||||||
|
so-hydra: *dockerOptions
|
||||||
so-logstash: *dockerOptions
|
so-logstash: *dockerOptions
|
||||||
so-nginx: *dockerOptions
|
so-nginx: *dockerOptions
|
||||||
so-nginx-fleet-node: *dockerOptions
|
so-nginx-fleet-node: *dockerOptions
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
elastalert:
|
elastalert:
|
||||||
enabled:
|
enabled:
|
||||||
description: You can enable or disable Elastalert.
|
description: Enables or disables the ElastAlert 2 process. This process is critical for ensuring alerts arrive in SOC, and for outbound notification delivery.
|
||||||
helpLink: elastalert.html
|
helpLink: elastalert.html
|
||||||
alerter_parameters:
|
alerter_parameters:
|
||||||
title: Alerter Parameters
|
title: Custom Configuration Parameters
|
||||||
description: Optional configuration parameters for additional alerters that can be enabled for all Sigma rules. Filter for 'Alerter' in this Configuration screen to find the setting that allows these alerters to be enabled within the SOC ElastAlert module. Use YAML format for these parameters, and reference the ElastAlert 2 documentation, located at https://elastalert2.readthedocs.io, for available alerters and their required configuration parameters. A full update of the ElastAlert rule engine, via the Detections screen, is required in order to apply these changes. Requires a valid Security Onion license key.
|
description: Optional configuration parameters made available as defaults for all rules and alerters. Use YAML format for these parameters, and reference the ElastAlert 2 documentation, located at https://elastalert2.readthedocs.io, for available configuration parameters. Requires a valid Security Onion license key.
|
||||||
global: True
|
global: True
|
||||||
multiline: True
|
multiline: True
|
||||||
syntax: yaml
|
syntax: yaml
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
elastic_fleet_package_registry:
|
elastic_fleet_package_registry:
|
||||||
enabled:
|
enabled:
|
||||||
description: You can enable or disable Elastic Fleet Package Registry.
|
description: Enables or disables the Fleet package registry process. This process must remain enabled to allow Elastic Agent packages to be updated.
|
||||||
advanced: True
|
advanced: True
|
||||||
|
|||||||
@@ -8,7 +8,6 @@
|
|||||||
{% from 'vars/globals.map.jinja' import GLOBALS %}
|
{% from 'vars/globals.map.jinja' import GLOBALS %}
|
||||||
{% from 'docker/docker.map.jinja' import DOCKER %}
|
{% from 'docker/docker.map.jinja' import DOCKER %}
|
||||||
|
|
||||||
|
|
||||||
include:
|
include:
|
||||||
- elasticagent.config
|
- elasticagent.config
|
||||||
- elasticagent.sostatus
|
- elasticagent.sostatus
|
||||||
|
|||||||
4
salt/elasticagent/soc_elasticagent.yaml
Normal file
4
salt/elasticagent/soc_elasticagent.yaml
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
elasticagent:
|
||||||
|
enabled:
|
||||||
|
description: Enables or disables the Elastic Agent process. This process must remain enabled to allow collection of node events.
|
||||||
|
advanced: True
|
||||||
@@ -9,3 +9,6 @@ fleetartifactdir:
|
|||||||
- user: 947
|
- user: 947
|
||||||
- group: 939
|
- group: 939
|
||||||
- makedirs: True
|
- makedirs: True
|
||||||
|
- recurse:
|
||||||
|
- user
|
||||||
|
- group
|
||||||
|
|||||||
34
salt/elasticfleet/config.map.jinja
Normal file
34
salt/elasticfleet/config.map.jinja
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
{# Copyright Security Onion Solutions LLC and/or licensed to Security Onion Solutions LLC under one
|
||||||
|
or more contributor license agreements. Licensed under the Elastic License 2.0 as shown at
|
||||||
|
https://securityonion.net/license; you may not use this file except in compliance with the
|
||||||
|
Elastic License 2.0. #}
|
||||||
|
|
||||||
|
{% from 'elasticfleet/map.jinja' import ELASTICFLEETMERGED %}
|
||||||
|
|
||||||
|
{# advanced config_yaml options for elasticfleet logstash output #}
|
||||||
|
{% set ADV_OUTPUT_LOGSTASH_RAW = ELASTICFLEETMERGED.config.outputs.logstash %}
|
||||||
|
{% set ADV_OUTPUT_LOGSTASH = {} %}
|
||||||
|
{% for k, v in ADV_OUTPUT_LOGSTASH_RAW.items() %}
|
||||||
|
{% if v != "" and v is not none %}
|
||||||
|
{% if k == 'queue_mem_events' %}
|
||||||
|
{# rename queue_mem_events queue.mem.events #}
|
||||||
|
{% do ADV_OUTPUT_LOGSTASH.update({'queue.mem.events':v}) %}
|
||||||
|
{% elif k == 'loadbalance' %}
|
||||||
|
{% if v %}
|
||||||
|
{# only include loadbalance config when its True #}
|
||||||
|
{% do ADV_OUTPUT_LOGSTASH.update({k:v}) %}
|
||||||
|
{% endif %}
|
||||||
|
{% else %}
|
||||||
|
{% do ADV_OUTPUT_LOGSTASH.update({k:v}) %}
|
||||||
|
{% endif %}
|
||||||
|
{% endif %}
|
||||||
|
{% endfor %}
|
||||||
|
|
||||||
|
{% set LOGSTASH_CONFIG_YAML_RAW = [] %}
|
||||||
|
{% if ADV_OUTPUT_LOGSTASH %}
|
||||||
|
{% for k, v in ADV_OUTPUT_LOGSTASH.items() %}
|
||||||
|
{% do LOGSTASH_CONFIG_YAML_RAW.append(k ~ ': ' ~ v) %}
|
||||||
|
{% endfor %}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% set LOGSTASH_CONFIG_YAML = LOGSTASH_CONFIG_YAML_RAW | join('\\n') if LOGSTASH_CONFIG_YAML_RAW else '' %}
|
||||||
@@ -9,6 +9,9 @@
|
|||||||
{% from 'elasticfleet/map.jinja' import ELASTICFLEETMERGED %}
|
{% from 'elasticfleet/map.jinja' import ELASTICFLEETMERGED %}
|
||||||
{% set node_data = salt['pillar.get']('node_data') %}
|
{% set node_data = salt['pillar.get']('node_data') %}
|
||||||
|
|
||||||
|
include:
|
||||||
|
- elasticfleet.artifact_registry
|
||||||
|
|
||||||
# Add EA Group
|
# Add EA Group
|
||||||
elasticfleetgroup:
|
elasticfleetgroup:
|
||||||
group.present:
|
group.present:
|
||||||
@@ -30,6 +33,7 @@ elasticfleet_sbin:
|
|||||||
- user: 947
|
- user: 947
|
||||||
- group: 939
|
- group: 939
|
||||||
- file_mode: 755
|
- file_mode: 755
|
||||||
|
- show_changes: False
|
||||||
|
|
||||||
elasticfleet_sbin_jinja:
|
elasticfleet_sbin_jinja:
|
||||||
file.recurse:
|
file.recurse:
|
||||||
@@ -41,6 +45,7 @@ elasticfleet_sbin_jinja:
|
|||||||
- template: jinja
|
- template: jinja
|
||||||
- exclude_pat:
|
- exclude_pat:
|
||||||
- so-elastic-fleet-package-upgrade # exclude this because we need to watch it for changes
|
- so-elastic-fleet-package-upgrade # exclude this because we need to watch it for changes
|
||||||
|
- show_changes: False
|
||||||
|
|
||||||
eaconfdir:
|
eaconfdir:
|
||||||
file.directory:
|
file.directory:
|
||||||
@@ -63,6 +68,14 @@ eastatedir:
|
|||||||
- group: 939
|
- group: 939
|
||||||
- makedirs: True
|
- makedirs: True
|
||||||
|
|
||||||
|
custommappingsdir:
|
||||||
|
file.directory:
|
||||||
|
- name: /nsm/custom-mappings
|
||||||
|
- user: 947
|
||||||
|
- group: 939
|
||||||
|
- makedirs: True
|
||||||
|
|
||||||
|
|
||||||
eapackageupgrade:
|
eapackageupgrade:
|
||||||
file.managed:
|
file.managed:
|
||||||
- name: /usr/sbin/so-elastic-fleet-package-upgrade
|
- name: /usr/sbin/so-elastic-fleet-package-upgrade
|
||||||
@@ -73,6 +86,56 @@ eapackageupgrade:
|
|||||||
- template: jinja
|
- template: jinja
|
||||||
|
|
||||||
{% if GLOBALS.role != "so-fleet" %}
|
{% if GLOBALS.role != "so-fleet" %}
|
||||||
|
|
||||||
|
{% if not GLOBALS.airgap %}
|
||||||
|
soresourcesrepoclone:
|
||||||
|
git.latest:
|
||||||
|
- name: https://github.com/Security-Onion-Solutions/securityonion-resources.git
|
||||||
|
- target: /nsm/securityonion-resources
|
||||||
|
- rev: 'main'
|
||||||
|
- depth: 1
|
||||||
|
- force_reset: True
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
elasticdefendconfdir:
|
||||||
|
file.directory:
|
||||||
|
- name: /opt/so/conf/elastic-fleet/defend-exclusions/rulesets
|
||||||
|
- user: 947
|
||||||
|
- group: 939
|
||||||
|
- makedirs: True
|
||||||
|
|
||||||
|
elasticdefenddisabled:
|
||||||
|
file.managed:
|
||||||
|
- name: /opt/so/conf/elastic-fleet/defend-exclusions/disabled-filters.yaml
|
||||||
|
- source: salt://elasticfleet/files/soc/elastic-defend-disabled-filters.yaml
|
||||||
|
- user: 947
|
||||||
|
- group: 939
|
||||||
|
- mode: 600
|
||||||
|
|
||||||
|
elasticdefendcustom:
|
||||||
|
file.managed:
|
||||||
|
- name: /opt/so/conf/elastic-fleet/defend-exclusions/rulesets/custom-filters-raw
|
||||||
|
- source: salt://elasticfleet/files/soc/elastic-defend-custom-filters.yaml
|
||||||
|
- user: 947
|
||||||
|
- group: 939
|
||||||
|
- mode: 600
|
||||||
|
|
||||||
|
{% if ELASTICFLEETMERGED.config.defend_filters.enable_auto_configuration %}
|
||||||
|
{% set ap = "present" %}
|
||||||
|
{% else %}
|
||||||
|
{% set ap = "absent" %}
|
||||||
|
{% endif %}
|
||||||
|
cron-elastic-defend-filters:
|
||||||
|
cron.{{ap}}:
|
||||||
|
- name: python3 /sbin/so-elastic-defend-manage-filters.py -c /opt/so/conf/elasticsearch/curl.config -d /opt/so/conf/elastic-fleet/defend-exclusions/disabled-filters.yaml -i /nsm/securityonion-resources/event_filters/ -i /opt/so/conf/elastic-fleet/defend-exclusions/rulesets/custom-filters/ &>> /opt/so/log/elasticfleet/elastic-defend-manage-filters.log
|
||||||
|
- identifier: elastic-defend-filters
|
||||||
|
- user: root
|
||||||
|
- minute: '0'
|
||||||
|
- hour: '3'
|
||||||
|
- daymonth: '*'
|
||||||
|
- month: '*'
|
||||||
|
- dayweek: '*'
|
||||||
|
|
||||||
eaintegrationsdir:
|
eaintegrationsdir:
|
||||||
file.directory:
|
file.directory:
|
||||||
- name: /opt/so/conf/elastic-fleet/integrations
|
- name: /opt/so/conf/elastic-fleet/integrations
|
||||||
@@ -87,6 +150,7 @@ eadynamicintegration:
|
|||||||
- user: 947
|
- user: 947
|
||||||
- group: 939
|
- group: 939
|
||||||
- template: jinja
|
- template: jinja
|
||||||
|
- show_changes: False
|
||||||
|
|
||||||
eaintegration:
|
eaintegration:
|
||||||
file.recurse:
|
file.recurse:
|
||||||
@@ -94,6 +158,7 @@ eaintegration:
|
|||||||
- source: salt://elasticfleet/files/integrations
|
- source: salt://elasticfleet/files/integrations
|
||||||
- user: 947
|
- user: 947
|
||||||
- group: 939
|
- group: 939
|
||||||
|
- show_changes: False
|
||||||
|
|
||||||
eaoptionalintegrationsdir:
|
eaoptionalintegrationsdir:
|
||||||
file.directory:
|
file.directory:
|
||||||
@@ -104,7 +169,7 @@ eaoptionalintegrationsdir:
|
|||||||
|
|
||||||
{% for minion in node_data %}
|
{% for minion in node_data %}
|
||||||
{% set role = node_data[minion]["role"] %}
|
{% set role = node_data[minion]["role"] %}
|
||||||
{% if role in [ "eval","fleet","heavynode","import","manager","managersearch","standalone" ] %}
|
{% if role in [ "eval","fleet","heavynode","import","manager", "managerhype", "managersearch","standalone" ] %}
|
||||||
{% set optional_integrations = ELASTICFLEETMERGED.optional_integrations %}
|
{% set optional_integrations = ELASTICFLEETMERGED.optional_integrations %}
|
||||||
{% set integration_keys = optional_integrations.keys() %}
|
{% set integration_keys = optional_integrations.keys() %}
|
||||||
fleet_server_integrations_{{ minion }}:
|
fleet_server_integrations_{{ minion }}:
|
||||||
|
|||||||
@@ -8,10 +8,21 @@ elasticfleet:
|
|||||||
endpoints_enrollment: ''
|
endpoints_enrollment: ''
|
||||||
es_token: ''
|
es_token: ''
|
||||||
grid_enrollment: ''
|
grid_enrollment: ''
|
||||||
|
defend_filters:
|
||||||
|
enable_auto_configuration: False
|
||||||
|
outputs:
|
||||||
|
logstash:
|
||||||
|
bulk_max_size: ''
|
||||||
|
worker: ''
|
||||||
|
queue_mem_events: ''
|
||||||
|
timeout: ''
|
||||||
|
loadbalance: False
|
||||||
|
compression_level: ''
|
||||||
|
subscription_integrations: False
|
||||||
|
auto_upgrade_integrations: False
|
||||||
logging:
|
logging:
|
||||||
zeek:
|
zeek:
|
||||||
excluded:
|
excluded:
|
||||||
- analyzer
|
|
||||||
- broker
|
- broker
|
||||||
- capture_loss
|
- capture_loss
|
||||||
- cluster
|
- cluster
|
||||||
@@ -30,88 +41,21 @@ elasticfleet:
|
|||||||
- stderr
|
- stderr
|
||||||
- stdout
|
- stdout
|
||||||
packages:
|
packages:
|
||||||
- apache
|
|
||||||
- auditd
|
|
||||||
- auth0
|
|
||||||
- aws
|
|
||||||
- azure
|
|
||||||
- barracuda
|
|
||||||
- carbonblack_edr
|
|
||||||
- cef
|
|
||||||
- checkpoint
|
|
||||||
- cisco_asa
|
|
||||||
- cisco_duo
|
|
||||||
- cisco_ftd
|
|
||||||
- cisco_ios
|
|
||||||
- cisco_ise
|
|
||||||
- cisco_meraki
|
|
||||||
- cisco_umbrella
|
|
||||||
- citrix_adc
|
|
||||||
- citrix_waf
|
|
||||||
- cloudflare
|
|
||||||
- crowdstrike
|
|
||||||
- darktrace
|
|
||||||
- elastic_agent
|
- elastic_agent
|
||||||
- elasticsearch
|
- elasticsearch
|
||||||
- endpoint
|
- endpoint
|
||||||
- f5_bigip
|
|
||||||
- fim
|
|
||||||
- fireeye
|
|
||||||
- fleet_server
|
- fleet_server
|
||||||
- fortinet
|
- filestream
|
||||||
- fortinet_fortigate
|
|
||||||
- gcp
|
|
||||||
- github
|
|
||||||
- google_workspace
|
|
||||||
- http_endpoint
|
- http_endpoint
|
||||||
- httpjson
|
- httpjson
|
||||||
- iis
|
|
||||||
- journald
|
|
||||||
- juniper
|
|
||||||
- juniper_srx
|
|
||||||
- kafka_log
|
|
||||||
- lastpass
|
|
||||||
- log
|
- log
|
||||||
- m365_defender
|
|
||||||
- microsoft_defender_endpoint
|
|
||||||
- microsoft_dhcp
|
|
||||||
- microsoft_sqlserver
|
|
||||||
- mimecast
|
|
||||||
- mysql
|
|
||||||
- netflow
|
|
||||||
- nginx
|
|
||||||
- o365
|
|
||||||
- okta
|
|
||||||
- osquery_manager
|
- osquery_manager
|
||||||
- panw
|
|
||||||
- pfsense
|
|
||||||
- proofpoint_tap
|
|
||||||
- pulse_connect_secure
|
|
||||||
- redis
|
- redis
|
||||||
- sentinel_one
|
|
||||||
- snort
|
|
||||||
- snyk
|
|
||||||
- sonicwall_firewall
|
|
||||||
- sophos
|
|
||||||
- sophos_central
|
|
||||||
- symantec_endpoint
|
|
||||||
- system
|
- system
|
||||||
- tcp
|
- tcp
|
||||||
- tenable_sc
|
|
||||||
- ti_abusech
|
|
||||||
- ti_anomali
|
|
||||||
- ti_cybersixgill
|
|
||||||
- ti_misp
|
|
||||||
- ti_otx
|
|
||||||
- ti_recordedfuture
|
|
||||||
- ti_threatq
|
|
||||||
- udp
|
- udp
|
||||||
- vsphere
|
|
||||||
- windows
|
- windows
|
||||||
- winlog
|
- winlog
|
||||||
- zscaler_zia
|
|
||||||
- zscaler_zpa
|
|
||||||
- 1password
|
|
||||||
optional_integrations:
|
optional_integrations:
|
||||||
sublime_platform:
|
sublime_platform:
|
||||||
enabled_nodes: []
|
enabled_nodes: []
|
||||||
|
|||||||
@@ -17,10 +17,12 @@ include:
|
|||||||
- elasticfleet.sostatus
|
- elasticfleet.sostatus
|
||||||
- ssl
|
- ssl
|
||||||
|
|
||||||
|
{% if grains.role not in ['so-fleet'] %}
|
||||||
# Wait for Elasticsearch to be ready - no reason to try running Elastic Fleet server if ES is not ready
|
# Wait for Elasticsearch to be ready - no reason to try running Elastic Fleet server if ES is not ready
|
||||||
wait_for_elasticsearch_elasticfleet:
|
wait_for_elasticsearch_elasticfleet:
|
||||||
cmd.run:
|
cmd.run:
|
||||||
- name: so-elasticsearch-wait
|
- name: so-elasticsearch-wait
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
# If enabled, automatically update Fleet Logstash Outputs
|
# If enabled, automatically update Fleet Logstash Outputs
|
||||||
{% if ELASTICFLEETMERGED.config.server.enable_auto_configuration and grains.role not in ['so-import', 'so-eval', 'so-fleet'] %}
|
{% if ELASTICFLEETMERGED.config.server.enable_auto_configuration and grains.role not in ['so-import', 'so-eval', 'so-fleet'] %}
|
||||||
@@ -30,6 +32,17 @@ so-elastic-fleet-auto-configure-logstash-outputs:
|
|||||||
- retry:
|
- retry:
|
||||||
attempts: 4
|
attempts: 4
|
||||||
interval: 30
|
interval: 30
|
||||||
|
|
||||||
|
{# Separate from above in order to catch elasticfleet-logstash.crt changes and force update to fleet output policy #}
|
||||||
|
so-elastic-fleet-auto-configure-logstash-outputs-force:
|
||||||
|
cmd.run:
|
||||||
|
- name: /usr/sbin/so-elastic-fleet-outputs-update --certs
|
||||||
|
- retry:
|
||||||
|
attempts: 4
|
||||||
|
interval: 30
|
||||||
|
- onchanges:
|
||||||
|
- x509: etc_elasticfleet_logstash_crt
|
||||||
|
- x509: elasticfleet_kafka_crt
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
# If enabled, automatically update Fleet Server URLs & ES Connection
|
# If enabled, automatically update Fleet Server URLs & ES Connection
|
||||||
@@ -65,6 +78,8 @@ so-elastic-fleet-auto-configure-artifact-urls:
|
|||||||
elasticagent_syncartifacts:
|
elasticagent_syncartifacts:
|
||||||
file.recurse:
|
file.recurse:
|
||||||
- name: /nsm/elastic-fleet/artifacts/beats
|
- name: /nsm/elastic-fleet/artifacts/beats
|
||||||
|
- user: 947
|
||||||
|
- group: 947
|
||||||
- source: salt://beats
|
- source: salt://beats
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
@@ -131,17 +146,46 @@ so-elastic-fleet-package-statefile:
|
|||||||
so-elastic-fleet-package-upgrade:
|
so-elastic-fleet-package-upgrade:
|
||||||
cmd.run:
|
cmd.run:
|
||||||
- name: /usr/sbin/so-elastic-fleet-package-upgrade
|
- name: /usr/sbin/so-elastic-fleet-package-upgrade
|
||||||
|
- retry:
|
||||||
|
attempts: 3
|
||||||
|
interval: 10
|
||||||
- onchanges:
|
- onchanges:
|
||||||
- file: /opt/so/state/elastic_fleet_packages.txt
|
- file: /opt/so/state/elastic_fleet_packages.txt
|
||||||
|
|
||||||
so-elastic-fleet-integrations:
|
so-elastic-fleet-integrations:
|
||||||
cmd.run:
|
cmd.run:
|
||||||
- name: /usr/sbin/so-elastic-fleet-integration-policy-load
|
- name: /usr/sbin/so-elastic-fleet-integration-policy-load
|
||||||
|
- retry:
|
||||||
|
attempts: 3
|
||||||
|
interval: 10
|
||||||
|
|
||||||
so-elastic-agent-grid-upgrade:
|
so-elastic-agent-grid-upgrade:
|
||||||
cmd.run:
|
cmd.run:
|
||||||
- name: /usr/sbin/so-elastic-agent-grid-upgrade
|
- name: /usr/sbin/so-elastic-agent-grid-upgrade
|
||||||
- retry: True
|
- retry:
|
||||||
|
attempts: 12
|
||||||
|
interval: 5
|
||||||
|
|
||||||
|
so-elastic-fleet-integration-upgrade:
|
||||||
|
cmd.run:
|
||||||
|
- name: /usr/sbin/so-elastic-fleet-integration-upgrade
|
||||||
|
- retry:
|
||||||
|
attempts: 3
|
||||||
|
interval: 10
|
||||||
|
|
||||||
|
{# Optional integrations script doesn't need the retries like so-elastic-fleet-integration-upgrade which loads the default integrations #}
|
||||||
|
so-elastic-fleet-addon-integrations:
|
||||||
|
cmd.run:
|
||||||
|
- name: /usr/sbin/so-elastic-fleet-optional-integrations-load
|
||||||
|
|
||||||
|
{% if ELASTICFLEETMERGED.config.defend_filters.enable_auto_configuration %}
|
||||||
|
so-elastic-defend-manage-filters-file-watch:
|
||||||
|
cmd.run:
|
||||||
|
- name: python3 /sbin/so-elastic-defend-manage-filters.py -c /opt/so/conf/elasticsearch/curl.config -d /opt/so/conf/elastic-fleet/defend-exclusions/disabled-filters.yaml -i /nsm/securityonion-resources/event_filters/ -i /opt/so/conf/elastic-fleet/defend-exclusions/rulesets/custom-filters/ &>> /opt/so/log/elasticfleet/elastic-defend-manage-filters.log
|
||||||
|
- onchanges:
|
||||||
|
- file: elasticdefendcustom
|
||||||
|
- file: elasticdefenddisabled
|
||||||
|
{% endif %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
delete_so-elastic-fleet_so-status.disabled:
|
delete_so-elastic-fleet_so-status.disabled:
|
||||||
|
|||||||
@@ -0,0 +1,19 @@
|
|||||||
|
{
|
||||||
|
"package": {
|
||||||
|
"name": "fleet_server",
|
||||||
|
"version": ""
|
||||||
|
},
|
||||||
|
"name": "fleet_server-1",
|
||||||
|
"namespace": "default",
|
||||||
|
"policy_id": "FleetServer_hostname",
|
||||||
|
"vars": {},
|
||||||
|
"inputs": {
|
||||||
|
"fleet_server-fleet-server": {
|
||||||
|
"enabled": true,
|
||||||
|
"vars": {
|
||||||
|
"custom": "server.ssl.supported_protocols: [\"TLSv1.2\", \"TLSv1.3\"]\nserver.ssl.cipher_suites: [ \"ECDHE-RSA-AES-128-GCM-SHA256\", \"ECDHE-RSA-AES-256-GCM-SHA384\", \"ECDHE-RSA-AES-128-CBC-SHA\", \"ECDHE-RSA-AES-256-CBC-SHA\", \"RSA-AES-128-GCM-SHA256\", \"RSA-AES-256-GCM-SHA384\"]"
|
||||||
|
},
|
||||||
|
"streams": {}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,46 @@
|
|||||||
|
{%- set identities = salt['sqlite3.fetch']('/nsm/kratos/db/db.sqlite', 'SELECT id, json_extract(traits, "$.email") as email FROM identities;') -%}
|
||||||
|
{%- set valid_identities = false -%}
|
||||||
|
{%- if identities -%}
|
||||||
|
{%- set valid_identities = true -%}
|
||||||
|
{%- for id, email in identities -%}
|
||||||
|
{%- if not id or not email -%}
|
||||||
|
{%- set valid_identities = false -%}
|
||||||
|
{%- break -%}
|
||||||
|
{%- endif -%}
|
||||||
|
{%- endfor -%}
|
||||||
|
{%- endif -%}
|
||||||
|
{
|
||||||
|
"package": {
|
||||||
|
"name": "log",
|
||||||
|
"version": ""
|
||||||
|
},
|
||||||
|
"name": "kratos-logs",
|
||||||
|
"namespace": "so",
|
||||||
|
"description": "Kratos logs",
|
||||||
|
"policy_id": "so-grid-nodes_general",
|
||||||
|
"inputs": {
|
||||||
|
"logs-logfile": {
|
||||||
|
"enabled": true,
|
||||||
|
"streams": {
|
||||||
|
"log.logs": {
|
||||||
|
"enabled": true,
|
||||||
|
"vars": {
|
||||||
|
"paths": [
|
||||||
|
"/opt/so/log/kratos/kratos.log"
|
||||||
|
],
|
||||||
|
"data_stream.dataset": "kratos",
|
||||||
|
"tags": ["so-kratos"],
|
||||||
|
{%- if valid_identities -%}
|
||||||
|
"processors": "- decode_json_fields:\n fields: [\"message\"]\n target: \"\"\n add_error_key: true\n- add_fields:\n target: event\n fields:\n category: iam\n module: kratos\n- if:\n has_fields:\n - identity_id\n then:{% for id, email in identities %}\n - if:\n equals:\n identity_id: \"{{ id }}\"\n then:\n - add_fields:\n target: ''\n fields:\n user.name: \"{{ email }}\"{% endfor %}",
|
||||||
|
{%- else -%}
|
||||||
|
"processors": "- decode_json_fields:\n fields: [\"message\"]\n target: \"\"\n add_error_key: true\n- add_fields:\n target: event\n fields:\n category: iam\n module: kratos",
|
||||||
|
{%- endif -%}
|
||||||
|
"custom": "pipeline: kratos"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"force": true
|
||||||
|
}
|
||||||
|
|
||||||
@@ -1,27 +1,33 @@
|
|||||||
{
|
{
|
||||||
"name": "elastic-defend-endpoints",
|
"name": "elastic-defend-endpoints",
|
||||||
"namespace": "default",
|
"namespace": "default",
|
||||||
"description": "",
|
"description": "",
|
||||||
"package": {
|
"package": {
|
||||||
"name": "endpoint",
|
"name": "endpoint",
|
||||||
"title": "Elastic Defend",
|
"title": "Elastic Defend",
|
||||||
"version": "8.10.2"
|
"version": "8.18.1",
|
||||||
},
|
"requires_root": true
|
||||||
"enabled": true,
|
},
|
||||||
"policy_id": "endpoints-initial",
|
"enabled": true,
|
||||||
"inputs": [{
|
"policy_ids": [
|
||||||
"type": "ENDPOINT_INTEGRATION_CONFIG",
|
"endpoints-initial"
|
||||||
"enabled": true,
|
],
|
||||||
"streams": [],
|
"vars": {},
|
||||||
"config": {
|
"inputs": [
|
||||||
"_config": {
|
{
|
||||||
"value": {
|
"type": "ENDPOINT_INTEGRATION_CONFIG",
|
||||||
"type": "endpoint",
|
"enabled": true,
|
||||||
"endpointConfig": {
|
"config": {
|
||||||
"preset": "DataCollection"
|
"_config": {
|
||||||
}
|
"value": {
|
||||||
}
|
"type": "endpoint",
|
||||||
}
|
"endpointConfig": {
|
||||||
}
|
"preset": "DataCollection"
|
||||||
}]
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"streams": []
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
@@ -11,7 +11,7 @@
|
|||||||
"winlogs-winlog": {
|
"winlogs-winlog": {
|
||||||
"enabled": true,
|
"enabled": true,
|
||||||
"streams": {
|
"streams": {
|
||||||
"winlog.winlog": {
|
"winlog.winlogs": {
|
||||||
"enabled": true,
|
"enabled": true,
|
||||||
"vars": {
|
"vars": {
|
||||||
"channel": "Microsoft-Windows-Windows Defender/Operational",
|
"channel": "Microsoft-Windows-Windows Defender/Operational",
|
||||||
|
|||||||
@@ -0,0 +1,48 @@
|
|||||||
|
{
|
||||||
|
"package": {
|
||||||
|
"name": "filestream",
|
||||||
|
"version": ""
|
||||||
|
},
|
||||||
|
"name": "agent-monitor",
|
||||||
|
"namespace": "",
|
||||||
|
"description": "",
|
||||||
|
"policy_ids": [
|
||||||
|
"so-grid-nodes_general"
|
||||||
|
],
|
||||||
|
"output_id": null,
|
||||||
|
"vars": {},
|
||||||
|
"inputs": {
|
||||||
|
"filestream-filestream": {
|
||||||
|
"enabled": true,
|
||||||
|
"streams": {
|
||||||
|
"filestream.generic": {
|
||||||
|
"enabled": true,
|
||||||
|
"vars": {
|
||||||
|
"paths": [
|
||||||
|
"/opt/so/log/agents/agent-monitor.log"
|
||||||
|
],
|
||||||
|
"data_stream.dataset": "agentmonitor",
|
||||||
|
"pipeline": "elasticagent.monitor",
|
||||||
|
"parsers": "",
|
||||||
|
"exclude_files": [
|
||||||
|
"\\.gz$"
|
||||||
|
],
|
||||||
|
"include_files": [],
|
||||||
|
"processors": "- decode_json_fields:\n fields: [\"message\"]\n target: \"\"\n- add_fields:\n target: event\n fields:\n module: gridmetrics",
|
||||||
|
"tags": [],
|
||||||
|
"recursive_glob": true,
|
||||||
|
"ignore_older": "72h",
|
||||||
|
"clean_inactive": -1,
|
||||||
|
"harvester_limit": 0,
|
||||||
|
"fingerprint": true,
|
||||||
|
"fingerprint_offset": 0,
|
||||||
|
"fingerprint_length": 64,
|
||||||
|
"file_identity_native": false,
|
||||||
|
"exclude_lines": [],
|
||||||
|
"include_lines": []
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -40,7 +40,7 @@
|
|||||||
"enabled": true,
|
"enabled": true,
|
||||||
"vars": {
|
"vars": {
|
||||||
"paths": [
|
"paths": [
|
||||||
"/opt/so/log/elasticsearch/*.log"
|
"/opt/so/log/elasticsearch/*.json"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -3,9 +3,9 @@
|
|||||||
"name": "log",
|
"name": "log",
|
||||||
"version": ""
|
"version": ""
|
||||||
},
|
},
|
||||||
"name": "kratos-logs",
|
"name": "hydra-logs",
|
||||||
"namespace": "so",
|
"namespace": "so",
|
||||||
"description": "Kratos logs",
|
"description": "Hydra logs",
|
||||||
"policy_id": "so-grid-nodes_general",
|
"policy_id": "so-grid-nodes_general",
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"logs-logfile": {
|
"logs-logfile": {
|
||||||
@@ -15,12 +15,12 @@
|
|||||||
"enabled": true,
|
"enabled": true,
|
||||||
"vars": {
|
"vars": {
|
||||||
"paths": [
|
"paths": [
|
||||||
"/opt/so/log/kratos/kratos.log"
|
"/opt/so/log/hydra/hydra.log"
|
||||||
],
|
],
|
||||||
"data_stream.dataset": "kratos",
|
"data_stream.dataset": "hydra",
|
||||||
"tags": ["so-kratos"],
|
"tags": ["so-hydra"],
|
||||||
"processors": "- decode_json_fields:\n fields: [\"message\"]\n target: \"\"\n add_error_key: true \n- add_fields:\n target: event\n fields:\n category: iam\n module: kratos",
|
"processors": "- decode_json_fields:\n fields: [\"message\"]\n target: \"\"\n add_error_key: true \n- add_fields:\n target: event\n fields:\n category: iam\n module: hydra",
|
||||||
"custom": "pipeline: kratos"
|
"custom": "pipeline: hydra"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -19,7 +19,7 @@
|
|||||||
],
|
],
|
||||||
"data_stream.dataset": "idh",
|
"data_stream.dataset": "idh",
|
||||||
"tags": [],
|
"tags": [],
|
||||||
"processors": "\n- decode_json_fields:\n fields: [\"message\"]\n target: \"\"\n add_error_key: true\n- drop_fields:\n when:\n equals:\n logtype: \"1001\"\n fields: [\"src_host\", \"src_port\", \"dst_host\", \"dst_port\" ]\n ignore_missing: true\n- rename:\n fields:\n - from: \"src_host\"\n to: \"source.ip\"\n - from: \"src_port\"\n to: \"source.port\"\n - from: \"dst_host\"\n to: \"destination.host\"\n - from: \"dst_port\"\n to: \"destination.port\"\n ignore_missing: true\n- convert:\n fields:\n - {from: \"logtype\", to: \"event.code\", type: \"string\"}\n ignore_missing: true\n- drop_fields:\n fields: '[\"prospector\", \"input\", \"offset\", \"beat\"]'\n- add_fields:\n target: event\n fields:\n category: host\n module: opencanary",
|
"processors": "\n- decode_json_fields:\n fields: [\"message\"]\n target: \"\"\n add_error_key: true\n- convert:\n fields:\n - {from: \"logtype\", to: \"event.code\", type: \"string\"}\n- drop_fields:\n when:\n equals:\n event.code: \"1001\"\n fields: [\"src_host\", \"src_port\", \"dst_host\", \"dst_port\" ]\n ignore_missing: true\n- rename:\n fields:\n - from: \"src_host\"\n to: \"source.ip\"\n - from: \"src_port\"\n to: \"source.port\"\n - from: \"dst_host\"\n to: \"destination.host\"\n - from: \"dst_port\"\n to: \"destination.port\"\n ignore_missing: true\n- drop_fields:\n fields: '[\"prospector\", \"input\", \"offset\", \"beat\"]'\n- add_fields:\n target: event\n fields:\n category: host\n module: opencanary",
|
||||||
"custom": "pipeline: common"
|
"custom": "pipeline: common"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,7 +20,7 @@
|
|||||||
],
|
],
|
||||||
"data_stream.dataset": "import",
|
"data_stream.dataset": "import",
|
||||||
"custom": "",
|
"custom": "",
|
||||||
"processors": "- dissect:\n tokenizer: \"/nsm/import/%{import.id}/evtx/%{import.file}\"\n field: \"log.file.path\"\n target_prefix: \"\"\n- decode_json_fields:\n fields: [\"message\"]\n target: \"\"\n- drop_fields:\n fields: [\"host\"]\n ignore_missing: true\n- add_fields:\n target: data_stream\n fields:\n type: logs\n dataset: system.security\n- add_fields:\n target: event\n fields:\n dataset: system.security\n module: system\n imported: true\n- add_fields:\n target: \"@metadata\"\n fields:\n pipeline: logs-system.security-1.43.0\n- if:\n equals:\n winlog.channel: 'Microsoft-Windows-Sysmon/Operational'\n then: \n - add_fields:\n target: data_stream\n fields:\n dataset: windows.sysmon_operational\n - add_fields:\n target: event\n fields:\n dataset: windows.sysmon_operational\n module: windows\n imported: true\n - add_fields:\n target: \"@metadata\"\n fields:\n pipeline: logs-windows.sysmon_operational-1.38.0\n- if:\n equals:\n winlog.channel: 'Application'\n then: \n - add_fields:\n target: data_stream\n fields:\n dataset: system.application\n - add_fields:\n target: event\n fields:\n dataset: system.application\n - add_fields:\n target: \"@metadata\"\n fields:\n pipeline: logs-system.application-1.43.0\n- if:\n equals:\n winlog.channel: 'System'\n then: \n - add_fields:\n target: data_stream\n fields:\n dataset: system.system\n - add_fields:\n target: event\n fields:\n dataset: system.system\n - add_fields:\n target: \"@metadata\"\n fields:\n pipeline: logs-system.system-1.43.0\n \n- if:\n equals:\n winlog.channel: 'Microsoft-Windows-PowerShell/Operational'\n then: \n - add_fields:\n target: data_stream\n fields:\n dataset: windows.powershell_operational\n - add_fields:\n target: event\n fields:\n dataset: windows.powershell_operational\n module: windows\n - add_fields:\n target: \"@metadata\"\n fields:\n pipeline: logs-windows.powershell_operational-1.38.0\n- add_fields:\n target: data_stream\n fields:\n dataset: import",
|
"processors": "- dissect:\n tokenizer: \"/nsm/import/%{import.id}/evtx/%{import.file}\"\n field: \"log.file.path\"\n target_prefix: \"\"\n- decode_json_fields:\n fields: [\"message\"]\n target: \"\"\n- drop_fields:\n fields: [\"host\"]\n ignore_missing: true\n- add_fields:\n target: data_stream\n fields:\n type: logs\n dataset: system.security\n- add_fields:\n target: event\n fields:\n dataset: system.security\n module: system\n imported: true\n- add_fields:\n target: \"@metadata\"\n fields:\n pipeline: logs-system.security-2.6.1\n- if:\n equals:\n winlog.channel: 'Microsoft-Windows-Sysmon/Operational'\n then: \n - add_fields:\n target: data_stream\n fields:\n dataset: windows.sysmon_operational\n - add_fields:\n target: event\n fields:\n dataset: windows.sysmon_operational\n module: windows\n imported: true\n - add_fields:\n target: \"@metadata\"\n fields:\n pipeline: logs-windows.sysmon_operational-3.1.2\n- if:\n equals:\n winlog.channel: 'Application'\n then: \n - add_fields:\n target: data_stream\n fields:\n dataset: system.application\n - add_fields:\n target: event\n fields:\n dataset: system.application\n - add_fields:\n target: \"@metadata\"\n fields:\n pipeline: logs-system.application-2.6.1\n- if:\n equals:\n winlog.channel: 'System'\n then: \n - add_fields:\n target: data_stream\n fields:\n dataset: system.system\n - add_fields:\n target: event\n fields:\n dataset: system.system\n - add_fields:\n target: \"@metadata\"\n fields:\n pipeline: logs-system.system-2.6.1\n \n- if:\n equals:\n winlog.channel: 'Microsoft-Windows-PowerShell/Operational'\n then: \n - add_fields:\n target: data_stream\n fields:\n dataset: windows.powershell_operational\n - add_fields:\n target: event\n fields:\n dataset: windows.powershell_operational\n module: windows\n - add_fields:\n target: \"@metadata\"\n fields:\n pipeline: logs-windows.powershell_operational-3.1.2\n- add_fields:\n target: data_stream\n fields:\n dataset: import",
|
||||||
"tags": [
|
"tags": [
|
||||||
"import"
|
"import"
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -0,0 +1,35 @@
|
|||||||
|
{
|
||||||
|
"package": {
|
||||||
|
"name": "log",
|
||||||
|
"version": ""
|
||||||
|
},
|
||||||
|
"name": "so-ip-mappings",
|
||||||
|
"namespace": "so",
|
||||||
|
"description": "IP Description mappings",
|
||||||
|
"policy_id": "so-grid-nodes_general",
|
||||||
|
"vars": {},
|
||||||
|
"inputs": {
|
||||||
|
"logs-logfile": {
|
||||||
|
"enabled": true,
|
||||||
|
"streams": {
|
||||||
|
"log.logs": {
|
||||||
|
"enabled": true,
|
||||||
|
"vars": {
|
||||||
|
"paths": [
|
||||||
|
"/nsm/custom-mappings/ip-descriptions.csv"
|
||||||
|
],
|
||||||
|
"data_stream.dataset": "hostnamemappings",
|
||||||
|
"tags": [
|
||||||
|
"so-ip-mappings"
|
||||||
|
],
|
||||||
|
"processors": "- decode_csv_fields:\n fields:\n message: decoded.csv\n separator: \",\"\n ignore_missing: false\n overwrite_keys: true\n trim_leading_space: true\n fail_on_error: true\n\n- extract_array:\n field: decoded.csv\n mappings:\n so.ip_address: '0'\n so.description: '1'\n\n- script:\n lang: javascript\n source: >\n function process(event) {\n var ip = event.Get('so.ip_address');\n var validIpRegex = /^((25[0-5]|2[0-4]\\d|1\\d{2}|[1-9]?\\d)\\.){3}(25[0-5]|2[0-4]\\d|1\\d{2}|[1-9]?\\d)$/\n if (!validIpRegex.test(ip)) {\n event.Cancel();\n }\n }\n- fingerprint:\n fields: [\"so.ip_address\"]\n target_field: \"@metadata._id\"\n",
|
||||||
|
"custom": ""
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"force": true
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -11,7 +11,7 @@
|
|||||||
"tcp-tcp": {
|
"tcp-tcp": {
|
||||||
"enabled": true,
|
"enabled": true,
|
||||||
"streams": {
|
"streams": {
|
||||||
"tcp.generic": {
|
"tcp.tcp": {
|
||||||
"enabled": true,
|
"enabled": true,
|
||||||
"vars": {
|
"vars": {
|
||||||
"listen_address": "0.0.0.0",
|
"listen_address": "0.0.0.0",
|
||||||
@@ -23,7 +23,8 @@
|
|||||||
"syslog"
|
"syslog"
|
||||||
],
|
],
|
||||||
"syslog_options": "field: message\n#format: auto\n#timezone: Local",
|
"syslog_options": "field: message\n#format: auto\n#timezone: Local",
|
||||||
"ssl": ""
|
"ssl": "",
|
||||||
|
"custom": ""
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
"udp-udp": {
|
"udp-udp": {
|
||||||
"enabled": true,
|
"enabled": true,
|
||||||
"streams": {
|
"streams": {
|
||||||
"udp.generic": {
|
"udp.udp": {
|
||||||
"enabled": true,
|
"enabled": true,
|
||||||
"vars": {
|
"vars": {
|
||||||
"listen_address": "0.0.0.0",
|
"listen_address": "0.0.0.0",
|
||||||
@@ -20,11 +20,13 @@
|
|||||||
"pipeline": "syslog",
|
"pipeline": "syslog",
|
||||||
"max_message_size": "10KiB",
|
"max_message_size": "10KiB",
|
||||||
"keep_null": false,
|
"keep_null": false,
|
||||||
"processors": "- add_fields:\n target: event\n fields: \n module: syslog\n",
|
"processors": "- add_fields:\n target: event\n fields: \n module: syslog",
|
||||||
"tags": [
|
"tags": [
|
||||||
"syslog"
|
"syslog"
|
||||||
],
|
],
|
||||||
"syslog_options": "field: message\n#format: auto\n#timezone: Local"
|
"syslog_options": "field: message\n#format: auto\n#timezone: Local\n",
|
||||||
|
"preserve_original_event": false,
|
||||||
|
"custom": ""
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -31,7 +31,8 @@
|
|||||||
],
|
],
|
||||||
"tags": [
|
"tags": [
|
||||||
"so-grid-node"
|
"so-grid-node"
|
||||||
]
|
],
|
||||||
|
"processors": "- if:\n contains:\n message: \"salt-minion\"\n then: \n - dissect:\n tokenizer: \"%{} %{} %{} %{} %{} %{}: [%{log.level}] %{*}\"\n field: \"message\"\n trim_values: \"all\"\n target_prefix: \"\"\n - drop_event:\n when:\n equals:\n log.level: \"INFO\""
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,27 @@
|
|||||||
|
title: 'Template 1'
|
||||||
|
id: 'This needs to be a UUIDv4 id - https://www.uuidgenerator.net/version4'
|
||||||
|
description: 'Short description detailing what this rule is filtering and why.'
|
||||||
|
references: 'Relevant urls, etc'
|
||||||
|
author: '@SecurityOnion'
|
||||||
|
date: 'MM/DD/YY'
|
||||||
|
event_type: 'dns_query'
|
||||||
|
filter_type: 'exclude'
|
||||||
|
filter:
|
||||||
|
selection_1:
|
||||||
|
TargetField: 'QueryName'
|
||||||
|
Condition: 'end with'
|
||||||
|
Pattern: '.thawte.com'
|
||||||
|
---
|
||||||
|
title: 'Template 2'
|
||||||
|
id: 'This needs to be a UUIDv4 id - https://www.uuidgenerator.net/version4'
|
||||||
|
description: 'Short description detailing what this rule is filtering and why.'
|
||||||
|
references: 'Relevant urls, etc'
|
||||||
|
author: '@SecurityOnion'
|
||||||
|
date: 'MM/DD/YY'
|
||||||
|
event_type: 'process_creation'
|
||||||
|
filter_type: 'exclude'
|
||||||
|
filter:
|
||||||
|
selection_1:
|
||||||
|
TargetField: 'ParentImage'
|
||||||
|
Condition: 'is'
|
||||||
|
Pattern: 'C:\Windows\Microsoft.NET\Framework\v4.0.30319\ngentask.exe'
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
'9EDAA51C-BB12-49D9-8748-2B61371F2E7D':
|
||||||
|
Date: '10/10/2024'
|
||||||
|
Notes: 'Example Disabled Filter - Leave this entry here, just copy and paste as needed.'
|
||||||
@@ -2,26 +2,30 @@
|
|||||||
# or more contributor license agreements. Licensed under the Elastic License 2.0; you may not use
|
# or more contributor license agreements. Licensed under the Elastic License 2.0; you may not use
|
||||||
# this file except in compliance with the Elastic License 2.0.
|
# this file except in compliance with the Elastic License 2.0.
|
||||||
|
|
||||||
{%- set GRIDNODETOKENGENERAL = salt['pillar.get']('global:fleet_grid_enrollment_token_general') -%}
|
{% set GRIDNODETOKEN = salt['pillar.get']('global:fleet_grid_enrollment_token_general') -%}
|
||||||
{%- set GRIDNODETOKENHEAVY = salt['pillar.get']('global:fleet_grid_enrollment_token_heavy') -%}
|
{% if grains.role == 'so-heavynode' %}
|
||||||
|
{% set GRIDNODETOKEN = salt['pillar.get']('global:fleet_grid_enrollment_token_heavy') -%}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
{% set AGENT_STATUS = salt['service.available']('elastic-agent') %}
|
{% set AGENT_STATUS = salt['service.available']('elastic-agent') %}
|
||||||
{% if not AGENT_STATUS %}
|
{% if not AGENT_STATUS %}
|
||||||
|
|
||||||
{% if grains.role not in ['so-heavynode'] %}
|
pull_agent_installer:
|
||||||
run_installer:
|
file.managed:
|
||||||
cmd.script:
|
- name: /opt/so/so-elastic-agent_linux_amd64
|
||||||
- name: salt://elasticfleet/files/so_agent-installers/so-elastic-agent_linux_amd64
|
- source: salt://elasticfleet/files/so_agent-installers/so-elastic-agent_linux_amd64
|
||||||
- cwd: /opt/so
|
- mode: 755
|
||||||
- args: -token={{ GRIDNODETOKENGENERAL }}
|
- makedirs: True
|
||||||
- retry: True
|
|
||||||
{% else %}
|
|
||||||
run_installer:
|
|
||||||
cmd.script:
|
|
||||||
- name: salt://elasticfleet/files/so_agent-installers/so-elastic-agent_linux_amd64
|
|
||||||
- cwd: /opt/so
|
|
||||||
- args: -token={{ GRIDNODETOKENHEAVY }}
|
|
||||||
- retry: True
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
|
run_installer:
|
||||||
|
cmd.run:
|
||||||
|
- name: ./so-elastic-agent_linux_amd64 -token={{ GRIDNODETOKEN }}
|
||||||
|
- cwd: /opt/so
|
||||||
|
- retry:
|
||||||
|
attempts: 3
|
||||||
|
interval: 20
|
||||||
|
|
||||||
|
cleanup_agent_installer:
|
||||||
|
file.absent:
|
||||||
|
- name: /opt/so/so-elastic-agent_linux_amd64
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|||||||
180
salt/elasticfleet/integration-defaults.map.jinja
Normal file
180
salt/elasticfleet/integration-defaults.map.jinja
Normal file
@@ -0,0 +1,180 @@
|
|||||||
|
{# Copyright Security Onion Solutions LLC and/or licensed to Security Onion Solutions LLC under one
|
||||||
|
or more contributor license agreements. Licensed under the Elastic License 2.0; you may not use
|
||||||
|
this file except in compliance with the Elastic License 2.0. #}
|
||||||
|
|
||||||
|
|
||||||
|
{% import_json '/opt/so/state/esfleet_package_components.json' as ADDON_PACKAGE_COMPONENTS %}
|
||||||
|
{% import_json '/opt/so/state/esfleet_component_templates.json' as INSTALLED_COMPONENT_TEMPLATES %}
|
||||||
|
{% import_yaml 'elasticfleet/defaults.yaml' as ELASTICFLEETDEFAULTS %}
|
||||||
|
|
||||||
|
{% set CORE_ESFLEET_PACKAGES = ELASTICFLEETDEFAULTS.get('elasticfleet', {}).get('packages', {}) %}
|
||||||
|
{% set ADDON_INTEGRATION_DEFAULTS = {} %}
|
||||||
|
|
||||||
|
{# Some fleet integrations don't follow the standard naming convention #}
|
||||||
|
{% set WEIRD_INTEGRATIONS = {
|
||||||
|
'awsfirehose.logs': 'awsfirehose',
|
||||||
|
'awsfirehose.metrics': 'aws.cloudwatch',
|
||||||
|
'cribl.logs': 'cribl',
|
||||||
|
'cribl.metrics': 'cribl',
|
||||||
|
'sentinel_one_cloud_funnel.logins': 'sentinel_one_cloud_funnel.login',
|
||||||
|
'azure_application_insights.app_insights': 'azure.app_insights',
|
||||||
|
'azure_application_insights.app_state': 'azure.app_state',
|
||||||
|
'azure_billing.billing': 'azure.billing',
|
||||||
|
'azure_functions.metrics': 'azure.function',
|
||||||
|
'azure_metrics.compute_vm_scaleset': 'azure.compute_vm_scaleset',
|
||||||
|
'azure_metrics.compute_vm': 'azure.compute_vm',
|
||||||
|
'azure_metrics.container_instance': 'azure.container_instance',
|
||||||
|
'azure_metrics.container_registry': 'azure.container_registry',
|
||||||
|
'azure_metrics.container_service': 'azure.container_service',
|
||||||
|
'azure_metrics.database_account': 'azure.database_account',
|
||||||
|
'azure_metrics.monitor': 'azure.monitor',
|
||||||
|
'azure_metrics.storage_account': 'azure.storage_account',
|
||||||
|
'azure_openai.metrics': 'azure.open_ai',
|
||||||
|
'beat.state': 'beats.stack_monitoring.state',
|
||||||
|
'beat.stats': 'beats.stack_monitoring.stats',
|
||||||
|
'enterprisesearch.health': 'enterprisesearch.stack_monitoring.health',
|
||||||
|
'enterprisesearch.stats': 'enterprisesearch.stack_monitoring.stats',
|
||||||
|
'kibana.cluster_actions': 'kibana.stack_monitoring.cluster_actions',
|
||||||
|
'kibana.cluster_rules': 'kibana.stack_monitoring.cluster_rules',
|
||||||
|
'kibana.node_actions': 'kibana.stack_monitoring.node_actions',
|
||||||
|
'kibana.node_rules': 'kibana.stack_monitoring.node_rules',
|
||||||
|
'kibana.stats': 'kibana.stack_monitoring.stats',
|
||||||
|
'kibana.status': 'kibana.stack_monitoring.status',
|
||||||
|
'logstash.node_cel': 'logstash.stack_monitoring.node',
|
||||||
|
'logstash.node_stats': 'logstash.stack_monitoring.node_stats',
|
||||||
|
'synthetics.browser': 'synthetics-browser',
|
||||||
|
'synthetics.browser_network': 'synthetics-browser.network',
|
||||||
|
'synthetics.browser_screenshot': 'synthetics-browser.screenshot',
|
||||||
|
'synthetics.http': 'synthetics-http',
|
||||||
|
'synthetics.icmp': 'synthetics-icmp',
|
||||||
|
'synthetics.tcp': 'synthetics-tcp',
|
||||||
|
'swimlane.swimlane_api': 'swimlane.api',
|
||||||
|
'swimlane.tenant_api': 'swimlane.tenant',
|
||||||
|
'swimlane.turbine_api': 'turbine.api'
|
||||||
|
} %}
|
||||||
|
|
||||||
|
{% for pkg in ADDON_PACKAGE_COMPONENTS %}
|
||||||
|
{% if pkg.name in CORE_ESFLEET_PACKAGES %}
|
||||||
|
{# skip core integrations #}
|
||||||
|
{% elif pkg.name not in CORE_ESFLEET_PACKAGES %}
|
||||||
|
{# generate defaults for each integration #}
|
||||||
|
{% if pkg.es_index_patterns is defined and pkg.es_index_patterns is not none %}
|
||||||
|
{% for pattern in pkg.es_index_patterns %}
|
||||||
|
{% if "metrics-" in pattern.name %}
|
||||||
|
{% set integration_type = "metrics-" %}
|
||||||
|
{% elif "logs-" in pattern.name %}
|
||||||
|
{% set integration_type = "logs-" %}
|
||||||
|
{% else %}
|
||||||
|
{% set integration_type = "" %}
|
||||||
|
{% endif %}
|
||||||
|
{% set component_name = pkg.name ~ "." ~ pattern.title %}
|
||||||
|
{% set index_pattern = pattern.name %}
|
||||||
|
|
||||||
|
{# fix weirdly named components #}
|
||||||
|
{% if component_name in WEIRD_INTEGRATIONS %}
|
||||||
|
{% set component_name = WEIRD_INTEGRATIONS[component_name] %}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{# create duplicate of component_name, so we can split generics from @custom component templates in the index template below and overwrite the default @package when needed
|
||||||
|
eg. having to replace unifiedlogs.generic@package with filestream.generic@package, but keep the ability to customize unifiedlogs.generic@custom and its ILM policy #}
|
||||||
|
{% set custom_component_name = component_name %}
|
||||||
|
|
||||||
|
{# duplicate integration_type to assist with sometimes needing to overwrite component templates with 'logs-filestream.generic@package' (there is no metrics-filestream.generic@package) #}
|
||||||
|
{% set generic_integration_type = integration_type %}
|
||||||
|
|
||||||
|
{# component_name_x maintains the functionality of merging local pillar changes with generated 'defaults' via SOC UI #}
|
||||||
|
{% set component_name_x = component_name.replace(".","_x_") %}
|
||||||
|
{# pillar overrides/merge expects the key names to follow the naming in elasticsearch/defaults.yaml eg. so-logs-1password_x_item_usages . The _x_ is replaced later on in elasticsearch/template.map.jinja #}
|
||||||
|
{% set integration_key = "so-" ~ integration_type ~ component_name_x %}
|
||||||
|
|
||||||
|
{# if its a .generic template make sure that a .generic@package for the integration exists. Else default to logs-filestream.generic@package #}
|
||||||
|
{% if ".generic" in component_name and integration_type ~ component_name ~ "@package" not in INSTALLED_COMPONENT_TEMPLATES %}
|
||||||
|
{# these generic templates by default are directed to index_pattern of 'logs-generic-*', overwrite that here to point to eg gcp_pubsub.generic-* #}
|
||||||
|
{% set index_pattern = integration_type ~ component_name ~ "-*" %}
|
||||||
|
{# includes use of .generic component template, but it doesn't exist in installed component templates. Redirect it to filestream.generic@package #}
|
||||||
|
{% set component_name = "filestream.generic" %}
|
||||||
|
{% set generic_integration_type = "logs-" %}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{# Default integration settings #}
|
||||||
|
{% set integration_defaults = {
|
||||||
|
"index_sorting": false,
|
||||||
|
"index_template": {
|
||||||
|
"composed_of": [generic_integration_type ~ component_name ~ "@package", integration_type ~ custom_component_name ~ "@custom", "so-fleet_integrations.ip_mappings-1", "so-fleet_globals-1", "so-fleet_agent_id_verification-1"],
|
||||||
|
"data_stream": {
|
||||||
|
"allow_custom_routing": false,
|
||||||
|
"hidden": false
|
||||||
|
},
|
||||||
|
"ignore_missing_component_templates": [integration_type ~ custom_component_name ~ "@custom"],
|
||||||
|
"index_patterns": [index_pattern],
|
||||||
|
"priority": 501,
|
||||||
|
"template": {
|
||||||
|
"settings": {
|
||||||
|
"index": {
|
||||||
|
"lifecycle": {"name": "so-" ~ integration_type ~ custom_component_name ~ "-logs"},
|
||||||
|
"number_of_replicas": 0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"policy": {
|
||||||
|
"phases": {
|
||||||
|
"cold": {
|
||||||
|
"actions": {
|
||||||
|
"allocate":{
|
||||||
|
"number_of_replicas": ""
|
||||||
|
},
|
||||||
|
"set_priority": {"priority": 0}
|
||||||
|
},
|
||||||
|
"min_age": "60d"
|
||||||
|
},
|
||||||
|
"delete": {
|
||||||
|
"actions": {
|
||||||
|
"delete": {}
|
||||||
|
},
|
||||||
|
"min_age": "365d"
|
||||||
|
},
|
||||||
|
"hot": {
|
||||||
|
"actions": {
|
||||||
|
"rollover": {
|
||||||
|
"max_age": "30d",
|
||||||
|
"max_primary_shard_size": "50gb"
|
||||||
|
},
|
||||||
|
"forcemerge":{
|
||||||
|
"max_num_segments": ""
|
||||||
|
},
|
||||||
|
"shrink":{
|
||||||
|
"max_primary_shard_size": "",
|
||||||
|
"method": "COUNT",
|
||||||
|
"number_of_shards": ""
|
||||||
|
},
|
||||||
|
"set_priority": {"priority": 100}
|
||||||
|
},
|
||||||
|
"min_age": "0ms"
|
||||||
|
},
|
||||||
|
"warm": {
|
||||||
|
"actions": {
|
||||||
|
"allocate": {
|
||||||
|
"number_of_replicas": ""
|
||||||
|
},
|
||||||
|
"forcemerge": {
|
||||||
|
"max_num_segments": ""
|
||||||
|
},
|
||||||
|
"shrink":{
|
||||||
|
"max_primary_shard_size": "",
|
||||||
|
"method": "COUNT",
|
||||||
|
"number_of_shards": ""
|
||||||
|
},
|
||||||
|
"set_priority": {"priority": 50}
|
||||||
|
},
|
||||||
|
"min_age": "30d"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} %}
|
||||||
|
|
||||||
|
{% do ADDON_INTEGRATION_DEFAULTS.update({integration_key: integration_defaults}) %}
|
||||||
|
{% endfor %}
|
||||||
|
{% endif %}
|
||||||
|
{% endif %}
|
||||||
|
{% endfor %}
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
elasticfleet:
|
elasticfleet:
|
||||||
enabled:
|
enabled:
|
||||||
description: You can enable or disable Elastic Fleet.
|
description: Enables or disables the Elastic Fleet process. This process is critical for managing Elastic Agents.
|
||||||
advanced: True
|
advanced: True
|
||||||
helpLink: elastic-fleet.html
|
helpLink: elastic-fleet.html
|
||||||
enable_manager_output:
|
enable_manager_output:
|
||||||
@@ -9,6 +9,24 @@ elasticfleet:
|
|||||||
global: True
|
global: True
|
||||||
forcedType: bool
|
forcedType: bool
|
||||||
helpLink: elastic-fleet.html
|
helpLink: elastic-fleet.html
|
||||||
|
files:
|
||||||
|
soc:
|
||||||
|
elastic-defend-disabled-filters__yaml:
|
||||||
|
title: Disabled Elastic Defend filters
|
||||||
|
description: Enter the ID of the filter that should be disabled.
|
||||||
|
syntax: yaml
|
||||||
|
file: True
|
||||||
|
global: True
|
||||||
|
helpLink: elastic-fleet.html
|
||||||
|
advanced: True
|
||||||
|
elastic-defend-custom-filters__yaml:
|
||||||
|
title: Custom Elastic Defend filters
|
||||||
|
description: Enter custom filters seperated by ---
|
||||||
|
syntax: yaml
|
||||||
|
file: True
|
||||||
|
global: True
|
||||||
|
helpLink: elastic-fleet.html
|
||||||
|
advanced: True
|
||||||
logging:
|
logging:
|
||||||
zeek:
|
zeek:
|
||||||
excluded:
|
excluded:
|
||||||
@@ -16,6 +34,62 @@ elasticfleet:
|
|||||||
forcedType: "[]string"
|
forcedType: "[]string"
|
||||||
helpLink: zeek.html
|
helpLink: zeek.html
|
||||||
config:
|
config:
|
||||||
|
defend_filters:
|
||||||
|
enable_auto_configuration:
|
||||||
|
description: Enable auto-configuration and management of the Elastic Defend Exclusion filters.
|
||||||
|
global: True
|
||||||
|
helpLink: elastic-fleet.html
|
||||||
|
advanced: True
|
||||||
|
subscription_integrations:
|
||||||
|
description: Enable the installation of integrations that require an Elastic license.
|
||||||
|
global: True
|
||||||
|
forcedType: bool
|
||||||
|
helpLink: elastic-fleet.html
|
||||||
|
auto_upgrade_integrations:
|
||||||
|
description: Enables or disables automatically upgrading Elastic Agent integrations.
|
||||||
|
global: True
|
||||||
|
forcedType: bool
|
||||||
|
helpLink: elastic-fleet.html
|
||||||
|
outputs:
|
||||||
|
logstash:
|
||||||
|
bulk_max_size:
|
||||||
|
description: The maximum number of events to bulk in a single Logstash request.
|
||||||
|
global: True
|
||||||
|
forcedType: int
|
||||||
|
advanced: True
|
||||||
|
helpLink: elastic-fleet.html
|
||||||
|
worker:
|
||||||
|
description: The number of workers per configured host publishing events.
|
||||||
|
global: True
|
||||||
|
forcedType: int
|
||||||
|
advanced: true
|
||||||
|
helpLink: elastic-fleet.html
|
||||||
|
queue_mem_events:
|
||||||
|
title: queued events
|
||||||
|
description: The number of events the queue can store. This value should be evenly divisible by the smaller of 'bulk_max_size' to avoid sending partial batches to the output.
|
||||||
|
global: True
|
||||||
|
forcedType: int
|
||||||
|
advanced: True
|
||||||
|
helpLink: elastic-fleet.html
|
||||||
|
timeout:
|
||||||
|
description: The number of seconds to wait for responses from the Logstash server before timing out. Eg 30s
|
||||||
|
regex: ^[0-9]+s$
|
||||||
|
advanced: True
|
||||||
|
global: True
|
||||||
|
helpLink: elastic-fleet.html
|
||||||
|
loadbalance:
|
||||||
|
description: If true and multiple Logstash hosts are configured, the output plugin load balances published events onto all Logstash hosts. If false, the output plugin sends all events to one host (determined at random) and switches to another host if the selected one becomes unresponsive.
|
||||||
|
forcedType: bool
|
||||||
|
advanced: True
|
||||||
|
global: True
|
||||||
|
helpLink: elastic-fleet.html
|
||||||
|
compression_level:
|
||||||
|
description: The gzip compression level. The compression level must be in the range of 1 (best speed) to 9 (best compression).
|
||||||
|
regex: ^[1-9]$
|
||||||
|
forcedType: int
|
||||||
|
advanced: True
|
||||||
|
global: True
|
||||||
|
helpLink: elastic-fleet.html
|
||||||
server:
|
server:
|
||||||
custom_fqdn:
|
custom_fqdn:
|
||||||
description: Custom FQDN for Agents to connect to. One per line.
|
description: Custom FQDN for Agents to connect to. One per line.
|
||||||
|
|||||||
251
salt/elasticfleet/tools/sbin/so-elastic-defend-manage-filters.py
Normal file
251
salt/elasticfleet/tools/sbin/so-elastic-defend-manage-filters.py
Normal file
@@ -0,0 +1,251 @@
|
|||||||
|
from datetime import datetime
|
||||||
|
import sys
|
||||||
|
import getopt
|
||||||
|
from so_elastic_defend_filters_helper import *
|
||||||
|
import logging
|
||||||
|
|
||||||
|
logging.basicConfig(level=logging.INFO, format='%(message)s')
|
||||||
|
|
||||||
|
# Define mappings for Target Field, Event Type, Conditions
|
||||||
|
TARGET_FIELD_MAPPINGS = {
|
||||||
|
"Image": "process.executable",
|
||||||
|
"ParentImage": "process.parent.executable",
|
||||||
|
"CommandLine": "process.command_line",
|
||||||
|
"ParentCommandLine": "process.parent.command_line",
|
||||||
|
"DestinationHostname": "destination.domain",
|
||||||
|
"QueryName": "dns.question.name",
|
||||||
|
"DestinationIp": "destination.ip",
|
||||||
|
"TargetObject": "registry.path",
|
||||||
|
"TargetFilename": "file.path"
|
||||||
|
}
|
||||||
|
|
||||||
|
DATASET_MAPPINGS = {
|
||||||
|
"process_create": "endpoint.events.process",
|
||||||
|
"network_connection": "endpoint.events.network",
|
||||||
|
"file_create": "endpoint.events.file",
|
||||||
|
"file_delete": "endpoint.events.file",
|
||||||
|
"registry_event": "endpoint.events.registry",
|
||||||
|
"dns_query": "endpoint.events.network"
|
||||||
|
}
|
||||||
|
|
||||||
|
CONDITION_MAPPINGS = {
|
||||||
|
"is": ("included", "match"),
|
||||||
|
"end with": ("included", "wildcard"),
|
||||||
|
"begin with": ("included", "wildcard"),
|
||||||
|
"contains": ("included", "wildcard")
|
||||||
|
}
|
||||||
|
|
||||||
|
# Extract entries for a rule
|
||||||
|
def extract_entries(data, event_type):
|
||||||
|
entries = []
|
||||||
|
filter_data = data.get('filter', {})
|
||||||
|
for value in filter_data.values():
|
||||||
|
target_field = TARGET_FIELD_MAPPINGS.get(value.get('TargetField', ''))
|
||||||
|
condition = value.get('Condition', '')
|
||||||
|
pattern = value.get('Pattern', '')
|
||||||
|
|
||||||
|
if condition not in CONDITION_MAPPINGS:
|
||||||
|
logging.error(f"Invalid condition: {condition}")
|
||||||
|
|
||||||
|
# Modify the pattern based on the condition
|
||||||
|
pattern = modify_pattern(condition, pattern)
|
||||||
|
|
||||||
|
operator, match_type = CONDITION_MAPPINGS[condition]
|
||||||
|
|
||||||
|
entries.append({
|
||||||
|
"field": target_field,
|
||||||
|
"operator": operator,
|
||||||
|
"type": match_type,
|
||||||
|
"value": pattern
|
||||||
|
})
|
||||||
|
|
||||||
|
# Add the event.dataset entry from DATASET_MAPPINGS
|
||||||
|
dataset_value = DATASET_MAPPINGS.get(event_type, '')
|
||||||
|
if dataset_value:
|
||||||
|
entries.append({
|
||||||
|
"field": "event.dataset",
|
||||||
|
"operator": "included",
|
||||||
|
"type": "match",
|
||||||
|
"value": dataset_value
|
||||||
|
})
|
||||||
|
else:
|
||||||
|
logging.error(f"No dataset mapping found for event_type: {event_type}")
|
||||||
|
|
||||||
|
return entries
|
||||||
|
|
||||||
|
# Build the JSON
|
||||||
|
def build_json_entry(entries, guid, event_type, context):
|
||||||
|
return {
|
||||||
|
"comments": [],
|
||||||
|
"entries": entries,
|
||||||
|
"item_id": guid,
|
||||||
|
"name": f"SO - {event_type} - {guid}",
|
||||||
|
"description": f"{context}\n\n <<- Note: This filter is managed by Security Onion. ->>",
|
||||||
|
"namespace_type": "agnostic",
|
||||||
|
"tags": ["policy:all"],
|
||||||
|
"type": "simple",
|
||||||
|
"os_types": ["windows"],
|
||||||
|
"entries": entries
|
||||||
|
}
|
||||||
|
|
||||||
|
# Check to see if the rule is disabled
|
||||||
|
# If it is, make sure it is not active
|
||||||
|
def disable_check(guid, disabled_rules, username, password):
|
||||||
|
if guid in disabled_rules:
|
||||||
|
logging.info(f"Rule {guid} is in the disabled rules list, confirming that is is actually disabled...")
|
||||||
|
existing_rule = api_request("GET", guid, username, password)
|
||||||
|
|
||||||
|
if existing_rule:
|
||||||
|
if api_request("DELETE", guid, username, password):
|
||||||
|
logging.info(f"Successfully deleted rule {guid}")
|
||||||
|
return True, "deleted"
|
||||||
|
else:
|
||||||
|
logging.error(f"Error deleting rule {guid}.")
|
||||||
|
return True, "Error deleting"
|
||||||
|
return True, "NOP"
|
||||||
|
return False, None
|
||||||
|
|
||||||
|
def modify_pattern(condition, pattern):
|
||||||
|
"""
|
||||||
|
Modify the pattern based on the condition.
|
||||||
|
- 'end with': Add '*' to the beginning of the pattern.
|
||||||
|
- 'begin with': Add '*' to the end of the pattern.
|
||||||
|
- 'contains': Add '*' to both the beginning and end of the pattern.
|
||||||
|
"""
|
||||||
|
if isinstance(pattern, list):
|
||||||
|
# Apply modification to each pattern in the list if it's a list of patterns
|
||||||
|
return [modify_pattern(condition, p) for p in pattern]
|
||||||
|
|
||||||
|
if condition == "end with":
|
||||||
|
return f"*{pattern}"
|
||||||
|
elif condition == "begin with":
|
||||||
|
return f"{pattern}*"
|
||||||
|
elif condition == "contains":
|
||||||
|
return f"*{pattern}*"
|
||||||
|
return pattern
|
||||||
|
|
||||||
|
|
||||||
|
def process_rule_update_or_create(guid, json_entry, username, password):
|
||||||
|
existing_rule = api_request("GET", guid, username, password)
|
||||||
|
|
||||||
|
if existing_rule:
|
||||||
|
existing_rule_data = extract_relevant_fields(existing_rule)
|
||||||
|
new_rule_data = extract_relevant_fields(json_entry)
|
||||||
|
if generate_hash(existing_rule_data) != generate_hash(new_rule_data):
|
||||||
|
logging.info(f"Updating rule {guid}")
|
||||||
|
json_entry.pop("list_id", None)
|
||||||
|
api_request("PUT", guid, username, password, json_data=json_entry)
|
||||||
|
return "updated"
|
||||||
|
logging.info(f"Rule {guid} is up to date.")
|
||||||
|
return "no_change"
|
||||||
|
else:
|
||||||
|
logging.info(f"Creating new rule {guid}")
|
||||||
|
json_entry["list_id"] = "endpoint_event_filters"
|
||||||
|
api_request("POST", guid, username, password, json_data=json_entry)
|
||||||
|
return "new"
|
||||||
|
|
||||||
|
# Main function for processing rules
|
||||||
|
def process_rules(yaml_files, disabled_rules, username, password):
|
||||||
|
stats = {"rule_count": 0, "new": 0, "updated": 0, "no_change": 0, "disabled": 0, "deleted": 0}
|
||||||
|
for data in yaml_files:
|
||||||
|
logging.info(f"Processing rule: {data.get('id', '')}")
|
||||||
|
event_type = data.get('event_type', '')
|
||||||
|
guid = data.get('id', '')
|
||||||
|
dataset = DATASET_MAPPINGS.get(event_type, '')
|
||||||
|
context = data.get('description', '')
|
||||||
|
|
||||||
|
rule_deleted, state = disable_check(guid, disabled_rules, username, password)
|
||||||
|
if rule_deleted:
|
||||||
|
stats["disabled"] += 1
|
||||||
|
if state == "deleted":
|
||||||
|
stats["deleted"] += 1
|
||||||
|
continue
|
||||||
|
|
||||||
|
# Extract entries and build JSON
|
||||||
|
entries = extract_entries(data, event_type)
|
||||||
|
json_entry = build_json_entry(entries, guid, event_type, context)
|
||||||
|
|
||||||
|
# Process rule creation or update
|
||||||
|
status = process_rule_update_or_create(guid, json_entry, username, password)
|
||||||
|
|
||||||
|
stats[status] += 1
|
||||||
|
stats["rule_count"] += 1
|
||||||
|
return stats
|
||||||
|
|
||||||
|
def parse_args(argv):
|
||||||
|
try:
|
||||||
|
opts, args = getopt.getopt(argv, "i:d:c:f:", ["input=", "disabled=", "credentials=", "flags_file="])
|
||||||
|
except getopt.GetoptError:
|
||||||
|
print("Usage: python so-elastic-defend-manage-filters.py -c <credentials_file> -d <disabled_file> -i <folder_of_yaml_files> [-f <flags_file>]")
|
||||||
|
sys.exit(2)
|
||||||
|
return opts
|
||||||
|
|
||||||
|
def load_flags(file_path):
|
||||||
|
with open(file_path, 'r') as flags_file:
|
||||||
|
return flags_file.read().splitlines()
|
||||||
|
|
||||||
|
def validate_inputs(credentials_file, disabled_file, yaml_directories):
|
||||||
|
if not credentials_file or not disabled_file or not yaml_directories:
|
||||||
|
print("Usage: python so-elastic-defend-manage-filters.py -c <credentials_file> -d <disabled_file> -i <folder_of_yaml_files> [-f <flags_file>]")
|
||||||
|
sys.exit(2)
|
||||||
|
|
||||||
|
def main(argv):
|
||||||
|
credentials_file = ""
|
||||||
|
disabled_file = ""
|
||||||
|
yaml_directories = []
|
||||||
|
|
||||||
|
opts = parse_args(argv)
|
||||||
|
|
||||||
|
for opt, arg in opts:
|
||||||
|
if opt in ("-c", "--credentials"):
|
||||||
|
credentials_file = arg
|
||||||
|
elif opt in ("-d", "--disabled"):
|
||||||
|
disabled_file = arg
|
||||||
|
elif opt in ("-i", "--input"):
|
||||||
|
yaml_directories.append(arg)
|
||||||
|
elif opt in ("-f", "--flags_file"):
|
||||||
|
flags = load_flags(arg)
|
||||||
|
return main(argv + flags)
|
||||||
|
|
||||||
|
timestamp = datetime.now().strftime('%Y-%m-%d %H:%M:%S')
|
||||||
|
logging.info(f"\n{timestamp}")
|
||||||
|
|
||||||
|
validate_inputs(credentials_file, disabled_file, yaml_directories)
|
||||||
|
|
||||||
|
credentials = load_credentials(credentials_file)
|
||||||
|
if not credentials:
|
||||||
|
raise Exception("Failed to load credentials")
|
||||||
|
|
||||||
|
username, password = extract_auth_details(credentials)
|
||||||
|
if not username or not password:
|
||||||
|
raise Exception("Invalid credentials format")
|
||||||
|
|
||||||
|
custom_rules_input = '/opt/so/conf/elastic-fleet/defend-exclusions/rulesets/custom-filters-raw'
|
||||||
|
custom_rules_output = '/opt/so/conf/elastic-fleet/defend-exclusions/rulesets/custom-filters'
|
||||||
|
prepare_custom_rules(custom_rules_input, custom_rules_output)
|
||||||
|
disabled_rules = load_disabled(disabled_file)
|
||||||
|
|
||||||
|
total_stats = {"rule_count": 0, "new": 0, "updated": 0, "no_change": 0, "disabled": 0, "deleted": 0}
|
||||||
|
|
||||||
|
for yaml_dir in yaml_directories:
|
||||||
|
yaml_files = load_yaml_files(yaml_dir)
|
||||||
|
stats = process_rules(yaml_files, disabled_rules, username, password)
|
||||||
|
|
||||||
|
for key in total_stats:
|
||||||
|
total_stats[key] += stats[key]
|
||||||
|
|
||||||
|
logging.info(f"\nProcessing Summary")
|
||||||
|
logging.info(f" - Total processed rules: {total_stats['rule_count']}")
|
||||||
|
logging.info(f" - New rules: {total_stats['new']}")
|
||||||
|
logging.info(f" - Updated rules: {total_stats['updated']}")
|
||||||
|
logging.info(f" - Disabled rules: {total_stats['deleted']}")
|
||||||
|
logging.info(f" - Rules with no changes: {total_stats['no_change']}")
|
||||||
|
logging.info(f"Rule status Summary")
|
||||||
|
logging.info(f" - Active rules: {total_stats['rule_count'] - total_stats['disabled']}")
|
||||||
|
logging.info(f" - Disabled rules: {total_stats['disabled']}")
|
||||||
|
timestamp = datetime.now().strftime('%Y-%m-%d %H:%M:%S')
|
||||||
|
logging.info(f"Execution completed at: {timestamp}")
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
main(sys.argv[1:])
|
||||||
@@ -23,6 +23,13 @@ fi
|
|||||||
# Define a banner to separate sections
|
# Define a banner to separate sections
|
||||||
banner="========================================================================="
|
banner="========================================================================="
|
||||||
|
|
||||||
|
fleet_api() {
|
||||||
|
local QUERYPATH=$1
|
||||||
|
shift
|
||||||
|
|
||||||
|
curl -sK /opt/so/conf/elasticsearch/curl.config -L "localhost:5601/api/fleet/${QUERYPATH}" "$@" --retry 3 --retry-delay 10 --fail 2>/dev/null
|
||||||
|
}
|
||||||
|
|
||||||
elastic_fleet_integration_check() {
|
elastic_fleet_integration_check() {
|
||||||
|
|
||||||
AGENT_POLICY=$1
|
AGENT_POLICY=$1
|
||||||
@@ -39,7 +46,9 @@ elastic_fleet_integration_create() {
|
|||||||
|
|
||||||
JSON_STRING=$1
|
JSON_STRING=$1
|
||||||
|
|
||||||
curl -K /opt/so/conf/elasticsearch/curl.config -L -X POST "localhost:5601/api/fleet/package_policies" -H 'kbn-xsrf: true' -H 'Content-Type: application/json' -d "$JSON_STRING"
|
if ! fleet_api "package_policies" -H 'kbn-xsrf: true' -H 'Content-Type: application/json' -XPOST -d "$JSON_STRING"; then
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -56,7 +65,10 @@ elastic_fleet_integration_remove() {
|
|||||||
'{"packagePolicyIds":[$INTEGRATIONID]}'
|
'{"packagePolicyIds":[$INTEGRATIONID]}'
|
||||||
)
|
)
|
||||||
|
|
||||||
curl -K /opt/so/conf/elasticsearch/curl.config -L -X POST "localhost:5601/api/fleet/package_policies/delete" -H 'kbn-xsrf: true' -H 'Content-Type: application/json' -d "$JSON_STRING"
|
if ! fleet_api "package_policies/delete" -XPOST -H 'kbn-xsrf: true' -H 'Content-Type: application/json' -d "$JSON_STRING"; then
|
||||||
|
echo "Error: Unable to delete '$NAME' from '$AGENT_POLICY'"
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
elastic_fleet_integration_update() {
|
elastic_fleet_integration_update() {
|
||||||
@@ -65,7 +77,9 @@ elastic_fleet_integration_update() {
|
|||||||
|
|
||||||
JSON_STRING=$2
|
JSON_STRING=$2
|
||||||
|
|
||||||
curl -K /opt/so/conf/elasticsearch/curl.config -L -X PUT "localhost:5601/api/fleet/package_policies/$UPDATE_ID" -H 'kbn-xsrf: true' -H 'Content-Type: application/json' -d "$JSON_STRING"
|
if ! fleet_api "package_policies/$UPDATE_ID" -H 'kbn-xsrf: true' -H 'Content-Type: application/json' -XPUT -d "$JSON_STRING"; then
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
elastic_fleet_integration_policy_upgrade() {
|
elastic_fleet_integration_policy_upgrade() {
|
||||||
@@ -77,29 +91,117 @@ elastic_fleet_integration_policy_upgrade() {
|
|||||||
'{"packagePolicyIds":[$INTEGRATIONID]}'
|
'{"packagePolicyIds":[$INTEGRATIONID]}'
|
||||||
)
|
)
|
||||||
|
|
||||||
curl -K /opt/so/conf/elasticsearch/curl.config -L -X POST "localhost:5601/api/fleet/package_policies/upgrade" -H 'kbn-xsrf: true' -H 'Content-Type: application/json' -d "$JSON_STRING"
|
if ! fleet_api "package_policies/upgrade" -XPOST -H 'kbn-xsrf: true' -H 'Content-Type: application/json' -d "$JSON_STRING"; then
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
elastic_fleet_package_version_check() {
|
elastic_fleet_package_version_check() {
|
||||||
PACKAGE=$1
|
PACKAGE=$1
|
||||||
curl -s -K /opt/so/conf/elasticsearch/curl.config -b "sid=$SESSIONCOOKIE" -L -X GET "localhost:5601/api/fleet/epm/packages/$PACKAGE" | jq -r '.item.version'
|
|
||||||
|
if output=$(fleet_api "epm/packages/$PACKAGE"); then
|
||||||
|
echo "$output" | jq -r '.item.version'
|
||||||
|
else
|
||||||
|
echo "Error: Failed to get current package version for '$PACKAGE'"
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
elastic_fleet_package_latest_version_check() {
|
elastic_fleet_package_latest_version_check() {
|
||||||
PACKAGE=$1
|
PACKAGE=$1
|
||||||
curl -s -K /opt/so/conf/elasticsearch/curl.config -b "sid=$SESSIONCOOKIE" -L -X GET "localhost:5601/api/fleet/epm/packages/$PACKAGE" | jq -r '.item.latestVersion'
|
if output=$(fleet_api "epm/packages/$PACKAGE"); then
|
||||||
|
if version=$(jq -e -r '.item.latestVersion' <<< $output); then
|
||||||
|
echo "$version"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo "Error: Failed to get latest version for '$PACKAGE'"
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
elastic_fleet_package_install() {
|
elastic_fleet_package_install() {
|
||||||
PKG=$1
|
PKG=$1
|
||||||
VERSION=$2
|
VERSION=$2
|
||||||
curl -s -K /opt/so/conf/elasticsearch/curl.config -b "sid=$SESSIONCOOKIE" -L -X POST -H 'kbn-xsrf: true' -H 'Content-Type: application/json' -d '{"force":true}' "localhost:5601/api/fleet/epm/packages/$PKG/$VERSION"
|
if ! fleet_api "epm/packages/$PKG/$VERSION" -XPOST -H 'kbn-xsrf: true' -H 'Content-Type: application/json' -d '{"force":true}'; then
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
elastic_fleet_package_is_installed() {
|
elastic_fleet_bulk_package_install() {
|
||||||
PACKAGE=$1
|
BULK_PKG_LIST=$1
|
||||||
curl -s -K /opt/so/conf/elasticsearch/curl.config -b "sid=$SESSIONCOOKIE" -L -X GET -H 'kbn-xsrf: true' "localhost:5601/api/fleet/epm/packages/$PACKAGE" | jq -r '.item.status'
|
if ! fleet_api "epm/packages/_bulk" -XPOST -H 'kbn-xsrf: true' -H 'Content-Type: application/json' -d@$BULK_PKG_LIST; then
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
elastic_fleet_installed_packages() {
|
||||||
|
if ! fleet_api "epm/packages/installed?perPage=500"; then
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
elastic_fleet_agent_policy_ids() {
|
||||||
|
if output=$(fleet_api "agent_policies"); then
|
||||||
|
echo "$output" | jq -r .items[].id
|
||||||
|
else
|
||||||
|
echo "Error: Failed to retrieve agent policies."
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
elastic_fleet_integration_policy_names() {
|
||||||
|
AGENT_POLICY=$1
|
||||||
|
if output=$(fleet_api "agent_policies/$AGENT_POLICY"); then
|
||||||
|
echo "$output" | jq -r .item.package_policies[].name
|
||||||
|
else
|
||||||
|
echo "Error: Failed to retrieve integrations for '$AGENT_POLICY'."
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
elastic_fleet_integration_policy_package_name() {
|
||||||
|
AGENT_POLICY=$1
|
||||||
|
INTEGRATION=$2
|
||||||
|
if output=$(fleet_api "agent_policies/$AGENT_POLICY"); then
|
||||||
|
echo "$output" | jq -r --arg INTEGRATION "$INTEGRATION" '.item.package_policies[] | select(.name==$INTEGRATION)| .package.name'
|
||||||
|
else
|
||||||
|
echo "Error: Failed to retrieve package name for '$INTEGRATION' in '$AGENT_POLICY'."
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
elastic_fleet_integration_policy_package_version() {
|
||||||
|
AGENT_POLICY=$1
|
||||||
|
INTEGRATION=$2
|
||||||
|
|
||||||
|
if output=$(fleet_api "agent_policies/$AGENT_POLICY"); then
|
||||||
|
if version=$(jq -e -r --arg INTEGRATION "$INTEGRATION" '.item.package_policies[] | select(.name==$INTEGRATION)| .package.version' <<< "$output"); then
|
||||||
|
echo "$version"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo "Error: Failed to retrieve integration version for '$INTEGRATION' in policy '$AGENT_POLICY'"
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
elastic_fleet_integration_id() {
|
||||||
|
AGENT_POLICY=$1
|
||||||
|
INTEGRATION=$2
|
||||||
|
if output=$(fleet_api "agent_policies/$AGENT_POLICY"); then
|
||||||
|
echo "$output" | jq -r --arg INTEGRATION "$INTEGRATION" '.item.package_policies[] | select(.name==$INTEGRATION)| .id'
|
||||||
|
else
|
||||||
|
echo "Error: Failed to retrieve integration ID for '$INTEGRATION' in '$AGENT_POLICY'."
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
elastic_fleet_integration_policy_dryrun_upgrade() {
|
||||||
|
INTEGRATION_ID=$1
|
||||||
|
if ! fleet_api "package_policies/upgrade/dryrun" -H "Content-Type: application/json" -H 'kbn-xsrf: true' -XPOST -d "{\"packagePolicyIds\":[\"$INTEGRATION_ID\"]}"; then
|
||||||
|
echo "Error: Failed to complete dry run for '$INTEGRATION_ID'."
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
elastic_fleet_policy_create() {
|
elastic_fleet_policy_create() {
|
||||||
@@ -107,25 +209,18 @@ elastic_fleet_policy_create() {
|
|||||||
NAME=$1
|
NAME=$1
|
||||||
DESC=$2
|
DESC=$2
|
||||||
FLEETSERVER=$3
|
FLEETSERVER=$3
|
||||||
TIMEOUT=$4
|
TIMEOUT=$4
|
||||||
|
|
||||||
JSON_STRING=$( jq -n \
|
JSON_STRING=$( jq -n \
|
||||||
--arg NAME "$NAME" \
|
--arg NAME "$NAME" \
|
||||||
--arg DESC "$DESC" \
|
--arg DESC "$DESC" \
|
||||||
--arg TIMEOUT $TIMEOUT \
|
--arg TIMEOUT $TIMEOUT \
|
||||||
--arg FLEETSERVER "$FLEETSERVER" \
|
--arg FLEETSERVER "$FLEETSERVER" \
|
||||||
'{"name": $NAME,"id":$NAME,"description":$DESC,"namespace":"default","monitoring_enabled":["logs"],"inactivity_timeout":$TIMEOUT,"has_fleet_server":$FLEETSERVER}'
|
'{"name": $NAME,"id":$NAME,"description":$DESC,"namespace":"default","monitoring_enabled":["logs"],"inactivity_timeout":$TIMEOUT,"has_fleet_server":$FLEETSERVER}'
|
||||||
)
|
)
|
||||||
# Create Fleet Policy
|
# Create Fleet Policy
|
||||||
curl -K /opt/so/conf/elasticsearch/curl.config -L -X POST "localhost:5601/api/fleet/agent_policies" -H 'kbn-xsrf: true' -H 'Content-Type: application/json' -d "$JSON_STRING"
|
if ! fleet_api "agent_policies" -XPOST -H 'kbn-xsrf: true' -H 'Content-Type: application/json' -d "$JSON_STRING"; then
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
elastic_fleet_policy_update() {
|
|
||||||
|
|
||||||
POLICYID=$1
|
|
||||||
JSON_STRING=$2
|
|
||||||
|
|
||||||
curl -K /opt/so/conf/elasticsearch/curl.config -L -X PUT "localhost:5601/api/fleet/agent_policies/$POLICYID" -H 'kbn-xsrf: true' -H 'Content-Type: application/json' -d "$JSON_STRING"
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|||||||
@@ -8,6 +8,7 @@
|
|||||||
|
|
||||||
. /usr/sbin/so-elastic-fleet-common
|
. /usr/sbin/so-elastic-fleet-common
|
||||||
|
|
||||||
|
ERROR=false
|
||||||
# Manage Elastic Defend Integration for Initial Endpoints Policy
|
# Manage Elastic Defend Integration for Initial Endpoints Policy
|
||||||
for INTEGRATION in /opt/so/conf/elastic-fleet/integrations/elastic-defend/*.json
|
for INTEGRATION in /opt/so/conf/elastic-fleet/integrations/elastic-defend/*.json
|
||||||
do
|
do
|
||||||
@@ -15,9 +16,20 @@ do
|
|||||||
elastic_fleet_integration_check "endpoints-initial" "$INTEGRATION"
|
elastic_fleet_integration_check "endpoints-initial" "$INTEGRATION"
|
||||||
if [ -n "$INTEGRATION_ID" ]; then
|
if [ -n "$INTEGRATION_ID" ]; then
|
||||||
printf "\n\nIntegration $NAME exists - Upgrading integration policy\n"
|
printf "\n\nIntegration $NAME exists - Upgrading integration policy\n"
|
||||||
elastic_fleet_integration_policy_upgrade "$INTEGRATION_ID"
|
if ! elastic_fleet_integration_policy_upgrade "$INTEGRATION_ID"; then
|
||||||
|
echo -e "\nFailed to upgrade integration policy for ${INTEGRATION##*/}"
|
||||||
|
ERROR=true
|
||||||
|
continue
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
printf "\n\nIntegration does not exist - Creating integration\n"
|
printf "\n\nIntegration does not exist - Creating integration\n"
|
||||||
elastic_fleet_integration_create "@$INTEGRATION"
|
if ! elastic_fleet_integration_create "@$INTEGRATION"; then
|
||||||
|
echo -e "\nFailed to create integration for ${INTEGRATION##*/}"
|
||||||
|
ERROR=true
|
||||||
|
continue
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
if [[ "$ERROR" == "true" ]]; then
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
# Copyright Security Onion Solutions LLC and/or licensed to Security Onion Solutions LLC under one
|
||||||
|
# or more contributor license agreements. Licensed under the Elastic License 2.0 as shown at
|
||||||
|
# https://securityonion.net/license; you may not use this file except in compliance with the
|
||||||
|
# Elastic License 2.0.
|
||||||
|
|
||||||
|
. /usr/sbin/so-elastic-fleet-common
|
||||||
|
|
||||||
|
# Get all the fleet policies
|
||||||
|
json_output=$(curl -s -K /opt/so/conf/elasticsearch/curl.config -L -X GET "localhost:5601/api/fleet/agent_policies" -H 'kbn-xsrf: true')
|
||||||
|
|
||||||
|
# Extract the IDs that start with "FleetServer_"
|
||||||
|
POLICY=$(echo "$json_output" | jq -r '.items[] | select(.id | startswith("FleetServer_")) | .id')
|
||||||
|
|
||||||
|
# Iterate over each ID in the POLICY variable
|
||||||
|
for POLICYNAME in $POLICY; do
|
||||||
|
printf "\nUpdating Policy: $POLICYNAME\n"
|
||||||
|
|
||||||
|
# First get the Integration ID
|
||||||
|
INTEGRATION_ID=$(/usr/sbin/so-elastic-fleet-agent-policy-view "$POLICYNAME" | jq -r '.item.package_policies[] | select(.package.name == "fleet_server") | .id')
|
||||||
|
|
||||||
|
# Modify the default integration policy to update the policy_id and an with the correct naming
|
||||||
|
UPDATED_INTEGRATION_POLICY=$(jq --arg policy_id "$POLICYNAME" --arg name "fleet_server-$POLICYNAME" '
|
||||||
|
.policy_id = $policy_id |
|
||||||
|
.name = $name' /opt/so/conf/elastic-fleet/integrations/fleet-server/fleet-server.json)
|
||||||
|
|
||||||
|
# Now update the integration policy using the modified JSON
|
||||||
|
if ! elastic_fleet_integration_update "$INTEGRATION_ID" "$UPDATED_INTEGRATION_POLICY"; then
|
||||||
|
# exit 1 on failure to update fleet integration policies, let salt handle retries
|
||||||
|
echo "Failed to update $POLICYNAME.."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
done
|
||||||
@@ -12,9 +12,11 @@ if [ ! -f /opt/so/state/eaintegrations.txt ]; then
|
|||||||
# First, check for any package upgrades
|
# First, check for any package upgrades
|
||||||
/usr/sbin/so-elastic-fleet-package-upgrade
|
/usr/sbin/so-elastic-fleet-package-upgrade
|
||||||
|
|
||||||
# Second, configure Elastic Defend Integration seperately
|
# Second, update Fleet Server policies
|
||||||
/usr/sbin/so-elastic-fleet-integration-policy-elastic-defend
|
/usr/sbin/so-elastic-fleet-integration-policy-elastic-fleet-server
|
||||||
|
|
||||||
|
# Third, configure Elastic Defend Integration seperately
|
||||||
|
/usr/sbin/so-elastic-fleet-integration-policy-elastic-defend
|
||||||
# Initial Endpoints
|
# Initial Endpoints
|
||||||
for INTEGRATION in /opt/so/conf/elastic-fleet/integrations/endpoints-initial/*.json
|
for INTEGRATION in /opt/so/conf/elastic-fleet/integrations/endpoints-initial/*.json
|
||||||
do
|
do
|
||||||
@@ -22,10 +24,18 @@ if [ ! -f /opt/so/state/eaintegrations.txt ]; then
|
|||||||
elastic_fleet_integration_check "endpoints-initial" "$INTEGRATION"
|
elastic_fleet_integration_check "endpoints-initial" "$INTEGRATION"
|
||||||
if [ -n "$INTEGRATION_ID" ]; then
|
if [ -n "$INTEGRATION_ID" ]; then
|
||||||
printf "\n\nIntegration $NAME exists - Updating integration\n"
|
printf "\n\nIntegration $NAME exists - Updating integration\n"
|
||||||
elastic_fleet_integration_update "$INTEGRATION_ID" "@$INTEGRATION"
|
if ! elastic_fleet_integration_update "$INTEGRATION_ID" "@$INTEGRATION"; then
|
||||||
|
echo -e "\nFailed to update integration for ${INTEGRATION##*/}"
|
||||||
|
RETURN_CODE=1
|
||||||
|
continue
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
printf "\n\nIntegration does not exist - Creating integration\n"
|
printf "\n\nIntegration does not exist - Creating integration\n"
|
||||||
elastic_fleet_integration_create "@$INTEGRATION"
|
if ! elastic_fleet_integration_create "@$INTEGRATION"; then
|
||||||
|
echo -e "\nFailed to create integration for ${INTEGRATION##*/}"
|
||||||
|
RETURN_CODE=1
|
||||||
|
continue
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
@@ -36,10 +46,18 @@ if [ ! -f /opt/so/state/eaintegrations.txt ]; then
|
|||||||
elastic_fleet_integration_check "so-grid-nodes_general" "$INTEGRATION"
|
elastic_fleet_integration_check "so-grid-nodes_general" "$INTEGRATION"
|
||||||
if [ -n "$INTEGRATION_ID" ]; then
|
if [ -n "$INTEGRATION_ID" ]; then
|
||||||
printf "\n\nIntegration $NAME exists - Updating integration\n"
|
printf "\n\nIntegration $NAME exists - Updating integration\n"
|
||||||
elastic_fleet_integration_update "$INTEGRATION_ID" "@$INTEGRATION"
|
if ! elastic_fleet_integration_update "$INTEGRATION_ID" "@$INTEGRATION"; then
|
||||||
|
echo -e "\nFailed to update integration for ${INTEGRATION##*/}"
|
||||||
|
RETURN_CODE=1
|
||||||
|
continue
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
printf "\n\nIntegration does not exist - Creating integration\n"
|
printf "\n\nIntegration does not exist - Creating integration\n"
|
||||||
elastic_fleet_integration_create "@$INTEGRATION"
|
if ! elastic_fleet_integration_create "@$INTEGRATION"; then
|
||||||
|
echo -e "\nFailed to create integration for ${INTEGRATION##*/}"
|
||||||
|
RETURN_CODE=1
|
||||||
|
continue
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
if [[ "$RETURN_CODE" != "1" ]]; then
|
if [[ "$RETURN_CODE" != "1" ]]; then
|
||||||
@@ -53,11 +71,19 @@ if [ ! -f /opt/so/state/eaintegrations.txt ]; then
|
|||||||
elastic_fleet_integration_check "so-grid-nodes_heavy" "$INTEGRATION"
|
elastic_fleet_integration_check "so-grid-nodes_heavy" "$INTEGRATION"
|
||||||
if [ -n "$INTEGRATION_ID" ]; then
|
if [ -n "$INTEGRATION_ID" ]; then
|
||||||
printf "\n\nIntegration $NAME exists - Updating integration\n"
|
printf "\n\nIntegration $NAME exists - Updating integration\n"
|
||||||
elastic_fleet_integration_update "$INTEGRATION_ID" "@$INTEGRATION"
|
if ! elastic_fleet_integration_update "$INTEGRATION_ID" "@$INTEGRATION"; then
|
||||||
|
echo -e "\nFailed to update integration for ${INTEGRATION##*/}"
|
||||||
|
RETURN_CODE=1
|
||||||
|
continue
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
printf "\n\nIntegration does not exist - Creating integration\n"
|
printf "\n\nIntegration does not exist - Creating integration\n"
|
||||||
if [ "$NAME" != "elasticsearch-logs" ]; then
|
if [ "$NAME" != "elasticsearch-logs" ]; then
|
||||||
elastic_fleet_integration_create "@$INTEGRATION"
|
if ! elastic_fleet_integration_create "@$INTEGRATION"; then
|
||||||
|
echo -e "\nFailed to create integration for ${INTEGRATION##*/}"
|
||||||
|
RETURN_CODE=1
|
||||||
|
continue
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
@@ -74,11 +100,19 @@ if [ ! -f /opt/so/state/eaintegrations.txt ]; then
|
|||||||
elastic_fleet_integration_check "$FLEET_POLICY" "$INTEGRATION"
|
elastic_fleet_integration_check "$FLEET_POLICY" "$INTEGRATION"
|
||||||
if [ -n "$INTEGRATION_ID" ]; then
|
if [ -n "$INTEGRATION_ID" ]; then
|
||||||
printf "\n\nIntegration $NAME exists - Updating integration\n"
|
printf "\n\nIntegration $NAME exists - Updating integration\n"
|
||||||
elastic_fleet_integration_update "$INTEGRATION_ID" "@$INTEGRATION"
|
if ! elastic_fleet_integration_update "$INTEGRATION_ID" "@$INTEGRATION"; then
|
||||||
|
echo -e "\nFailed to update integration for ${INTEGRATION##*/}"
|
||||||
|
RETURN_CODE=1
|
||||||
|
continue
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
printf "\n\nIntegration does not exist - Creating integration\n"
|
printf "\n\nIntegration does not exist - Creating integration\n"
|
||||||
if [ "$NAME" != "elasticsearch-logs" ]; then
|
if [ "$NAME" != "elasticsearch-logs" ]; then
|
||||||
elastic_fleet_integration_create "@$INTEGRATION"
|
if ! elastic_fleet_integration_create "@$INTEGRATION"; then
|
||||||
|
echo -e "\nFailed to create integration for ${INTEGRATION##*/}"
|
||||||
|
RETURN_CODE=1
|
||||||
|
continue
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -10,6 +10,6 @@
|
|||||||
SESSIONCOOKIE=$(curl -s -K /opt/so/conf/elasticsearch/curl.config -c - -X GET http://localhost:5601/ | grep sid | awk '{print $7}')
|
SESSIONCOOKIE=$(curl -s -K /opt/so/conf/elasticsearch/curl.config -c - -X GET http://localhost:5601/ | grep sid | awk '{print $7}')
|
||||||
|
|
||||||
# List configured package policies
|
# List configured package policies
|
||||||
curl -s -K /opt/so/conf/elasticsearch/curl.config -b "sid=$SESSIONCOOKIE" -L -X GET "localhost:5601/api/fleet/epm/packages" -H 'kbn-xsrf: true' | jq
|
curl -s -K /opt/so/conf/elasticsearch/curl.config -b "sid=$SESSIONCOOKIE" -L -X GET "localhost:5601/api/fleet/epm/packages?prerelease=true" -H 'kbn-xsrf: true' | jq
|
||||||
|
|
||||||
echo
|
echo
|
||||||
|
|||||||
128
salt/elasticfleet/tools/sbin/so_elastic_defend_filters_helper.py
Normal file
128
salt/elasticfleet/tools/sbin/so_elastic_defend_filters_helper.py
Normal file
@@ -0,0 +1,128 @@
|
|||||||
|
|
||||||
|
import hashlib
|
||||||
|
import os
|
||||||
|
import json
|
||||||
|
import yaml
|
||||||
|
import requests
|
||||||
|
from requests.auth import HTTPBasicAuth
|
||||||
|
import shutil
|
||||||
|
|
||||||
|
# Extract 'entries', 'description' and 'os_types' fields
|
||||||
|
def extract_relevant_fields(filter):
|
||||||
|
return {
|
||||||
|
'entries': filter.get('entries', []),
|
||||||
|
'description': filter.get('description', '')
|
||||||
|
}
|
||||||
|
|
||||||
|
# Sort for consistency, so that a hash can be generated
|
||||||
|
def sorted_data(value):
|
||||||
|
if isinstance(value, dict):
|
||||||
|
# Recursively sort the dictionary by key
|
||||||
|
return {k: sorted_data(v) for k, v in sorted(value.items())}
|
||||||
|
elif isinstance(value, list):
|
||||||
|
# Sort lists; for dictionaries, sort by a specific key
|
||||||
|
return sorted(value, key=lambda x: tuple(sorted(x.items())) if isinstance(x, dict) else x)
|
||||||
|
return value
|
||||||
|
|
||||||
|
# Generate a hash based on sorted relevant fields
|
||||||
|
def generate_hash(data):
|
||||||
|
sorted_data_string = json.dumps(sorted_data(data), sort_keys=True)
|
||||||
|
return hashlib.sha256(sorted_data_string.encode('utf-8')).hexdigest()
|
||||||
|
|
||||||
|
# Load Elasticsearch credentials from the config file
|
||||||
|
def load_credentials(config_path):
|
||||||
|
with open(config_path, 'r') as file:
|
||||||
|
for line in file:
|
||||||
|
if line.startswith("user"):
|
||||||
|
credentials = line.split('=', 1)[1].strip().strip('"')
|
||||||
|
return credentials
|
||||||
|
return None
|
||||||
|
|
||||||
|
# Extract username and password from credentials
|
||||||
|
def extract_auth_details(credentials):
|
||||||
|
if ':' in credentials:
|
||||||
|
return credentials.split(':', 1)
|
||||||
|
return None, None
|
||||||
|
|
||||||
|
# Generalized API request function
|
||||||
|
def api_request(method, guid, username, password, json_data=None):
|
||||||
|
headers = {
|
||||||
|
'kbn-xsrf': 'true',
|
||||||
|
'Content-Type': 'application/json'
|
||||||
|
}
|
||||||
|
auth = HTTPBasicAuth(username, password)
|
||||||
|
|
||||||
|
if method == "POST":
|
||||||
|
url = "http://localhost:5601/api/exception_lists/items?namespace_type=agnostic"
|
||||||
|
else:
|
||||||
|
url = f"http://localhost:5601/api/exception_lists/items?item_id={guid}&namespace_type=agnostic"
|
||||||
|
|
||||||
|
response = requests.request(method, url, headers=headers, auth=auth, json=json_data)
|
||||||
|
|
||||||
|
if response.status_code in [200, 201]:
|
||||||
|
return response.json() if response.content else True
|
||||||
|
elif response.status_code == 404 and method == "GET":
|
||||||
|
return None
|
||||||
|
else:
|
||||||
|
print(f"Error with {method} request: {response.status_code} - {response.text}")
|
||||||
|
return False
|
||||||
|
|
||||||
|
|
||||||
|
# Load YAML data for GUIDs to skip
|
||||||
|
def load_disabled(disabled_file_path):
|
||||||
|
if os.path.exists(disabled_file_path):
|
||||||
|
with open(disabled_file_path, 'r') as file:
|
||||||
|
return yaml.safe_load(file) or {}
|
||||||
|
return {}
|
||||||
|
|
||||||
|
def load_yaml_files(*dirs):
|
||||||
|
yaml_files = []
|
||||||
|
|
||||||
|
for dir_path in dirs:
|
||||||
|
if os.path.isdir(dir_path):
|
||||||
|
# Recurse through the directory and subdirectories
|
||||||
|
for root, dirs, files in os.walk(dir_path):
|
||||||
|
for file_name in files:
|
||||||
|
if file_name.endswith(".yaml"):
|
||||||
|
full_path = os.path.join(root, file_name)
|
||||||
|
with open(full_path, 'r') as f:
|
||||||
|
try:
|
||||||
|
yaml_content = yaml.safe_load(f)
|
||||||
|
yaml_files.append(yaml_content)
|
||||||
|
except yaml.YAMLError as e:
|
||||||
|
print(f"Error loading {full_path}: {e}")
|
||||||
|
else:
|
||||||
|
print(f"Invalid directory: {dir_path}")
|
||||||
|
|
||||||
|
return yaml_files
|
||||||
|
|
||||||
|
def prepare_custom_rules(input_file, output_dir):
|
||||||
|
# Clear the output directory first
|
||||||
|
if os.path.exists(output_dir):
|
||||||
|
shutil.rmtree(output_dir)
|
||||||
|
os.makedirs(output_dir, exist_ok=True)
|
||||||
|
|
||||||
|
try:
|
||||||
|
# Load the YAML file
|
||||||
|
with open(input_file, 'r') as f:
|
||||||
|
docs = yaml.safe_load_all(f)
|
||||||
|
|
||||||
|
for doc in docs:
|
||||||
|
if 'id' not in doc:
|
||||||
|
print(f"Skipping rule, no 'id' found: {doc}")
|
||||||
|
continue
|
||||||
|
if doc.get('title') in ["Template 1", "Template 2"]:
|
||||||
|
print(f"Skipping template rule with title: {doc['title']}")
|
||||||
|
continue
|
||||||
|
# Create a filename using the 'id' field
|
||||||
|
file_name = os.path.join(output_dir, f"{doc['id']}.yaml")
|
||||||
|
|
||||||
|
# Write the individual YAML file
|
||||||
|
with open(file_name, 'w') as output_file:
|
||||||
|
yaml.dump(doc, output_file, default_flow_style=False)
|
||||||
|
print(f"Created file: {file_name}")
|
||||||
|
|
||||||
|
except yaml.YAMLError as e:
|
||||||
|
print(f"Error parsing YAML: {e}")
|
||||||
|
except Exception as e:
|
||||||
|
print(f"Error processing file: {e}")
|
||||||
@@ -13,6 +13,9 @@
|
|||||||
|
|
||||||
LOG="/opt/so/log/elasticfleet/so-elastic-agent-gen-installers.log"
|
LOG="/opt/so/log/elasticfleet/so-elastic-agent-gen-installers.log"
|
||||||
|
|
||||||
|
# get the variables needed such as ELASTIC_AGENT_TARBALL_VERSION
|
||||||
|
get_elastic_agent_vars
|
||||||
|
|
||||||
# Check to see if we are already running
|
# Check to see if we are already running
|
||||||
NUM_RUNNING=$(pgrep -cf "/bin/bash /sbin/so-elastic-agent-gen-installers")
|
NUM_RUNNING=$(pgrep -cf "/bin/bash /sbin/so-elastic-agent-gen-installers")
|
||||||
[ "$NUM_RUNNING" -gt 1 ] && echo "$(date) - $NUM_RUNNING gen installers script processes running...exiting." >>$LOG && exit 0
|
[ "$NUM_RUNNING" -gt 1 ] && echo "$(date) - $NUM_RUNNING gen installers script processes running...exiting." >>$LOG && exit 0
|
||||||
@@ -36,6 +39,7 @@ printf "\n### Creating a temp directory at /nsm/elastic-agent-workspace\n"
|
|||||||
rm -rf /nsm/elastic-agent-workspace
|
rm -rf /nsm/elastic-agent-workspace
|
||||||
mkdir -p /nsm/elastic-agent-workspace
|
mkdir -p /nsm/elastic-agent-workspace
|
||||||
|
|
||||||
|
|
||||||
printf "\n### Extracting outer tarball and then each individual tarball/zip\n"
|
printf "\n### Extracting outer tarball and then each individual tarball/zip\n"
|
||||||
tar -xf /nsm/elastic-fleet/artifacts/elastic-agent_SO-$ELASTIC_AGENT_TARBALL_VERSION.tar.gz -C /nsm/elastic-agent-workspace/
|
tar -xf /nsm/elastic-fleet/artifacts/elastic-agent_SO-$ELASTIC_AGENT_TARBALL_VERSION.tar.gz -C /nsm/elastic-agent-workspace/
|
||||||
unzip -q /nsm/elastic-agent-workspace/elastic-agent-*.zip -d /nsm/elastic-agent-workspace/
|
unzip -q /nsm/elastic-agent-workspace/elastic-agent-*.zip -d /nsm/elastic-agent-workspace/
|
||||||
@@ -72,5 +76,17 @@ do
|
|||||||
printf "\n### $GOOS/$GOARCH Installer Generated...\n"
|
printf "\n### $GOOS/$GOARCH Installer Generated...\n"
|
||||||
done
|
done
|
||||||
|
|
||||||
printf "\n### Cleaning up temp files in /nsm/elastic-agent-workspace\n"
|
printf "\n\n### Generating MSI...\n"
|
||||||
|
cp /opt/so/saltstack/local/salt/elasticfleet/files/so_agent-installers/so-elastic-agent_windows_amd64 /opt/so/saltstack/local/salt/elasticfleet/files/so_agent-installers/so-elastic-agent_windows_amd64.exe
|
||||||
|
docker run \
|
||||||
|
--mount type=bind,source=/opt/so/saltstack/local/salt/elasticfleet/files/so_agent-installers/,target=/output/ -w /output \
|
||||||
|
{{ GLOBALS.registry_host }}:5000/{{ GLOBALS.image_repo }}/so-elastic-agent-builder:{{ GLOBALS.so_version }} wixl -o so-elastic-agent_windows_amd64_msi --arch x64 /workspace/so-elastic-agent.wxs
|
||||||
|
printf "\n### MSI Generated...\n"
|
||||||
|
|
||||||
|
printf "\n### Cleaning up temp files \n"
|
||||||
rm -rf /nsm/elastic-agent-workspace
|
rm -rf /nsm/elastic-agent-workspace
|
||||||
|
rm -rf /opt/so/saltstack/local/salt/elasticfleet/files/so_agent-installers/so-elastic-agent_windows_amd64.exe
|
||||||
|
|
||||||
|
printf "\n### Copying so_agent-installers to /nsm/elastic-fleet/ for nginx.\n"
|
||||||
|
\cp -vr /opt/so/saltstack/local/salt/elasticfleet/files/so_agent-installers/ /nsm/elastic-fleet/
|
||||||
|
chmod 644 /nsm/elastic-fleet/so_agent-installers/*
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
# this file except in compliance with the Elastic License 2.0.
|
# this file except in compliance with the Elastic License 2.0.
|
||||||
|
|
||||||
. /usr/sbin/so-common
|
. /usr/sbin/so-common
|
||||||
|
{%- import_yaml 'elasticsearch/defaults.yaml' as ELASTICSEARCHDEFAULTS %}
|
||||||
|
|
||||||
# Only run on Managers
|
# Only run on Managers
|
||||||
if ! is_manager_node; then
|
if ! is_manager_node; then
|
||||||
@@ -13,7 +14,7 @@ if ! is_manager_node; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Get current list of Grid Node Agents that need to be upgraded
|
# Get current list of Grid Node Agents that need to be upgraded
|
||||||
RAW_JSON=$(curl -K /opt/so/conf/elasticsearch/curl.config -L "http://localhost:5601/api/fleet/agents?perPage=20&page=1&kuery=policy_id%20%3A%20so-grid-nodes_%2A&showInactive=false&showUpgradeable=true&getStatusSummary=true")
|
RAW_JSON=$(curl -K /opt/so/conf/elasticsearch/curl.config -L "http://localhost:5601/api/fleet/agents?perPage=20&page=1&kuery=NOT%20agent.version%20:%20%22{{ELASTICSEARCHDEFAULTS.elasticsearch.version}}%22%20and%20policy_id%20:%20%22so-grid-nodes_general%22&showInactive=false&getStatusSummary=true")
|
||||||
|
|
||||||
# Check to make sure that the server responded with good data - else, bail from script
|
# Check to make sure that the server responded with good data - else, bail from script
|
||||||
CHECKSUM=$(jq -r '.page' <<< "$RAW_JSON")
|
CHECKSUM=$(jq -r '.page' <<< "$RAW_JSON")
|
||||||
@@ -27,10 +28,10 @@ OUTDATED_LIST=$(jq -r '.items | map(.id) | (tojson)' <<< "$RAW_JSON")
|
|||||||
|
|
||||||
if [ "$OUTDATED_LIST" != '[]' ]; then
|
if [ "$OUTDATED_LIST" != '[]' ]; then
|
||||||
AGENTNUMBERS=$(jq -r '.total' <<< "$RAW_JSON")
|
AGENTNUMBERS=$(jq -r '.total' <<< "$RAW_JSON")
|
||||||
printf "Initiating upgrades for $AGENTNUMBERS Agents to Elastic $ELASTIC_AGENT_TARBALL_VERSION...\n\n"
|
printf "Initiating upgrades for $AGENTNUMBERS Agents to Elastic {{ELASTICSEARCHDEFAULTS.elasticsearch.version}}...\n\n"
|
||||||
|
|
||||||
# Generate updated JSON payload
|
# Generate updated JSON payload
|
||||||
JSON_STRING=$(jq -n --arg ELASTICVERSION $ELASTIC_AGENT_TARBALL_VERSION --arg UPDATELIST $OUTDATED_LIST '{"version": $ELASTICVERSION,"agents": $UPDATELIST }')
|
JSON_STRING=$(jq -n --arg ELASTICVERSION {{ELASTICSEARCHDEFAULTS.elasticsearch.version}} --arg UPDATELIST $OUTDATED_LIST '{"version": $ELASTICVERSION,"agents": $UPDATELIST }')
|
||||||
|
|
||||||
# Update Node Agents
|
# Update Node Agents
|
||||||
curl -K /opt/so/conf/elasticsearch/curl.config -L -X POST "http://localhost:5601/api/fleet/agents/bulk_upgrade" -H 'kbn-xsrf: true' -H 'Content-Type: application/json' -d "$JSON_STRING"
|
curl -K /opt/so/conf/elasticsearch/curl.config -L -X POST "http://localhost:5601/api/fleet/agents/bulk_upgrade" -H 'kbn-xsrf: true' -H 'Content-Type: application/json' -d "$JSON_STRING"
|
||||||
|
|||||||
@@ -0,0 +1,95 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
# Copyright Security Onion Solutions LLC and/or licensed to Security Onion Solutions LLC under one
|
||||||
|
# or more contributor license agreements. Licensed under the Elastic License 2.0 as shown at
|
||||||
|
# https://securityonion.net/license; you may not use this file except in compliance with the
|
||||||
|
# Elastic License 2.0.
|
||||||
|
{%- import_yaml 'elasticfleet/defaults.yaml' as ELASTICFLEETDEFAULTS %}
|
||||||
|
{%- set SUPPORTED_PACKAGES = salt['pillar.get']('elasticfleet:packages', default=ELASTICFLEETDEFAULTS.elasticfleet.packages, merge=True) %}
|
||||||
|
{%- set AUTO_UPGRADE_INTEGRATIONS = salt['pillar.get']('elasticfleet:config:auto_upgrade_integrations', default=false) %}
|
||||||
|
|
||||||
|
. /usr/sbin/so-elastic-fleet-common
|
||||||
|
|
||||||
|
curl_output=$(curl -s -K /opt/so/conf/elasticsearch/curl.config -c - -X GET http://localhost:5601/)
|
||||||
|
if [ $? -ne 0 ]; then
|
||||||
|
echo "Error: Failed to connect to Kibana."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
IFS=$'\n'
|
||||||
|
agent_policies=$(elastic_fleet_agent_policy_ids)
|
||||||
|
if [ $? -ne 0 ]; then
|
||||||
|
echo "Error: Failed to retrieve agent policies."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
default_packages=({% for pkg in SUPPORTED_PACKAGES %}"{{ pkg }}"{% if not loop.last %} {% endif %}{% endfor %})
|
||||||
|
|
||||||
|
ERROR=false
|
||||||
|
for AGENT_POLICY in $agent_policies; do
|
||||||
|
if ! integrations=$(elastic_fleet_integration_policy_names "$AGENT_POLICY"); then
|
||||||
|
# this script upgrades default integration packages, exit 1 and let salt handle retrying
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
for INTEGRATION in $integrations; do
|
||||||
|
if ! [[ "$INTEGRATION" == "elastic-defend-endpoints" ]] && ! [[ "$INTEGRATION" == "fleet_server-"* ]]; then
|
||||||
|
# Get package name so we know what package to look for when checking the current and latest available version
|
||||||
|
if ! PACKAGE_NAME=$(elastic_fleet_integration_policy_package_name "$AGENT_POLICY" "$INTEGRATION"); then
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
{%- if not AUTO_UPGRADE_INTEGRATIONS %}
|
||||||
|
if [[ " ${default_packages[@]} " =~ " $PACKAGE_NAME " ]]; then
|
||||||
|
{%- endif %}
|
||||||
|
# Get currently installed version of package
|
||||||
|
attempt=0
|
||||||
|
max_attempts=3
|
||||||
|
while [ $attempt -lt $max_attempts ]; do
|
||||||
|
if PACKAGE_VERSION=$(elastic_fleet_integration_policy_package_version "$AGENT_POLICY" "$INTEGRATION") && AVAILABLE_VERSION=$(elastic_fleet_package_latest_version_check "$PACKAGE_NAME"); then
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
attempt=$((attempt + 1))
|
||||||
|
done
|
||||||
|
if [ $attempt -eq $max_attempts ]; then
|
||||||
|
echo "Error: Failed getting $PACKAGE_VERSION or $AVAILABLE_VERSION"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Get integration ID
|
||||||
|
if ! INTEGRATION_ID=$(elastic_fleet_integration_id "$AGENT_POLICY" "$INTEGRATION"); then
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ "$PACKAGE_VERSION" != "$AVAILABLE_VERSION" ]]; then
|
||||||
|
# Dry run of the upgrade
|
||||||
|
echo ""
|
||||||
|
echo "Current $PACKAGE_NAME package version ($PACKAGE_VERSION) is not the same as the latest available package ($AVAILABLE_VERSION)..."
|
||||||
|
echo "Upgrading $INTEGRATION..."
|
||||||
|
echo "Starting dry run..."
|
||||||
|
if ! DRYRUN_OUTPUT=$(elastic_fleet_integration_policy_dryrun_upgrade "$INTEGRATION_ID"); then
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
DRYRUN_ERRORS=$(echo "$DRYRUN_OUTPUT" | jq .[].hasErrors)
|
||||||
|
|
||||||
|
# If no errors with dry run, proceed with actual upgrade
|
||||||
|
if [[ "$DRYRUN_ERRORS" == "false" ]]; then
|
||||||
|
echo "No errors detected. Proceeding with upgrade..."
|
||||||
|
if ! elastic_fleet_integration_policy_upgrade "$INTEGRATION_ID"; then
|
||||||
|
echo "Error: Upgrade failed for $PACKAGE_NAME with integration ID '$INTEGRATION_ID'."
|
||||||
|
ERROR=true
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo "Errors detected during dry run for $PACKAGE_NAME policy upgrade..."
|
||||||
|
ERROR=true
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
{%- if not AUTO_UPGRADE_INTEGRATIONS %}
|
||||||
|
fi
|
||||||
|
{%- endif %}
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
done
|
||||||
|
if [[ "$ERROR" == "true" ]]; then
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
echo
|
||||||
@@ -0,0 +1,202 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Copyright Security Onion Solutions LLC and/or licensed to Security Onion Solutions LLC under one
|
||||||
|
# or more contributor license agreements. Licensed under the Elastic License 2.0; you may not use
|
||||||
|
# this file except in compliance with the Elastic License 2.0.
|
||||||
|
{%- import_yaml 'elasticfleet/defaults.yaml' as ELASTICFLEETDEFAULTS %}
|
||||||
|
{% set SUB = salt['pillar.get']('elasticfleet:config:subscription_integrations', default=false) %}
|
||||||
|
{% set AUTO_UPGRADE_INTEGRATIONS = salt['pillar.get']('elasticfleet:config:auto_upgrade_integrations', default=false) %}
|
||||||
|
{%- set SUPPORTED_PACKAGES = salt['pillar.get']('elasticfleet:packages', default=ELASTICFLEETDEFAULTS.elasticfleet.packages, merge=True) %}
|
||||||
|
|
||||||
|
. /usr/sbin/so-common
|
||||||
|
. /usr/sbin/so-elastic-fleet-common
|
||||||
|
|
||||||
|
# Check that /opt/so/state/estemplates.txt exists to signal that Elasticsearch
|
||||||
|
# has completed its first run of core-only integrations/indices/components/ilm
|
||||||
|
STATE_FILE_SUCCESS=/opt/so/state/estemplates.txt
|
||||||
|
INSTALLED_PACKAGE_LIST=/tmp/esfleet_installed_packages.json
|
||||||
|
BULK_INSTALL_PACKAGE_LIST=/tmp/esfleet_bulk_install.json
|
||||||
|
BULK_INSTALL_PACKAGE_TMP=/tmp/esfleet_bulk_install_tmp.json
|
||||||
|
BULK_INSTALL_OUTPUT=/opt/so/state/esfleet_bulk_install_results.json
|
||||||
|
PACKAGE_COMPONENTS=/opt/so/state/esfleet_package_components.json
|
||||||
|
COMPONENT_TEMPLATES=/opt/so/state/esfleet_component_templates.json
|
||||||
|
|
||||||
|
PENDING_UPDATE=false
|
||||||
|
|
||||||
|
# Integrations which are included in the package registry, but excluded from automatic installation via this script.
|
||||||
|
# Requiring some level of manual Elastic Stack configuration before installation
|
||||||
|
EXCLUDED_INTEGRATIONS=('apm')
|
||||||
|
|
||||||
|
version_conversion(){
|
||||||
|
version=$1
|
||||||
|
echo "$version" | awk -F '.' '{ printf("%d%03d%03d\n", $1, $2, $3); }'
|
||||||
|
}
|
||||||
|
|
||||||
|
compare_versions() {
|
||||||
|
version1=$1
|
||||||
|
version2=$2
|
||||||
|
|
||||||
|
# Convert versions to numbers
|
||||||
|
num1=$(version_conversion "$version1")
|
||||||
|
num2=$(version_conversion "$version2")
|
||||||
|
|
||||||
|
# Compare using bc
|
||||||
|
if (( $(echo "$num1 < $num2" | bc -l) )); then
|
||||||
|
echo "less"
|
||||||
|
elif (( $(echo "$num1 > $num2" | bc -l) )); then
|
||||||
|
echo "greater"
|
||||||
|
else
|
||||||
|
echo "equal"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
IFS=$'\n'
|
||||||
|
agent_policies=$(elastic_fleet_agent_policy_ids)
|
||||||
|
if [ $? -ne 0 ]; then
|
||||||
|
echo "Error: Failed to retrieve agent policies."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
default_packages=({% for pkg in SUPPORTED_PACKAGES %}"{{ pkg }}"{% if not loop.last %} {% endif %}{% endfor %})
|
||||||
|
|
||||||
|
in_use_integrations=()
|
||||||
|
|
||||||
|
for AGENT_POLICY in $agent_policies; do
|
||||||
|
|
||||||
|
if ! integrations=$(elastic_fleet_integration_policy_names "$AGENT_POLICY"); then
|
||||||
|
# skip the agent policy if we can't get required info, let salt retry. Integrations loaded by this script are non-default integrations.
|
||||||
|
echo "Skipping $AGENT_POLICY.. "
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
for INTEGRATION in $integrations; do
|
||||||
|
if ! PACKAGE_NAME=$(elastic_fleet_integration_policy_package_name "$AGENT_POLICY" "$INTEGRATION"); then
|
||||||
|
echo "Not adding $INTEGRATION, couldn't get package name"
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
# non-default integrations that are in-use in any policy
|
||||||
|
if ! [[ " ${default_packages[@]} " =~ " $PACKAGE_NAME " ]]; then
|
||||||
|
in_use_integrations+=("$PACKAGE_NAME")
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
done
|
||||||
|
|
||||||
|
if [[ -f $STATE_FILE_SUCCESS ]]; then
|
||||||
|
if retry 3 1 "curl -s -K /opt/so/conf/elasticsearch/curl.config --output /dev/null --silent --head --fail localhost:5601/api/fleet/epm/packages"; then
|
||||||
|
# Package_list contains all integrations beta / non-beta.
|
||||||
|
latest_package_list=$(/usr/sbin/so-elastic-fleet-package-list)
|
||||||
|
echo '{ "packages" : []}' > $BULK_INSTALL_PACKAGE_LIST
|
||||||
|
rm -f $INSTALLED_PACKAGE_LIST
|
||||||
|
echo $latest_package_list | jq '{packages: [.items[] | {name: .name, latest_version: .version, installed_version: .savedObject.attributes.install_version, subscription: .conditions.elastic.subscription }]}' >> $INSTALLED_PACKAGE_LIST
|
||||||
|
|
||||||
|
while read -r package; do
|
||||||
|
# get package details
|
||||||
|
package_name=$(echo "$package" | jq -r '.name')
|
||||||
|
latest_version=$(echo "$package" | jq -r '.latest_version')
|
||||||
|
installed_version=$(echo "$package" | jq -r '.installed_version')
|
||||||
|
subscription=$(echo "$package" | jq -r '.subscription')
|
||||||
|
bulk_package=$(echo "$package" | jq '{name: .name, version: .latest_version}' )
|
||||||
|
|
||||||
|
if [[ ! "${EXCLUDED_INTEGRATIONS[@]}" =~ "$package_name" ]]; then
|
||||||
|
{% if not SUB %}
|
||||||
|
if [[ "$subscription" != "basic" && "$subscription" != "null" && -n "$subscription" ]]; then
|
||||||
|
# pass over integrations that require non-basic elastic license
|
||||||
|
echo "$package_name integration requires an Elastic license of $subscription or greater... skipping"
|
||||||
|
continue
|
||||||
|
else
|
||||||
|
if [[ "$installed_version" == "null" || -z "$installed_version" ]]; then
|
||||||
|
echo "$package_name is not installed... Adding to next update."
|
||||||
|
jq --argjson package "$bulk_package" '.packages += [$package]' $BULK_INSTALL_PACKAGE_LIST > $BULK_INSTALL_PACKAGE_TMP && mv $BULK_INSTALL_PACKAGE_TMP $BULK_INSTALL_PACKAGE_LIST
|
||||||
|
|
||||||
|
PENDING_UPDATE=true
|
||||||
|
else
|
||||||
|
results=$(compare_versions "$latest_version" "$installed_version")
|
||||||
|
if [ $results == "greater" ]; then
|
||||||
|
{#- When auto_upgrade_integrations is false, skip upgrading in_use_integrations #}
|
||||||
|
{%- if not AUTO_UPGRADE_INTEGRATIONS %}
|
||||||
|
if ! [[ " ${in_use_integrations[@]} " =~ " $package_name " ]]; then
|
||||||
|
{%- endif %}
|
||||||
|
echo "$package_name is at version $installed_version latest version is $latest_version... Adding to next update."
|
||||||
|
jq --argjson package "$bulk_package" '.packages += [$package]' $BULK_INSTALL_PACKAGE_LIST > $BULK_INSTALL_PACKAGE_TMP && mv $BULK_INSTALL_PACKAGE_TMP $BULK_INSTALL_PACKAGE_LIST
|
||||||
|
|
||||||
|
PENDING_UPDATE=true
|
||||||
|
{%- if not AUTO_UPGRADE_INTEGRATIONS %}
|
||||||
|
else
|
||||||
|
echo "skipping available upgrade for in use integration - $package_name."
|
||||||
|
fi
|
||||||
|
{%- endif %}
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
{% else %}
|
||||||
|
if [[ "$installed_version" == "null" || -z "$installed_version" ]]; then
|
||||||
|
echo "$package_name is not installed... Adding to next update."
|
||||||
|
jq --argjson package "$bulk_package" '.packages += [$package]' $BULK_INSTALL_PACKAGE_LIST > $BULK_INSTALL_PACKAGE_TMP && mv $BULK_INSTALL_PACKAGE_TMP $BULK_INSTALL_PACKAGE_LIST
|
||||||
|
PENDING_UPDATE=true
|
||||||
|
else
|
||||||
|
results=$(compare_versions "$latest_version" "$installed_version")
|
||||||
|
if [ $results == "greater" ]; then
|
||||||
|
{#- When auto_upgrade_integrations is false, skip upgrading in_use_integrations #}
|
||||||
|
{%- if not AUTO_UPGRADE_INTEGRATIONS %}
|
||||||
|
if ! [[ " ${in_use_integrations[@]} " =~ " $package_name " ]]; then
|
||||||
|
{%- endif %}
|
||||||
|
echo "$package_name is at version $installed_version latest version is $latest_version... Adding to next update."
|
||||||
|
jq --argjson package "$bulk_package" '.packages += [$package]' $BULK_INSTALL_PACKAGE_LIST > $BULK_INSTALL_PACKAGE_TMP && mv $BULK_INSTALL_PACKAGE_TMP $BULK_INSTALL_PACKAGE_LIST
|
||||||
|
PENDING_UPDATE=true
|
||||||
|
{%- if not AUTO_UPGRADE_INTEGRATIONS %}
|
||||||
|
else
|
||||||
|
echo "skipping available upgrade for in use integration - $package_name."
|
||||||
|
fi
|
||||||
|
{%- endif %}
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
{% endif %}
|
||||||
|
else
|
||||||
|
echo "Skipping $package_name..."
|
||||||
|
fi
|
||||||
|
done <<< "$(jq -c '.packages[]' "$INSTALLED_PACKAGE_LIST")"
|
||||||
|
|
||||||
|
if [ "$PENDING_UPDATE" = true ]; then
|
||||||
|
# Run chunked install of packages
|
||||||
|
echo "" > $BULK_INSTALL_OUTPUT
|
||||||
|
pkg_group=1
|
||||||
|
pkg_filename="${BULK_INSTALL_PACKAGE_LIST%.json}"
|
||||||
|
|
||||||
|
jq -c '.packages | _nwise(25)' $BULK_INSTALL_PACKAGE_LIST | while read -r line; do
|
||||||
|
echo "$line" | jq '{ "packages": . }' > "${pkg_filename}_${pkg_group}.json"
|
||||||
|
pkg_group=$((pkg_group + 1))
|
||||||
|
done
|
||||||
|
|
||||||
|
for file in "${pkg_filename}_"*.json; do
|
||||||
|
[ -e "$file" ] || continue
|
||||||
|
if ! elastic_fleet_bulk_package_install $file >> $BULK_INSTALL_OUTPUT; then
|
||||||
|
# integrations loaded my this script are non-essential and shouldn't cause exit, skip them for now next highstate run can retry
|
||||||
|
echo "Failed to complete a chunk of bulk package installs -- $file "
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
# cleanup any temp files for chunked package install
|
||||||
|
rm -f ${pkg_filename}_*.json $BULK_INSTALL_PACKAGE_LIST
|
||||||
|
else
|
||||||
|
echo "Elastic integrations don't appear to need installation/updating..."
|
||||||
|
fi
|
||||||
|
# Write out file for generating index/component/ilm templates
|
||||||
|
if latest_installed_package_list=$(elastic_fleet_installed_packages); then
|
||||||
|
echo $latest_installed_package_list | jq '[.items[] | {name: .name, es_index_patterns: .dataStreams}]' > $PACKAGE_COMPONENTS
|
||||||
|
fi
|
||||||
|
if retry 3 1 "so-elasticsearch-query / --fail --output /dev/null"; then
|
||||||
|
# Refresh installed component template list
|
||||||
|
latest_component_templates_list=$(so-elasticsearch-query _component_template | jq '.component_templates[] | .name' | jq -s '.')
|
||||||
|
echo $latest_component_templates_list > $COMPONENT_TEMPLATES
|
||||||
|
fi
|
||||||
|
|
||||||
|
else
|
||||||
|
# This is the installation of add-on integrations and upgrade of existing integrations. Exiting without error, next highstate will attempt to re-run.
|
||||||
|
echo "Elastic Fleet does not appear to be responding... Exiting... "
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
# This message will appear when an update to core integration is made and this script is run at the same time as
|
||||||
|
# elasticsearch.enabled -> detects change to core index settings -> deletes estemplates.txt
|
||||||
|
echo "Elasticsearch may not be fully configured yet or is currently updating core index settings."
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
@@ -3,11 +3,36 @@
|
|||||||
# Copyright Security Onion Solutions LLC and/or licensed to Security Onion Solutions LLC under one
|
# Copyright Security Onion Solutions LLC and/or licensed to Security Onion Solutions LLC under one
|
||||||
# or more contributor license agreements. Licensed under the Elastic License 2.0; you may not use
|
# or more contributor license agreements. Licensed under the Elastic License 2.0; you may not use
|
||||||
# this file except in compliance with the Elastic License 2.0.
|
# this file except in compliance with the Elastic License 2.0.
|
||||||
{% from 'vars/globals.map.jinja' import GLOBALS %}
|
{%- from 'vars/globals.map.jinja' import GLOBALS %}
|
||||||
{% from 'elasticfleet/map.jinja' import ELASTICFLEETMERGED %}
|
{%- from 'elasticfleet/map.jinja' import ELASTICFLEETMERGED %}
|
||||||
|
{%- from 'elasticfleet/config.map.jinja' import LOGSTASH_CONFIG_YAML %}
|
||||||
|
|
||||||
. /usr/sbin/so-common
|
. /usr/sbin/so-common
|
||||||
|
|
||||||
|
FORCE_UPDATE=false
|
||||||
|
UPDATE_CERTS=false
|
||||||
|
LOGSTASH_PILLAR_CONFIG_YAML="{{ LOGSTASH_CONFIG_YAML }}"
|
||||||
|
LOGSTASH_PILLAR_STATE_FILE="/opt/so/state/esfleet_logstash_config_pillar"
|
||||||
|
|
||||||
|
while [[ $# -gt 0 ]]; do
|
||||||
|
case $1 in
|
||||||
|
-f|--force)
|
||||||
|
FORCE_UPDATE=true
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
-c| --certs)
|
||||||
|
UPDATE_CERTS=true
|
||||||
|
FORCE_UPDATE=true
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "Unknown option $1"
|
||||||
|
echo "Usage: $0 [-f|--force] [-c|--certs]"
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
# Only run on Managers
|
# Only run on Managers
|
||||||
if ! is_manager_node; then
|
if ! is_manager_node; then
|
||||||
printf "Not a Manager Node... Exiting"
|
printf "Not a Manager Node... Exiting"
|
||||||
@@ -15,22 +40,104 @@ if ! is_manager_node; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
function update_logstash_outputs() {
|
function update_logstash_outputs() {
|
||||||
# Generate updated JSON payload
|
if logstash_policy=$(curl -K /opt/so/conf/elasticsearch/curl.config -L "http://localhost:5601/api/fleet/outputs/so-manager_logstash" --retry 3 --retry-delay 10 --fail 2>/dev/null); then
|
||||||
JSON_STRING=$(jq -n --arg UPDATEDLIST $NEW_LIST_JSON '{"name":"grid-logstash","type":"logstash","hosts": $UPDATEDLIST,"is_default":true,"is_default_monitoring":true,"config_yaml":""}')
|
SSL_CONFIG=$(echo "$logstash_policy" | jq -r '.item.ssl')
|
||||||
|
LOGSTASHKEY=$(openssl rsa -in /etc/pki/elasticfleet-logstash.key)
|
||||||
|
LOGSTASHCRT=$(openssl x509 -in /etc/pki/elasticfleet-logstash.crt)
|
||||||
|
LOGSTASHCA=$(openssl x509 -in /etc/pki/tls/certs/intca.crt)
|
||||||
|
# Revert escaped \\n to \n for jq
|
||||||
|
LOGSTASH_PILLAR_CONFIG_YAML=$(printf '%b' "$LOGSTASH_PILLAR_CONFIG_YAML")
|
||||||
|
|
||||||
|
if SECRETS=$(echo "$logstash_policy" | jq -er '.item.secrets' 2>/dev/null); then
|
||||||
|
if [[ "$UPDATE_CERTS" != "true" ]]; then
|
||||||
|
# Reuse existing secret
|
||||||
|
JSON_STRING=$(jq -n \
|
||||||
|
--arg UPDATEDLIST "$NEW_LIST_JSON" \
|
||||||
|
--arg CONFIG_YAML "$LOGSTASH_PILLAR_CONFIG_YAML" \
|
||||||
|
--argjson SECRETS "$SECRETS" \
|
||||||
|
--argjson SSL_CONFIG "$SSL_CONFIG" \
|
||||||
|
'{"name":"grid-logstash","type":"logstash","hosts": $UPDATEDLIST,"is_default":true,"is_default_monitoring":true,"config_yaml":$CONFIG_YAML,"ssl": $SSL_CONFIG,"secrets": $SECRETS}')
|
||||||
|
else
|
||||||
|
# Update certs, creating new secret
|
||||||
|
JSON_STRING=$(jq -n \
|
||||||
|
--arg UPDATEDLIST "$NEW_LIST_JSON" \
|
||||||
|
--arg CONFIG_YAML "$LOGSTASH_PILLAR_CONFIG_YAML" \
|
||||||
|
--arg LOGSTASHKEY "$LOGSTASHKEY" \
|
||||||
|
--arg LOGSTASHCRT "$LOGSTASHCRT" \
|
||||||
|
--arg LOGSTASHCA "$LOGSTASHCA" \
|
||||||
|
'{"name":"grid-logstash","type":"logstash","hosts": $UPDATEDLIST,"is_default":true,"is_default_monitoring":true,"config_yaml":$CONFIG_YAML,"ssl": {"certificate": $LOGSTASHCRT,"certificate_authorities":[ $LOGSTASHCA ]},"secrets": {"ssl":{"key": $LOGSTASHKEY }}}')
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
if [[ "$UPDATE_CERTS" != "true" ]]; then
|
||||||
|
# Reuse existing ssl config
|
||||||
|
JSON_STRING=$(jq -n \
|
||||||
|
--arg UPDATEDLIST "$NEW_LIST_JSON" \
|
||||||
|
--arg CONFIG_YAML "$LOGSTASH_PILLAR_CONFIG_YAML" \
|
||||||
|
--argjson SSL_CONFIG "$SSL_CONFIG" \
|
||||||
|
'{"name":"grid-logstash","type":"logstash","hosts": $UPDATEDLIST,"is_default":true,"is_default_monitoring":true,"config_yaml":$CONFIG_YAML,"ssl": $SSL_CONFIG}')
|
||||||
|
else
|
||||||
|
# Update ssl config
|
||||||
|
JSON_STRING=$(jq -n \
|
||||||
|
--arg UPDATEDLIST "$NEW_LIST_JSON" \
|
||||||
|
--arg CONFIG_YAML "$LOGSTASH_PILLAR_CONFIG_YAML" \
|
||||||
|
--arg LOGSTASHKEY "$LOGSTASHKEY" \
|
||||||
|
--arg LOGSTASHCRT "$LOGSTASHCRT" \
|
||||||
|
--arg LOGSTASHCA "$LOGSTASHCA" \
|
||||||
|
'{"name":"grid-logstash","type":"logstash","hosts": $UPDATEDLIST,"is_default":true,"is_default_monitoring":true,"config_yaml":$CONFIG_YAML,"ssl": {"certificate": $LOGSTASHCRT,"key": $LOGSTASHKEY,"certificate_authorities":[ $LOGSTASHCA ]}}')
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
# Update Logstash Outputs
|
# Update Logstash Outputs
|
||||||
curl -K /opt/so/conf/elasticsearch/curl.config -L -X PUT "localhost:5601/api/fleet/outputs/so-manager_logstash" -H 'kbn-xsrf: true' -H 'Content-Type: application/json' -d "$JSON_STRING" | jq
|
curl -K /opt/so/conf/elasticsearch/curl.config -L -X PUT "localhost:5601/api/fleet/outputs/so-manager_logstash" -H 'kbn-xsrf: true' -H 'Content-Type: application/json' -d "$JSON_STRING" | jq
|
||||||
}
|
}
|
||||||
function update_kafka_outputs() {
|
function update_kafka_outputs() {
|
||||||
# Make sure SSL configuration is included in policy updates for Kafka output. SSL is configured in so-elastic-fleet-setup
|
# Make sure SSL configuration is included in policy updates for Kafka output. SSL is configured in so-elastic-fleet-setup
|
||||||
SSL_CONFIG=$(curl -K /opt/so/conf/elasticsearch/curl.config -L "http://localhost:5601/api/fleet/outputs/so-manager_kafka" | jq -r '.item.ssl')
|
if kafka_policy=$(curl -K /opt/so/conf/elasticsearch/curl.config -L "http://localhost:5601/api/fleet/outputs/so-manager_kafka" --fail 2>/dev/null); then
|
||||||
|
SSL_CONFIG=$(echo "$kafka_policy" | jq -r '.item.ssl')
|
||||||
JSON_STRING=$(jq -n \
|
KAFKAKEY=$(openssl rsa -in /etc/pki/elasticfleet-kafka.key)
|
||||||
--arg UPDATEDLIST "$NEW_LIST_JSON" \
|
KAFKACRT=$(openssl x509 -in /etc/pki/elasticfleet-kafka.crt)
|
||||||
--argjson SSL_CONFIG "$SSL_CONFIG" \
|
KAFKACA=$(openssl x509 -in /etc/pki/tls/certs/intca.crt)
|
||||||
'{"name": "grid-kafka","type": "kafka","hosts": $UPDATEDLIST,"is_default": true,"is_default_monitoring": true,"config_yaml": "","ssl": $SSL_CONFIG}')
|
if SECRETS=$(echo "$kafka_policy" | jq -er '.item.secrets' 2>/dev/null); then
|
||||||
# Update Kafka outputs
|
if [[ "$UPDATE_CERTS" != "true" ]]; then
|
||||||
curl -K /opt/so/conf/elasticsearch/curl.config -L -X PUT "localhost:5601/api/fleet/outputs/so-manager_kafka" -H 'kbn-xsrf: true' -H 'Content-Type: application/json' -d "$JSON_STRING" | jq
|
# Update policy when fleet has secrets enabled
|
||||||
|
JSON_STRING=$(jq -n \
|
||||||
|
--arg UPDATEDLIST "$NEW_LIST_JSON" \
|
||||||
|
--argjson SSL_CONFIG "$SSL_CONFIG" \
|
||||||
|
--argjson SECRETS "$SECRETS" \
|
||||||
|
'{"name": "grid-kafka","type": "kafka","hosts": $UPDATEDLIST,"is_default": true,"is_default_monitoring": true,"config_yaml": "","ssl": $SSL_CONFIG,"secrets": $SECRETS}')
|
||||||
|
else
|
||||||
|
# Update certs, creating new secret
|
||||||
|
JSON_STRING=$(jq -n \
|
||||||
|
--arg UPDATEDLIST "$NEW_LIST_JSON" \
|
||||||
|
--arg KAFKAKEY "$KAFKAKEY" \
|
||||||
|
--arg KAFKACRT "$KAFKACRT" \
|
||||||
|
--arg KAFKACA "$KAFKACA" \
|
||||||
|
'{"name": "grid-kafka","type": "kafka","hosts": $UPDATEDLIST,"is_default": true,"is_default_monitoring": true,"config_yaml": "","ssl": {"certificate_authorities":[ $KAFKACA ],"certificate": $KAFKACRT ,"key":"","verification_mode":"full"},"secrets": {"ssl":{"key": $KAFKAKEY }}}')
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
if [[ "$UPDATE_CERTS" != "true" ]]; then
|
||||||
|
# Update policy when fleet has secrets disabled or policy hasn't been force updated
|
||||||
|
JSON_STRING=$(jq -n \
|
||||||
|
--arg UPDATEDLIST "$NEW_LIST_JSON" \
|
||||||
|
--argjson SSL_CONFIG "$SSL_CONFIG" \
|
||||||
|
'{"name": "grid-kafka","type": "kafka","hosts": $UPDATEDLIST,"is_default": true,"is_default_monitoring": true,"config_yaml": "","ssl": $SSL_CONFIG}')
|
||||||
|
else
|
||||||
|
# Update ssl config
|
||||||
|
JSON_STRING=$(jq -n \
|
||||||
|
--arg UPDATEDLIST "$NEW_LIST_JSON" \
|
||||||
|
--arg KAFKAKEY "$KAFKAKEY" \
|
||||||
|
--arg KAFKACRT "$KAFKACRT" \
|
||||||
|
--arg KAFKACA "$KAFKACA" \
|
||||||
|
'{"name": "grid-kafka","type": "kafka","hosts": $UPDATEDLIST,"is_default": true,"is_default_monitoring": true,"config_yaml": "","ssl": { "certificate_authorities": [ $KAFKACA ], "certificate": $KAFKACRT, "key": $KAFKAKEY, "verification_mode": "full" }}')
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
# Update Kafka outputs
|
||||||
|
curl -K /opt/so/conf/elasticsearch/curl.config -L -X PUT "localhost:5601/api/fleet/outputs/so-manager_kafka" -H 'kbn-xsrf: true' -H 'Content-Type: application/json' -d "$JSON_STRING" | jq
|
||||||
|
else
|
||||||
|
printf "Failed to get current Kafka output policy..."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
{% if GLOBALS.pipeline == "KAFKA" %}
|
{% if GLOBALS.pipeline == "KAFKA" %}
|
||||||
@@ -46,7 +153,7 @@ function update_kafka_outputs() {
|
|||||||
|
|
||||||
# Get the current list of kafka outputs & hash them
|
# Get the current list of kafka outputs & hash them
|
||||||
CURRENT_LIST=$(jq -c -r '.item.hosts' <<< "$RAW_JSON")
|
CURRENT_LIST=$(jq -c -r '.item.hosts' <<< "$RAW_JSON")
|
||||||
CURRENT_HASH=$(sha1sum <<< "$CURRENT_LIST" | awk '{print $1}')
|
CURRENT_HASH=$(sha256sum <<< "$CURRENT_LIST" | awk '{print $1}')
|
||||||
|
|
||||||
declare -a NEW_LIST=()
|
declare -a NEW_LIST=()
|
||||||
|
|
||||||
@@ -69,10 +176,19 @@ function update_kafka_outputs() {
|
|||||||
printf "Failed to query for current Logstash Outputs..."
|
printf "Failed to query for current Logstash Outputs..."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
# logstash adv config - compare pillar to last state file value
|
||||||
|
if [[ -f "$LOGSTASH_PILLAR_STATE_FILE" ]]; then
|
||||||
|
PREVIOUS_LOGSTASH_PILLAR_CONFIG_YAML=$(cat "$LOGSTASH_PILLAR_STATE_FILE")
|
||||||
|
if [[ "$LOGSTASH_PILLAR_CONFIG_YAML" != "$PREVIOUS_LOGSTASH_PILLAR_CONFIG_YAML" ]]; then
|
||||||
|
echo "Logstash pillar config has changed - forcing update"
|
||||||
|
FORCE_UPDATE=true
|
||||||
|
fi
|
||||||
|
echo "$LOGSTASH_PILLAR_CONFIG_YAML" > "$LOGSTASH_PILLAR_STATE_FILE"
|
||||||
|
fi
|
||||||
|
|
||||||
# Get the current list of Logstash outputs & hash them
|
# Get the current list of Logstash outputs & hash them
|
||||||
CURRENT_LIST=$(jq -c -r '.item.hosts' <<< "$RAW_JSON")
|
CURRENT_LIST=$(jq -c -r '.item.hosts' <<< "$RAW_JSON")
|
||||||
CURRENT_HASH=$(sha1sum <<< "$CURRENT_LIST" | awk '{print $1}')
|
CURRENT_HASH=$(sha256sum <<< "$CURRENT_LIST" | awk '{print $1}')
|
||||||
|
|
||||||
declare -a NEW_LIST=()
|
declare -a NEW_LIST=()
|
||||||
|
|
||||||
@@ -121,10 +237,10 @@ function update_kafka_outputs() {
|
|||||||
|
|
||||||
# Sort & hash the new list of Logstash Outputs
|
# Sort & hash the new list of Logstash Outputs
|
||||||
NEW_LIST_JSON=$(jq --compact-output --null-input '$ARGS.positional' --args -- "${NEW_LIST[@]}")
|
NEW_LIST_JSON=$(jq --compact-output --null-input '$ARGS.positional' --args -- "${NEW_LIST[@]}")
|
||||||
NEW_HASH=$(sha1sum <<< "$NEW_LIST_JSON" | awk '{print $1}')
|
NEW_HASH=$(sha256sum <<< "$NEW_LIST_JSON" | awk '{print $1}')
|
||||||
|
|
||||||
# Compare the current & new list of outputs - if different, update the Logstash outputs
|
# Compare the current & new list of outputs - if different, update the Logstash outputs
|
||||||
if [ "$NEW_HASH" = "$CURRENT_HASH" ]; then
|
if [[ "$NEW_HASH" = "$CURRENT_HASH" ]] && [[ "$FORCE_UPDATE" != "true" ]]; then
|
||||||
printf "\nHashes match - no update needed.\n"
|
printf "\nHashes match - no update needed.\n"
|
||||||
printf "Current List: $CURRENT_LIST\nNew List: $NEW_LIST_JSON\n"
|
printf "Current List: $CURRENT_LIST\nNew List: $NEW_LIST_JSON\n"
|
||||||
|
|
||||||
|
|||||||
@@ -10,8 +10,16 @@
|
|||||||
|
|
||||||
{%- for PACKAGE in SUPPORTED_PACKAGES %}
|
{%- for PACKAGE in SUPPORTED_PACKAGES %}
|
||||||
echo "Setting up {{ PACKAGE }} package..."
|
echo "Setting up {{ PACKAGE }} package..."
|
||||||
VERSION=$(elastic_fleet_package_version_check "{{ PACKAGE }}")
|
if VERSION=$(elastic_fleet_package_version_check "{{ PACKAGE }}"); then
|
||||||
elastic_fleet_package_install "{{ PACKAGE }}" "$VERSION"
|
if ! elastic_fleet_package_install "{{ PACKAGE }}" "$VERSION"; then
|
||||||
|
# packages loaded by this script should never fail to install and REQUIRED before an installation of SO can be considered successful
|
||||||
|
echo -e "\nERROR: Failed to install default integration package -- $PACKAGE $VERSION"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo -e "\nERROR: Failed to get version information for integration $PACKAGE"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
echo
|
echo
|
||||||
{%- endfor %}
|
{%- endfor %}
|
||||||
echo
|
echo
|
||||||
|
|||||||
@@ -10,8 +10,15 @@
|
|||||||
|
|
||||||
{%- for PACKAGE in SUPPORTED_PACKAGES %}
|
{%- for PACKAGE in SUPPORTED_PACKAGES %}
|
||||||
echo "Upgrading {{ PACKAGE }} package..."
|
echo "Upgrading {{ PACKAGE }} package..."
|
||||||
VERSION=$(elastic_fleet_package_latest_version_check "{{ PACKAGE }}")
|
if VERSION=$(elastic_fleet_package_latest_version_check "{{ PACKAGE }}"); then
|
||||||
elastic_fleet_package_install "{{ PACKAGE }}" "$VERSION"
|
if ! elastic_fleet_package_install "{{ PACKAGE }}" "$VERSION"; then
|
||||||
|
# exit 1 on failure to upgrade a default package, allow salt to handle retries
|
||||||
|
echo -e "\nERROR: Failed to upgrade $PACKAGE to version: $VERSION"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo -e "\nERROR: Failed to get version information for integration $PACKAGE"
|
||||||
|
fi
|
||||||
echo
|
echo
|
||||||
{%- endfor %}
|
{%- endfor %}
|
||||||
echo
|
echo
|
||||||
|
|||||||
@@ -23,18 +23,17 @@ if [[ "$RETURN_CODE" != "0" ]]; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
ALIASES=".fleet-servers .fleet-policies-leader .fleet-policies .fleet-agents .fleet-artifacts .fleet-enrollment-api-keys .kibana_ingest"
|
ALIASES=(.fleet-servers .fleet-policies-leader .fleet-policies .fleet-agents .fleet-artifacts .fleet-enrollment-api-keys .kibana_ingest)
|
||||||
for ALIAS in ${ALIASES}
|
for ALIAS in "${ALIASES[@]}"; do
|
||||||
do
|
|
||||||
# Get all concrete indices from alias
|
# Get all concrete indices from alias
|
||||||
INDXS=$(curl -K /opt/so/conf/kibana/curl.config -s -k -L -H "Content-Type: application/json" "https://localhost:9200/_resolve/index/${ALIAS}" | jq -r '.aliases[].indices[]')
|
if INDXS_RAW=$(curl -sK /opt/so/conf/kibana/curl.config -s -k -L -H "Content-Type: application/json" "https://localhost:9200/_resolve/index/${ALIAS}" --fail 2>/dev/null); then
|
||||||
|
INDXS=$(echo "$INDXS_RAW" | jq -r '.aliases[].indices[]')
|
||||||
# Delete all resolved indices
|
# Delete all resolved indices
|
||||||
for INDX in ${INDXS}
|
for INDX in ${INDXS}; do
|
||||||
do
|
|
||||||
status "Deleting $INDX"
|
status "Deleting $INDX"
|
||||||
curl -K /opt/so/conf/kibana/curl.config -s -k -L -H "Content-Type: application/json" "https://localhost:9200/${INDX}" -XDELETE
|
curl -K /opt/so/conf/kibana/curl.config -s -k -L -H "Content-Type: application/json" "https://localhost:9200/${INDX}" -XDELETE
|
||||||
done
|
done
|
||||||
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
# Restarting Kibana...
|
# Restarting Kibana...
|
||||||
@@ -51,18 +50,75 @@ if [[ "$RETURN_CODE" != "0" ]]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
printf "\n### Create ES Token ###\n"
|
printf "\n### Create ES Token ###\n"
|
||||||
ESTOKEN=$(curl -K /opt/so/conf/elasticsearch/curl.config -L -X POST "localhost:5601/api/fleet/service_tokens" -H 'kbn-xsrf: true' -H 'Content-Type: application/json' | jq -r .value)
|
if ESTOKEN_RAW=$(fleet_api "service_tokens" -XPOST -H 'kbn-xsrf: true' -H 'Content-Type: application/json'); then
|
||||||
|
ESTOKEN=$(echo "$ESTOKEN_RAW" | jq -r .value)
|
||||||
|
else
|
||||||
|
echo -e "\nFailed to create ES token..."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
### Create Outputs & Fleet URLs ###
|
### Create Outputs, Fleet Policy and Fleet URLs ###
|
||||||
|
# Create the Manager Elasticsearch Output first and set it as the default output
|
||||||
printf "\nAdd Manager Elasticsearch Output...\n"
|
printf "\nAdd Manager Elasticsearch Output...\n"
|
||||||
ESCACRT=$(openssl x509 -in $INTCA)
|
ESCACRT=$(openssl x509 -in "$INTCA" -outform DER | sha256sum | cut -d' ' -f1 | tr '[:lower:]' '[:upper:]')
|
||||||
JSON_STRING=$( jq -n \
|
JSON_STRING=$(jq -n \
|
||||||
--arg ESCACRT "$ESCACRT" \
|
--arg ESCACRT "$ESCACRT" \
|
||||||
'{"name":"so-manager_elasticsearch","id":"so-manager_elasticsearch","type":"elasticsearch","hosts":["https://{{ GLOBALS.manager_ip }}:9200","https://{{ GLOBALS.manager }}:9200"],"is_default":true,"is_default_monitoring":true,"config_yaml":"","ssl":{"certificate_authorities": [$ESCACRT]}}' )
|
'{"name":"so-manager_elasticsearch","id":"so-manager_elasticsearch","type":"elasticsearch","hosts":["https://{{ GLOBALS.manager_ip }}:9200","https://{{ GLOBALS.manager }}:9200"],"is_default":false,"is_default_monitoring":false,"config_yaml":"","ca_trusted_fingerprint": $ESCACRT}')
|
||||||
curl -K /opt/so/conf/elasticsearch/curl.config -L -X POST "localhost:5601/api/fleet/outputs" -H 'kbn-xsrf: true' -H 'Content-Type: application/json' -d "$JSON_STRING"
|
|
||||||
|
if ! fleet_api "outputs" -XPOST -H 'kbn-xsrf: true' -H 'Content-Type: application/json' -d "$JSON_STRING"; then
|
||||||
|
echo -e "\nFailed to create so-elasticsearch_manager policy..."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
printf "\n\n"
|
printf "\n\n"
|
||||||
|
|
||||||
printf "\nCreate Logstash Output Config if node is not an Import or Eval install\n"
|
# so-manager_elasticsearch should exist and be disabled. Now update it before checking its the only default policy
|
||||||
|
MANAGER_OUTPUT_ENABLED=$(echo "$JSON_STRING" | jq 'del(.id) | .is_default = true | .is_default_monitoring = true')
|
||||||
|
if ! curl -sK /opt/so/conf/elasticsearch/curl.config -L -X PUT "localhost:5601/api/fleet/outputs/so-manager_elasticsearch" -H 'kbn-xsrf: true' -H 'Content-Type: application/json' -d "$MANAGER_OUTPUT_ENABLED"; then
|
||||||
|
echo -e "\n failed to update so-manager_elasticsearch"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# At this point there should only be two policies. fleet-default-output & so-manager_elasticsearch
|
||||||
|
status "Verifying so-manager_elasticsearch policy is configured as the current default"
|
||||||
|
|
||||||
|
# Grab the fleet-default-output policy instead of so-manager_elasticsearch, because a weird state can exist where both fleet-default-output & so-elasticsearch_manager can be set as the active default output for logs / metrics. Resulting in logs not ingesting on import/eval nodes
|
||||||
|
if DEFAULTPOLICY=$(fleet_api "outputs/fleet-default-output"); then
|
||||||
|
fleet_default=$(echo "$DEFAULTPOLICY" | jq -er '.item.is_default')
|
||||||
|
fleet_default_monitoring=$(echo "$DEFAULTPOLICY" | jq -er '.item.is_default_monitoring')
|
||||||
|
# Check that fleet-default-output isn't configured as a default for anything ( both variables return false )
|
||||||
|
if [[ $fleet_default == "false" ]] && [[ $fleet_default_monitoring == "false" ]]; then
|
||||||
|
echo -e "\nso-manager_elasticsearch is configured as the current default policy..."
|
||||||
|
else
|
||||||
|
echo -e "\nVerification of so-manager_elasticsearch policy failed... The default 'fleet-default-output' output is still active..."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
# fleet-output-policy is created automatically by fleet when started. Should always exist on any installation type
|
||||||
|
echo -e "\nDefault fleet-default-output policy doesn't exist...\n"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Create the Manager Fleet Server Host Agent Policy
|
||||||
|
# This has to be done while the Elasticsearch Output is set to the default Output
|
||||||
|
printf "Create Manager Fleet Server Policy...\n"
|
||||||
|
if ! elastic_fleet_policy_create "FleetServer_{{ GLOBALS.hostname }}" "Fleet Server - {{ GLOBALS.hostname }}" "false" "120"; then
|
||||||
|
echo -e "\n Failed to create Manager fleet server policy..."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Modify the default integration policy to update the policy_id with the correct naming
|
||||||
|
UPDATED_INTEGRATION_POLICY=$(jq --arg policy_id "FleetServer_{{ GLOBALS.hostname }}" --arg name "fleet_server-{{ GLOBALS.hostname }}" '
|
||||||
|
.policy_id = $policy_id |
|
||||||
|
.name = $name' /opt/so/conf/elastic-fleet/integrations/fleet-server/fleet-server.json)
|
||||||
|
|
||||||
|
# Add the Fleet Server Integration to the new Fleet Policy
|
||||||
|
if ! elastic_fleet_integration_create "$UPDATED_INTEGRATION_POLICY"; then
|
||||||
|
echo -e "\nFailed to create Fleet server integration for Manager.."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Now we can create the Logstash Output and set it to to be the default Output
|
||||||
|
printf "\n\nCreate Logstash Output Config if node is not an Import or Eval install\n"
|
||||||
{% if grains.role not in ['so-import', 'so-eval'] %}
|
{% if grains.role not in ['so-import', 'so-eval'] %}
|
||||||
LOGSTASHCRT=$(openssl x509 -in /etc/pki/elasticfleet-logstash.crt)
|
LOGSTASHCRT=$(openssl x509 -in /etc/pki/elasticfleet-logstash.crt)
|
||||||
LOGSTASHKEY=$(openssl rsa -in /etc/pki/elasticfleet-logstash.key)
|
LOGSTASHKEY=$(openssl rsa -in /etc/pki/elasticfleet-logstash.key)
|
||||||
@@ -71,9 +127,12 @@ JSON_STRING=$( jq -n \
|
|||||||
--arg LOGSTASHCRT "$LOGSTASHCRT" \
|
--arg LOGSTASHCRT "$LOGSTASHCRT" \
|
||||||
--arg LOGSTASHKEY "$LOGSTASHKEY" \
|
--arg LOGSTASHKEY "$LOGSTASHKEY" \
|
||||||
--arg LOGSTASHCA "$LOGSTASHCA" \
|
--arg LOGSTASHCA "$LOGSTASHCA" \
|
||||||
'{"name":"grid-logstash","is_default":true,"is_default_monitoring":true,"id":"so-manager_logstash","type":"logstash","hosts":["{{ GLOBALS.manager_ip }}:5055", "{{ GLOBALS.manager }}:5055"],"config_yaml":"","ssl":{"certificate": $LOGSTASHCRT,"key": $LOGSTASHKEY,"certificate_authorities":[ $LOGSTASHCA ]},"proxy_id":null}'
|
'{"name":"grid-logstash","is_default":true,"is_default_monitoring":true,"id":"so-manager_logstash","type":"logstash","hosts":["{{ GLOBALS.manager_ip }}:5055", "{{ GLOBALS.manager }}:5055"],"config_yaml":"","ssl":{"certificate": $LOGSTASHCRT,"certificate_authorities":[ $LOGSTASHCA ]},"secrets":{"ssl":{"key": $LOGSTASHKEY }},"proxy_id":null}'
|
||||||
)
|
)
|
||||||
curl -K /opt/so/conf/elasticsearch/curl.config -L -X POST "localhost:5601/api/fleet/outputs" -H 'kbn-xsrf: true' -H 'Content-Type: application/json' -d "$JSON_STRING"
|
if ! fleet_api "outputs" -XPOST -H 'kbn-xsrf: true' -H 'Content-Type: application/json' -d "$JSON_STRING"; then
|
||||||
|
echo -e "\nFailed to create logstash fleet output"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
printf "\n\n"
|
printf "\n\n"
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
|
|
||||||
@@ -91,7 +150,10 @@ else
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
## This array replaces whatever URLs are currently configured
|
## This array replaces whatever URLs are currently configured
|
||||||
curl -K /opt/so/conf/elasticsearch/curl.config -L -X POST "localhost:5601/api/fleet/fleet_server_hosts" -H 'kbn-xsrf: true' -H 'Content-Type: application/json' -d "$JSON_STRING"
|
if ! fleet_api "fleet_server_hosts" -XPOST -H 'kbn-xsrf: true' -H 'Content-Type: application/json' -d "$JSON_STRING"; then
|
||||||
|
echo -e "\nFailed to add manager fleet URL"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
printf "\n\n"
|
printf "\n\n"
|
||||||
|
|
||||||
### Create Policies & Associated Integration Configuration ###
|
### Create Policies & Associated Integration Configuration ###
|
||||||
@@ -101,24 +163,23 @@ printf "\n\n"
|
|||||||
# Load Elasticsearch templates
|
# Load Elasticsearch templates
|
||||||
/usr/sbin/so-elasticsearch-templates-load
|
/usr/sbin/so-elasticsearch-templates-load
|
||||||
|
|
||||||
# Manager Fleet Server Host
|
|
||||||
elastic_fleet_policy_create "FleetServer_{{ GLOBALS.hostname }}" "Fleet Server - {{ GLOBALS.hostname }}" "true" "120"
|
|
||||||
|
|
||||||
#Temp Fixup for ES Output bug
|
|
||||||
JSON_STRING=$( jq -n \
|
|
||||||
--arg NAME "FleetServer_{{ GLOBALS.hostname }}" \
|
|
||||||
'{"name": $NAME,"description": $NAME,"namespace":"default","monitoring_enabled":["logs"],"inactivity_timeout":120,"data_output_id":"so-manager_elasticsearch"}'
|
|
||||||
)
|
|
||||||
curl -K /opt/so/conf/elasticsearch/curl.config -L -X PUT "localhost:5601/api/fleet/agent_policies/FleetServer_{{ GLOBALS.hostname }}" -H 'kbn-xsrf: true' -H 'Content-Type: application/json' -d "$JSON_STRING"
|
|
||||||
|
|
||||||
# Initial Endpoints Policy
|
# Initial Endpoints Policy
|
||||||
elastic_fleet_policy_create "endpoints-initial" "Initial Endpoint Policy" "false" "1209600"
|
if ! elastic_fleet_policy_create "endpoints-initial" "Initial Endpoint Policy" "false" "1209600"; then
|
||||||
|
echo -e "\nFailed to create endpoints-initial policy..."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
# Grid Nodes - General Policy
|
# Grid Nodes - General Policy
|
||||||
elastic_fleet_policy_create "so-grid-nodes_general" "SO Grid Nodes - General Purpose" "false" "1209600"
|
if ! elastic_fleet_policy_create "so-grid-nodes_general" "SO Grid Nodes - General Purpose" "false" "1209600"; then
|
||||||
|
echo -e "\nFailed to create so-grid-nodes_general policy..."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
# Grid Nodes - Heavy Node Policy
|
# Grid Nodes - Heavy Node Policy
|
||||||
elastic_fleet_policy_create "so-grid-nodes_heavy" "SO Grid Nodes - Heavy Node" "false" "1209600"
|
if ! elastic_fleet_policy_create "so-grid-nodes_heavy" "SO Grid Nodes - Heavy Node" "false" "1209600"; then
|
||||||
|
echo -e "\nFailed to create so-grid-nodes_heavy policy..."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
# Load Integrations for default policies
|
# Load Integrations for default policies
|
||||||
so-elastic-fleet-integration-policy-load
|
so-elastic-fleet-integration-policy-load
|
||||||
@@ -130,14 +191,34 @@ JSON_STRING=$( jq -n \
|
|||||||
'{"name":$NAME,"host":$URL,"is_default":true}'
|
'{"name":$NAME,"host":$URL,"is_default":true}'
|
||||||
)
|
)
|
||||||
|
|
||||||
curl -K /opt/so/conf/elasticsearch/curl.config -L -X POST "localhost:5601/api/fleet/agent_download_sources" -H 'kbn-xsrf: true' -H 'Content-Type: application/json' -d "$JSON_STRING"
|
if ! fleet_api "agent_download_sources" -XPOST -H 'kbn-xsrf: true' -H 'Content-Type: application/json' -d "$JSON_STRING"; then
|
||||||
|
echo -e "\nFailed to update Elastic Agent artifact URL"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
### Finalization ###
|
### Finalization ###
|
||||||
|
|
||||||
# Query for Enrollment Tokens for default policies
|
# Query for Enrollment Tokens for default policies
|
||||||
ENDPOINTSENROLLMENTOKEN=$(curl -K /opt/so/conf/elasticsearch/curl.config -L "localhost:5601/api/fleet/enrollment_api_keys" -H 'kbn-xsrf: true' -H 'Content-Type: application/json' | jq .list | jq -r -c '.[] | select(.policy_id | contains("endpoints-initial")) | .api_key')
|
if ENDPOINTSENROLLMENTOKEN_RAW=$(fleet_api "enrollment_api_keys" -H 'kbn-xsrf: true' -H 'Content-Type: application/json'); then
|
||||||
GRIDNODESENROLLMENTOKENGENERAL=$(curl -K /opt/so/conf/elasticsearch/curl.config -L "localhost:5601/api/fleet/enrollment_api_keys" -H 'kbn-xsrf: true' -H 'Content-Type: application/json' | jq .list | jq -r -c '.[] | select(.policy_id | contains("so-grid-nodes_general")) | .api_key')
|
ENDPOINTSENROLLMENTOKEN=$(echo "$ENDPOINTSENROLLMENTOKEN_RAW" | jq .list | jq -r -c '.[] | select(.policy_id | contains("endpoints-initial")) | .api_key')
|
||||||
GRIDNODESENROLLMENTOKENHEAVY=$(curl -K /opt/so/conf/elasticsearch/curl.config -L "localhost:5601/api/fleet/enrollment_api_keys" -H 'kbn-xsrf: true' -H 'Content-Type: application/json' | jq .list | jq -r -c '.[] | select(.policy_id | contains("so-grid-nodes_heavy")) | .api_key')
|
else
|
||||||
|
echo -e "\nFailed to query for Endpoints enrollment token"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if GRIDNODESENROLLMENTOKENGENERAL_RAW=$(fleet_api "enrollment_api_keys" -H 'kbn-xsrf: true' -H 'Content-Type: application/json'); then
|
||||||
|
GRIDNODESENROLLMENTOKENGENERAL=$(echo "$GRIDNODESENROLLMENTOKENGENERAL_RAW" | jq .list | jq -r -c '.[] | select(.policy_id | contains("so-grid-nodes_general")) | .api_key')
|
||||||
|
else
|
||||||
|
echo -e "\nFailed to query for Grid nodes - General enrollment token"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if GRIDNODESENROLLMENTOKENHEAVY_RAW=$(fleet_api "enrollment_api_keys" -H 'kbn-xsrf: true' -H 'Content-Type: application/json'); then
|
||||||
|
GRIDNODESENROLLMENTOKENHEAVY=$(echo "$GRIDNODESENROLLMENTOKENHEAVY_RAW" | jq .list | jq -r -c '.[] | select(.policy_id | contains("so-grid-nodes_heavy")) | .api_key')
|
||||||
|
else
|
||||||
|
echo -e "\nFailed to query for Grid nodes - Heavy enrollment token"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
# Store needed data in minion pillar
|
# Store needed data in minion pillar
|
||||||
pillar_file=/opt/so/saltstack/local/pillar/minions/{{ GLOBALS.minion_id }}.sls
|
pillar_file=/opt/so/saltstack/local/pillar/minions/{{ GLOBALS.minion_id }}.sls
|
||||||
|
|||||||
@@ -5,46 +5,78 @@
|
|||||||
# Elastic License 2.0.
|
# Elastic License 2.0.
|
||||||
|
|
||||||
{% from 'vars/globals.map.jinja' import GLOBALS %}
|
{% from 'vars/globals.map.jinja' import GLOBALS %}
|
||||||
{% if GLOBALS.role in ['so-manager', 'so-standalone', 'so-managersearch'] %}
|
{% if GLOBALS.role in ['so-manager', 'so-standalone', 'so-managersearch', 'so-managerhype'] %}
|
||||||
|
|
||||||
. /usr/sbin/so-common
|
. /usr/sbin/so-common
|
||||||
|
|
||||||
|
force=false
|
||||||
|
while [[ $# -gt 0 ]]; do
|
||||||
|
case $1 in
|
||||||
|
-f|--force)
|
||||||
|
force=true
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "Unknown option $1"
|
||||||
|
echo "Usage: $0 [-f|--force]"
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
# Check to make sure that Kibana API is up & ready
|
# Check to make sure that Kibana API is up & ready
|
||||||
RETURN_CODE=0
|
RETURN_CODE=0
|
||||||
wait_for_web_response "http://localhost:5601/api/fleet/settings" "fleet" 300 "curl -K /opt/so/conf/elasticsearch/curl.config"
|
wait_for_web_response "http://localhost:5601/api/fleet/settings" "fleet" 300 "curl -K /opt/so/conf/elasticsearch/curl.config"
|
||||||
RETURN_CODE=$?
|
RETURN_CODE=$?
|
||||||
|
|
||||||
if [[ "$RETURN_CODE" != "0" ]]; then
|
if [[ "$RETURN_CODE" != "0" ]]; then
|
||||||
printf "Kibana API not accessible, can't setup Elastic Fleet output policy for Kafka..."
|
echo -e "\nKibana API not accessible, can't setup Elastic Fleet output policy for Kafka...\n"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
output=$(curl -sK /opt/so/conf/elasticsearch/curl.config -L "http://localhost:5601/api/fleet/outputs" | jq -r .items[].id)
|
KAFKACRT=$(openssl x509 -in /etc/pki/elasticfleet-kafka.crt)
|
||||||
|
KAFKAKEY=$(openssl rsa -in /etc/pki/elasticfleet-kafka.key)
|
||||||
|
KAFKACA=$(openssl x509 -in /etc/pki/tls/certs/intca.crt)
|
||||||
|
KAFKA_OUTPUT_VERSION="2.6.0"
|
||||||
|
|
||||||
if ! echo "$output" | grep -q "so-manager_kafka"; then
|
if ! kafka_output=$(curl -sK /opt/so/conf/elasticsearch/curl.config -L "http://localhost:5601/api/fleet/outputs/so-manager_kafka" --fail 2>/dev/null); then
|
||||||
KAFKACRT=$(openssl x509 -in /etc/pki/elasticfleet-kafka.crt)
|
# Create a new output policy for Kafka. Default is disabled 'is_default: false & is_default_monitoring: false'
|
||||||
KAFKAKEY=$(openssl rsa -in /etc/pki/elasticfleet-kafka.key)
|
|
||||||
KAFKACA=$(openssl x509 -in /etc/pki/tls/certs/intca.crt)
|
|
||||||
KAFKA_OUTPUT_VERSION="2.6.0"
|
|
||||||
JSON_STRING=$( jq -n \
|
JSON_STRING=$( jq -n \
|
||||||
--arg KAFKACRT "$KAFKACRT" \
|
--arg KAFKACRT "$KAFKACRT" \
|
||||||
--arg KAFKAKEY "$KAFKAKEY" \
|
--arg KAFKAKEY "$KAFKAKEY" \
|
||||||
--arg KAFKACA "$KAFKACA" \
|
--arg KAFKACA "$KAFKACA" \
|
||||||
--arg MANAGER_IP "{{ GLOBALS.manager_ip }}:9092" \
|
--arg MANAGER_IP "{{ GLOBALS.manager_ip }}:9092" \
|
||||||
--arg KAFKA_OUTPUT_VERSION "$KAFKA_OUTPUT_VERSION" \
|
--arg KAFKA_OUTPUT_VERSION "$KAFKA_OUTPUT_VERSION" \
|
||||||
'{ "name": "grid-kafka", "id": "so-manager_kafka", "type": "kafka", "hosts": [ $MANAGER_IP ], "is_default": false, "is_default_monitoring": false, "config_yaml": "", "ssl": { "certificate_authorities": [ $KAFKACA ], "certificate": $KAFKACRT, "key": $KAFKAKEY, "verification_mode": "full" }, "proxy_id": null, "client_id": "Elastic", "version": $KAFKA_OUTPUT_VERSION, "compression": "none", "auth_type": "ssl", "partition": "round_robin", "round_robin": { "group_events": 1 }, "topics":[{"topic":"%{[event.module]}-securityonion","when":{"type":"regexp","condition":"event.module:.+"}},{"topic":"default-securityonion"}], "headers": [ { "key": "", "value": "" } ], "timeout": 30, "broker_timeout": 30, "required_acks": 1 }'
|
'{"name":"grid-kafka", "id":"so-manager_kafka","type":"kafka","hosts":[ $MANAGER_IP ],"is_default":false,"is_default_monitoring":false,"config_yaml":"","ssl":{"certificate_authorities":[ $KAFKACA ],"certificate": $KAFKACRT ,"key":"","verification_mode":"full"},"proxy_id":null,"client_id":"Elastic","version": $KAFKA_OUTPUT_VERSION ,"compression":"none","auth_type":"ssl","partition":"round_robin","round_robin":{"group_events":10},"topics":[{"topic":"default-securityonion"}],"headers":[{"key":"","value":""}],"timeout":30,"broker_timeout":30,"required_acks":1,"secrets":{"ssl":{"key": $KAFKAKEY }}}'
|
||||||
)
|
)
|
||||||
curl -sK /opt/so/conf/elasticsearch/curl.config -L -X POST "localhost:5601/api/fleet/outputs" -H 'kbn-xsrf: true' -H 'Content-Type: application/json' -d "$JSON_STRING" -o /dev/null
|
if ! response=$(curl -sK /opt/so/conf/elasticsearch/curl.config -L -X POST "localhost:5601/api/fleet/outputs" -H 'kbn-xsrf: true' -H 'Content-Type: application/json' -d "$JSON_STRING" --fail 2>/dev/null); then
|
||||||
refresh_output=$(curl -sK /opt/so/conf/elasticsearch/curl.config -L "http://localhost:5601/api/fleet/outputs" | jq -r .items[].id)
|
echo -e "\nFailed to setup Elastic Fleet output policy for Kafka...\n"
|
||||||
|
exit 1
|
||||||
if ! echo "$refresh_output" | grep -q "so-manager_kafka"; then
|
else
|
||||||
echo -e "\nFailed to setup Elastic Fleet output policy for Kafka...\n"
|
echo -e "\nSuccessfully setup Elastic Fleet output policy for Kafka...\n"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
elif kafka_output=$(curl -sK /opt/so/conf/elasticsearch/curl.config -L "http://localhost:5601/api/fleet/outputs/so-manager_kafka" --fail 2>/dev/null) && [[ "$force" == "true" ]]; then
|
||||||
|
# force an update to Kafka policy. Keep the current value of Kafka output policy (enabled/disabled).
|
||||||
|
ENABLED_DISABLED=$(echo "$kafka_output" | jq -e .item.is_default)
|
||||||
|
HOSTS=$(echo "$kafka_output" | jq -r '.item.hosts')
|
||||||
|
JSON_STRING=$( jq -n \
|
||||||
|
--arg KAFKACRT "$KAFKACRT" \
|
||||||
|
--arg KAFKAKEY "$KAFKAKEY" \
|
||||||
|
--arg KAFKACA "$KAFKACA" \
|
||||||
|
--arg ENABLED_DISABLED "$ENABLED_DISABLED"\
|
||||||
|
--arg KAFKA_OUTPUT_VERSION "$KAFKA_OUTPUT_VERSION" \
|
||||||
|
--argjson HOSTS "$HOSTS" \
|
||||||
|
'{"name":"grid-kafka","type":"kafka","hosts":$HOSTS,"is_default":$ENABLED_DISABLED,"is_default_monitoring":$ENABLED_DISABLED,"config_yaml":"","ssl":{"certificate_authorities":[ $KAFKACA ],"certificate": $KAFKACRT ,"key":"","verification_mode":"full"},"proxy_id":null,"client_id":"Elastic","version": $KAFKA_OUTPUT_VERSION ,"compression":"none","auth_type":"ssl","partition":"round_robin","round_robin":{"group_events":10},"topics":[{"topic":"default-securityonion"}],"headers":[{"key":"","value":""}],"timeout":30,"broker_timeout":30,"required_acks":1,"secrets":{"ssl":{"key": $KAFKAKEY }}}'
|
||||||
|
)
|
||||||
|
if ! response=$(curl -sK /opt/so/conf/elasticsearch/curl.config -L -X PUT "localhost:5601/api/fleet/outputs/so-manager_kafka" -H 'kbn-xsrf: true' -H 'Content-Type: application/json' -d "$JSON_STRING" --fail 2>/dev/null); then
|
||||||
|
echo -e "\nFailed to force update to Elastic Fleet output policy for Kafka...\n"
|
||||||
exit 1
|
exit 1
|
||||||
elif echo "$refresh_output" | grep -q "so-manager_kafka"; then
|
else
|
||||||
echo -e "\nSuccessfully setup Elastic Fleet output policy for Kafka...\n"
|
echo -e "\nForced update to Elastic Fleet output policy for Kafka...\n"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
elif echo "$output" | grep -q "so-manager_kafka"; then
|
else
|
||||||
echo -e "\nElastic Fleet output policy for Kafka already exists...\n"
|
echo -e "\nElastic Fleet output policy for Kafka already exists...\n"
|
||||||
fi
|
fi
|
||||||
{% else %}
|
{% else %}
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
elastic_auth_pillar:
|
elastic_auth_pillar:
|
||||||
file.managed:
|
file.managed:
|
||||||
- name: /opt/so/saltstack/local/pillar/elasticsearch/auth.sls
|
- name: /opt/so/saltstack/local/pillar/elasticsearch/auth.sls
|
||||||
- mode: 600
|
- mode: 640
|
||||||
- reload_pillar: True
|
- reload_pillar: True
|
||||||
- contents: |
|
- contents: |
|
||||||
elasticsearch:
|
elasticsearch:
|
||||||
|
|||||||
@@ -28,7 +28,7 @@
|
|||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
||||||
{% if grains.id.split('_') | last in ['manager','managersearch','standalone'] %}
|
{% if grains.id.split('_') | last in ['manager','managerhype','managersearch','standalone'] %}
|
||||||
{% if ELASTICSEARCH_SEED_HOSTS | length > 1 %}
|
{% if ELASTICSEARCH_SEED_HOSTS | length > 1 %}
|
||||||
{% do ELASTICSEARCHDEFAULTS.elasticsearch.config.update({'discovery': {'seed_hosts': []}}) %}
|
{% do ELASTICSEARCHDEFAULTS.elasticsearch.config.update({'discovery': {'seed_hosts': []}}) %}
|
||||||
{% for NODE in ELASTICSEARCH_SEED_HOSTS %}
|
{% for NODE in ELASTICSEARCH_SEED_HOSTS %}
|
||||||
|
|||||||
@@ -47,6 +47,7 @@ elasticsearch_sbin:
|
|||||||
- file_mode: 755
|
- file_mode: 755
|
||||||
- exclude_pat:
|
- exclude_pat:
|
||||||
- so-elasticsearch-pipelines # exclude this because we need to watch it for changes, we sync it in another state
|
- so-elasticsearch-pipelines # exclude this because we need to watch it for changes, we sync it in another state
|
||||||
|
- show_changes: False
|
||||||
|
|
||||||
elasticsearch_sbin_jinja:
|
elasticsearch_sbin_jinja:
|
||||||
file.recurse:
|
file.recurse:
|
||||||
@@ -60,6 +61,7 @@ elasticsearch_sbin_jinja:
|
|||||||
- so-elasticsearch-ilm-policy-load # exclude this because we need to watch it for changes, we sync it in another state
|
- so-elasticsearch-ilm-policy-load # exclude this because we need to watch it for changes, we sync it in another state
|
||||||
- defaults:
|
- defaults:
|
||||||
GLOBALS: {{ GLOBALS }}
|
GLOBALS: {{ GLOBALS }}
|
||||||
|
- show_changes: False
|
||||||
|
|
||||||
so-elasticsearch-ilm-policy-load-script:
|
so-elasticsearch-ilm-policy-load-script:
|
||||||
file.managed:
|
file.managed:
|
||||||
@@ -69,6 +71,7 @@ so-elasticsearch-ilm-policy-load-script:
|
|||||||
- group: 939
|
- group: 939
|
||||||
- mode: 754
|
- mode: 754
|
||||||
- template: jinja
|
- template: jinja
|
||||||
|
- show_changes: False
|
||||||
|
|
||||||
so-elasticsearch-pipelines-script:
|
so-elasticsearch-pipelines-script:
|
||||||
file.managed:
|
file.managed:
|
||||||
@@ -77,6 +80,7 @@ so-elasticsearch-pipelines-script:
|
|||||||
- user: 930
|
- user: 930
|
||||||
- group: 939
|
- group: 939
|
||||||
- mode: 754
|
- mode: 754
|
||||||
|
- show_changes: False
|
||||||
|
|
||||||
esingestdir:
|
esingestdir:
|
||||||
file.directory:
|
file.directory:
|
||||||
@@ -110,6 +114,7 @@ esingestdynamicconf:
|
|||||||
- user: 930
|
- user: 930
|
||||||
- group: 939
|
- group: 939
|
||||||
- template: jinja
|
- template: jinja
|
||||||
|
- show_changes: False
|
||||||
|
|
||||||
esingestconf:
|
esingestconf:
|
||||||
file.recurse:
|
file.recurse:
|
||||||
@@ -117,6 +122,12 @@ esingestconf:
|
|||||||
- source: salt://elasticsearch/files/ingest
|
- source: salt://elasticsearch/files/ingest
|
||||||
- user: 930
|
- user: 930
|
||||||
- group: 939
|
- group: 939
|
||||||
|
- show_changes: False
|
||||||
|
|
||||||
|
# Remove .fleet_final_pipeline-1 because we are using global@custom now
|
||||||
|
so-fleet-final-pipeline-remove:
|
||||||
|
file.absent:
|
||||||
|
- name: /opt/so/conf/elasticsearch/ingest/.fleet_final_pipeline-1
|
||||||
|
|
||||||
# Auto-generate Elasticsearch ingest node pipelines from pillar
|
# Auto-generate Elasticsearch ingest node pipelines from pillar
|
||||||
{% for pipeline, config in ELASTICSEARCHMERGED.pipelines.items() %}
|
{% for pipeline, config in ELASTICSEARCHMERGED.pipelines.items() %}
|
||||||
@@ -148,6 +159,7 @@ esyml:
|
|||||||
- defaults:
|
- defaults:
|
||||||
ESCONFIG: {{ ELASTICSEARCHMERGED.config }}
|
ESCONFIG: {{ ELASTICSEARCHMERGED.config }}
|
||||||
- template: jinja
|
- template: jinja
|
||||||
|
- show_changes: False
|
||||||
|
|
||||||
esroles:
|
esroles:
|
||||||
file.recurse:
|
file.recurse:
|
||||||
@@ -157,6 +169,7 @@ esroles:
|
|||||||
- template: jinja
|
- template: jinja
|
||||||
- user: 930
|
- user: 930
|
||||||
- group: 939
|
- group: 939
|
||||||
|
- show_changes: False
|
||||||
|
|
||||||
nsmesdir:
|
nsmesdir:
|
||||||
file.directory:
|
file.directory:
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -6,10 +6,11 @@
|
|||||||
{% from 'allowed_states.map.jinja' import allowed_states %}
|
{% from 'allowed_states.map.jinja' import allowed_states %}
|
||||||
{% if sls.split('.')[0] in allowed_states %}
|
{% if sls.split('.')[0] in allowed_states %}
|
||||||
{% from 'vars/globals.map.jinja' import GLOBALS %}
|
{% from 'vars/globals.map.jinja' import GLOBALS %}
|
||||||
|
{% import_yaml 'elasticsearch/defaults.yaml' as ELASTICSEARCHDEFAULTS %}
|
||||||
|
|
||||||
so-elasticsearch_image:
|
so-elasticsearch_image:
|
||||||
docker_image.present:
|
docker_image.present:
|
||||||
- name: {{ GLOBALS.registry_host }}:5000/{{ GLOBALS.image_repo }}/so-elasticsearch:{{ GLOBALS.so_version }}
|
- name: {{ GLOBALS.registry_host }}:5000/{{ GLOBALS.image_repo }}/so-elasticsearch:{{ ELASTICSEARCHDEFAULTS.elasticsearch.version }}
|
||||||
|
|
||||||
{% else %}
|
{% else %}
|
||||||
|
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ include:
|
|||||||
|
|
||||||
so-elasticsearch:
|
so-elasticsearch:
|
||||||
docker_container.running:
|
docker_container.running:
|
||||||
- image: {{ GLOBALS.registry_host }}:5000/{{ GLOBALS.image_repo }}/so-elasticsearch:{{ GLOBALS.so_version }}
|
- image: {{ GLOBALS.registry_host }}:5000/{{ GLOBALS.image_repo }}/so-elasticsearch:{{ ELASTICSEARCHMERGED.version }}
|
||||||
- hostname: elasticsearch
|
- hostname: elasticsearch
|
||||||
- name: so-elasticsearch
|
- name: so-elasticsearch
|
||||||
- user: elasticsearch
|
- user: elasticsearch
|
||||||
@@ -38,7 +38,7 @@ so-elasticsearch:
|
|||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
- environment:
|
- environment:
|
||||||
{% if ELASTICSEARCH_SEED_HOSTS | length == 1 or GLOBALS.role == 'so-heavynode' %}
|
{% if (GLOBALS.role in GLOBALS.manager_roles and ELASTICSEARCH_SEED_HOSTS | length == 1) or GLOBALS.role == 'so-heavynode' %}
|
||||||
- discovery.type=single-node
|
- discovery.type=single-node
|
||||||
{% endif %}
|
{% endif %}
|
||||||
- ES_JAVA_OPTS=-Xms{{ GLOBALS.elasticsearch.es_heap }} -Xmx{{ GLOBALS.elasticsearch.es_heap }} -Des.transport.cname_in_publish_address=true -Dlog4j2.formatMsgNoLookups=true
|
- ES_JAVA_OPTS=-Xms{{ GLOBALS.elasticsearch.es_heap }} -Xmx{{ GLOBALS.elasticsearch.es_heap }} -Des.transport.cname_in_publish_address=true -Dlog4j2.formatMsgNoLookups=true
|
||||||
@@ -116,6 +116,7 @@ escomponenttemplates:
|
|||||||
- clean: True
|
- clean: True
|
||||||
- onchanges_in:
|
- onchanges_in:
|
||||||
- file: so-elasticsearch-templates-reload
|
- file: so-elasticsearch-templates-reload
|
||||||
|
- show_changes: False
|
||||||
|
|
||||||
# Auto-generate templates from defaults file
|
# Auto-generate templates from defaults file
|
||||||
{% for index, settings in ES_INDEX_SETTINGS.items() %}
|
{% for index, settings in ES_INDEX_SETTINGS.items() %}
|
||||||
@@ -127,6 +128,7 @@ es_index_template_{{index}}:
|
|||||||
- defaults:
|
- defaults:
|
||||||
TEMPLATE_CONFIG: {{ settings.index_template }}
|
TEMPLATE_CONFIG: {{ settings.index_template }}
|
||||||
- template: jinja
|
- template: jinja
|
||||||
|
- show_changes: False
|
||||||
- onchanges_in:
|
- onchanges_in:
|
||||||
- file: so-elasticsearch-templates-reload
|
- file: so-elasticsearch-templates-reload
|
||||||
{% endif %}
|
{% endif %}
|
||||||
@@ -146,12 +148,13 @@ es_template_{{TEMPLATE.split('.')[0] | replace("/","_") }}:
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
- user: 930
|
- user: 930
|
||||||
- group: 939
|
- group: 939
|
||||||
|
- show_changes: False
|
||||||
- onchanges_in:
|
- onchanges_in:
|
||||||
- file: so-elasticsearch-templates-reload
|
- file: so-elasticsearch-templates-reload
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% if GLOBALS.role in GLOBALS.manager_roles %}
|
{% if GLOBALS.role in GLOBALS.manager_roles %}
|
||||||
so-es-cluster-settings:
|
so-es-cluster-settings:
|
||||||
cmd.run:
|
cmd.run:
|
||||||
- name: /usr/sbin/so-elasticsearch-cluster-settings
|
- name: /usr/sbin/so-elasticsearch-cluster-settings
|
||||||
@@ -160,7 +163,7 @@ so-es-cluster-settings:
|
|||||||
- require:
|
- require:
|
||||||
- docker_container: so-elasticsearch
|
- docker_container: so-elasticsearch
|
||||||
- file: elasticsearch_sbin_jinja
|
- file: elasticsearch_sbin_jinja
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
so-elasticsearch-ilm-policy-load:
|
so-elasticsearch-ilm-policy-load:
|
||||||
cmd.run:
|
cmd.run:
|
||||||
@@ -201,12 +204,17 @@ so-elasticsearch-roles-load:
|
|||||||
- docker_container: so-elasticsearch
|
- docker_container: so-elasticsearch
|
||||||
- file: elasticsearch_sbin_jinja
|
- file: elasticsearch_sbin_jinja
|
||||||
|
|
||||||
{% if grains.role in ['so-eval', 'so-standalone', 'so-managersearch', 'so-heavynode', 'so-manager'] %}
|
{% if grains.role in ['so-managersearch', 'so-manager', 'so-managerhype'] %}
|
||||||
|
{% set ap = "absent" %}
|
||||||
|
{% endif %}
|
||||||
|
{% if grains.role in ['so-eval', 'so-standalone', 'so-heavynode'] %}
|
||||||
{% if ELASTICSEARCHMERGED.index_clean %}
|
{% if ELASTICSEARCHMERGED.index_clean %}
|
||||||
{% set ap = "present" %}
|
{% set ap = "present" %}
|
||||||
{% else %}
|
{% else %}
|
||||||
{% set ap = "absent" %}
|
{% set ap = "absent" %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
{% endif %}
|
||||||
|
{% if grains.role in ['so-eval', 'so-standalone', 'so-managersearch', 'so-heavynode', 'so-manager'] %}
|
||||||
so-elasticsearch-indices-delete:
|
so-elasticsearch-indices-delete:
|
||||||
cron.{{ap}}:
|
cron.{{ap}}:
|
||||||
- name: /usr/sbin/so-elasticsearch-indices-delete > /opt/so/log/elasticsearch/cron-elasticsearch-indices-delete.log 2>&1
|
- name: /usr/sbin/so-elasticsearch-indices-delete > /opt/so/log/elasticsearch/cron-elasticsearch-indices-delete.log 2>&1
|
||||||
|
|||||||
@@ -26,7 +26,7 @@
|
|||||||
{
|
{
|
||||||
"geoip": {
|
"geoip": {
|
||||||
"field": "destination.ip",
|
"field": "destination.ip",
|
||||||
"target_field": "destination_geo",
|
"target_field": "destination.as",
|
||||||
"database_file": "GeoLite2-ASN.mmdb",
|
"database_file": "GeoLite2-ASN.mmdb",
|
||||||
"ignore_missing": true,
|
"ignore_missing": true,
|
||||||
"ignore_failure": true,
|
"ignore_failure": true,
|
||||||
@@ -36,13 +36,17 @@
|
|||||||
{
|
{
|
||||||
"geoip": {
|
"geoip": {
|
||||||
"field": "source.ip",
|
"field": "source.ip",
|
||||||
"target_field": "source_geo",
|
"target_field": "source.as",
|
||||||
"database_file": "GeoLite2-ASN.mmdb",
|
"database_file": "GeoLite2-ASN.mmdb",
|
||||||
"ignore_missing": true,
|
"ignore_missing": true,
|
||||||
"ignore_failure": true,
|
"ignore_failure": true,
|
||||||
"properties": ["ip", "asn", "organization_name", "network"]
|
"properties": ["ip", "asn", "organization_name", "network"]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{ "rename": { "field": "destination.as.organization_name", "target_field": "destination.as.organization.name", "ignore_failure": true, "ignore_missing": true } },
|
||||||
|
{ "rename": { "field": "source.as.organization_name", "target_field": "source.as.organization.name", "ignore_failure": true, "ignore_missing": true } },
|
||||||
|
{ "rename": { "field": "destination.as.asn", "target_field": "destination.as.number", "ignore_failure": true, "ignore_missing": true } },
|
||||||
|
{ "rename": { "field": "source.as.asn", "target_field": "source.as.number", "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 == 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 == 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 == 3", "field": "event.severity_label", "value": "high", "override": true } },
|
||||||
@@ -62,6 +66,7 @@
|
|||||||
{ "split": { "if": "ctx.event?.dataset != null && ctx.event.dataset.contains('.')", "field": "event.dataset", "separator": "\\.", "target_field": "dataset_tag_temp" } },
|
{ "split": { "if": "ctx.event?.dataset != null && ctx.event.dataset.contains('.')", "field": "event.dataset", "separator": "\\.", "target_field": "dataset_tag_temp" } },
|
||||||
{ "append": { "if": "ctx.dataset_tag_temp != null", "field": "tags", "value": "{{dataset_tag_temp.1}}" } },
|
{ "append": { "if": "ctx.dataset_tag_temp != null", "field": "tags", "value": "{{dataset_tag_temp.1}}" } },
|
||||||
{ "grok": { "if": "ctx.http?.response?.status_code != null", "field": "http.response.status_code", "patterns": ["%{NUMBER:http.response.status_code:long} %{GREEDYDATA}"]} },
|
{ "grok": { "if": "ctx.http?.response?.status_code != null", "field": "http.response.status_code", "patterns": ["%{NUMBER:http.response.status_code:long} %{GREEDYDATA}"]} },
|
||||||
|
{ "set": { "if": "ctx?.metadata?.kafka != null" , "field": "kafka.id", "value": "{{metadata.kafka.partition}}{{metadata.kafka.offset}}{{metadata.kafka.timestamp}}", "ignore_failure": true } },
|
||||||
{ "remove": { "field": [ "message2", "type", "fields", "category", "module", "dataset", "dataset_tag_temp", "event.dataset_temp" ], "ignore_missing": true, "ignore_failure": true } }
|
{ "remove": { "field": [ "message2", "type", "fields", "category", "module", "dataset", "dataset_tag_temp", "event.dataset_temp" ], "ignore_missing": true, "ignore_failure": true } }
|
||||||
{%- endraw %}
|
{%- endraw %}
|
||||||
{%- if HIGHLANDER %}
|
{%- if HIGHLANDER %}
|
||||||
@@ -73,6 +78,8 @@
|
|||||||
}
|
}
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
{%- raw %}
|
{%- raw %}
|
||||||
|
,
|
||||||
|
{ "pipeline": { "name": "global@custom", "ignore_missing_pipeline": true, "description": "[Fleet] Global pipeline for all data streams" } }
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
{% endraw %}
|
{% endraw %}
|
||||||
|
|||||||
@@ -1,107 +0,0 @@
|
|||||||
{
|
|
||||||
"version": 3,
|
|
||||||
"_meta": {
|
|
||||||
"managed_by": "fleet",
|
|
||||||
"managed": true
|
|
||||||
},
|
|
||||||
"description": "Final pipeline for processing all incoming Fleet Agent documents. \n",
|
|
||||||
"processors": [
|
|
||||||
{
|
|
||||||
"date": {
|
|
||||||
"description": "Add time when event was ingested (and remove sub-seconds to improve storage efficiency)",
|
|
||||||
"tag": "truncate-subseconds-event-ingested",
|
|
||||||
"field": "_ingest.timestamp",
|
|
||||||
"target_field": "event.ingested",
|
|
||||||
"formats": [
|
|
||||||
"ISO8601"
|
|
||||||
],
|
|
||||||
"output_format": "date_time_no_millis",
|
|
||||||
"ignore_failure": true
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"remove": {
|
|
||||||
"description": "Remove any pre-existing untrusted values.",
|
|
||||||
"field": [
|
|
||||||
"event.agent_id_status",
|
|
||||||
"_security"
|
|
||||||
],
|
|
||||||
"ignore_missing": true
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"set_security_user": {
|
|
||||||
"field": "_security",
|
|
||||||
"properties": [
|
|
||||||
"authentication_type",
|
|
||||||
"username",
|
|
||||||
"realm",
|
|
||||||
"api_key"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"script": {
|
|
||||||
"description": "Add event.agent_id_status based on the API key metadata and the agent.id contained in the event.\n",
|
|
||||||
"tag": "agent-id-status",
|
|
||||||
"source": "boolean is_user_trusted(def ctx, def users) {\n if (ctx?._security?.username == null) {\n return false;\n }\n\n def user = null;\n for (def item : users) {\n if (item?.username == ctx._security.username) {\n user = item;\n break;\n }\n }\n\n if (user == null || user?.realm == null || ctx?._security?.realm?.name == null) {\n return false;\n }\n\n if (ctx._security.realm.name != user.realm) {\n return false;\n }\n\n return true;\n}\n\nString verified(def ctx, def params) {\n // No agent.id field to validate.\n if (ctx?.agent?.id == null) {\n return \"missing\";\n }\n\n // Check auth metadata from API key.\n if (ctx?._security?.authentication_type == null\n // Agents only use API keys.\n || ctx._security.authentication_type != 'API_KEY'\n // Verify the API key owner before trusting any metadata it contains.\n || !is_user_trusted(ctx, params.trusted_users)\n // Verify the API key has metadata indicating the assigned agent ID.\n || ctx?._security?.api_key?.metadata?.agent_id == null) {\n return \"auth_metadata_missing\";\n }\n\n // The API key can only be used represent the agent.id it was issued to.\n if (ctx._security.api_key.metadata.agent_id != ctx.agent.id) {\n // Potential masquerade attempt.\n return \"mismatch\";\n }\n\n return \"verified\";\n}\n\nif (ctx?.event == null) {\n ctx.event = [:];\n}\n\nctx.event.agent_id_status = verified(ctx, params);",
|
|
||||||
"params": {
|
|
||||||
"trusted_users": [
|
|
||||||
{
|
|
||||||
"username": "elastic/fleet-server",
|
|
||||||
"realm": "_service_account"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"username": "cloud-internal-agent-server",
|
|
||||||
"realm": "found"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"username": "elastic",
|
|
||||||
"realm": "reserved"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"remove": {
|
|
||||||
"field": "_security",
|
|
||||||
"ignore_missing": true
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{ "set": { "ignore_failure": true, "field": "event.module", "value": "elastic_agent" } },
|
|
||||||
{ "split": { "if": "ctx.event?.dataset != null && ctx.event.dataset.contains('.')", "field": "event.dataset", "separator": "\\.", "target_field": "module_temp" } },
|
|
||||||
{ "set": { "if": "ctx.module_temp != null", "override": true, "field": "event.module", "value": "{{module_temp.0}}" } },
|
|
||||||
{ "gsub": { "if": "ctx.event?.dataset != null && ctx.event.dataset.contains('.')", "field": "event.dataset", "pattern": "^[^.]*.", "replacement": "", "target_field": "dataset_tag_temp" } },
|
|
||||||
{ "append": { "if": "ctx.dataset_tag_temp != null", "field": "tags", "value": "{{dataset_tag_temp}}" } },
|
|
||||||
{ "set": { "if": "ctx.network?.direction == 'egress'", "override": true, "field": "network.initiated", "value": "true" } },
|
|
||||||
{ "set": { "if": "ctx.network?.direction == 'ingress'", "override": true, "field": "network.initiated", "value": "false" } },
|
|
||||||
{ "set": { "if": "ctx.network?.type == 'ipv4'", "override": true, "field": "destination.ipv6", "value": "false" } },
|
|
||||||
{ "set": { "if": "ctx.network?.type == 'ipv6'", "override": true, "field": "destination.ipv6", "value": "true" } },
|
|
||||||
{ "set": { "if": "ctx.tags.0 == 'import'", "override": true, "field": "data_stream.dataset", "value": "import" } },
|
|
||||||
{ "set": { "if": "ctx.tags.0 == 'import'", "override": true, "field": "data_stream.namespace", "value": "so" } },
|
|
||||||
{ "date": { "if": "ctx.event?.module == 'system'", "field": "event.created", "target_field": "@timestamp","ignore_failure": true, "formats": ["yyyy-MM-dd'T'HH:mm:ss.SSSX","yyyy-MM-dd'T'HH:mm:ss.SSSSSS'Z'"] } },
|
|
||||||
{ "community_id":{ "if": "ctx.event?.dataset == 'endpoint.events.network'", "ignore_failure":true } },
|
|
||||||
{ "set": { "if": "ctx.event?.module == 'fim'", "override": true, "field": "event.module", "value": "file_integrity" } },
|
|
||||||
{ "rename": { "if": "ctx.winlog?.provider_name == 'Microsoft-Windows-Windows Defender'", "ignore_missing": true, "field": "winlog.event_data.Threat Name", "target_field": "winlog.event_data.threat_name" } },
|
|
||||||
{ "set": { "if": "ctx?.metadata?.kafka != null" , "field": "kafka.id", "value": "{{metadata.kafka.partition}}{{metadata.kafka.offset}}{{metadata.kafka.timestamp}}", "ignore_failure": true } },
|
|
||||||
{ "remove": { "field": [ "message2", "type", "fields", "category", "module", "dataset", "event.dataset_temp", "dataset_tag_temp", "module_temp" ], "ignore_missing": true, "ignore_failure": true } }
|
|
||||||
],
|
|
||||||
"on_failure": [
|
|
||||||
{
|
|
||||||
"remove": {
|
|
||||||
"field": "_security",
|
|
||||||
"ignore_missing": true,
|
|
||||||
"ignore_failure": true
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"append": {
|
|
||||||
"field": "error.message",
|
|
||||||
"value": [
|
|
||||||
"failed in Fleet agent final_pipeline: {{ _ingest.on_failure_message }}"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
22
salt/elasticsearch/files/ingest/common.ip_validation
Normal file
22
salt/elasticsearch/files/ingest/common.ip_validation
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
{
|
||||||
|
"processors": [
|
||||||
|
{
|
||||||
|
"convert": {
|
||||||
|
"field": "_ingest._value",
|
||||||
|
"type": "ip",
|
||||||
|
"target_field": "_ingest._temp_ip",
|
||||||
|
"ignore_failure": true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"append": {
|
||||||
|
"field": "temp._valid_ips",
|
||||||
|
"allow_duplicates": false,
|
||||||
|
"value": [
|
||||||
|
"{{{_ingest._temp_ip}}}"
|
||||||
|
],
|
||||||
|
"ignore_failure": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
36
salt/elasticsearch/files/ingest/elasticagent.monitor
Normal file
36
salt/elasticsearch/files/ingest/elasticagent.monitor
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
{
|
||||||
|
"processors": [
|
||||||
|
{
|
||||||
|
"set": {
|
||||||
|
"field": "event.dataset",
|
||||||
|
"value": "gridmetrics.agents",
|
||||||
|
"ignore_failure": true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"set": {
|
||||||
|
"field": "event.module",
|
||||||
|
"value": "gridmetrics",
|
||||||
|
"ignore_failure": true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"remove": {
|
||||||
|
"field": [
|
||||||
|
"host",
|
||||||
|
"elastic_agent",
|
||||||
|
"agent"
|
||||||
|
],
|
||||||
|
"ignore_missing": true,
|
||||||
|
"ignore_failure": true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"json": {
|
||||||
|
"field": "message",
|
||||||
|
"add_to_root": true,
|
||||||
|
"ignore_failure": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
31
salt/elasticsearch/files/ingest/global@custom
Normal file
31
salt/elasticsearch/files/ingest/global@custom
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
{
|
||||||
|
"version": 3,
|
||||||
|
"_meta": {
|
||||||
|
"managed_by": "securityonion",
|
||||||
|
"managed": true
|
||||||
|
},
|
||||||
|
"description": "Custom pipeline for processing all incoming Fleet Agent documents. \n",
|
||||||
|
"processors": [
|
||||||
|
{ "set": { "ignore_failure": true, "field": "event.module", "value": "elastic_agent" } },
|
||||||
|
{ "split": { "if": "ctx.event?.dataset != null && ctx.event.dataset.contains('.')", "field": "event.dataset", "separator": "\\.", "target_field": "module_temp" } },
|
||||||
|
{ "split": { "if": "ctx.data_stream?.dataset != null && ctx.data_stream?.dataset.contains('.')", "field":"data_stream.dataset", "separator":"\\.", "target_field":"datastream_dataset_temp", "ignore_missing":true } },
|
||||||
|
{ "set": { "if": "ctx.module_temp != null", "override": true, "field": "event.module", "value": "{{module_temp.0}}" } },
|
||||||
|
{ "set": { "if": "ctx.datastream_dataset_temp != null && ctx.datastream_dataset_temp[0] == 'network_traffic'", "field":"event.module", "value":"{{ datastream_dataset_temp.0 }}", "ignore_failure":true, "ignore_empty_value":true, "description":"Fix EA network packet capture" } },
|
||||||
|
{ "gsub": { "if": "ctx.event?.dataset != null && ctx.event.dataset.contains('.')", "field": "event.dataset", "pattern": "^[^.]*.", "replacement": "", "target_field": "dataset_tag_temp" } },
|
||||||
|
{ "append": { "if": "ctx.dataset_tag_temp != null", "field": "tags", "value": "{{dataset_tag_temp}}", "allow_duplicates": false } },
|
||||||
|
{ "set": { "if": "ctx.network?.direction == 'egress'", "override": true, "field": "network.initiated", "value": "true" } },
|
||||||
|
{ "set": { "if": "ctx.network?.direction == 'ingress'", "override": true, "field": "network.initiated", "value": "false" } },
|
||||||
|
{ "set": { "if": "ctx.network?.type == 'ipv4'", "override": true, "field": "destination.ipv6", "value": "false" } },
|
||||||
|
{ "set": { "if": "ctx.network?.type == 'ipv6'", "override": true, "field": "destination.ipv6", "value": "true" } },
|
||||||
|
{ "set": { "if": "ctx.tags != null && ctx.tags.contains('import')", "override": true, "field": "data_stream.dataset", "value": "import" } },
|
||||||
|
{ "set": { "if": "ctx.tags != null && ctx.tags.contains('import')", "override": true, "field": "data_stream.namespace", "value": "so" } },
|
||||||
|
{ "community_id":{ "if": "ctx.event?.dataset == 'endpoint.events.network'", "ignore_failure":true } },
|
||||||
|
{ "set": { "if": "ctx.event?.module == 'fim'", "override": true, "field": "event.module", "value": "file_integrity" } },
|
||||||
|
{ "rename": { "if": "ctx.winlog?.provider_name == 'Microsoft-Windows-Windows Defender'", "ignore_missing": true, "field": "winlog.event_data.Threat Name", "target_field": "winlog.event_data.threat_name" } },
|
||||||
|
{ "set": { "if": "ctx?.metadata?.kafka != null" , "field": "kafka.id", "value": "{{metadata.kafka.partition}}{{metadata.kafka.offset}}{{metadata.kafka.timestamp}}", "ignore_failure": true } },
|
||||||
|
{ "set": { "if": "ctx.event?.dataset != null && ctx.event?.dataset == 'elasticsearch.server'", "field": "event.module", "value":"elasticsearch" }},
|
||||||
|
{"append": {"field":"related.ip","value":["{{source.ip}}","{{destination.ip}}"],"allow_duplicates":false,"if":"ctx?.event?.dataset == 'endpoint.events.network' && ctx?.source?.ip != null","ignore_failure":true}},
|
||||||
|
{"foreach": {"field":"host.ip","processor":{"append":{"field":"related.ip","value":"{{_ingest._value}}","allow_duplicates":false}},"if":"ctx?.event?.module == 'endpoint' && ctx?.host?.ip != null","ignore_missing":true, "description":"Extract IPs from Elastic Agent events (host.ip) and adds them to related.ip"}},
|
||||||
|
{ "remove": { "field": [ "message2", "type", "fields", "category", "module", "dataset", "event.dataset_temp", "dataset_tag_temp", "module_temp", "datastream_dataset_temp" ], "ignore_missing": true, "ignore_failure": true } }
|
||||||
|
]
|
||||||
|
}
|
||||||
9
salt/elasticsearch/files/ingest/hydra
Normal file
9
salt/elasticsearch/files/ingest/hydra
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
{
|
||||||
|
"description" : "hydra",
|
||||||
|
"processors" : [
|
||||||
|
{"set":{"field":"audience","value":"access","override":false,"ignore_failure":true}},
|
||||||
|
{"set":{"field":"event.dataset","ignore_empty_value":true,"ignore_failure":true,"value":"hydra.{{{audience}}}","media_type":"text/plain"}},
|
||||||
|
{"set":{"field":"event.action","ignore_failure":true,"copy_from":"msg" }},
|
||||||
|
{ "pipeline": { "name": "common" } }
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
{
|
|
||||||
"description" : "import.wel",
|
|
||||||
"processors" : [
|
|
||||||
{ "set": { "field": "event.ingested", "value": "{{ @timestamp }}" } },
|
|
||||||
{ "set" : { "field" : "@timestamp", "value" : "{{ event.created }}" } },
|
|
||||||
{ "remove": { "field": [ "event_record_id", "event.created" , "timestamp" , "winlog.event_data.UtcTime" ], "ignore_failure": true } },
|
|
||||||
{ "pipeline": { "if": "ctx.winlog?.channel == 'Microsoft-Windows-Sysmon/Operational'", "name": "sysmon" } },
|
|
||||||
{ "pipeline": { "if": "ctx.winlog?.channel != 'Microsoft-Windows-Sysmon/Operational'", "name":"win.eventlogs" } },
|
|
||||||
{ "pipeline": { "name": "common" } }
|
|
||||||
]
|
|
||||||
}
|
|
||||||
@@ -1,10 +1,17 @@
|
|||||||
{
|
{
|
||||||
"description": "Pipeline for pfSense",
|
"description": "Pipeline for PFsense",
|
||||||
|
"_meta": {
|
||||||
|
"managed_by": "fleet",
|
||||||
|
"managed": true,
|
||||||
|
"package": {
|
||||||
|
"name": "pfsense"
|
||||||
|
}
|
||||||
|
},
|
||||||
"processors": [
|
"processors": [
|
||||||
{
|
{
|
||||||
"set": {
|
"set": {
|
||||||
"field": "ecs.version",
|
"field": "ecs.version",
|
||||||
"value": "8.10.0"
|
"value": "8.17.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -22,7 +29,9 @@
|
|||||||
{
|
{
|
||||||
"rename": {
|
"rename": {
|
||||||
"field": "message",
|
"field": "message",
|
||||||
"target_field": "event.original"
|
"target_field": "event.original",
|
||||||
|
"ignore_missing": true,
|
||||||
|
"if": "ctx.event?.original == null"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -34,7 +43,7 @@
|
|||||||
{
|
{
|
||||||
"set": {
|
"set": {
|
||||||
"field": "event.timezone",
|
"field": "event.timezone",
|
||||||
"value": "{{_tmp.tz_offset}}",
|
"value": "{{{_tmp.tz_offset}}}",
|
||||||
"if": "ctx._tmp?.tz_offset != null && ctx._tmp?.tz_offset != 'local'"
|
"if": "ctx._tmp?.tz_offset != null && ctx._tmp?.tz_offset != 'local'"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -54,7 +63,8 @@
|
|||||||
"SYSLOG_TIMESTAMP_FORMAT": "%{TIMESTAMP_ISO8601:_tmp.timestamp8601}%{SPACE}%{OBSERVER}%{SPACE}%{PROCESS}%{SPACE}(%{POSINT:process.pid:long}|-) - (-|%{META})",
|
"SYSLOG_TIMESTAMP_FORMAT": "%{TIMESTAMP_ISO8601:_tmp.timestamp8601}%{SPACE}%{OBSERVER}%{SPACE}%{PROCESS}%{SPACE}(%{POSINT:process.pid:long}|-) - (-|%{META})",
|
||||||
"TIMESTAMP_ISO8601": "%{YEAR}-%{MONTHNUM}-%{MONTHDAY}[T ]%{HOUR}:?%{MINUTE}(?::?%{SECOND})?%{ISO8601_TIMEZONE:event.timezone}?",
|
"TIMESTAMP_ISO8601": "%{YEAR}-%{MONTHNUM}-%{MONTHDAY}[T ]%{HOUR}:?%{MINUTE}(?::?%{SECOND})?%{ISO8601_TIMEZONE:event.timezone}?",
|
||||||
"OBSERVER": "(?:%{IP:observer.ip}|%{HOSTNAME:observer.name})",
|
"OBSERVER": "(?:%{IP:observer.ip}|%{HOSTNAME:observer.name})",
|
||||||
"PROCESS": "(\\(%{DATA:process.name}\\)|(?:%{UNIXPATH}*/)?%{BASEPATH:process.name})",
|
"UNIXPATH": "(/([\\w_%!$@:.,+~-]+|\\\\.)*)*",
|
||||||
|
"PROCESS": "(\\(%{DATA:process.name}\\)|(?:%{UNIXPATH})%{BASEPATH:process.name})",
|
||||||
"BASEPATH": "[[[:alnum:]]_%!$@:.,+~-]+",
|
"BASEPATH": "[[[:alnum:]]_%!$@:.,+~-]+",
|
||||||
"META": "\\[[^\\]]*\\]"
|
"META": "\\[[^\\]]*\\]"
|
||||||
}
|
}
|
||||||
@@ -80,7 +90,7 @@
|
|||||||
"MMM d HH:mm:ss",
|
"MMM d HH:mm:ss",
|
||||||
"MMM dd HH:mm:ss"
|
"MMM dd HH:mm:ss"
|
||||||
],
|
],
|
||||||
"timezone": "{{ event.timezone }}"
|
"timezone": "{{{ event.timezone }}}"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -97,61 +107,67 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"pipeline": {
|
"pipeline": {
|
||||||
"name": "logs-pfsense.log-1.16.0-firewall",
|
"name": "logs-pfsense.log-1.23.1-firewall",
|
||||||
"if": "ctx.event.provider == 'filterlog'"
|
"if": "ctx.event.provider == 'filterlog'"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"pipeline": {
|
"pipeline": {
|
||||||
"name": "logs-pfsense.log-1.16.0-openvpn",
|
"name": "logs-pfsense.log-1.23.1-openvpn",
|
||||||
"if": "ctx.event.provider == 'openvpn'"
|
"if": "ctx.event.provider == 'openvpn'"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"pipeline": {
|
"pipeline": {
|
||||||
"name": "logs-pfsense.log-1.16.0-ipsec",
|
"name": "logs-pfsense.log-1.23.1-ipsec",
|
||||||
"if": "ctx.event.provider == 'charon'"
|
"if": "ctx.event.provider == 'charon'"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"pipeline": {
|
"pipeline": {
|
||||||
"name": "logs-pfsense.log-1.16.0-dhcp",
|
"name": "logs-pfsense.log-1.23.1-dhcp",
|
||||||
"if": "[\"dhcpd\", \"dhclient\", \"dhcp6c\"].contains(ctx.event.provider)"
|
"if": "[\"dhcpd\", \"dhclient\", \"dhcp6c\"].contains(ctx.event.provider)"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"pipeline": {
|
"pipeline": {
|
||||||
"name": "logs-pfsense.log-1.16.0-unbound",
|
"name": "logs-pfsense.log-1.23.1-unbound",
|
||||||
"if": "ctx.event.provider == 'unbound'"
|
"if": "ctx.event.provider == 'unbound'"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"pipeline": {
|
"pipeline": {
|
||||||
"name": "logs-pfsense.log-1.16.0-haproxy",
|
"name": "logs-pfsense.log-1.23.1-haproxy",
|
||||||
"if": "ctx.event.provider == 'haproxy'"
|
"if": "ctx.event.provider == 'haproxy'"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"pipeline": {
|
"pipeline": {
|
||||||
"name": "logs-pfsense.log-1.16.0-php-fpm",
|
"name": "logs-pfsense.log-1.23.1-php-fpm",
|
||||||
"if": "ctx.event.provider == 'php-fpm'"
|
"if": "ctx.event.provider == 'php-fpm'"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"pipeline": {
|
"pipeline": {
|
||||||
"name": "logs-pfsense.log-1.16.0-squid",
|
"name": "logs-pfsense.log-1.23.1-squid",
|
||||||
"if": "ctx.event.provider == 'squid'"
|
"if": "ctx.event.provider == 'squid'"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"pipeline": {
|
"pipeline": {
|
||||||
"name": "logs-pfsense.log-1.16.0-suricata",
|
"name": "logs-pfsense.log-1.23.1-snort",
|
||||||
|
"if": "ctx.event.provider == 'snort'"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"pipeline": {
|
||||||
|
"name": "logs-pfsense.log-1.23.1-suricata",
|
||||||
"if": "ctx.event.provider == 'suricata'"
|
"if": "ctx.event.provider == 'suricata'"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"drop": {
|
"drop": {
|
||||||
"if": "![\"filterlog\", \"openvpn\", \"charon\", \"dhcpd\", \"dhclient\", \"dhcp6c\", \"unbound\", \"haproxy\", \"php-fpm\", \"squid\", \"suricata\"].contains(ctx.event?.provider)"
|
"if": "![\"filterlog\", \"openvpn\", \"charon\", \"dhcpd\", \"dhclient\", \"dhcp6c\", \"unbound\", \"haproxy\", \"php-fpm\", \"squid\", \"snort\", \"suricata\"].contains(ctx.event?.provider)"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -285,7 +301,7 @@
|
|||||||
{
|
{
|
||||||
"append": {
|
"append": {
|
||||||
"field": "related.ip",
|
"field": "related.ip",
|
||||||
"value": "{{destination.ip}}",
|
"value": "{{{destination.ip}}}",
|
||||||
"allow_duplicates": false,
|
"allow_duplicates": false,
|
||||||
"if": "ctx.destination?.ip != null"
|
"if": "ctx.destination?.ip != null"
|
||||||
}
|
}
|
||||||
@@ -293,7 +309,7 @@
|
|||||||
{
|
{
|
||||||
"append": {
|
"append": {
|
||||||
"field": "related.ip",
|
"field": "related.ip",
|
||||||
"value": "{{source.ip}}",
|
"value": "{{{source.ip}}}",
|
||||||
"allow_duplicates": false,
|
"allow_duplicates": false,
|
||||||
"if": "ctx.source?.ip != null"
|
"if": "ctx.source?.ip != null"
|
||||||
}
|
}
|
||||||
@@ -301,7 +317,7 @@
|
|||||||
{
|
{
|
||||||
"append": {
|
"append": {
|
||||||
"field": "related.ip",
|
"field": "related.ip",
|
||||||
"value": "{{source.nat.ip}}",
|
"value": "{{{source.nat.ip}}}",
|
||||||
"allow_duplicates": false,
|
"allow_duplicates": false,
|
||||||
"if": "ctx.source?.nat?.ip != null"
|
"if": "ctx.source?.nat?.ip != null"
|
||||||
}
|
}
|
||||||
@@ -309,21 +325,21 @@
|
|||||||
{
|
{
|
||||||
"append": {
|
"append": {
|
||||||
"field": "related.hosts",
|
"field": "related.hosts",
|
||||||
"value": "{{destination.domain}}",
|
"value": "{{{destination.domain}}}",
|
||||||
"if": "ctx.destination?.domain != null"
|
"if": "ctx.destination?.domain != null"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"append": {
|
"append": {
|
||||||
"field": "related.user",
|
"field": "related.user",
|
||||||
"value": "{{user.name}}",
|
"value": "{{{user.name}}}",
|
||||||
"if": "ctx.user?.name != null"
|
"if": "ctx.user?.name != null"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"set": {
|
"set": {
|
||||||
"field": "network.direction",
|
"field": "network.direction",
|
||||||
"value": "{{network.direction}}bound",
|
"value": "{{{network.direction}}}bound",
|
||||||
"if": "ctx.network?.direction != null && ctx.network?.direction =~ /^(in|out)$/"
|
"if": "ctx.network?.direction != null && ctx.network?.direction =~ /^(in|out)$/"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -343,17 +359,31 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"remove": {
|
"pipeline": {
|
||||||
"field": "event.original",
|
"name": "global@custom",
|
||||||
"if": "ctx.tags == null || !(ctx.tags.contains('preserve_original_event'))",
|
"ignore_missing_pipeline": true,
|
||||||
"ignore_failure": true,
|
"description": "[Fleet] Global pipeline for all data streams"
|
||||||
"ignore_missing": true
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"pipeline": {
|
||||||
|
"name": "logs@custom",
|
||||||
|
"ignore_missing_pipeline": true,
|
||||||
|
"description": "[Fleet] Pipeline for all data streams of type `logs`"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"pipeline": {
|
||||||
|
"name": "logs-pfsense.integration@custom",
|
||||||
|
"ignore_missing_pipeline": true,
|
||||||
|
"description": "[Fleet] Pipeline for all data streams of type `logs` defined by the `pfsense` integration"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"pipeline": {
|
"pipeline": {
|
||||||
"name": "logs-pfsense.log@custom",
|
"name": "logs-pfsense.log@custom",
|
||||||
"ignore_missing_pipeline": true
|
"ignore_missing_pipeline": true,
|
||||||
|
"description": "[Fleet] Pipeline for the `pfsense.log` dataset"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
@@ -378,12 +408,5 @@
|
|||||||
"value": "{{{ _ingest.on_failure_message }}}"
|
"value": "{{{ _ingest.on_failure_message }}}"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
],
|
]
|
||||||
"_meta": {
|
|
||||||
"managed_by": "fleet",
|
|
||||||
"managed": true,
|
|
||||||
"package": {
|
|
||||||
"name": "pfsense"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -1,9 +1,14 @@
|
|||||||
{
|
{
|
||||||
"description": "Pipeline for parsing pfSense Suricata logs.",
|
"description": "Pipeline for parsing pfSense Suricata logs.",
|
||||||
"processors": [
|
"processors": [
|
||||||
|
{ "set": {
|
||||||
|
"field": "event.module",
|
||||||
|
"value": "suricata"
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"pipeline": {
|
"pipeline": {
|
||||||
"name": "suricata.common"
|
"name": "suricata.common_pfsense"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user