@@ -7,6 +7,7 @@ ARG NAP_WAF_VERSION=35+5.527
77ARG NAP_WAF_COMMON_VERSION=11.559
88ARG NAP_WAF_PLUGIN_VERSION=6.23.0
99ARG NGINX_AGENT_VERSION=3.3
10+ ARG NAP_AGENT_VERSION=2
1011ARG DOWNLOAD_TAG=edge
1112ARG DEBIAN_FRONTEND=noninteractive
1213ARG PREBUILT_BASE_IMG=nginx/nginx-ingress:${DOWNLOAD_TAG}
@@ -216,6 +217,7 @@ FROM alpine:3.19@sha256:6baf43584bcb78f2e5847d1de515f23499913ac9f12bdf834811a314
216217ARG NGINX_PLUS_VERSION
217218ARG NAP_WAF_VERSION
218219ARG PACKAGE_REPO
220+ ARG NAP_AGENT_VERSION
219221
220222ENV NGINX_VERSION=${NGINX_PLUS_VERSION}
221223
@@ -232,7 +234,7 @@ RUN --mount=type=bind,from=alpine-fips-3.19,target=/tmp/fips/ \
232234 && printf "%s\n " "https://pkgs.nginx.com/app-protect-security-updates/alpine/v$(grep -E -o '^[0-9]+\. [0-9]+' /etc/alpine-release)/main" >> /etc/apk/repositories \
233235 && printf "%s\n " "https://${PACKAGE_REPO}/nginx-agent/alpine/v$(grep -E -o '^[0-9]+\. [0-9]+' /etc/alpine-release)/main" >> /etc/apk/repositories \
234236 && apk add --no-cache libcap-utils libcurl nginx-plus nginx-plus-module-njs nginx-plus-module-otel nginx-plus-module-fips-check \
235- && apk add --no-cache nginx-agent~2 \
237+ && apk add --no-cache nginx-agent~${NAP_AGENT_VERSION} \
236238 && mkdir -p /usr/ssl \
237239 && cp -av /tmp/fips/usr/lib/ossl-modules/fips.so /usr/lib/ossl-modules/fips.so \
238240 && cp -av /tmp/fips/usr/ssl/fipsmodule.cnf /usr/ssl/fipsmodule.cnf \
@@ -248,8 +250,9 @@ RUN --mount=type=bind,from=alpine-fips-3.19,target=/tmp/fips/ \
248250# ############################################ Base image for Alpine with NGINX Plus, App Protect WAFv5 and FIPS #############################################
249251FROM alpine:3.19@sha256:6baf43584bcb78f2e5847d1de515f23499913ac9f12bdf834811a3145eb11ca1 AS alpine-plus-nap-v5-fips
250252ARG NGINX_PLUS_VERSION
251- ARG NAP_WAF_VERSION
252253ARG PACKAGE_REPO
254+ ARG NAP_WAF_VERSION
255+ ARG NAP_AGENT_VERSION
253256
254257ENV NGINX_VERSION=${NGINX_PLUS_VERSION}
255258
@@ -264,7 +267,7 @@ RUN --mount=type=bind,from=alpine-fips-3.19,target=/tmp/fips/ \
264267 && printf "%s\n " "https://${PACKAGE_REPO}/app-protect-x-plus/alpine/v$(grep -E -o '^[0-9]+\. [0-9]+' /etc/alpine-release)/main" >> /etc/apk/repositories \
265268 && printf "%s\n " "https://${PACKAGE_REPO}/nginx-agent/alpine/v$(grep -E -o '^[0-9]+\. [0-9]+' /etc/alpine-release)/main" >> /etc/apk/repositories \
266269 && apk add --no-cache libcap-utils libcurl nginx-plus nginx-plus-module-njs nginx-plus-module-otel nginx-plus-module-fips-check \
267- && apk add --no-cache nginx-agent~2 \
270+ && apk add --no-cache nginx-agent~${NAP_AGENT_VERSION} \
268271 && mkdir -p /usr/ssl \
269272 && cp -av /tmp/fips/usr/lib/ossl-modules/fips.so /usr/lib/ossl-modules/fips.so \
270273 && cp -av /tmp/fips/usr/ssl/fipsmodule.cnf /usr/ssl/fipsmodule.cnf \
@@ -333,6 +336,7 @@ ARG NGINX_PLUS_VERSION
333336ARG NAP_WAF_VERSION
334337ARG NAP_WAF_COMMON_VERSION
335338ARG NAP_WAF_PLUGIN_VERSION
339+ ARG NAP_AGENT_VERSION
336340
337341ENV NGINX_VERSION=${NGINX_PLUS_VERSION}
338342
@@ -357,7 +361,7 @@ RUN --mount=type=secret,id=nginx-repo.crt,dst=/etc/ssl/nginx/nginx-repo.crt,mode
357361 app-protect-plugin=${NAP_WAF_PLUGIN_VERSION}* \
358362 app-protect-attack-signatures \
359363 app-protect-threat-campaigns \
360- nginx-agent=2 .* \
364+ nginx-agent=${NAP_AGENT_VERSION} .* \
361365 && rm -f /etc/apt/sources.list.d/app-protect.sources /etc/apt/sources.list.d/nginx-agent.sources \
362366 && nap-waf.sh \
363367 && agent.sh; \
@@ -376,6 +380,7 @@ FROM debian-plus-only AS debian-plus-nap-v5
376380ARG NGINX_PLUS_VERSION
377381ARG NAP_WAF_VERSION
378382ARG NAP_WAF_PLUGIN_VERSION
383+ ARG NAP_AGENT_VERSION
379384
380385ENV NGINX_VERSION=${NGINX_PLUS_VERSION}
381386
@@ -387,7 +392,7 @@ RUN --mount=type=secret,id=nginx-repo.crt,dst=/etc/ssl/nginx/nginx-repo.crt,mode
387392 --mount=type=bind,from=nginx-files,src=nap-waf.sh,target=/usr/local/bin/nap-waf.sh \
388393 --mount=type=bind,from=nginx-files,src=debian-agent-12.sources,target=/etc/apt/sources.list.d/nginx-agent.sources \
389394 apt-get update \
390- && apt-get install --no-install-recommends --no-install-suggests -y nginx-agent=2 .* app-protect-module-plus=${NAP_WAF_VERSION}* nginx-plus-module-appprotect=${NAP_WAF_VERSION}* app-protect-plugin=${NAP_WAF_PLUGIN_VERSION}* \
395+ && apt-get install --no-install-recommends --no-install-suggests -y nginx-agent=${NAP_AGENT_VERSION} .* app-protect-module-plus=${NAP_WAF_VERSION}* nginx-plus-module-appprotect=${NAP_WAF_VERSION}* app-protect-plugin=${NAP_WAF_PLUGIN_VERSION}* \
391396 && nap-waf.sh \
392397 && agent.sh
393398
@@ -413,7 +418,7 @@ RUN --mount=type=secret,id=nginx-repo.crt,dst=/etc/ssl/nginx/nginx-repo.crt,mode
413418 mkdir -p /etc/nginx/reporting/ && cp -av /tmp/nginx/reporting/tracking.info /etc/nginx/reporting/tracking.info \
414419 && ubi-setup.sh \
415420 && rpm -Uvh /ubi-bin/c-ares-*.rpm \
416- && microdnf --nodocs install -y nginx-plus nginx-plus-module-njs nginx-plus-module-otel nginx-plus-module-fips-check nginx-agent-${NGINX_AGENT_VERSION}* \
421+ && microdnf --nodocs install -y nginx-plus nginx-plus-module-njs nginx-plus-module-otel nginx-plus-module-fips-check nginx-agent-${NGINX_AGENT_VERSION}. * \
417422 && agent.sh \
418423 && ubi-clean.sh
419424
@@ -424,6 +429,7 @@ ARG NAP_MODULES
424429ARG BUILD_OS
425430ARG NGINX_PLUS_VERSION
426431ARG NAP_WAF_VERSION
432+ ARG NAP_AGENT_VERSION
427433
428434ENV NGINX_VERSION=${NGINX_PLUS_VERSION}
429435
@@ -446,7 +452,7 @@ RUN --mount=type=secret,id=nginx-repo.crt,dst=/etc/ssl/nginx/nginx-repo.crt,mode
446452 mkdir -p /etc/nginx/reporting/ && cp -av /tmp/nginx/reporting/tracking.info /etc/nginx/reporting/tracking.info \
447453 && ubi-setup.sh \
448454 && rpm -Uvh /ubi-bin/c-ares-*.rpm \
449- && microdnf --nodocs install -y nginx-plus nginx-plus-module-njs nginx-plus-module-fips-check nginx-plus-module-otel nginx-agent-2 .* \
455+ && microdnf --nodocs install -y nginx-plus nginx-plus-module-njs nginx-plus-module-fips-check nginx-plus-module-otel nginx-agent-${NAP_AGENT_VERSION} .* \
450456 && source /tmp/rhel_license \
451457 && microdnf --nodocs install -y ca-certificates shadow-utils subscription-manager \
452458 && rpm -ivh https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm \
@@ -475,6 +481,7 @@ RUN --mount=type=secret,id=nginx-repo.crt,dst=/etc/ssl/nginx/nginx-repo.crt,mode
475481FROM ubi-minimal AS ubi-9-plus-nap-v5
476482ARG NGINX_PLUS_VERSION
477483ARG NAP_WAF_VERSION
484+ ARG NAP_AGENT_VERSION
478485
479486ENV NGINX_VERSION=${NGINX_PLUS_VERSION}
480487
@@ -498,7 +505,7 @@ RUN --mount=type=secret,id=nginx-repo.crt,dst=/etc/ssl/nginx/nginx-repo.crt,mode
498505 && rpm -ivh https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm \
499506 && rpm -Uvh /ubi-bin/c-ares-*.rpm \
500507 && microdnf --nodocs install -y ca-certificates shadow-utils subscription-manager \
501- && microdnf --nodocs install -y nginx-plus-module-otel nginx-agent-2 .* app-protect-module-plus-${NAP_WAF_VERSION}* \
508+ && microdnf --nodocs install -y nginx-plus-module-otel nginx-agent-${NAP_AGENT_VERSION} .* app-protect-module-plus-${NAP_WAF_VERSION}* \
502509 && nap-waf.sh \
503510 && ubi-clean.sh \
504511 && agent.sh
@@ -509,6 +516,7 @@ FROM redhat/ubi8@sha256:2f698e145dd30ac9f611b8984b910640bc210fae476dc36aa9ba200f
509516ARG NGINX_PLUS_VERSION
510517ARG NAP_WAF_VERSION
511518ARG BUILD_OS
519+ ARG NAP_AGENT_VERSION
512520
513521ENV NGINX_VERSION=${NGINX_PLUS_VERSION}
514522
@@ -531,7 +539,7 @@ RUN --mount=type=secret,id=nginx-repo.crt,dst=/etc/ssl/nginx/nginx-repo.crt,mode
531539 && rpm --import /tmp/nginx_signing.key \
532540 && rpm --import /tmp/app-protect-security-updates.key \
533541 && rpm -Uvh /ubi-bin/c-ares-*.rpm \
534- && dnf --nodocs install -y nginx-plus nginx-plus-module-njs nginx-plus-module-otel nginx-plus-module-fips-check nginx-agent-2 .* \
542+ && dnf --nodocs install -y nginx-plus nginx-plus-module-njs nginx-plus-module-otel nginx-plus-module-fips-check nginx-agent-${NAP_AGENT_VERSION} .* \
535543 && sed -i 's/\( def in_container():\) /\1\n return False/g' /usr/lib64/python*/*-packages/rhsm/config.py \
536544 && subscription-manager register --org=${RHEL_ORGANIZATION} --activationkey=${RHEL_ACTIVATION_KEY} --name ${BUILD_OS}-$(uname -m) || true \
537545 && subscription-manager attach \
@@ -548,6 +556,7 @@ RUN --mount=type=secret,id=nginx-repo.crt,dst=/etc/ssl/nginx/nginx-repo.crt,mode
548556FROM redhat/ubi8@sha256:2f698e145dd30ac9f611b8984b910640bc210fae476dc36aa9ba200fad2a30ed AS ubi-8-plus-nap-v5
549557ARG NGINX_PLUS_VERSION
550558ARG NAP_WAF_VERSION
559+ ARG NAP_AGENT_VERSION
551560
552561ENV NGINX_VERSION=${NGINX_PLUS_VERSION}
553562
@@ -569,7 +578,7 @@ RUN --mount=type=secret,id=nginx-repo.crt,dst=/etc/ssl/nginx/nginx-repo.crt,mode
569578 && useradd --system --gid nginx --no-create-home --home-dir /nonexistent --comment "nginx user" --shell /bin/false --uid 101 nginx \
570579 && rpm --import /tmp/nginx_signing.key \
571580 && rpm -Uvh /ubi-bin/c-ares-*.rpm \
572- && dnf --nodocs install -y nginx-plus nginx-plus-module-njs nginx-plus-module-otel nginx-plus-module-fips-check nginx-agent-2 .* \
581+ && dnf --nodocs install -y nginx-plus nginx-plus-module-njs nginx-plus-module-otel nginx-plus-module-fips-check nginx-agent-${NAP_AGENT_VERSION} .* \
573582 && dnf --nodocs install -y app-protect-module-plus-${NAP_WAF_VERSION}* \
574583 && nap-waf.sh \
575584 && agent.sh \
0 commit comments