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

Basic streaming detection on raw request/response #304

Open
rcbarnett-zz opened this issue Oct 17, 2013 · 4 comments
Open

Basic streaming detection on raw request/response #304

rcbarnett-zz opened this issue Oct 17, 2013 · 4 comments
Assignees
Labels
2.x Related to ModSecurity version 2.x 3.x Related to ModSecurity version 3.x bug It is a confirmed bug enhancement

Comments

@rcbarnett-zz
Copy link
Contributor

MODSEC-147: I'd like to begin the process of streaming inspection. Initially only on the raw request and response (i.e. connection level filter data).

See MODSEC-17 and MODSEC-18 for the basic ideas.

Here, I only want these to work:

SecStreamInspect REQUEST "@pmf huge-prequal-list.dat" "nolog,pass,setvar:TX.prequal=1"
SecStreamInspect RESPONSE "@verifyCC \b(\d{13,16})\b" "log,drop,msg='CC# detected in response',sanitizeMatchedBytes"

Or maybe these are better:

SecRule STREAM_REQUEST "@pmf huge-prequal-list.dat" "phase:rawrequest,nolog,pass,setvar:TX.prequal=1"
SecRule STREAM_RESPONSE "@verifyCC \b(\d{13,16})\b" "phase:rawresponse,log,drop,msg='CC# detected in response',sanitizeMatchedBytes"

sanitizeMatchedBytes (MODSEC-146) MUST sanitize (x out) all of the bytes that matched.

@rcbarnett-zz
Copy link
Contributor Author

Original reporter: brectanus

@rcbarnett-zz
Copy link
Contributor Author

rbarnett: I am assuming that by stream inspection, we mean that modsecurity will be able to act as a "filter". I like the following syntax -

SecRule STREAM_REQUEST "@pmf huge-prequal-list.dat" "phase:rawrequest,nolog,pass,setvar:TX.prequal=1"
SecRule STREAM_RESPONSE "@verifyCC \b(\d{13,16})\b" "phase:rawresponse,log,drop,msg='CC# detected in response',sanitizeMatchedBytes"

@ghost ghost assigned zimmerle Oct 17, 2013
@rcbarnett-zz
Copy link
Contributor Author

bpinto: We start doing it with STREAM_INPUT_BODY / STREAM_OUTPUT_BODY. A real full stream inspection need to wait more

@rcbarnett-zz
Copy link
Contributor Author

bpinto: We are still buffering this variables. I really don't know if make sense has it for modsecurity. I'm moving it for future versions

@victorhora victorhora added enhancement 2.x Related to ModSecurity version 2.x 3.x Related to ModSecurity version 3.x labels Nov 15, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.x Related to ModSecurity version 2.x 3.x Related to ModSecurity version 3.x bug It is a confirmed bug enhancement
Projects
None yet
Development

No branches or pull requests

3 participants