-
Notifications
You must be signed in to change notification settings - Fork 25
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
logging plus http response_code advice #209
Comments
Hi @ericinfra, thanks for coming by. We removed that some time ago especially because in a proxy we can't guarantee what was the response code that would end up returned to upstream but not only limited to proxies but to connectors in general, see corazawaf/coraza#795 for more details. Is this something you need for production or just for the benchmarks? |
Hi @jcchavezs .Thank you for the reply This is need for production ,currently in beta Convenient event tracking and analysis Or when the following two log messages exist at the same time "Coraza: Access denied (phase 1)" and "Coraza: Access denied (phase 5)" I want to clearly confirm which rule is blocking malicious attacks |
Would a response header telling you the rule help? Of course that can't be leaked to client in prod. |
Can it be associated with istio proxy access log? I hope that the "Coraza: Access denied" log and the "istio proxy/envoy" access log can be associated with a unique identifier for easy tracking of events |
Question 1: REQUEST-949-BLOCKING-EVALUATION.conf log ,Total Score: 48
RESPONSE-980-CORRELATION.conf Access denied log, did not see the "Total Score" keyword
Question 2: Is the "Access denied" directive in RESPONSE-980-CORRELATION.conf really effective? I see that 2023-06-26T09:00:18 still has a normal access log with 301 status 980 wasm 2023-06-26T09:00:18 log
pod 2023-06-26T09:00:18 access log
|
Ping @M4tteoP
…On Mon, Jun 26, 2023 at 11:19 AM Erictang ***@***.***> wrote:
Question 1:
Only after triggering the 949 rule, there is Inbound Anomaly Score
Exceeded in phase 1 (Total Score: 58)
But when the 980 rule is triggered, the "Total Score" keyword is not seen
Very confused, what is the Anomaly Score that triggers the 980 rule and
leads to "Access denied"?
REQUEST-949-BLOCKING-EVALUATION.conf log ,Total Score: 48
2023-06-26T08:48:14.108812Z critical envoy wasm external/envoy/source/extensions/common/wasm/context.cc:1157 wasm log my-wasm-root-id my-wasm-vm-id: [client "192.168.122.1"] Coraza: Access denied (phase 1). Inbound Anomaly Score Exceeded in phase 1 (Total Score: 48) [file ***@***.***_crs/REQUEST-949-BLOCKING-EVALUATION.conf"] [line "10773"] [id "949111"] [rev ""] [msg "Inbound Anomaly Score Exceeded in phase 1 (Total Score: 48)"] [data ""] [severity "emergency"] [ver "OWASP_CRS/4.0.0-rc1"] [maturity "0"] [accuracy "0"] [tag "anomaly-evaluation"] [hostname "10.110.32.70"] [uri "/?s=..%2F..%2F..%2F..%2F..%2F..%2F..%2F..%2F..%2F..%2F..%2F..%2F..%2F..%2F..%2F..%2F"] [unique_id "segMKgHkWDPmIwxaowb"]
RESPONSE-980-CORRELATION.conf Access denied log, did not see the "Total
Score" keyword
2023-06-26T08:48:12.641728Z critical envoy wasm external/envoy/source/extensions/common/wasm/context.cc:1157 wasm log my-wasm-root-id my-wasm-vm-id: [client "192.168.122.1"] Coraza: Access denied (phase 5). Anomaly Scores: (Inbound Scores: blocking=3, detection=3, per_pl=3-0-0-0, threshold=5) - (Outbound Scores: blocking=0, detection=0, per_pl=0-0-0-0, threshold=4) - (SQLI=0, XSS=0, RFI=0, LFI=0, RCE=0, [file ***@***.***_crs/RESPONSE-980-CORRELATION.conf"] [line "12628"] [id "980170"] [rev ""] [msg "Anomaly Scores: (Inbound Scores: blocking=3, detection=3, per_pl=3-0-0-0, threshold=5) - (Outbound Scores: blocking=0, detection=0, per_pl=0-0-0-0, threshold=4) - (SQLI=0, XSS=0, RFI=0, LFI=0, RCE=0, "] [data ""] [severity "emergency"] [ver "OWASP_CRS/4.0.0-rc1"] [maturity "0"] [accuracy "0"] [tag "reporting"] [hostname "10.110.32.70"] [uri "/wp-includes/js/2821272244324623417"] [unique_id "LfBFgSWGArVPGmFUdiw"]
Question 2:
Is the "Access denied" directive in RESPONSE-980-CORRELATION.conf really
effective? I see that 2023-06-26T09:00:18 still has a normal access log
with 301 status
980 wasm 2023-06-26T09:00:18 log
2023-06-26T09:00:18.558035Z warning envoy wasm external/envoy/source/extensions/common/wasm/context.cc:1151 wasm log my-wasm-root-id my-wasm-vm-id: [client "10.110.32.46"] Coraza: Access denied (phase 1). Host header is a numeric IP address [file ***@***.***_crs/REQUEST-920-PROTOCOL-ENFORCEMENT.conf"] [line "2243"] [id "920350"] [rev ""] [msg "Host header is a numeric IP address"] [data "10.110.32.70:80"] [severity "warning"] [ver "OWASP_CRS/4.0.0-rc1"] [maturity "0"] [accuracy "0"] [tag "application-multi"] [tag "language-multi"] [tag "platform-multi"] [tag "attack-protocol"] [tag "paranoia-level/1"] [tag "OWASP_CRS"] [tag "capec/1000/210/272"] [tag "PCI/6.5.10"] [hostname "10.110.32.70"] [uri "/metrics"] [unique_id "OzWlmsqxDbKJjjaYXrP"]
2023-06-26T09:00:18.593148Z critical envoy wasm external/envoy/source/extensions/common/wasm/context.cc:1157 wasm log my-wasm-root-id my-wasm-vm-id: [client "10.110.32.46"] Coraza: Access denied (phase 5). Anomaly Scores: (Inbound Scores: blocking=3, detection=3, per_pl=3-0-0-0, threshold=5) - (Outbound Scores: blocking=0, detection=0, per_pl=0-0-0-0, threshold=4) - (SQLI=0, XSS=0, RFI=0, LFI=0, RCE=0, [file ***@***.***_crs/RESPONSE-980-CORRELATION.conf"] [line "12628"] [id "980170"] [rev ""] [msg "Anomaly Scores: (Inbound Scores: blocking=3, detection=3, per_pl=3-0-0-0, threshold=5) - (Outbound Scores: blocking=0, detection=0, per_pl=0-0-0-0, threshold=4) - (SQLI=0, XSS=0, RFI=0, LFI=0, RCE=0, "] [data ""] [severity "emergency"] [ver "OWASP_CRS/4.0.0-rc1"] [maturity "0"] [accuracy "0"] [tag "reporting"] [hostname "10.110.32.70"] [uri "/metrics"] [unique_id "OzWlmsqxDbKJjjaYXrP"]
2023-06-26T09:00:18.594099Z warning envoy wasm external/envoy/source/extensions/common/wasm/context.cc:1151 wasm log my-wasm-root-id my-wasm-vm-id: [client "10.110.32.46"] Coraza: Access denied (phase 1). Host header is a numeric IP address [file ***@***.***_crs/REQUEST-920-PROTOCOL-ENFORCEMENT.conf"] [line "2243"] [id "920350"] [rev ""] [msg "Host header is a numeric IP address"] [data "10.110.32.70:30845"] [severity "warning"] [ver "OWASP_CRS/4.0.0-rc1"] [maturity "0"] [accuracy "0"] [tag "application-multi"] [tag "language-multi"] [tag "platform-multi"] [tag "attack-protocol"] [tag "paranoia-level/1"] [tag "OWASP_CRS"] [tag "capec/1000/210/272"] [tag "PCI/6.5.10"] [hostname "10.110.32.70"] [uri "/metrics"] [unique_id "KjkRGNlRpxeKJftwrWP"]
2023-06-26T09:00:18.595245Z critical envoy wasm external/envoy/source/extensions/common/wasm/context.cc:1157 wasm log my-wasm-root-id my-wasm-vm-id: [client "10.110.32.46"] Coraza: Access denied (phase 5). Anomaly Scores: (Inbound Scores: blocking=3, detection=3, per_pl=3-0-0-0, threshold=5) - (Outbound Scores: blocking=0, detection=0, per_pl=0-0-0-0, threshold=4) - (SQLI=0, XSS=0, RFI=0, LFI=0, RCE=0, [file ***@***.***_crs/RESPONSE-980-CORRELATION.conf"] [line "12628"] [id "980170"] [rev ""] [msg "Anomaly Scores: (Inbound Scores: blocking=3, detection=3, per_pl=3-0-0-0, threshold=5) - (Outbound Scores: blocking=0, detection=0, per_pl=0-0-0-0, threshold=4) - (SQLI=0, XSS=0, RFI=0, LFI=0, RCE=0, "] [data ""] [severity "emergency"] [ver "OWASP_CRS/4.0.0-rc1"] [maturity "0"] [accuracy "0"] [tag "reporting"] [hostname "10.110.32.70"] [uri "/metrics"] [unique_id "KjkRGNlRpxeKJftwrWP"]
pod 2023-06-26T09:00:18 access log
127.0.0.6 - - [26/Jun/2023:09:00:18 +0000] "GET /metrics HTTP/1.1" 301 352 "-" "Prometheus/2.38.0"
—
Reply to this email directly, view it on GitHub
<#209 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAXOYAXJ3HYSYSBMBSYCT6DXNFH37ANCNFSM6AAAAAAZS7PUJU>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Hi @ericinfra
The misleading part is the
Is effective in terms of telling you that rule An example to clarify
This line tells you that a blocking action has been enforced, denying the request because of a total score equal to
|
About it, as stated by JC, the old implementation was not properly working and has been removed by corazawaf/coraza#795. What we might evaluate is if it is worth adding a log line connector side printing what the waf module tried to enforce. But I agree with corazawaf/coraza#795 (comment), we should at least clearly state that it is what the waf module tried to enforce, not necessarily the real final status code. |
I use sqlmap to simulate the attack, both coraza and ModSecurity return 403
But ModSecurity logs the http response_code, cozara doesn't
The ModSecurity logging is "ModSecurity: Access denied with code 403"
cozara logging is "Coraza: Access denied (phase 1)" and "Coraza: Access denied (phase 5)"
This leads to the need to manually check the access log to judge and guess the httpresponse_code returned to the client by coraza, which is troublesome
ModSecurity log
coraza log
The text was updated successfully, but these errors were encountered: