Check your AlmaLinux release
Use this procedure on a maintained minor release of AlmaLinux 9 or 10. Run cat /etc/os-release on the relay. The instructions use the distribution NGINX package, systemd and SELinux in enforcing mode. Identify the relay’s private DNS name, listener address and appliance source using the network prerequisites. AlmaLinux releases.
Install the packages and service account
Use the distribution repositories on a dedicated relay. DNF selects Python 3.12 from AppStream on version 9 or the system Python 3.12 on version 10. The refresh service uses the nginx worker group to grant read access to its verified files. Allow the relay outbound DNS and HTTPS to feeds.data-shield.eu.
sudo dnf install nginx /usr/bin/curl /usr/bin/python3.12 ca-certificates firewalld policycoreutils-python-utils libselinux-utils
/usr/bin/python3.12 --version
getent group nginx
getent passwd data-shield-relay >/dev/null ||
sudo useradd --system --no-create-home --gid nginx --shell /sbin/nologin data-shield-relay
sudo install -d -o root -g root -m 0755 /usr/local/lib/data-shield-relay
sudo install -d -o root -g root -m 0700 /etc/data-shield-relayFollow Download the reference files and Store the Device ID and token. From the directory containing the four downloaded files, install the service with its Enterprise Linux override. Check that the effective group is nginx and the command runs /usr/bin/python3.12.
sudo install -o root -g root -m 0755 refresh.py /usr/local/lib/data-shield-relay/
sudo install -o root -g root -m 0644 data-shield-relay.service data-shield-relay.timer /etc/systemd/system/
sudo install -d -m 0755 /etc/systemd/system/data-shield-relay.service.d
sudo tee /etc/systemd/system/data-shield-relay.service.d/10-enterprise-linux.conf >/dev/null <<'UNIT'
[Service]
Group=nginx
ExecStart=
ExecStart=/usr/bin/python3.12 -IB /usr/local/lib/data-shield-relay/refresh.py
UNIT
sudo restorecon -Rv /usr/local/lib/data-shield-relay /etc/data-shield-relay /etc/systemd/system/data-shield-relay*
sudo systemctl daemon-reload
systemctl show data-shield-relay.service -p User -p Group -p ExecStartLabel the publication directory and verify the first refresh
Keep SELinux enforcing. Apply the permanent httpd_sys_content_t label only to the publication tree. New snapshot directories and files inherit its type. The root-only credential directory stays separate under /etc/data-shield-relay. Add this mapping at first installation. When updating an existing relay, inspect its current mapping and repeat restorecon if the correct mapping is already present.
getenforce
sudo install -d -o data-shield-relay -g nginx -m 0750 /var/lib/data-shield-relay
sudo semanage fcontext -a -t httpd_sys_content_t '/var/lib/data-shield-relay(/.*)?'
sudo restorecon -Rv /var/lib/data-shield-relay
ls -Zd /var/lib/data-shield-relayExpect Enforcing and httpd_sys_content_t. Complete one successful download before enabling the web endpoint. The journal reports the verified generation and counts. Check that the oneshot result is success, the content label is verified and the NGINX account can read the full file.
sudo systemctl start data-shield-relay.service
systemctl show data-shield-relay.service -p Result -p ExecMainStatus
sudo journalctl -u data-shield-relay.service -n 12 --no-pager
sudo matchpathcon -V /var/lib/data-shield-relay/current/critical.txt
sudo -u nginx test -r /var/lib/data-shield-relay/current/critical.txt
sudo systemctl enable --now data-shield-relay.timer
systemctl list-timers --all data-shield-relay.timerConfigure NGINX for the private network
Prepare the internal DNS name, trusted certificate chain and matching private key as described in TLS prerequisites. Replace the certificate paths below. In the site file replace the listening IP, hostname and allowed client address. The package loads /etc/nginx/conf.d/*.conf. Preserve the filename restrictions, the client allowlist and the final deny all.
sudo install -d -o root -g root -m 0700 /etc/nginx/tls
sudo install -o root -g root -m 0644 /path/to/fullchain.pem /etc/nginx/tls/feed-relay.crt
sudo install -o root -g root -m 0600 /path/to/privkey.pem /etc/nginx/tls/feed-relay.key
sudo install -o root -g root -m 0644 nginx.conf.example /etc/nginx/conf.d/data-shield-relay.conf
sudoedit /etc/nginx/conf.d/data-shield-relay.conf
sudo restorecon -Rv /etc/nginx/tls /etc/nginx/conf.d/data-shield-relay.conf
sudo nginx -tOn a dedicated host, review any distribution default server in /etc/nginx/nginx.conf and enable only the listeners you intend to expose. Keep the service on the LAN. NGINX serves static text here. The updater makes the upstream connection under its own account.
Restrict inbound HTTPS and check the appliance
The commands below apply to an active firewalld installation. On a new host, preserve management access before enabling firewalld. On a host managed by another firewall, apply equivalent source and destination restrictions there. Replace ens192 with your private interface, then use its actual zone.
sudo firewall-cmd --state
sudo firewall-cmd --get-active-zones
sudo firewall-cmd --get-zone-of-interface=ens192Replace internal, the appliance source 192.0.2.20/32 and the relay destination 192.0.2.10/32. The first rule accepts the appliance. The second rejects other clients to this address and port. For an approved HA pair, add the second source at the same accept priority. Check both rules in the runtime and permanent lists before starting NGINX.
zone=internal
allow='rule priority="-100" family="ipv4" source address="192.0.2.20/32" destination address="192.0.2.10/32" port port="443" protocol="tcp" accept'
block='rule priority="-90" family="ipv4" destination address="192.0.2.10/32" port port="443" protocol="tcp" reject'
for rule in "$allow" "$block"; do
sudo firewall-cmd --permanent --zone="$zone" --add-rich-rule="$rule" &&
sudo firewall-cmd --zone="$zone" --add-rich-rule="$rule" || break
done
sudo firewall-cmd --zone="$zone" --list-rich-rules
sudo firewall-cmd --permanent --zone="$zone" --list-rich-rulessudo nginx -t && sudo systemctl enable --now nginx && sudo systemctl reload nginx
sudo ss -lntpFrom the authorized firewall, follow Verify the HTTPS download for /critical.txt or a connector for each current split. Expect HTTP 200 and IPv4 entries. Another client should receive a denial or a refused connection. For a 403 from an authorized address, check the NGINX allowlist, directory permissions and matchpathcon -V on the file. Check SELinux denials with sudo ausearch -m AVC -ts recent. For a stale list or a 401, see Recovery and token rotation.
NGINX on Enterprise Linux · Persistent SELinux file labels · firewalld rule order
BETTER DATA. TOGETHER.
Need a correction?
Report a documentation issue or request a review of an address. Keep credentials and private configuration out of public issues.