[13318] 2018-10-19_如何通过Kibana、Wazuh和BroIDS提高中小企业的威胁检测能力?

文档创建者:s7ckTeam
浏览次数:2
最后更新:2025-01-18
2018-10-19_如何通过Kibana、Wazuh和BroIDS提高中小企业的威胁检测能力? K i b a n a W a z u h B r o   I D S s e c i s t   F r e e B u f   2 0 1 8 - 1 0 - 1 9 K i b a n a W a z u h B r o   I D S W a z u h W a z u h O S S E C E L K 便 E L K   &   W a z u h W a z u h h t t p : / / y o u r _ s e r v e r : 5 6 0 1 访 K i b a n a W a z u h
B r o B R O I D S 使 K i b a n a U b u n t u   U b u n t u G i t 使 b r o B r o B r o B r o / u s r / l o c a l / b r o / u s r / l o c a l / b r o $ P A T H / e t c / p r o f i l e . d 3 r d - p a r t y . s h B r o B r o B r o / u s r / l o c a l / b r o / e t c n o d e . c f g n e t w o r k s . c f g C I D R b r o c t l . c f g B r o C o n t r o l B r o n o d e . c f g B r o g i t   c l o n e   - - r e c u r s i v e   g i t : / / g i t . b r o . o r g / b r o c d   b r o . / c o n f i g u r e m a k e s u d o   m a k e   i n s t a l l e x p o r t   P A T H = $ P A T H : / u s r / l o c a l / b r o / b i n
b r o i n t e r f a c e e t h 0 U b u n t u   1 6 . 0 4 / u s r / l o c a l / b r o / e t c / n o d e . c f g n e t w o r k s . c f g I P I P I P i p   a d d r   s h o w n e t w o r k s . c f g   / u s r / l o c a l / b r o / e t c / n e t w o r k s . c f g 使 使 B r o C o n t r o l B r o B r o C o n t r o l B r o   -   B r o s h e l l 使 s u d o   / u s r / l o c a l / b r o / b i n / b r o c t l b r o c t l s h e l l 使 e x i t 退 s h e l l s h e l l B r o s h e l l b r o c t l L i n u x b r o c t l 使 b r o c t l   d e p l o y B r o s u d o   n a n o   / u s r / l o c a l / b r o / e t c / n o d e . c f g [ b r o ] t y p e = s t a n d a l o n e h o s t = l o c a l h o s t i n t e r f a c e = e t h 0 s u d o   n a n o   / u s r / l o c a l / b r o / e t c / n e t w o r k s . c f g / u s r / l o c a l / b r o / e t c / n e t w o r k s . c f g #   L i s t   o f   l o c a l   n e t w o r k s   i n   C I D R   n o t a t i o n ,   o p t i o n a l l y   f o l l o w e d   b y   a #   d e s c r i p t i v e   t a g . #   F o r   e x a m p l e ,   " 1 0 . 0 . 0 . 0 / 8 "   o r   " f e 8 0 : : / 6 4 "   a r e   v a l i d   p r e f i x e s . 1 0 . 0 . 0 . 0 / 8                     P r i v a t e   I P   s p a c e 1 7 2 . 1 6 . 0 . 0 / 1 2               P r i v a t e   I P   s p a c e 1 9 2 . 1 6 8 . 0 . 0 / 1 6             P r i v a t e   I P   s p a c e 1 9 2 . 1 6 8 . 1 . 0 / 2 4                     P u b l i c   I P   s p a c e 1 7 2 . 1 6 . 1 0 0 . 0 / 2 4                   P r i v a t e   I P   s p a c e W e l c o m e   t o   B r o C o n t r o l   1 . 5 - 2 1 T y p e   " h e l p "   f o r   h e l p . [ B r o C o n t r o l ]   > s u d o   / u s r / l o c a l / b r o / b i n / b r o c t l   d e p l o y
B r o J S O N B r o T S V   E l a s t i c S e a r c h 使 J S O N / u s r / s h a r e / b r o / s h a r e / s i t e / b r o . l o c a l B r o J S O N F i l e b e a t w a z u h   f i l e b e a t c o n f . d / e t c / f i l e b e a t / c o n f . d / f i l e b e a t _ b r o . y m l b r o   f i l e b e a t @ l o a d   t u n i n g / j s o n - l o g s r e d e f   L o g A s c i i : : j s o n _ t i m e s t a m p s   =   J S O N : : T S _ I S O 8 6 0 1 ; r e d e f   L o g A s c i i : : u s e _ j s o n   =   T ; s u d o   / u s r / l o c a l / b r o / b i n / b r o c t l   r e s t a r t c d   / e t c / f i l e b e a t m k d i r   c o n f . d m v   f i l e b e a t . y m l   c o n f . d / c a t   < <   E O F   >   f i l e b e a t . y m l f i l e b e a t :     c o n f i g _ d i r :   / e t c / f i l e b e a t / c o n f . d o u t p u t :   l o g s t a s h :       #   T h e   L o g s t a s h   h o s t s       h o s t s :   [ " 1 2 7 . 0 . 0 . 1 : 5 0 0 0 " ] E O F f i l e b e a t :   p r o s p e c t o r s :     -   i n p u t _ t y p e :   l o g         p a t h s :           -   " / u s r / l o c a l / b r o / s p o o l / b r o / c o n n . l o g "         d o c u m e n t _ t y p e :   j s o n         j s o n . m e s s a g e _ k e y :   l o g         j s o n . k e y s _ u n d e r _ r o o t :   t r u e         j s o n . o v e r w r i t e _ k e y s :   t r u e     -   i n p u t _ t y p e :   l o g         p a t h s :           -   " / u s r / l o c a l / b r o / s p o o l / b r o / d n s . l o g "         d o c u m e n t _ t y p e :   j s o n         j s o n . m e s s a g e _ k e y :   l o g         j s o n . k e y s _ u n d e r _ r o o t :   t r u e         j s o n . o v e r w r i t e _ k e y s :   t r u e     -   i n p u t _ t y p e :   l o g         p a t h s :           -   " / u s r / l o c a l / b r o / s p o o l / b r o / h t t p . l o g "         d o c u m e n t _ t y p e :   j s o n         j s o n . m e s s a g e _ k e y :   l o g         j s o n . k e y s _ u n d e r _ r o o t :   t r u e         j s o n . o v e r w r i t e _ k e y s :   t r u e     -   i n p u t _ t y p e :   l o g         p a t h s :           -   " / u s r / l o c a l / b r o / s p o o l / b r o / i n t e l . l o g "         d o c u m e n t _ t y p e :   j s o n         j s o n . m e s s a g e _ k e y :   l o g         j s o n . k e y s _ u n d e r _ r o o t :   t r u e         j s o n . o v e r w r i t e _ k e y s :   t r u e #   c o p y   i n p u t s   t o   a d d   a d d i t i o n a l   b r o   l o g s   a s   n e e d e d o u t p u t :   l o g s t a s h :       #   T h e   L o g s t a s h   h o s t s       h o s t s :   [ " 1 2 7 . 0 . 0 . 1 : 5 0 0 1 " ]
L o g s t a s h L o g s t a s h / e t c / l o g s t a s h / c o n f . d / b r o . c o n f i n p u t   {         b e a t s   {                 p o r t   = >   5 0 0 1                 c o d e c   = >   " j s o n _ l i n e s "         } } f i l t e r   {     # L e t ' s   g e t   r i d   o f   t h o s e   h e a d e r   l i n e s ;   t h e y   b e g i n   w i t h   a   h a s h     i f   [ m e s s a g e ]   = ~   / ^ # /   {         d r o p   {   }     }     # N o w ,   u s i n g   t h e   c s v   f i l t e r ,   w e   c a n   d e f i n e   t h e   B r o   l o g   f i e l d s     i f   [ t y p e ]   = =   " b r o - c o n n _ l o g "   {         c s v   {             c o l u m n s   = >   [ " t s " , " u i d " , " i d . o r i g _ h " , " i d . o r i g _ p " , " i d . r e s p _ h " , " i d . r e s p _ p " , " p r o t o " , " s e r v i c e " , " d u r a t i o n " , " o r i g _ b y t e s " , " r e s p _ b y t e s " , " c o n n _ s t a t e " , " l o c a l _ o r i g " , " m i s s e d _ b y t e s " , " h i s t o r y " , " o r i g _ p k t s " , " o r i g _ i p _ b y t e s " , " r e s p _ p k t s " , " r e s p _ i p _ b y t e s " , " t u n n e l _ p a r e n t s " ]             # I f   y o u   u s e   a   c u s t o m   d e l i m i t e r ,   c h a n g e   t h e   f o l l o w i n g   v a l u e   i n   b e t w e e n   t h e   q u o t e s   t o   y o u r   d e l i m i t e r .   O t h e r w i s e ,   i n s e r t   a   l i t e r a l   < t a b >   i n   b e t w e e n   t h e   t w o   q u o t e s   o n   y o u r   l o g s t a s h   s y s t e m ,   u s e   a   t e x t   e d i t o r   l i k e   n a n o   t h a t   d o e s n ' t   c o n v e r t   t a b s   t o   s p a c e s .             s e p a r a t o r   = >   "         "         }         # L e t ' s   c o n v e r t   o u r   t i m e s t a m p   i n t o   t h e   ' t s '   f i e l d ,   s o   w e   c a n   u s e   K i b a n a   f e a t u r e s   n a t i v e l y         d a t e   {             m a t c h   = >   [   " t s " ,   " U N I X "   ]         }         #   a d d   g e o i p   a t t r i b u t e s         g e o i p   {             s o u r c e   = >   " i d . o r i g _ h "             t a r g e t   = >   " o r i g _ g e o i p "         }         g e o i p   {             s o u r c e   = >   " i d . r e s p _ h "             t a r g e t   = >   " r e s p _ g e o i p "         }         # T h e   f o l l o w i n g   m a k e s   u s e   o f   t h e   t r a n s l a t e   f i l t e r   ( l o g s t a s h   c o n t r i b )   t o   c o n v e r t   c o n n _ s t a t e   i n t o   h u m a n   t e x t .   S a v e s   h a v i n g   t o   l o o k   u p   v a l u e s   f o r   p a c k e t   i n t r o s p e c t i o n         t r a n s l a t e   {             f i e l d   = >   " c o n n _ s t a t e "             d e s t i n a t i o n   = >   " c o n n _ s t a t e _ f u l l "             d i c t i o n a r y   = >   [                                         " S 0 " ,   " C o n n e c t i o n   a t t e m p t   s e e n ,   n o   r e p l y " ,                                         " S 1 " ,   " C o n n e c t i o n   e s t a b l i s h e d ,   n o t   t e r m i n a t e d " ,                                         " S 2 " ,   " C o n n e c t i o n   e s t a b l i s h e d   a n d   c l o s e   a t t e m p t   b y   o r i g i n a t o r   s e e n   ( b u t   n o   r e p l y   f r o m   r e s p o n d e r ) " ,                                         " S 3 " ,   " C o n n e c t i o n   e s t a b l i s h e d   a n d   c l o s e   a t t e m p t   b y   r e s p o n d e r   s e e n   ( b u t   n o   r e p l y   f r o m   o r i g i n a t o r ) " ,                                         " S F " ,   " N o r m a l   S Y N / F I N   c o m p l e t i o n " ,                                         " R E J " ,   " C o n n e c t i o n   a t t e m p t   r e j e c t e d " ,                                         " R S T O " ,   " C o n n e c t i o n   e s t a b l i s h e d ,   o r i g i n a t o r   a b o r t e d   ( s e n t   a   R S T ) " ,                                         " R S T R " ,   " E s t a b l i s h e d ,   r e s p o n d e r   a b o r t e d " ,                                         " R S T O S 0 " ,   " O r i g i n a t o r   s e n t   a   S Y N   f o l l o w e d   b y   a   R S T ,   w e   n e v e r   s a w   a   S Y N - A C K   f r o m   t h e   r e s p o n d e r " ,                                         " R S T R H " ,   " R e s p o n d e r   s e n t   a   S Y N   A C K   f o l l o w e d   b y   a   R S T ,   w e   n e v e r   s a w   a   S Y N   f r o m   t h e   ( p u r p o r t e d )   o r i g i n a t o r " ,                                         " S H " ,   " O r i g i n a t o r   s e n t   a   S Y N   f o l l o w e d   b y   a   F I N ,   w e   n e v e r   s a w   a   S Y N   A C K   f r o m   t h e   r e s p o n d e r   ( h e n c e   t h e   c o n n e c t i o n   w a s   ' h a l f '   o p e n ) " ,                 " S H R " ,   " R e s p o n d e r   s e n t   a   S Y N   A C K   f o l l o w e d   b y   a   F I N ,   w e   n e v e r   s a w   a   S Y N   f r o m   t h e   o r i g i n a t o r " ,                                         " O T H " ,   " N o   S Y N   s e e n ,   j u s t   m i d s t r e a m   t r a f f i c   ( a   ' p a r t i a l   c o n n e c t i o n '   t h a t   w a s   n o t   l a t e r   c l o s e d ) "                                         ]         }         m u t a t e   {             c o n v e r t   = >   [   " i d . o r i g _ p " ,   " i n t e g e r "   ]             c o n v e r t   = >   [   " i d . r e s p _ p " ,   " i n t e g e r "   ]             c o n v e r t   = >   [   " o r i g _ b y t e s " ,   " i n t e g e r "   ]             c o n v e r t   = >   [   " d u r a t i o n " ,   " f l o a t "   ]             c o n v e r t   = >   [   " r e s p _ b y t e s " ,   " i n t e g e r "   ]             c o n v e r t   = >   [   " m i s s e d _ b y t e s " ,   " i n t e g e r "   ]             c o n v e r t   = >   [   " o r i g _ p k t s " ,   " i n t e g e r "   ]             c o n v e r t   = >   [   " o r i g _ i p _ b y t e s " ,   " i n t e g e r "   ]             c o n v e r t   = >   [   " r e s p _ p k t s " ,   " i n t e g e r "   ]             c o n v e r t   = >   [   " r e s p _ i p _ b y t e s " ,   " i n t e g e r "   ]             r e n a m e   = >     [   " i d . o r i g _ h " ,   " i d _ o r i g _ h o s t "   ]             r e n a m e   = >     [   " i d . o r i g _ p " ,   " i d _ o r i g _ p o r t "   ]             r e n a m e   = >     [   " i d . r e s p _ h " ,   " i d _ r e s p _ h o s t "   ]             r e n a m e   = >     [   " i d . r e s p _ p " ,   " i d _ r e s p _ p o r t "   ]         }     } } o u t p u t   {
b r o . j s o n h t t p s : / / g i s t . g i t h u b . c o m / n e t s c y l l a / 2 7 a c 9 e 1 4 7 2 d 8 9 d f f a 5 a 8 2 6 7 a 6 a f 9 c 9 b e l o g s t a s h K i b a n a i n d e x   p a t t e r n s k i b a n a b r o d i s c o v e r b r o o u t p u t   {     # s t d o u t   {   c o d e c   = >   r u b y d e b u g   }     e l a s t i c s e a r c h   {                     h o s t s   = >   [ " l o c a l h o s t : 9 2 0 0 " ]                 i n d e x   = >   " b r o - c o n n - % { + Y Y Y Y . M M . d d } "                 d o c u m e n t _ t y p e   = >   " b r o "                 t e m p l a t e   = >   " / e t c / l o g s t a s h / b r o . j s o n "                 t e m p l a t e _ n a m e   = >   " b r o "                 t e m p l a t e _ o v e r w r i t e   = >   t r u e     } } s y s t e m c t l   r e s t a r t   l o g s t a s h
  -   B r o C o n t a i n e r f e e d s     s e n s o r f e e d s a p i   c o d e c r i t i c a l - s t a c k - i n t e l 使 a p i   c o d e f e e d b r o 使 f e e d s H I D S N I D S c r i t i c a l - s t a c k - i n t e l   a p i   [ a p i _ c o d e _ h e r e ] s u d o   / u s r / l o c a l / b r o / b i n / b r o c t l   r e s t a r t c r i t i c a l - s t a c k - i n t e l   l i s t
* n e t s c y l l a F B s e c i s t F r e e B u f . C O M
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则