Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,7 @@ These variables are common to image variants and will set defaults based on the
| SSL_PORT | Port number where the SSL enabled webserver is listening | `8443` | - |
| SSL_SESSION_TICKETS | A string to enable or disable the use of [TLS session tickets](https://httpd.apache.org/docs/2.4/mod/mod_ssl.html#sslsessiontickets) (RFC 5077). (Default: `off`) |
| TIMEOUT | Number of seconds before receiving and sending timeout (Default: `60`) |
| USE_EXTENDED_LOGFORMAT | A boolean value to enable the [extended log format](https://www.netnea.com/cms/apache-tutorial-5_extending-access-log/#step_4_configuring_the_new,_extended_log_format). When `true`, `APACHE_LOGFORMAT` is overridden with the extended format that includes ModSecurity anomaly scores and other extended fields. (Allowed values: `true`, `false`. Default: `false`) |
| WORKER_CONNECTIONS | Maximum number of MPM request worker processes (Default: `400`) |

> [!NOTE]
Expand Down
1 change: 1 addition & 0 deletions apache/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ ENV \
SSL_PROTOCOLS="all -SSLv3 -TLSv1 -TLSv1.1" \
SSL_SESSION_TICKETS=off \
TIMEOUT=60 \
USE_EXTENDED_LOGFORMAT=false \
WORKER_CONNECTIONS=400 \
# CRS specific variables
ANOMALY_INBOUND=5 \
Expand Down
1 change: 1 addition & 0 deletions apache/Dockerfile-alpine
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ ENV \
SSL_PROTOCOLS="all -SSLv3 -TLSv1 -TLSv1.1" \
SSL_SESSION_TICKETS=off \
TIMEOUT=60 \
USE_EXTENDED_LOGFORMAT=false \
WORKER_CONNECTIONS=400 \
# CRS specific variables
ANOMALY_INBOUND=5 \
Expand Down
4 changes: 4 additions & 0 deletions apache/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,8 @@
/opt/modsecurity/activate-plugins.sh
/opt/modsecurity/configure-rules.sh

if [ "$USE_EXTENDED_LOGFORMAT" = "true" ]; then
export APACHE_LOGFORMAT='"%h %{GEOIP_COUNTRY_CODE}e %u [%{%Y-%m-%d %H:%M:%S}t.%{usec_frac}t] \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" \"%{Content-Type}i\" %{remote}p %v %A %p %R %{BALANCER_WORKER_ROUTE}e %X \"%{cookie}n\" %{UNIQUE_ID}e %{SSL_PROTOCOL}x %{SSL_CIPHER}x %I %O %{ratio}n%% %D %{ModSecTimeIn}e %{ApplicationTime}e %{ModSecTimeOut}e %{ModSecAnomalyScoreInPLs}e %{ModSecAnomalyScoreOutPLs}e %{ModSecAnomalyScoreIn}e %{ModSecAnomalyScoreOut}e"'
fi

exec "$@"
Loading