Skip to content

Commit 91f5dd2

Browse files
authored
Using CRS latest release other than git pull
1 parent 2223c72 commit 91f5dd2

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Dockerfile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,11 @@ RUN GPG_KEYS=B0F4253373F8F6F510D42178520A9993A1C052F8 \
131131
&& cp /usr/src/ModSecurity/unicode.mapping /etc/nginx/modsec.d \
132132
&& sed -i -e 's/SecRuleEngine DetectionOnly/SecRuleEngine On/g' /etc/nginx/modsec.d/modsecurity.conf \
133133
&& cd /etc/nginx/modsec.d \
134-
&& git clone --depth 1 https://github.com/SpiderLabs/owasp-modsecurity-crs \
134+
&& CRS_VERSION=$(curl --silent "https://api.github.com/repos/SpiderLabs/owasp-modsecurity-crs/releases/latest" | grep '"tag_name":' | sed -E 's/.*"v([^"]+)".*/\1/') \
135+
&& curl -fSL https://github.com/SpiderLabs/owasp-modsecurity-crs/archive/v$CRS_VERSION.tar.gz -o owasp-modsecurity-crs.tar.gz \
136+
&& tar -zxC ./ -f owasp-modsecurity-crs.tar.gz \
137+
&& rm ./owasp-modsecurity-crs.tar.gz \
138+
&& mv owasp-modsecurity-crs-$CRS_VERSION owasp-modsecurity-crs \
135139
&& cd owasp-modsecurity-crs \
136140
&& mv crs-setup.conf.example crs-setup.conf \
137141
&& cd rules \

0 commit comments

Comments
 (0)