mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2025-12-06 17:22:49 +01:00
Compare commits
1054 Commits
2.3.50GRID
...
2.3.70-GRA
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
72ba29fb7b | ||
|
|
2859bff0e4 | ||
|
|
6e921415ea | ||
|
|
2f8b68e67a | ||
|
|
8ea89932ae | ||
|
|
f87cf123b0 | ||
|
|
80f4d03254 | ||
|
|
a9cc68f89e | ||
|
|
b053f29a89 | ||
|
|
0abf7593ed | ||
|
|
f096b513b7 | ||
|
|
51b517581a | ||
|
|
936c998ecb | ||
|
|
02372d130a | ||
|
|
6f9a263af3 | ||
|
|
43ffaab82c | ||
|
|
dccfdb14e4 | ||
|
|
21f3b3d985 | ||
|
|
e2d74b115f | ||
|
|
13741400f1 | ||
|
|
d0f587858c | ||
|
|
acca8cc5d2 | ||
|
|
ef950955bd | ||
|
|
9a8ccef828 | ||
|
|
7b8e23fadd | ||
|
|
18335afa7f | ||
|
|
41e8be87b6 | ||
|
|
39f32a6e13 | ||
|
|
8e9f95652d | ||
|
|
30489e4117 | ||
|
|
9dc9f10003 | ||
|
|
1ced05c1d2 | ||
|
|
41b246b8b3 | ||
|
|
a12f19c533 | ||
|
|
f1c91555ae | ||
|
|
e39de8c7bc | ||
|
|
d0e312ec42 | ||
|
|
e492833453 | ||
|
|
9beacacd44 | ||
|
|
aad14b2461 | ||
|
|
4955b552df | ||
|
|
55e8a777d4 | ||
|
|
a98ed282c0 | ||
|
|
7504b1cb2e | ||
|
|
afab1cb1e6 | ||
|
|
cd0b9bbe4a | ||
|
|
3ea29e77a9 | ||
|
|
fb4c2c35e3 | ||
|
|
81ccce8659 | ||
|
|
0d5e3771f5 | ||
|
|
2030ef65f1 | ||
|
|
b6c361f83d | ||
|
|
9404cb635d | ||
|
|
da53b39c15 | ||
|
|
86569b0599 | ||
|
|
45aa2f72cb | ||
|
|
06b7434ca2 | ||
|
|
258cebda6e | ||
|
|
0cca43c4bd | ||
|
|
bf40a1038e | ||
|
|
3312a66e75 | ||
|
|
4a31d6b3bc | ||
|
|
64dfc6e191 | ||
|
|
95bd7f9861 | ||
|
|
983549711c | ||
|
|
5922dbdf22 | ||
|
|
9e48a5b57b | ||
|
|
3c1114403e | ||
|
|
8d2f614af6 | ||
|
|
1415de858c | ||
|
|
59e9fddf18 | ||
|
|
ad3b6cf629 | ||
|
|
b12e2eded5 | ||
|
|
26030d83eb | ||
|
|
3b01f6431e | ||
|
|
a646867593 | ||
|
|
768e61e11a | ||
|
|
e72ad9eb5a | ||
|
|
ac4faf673d | ||
|
|
dd1769fbef | ||
|
|
853a986082 | ||
|
|
727a3742f5 | ||
|
|
478a0b6a3f | ||
|
|
771688a70f | ||
|
|
40fa549353 | ||
|
|
84fdc1e690 | ||
|
|
71bbb41b5f | ||
|
|
52cb72ba67 | ||
|
|
54a3b754e0 | ||
|
|
2bc88e7750 | ||
|
|
ef59cb47dd | ||
|
|
9e5d3aa286 | ||
|
|
25bf25eae6 | ||
|
|
24f5fa66f3 | ||
|
|
1aeb2d7d4f | ||
|
|
ee176f5bfd | ||
|
|
eb093b8e6c | ||
|
|
f88fa6e3b2 | ||
|
|
724f7d4f3d | ||
|
|
19816d8814 | ||
|
|
d3b170c6df | ||
|
|
757091beeb | ||
|
|
8a49039b85 | ||
|
|
4f39cd1d7f | ||
|
|
2a6277c0c3 | ||
|
|
33bd6aed20 | ||
|
|
b9980c9d30 | ||
|
|
01bb94514c | ||
|
|
d71967ea1d | ||
|
|
0b06d0bfdb | ||
|
|
b2a83018ba | ||
|
|
ba265d94f4 | ||
|
|
af7b314cfe | ||
|
|
4c6447a3da | ||
|
|
b30f771fa2 | ||
|
|
837c0402a0 | ||
|
|
e38219aa2e | ||
|
|
9e92f6da3d | ||
|
|
44551ea9ee | ||
|
|
c53da9b1ff | ||
|
|
e1785dbd9a | ||
|
|
2560a9b78c | ||
|
|
d53e989c55 | ||
|
|
211a841cdb | ||
|
|
50e4365475 | ||
|
|
c524b54af1 | ||
|
|
7591bb115e | ||
|
|
3d2da303c8 | ||
|
|
f585eb6e62 | ||
|
|
4b6120a46b | ||
|
|
d946c6d5ed | ||
|
|
5894b85bd1 | ||
|
|
3fc43f7d92 | ||
|
|
8ed264460f | ||
|
|
811b32735e | ||
|
|
4b3db0c4d2 | ||
|
|
281ba21298 | ||
|
|
d4a177949a | ||
|
|
a42d8c9229 | ||
|
|
dd0e407935 | ||
|
|
7ef5b39b04 | ||
|
|
cf9121dfc2 | ||
|
|
fcfc2a65a9 | ||
|
|
91accb0bc6 | ||
|
|
e2abe8840f | ||
|
|
ead9ae8cb5 | ||
|
|
455719936b | ||
|
|
8d56fc71fa | ||
|
|
833d154bf4 | ||
|
|
f31dc5abc7 | ||
|
|
9a429230fe | ||
|
|
b36d46b7f2 | ||
|
|
fee89665fd | ||
|
|
d78a37f9e3 | ||
|
|
28c5c02ef1 | ||
|
|
8ffeae38bc | ||
|
|
f4fae7938e | ||
|
|
22920bc9a1 | ||
|
|
ceb82cb863 | ||
|
|
1caa361e22 | ||
|
|
da20790238 | ||
|
|
f359dd0cd4 | ||
|
|
bee442a21f | ||
|
|
a66765e99b | ||
|
|
0db7f91eb4 | ||
|
|
850315dc20 | ||
|
|
d35e4bea01 | ||
|
|
356b623148 | ||
|
|
3a022e7a83 | ||
|
|
64945cec16 | ||
|
|
26741bdb53 | ||
|
|
7aa5e857ed | ||
|
|
2e277bf487 | ||
|
|
e4f46c6e14 | ||
|
|
e9d90644fd | ||
|
|
5a06f0dce9 | ||
|
|
08e9a58f2e | ||
|
|
e1f0c8e87c | ||
|
|
17a532f7b5 | ||
|
|
c7306dda12 | ||
|
|
00d311cd6c | ||
|
|
f8d2a7f449 | ||
|
|
a02a928996 | ||
|
|
eb661b7a24 | ||
|
|
6aea607f21 | ||
|
|
41e747dcc1 | ||
|
|
d3d02faa1c | ||
|
|
7a85a3c7f7 | ||
|
|
fceb2851ef | ||
|
|
2f118781ea | ||
|
|
b8e3a45a7e | ||
|
|
61312397e1 | ||
|
|
8ea4682aab | ||
|
|
3b6befdb97 | ||
|
|
613979ea3f | ||
|
|
191def686b | ||
|
|
f986e0dc78 | ||
|
|
08e75567d4 | ||
|
|
668199f1a8 | ||
|
|
7a753a56ec | ||
|
|
7b38b4e280 | ||
|
|
7dc2e2ca73 | ||
|
|
44eb23615a | ||
|
|
d47566f667 | ||
|
|
9ae84c8108 | ||
|
|
578c7aac35 | ||
|
|
1c460cc19c | ||
|
|
ff436aea93 | ||
|
|
aa333794f7 | ||
|
|
3d3593a1a9 | ||
|
|
257062e20c | ||
|
|
fa9d7afb46 | ||
|
|
ae5f351e1a | ||
|
|
257a88ec8e | ||
|
|
e1e6304a8a | ||
|
|
a81ef0017c | ||
|
|
b89162e086 | ||
|
|
a6630540a4 | ||
|
|
a528c5d54b | ||
|
|
690699ddf7 | ||
|
|
cd8d9c657e | ||
|
|
f732b80b92 | ||
|
|
ad8c12afa5 | ||
|
|
479fcb6c46 | ||
|
|
74874dfff2 | ||
|
|
ceb108a5fe | ||
|
|
235d8b7cf0 | ||
|
|
7c9df2d75a | ||
|
|
43bf75217f | ||
|
|
9bf6d478c5 | ||
|
|
e2baa93270 | ||
|
|
37fcda3817 | ||
|
|
457ae54341 | ||
|
|
4cc3c5ada9 | ||
|
|
07d5736d61 | ||
|
|
a7551a44e5 | ||
|
|
f4d3e13c7f | ||
|
|
47d82b3d35 | ||
|
|
9d06aff1d1 | ||
|
|
5ea8c978a0 | ||
|
|
6809c3a9f6 | ||
|
|
761108964e | ||
|
|
e3e74a84f2 | ||
|
|
1fee4e87c4 | ||
|
|
0c4c59375d | ||
|
|
09165daab8 | ||
|
|
3393b77535 | ||
|
|
d050bc02e2 | ||
|
|
af60ddf404 | ||
|
|
1bb92f63d1 | ||
|
|
a405ca39fa | ||
|
|
852b686d81 | ||
|
|
608d5d3c26 | ||
|
|
6038ebb705 | ||
|
|
4bb350d37d | ||
|
|
d01ac55db1 | ||
|
|
fcde5c3c18 | ||
|
|
dbf19e134f | ||
|
|
b13c5a3b8b | ||
|
|
b0c5a352c1 | ||
|
|
d0b3cd5f66 | ||
|
|
24efdec9ea | ||
|
|
1bed818a8e | ||
|
|
3c4c52567d | ||
|
|
87ae14d11c | ||
|
|
258d303e7f | ||
|
|
458350e1a8 | ||
|
|
fe7ee1e2c7 | ||
|
|
d8910a0097 | ||
|
|
3b6e683d37 | ||
|
|
90f6bad6ce | ||
|
|
fcc6802f86 | ||
|
|
3b9bc77ecc | ||
|
|
0fb4500fcc | ||
|
|
93ca00c7fe | ||
|
|
522f2a3f9f | ||
|
|
40ddf5f49c | ||
|
|
60356eacce | ||
|
|
158f3bf092 | ||
|
|
ebf3c65bed | ||
|
|
df6d1d72e2 | ||
|
|
72542322ca | ||
|
|
fea4f3f973 | ||
|
|
7878180f54 | ||
|
|
0669aa6bbd | ||
|
|
2c4924a602 | ||
|
|
bde86e0383 | ||
|
|
bab18275bc | ||
|
|
7e86681509 | ||
|
|
c2fc2df54c | ||
|
|
0deb77468f | ||
|
|
9bf1d3e0c6 | ||
|
|
3a12d28d20 | ||
|
|
e8ba4bdc6c | ||
|
|
b552973e00 | ||
|
|
ac98e1fd0f | ||
|
|
4246aac51b | ||
|
|
33f396bdae | ||
|
|
ff25cecd54 | ||
|
|
e88b258208 | ||
|
|
1cbf895e0e | ||
|
|
7dc1f5c445 | ||
|
|
439e049948 | ||
|
|
fbf26bef8d | ||
|
|
c1f550382c | ||
|
|
23fb6a5c02 | ||
|
|
d632266092 | ||
|
|
4ea3ab9538 | ||
|
|
725161ea6e | ||
|
|
fccd86f676 | ||
|
|
0f0a977ed9 | ||
|
|
7f9d0b59b8 | ||
|
|
b0d510167c | ||
|
|
4971933201 | ||
|
|
693a9b30ae | ||
|
|
76c285158a | ||
|
|
08517e3732 | ||
|
|
59530f4263 | ||
|
|
5d48fb41ba | ||
|
|
4acebe7f59 | ||
|
|
a44a7b7161 | ||
|
|
be13f0a066 | ||
|
|
98ce77c2b1 | ||
|
|
275a491cac | ||
|
|
1c868f85c4 | ||
|
|
b6deacf86d | ||
|
|
ebe5ef6535 | ||
|
|
294f91473c | ||
|
|
902f04efb4 | ||
|
|
ca2989c0e5 | ||
|
|
2d9697cd66 | ||
|
|
b4111a9f79 | ||
|
|
7f8212fdba | ||
|
|
7e1be8a3a4 | ||
|
|
05aad07bfc | ||
|
|
92a80f9a58 | ||
|
|
4b4ceb525a | ||
|
|
42ba9888d7 | ||
|
|
818f912a90 | ||
|
|
dae64b82ff | ||
|
|
53c6edcbdb | ||
|
|
723172bc1f | ||
|
|
323b5d6694 | ||
|
|
441cd3fc59 | ||
|
|
1d23d1b2e2 | ||
|
|
1dd81b6d49 | ||
|
|
741e825ab9 | ||
|
|
e41811fbd0 | ||
|
|
f111106a9f | ||
|
|
f9e29eaede | ||
|
|
e7a6172d7e | ||
|
|
ec8f9228e8 | ||
|
|
6c12e26632 | ||
|
|
9a6ac7bd20 | ||
|
|
5b3751da70 | ||
|
|
65127eb226 | ||
|
|
115e0a6fee | ||
|
|
ddfab44883 | ||
|
|
6eab390962 | ||
|
|
35388056d3 | ||
|
|
e2c5967191 | ||
|
|
7cdb967810 | ||
|
|
8900d52c33 | ||
|
|
bab72393e6 | ||
|
|
e059c25ebc | ||
|
|
c87ca8f5dc | ||
|
|
e01e3cdd43 | ||
|
|
2ab9ade761 | ||
|
|
0b35b8f6d6 | ||
|
|
9ff95f66dd | ||
|
|
c1523c4936 | ||
|
|
b6e31278a7 | ||
|
|
ca2b24f735 | ||
|
|
2b0bca8e55 | ||
|
|
98fe7e8700 | ||
|
|
0acc3cc537 | ||
|
|
8491ffde07 | ||
|
|
2ea3989497 | ||
|
|
e6f9592cde | ||
|
|
222d79bf53 | ||
|
|
19d9258717 | ||
|
|
b46456b78e | ||
|
|
cebc2ef09d | ||
|
|
c4ff8f6876 | ||
|
|
619022ef7f | ||
|
|
c0f3c5b3db | ||
|
|
860b8bf945 | ||
|
|
694db81b80 | ||
|
|
a895270bc8 | ||
|
|
7474b451ca | ||
|
|
e8eecc8bc1 | ||
|
|
28e33b413c | ||
|
|
78c58e61ea | ||
|
|
f3ecdf21bf | ||
|
|
ff656365d2 | ||
|
|
ea7c09bb00 | ||
|
|
e23f7cd3e7 | ||
|
|
c6bb32b862 | ||
|
|
0bde69b441 | ||
|
|
6fbafb74bd | ||
|
|
9572c1f663 | ||
|
|
0fedb0f2c5 | ||
|
|
33d3aef9f5 | ||
|
|
fb8ccedf66 | ||
|
|
efcf0accc1 | ||
|
|
f556d5c07d | ||
|
|
6c1f424c0b | ||
|
|
90970f97e8 | ||
|
|
d3137dc6b9 | ||
|
|
efaf53f2f7 | ||
|
|
beb7b89275 | ||
|
|
8c15fa1627 | ||
|
|
bc814c9be6 | ||
|
|
bac7ef71d8 | ||
|
|
dd199ea30f | ||
|
|
fc8acac1a5 | ||
|
|
fec269c3e7 | ||
|
|
8e366fd633 | ||
|
|
f7d54186dd | ||
|
|
ab92fb3910 | ||
|
|
6783e2e28b | ||
|
|
4e47d3f458 | ||
|
|
b265c7dcb7 | ||
|
|
f4fae89b8e | ||
|
|
45f0b4c85f | ||
|
|
7c80483f6e | ||
|
|
08ba4fdbee | ||
|
|
7085796601 | ||
|
|
091b5f73b1 | ||
|
|
0c079edc1a | ||
|
|
54cdfb89f6 | ||
|
|
f56514ed7d | ||
|
|
56697fde19 | ||
|
|
80525ee736 | ||
|
|
a43bdd9aad | ||
|
|
20360d0bb0 | ||
|
|
70d7513f84 | ||
|
|
12b7fd3ab4 | ||
|
|
c32b5b5429 | ||
|
|
ea2a748dba | ||
|
|
c1d7d8c55a | ||
|
|
a3c58d8445 | ||
|
|
cfc5c2aef6 | ||
|
|
313260a0c5 | ||
|
|
ee548aaf83 | ||
|
|
5eab57e500 | ||
|
|
6f48fdad42 | ||
|
|
98fb5109d7 | ||
|
|
9c2ead16cc | ||
|
|
c4293c6119 | ||
|
|
13c392d758 | ||
|
|
35f10518b2 | ||
|
|
03066c4674 | ||
|
|
e33a6892b3 | ||
|
|
87bb3f4a6b | ||
|
|
62bfaa4e45 | ||
|
|
9e94e605ee | ||
|
|
f8dc647b1f | ||
|
|
fc727d6909 | ||
|
|
c1d61dc624 | ||
|
|
0627ca2fc2 | ||
|
|
ce0b064972 | ||
|
|
2f3f04e4ca | ||
|
|
2e91f27336 | ||
|
|
10b1829830 | ||
|
|
4946f32d88 | ||
|
|
dc1363aaf5 | ||
|
|
a5067718d2 | ||
|
|
98505a9a3f | ||
|
|
e054fdb464 | ||
|
|
3c8ad18693 | ||
|
|
0a91f571c1 | ||
|
|
8db5284f6e | ||
|
|
22aa695508 | ||
|
|
a16f733622 | ||
|
|
af7d6c8cb5 | ||
|
|
693f455862 | ||
|
|
b0abd290a9 | ||
|
|
0a9686f584 | ||
|
|
0b11bf6266 | ||
|
|
d26056d272 | ||
|
|
724f9ec76f | ||
|
|
d583c79936 | ||
|
|
73b47716bc | ||
|
|
4eaef94454 | ||
|
|
21c9c7b8f4 | ||
|
|
108fb12612 | ||
|
|
eb8a030966 | ||
|
|
9235bb35a1 | ||
|
|
7b281abf0c | ||
|
|
b5fecd30cf | ||
|
|
26ff50f85c | ||
|
|
2eb1ba565f | ||
|
|
4dbb869952 | ||
|
|
f3041a8d7e | ||
|
|
4109cdec53 | ||
|
|
cdced887d1 | ||
|
|
77ca922f62 | ||
|
|
a08166f27d | ||
|
|
b9c56d1885 | ||
|
|
fcbacd473d | ||
|
|
06d77d9972 | ||
|
|
ee9c4f130e | ||
|
|
ada729087d | ||
|
|
aa47a72656 | ||
|
|
857ec70abb | ||
|
|
149f837223 | ||
|
|
37d6529ae0 | ||
|
|
8d3ae65e04 | ||
|
|
649e539ca6 | ||
|
|
45e90750a0 | ||
|
|
ce2a8917a6 | ||
|
|
b22cd2d27c | ||
|
|
813ef7d81a | ||
|
|
88275cd968 | ||
|
|
3a47563b27 | ||
|
|
ebb45a866b | ||
|
|
1433822437 | ||
|
|
4a5b416a0b | ||
|
|
cad4efdded | ||
|
|
f73a8d4d80 | ||
|
|
dac19d224f | ||
|
|
fa3e5eebe2 | ||
|
|
b64749c9d7 | ||
|
|
822165f168 | ||
|
|
2d16463fc6 | ||
|
|
3d8cbe9427 | ||
|
|
f18b64faaf | ||
|
|
95c7a7e9de | ||
|
|
ca152ab04c | ||
|
|
bf8bba7b84 | ||
|
|
3f2f699449 | ||
|
|
6b68a39cbe | ||
|
|
8867840215 | ||
|
|
1c516daa96 | ||
|
|
21c9388ee6 | ||
|
|
c72146587a | ||
|
|
0ba685d0e2 | ||
|
|
ce98f46331 | ||
|
|
d6aa672556 | ||
|
|
6d2761b155 | ||
|
|
127afe1582 | ||
|
|
a3d7f4e35d | ||
|
|
8eb163532d | ||
|
|
ea50023ca5 | ||
|
|
846aef1bd6 | ||
|
|
143f2eb1a8 | ||
|
|
3f8cb23cf6 | ||
|
|
f92709b03b | ||
|
|
81bb7c6534 | ||
|
|
bdd1074be7 | ||
|
|
42a63f8ea5 | ||
|
|
3c85db1769 | ||
|
|
930d5b3627 | ||
|
|
a1ec40b547 | ||
|
|
022f9ea76e | ||
|
|
2681903c93 | ||
|
|
403d10cc75 | ||
|
|
66e88cef42 | ||
|
|
8f9d1b99e2 | ||
|
|
4af2f6d84a | ||
|
|
78fa4feac6 | ||
|
|
5189f38766 | ||
|
|
243e888717 | ||
|
|
c5b81f2f4b | ||
|
|
caa14e0cad | ||
|
|
d411a9e1ff | ||
|
|
3fbc850774 | ||
|
|
d16febcae1 | ||
|
|
26bb6cc011 | ||
|
|
bc80ef9a80 | ||
|
|
9fad0876c5 | ||
|
|
914e635b4a | ||
|
|
85bb234cf9 | ||
|
|
f7675a5dea | ||
|
|
7b662055dd | ||
|
|
d78c6f1a74 | ||
|
|
9fa83d1cee | ||
|
|
6e780164ea | ||
|
|
2ca8da0710 | ||
|
|
c3deabae36 | ||
|
|
9cdbcb72ac | ||
|
|
bc86590411 | ||
|
|
cb167f3d74 | ||
|
|
8ddc99e91f | ||
|
|
dcc9af946a | ||
|
|
e4e3b199fc | ||
|
|
bf61c82cf2 | ||
|
|
c9ee28ce01 | ||
|
|
5135beb036 | ||
|
|
f36ef86ccc | ||
|
|
5e042bf4b8 | ||
|
|
130ce34686 | ||
|
|
591ef540a6 | ||
|
|
697f6ab538 | ||
|
|
ba5b5db2c4 | ||
|
|
e7afbab6a1 | ||
|
|
5298cb8cfb | ||
|
|
777bece2eb | ||
|
|
7daad1a52a | ||
|
|
60fd3c6bd3 | ||
|
|
dc1c82f347 | ||
|
|
c7a58816b6 | ||
|
|
48c3cb4816 | ||
|
|
6e7f2107cb | ||
|
|
101b835cf6 | ||
|
|
558a90aaf8 | ||
|
|
1d4161ba31 | ||
|
|
78d53af27c | ||
|
|
188b4424e4 | ||
|
|
0615d635eb | ||
|
|
85d7e75fb1 | ||
|
|
833559dde6 | ||
|
|
b294cee278 | ||
|
|
afe7ddb480 | ||
|
|
98526af82a | ||
|
|
0cb4562254 | ||
|
|
70f0ee719c | ||
|
|
63b120e9e2 | ||
|
|
d587120613 | ||
|
|
0dc4bc3cee | ||
|
|
79aad225a4 | ||
|
|
8cd2bc7c13 | ||
|
|
2a5198cae4 | ||
|
|
b8c463db82 | ||
|
|
059b016c62 | ||
|
|
f1429632d2 | ||
|
|
2d34208269 | ||
|
|
36c9054744 | ||
|
|
5e11efb0b9 | ||
|
|
703988b376 | ||
|
|
fefd2677fb | ||
|
|
a323aeb8fa | ||
|
|
8d6b0e23ce | ||
|
|
edac99e5a9 | ||
|
|
dd14235e31 | ||
|
|
15eadd4f89 | ||
|
|
09fbb045a1 | ||
|
|
7bdd0d3bf1 | ||
|
|
ebea9a7198 | ||
|
|
ad9441bb60 | ||
|
|
989f9dce42 | ||
|
|
b95437347e | ||
|
|
2d27e0d9a9 | ||
|
|
c3c078e5be | ||
|
|
dd8eb29a18 | ||
|
|
2d5591a87f | ||
|
|
71b079eb54 | ||
|
|
ca6f3807fc | ||
|
|
c2f6a6983d | ||
|
|
3891ca2929 | ||
|
|
20437ef2c7 | ||
|
|
7de02d541f | ||
|
|
68e4c5e469 | ||
|
|
62187807f0 | ||
|
|
37f4caf536 | ||
|
|
fca1c6e957 | ||
|
|
0de7e71fa0 | ||
|
|
fd5d540c78 | ||
|
|
d2069dc5f2 | ||
|
|
2ac832678f | ||
|
|
5941332d49 | ||
|
|
45732bd87a | ||
|
|
f7600af89b | ||
|
|
5108121b59 | ||
|
|
c2339c84e7 | ||
|
|
7205c5cb7b | ||
|
|
ff807c9a6f | ||
|
|
0341eb5d8f | ||
|
|
a2e1b1de3a | ||
|
|
e64059bd7b | ||
|
|
46b1de97f5 | ||
|
|
ca7d2c6d64 | ||
|
|
12d4d4a4f7 | ||
|
|
7c92054f13 | ||
|
|
1bef1d5652 | ||
|
|
89a02383b8 | ||
|
|
7fba904f75 | ||
|
|
1c7741fdbe | ||
|
|
4c90a0ed7e | ||
|
|
a82b174826 | ||
|
|
579ff8c0b4 | ||
|
|
264080546c | ||
|
|
a0c65e2333 | ||
|
|
dd73ad544c | ||
|
|
33db9023eb | ||
|
|
88eea03f97 | ||
|
|
a959ec1eb1 | ||
|
|
3e138cbc6d | ||
|
|
9b61723194 | ||
|
|
d2381b0209 | ||
|
|
4972f69dd6 | ||
|
|
56eb220ed6 | ||
|
|
343c47d67a | ||
|
|
e53f2217ec | ||
|
|
016a5a5914 | ||
|
|
9f2adfb67a | ||
|
|
6e92e7283d | ||
|
|
e3c16147ce | ||
|
|
14aa9805b4 | ||
|
|
fdab17a3b9 | ||
|
|
bebba7d280 | ||
|
|
11b2b2a893 | ||
|
|
84141082ab | ||
|
|
ba29b5e036 | ||
|
|
e22421ec99 | ||
|
|
416b38fc71 | ||
|
|
fd5fcfeaae | ||
|
|
75ff268ecc | ||
|
|
9f98b8ad2f | ||
|
|
316035910f | ||
|
|
d1d09d4aab | ||
|
|
31365b266a | ||
|
|
2f34e7eeed | ||
|
|
3aff3ac7e4 | ||
|
|
d1a185aaae | ||
|
|
ff10432124 | ||
|
|
bb5b805983 | ||
|
|
58ae3479dc | ||
|
|
d55e007032 | ||
|
|
2af43d62eb | ||
|
|
5c527b2c48 | ||
|
|
e6165f0046 | ||
|
|
70427bc676 | ||
|
|
9ec7cbef8e | ||
|
|
719d841353 | ||
|
|
fa6af06204 | ||
|
|
cba719b3a0 | ||
|
|
4241bb08b8 | ||
|
|
901242f7e9 | ||
|
|
4c74e7f308 | ||
|
|
db48c15f1d | ||
|
|
a1b34e7a88 | ||
|
|
fc6b3726a4 | ||
|
|
9c9bcac61b | ||
|
|
588da4d7dc | ||
|
|
e42db3cd2d | ||
|
|
e8cc88174f | ||
|
|
7b7111e12c | ||
|
|
b3f2c60065 | ||
|
|
20e896cacf | ||
|
|
afbf7de9e3 | ||
|
|
4ff85ab0c4 | ||
|
|
dd7388e577 | ||
|
|
77f13961ad | ||
|
|
e00fe0a732 | ||
|
|
c757d21360 | ||
|
|
3a134cc706 | ||
|
|
7aede4d058 | ||
|
|
5983eae3a8 | ||
|
|
9d6dca9c64 | ||
|
|
7b68c1bc9b | ||
|
|
9d905368ca | ||
|
|
867613669d | ||
|
|
fd1de624c8 | ||
|
|
2a2247e1da | ||
|
|
7a59bee315 | ||
|
|
91c8a7c65b | ||
|
|
73a0b31380 | ||
|
|
ef00695b07 | ||
|
|
bfaffbc87e | ||
|
|
e800d62df4 | ||
|
|
6fe765434e | ||
|
|
7e48740ea7 | ||
|
|
d25a439bd4 | ||
|
|
ed8c85df2b | ||
|
|
c4ae8c3418 | ||
|
|
f87dce8ec1 | ||
|
|
5d2f1c8e11 | ||
|
|
1aa2852ed6 | ||
|
|
a42a406f53 | ||
|
|
47b56e78b3 | ||
|
|
52db7b32ef | ||
|
|
3aad5a30e9 | ||
|
|
b8a10f2e86 | ||
|
|
4e8dc0e3b9 | ||
|
|
edf60f80f7 | ||
|
|
a94c598d00 | ||
|
|
68abaa5e3c | ||
|
|
63b31de2b8 | ||
|
|
eac5c604bd | ||
|
|
e7d8df499c | ||
|
|
35845440c6 | ||
|
|
18926009d3 | ||
|
|
d55a9e6274 | ||
|
|
ba011581ef | ||
|
|
1788ceccea | ||
|
|
ada8255af0 | ||
|
|
f1a6f66d49 | ||
|
|
423793ecf9 | ||
|
|
94cfa3c9d0 | ||
|
|
0134ceef16 | ||
|
|
b23ce7462e | ||
|
|
cf3dda6869 | ||
|
|
dc8520df42 | ||
|
|
d9c5976ed0 | ||
|
|
aeea5701e4 | ||
|
|
7263e35a89 | ||
|
|
4d991d3773 | ||
|
|
bfcde15a24 | ||
|
|
ee675546ac | ||
|
|
b43e6c5d6b | ||
|
|
c531ef0773 | ||
|
|
a6a4c03029 | ||
|
|
b525cfc787 | ||
|
|
842aa97f7e | ||
|
|
34d4eedf67 | ||
|
|
4a109d6af1 | ||
|
|
cb40a76247 | ||
|
|
ed249600d3 | ||
|
|
0187c9d6df | ||
|
|
6da37966d9 | ||
|
|
525d4325c7 | ||
|
|
ecf7e25a51 | ||
|
|
ec2f8fe6c8 | ||
|
|
dfaf40f583 | ||
|
|
543154f037 | ||
|
|
cd3e355f84 | ||
|
|
2eee6b45bc | ||
|
|
0de5c6f204 | ||
|
|
9363fc153c | ||
|
|
2aacd5b9b6 | ||
|
|
c3b2e1e8b2 | ||
|
|
e261c197f3 | ||
|
|
747dc77c92 | ||
|
|
35cc7b27e9 | ||
|
|
67828a86c1 | ||
|
|
58ec31d6c7 | ||
|
|
6da0b57ce1 | ||
|
|
8d9d5a267a | ||
|
|
94af55a951 | ||
|
|
192cec1825 | ||
|
|
1e564c2140 | ||
|
|
7e008378ba | ||
|
|
dbc4ffd69a | ||
|
|
5a1e8d9fe9 | ||
|
|
5e5d30a377 | ||
|
|
3bc0def02a | ||
|
|
bd301880ad | ||
|
|
2deb703272 | ||
|
|
8c6489a49a | ||
|
|
87609ba5d1 | ||
|
|
ba3a51387c | ||
|
|
ffd5bfc480 | ||
|
|
a4226cc39a | ||
|
|
dcb89b704a | ||
|
|
686c7c5a6c | ||
|
|
409eea677d | ||
|
|
99d41d1606 | ||
|
|
915b7aa2df | ||
|
|
e2d5102a0e | ||
|
|
e5a41b60ef | ||
|
|
0572ea4095 | ||
|
|
71032150c5 | ||
|
|
36d13dd414 | ||
|
|
946e369a44 | ||
|
|
18922ed6f5 | ||
|
|
c1dd4dafe4 | ||
|
|
fe3aec173f | ||
|
|
c5d0286e24 | ||
|
|
7aed01658f | ||
|
|
de4fde4ee3 | ||
|
|
3450219bc7 | ||
|
|
b440f73336 | ||
|
|
6af126b872 | ||
|
|
ac42cba50b | ||
|
|
5d263f63cb | ||
|
|
f445186f1e | ||
|
|
25e2edc6d2 | ||
|
|
bdd53ed5e3 | ||
|
|
c207504657 | ||
|
|
fe155222c2 | ||
|
|
9b4325662b | ||
|
|
0de1c9a669 | ||
|
|
ef32bff302 | ||
|
|
e50002e0ca | ||
|
|
dbd5ef70c9 | ||
|
|
ce9554281e | ||
|
|
4e1fba5b38 | ||
|
|
3f238f7a4a | ||
|
|
b89091cc7d | ||
|
|
d001597e52 | ||
|
|
4c7cee4ebc | ||
|
|
6eed730209 | ||
|
|
992b76a0f0 | ||
|
|
2bcd51b21c | ||
|
|
3625453668 | ||
|
|
5821a122cc | ||
|
|
891e414cb6 | ||
|
|
54f9e3ff9d | ||
|
|
1c0cc15fdb | ||
|
|
231e07dbbd | ||
|
|
3859f6464a | ||
|
|
71a74a6656 | ||
|
|
3668d1aadf | ||
|
|
d3af06e7a4 | ||
|
|
74f2a61b25 | ||
|
|
68a667ee7c | ||
|
|
192b5db25a | ||
|
|
9ced391c11 | ||
|
|
807b525c79 | ||
|
|
7bd04deae7 | ||
|
|
c379822bf0 | ||
|
|
ad67167e97 | ||
|
|
4012a8276c | ||
|
|
efc028d0a5 | ||
|
|
01a121e029 | ||
|
|
f793450d97 | ||
|
|
fec868432f | ||
|
|
d3b08beb53 | ||
|
|
a75d4841d0 | ||
|
|
8b3730748b | ||
|
|
de5552c91a | ||
|
|
a7e6dec51d | ||
|
|
26335a9b42 | ||
|
|
f8dd6890b2 | ||
|
|
1c103f92f2 | ||
|
|
e3ce683970 | ||
|
|
9eb63b17f9 | ||
|
|
755370eff0 | ||
|
|
407ad51244 | ||
|
|
293fb0a76d | ||
|
|
2e228c8355 | ||
|
|
009f7617c1 | ||
|
|
b39c8c1f1f | ||
|
|
7b29c6427b | ||
|
|
d0e084b8ea | ||
|
|
46223e0b30 | ||
|
|
5d3b147b42 | ||
|
|
6474c296e1 | ||
|
|
b8ad80ae35 | ||
|
|
78240b4b52 | ||
|
|
e7c716ede4 | ||
|
|
fb986b5cff | ||
|
|
a49f2e2d98 | ||
|
|
90b3462ead | ||
|
|
da528e802f | ||
|
|
23b4327c28 | ||
|
|
1de768c182 | ||
|
|
9f6dfa4d2e | ||
|
|
728d1f7540 | ||
|
|
ee92ba20b0 | ||
|
|
1b749cf004 | ||
|
|
37929dbd7d | ||
|
|
865ba912f8 | ||
|
|
9dbb9f519b | ||
|
|
20188549f7 | ||
|
|
925be17d51 | ||
|
|
0ea4c99102 | ||
|
|
db98b7ed27 | ||
|
|
44de611097 | ||
|
|
a5ee8fb59d | ||
|
|
e532804474 | ||
|
|
ce24781446 | ||
|
|
c867d6648a | ||
|
|
8ae5ae7e57 | ||
|
|
6a639edb05 | ||
|
|
a1a79719fc | ||
|
|
c5f99b012e | ||
|
|
fcd1bea4a3 | ||
|
|
0622c77a7f | ||
|
|
8aaf3e1052 | ||
|
|
3dcaa1f6fb | ||
|
|
2d91e509fa | ||
|
|
a0f1839162 | ||
|
|
e2f52765e4 | ||
|
|
f186a3dde9 | ||
|
|
9b065155f4 | ||
|
|
12306368cf | ||
|
|
d4e8ea8e72 | ||
|
|
619402cc67 | ||
|
|
b01bfda862 | ||
|
|
da19df5174 | ||
|
|
19dd9b97d2 | ||
|
|
21b92ac077 | ||
|
|
b80dd1ef3e | ||
|
|
d6b9154a88 | ||
|
|
f9573f7972 | ||
|
|
038cadeae8 | ||
|
|
e32ca284c5 | ||
|
|
a56426010d | ||
|
|
dda07af4d4 | ||
|
|
81bfb202f7 | ||
|
|
b6561fd8e2 | ||
|
|
d475e50bef | ||
|
|
689a01423f | ||
|
|
888d637b67 | ||
|
|
e7660d68cb | ||
|
|
450a01784b | ||
|
|
5d8cb511be | ||
|
|
44ad8ce888 | ||
|
|
14572d9eab | ||
|
|
76d735ff43 | ||
|
|
02b621bd2c | ||
|
|
96eab86bc6 | ||
|
|
93ee96b1cd | ||
|
|
907dbe6388 | ||
|
|
f8e01d5d53 | ||
|
|
454b541a2e | ||
|
|
2b9b22cd90 | ||
|
|
5584c4f1ae | ||
|
|
9830f661c8 | ||
|
|
7a21c44727 | ||
|
|
4c55e5a6cc | ||
|
|
f0012015e6 | ||
|
|
14557983e1 | ||
|
|
865e5cb120 | ||
|
|
d9cb018a7d | ||
|
|
8dd9564171 | ||
|
|
77533f7873 | ||
|
|
a6b2eefee1 | ||
|
|
4cea08c080 | ||
|
|
d56e66917a | ||
|
|
28982e0e0b | ||
|
|
1fbf77d090 | ||
|
|
6c8a2e68d9 | ||
|
|
f5ddb084b6 | ||
|
|
21077ef26e | ||
|
|
5cedf98f55 | ||
|
|
a7247e9812 | ||
|
|
c9298137b5 | ||
|
|
17c95723ec | ||
|
|
1f654d4444 | ||
|
|
0a01d7b041 | ||
|
|
b53017ee87 | ||
|
|
af86a9dac0 | ||
|
|
d792c65ce3 | ||
|
|
8eef574342 | ||
|
|
2d0594398c | ||
|
|
115764ae38 | ||
|
|
5cda35db0a | ||
|
|
4f3b3a787c | ||
|
|
8e55e0b994 | ||
|
|
30c6d4756a | ||
|
|
d1150f150f | ||
|
|
e0f4abaa09 | ||
|
|
889e624a8c | ||
|
|
cd0ab5c709 | ||
|
|
d75fafb19c | ||
|
|
11c3f14b42 | ||
|
|
53528d486c | ||
|
|
3a8aea0de6 | ||
|
|
a3e11f017b | ||
|
|
c4da576030 | ||
|
|
465253a769 | ||
|
|
3b74d987c1 | ||
|
|
3385ba2ca2 | ||
|
|
6dba2879c5 | ||
|
|
8fc1656939 | ||
|
|
75012cdcba | ||
|
|
c1e4c4cb30 | ||
|
|
a3a0af64ce | ||
|
|
1f9e5ca3cc | ||
|
|
7409f15752 |
39
CONTRIBUTING.md
Normal file
39
CONTRIBUTING.md
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
# Contributing to Security Onion
|
||||||
|
|
||||||
|
### Questions, suggestions, and general comments
|
||||||
|
* Security Onion uses GitHub's [Discussions](https://github.com/Security-Onion-Solutions/securityonion/discussions) to provide a forum where the community and developers can interact as well as ask and answer questions.
|
||||||
|
|
||||||
|
### Reporting a bug
|
||||||
|
* The primary place to report unexpected behavior or possible bugs is the repo's [Discussions forum](https://github.com/Security-Onion-Solutions/securityonion/discussions).
|
||||||
|
|
||||||
|
* **If you are familiar with the current version of Security Onion and are confident you've discovered a bug**, first ensure there is not already an issue present by searching the open [issues](https://github.com/Security-Onion-Solutions/securityonion/issues). If there is, a thumbs up :+1: is a great way to show this bug is affecting you too.
|
||||||
|
|
||||||
|
* If an issue doesn't exist, [open a new one](https://github.com/Security-Onion-Solutions/securityonion/issues/new), following the directions in the issue template. This means including:
|
||||||
|
* **System information** and how Security Onion was installed
|
||||||
|
* **Log files** relevant to the bug report
|
||||||
|
* **Reproduction steps**
|
||||||
|
|
||||||
|
### Contributing code
|
||||||
|
|
||||||
|
* **All commits must be signed** with a valid key that has been added to your GitHub account. The commits should have all the "**Verified**" tag when viewed on GitHub as shown below:
|
||||||
|
|
||||||
|
<img src="./assets/images/verified-commit-1.png" width="450">
|
||||||
|
|
||||||
|
* If an issue does not already exist for the bug or feature for which you are submitting a pull request, [create one](https://github.com/Security-Onion-Solutions/securityonion/issues/new) with the relevant prefix. (**`FIX:`** for bug fixes, **`FEATURE:`** for new features.)
|
||||||
|
|
||||||
|
* Link the PR to the related issue, either using [keywords](https://docs.github.com/en/issues/tracking-your-work-with-issues/creating-issues/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword) in the PR description, or [manually](https://docs.github.com/en/issues/tracking-your-work-with-issues/creating-issues/linking-a-pull-request-to-an-issue#manually-linking-a-pull-request-to-an-issue).
|
||||||
|
|
||||||
|
* **Pull requests should be opened against the `dev` branch of this repo**, and should clearly describe the problem and solution.
|
||||||
|
|
||||||
|
* Be sure you have tested your changes and are confident they will not break other parts of the product.
|
||||||
|
|
||||||
|
* See this document's [code styling and conventions section](#code-style-and-conventions) below to be sure your PR fits our code requirements prior to submitting.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Code style and conventions
|
||||||
|
* **Keep code [DRY](https://en.wikipedia.org/wiki/Don%27t_repeat_yourself)**. For example, Bash code used by multiple scripts will likely best be added to <span style="white-space: nowrap;">[`so-common`](salt/common/tools/sbin/so-common)</span>.
|
||||||
|
|
||||||
|
* All new Bash code should pass [ShellCheck](https://www.shellcheck.net/) analysis. Where errors can be *safely* [ignored](https://github.com/koalaman/shellcheck/wiki/Ignore), the relevant disable directive should be accompanied by a brief explanation as to why the error is being ignored.
|
||||||
|
|
||||||
|
* **Ensure all YAML (this includes Salt states and pillars) is properly formatted**. The spec for YAML v1.2 can be found [here](https://yaml.org/spec/1.2/spec.html), however there are numerous online resources with simpler descriptions of its formatting rules.
|
||||||
@@ -1,14 +1,14 @@
|
|||||||
## Security Onion 2.3.50
|
## Security Onion 2.3.70
|
||||||
|
|
||||||
Security Onion 2.3.50 is here!
|
Security Onion 2.3.70 is here!
|
||||||
|
|
||||||
## Screenshots
|
## Screenshots
|
||||||
|
|
||||||
Alerts
|
Alerts
|
||||||

|

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

|

|
||||||
|
|
||||||
### Release Notes
|
### Release Notes
|
||||||
|
|
||||||
|
|||||||
21
SECURITY.md
Normal file
21
SECURITY.md
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
# Security Policy
|
||||||
|
|
||||||
|
## Supported Versions
|
||||||
|
|
||||||
|
| Version | Supported |
|
||||||
|
| ------- | ------------------ |
|
||||||
|
| 2.x.x | :white_check_mark: |
|
||||||
|
| 16.04.x | :x: |
|
||||||
|
|
||||||
|
Security Onion 16.04 has reached End Of Life and is no longer supported.
|
||||||
|
|
||||||
|
## Reporting a Vulnerability
|
||||||
|
|
||||||
|
If you have any security concerns regarding Security Onion or believe you have uncovered a vulnerability, please follow these steps:
|
||||||
|
|
||||||
|
- send an email to security@securityonion.net
|
||||||
|
- include a description of the issue and steps to reproduce
|
||||||
|
- please use plain text format (no Word documents or PDF files)
|
||||||
|
- please do not disclose publicly until we have had sufficient time to resolve the issue
|
||||||
|
|
||||||
|
This security address should be used only for undisclosed vulnerabilities. Dealing with fixed issues or general questions on how to use Security Onion should be handled via the normal support channels.
|
||||||
@@ -1,17 +1,18 @@
|
|||||||
### 2.3.50 ISO image built on 2021/04/27
|
### 2.3.70-GRAFANA ISO image built on 2021/08/23
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
### Download and Verify
|
### Download and Verify
|
||||||
|
|
||||||
2.3.50 ISO image:
|
2.3.70-GRAFANA ISO image:
|
||||||
https://download.securityonion.net/file/securityonion/securityonion-2.3.50.iso
|
https://download.securityonion.net/file/securityonion/securityonion-2.3.70-GRAFANA.iso
|
||||||
|
|
||||||
MD5: C39CEA68B5A8AFC5CFFB2481797C0374
|
MD5: A16683FC8F2151C290E359FC6066B1F2
|
||||||
SHA1: 00AD9F29ABE3AB495136989E62EBB8FA00DA82C6
|
SHA1: A93329C103CCCE665968F246163FBE5D41EF0510
|
||||||
SHA256: D77AE370D7863837A989F6735413D1DD46B866D8D135A4C363B0633E3990387E
|
SHA256: 3ED0177CADF203324363916AA240A10C58DC3E9044A9ADE173A80674701A50A3
|
||||||
|
|
||||||
Signature for ISO image:
|
Signature for ISO image:
|
||||||
https://github.com/Security-Onion-Solutions/securityonion/raw/master/sigs/securityonion-2.3.50.iso.sig
|
https://github.com/Security-Onion-Solutions/securityonion/raw/master/sigs/securityonion-2.3.70-GRAFANA.iso.sig
|
||||||
|
|
||||||
Signing key:
|
Signing key:
|
||||||
https://raw.githubusercontent.com/Security-Onion-Solutions/securityonion/master/KEYS
|
https://raw.githubusercontent.com/Security-Onion-Solutions/securityonion/master/KEYS
|
||||||
@@ -25,22 +26,22 @@ wget https://raw.githubusercontent.com/Security-Onion-Solutions/securityonion/ma
|
|||||||
|
|
||||||
Download the signature file for the ISO:
|
Download the signature file for the ISO:
|
||||||
```
|
```
|
||||||
wget https://github.com/Security-Onion-Solutions/securityonion/raw/master/sigs/securityonion-2.3.50.iso.sig
|
wget https://github.com/Security-Onion-Solutions/securityonion/raw/master/sigs/securityonion-2.3.70-GRAFANA.iso.sig
|
||||||
```
|
```
|
||||||
|
|
||||||
Download the ISO image:
|
Download the ISO image:
|
||||||
```
|
```
|
||||||
wget https://download.securityonion.net/file/securityonion/securityonion-2.3.50.iso
|
wget https://download.securityonion.net/file/securityonion/securityonion-2.3.70-GRAFANA.iso
|
||||||
```
|
```
|
||||||
|
|
||||||
Verify the downloaded ISO image using the signature file:
|
Verify the downloaded ISO image using the signature file:
|
||||||
```
|
```
|
||||||
gpg --verify securityonion-2.3.50.iso.sig securityonion-2.3.50.iso
|
gpg --verify securityonion-2.3.70-GRAFANA.iso.sig securityonion-2.3.70-GRAFANA.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 Tue 27 Apr 2021 02:17:25 PM EDT using RSA key ID FE507013
|
gpg: Signature made Mon 23 Aug 2021 01:43:00 PM 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.
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 245 KiB After Width: | Height: | Size: 245 KiB |
|
Before Width: | Height: | Size: 168 KiB After Width: | Height: | Size: 168 KiB |
BIN
assets/images/verified-commit-1.png
Normal file
BIN
assets/images/verified-commit-1.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 24 KiB |
@@ -67,3 +67,7 @@ peer:
|
|||||||
reactor:
|
reactor:
|
||||||
- 'so/fleet':
|
- 'so/fleet':
|
||||||
- salt://reactor/fleet.sls
|
- salt://reactor/fleet.sls
|
||||||
|
- 'salt/beacon/*/watch_sqlite_db//opt/so/conf/kratos/db/sqlite.db':
|
||||||
|
- salt://reactor/kratos.sls
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,208 +0,0 @@
|
|||||||
{%- set FLEETMANAGER = salt['pillar.get']('global:fleet_manager', False) -%}
|
|
||||||
{%- set FLEETNODE = salt['pillar.get']('global:fleet_node', False) -%}
|
|
||||||
{% set WAZUH = salt['pillar.get']('manager:wazuh', '0') %}
|
|
||||||
{% set THEHIVE = salt['pillar.get']('manager:thehive', '0') %}
|
|
||||||
{% set PLAYBOOK = salt['pillar.get']('manager:playbook', '0') %}
|
|
||||||
{% set FREQSERVER = salt['pillar.get']('manager:freq', '0') %}
|
|
||||||
{% set DOMAINSTATS = salt['pillar.get']('manager:domainstats', '0') %}
|
|
||||||
{% set ZEEKVER = salt['pillar.get']('global:mdengine', 'COMMUNITY') %}
|
|
||||||
{% set GRAFANA = salt['pillar.get']('manager:grafana', '0') %}
|
|
||||||
|
|
||||||
eval:
|
|
||||||
containers:
|
|
||||||
- so-nginx
|
|
||||||
- so-telegraf
|
|
||||||
{% if GRAFANA == '1' %}
|
|
||||||
- so-influxdb
|
|
||||||
- so-grafana
|
|
||||||
{% endif %}
|
|
||||||
- so-dockerregistry
|
|
||||||
- so-soc
|
|
||||||
- so-kratos
|
|
||||||
- so-idstools
|
|
||||||
{% if FLEETMANAGER %}
|
|
||||||
- so-mysql
|
|
||||||
- so-fleet
|
|
||||||
- so-redis
|
|
||||||
{% endif %}
|
|
||||||
- so-elasticsearch
|
|
||||||
- so-logstash
|
|
||||||
- so-kibana
|
|
||||||
- so-steno
|
|
||||||
- so-suricata
|
|
||||||
- so-zeek
|
|
||||||
- so-curator
|
|
||||||
- so-elastalert
|
|
||||||
{% if WAZUH != '0' %}
|
|
||||||
- so-wazuh
|
|
||||||
{% endif %}
|
|
||||||
- so-soctopus
|
|
||||||
{% if THEHIVE != '0' %}
|
|
||||||
- so-thehive
|
|
||||||
- so-thehive-es
|
|
||||||
- so-cortex
|
|
||||||
{% endif %}
|
|
||||||
{% if PLAYBOOK != '0' %}
|
|
||||||
- so-playbook
|
|
||||||
{% endif %}
|
|
||||||
{% if FREQSERVER != '0' %}
|
|
||||||
- so-freqserver
|
|
||||||
{% endif %}
|
|
||||||
{% if DOMAINSTATS != '0' %}
|
|
||||||
- so-domainstats
|
|
||||||
{% endif %}
|
|
||||||
heavy_node:
|
|
||||||
containers:
|
|
||||||
- so-nginx
|
|
||||||
- so-telegraf
|
|
||||||
- so-redis
|
|
||||||
- so-logstash
|
|
||||||
- so-elasticsearch
|
|
||||||
- so-curator
|
|
||||||
- so-steno
|
|
||||||
- so-suricata
|
|
||||||
- so-wazuh
|
|
||||||
- so-filebeat
|
|
||||||
{% if ZEEKVER != 'SURICATA' %}
|
|
||||||
- so-zeek
|
|
||||||
{% endif %}
|
|
||||||
helix:
|
|
||||||
containers:
|
|
||||||
- so-nginx
|
|
||||||
- so-telegraf
|
|
||||||
- so-idstools
|
|
||||||
- so-steno
|
|
||||||
- so-zeek
|
|
||||||
- so-redis
|
|
||||||
- so-logstash
|
|
||||||
- so-filebeat
|
|
||||||
hot_node:
|
|
||||||
containers:
|
|
||||||
- so-nginx
|
|
||||||
- so-telegraf
|
|
||||||
- so-logstash
|
|
||||||
- so-elasticsearch
|
|
||||||
- so-curator
|
|
||||||
manager_search:
|
|
||||||
containers:
|
|
||||||
- so-nginx
|
|
||||||
- so-telegraf
|
|
||||||
- so-soc
|
|
||||||
- so-kratos
|
|
||||||
- so-acng
|
|
||||||
- so-idstools
|
|
||||||
- so-redis
|
|
||||||
- so-logstash
|
|
||||||
- so-elasticsearch
|
|
||||||
- so-curator
|
|
||||||
- so-kibana
|
|
||||||
- so-elastalert
|
|
||||||
- so-filebeat
|
|
||||||
- so-soctopus
|
|
||||||
{% if FLEETMANAGER %}
|
|
||||||
- so-mysql
|
|
||||||
- so-fleet
|
|
||||||
- so-redis
|
|
||||||
{% endif %}
|
|
||||||
{% if WAZUH != '0' %}
|
|
||||||
- so-wazuh
|
|
||||||
{% endif %}
|
|
||||||
- so-soctopus
|
|
||||||
{% if THEHIVE != '0' %}
|
|
||||||
- so-thehive
|
|
||||||
- so-thehive-es
|
|
||||||
- so-cortex
|
|
||||||
{% endif %}
|
|
||||||
{% if PLAYBOOK != '0' %}
|
|
||||||
- so-playbook
|
|
||||||
{% endif %}
|
|
||||||
{% if FREQSERVER != '0' %}
|
|
||||||
- so-freqserver
|
|
||||||
{% endif %}
|
|
||||||
{% if DOMAINSTATS != '0' %}
|
|
||||||
- so-domainstats
|
|
||||||
{% endif %}
|
|
||||||
manager:
|
|
||||||
containers:
|
|
||||||
- so-dockerregistry
|
|
||||||
- so-nginx
|
|
||||||
- so-telegraf
|
|
||||||
{% if GRAFANA == '1' %}
|
|
||||||
- so-influxdb
|
|
||||||
- so-grafana
|
|
||||||
{% endif %}
|
|
||||||
- so-soc
|
|
||||||
- so-kratos
|
|
||||||
- so-acng
|
|
||||||
- so-idstools
|
|
||||||
- so-redis
|
|
||||||
- so-elasticsearch
|
|
||||||
- so-logstash
|
|
||||||
- so-kibana
|
|
||||||
- so-elastalert
|
|
||||||
- so-filebeat
|
|
||||||
{% if FLEETMANAGER %}
|
|
||||||
- so-mysql
|
|
||||||
- so-fleet
|
|
||||||
- so-redis
|
|
||||||
{% endif %}
|
|
||||||
{% if WAZUH != '0' %}
|
|
||||||
- so-wazuh
|
|
||||||
{% endif %}
|
|
||||||
- so-soctopus
|
|
||||||
{% if THEHIVE != '0' %}
|
|
||||||
- so-thehive
|
|
||||||
- so-thehive-es
|
|
||||||
- so-cortex
|
|
||||||
{% endif %}
|
|
||||||
{% if PLAYBOOK != '0' %}
|
|
||||||
- so-playbook
|
|
||||||
{% endif %}
|
|
||||||
{% if FREQSERVER != '0' %}
|
|
||||||
- so-freqserver
|
|
||||||
{% endif %}
|
|
||||||
{% if DOMAINSTATS != '0' %}
|
|
||||||
- so-domainstats
|
|
||||||
{% endif %}
|
|
||||||
parser_node:
|
|
||||||
containers:
|
|
||||||
- so-nginx
|
|
||||||
- so-telegraf
|
|
||||||
- so-logstash
|
|
||||||
search_node:
|
|
||||||
containers:
|
|
||||||
- so-nginx
|
|
||||||
- so-telegraf
|
|
||||||
- so-logstash
|
|
||||||
- so-elasticsearch
|
|
||||||
- so-curator
|
|
||||||
- so-filebeat
|
|
||||||
{% if WAZUH != '0' %}
|
|
||||||
- so-wazuh
|
|
||||||
{% endif %}
|
|
||||||
sensor:
|
|
||||||
containers:
|
|
||||||
- so-nginx
|
|
||||||
- so-telegraf
|
|
||||||
- so-steno
|
|
||||||
- so-suricata
|
|
||||||
{% if ZEEKVER != 'SURICATA' %}
|
|
||||||
- so-zeek
|
|
||||||
{% endif %}
|
|
||||||
- so-wazuh
|
|
||||||
- so-filebeat
|
|
||||||
warm_node:
|
|
||||||
containers:
|
|
||||||
- so-nginx
|
|
||||||
- so-telegraf
|
|
||||||
- so-elasticsearch
|
|
||||||
fleet:
|
|
||||||
containers:
|
|
||||||
{% if FLEETNODE %}
|
|
||||||
- so-mysql
|
|
||||||
- so-fleet
|
|
||||||
- so-redis
|
|
||||||
- so-filebeat
|
|
||||||
- so-nginx
|
|
||||||
- so-telegraf
|
|
||||||
{% endif %}
|
|
||||||
@@ -7,8 +7,10 @@ logstash:
|
|||||||
- so/9000_output_zeek.conf.jinja
|
- so/9000_output_zeek.conf.jinja
|
||||||
- so/9002_output_import.conf.jinja
|
- so/9002_output_import.conf.jinja
|
||||||
- so/9034_output_syslog.conf.jinja
|
- so/9034_output_syslog.conf.jinja
|
||||||
|
- so/9050_output_filebeatmodules.conf.jinja
|
||||||
- so/9100_output_osquery.conf.jinja
|
- so/9100_output_osquery.conf.jinja
|
||||||
- so/9400_output_suricata.conf.jinja
|
- so/9400_output_suricata.conf.jinja
|
||||||
- so/9500_output_beats.conf.jinja
|
- so/9500_output_beats.conf.jinja
|
||||||
- so/9600_output_ossec.conf.jinja
|
- so/9600_output_ossec.conf.jinja
|
||||||
- so/9700_output_strelka.conf.jinja
|
- so/9700_output_strelka.conf.jinja
|
||||||
|
- so/9800_output_logscan.conf.jinja
|
||||||
|
|||||||
@@ -22,6 +22,9 @@ base:
|
|||||||
'*_manager or *_managersearch':
|
'*_manager or *_managersearch':
|
||||||
- match: compound
|
- match: compound
|
||||||
- data.*
|
- data.*
|
||||||
|
{% if salt['file.file_exists']('/opt/so/saltstack/local/pillar/elasticsearch/auth.sls') %}
|
||||||
|
- elasticsearch.auth
|
||||||
|
{% endif %}
|
||||||
- secrets
|
- secrets
|
||||||
- global
|
- global
|
||||||
- minions.{{ grains.id }}
|
- minions.{{ grains.id }}
|
||||||
@@ -38,6 +41,9 @@ base:
|
|||||||
- secrets
|
- secrets
|
||||||
- healthcheck.eval
|
- healthcheck.eval
|
||||||
- elasticsearch.eval
|
- elasticsearch.eval
|
||||||
|
{% if salt['file.file_exists']('/opt/so/saltstack/local/pillar/elasticsearch/auth.sls') %}
|
||||||
|
- elasticsearch.auth
|
||||||
|
{% endif %}
|
||||||
- global
|
- global
|
||||||
- minions.{{ grains.id }}
|
- minions.{{ grains.id }}
|
||||||
|
|
||||||
@@ -46,6 +52,9 @@ base:
|
|||||||
- logstash.manager
|
- logstash.manager
|
||||||
- logstash.search
|
- logstash.search
|
||||||
- elasticsearch.search
|
- elasticsearch.search
|
||||||
|
{% if salt['file.file_exists']('/opt/so/saltstack/local/pillar/elasticsearch/auth.sls') %}
|
||||||
|
- elasticsearch.auth
|
||||||
|
{% endif %}
|
||||||
- data.*
|
- data.*
|
||||||
- zeeklogs
|
- zeeklogs
|
||||||
- secrets
|
- secrets
|
||||||
@@ -59,6 +68,7 @@ base:
|
|||||||
|
|
||||||
'*_heavynode':
|
'*_heavynode':
|
||||||
- zeeklogs
|
- zeeklogs
|
||||||
|
- elasticsearch.auth
|
||||||
- global
|
- global
|
||||||
- minions.{{ grains.id }}
|
- minions.{{ grains.id }}
|
||||||
|
|
||||||
@@ -80,6 +90,7 @@ base:
|
|||||||
- logstash
|
- logstash
|
||||||
- logstash.search
|
- logstash.search
|
||||||
- elasticsearch.search
|
- elasticsearch.search
|
||||||
|
- elasticsearch.auth
|
||||||
- global
|
- global
|
||||||
- minions.{{ grains.id }}
|
- minions.{{ grains.id }}
|
||||||
- data.nodestab
|
- data.nodestab
|
||||||
@@ -88,5 +99,8 @@ base:
|
|||||||
- zeeklogs
|
- zeeklogs
|
||||||
- secrets
|
- secrets
|
||||||
- elasticsearch.eval
|
- elasticsearch.eval
|
||||||
|
{% if salt['file.file_exists']('/opt/so/saltstack/local/pillar/elasticsearch/auth.sls') %}
|
||||||
|
- elasticsearch.auth
|
||||||
|
{% endif %}
|
||||||
- global
|
- global
|
||||||
- minions.{{ grains.id }}
|
- minions.{{ grains.id }}
|
||||||
@@ -52,5 +52,4 @@ zeek:
|
|||||||
- frameworks/signatures/detect-windows-shells
|
- frameworks/signatures/detect-windows-shells
|
||||||
redef:
|
redef:
|
||||||
- LogAscii::use_json = T;
|
- LogAscii::use_json = T;
|
||||||
- LogAscii::json_timestamps = JSON::TS_ISO8601;
|
|
||||||
- CaptureLoss::watch_interval = 5 mins;
|
- CaptureLoss::watch_interval = 5 mins;
|
||||||
@@ -45,7 +45,8 @@
|
|||||||
'schedule',
|
'schedule',
|
||||||
'soctopus',
|
'soctopus',
|
||||||
'tcpreplay',
|
'tcpreplay',
|
||||||
'docker_clean'
|
'docker_clean',
|
||||||
|
'learn'
|
||||||
],
|
],
|
||||||
'so-heavynode': [
|
'so-heavynode': [
|
||||||
'ca',
|
'ca',
|
||||||
@@ -108,7 +109,8 @@
|
|||||||
'zeek',
|
'zeek',
|
||||||
'schedule',
|
'schedule',
|
||||||
'tcpreplay',
|
'tcpreplay',
|
||||||
'docker_clean'
|
'docker_clean',
|
||||||
|
'learn'
|
||||||
],
|
],
|
||||||
'so-manager': [
|
'so-manager': [
|
||||||
'salt.master',
|
'salt.master',
|
||||||
@@ -127,7 +129,8 @@
|
|||||||
'utility',
|
'utility',
|
||||||
'schedule',
|
'schedule',
|
||||||
'soctopus',
|
'soctopus',
|
||||||
'docker_clean'
|
'docker_clean',
|
||||||
|
'learn'
|
||||||
],
|
],
|
||||||
'so-managersearch': [
|
'so-managersearch': [
|
||||||
'salt.master',
|
'salt.master',
|
||||||
@@ -146,7 +149,8 @@
|
|||||||
'utility',
|
'utility',
|
||||||
'schedule',
|
'schedule',
|
||||||
'soctopus',
|
'soctopus',
|
||||||
'docker_clean'
|
'docker_clean',
|
||||||
|
'learn'
|
||||||
],
|
],
|
||||||
'so-node': [
|
'so-node': [
|
||||||
'ca',
|
'ca',
|
||||||
@@ -178,7 +182,8 @@
|
|||||||
'schedule',
|
'schedule',
|
||||||
'soctopus',
|
'soctopus',
|
||||||
'tcpreplay',
|
'tcpreplay',
|
||||||
'docker_clean'
|
'docker_clean',
|
||||||
|
'learn'
|
||||||
],
|
],
|
||||||
'so-sensor': [
|
'so-sensor': [
|
||||||
'ca',
|
'ca',
|
||||||
@@ -237,7 +242,7 @@
|
|||||||
{% do allowed_states.append('kibana') %}
|
{% do allowed_states.append('kibana') %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% if CURATOR and grains.role in ['so-eval', 'so-standalone', 'so-node', 'so-managersearch', 'so-heavynode'] %}
|
{% if grains.role in ['so-eval', 'so-standalone', 'so-node', 'so-managersearch', 'so-heavynode', 'so-manager'] %}
|
||||||
{% do allowed_states.append('curator') %}
|
{% do allowed_states.append('curator') %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
|||||||
@@ -22,6 +22,7 @@
|
|||||||
/opt/so/log/salt/so-salt-minion-check
|
/opt/so/log/salt/so-salt-minion-check
|
||||||
/opt/so/log/salt/minion
|
/opt/so/log/salt/minion
|
||||||
/opt/so/log/salt/master
|
/opt/so/log/salt/master
|
||||||
|
/opt/so/log/logscan/*.log
|
||||||
{
|
{
|
||||||
{{ logrotate_conf | indent(width=4) }}
|
{{ logrotate_conf | indent(width=4) }}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
{% if sls in allowed_states %}
|
{% if sls in allowed_states %}
|
||||||
|
|
||||||
{% set role = grains.id.split('_') | last %}
|
{% set role = grains.id.split('_') | last %}
|
||||||
|
{% from 'elasticsearch/auth.map.jinja' import ELASTICAUTH with context %}
|
||||||
|
|
||||||
# Remove variables.txt from /tmp - This is temp
|
# Remove variables.txt from /tmp - This is temp
|
||||||
rmvariablesfile:
|
rmvariablesfile:
|
||||||
@@ -95,7 +96,6 @@ commonpkgs:
|
|||||||
- netcat
|
- netcat
|
||||||
- python3-mysqldb
|
- python3-mysqldb
|
||||||
- sqlite3
|
- sqlite3
|
||||||
- argon2
|
|
||||||
- libssl-dev
|
- libssl-dev
|
||||||
- python3-dateutil
|
- python3-dateutil
|
||||||
- python3-m2crypto
|
- python3-m2crypto
|
||||||
@@ -128,7 +128,6 @@ commonpkgs:
|
|||||||
- net-tools
|
- net-tools
|
||||||
- curl
|
- curl
|
||||||
- sqlite
|
- sqlite
|
||||||
- argon2
|
|
||||||
- mariadb-devel
|
- mariadb-devel
|
||||||
- nmap-ncat
|
- nmap-ncat
|
||||||
- python3
|
- python3
|
||||||
@@ -169,6 +168,14 @@ alwaysupdated:
|
|||||||
Etc/UTC:
|
Etc/UTC:
|
||||||
timezone.system
|
timezone.system
|
||||||
|
|
||||||
|
elastic_curl_config:
|
||||||
|
file.managed:
|
||||||
|
- name: /opt/so/conf/elasticsearch/curl.config
|
||||||
|
- source: salt://elasticsearch/curl.config
|
||||||
|
- mode: 600
|
||||||
|
- show_changes: False
|
||||||
|
- makedirs: True
|
||||||
|
|
||||||
# Sync some Utilities
|
# Sync some Utilities
|
||||||
utilsyncscripts:
|
utilsyncscripts:
|
||||||
file.recurse:
|
file.recurse:
|
||||||
@@ -178,6 +185,10 @@ utilsyncscripts:
|
|||||||
- file_mode: 755
|
- file_mode: 755
|
||||||
- template: jinja
|
- template: jinja
|
||||||
- source: salt://common/tools/sbin
|
- source: salt://common/tools/sbin
|
||||||
|
- defaults:
|
||||||
|
ELASTICCURL: 'curl'
|
||||||
|
- context:
|
||||||
|
ELASTICCURL: {{ ELASTICAUTH.elasticcurl }}
|
||||||
|
|
||||||
{% if role in ['eval', 'standalone', 'sensor', 'heavynode'] %}
|
{% if role in ['eval', 'standalone', 'sensor', 'heavynode'] %}
|
||||||
# Add sensor cleanup
|
# Add sensor cleanup
|
||||||
@@ -315,6 +326,16 @@ dockerreserveports:
|
|||||||
- name: /etc/sysctl.d/99-reserved-ports.conf
|
- name: /etc/sysctl.d/99-reserved-ports.conf
|
||||||
|
|
||||||
{% if salt['grains.get']('sosmodel', '') %}
|
{% if salt['grains.get']('sosmodel', '') %}
|
||||||
|
{% if grains['os'] == 'CentOS' %}
|
||||||
|
# Install Raid tools
|
||||||
|
raidpkgs:
|
||||||
|
pkg.installed:
|
||||||
|
- skip_suggestions: True
|
||||||
|
- pkgs:
|
||||||
|
- securityonion-raidtools
|
||||||
|
- securityonion-megactl
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
# Install raid check cron
|
# Install raid check cron
|
||||||
/usr/sbin/so-raid-status > /dev/null 2>&1:
|
/usr/sbin/so-raid-status > /dev/null 2>&1:
|
||||||
cron.present:
|
cron.present:
|
||||||
|
|||||||
@@ -1,64 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
# Copyright 2014,2015,2016,2017,2018,2019,2020,2021 Security Onion Solutions, LLC
|
|
||||||
#
|
|
||||||
# This program is free software: you can redistribute it and/or modify
|
|
||||||
# it under the terms of the GNU General Public License as published by
|
|
||||||
# the Free Software Foundation, either version 3 of the License, or
|
|
||||||
# (at your option) any later version.
|
|
||||||
#
|
|
||||||
# This program is distributed in the hope that it will be useful,
|
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
. /usr/sbin/so-common
|
|
||||||
|
|
||||||
UPDATE_DIR=/tmp/sohotfixapply
|
|
||||||
|
|
||||||
if [ -z "$1" ]; then
|
|
||||||
echo "No tarball given. Please provide the filename so I can run the hotfix"
|
|
||||||
echo "so-airgap-hotfixapply /path/to/sohotfix.tar"
|
|
||||||
exit 1
|
|
||||||
else
|
|
||||||
if [ ! -f "$1" ]; then
|
|
||||||
echo "Unable to find $1. Make sure your path is correct and retry."
|
|
||||||
exit 1
|
|
||||||
else
|
|
||||||
echo "Determining if we need to apply this hotfix"
|
|
||||||
rm -rf $UPDATE_DIR
|
|
||||||
mkdir -p $UPDATE_DIR
|
|
||||||
tar xvf $1 -C $UPDATE_DIR
|
|
||||||
|
|
||||||
# Compare some versions
|
|
||||||
NEWVERSION=$(cat $UPDATE_DIR/VERSION)
|
|
||||||
HOTFIXVERSION=$(cat $UPDATE_DIR/HOTFIX)
|
|
||||||
CURRENTHOTFIX=$(cat /etc/sohotfix)
|
|
||||||
INSTALLEDVERSION=$(cat /etc/soversion)
|
|
||||||
|
|
||||||
if [ "$INSTALLEDVERSION" == "$NEWVERSION" ]; then
|
|
||||||
echo "Checking to see if there are hotfixes needed"
|
|
||||||
if [ "$HOTFIXVERSION" == "$CURRENTHOTFIX" ]; then
|
|
||||||
echo "You are already running the latest version of Security Onion."
|
|
||||||
rm -rf $UPDATE_DIR
|
|
||||||
exit 1
|
|
||||||
else
|
|
||||||
echo "We need to apply a hotfix"
|
|
||||||
copy_new_files
|
|
||||||
echo $HOTFIXVERSION > /etc/sohotfix
|
|
||||||
salt-call state.highstate -l info queue=True
|
|
||||||
echo "The Hotfix $HOTFIXVERSION has been applied"
|
|
||||||
# Clean up
|
|
||||||
rm -rf $UPDATE_DIR
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
echo "This hotfix is not compatible with your current version. Download the latest ISO and run soup"
|
|
||||||
rm -rf $UPDATE_DIR
|
|
||||||
fi
|
|
||||||
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
@@ -17,4 +17,4 @@
|
|||||||
|
|
||||||
. /usr/sbin/so-common
|
. /usr/sbin/so-common
|
||||||
|
|
||||||
salt-call state.highstate
|
salt-call state.highstate -linfo
|
||||||
|
|||||||
@@ -88,19 +88,6 @@ add_interface_bond0() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
check_airgap() {
|
|
||||||
# See if this is an airgap install
|
|
||||||
AIRGAP=$(cat /opt/so/saltstack/local/pillar/global.sls | grep airgap: | awk '{print $2}')
|
|
||||||
if [[ "$AIRGAP" == "True" ]]; then
|
|
||||||
is_airgap=0
|
|
||||||
UPDATE_DIR=/tmp/soagupdate/SecurityOnion
|
|
||||||
AGDOCKER=/tmp/soagupdate/docker
|
|
||||||
AGREPO=/tmp/soagupdate/Packages
|
|
||||||
else
|
|
||||||
is_airgap=1
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
check_container() {
|
check_container() {
|
||||||
docker ps | grep "$1:" > /dev/null 2>&1
|
docker ps | grep "$1:" > /dev/null 2>&1
|
||||||
return $?
|
return $?
|
||||||
@@ -153,7 +140,7 @@ Do you agree to the terms of the Elastic License?
|
|||||||
If so, type AGREE to accept the Elastic License and continue. Otherwise, press Enter to exit this program without making any changes.
|
If so, type AGREE to accept the Elastic License and continue. Otherwise, press Enter to exit this program without making any changes.
|
||||||
EOM
|
EOM
|
||||||
|
|
||||||
AGREED=$(whiptail --title "Security Onion Setup" --inputbox \
|
AGREED=$(whiptail --title "$whiptail_title" --inputbox \
|
||||||
"$message" 20 75 3>&1 1>&2 2>&3)
|
"$message" 20 75 3>&1 1>&2 2>&3)
|
||||||
|
|
||||||
if [ "${AGREED^^}" = 'AGREE' ]; then
|
if [ "${AGREED^^}" = 'AGREE' ]; then
|
||||||
@@ -252,6 +239,7 @@ lookup_salt_value() {
|
|||||||
key=$1
|
key=$1
|
||||||
group=$2
|
group=$2
|
||||||
kind=$3
|
kind=$3
|
||||||
|
output=${4:-newline_values_only}
|
||||||
|
|
||||||
if [ -z "$kind" ]; then
|
if [ -z "$kind" ]; then
|
||||||
kind=pillar
|
kind=pillar
|
||||||
@@ -261,7 +249,7 @@ lookup_salt_value() {
|
|||||||
group=${group}:
|
group=${group}:
|
||||||
fi
|
fi
|
||||||
|
|
||||||
salt-call --no-color ${kind}.get ${group}${key} --out=newline_values_only
|
salt-call --no-color ${kind}.get ${group}${key} --out=${output}
|
||||||
}
|
}
|
||||||
|
|
||||||
lookup_pillar() {
|
lookup_pillar() {
|
||||||
@@ -289,7 +277,7 @@ lookup_role() {
|
|||||||
|
|
||||||
require_manager() {
|
require_manager() {
|
||||||
if is_manager_node; then
|
if is_manager_node; then
|
||||||
echo "This is a manager, We can proceed."
|
echo "This is a manager, so we can proceed."
|
||||||
else
|
else
|
||||||
echo "Please run this command on the manager; the manager controls the grid."
|
echo "Please run this command on the manager; the manager controls the grid."
|
||||||
exit 1
|
exit 1
|
||||||
@@ -302,6 +290,7 @@ retry() {
|
|||||||
cmd=$3
|
cmd=$3
|
||||||
expectedOutput=$4
|
expectedOutput=$4
|
||||||
attempt=0
|
attempt=0
|
||||||
|
local exitcode=0
|
||||||
while [[ $attempt -lt $maxAttempts ]]; do
|
while [[ $attempt -lt $maxAttempts ]]; do
|
||||||
attempt=$((attempt+1))
|
attempt=$((attempt+1))
|
||||||
echo "Executing command with retry support: $cmd"
|
echo "Executing command with retry support: $cmd"
|
||||||
@@ -321,7 +310,29 @@ retry() {
|
|||||||
sleep $sleepDelay
|
sleep $sleepDelay
|
||||||
done
|
done
|
||||||
echo "Command continues to fail; giving up."
|
echo "Command continues to fail; giving up."
|
||||||
return 1
|
return $exitcode
|
||||||
|
}
|
||||||
|
|
||||||
|
run_check_net_err() {
|
||||||
|
local cmd=$1
|
||||||
|
local err_msg=${2:-"Unknown error occured, please check /root/$WHATWOULDYOUSAYYAHDOHERE.log for details."} # Really need to rename that variable
|
||||||
|
local no_retry=$3
|
||||||
|
|
||||||
|
local exit_code
|
||||||
|
if [[ -z $no_retry ]]; then
|
||||||
|
retry 5 60 "$cmd"
|
||||||
|
exit_code=$?
|
||||||
|
else
|
||||||
|
eval "$cmd"
|
||||||
|
exit_code=$?
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ $exit_code -ne 0 ]]; then
|
||||||
|
ERR_HANDLED=true
|
||||||
|
[[ -z $no_retry ]] || echo "Command failed with error $exit_code"
|
||||||
|
echo "$err_msg"
|
||||||
|
exit $exit_code
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
set_os() {
|
set_os() {
|
||||||
@@ -361,6 +372,14 @@ set_version() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
has_uppercase() {
|
||||||
|
local string=$1
|
||||||
|
|
||||||
|
echo "$string" | grep -qP '[A-Z]' \
|
||||||
|
&& return 0 \
|
||||||
|
|| return 1
|
||||||
|
}
|
||||||
|
|
||||||
valid_cidr() {
|
valid_cidr() {
|
||||||
# Verify there is a backslash in the string
|
# Verify there is a backslash in the string
|
||||||
echo "$1" | grep -qP "^[^/]+/[^/]+$" || return 1
|
echo "$1" | grep -qP "^[^/]+/[^/]+$" || return 1
|
||||||
@@ -486,12 +505,14 @@ wait_for_web_response() {
|
|||||||
url=$1
|
url=$1
|
||||||
expected=$2
|
expected=$2
|
||||||
maxAttempts=${3:-300}
|
maxAttempts=${3:-300}
|
||||||
|
curlcmd=${4:-curl}
|
||||||
logfile=/root/wait_for_web_response.log
|
logfile=/root/wait_for_web_response.log
|
||||||
|
truncate -s 0 "$logfile"
|
||||||
attempt=0
|
attempt=0
|
||||||
while [[ $attempt -lt $maxAttempts ]]; do
|
while [[ $attempt -lt $maxAttempts ]]; do
|
||||||
attempt=$((attempt+1))
|
attempt=$((attempt+1))
|
||||||
echo "Waiting for value '$expected' at '$url' ($attempt/$maxAttempts)"
|
echo "Waiting for value '$expected' at '$url' ($attempt/$maxAttempts)"
|
||||||
result=$(curl -ks -L $url)
|
result=$($curlcmd -ks -L $url)
|
||||||
exitcode=$?
|
exitcode=$?
|
||||||
|
|
||||||
echo "--------------------------------------------------" >> $logfile
|
echo "--------------------------------------------------" >> $logfile
|
||||||
|
|||||||
@@ -35,6 +35,7 @@ if [ ! -f $BACKUPFILE ]; then
|
|||||||
{%- endfor %}
|
{%- endfor %}
|
||||||
tar -rf $BACKUPFILE /etc/pki
|
tar -rf $BACKUPFILE /etc/pki
|
||||||
tar -rf $BACKUPFILE /etc/salt
|
tar -rf $BACKUPFILE /etc/salt
|
||||||
|
tar -rf $BACKUPFILE /opt/so/conf/kratos
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
@@ -32,19 +32,25 @@ def get_image_version(string) -> str:
|
|||||||
ver = string.split(':')[-1]
|
ver = string.split(':')[-1]
|
||||||
if ver == 'latest':
|
if ver == 'latest':
|
||||||
# Version doesn't like "latest", so use a high semver
|
# Version doesn't like "latest", so use a high semver
|
||||||
return '999999.9.9'
|
return '99999.9.9'
|
||||||
else:
|
else:
|
||||||
try:
|
try:
|
||||||
Version(ver)
|
Version(ver)
|
||||||
except InvalidVersion:
|
except InvalidVersion:
|
||||||
# Strip the last substring following a hyphen for automated branches
|
# Also return a very high semver for any version
|
||||||
ver = '-'.join(ver.split('-')[:-1])
|
# with a dash in it since it will likely be a dev version of some kind
|
||||||
|
if '-' in ver:
|
||||||
|
return '999999.9.9'
|
||||||
return ver
|
return ver
|
||||||
|
|
||||||
|
|
||||||
def main(quiet):
|
def main(quiet):
|
||||||
client = docker.from_env()
|
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 })
|
image_list = client.images.list(filters={ 'dangling': False })
|
||||||
|
|
||||||
# Map list of image objects to flattened list of tags (format: "name:version")
|
# Map list of image objects to flattened list of tags (format: "name:version")
|
||||||
@@ -72,9 +78,16 @@ def main(quiet):
|
|||||||
for group in grouped_t_list[2:]:
|
for group in grouped_t_list[2:]:
|
||||||
for tag in group:
|
for tag in group:
|
||||||
if not quiet: print(f'Removing image {tag}')
|
if not quiet: print(f'Removing image {tag}')
|
||||||
client.images.remove(tag)
|
try:
|
||||||
except InvalidVersion as e:
|
client.images.remove(tag, force=True)
|
||||||
print(f'so-{get_so_image_basename(t_list[0])}: {e.args[0]}', file=sys.stderr)
|
except docker.errors.ClientError as e:
|
||||||
|
print(f'Could not remove image {tag}, continuing...')
|
||||||
|
except (docker.errors.APIError, InvalidVersion) as e:
|
||||||
|
print(f'so-{get_so_image_basename(t_list[0])}: {e}', file=sys.stderr)
|
||||||
|
exit(1)
|
||||||
|
except Exception as e:
|
||||||
|
print('Unhandled exception occurred:')
|
||||||
|
print(f'so-{get_so_image_basename(t_list[0])}: {e}', file=sys.stderr)
|
||||||
exit(1)
|
exit(1)
|
||||||
|
|
||||||
if no_prunable and not quiet:
|
if no_prunable and not quiet:
|
||||||
|
|||||||
@@ -145,9 +145,9 @@ EOF
|
|||||||
rulename=$(echo ${raw_rulename,,} | sed 's/ /_/g')
|
rulename=$(echo ${raw_rulename,,} | sed 's/ /_/g')
|
||||||
|
|
||||||
cat << EOF >> "$rulename.yaml"
|
cat << EOF >> "$rulename.yaml"
|
||||||
# Elasticsearch Host
|
# Elasticsearch Host Override (optional)
|
||||||
es_host: elasticsearch
|
# es_host: elasticsearch
|
||||||
es_port: 9200
|
# es_port: 9200
|
||||||
|
|
||||||
# (Required)
|
# (Required)
|
||||||
# Rule name, must be unique
|
# Rule name, must be unique
|
||||||
|
|||||||
67
salt/common/tools/sbin/so-elastic-auth
Executable file
67
salt/common/tools/sbin/so-elastic-auth
Executable file
@@ -0,0 +1,67 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Copyright 2014,2015,2016,2017,2018,2019,2020,2021 Security Onion Solutions, LLC
|
||||||
|
#
|
||||||
|
# This program is free software: you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation, either version 3 of the License, or
|
||||||
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
if [ -f "/usr/sbin/so-common" ]; then
|
||||||
|
. /usr/sbin/so-common
|
||||||
|
fi
|
||||||
|
|
||||||
|
ES_AUTH_PILLAR=${ELASTIC_AUTH_PILLAR:-/opt/so/saltstack/local/pillar/elasticsearch/auth.sls}
|
||||||
|
ES_USERS_FILE=${ELASTIC_USERS_FILE:-/opt/so/saltstack/local/salt/elasticsearch/files/users}
|
||||||
|
|
||||||
|
authEnable=$1
|
||||||
|
|
||||||
|
if ! grep -q "enabled: " "$ES_AUTH_PILLAR"; then
|
||||||
|
echo "Elastic auth pillar file is invalid. Unable to proceed."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
function restart() {
|
||||||
|
if [[ -z "$ELASTIC_AUTH_SKIP_HIGHSTATE" ]]; then
|
||||||
|
echo "Elasticsearch on all affected minions will now be stopped and then restarted..."
|
||||||
|
salt -C 'G@role:so-standalone or G@role:so-eval or G@role:so-import or G@role:so-manager or G@role:so-managersearch or G@role:so-node or G@role:so-heavynode' cmd.run so-elastic-stop queue=True
|
||||||
|
echo "Applying highstate to all affected minions..."
|
||||||
|
salt -C 'G@role:so-standalone or G@role:so-eval or G@role:so-import or G@role:so-manager or G@role:so-managersearch or G@role:so-node or G@role:so-heavynode' state.highstate queue=True
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
if [[ "$authEnable" == "true" ]]; then
|
||||||
|
if grep -q "enabled: False" "$ES_AUTH_PILLAR"; then
|
||||||
|
sed -i 's/enabled: False/enabled: True/g' "$ES_AUTH_PILLAR"
|
||||||
|
restart
|
||||||
|
echo "Elastic auth is now enabled."
|
||||||
|
if grep -q "argon" "$ES_USERS_FILE"; then
|
||||||
|
echo ""
|
||||||
|
echo "IMPORTANT: The following users will need to change their password, after logging into SOC, in order to access Kibana:"
|
||||||
|
grep argon "$ES_USERS_FILE" | cut -d ":" -f 1
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo "Auth is already enabled."
|
||||||
|
fi
|
||||||
|
elif [[ "$authEnable" == "false" ]]; then
|
||||||
|
if grep -q "enabled: True" "$ES_AUTH_PILLAR"; then
|
||||||
|
sed -i 's/enabled: True/enabled: False/g' "$ES_AUTH_PILLAR"
|
||||||
|
restart
|
||||||
|
echo "Elastic auth is now disabled."
|
||||||
|
else
|
||||||
|
echo "Auth is already disabled."
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo "Usage: $0 <true|false>"
|
||||||
|
echo ""
|
||||||
|
echo "Toggles Elastic authentication. Elasticsearch will be restarted on each affected minion."
|
||||||
|
echo ""
|
||||||
|
fi
|
||||||
@@ -50,7 +50,7 @@ done
|
|||||||
if [ $SKIP -ne 1 ]; then
|
if [ $SKIP -ne 1 ]; then
|
||||||
# List indices
|
# List indices
|
||||||
echo
|
echo
|
||||||
curl -k -L https://{{ NODEIP }}:9200/_cat/indices?v
|
{{ ELASTICCURL }} -k -L https://{{ NODEIP }}:9200/_cat/indices?v
|
||||||
echo
|
echo
|
||||||
# Inform user we are about to delete all data
|
# Inform user we are about to delete all data
|
||||||
echo
|
echo
|
||||||
@@ -89,10 +89,10 @@ fi
|
|||||||
# Delete data
|
# Delete data
|
||||||
echo "Deleting data..."
|
echo "Deleting data..."
|
||||||
|
|
||||||
INDXS=$(curl -s -XGET -k -L https://{{ NODEIP }}:9200/_cat/indices?v | egrep 'logstash|elastalert|so-' | awk '{ print $3 }')
|
INDXS=$({{ ELASTICCURL }} -s -XGET -k -L https://{{ NODEIP }}:9200/_cat/indices?v | egrep 'logstash|elastalert|so-' | awk '{ print $3 }')
|
||||||
for INDX in ${INDXS}
|
for INDX in ${INDXS}
|
||||||
do
|
do
|
||||||
curl -XDELETE -k -L https://"{{ NODEIP }}:9200/${INDX}" > /dev/null 2>&1
|
{{ ELASTICCURL }} -XDELETE -k -L https://"{{ NODEIP }}:9200/${INDX}" > /dev/null 2>&1
|
||||||
done
|
done
|
||||||
|
|
||||||
#Start Logstash/Filebeat
|
#Start Logstash/Filebeat
|
||||||
|
|||||||
@@ -18,4 +18,4 @@
|
|||||||
|
|
||||||
. /usr/sbin/so-common
|
. /usr/sbin/so-common
|
||||||
|
|
||||||
curl -s -k -L https://{{ NODEIP }}:9200/_cat/indices?pretty
|
{{ ELASTICCURL }} -s -k -L https://{{ NODEIP }}:9200/_cat/indices?pretty
|
||||||
|
|||||||
@@ -21,5 +21,5 @@ THEHIVEESPORT=9400
|
|||||||
|
|
||||||
echo "Removing read only attributes for indices..."
|
echo "Removing read only attributes for indices..."
|
||||||
echo
|
echo
|
||||||
curl -s -k -XPUT -H "Content-Type: application/json" -L https://$IP:9200/_all/_settings -d '{"index.blocks.read_only_allow_delete": null}' 2>&1 | if grep -q ack; then echo "Index settings updated..."; else echo "There was any issue updating the read-only attribute. Please ensure Elasticsearch is running.";fi;
|
{{ ELASTICCURL }} -s -k -XPUT -H "Content-Type: application/json" -L https://$IP:9200/_all/_settings -d '{"index.blocks.read_only_allow_delete": null}' 2>&1 | if grep -q ack; then echo "Index settings updated..."; else echo "There was any issue updating the read-only attribute. Please ensure Elasticsearch is running.";fi;
|
||||||
curl -XPUT -H "Content-Type: application/json" -L http://$IP:9400/_all/_settings -d '{"index.blocks.read_only_allow_delete": null}' 2>&1 | if grep -q ack; then echo "Index settings updated..."; else echo "There was any issue updating the read-only attribute. Please ensure Elasticsearch is running.";fi;
|
{{ ELASTICCURL }} -XPUT -H "Content-Type: application/json" -L http://$IP:9400/_all/_settings -d '{"index.blocks.read_only_allow_delete": null}' 2>&1 | if grep -q ack; then echo "Index settings updated..."; else echo "There was any issue updating the read-only attribute. Please ensure Elasticsearch is running.";fi;
|
||||||
|
|||||||
@@ -19,7 +19,7 @@
|
|||||||
. /usr/sbin/so-common
|
. /usr/sbin/so-common
|
||||||
|
|
||||||
if [ "$1" == "" ]; then
|
if [ "$1" == "" ]; then
|
||||||
curl -s -k -L https://{{ NODEIP }}:9200/_nodes/stats | jq .nodes | jq ".[] | .ingest.pipelines"
|
{{ ELASTICCURL }} -s -k -L https://{{ NODEIP }}:9200/_nodes/stats | jq .nodes | jq ".[] | .ingest.pipelines"
|
||||||
else
|
else
|
||||||
curl -s -k -L https://{{ NODEIP }}:9200/_nodes/stats | jq .nodes | jq ".[] | .ingest.pipelines.\"$1\""
|
{{ ELASTICCURL }} -s -k -L https://{{ NODEIP }}:9200/_nodes/stats | jq .nodes | jq ".[] | .ingest.pipelines.\"$1\""
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -19,7 +19,7 @@
|
|||||||
. /usr/sbin/so-common
|
. /usr/sbin/so-common
|
||||||
|
|
||||||
if [ "$1" == "" ]; then
|
if [ "$1" == "" ]; then
|
||||||
curl -s -k -L https://{{ NODEIP }}:9200/_ingest/pipeline/* | jq .
|
{{ ELASTICCURL }} -s -k -L https://{{ NODEIP }}:9200/_ingest/pipeline/* | jq .
|
||||||
else
|
else
|
||||||
curl -s -k -L https://{{ NODEIP }}:9200/_ingest/pipeline/$1 | jq .
|
{{ ELASTICCURL }} -s -k -L https://{{ NODEIP }}:9200/_ingest/pipeline/$1 | jq .[]
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
{%- set NODEIP = salt['pillar.get']('elasticsearch:mainip', '') -%}
|
{%- set NODEIP = salt['pillar.get']('elasticsearch:mainip', '') -%}
|
||||||
. /usr/sbin/so-common
|
. /usr/sbin/so-common
|
||||||
if [ "$1" == "" ]; then
|
if [ "$1" == "" ]; then
|
||||||
curl -s -k -L https://{{ NODEIP }}:9200/_ingest/pipeline/* | jq 'keys'
|
{{ ELASTICCURL }} -s -k -L https://{{ NODEIP }}:9200/_ingest/pipeline/* | jq 'keys'
|
||||||
else
|
else
|
||||||
curl -s -k -L https://{{ NODEIP }}:9200/_ingest/pipeline/$1 | jq
|
{{ ELASTICCURL }} -s -k -L https://{{ NODEIP }}:9200/_ingest/pipeline/$1 | jq
|
||||||
fi
|
fi
|
||||||
|
|||||||
37
salt/common/tools/sbin/so-elasticsearch-query
Executable file
37
salt/common/tools/sbin/so-elasticsearch-query
Executable file
@@ -0,0 +1,37 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
#
|
||||||
|
# Copyright 2014,2015,2016,2017,2018,2019,2020,2021 Security Onion Solutions, LLC
|
||||||
|
#
|
||||||
|
# This program is free software: you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation, either version 3 of the License, or
|
||||||
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||||
|
. /usr/sbin/so-common
|
||||||
|
|
||||||
|
if [[ $# -lt 1 ]]; then
|
||||||
|
echo "Submit a cURL request to the local Security Onion Elasticsearch host."
|
||||||
|
echo ""
|
||||||
|
echo "Usage: $0 <PATH> [ARGS,...]"
|
||||||
|
echo ""
|
||||||
|
echo "Where "
|
||||||
|
echo " PATH represents the elastic function being requested."
|
||||||
|
echo " ARGS is used to specify additional, optional curl parameters."
|
||||||
|
echo ""
|
||||||
|
echo "Examples:"
|
||||||
|
echo " $0 /"
|
||||||
|
echo " $0 '*:so-*/_search' -d '{\"query\": {\"match_all\": {}},\"size\": 1}' | jq"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
QUERYPATH=$1
|
||||||
|
shift
|
||||||
|
|
||||||
|
{{ ELASTICCURL }} -s -k -L -H "Content-Type: application/json" "https://localhost:9200/${QUERYPATH}" "$@"
|
||||||
@@ -18,4 +18,4 @@
|
|||||||
|
|
||||||
. /usr/sbin/so-common
|
. /usr/sbin/so-common
|
||||||
|
|
||||||
curl -s -k -L https://{{ NODEIP }}:9200/_cat/shards?pretty
|
{{ ELASTICCURL }} -s -k -L https://{{ NODEIP }}:9200/_cat/shards?pretty
|
||||||
|
|||||||
@@ -18,4 +18,4 @@
|
|||||||
|
|
||||||
. /usr/sbin/so-common
|
. /usr/sbin/so-common
|
||||||
|
|
||||||
curl -s -k -L -XDELETE https://{{ NODEIP }}:9200/_template/$1
|
{{ ELASTICCURL }} -s -k -L -XDELETE https://{{ NODEIP }}:9200/_template/$1
|
||||||
|
|||||||
@@ -19,7 +19,7 @@
|
|||||||
. /usr/sbin/so-common
|
. /usr/sbin/so-common
|
||||||
|
|
||||||
if [ "$1" == "" ]; then
|
if [ "$1" == "" ]; then
|
||||||
curl -s -k -L https://{{ NODEIP }}:9200/_template/* | jq .
|
{{ ELASTICCURL }} -s -k -L https://{{ NODEIP }}:9200/_template/* | jq .
|
||||||
else
|
else
|
||||||
curl -s -k -L https://{{ NODEIP }}:9200/_template/$1 | jq .
|
{{ ELASTICCURL }} -s -k -L https://{{ NODEIP }}:9200/_template/$1 | jq .
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
{%- set NODEIP = salt['pillar.get']('elasticsearch:mainip', '') -%}
|
{%- set NODEIP = salt['pillar.get']('elasticsearch:mainip', '') -%}
|
||||||
. /usr/sbin/so-common
|
. /usr/sbin/so-common
|
||||||
if [ "$1" == "" ]; then
|
if [ "$1" == "" ]; then
|
||||||
curl -s -k -L https://{{ NODEIP }}:9200/_template/* | jq 'keys'
|
{{ ELASTICCURL }} -s -k -L https://{{ NODEIP }}:9200/_template/* | jq 'keys'
|
||||||
else
|
else
|
||||||
curl -s -k -L https://{{ NODEIP }}:9200/_template/$1 | jq
|
{{ ELASTICCURL }} -s -k -L https://{{ NODEIP }}:9200/_template/$1 | jq
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -1,8 +1,5 @@
|
|||||||
{%- set mainint = salt['pillar.get']('host:mainint') %}
|
|
||||||
{%- set MYIP = salt['grains.get']('ip_interfaces:' ~ mainint)[0] %}
|
|
||||||
|
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# Copyright 2014,2015,2016,2017,2018,2019 Security Onion Solutions, LLC
|
# Copyright 2014,2015,2016,2017,2018,2019,2020,2021 Security Onion Solutions, LLC
|
||||||
#
|
#
|
||||||
# This program is free software: you can redistribute it and/or modify
|
# This program is free software: you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
@@ -17,6 +14,9 @@
|
|||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
{%- set mainint = salt['pillar.get']('host:mainint') %}
|
||||||
|
{%- set MYIP = salt['grains.get']('ip_interfaces:' ~ mainint)[0] %}
|
||||||
|
|
||||||
default_conf_dir=/opt/so/conf
|
default_conf_dir=/opt/so/conf
|
||||||
ELASTICSEARCH_HOST="{{ MYIP }}"
|
ELASTICSEARCH_HOST="{{ MYIP }}"
|
||||||
ELASTICSEARCH_PORT=9200
|
ELASTICSEARCH_PORT=9200
|
||||||
@@ -30,7 +30,7 @@ echo -n "Waiting for ElasticSearch..."
|
|||||||
COUNT=0
|
COUNT=0
|
||||||
ELASTICSEARCH_CONNECTED="no"
|
ELASTICSEARCH_CONNECTED="no"
|
||||||
while [[ "$COUNT" -le 240 ]]; do
|
while [[ "$COUNT" -le 240 ]]; do
|
||||||
curl -k --output /dev/null --silent --head --fail -L https://"$ELASTICSEARCH_HOST":"$ELASTICSEARCH_PORT"
|
{{ ELASTICCURL }} -k --output /dev/null --silent --head --fail -L https://"$ELASTICSEARCH_HOST":"$ELASTICSEARCH_PORT"
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
ELASTICSEARCH_CONNECTED="yes"
|
ELASTICSEARCH_CONNECTED="yes"
|
||||||
echo "connected!"
|
echo "connected!"
|
||||||
@@ -51,7 +51,7 @@ cd ${ELASTICSEARCH_TEMPLATES}
|
|||||||
|
|
||||||
|
|
||||||
echo "Loading templates..."
|
echo "Loading templates..."
|
||||||
for i in *; do TEMPLATE=$(echo $i | cut -d '-' -f2); echo "so-$TEMPLATE"; curl -k ${ELASTICSEARCH_AUTH} -s -XPUT -L https://${ELASTICSEARCH_HOST}:${ELASTICSEARCH_PORT}/_template/so-$TEMPLATE -H 'Content-Type: application/json' -d@$i 2>/dev/null; echo; done
|
for i in *; do TEMPLATE=$(echo $i | cut -d '-' -f2); echo "so-$TEMPLATE"; {{ ELASTICCURL }} -k ${ELASTICSEARCH_AUTH} -s -XPUT -L https://${ELASTICSEARCH_HOST}:${ELASTICSEARCH_PORT}/_template/so-$TEMPLATE -H 'Content-Type: application/json' -d@$i 2>/dev/null; echo; done
|
||||||
echo
|
echo
|
||||||
|
|
||||||
cd - >/dev/null
|
cd - >/dev/null
|
||||||
|
|||||||
5
salt/common/tools/sbin/so-elasticsearch-wait
Executable file
5
salt/common/tools/sbin/so-elasticsearch-wait
Executable file
@@ -0,0 +1,5 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
. /usr/sbin/so-common
|
||||||
|
|
||||||
|
wait_for_web_response "https://localhost:9200/_cat/indices/.kibana*" "green open" 300 "{{ ELASTICCURL }}"
|
||||||
67
salt/common/tools/sbin/so-filebeat-module-setup
Executable file
67
salt/common/tools/sbin/so-filebeat-module-setup
Executable file
@@ -0,0 +1,67 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
# Copyright 2014,2015,2016,2017,2018,2019,2020,2021 Security Onion Solutions, LLC
|
||||||
|
#
|
||||||
|
# This program is free software: you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation, either version 3 of the License, or
|
||||||
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
{%- set mainint = salt['pillar.get']('host:mainint') %}
|
||||||
|
{%- set MYIP = salt['grains.get']('ip_interfaces:' ~ mainint)[0] %}
|
||||||
|
|
||||||
|
default_conf_dir=/opt/so/conf
|
||||||
|
ELASTICSEARCH_HOST="{{ MYIP }}"
|
||||||
|
ELASTICSEARCH_PORT=9200
|
||||||
|
#ELASTICSEARCH_AUTH=""
|
||||||
|
|
||||||
|
# Define a default directory to load pipelines from
|
||||||
|
FB_MODULE_YML="/usr/share/filebeat/module-setup.yml"
|
||||||
|
|
||||||
|
|
||||||
|
# Wait for ElasticSearch to initialize
|
||||||
|
echo -n "Waiting for ElasticSearch..."
|
||||||
|
COUNT=0
|
||||||
|
ELASTICSEARCH_CONNECTED="no"
|
||||||
|
while [[ "$COUNT" -le 240 ]]; do
|
||||||
|
{{ ELASTICCURL }} -k --output /dev/null --silent --head --fail -L https://"$ELASTICSEARCH_HOST":"$ELASTICSEARCH_PORT"
|
||||||
|
if [ $? -eq 0 ]; then
|
||||||
|
ELASTICSEARCH_CONNECTED="yes"
|
||||||
|
echo "connected!"
|
||||||
|
break
|
||||||
|
else
|
||||||
|
((COUNT+=1))
|
||||||
|
sleep 1
|
||||||
|
echo -n "."
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
if [ "$ELASTICSEARCH_CONNECTED" == "no" ]; then
|
||||||
|
echo
|
||||||
|
echo -e "Connection attempt timed out. Unable to connect to ElasticSearch. \nPlease try: \n -checking log(s) in /var/log/elasticsearch/\n -running 'sudo docker ps' \n -running 'sudo so-elastic-restart'"
|
||||||
|
echo
|
||||||
|
fi
|
||||||
|
echo "Testing to see if the pipelines are already applied"
|
||||||
|
ESVER=$({{ ELASTICCURL }} -sk https://"$ELASTICSEARCH_HOST":"$ELASTICSEARCH_PORT" |jq .version.number |tr -d \")
|
||||||
|
PIPELINES=$({{ ELASTICCURL }} -sk https://"$ELASTICSEARCH_HOST":"$ELASTICSEARCH_PORT"/_ingest/pipeline/filebeat-$ESVER-suricata-eve-pipeline | jq . | wc -c)
|
||||||
|
|
||||||
|
if [[ "$PIPELINES" -lt 5 ]]; then
|
||||||
|
echo "Setting up ingest pipeline(s)"
|
||||||
|
|
||||||
|
for MODULE in activemq apache auditd aws azure barracuda bluecoat cef checkpoint cisco coredns crowdstrike cyberark cylance elasticsearch envoyproxy f5 fortinet gcp google_workspace googlecloud gsuite haproxy ibmmq icinga iis imperva infoblox iptables juniper kafka kibana logstash microsoft misp mongodb mssql mysql nats netscout nginx o365 okta osquery panw postgresql rabbitmq radware redis santa snort snyk sonicwall sophos squid suricata system tomcat traefik zeek zscaler
|
||||||
|
do
|
||||||
|
echo "Loading $MODULE"
|
||||||
|
docker exec -i so-filebeat filebeat setup modules -pipelines -modules $MODULE -c $FB_MODULE_YML
|
||||||
|
sleep 2
|
||||||
|
done
|
||||||
|
else
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
@@ -35,6 +35,7 @@ def showUsage(options, args):
|
|||||||
print('')
|
print('')
|
||||||
print(' General commands:')
|
print(' General commands:')
|
||||||
print(' help - Prints this usage information.')
|
print(' help - Prints this usage information.')
|
||||||
|
print(' apply - Apply the firewall state.')
|
||||||
print('')
|
print('')
|
||||||
print(' Host commands:')
|
print(' Host commands:')
|
||||||
print(' listhostgroups - Lists the known host groups.')
|
print(' listhostgroups - Lists the known host groups.')
|
||||||
@@ -66,7 +67,7 @@ def checkDefaultPortsOption(options):
|
|||||||
|
|
||||||
def checkApplyOption(options):
|
def checkApplyOption(options):
|
||||||
if "--apply" in options:
|
if "--apply" in options:
|
||||||
return apply()
|
return apply(None, None)
|
||||||
|
|
||||||
def loadYaml(filename):
|
def loadYaml(filename):
|
||||||
file = open(filename, "r")
|
file = open(filename, "r")
|
||||||
@@ -328,7 +329,7 @@ def removehost(options, args):
|
|||||||
code = checkApplyOption(options)
|
code = checkApplyOption(options)
|
||||||
return code
|
return code
|
||||||
|
|
||||||
def apply():
|
def apply(options, args):
|
||||||
proc = subprocess.run(['salt-call', 'state.apply', 'firewall', 'queue=True'])
|
proc = subprocess.run(['salt-call', 'state.apply', 'firewall', 'queue=True'])
|
||||||
return proc.returncode
|
return proc.returncode
|
||||||
|
|
||||||
@@ -356,7 +357,8 @@ def main():
|
|||||||
"addport": addport,
|
"addport": addport,
|
||||||
"removeport": removeport,
|
"removeport": removeport,
|
||||||
"addhostgroup": addhostgroup,
|
"addhostgroup": addhostgroup,
|
||||||
"addportgroup": addportgroup
|
"addportgroup": addportgroup,
|
||||||
|
"apply": apply
|
||||||
}
|
}
|
||||||
|
|
||||||
code=1
|
code=1
|
||||||
|
|||||||
75
salt/common/tools/sbin/so-fleet-user-update
Executable file
75
salt/common/tools/sbin/so-fleet-user-update
Executable file
@@ -0,0 +1,75 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
#
|
||||||
|
# Copyright 2014,2015,2016,2017,2018,2019,2020,2021 Security Onion Solutions, LLC
|
||||||
|
#
|
||||||
|
# This program is free software: you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation, either version 3 of the License, or
|
||||||
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
. /usr/sbin/so-common
|
||||||
|
|
||||||
|
usage() {
|
||||||
|
echo "Usage: $0 <user-name>"
|
||||||
|
echo ""
|
||||||
|
echo "Update password for an existing Fleet user. The new password will be read from STDIN."
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
if [ $# -ne 1 ]; then
|
||||||
|
usage
|
||||||
|
fi
|
||||||
|
|
||||||
|
USER=$1
|
||||||
|
|
||||||
|
MYSQL_PASS=$(lookup_pillar_secret mysql)
|
||||||
|
FLEET_IP=$(lookup_pillar fleet_ip)
|
||||||
|
FLEET_USER=$USER
|
||||||
|
|
||||||
|
# test existence of user
|
||||||
|
MYSQL_OUTPUT=$(docker exec so-mysql mysql -u root --password=$MYSQL_PASS fleet -e \
|
||||||
|
"SELECT count(1) FROM users WHERE username='$FLEET_USER'" 2>/dev/null | tail -1)
|
||||||
|
if [[ $? -ne 0 ]] || [[ $MYSQL_OUTPUT -ne 1 ]] ; then
|
||||||
|
echo "Test for username [${FLEET_USER}] failed"
|
||||||
|
echo " expect 1 hit in users database, return $MYSQL_OUTPUT hit(s)."
|
||||||
|
echo "Unable to update Fleet user password."
|
||||||
|
exit 2
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Read password for new user from stdin
|
||||||
|
test -t 0
|
||||||
|
if [[ $? == 0 ]]; then
|
||||||
|
echo "Enter new password:"
|
||||||
|
fi
|
||||||
|
read -rs FLEET_PASS
|
||||||
|
|
||||||
|
if ! check_password "$FLEET_PASS"; then
|
||||||
|
echo "Password is invalid. Please exclude single quotes, double quotes and backslashes from the password."
|
||||||
|
exit 2
|
||||||
|
fi
|
||||||
|
|
||||||
|
FLEET_HASH=$(docker exec so-soctopus python -c "import bcrypt; print(bcrypt.hashpw('$FLEET_PASS'.encode('utf-8'), bcrypt.gensalt()).decode('utf-8'));" 2>&1)
|
||||||
|
if [[ $? -ne 0 ]]; then
|
||||||
|
echo "Failed to generate Fleet password hash"
|
||||||
|
exit 2
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
MYSQL_OUTPUT=$(docker exec so-mysql mysql -u root --password=$MYSQL_PASS fleet -e \
|
||||||
|
"UPDATE users SET password='$FLEET_HASH', salt='' where username='$FLEET_USER'" 2>&1)
|
||||||
|
|
||||||
|
if [[ $? -eq 0 ]]; then
|
||||||
|
echo "Successfully updated Fleet user password"
|
||||||
|
else
|
||||||
|
echo "Unable to update Fleet user password"
|
||||||
|
echo "$MYSQL_OUTPUT"
|
||||||
|
exit 2
|
||||||
|
fi
|
||||||
17
salt/common/tools/sbin/so-grafana-dashboard-folder-delete
Executable file
17
salt/common/tools/sbin/so-grafana-dashboard-folder-delete
Executable file
@@ -0,0 +1,17 @@
|
|||||||
|
# this script is used to delete the default Grafana dashboard folders that existed prior to Grafana dashboard and Salt management changes in 2.3.70
|
||||||
|
|
||||||
|
folders=$(curl -X GET http://admin:{{salt['pillar.get']('secrets:grafana_admin')}}@localhost:3000/api/folders | jq -r '.[] | @base64')
|
||||||
|
delfolder=("Manager" "Manager Search" "Sensor Nodes" "Search Nodes" "Standalone" "Eval Mode")
|
||||||
|
|
||||||
|
for row in $folders; do
|
||||||
|
title=$(echo ${row} | base64 --decode | jq -r '.title')
|
||||||
|
uid=$(echo ${row} | base64 --decode | jq -r '.uid')
|
||||||
|
|
||||||
|
if [[ " ${delfolder[@]} " =~ " ${title} " ]]; then
|
||||||
|
curl -X DELETE http://admin:{{salt['pillar.get']('secrets:grafana_admin')}}@localhost:3000/api/folders/$uid
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
echo "so-grafana-dashboard-folder-delete has been run to delete default Grafana dashboard folders that existed prior to 2.3.70" > /opt/so/state/so-grafana-dashboard-folder-delete-complete
|
||||||
|
|
||||||
|
exit 0
|
||||||
@@ -18,6 +18,7 @@
|
|||||||
# NOTE: This script depends on so-common
|
# NOTE: This script depends on so-common
|
||||||
IMAGEREPO=security-onion-solutions
|
IMAGEREPO=security-onion-solutions
|
||||||
|
|
||||||
|
# shellcheck disable=SC2120
|
||||||
container_list() {
|
container_list() {
|
||||||
MANAGERCHECK=$1
|
MANAGERCHECK=$1
|
||||||
|
|
||||||
@@ -128,13 +129,13 @@ update_docker_containers() {
|
|||||||
mkdir -p $SIGNPATH >> "$LOG_FILE" 2>&1
|
mkdir -p $SIGNPATH >> "$LOG_FILE" 2>&1
|
||||||
|
|
||||||
# Let's make sure we have the public key
|
# Let's make sure we have the public key
|
||||||
retry 50 10 "curl -sSL https://raw.githubusercontent.com/Security-Onion-Solutions/securityonion/master/KEYS -o $SIGNPATH/KEYS" >> "$LOG_FILE" 2>&1
|
run_check_net_err \
|
||||||
|
"curl --retry 5 --retry-delay 60 -sSL https://raw.githubusercontent.com/Security-Onion-Solutions/securityonion/master/KEYS -o $SIGNPATH/KEYS" \
|
||||||
|
"Could not pull signature key file, please ensure connectivity to https://raw.gihubusercontent.com" \
|
||||||
|
noretry >> "$LOG_FILE" 2>&1
|
||||||
result=$?
|
result=$?
|
||||||
if [[ $result -eq 0 ]]; then
|
if [[ $result -eq 0 ]]; then
|
||||||
cat $SIGNPATH/KEYS | gpg --import - >> "$LOG_FILE" 2>&1
|
cat $SIGNPATH/KEYS | gpg --import - >> "$LOG_FILE" 2>&1
|
||||||
else
|
|
||||||
echo "Failed to pull signature key file: $result"
|
|
||||||
exit 1
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Download the containers from the interwebs
|
# Download the containers from the interwebs
|
||||||
@@ -148,14 +149,15 @@ update_docker_containers() {
|
|||||||
|
|
||||||
# Pull down the trusted docker image
|
# Pull down the trusted docker image
|
||||||
local image=$i:$VERSION$IMAGE_TAG_SUFFIX
|
local image=$i:$VERSION$IMAGE_TAG_SUFFIX
|
||||||
retry 50 10 "docker pull $CONTAINER_REGISTRY/$IMAGEREPO/$image" >> "$LOG_FILE" 2>&1
|
run_check_net_err \
|
||||||
|
"docker pull $CONTAINER_REGISTRY/$IMAGEREPO/$image" \
|
||||||
|
"Could not pull $image, please ensure connectivity to $CONTAINER_REGISTRY" >> "$LOG_FILE" 2>&1
|
||||||
|
|
||||||
# Get signature
|
# Get signature
|
||||||
retry 50 10 "curl -A '$CURLTYPE/$CURRENTVERSION/$OS/$(uname -r)' https://sigs.securityonion.net/$VERSION/$i:$VERSION$IMAGE_TAG_SUFFIX.sig --output $SIGNPATH/$image.sig" >> "$LOG_FILE" 2>&1
|
run_check_net_err \
|
||||||
if [[ $? -ne 0 ]]; then
|
"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" \
|
||||||
echo "Unable to pull signature file for $image" >> "$LOG_FILE" 2>&1
|
"Could not pull signature file for $image, please ensure connectivity to https://sigs.securityonion.net " \
|
||||||
exit 1
|
noretry >> "$LOG_FILE" 2>&1
|
||||||
fi
|
|
||||||
# Dump our hash values
|
# Dump our hash values
|
||||||
DOCKERINSPECT=$(docker inspect $CONTAINER_REGISTRY/$IMAGEREPO/$image)
|
DOCKERINSPECT=$(docker inspect $CONTAINER_REGISTRY/$IMAGEREPO/$image)
|
||||||
|
|
||||||
|
|||||||
58
salt/common/tools/sbin/so-image-pull
Executable file
58
salt/common/tools/sbin/so-image-pull
Executable file
@@ -0,0 +1,58 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
#
|
||||||
|
# Copyright 2014,2015,2016,2017,2018,2019,2020,2021 Security Onion Solutions, LLC
|
||||||
|
#
|
||||||
|
# This program is free software: you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation, either version 3 of the License, or
|
||||||
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
. /usr/sbin/so-common
|
||||||
|
. /usr/sbin/so-image-common
|
||||||
|
|
||||||
|
usage() {
|
||||||
|
read -r -d '' message <<- EOM
|
||||||
|
usage: so-image-pull [-h] IMAGE [IMAGE ...]
|
||||||
|
|
||||||
|
positional arguments:
|
||||||
|
IMAGE One or more 'so-' prefixed images to download and verify.
|
||||||
|
|
||||||
|
optional arguments:
|
||||||
|
-h, --help Show this help message and exit.
|
||||||
|
EOM
|
||||||
|
echo "$message"
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
for arg; do
|
||||||
|
shift
|
||||||
|
[[ "$arg" = "--quiet" || "$arg" = "-q" ]] && quiet=true && continue
|
||||||
|
set -- "$@" "$arg"
|
||||||
|
done
|
||||||
|
|
||||||
|
if [[ $# -eq 0 || $# -gt 1 ]] || [[ $1 == '-h' || $1 == '--help' ]]; then
|
||||||
|
usage
|
||||||
|
fi
|
||||||
|
|
||||||
|
TRUSTED_CONTAINERS=("$@")
|
||||||
|
set_version
|
||||||
|
|
||||||
|
for image in "${TRUSTED_CONTAINERS[@]}"; do
|
||||||
|
if ! docker images | grep "$image" | grep ":5000" | grep -q "$VERSION"; then
|
||||||
|
if [[ $quiet == true ]]; then
|
||||||
|
update_docker_containers "$image" "" "" "/dev/null"
|
||||||
|
else
|
||||||
|
update_docker_containers "$image" "" "" ""
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo "$image:$VERSION image exists."
|
||||||
|
fi
|
||||||
|
done
|
||||||
@@ -132,6 +132,8 @@ for PCAP in "$@"; do
|
|||||||
PCAP_FIXED=`mktemp /tmp/so-import-pcap-XXXXXXXXXX.pcap`
|
PCAP_FIXED=`mktemp /tmp/so-import-pcap-XXXXXXXXXX.pcap`
|
||||||
echo "- attempting to recover corrupted PCAP file"
|
echo "- attempting to recover corrupted PCAP file"
|
||||||
pcapfix "${PCAP}" "${PCAP_FIXED}"
|
pcapfix "${PCAP}" "${PCAP_FIXED}"
|
||||||
|
# Make fixed file world readable since the Suricata docker container will runas a non-root user
|
||||||
|
chmod a+r "${PCAP_FIXED}"
|
||||||
PCAP="${PCAP_FIXED}"
|
PCAP="${PCAP_FIXED}"
|
||||||
TEMP_PCAPS+=(${PCAP_FIXED})
|
TEMP_PCAPS+=(${PCAP_FIXED})
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -15,4 +15,4 @@
|
|||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
curl -X GET -k -L "https://localhost:9200/_cat/indices?v&s=index"
|
{{ ELASTICCURL }} -X GET -k -L "https://localhost:9200/_cat/indices?v&s=index"
|
||||||
|
|||||||
53
salt/common/tools/sbin/so-influxdb-clean
Executable file
53
salt/common/tools/sbin/so-influxdb-clean
Executable file
@@ -0,0 +1,53 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Copyright 2014,2015,2016,2017,2018,2019,2020,2021 Security Onion Solutions, LLC
|
||||||
|
#
|
||||||
|
# This program is free software: you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation, either version 3 of the License, or
|
||||||
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
. /usr/sbin/so-common
|
||||||
|
|
||||||
|
wdurregex="^[0-9]+w$"
|
||||||
|
ddurregex="^[0-9]+d$"
|
||||||
|
|
||||||
|
echo -e "\nThis script is used to reduce the size of InfluxDB by removing old data and retaining only the duration specified."
|
||||||
|
echo "The duration will need to be specified as an integer followed by the duration unit without a space."
|
||||||
|
echo -e "\nFor example, to purge all data but retain the past 12 weeks, specify 12w for the duration."
|
||||||
|
echo "The duration units are as follows:"
|
||||||
|
echo " w - week(s)"
|
||||||
|
echo " d - day(s)"
|
||||||
|
|
||||||
|
while true; do
|
||||||
|
echo ""
|
||||||
|
read -p 'Enter the duration of past data that you would like to retain: ' duration
|
||||||
|
duration=$(echo $duration | tr '[:upper:]' '[:lower:]')
|
||||||
|
|
||||||
|
if [[ "$duration" =~ $wdurregex ]] || [[ "$duration" =~ $ddurregex ]]; then
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo -e "\nInvalid duration."
|
||||||
|
done
|
||||||
|
|
||||||
|
echo -e "\nInfluxDB will now be cleaned and leave only the past $duration worth of data."
|
||||||
|
read -r -p "Are you sure you want to continue? [y/N] " yorn
|
||||||
|
if [[ "$yorn" =~ ^([yY][eE][sS]|[yY])$ ]]; then
|
||||||
|
echo -e "\nCleaning InfluxDb and saving only the past $duration. This may could take several minutes depending on how much data needs to be cleaned."
|
||||||
|
if docker exec -t so-influxdb /bin/bash -c "influx -ssl -unsafeSsl -database telegraf -execute \"DELETE FROM /.*/ WHERE \"time\" >= '2020-01-01T00:00:00.0000000Z' AND \"time\" <= now() - $duration\""; then
|
||||||
|
echo -e "\nInfluxDb clean complete."
|
||||||
|
else
|
||||||
|
echo -e "\nSomething went wrong with cleaning InfluxDB. Please verify that the so-influxdb Docker container is running, and check the log at /opt/so/log/influxdb/influxdb.log for any details."
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo -e "\nExiting as requested."
|
||||||
|
fi
|
||||||
63
salt/common/tools/sbin/so-influxdb-downsample
Executable file
63
salt/common/tools/sbin/so-influxdb-downsample
Executable file
@@ -0,0 +1,63 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Copyright 2014,2015,2016,2017,2018,2019,2020,2021 Security Onion Solutions, LLC
|
||||||
|
#
|
||||||
|
# This program is free software: you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation, either version 3 of the License, or
|
||||||
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
{%- set role = grains.id.split('_') | last %}
|
||||||
|
{%- if role in ['manager', 'managersearch', 'eval', 'standalone'] %}
|
||||||
|
{%- import_yaml 'influxdb/defaults.yaml' as default_settings %}
|
||||||
|
{%- set influxdb = salt['grains.filter_by'](default_settings, default='influxdb', merge=salt['pillar.get']('influxdb', {})) %}
|
||||||
|
|
||||||
|
. /usr/sbin/so-common
|
||||||
|
|
||||||
|
echo -e "\nThis script is used to reduce the size of InfluxDB by downsampling old data into the so_long_term retention policy."
|
||||||
|
|
||||||
|
echo -e "\nInfluxDB will now be downsampled. This could take a few hours depending on how large the database is and hardware resources available."
|
||||||
|
read -r -p "Are you sure you want to continue? [y/N] " yorn
|
||||||
|
if [[ "$yorn" =~ ^([yY][eE][sS]|[yY])$ ]]; then
|
||||||
|
echo -e "\nDownsampling InfluxDb started at `date`. This may take several hours depending on how much data needs to be downsampled."
|
||||||
|
|
||||||
|
{% for dest_rp in influxdb.downsample.keys() -%}
|
||||||
|
{% for measurement in influxdb.downsample[dest_rp].get('measurements', []) -%}
|
||||||
|
|
||||||
|
day=0
|
||||||
|
startdate=`date`
|
||||||
|
while docker exec -t so-influxdb /bin/bash -c "influx -ssl -unsafeSsl -database telegraf -execute \"SELECT mean(*) INTO \"so_long_term\".\"{{measurement}}\" FROM \"autogen\".\"{{measurement}}\" WHERE \"time\" >= '2020-07-21T00:00:00.0000000Z' + ${day}d AND \"time\" <= '2020-07-21T00:00:00.0000000Z' + $((day+1))d GROUP BY time(5m),*\""; do
|
||||||
|
# why 2020-07-21?
|
||||||
|
migrationdate=`date -d "2020-07-21 + ${day} days" +"%y-%m-%d"`
|
||||||
|
|
||||||
|
echo "Downsampling of measurement: {{measurement}} from $migrationdate started at $startdate and completed at `date`."
|
||||||
|
|
||||||
|
newdaytomigrate=$(date -d "$migrationdate + 1 days" +"%s")
|
||||||
|
today=$(date +"%s")
|
||||||
|
if [ $newdaytomigrate -ge $today ]; then
|
||||||
|
break
|
||||||
|
else
|
||||||
|
((day=day+1))
|
||||||
|
startdate=`date`
|
||||||
|
echo -e "\nDownsampling the next day's worth of data for measurement: {{measurement}}."
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
{% endfor -%}
|
||||||
|
{% endfor -%}
|
||||||
|
|
||||||
|
echo -e "\nInfluxDb data downsampling complete."
|
||||||
|
|
||||||
|
else
|
||||||
|
echo -e "\nExiting as requested."
|
||||||
|
fi
|
||||||
|
{%- else %}
|
||||||
|
echo -e "\nThis script can only be run on a node running InfluxDB."
|
||||||
|
{%- endif %}
|
||||||
34
salt/common/tools/sbin/so-influxdb-drop-autogen
Executable file
34
salt/common/tools/sbin/so-influxdb-drop-autogen
Executable file
@@ -0,0 +1,34 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Copyright 2014,2015,2016,2017,2018,2019,2020,2021 Security Onion Solutions, LLC
|
||||||
|
#
|
||||||
|
# This program is free software: you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation, either version 3 of the License, or
|
||||||
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
. /usr/sbin/so-common
|
||||||
|
|
||||||
|
echo -e "\nThis script is used to reduce the size of InfluxDB by dropping the autogen retention policy."
|
||||||
|
echo "If you want to retain historical data prior to 2.3.60, then this should only be run after you have downsampled your data using so-influxdb-downsample."
|
||||||
|
|
||||||
|
echo -e "\nThe autogen retention policy will now be dropped from InfluxDB."
|
||||||
|
read -r -p "Are you sure you want to continue? [y/N] " yorn
|
||||||
|
if [[ "$yorn" =~ ^([yY][eE][sS]|[yY])$ ]]; then
|
||||||
|
echo -e "\nDropping autogen retention policy."
|
||||||
|
if docker exec -t so-influxdb influx -format json -ssl -unsafeSsl -execute "drop retention policy autogen on telegraf"; then
|
||||||
|
echo -e "\nAutogen retention policy dropped from InfluxDb."
|
||||||
|
else
|
||||||
|
echo -e "\nSomething went wrong dropping then autogen retention policy from InfluxDB. Please verify that the so-influxdb Docker container is running, and check the log at /opt/so/log/influxdb/influxdb.log for any details."
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo -e "\nExiting as requested."
|
||||||
|
fi
|
||||||
@@ -23,7 +23,9 @@
|
|||||||
KIBANA_HOST={{ MANAGER }}
|
KIBANA_HOST={{ MANAGER }}
|
||||||
KSO_PORT=5601
|
KSO_PORT=5601
|
||||||
OUTFILE="saved_objects.ndjson"
|
OUTFILE="saved_objects.ndjson"
|
||||||
curl -s -H 'kbn-xsrf: true' -H 'Content-Type: application/json' -XPOST -L $KIBANA_HOST:$KSO_PORT/api/saved_objects/_export -d '{ "type": [ "index-pattern", "config", "visualization", "dashboard", "search" ], "excludeExportDetails": false }' > $OUTFILE
|
|
||||||
|
SESSIONCOOKIE=$({{ ELASTICCURL }} -c - -X GET http://$KIBANA_HOST:$KSO_PORT/ | grep sid | awk '{print $7}')
|
||||||
|
{{ ELASTICCURL }} -b "sid=$SESSIONCOOKIE" -s -H 'kbn-xsrf: true' -H 'Content-Type: application/json' -XPOST -L $KIBANA_HOST:$KSO_PORT/api/saved_objects/_export -d '{ "type": [ "index-pattern", "config", "visualization", "dashboard", "search" ], "excludeExportDetails": false }' > $OUTFILE
|
||||||
|
|
||||||
# Clean up using PLACEHOLDER
|
# Clean up using PLACEHOLDER
|
||||||
sed -i "s/$KIBANA_HOST/PLACEHOLDER/g" $OUTFILE
|
sed -i "s/$KIBANA_HOST/PLACEHOLDER/g" $OUTFILE
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
. /usr/sbin/so-common
|
. /usr/sbin/so-common
|
||||||
|
|
||||||
wait_for_web_response "http://localhost:5601/app/kibana" "Elastic"
|
wait_for_web_response "http://localhost:5601/app/kibana" "Elastic" 300 "{{ ELASTICCURL }}"
|
||||||
## This hackery will be removed if using Elastic Auth ##
|
## This hackery will be removed if using Elastic Auth ##
|
||||||
|
|
||||||
# Let's snag a cookie from Kibana
|
# Let's snag a cookie from Kibana
|
||||||
THECOOKIE=$(curl -c - -X GET http://localhost:5601/ | grep sid | awk '{print $7}')
|
SESSIONCOOKIE=$({{ ELASTICCURL }} -c - -X GET http://localhost:5601/ | grep sid | awk '{print $7}')
|
||||||
|
|
||||||
# Disable certain Features from showing up in the Kibana UI
|
# Disable certain Features from showing up in the Kibana UI
|
||||||
echo
|
echo
|
||||||
echo "Setting up default Space:"
|
echo "Setting up default Space:"
|
||||||
curl -b "sid=$THECOOKIE" -L -X PUT "localhost:5601/api/spaces/space/default" -H 'kbn-xsrf: true' -H 'Content-Type: application/json' -d' {"id":"default","name":"Default","disabledFeatures":["ml","enterpriseSearch","siem","logs","infrastructure","apm","uptime","monitoring","stackAlerts","actions","fleet"]} ' >> /opt/so/log/kibana/misc.log
|
{{ ELASTICCURL }} -b "sid=$SESSIONCOOKIE" -L -X PUT "localhost:5601/api/spaces/space/default" -H 'kbn-xsrf: true' -H 'Content-Type: application/json' -d' {"id":"default","name":"Default","disabledFeatures":["ml","enterpriseSearch","siem","logs","infrastructure","apm","uptime","monitoring","stackAlerts","actions","fleet"]} ' >> /opt/so/log/kibana/misc.log
|
||||||
echo
|
echo
|
||||||
303
salt/common/tools/sbin/so-learn
Executable file
303
salt/common/tools/sbin/so-learn
Executable file
@@ -0,0 +1,303 @@
|
|||||||
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
|
# Copyright 2014,2015,2016,2017,2018,2019,2020,2021 Security Onion Solutions, LLC
|
||||||
|
#
|
||||||
|
# This program is free software: you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation, either version 3 of the License, or
|
||||||
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
from itertools import chain
|
||||||
|
from typing import List
|
||||||
|
|
||||||
|
import signal
|
||||||
|
import sys
|
||||||
|
import os
|
||||||
|
import re
|
||||||
|
import subprocess
|
||||||
|
import argparse
|
||||||
|
import textwrap
|
||||||
|
import yaml
|
||||||
|
import multiprocessing
|
||||||
|
import docker
|
||||||
|
import pty
|
||||||
|
|
||||||
|
minion_pillar_dir = '/opt/so/saltstack/local/pillar/minions'
|
||||||
|
so_status_conf = '/opt/so/conf/so-status/so-status.conf'
|
||||||
|
proc: subprocess.CompletedProcess = None
|
||||||
|
|
||||||
|
# Temp store of modules, will likely be broken out into salt
|
||||||
|
def get_learn_modules():
|
||||||
|
return {
|
||||||
|
'logscan': { 'cpu_period': get_cpu_period(fraction=0.25), 'enabled': False, 'description': 'Scan log files against pre-trained models to alert on anomalies.' }
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
def get_cpu_period(fraction: float):
|
||||||
|
multiplier = 10000
|
||||||
|
|
||||||
|
num_cores = multiprocessing.cpu_count()
|
||||||
|
if num_cores <= 2:
|
||||||
|
fraction = 1.
|
||||||
|
|
||||||
|
num_used_cores = int(num_cores * fraction)
|
||||||
|
cpu_period = num_used_cores * multiplier
|
||||||
|
return cpu_period
|
||||||
|
|
||||||
|
|
||||||
|
def sigint_handler(*_):
|
||||||
|
print('Exiting gracefully on Ctrl-C')
|
||||||
|
if proc is not None: proc.send_signal(signal.SIGINT)
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
|
|
||||||
|
def find_minion_pillar() -> str:
|
||||||
|
regex = '^.*_(manager|managersearch|standalone|import|eval)\.sls$'
|
||||||
|
|
||||||
|
result = []
|
||||||
|
for root, _, files in os.walk(minion_pillar_dir):
|
||||||
|
for f_minion_id in files:
|
||||||
|
if re.search(regex, f_minion_id):
|
||||||
|
result.append(os.path.join(root, f_minion_id))
|
||||||
|
|
||||||
|
if len(result) == 0:
|
||||||
|
print('Could not find manager-type pillar (eval, standalone, manager, managersearch, import). Are you running this script on the manager?', file=sys.stderr)
|
||||||
|
sys.exit(3)
|
||||||
|
elif len(result) > 1:
|
||||||
|
res_str = ', '.join(f'\"{result}\"')
|
||||||
|
print('(This should not happen, the system is in an error state if you see this message.)\n', file=sys.stderr)
|
||||||
|
print('More than one manager-type pillar exists, minion id\'s listed below:', file=sys.stderr)
|
||||||
|
print(f' {res_str}', file=sys.stderr)
|
||||||
|
sys.exit(3)
|
||||||
|
else:
|
||||||
|
return result[0]
|
||||||
|
|
||||||
|
|
||||||
|
def read_pillar(pillar: str):
|
||||||
|
try:
|
||||||
|
with open(pillar, 'r') as pillar_file:
|
||||||
|
loaded_yaml = yaml.safe_load(pillar_file.read())
|
||||||
|
if loaded_yaml is None:
|
||||||
|
print(f'Could not parse {pillar}', file=sys.stderr)
|
||||||
|
sys.exit(3)
|
||||||
|
return loaded_yaml
|
||||||
|
except:
|
||||||
|
print(f'Could not open {pillar}', file=sys.stderr)
|
||||||
|
sys.exit(3)
|
||||||
|
|
||||||
|
|
||||||
|
def write_pillar(pillar: str, content: dict):
|
||||||
|
try:
|
||||||
|
with open(pillar, 'w') as pillar_file:
|
||||||
|
yaml.dump(content, pillar_file, default_flow_style=False)
|
||||||
|
except:
|
||||||
|
print(f'Could not open {pillar}', file=sys.stderr)
|
||||||
|
sys.exit(3)
|
||||||
|
|
||||||
|
|
||||||
|
def mod_so_status(action: str, item: str):
|
||||||
|
with open(so_status_conf, 'a+') as conf:
|
||||||
|
conf.seek(0)
|
||||||
|
containers = conf.readlines()
|
||||||
|
|
||||||
|
if f'so-{item}\n' in containers:
|
||||||
|
if action == 'remove': containers.remove(f'so-{item}\n')
|
||||||
|
if action == 'add': pass
|
||||||
|
else:
|
||||||
|
if action == 'remove': pass
|
||||||
|
if action == 'add': containers.append(f'so-{item}\n')
|
||||||
|
|
||||||
|
[containers.remove(c_name) for c_name in containers if c_name == '\n'] # remove extra newlines
|
||||||
|
|
||||||
|
conf.seek(0)
|
||||||
|
conf.truncate(0)
|
||||||
|
conf.writelines(containers)
|
||||||
|
|
||||||
|
|
||||||
|
def create_pillar_if_not_exist(pillar:str, content: dict):
|
||||||
|
pillar_dict = content
|
||||||
|
|
||||||
|
if pillar_dict.get('learn', {}).get('modules') is None:
|
||||||
|
pillar_dict['learn'] = {}
|
||||||
|
pillar_dict['learn']['modules'] = get_learn_modules()
|
||||||
|
content.update()
|
||||||
|
write_pillar(pillar, content)
|
||||||
|
|
||||||
|
return content
|
||||||
|
|
||||||
|
|
||||||
|
def salt_call(module: str):
|
||||||
|
salt_cmd = ['salt-call', 'state.apply', '-l', 'quiet', f'learn.{module}', 'queue=True']
|
||||||
|
|
||||||
|
print(f' Applying salt state for {module} module...')
|
||||||
|
proc = subprocess.run(salt_cmd, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
|
||||||
|
return_code = proc.returncode
|
||||||
|
if return_code != 0:
|
||||||
|
print(f' [ERROR] Failed to apply salt state for {module} module.')
|
||||||
|
|
||||||
|
return return_code
|
||||||
|
|
||||||
|
|
||||||
|
def pull_image(module: str):
|
||||||
|
container_basename = f'so-{module}'
|
||||||
|
|
||||||
|
client = docker.from_env()
|
||||||
|
image_list = client.images.list(filters={ 'dangling': False })
|
||||||
|
tag_list = list(chain.from_iterable(list(map(lambda x: x.attrs.get('RepoTags'), image_list))))
|
||||||
|
basename_match = list(filter(lambda x: f'{container_basename}' in x, tag_list))
|
||||||
|
local_registry_match = list(filter(lambda x: ':5000' in x, basename_match))
|
||||||
|
|
||||||
|
if len(local_registry_match) == 0:
|
||||||
|
print(f'Pulling and verifying missing image for {module} (may take several minutes) ...')
|
||||||
|
pull_command = ['so-image-pull', '--quiet', container_basename]
|
||||||
|
|
||||||
|
proc = subprocess.run(pull_command, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
|
||||||
|
return_code = proc.returncode
|
||||||
|
if return_code != 0:
|
||||||
|
print(f'[ERROR] Failed to pull image so-{module}, skipping state.')
|
||||||
|
else:
|
||||||
|
return_code = 0
|
||||||
|
return return_code
|
||||||
|
|
||||||
|
|
||||||
|
def apply(module_list: List):
|
||||||
|
return_code = 0
|
||||||
|
for module in module_list:
|
||||||
|
salt_ret = salt_call(module)
|
||||||
|
# Only update return_code if the command returned a non-zero return
|
||||||
|
if salt_ret != 0:
|
||||||
|
return_code = salt_ret
|
||||||
|
|
||||||
|
return return_code
|
||||||
|
|
||||||
|
|
||||||
|
def check_apply(args: dict):
|
||||||
|
if args.apply:
|
||||||
|
print('Configuration updated. Applying changes:')
|
||||||
|
return apply(args.modules)
|
||||||
|
else:
|
||||||
|
message = 'Configuration updated. Would you like to apply your changes now? (y/N) '
|
||||||
|
answer = input(message)
|
||||||
|
while answer.lower() not in [ 'y', 'n', '' ]:
|
||||||
|
answer = input(message)
|
||||||
|
if answer.lower() in [ 'n', '' ]:
|
||||||
|
return 0
|
||||||
|
else:
|
||||||
|
print('Applying changes:')
|
||||||
|
return apply(args.modules)
|
||||||
|
|
||||||
|
|
||||||
|
def enable_disable_modules(args, enable: bool):
|
||||||
|
pillar_modules = args.pillar_dict.get('learn', {}).get('modules')
|
||||||
|
pillar_mod_names = args.pillar_dict.get('learn', {}).get('modules').keys()
|
||||||
|
|
||||||
|
action_str = 'add' if enable else 'remove'
|
||||||
|
|
||||||
|
if 'all' in args.modules:
|
||||||
|
for module, details in pillar_modules.items():
|
||||||
|
details['enabled'] = enable
|
||||||
|
mod_so_status(action_str, module)
|
||||||
|
if enable: pull_image(module)
|
||||||
|
args.pillar_dict.update()
|
||||||
|
write_pillar(args.pillar, args.pillar_dict)
|
||||||
|
else:
|
||||||
|
write_needed = False
|
||||||
|
for module in args.modules:
|
||||||
|
if module in pillar_mod_names:
|
||||||
|
if pillar_modules[module]['enabled'] == enable:
|
||||||
|
state_str = 'enabled' if enable else 'disabled'
|
||||||
|
print(f'{module} module already {state_str}.', file=sys.stderr)
|
||||||
|
else:
|
||||||
|
if enable and pull_image(module) != 0:
|
||||||
|
continue
|
||||||
|
pillar_modules[module]['enabled'] = enable
|
||||||
|
mod_so_status(action_str, module)
|
||||||
|
write_needed = True
|
||||||
|
if write_needed:
|
||||||
|
args.pillar_dict.update()
|
||||||
|
write_pillar(args.pillar, args.pillar_dict)
|
||||||
|
|
||||||
|
cmd_ret = check_apply(args)
|
||||||
|
return cmd_ret
|
||||||
|
|
||||||
|
|
||||||
|
def enable_modules(args):
|
||||||
|
enable_disable_modules(args, enable=True)
|
||||||
|
|
||||||
|
|
||||||
|
def disable_modules(args):
|
||||||
|
enable_disable_modules(args, enable=False)
|
||||||
|
|
||||||
|
|
||||||
|
def list_modules(*_):
|
||||||
|
print('Available ML modules:')
|
||||||
|
for module, details in get_learn_modules().items():
|
||||||
|
print(f' - { module } : {details["description"]}')
|
||||||
|
return 0
|
||||||
|
|
||||||
|
|
||||||
|
def main():
|
||||||
|
beta_str = 'BETA - SUBJECT TO CHANGE\n'
|
||||||
|
|
||||||
|
apply_help='After ACTION the chosen modules, apply any necessary salt states.'
|
||||||
|
enable_apply_help = apply_help.replace('ACTION', 'enabling')
|
||||||
|
disable_apply_help = apply_help.replace('ACTION', 'disabling')
|
||||||
|
|
||||||
|
signal.signal(signal.SIGINT, sigint_handler)
|
||||||
|
|
||||||
|
if os.geteuid() != 0:
|
||||||
|
print('You must run this script as root', file=sys.stderr)
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
|
main_parser = argparse.ArgumentParser(formatter_class=argparse.RawDescriptionHelpFormatter)
|
||||||
|
|
||||||
|
subcommand_desc = textwrap.dedent(
|
||||||
|
"""\
|
||||||
|
enable Enable one or more ML modules.
|
||||||
|
disable Disable one or more ML modules.
|
||||||
|
list List all available ML modules.
|
||||||
|
"""
|
||||||
|
)
|
||||||
|
|
||||||
|
subparsers = main_parser.add_subparsers(title='commands', description=subcommand_desc, metavar='', dest='command')
|
||||||
|
|
||||||
|
module_help_str = 'One or more ML modules, which can be listed using \'so-learn list\'. Use the keyword \'all\' to apply the action to all available modules.'
|
||||||
|
|
||||||
|
enable = subparsers.add_parser('enable')
|
||||||
|
enable.set_defaults(func=enable_modules)
|
||||||
|
enable.add_argument('modules', metavar='ML_MODULE', nargs='+', help=module_help_str)
|
||||||
|
enable.add_argument('--apply', action='store_const', const=True, required=False, help=enable_apply_help)
|
||||||
|
|
||||||
|
disable = subparsers.add_parser('disable')
|
||||||
|
disable.set_defaults(func=disable_modules)
|
||||||
|
disable.add_argument('modules', metavar='ML_MODULE', nargs='+', help=module_help_str)
|
||||||
|
disable.add_argument('--apply', action='store_const', const=True, required=False, help=disable_apply_help)
|
||||||
|
|
||||||
|
list = subparsers.add_parser('list')
|
||||||
|
list.set_defaults(func=list_modules)
|
||||||
|
|
||||||
|
args = main_parser.parse_args(sys.argv[1:])
|
||||||
|
args.pillar = find_minion_pillar()
|
||||||
|
args.pillar_dict = create_pillar_if_not_exist(args.pillar, read_pillar(args.pillar))
|
||||||
|
|
||||||
|
if hasattr(args, 'func'):
|
||||||
|
exit_code = args.func(args)
|
||||||
|
else:
|
||||||
|
if args.command is None:
|
||||||
|
print(beta_str)
|
||||||
|
main_parser.print_help()
|
||||||
|
sys.exit(0)
|
||||||
|
|
||||||
|
sys.exit(exit_code)
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
main()
|
||||||
23
salt/common/tools/sbin/so-airgap-hotfixdownload → salt/common/tools/sbin/so-pcap-export
Normal file → Executable file
23
salt/common/tools/sbin/so-airgap-hotfixdownload → salt/common/tools/sbin/so-pcap-export
Normal file → Executable file
@@ -1,5 +1,5 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
#
|
||||||
# Copyright 2014,2015,2016,2017,2018,2019,2020,2021 Security Onion Solutions, LLC
|
# Copyright 2014,2015,2016,2017,2018,2019,2020,2021 Security Onion Solutions, LLC
|
||||||
#
|
#
|
||||||
# This program is free software: you can redistribute it and/or modify
|
# This program is free software: you can redistribute it and/or modify
|
||||||
@@ -15,19 +15,12 @@
|
|||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
# Get the latest code
|
if [ $# -lt 2 ]; then
|
||||||
rm -rf /tmp/sohotfix
|
echo "Usage: $0 <steno-query> Output-Filename"
|
||||||
mkdir -p /tmp/sohotfix
|
|
||||||
cd /tmp/sohotfix
|
|
||||||
git clone https://github.com/Security-Onion-Solutions/securityonion
|
|
||||||
if [ ! -d "/tmp/sohotfix/securityonion" ]; then
|
|
||||||
echo "I was unable to get the latest code. Check your internet and try again."
|
|
||||||
exit 1
|
exit 1
|
||||||
else
|
|
||||||
echo "Looks like we have the code lets create the tarball."
|
|
||||||
cd /tmp/sohotfix/securityonion
|
|
||||||
tar cvf /tmp/sohotfix/sohotfix.tar HOTFIX VERSION salt pillar
|
|
||||||
echo ""
|
|
||||||
echo "Copy /tmp/sohotfix/sohotfix.tar to portable media and then copy it to your airgap manager."
|
|
||||||
exit 0
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
docker exec -it so-sensoroni scripts/stenoquery.sh "$1" -w /nsm/pcapout/$2.pcap
|
||||||
|
|
||||||
|
echo ""
|
||||||
|
echo "If successful, the output was written to: /nsm/pcapout/$2.pcap"
|
||||||
@@ -22,5 +22,5 @@ salt-call state.apply playbook.db_init,playbook,playbook.automation_user_create
|
|||||||
/usr/sbin/so-soctopus-restart
|
/usr/sbin/so-soctopus-restart
|
||||||
|
|
||||||
echo "Importing Plays - this will take some time...."
|
echo "Importing Plays - this will take some time...."
|
||||||
wait 5
|
sleep 5
|
||||||
/usr/sbin/so-playbook-ruleupdate
|
/usr/sbin/so-playbook-ruleupdate
|
||||||
@@ -17,67 +17,98 @@
|
|||||||
|
|
||||||
. /usr/sbin/so-common
|
. /usr/sbin/so-common
|
||||||
|
|
||||||
#check_boss_raid() {
|
appliance_check() {
|
||||||
# BOSSBIN=/opt/boss/mvcli
|
{%- if salt['grains.get']('sosmodel', '') %}
|
||||||
# BOSSRC=$($BOSSBIN info -o vd | grep functional)
|
APPLIANCE=1
|
||||||
#
|
DUDEYOUGOTADELL=$(dmidecode |grep Dell)
|
||||||
# if [[ $BOSSRC ]]; then
|
if [[ -n $DUDEYOUGOTADELL ]]; then
|
||||||
# # Raid is good
|
APPTYPE=dell
|
||||||
# BOSSRAID=0
|
|
||||||
# else
|
|
||||||
# BOSSRAID=1
|
|
||||||
# fi
|
|
||||||
#}
|
|
||||||
|
|
||||||
check_lsi_raid() {
|
|
||||||
# For use for LSI on Ubuntu
|
|
||||||
#MEGA=/opt/MegaRAID/MegeCli/MegaCli64
|
|
||||||
#LSIRC=$($MEGA -LDInfo -Lall -aALL | grep Optimal)
|
|
||||||
# Open Source Centos
|
|
||||||
MEGA=/opt/mega/megasasctl
|
|
||||||
LSIRC=$($MEGA | grep optimal)
|
|
||||||
|
|
||||||
if [[ $LSIRC ]]; then
|
|
||||||
# Raid is good
|
|
||||||
LSIRAID=0
|
|
||||||
else
|
else
|
||||||
LSIRAID=1
|
APPTYPE=sm
|
||||||
|
fi
|
||||||
|
mkdir -p /opt/so/log/raid
|
||||||
|
|
||||||
|
{%- else %}
|
||||||
|
echo "This is not an appliance"
|
||||||
|
exit 0
|
||||||
|
{%- endif %}
|
||||||
|
}
|
||||||
|
|
||||||
|
check_nsm_raid() {
|
||||||
|
PERCCLI=$(/opt/raidtools/perccli/perccli64 /c0/v0 show|grep RAID|grep Optl)
|
||||||
|
MEGACTL=$(/opt/raidtools/megasasctl |grep optimal)
|
||||||
|
|
||||||
|
if [[ $APPLIANCE == '1' ]]; then
|
||||||
|
if [[ -n $PERCCLI ]]; then
|
||||||
|
HWRAID=0
|
||||||
|
elif [[ -n $MEGACTL ]]; then
|
||||||
|
HWRAID=0
|
||||||
|
else
|
||||||
|
HWRAID=1
|
||||||
|
fi
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
check_boss_raid() {
|
||||||
|
MVCLI=$(/usr/local/bin/mvcli info -o vd |grep status |grep functional)
|
||||||
|
|
||||||
|
if [[ -n $DUDEYOUGOTADELL ]]; then
|
||||||
|
if [[ -n $MVCLI ]]; then
|
||||||
|
BOSSRAID=0
|
||||||
|
else
|
||||||
|
BOSSRAID=1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
check_software_raid() {
|
check_software_raid() {
|
||||||
|
if [[ -n $DUDEYOUGOTADELL ]]; then
|
||||||
SWRC=$(grep "_" /proc/mdstat)
|
SWRC=$(grep "_" /proc/mdstat)
|
||||||
|
|
||||||
if [[ $SWRC ]]; then
|
if [[ -n $SWRC ]]; then
|
||||||
# RAID is failed in some way
|
# RAID is failed in some way
|
||||||
SWRAID=1
|
SWRAID=1
|
||||||
else
|
else
|
||||||
SWRAID=0
|
SWRAID=0
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# This script checks raid status if you use SO appliances
|
# This script checks raid status if you use SO appliances
|
||||||
|
|
||||||
# See if this is an appliance
|
# See if this is an appliance
|
||||||
|
|
||||||
|
appliance_check
|
||||||
|
check_nsm_raid
|
||||||
|
check_boss_raid
|
||||||
{%- if salt['grains.get']('sosmodel', '') %}
|
{%- if salt['grains.get']('sosmodel', '') %}
|
||||||
mkdir -p /opt/so/log/raid
|
|
||||||
{%- if grains['sosmodel'] in ['SOSMN', 'SOSSNNV'] %}
|
{%- if grains['sosmodel'] in ['SOSMN', 'SOSSNNV'] %}
|
||||||
#check_boss_raid
|
|
||||||
check_software_raid
|
check_software_raid
|
||||||
#echo "osraid=$BOSSRAID nsmraid=$SWRAID" > /opt/so/log/raid/status.log
|
|
||||||
echo "osraid=1 nsmraid=$SWRAID" > /opt/so/log/raid/status.log
|
|
||||||
{%- elif grains['sosmodel'] in ['SOS1000F', 'SOS1000', 'SOSSN7200', 'SOS10K', 'SOS4000'] %}
|
|
||||||
#check_boss_raid
|
|
||||||
check_lsi_raid
|
|
||||||
#echo "osraid=$BOSSRAID nsmraid=$LSIRAID" > /opt/so/log/raid/status.log
|
|
||||||
echo "osraid=1 nsmraid=$LSIRAID" > /opt/so/log/raid/status.log
|
|
||||||
{%- else %}
|
|
||||||
exit 0
|
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
{%- else %}
|
|
||||||
exit 0
|
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
|
|
||||||
|
if [[ -n $SWRAID ]]; then
|
||||||
|
if [[ $SWRAID == '0' && BOSSRAID == '0' ]]; then
|
||||||
|
RAIDSTATUS=0
|
||||||
|
else
|
||||||
|
RAIDSTATUS=1
|
||||||
|
fi
|
||||||
|
elif [[ -n $DUDEYOUGOTADELL ]]; then
|
||||||
|
if [[ $BOSSRAID == '0' && $HWRAID == '0' ]]; then
|
||||||
|
RAIDSTATUS=0
|
||||||
|
else
|
||||||
|
RAIDSTATUS=1
|
||||||
|
fi
|
||||||
|
elif [[ "$APPTYPE" == 'sm' ]]; then
|
||||||
|
if [[ -n "$HWRAID" ]]; then
|
||||||
|
RAIDSTATUS=0
|
||||||
|
else
|
||||||
|
RAIDSTATUS=1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "nsmraid=$RAIDSTATUS" > /opt/so/log/raid/status.log
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -23,6 +23,11 @@ TESTPCAP=$2
|
|||||||
|
|
||||||
. /usr/sbin/so-common
|
. /usr/sbin/so-common
|
||||||
|
|
||||||
|
if [ $# -lt 2 ]; then
|
||||||
|
echo "Usage: $0 <CustomRule> <TargetPCAP>"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
echo ""
|
echo ""
|
||||||
echo "==============="
|
echo "==============="
|
||||||
echo "Running all.rules and $TESTRULE against the following pcap: $TESTPCAP"
|
echo "Running all.rules and $TESTRULE against the following pcap: $TESTPCAP"
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ if [[ $# -lt 1 ]]; then
|
|||||||
echo "Usage: $0 <pcap-sample(s)>"
|
echo "Usage: $0 <pcap-sample(s)>"
|
||||||
echo
|
echo
|
||||||
echo "All PCAPs must be placed in the /opt/so/samples directory unless replaying"
|
echo "All PCAPs must be placed in the /opt/so/samples directory unless replaying"
|
||||||
echo "a sample pcap that is included in the so-tcpreplay image. Those PCAP sampes"
|
echo "a sample pcap that is included in the so-tcpreplay image. Those PCAP samples"
|
||||||
echo "are located in the /opt/samples directory inside of the image."
|
echo "are located in the /opt/samples directory inside of the image."
|
||||||
echo
|
echo
|
||||||
echo "Customer provided PCAP example:"
|
echo "Customer provided PCAP example:"
|
||||||
|
|||||||
57
salt/common/tools/sbin/so-thehive-user-update
Executable file
57
salt/common/tools/sbin/so-thehive-user-update
Executable file
@@ -0,0 +1,57 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
#
|
||||||
|
# Copyright 2014,2015,2016,2017,2018,2019,2020,2021 Security Onion Solutions, LLC
|
||||||
|
#
|
||||||
|
# This program is free software: you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation, either version 3 of the License, or
|
||||||
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
. /usr/sbin/so-common
|
||||||
|
|
||||||
|
usage() {
|
||||||
|
echo "Usage: $0 <user-name>"
|
||||||
|
echo ""
|
||||||
|
echo "Update password for an existing TheHive user. The new password will be read from STDIN."
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
if [ $# -ne 1 ]; then
|
||||||
|
usage
|
||||||
|
fi
|
||||||
|
|
||||||
|
USER=$1
|
||||||
|
|
||||||
|
THEHIVE_KEY=$(lookup_pillar hivekey)
|
||||||
|
THEHVIE_API_URL="$(lookup_pillar url_base)/thehive/api"
|
||||||
|
THEHIVE_USER=$USER
|
||||||
|
|
||||||
|
# Read password for new user from stdin
|
||||||
|
test -t 0
|
||||||
|
if [[ $? == 0 ]]; then
|
||||||
|
echo "Enter new password:"
|
||||||
|
fi
|
||||||
|
read -rs THEHIVE_PASS
|
||||||
|
|
||||||
|
if ! check_password "$THEHIVE_PASS"; then
|
||||||
|
echo "Password is invalid. Please exclude single quotes, double quotes and backslashes from the password."
|
||||||
|
exit 2
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Change password for user in TheHive
|
||||||
|
resp=$(curl -sk -XPOST -H "Authorization: Bearer $THEHIVE_KEY" -H "Content-Type: application/json" -L "https://$THEHVIE_API_URL/user/${THEHIVE_USER}/password/set" -d "{\"password\" : \"$THEHIVE_PASS\"}")
|
||||||
|
if [[ -z "$resp" ]]; then
|
||||||
|
echo "Successfully updated TheHive user password"
|
||||||
|
else
|
||||||
|
echo "Unable to update TheHive user password"
|
||||||
|
echo $resp
|
||||||
|
exit 2
|
||||||
|
fi
|
||||||
@@ -39,10 +39,18 @@ email=$2
|
|||||||
|
|
||||||
kratosUrl=${KRATOS_URL:-http://127.0.0.1:4434}
|
kratosUrl=${KRATOS_URL:-http://127.0.0.1:4434}
|
||||||
databasePath=${KRATOS_DB_PATH:-/opt/so/conf/kratos/db/db.sqlite}
|
databasePath=${KRATOS_DB_PATH:-/opt/so/conf/kratos/db/db.sqlite}
|
||||||
argon2Iterations=${ARGON2_ITERATIONS:-3}
|
bcryptRounds=${BCRYPT_ROUNDS:-12}
|
||||||
argon2Memory=${ARGON2_MEMORY:-14}
|
elasticUsersFile=${ELASTIC_USERS_FILE:-/opt/so/saltstack/local/salt/elasticsearch/files/users}
|
||||||
argon2Parallelism=${ARGON2_PARALLELISM:-2}
|
elasticRolesFile=${ELASTIC_ROLES_FILE:-/opt/so/saltstack/local/salt/elasticsearch/files/users_roles}
|
||||||
argon2HashSize=${ARGON2_HASH_SIZE:-32}
|
esUID=${ELASTIC_UID:-930}
|
||||||
|
esGID=${ELASTIC_GID:-930}
|
||||||
|
|
||||||
|
function lock() {
|
||||||
|
# Obtain file descriptor lock
|
||||||
|
exec 99>/var/tmp/so-user.lock || fail "Unable to create lock descriptor; if the system was not shutdown gracefully you may need to remove /var/tmp/so-user.lock manually."
|
||||||
|
flock -w 10 99 || fail "Another process is using so-user; if the system was not shutdown gracefully you may need to remove /var/tmp/so-user.lock manually."
|
||||||
|
trap 'rm -f /var/tmp/so-user.lock' EXIT
|
||||||
|
}
|
||||||
|
|
||||||
function fail() {
|
function fail() {
|
||||||
msg=$1
|
msg=$1
|
||||||
@@ -58,7 +66,7 @@ function require() {
|
|||||||
|
|
||||||
# Verify this environment is capable of running this script
|
# Verify this environment is capable of running this script
|
||||||
function verifyEnvironment() {
|
function verifyEnvironment() {
|
||||||
require "argon2"
|
require "htpasswd"
|
||||||
require "jq"
|
require "jq"
|
||||||
require "curl"
|
require "curl"
|
||||||
require "openssl"
|
require "openssl"
|
||||||
@@ -95,6 +103,16 @@ function validateEmail() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function hashPassword() {
|
||||||
|
password=$1
|
||||||
|
|
||||||
|
passwordHash=$(echo "${password}" | htpasswd -niBC $bcryptRounds SOUSER)
|
||||||
|
passwordHash=$(echo "$passwordHash" | cut -c 11-)
|
||||||
|
passwordHash="\$2a${passwordHash}" # still waiting for https://github.com/elastic/elasticsearch/issues/51132
|
||||||
|
echo "$passwordHash"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
function updatePassword() {
|
function updatePassword() {
|
||||||
identityId=$1
|
identityId=$1
|
||||||
|
|
||||||
@@ -111,15 +129,125 @@ function updatePassword() {
|
|||||||
|
|
||||||
if [[ -n $identityId ]]; then
|
if [[ -n $identityId ]]; then
|
||||||
# Generate password hash
|
# Generate password hash
|
||||||
salt=$(openssl rand -hex 8)
|
passwordHash=$(hashPassword "$password")
|
||||||
passwordHash=$(echo "${password}" | argon2 ${salt} -id -t $argon2Iterations -m $argon2Memory -p $argon2Parallelism -l $argon2HashSize -e)
|
|
||||||
|
|
||||||
# Update DB with new hash
|
# Update DB with new hash
|
||||||
echo "update identity_credentials set config=CAST('{\"hashed_password\":\"${passwordHash}\"}' as BLOB) where identity_id=${identityId};" | sqlite3 "$databasePath"
|
echo "update identity_credentials set config=CAST('{\"hashed_password\":\"$passwordHash\"}' as BLOB) where identity_id=${identityId};" | sqlite3 "$databasePath"
|
||||||
[[ $? != 0 ]] && fail "Unable to update password"
|
[[ $? != 0 ]] && fail "Unable to update password"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function createElasticFile() {
|
||||||
|
filename=$1
|
||||||
|
tmpFile=${filename}
|
||||||
|
truncate -s 0 "$tmpFile"
|
||||||
|
chmod 600 "$tmpFile"
|
||||||
|
chown "${esUID}:${esGID}" "$tmpFile"
|
||||||
|
}
|
||||||
|
|
||||||
|
function syncElasticSystemUser() {
|
||||||
|
json=$1
|
||||||
|
userid=$2
|
||||||
|
usersFile=$3
|
||||||
|
|
||||||
|
user=$(echo "$json" | jq -r ".local.users.$userid.user")
|
||||||
|
pass=$(echo "$json" | jq -r ".local.users.$userid.pass")
|
||||||
|
|
||||||
|
[[ -z "$user" || -z "$pass" ]] && fail "Elastic auth credentials for system user '$userid' are missing"
|
||||||
|
hash=$(hashPassword "$pass")
|
||||||
|
|
||||||
|
echo "${user}:${hash}" >> "$usersFile"
|
||||||
|
}
|
||||||
|
|
||||||
|
function syncElasticSystemRole() {
|
||||||
|
json=$1
|
||||||
|
userid=$2
|
||||||
|
role=$3
|
||||||
|
rolesFile=$4
|
||||||
|
|
||||||
|
user=$(echo "$json" | jq -r ".local.users.$userid.user")
|
||||||
|
|
||||||
|
[[ -z "$user" ]] && fail "Elastic auth credentials for system user '$userid' are missing"
|
||||||
|
|
||||||
|
echo "${role}:${user}" >> "$rolesFile"
|
||||||
|
}
|
||||||
|
|
||||||
|
function syncElastic() {
|
||||||
|
echo "Syncing users between SOC and Elastic..."
|
||||||
|
usersTmpFile="${elasticUsersFile}.tmp"
|
||||||
|
rolesTmpFile="${elasticRolesFile}.tmp"
|
||||||
|
createElasticFile "${usersTmpFile}"
|
||||||
|
createElasticFile "${rolesTmpFile}"
|
||||||
|
|
||||||
|
authPillarJson=$(lookup_salt_value "auth" "elasticsearch" "pillar" "json")
|
||||||
|
|
||||||
|
syncElasticSystemUser "$authPillarJson" "so_elastic_user" "$usersTmpFile"
|
||||||
|
syncElasticSystemRole "$authPillarJson" "so_elastic_user" "superuser" "$rolesTmpFile"
|
||||||
|
|
||||||
|
syncElasticSystemUser "$authPillarJson" "so_kibana_user" "$usersTmpFile"
|
||||||
|
syncElasticSystemRole "$authPillarJson" "so_kibana_user" "superuser" "$rolesTmpFile"
|
||||||
|
|
||||||
|
syncElasticSystemUser "$authPillarJson" "so_logstash_user" "$usersTmpFile"
|
||||||
|
syncElasticSystemRole "$authPillarJson" "so_logstash_user" "superuser" "$rolesTmpFile"
|
||||||
|
|
||||||
|
syncElasticSystemUser "$authPillarJson" "so_beats_user" "$usersTmpFile"
|
||||||
|
syncElasticSystemRole "$authPillarJson" "so_beats_user" "superuser" "$rolesTmpFile"
|
||||||
|
|
||||||
|
syncElasticSystemUser "$authPillarJson" "so_monitor_user" "$usersTmpFile"
|
||||||
|
syncElasticSystemRole "$authPillarJson" "so_monitor_user" "remote_monitoring_collector" "$rolesTmpFile"
|
||||||
|
syncElasticSystemRole "$authPillarJson" "so_monitor_user" "remote_monitoring_agent" "$rolesTmpFile"
|
||||||
|
syncElasticSystemRole "$authPillarJson" "so_monitor_user" "monitoring_user" "$rolesTmpFile"
|
||||||
|
|
||||||
|
if [[ -f "$databasePath" ]]; then
|
||||||
|
# Generate the new users file
|
||||||
|
echo "select '{\"user\":\"' || ici.identifier || '\", \"data\":' || ic.config || '}'" \
|
||||||
|
"from identity_credential_identifiers ici, identity_credentials ic " \
|
||||||
|
"where ici.identity_credential_id=ic.id and instr(ic.config, 'hashed_password') " \
|
||||||
|
"order by ici.identifier;" | \
|
||||||
|
sqlite3 "$databasePath" | \
|
||||||
|
jq -r '.user + ":" + .data.hashed_password' \
|
||||||
|
>> "$usersTmpFile"
|
||||||
|
[[ $? != 0 ]] && fail "Unable to read credential hashes from database"
|
||||||
|
|
||||||
|
# Generate the new users_roles file
|
||||||
|
|
||||||
|
echo "select 'superuser:' || ici.identifier " \
|
||||||
|
"from identity_credential_identifiers ici, identity_credentials ic " \
|
||||||
|
"where ici.identity_credential_id=ic.id and instr(ic.config, 'hashed_password') " \
|
||||||
|
"order by ici.identifier;" | \
|
||||||
|
sqlite3 "$databasePath" \
|
||||||
|
>> "$rolesTmpFile"
|
||||||
|
[[ $? != 0 ]] && fail "Unable to read credential IDs from database"
|
||||||
|
else
|
||||||
|
echo "Database file does not exist yet, skipping users export"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ -s "${usersTmpFile}" ]]; then
|
||||||
|
mv "${usersTmpFile}" "${elasticUsersFile}"
|
||||||
|
mv "${rolesTmpFile}" "${elasticRolesFile}"
|
||||||
|
|
||||||
|
if [[ -z "$SKIP_STATE_APPLY" ]]; then
|
||||||
|
echo "Elastic state will be re-applied to affected minions. This may take several minutes..."
|
||||||
|
echo "Applying elastic state to elastic minions at $(date)" >> /opt/so/log/soc/sync.log 2>&1
|
||||||
|
salt -C 'G@role:so-standalone or G@role:so-eval or G@role:so-import or G@role:so-manager or G@role:so-managersearch or G@role:so-node or G@role:so-heavynode' state.apply elasticsearch queue=True >> /opt/so/log/soc/sync.log 2>&1
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo "Newly generated users/roles files are incomplete; aborting."
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
function syncAll() {
|
||||||
|
if [[ -z "$FORCE_SYNC" && -f "$databasePath" && -f "$elasticUsersFile" ]]; then
|
||||||
|
usersFileAgeSecs=$(echo $(($(date +%s) - $(date +%s -r "$elasticUsersFile"))))
|
||||||
|
staleCount=$(echo "select count(*) from identity_credentials where updated_at >= Datetime('now', '-${usersFileAgeSecs} seconds');" \
|
||||||
|
| sqlite3 "$databasePath")
|
||||||
|
if [[ "$staleCount" == "0" ]]; then
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
syncElastic
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
function listUsers() {
|
function listUsers() {
|
||||||
response=$(curl -Ss -L ${kratosUrl}/identities)
|
response=$(curl -Ss -L ${kratosUrl}/identities)
|
||||||
[[ $? != 0 ]] && fail "Unable to communicate with Kratos"
|
[[ $? != 0 ]] && fail "Unable to communicate with Kratos"
|
||||||
@@ -178,7 +306,7 @@ function updateStatus() {
|
|||||||
[[ $? != 0 ]] && fail "Unable to unlock credential record"
|
[[ $? != 0 ]] && fail "Unable to unlock credential record"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
updatedJson=$(echo "$response" | jq ".traits.status = \"$status\" | del(.verifiable_addresses) | del(.id) | del(.schema_url)")
|
updatedJson=$(echo "$response" | jq ".traits.status = \"$status\" | del(.verifiable_addresses) | del(.id) | del(.schema_url) | del(.created_at) | del(.updated_at)")
|
||||||
response=$(curl -Ss -XPUT -L ${kratosUrl}/identities/$identityId -d "$updatedJson")
|
response=$(curl -Ss -XPUT -L ${kratosUrl}/identities/$identityId -d "$updatedJson")
|
||||||
[[ $? != 0 ]] && fail "Unable to mark user as locked"
|
[[ $? != 0 ]] && fail "Unable to mark user as locked"
|
||||||
|
|
||||||
@@ -208,12 +336,14 @@ case "${operation}" in
|
|||||||
verifyEnvironment
|
verifyEnvironment
|
||||||
[[ "$email" == "" ]] && fail "Email address must be provided"
|
[[ "$email" == "" ]] && fail "Email address must be provided"
|
||||||
|
|
||||||
|
lock
|
||||||
validateEmail "$email"
|
validateEmail "$email"
|
||||||
updatePassword
|
updatePassword
|
||||||
createUser "$email"
|
createUser "$email"
|
||||||
|
syncAll
|
||||||
echo "Successfully added new user to SOC"
|
echo "Successfully added new user to SOC"
|
||||||
check_container thehive && echo $password | so-thehive-user-add "$email"
|
check_container thehive && echo "$password" | so-thehive-user-add "$email"
|
||||||
check_container fleet && echo $password | so-fleet-user-add "$email"
|
check_container fleet && echo "$password" | so-fleet-user-add "$email"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
"list")
|
"list")
|
||||||
@@ -225,7 +355,9 @@ case "${operation}" in
|
|||||||
verifyEnvironment
|
verifyEnvironment
|
||||||
[[ "$email" == "" ]] && fail "Email address must be provided"
|
[[ "$email" == "" ]] && fail "Email address must be provided"
|
||||||
|
|
||||||
|
lock
|
||||||
updateUser "$email"
|
updateUser "$email"
|
||||||
|
syncAll
|
||||||
echo "Successfully updated user"
|
echo "Successfully updated user"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
@@ -233,7 +365,9 @@ case "${operation}" in
|
|||||||
verifyEnvironment
|
verifyEnvironment
|
||||||
[[ "$email" == "" ]] && fail "Email address must be provided"
|
[[ "$email" == "" ]] && fail "Email address must be provided"
|
||||||
|
|
||||||
|
lock
|
||||||
updateStatus "$email" 'active'
|
updateStatus "$email" 'active'
|
||||||
|
syncAll
|
||||||
echo "Successfully enabled user"
|
echo "Successfully enabled user"
|
||||||
check_container thehive && so-thehive-user-enable "$email" true
|
check_container thehive && so-thehive-user-enable "$email" true
|
||||||
check_container fleet && so-fleet-user-enable "$email" true
|
check_container fleet && so-fleet-user-enable "$email" true
|
||||||
@@ -243,7 +377,9 @@ case "${operation}" in
|
|||||||
verifyEnvironment
|
verifyEnvironment
|
||||||
[[ "$email" == "" ]] && fail "Email address must be provided"
|
[[ "$email" == "" ]] && fail "Email address must be provided"
|
||||||
|
|
||||||
|
lock
|
||||||
updateStatus "$email" 'locked'
|
updateStatus "$email" 'locked'
|
||||||
|
syncAll
|
||||||
echo "Successfully disabled user"
|
echo "Successfully disabled user"
|
||||||
check_container thehive && so-thehive-user-enable "$email" false
|
check_container thehive && so-thehive-user-enable "$email" false
|
||||||
check_container fleet && so-fleet-user-enable "$email" false
|
check_container fleet && so-fleet-user-enable "$email" false
|
||||||
@@ -253,12 +389,19 @@ case "${operation}" in
|
|||||||
verifyEnvironment
|
verifyEnvironment
|
||||||
[[ "$email" == "" ]] && fail "Email address must be provided"
|
[[ "$email" == "" ]] && fail "Email address must be provided"
|
||||||
|
|
||||||
|
lock
|
||||||
deleteUser "$email"
|
deleteUser "$email"
|
||||||
|
syncAll
|
||||||
echo "Successfully deleted user"
|
echo "Successfully deleted user"
|
||||||
check_container thehive && so-thehive-user-enable "$email" false
|
check_container thehive && so-thehive-user-enable "$email" false
|
||||||
check_container fleet && so-fleet-user-enable "$email" false
|
check_container fleet && so-fleet-user-enable "$email" false
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
"sync")
|
||||||
|
lock
|
||||||
|
syncAll
|
||||||
|
;;
|
||||||
|
|
||||||
"validate")
|
"validate")
|
||||||
validateEmail "$email"
|
validateEmail "$email"
|
||||||
updatePassword
|
updatePassword
|
||||||
|
|||||||
@@ -10,11 +10,10 @@ zeek_logs_enabled() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
whiptail_manager_adv_service_zeeklogs() {
|
whiptail_manager_adv_service_zeeklogs() {
|
||||||
BLOGS=$(whiptail --title "Security Onion Setup" --checklist "Please Select Logs to Send:" 24 78 12 \
|
BLOGS=$(whiptail --title "so-zeek-logs" --checklist "Please Select Logs to Send:" 24 78 12 \
|
||||||
"conn" "Connection Logging" ON \
|
"conn" "Connection Logging" ON \
|
||||||
"dce_rpc" "RPC Logs" ON \
|
"dce_rpc" "RPC Logs" ON \
|
||||||
"dhcp" "DHCP Logs" ON \
|
"dhcp" "DHCP Logs" ON \
|
||||||
"dhcpv6" "DHCP IPv6 Logs" ON \
|
|
||||||
"dnp3" "DNP3 Logs" ON \
|
"dnp3" "DNP3 Logs" ON \
|
||||||
"dns" "DNS Logs" ON \
|
"dns" "DNS Logs" ON \
|
||||||
"dpd" "DPD Logs" ON \
|
"dpd" "DPD Logs" ON \
|
||||||
@@ -25,25 +24,20 @@ whiptail_manager_adv_service_zeeklogs() {
|
|||||||
"irc" "IRC Chat Logs" ON \
|
"irc" "IRC Chat Logs" ON \
|
||||||
"kerberos" "Kerberos Logs" ON \
|
"kerberos" "Kerberos Logs" ON \
|
||||||
"modbus" "MODBUS Logs" ON \
|
"modbus" "MODBUS Logs" ON \
|
||||||
"mqtt" "MQTT Logs" ON \
|
|
||||||
"notice" "Zeek Notice Logs" ON \
|
"notice" "Zeek Notice Logs" ON \
|
||||||
"ntlm" "NTLM Logs" ON \
|
"ntlm" "NTLM Logs" ON \
|
||||||
"openvpn" "OPENVPN Logs" ON \
|
|
||||||
"pe" "PE Logs" ON \
|
"pe" "PE Logs" ON \
|
||||||
"radius" "Radius Logs" ON \
|
"radius" "Radius Logs" ON \
|
||||||
"rfb" "RFB Logs" ON \
|
"rfb" "RFB Logs" ON \
|
||||||
"rdp" "RDP Logs" ON \
|
"rdp" "RDP Logs" ON \
|
||||||
"signatures" "Signatures Logs" ON \
|
|
||||||
"sip" "SIP Logs" ON \
|
"sip" "SIP Logs" ON \
|
||||||
"smb_files" "SMB Files Logs" ON \
|
"smb_files" "SMB Files Logs" ON \
|
||||||
"smb_mapping" "SMB Mapping Logs" ON \
|
"smb_mapping" "SMB Mapping Logs" ON \
|
||||||
"smtp" "SMTP Logs" ON \
|
"smtp" "SMTP Logs" ON \
|
||||||
"snmp" "SNMP Logs" ON \
|
"snmp" "SNMP Logs" ON \
|
||||||
"software" "Software Logs" ON \
|
|
||||||
"ssh" "SSH Logs" ON \
|
"ssh" "SSH Logs" ON \
|
||||||
"ssl" "SSL Logs" ON \
|
"ssl" "SSL Logs" ON \
|
||||||
"syslog" "Syslog Logs" ON \
|
"syslog" "Syslog Logs" ON \
|
||||||
"telnet" "Telnet Logs" ON \
|
|
||||||
"tunnel" "Tunnel Logs" ON \
|
"tunnel" "Tunnel Logs" ON \
|
||||||
"weird" "Zeek Weird Logs" ON \
|
"weird" "Zeek Weird Logs" ON \
|
||||||
"mysql" "MySQL Logs" ON \
|
"mysql" "MySQL Logs" ON \
|
||||||
@@ -61,10 +55,10 @@ whiptail_manager_adv_service_zeeklogs
|
|||||||
return_code=$?
|
return_code=$?
|
||||||
case $return_code in
|
case $return_code in
|
||||||
1)
|
1)
|
||||||
whiptail --title "Security Onion Setup" --msgbox "Cancelling. No changes have been made." 8 75
|
whiptail --title "so-zeek-logs" --msgbox "Cancelling. No changes have been made." 8 75
|
||||||
;;
|
;;
|
||||||
255)
|
255)
|
||||||
whiptail --title "Security Onion Setup" --msgbox "Whiptail error occured, exiting." 8 75
|
whiptail --title "so-zeek-logs" --msgbox "Whiptail error occured, exiting." 8 75
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
zeek_logs_enabled
|
zeek_logs_enabled
|
||||||
|
|||||||
@@ -24,11 +24,11 @@ show_stats() {
|
|||||||
echo
|
echo
|
||||||
echo "Average throughput:"
|
echo "Average throughput:"
|
||||||
echo
|
echo
|
||||||
docker exec so-zeek env -i PATH=/bin:/usr/bin:/sbin:/usr/sbin:/opt/bin:/usr/local/bin:/usr/local/sbin runuser -l zeek -c '/opt/zeek/bin/zeekctl capstats'
|
docker exec so-zeek env -i PATH=/bin:/usr/bin:/sbin:/usr/sbin:/opt/bin:/usr/local/bin:/usr/local/sbin /opt/zeek/bin/zeekctl capstats
|
||||||
echo
|
echo
|
||||||
echo "Average packet loss:"
|
echo "Average packet loss:"
|
||||||
echo
|
echo
|
||||||
docker exec so-zeek env -i PATH=/bin:/usr/bin:/sbin:/usr/sbin:/opt/bin:/usr/local/bin:/usr/local/sbin runuser -l zeek -c '/opt/zeek/bin/zeekctl netstats'
|
docker exec so-zeek env -i PATH=/bin:/usr/bin:/sbin:/usr/sbin:/opt/bin:/usr/local/bin:/usr/local/sbin /opt/zeek/bin/zeekctl netstats
|
||||||
echo
|
echo
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -18,12 +18,82 @@
|
|||||||
. /usr/sbin/so-common
|
. /usr/sbin/so-common
|
||||||
|
|
||||||
UPDATE_DIR=/tmp/sogh/securityonion
|
UPDATE_DIR=/tmp/sogh/securityonion
|
||||||
|
DEFAULT_SALT_DIR=/opt/so/saltstack/default
|
||||||
INSTALLEDVERSION=$(cat /etc/soversion)
|
INSTALLEDVERSION=$(cat /etc/soversion)
|
||||||
POSTVERSION=$INSTALLEDVERSION
|
POSTVERSION=$INSTALLEDVERSION
|
||||||
INSTALLEDSALTVERSION=$(salt --versions-report | grep Salt: | awk {'print $2'})
|
INSTALLEDSALTVERSION=$(salt --versions-report | grep Salt: | awk '{print $2}')
|
||||||
BATCHSIZE=5
|
BATCHSIZE=5
|
||||||
SOUP_LOG=/root/soup.log
|
SOUP_LOG=/root/soup.log
|
||||||
|
INFLUXDB_MIGRATION_LOG=/opt/so/log/influxdb/soup_migration.log
|
||||||
WHATWOULDYOUSAYYAHDOHERE=soup
|
WHATWOULDYOUSAYYAHDOHERE=soup
|
||||||
|
whiptail_title='Security Onion UPdater'
|
||||||
|
|
||||||
|
check_err() {
|
||||||
|
local exit_code=$1
|
||||||
|
local err_msg="Unhandled error occured, please check $SOUP_LOG for details."
|
||||||
|
|
||||||
|
[[ $ERR_HANDLED == true ]] && exit $exit_code
|
||||||
|
if [[ $exit_code -ne 0 ]]; then
|
||||||
|
printf '%s' "Soup failed with error $exit_code: "
|
||||||
|
case $exit_code in
|
||||||
|
2)
|
||||||
|
echo 'No such file or directory'
|
||||||
|
;;
|
||||||
|
5)
|
||||||
|
echo 'Interrupted system call'
|
||||||
|
;;
|
||||||
|
12)
|
||||||
|
echo 'Out of memory'
|
||||||
|
;;
|
||||||
|
28)
|
||||||
|
echo 'No space left on device'
|
||||||
|
echo 'Likely ran out of space on disk, please review hardware requirements for Security Onion: https://docs.securityonion.net/en/2.3/hardware.html'
|
||||||
|
;;
|
||||||
|
30)
|
||||||
|
echo 'Read-only file system'
|
||||||
|
;;
|
||||||
|
35)
|
||||||
|
echo 'Resource temporarily unavailable'
|
||||||
|
;;
|
||||||
|
64)
|
||||||
|
echo 'Machine is not on the network'
|
||||||
|
;;
|
||||||
|
67)
|
||||||
|
echo 'Link has been severed'
|
||||||
|
;;
|
||||||
|
100)
|
||||||
|
echo 'Network is down'
|
||||||
|
;;
|
||||||
|
101)
|
||||||
|
echo 'Network is unreachable'
|
||||||
|
;;
|
||||||
|
102)
|
||||||
|
echo 'Network reset'
|
||||||
|
;;
|
||||||
|
110)
|
||||||
|
echo 'Connection timed out'
|
||||||
|
;;
|
||||||
|
111)
|
||||||
|
echo 'Connection refused'
|
||||||
|
;;
|
||||||
|
112)
|
||||||
|
echo 'Host is down'
|
||||||
|
;;
|
||||||
|
113)
|
||||||
|
echo 'No route to host'
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo 'Unhandled error'
|
||||||
|
echo "$err_msg"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
if [[ $exit_code -ge 64 && $exit_code -le 113 ]]; then
|
||||||
|
echo "$err_msg"
|
||||||
|
fi
|
||||||
|
exit $exit_code
|
||||||
|
fi
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
add_common() {
|
add_common() {
|
||||||
cp $UPDATE_DIR/salt/common/tools/sbin/so-common $DEFAULT_SALT_DIR/salt/common/tools/sbin/
|
cp $UPDATE_DIR/salt/common/tools/sbin/so-common $DEFAULT_SALT_DIR/salt/common/tools/sbin/
|
||||||
@@ -39,15 +109,14 @@ airgap_mounted() {
|
|||||||
echo "The ISO is already mounted"
|
echo "The ISO is already mounted"
|
||||||
else
|
else
|
||||||
echo ""
|
echo ""
|
||||||
echo "Looks like we need access to the upgrade content"
|
cat << EOF
|
||||||
echo ""
|
In order for soup to proceed, the path to the downloaded Security Onion ISO file, or the path to the CD-ROM or equivalent device containing the ISO media must be provided.
|
||||||
echo "If you just copied the .iso file over you can specify the path."
|
For example, if you have copied the new Security Onion ISO file to your home directory, then the path might look like /home/myuser/securityonion-2.x.y.iso.
|
||||||
echo "If you burned the ISO to a disk the standard way you can specify the device."
|
Or, if you have burned the new ISO onto an optical disk then the path might look like /dev/cdrom.
|
||||||
echo "Example: /home/user/securityonion-2.X.0.iso"
|
|
||||||
echo "Example: /dev/sdx1"
|
EOF
|
||||||
echo ""
|
read -rp 'Enter the path to the new Security Onion ISO content: ' ISOLOC
|
||||||
read -p 'Enter the location of the iso: ' ISOLOC
|
if [[ -f $ISOLOC ]]; then
|
||||||
if [ -f $ISOLOC ]; then
|
|
||||||
# Mounting the ISO image
|
# Mounting the ISO image
|
||||||
mkdir -p /tmp/soagupdate
|
mkdir -p /tmp/soagupdate
|
||||||
mount -t iso9660 -o loop $ISOLOC /tmp/soagupdate
|
mount -t iso9660 -o loop $ISOLOC /tmp/soagupdate
|
||||||
@@ -59,7 +128,7 @@ airgap_mounted() {
|
|||||||
else
|
else
|
||||||
echo "ISO has been mounted!"
|
echo "ISO has been mounted!"
|
||||||
fi
|
fi
|
||||||
elif [ -f $ISOLOC/SecurityOnion/VERSION ]; then
|
elif [[ -f $ISOLOC/SecurityOnion/VERSION ]]; then
|
||||||
ln -s $ISOLOC /tmp/soagupdate
|
ln -s $ISOLOC /tmp/soagupdate
|
||||||
echo "Found the update content"
|
echo "Found the update content"
|
||||||
else
|
else
|
||||||
@@ -77,9 +146,9 @@ airgap_mounted() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
airgap_update_dockers() {
|
airgap_update_dockers() {
|
||||||
if [ $is_airgap -eq 0 ]; then
|
if [[ $is_airgap -eq 0 ]]; then
|
||||||
# Let's copy the tarball
|
# Let's copy the tarball
|
||||||
if [ ! -f $AGDOCKER/registry.tar ]; then
|
if [[ ! -f $AGDOCKER/registry.tar ]]; then
|
||||||
echo "Unable to locate registry. Exiting"
|
echo "Unable to locate registry. Exiting"
|
||||||
exit 1
|
exit 1
|
||||||
else
|
else
|
||||||
@@ -87,9 +156,9 @@ airgap_update_dockers() {
|
|||||||
docker stop so-dockerregistry
|
docker stop so-dockerregistry
|
||||||
docker rm so-dockerregistry
|
docker rm so-dockerregistry
|
||||||
echo "Copying the new dockers over"
|
echo "Copying the new dockers over"
|
||||||
tar xvf $AGDOCKER/registry.tar -C /nsm/docker-registry/docker
|
tar xvf "$AGDOCKER/registry.tar" -C /nsm/docker-registry/docker
|
||||||
echo "Add Registry back"
|
echo "Add Registry back"
|
||||||
docker load -i $AGDOCKER/registry_image.tar
|
docker load -i "$AGDOCKER/registry_image.tar"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
@@ -100,6 +169,50 @@ update_registry() {
|
|||||||
salt-call state.apply registry queue=True
|
salt-call state.apply registry queue=True
|
||||||
}
|
}
|
||||||
|
|
||||||
|
check_airgap() {
|
||||||
|
# See if this is an airgap install
|
||||||
|
AIRGAP=$(cat /opt/so/saltstack/local/pillar/global.sls | grep airgap: | awk '{print $2}')
|
||||||
|
if [[ "$AIRGAP" == "True" ]]; then
|
||||||
|
is_airgap=0
|
||||||
|
UPDATE_DIR=/tmp/soagupdate/SecurityOnion
|
||||||
|
AGDOCKER=/tmp/soagupdate/docker
|
||||||
|
AGREPO=/tmp/soagupdate/Packages
|
||||||
|
else
|
||||||
|
is_airgap=1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
# {% raw %}
|
||||||
|
|
||||||
|
check_local_mods() {
|
||||||
|
local salt_local=/opt/so/saltstack/local
|
||||||
|
|
||||||
|
local_mod_arr=()
|
||||||
|
|
||||||
|
while IFS= read -r -d '' local_file; do
|
||||||
|
stripped_path=${local_file#"$salt_local"}
|
||||||
|
default_file="${DEFAULT_SALT_DIR}${stripped_path}"
|
||||||
|
if [[ -f $default_file ]]; then
|
||||||
|
file_diff=$(diff "$default_file" "$local_file" )
|
||||||
|
if [[ $(echo "$file_diff" | grep -c "^<") -gt 0 ]]; then
|
||||||
|
local_mod_arr+=( "$local_file" )
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
done< <(find $salt_local -type f -print0)
|
||||||
|
|
||||||
|
if [[ ${#local_mod_arr} -gt 0 ]]; then
|
||||||
|
echo "Potentially breaking changes found in the following files (check ${DEFAULT_SALT_DIR} for original copy):"
|
||||||
|
for file_str in "${local_mod_arr[@]}"; do
|
||||||
|
echo " $file_str"
|
||||||
|
done
|
||||||
|
echo ""
|
||||||
|
echo "To reference this list later, check $SOUP_LOG"
|
||||||
|
sleep 10
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
# {% endraw %}
|
||||||
|
|
||||||
check_sudoers() {
|
check_sudoers() {
|
||||||
if grep -q "so-setup" /etc/sudoers; then
|
if grep -q "so-setup" /etc/sudoers; then
|
||||||
echo "There is an entry for so-setup in the sudoers file, this can be safely deleted using \"visudo\"."
|
echo "There is an entry for so-setup in the sudoers file, this can be safely deleted using \"visudo\"."
|
||||||
@@ -177,7 +290,9 @@ check_os_updates() {
|
|||||||
echo "Continuing without updating packages"
|
echo "Continuing without updating packages"
|
||||||
elif [[ "$confirm" == [uU] ]]; then
|
elif [[ "$confirm" == [uU] ]]; then
|
||||||
echo "Applying Grid Updates"
|
echo "Applying Grid Updates"
|
||||||
salt \* -b 5 state.apply patch.os queue=True
|
set +e
|
||||||
|
run_check_net_err "salt '*' -b 5 state.apply patch.os queue=True" 'Could not apply OS updates, please check your network connection.'
|
||||||
|
set -e
|
||||||
else
|
else
|
||||||
echo "Exiting soup"
|
echo "Exiting soup"
|
||||||
exit 0
|
exit 0
|
||||||
@@ -217,7 +332,7 @@ generate_and_clean_tarballs() {
|
|||||||
local new_version
|
local new_version
|
||||||
new_version=$(cat $UPDATE_DIR/VERSION)
|
new_version=$(cat $UPDATE_DIR/VERSION)
|
||||||
[ -d /opt/so/repo ] || mkdir -p /opt/so/repo
|
[ -d /opt/so/repo ] || mkdir -p /opt/so/repo
|
||||||
tar -czf "/opt/so/repo/$new_version.tar.gz" "$UPDATE_DIR"
|
tar -czf "/opt/so/repo/$new_version.tar.gz" -C "$UPDATE_DIR" .
|
||||||
find "/opt/so/repo" -type f -not -name "$new_version.tar.gz" -exec rm -rf {} \;
|
find "/opt/so/repo" -type f -not -name "$new_version.tar.gz" -exec rm -rf {} \;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -247,13 +362,6 @@ masterunlock() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
preupgrade_changes_2.3.50_repo() {
|
|
||||||
# We made repo changes in 2.3.50 and this prepares for that on upgrade
|
|
||||||
echo "Checking to see if 2.3.50 repo changes are needed."
|
|
||||||
|
|
||||||
[[ "$INSTALLEDVERSION" == 2.3.30 || "$INSTALLEDVERSION" == 2.3.40 ]] && up_2.3.3X_to_2.3.50_repo
|
|
||||||
}
|
|
||||||
|
|
||||||
preupgrade_changes() {
|
preupgrade_changes() {
|
||||||
# This function is to add any new pillar items if needed.
|
# This function is to add any new pillar items if needed.
|
||||||
echo "Checking to see if changes are needed."
|
echo "Checking to see if changes are needed."
|
||||||
@@ -264,6 +372,7 @@ preupgrade_changes() {
|
|||||||
[[ "$INSTALLEDVERSION" == 2.3.0 || "$INSTALLEDVERSION" == 2.3.1 || "$INSTALLEDVERSION" == 2.3.2 || "$INSTALLEDVERSION" == 2.3.10 ]] && up_2.3.0_to_2.3.20
|
[[ "$INSTALLEDVERSION" == 2.3.0 || "$INSTALLEDVERSION" == 2.3.1 || "$INSTALLEDVERSION" == 2.3.2 || "$INSTALLEDVERSION" == 2.3.10 ]] && up_2.3.0_to_2.3.20
|
||||||
[[ "$INSTALLEDVERSION" == 2.3.20 || "$INSTALLEDVERSION" == 2.3.21 ]] && up_2.3.2X_to_2.3.30
|
[[ "$INSTALLEDVERSION" == 2.3.20 || "$INSTALLEDVERSION" == 2.3.21 ]] && up_2.3.2X_to_2.3.30
|
||||||
[[ "$INSTALLEDVERSION" == 2.3.30 || "$INSTALLEDVERSION" == 2.3.40 ]] && up_2.3.3X_to_2.3.50
|
[[ "$INSTALLEDVERSION" == 2.3.30 || "$INSTALLEDVERSION" == 2.3.40 ]] && up_2.3.3X_to_2.3.50
|
||||||
|
true
|
||||||
}
|
}
|
||||||
|
|
||||||
postupgrade_changes() {
|
postupgrade_changes() {
|
||||||
@@ -273,6 +382,8 @@ postupgrade_changes() {
|
|||||||
[[ "$POSTVERSION" =~ rc.1 ]] && post_rc1_to_rc2
|
[[ "$POSTVERSION" =~ rc.1 ]] && post_rc1_to_rc2
|
||||||
[[ "$POSTVERSION" == 2.3.20 || "$POSTVERSION" == 2.3.21 ]] && post_2.3.2X_to_2.3.30
|
[[ "$POSTVERSION" == 2.3.20 || "$POSTVERSION" == 2.3.21 ]] && post_2.3.2X_to_2.3.30
|
||||||
[[ "$POSTVERSION" == 2.3.30 ]] && post_2.3.30_to_2.3.40
|
[[ "$POSTVERSION" == 2.3.30 ]] && post_2.3.30_to_2.3.40
|
||||||
|
[[ "$POSTVERSION" == 2.3.50 ]] && post_2.3.5X_to_2.3.60
|
||||||
|
true
|
||||||
}
|
}
|
||||||
|
|
||||||
post_rc1_to_2.3.21() {
|
post_rc1_to_2.3.21() {
|
||||||
@@ -293,6 +404,10 @@ post_2.3.30_to_2.3.40() {
|
|||||||
POSTVERSION=2.3.40
|
POSTVERSION=2.3.40
|
||||||
}
|
}
|
||||||
|
|
||||||
|
post_2.3.5X_to_2.3.60() {
|
||||||
|
POSTVERSION=2.3.60
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
rc1_to_rc2() {
|
rc1_to_rc2() {
|
||||||
|
|
||||||
@@ -426,7 +541,7 @@ up_2.3.2X_to_2.3.30() {
|
|||||||
sed -i "/ imagerepo: securityonion/c\ imagerepo: 'security-onion-solutions'" /opt/so/saltstack/local/pillar/global.sls
|
sed -i "/ imagerepo: securityonion/c\ imagerepo: 'security-onion-solutions'" /opt/so/saltstack/local/pillar/global.sls
|
||||||
|
|
||||||
# Strelka rule repo pillar addition
|
# Strelka rule repo pillar addition
|
||||||
if [ $is_airgap -eq 0 ]; then
|
if [[ $is_airgap -eq 0 ]]; then
|
||||||
# Add manager as default Strelka YARA rule repo
|
# Add manager as default Strelka YARA rule repo
|
||||||
sed -i "/^strelka:/a \\ repos: \n - https://$HOSTNAME/repo/rules/strelka" /opt/so/saltstack/local/pillar/global.sls;
|
sed -i "/^strelka:/a \\ repos: \n - https://$HOSTNAME/repo/rules/strelka" /opt/so/saltstack/local/pillar/global.sls;
|
||||||
else
|
else
|
||||||
@@ -437,8 +552,8 @@ up_2.3.2X_to_2.3.30() {
|
|||||||
INSTALLEDVERSION=2.3.30
|
INSTALLEDVERSION=2.3.30
|
||||||
}
|
}
|
||||||
|
|
||||||
up_2.3.3X_to_2.3.50_repo() {
|
upgrade_to_2.3.50_repo() {
|
||||||
echo "Performing 2.3.50 repo actions."
|
echo "Performing repo changes."
|
||||||
if [[ "$OS" == "centos" ]]; then
|
if [[ "$OS" == "centos" ]]; then
|
||||||
# Import GPG Keys
|
# Import GPG Keys
|
||||||
gpg_rpm_import
|
gpg_rpm_import
|
||||||
@@ -453,7 +568,7 @@ up_2.3.3X_to_2.3.50_repo() {
|
|||||||
rm -f "/etc/yum.repos.d/$DELREPO.repo"
|
rm -f "/etc/yum.repos.d/$DELREPO.repo"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
if [ $is_airgap -eq 1 ]; then
|
if [[ $is_airgap -eq 1 ]]; then
|
||||||
# Copy the new repo file if not airgap
|
# Copy the new repo file if not airgap
|
||||||
cp $UPDATE_DIR/salt/repo/client/files/centos/securityonion.repo /etc/yum.repos.d/
|
cp $UPDATE_DIR/salt/repo/client/files/centos/securityonion.repo /etc/yum.repos.d/
|
||||||
yum clean all
|
yum clean all
|
||||||
@@ -569,7 +684,7 @@ upgrade_check() {
|
|||||||
# Let's make sure we actually need to update.
|
# Let's make sure we actually need to update.
|
||||||
NEWVERSION=$(cat $UPDATE_DIR/VERSION)
|
NEWVERSION=$(cat $UPDATE_DIR/VERSION)
|
||||||
HOTFIXVERSION=$(cat $UPDATE_DIR/HOTFIX)
|
HOTFIXVERSION=$(cat $UPDATE_DIR/HOTFIX)
|
||||||
CURRENTHOTFIX=$(cat /etc/sohotfix 2>/dev/null)
|
[[ -f /etc/sohotfix ]] && CURRENTHOTFIX=$(cat /etc/sohotfix)
|
||||||
if [ "$INSTALLEDVERSION" == "$NEWVERSION" ]; then
|
if [ "$INSTALLEDVERSION" == "$NEWVERSION" ]; then
|
||||||
echo "Checking to see if there are hotfixes needed"
|
echo "Checking to see if there are hotfixes needed"
|
||||||
if [ "$HOTFIXVERSION" == "$CURRENTHOTFIX" ]; then
|
if [ "$HOTFIXVERSION" == "$CURRENTHOTFIX" ]; then
|
||||||
@@ -586,13 +701,14 @@ upgrade_check() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
upgrade_check_salt() {
|
upgrade_check_salt() {
|
||||||
NEWSALTVERSION=$(grep version: $UPDATE_DIR/salt/salt/master.defaults.yaml | awk {'print $2'})
|
NEWSALTVERSION=$(grep version: $UPDATE_DIR/salt/salt/master.defaults.yaml | awk '{print $2}')
|
||||||
if [ "$INSTALLEDSALTVERSION" == "$NEWSALTVERSION" ]; then
|
if [ "$INSTALLEDSALTVERSION" == "$NEWSALTVERSION" ]; then
|
||||||
echo "You are already running the correct version of Salt for Security Onion."
|
echo "You are already running the correct version of Salt for Security Onion."
|
||||||
else
|
else
|
||||||
UPGRADESALT=1
|
UPGRADESALT=1
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
upgrade_salt() {
|
upgrade_salt() {
|
||||||
SALTUPGRADED=True
|
SALTUPGRADED=True
|
||||||
echo "Performing upgrade of Salt from $INSTALLEDSALTVERSION to $NEWSALTVERSION."
|
echo "Performing upgrade of Salt from $INSTALLEDSALTVERSION to $NEWSALTVERSION."
|
||||||
@@ -604,7 +720,11 @@ upgrade_salt() {
|
|||||||
yum versionlock delete "salt-*"
|
yum versionlock delete "salt-*"
|
||||||
echo "Updating Salt packages and restarting services."
|
echo "Updating Salt packages and restarting services."
|
||||||
echo ""
|
echo ""
|
||||||
sh $UPDATE_DIR/salt/salt/scripts/bootstrap-salt.sh -r -F -M -x python3 stable "$NEWSALTVERSION"
|
set +e
|
||||||
|
run_check_net_err \
|
||||||
|
"sh $UPDATE_DIR/salt/salt/scripts/bootstrap-salt.sh -r -F -M -x python3 stable \"$NEWSALTVERSION\"" \
|
||||||
|
"Could not update salt, please check $SOUP_LOG for details."
|
||||||
|
set -e
|
||||||
echo "Applying yum versionlock for Salt."
|
echo "Applying yum versionlock for Salt."
|
||||||
echo ""
|
echo ""
|
||||||
yum versionlock add "salt-*"
|
yum versionlock add "salt-*"
|
||||||
@@ -617,7 +737,11 @@ upgrade_salt() {
|
|||||||
apt-mark unhold "salt-minion"
|
apt-mark unhold "salt-minion"
|
||||||
echo "Updating Salt packages and restarting services."
|
echo "Updating Salt packages and restarting services."
|
||||||
echo ""
|
echo ""
|
||||||
sh $UPDATE_DIR/salt/salt/scripts/bootstrap-salt.sh -F -M -x python3 stable "$NEWSALTVERSION"
|
set +e
|
||||||
|
run_check_net_err \
|
||||||
|
"sh $UPDATE_DIR/salt/salt/scripts/bootstrap-salt.sh -F -M -x python3 stable \"$NEWSALTVERSION\"" \
|
||||||
|
"Could not update salt, please check $SOUP_LOG for details."
|
||||||
|
set -e
|
||||||
echo "Applying apt hold for Salt."
|
echo "Applying apt hold for Salt."
|
||||||
echo ""
|
echo ""
|
||||||
apt-mark hold "salt-common"
|
apt-mark hold "salt-common"
|
||||||
@@ -642,7 +766,7 @@ verify_latest_update_script() {
|
|||||||
cp $UPDATE_DIR/salt/common/tools/sbin/soup $DEFAULT_SALT_DIR/salt/common/tools/sbin/
|
cp $UPDATE_DIR/salt/common/tools/sbin/soup $DEFAULT_SALT_DIR/salt/common/tools/sbin/
|
||||||
cp $UPDATE_DIR/salt/common/tools/sbin/so-common $DEFAULT_SALT_DIR/salt/common/tools/sbin/
|
cp $UPDATE_DIR/salt/common/tools/sbin/so-common $DEFAULT_SALT_DIR/salt/common/tools/sbin/
|
||||||
cp $UPDATE_DIR/salt/common/tools/sbin/so-image-common $DEFAULT_SALT_DIR/salt/common/tools/sbin/
|
cp $UPDATE_DIR/salt/common/tools/sbin/so-image-common $DEFAULT_SALT_DIR/salt/common/tools/sbin/
|
||||||
salt-call state.apply common queue=True
|
salt-call state.apply -l info common queue=True
|
||||||
echo ""
|
echo ""
|
||||||
echo "soup has been updated. Please run soup again."
|
echo "soup has been updated. Please run soup again."
|
||||||
exit 0
|
exit 0
|
||||||
@@ -650,7 +774,11 @@ verify_latest_update_script() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
main() {
|
main() {
|
||||||
echo "### Preparing soup at `date` ###"
|
set -e
|
||||||
|
set +e
|
||||||
|
trap 'check_err $?' EXIT
|
||||||
|
|
||||||
|
echo "### Preparing soup at $(date) ###"
|
||||||
while getopts ":b" opt; do
|
while getopts ":b" opt; do
|
||||||
case "$opt" in
|
case "$opt" in
|
||||||
b ) # process option b
|
b ) # process option b
|
||||||
@@ -671,29 +799,30 @@ echo "Checking to see if this is a manager."
|
|||||||
echo ""
|
echo ""
|
||||||
require_manager
|
require_manager
|
||||||
set_minionid
|
set_minionid
|
||||||
echo "Checking to see if this is an airgap install"
|
echo "Checking to see if this is an airgap install."
|
||||||
echo ""
|
echo ""
|
||||||
check_airgap
|
check_airgap
|
||||||
echo "Found that Security Onion $INSTALLEDVERSION is currently installed."
|
echo "Found that Security Onion $INSTALLEDVERSION is currently installed."
|
||||||
echo ""
|
echo ""
|
||||||
set_os
|
if [[ $is_airgap -eq 0 ]]; then
|
||||||
set_palette
|
|
||||||
check_elastic_license
|
|
||||||
echo ""
|
|
||||||
if [ $is_airgap -eq 0 ]; then
|
|
||||||
# Let's mount the ISO since this is airgap
|
# Let's mount the ISO since this is airgap
|
||||||
|
echo "This is airgap. Ask for a location."
|
||||||
airgap_mounted
|
airgap_mounted
|
||||||
else
|
else
|
||||||
echo "Cloning Security Onion github repo into $UPDATE_DIR."
|
echo "Cloning Security Onion github repo into $UPDATE_DIR."
|
||||||
echo "Removing previous upgrade sources."
|
echo "Removing previous upgrade sources."
|
||||||
rm -rf $UPDATE_DIR
|
rm -rf $UPDATE_DIR
|
||||||
|
echo "Cloning the Security Onion Repo."
|
||||||
clone_to_tmp
|
clone_to_tmp
|
||||||
fi
|
fi
|
||||||
check_os_updates
|
|
||||||
echo ""
|
|
||||||
echo "Verifying we have the latest soup script."
|
echo "Verifying we have the latest soup script."
|
||||||
verify_latest_update_script
|
verify_latest_update_script
|
||||||
echo ""
|
echo ""
|
||||||
|
set_os
|
||||||
|
set_palette
|
||||||
|
check_elastic_license
|
||||||
|
echo ""
|
||||||
|
check_os_updates
|
||||||
|
|
||||||
echo "Generating new repo archive"
|
echo "Generating new repo archive"
|
||||||
generate_and_clean_tarballs
|
generate_and_clean_tarballs
|
||||||
@@ -709,7 +838,7 @@ upgrade_space
|
|||||||
|
|
||||||
echo "Checking for Salt Master and Minion updates."
|
echo "Checking for Salt Master and Minion updates."
|
||||||
upgrade_check_salt
|
upgrade_check_salt
|
||||||
|
set -e
|
||||||
|
|
||||||
if [ "$is_hotfix" == "true" ]; then
|
if [ "$is_hotfix" == "true" ]; then
|
||||||
echo "Applying $HOTFIXVERSION"
|
echo "Applying $HOTFIXVERSION"
|
||||||
@@ -717,37 +846,40 @@ if [ "$is_hotfix" == "true" ]; then
|
|||||||
echo ""
|
echo ""
|
||||||
update_version
|
update_version
|
||||||
salt-call state.highstate -l info queue=True
|
salt-call state.highstate -l info queue=True
|
||||||
|
|
||||||
else
|
else
|
||||||
echo ""
|
echo ""
|
||||||
echo "Performing upgrade from Security Onion $INSTALLEDVERSION to Security Onion $NEWVERSION."
|
echo "Performing upgrade from Security Onion $INSTALLEDVERSION to Security Onion $NEWVERSION."
|
||||||
echo ""
|
echo ""
|
||||||
|
|
||||||
echo "Updating dockers to $NEWVERSION."
|
echo "Updating dockers to $NEWVERSION."
|
||||||
if [ $is_airgap -eq 0 ]; then
|
if [[ $is_airgap -eq 0 ]]; then
|
||||||
airgap_update_dockers
|
airgap_update_dockers
|
||||||
update_centos_repo
|
update_centos_repo
|
||||||
yum clean all
|
yum clean all
|
||||||
check_os_updates
|
check_os_updates
|
||||||
else
|
else
|
||||||
update_registry
|
update_registry
|
||||||
|
set +e
|
||||||
update_docker_containers "soup"
|
update_docker_containers "soup"
|
||||||
|
set -e
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo ""
|
echo ""
|
||||||
echo "Stopping Salt Minion service."
|
echo "Stopping Salt Minion service."
|
||||||
systemctl stop salt-minion
|
systemctl stop salt-minion
|
||||||
echo "Killing any remaining Salt Minion processes."
|
echo "Killing any remaining Salt Minion processes."
|
||||||
|
set +e
|
||||||
pkill -9 -ef /usr/bin/salt-minion
|
pkill -9 -ef /usr/bin/salt-minion
|
||||||
|
set -e
|
||||||
echo ""
|
echo ""
|
||||||
echo "Stopping Salt Master service."
|
echo "Stopping Salt Master service."
|
||||||
systemctl stop salt-master
|
systemctl stop salt-master
|
||||||
echo ""
|
echo ""
|
||||||
|
|
||||||
preupgrade_changes_2.3.50_repo
|
upgrade_to_2.3.50_repo
|
||||||
|
|
||||||
# Does salt need upgraded. If so update it.
|
# Does salt need upgraded. If so update it.
|
||||||
if [ "$UPGRADESALT" == "1" ]; then
|
if [[ $UPGRADESALT -eq 1 ]]; then
|
||||||
echo "Upgrading Salt"
|
echo "Upgrading Salt"
|
||||||
# Update the repo files so it can actually upgrade
|
# Update the repo files so it can actually upgrade
|
||||||
upgrade_salt
|
upgrade_salt
|
||||||
@@ -756,7 +888,7 @@ else
|
|||||||
echo "Checking if Salt was upgraded."
|
echo "Checking if Salt was upgraded."
|
||||||
echo ""
|
echo ""
|
||||||
# Check that Salt was upgraded
|
# Check that Salt was upgraded
|
||||||
SALTVERSIONPOSTUPGRADE=$(salt --versions-report | grep Salt: | awk {'print $2'})
|
SALTVERSIONPOSTUPGRADE=$(salt --versions-report | grep Salt: | awk '{print $2}')
|
||||||
if [[ "$SALTVERSIONPOSTUPGRADE" != "$NEWSALTVERSION" ]]; then
|
if [[ "$SALTVERSIONPOSTUPGRADE" != "$NEWSALTVERSION" ]]; then
|
||||||
echo "Salt upgrade failed. Check of indicators of failure in $SOUP_LOG."
|
echo "Salt upgrade failed. Check of indicators of failure in $SOUP_LOG."
|
||||||
echo "Once the issue is resolved, run soup again."
|
echo "Once the issue is resolved, run soup again."
|
||||||
@@ -771,13 +903,13 @@ else
|
|||||||
preupgrade_changes
|
preupgrade_changes
|
||||||
echo ""
|
echo ""
|
||||||
|
|
||||||
if [ $is_airgap -eq 0 ]; then
|
if [[ $is_airgap -eq 0 ]]; then
|
||||||
echo "Updating Rule Files to the Latest."
|
echo "Updating Rule Files to the Latest."
|
||||||
update_airgap_rules
|
update_airgap_rules
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Only update the repo if its airgap
|
# Only update the repo if its airgap
|
||||||
if [[ $is_airgap -eq 0 ]] && [[ "$UPGRADESALT" != "1" ]]; then
|
if [[ $is_airgap -eq 0 && $UPGRADESALT -ne 1 ]]; then
|
||||||
update_centos_repo
|
update_centos_repo
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -795,6 +927,17 @@ else
|
|||||||
echo "Starting Salt Master service."
|
echo "Starting Salt Master service."
|
||||||
systemctl start salt-master
|
systemctl start salt-master
|
||||||
|
|
||||||
|
# Testing that salt-master is up by checking that is it connected to itself
|
||||||
|
set +e
|
||||||
|
echo "Waiting on the Salt Master service to be ready."
|
||||||
|
salt-call state.show_top -l error queue=True || fail "salt-master could not be reached. Check $SOUP_LOG for details."
|
||||||
|
set -e
|
||||||
|
|
||||||
|
echo ""
|
||||||
|
echo "Ensuring python modules for Salt are installed and patched."
|
||||||
|
salt-call state.apply salt.python3-influxdb -l info queue=True
|
||||||
|
echo ""
|
||||||
|
|
||||||
# Only regenerate osquery packages if Fleet is enabled
|
# Only regenerate osquery packages if Fleet is enabled
|
||||||
FLEET_MANAGER=$(lookup_pillar fleet_manager)
|
FLEET_MANAGER=$(lookup_pillar fleet_manager)
|
||||||
FLEET_NODE=$(lookup_pillar fleet_node)
|
FLEET_NODE=$(lookup_pillar fleet_node)
|
||||||
@@ -807,7 +950,9 @@ else
|
|||||||
|
|
||||||
echo ""
|
echo ""
|
||||||
echo "Running a highstate to complete the Security Onion upgrade on this manager. This could take several minutes."
|
echo "Running a highstate to complete the Security Onion upgrade on this manager. This could take several minutes."
|
||||||
|
set +e
|
||||||
salt-call state.highstate -l info queue=True
|
salt-call state.highstate -l info queue=True
|
||||||
|
set -e
|
||||||
echo ""
|
echo ""
|
||||||
echo "Upgrade from $INSTALLEDVERSION to $NEWVERSION complete."
|
echo "Upgrade from $INSTALLEDVERSION to $NEWVERSION complete."
|
||||||
|
|
||||||
@@ -820,14 +965,21 @@ else
|
|||||||
echo ""
|
echo ""
|
||||||
echo "Starting Salt Master service."
|
echo "Starting Salt Master service."
|
||||||
systemctl start salt-master
|
systemctl start salt-master
|
||||||
|
|
||||||
|
set +e
|
||||||
|
echo "Waiting on the Salt Master service to be ready."
|
||||||
|
salt-call state.show_top -l error queue=True || fail "salt-master could not be reached. Check $SOUP_LOG for details."
|
||||||
|
set -e
|
||||||
|
|
||||||
echo "Running a highstate. This could take several minutes."
|
echo "Running a highstate. This could take several minutes."
|
||||||
salt-call state.highstate -l info queue=True
|
salt-call state.highstate -l info queue=True
|
||||||
postupgrade_changes
|
postupgrade_changes
|
||||||
unmount_update
|
[[ $is_airgap -eq 0 ]] && unmount_update
|
||||||
thehive_maint
|
thehive_maint
|
||||||
|
|
||||||
if [ "$UPGRADESALT" == "1" ]; then
|
NUM_MINIONS=$(ls /opt/so/saltstack/local/pillar/minions/*_*.sls | wc -l)
|
||||||
if [ $is_airgap -eq 0 ]; then
|
if [[ $UPGRADESALT -eq 1 ]] && [[ $NUM_MINIONS -gt 1 ]]; then
|
||||||
|
if [[ $is_airgap -eq 0 ]]; then
|
||||||
echo ""
|
echo ""
|
||||||
echo "Cleaning repos on remote Security Onion nodes."
|
echo "Cleaning repos on remote Security Onion nodes."
|
||||||
salt -C 'not *_eval and not *_helixsensor and not *_manager and not *_managersearch and not *_standalone and G@os:CentOS' cmd.run "yum clean all"
|
salt -C 'not *_eval and not *_helixsensor and not *_manager and not *_managersearch and not *_standalone and G@os:CentOS' cmd.run "yum clean all"
|
||||||
@@ -835,6 +987,8 @@ else
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
check_local_mods
|
||||||
|
|
||||||
check_sudoers
|
check_sudoers
|
||||||
|
|
||||||
if [[ -n $lsl_msg ]]; then
|
if [[ -n $lsl_msg ]]; then
|
||||||
@@ -853,9 +1007,7 @@ else
|
|||||||
esac
|
esac
|
||||||
fi
|
fi
|
||||||
|
|
||||||
NUM_MINIONS=$(ls /opt/so/saltstack/local/pillar/minions/*_*.sls | wc -l)
|
if [[ $NUM_MINIONS -gt 1 ]]; then
|
||||||
|
|
||||||
if [ $NUM_MINIONS -gt 1 ]; then
|
|
||||||
|
|
||||||
cat << EOF
|
cat << EOF
|
||||||
|
|
||||||
@@ -874,7 +1026,7 @@ EOF
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "### soup has been served at `date` ###"
|
echo "### soup has been served at $(date) ###"
|
||||||
}
|
}
|
||||||
|
|
||||||
cat << EOF
|
cat << EOF
|
||||||
@@ -889,6 +1041,7 @@ Press Enter to continue or Ctrl-C to cancel.
|
|||||||
|
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
read input
|
read -r input
|
||||||
|
|
||||||
main "$@" | tee -a $SOUP_LOG
|
main "$@" | tee -a $SOUP_LOG
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
{%- if grains['role'] in ['so-node', 'so-heavynode'] %}
|
{%- if grains['role'] in ['so-node', 'so-heavynode'] %}
|
||||||
{%- set ELASTICSEARCH_HOST = salt['pillar.get']('elasticsearch:mainip', '') -%}
|
{%- set ELASTICSEARCH_HOST = salt['pillar.get']('elasticsearch:mainip', '') -%}
|
||||||
{%- set ELASTICSEARCH_PORT = salt['pillar.get']('elasticsearch:es_port', '') -%}
|
{%- set ELASTICSEARCH_PORT = salt['pillar.get']('elasticsearch:es_port', '') -%}
|
||||||
{%- elif grains['role'] in ['so-eval', 'so-managersearch', 'so-standalone'] %}
|
{%- elif grains['role'] in ['so-eval', 'so-managersearch', 'so-standalone', 'so-manager'] %}
|
||||||
{%- set ELASTICSEARCH_HOST = salt['pillar.get']('manager:mainip', '') -%}
|
{%- set ELASTICSEARCH_HOST = salt['pillar.get']('manager:mainip', '') -%}
|
||||||
{%- set ELASTICSEARCH_PORT = salt['pillar.get']('manager:es_port', '') -%}
|
{%- set ELASTICSEARCH_PORT = salt['pillar.get']('manager:es_port', '') -%}
|
||||||
{%- endif -%}
|
{%- endif -%}
|
||||||
@@ -34,7 +34,7 @@ overlimit() {
|
|||||||
|
|
||||||
closedindices() {
|
closedindices() {
|
||||||
|
|
||||||
INDICES=$(curl -s -k https://{{ELASTICSEARCH_HOST}}:{{ELASTICSEARCH_PORT}}/_cat/indices?h=index\&expand_wildcards=closed 2> /dev/null)
|
INDICES=$({{ ELASTICCURL }} -s -k https://{{ELASTICSEARCH_HOST}}:{{ELASTICSEARCH_PORT}}/_cat/indices?h=index\&expand_wildcards=closed 2> /dev/null)
|
||||||
[ $? -eq 1 ] && return false
|
[ $? -eq 1 ] && return false
|
||||||
echo ${INDICES} | grep -q -E "(logstash-|so-)"
|
echo ${INDICES} | grep -q -E "(logstash-|so-)"
|
||||||
}
|
}
|
||||||
@@ -49,10 +49,10 @@ while overlimit && closedindices; do
|
|||||||
# First, get the list of closed indices using _cat/indices?h=index\&expand_wildcards=closed.
|
# First, get the list of closed indices using _cat/indices?h=index\&expand_wildcards=closed.
|
||||||
# Then, sort by date by telling sort to use hyphen as delimiter and then sort on the third field.
|
# Then, sort by date by telling sort to use hyphen as delimiter and then sort on the third field.
|
||||||
# Finally, select the first entry in that sorted list.
|
# Finally, select the first entry in that sorted list.
|
||||||
OLDEST_INDEX=$(curl -s -k https://{{ELASTICSEARCH_HOST}}:{{ELASTICSEARCH_PORT}}/_cat/indices?h=index\&expand_wildcards=closed | grep -E "(logstash-|so-)" | sort -t- -k3 | head -1)
|
OLDEST_INDEX=$({{ ELASTICCURL }} -s -k https://{{ELASTICSEARCH_HOST}}:{{ELASTICSEARCH_PORT}}/_cat/indices?h=index\&expand_wildcards=closed | grep -E "(logstash-|so-)" | sort -t- -k3 | head -1)
|
||||||
|
|
||||||
# Now that we've determined OLDEST_INDEX, ask Elasticsearch to delete it.
|
# Now that we've determined OLDEST_INDEX, ask Elasticsearch to delete it.
|
||||||
curl -XDELETE -k https://{{ELASTICSEARCH_HOST}}:{{ELASTICSEARCH_PORT}}/${OLDEST_INDEX}
|
{{ ELASTICCURL }} -XDELETE -k https://{{ELASTICSEARCH_HOST}}:{{ELASTICSEARCH_PORT}}/${OLDEST_INDEX}
|
||||||
|
|
||||||
# Finally, write a log entry that says we deleted it.
|
# Finally, write a log entry that says we deleted it.
|
||||||
echo "$(date) - Used disk space exceeds LOG_SIZE_LIMIT ({{LOG_SIZE_LIMIT}} GB) - Index ${OLDEST_INDEX} deleted ..." >> ${LOG}
|
echo "$(date) - Used disk space exceeds LOG_SIZE_LIMIT ({{LOG_SIZE_LIMIT}} GB) - Index ${OLDEST_INDEX} deleted ..." >> ${LOG}
|
||||||
|
|||||||
@@ -1,8 +1,15 @@
|
|||||||
{% if grains['role'] in ['so-node', 'so-heavynode'] %}
|
{% if grains['role'] in ['so-node', 'so-heavynode'] %}
|
||||||
{%- set elasticsearch = salt['pillar.get']('elasticsearch:mainip', '') -%}
|
{%- set elasticsearch = salt['pillar.get']('elasticsearch:mainip', '') -%}
|
||||||
{% elif grains['role'] in ['so-eval', 'so-managersearch', 'so-standalone'] %}
|
{% elif grains['role'] in ['so-eval', 'so-managersearch', 'so-standalone', 'so-manager'] %}
|
||||||
{%- set elasticsearch = salt['pillar.get']('manager:mainip', '') -%}
|
{%- set elasticsearch = salt['pillar.get']('manager:mainip', '') -%}
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
|
{%- if salt['pillar.get']('elasticsearch:auth:enabled') is sameas true %}
|
||||||
|
{%- set ES_USER = salt['pillar.get']('elasticsearch:auth:users:so_elastic_user:user', '') %}
|
||||||
|
{%- set ES_PASS = salt['pillar.get']('elasticsearch:auth:users:so_elastic_user:pass', '') %}
|
||||||
|
{%- else %}
|
||||||
|
{%- set ES_USER = '' %}
|
||||||
|
{%- set ES_PASS = '' %}
|
||||||
|
{%- endif %}
|
||||||
|
|
||||||
---
|
---
|
||||||
# Remember, leave a key empty if there is no value. None will be a string,
|
# Remember, leave a key empty if there is no value. None will be a string,
|
||||||
@@ -11,13 +18,15 @@ client:
|
|||||||
hosts:
|
hosts:
|
||||||
- {{elasticsearch}}
|
- {{elasticsearch}}
|
||||||
port: 9200
|
port: 9200
|
||||||
|
{%- if salt['pillar.get']('elasticsearch:auth:enabled') is sameas true %}
|
||||||
|
http_auth: {{ ES_USER }}:{{ ES_PASS }}
|
||||||
|
{%- endif %}
|
||||||
url_prefix:
|
url_prefix:
|
||||||
use_ssl: True
|
use_ssl: True
|
||||||
certificate:
|
certificate:
|
||||||
client_cert:
|
client_cert:
|
||||||
client_key:
|
client_key:
|
||||||
ssl_no_validate: True
|
ssl_no_validate: True
|
||||||
http_auth:
|
|
||||||
timeout: 30
|
timeout: 30
|
||||||
master_only: False
|
master_only: False
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,10 @@
|
|||||||
{% set VERSION = salt['pillar.get']('global:soversion', 'HH1.2.2') %}
|
{% set VERSION = salt['pillar.get']('global:soversion', 'HH1.2.2') %}
|
||||||
{% set IMAGEREPO = salt['pillar.get']('global:imagerepo') %}
|
{% set IMAGEREPO = salt['pillar.get']('global:imagerepo') %}
|
||||||
{% set MANAGER = salt['grains.get']('master') %}
|
{% set MANAGER = salt['grains.get']('master') %}
|
||||||
{% if grains['role'] in ['so-eval', 'so-node', 'so-managersearch', 'so-heavynode', 'so-standalone'] %}
|
{% set REMOVECURATORCRON = False %}
|
||||||
|
{% if grains['role'] in ['so-eval', 'so-node', 'so-managersearch', 'so-heavynode', 'so-standalone', 'so-manager'] %}
|
||||||
|
{% from 'elasticsearch/auth.map.jinja' import ELASTICAUTH with context %}
|
||||||
|
{% from "curator/map.jinja" import CURATOROPTIONS with context %}
|
||||||
# Curator
|
# Curator
|
||||||
# Create the group
|
# Create the group
|
||||||
curatorgroup:
|
curatorgroup:
|
||||||
@@ -48,6 +51,7 @@ curconf:
|
|||||||
- source: salt://curator/files/curator.yml
|
- source: salt://curator/files/curator.yml
|
||||||
- user: 934
|
- user: 934
|
||||||
- group: 939
|
- group: 939
|
||||||
|
- mode: 660
|
||||||
- template: jinja
|
- template: jinja
|
||||||
|
|
||||||
curcloseddel:
|
curcloseddel:
|
||||||
@@ -66,6 +70,8 @@ curcloseddeldel:
|
|||||||
- group: 939
|
- group: 939
|
||||||
- mode: 755
|
- mode: 755
|
||||||
- template: jinja
|
- template: jinja
|
||||||
|
- defaults:
|
||||||
|
ELASTICCURL: {{ ELASTICAUTH.elasticcurl }}
|
||||||
|
|
||||||
curclose:
|
curclose:
|
||||||
file.managed:
|
file.managed:
|
||||||
@@ -83,6 +89,81 @@ curdel:
|
|||||||
- group: 939
|
- group: 939
|
||||||
- mode: 755
|
- mode: 755
|
||||||
|
|
||||||
|
so-curator:
|
||||||
|
docker_container.{{ CURATOROPTIONS.status }}:
|
||||||
|
{% if CURATOROPTIONS.status == 'running' %}
|
||||||
|
- image: {{ MANAGER }}:5000/{{ IMAGEREPO }}/so-curator:{{ VERSION }}
|
||||||
|
- start: {{ CURATOROPTIONS.start }}
|
||||||
|
- hostname: curator
|
||||||
|
- name: so-curator
|
||||||
|
- user: curator
|
||||||
|
- interactive: True
|
||||||
|
- tty: True
|
||||||
|
- binds:
|
||||||
|
- /opt/so/conf/curator/curator.yml:/etc/curator/config/curator.yml:ro
|
||||||
|
- /opt/so/conf/curator/action/:/etc/curator/action:ro
|
||||||
|
- /opt/so/log/curator:/var/log/curator:rw
|
||||||
|
- require:
|
||||||
|
- file: actionconfs
|
||||||
|
- file: curconf
|
||||||
|
- file: curlogdir
|
||||||
|
{% else %}
|
||||||
|
- force: True
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% if CURATOROPTIONS.manage_sostatus %}
|
||||||
|
append_so-curator_so-status.conf:
|
||||||
|
file.append:
|
||||||
|
- name: /opt/so/conf/so-status/so-status.conf
|
||||||
|
- text: so-curator
|
||||||
|
- unless: grep -q so-curator /opt/so/conf/so-status/so-status.conf
|
||||||
|
|
||||||
|
{% if not CURATOROPTIONS.start %}
|
||||||
|
so-curator_so-status.disabled:
|
||||||
|
file.comment:
|
||||||
|
- name: /opt/so/conf/so-status/so-status.conf
|
||||||
|
- regex: ^so-curator$
|
||||||
|
|
||||||
|
# need to remove cronjobs here since curator is disabled
|
||||||
|
{% set REMOVECURATORCRON = True %}
|
||||||
|
{% else %}
|
||||||
|
delete_so-curator_so-status.disabled:
|
||||||
|
file.uncomment:
|
||||||
|
- name: /opt/so/conf/so-status/so-status.conf
|
||||||
|
- regex: ^so-curator$
|
||||||
|
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% else %}
|
||||||
|
delete_so-curator_so-status:
|
||||||
|
file.line:
|
||||||
|
- name: /opt/so/conf/so-status/so-status.conf
|
||||||
|
- match: ^so-curator$
|
||||||
|
- mode: delete
|
||||||
|
|
||||||
|
# need to remove cronjobs here since curator is disabled
|
||||||
|
{% set REMOVECURATORCRON = True %}
|
||||||
|
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% if REMOVECURATORCRON %}
|
||||||
|
so-curatorcloseddeletecron:
|
||||||
|
cron.absent:
|
||||||
|
- name: /usr/sbin/so-curator-closed-delete > /opt/so/log/curator/cron-closed-delete.log 2>&1
|
||||||
|
- user: root
|
||||||
|
|
||||||
|
so-curatorclosecron:
|
||||||
|
cron.absent:
|
||||||
|
- name: /usr/sbin/so-curator-close > /opt/so/log/curator/cron-close.log 2>&1
|
||||||
|
- user: root
|
||||||
|
|
||||||
|
so-curatordeletecron:
|
||||||
|
cron.absent:
|
||||||
|
- name: /usr/sbin/so-curator-delete > /opt/so/log/curator/cron-delete.log 2>&1
|
||||||
|
- user: root
|
||||||
|
|
||||||
|
{% else %}
|
||||||
|
|
||||||
so-curatorcloseddeletecron:
|
so-curatorcloseddeletecron:
|
||||||
cron.present:
|
cron.present:
|
||||||
- name: /usr/sbin/so-curator-closed-delete > /opt/so/log/curator/cron-closed-delete.log 2>&1
|
- name: /usr/sbin/so-curator-closed-delete > /opt/so/log/curator/cron-closed-delete.log 2>&1
|
||||||
@@ -113,23 +194,7 @@ so-curatordeletecron:
|
|||||||
- month: '*'
|
- month: '*'
|
||||||
- dayweek: '*'
|
- dayweek: '*'
|
||||||
|
|
||||||
so-curator:
|
{% endif %}
|
||||||
docker_container.running:
|
|
||||||
- image: {{ MANAGER }}:5000/{{ IMAGEREPO }}/so-curator:{{ VERSION }}
|
|
||||||
- hostname: curator
|
|
||||||
- name: so-curator
|
|
||||||
- user: curator
|
|
||||||
- interactive: True
|
|
||||||
- tty: True
|
|
||||||
- binds:
|
|
||||||
- /opt/so/conf/curator/curator.yml:/etc/curator/config/curator.yml:ro
|
|
||||||
- /opt/so/conf/curator/action/:/etc/curator/action:ro
|
|
||||||
- /opt/so/log/curator:/var/log/curator:rw
|
|
||||||
|
|
||||||
append_so-curator_so-status.conf:
|
|
||||||
file.append:
|
|
||||||
- name: /opt/so/conf/so-status/so-status.conf
|
|
||||||
- text: so-curator
|
|
||||||
|
|
||||||
# Begin Curator Cron Jobs
|
# Begin Curator Cron Jobs
|
||||||
|
|
||||||
|
|||||||
16
salt/curator/map.jinja
Normal file
16
salt/curator/map.jinja
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
{% set CURATOROPTIONS = {} %}
|
||||||
|
{% set ENABLED = salt['pillar.get']('curator:enabled', True) %}
|
||||||
|
{% set TRUECLUSTER = salt['pillar.get']('elasticsearch:true_cluster', False) %}
|
||||||
|
{% do CURATOROPTIONS.update({'manage_sostatus': True}) %}
|
||||||
|
|
||||||
|
# don't start the docker container if curator is disabled via pillar
|
||||||
|
{% if not ENABLED or grains.id.split('_')|last == 'manager'%}
|
||||||
|
{% do CURATOROPTIONS.update({'start': False}) %}
|
||||||
|
{% do CURATOROPTIONS.update({'status': 'absent'}) %}
|
||||||
|
{% if grains.id.split('_')|last == 'manager' %}
|
||||||
|
{% do CURATOROPTIONS.update({'manage_sostatus': False}) %}
|
||||||
|
{% endif %}
|
||||||
|
{% else %}
|
||||||
|
{% do CURATOROPTIONS.update({'start': True}) %}
|
||||||
|
{% do CURATOROPTIONS.update({'status': 'running'}) %}
|
||||||
|
{% endif %}
|
||||||
@@ -1,3 +1,5 @@
|
|||||||
|
{%- set ES_USER = salt['pillar.get']('elasticsearch:auth:users:so_elastic_user:user', '') %}
|
||||||
|
{%- set ES_PASS = salt['pillar.get']('elasticsearch:auth:users:so_elastic_user:pass', '') %}
|
||||||
elastalert:
|
elastalert:
|
||||||
config:
|
config:
|
||||||
rules_folder: /opt/elastalert/rules/
|
rules_folder: /opt/elastalert/rules/
|
||||||
@@ -19,8 +21,10 @@ elastalert:
|
|||||||
use_ssl: true
|
use_ssl: true
|
||||||
verify_certs: false
|
verify_certs: false
|
||||||
#es_send_get_body_as: GET
|
#es_send_get_body_as: GET
|
||||||
#es_username: someusername
|
{%- if salt['pillar.get']('elasticsearch:auth:enabled') is sameas true %}
|
||||||
#es_password: somepassword
|
es_username: {{ ES_USER }}
|
||||||
|
es_password: {{ ES_PASS }}
|
||||||
|
{%- endif %}
|
||||||
writeback_index: elastalert_status
|
writeback_index: elastalert_status
|
||||||
alert_time_limit:
|
alert_time_limit:
|
||||||
days: 2
|
days: 2
|
||||||
|
|||||||
@@ -12,16 +12,21 @@ class PlaybookESAlerter(Alerter):
|
|||||||
Use matched data to create alerts in elasticsearch
|
Use matched data to create alerts in elasticsearch
|
||||||
"""
|
"""
|
||||||
|
|
||||||
required_options = set(['play_title','play_url','sigma_level','elasticsearch_host'])
|
required_options = set(['play_title','play_url','sigma_level'])
|
||||||
|
|
||||||
def alert(self, matches):
|
def alert(self, matches):
|
||||||
for match in matches:
|
for match in matches:
|
||||||
today = strftime("%Y.%m.%d", gmtime())
|
today = strftime("%Y.%m.%d", gmtime())
|
||||||
timestamp = strftime("%Y-%m-%d"'T'"%H:%M:%S"'.000Z', gmtime())
|
timestamp = strftime("%Y-%m-%d"'T'"%H:%M:%S"'.000Z', gmtime())
|
||||||
headers = {"Content-Type": "application/json"}
|
headers = {"Content-Type": "application/json"}
|
||||||
|
|
||||||
|
creds = None
|
||||||
|
if 'es_username' in self.rule and 'es_password' in self.rule:
|
||||||
|
creds = (self.rule['es_username'], self.rule['es_password'])
|
||||||
|
|
||||||
payload = {"rule": { "name": self.rule['play_title'],"case_template": self.rule['play_id'],"uuid": self.rule['play_id'],"category": self.rule['rule.category']},"event":{ "severity": self.rule['event.severity'],"module": self.rule['event.module'],"dataset": self.rule['event.dataset'],"severity_label": self.rule['sigma_level']},"kibana_pivot": self.rule['kibana_pivot'],"soc_pivot": self.rule['soc_pivot'],"play_url": self.rule['play_url'],"sigma_level": self.rule['sigma_level'],"event_data": match, "@timestamp": timestamp}
|
payload = {"rule": { "name": self.rule['play_title'],"case_template": self.rule['play_id'],"uuid": self.rule['play_id'],"category": self.rule['rule.category']},"event":{ "severity": self.rule['event.severity'],"module": self.rule['event.module'],"dataset": self.rule['event.dataset'],"severity_label": self.rule['sigma_level']},"kibana_pivot": self.rule['kibana_pivot'],"soc_pivot": self.rule['soc_pivot'],"play_url": self.rule['play_url'],"sigma_level": self.rule['sigma_level'],"event_data": match, "@timestamp": timestamp}
|
||||||
url = f"https://{self.rule['elasticsearch_host']}/so-playbook-alerts-{today}/_doc/"
|
url = f"https://{self.rule['es_host']}:{self.rule['es_port']}/so-playbook-alerts-{today}/_doc/"
|
||||||
requests.post(url, data=json.dumps(payload), headers=headers, verify=False)
|
requests.post(url, data=json.dumps(payload), headers=headers, verify=False, auth=creds)
|
||||||
|
|
||||||
def get_info(self):
|
def get_info(self):
|
||||||
return {'type': 'PlaybookESAlerter'}
|
return {'type': 'PlaybookESAlerter'}
|
||||||
@@ -99,14 +99,12 @@ elastaconf:
|
|||||||
elastalert_config: {{ elastalert_config.elastalert.config }}
|
elastalert_config: {{ elastalert_config.elastalert.config }}
|
||||||
- user: 933
|
- user: 933
|
||||||
- group: 933
|
- group: 933
|
||||||
|
- mode: 660
|
||||||
- template: jinja
|
- template: jinja
|
||||||
|
|
||||||
wait_for_elasticsearch:
|
wait_for_elasticsearch:
|
||||||
module.run:
|
cmd.run:
|
||||||
- http.wait_for_successful_query:
|
- name: so-elasticsearch-wait
|
||||||
- url: 'https://{{MANAGER}}:9200/_cat/indices/.kibana*'
|
|
||||||
- wait_for: 180
|
|
||||||
- verify_ssl: False
|
|
||||||
|
|
||||||
so-elastalert:
|
so-elastalert:
|
||||||
docker_container.running:
|
docker_container.running:
|
||||||
@@ -123,7 +121,7 @@ so-elastalert:
|
|||||||
- extra_hosts:
|
- extra_hosts:
|
||||||
- {{MANAGER_URL}}:{{MANAGER_IP}}
|
- {{MANAGER_URL}}:{{MANAGER_IP}}
|
||||||
- require:
|
- require:
|
||||||
- module: wait_for_elasticsearch
|
- cmd: wait_for_elasticsearch
|
||||||
- watch:
|
- watch:
|
||||||
- file: elastaconf
|
- file: elastaconf
|
||||||
|
|
||||||
|
|||||||
7
salt/elasticsearch/auth.map.jinja
Normal file
7
salt/elasticsearch/auth.map.jinja
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
{% set ELASTICAUTH = salt['pillar.filter_by']({
|
||||||
|
True: {
|
||||||
|
'user': salt['pillar.get']('elasticsearch:auth:users:so_elastic_user:user'),
|
||||||
|
'pass': salt['pillar.get']('elasticsearch:auth:users:so_elastic_user:pass'),
|
||||||
|
'elasticcurl':'curl -K /opt/so/conf/elasticsearch/curl.config' },
|
||||||
|
False: {'elasticcurl': 'curl'},
|
||||||
|
}, pillar='elasticsearch:auth:enabled', default=False) %}
|
||||||
39
salt/elasticsearch/auth.sls
Normal file
39
salt/elasticsearch/auth.sls
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
{% set so_elastic_user_pass = salt['random.get_str'](20) %}
|
||||||
|
{% set so_kibana_user_pass = salt['random.get_str'](20) %}
|
||||||
|
{% set so_logstash_user_pass = salt['random.get_str'](20) %}
|
||||||
|
{% set so_beats_user_pass = salt['random.get_str'](20) %}
|
||||||
|
{% set so_monitor_user_pass = salt['random.get_str'](20) %}
|
||||||
|
|
||||||
|
elastic_auth_pillar:
|
||||||
|
file.managed:
|
||||||
|
- name: /opt/so/saltstack/local/pillar/elasticsearch/auth.sls
|
||||||
|
- mode: 600
|
||||||
|
- reload_pillar: True
|
||||||
|
- contents: |
|
||||||
|
elasticsearch:
|
||||||
|
auth:
|
||||||
|
enabled: False
|
||||||
|
users:
|
||||||
|
so_elastic_user:
|
||||||
|
user: so_elastic
|
||||||
|
pass: {{ so_elastic_user_pass }}
|
||||||
|
so_kibana_user:
|
||||||
|
user: so_kibana
|
||||||
|
pass: {{ so_kibana_user_pass }}
|
||||||
|
so_logstash_user:
|
||||||
|
user: so_logstash
|
||||||
|
pass: {{ so_logstash_user_pass }}
|
||||||
|
so_beats_user:
|
||||||
|
user: so_beats
|
||||||
|
pass: {{ so_beats_user_pass }}
|
||||||
|
so_monitor_user:
|
||||||
|
user: so_monitor
|
||||||
|
pass: {{ so_monitor_user_pass }}
|
||||||
|
# since we are generating a random password, and we don't want that to happen everytime
|
||||||
|
# a highstate runs, we only manage the file each user isn't present in the file. if the
|
||||||
|
# pillar file doesn't exists, then the default vault provided to pillar.get should not
|
||||||
|
# be within the file either, so it should then be created
|
||||||
|
- unless:
|
||||||
|
{% for so_app_user, values in salt['pillar.get']('elasticsearch:auth:users', {'so_noapp_user': {'user': 'r@NDumu53Rd0NtDOoP'}}).items() %}
|
||||||
|
- grep {{ values.user }} /opt/so/saltstack/local/pillar/elasticsearch/auth.sls
|
||||||
|
{% endfor%}
|
||||||
1
salt/elasticsearch/files/curl.config.template
Normal file
1
salt/elasticsearch/files/curl.config.template
Normal file
@@ -0,0 +1 @@
|
|||||||
|
user = "{{ salt['pillar.get']('elasticsearch:auth:users:so_elastic_user:user') }}:{{ salt['pillar.get']('elasticsearch:auth:users:so_elastic_user:pass') }}"
|
||||||
@@ -30,13 +30,15 @@ xpack.security.http.ssl.client_authentication: none
|
|||||||
xpack.security.http.ssl.key: /usr/share/elasticsearch/config/elasticsearch.key
|
xpack.security.http.ssl.key: /usr/share/elasticsearch/config/elasticsearch.key
|
||||||
xpack.security.http.ssl.certificate: /usr/share/elasticsearch/config/elasticsearch.crt
|
xpack.security.http.ssl.certificate: /usr/share/elasticsearch/config/elasticsearch.crt
|
||||||
xpack.security.http.ssl.certificate_authorities: /usr/share/elasticsearch/config/ca.crt
|
xpack.security.http.ssl.certificate_authorities: /usr/share/elasticsearch/config/ca.crt
|
||||||
|
{% if not salt['pillar.get']('elasticsearch:auth:enabled', False) %}
|
||||||
xpack.security.authc:
|
xpack.security.authc:
|
||||||
anonymous:
|
anonymous:
|
||||||
username: anonymous_user
|
username: anonymous_user
|
||||||
roles: superuser
|
roles: superuser
|
||||||
authz_exception: true
|
authz_exception: true
|
||||||
|
{% endif %}
|
||||||
node.name: {{ grains.host }}
|
node.name: {{ grains.host }}
|
||||||
script.max_compilations_rate: 1000/1m
|
script.max_compilations_rate: 20000/1m
|
||||||
{%- if TRUECLUSTER is sameas true %}
|
{%- if TRUECLUSTER is sameas true %}
|
||||||
{%- if grains.role == 'so-manager' %}
|
{%- if grains.role == 'so-manager' %}
|
||||||
{%- if salt['pillar.get']('nodestab', {}) %}
|
{%- if salt['pillar.get']('nodestab', {}) %}
|
||||||
@@ -47,6 +49,16 @@ discovery.seed_hosts:
|
|||||||
- {{ SN.split('_')|first }}
|
- {{ SN.split('_')|first }}
|
||||||
{%- endfor %}
|
{%- endfor %}
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
|
{%- elif grains.role == 'so-managersearch' %}
|
||||||
|
{%- if salt['pillar.get']('nodestab', {}) %}
|
||||||
|
node.roles: [ master, data, remote_cluster_client ]
|
||||||
|
discovery.seed_hosts:
|
||||||
|
- {{ grains.master }}
|
||||||
|
{%- for SN, SNDATA in salt['pillar.get']('nodestab', {}).items() %}
|
||||||
|
- {{ SN.split('_')|first }}
|
||||||
|
{%- endfor %}
|
||||||
|
{%- endif %}
|
||||||
|
node.attr.box_type: {{ NODE_ROUTE_TYPE }}
|
||||||
{%- else %}
|
{%- else %}
|
||||||
node.roles: {{ NODE_ROLES }}
|
node.roles: {{ NODE_ROLES }}
|
||||||
node.attr.box_type: {{ NODE_ROUTE_TYPE }}
|
node.attr.box_type: {{ NODE_ROUTE_TYPE }}
|
||||||
|
|||||||
@@ -51,7 +51,7 @@
|
|||||||
},
|
},
|
||||||
{ "set": { "field": "_index", "value": "so-firewall", "override": true } },
|
{ "set": { "field": "_index", "value": "so-firewall", "override": true } },
|
||||||
{ "set": { "if": "ctx.network?.transport_id == '0'", "field": "network.transport", "value": "icmp", "override": true } },
|
{ "set": { "if": "ctx.network?.transport_id == '0'", "field": "network.transport", "value": "icmp", "override": true } },
|
||||||
{"community_id": { "if": "ctx.network?.transport != null", "field":["source.ip","source.port","destination.ip","destination.port","network.transport"],"target_field":"network.community_id"}},
|
{"community_id": {} },
|
||||||
{ "set": { "field": "module", "value": "pfsense", "override": true } },
|
{ "set": { "field": "module", "value": "pfsense", "override": true } },
|
||||||
{ "set": { "field": "dataset", "value": "firewall", "override": true } },
|
{ "set": { "field": "dataset", "value": "firewall", "override": true } },
|
||||||
{ "remove": { "field": ["real_message", "ip_sub_msg", "firewall.sub_message"], "ignore_failure": true } }
|
{ "remove": { "field": ["real_message", "ip_sub_msg", "firewall.sub_message"], "ignore_failure": true } }
|
||||||
|
|||||||
29
salt/elasticsearch/files/ingest/logscan.alert
Normal file
29
salt/elasticsearch/files/ingest/logscan.alert
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
{
|
||||||
|
"description": "logscan",
|
||||||
|
"processors": [
|
||||||
|
{ "set": { "field": "event.severity", "value": 2 } },
|
||||||
|
{ "json": { "field": "message", "add_to_root": true, "ignore_failure": true } },
|
||||||
|
{ "rename": { "field": "@timestamp", "target_field": "event.ingested", "ignore_missing": true } },
|
||||||
|
{ "date": { "field": "timestamp", "target_field": "event.created", "formats": [ "ISO8601", "UNIX" ], "ignore_failure": true } },
|
||||||
|
{ "date": { "field": "start_time", "target_field": "@timestamp", "formats": [ "ISO8601", "UNIX" ], "ignore_failure": true } },
|
||||||
|
{ "date": { "field": "start_time", "target_field": "event.start", "formats": [ "ISO8601", "UNIX" ], "ignore_failure": true } },
|
||||||
|
{ "date": { "field": "end_time", "target_field": "event.end", "formats": [ "ISO8601", "UNIX" ], "ignore_failure": true } },
|
||||||
|
{ "remove": { "field": "start_time", "ignore_missing": true } },
|
||||||
|
{ "remove": { "field": "end_time", "ignore_missing": true } },
|
||||||
|
{ "rename": { "field": "source_ip", "target_field": "source.ip", "ignore_missing": true } },
|
||||||
|
{ "rename": { "field": "top_source_ips", "target_field": "logscan.source.ips", "ignore_missing": true } },
|
||||||
|
{ "append": { "if": "ctx.source != null", "field": "logscan.source.ips", "value": "{{{source.ip}}}", "ignore_failure": true } },
|
||||||
|
{ "set": { "if": "ctx.model == 'k1'", "field": "rule.name", "value": "LOGSCAN K1 MODEL THRESHOLD" } },
|
||||||
|
{ "set": { "if": "ctx.model == 'k1'", "field": "rule.description", "value": "High number of logins from single IP in 1 minute window" } },
|
||||||
|
{ "set": { "if": "ctx.model == 'k5'", "field": "rule.name", "value": "LOGSCAN K5 MODEL THRESHOLD" } },
|
||||||
|
{ "set": { "if": "ctx.model == 'k5'", "field": "rule.description", "value": "High ratio of login failures from single IP in 5 minute window" } },
|
||||||
|
{ "set": { "if": "ctx.model == 'k60'", "field": "rule.name", "value": "LOGSCAN K60 MODEL THRESHOLD" } },
|
||||||
|
{ "set": { "if": "ctx.model == 'k60'", "field": "rule.description", "value": "Large number of login failures in 1 hour window" } },
|
||||||
|
{ "rename": { "field": "model", "target_field": "logscan.model" } },
|
||||||
|
{ "rename": { "field": "num_attempts", "target_field": "logscan.attempts.total.amount", "ignore_missing": true } },
|
||||||
|
{ "rename": { "field": "num_failed", "target_field": "logscan.attempts.failed.amount", "ignore_missing": true } },
|
||||||
|
{ "script": { "lang": "painless", "source": "ctx.logscan.attempts.succeeded.amount = ctx.logscan.attempts.total.amount - ctx.logscan.attempts.failed.amount" , "ignore_failure": true} },
|
||||||
|
{ "rename": { "field": "avg_failure_interval", "target_field": "logscan.attempts.failed.avg_interval", "ignore_missing": true } },
|
||||||
|
{ "pipeline": { "name": "common" } }
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -33,6 +33,7 @@
|
|||||||
{ "rename": { "field": "data.win.eventdata.user", "target_field": "user.name", "ignore_missing": true } },
|
{ "rename": { "field": "data.win.eventdata.user", "target_field": "user.name", "ignore_missing": true } },
|
||||||
{ "rename": { "field": "data.win.system", "target_field": "winlog", "ignore_missing": true } },
|
{ "rename": { "field": "data.win.system", "target_field": "winlog", "ignore_missing": true } },
|
||||||
{ "rename": { "field": "data.win.eventdata", "target_field": "winlog.event_data", "ignore_missing": true } },
|
{ "rename": { "field": "data.win.eventdata", "target_field": "winlog.event_data", "ignore_missing": true } },
|
||||||
|
{ "rename": { "field": "data", "target_field": "wazuh.data", "ignore_missing": true } },
|
||||||
{ "rename": { "field": "winlog.eventID", "target_field": "winlog.event_id", "ignore_missing": true } },
|
{ "rename": { "field": "winlog.eventID", "target_field": "winlog.event_id", "ignore_missing": true } },
|
||||||
{ "rename": { "field": "predecoder.program_name", "target_field": "process.name", "ignore_missing": true } },
|
{ "rename": { "field": "predecoder.program_name", "target_field": "process.name", "ignore_missing": true } },
|
||||||
{ "rename": { "field": "decoder.name", "target_field": "event.dataset", "ignore_missing": true } },
|
{ "rename": { "field": "decoder.name", "target_field": "event.dataset", "ignore_missing": true } },
|
||||||
|
|||||||
@@ -8,6 +8,7 @@
|
|||||||
{ "rename": { "field": "scan.hash", "target_field": "hash", "ignore_missing": true } },
|
{ "rename": { "field": "scan.hash", "target_field": "hash", "ignore_missing": true } },
|
||||||
{ "rename": { "field": "scan.exiftool", "target_field": "exiftool", "ignore_missing": true } },
|
{ "rename": { "field": "scan.exiftool", "target_field": "exiftool", "ignore_missing": true } },
|
||||||
{ "grok": { "if": "ctx.request?.attributes?.filename != null", "field": "request.attributes.filename", "patterns": ["-%{WORD:log.id.fuid}-"], "ignore_failure": true } },
|
{ "grok": { "if": "ctx.request?.attributes?.filename != null", "field": "request.attributes.filename", "patterns": ["-%{WORD:log.id.fuid}-"], "ignore_failure": true } },
|
||||||
|
{ "gsub": { "if": "ctx.request?.attributes?.filename != null", "field": "request.attributes.filename", "pattern": "\/nsm\/strelka\/staging", "replacement": "\/nsm\/strelka\/processed" } },
|
||||||
{ "foreach":
|
{ "foreach":
|
||||||
{
|
{
|
||||||
"if": "ctx.exiftool?.keys !=null",
|
"if": "ctx.exiftool?.keys !=null",
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
{ "rename": { "field": "message2.dns.qr", "target_field": "dns.qr", "ignore_missing": true } },
|
{ "rename": { "field": "message2.dns.qr", "target_field": "dns.qr", "ignore_missing": true } },
|
||||||
{ "rename": { "field": "message2.dns.rd", "target_field": "dns.recursion.desired", "ignore_missing": true } },
|
{ "rename": { "field": "message2.dns.rd", "target_field": "dns.recursion.desired", "ignore_missing": true } },
|
||||||
{ "rename": { "field": "message2.dns.ra", "target_field": "dns.recursion.available", "ignore_missing": true } },
|
{ "rename": { "field": "message2.dns.ra", "target_field": "dns.recursion.available", "ignore_missing": true } },
|
||||||
{ "rename": { "field": "message2.dns.rcode", "target_field": "dns.response.code", "ignore_missing": true } },
|
{ "rename": { "field": "message2.dns.rcode", "target_field": "dns.response.code_name", "ignore_missing": true } },
|
||||||
{ "rename": { "field": "message2.grouped.A", "target_field": "dns.answers.data", "ignore_missing": true } },
|
{ "rename": { "field": "message2.grouped.A", "target_field": "dns.answers.data", "ignore_missing": true } },
|
||||||
{ "rename": { "field": "message2.grouped.CNAME", "target_field": "dns.answers.name", "ignore_missing": true } },
|
{ "rename": { "field": "message2.grouped.CNAME", "target_field": "dns.answers.name", "ignore_missing": true } },
|
||||||
{ "pipeline": { "if": "ctx.dns.query?.name != null && ctx.dns.query.name.contains('.')", "name": "dns.tld" } },
|
{ "pipeline": { "if": "ctx.dns.query?.name != null && ctx.dns.query.name.contains('.')", "name": "dns.tld" } },
|
||||||
|
|||||||
@@ -13,6 +13,7 @@
|
|||||||
{ "rename": { "field": "message2.fileinfo.size", "target_field": "file.size", "ignore_missing": true } },
|
{ "rename": { "field": "message2.fileinfo.size", "target_field": "file.size", "ignore_missing": true } },
|
||||||
{ "rename": { "field": "message2.fileinfo.state", "target_field": "file.state", "ignore_missing": true } },
|
{ "rename": { "field": "message2.fileinfo.state", "target_field": "file.state", "ignore_missing": true } },
|
||||||
{ "rename": { "field": "message2.fileinfo.stored", "target_field": "file.saved", "ignore_missing": true } },
|
{ "rename": { "field": "message2.fileinfo.stored", "target_field": "file.saved", "ignore_missing": true } },
|
||||||
|
{ "rename": { "field": "message2.fileinfo.sha256", "target_field": "hash.sha256", "ignore_missing": true } },
|
||||||
{ "set": { "if": "ctx.network?.protocol != null", "field": "file.source", "value": "{{network.protocol}}" } },
|
{ "set": { "if": "ctx.network?.protocol != null", "field": "file.source", "value": "{{network.protocol}}" } },
|
||||||
{ "pipeline": { "name": "common" } }
|
{ "pipeline": { "name": "common" } }
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
{
|
{
|
||||||
"description" : "sysmon",
|
"description" : "sysmon",
|
||||||
"processors" : [
|
"processors" : [
|
||||||
{"community_id": {"if": "ctx.winlog.event_data?.Protocol != null", "field":["winlog.event_data.SourceIp","winlog.event_data.SourcePort","winlog.event_data.DestinationIp","winlog.event_data.DestinationPort","winlog.event_data.Protocol"],"target_field":"network.community_id"}},
|
|
||||||
{ "set": { "field": "event.code", "value": "{{winlog.event_id}}", "override": true } },
|
{ "set": { "field": "event.code", "value": "{{winlog.event_id}}", "override": true } },
|
||||||
{ "set": { "field": "event.module", "value": "sysmon", "override": true } },
|
{ "set": { "field": "event.module", "value": "sysmon", "override": true } },
|
||||||
{ "set": { "if": "ctx.winlog?.computer_name != null", "field": "observer.name", "value": "{{winlog.computer_name}}", "override": true } },
|
{ "set": { "if": "ctx.winlog?.computer_name != null", "field": "observer.name", "value": "{{winlog.computer_name}}", "override": true } },
|
||||||
@@ -64,6 +63,7 @@
|
|||||||
{ "rename": { "field": "winlog.event_data.SourceIp", "target_field": "source.ip", "ignore_missing": true } },
|
{ "rename": { "field": "winlog.event_data.SourceIp", "target_field": "source.ip", "ignore_missing": true } },
|
||||||
{ "rename": { "field": "winlog.event_data.SourcePort", "target_field": "source.port", "ignore_missing": true } },
|
{ "rename": { "field": "winlog.event_data.SourcePort", "target_field": "source.port", "ignore_missing": true } },
|
||||||
{ "rename": { "field": "winlog.event_data.targetFilename", "target_field": "file.target", "ignore_missing": true } },
|
{ "rename": { "field": "winlog.event_data.targetFilename", "target_field": "file.target", "ignore_missing": true } },
|
||||||
{ "rename": { "field": "winlog.event_data.TargetFilename", "target_field": "file.target", "ignore_missing": true } }
|
{ "rename": { "field": "winlog.event_data.TargetFilename", "target_field": "file.target", "ignore_missing": true } },
|
||||||
|
{ "community_id": {} }
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,11 +8,11 @@
|
|||||||
{ "dot_expander": { "field": "id.orig_p", "path": "message2", "ignore_failure": true } },
|
{ "dot_expander": { "field": "id.orig_p", "path": "message2", "ignore_failure": true } },
|
||||||
{ "dot_expander": { "field": "id.resp_h", "path": "message2", "ignore_failure": true } },
|
{ "dot_expander": { "field": "id.resp_h", "path": "message2", "ignore_failure": true } },
|
||||||
{ "dot_expander": { "field": "id.resp_p", "path": "message2", "ignore_failure": true } },
|
{ "dot_expander": { "field": "id.resp_p", "path": "message2", "ignore_failure": true } },
|
||||||
{"community_id": {"if": "ctx.network?.transport != null", "field":["message2.id.orig_h","message2.id.orig_p","message2.id.resp_h","message2.id.resp_p","network.transport"],"target_field":"network.community_id"}},
|
|
||||||
{ "rename": { "field": "message2.id.orig_h", "target_field": "source.ip", "ignore_missing": true } },
|
{ "rename": { "field": "message2.id.orig_h", "target_field": "source.ip", "ignore_missing": true } },
|
||||||
{ "rename": { "field": "message2.id.orig_p", "target_field": "source.port", "ignore_missing": true } },
|
{ "rename": { "field": "message2.id.orig_p", "target_field": "source.port", "ignore_missing": true } },
|
||||||
{ "rename": { "field": "message2.id.resp_h", "target_field": "destination.ip", "ignore_missing": true } },
|
{ "rename": { "field": "message2.id.resp_h", "target_field": "destination.ip", "ignore_missing": true } },
|
||||||
{ "rename": { "field": "message2.id.resp_p", "target_field": "destination.port", "ignore_missing": true } },
|
{ "rename": { "field": "message2.id.resp_p", "target_field": "destination.port", "ignore_missing": true } },
|
||||||
|
{ "community_id": {} },
|
||||||
{ "set": { "if": "ctx.source?.ip != null", "field": "client.ip", "value": "{{source.ip}}" } },
|
{ "set": { "if": "ctx.source?.ip != null", "field": "client.ip", "value": "{{source.ip}}" } },
|
||||||
{ "set": { "if": "ctx.source?.port != null", "field": "client.port", "value": "{{source.port}}" } },
|
{ "set": { "if": "ctx.source?.port != null", "field": "client.port", "value": "{{source.port}}" } },
|
||||||
{ "set": { "if": "ctx.destination?.ip != null", "field": "server.ip", "value": "{{destination.ip}}" } },
|
{ "set": { "if": "ctx.destination?.ip != null", "field": "server.ip", "value": "{{destination.ip}}" } },
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
#
|
#
|
||||||
# Copyright 2014,2015,2016,2017,2018,2019 Security Onion Solutions, LLC
|
# Copyright 2014,2015,2016,2017,2018,2019,2020,2021 Security Onion Solutions, LLC
|
||||||
#
|
#
|
||||||
# This program is free software: you can redistribute it and/or modify
|
# This program is free software: you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
#
|
#
|
||||||
# Copyright 2014,2015,2016,2017,2018,2019 Security Onion Solutions, LLC
|
# Copyright 2014,2015,2016,2017,2018,2019,2020,2021 Security Onion Solutions, LLC
|
||||||
#
|
#
|
||||||
# This program is free software: you can redistribute it and/or modify
|
# This program is free software: you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
@@ -27,7 +27,7 @@ echo -n "Waiting for ElasticSearch..."
|
|||||||
COUNT=0
|
COUNT=0
|
||||||
ELASTICSEARCH_CONNECTED="no"
|
ELASTICSEARCH_CONNECTED="no"
|
||||||
while [[ "$COUNT" -le 240 ]]; do
|
while [[ "$COUNT" -le 240 ]]; do
|
||||||
curl ${ELASTICSEARCH_AUTH} -k --output /dev/null --silent --head --fail -L https://"$ELASTICSEARCH_HOST":"$ELASTICSEARCH_PORT"
|
{{ ELASTICCURL }} -k --output /dev/null --silent --head --fail -L https://"$ELASTICSEARCH_HOST":"$ELASTICSEARCH_PORT"
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
ELASTICSEARCH_CONNECTED="yes"
|
ELASTICSEARCH_CONNECTED="yes"
|
||||||
echo "connected!"
|
echo "connected!"
|
||||||
@@ -47,7 +47,7 @@ fi
|
|||||||
cd ${ELASTICSEARCH_INGEST_PIPELINES}
|
cd ${ELASTICSEARCH_INGEST_PIPELINES}
|
||||||
|
|
||||||
echo "Loading pipelines..."
|
echo "Loading pipelines..."
|
||||||
for i in *; do echo $i; RESPONSE=$(curl ${ELASTICSEARCH_AUTH} -k -XPUT -L https://${ELASTICSEARCH_HOST}:${ELASTICSEARCH_PORT}/_ingest/pipeline/$i -H 'Content-Type: application/json' -d@$i 2>/dev/null); echo $RESPONSE; if [[ "$RESPONSE" == *"error"* ]]; then RETURN_CODE=1; fi; done
|
for i in *; do echo $i; RESPONSE=$({{ ELASTICCURL }} -k -XPUT -L https://${ELASTICSEARCH_HOST}:${ELASTICSEARCH_PORT}/_ingest/pipeline/$i -H 'Content-Type: application/json' -d@$i 2>/dev/null); echo $RESPONSE; if [[ "$RESPONSE" == *"error"* ]]; then RETURN_CODE=1; fi; done
|
||||||
echo
|
echo
|
||||||
|
|
||||||
cd - >/dev/null
|
cd - >/dev/null
|
||||||
|
|||||||
@@ -35,6 +35,8 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% set TEMPLATES = salt['pillar.get']('elasticsearch:templates', {}) %}
|
{% set TEMPLATES = salt['pillar.get']('elasticsearch:templates', {}) %}
|
||||||
|
{% from 'elasticsearch/auth.map.jinja' import ELASTICAUTH with context %}
|
||||||
|
|
||||||
|
|
||||||
vm.max_map_count:
|
vm.max_map_count:
|
||||||
sysctl.present:
|
sysctl.present:
|
||||||
@@ -169,6 +171,40 @@ eslogdir:
|
|||||||
- group: 939
|
- group: 939
|
||||||
- makedirs: True
|
- makedirs: True
|
||||||
|
|
||||||
|
auth_users:
|
||||||
|
file.managed:
|
||||||
|
- name: /opt/so/conf/elasticsearch/users.tmp
|
||||||
|
- source: salt://elasticsearch/files/users
|
||||||
|
- user: 930
|
||||||
|
- group: 930
|
||||||
|
- mode: 600
|
||||||
|
- show_changes: False
|
||||||
|
|
||||||
|
auth_users_roles:
|
||||||
|
file.managed:
|
||||||
|
- name: /opt/so/conf/elasticsearch/users_roles.tmp
|
||||||
|
- source: salt://elasticsearch/files/users_roles
|
||||||
|
- user: 930
|
||||||
|
- group: 930
|
||||||
|
- mode: 600
|
||||||
|
- show_changes: False
|
||||||
|
|
||||||
|
auth_users_inode:
|
||||||
|
require:
|
||||||
|
- file: auth_users
|
||||||
|
cmd.run:
|
||||||
|
- name: cat /opt/so/conf/elasticsearch/users.tmp > /opt/so/conf/elasticsearch/users && chown 930:930 /opt/so/conf/elasticsearch/users && chmod 600 /opt/so/conf/elasticsearch/users
|
||||||
|
- onchanges:
|
||||||
|
- file: /opt/so/conf/elasticsearch/users.tmp
|
||||||
|
|
||||||
|
auth_users_roles_inode:
|
||||||
|
require:
|
||||||
|
- file: auth_users_roles
|
||||||
|
cmd.run:
|
||||||
|
- name: cat /opt/so/conf/elasticsearch/users_roles.tmp > /opt/so/conf/elasticsearch/users_roles && chown 930:930 /opt/so/conf/elasticsearch/users_roles && chmod 600 /opt/so/conf/elasticsearch/users_roles
|
||||||
|
- onchanges:
|
||||||
|
- file: /opt/so/conf/elasticsearch/users_roles.tmp
|
||||||
|
|
||||||
so-elasticsearch:
|
so-elasticsearch:
|
||||||
docker_container.running:
|
docker_container.running:
|
||||||
- image: {{ MANAGER }}:5000/{{ IMAGEREPO }}/so-elasticsearch:{{ VERSION }}
|
- image: {{ MANAGER }}:5000/{{ IMAGEREPO }}/so-elasticsearch:{{ VERSION }}
|
||||||
@@ -213,6 +249,10 @@ so-elasticsearch:
|
|||||||
- /etc/pki/elasticsearch.crt:/usr/share/elasticsearch/config/elasticsearch.crt:ro
|
- /etc/pki/elasticsearch.crt:/usr/share/elasticsearch/config/elasticsearch.crt:ro
|
||||||
- /etc/pki/elasticsearch.key:/usr/share/elasticsearch/config/elasticsearch.key:ro
|
- /etc/pki/elasticsearch.key:/usr/share/elasticsearch/config/elasticsearch.key:ro
|
||||||
- /etc/pki/elasticsearch.p12:/usr/share/elasticsearch/config/elasticsearch.p12:ro
|
- /etc/pki/elasticsearch.p12:/usr/share/elasticsearch/config/elasticsearch.p12:ro
|
||||||
|
{% if salt['pillar.get']('elasticsearch:auth:enabled', False) %}
|
||||||
|
- /opt/so/conf/elasticsearch/users_roles:/usr/share/elasticsearch/config/users_roles:ro
|
||||||
|
- /opt/so/conf/elasticsearch/users:/usr/share/elasticsearch/config/users:ro
|
||||||
|
{% endif %}
|
||||||
- watch:
|
- watch:
|
||||||
- file: cacertz
|
- file: cacertz
|
||||||
- file: esyml
|
- file: esyml
|
||||||
@@ -232,6 +272,8 @@ so-elasticsearch-pipelines-file:
|
|||||||
- group: 939
|
- group: 939
|
||||||
- mode: 754
|
- mode: 754
|
||||||
- template: jinja
|
- template: jinja
|
||||||
|
- defaults:
|
||||||
|
ELASTICCURL: {{ ELASTICAUTH.elasticcurl }}
|
||||||
|
|
||||||
so-elasticsearch-pipelines:
|
so-elasticsearch-pipelines:
|
||||||
cmd.run:
|
cmd.run:
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"index_patterns": ["so-ids-*", "so-firewall-*", "so-syslog-*", "so-zeek-*", "so-import-*", "so-ossec-*", "so-strelka-*", "so-beats-*", "so-osquery-*","so-playbook-*"],
|
"index_patterns": ["so-*"],
|
||||||
"version":50001,
|
"version":50001,
|
||||||
"order":10,
|
"order":10,
|
||||||
"settings":{
|
"settings":{
|
||||||
@@ -65,6 +65,7 @@
|
|||||||
{
|
{
|
||||||
"port": {
|
"port": {
|
||||||
"path_match": "*.port",
|
"path_match": "*.port",
|
||||||
|
"path_unmatch": "*.data.port",
|
||||||
"mapping": {
|
"mapping": {
|
||||||
"type": "integer",
|
"type": "integer",
|
||||||
"fields" : {
|
"fields" : {
|
||||||
@@ -229,6 +230,10 @@
|
|||||||
"type":"object",
|
"type":"object",
|
||||||
"dynamic": true
|
"dynamic": true
|
||||||
},
|
},
|
||||||
|
"event_data":{
|
||||||
|
"type":"object",
|
||||||
|
"dynamic": true
|
||||||
|
},
|
||||||
"file":{
|
"file":{
|
||||||
"type":"object",
|
"type":"object",
|
||||||
"dynamic": true
|
"dynamic": true
|
||||||
@@ -308,6 +313,10 @@
|
|||||||
"type":"object",
|
"type":"object",
|
||||||
"dynamic": true
|
"dynamic": true
|
||||||
},
|
},
|
||||||
|
"logscan": {
|
||||||
|
"type": "object",
|
||||||
|
"dynamic": true
|
||||||
|
},
|
||||||
"manager":{
|
"manager":{
|
||||||
"type":"object",
|
"type":"object",
|
||||||
"dynamic": true
|
"dynamic": true
|
||||||
@@ -316,7 +325,8 @@
|
|||||||
"type":"text",
|
"type":"text",
|
||||||
"fields":{
|
"fields":{
|
||||||
"keyword":{
|
"keyword":{
|
||||||
"type":"keyword"
|
"type":"keyword",
|
||||||
|
"ignore_above": 32766
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -527,6 +537,158 @@
|
|||||||
"x509":{
|
"x509":{
|
||||||
"type":"object",
|
"type":"object",
|
||||||
"dynamic": true
|
"dynamic": true
|
||||||
|
},
|
||||||
|
"suricata":{
|
||||||
|
"type":"object",
|
||||||
|
"dynamic": true
|
||||||
|
},
|
||||||
|
"zeek":{
|
||||||
|
"type":"object",
|
||||||
|
"dynamic": true
|
||||||
|
},
|
||||||
|
"aws":{
|
||||||
|
"type":"object",
|
||||||
|
"dynamic": true
|
||||||
|
},
|
||||||
|
"azure":{
|
||||||
|
"type":"object",
|
||||||
|
"dynamic": true
|
||||||
|
},
|
||||||
|
"barracuda":{
|
||||||
|
"type":"object",
|
||||||
|
"dynamic": true
|
||||||
|
},
|
||||||
|
"bluecoat":{
|
||||||
|
"type":"object",
|
||||||
|
"dynamic": true
|
||||||
|
},
|
||||||
|
"cef":{
|
||||||
|
"type":"object",
|
||||||
|
"dynamic": true
|
||||||
|
},
|
||||||
|
"checkpoint":{
|
||||||
|
"type":"object",
|
||||||
|
"dynamic": true
|
||||||
|
},
|
||||||
|
"cisco":{
|
||||||
|
"type":"object",
|
||||||
|
"dynamic": true
|
||||||
|
},
|
||||||
|
"cyberark":{
|
||||||
|
"type":"object",
|
||||||
|
"dynamic": true
|
||||||
|
},
|
||||||
|
"cylance":{
|
||||||
|
"type":"object",
|
||||||
|
"dynamic": true
|
||||||
|
},
|
||||||
|
"f5":{
|
||||||
|
"type":"object",
|
||||||
|
"dynamic": true
|
||||||
|
},
|
||||||
|
"fortinet":{
|
||||||
|
"type":"object",
|
||||||
|
"dynamic": true
|
||||||
|
},
|
||||||
|
"gcp":{
|
||||||
|
"type":"object",
|
||||||
|
"dynamic": true
|
||||||
|
},
|
||||||
|
"google_workspace":{
|
||||||
|
"type":"object",
|
||||||
|
"dynamic": true
|
||||||
|
},
|
||||||
|
"imperva":{
|
||||||
|
"type":"object",
|
||||||
|
"dynamic": true
|
||||||
|
},
|
||||||
|
"infoblox":{
|
||||||
|
"type":"object",
|
||||||
|
"dynamic": true
|
||||||
|
},
|
||||||
|
"juniper":{
|
||||||
|
"type":"object",
|
||||||
|
"dynamic": true
|
||||||
|
},
|
||||||
|
"microsoft":{
|
||||||
|
"type":"object",
|
||||||
|
"dynamic": true
|
||||||
|
},
|
||||||
|
"misp":{
|
||||||
|
"type":"object",
|
||||||
|
"dynamic": true
|
||||||
|
},
|
||||||
|
"netflow":{
|
||||||
|
"type":"object",
|
||||||
|
"dynamic": true
|
||||||
|
},
|
||||||
|
"netscout":{
|
||||||
|
"type":"object",
|
||||||
|
"dynamic": true
|
||||||
|
},
|
||||||
|
"o365":{
|
||||||
|
"type":"object",
|
||||||
|
"dynamic": true
|
||||||
|
},
|
||||||
|
"okta":{
|
||||||
|
"type":"object",
|
||||||
|
"dynamic": true
|
||||||
|
},
|
||||||
|
"proofpoint":{
|
||||||
|
"type":"object",
|
||||||
|
"dynamic": true
|
||||||
|
},
|
||||||
|
"radware":{
|
||||||
|
"type":"object",
|
||||||
|
"dynamic": true
|
||||||
|
},
|
||||||
|
"snort":{
|
||||||
|
"type":"object",
|
||||||
|
"dynamic": true
|
||||||
|
},
|
||||||
|
"snyk":{
|
||||||
|
"type":"object",
|
||||||
|
"dynamic": true
|
||||||
|
},
|
||||||
|
"sonicwall":{
|
||||||
|
"type":"object",
|
||||||
|
"dynamic": true
|
||||||
|
},
|
||||||
|
"sophos":{
|
||||||
|
"type":"object",
|
||||||
|
"dynamic": true
|
||||||
|
},
|
||||||
|
"squid":{
|
||||||
|
"type":"object",
|
||||||
|
"dynamic": true
|
||||||
|
},
|
||||||
|
"tomcat":{
|
||||||
|
"type":"object",
|
||||||
|
"dynamic": true
|
||||||
|
},
|
||||||
|
"zcaler":{
|
||||||
|
"type":"object",
|
||||||
|
"dynamic": true
|
||||||
|
},
|
||||||
|
"elasticsearch":{
|
||||||
|
"type":"object",
|
||||||
|
"dynamic": true
|
||||||
|
},
|
||||||
|
"kibana":{
|
||||||
|
"type":"object",
|
||||||
|
"dynamic": true
|
||||||
|
},
|
||||||
|
"logstash":{
|
||||||
|
"type":"object",
|
||||||
|
"dynamic": true
|
||||||
|
},
|
||||||
|
"redis":{
|
||||||
|
"type":"object",
|
||||||
|
"dynamic": true
|
||||||
|
},
|
||||||
|
"wazuh":{
|
||||||
|
"type":"object",
|
||||||
|
"dynamic": true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,7 +3,8 @@
|
|||||||
{%- else %}
|
{%- else %}
|
||||||
{%- set MANAGER = salt['grains.get']('master') %}
|
{%- set MANAGER = salt['grains.get']('master') %}
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
|
{%- set ES_USER = salt['pillar.get']('elasticsearch:auth:users:so_elastic_user:user', '') %}
|
||||||
|
{%- set ES_PASS = salt['pillar.get']('elasticsearch:auth:users:so_elastic_user:pass', '') %}
|
||||||
|
|
||||||
{%- set HOSTNAME = salt['grains.get']('host', '') %}
|
{%- set HOSTNAME = salt['grains.get']('host', '') %}
|
||||||
{%- set ZEEKVER = salt['pillar.get']('global:mdengine', 'COMMUNITY') %}
|
{%- set ZEEKVER = salt['pillar.get']('global:mdengine', 'COMMUNITY') %}
|
||||||
@@ -15,6 +16,7 @@
|
|||||||
{%- set FBMEMFLUSHMINEVENTS = salt['pillar.get']('filebeat:mem_flush_min_events', 2048) -%}
|
{%- set FBMEMFLUSHMINEVENTS = salt['pillar.get']('filebeat:mem_flush_min_events', 2048) -%}
|
||||||
{%- set FBLSWORKERS = salt['pillar.get']('filebeat:ls_workers', 1) -%}
|
{%- set FBLSWORKERS = salt['pillar.get']('filebeat:ls_workers', 1) -%}
|
||||||
{%- set FBLSBULKMAXSIZE = salt['pillar.get']('filebeat:ls_bulk_max_size', 2048) -%}
|
{%- set FBLSBULKMAXSIZE = salt['pillar.get']('filebeat:ls_bulk_max_size', 2048) -%}
|
||||||
|
{%- set FBLOGGINGLEVEL = salt['pillar.get']('filebeat:logging:level', 'warning') -%}
|
||||||
|
|
||||||
name: {{ HOSTNAME }}
|
name: {{ HOSTNAME }}
|
||||||
|
|
||||||
@@ -24,7 +26,7 @@ name: {{ HOSTNAME }}
|
|||||||
|
|
||||||
# Sets log level. The default log level is info.
|
# Sets log level. The default log level is info.
|
||||||
# Available log levels are: error, warning, info, debug
|
# Available log levels are: error, warning, info, debug
|
||||||
logging.level: warning
|
logging.level: {{ FBLOGGINGLEVEL }}
|
||||||
|
|
||||||
# Enable debug output for selected components. To enable all selectors use ["*"]
|
# Enable debug output for selected components. To enable all selectors use ["*"]
|
||||||
# Other available selectors are "beat", "publish", "service"
|
# Other available selectors are "beat", "publish", "service"
|
||||||
@@ -71,7 +73,13 @@ logging.files:
|
|||||||
# Set to true to log messages in json format.
|
# Set to true to log messages in json format.
|
||||||
#logging.json: false
|
#logging.json: false
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#========================== Modules configuration ============================
|
#========================== Modules configuration ============================
|
||||||
|
filebeat.config.modules:
|
||||||
|
enabled: true
|
||||||
|
path: ${path.config}/modules.d/*.yml
|
||||||
|
|
||||||
filebeat.modules:
|
filebeat.modules:
|
||||||
#=========================== Filebeat prospectors =============================
|
#=========================== Filebeat prospectors =============================
|
||||||
|
|
||||||
@@ -104,6 +112,21 @@ filebeat.inputs:
|
|||||||
fields: ["source", "prospector", "input", "offset", "beat"]
|
fields: ["source", "prospector", "input", "offset", "beat"]
|
||||||
fields_under_root: true
|
fields_under_root: true
|
||||||
|
|
||||||
|
{%- if grains['role'] in ['so-eval', 'so-standalone', 'so-manager', 'so-managersearch', 'so-import'] %}
|
||||||
|
- type: log
|
||||||
|
paths:
|
||||||
|
- /logs/logscan/alerts.log
|
||||||
|
fields:
|
||||||
|
module: logscan
|
||||||
|
dataset: alert
|
||||||
|
processors:
|
||||||
|
- drop_fields:
|
||||||
|
fields: ["source", "prospector", "input", "offset", "beat"]
|
||||||
|
fields_under_root: true
|
||||||
|
clean_removed: true
|
||||||
|
close_removed: false
|
||||||
|
{%- endif %}
|
||||||
|
|
||||||
{%- if grains['role'] in ['so-eval', 'so-standalone', 'so-sensor', 'so-helix', 'so-heavynode', 'so-import'] %}
|
{%- if grains['role'] in ['so-eval', 'so-standalone', 'so-sensor', 'so-helix', 'so-heavynode', 'so-import'] %}
|
||||||
{%- if ZEEKVER != 'SURICATA' %}
|
{%- if ZEEKVER != 'SURICATA' %}
|
||||||
{%- for LOGNAME in salt['pillar.get']('zeeklogs:enabled', '') %}
|
{%- for LOGNAME in salt['pillar.get']('zeeklogs:enabled', '') %}
|
||||||
@@ -183,7 +206,6 @@ filebeat.inputs:
|
|||||||
fields_under_root: true
|
fields_under_root: true
|
||||||
clean_removed: false
|
clean_removed: false
|
||||||
close_removed: false
|
close_removed: false
|
||||||
|
|
||||||
{%- if STRELKAENABLED == 1 %}
|
{%- if STRELKAENABLED == 1 %}
|
||||||
- type: log
|
- type: log
|
||||||
paths:
|
paths:
|
||||||
@@ -261,6 +283,10 @@ output.{{ type }}:
|
|||||||
output.elasticsearch:
|
output.elasticsearch:
|
||||||
enabled: true
|
enabled: true
|
||||||
hosts: ["https://{{ MANAGER }}:9200"]
|
hosts: ["https://{{ MANAGER }}:9200"]
|
||||||
|
{%- if salt['pillar.get']('elasticsearch:auth:enabled') is sameas true %}
|
||||||
|
username: "{{ ES_USER }}"
|
||||||
|
password: "{{ ES_PASS }}"
|
||||||
|
{%- endif %}
|
||||||
ssl.certificate_authorities: ["/usr/share/filebeat/intraca.crt"]
|
ssl.certificate_authorities: ["/usr/share/filebeat/intraca.crt"]
|
||||||
pipelines:
|
pipelines:
|
||||||
- pipeline: "%{[module]}.%{[dataset]}"
|
- pipeline: "%{[module]}.%{[dataset]}"
|
||||||
@@ -283,6 +309,9 @@ output.elasticsearch:
|
|||||||
- index: "so-strelka"
|
- index: "so-strelka"
|
||||||
when.contains:
|
when.contains:
|
||||||
module: "strelka"
|
module: "strelka"
|
||||||
|
- index: "so-logscan"
|
||||||
|
when.contains:
|
||||||
|
module: "logscan"
|
||||||
|
|
||||||
setup.template.enabled: false
|
setup.template.enabled: false
|
||||||
{%- else %}
|
{%- else %}
|
||||||
|
|||||||
16
salt/filebeat/etc/module-setup.yml
Normal file
16
salt/filebeat/etc/module-setup.yml
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
{%- if grains['role'] in ['so-managersearch', 'so-heavynode', 'so-node'] %}
|
||||||
|
{%- set MANAGER = salt['grains.get']('host' '') %}
|
||||||
|
{%- else %}
|
||||||
|
{%- set MANAGER = salt['grains.get']('master') %}
|
||||||
|
{%- endif %}
|
||||||
|
{%- set ES_USER = salt['pillar.get']('elasticsearch:auth:users:so_elastic_user:user', '') %}
|
||||||
|
{%- set ES_PASS = salt['pillar.get']('elasticsearch:auth:users:so_elastic_user:pass', '') %}
|
||||||
|
|
||||||
|
output.elasticsearch:
|
||||||
|
enabled: true
|
||||||
|
hosts: ["https://{{ MANAGER }}:9200"]
|
||||||
|
{% if salt['pillar.get']('elasticsearch:auth:enabled') is sameas true %}
|
||||||
|
username: "{{ ES_USER }}"
|
||||||
|
password: "{{ ES_PASS }}"
|
||||||
|
{% endif %}
|
||||||
|
ssl.certificate_authorities: ["/usr/share/filebeat/intraca.crt"]
|
||||||
18
salt/filebeat/etc/module_config.yml.jinja
Normal file
18
salt/filebeat/etc/module_config.yml.jinja
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
# DO NOT EDIT THIS FILE
|
||||||
|
{%- if MODULES.modules is iterable and MODULES.modules is not string and MODULES.modules|length > 0%}
|
||||||
|
{%- for module in MODULES.modules.keys() %}
|
||||||
|
- module: {{ module }}
|
||||||
|
{%- for fileset in MODULES.modules[module] %}
|
||||||
|
{{ fileset }}:
|
||||||
|
enabled: {{ MODULES.modules[module][fileset].enabled|string|lower }}
|
||||||
|
{#- only manage the settings if the fileset is enabled #}
|
||||||
|
{%- if MODULES.modules[module][fileset].enabled %}
|
||||||
|
{%- for var, value in MODULES.modules[module][fileset].items() %}
|
||||||
|
{%- if var|lower != 'enabled' %}
|
||||||
|
{{ var }}: {{ value }}
|
||||||
|
{%- endif %}
|
||||||
|
{%- endfor %}
|
||||||
|
{%- endif %}
|
||||||
|
{%- endfor %}
|
||||||
|
{%- endfor %}
|
||||||
|
{% endif %}
|
||||||
@@ -1,3 +1,4 @@
|
|||||||
|
|
||||||
# Copyright 2014,2015,2016,2017,2018,2019,2020,2021 Security Onion Solutions, LLC
|
# Copyright 2014,2015,2016,2017,2018,2019,2020,2021 Security Onion Solutions, LLC
|
||||||
# This program is free software: you can redistribute it and/or modify
|
# This program is free software: you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
@@ -20,18 +21,37 @@
|
|||||||
{% set LOCALHOSTIP = salt['grains.get']('ip_interfaces').get(MAININT)[0] %}
|
{% set LOCALHOSTIP = salt['grains.get']('ip_interfaces').get(MAININT)[0] %}
|
||||||
{% set MANAGER = salt['grains.get']('master') %}
|
{% set MANAGER = salt['grains.get']('master') %}
|
||||||
{% set MANAGERIP = salt['pillar.get']('global:managerip', '') %}
|
{% set MANAGERIP = salt['pillar.get']('global:managerip', '') %}
|
||||||
|
{% from 'filebeat/map.jinja' import THIRDPARTY with context %}
|
||||||
|
{% from 'filebeat/map.jinja' import SO with context %}
|
||||||
|
{% set ES_INCLUDED_NODES = ['so-eval', 'so-standalone', 'so-managersearch', 'so-node', 'so-heavynode', 'so-import'] %}
|
||||||
|
|
||||||
|
#only include elastic state for certain nodes
|
||||||
|
{% if grains.role in ES_INCLUDED_NODES %}
|
||||||
|
include:
|
||||||
|
- elasticsearch
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
filebeatetcdir:
|
filebeatetcdir:
|
||||||
file.directory:
|
file.directory:
|
||||||
- name: /opt/so/conf/filebeat/etc
|
- name: /opt/so/conf/filebeat/etc
|
||||||
- user: 939
|
- user: 939
|
||||||
- group: 939
|
- group: 939
|
||||||
- makedirs: True
|
- makedirs: True
|
||||||
|
|
||||||
|
filebeatmoduledir:
|
||||||
|
file.directory:
|
||||||
|
- name: /opt/so/conf/filebeat/modules
|
||||||
|
- user: root
|
||||||
|
- group: root
|
||||||
|
- makedirs: True
|
||||||
|
|
||||||
filebeatlogdir:
|
filebeatlogdir:
|
||||||
file.directory:
|
file.directory:
|
||||||
- name: /opt/so/log/filebeat
|
- name: /opt/so/log/filebeat
|
||||||
- user: 939
|
- user: 939
|
||||||
- group: 939
|
- group: 939
|
||||||
- makedirs: True
|
- makedirs: True
|
||||||
|
|
||||||
filebeatpkidir:
|
filebeatpkidir:
|
||||||
file.directory:
|
file.directory:
|
||||||
- name: /opt/so/conf/filebeat/etc/pki
|
- name: /opt/so/conf/filebeat/etc/pki
|
||||||
@@ -44,6 +64,7 @@ fileregistrydir:
|
|||||||
- user: 939
|
- user: 939
|
||||||
- group: 939
|
- group: 939
|
||||||
- makedirs: True
|
- makedirs: True
|
||||||
|
|
||||||
# This needs to be owned by root
|
# This needs to be owned by root
|
||||||
filebeatconfsync:
|
filebeatconfsync:
|
||||||
file.managed:
|
file.managed:
|
||||||
@@ -55,6 +76,33 @@ filebeatconfsync:
|
|||||||
- defaults:
|
- defaults:
|
||||||
INPUTS: {{ salt['pillar.get']('filebeat:config:inputs', {}) }}
|
INPUTS: {{ salt['pillar.get']('filebeat:config:inputs', {}) }}
|
||||||
OUTPUT: {{ salt['pillar.get']('filebeat:config:output', {}) }}
|
OUTPUT: {{ salt['pillar.get']('filebeat:config:output', {}) }}
|
||||||
|
|
||||||
|
# Filebeat module config file
|
||||||
|
filebeatmoduleconfsync:
|
||||||
|
file.managed:
|
||||||
|
- name: /opt/so/conf/filebeat/etc/module-setup.yml
|
||||||
|
- source: salt://filebeat/etc/module-setup.yml
|
||||||
|
- user: root
|
||||||
|
- group: root
|
||||||
|
- mode: 640
|
||||||
|
- template: jinja
|
||||||
|
|
||||||
|
sodefaults_module_conf:
|
||||||
|
file.managed:
|
||||||
|
- name: /opt/so/conf/filebeat/modules/securityonion.yml
|
||||||
|
- source: salt://filebeat/etc/module_config.yml.jinja
|
||||||
|
- template: jinja
|
||||||
|
- defaults:
|
||||||
|
MODULES: {{ SO }}
|
||||||
|
|
||||||
|
thirdparty_module_conf:
|
||||||
|
file.managed:
|
||||||
|
- name: /opt/so/conf/filebeat/modules/thirdparty.yml
|
||||||
|
- source: salt://filebeat/etc/module_config.yml.jinja
|
||||||
|
- template: jinja
|
||||||
|
- defaults:
|
||||||
|
MODULES: {{ THIRDPARTY }}
|
||||||
|
|
||||||
so-filebeat:
|
so-filebeat:
|
||||||
docker_container.running:
|
docker_container.running:
|
||||||
- image: {{ MANAGER }}:5000/{{ IMAGEREPO }}/so-filebeat:{{ VERSION }}
|
- image: {{ MANAGER }}:5000/{{ IMAGEREPO }}/so-filebeat:{{ VERSION }}
|
||||||
@@ -65,19 +113,41 @@ so-filebeat:
|
|||||||
- /nsm:/nsm:ro
|
- /nsm:/nsm:ro
|
||||||
- /opt/so/log/filebeat:/usr/share/filebeat/logs:rw
|
- /opt/so/log/filebeat:/usr/share/filebeat/logs:rw
|
||||||
- /opt/so/conf/filebeat/etc/filebeat.yml:/usr/share/filebeat/filebeat.yml:ro
|
- /opt/so/conf/filebeat/etc/filebeat.yml:/usr/share/filebeat/filebeat.yml:ro
|
||||||
|
- /opt/so/conf/filebeat/etc/module-setup.yml:/usr/share/filebeat/module-setup.yml:ro
|
||||||
- /nsm/wazuh/logs/alerts:/wazuh/alerts:ro
|
- /nsm/wazuh/logs/alerts:/wazuh/alerts:ro
|
||||||
- /nsm/wazuh/logs/archives:/wazuh/archives:ro
|
- /nsm/wazuh/logs/archives:/wazuh/archives:ro
|
||||||
|
- /opt/so/conf/filebeat/modules:/usr/share/filebeat/modules.d
|
||||||
- /opt/so/conf/filebeat/etc/pki/filebeat.crt:/usr/share/filebeat/filebeat.crt:ro
|
- /opt/so/conf/filebeat/etc/pki/filebeat.crt:/usr/share/filebeat/filebeat.crt:ro
|
||||||
- /opt/so/conf/filebeat/etc/pki/filebeat.key:/usr/share/filebeat/filebeat.key:ro
|
- /opt/so/conf/filebeat/etc/pki/filebeat.key:/usr/share/filebeat/filebeat.key:ro
|
||||||
- /opt/so/conf/filebeat/registry:/usr/share/filebeat/data/registry:rw
|
- /opt/so/conf/filebeat/registry:/usr/share/filebeat/data/registry:rw
|
||||||
- /etc/ssl/certs/intca.crt:/usr/share/filebeat/intraca.crt:ro
|
- /etc/ssl/certs/intca.crt:/usr/share/filebeat/intraca.crt:ro
|
||||||
|
- /opt/so/log:/logs:ro
|
||||||
- port_bindings:
|
- port_bindings:
|
||||||
- 0.0.0.0:514:514/udp
|
- 0.0.0.0:514:514/udp
|
||||||
- 0.0.0.0:514:514/tcp
|
- 0.0.0.0:514:514/tcp
|
||||||
- 0.0.0.0:5066:5066/tcp
|
- 0.0.0.0:5066:5066/tcp
|
||||||
|
{% for module in THIRDPARTY.modules.keys() %}
|
||||||
|
{% for submodule in THIRDPARTY.modules[module] %}
|
||||||
|
{% if THIRDPARTY.modules[module][submodule].enabled and THIRDPARTY.modules[module][submodule]["var.syslog_port"] is defined %}
|
||||||
|
- {{ THIRDPARTY.modules[module][submodule].get("var.syslog_host", "0.0.0.0") }}:{{ THIRDPARTY.modules[module][submodule]["var.syslog_port"] }}:{{ THIRDPARTY.modules[module][submodule]["var.syslog_port"] }}/tcp
|
||||||
|
- {{ THIRDPARTY.modules[module][submodule].get("var.syslog_host", "0.0.0.0") }}:{{ THIRDPARTY.modules[module][submodule]["var.syslog_port"] }}:{{ THIRDPARTY.modules[module][submodule]["var.syslog_port"] }}/udp
|
||||||
|
{% endif %}
|
||||||
|
{% endfor %}
|
||||||
|
{% endfor %}
|
||||||
- watch:
|
- watch:
|
||||||
- file: /opt/so/conf/filebeat/etc/filebeat.yml
|
- file: /opt/so/conf/filebeat/etc/filebeat.yml
|
||||||
|
|
||||||
|
{% if grains.role in ES_INCLUDED_NODES %}
|
||||||
|
run_module_setup:
|
||||||
|
cmd.run:
|
||||||
|
- name: /usr/sbin/so-filebeat-module-setup
|
||||||
|
- require:
|
||||||
|
- file: filebeatmoduleconfsync
|
||||||
|
- docker_container: so-filebeat
|
||||||
|
- onchanges:
|
||||||
|
- docker_container: so-elasticsearch
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
append_so-filebeat_so-status.conf:
|
append_so-filebeat_so-status.conf:
|
||||||
file.append:
|
file.append:
|
||||||
- name: /opt/so/conf/so-status/so-status.conf
|
- name: /opt/so/conf/so-status/so-status.conf
|
||||||
|
|||||||
6
salt/filebeat/map.jinja
Normal file
6
salt/filebeat/map.jinja
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
{% import_yaml 'filebeat/thirdpartydefaults.yaml' as TPDEFAULTS %}
|
||||||
|
{% set THIRDPARTY = salt['pillar.get']('filebeat:third_party_filebeat', default=TPDEFAULTS.third_party_filebeat, merge=True) %}
|
||||||
|
|
||||||
|
{% import_yaml 'filebeat/securityoniondefaults.yaml' as SODEFAULTS %}
|
||||||
|
{% set SO = SODEFAULTS.securityonion_filebeat %}
|
||||||
|
{#% set SO = salt['pillar.get']('filebeat:third_party_filebeat', default=SODEFAULTS.third_party_filebeat, merge=True) %#}
|
||||||
31
salt/filebeat/securityoniondefaults.yaml
Normal file
31
salt/filebeat/securityoniondefaults.yaml
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
{%- set ZEEKVER = salt['pillar.get']('global:mdengine', '') %}
|
||||||
|
{% set ZEEKLOGLOOKUP = {
|
||||||
|
'conn': 'connection',
|
||||||
|
} %}
|
||||||
|
securityonion_filebeat:
|
||||||
|
modules:
|
||||||
|
{%- if grains['role'] in ['so-manager', 'so-eval', 'so-managersearch', 'so-standalone','so-node', 'so-hotnode', 'so-warmnode', 'so-heavynode'] %}
|
||||||
|
elasticsearch:
|
||||||
|
server:
|
||||||
|
enabled: true
|
||||||
|
var.paths: ["/logs/elasticsearch/*.log"]
|
||||||
|
logstash:
|
||||||
|
log:
|
||||||
|
enabled: true
|
||||||
|
var.paths: ["/logs/logstash.log"]
|
||||||
|
{%- endif %}
|
||||||
|
{%- if grains['role'] in ['so-manager', 'so-eval', 'so-managersearch', 'so-standalone'] %}
|
||||||
|
kibana:
|
||||||
|
log:
|
||||||
|
enabled: true
|
||||||
|
var.paths: ["/logs/kibana/kibana.log"]
|
||||||
|
{%- endif %}
|
||||||
|
{%- if grains['role'] in ['so-manager', 'so-eval', 'so-managersearch', 'so-standalone', 'so-heavynode'] %}
|
||||||
|
redis:
|
||||||
|
log:
|
||||||
|
enabled: true
|
||||||
|
var.paths: ["/logs/redis.log"]
|
||||||
|
slowlog:
|
||||||
|
enabled: false
|
||||||
|
{%- endif %}
|
||||||
|
|
||||||
252
salt/filebeat/thirdpartydefaults.yaml
Normal file
252
salt/filebeat/thirdpartydefaults.yaml
Normal file
@@ -0,0 +1,252 @@
|
|||||||
|
third_party_filebeat:
|
||||||
|
modules:
|
||||||
|
aws:
|
||||||
|
cloudtrail:
|
||||||
|
enabled: false
|
||||||
|
cloudwatch:
|
||||||
|
enabled: false
|
||||||
|
ec2:
|
||||||
|
enabled: false
|
||||||
|
elb:
|
||||||
|
enabled: false
|
||||||
|
s3access:
|
||||||
|
enabled: false
|
||||||
|
vpcflow:
|
||||||
|
enabled: false
|
||||||
|
azure:
|
||||||
|
activitylogs:
|
||||||
|
enabled: false
|
||||||
|
platformlogs:
|
||||||
|
enabled: false
|
||||||
|
auditlogs:
|
||||||
|
enabled: false
|
||||||
|
signinlogs:
|
||||||
|
enabled: false
|
||||||
|
barracuda:
|
||||||
|
waf:
|
||||||
|
enabled: false
|
||||||
|
var.input: udp
|
||||||
|
var.syslog_host: 0.0.0.0
|
||||||
|
var.syslog_port: 9503
|
||||||
|
spamfirewall:
|
||||||
|
enabled: false
|
||||||
|
var.input: udp
|
||||||
|
var.syslog_host: 0.0.0.0
|
||||||
|
var.syslog_port: 9524
|
||||||
|
bluecoat:
|
||||||
|
director:
|
||||||
|
enabled: false
|
||||||
|
var.input: udp
|
||||||
|
var.syslog_host: 0.0.0.0
|
||||||
|
var.syslog_port: 9505
|
||||||
|
cef:
|
||||||
|
log:
|
||||||
|
enabled: false
|
||||||
|
var.syslog_host: 0.0.0.0
|
||||||
|
var.syslog_port: 9003
|
||||||
|
checkpoint:
|
||||||
|
firewall:
|
||||||
|
enabled: false
|
||||||
|
var.syslog_host: 0.0.0.0
|
||||||
|
var.syslog_port: 9505
|
||||||
|
cisco:
|
||||||
|
asa:
|
||||||
|
enabled: false
|
||||||
|
var.syslog_host: 0.0.0.0
|
||||||
|
var.syslog_port: 9001
|
||||||
|
ftd:
|
||||||
|
enabled: false
|
||||||
|
var.syslog_host: 0.0.0.0
|
||||||
|
var.syslog_port: 9003
|
||||||
|
ios:
|
||||||
|
enabled: false
|
||||||
|
var.syslog_host: 0.0.0.0
|
||||||
|
var.syslog_port: 9002
|
||||||
|
nexus:
|
||||||
|
enabled: false
|
||||||
|
var.syslog_host: 0.0.0.0
|
||||||
|
var.syslog_port: 9506
|
||||||
|
meraki:
|
||||||
|
enabled: false
|
||||||
|
var.syslog_host: 0.0.0.0
|
||||||
|
var.syslog_port: 9525
|
||||||
|
umbrella:
|
||||||
|
enabled: false
|
||||||
|
amp:
|
||||||
|
enabled: false
|
||||||
|
cyberark:
|
||||||
|
corepas:
|
||||||
|
enabled: false
|
||||||
|
var.input: udp
|
||||||
|
var.syslog_host: 0.0.0.0
|
||||||
|
var.syslog_port: 9527
|
||||||
|
cylance:
|
||||||
|
protect:
|
||||||
|
enabled: false
|
||||||
|
var.input: udp
|
||||||
|
var.syslog_host: 0.0.0.0
|
||||||
|
var.syslog_port: 9508
|
||||||
|
f5:
|
||||||
|
bigipapm:
|
||||||
|
enabled: false
|
||||||
|
var.input: udp
|
||||||
|
var.syslog_host: 0.0.0.0
|
||||||
|
var.syslog_port: 9504
|
||||||
|
bigipafm:
|
||||||
|
enabled: false
|
||||||
|
var.input: udp
|
||||||
|
var.syslog_host: 0.0.0.0
|
||||||
|
var.syslog_port: 9528
|
||||||
|
fortinet:
|
||||||
|
firewall:
|
||||||
|
enabled: false
|
||||||
|
var.input: udp
|
||||||
|
var.syslog_host: 0.0.0.0
|
||||||
|
var.syslog_port: 9004
|
||||||
|
clientendpoint:
|
||||||
|
enabled: false
|
||||||
|
var.input: udp
|
||||||
|
var.syslog_host: 0.0.0.0
|
||||||
|
var.syslog_port: 9510
|
||||||
|
fortimail:
|
||||||
|
enabled: false
|
||||||
|
var.input: udp
|
||||||
|
var.syslog_port: 9350
|
||||||
|
gcp:
|
||||||
|
vpcflow:
|
||||||
|
enabled: false
|
||||||
|
firewall:
|
||||||
|
enabled: false
|
||||||
|
audit:
|
||||||
|
enabled: false
|
||||||
|
google_workspace:
|
||||||
|
saml:
|
||||||
|
enabled: false
|
||||||
|
user_accounts:
|
||||||
|
enabled: false
|
||||||
|
login:
|
||||||
|
enabled: false
|
||||||
|
admin:
|
||||||
|
enabled: false
|
||||||
|
drive:
|
||||||
|
enabled: false
|
||||||
|
groups:
|
||||||
|
enabled: false
|
||||||
|
imperva:
|
||||||
|
securesphere:
|
||||||
|
enabled: false
|
||||||
|
var.input: udp
|
||||||
|
var.syslog_host: 0.0.0.0
|
||||||
|
var.syslog_port: 9511
|
||||||
|
infoblox:
|
||||||
|
nios:
|
||||||
|
enabled: false
|
||||||
|
var.input: udp
|
||||||
|
var.syslog_host: 0.0.0.0
|
||||||
|
var.syslog_port: 9512
|
||||||
|
juniper:
|
||||||
|
junos:
|
||||||
|
enabled: false
|
||||||
|
var.input: udp
|
||||||
|
var.syslog_host: 0.0.0.0
|
||||||
|
var.syslog_port: 9513
|
||||||
|
netscreen:
|
||||||
|
enabled: false
|
||||||
|
var.input: udp
|
||||||
|
var.syslog_host: 0.0.0.0
|
||||||
|
var.syslog_port: 9523
|
||||||
|
srx:
|
||||||
|
enabled: false
|
||||||
|
var.input: udp
|
||||||
|
var.syslog_host: 0.0.0.0
|
||||||
|
var.syslog_port: 9006
|
||||||
|
microsoft:
|
||||||
|
defender_atp:
|
||||||
|
enabled: false
|
||||||
|
m365_defender:
|
||||||
|
enabled: false
|
||||||
|
dhcp:
|
||||||
|
enabled: false
|
||||||
|
var.input: udp
|
||||||
|
var.syslog_host: 0.0.0.0
|
||||||
|
var.syslog_port: 9515
|
||||||
|
misp:
|
||||||
|
threat:
|
||||||
|
enabled: false
|
||||||
|
netflow:
|
||||||
|
log:
|
||||||
|
enabled: false
|
||||||
|
var.netflow_host: 0.0.0.0
|
||||||
|
var.netflow_port: 2055
|
||||||
|
var.internal_networks:
|
||||||
|
- private
|
||||||
|
netscout:
|
||||||
|
sightline:
|
||||||
|
enabled: false
|
||||||
|
var.input: udp
|
||||||
|
var.syslog_host: 0.0.0.0
|
||||||
|
var.syslog_port: 9502
|
||||||
|
o365:
|
||||||
|
audit:
|
||||||
|
enabled: false
|
||||||
|
okta:
|
||||||
|
system:
|
||||||
|
enabled: false
|
||||||
|
proofpoint:
|
||||||
|
emailsecurity:
|
||||||
|
enabled: false
|
||||||
|
var.input: udp
|
||||||
|
var.syslog_host: 0.0.0.0
|
||||||
|
var.syslog_port: 9531
|
||||||
|
radware:
|
||||||
|
defensepro:
|
||||||
|
enabled: false
|
||||||
|
var.input: udp
|
||||||
|
var.syslog_host: 0.0.0.0
|
||||||
|
var.syslog_port: 9518
|
||||||
|
snort:
|
||||||
|
log:
|
||||||
|
enabled: false
|
||||||
|
var.input: udp
|
||||||
|
var.syslog_host: 0.0.0.0
|
||||||
|
var.syslog_port: 9532
|
||||||
|
snyk:
|
||||||
|
audit:
|
||||||
|
enabled: false
|
||||||
|
vulnerabilities:
|
||||||
|
enabled: false
|
||||||
|
sonicwall:
|
||||||
|
firewall:
|
||||||
|
enabled: false
|
||||||
|
var.input: udp
|
||||||
|
var.syslog_host: 0.0.0.0
|
||||||
|
var.syslog_port: 9519
|
||||||
|
sophos:
|
||||||
|
xg:
|
||||||
|
enabled: false
|
||||||
|
var.input: udp
|
||||||
|
var.syslog_host: 0.0.0.0
|
||||||
|
var.syslog_port: 9005
|
||||||
|
utm:
|
||||||
|
enabled: false
|
||||||
|
var.input: udp
|
||||||
|
var.syslog_host: 0.0.0.0
|
||||||
|
var.syslog_port: 9533
|
||||||
|
squid:
|
||||||
|
log:
|
||||||
|
enabled: false
|
||||||
|
var.input: udp
|
||||||
|
var.syslog_host: 0.0.0.0
|
||||||
|
var.syslog_port: 9520
|
||||||
|
tomcat:
|
||||||
|
log:
|
||||||
|
enabled: false
|
||||||
|
var.input: udp
|
||||||
|
var.syslog_host: 0.0.0.0
|
||||||
|
var.syslog_port: 9501
|
||||||
|
zscaler:
|
||||||
|
zia:
|
||||||
|
enabled: false
|
||||||
|
var.input: udp
|
||||||
|
var.syslog_host: 0.0.0.0
|
||||||
|
var.syslog_port: 9521
|
||||||
62
salt/grafana/dashboards/common_template.json.jinja
Normal file
62
salt/grafana/dashboards/common_template.json.jinja
Normal file
@@ -0,0 +1,62 @@
|
|||||||
|
{
|
||||||
|
"annotations": {
|
||||||
|
"list": [
|
||||||
|
{
|
||||||
|
"builtIn": 1,
|
||||||
|
"datasource": "-- Grafana --",
|
||||||
|
"enable": true,
|
||||||
|
"hide": true,
|
||||||
|
"iconColor": "rgba(0, 211, 255, 1)",
|
||||||
|
"name": "Annotations & Alerts",
|
||||||
|
"type": "dashboard"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"description": "{{TITLE}}",
|
||||||
|
"editable": true,
|
||||||
|
"gnetId": null,
|
||||||
|
"graphTooltip": 0,
|
||||||
|
"id": {{ ID }},
|
||||||
|
"iteration": 1625757047565,
|
||||||
|
"links": [],
|
||||||
|
"panels": [
|
||||||
|
{% for panel in PANELS -%}
|
||||||
|
{%- import_json "grafana/panels/" ~ panel ~ ".json.jinja" as panel %}
|
||||||
|
{{ panel | json }} {% if not loop.last %},{% endif %}
|
||||||
|
{% endfor -%}
|
||||||
|
],
|
||||||
|
"refresh": "5m",
|
||||||
|
"schemaVersion": 27,
|
||||||
|
"style": "dark",
|
||||||
|
"tags": [],
|
||||||
|
"templating": {
|
||||||
|
"list": [
|
||||||
|
{% for template in TEMPLATES.keys() -%}
|
||||||
|
{%- import_json "grafana/templates/" ~ template ~ ".json" as template %}
|
||||||
|
{{ template | json }} {% if not loop.last %},{% endif %}
|
||||||
|
{% endfor -%}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"time": {
|
||||||
|
"from": "now-3h",
|
||||||
|
"to": "now"
|
||||||
|
},
|
||||||
|
"timepicker": {
|
||||||
|
"refresh_intervals": [
|
||||||
|
"30s",
|
||||||
|
"1m",
|
||||||
|
"5m",
|
||||||
|
"15m",
|
||||||
|
"30m",
|
||||||
|
"1h",
|
||||||
|
"2h",
|
||||||
|
"1d"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"timezone": "browser",
|
||||||
|
"title": "{{ TITLE }}",
|
||||||
|
{% if TITLE | lower == 'security onion grid overview' %}
|
||||||
|
"uid": "so_overview",
|
||||||
|
{% endif %}
|
||||||
|
"version": 1
|
||||||
|
}
|
||||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,55 +1,12 @@
|
|||||||
apiVersion: 1
|
apiVersion: 1
|
||||||
|
|
||||||
providers:
|
providers:
|
||||||
|
- name: 'Dashboards'
|
||||||
|
folder: 'Dashboards'
|
||||||
|
type: file
|
||||||
|
disableDeletion: false
|
||||||
|
editable: true
|
||||||
|
allowUiUpdates: true
|
||||||
|
options:
|
||||||
|
path: /etc/grafana/grafana_dashboards/
|
||||||
|
|
||||||
{%- if grains['role'] != 'so-eval' %}
|
|
||||||
- name: 'Manager'
|
|
||||||
folder: 'Manager'
|
|
||||||
type: file
|
|
||||||
disableDeletion: false
|
|
||||||
editable: true
|
|
||||||
allowUiUpdates: true
|
|
||||||
options:
|
|
||||||
path: /etc/grafana/grafana_dashboards/manager
|
|
||||||
- name: 'Manager Search'
|
|
||||||
folder: 'Manager Search'
|
|
||||||
type: file
|
|
||||||
disableDeletion: false
|
|
||||||
editable: true
|
|
||||||
allowUiUpdates: true
|
|
||||||
options:
|
|
||||||
path: /etc/grafana/grafana_dashboards/managersearch
|
|
||||||
- name: 'Sensor Nodes'
|
|
||||||
folder: 'Sensor Nodes'
|
|
||||||
type: file
|
|
||||||
disableDeletion: false
|
|
||||||
editable: true
|
|
||||||
allowUiUpdates: true
|
|
||||||
options:
|
|
||||||
path: /etc/grafana/grafana_dashboards/sensor_nodes
|
|
||||||
- name: 'Search Nodes'
|
|
||||||
folder: 'Search Nodes'
|
|
||||||
type: file
|
|
||||||
disableDeletion: false
|
|
||||||
editable: true
|
|
||||||
allowUiUpdates: true
|
|
||||||
options:
|
|
||||||
path: /etc/grafana/grafana_dashboards/search_nodes
|
|
||||||
- name: 'Standalone'
|
|
||||||
folder: 'Standalone'
|
|
||||||
type: file
|
|
||||||
disableDeletion: false
|
|
||||||
editable: true
|
|
||||||
allowUiUpdates: true
|
|
||||||
options:
|
|
||||||
path: /etc/grafana/grafana_dashboards/standalone
|
|
||||||
{%- else %}
|
|
||||||
- name: 'Security Onion'
|
|
||||||
folder: 'Eval Mode'
|
|
||||||
type: file
|
|
||||||
disableDeletion: false
|
|
||||||
editable: true
|
|
||||||
allowUiUpdates: true
|
|
||||||
options:
|
|
||||||
path: /etc/grafana/grafana_dashboards/eval
|
|
||||||
{% endif %}
|
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user