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

ModSecurity and disabling rules the best way #5288

Open
Obsiye opened this issue Dec 13, 2022 · 2 comments
Open

ModSecurity and disabling rules the best way #5288

Obsiye opened this issue Dec 13, 2022 · 2 comments

Comments

@Obsiye
Copy link
Contributor

Obsiye commented Dec 13, 2022

After giving a Developer Presentation on ModSecurity, we got a question about how do we compensate for a security rule that was disabled i.e. how do we test for HTTP Smuggling attacks now that we've disabled it on the firewall.

      SecRule REQUEST_URI "@contains /messages" \
        "id:1000,phase:2,pass,nolog,ctl:ruleRemoveById=921110"

Extra: There was also a question of if we needed to disable the rule and instead can we fine tune it further?

@Obsiye
Copy link
Contributor Author

Obsiye commented Jan 12, 2023

I believe it's best to re-enable this but fine tune it. This is because HTTP Smuggling attack protection isn't built into Rails. I think puma has it but i'll need to do further digging into that.

CCCD uses Unicorn (web server). I can't seem to find Unicorn in the Snyk database :/ but i do see stuff around https://yhbt.net/unicorn.git/ . I've emailed Unicorn unicorn@yhbt.net to ask them if they protect against http smuggling attacks by default.

However, we do have HTTP 2 set on the nginx server which provides some level of protection (more info here).

We can turn the rule back on in the firewall and then fine tune it to allow specific types of sentences with regex.

ATM, i want to try and POC a way to alert us on slack when modsecurity has matched on data relating to a http smuggling attack. This means we'll be alerted of false positives, if any.

@Obsiye
Copy link
Contributor Author

Obsiye commented Jan 12, 2023

Snyk has an excellent blog on http smuggling attaacks https://snyk.io/blog/demystifying-http-request-smuggling/

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

1 participant