-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from xdecock/fix/dont-reusebuffers
Fix: correct header and request body handling, allowing the binding to be fully working
- Loading branch information
Showing
4 changed files
with
85 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
2.0.0 - Make the binding functional - before updating, make sure you test your rules | ||
1.0.1 - Update to compile with different modsecurity version, and different varnish versions | ||
1.0.0 - Initial Proof of concept binding, some important problems occurs on this version, mostly not able to effectively act. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
Handle Varnish requests on stream (request / deliver) | ||
VRT_AddFilter(ctx, &td_sec_vfp_modsec, &td_sec_vdp_modsec); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,25 @@ | ||
varnishtest "Check if we got the version string" | ||
|
||
server s1 { | ||
rxreq | ||
txresp | ||
rxreq | ||
txresp | ||
} -start | ||
|
||
varnish v1 -vcl+backend { | ||
import sec; | ||
|
||
sub vcl_init { | ||
new xsec = sec.sec(); | ||
|
||
} | ||
sub vcl_init { | ||
new xsec = sec.sec(); | ||
xsec.add_rules("https://www.modsecurity.org/modsecurity-regression-test-secremoterules.txt", "test"); | ||
} | ||
sub vcl_deliver { | ||
set resp.http.X-ModSec-RulesCouns = xsec.add_rules("https://www.modsecurity.org/modsecurity-regression-test-secremoterules.txt", "test"); | ||
set resp.http.X-ModSec-RulesCount = 50; | ||
} | ||
} -start | ||
|
||
client c1 { | ||
txreq | ||
rxresp | ||
expect resp.status == 200 | ||
expect resp.http.X-ModSec-RulesCouns ~ ^[0-9]+$ | ||
txreq | ||
rxresp | ||
expect resp.status == 200 | ||
expect resp.http.X-ModSec-RulesCount ~ ^[0-9]+$ | ||
} -run |