-
Notifications
You must be signed in to change notification settings - Fork 44
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
Unable to remove Server header on Coraza module's response #144
Comments
Interesting. What happens when you do `SecRuleEngine Off`?
…On Mon, Apr 8, 2024 at 12:51 PM to-kr ***@***.***> wrote:
I'm currently using Caddy server with the coraza module for web
application firewall (WAF) capabilities. I've configured Caddy to remove
the Server header using the header directive, but it seems that the Server
header persists when the coraza module returns a 403 Forbidden response.
image.png (view on web)
<https://github.com/corazawaf/coraza-caddy/assets/6631729/8ccb2f35-bddb-4ba8-98ac-42bd627d1707>
Caddyfile:
{
http_port 8080
order coraza_waf first
}
:8080 {
header {
-Server
-Alt-Svc
}
handle {
respond 404
}
coraza_waf {
load_owasp_crs
directives `
Include /etc/caddy/*.conf
Include @coraza.conf-recommended
Include @crs-setup.conf.example
Include @owasp_crs/*.conf
SecRuleEngine On
`
}
}
Steps to Reproduce:
1. Start Caddy server with the provided Caddyfile configuration.
2. Send a request that triggers a 403 Forbidden response from the
coraza module.
curl -v "http://127.0.0.1:8080?id=1;DELETE%20FROM"
3. Check the response headers and observe that the Server header is
still present.
Expected Behavior:
The Server header should be removed from the response when the coraza
module returns a 403 Forbidden response, as specified in the Caddyfile
configuration.
Actual Behavior:
The Server header persists in the response even after configuring Caddy to
remove it.
Additional Information:
- Caddy version: 2.7.6
- Coraza module version: v2.0.0-rc.3
—
Reply to this email directly, view it on GitHub
<#144>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAXOYAT3YQISJ7NGMJMJ7WDY4JZDPAVCNFSM6AAAAABF4OUAOKVHI2DSMVQWIX3LMV43ASLTON2WKOZSGIZTAOBXGY3DSMQ>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Could it be the case that the middleware that removes server header happens after coraza does its job? cc @mholt |
Yeah. |
We can configure WAF header from
Returns:
and
|
Thank You. It works. |
Can we close this?
…On Wed, Oct 2, 2024 at 2:34 PM to-kr ***@***.***> wrote:
Thank You. It works.
—
Reply to this email directly, view it on GitHub
<#144 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAXOYAQCAGXPG7ERHAGODETZZPR33AVCNFSM6AAAAABF4OUAOKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGOBYGUZTANBTGM>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Yes, handle_errors solves the problem |
I'm currently using Caddy server with the coraza module for web application firewall (WAF) capabilities. I've configured Caddy to remove the Server header using the header directive, but it seems that the Server header persists when the coraza module returns a 403 Forbidden response.
Caddyfile:
Steps to Reproduce:
Expected Behavior:
The Server header should be removed from the response when the coraza module returns a 403 Forbidden response, as specified in the Caddyfile configuration.
Actual Behavior:
The Server header persists in the response even after configuring Caddy to remove it.
Additional Information:
The text was updated successfully, but these errors were encountered: