Skip to content

Commit

Permalink
Allow more customizations for SecAudit* options
Browse files Browse the repository at this point in the history
These options controls the audit/transaction logging of modsecurity. By
exposing these options via env variable, we can further customize the
audit/transaction logging of modsecurity

Signed-off-by: Nicolas Bigler <[email protected]>
  • Loading branch information
TheBigLee committed Sep 27, 2023
1 parent 65b9e9e commit 706d0ab
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 3 additions & 0 deletions v3.3/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ ENV APACHE_RUN_USER=www-data \
APACHE_METRICS_DENY_FROM='All' \
APACHE_METRICS_ALLOW_FROM='127.0.0.0/255.0.0.0 ::1/128' \
CRS_DISABLE_PLUGINS=0 \
MODSEC_AUDIT_ENGINE=RelevantOnly \
MODSEC_AUDIT_LOG_RELEVANT_STATUS='^(?:5|4(?!04))' \
MODSEC_AUDIT_LOG_PARTS=ABEFHIJZ \
MODSEC_AUDIT_LOG=/dev/stdout \
MODSEC_AUDIT_LOG_TYPE=Serial \
MODSEC_AUDIT_LOG_FORMAT=JSON \
Expand Down
6 changes: 3 additions & 3 deletions v3.3/modsecurity.d/modsecurity.conf
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ SecTmpSaveUploadedFiles on
SecDebugLog ${MODSEC_DEBUG_LOG}
SecDebugLogLevel ${MODSEC_DEBUG_LOGLEVEL}

SecAuditEngine RelevantOnly
SecAuditLogRelevantStatus "^(?:5|4(?!04))"
SecAuditLogParts ABEFHIJZ
SecAuditEngine ${MODSEC_AUDIT_ENGINE}
SecAuditLogRelevantStatus ${MODSEC_AUDIT_LOG_RELEVANT_STATUS}
SecAuditLogParts ${MODSEC_AUDIT_LOG_PARTS}

SecAuditLogType ${MODSEC_AUDIT_LOG_TYPE}
SecAuditLogFormat ${MODSEC_AUDIT_LOG_FORMAT}
Expand Down

0 comments on commit 706d0ab

Please sign in to comment.