Restrict access to Knox E-FOTA On-Premises
Last updated December 15th, 2023
Categories:
Environment
- Knox E-FOTA On-Premises
- HAProxy service
- Linux terminal
Overview
With HAProxy, IT admins can restrict access to the Knox E-FOTA On-Premises console by creating an allowlist of IP addresses.
This HAProxy configuration assumes that the Knox E-FOTA On-Premises server and the IT admin’s computer are located in the same network range.
How to configure the HAProxy allowlist
To configure the HAProxy allowlist:
-
Locate the HAProxy configuration file. By default, the path to the config file is /dfm/haproxy/config/haproxy.cfg.
-
Open the configuration file and add the following lines under frontend fe_web. For this section, 123.123.123.123 is used as a replacement value for your IP address.
acl is-allowed-ip src 123.123.123.123 acl is-admin path_beg -i /admin http-request deny if !is-allowed-ip is-admin
-
Restart the HAProxy service in the command line:
dfm restart dfm-proxy podman ps -a
After making these changes, any attempts to access the Knox E-FOTA On-Premises console with an IP address that is not allowed returns a 403 error code.
If access is blocked for an IP address included in the allowlist, the IP address of the target computer might be different from the address included in the allowlist.
To resolve this issue:
-
Open the HAProxy configuration file.
-
Comment out the following lines:
# option dontlog-normal ... # acl is-allowed-ip src <ip_address> # acl is-admin path_beg -i /admin # http-request deny if !is-allowed-ip is-admin
-
Restart the HAProxy service:
dfm restart dfm-proxy podman ps -a
-
Before accessing the E-FOTA On-Premises console, turn on log monitoring in the command line:
podman logs --tail 30 -f dfm-proxy
-
Access the Knox E-FOTA On-Premises console. The IP address of your device is shown in the log.
-
Uncomment the original allowlist commands, and include the updated IP address.
-
Restart the HAProxy service:
dfm restart dfm-proxy
-
Test access to the console with an IP address that is not allowed. If there is a 403 error code, the configuration is working.
-
In the configuration file, uncomment the following line:
option dontlog-normal
-
Restart the HAProxy service:
dfm restart dfm-proxy
On this page
Is this page helpful?