Skip to content

Commit 6af5f33

Browse files
Added support for NGINX Instance Manager 2.13 and API Connectivity Manager 1.9 (#111)
* Added API Connectivity Manager 1.5.0 support * Ownership fix * Startup script fix * NGINX App Protect WAF updates * Tested with NGINX Instance Manager 2.9.1 * Added docker-compose support * Tested with NGINX Instance Manager 2.10.0 and Security Monitoring 1.4.0 * Tested with NGINX Instance Manager 2.10.0 and API Connectivity Manager 1.5.0 * Tested with API Connectivity Manager 1.6.0 * Tested with API Connectivity Manager 1.6.0 * README updated * Added support for NGINX Instance Manager 2.10.1 and App Delivery Manager 4.0.0 * Fixed NGINX App Protect detection bug for NGINX Instance Manager 2.10.0+ * Fixed agent syslog receiver bug * README updated * Tested with NGINX Instance Manager 2.11.0 and Security Monitoring 1.5.0 * Tested with NGINX Instance Manager 2.11.0 * Tested with NGINX API Connectivity Manager 1.7.0 * Tested with NGINX Instance Manager 2.12.0 and Security Monitoring 1.6.0 * Tested with API Connectivity Manager 1.8.0 * Tested with API Connectivity Manager 1.8.0 * Tested with NGINX Instance Manager 2.12.0 * Dockerfile updated * Support for NGINX Instance Manager 2.13 --------- Signed-off-by: 65397 <[email protected]>
1 parent 07bbab1 commit 6af5f33

File tree

5 files changed

+42
-15
lines changed

5 files changed

+42
-15
lines changed

nginx-agent-docker/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ This repository can be used to build a docker image with NGINX Plus and NGINX In
88

99
This repository has been tested with NGINX agent for:
1010

11-
- NGINX Instance Manager 2.4.0, 2.5.0, 2.5.1, 2.6.0, 2.7.0, 2.8.0, 2.9.0, 2.10.0, 2.10.1, 2.11.0, 2.12.0
12-
- API Connectivity Manager 1.4.0, 1.5.0, 1.6.0, 1.7.0, 1.8.0
11+
- NGINX Instance Manager 2.4.0, 2.5.0, 2.5.1, 2.6.0, 2.7.0, 2.8.0, 2.9.0, 2.10.0, 2.10.1, 2.11.0, 2.12.0, 2.13.0, 2.13.1
12+
- API Connectivity Manager 1.4.0, 1.5.0, 1.6.0, 1.7.0, 1.8.0, 1.9.0
1313
- NGINX App Protect WAF 4.100.1+
1414

1515
## Prerequisites

nginx-nms-docker/Dockerfile.automated

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,9 @@ RUN --mount=type=secret,id=nginx-crt,dst=/etc/ssl/nginx/nginx-repo.crt,mode=0644
3939
&& if [ ! -z "${ADD_ADM}" ] ; then \
4040
apt-get -y install nms-app-delivery-manager; fi \
4141
# Set permissions
42-
&& chmod +x /etc/nms/scripts/*.sh
42+
&& chmod +x /etc/nms/scripts/*.sh \
43+
&& wget https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64 -O /usr/bin/yq \
44+
&& chmod +x /usr/bin/yq
4345

4446
# Optional Second Sight
4547
WORKDIR /deployment

nginx-nms-docker/README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ A bash script to quickly install NGINX Management Suite through the official Hel
2424

2525
This repository has been tested with:
2626

27-
- NGINX Instance Manager 2.4.0, 2.5.0, 2.5.1, 2.6.0, 2.7.0, 2.8.0, 2.9.0, 2.9.1, 2.10.0, 2.10.1, 2.11.0, 2.12.0
28-
- NGINX API Connectivity Manager 1.0.0, 1.1.0, 1.1.1, 1.2.0, 1.3.0, 1.3.1, 1.4.0, 1.4.1, 1.5.0, 1.6.0, 1.7.0, 1.8.0
29-
- Security Monitoring 1.0.0, 1.1.0, 1.2.0, 1.3.0, 1.4.0, 1.5.0, 1.6.0
30-
- NGINX App Protect WAF compiler 3.1088.2, 4.2.0, 4.100.1, 4.218.0
27+
- NGINX Instance Manager 2.4.0, 2.5.0, 2.5.1, 2.6.0, 2.7.0, 2.8.0, 2.9.0, 2.9.1, 2.10.0, 2.10.1, 2.11.0, 2.12.0, 2.13.0, 2.13.1, 2.14.0
28+
- NGINX API Connectivity Manager 1.0.0, 1.1.0, 1.1.1, 1.2.0, 1.3.0, 1.3.1, 1.4.0, 1.4.1, 1.5.0, 1.6.0, 1.7.0, 1.8.0, 1.9.0, 1.9.1
29+
- Security Monitoring 1.0.0, 1.1.0, 1.2.0, 1.3.0, 1.4.0, 1.5.0, 1.6.0, 1.7.0
30+
- NGINX App Protect WAF compiler v3.1088.2, v4.100.1, v4.2.0, v4.218.0, v4.279.0, v4.402.0, v4.457.0
3131
- NGINX App Delivery Manager 4.0.0
3232

3333
## Prerequisites
@@ -74,7 +74,7 @@ NGINX Management Suite Docker image builder
7474
-K [file.key] - Key file to pull packages from the official NGINX repository
7575
-A - Enable API Connectivity Manager - optional
7676
-W - Enable Security Monitoring - optional
77-
-P [version] - Enable WAF policy compiler, version can be [v3.1088.2|v4.2.0|v4.100.1|v4.218.0|v4.279.0|v4.402.0] - optional
77+
-P [version] - Enable WAF policy compiler, version can be any [v3.1088.2|v4.100.1|v4.2.0|v4.218.0|v4.279.0|v4.402.0|v4.457.0] - optional
7878
-D - Enable App Delivery Manager - optional
7979
8080
=== Examples:
@@ -88,7 +88,7 @@ NGINX Management Suite Docker image builder
8888
8989
Automated build:
9090
./scripts/buildNIM.sh -i -C nginx-repo.crt -K nginx-repo.key
91-
-A -W -P v4.218.0 -D -t my.registry.tld/nginx-nms:2.9.0
91+
-A -W -P v4.457.0 -D -t my.registry.tld/nginx-nms:2.13.1
9292
```
9393

9494
### Automated build

nginx-nms-docker/container/startNIM.sh

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ clickhouse_username = '$NIM_CLICKHOUSE_USERNAME'
5050
clickhouse_password = '$NIM_CLICKHOUSE_PASSWORD'
5151
" >> /etc/nms/nms.conf
5252
;;
53-
*)
54-
echo "YAML nms.conf"
53+
2.7.0|2.8.0|2.9.0|2.9.1|2.10.0|2.10.1|2.11.0|2.12.0)
54+
echo "YAML nms.conf <= 2.12"
5555
# Clickhouse configuration - dedicated pod
5656
echo -e "
5757
@@ -62,6 +62,20 @@ clickhouse:
6262
password: '$NIM_CLICKHOUSE_PASSWORD'
6363
" >> /etc/nms/nms.conf
6464
;;
65+
*)
66+
echo "YAML nms.conf >= 2.13"
67+
# Clickhouse configuration - dedicated pod
68+
export NIM_CLICKHOUSE_ADDRESSPORT=$NIM_CLICKHOUSE_ADDRESS:$NIM_CLICKHOUSE_PORT
69+
yq '.clickhouse.address=strenv(NIM_CLICKHOUSE_ADDRESSPORT)|.clickhouse.username=strenv(NIM_CLICKHOUSE_USERNAME)|.clickhouse.password=strenv(NIM_CLICKHOUSE_PASSWORD)' /etc/nms/nms.conf > /etc/nms/nms.conf-updated
70+
mv /etc/nms/nms.conf-updated /etc/nms/nms.conf
71+
chown nms:nms /etc/nms/nms.conf
72+
chmod 644 /etc/nms/nms.conf
73+
74+
yq '.clickhouse.address="tcp://"+strenv(NIM_CLICKHOUSE_ADDRESSPORT)|.clickhouse.username=strenv(NIM_CLICKHOUSE_USERNAME)|.clickhouse.password=strenv(NIM_CLICKHOUSE_PASSWORD)' /etc/nms/nms-sm-conf.yaml > /etc/nms/nms-sm-conf.yaml-updated
75+
cp /etc/nms/nms-sm-conf.yaml-updated /etc/nms/nms-sm-conf.yaml
76+
chown nms:nms /etc/nms/nms-sm-conf.yaml
77+
chmod 644 /etc/nms/nms-sm-conf.yaml
78+
;;
6579
esac
6680

6781
# Start nms core - from /lib/systemd/system/nms-core.service
@@ -128,6 +142,12 @@ fi
128142

129143
sleep 5
130144

145+
# Start Security Monitoring
146+
if [ -f /usr/bin/nms-sm ]
147+
then
148+
su - nms -c "/usr/bin/nms-sm start &" -s /bin/bash
149+
fi
150+
131151
chmod 666 /var/run/nms/*.sock
132152

133153
/etc/init.d/nginx start

nginx-nms-docker/scripts/buildNIM.sh

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ Automated build:\n\n
1919
-K [file.key]\t\t- Key file to pull packages from the official NGINX repository\n
2020
-A\t\t\t- Enable API Connectivity Manager - optional\n
2121
-W\t\t\t- Enable Security Monitoring - optional\n
22-
-P [version]\t\t- Enable WAF policy compiler, version can be [v3.1088.2|v4.2.0|v4.100.1|v4.218.0|v4.279.0|v4.402.0] - optional\n\n
22+
-P [version]\t\t- Enable WAF policy compiler, version can be any [v3.1088.2|v4.100.1|v4.2.0|v4.218.0|v4.279.0|v4.402.0|v4.457.0] - optional\n
23+
-D\t\t\t- Enable App Delivery Manager - optional\n\n
2324
=== Examples:\n\n
2425
Manual build:\n
2526
\t$0 -n nim-files/nms-instance-manager_2.6.0-698150575~focal_amd64.deb \\\\\n
@@ -29,13 +30,13 @@ Manual build:\n
2930
\t\t-t my.registry.tld/nginx-nms:2.6.0\n\n
3031
Automated build:\n
3132
\t$0 -i -C nginx-repo.crt -K nginx-repo.key\n
32-
\t\t-A -W -P v4.218.0 -D -t my.registry.tld/nginx-nms:2.9.0\n
33+
\t\t-A -W -P v4.457.0 -D -t my.registry.tld/nginx-nms:2.13.1\n
3334
"
3435

3536
# Defaults
3637
COUNTER=false
3738

38-
while getopts 'hn:a:w:p:t:siC:K:AWP:' OPTION
39+
while getopts 'hn:a:w:p:t:siC:K:AWP:D' OPTION
3940
do
4041
case "$OPTION" in
4142
h)
@@ -78,6 +79,9 @@ do
7879
P)
7980
ADD_PUM=$OPTARG
8081
;;
82+
D)
83+
ADD_ADM=true
84+
;;
8185
esac
8286
done
8387

@@ -113,7 +117,8 @@ then
113117
--build-arg ACM_IMAGE=$ACM_IMAGE --build-arg SM_IMAGE=$SM_IMAGE --build-arg PUM_IMAGE=$PUM_IMAGE -t $IMGNAME .
114118
else
115119
DOCKER_BUILDKIT=1 docker build --no-cache -f Dockerfile.automated --secret id=nginx-key,src=$NGINX_KEY --secret id=nginx-crt,src=$NGINX_CERT \
116-
--build-arg ADD_ACM=$ADD_ACM --build-arg ADD_SM=$ADD_SM --build-arg ADD_PUM=$ADD_PUM --build-arg BUILD_WITH_SECONDSIGHT=$COUNTER \
120+
--build-arg ADD_ACM=$ADD_ACM --build-arg ADD_SM=$ADD_SM --build-arg ADD_PUM=$ADD_PUM --build-arg ADD_ADM=$ADD_ADM \
121+
--build-arg BUILD_WITH_SECONDSIGHT=$COUNTER \
117122
-t $IMGNAME .
118123
fi
119124

0 commit comments

Comments
 (0)