Skip to content

Commit c701963

Browse files
NGINX App Protect updates (#88)
1 parent 8b0d400 commit c701963

File tree

6 files changed

+29
-11
lines changed

6 files changed

+29
-11
lines changed

nginx-agent-docker/Dockerfile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,11 @@ RUN --mount=type=secret,id=nginx-crt,dst=/etc/ssl/nginx/nginx-repo.crt,mode=0644
4949

5050
# Forward request logs to Docker log collector
5151
&& ln -sf /dev/stdout /var/log/nginx/access.log \
52-
&& ln -sf /dev/stderr /var/log/nginx/error.log
52+
&& ln -sf /dev/stderr /var/log/nginx/error.log \
53+
54+
&& groupadd -g 1001 nginx-agent \
55+
&& usermod root -G nginx-agent \
56+
&& usermod nginx -G nginx-agent
5357

5458
EXPOSE 80
5559
STOPSIGNAL SIGTERM

nginx-agent-docker/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ 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
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
1212
- API Connectivity Manager 1.4.0
1313
- NGINX App Protect WAF 4.100.1+
1414

nginx-agent-docker/container/start.sh

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,18 @@ if [[ ! -z "$NIM_TAGS" ]]; then
1313
PARM="${PARM} --tags $NIM_TAGS"
1414
fi
1515

16+
1617
if [[ "$NAP_WAF" == "true" ]]; then
1718
PARM="${PARM} --nginx-app-protect-report-interval 15s --nap-monitoring-collector-buffer-size 50000 --nap-monitoring-processor-buffer-size 50000 --nap-monitoring-syslog-ip 127.0.0.1 --nap-monitoring-syslog-port 514"
18-
/usr/share/ts/bin/bd-socket-plugin tmm_count 4 proc_cpuinfo_cpu_mhz 2000000 total_xml_memory 471859200 total_umu_max_size 3129344 sys_max_account_id 1024 no_static_config &
19+
su - nginx -s /bin/bash -c "/opt/app_protect/bin/bd_agent &"
20+
su - nginx -s /bin/bash -c "/usr/share/ts/bin/bd-socket-plugin tmm_count 4 proc_cpuinfo_cpu_mhz 2000000 total_xml_memory 471859200 total_umu_max_size 3129344 sys_max_account_id 1024 no_static_config &"
21+
22+
while ([ ! -e /opt/app_protect/pipe/app_protect_plugin_socket ] || [ ! -e /opt/app_protect/pipe/ts_agent_pipe ])
23+
do
24+
sleep 1
25+
done
26+
27+
chown nginx:nginx /opt/app_protect/pipe/*
1928
fi
2029

2130
if [[ "$NAP_WAF_PRECOMPILED_POLICIES" == "true" ]]; then
@@ -26,4 +35,4 @@ if [[ "$ACM_DEVPORTAL" == "true" ]]; then
2635
nginx-devportal server &
2736
fi
2837

29-
nginx-agent $PARM
38+
sg nginx-agent "/usr/bin/nginx-agent $PARM"

nginx-nms-docker/Dockerfile.automated

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,9 @@ RUN --mount=type=secret,id=nginx-crt,dst=/etc/ssl/nginx/nginx-repo.crt,mode=0644
3232
apt-get -y install nms-sm; fi \
3333
# Optional WAF Policy Compiler
3434
&& if [ ! -z "${ADD_PUM}" ] ; then \
35-
apt-get -y install nms-nap-compiler-$ADD_PUM; fi
35+
apt-get -y install nms-nap-compiler-$ADD_PUM; fi \
36+
# Set permissions
37+
&& chmod +x /etc/nms/scripts/*.sh
3638

3739
# Optional Second Sight
3840
WORKDIR /deployment

nginx-nms-docker/Dockerfile.manual

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ ARG PUM_IMAGE=nim-files/.placeholder
88

99
# Initial setup
1010
RUN apt-get update && \
11-
DEBIAN_FRONTEND=noninteractive apt-get install -y -q build-essential git nano curl jq wget gawk \
12-
nginx lsb-release rsyslog systemd apt-transport-https ca-certificates netcat sudo && \
11+
DEBIAN_FRONTEND=noninteractive apt-get install -y -q build-essential git nano curl jq wget gawk \
12+
nginx lsb-release rsyslog systemd apt-transport-https ca-certificates netcat && \
1313
mkdir -p /deployment/setup
1414

1515
# NGINX Instance Manager 2.4.0+
@@ -40,6 +40,9 @@ RUN if [ "$SM_IMAGE" != "nim-files/.placeholder" ] ; then \
4040
RUN if [ "$PUM_IMAGE" != "nim-files/.placeholder" ] ; then \
4141
apt-get -y install /deployment/setup/pum.deb; fi
4242

43+
# Set permissions
44+
RUN chmod +x /etc/nms/scripts/*.sh
45+
4346
RUN rm -r /deployment/setup
4447

4548
# Optional Second Sight

nginx-nms-docker/README.md

Lines changed: 4 additions & 4 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
28-
- NGINX Management Suite API Connectivity Manager 1.0.0, 1.1.0, 1.1.1, 1.2.0, 1.3.0, 1.3.1
29-
- Security Monitoring 1.0.0, 1.1.0, 1.2.0
30-
- NGINX App Protect WAF compiler 3.1088.2, 4.2.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
28+
- NGINX Management Suite 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
29+
- Security Monitoring 1.0.0, 1.1.0, 1.2.0, 1.3.0
30+
- NGINX App Protect WAF compiler 3.1088.2, 4.2.0, 4.100.1
3131

3232
## Prerequisites
3333

0 commit comments

Comments
 (0)