@@ -47,7 +47,7 @@ The multi-container configuration is recommended if you are building a new syste
4747
4848The hybrid configuration is suitable if you want to add F5 WAF for NGINX to an existing virtual environment and wish to use Docker for the F5 WAF components instead of installing and configuring WAF packages as explained in the [ Virtual machine or bare metal] ({{< ref "/waf/install/virtual-environment.md" >}}) instructions.
4949
50- The single container configuration requires a Docker image to be built, which encapsulates all parts of the system in one image . This image will need to be rebuilt with each release.
50+ The single container configuration only supports NGINX Plus and requires a building a Docker image that encapsulates all parts of the system. This image will need to be rebuilt with each release.
5151
5252The steps you should follow on this page are dependent on your configuration type: after the shared steps, links will guide you to the next appropriate section.
5353
@@ -589,7 +589,6 @@ CMD ["sh", "/root/entrypoint.sh"]
589589
590590{{% /tab %}}
591591
592-
593592{{% tab name="V4" %}}
594593
595594``` dockerfile
@@ -1104,6 +1103,380 @@ sudo dnf install app-protect-module-plus
11041103
11051104## Single container configuration
11061105
1106+ ### Create a Dockerfile
1107+
1108+ In the same folder as your credential and configuration files, create a _ Dockerfile_ based on your desired operating system image using an example from the following sections.
1109+
1110+ {{< call-out "note" >}}
1111+
1112+ If you are not using using ` custom_log_format.json ` or the IP intelligence feature, you should remove any references to them from your Dockerfile.
1113+
1114+ {{< /call-out >}}
1115+
1116+ #### Alpine Linux
1117+
1118+ ``` dockerfile
1119+ # syntax=docker/dockerfile:1
1120+ # For Alpine 3.19:
1121+ FROM alpine:3.19
1122+
1123+ # Download and add the NGINX signing keys:
1124+ RUN wget -O /etc/apk/keys/nginx_signing.rsa.pub https://cs.nginx.com/static/keys/nginx_signing.rsa.pub \
1125+ && wget -O /etc/apk/keys/app-protect-security-updates.rsa.pub https://cs.nginx.com/static/keys/app-protect-security-updates.rsa.pub
1126+
1127+ # Add NGINX Plus repository:
1128+ RUN printf "https://pkgs.nginx.com/plus/alpine/v`egrep -o '^[0-9]+\. [0-9]+' /etc/alpine-release`/main\n " | tee -a /etc/apk/repositories
1129+
1130+ # Add F5 WAF for NGINX repository:
1131+ RUN printf "https://pkgs.nginx.com/app-protect/alpine/v`egrep -o '^[0-9]+\. [0-9]+' /etc/alpine-release`/main\n " | tee -a /etc/apk/repositories \
1132+ && printf "https://pkgs.nginx.com/app-protect-security-updates/alpine/v`egrep -o '^[0-9]+\. [0-9]+' /etc/alpine-release`/main\n " | tee -a /etc/apk/repositories
1133+
1134+ # Update the repository and install the most recent version of the F5 WAF for NGINX package (which includes NGINX Plus):
1135+ RUN --mount=type=secret,id=nginx-crt,dst=/etc/apk/cert.pem,mode=0644 \
1136+ --mount=type=secret,id=nginx-key,dst=/etc/apk/cert.key,mode=0644 \
1137+ apk update && apk add app-protect
1138+
1139+ # Only use if you want to install and use the IP intelligence feature:
1140+ RUN --mount=type=secret,id=nginx-crt,dst=/etc/apk/cert.pem,mode=0644 \
1141+ --mount=type=secret,id=nginx-key,dst=/etc/apk/cert.key,mode=0644 \
1142+ apk update && apk add app-protect-ip-intelligence
1143+
1144+ # Forward request logs to Docker log collector:
1145+ RUN ln -sf /dev/stdout /var/log/nginx/access.log \
1146+ && ln -sf /dev/stderr /var/log/nginx/error.log
1147+
1148+ # Copy configuration files:
1149+ COPY nginx.conf custom_log_format.json /etc/nginx/
1150+ COPY entrypoint.sh /root/
1151+
1152+ CMD ["sh" , "/root/entrypoint.sh" ]
1153+ ```
1154+
1155+ #### Amazon Linux
1156+
1157+ ``` dockerfile
1158+ # syntax=docker/dockerfile:1
1159+ # For Amazon Linux 2023:
1160+ FROM amazonlinux:2023
1161+
1162+ # Install prerequisite packages:
1163+ RUN dnf -y install wget ca-certificates
1164+
1165+ # Add NGINX Plus repo:
1166+ RUN wget -P /etc/yum.repos.d https://cs.nginx.com/static/files/plus-amazonlinux2023.repo
1167+
1168+ # Add NAP dependencies repo:
1169+ RUN wget -P /etc/yum.repos.d https://cs.nginx.com/static/files/dependencies.amazonlinux2023.repo
1170+
1171+ # Add NGINX App-protect repo:
1172+ RUN wget -P /etc/yum.repos.d https://cs.nginx.com/static/files/app-protect-amazonlinux2023.repo
1173+
1174+ # Install F5 WAF for NGINX:
1175+ RUN --mount=type=secret,id=nginx-crt,dst=/etc/ssl/nginx/nginx-repo.cert,mode=0644 \
1176+ --mount=type=secret,id=nginx-key,dst=/etc/ssl/nginx/nginx-repo.key,mode=0644 \
1177+ dnf -y install app-protect \
1178+ && dnf clean all \
1179+ && rm -rf /var/cache/yum
1180+
1181+ # Only use if you want to install and use the IP intelligence feature:
1182+ RUN --mount=type=secret,id=nginx-crt,dst=/etc/ssl/nginx/nginx-repo.cert,mode=0644 \
1183+ --mount=type=secret,id=nginx-key,dst=/etc/ssl/nginx/nginx-repo.key,mode=0644 \
1184+ dnf -y install app-protect-ip-intelligence
1185+
1186+ # Forward request logs to Docker log collector:
1187+ RUN ln -sf /dev/stdout /var/log/nginx/access.log \
1188+ && ln -sf /dev/stderr /var/log/nginx/error.log
1189+
1190+ # Copy configuration files:
1191+ COPY nginx.conf custom_log_format.json /etc/nginx/
1192+ COPY entrypoint.sh /root/
1193+
1194+ CMD ["sh" , "/root/entrypoint.sh" ]
1195+ ```
1196+
1197+ #### Debian
1198+
1199+ ``` dockerfile
1200+ ARG OS_CODENAME
1201+ # Where OS_CODENAME can be: buster/bullseye/bookworm
1202+ # syntax=docker/dockerfile:1
1203+ # For Debian 11 / 12:
1204+ FROM debian:${OS_CODENAME}
1205+
1206+ # Install prerequisite packages:
1207+ RUN apt-get update && apt-get install -y apt-transport-https lsb-release ca-certificates wget gnupg2
1208+
1209+ # Download and add the NGINX signing keys:
1210+ RUN wget -qO - https://cs.nginx.com/static/keys/nginx_signing.key | \
1211+ gpg --dearmor | tee /usr/share/keyrings/nginx-archive-keyring.gpg >/dev/null
1212+ RUN wget -qO - https://cs.nginx.com/static/keys/app-protect-security-updates.key | \
1213+ gpg --dearmor | tee /usr/share/keyrings/app-protect-security-updates.gpg >/dev/null
1214+
1215+ # Add NGINX Plus repository:
1216+ RUN printf "deb [signed-by=/usr/share/keyrings/nginx-archive-keyring.gpg] \
1217+ https://pkgs.nginx.com/plus/debian `lsb_release -cs` nginx-plus\n " | \
1218+ tee /etc/apt/sources.list.d/nginx-plus.list
1219+
1220+ # Add F5 WAF for NGINX repositories:
1221+ RUN printf "deb [signed-by=/usr/share/keyrings/nginx-archive-keyring.gpg] \
1222+ https://pkgs.nginx.com/app-protect/debian `lsb_release -cs` nginx-plus\n " | \
1223+ tee /etc/apt/sources.list.d/nginx-app-protect.list
1224+ RUN printf "deb [signed-by=/usr/share/keyrings/app-protect-security-updates.gpg] \
1225+ https://pkgs.nginx.com/app-protect-security-updates/debian `lsb_release -cs` nginx-plus\n " | \
1226+ tee /etc/apt/sources.list.d/app-protect-security-updates.list
1227+
1228+ # Download the apt configuration to `/etc/apt/apt.conf.d`:
1229+ RUN wget -P /etc/apt/apt.conf.d https://cs.nginx.com/static/files/90pkgs-nginx
1230+
1231+ # Update the repository and install the most recent version of the F5 WAF for NGINX package (which includes NGINX Plus):
1232+ RUN --mount=type=secret,id=nginx-crt,dst=/etc/ssl/nginx/nginx-repo.cert,mode=0644 \
1233+ --mount=type=secret,id=nginx-key,dst=/etc/ssl/nginx/nginx-repo.key,mode=0644 \
1234+ apt-get update && apt-get install -y app-protect
1235+
1236+ # Only use if you want to install and use the IP intelligence feature:
1237+ RUN --mount=type=secret,id=nginx-crt,dst=/etc/ssl/nginx/nginx-repo.cert,mode=0644 \
1238+ --mount=type=secret,id=nginx-key,dst=/etc/ssl/nginx/nginx-repo.key,mode=0644 \
1239+ apt-get install -y app-protect-ip-intelligence
1240+
1241+ # Forward request logs to Docker log collector:
1242+ RUN ln -sf /dev/stdout /var/log/nginx/access.log \
1243+ && ln -sf /dev/stderr /var/log/nginx/error.log
1244+
1245+ # Copy configuration files:
1246+ COPY nginx.conf custom_log_format.json /etc/nginx/
1247+ COPY entrypoint.sh /root/
1248+
1249+ CMD ["sh" , "/root/entrypoint.sh" ]
1250+ ```
1251+
1252+ #### Oracle Linux
1253+
1254+ ``` dockerfile
1255+ # syntax=docker/dockerfile:1
1256+ # For Oracle Linux 8:
1257+ FROM oraclelinux:8
1258+
1259+ # Install prerequisite packages:
1260+ RUN dnf -y install wget ca-certificates yum-utils
1261+
1262+ # Add NGINX Plus repo to Yum:
1263+ RUN wget -P /etc/yum.repos.d https://cs.nginx.com/static/files/nginx-plus-8.repo
1264+
1265+ # Add NGINX App-protect repo to Yum:
1266+ RUN wget -P /etc/yum.repos.d https://cs.nginx.com/static/files/app-protect-8.repo
1267+
1268+ # Enable Yum repositories to pull App Protect dependencies:
1269+ RUN dnf config-manager --set-enabled ol8_codeready_builder \
1270+ && wget -P /etc/yum.repos.d https://cs.nginx.com/static/files/dependencies.repo \
1271+ # You can use either of the dependencies or epel repo
1272+ # && rpm -ivh https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm \
1273+ && dnf clean all
1274+
1275+ # Install F5 WAF for NGINX:
1276+ RUN --mount=type=secret,id=nginx-crt,dst=/etc/ssl/nginx/nginx-repo.cert,mode=0644 \
1277+ --mount=type=secret,id=nginx-key,dst=/etc/ssl/nginx/nginx-repo.key,mode=0644 \
1278+ dnf -y install app-protect \
1279+ && dnf clean all \
1280+ && rm -rf /var/cache/dnf
1281+
1282+ # Only use if you want to install and use the IP intelligence feature:
1283+ RUN --mount=type=secret,id=nginx-crt,dst=/etc/ssl/nginx/nginx-repo.cert,mode=0644 \
1284+ --mount=type=secret,id=nginx-key,dst=/etc/ssl/nginx/nginx-repo.key,mode=0644 \
1285+ dnf install -y app-protect-ip-intelligence
1286+
1287+ # Forward request logs to Docker log collector:
1288+ RUN ln -sf /dev/stdout /var/log/nginx/access.log \
1289+ && ln -sf /dev/stderr /var/log/nginx/error.log
1290+
1291+ # Copy configuration files:
1292+ COPY nginx.conf custom_log_format.json /etc/nginx/
1293+ COPY entrypoint.sh /root/
1294+
1295+ CMD ["sh" , "/root/entrypoint.sh" ]
1296+ ```
1297+
1298+ #### RHEL 8
1299+
1300+ ``` dockerfile
1301+ # syntax=docker/dockerfile:1
1302+ # For RHEL ubi8:
1303+ FROM registry.access.redhat.com/ubi8/ubi
1304+
1305+ # Install prerequisite packages:
1306+ RUN dnf -y install wget ca-certificates
1307+
1308+ # Add NGINX Plus repo to Yum:
1309+ RUN wget -P /etc/yum.repos.d https://cs.nginx.com/static/files/nginx-plus-8.repo
1310+
1311+ # Add NGINX App-protect & dependencies repo to Yum:
1312+ RUN wget -P /etc/yum.repos.d https://cs.nginx.com/static/files/app-protect-8.repo
1313+ RUN wget -P /etc/yum.repos.d https://cs.nginx.com/static/files/dependencies.repo \
1314+ # You can use either of the dependencies or epel repo
1315+ # && rpm -ivh https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm \
1316+ && dnf clean all
1317+
1318+ # Install F5 WAF for NGINX:
1319+ RUN --mount=type=secret,id=nginx-crt,dst=/etc/ssl/nginx/nginx-repo.cert,mode=0644 \
1320+ --mount=type=secret,id=nginx-key,dst=/etc/ssl/nginx/nginx-repo.key,mode=0644 \
1321+ dnf install --enablerepo=codeready-builder-for-rhel-8-x86_64-rpms -y app-protect \
1322+ && dnf clean all \
1323+ && rm -rf /var/cache/dnf
1324+
1325+ # Only use if you want to install and use the IP intelligence feature:
1326+ RUN --mount=type=secret,id=nginx-crt,dst=/etc/ssl/nginx/nginx-repo.cert,mode=0644 \
1327+ --mount=type=secret,id=nginx-key,dst=/etc/ssl/nginx/nginx-repo.key,mode=0644 \
1328+ dnf install -y app-protect-ip-intelligence
1329+
1330+ # Forward request logs to Docker log collector:
1331+ RUN ln -sf /dev/stdout /var/log/nginx/access.log \
1332+ && ln -sf /dev/stderr /var/log/nginx/error.log
1333+
1334+ # Copy configuration files:
1335+ COPY nginx.conf custom_log_format.json /etc/nginx/
1336+ COPY entrypoint.sh /root/
1337+
1338+ CMD ["sh" , "/root/entrypoint.sh" ]
1339+ ```
1340+
1341+ #### RHEL 9
1342+
1343+ ``` dockerfile
1344+ # syntax=docker/dockerfile:1
1345+ # For Rocky Linux 9:
1346+ FROM rockylinux:9
1347+
1348+ # Install prerequisite packages:
1349+ RUN dnf -y install wget ca-certificates 'dnf-command(config-manager)'
1350+
1351+ # Add NGINX Plus repo to Yum:
1352+ RUN wget -P /etc/yum.repos.d https://cs.nginx.com/static/files/plus-9.repo
1353+
1354+ # Add NGINX App-protect & dependencies repo to Yum:
1355+ RUN wget -P /etc/yum.repos.d https://cs.nginx.com/static/files/app-protect-9.repo
1356+ RUN dnf config-manager --set-enabled crb \
1357+ && wget -P /etc/yum.repos.d https://cs.nginx.com/static/files/dependencies.repo \
1358+ && dnf clean all
1359+
1360+ # Install F5 WAF for NGINX:
1361+ RUN --mount=type=secret,id=nginx-crt,dst=/etc/ssl/nginx/nginx-repo.cert,mode=0644 \
1362+ --mount=type=secret,id=nginx-key,dst=/etc/ssl/nginx/nginx-repo.key,mode=0644 \
1363+ dnf install -y app-protect \
1364+ && dnf clean all \
1365+ && rm -rf /var/cache/dnf
1366+
1367+ # Only use if you want to install and use the IP intelligence feature:
1368+ RUN --mount=type=secret,id=nginx-crt,dst=/etc/ssl/nginx/nginx-repo.cert,mode=0644 \
1369+ --mount=type=secret,id=nginx-key,dst=/etc/ssl/nginx/nginx-repo.key,mode=0644 \
1370+ dnf install -y app-protect-ip-intelligence
1371+
1372+ # Forward request logs to Docker log collector:
1373+ RUN ln -sf /dev/stdout /var/log/nginx/access.log \
1374+ && ln -sf /dev/stderr /var/log/nginx/error.log
1375+
1376+ # Copy configuration files:
1377+ COPY nginx.conf custom_log_format.json /etc/nginx/
1378+ COPY entrypoint.sh /root/
1379+
1380+ CMD ["sh" , "/root/entrypoint.sh" ]
1381+ ```
1382+
1383+ #### Rocky Linux 9
1384+
1385+ ``` dockerfile
1386+ # syntax=docker/dockerfile:1
1387+ # For Rocky Linux 9:
1388+ FROM rockylinux:9
1389+
1390+ # Install prerequisite packages:
1391+ RUN dnf -y install wget ca-certificates 'dnf-command(config-manager)'
1392+
1393+ # Add NGINX Plus repo to Yum:
1394+ RUN wget -P /etc/yum.repos.d https://cs.nginx.com/static/files/plus-9.repo
1395+
1396+ # Add NGINX App-protect & dependencies repo to Yum:
1397+ RUN wget -P /etc/yum.repos.d https://cs.nginx.com/static/files/app-protect-9.repo
1398+ RUN dnf config-manager --set-enabled crb \
1399+ && wget -P /etc/yum.repos.d https://cs.nginx.com/static/files/dependencies.repo \
1400+ && dnf clean all
1401+
1402+ # Install F5 WAF for NGINX:
1403+ RUN --mount=type=secret,id=nginx-crt,dst=/etc/ssl/nginx/nginx-repo.cert,mode=0644 \
1404+ --mount=type=secret,id=nginx-key,dst=/etc/ssl/nginx/nginx-repo.key,mode=0644 \
1405+ dnf install -y app-protect \
1406+ && dnf clean all \
1407+ && rm -rf /var/cache/dnf
1408+
1409+ # Only use if you want to install and use the IP intelligence feature:
1410+ RUN --mount=type=secret,id=nginx-crt,dst=/etc/ssl/nginx/nginx-repo.cert,mode=0644 \
1411+ --mount=type=secret,id=nginx-key,dst=/etc/ssl/nginx/nginx-repo.key,mode=0644 \
1412+ dnf install -y app-protect-ip-intelligence
1413+
1414+ # Forward request logs to Docker log collector:
1415+ RUN ln -sf /dev/stdout /var/log/nginx/access.log \
1416+ && ln -sf /dev/stderr /var/log/nginx/error.log
1417+
1418+ # Copy configuration files:
1419+ COPY nginx.conf custom_log_format.json /etc/nginx/
1420+ COPY entrypoint.sh /root/
1421+
1422+ CMD ["sh" , "/root/entrypoint.sh" ]
1423+ ```
1424+
1425+ #### Ubuntu
1426+
1427+ ``` dockerfile
1428+ ARG OS_CODENAME
1429+ # Where OS_CODENAME can be: focal/jammy/noble
1430+ # syntax=docker/dockerfile:1
1431+ # For Ubuntu 20.04 / 22.04 / 24.04:
1432+ FROM ubuntu:${OS_CODENAME}
1433+
1434+ # Install prerequisite packages:
1435+ RUN apt-get update && apt-get install -y apt-transport-https lsb-release ca-certificates wget gnupg2
1436+
1437+ # Download and add the NGINX signing keys:
1438+ RUN wget -qO - https://cs.nginx.com/static/keys/nginx_signing.key | \
1439+ gpg --dearmor | tee /usr/share/keyrings/nginx-archive-keyring.gpg >/dev/null
1440+ RUN wget -qO - https://cs.nginx.com/static/keys/app-protect-security-updates.key | \
1441+ gpg --dearmor | tee /usr/share/keyrings/app-protect-security-updates.gpg >/dev/null
1442+
1443+ # Add NGINX Plus repository:
1444+ RUN printf "deb [signed-by=/usr/share/keyrings/nginx-archive-keyring.gpg] \
1445+ https://pkgs.nginx.com/plus/ubuntu `lsb_release -cs` nginx-plus\n " | \
1446+ tee /etc/apt/sources.list.d/nginx-plus.list
1447+
1448+ # Add F5 WAF for NGINX repositories:
1449+ RUN printf "deb [signed-by=/usr/share/keyrings/nginx-archive-keyring.gpg] \
1450+ https://pkgs.nginx.com/app-protect/ubuntu `lsb_release -cs` nginx-plus\n " | \
1451+ tee /etc/apt/sources.list.d/nginx-app-protect.list
1452+ RUN printf "deb [signed-by=/usr/share/keyrings/app-protect-security-updates.gpg] \
1453+ https://pkgs.nginx.com/app-protect-security-updates/ubuntu `lsb_release -cs` nginx-plus\n " | \
1454+ tee /etc/apt/sources.list.d/app-protect-security-updates.list
1455+
1456+ # Download the apt configuration to `/etc/apt/apt.conf.d`:
1457+ RUN wget -P /etc/apt/apt.conf.d https://cs.nginx.com/static/files/90pkgs-nginx
1458+
1459+ # Update the repository and install the most recent version of the F5 WAF for NGINX package (which includes NGINX Plus):
1460+ RUN --mount=type=secret,id=nginx-crt,dst=/etc/ssl/nginx/nginx-repo.cert,mode=0644 \
1461+ --mount=type=secret,id=nginx-key,dst=/etc/ssl/nginx/nginx-repo.key,mode=0644 \
1462+ apt-get update && DEBIAN_FRONTEND="noninteractive" apt-get install -y app-protect
1463+
1464+ # Only use if you want to install and use the IP intelligence feature:
1465+ RUN --mount=type=secret,id=nginx-crt,dst=/etc/ssl/nginx/nginx-repo.cert,mode=0644 \
1466+ --mount=type=secret,id=nginx-key,dst=/etc/ssl/nginx/nginx-repo.key,mode=0644 \
1467+ apt-get install -y app-protect-ip-intelligence
1468+
1469+ # Forward request logs to Docker log collector:
1470+ RUN ln -sf /dev/stdout /var/log/nginx/access.log \
1471+ && ln -sf /dev/stderr /var/log/nginx/error.log
1472+
1473+ # Copy configuration files:
1474+ COPY nginx.conf custom_log_format.json /etc/nginx/
1475+ COPY entrypoint.sh /root/
1476+
1477+ CMD ["sh" , "/root/entrypoint.sh" ]
1478+ ```
1479+
11071480## Post-installation checks
11081481
11091482{{< include "waf/install-post-checks.md" >}}
0 commit comments