[13049] 2018-08-11_打造基于Nginx的敏感信息泄露检测系统

文档创建者:s7ckTeam
浏览次数:6
最后更新:2025-01-18
2018-08-11_打造基于Nginx的敏感信息泄露检测系统 N g i n x f 4 c k b a i d u   F r e e B u f   2 0 1 8 - 0 8 - 1 1 * f 4 c k b a i d u F r e e B u f   0 / d a t a / c o d e t e s t . c o n f C e n t O S   7   M i n i m a l O p e n R e s t y 1 . 1 3 . 6 . 2 h t t p s : / / o p e n r e s t y . o r g / c n / d o w n l o a d . h t m l S p l u n k   F r e e h t t p s : / / d o w n l o a d . s p l u n k . c o m / p r o d u c t s / s p l u n k / r e l e a s e s / 7 . 1 . 2 / l i n u x / s p l u n k - 7 . 1 . 2 - a 0 c 7 2 a 6 6 d b 6 6 - l i n u x - 2 . 6 - x 8 6 _ 6 4 . r p m 1 / e r r o r - b a s e d   s q l i 使 O p e n R e s t y N g i n x N g i n x   l u a 2 N g i n x   L u a b o d y _ f i l t e r l o g b o d y _ f i l t e r r e s p _ b o d y - - > n g x . c t x l o g - - > l o g S p l u n k - - > S p l u n k b o d y _ f i l t e r b o d y _ f i l t e r . l u a l o c a l   r e s p _ b o d y   =   n g x . a r g [ 1 ]   - -
l o c a l   e o f   =   n g x . a r g [ 2 ] l o c a l   c t x _ l o g   =   { }   - - t a b l e l o c a l   r e g e x   =   [ [ Y o u   h a v e   a n   e r r o r   i n   y o u r   S Q L   s y n t a x ] ]   - - l o c a l   m   =   n g x . r e . m a t c h ( r e s p _ b o d y ,   r e g e x ,   ' j i o ' )   - - i f   m   t h e n   - -   c t x _ l o g . r u l e _ m a t c h   =   m [ 0 ]   - -   c t x _ l o g . R e q u e s t _ l i n e   =   n g x . v a r . r e q u e s t   - - U R L G E T   c t x _ l o g . R e q u e s t _ h e a d e r s   =   n g x . r e q . g e t _ h e a d e r s ( )   - -   n g x . c t x . l o g   =   c t x _ l o g   - - n g x . c t x . l o g e n d l o g l o g . l u a l o c a l   l o g g e r   =   r e q u i r e   " s o c k e t "   - - l o g g e r   s o c k e t l o c a l   c j s o n   =   r e q u i r e   " c j s o n . s a f e "   - - c j s o n i f   n o t   l o g g e r . i n i t t e d ( )   t h e n   - - l o g g e r   l o c a l   o k , e r r   =   l o g g e r . i n i t {       h o s t   =   " 1 2 7 . 0 . 0 . 1 " ,   - - s p l u n k   I P       p o r t   =   8 8 8 8 ,     - - s p l u n k       s o c k _ t y p e   =   " t c p " ,   - - s o c k e t       f l u s h _ l i m i t   =   1 ,       }   i f   n o t   o k   t h e n   - -     n g x . l o g ( n g x . E R R , " f a i l e d   t o   i n i t i a l i z e   t h e   l o g g e r :   " , e r r )     r e t u r n   e n d e n d l o c a l   l o g   =   n g x . c t x . l o g   - - n g x . c t x . l o g i f   t y p e ( l o g )   = =   " t a b l e "   t h e n   - -   l o c a l   b y t e s ,   e r r   =   l o g g e r . l o g ( c j s o n . e n c o d e ( l o g )   . .   " r n " )   i f   e r r   t h e n     n g x . l o g ( n g x . E R R ,   " f a i l e d   t o   l o g   m e s s a g e :   " ,   e r r )     e n d e n d n g i n x h t t p i n c l u d e   t e s t . c o n f t e s t . c o n f l u a _ p a c k a g e _ p a t h   ' / d a t a / c o d e / ? . l u a ; ; ' ; b o d y _ f i l t e r _ b y _ l u a _ f i l e   / d a t a / c o d e / b o d y _ f i l t e r . l u a ; l o g _ b y _ l u a _ f i l e   / d a t a / c o d e / l o g . l u a ; l u a _ c o d e _ c a c h e   o n ;
使 d v w a s q l i M y S Q L n g i n x - - > h t t p d   +   p h p d v w a M y S Q L s p l u n k R e q u e s t _ h e a d e r s R e q u e s t _ l i n e r u l e _ m a t c h P S P O S T a c c e s s
S p l u n k p r o p s . c o n f S p l u n k J s o n v i m   / o p t / s p l u n k / e t c / s y s t e m / l o c a l / p r o p s . c o n f [ _ j s o n ]     # s o u r c e t y p e S H O U L D _ L I N E M E R G E   =   f a l s e     # S p l u n k 3 n g i n x   l u a h t t p s : / / g i t h u b . c o m / o p e n r e s t y / l u a - n g i n x - m o d u l e O p e n R e s t y   l o g g e r   s o c k e t h t t p s : / / g i t h u b . c o m / c l o u d f l a r e / l u a - r e s t y - l o g g e r - s o c k e t O p e n R e s t y h t t p s : / / m o o n b i n g b i n g . g i t b o o k s . i o / o p e n r e s t y - b e s t - p r a c t i c e s / l u a / m a i n . h t m l * f 4 c k b a i d u F r e e B u f
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则