Default value for SecAuditLogDirMode
Hi all,
The default value for "SecAuditLogDirMode" in the current documentation specifies that this value is 0600:
https://github.com/SpiderLabs/ModSecurity/wiki/Reference-Manual#secauditlogdirmode
However, the code for v3-master currently has the following values defined as the defaults:
ModSecurity/headers/modsecurity/audit_log.h
line 199:
int m_defaultDirectoryPermission = 0766;
Which is something I am looking at altering but were confused at the discrepancy. Should the default value here be 0600, or is this a mistake in the documentation?
I know these values can be altered in configuration using:
SecAuditLogFileMode octal_mode|"default" & SecAuditLogDirMode octal_mode|"default" accordingly so it is not a problem really, but something I felt you'd like to be aware of.
Thanks,
David
Hi @met3or,
Turns out we have 3 different sources saying different things, listed:
- The manual says 0600 [details].
- The code in version 2 says 1872 [details].
- The code in v3 says 0766 [details].
I think the best thing to do is to keep what we have in v2 and change the manual to reflect the reality.
Permission at the code:
- for version 2: https://github.com/SpiderLabs/ModSecurity/blob/v2/master/apache2/modsecurity.h#L76
- for version 3: https://github.com/SpiderLabs/ModSecurity/blob/v3/master/headers/modsecurity/audit_log.h#L199
Since we are reviewing the permissions, I am also going to change the default permission for file creation. Version 2 says it is 1600. Using same value on version 3.
Fixed at: 27a8abc0523c259437b440e7ab2dac38d862f84d and b58c8fe7ed4cb019694f76942212dbbb1299808b
0640 and 0750 are the expected values. changed.
Thanks @zimmerle for the clarification! :-)