-
Notifications
You must be signed in to change notification settings - Fork 18
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
New application logging (zerolog) & error handling #75
Changes from all commits
dfffcd9
aecf93d
04fa36d
d186b8e
79d7742
f6425dc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,11 +6,11 @@ defaults | |
log global | ||
option httplog | ||
timeout client 1m | ||
timeout server 1m | ||
timeout connect 10s | ||
timeout http-keep-alive 2m | ||
timeout queue 15s | ||
timeout tunnel 4h # for websocket | ||
timeout server 1m | ||
timeout connect 10s | ||
timeout http-keep-alive 2m | ||
timeout queue 15s | ||
timeout tunnel 4h # for websocket | ||
|
||
frontend stats | ||
mode http | ||
|
@@ -26,7 +26,7 @@ frontend test_frontend | |
bind *:443 ssl crt /usr/local/etc/haproxy/example.com.pem alpn h2,http/1.1 | ||
unique-id-format %[uuid()] | ||
unique-id-header X-Unique-ID | ||
log-format "%ci:%cp\ [%t]\ %ft\ %b/%s\ %Th/%Ti/%TR/%Tq/%Tw/%Tc/%Tr/%Tt\ %ST\ %B\ %CC\ %CS\ %tsc\ %ac/%fc/%bc/%sc/%rc\ %sq/%bq\ %hr\ %hs\ %{+Q}r\ %ID\ spoa-error:\ %[var(txn.coraza.error)]\ waf-action:\ %[var(txn.coraza.action)]" | ||
log-format "%ci:%cp\ [%t]\ %ft\ %b/%s\ %Th/%Ti/%TR/%Tq/%Tw/%Tc/%Tr/%Tt\ %ST\ %B\ %CC\ %CS\ %tsc\ %ac/%fc/%bc/%sc/%rc\ %sq/%bq\ %hr\ %hs\ %{+Q}r\ %ID\ waf-action:\ %[var(txn.coraza.action)]\ spoe-error:\ %[var(txn.coraza.error)]\ spoa-error:\ %[var(txn.coraza.err_code)]\ %[var(txn.coraza.err_msg)]" | ||
|
||
filter spoe engine coraza config /usr/local/etc/haproxy/coraza.cfg | ||
|
||
|
@@ -40,10 +40,14 @@ frontend test_frontend | |
http-request silent-drop if { var(txn.coraza.action) -m str drop } | ||
http-response silent-drop if { var(txn.coraza.action) -m str drop } | ||
|
||
# Deny in case of an error, when processing with the Coraza SPOA | ||
# Deny in case of an error, when processing with the Coraza SPOE | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The SPOE is the Haproxy part which talks to the SPOA. So I think this as correct. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. HAProxy talks about SPOE/SPOP only. There are |
||
http-request deny deny_status 504 if { var(txn.coraza.error) -m int gt 0 } | ||
http-response deny deny_status 504 if { var(txn.coraza.error) -m int gt 0 } | ||
|
||
# Deny in case of an error, when processing with the Coraza SPOA | ||
http-request deny deny_status 504 if { var(txn.coraza.err_code) -m int gt 0 } | ||
http-response deny deny_status 504 if { var(txn.coraza.err_code) -m int gt 0 } | ||
|
||
# Deprecated, use action instead of fail | ||
#http-request deny deny_status 401 hdr waf-block "request" if { var(txn.coraza.fail) -m int eq 1 } | ||
#http-response deny deny_status 401 hdr waf-block "response" if { var(txn.coraza.fail) -m int eq 1 } | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we should provide two ways to do login in a connector. Can we stick to tx's logger?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, we need application (
coraza-spoa
) logging. We need to log all initialization stuff as well as request/response before transaction is created.