Skip to content

Commit

Permalink
fix(config): image build (#100)
Browse files Browse the repository at this point in the history
* build image: use coraza.cfg as updated in 8f29491

* coraza.cfg: haproxy configs must end with a LF

A missing LF on the end of config files is a hard error starting with haproxy 2.3
  • Loading branch information
bzed committed Jan 2, 2024
1 parent 6a0d9a3 commit b93d995
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
4 changes: 3 additions & 1 deletion doc/config/coraza.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,6 @@ spoe-message coraza-req

spoe-message coraza-res
args app=str(sample_app) id=unique-id version=res.ver status=status headers=res.hdrs body=res.body
event on-http-response
event on-http-response


15 changes: 11 additions & 4 deletions docker/haproxy/coraza.cfg
Original file line number Diff line number Diff line change
@@ -1,19 +1,26 @@
# https://github.com/haproxy/haproxy/blob/master/doc/SPOE.txt
# /etc/haproxy/coraza.cfg
[coraza]
spoe-agent coraza-agent
messages coraza-req coraza-res
# Process HTTP requests only (the responses are not evaluated)
messages coraza-req
# Comment the previous line and add coraza-res, to process responses also.
# NOTE: there are still some memory & caching issues, so use this with care
#messages coraza-req coraza-res
option var-prefix coraza
option set-on-error error
timeout hello 100ms
timeout hello 2s
timeout idle 2m
timeout processing 500ms
use-backend coraza-spoa
log global

spoe-message coraza-req
args app=fe_name id=unique-id src-ip=src src-port=src_port dst-ip=dst dst-port=dst_port method=method path=path query=query version=req.ver headers=req.hdrs body=req.body
args app=str(sample_app) id=unique-id src-ip=src src-port=src_port dst-ip=dst dst-port=dst_port method=method path=path query=query version=req.ver headers=req.hdrs body=req.body
event on-frontend-http-request

spoe-message coraza-res
args app=fe_name id=unique-id version=res.ver status=status headers=res.hdrs body=res.body
args app=str(sample_app) id=unique-id version=res.ver status=status headers=res.hdrs body=res.body
event on-http-response


0 comments on commit b93d995

Please sign in to comment.