@@ -7,6 +7,8 @@ FROM debian:bookworm-slim AS nginxbuilder
7
7
ARG OPENRESTY_VERSION
8
8
ARG LUA_VERSION
9
9
ARG LUAROCKS_VERSION
10
+ ARG LIBMODSECURITY_VERSION
11
+ ARG MODSECURITY_NGINX_VERSION
10
12
11
13
RUN apt-get update \
12
14
&& apt-get install -y \
@@ -16,7 +18,12 @@ RUN apt-get update \
16
18
libpcre3-dev \
17
19
libreadline-dev \
18
20
libssl-dev \
19
- openssl unzip \
21
+ openssl \
22
+ unzip \
23
+ autoconf \
24
+ automake \
25
+ libtool \
26
+ libpcre2-dev \
20
27
wget \
21
28
zlib1g-dev \
22
29
git \
@@ -26,6 +33,10 @@ RUN apt-get update \
26
33
COPY ./scripts/build-lua /tmp/build-lua
27
34
RUN /tmp/build-lua
28
35
36
+ # LibModSecurity build
37
+ COPY ./scripts/build-modsecurity /tmp/build-modsecurity
38
+ RUN /tmp/build-modsecurity
39
+
29
40
# Nginx build
30
41
COPY ./scripts/build-openresty /tmp/build-openresty
31
42
RUN /tmp/build-openresty
@@ -40,6 +51,7 @@ LABEL maintainer="Jamie Curnow <jc@jc21.com>"
40
51
SHELL ["/bin/bash" , "-o" , "pipefail" , "-c" ]
41
52
42
53
ARG TARGETPLATFORM
54
+ ARG CRS_VERSION
43
55
RUN echo "Base: debian:bookworm-slim, ${TARGETPLATFORM:-linux/amd64}" > /built-for-arch
44
56
45
57
# OpenResty uses LuaJIT which has a dependency on GCC
@@ -74,24 +86,29 @@ COPY --from=nginxbuilder /tmp/luarocks /tmp/luarocks
74
86
COPY ./scripts/install-lua /tmp/install-lua
75
87
76
88
# Copy openresty build from first image
89
+ COPY --from=nginxbuilder /tmp/modsecurity /tmp/modsecurity
77
90
COPY --from=nginxbuilder /tmp/openresty /tmp/openresty
78
91
COPY ./scripts/install-openresty /tmp/install-openresty
79
92
80
93
# Copy crowdsec openresty bouncer install script
81
94
COPY ./scripts/install-crowdsec_openresty_bouncer /tmp/install-crowdsec_openresty_bouncer
82
95
96
+ # Copy OWASP core ruleset install script
97
+ COPY ./scripts/install-crs /tmp/install-crs
98
+
83
99
ARG OPENRESTY_VERSION
84
100
ARG CROWDSEC_OPENRESTY_BOUNCER_VERSION
85
101
ENV SSL_CERT_FILE=/etc/ssl/certs/ca-certificates.crt \
86
102
OPENRESTY_VERSION=${OPENRESTY_VERSION} \
87
103
CROWDSEC_OPENRESTY_BOUNCER_VERSION=${CROWDSEC_OPENRESTY_BOUNCER_VERSION}
88
104
89
- # Install openresty, lua, then clean up file system
105
+ # Install openresty, lua, csr, then clean up file system
90
106
RUN apt-get update \
91
- && apt-get install -y gcc make socat git \
107
+ && apt-get install -y build-essential gcc make socat git autoconf automake libtool libpcre2-dev \
92
108
&& /tmp/install-lua \
109
+ && /tmp/install-crs \
93
110
&& /tmp/install-openresty \
94
- && apt-get remove -y make gcc git wget gettext \
111
+ && apt-get remove -y build-essential gcc make git wget gettext autoconf automake libtool libpcre2-dev \
95
112
&& apt-get autoremove -y \
96
113
&& apt-get clean \
97
114
&& rm -rf /var/lib/apt/lists/* \
0 commit comments