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 to monitor websocket connection proxied by nginx #1368

Closed
cschwaderer opened this issue Mar 29, 2017 · 2 comments
Closed

ModSecurity to monitor websocket connection proxied by nginx #1368

cschwaderer opened this issue Mar 29, 2017 · 2 comments
Assignees

Comments

@cschwaderer
Copy link

Can ModSecurity monitor and block websocket traffic?

(Might be the same question as #831 But that one's not totally clear to me and maybe things have changed since then.)

My current setup: An AngularJS/AngularSails web application "talks" with an NodeJS/SailsJS backend solely over websocket (resp. the Sails implementation of socket.io). In between sits nginx as a proxy, configured like so:

server {
    listen 1337 ssl;
    location /socket.io/ {
       proxy_pass https://localhost:1338;
       proxy_set_header Upgrade $http_upgrade;
       proxy_set_header Connection "upgrade";
       proxy_http_version 1.1;
       proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    }
}

Can I use ModSecurity in nginx to monitor, analyse, and block the traffic going over this websocket connection? If so: How?

@jptosso
Copy link

jptosso commented Apr 30, 2017

I would say no as websockets are data streams and you can't intercept stream blocks to analyze, it would probably take a huge restructuration and creating new stages.

@zimmerle zimmerle self-assigned this May 5, 2017
@zimmerle
Copy link
Contributor

zimmerle commented May 5, 2017

Hi @cschwaderer and @asdfuken,

Currently ModSecurity is not capable to inspect WebSockets. It is only capable to understand the http requests.

@zimmerle zimmerle closed this as completed May 5, 2017
acouvreur pushed a commit to acouvreur/traefik-modsecurity-plugin that referenced this issue Dec 28, 2021
owasp-modsecurity/ModSecurity#1368

Currently ModSecurity is not capable to inspect WebSockets. It is only capable to understand the http requests.
acouvreur added a commit to acouvreur/traefik-modsecurity-plugin that referenced this issue Jan 11, 2022
owasp-modsecurity/ModSecurity#1368

Currently ModSecurity is not capable to inspect WebSockets. It is only capable to understand the http requests.
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

3 participants