Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The log cannot record 302 actions #2741

Closed
lebashupian opened this issue May 16, 2022 · 2 comments
Closed

The log cannot record 302 actions #2741

lebashupian opened this issue May 16, 2022 · 2 comments

Comments

@lebashupian
Copy link

v3.0.5
When I configure the following rules
SecRule REQUEST_URI "attack" "phase:1,id:100000001,log,block,t:none,redirect:%{REQUEST_HEADERS:scheme}/block.html?url=%{REQUEST_FILENAME}&intercept_domain=%{request_headers.host},ctl:ruleEngine=On,msg:'TEST'"

It can work

but, But my log does not seem to record the details of 302 jump, *response":{"http_code":200,"headers":{}**},

The status code received by the browser is 302, but 200 is recorded here Moreover, the headers are empty. Why are there no records?

{"transaction":{"client_ip":"127.0.0.1","time_stamp":"Mon May 16 17:19:10 2022","server_id":"d9d7259fce8baf263c250507ff437189af7d0a8f","client_port":57964,"host_ip":"127.0.0.1","host_port":8080,"unique_id":"165269275030.697083","request":{"method":"GET","http_version":1.1,"uri":"/attack","body":"","headers":{"Host":"127.0.0.1:8080","User-Agent":"curl/7.61.1","Accept":"/"}},"response":{"http_code":200,"headers":{}},"producer":{"modsecurity":"ModSecurity v3.0.4 (Linux)","connector":"ModSecurity-nginx v1.0.2","secrules_engine":"Enabled","components":[]},"messages":[{"message":"Just For a Test or Attack","details":{"match":"Matched "Operator Rx' with parameter attack' against variable REQUEST_URI' (Value: /attack' )","reference":"o1,6v4,7","ruleId":"100000001","file":"/hqxa/nginx/conf/modsecurity/waf_rules/rules.conf","lineNumber":"1","data":"","severity":"0","ver":"","rev":"","tags":[],"maturity":"0","accuracy":"0"}}]}}

Ask for help

@martinhsv
Copy link
Contributor

Hello @lebashupian ,

I believe what you are describing is encompassed in this open ticket: owasp-modsecurity/ModSecurity-nginx#170 .

As a workaround, you can get expected output by changing your rule to run in phase:2.

@lebashupian
Copy link
Author

thank you . The problem was solved

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants