Open rahulbhatu opened 5 years ago
Managed to get the event logs enabled in file. Next challenge is 1) I am converting the .conf rules to json using modsec2lua-resty-waf.pl, However the rules are converted to json and also the echo $? suggests that the conversion was successful with 0 status but but i get some errors not sure if these are warning as comparing the .conf and json files all rules are there.
root@ip-172-31-29-13:/usr/local/openresty/lua-resty-waf/tools# ./modsec2lua-resty-waf.pl < 26_Apps_WordPress.conf > 26_Apps_WordPress.json
Cannot translate variable FILES at /usr/local/openresty/lua-resty-waf/tools/Modsec2LRW.pm line 674, <> line 170.
SecRule TX:WordPress @eq 1 id:225120,chain,msg:'COMODO WAF: XSS vulnerability in WordPress before 4.6.1 (CVE-2016-7168)||%{tx.domain}|%{tx.mode}|2',phase:2,deny,status:403,log,t:none,rev:2,severity:2,tag:'CWAF',tag:'WordPress'
SecRule REQUEST_BASENAME @streq media-new.php chain,t:none,t:urlDecodeUni
SecRule FILES @rx (?:\<(.+)\>) chain,capture,t:none,t:urlDecodeUni
SecRule TX:1 @contains = t:none
Cannot perform transform normalizePath at /usr/local/openresty/lua-resty-waf/tools/Modsec2LRW.pm line 951, <> line 170.
Cannot translate variable FILES at /usr/local/openresty/lua-resty-waf/tools/Modsec2LRW.pm line 674, <> line 170.
SecRule TX:WordPress @eq 1 id:225140,chain,msg:'COMODO WAF: XSS vulnerability in the in WordPress before 4.5.3 (CVE-2016-5834)||%{tx.domain}|%{tx.mode}|2',phase:2,deny,status:403,log,t:none,rev:3,severity:2,tag:'CWAF',tag:'WordPress'
SecRule ARGS_POST:action @streq upload-attachment chain,t:none,t:urlDecodeUni,t:lowercase
SecRule FILES @contains < chain,t:none,t:urlDecodeUni
SecRule REQUEST_BASENAME @streq async-upload.php t:none,t:urlDecodeUni,t:lowercase
Cannot translate variable FILES at /usr/local/openresty/lua-resty-waf/tools/Modsec2LRW.pm line 674, <> line 170.
SecRule TX:WordPress @eq 1 id:225141,chain,msg:'COMODO WAF: XSS vulnerability in the in WordPress before 4.5.3 (CVE-2016-5834)||%{tx.domain}|%{tx.mode}|2',phase:2,deny,status:403,log,t:none,rev:3,severity:2,tag:'CWAF',tag:'WordPress'
SecRule ARGS_POST:html-upload @streq upload chain,t:none,t:lowercase
SecRule FILES @contains < chain,t:none,t:urlDecodeUni
SecRule REQUEST_FILENAME @streq media-new.php t:none,t:urlDecodeUni,t:lowercase
Cannot perform transform normalizePath at /usr/local/openresty/lua-resty-waf/tools/Modsec2LRW.pm line 951, <> line 170.
Cannot translate variable FILES at /usr/local/openresty/lua-resty-waf/tools/Modsec2LRW.pm line 674, <> line 170.
SecRule TX:WordPress @eq 1 id:225210,chain,msg:'COMODO WAF: Unrestricted file upload vulnerability in WordPress 4.9.7 (CVE-2018-14028)||%{tx.domain}|%{tx.mode}|2',phase:2,deny,status:403,log,t:none,rev:2,severity:2,tag:'CWAF',tag:'WordPress'
SecRule REQUEST_BASENAME @streq update.php chain,t:none,t:urlDecodeUni,t:lowercase
SecRule ARGS_GET:action @rx ^upload-(?:plugin|theme)$ chain,t:none,t:urlDecodeUni,t:lowercase
SecRule FILES !@rx \.zip$ t:none,t:urlDecodeUni,t:lowercase
Cannot perform transform normalizePath at /usr/local/openresty/lua-resty-waf/tools/Modsec2LRW.pm line 951, <> line 170.
Cannot translate variable FILES at /usr/local/openresty/lua-resty-waf/tools/Modsec2LRW.pm line 674, <> line 170.
SecRule REQUEST_FILENAME @contains /wp-content/plugins/sexy-contact-form/includes/fileupload/ id:240020,chain,msg:'COMODO WAF: Protecting WordPress Creative Contact Form Files folder||%{tx.domain}|%{tx.mode}|2',phase:2,deny,status:403,t:none,t:urlDecodeUni,t:lowercase,t:normalizePath,rev:5,severity:2,tag:'CWAF',tag:'WordPress'
SecRule FILES @rx \.(?:php|js|pl)(?:\.|$) t:none,t:lowercase,t:urlDecodeUni
Cannot perform transform normalizePath at /usr/local/openresty/lua-resty-waf/tools/Modsec2LRW.pm line 951, <> line 170.
Cannot perform transform utf8toUnicode at /usr/local/openresty/lua-resty-waf/tools/Modsec2LRW.pm line 951, <> line 170.
Cannot perform transform utf8toUnicode at /usr/local/openresty/lua-resty-waf/tools/Modsec2LRW.pm line 951, <> line 170.
Cannot perform transform normalizePath at /usr/local/openresty/lua-resty-waf/tools/Modsec2LRW.pm line 951, <> line 170.
Cannot perform transform normalizePath at /usr/local/openresty/lua-resty-waf/tools/Modsec2LRW.pm line 951, <> line 170.
Cannot perform transform normalizePath at /usr/local/openresty/lua-resty-waf/tools/Modsec2LRW.pm line 951, <> line 170.
Cannot perform transform normalizePath at /usr/local/openresty/lua-resty-waf/tools/Modsec2LRW.pm line 951, <> line 170.
2) after converting rules to json Moving them to rules directory activate them or One has to do lua_resty_waf.load_secrules and add waf:set_option("add_ruleset", "example.conf") after converting to json
Thanks
Hi I have lua-resty-waf setup but event logs are not being captured in the given file location.
########################################################################
my default.conf