diff --git a/Makefile b/Makefile index 6e581c02ba..551a3ee220 100644 --- a/Makefile +++ b/Makefile @@ -4,6 +4,9 @@ GIT_TAG = $(shell git describe --exact-match --tags || echo untagged) VERSION = $(VER)-SNAPSHOT NGINX_OSS_VERSION ?= 1.29 NGINX_PLUS_VERSION ?= R35 +NAP_WAF_VERSION ?= 35+5.498 +NAP_WAF_COMMON_VERSION ?= 11.533 +NAP_WAF_PLUGIN_VERSION ?= 6.20.0 NGINX_AGENT_VERSION ?= 3.3 PLUS_ARGS = --build-arg NGINX_PLUS_VERSION=$(NGINX_PLUS_VERSION) --secret id=nginx-repo.crt,src=nginx-repo.crt --secret id=nginx-repo.key,src=nginx-repo.key @@ -155,12 +158,12 @@ alpine-image-plus-fips: build ## Create Docker image for Ingress Controller (Alp .PHONY: alpine-image-nap-plus-fips alpine-image-nap-plus-fips: build ## Create Docker image for Ingress Controller (Alpine with NGINX Plus, NGINX App Protect WAF and FIPS) - $(DOCKER_CMD) $(PLUS_ARGS) --build-arg BUILD_OS=alpine-plus-nap-fips + $(DOCKER_CMD) $(PLUS_ARGS) --build-arg BUILD_OS=alpine-plus-nap-fips --build-arg NAP_WAF_VERSION=$(NAP_WAF_VERSION) .PHONY: alpine-image-nap-v5-plus-fips alpine-image-nap-v5-plus-fips: build ## Create Docker image for Ingress Controller (Alpine with NGINX Plus, NGINX App Protect WAFv5 and FIPS) $(DOCKER_CMD) $(PLUS_ARGS) \ - --build-arg BUILD_OS=alpine-plus-nap-v5-fips + --build-arg BUILD_OS=alpine-plus-nap-v5-fips --build-arg NAP_WAF_VERSION=$(NAP_WAF_VERSION) .PHONY: debian-image-plus debian-image-plus: build ## Create Docker image for Ingress Controller (Debian with NGINX Plus) @@ -168,11 +171,14 @@ debian-image-plus: build ## Create Docker image for Ingress Controller (Debian w .PHONY: debian-image-nap-plus debian-image-nap-plus: build ## Create Docker image for Ingress Controller (Debian with NGINX Plus and NGINX App Protect WAF) - $(DOCKER_CMD) $(PLUS_ARGS) --build-arg BUILD_OS=debian-plus-nap --build-arg NAP_MODULES=waf + $(DOCKER_CMD) $(PLUS_ARGS) --build-arg BUILD_OS=debian-plus-nap --build-arg NAP_MODULES=waf \ + --build-arg NAP_WAF_VERSION=$(NAP_WAF_VERSION) --build-arg NAP_WAF_PLUGIN_VERSION=$(NAP_WAF_PLUGIN_VERSION) \ + --build-arg NAP_WAF_COMMON_VERSION=$(NAP_WAF_COMMON_VERSION) .PHONY: debian-image-nap-v5-plus debian-image-nap-v5-plus: build ## Create Docker image for Ingress Controller (Debian with NGINX Plus and NGINX App Protect WAFv5) - $(DOCKER_CMD) $(PLUS_ARGS) --build-arg BUILD_OS=debian-plus-nap-v5 + $(DOCKER_CMD) $(PLUS_ARGS) --build-arg BUILD_OS=debian-plus-nap-v5 --build-arg NAP_WAF_VERSION=$(NAP_WAF_VERSION) \ + --build-arg NAP_WAF_PLUGIN_VERSION=$(NAP_WAF_PLUGIN_VERSION) .PHONY: debian-image-dos-plus debian-image-dos-plus: build ## Create Docker image for Ingress Controller (Debian with NGINX Plus and NGINX App Protect DoS) @@ -180,7 +186,9 @@ debian-image-dos-plus: build ## Create Docker image for Ingress Controller (Debi .PHONY: debian-image-nap-dos-plus debian-image-nap-dos-plus: build ## Create Docker image for Ingress Controller (Debian with NGINX Plus, NGINX App Protect WAF and DoS) - $(DOCKER_CMD) $(PLUS_ARGS) --build-arg BUILD_OS=debian-plus-nap --build-arg NAP_MODULES=waf,dos + $(DOCKER_CMD) $(PLUS_ARGS) --build-arg BUILD_OS=debian-plus-nap --build-arg NAP_MODULES=waf,dos \ + --build-arg NAP_WAF_VERSION=$(NAP_WAF_VERSION) --build-arg NAP_WAF_PLUGIN_VERSION=$(NAP_WAF_PLUGIN_VERSION) \ + --build-arg NAP_WAF_COMMON_VERSION=$(NAP_WAF_COMMON_VERSION) .PHONY: ubi-image ubi-image: build ## Create Docker image for Ingress Controller (UBI) @@ -192,29 +200,33 @@ ubi-image-plus: build ## Create Docker image for Ingress Controller (UBI with NG .PHONY: ubi-image-nap-plus ubi-image-nap-plus: build ## Create Docker image for Ingress Controller (UBI with NGINX Plus and NGINX App Protect WAF) - $(DOCKER_CMD) $(PLUS_ARGS) --secret id=rhel_license,src=rhel_license --build-arg BUILD_OS=ubi-9-plus-nap --build-arg NAP_MODULES=waf + $(DOCKER_CMD) $(PLUS_ARGS) --secret id=rhel_license,src=rhel_license --build-arg BUILD_OS=ubi-9-plus-nap \ + --build-arg NAP_MODULES=waf --build-arg NAP_WAF_VERSION=$(NAP_WAF_VERSION) .PHONY: ubi8-image-nap-plus ubi8-image-nap-plus: build ## Create Docker image for Ingress Controller (UBI with NGINX Plus and NGINX App Protect WAF) - $(DOCKER_CMD) $(PLUS_ARGS) --secret id=rhel_license,src=rhel_license --build-arg BUILD_OS=ubi-8-plus-nap --build-arg NAP_MODULES=waf + $(DOCKER_CMD) $(PLUS_ARGS) --secret id=rhel_license,src=rhel_license --build-arg BUILD_OS=ubi-8-plus-nap \ + --build-arg NAP_MODULES=waf --build-arg NAP_WAF_VERSION=$(NAP_WAF_VERSION) .PHONY: ubi-image-nap-v5-plus ubi-image-nap-v5-plus: build ## Create Docker image for Ingress Controller (UBI with NGINX Plus and NGINX App Protect WAFv5) $(DOCKER_CMD) $(PLUS_ARGS) --secret id=rhel_license,src=rhel_license \ - --build-arg BUILD_OS=ubi-9-plus-nap-v5 + --build-arg BUILD_OS=ubi-9-plus-nap-v5 --build-arg NAP_WAF_VERSION=$(NAP_WAF_VERSION) .PHONY: ubi8-image-nap-v5-plus ubi8-image-nap-v5-plus: build ## Create Docker image for Ingress Controller (UBI with NGINX Plus and NGINX App Protect WAFv5) $(DOCKER_CMD) $(PLUS_ARGS) --secret id=rhel_license,src=rhel_license \ - --build-arg BUILD_OS=ubi-8-plus-nap-v5 + --build-arg BUILD_OS=ubi-8-plus-nap-v5 --build-arg NAP_WAF_VERSION=$(NAP_WAF_VERSION) .PHONY: ubi-image-dos-plus ubi-image-dos-plus: build ## Create Docker image for Ingress Controller (UBI with NGINX Plus and NGINX App Protect DoS) - $(DOCKER_CMD) $(PLUS_ARGS) --secret id=rhel_license,src=rhel_license --build-arg BUILD_OS=ubi-9-plus-nap --build-arg NAP_MODULES=dos + $(DOCKER_CMD) $(PLUS_ARGS) --secret id=rhel_license,src=rhel_license --build-arg BUILD_OS=ubi-9-plus-nap \ + --build-arg NAP_MODULES=dos .PHONY: ubi-image-nap-dos-plus ubi-image-nap-dos-plus: build ## Create Docker image for Ingress Controller (UBI with NGINX Plus, NGINX App Protect WAF and DoS) - $(DOCKER_CMD) $(PLUS_ARGS) --secret id=rhel_license,src=rhel_license --build-arg BUILD_OS=ubi-9-plus-nap --build-arg NAP_MODULES=waf,dos + $(DOCKER_CMD) $(PLUS_ARGS) --secret id=rhel_license,src=rhel_license --build-arg BUILD_OS=ubi-9-plus-nap \ + --build-arg NAP_MODULES=waf,dos --build-arg NAP_WAF_VERSION=$(NAP_WAF_VERSION) .PHONY: all-images ## Create all the Docker images for Ingress Controller all-images: alpine-image alpine-image-plus alpine-image-plus-fips alpine-image-nap-plus-fips debian-image debian-image-plus debian-image-nap-plus debian-image-dos-plus debian-image-nap-dos-plus ubi-image ubi-image-plus ubi-image-nap-plus ubi-image-dos-plus ubi-image-nap-dos-plus diff --git a/build/Dockerfile b/build/Dockerfile index 79177cca2d..694039e01c 100644 --- a/build/Dockerfile +++ b/build/Dockerfile @@ -2,6 +2,9 @@ ARG BUILD_OS=debian ARG NGINX_OSS_VERSION=1.29 ARG NGINX_PLUS_VERSION=R35 +ARG NAP_WAF_VERSION=35+5.498 +ARG NAP_WAF_COMMON_VERSION=11.533 +ARG NAP_WAF_PLUGIN_VERSION=6.20.0 ARG NGINX_AGENT_VERSION=3.3 ARG DOWNLOAD_TAG=edge ARG DEBIAN_FRONTEND=noninteractive @@ -207,6 +210,7 @@ RUN --mount=type=bind,from=alpine-fips-3.22,target=/tmp/fips/ \ ############################################# Base image for Alpine with NGINX Plus, App Protect WAF and FIPS ############################################# FROM alpine:3.19@sha256:3be987e6cde1d07e873c012bf6cfe941e6e85d16ca5fc5b8bedc675451d2de67 AS alpine-plus-nap-fips ARG NGINX_PLUS_VERSION +ARG NAP_WAF_VERSION ARG PACKAGE_REPO ENV NGINX_VERSION=${NGINX_PLUS_VERSION} @@ -231,7 +235,7 @@ RUN --mount=type=bind,from=alpine-fips-3.19,target=/tmp/fips/ \ && cp -av /tmp/fips/etc/ssl/openssl.cnf /etc/ssl/openssl.cnf \ && mkdir -p /etc/nginx/reporting/ \ && cp -av /tmp/nginx/reporting/tracking.info /etc/nginx/reporting/tracking.info \ - && apk add --no-cache app-protect app-protect-attack-signatures app-protect-threat-campaigns \ + && apk add --no-cache app-protect~=${NAP_WAF_VERSION/+/.} app-protect-attack-signatures app-protect-threat-campaigns \ && sed -i -e '/nginx.com/d' /etc/apk/repositories \ && nap-waf.sh \ agent.sh @@ -240,6 +244,7 @@ RUN --mount=type=bind,from=alpine-fips-3.19,target=/tmp/fips/ \ ############################################# Base image for Alpine with NGINX Plus, App Protect WAFv5 and FIPS ############################################# FROM alpine:3.19@sha256:3be987e6cde1d07e873c012bf6cfe941e6e85d16ca5fc5b8bedc675451d2de67 AS alpine-plus-nap-v5-fips ARG NGINX_PLUS_VERSION +ARG NAP_WAF_VERSION ARG PACKAGE_REPO ENV NGINX_VERSION=${NGINX_PLUS_VERSION} @@ -262,7 +267,7 @@ RUN --mount=type=bind,from=alpine-fips-3.19,target=/tmp/fips/ \ && cp -av /tmp/fips/etc/ssl/openssl.cnf /etc/ssl/openssl.cnf \ && mkdir -p /etc/nginx/reporting/ \ && cp -av /tmp/nginx/reporting/tracking.info /etc/nginx/reporting/tracking.info \ - && apk add --no-cache app-protect-module-plus~=35.5.498 \ + && apk add --no-cache app-protect-module-plus~=${NAP_WAF_VERSION/+/.} \ && sed -i -e '/nginx.com/d' /etc/apk/repositories \ && nap-waf.sh \ agent.sh @@ -321,6 +326,9 @@ RUN --mount=type=secret,id=nginx-repo.crt,dst=/etc/ssl/nginx/nginx-repo.crt,mode FROM debian-plus-only AS debian-plus-nap ARG NAP_MODULES ARG NGINX_PLUS_VERSION +ARG NAP_WAF_VERSION +ARG NAP_WAF_COMMON_VERSION +ARG NAP_WAF_PLUGIN_VERSION ENV NGINX_VERSION=${NGINX_PLUS_VERSION} @@ -337,7 +345,15 @@ RUN --mount=type=secret,id=nginx-repo.crt,dst=/etc/ssl/nginx/nginx-repo.crt,mode cp /tmp/app-protect.sources /etc/apt/sources.list.d/app-protect.sources \ && cp /tmp/nginx-agent.sources /etc/apt/sources.list.d/nginx-agent.sources \ && apt-get update \ - && apt-get install --no-install-recommends --no-install-suggests -y app-protect app-protect-attack-signatures app-protect-threat-campaigns nginx-agent=2.* \ + && apt-get install --no-install-recommends --no-install-suggests -y app-protect=${NAP_WAF_VERSION}* \ + nginx-plus-module-appprotect=${NAP_WAF_VERSION}* \ + app-protect-engine=${NAP_WAF_COMMON_VERSION}* \ + app-protect-common=${NAP_WAF_COMMON_VERSION}* \ + app-protect-compiler=${NAP_WAF_COMMON_VERSION}* \ + app-protect-plugin=${NAP_WAF_PLUGIN_VERSION}* \ + app-protect-attack-signatures \ + app-protect-threat-campaigns \ + nginx-agent=2.* \ && rm -f /etc/apt/sources.list.d/app-protect.sources /etc/apt/sources.list.d/nginx-agent.sources \ && nap-waf.sh \ && agent.sh; \ @@ -354,6 +370,8 @@ RUN --mount=type=secret,id=nginx-repo.crt,dst=/etc/ssl/nginx/nginx-repo.crt,mode ############################################# Base image for Debian with NGINX Plus and App Protect WAFv5 ############################################# FROM debian-plus-only AS debian-plus-nap-v5 ARG NGINX_PLUS_VERSION +ARG NAP_WAF_VERSION +ARG NAP_WAF_PLUGIN_VERSION ENV NGINX_VERSION=${NGINX_PLUS_VERSION} @@ -365,7 +383,7 @@ RUN --mount=type=secret,id=nginx-repo.crt,dst=/etc/ssl/nginx/nginx-repo.crt,mode --mount=type=bind,from=nginx-files,src=nap-waf.sh,target=/usr/local/bin/nap-waf.sh \ --mount=type=bind,from=nginx-files,src=debian-agent-12.sources,target=/etc/apt/sources.list.d/nginx-agent.sources \ apt-get update \ - && apt-get install --no-install-recommends --no-install-suggests -y nginx-agent=2.* app-protect-module-plus=35+5.498* nginx-plus-module-appprotect=35+5.498* app-protect-plugin=6.20.0* \ + && 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}* \ && nap-waf.sh \ && agent.sh @@ -400,6 +418,10 @@ RUN --mount=type=secret,id=nginx-repo.crt,dst=/etc/ssl/nginx/nginx-repo.crt,mode FROM ubi-minimal AS ubi-9-plus-nap ARG NAP_MODULES ARG BUILD_OS +ARG NGINX_PLUS_VERSION +ARG NAP_WAF_VERSION + +ENV NGINX_VERSION=${NGINX_PLUS_VERSION} RUN --mount=type=secret,id=nginx-repo.crt,dst=/etc/ssl/nginx/nginx-repo.crt,mode=0644 \ --mount=type=secret,id=nginx-repo.key,dst=/etc/ssl/nginx/nginx-repo.key,mode=0644 \ @@ -430,7 +452,7 @@ RUN --mount=type=secret,id=nginx-repo.crt,dst=/etc/ssl/nginx/nginx-repo.crt,mode rpm --import /tmp/app-protect-security-updates.key \ && cp /tmp/app-protect-9.repo /etc/yum.repos.d/app-protect-9.repo \ && microdnf --enablerepo=codeready-builder-for-rhel-9-x86_64-rpms --nodocs install -y \ - app-protect app-protect-attack-signatures app-protect-threat-campaigns \ + app-protect-${NAP_WAF_VERSION}* app-protect-attack-signatures app-protect-threat-campaigns \ && rm -f /etc/yum.repos.d/app-protect-9.repo \ && nap-waf.sh \ && agent.sh; \ @@ -447,6 +469,10 @@ RUN --mount=type=secret,id=nginx-repo.crt,dst=/etc/ssl/nginx/nginx-repo.crt,mode ############################################# Base image for UBI with NGINX Plus and App Protect WAFv5 ############################################# FROM ubi-minimal AS ubi-9-plus-nap-v5 +ARG NGINX_PLUS_VERSION +ARG NAP_WAF_VERSION + +ENV NGINX_VERSION=${NGINX_PLUS_VERSION} RUN --mount=type=secret,id=nginx-repo.crt,dst=/etc/ssl/nginx/nginx-repo.crt,mode=0644 \ --mount=type=secret,id=nginx-repo.key,dst=/etc/ssl/nginx/nginx-repo.key,mode=0644 \ @@ -468,7 +494,7 @@ RUN --mount=type=secret,id=nginx-repo.crt,dst=/etc/ssl/nginx/nginx-repo.crt,mode && rpm -ivh https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm \ && rpm -Uvh /ubi-bin/c-ares-*.rpm \ && microdnf --nodocs install -y ca-certificates shadow-utils subscription-manager \ - && microdnf --nodocs install -y nginx-plus-module-otel nginx-agent-2.* app-protect-module-plus-35+5.498* \ + && microdnf --nodocs install -y nginx-plus-module-otel nginx-agent-2.* app-protect-module-plus-${NAP_WAF_VERSION}* \ && nap-waf.sh \ && ubi-clean.sh \ && agent.sh @@ -477,6 +503,7 @@ RUN --mount=type=secret,id=nginx-repo.crt,dst=/etc/ssl/nginx/nginx-repo.crt,mode ############################################# Base image for UBI8 with NGINX Plus and App Protect WAF ############################################# FROM redhat/ubi8@sha256:534c2c0efa4150ede18e3f9d7480d3b9ec2a52e62bc91cd54e08ee7336819619 AS ubi-8-plus-nap ARG NGINX_PLUS_VERSION +ARG NAP_WAF_VERSION ARG BUILD_OS ENV NGINX_VERSION=${NGINX_PLUS_VERSION} @@ -506,7 +533,7 @@ RUN --mount=type=secret,id=nginx-repo.crt,dst=/etc/ssl/nginx/nginx-repo.crt,mode && subscription-manager attach \ && dnf config-manager --set-enabled codeready-builder-for-rhel-8-x86_64-rpms \ && dnf --nodocs install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm \ - && dnf --nodocs install -y app-protect app-protect-attack-signatures app-protect-threat-campaigns \ + && dnf --nodocs install -y app-protect-${NAP_WAF_VERSION}* app-protect-attack-signatures app-protect-threat-campaigns \ && subscription-manager unregister \ && nap-waf.sh \ && agent.sh \ @@ -516,6 +543,7 @@ RUN --mount=type=secret,id=nginx-repo.crt,dst=/etc/ssl/nginx/nginx-repo.crt,mode ############################################# Base image for UBI8 with NGINX Plus and App Protect WAFv5 ############################################# FROM redhat/ubi8@sha256:534c2c0efa4150ede18e3f9d7480d3b9ec2a52e62bc91cd54e08ee7336819619 AS ubi-8-plus-nap-v5 ARG NGINX_PLUS_VERSION +ARG NAP_WAF_VERSION ENV NGINX_VERSION=${NGINX_PLUS_VERSION} @@ -538,7 +566,7 @@ RUN --mount=type=secret,id=nginx-repo.crt,dst=/etc/ssl/nginx/nginx-repo.crt,mode && rpm --import /tmp/nginx_signing.key \ && rpm -Uvh /ubi-bin/c-ares-*.rpm \ && dnf --nodocs install -y nginx-plus nginx-plus-module-njs nginx-plus-module-otel nginx-plus-module-fips-check nginx-agent-2.* \ - && dnf --nodocs install -y app-protect-module-plus-35+5.498* \ + && dnf --nodocs install -y app-protect-module-plus-${NAP_WAF_VERSION}* \ && nap-waf.sh \ && agent.sh \ && dnf clean all