-
-
Notifications
You must be signed in to change notification settings - Fork 249
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
chore: improves coraza.conf-recommended
comments
#1334
base: main
Are you sure you want to change the base?
Conversation
fb293c1
to
58bb175
Compare
# file uploads then the value given on the first line has to be as large | ||
# as the largest file you are willing to accept. The second value refers | ||
# to the size of data, with files excluded. You want to keep that value as | ||
# low as practical. | ||
# | ||
# file uploads, this value must has to be as large as the largest file | ||
# you are willing to accept. | ||
SecRequestBodyLimit 13107200 | ||
|
||
# Maximum request body size that Coraza will store in memory. If the body | ||
# size exceeds this value, it will be saved to a temporary file on disk. | ||
SecRequestBodyInMemoryLimit 131072 | ||
|
||
# SecRequestBodyNoFilesLimit is currently not supported by Coraza | ||
# Maximum request body size we will accept for buffering, with files excluded. | ||
# You want to keep that value as low as practical. | ||
# Note: SecRequestBodyNoFilesLimit is currently NOT supported by Coraza |
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.
first line
,second value
is not clear at all. I think it was referring toSecRequestBodyNoFilesLimit
but then we addedSecRequestBodyInMemoryLimit
in between. I split this comment into one comment per directive.SecRequestBodyInMemoryLimit
was uncommented
# Warning: Setting this directive to ProcessPartial introduces a potential bypass | ||
# risk, as attackers could prepend junk data equal to or greater than the inspected body size. |
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 feel it is worth mentioning this attack here, this is something to consider when setting this directive. See https://github.com/assetnote/nowafpls
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1334 +/- ##
=======================================
Coverage 81.99% 81.99%
=======================================
Files 170 170
Lines 9803 9803
=======================================
Hits 8038 8038
Misses 1518 1518
Partials 247 247
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
# By default, only keep the files that were determined to be unusual | ||
# in some way (by an external inspection script). For this to work you | ||
# will also need at least one file inspection rule. | ||
# If On, the WAF will store the uploaded files in the SecUploadDir | ||
# directory. | ||
# Note: SecUploadKeepFiles is currently NOT supported by Coraza | ||
# | ||
#SecUploadKeepFiles RelevantOnly | ||
#SecUploadKeepFiles Off |
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.
Matching reality here. See #1205
|
||
# Uploaded files are by default created with permissions that do not allow | ||
# any other user to access them. You may need to relax that if you want to | ||
# interface Coraza to an external program (e.g., an anti-virus). | ||
# Note: SecUploadFileMode is currently NOT supported by Coraza |
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.
We are calling os.CreateTemp(storagePath, "crzmp*")
, which is coming with hardcoded 0600
. So we are reading this value, not effectively using it.
# Most logging has not been implemented because it will be replaced with | ||
# advanced rule profiling options |
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.
It is a pretty old comment. We should maybe revisit all the logs printed in the various levels, but we have some logs for each of them, and I don't think there is some traction for advanced rule profiling options
. I would remove these lines and not confuse the user reading them
@@ -153,7 +156,7 @@ SecDataDir /tmp/ | |||
SecAuditEngine RelevantOnly | |||
SecAuditLogRelevantStatus "^(?:(5|4)(0|1)[0-9])$" | |||
|
|||
# Log everything we know about a transaction. |
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.
ABIJDEFHZ
is not even everything
Improves
coraza.conf-recommended
coherency with the current Coraza state, and reduces old copy-pasted messages. See in-line comments for details