Skip to content

Commit db65f3a

Browse files
author
root
committed
feat(toolkit-security): default exporter ACL protection matching container model (v1.1.0)
- Updated perfSONAR-toolkit-install.sh to apply AGLT2+CERN exporter ACLs by default - Added DEFAULT_EXPORTER_ALLOWLIST constant with container-matching subnets - Users can override with --exporter-allowlist or disable with --no-exporter-acls - Updated documentation to clarify protection is ON by default (not optional) - Quick-start examples now show ACL protection is automatic - Verified: nftables firewall allows port 443; Apache applies IP-level ACLs - All DEFAULT_EXPORTER_ALLOWLIST subnets configured on deployed hosts Closes gap: toolkit installations now have same protection as container builds.
1 parent bed9b2f commit db65f3a

File tree

5 files changed

+62
-22
lines changed

5 files changed

+62
-22
lines changed

docs/perfsonar/tools_scripts/README.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,13 +73,18 @@ Differences from the container orchestrator:
7373

7474
```bash
7575
# Quick start — full toolkit, ATLAS (experiment 1), no LE cert
76+
# (Includes exporter endpoint ACL protection by default for AGLT2 + CERN)
7677
curl -fsSL https://raw.githubusercontent.com/osg-htc/networking/master/docs/perfsonar/tools_scripts/perfSONAR-toolkit-install.sh \
7778
| sudo bash -s -- --experiment-id 1 --non-interactive
7879

79-
# With exporter endpoint protection (recommended: AGLT2 + CERN subnets, matches container model)
80+
# Override default exporter allow-list with custom subnets
8081
curl -fsSL https://raw.githubusercontent.com/osg-htc/networking/master/docs/perfsonar/tools_scripts/perfSONAR-toolkit-install.sh \
8182
| sudo bash -s -- --experiment-id 1 --non-interactive \
82-
--exporter-allowlist "192.41.230.0/23,192.41.236.0/23,2001:48a8:68f7::/50,188.184.0.0/17,188.185.0.0/17,188.185.128.0/18,128.142.0.0/16,2001:1458:d00::/48,2001:1458:d03::/48,2001:1458:301::/48,2001:1458:302::/48,2001:1458:303::/48"
83+
--exporter-allowlist "YOUR_SUBNET_1,YOUR_SUBNET_2"
84+
85+
# Disable exporter endpoint ACL protection (not recommended)
86+
curl -fsSL https://raw.githubusercontent.com/osg-htc/networking/master/docs/perfsonar/tools_scripts/perfSONAR-toolkit-install.sh \
87+
| sudo bash -s -- --experiment-id 1 --non-interactive --no-exporter-acls
8388

8489
# With Let's Encrypt
8590
curl -fsSL https://raw.githubusercontent.com/osg-htc/networking/master/docs/perfsonar/tools_scripts/perfSONAR-toolkit-install.sh \
@@ -92,7 +97,7 @@ curl -fsSL https://raw.githubusercontent.com/osg-htc/networking/master/docs/perf
9297
```
9398

9499
Flags: `--bundle {toolkit|testpoint|core|tools}`, `--fqdn`, `--email`, `--experiment-id N`,
95-
`--no-flowd-go`, `--exporter-allowlist "CIDR1,CIDR2,..."`, `--non-interactive`, `--yes`, `--dry-run`
100+
`--no-flowd-go`, `--exporter-allowlist "CIDR1,CIDR2,..."` (override defaults), `--no-exporter-acls` (disable protection), `--non-interactive`, `--yes`, `--dry-run`
96101

97102
> **RHEL 9 note**: The perfSONAR automated install script (`downloads.perfsonar.net/install`)
98103
> does not enable CodeReady Builder on Satellite-managed RHEL systems.

docs/perfsonar/tools_scripts/perfSONAR-toolkit-install.sh

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env bash
22
set -euo pipefail
3-
# Version: 1.0.3
3+
# Version: 1.1.0
44
# Author: Shawn McKee, University of Michigan
55
# Acknowledgements: Supported by IRIS-HEP and OSG-LHC
66

@@ -34,8 +34,10 @@ set -euo pipefail
3434
# --experiment-id N SciTags experiment ID for flowd-go (1-14; interactive prompt if omitted)
3535
# --no-firefly-receiver Disable fireflyp plugin in flowd-go config (use with flowd-go 2.4.x RPM)
3636
# Requires flowd-go >= 2.5.0; omit with current 2.4.2 RPM to avoid errors
37-
# --exporter-allowlist Comma-separated CIDRs/IPs allowed to access exporter endpoints
37+
# --exporter-allowlist Override default exporter endpoint allow-list (comma-separated CIDRs/IPs)
38+
# Default: AGLT2 + CERN monitoring subnets (matching container protection)
3839
# (/node_exporter/metrics and /perfsonar_host_exporter/)
40+
# --no-exporter-acls Disable exporter endpoint ACL protection (not recommended)
3941
#
4042
# Log:
4143
# /var/log/perfsonar-toolkit-install.log
@@ -47,11 +49,15 @@ NON_INTERACTIVE=false
4749
INSTALL_FLOWD_GO=true
4850
FLOWD_GO_EXPERIMENT_ID=""
4951
NO_FIREFLY_RECEIVER=false
50-
EXPORTER_ALLOWLIST=""
52+
NO_EXPORTER_ACLS=false
5153
BUNDLE="toolkit"
5254
LE_FQDN=""
5355
LE_EMAIL=""
5456

57+
# Default exporter endpoint ACL allow-list (AGLT2 + CERN, matching container)
58+
DEFAULT_EXPORTER_ALLOWLIST="192.41.230.0/23,192.41.236.0/23,2001:48a8:68f7::/50,188.184.0.0/17,188.185.0.0/17,188.185.128.0/18,128.142.0.0/16,2001:1458:d00::/48,2001:1458:d03::/48,2001:1458:301::/48,2001:1458:302::/48,2001:1458:303::/48"
59+
EXPORTER_ALLOWLIST="$DEFAULT_EXPORTER_ALLOWLIST"
60+
5561
# Repo + package constants
5662
PERFSONA_REPO_URL="http://software.internet2.edu/rpms/el9/x86_64/latest/packages/perfsonar-repo-0.11-1.noarch.rpm"
5763
EPEL_REPO_URL="https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm"
@@ -104,6 +110,7 @@ parse_cli() {
104110
--experiment-id) FLOWD_GO_EXPERIMENT_ID="${2:-}"; shift 2;;
105111
--no-firefly-receiver) NO_FIREFLY_RECEIVER=true; shift;;
106112
--exporter-allowlist) EXPORTER_ALLOWLIST="${2:-}"; shift 2;;
113+
--no-exporter-acls) NO_EXPORTER_ACLS=true; EXPORTER_ALLOWLIST=""; shift;;
107114
--help|-h) sed -n '1,80p' "$0"; exit 0;;
108115
*) echo "Unknown argument: $1" >&2; exit 2;;
109116
esac
@@ -243,17 +250,17 @@ step_security() {
243250
fi
244251
run "${sec_cmd[@]}" || true
245252

246-
if [ -n "$EXPORTER_ALLOWLIST" ]; then
247-
log "Restricting exporter endpoints (/node_exporter/metrics, /perfsonar_host_exporter/) to monitoring subnets: $EXPORTER_ALLOWLIST"
253+
if [ "$NO_EXPORTER_ACLS" = true ]; then
254+
log "WARNING: Exporter endpoint ACL protection is DISABLED (--no-exporter-acls). Both /node_exporter/metrics and /perfsonar_host_exporter/ will be accessible from any HTTPS client. This is not recommended."
255+
else
256+
log "Protecting exporter endpoints (/node_exporter/metrics, /perfsonar_host_exporter/) with ACLs for: $EXPORTER_ALLOWLIST"
248257
if [ -x "$HELPER_DIR/tools_scripts/perfSONAR-configure-exporter-acls.sh" ]; then
249258
run "$HELPER_DIR/tools_scripts/perfSONAR-configure-exporter-acls.sh" \
250259
--allowlist "$EXPORTER_ALLOWLIST" --yes || true
251260
run systemctl reload httpd || run systemctl reload apache2 || true
252261
else
253262
log "WARNING: perfSONAR-configure-exporter-acls.sh not found; skipping exporter ACL configuration."
254263
fi
255-
else
256-
log "Exporter endpoint ACL protection not configured. Use --exporter-allowlist to restrict access (e.g., --exporter-allowlist \"192.41.230.0/23,2001:48a8:68f7::/50\")."
257264
fi
258265
}
259266

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
a5d25fbac56fd79a0bdd8c11b5504a1136ff87c0d174f21b6120b3aa054c4eb8 perfSONAR-toolkit-install.sh
1+
5e2f395b3c02f342a1ca263b3d8620ee1ce835048b8a48a5f407f3ace43f3b5a perfSONAR-toolkit-install.sh

docs/perfsonar/tools_scripts/scripts.sha256

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ e1944123e17c89e8f202cca960f147397d64ae1e675af132c84b02ced2564abb node_exporter.
1818
50dfab90bc21d5c566b713f48b00b079a32a8b8756432a0d0f66ac6a64e6e581 perfSONAR-health-monitor.sh
1919
e184c633ca9ca5d3d79321213843a4eaa951e5596d3dc05f082e5f76e860e580 install_tools_scripts.sh
2020
7be726de5dfdbe8f7f5ac8e803b0b71e8f98f1ba274ca70b42f8eba4822cc67b perfSONAR-orchestrator.sh
21-
a5d25fbac56fd79a0bdd8c11b5504a1136ff87c0d174f21b6120b3aa054c4eb8 perfSONAR-toolkit-install.sh
21+
5e2f395b3c02f342a1ca263b3d8620ee1ce835048b8a48a5f407f3ace43f3b5a perfSONAR-toolkit-install.sh
2222
cd0e7afd1ca7a20a972e585018802be0cb6f67cd3ffee449dea45d785c23145a perfSONAR-configure-exporter-acls.sh
2323
2615a29d65e285391adb547046584c4534ea548e69571b67e0cf35773b010c57 perfSONAR-diagnostic-report.sh
2424
ac0c8fd6f27cc156ec05c7e6ac3547e0732f436a7033dac34475ece5641a284f docs/perfsonar/tools_scripts/perfSONAR-install-flowd-go.sh

docs/personas/quick-deploy/install-perfsonar-toolkit.md

Lines changed: 38 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -171,15 +171,25 @@ Installation takes approximately 5-10 minutes depending on network speed.
171171
runs post-install configuration, and optionally installs flowd-go:
172172
173173
```bash
174+
# Standard installation (includes exporter ACL protection by default for AGLT2 + CERN)
174175
curl -fsSL https://raw.githubusercontent.com/osg-htc/networking/master/docs/perfsonar/tools_scripts/perfSONAR-toolkit-install.sh \
175176
| sudo bash -s -- --experiment-id 1 --non-interactive
176177
```
177178
178-
To protect exporter endpoints by restricting access to monitoring subnets (AGLT2 and CERN):
179+
The exporter endpoints are **protected by default** with Apache `Require ip` ACLs for AGLT2 and CERN monitoring subnets, matching the container deployment model. To customize the allow-list:
180+
179181
```bash
182+
# Override the default allow-list with your own subnets
180183
curl -fsSL https://raw.githubusercontent.com/osg-htc/networking/master/docs/perfsonar/tools_scripts/perfSONAR-toolkit-install.sh \
181184
| sudo bash -s -- --experiment-id 1 --non-interactive \
182-
--exporter-allowlist "192.41.230.0/23,192.41.236.0/23,2001:48a8:68f7::/50,188.184.0.0/17,188.185.0.0/17,188.185.128.0/18,128.142.0.0/16,2001:1458:d00::/48,2001:1458:d03::/48,2001:1458:301::/48,2001:1458:302::/48,2001:1458:303::/48"
185+
--exporter-allowlist "YOUR_SUBNET_1,YOUR_SUBNET_2"
186+
```
187+
188+
To disable ACL protection on exporter endpoints (not recommended):
189+
190+
```bash
191+
curl -fsSL https://raw.githubusercontent.com/osg-htc/networking/master/docs/perfsonar/tools_scripts/perfSONAR-toolkit-install.sh \
192+
| sudo bash -s -- --experiment-id 1 --non-interactive --no-exporter-acls
183193
```
184194
185195
See the [tools_scripts README](../../perfsonar/tools_scripts/README.md) for full
@@ -486,28 +496,46 @@ You can use the install script to install the options you want (selinux, fail2ba
486496
The script writes nftables rules for perfSONAR services, derives SSH allow-lists from `/etc/perfSONAR-multi-nic-
487497
config.conf`, optionally adjusts SELinux, and enables Fail2ban jails—only if those components are already installed.
488498
489-
### Restricting exporter endpoints to monitoring subnets
499+
### Exporter endpoint protection (on by default)
490500
491501
The toolkit exposes two exporter endpoints via HTTPS:
492502
493503
- `/node_exporter/metrics` (system metrics from Node Exporter, proxied via `localhost:9100`)
494504
- `/perfsonar_host_exporter/` (host-specific metrics from perfSONAR)
495505
496-
**We are protecting these endpoints** by allowing access only from designated monitoring subnets, matching the container deployment model. By default, if you specify `--exporter-allowlist` during installation, these endpoints are restricted by Apache `Require ip` rules to the CIDRs you provide.
506+
**These endpoints are protected by default** with Apache `Require ip` ACLs that restrict access to AGLT2 and CERN monitoring subnets, matching the container deployment protection model. This happens automatically during installation without any additional flags required.
507+
508+
**Default protected subnets** (same as container image):
509+
- AGLT2 IPv4: `192.41.230.0/23`, `192.41.236.0/23`
510+
- AGLT2 IPv6: `2001:48a8:68f7::/50`
511+
- CERN IPv4: `188.184.0.0/17`, `188.185.0.0/17`, `188.185.128.0/18`, `128.142.0.0/16`
512+
- CERN IPv6: `2001:1458:d00::/48`, `2001:1458:d03::/48`, `2001:1458:301::/48`, `2001:1458:302::/48`, `2001:1458:303::/48`
497513
498-
**Recommended default subnets** (AGLT2 and CERN, matching the container image):
514+
**To customize the allow-list:**
515+
516+
If your site needs different monitoring subnets, override the defaults at install time:
517+
518+
```bash
519+
curl -fsSL https://raw.githubusercontent.com/osg-htc/networking/master/docs/perfsonar/tools_scripts/perfSONAR-toolkit-install.sh \
520+
| sudo bash -s -- --experiment-id 1 --non-interactive \
521+
--exporter-allowlist "YOUR_SUBNET_1,YOUR_SUBNET_2,YOUR_SUBNET_3"
522+
```
523+
524+
Or, if the toolkit is already installed, use the helper script directly:
499525
500526
```bash
501527
/opt/perfsonar-tp/tools_scripts/perfSONAR-configure-exporter-acls.sh \
502-
--allowlist "192.41.230.0/23,192.41.236.0/23,2001:48a8:68f7::/50,188.184.0.0/17,188.185.0.0/17,188.185.128.0/18,128.142.0.0/16,2001:1458:d00::/48,2001:1458:d03::/48,2001:1458:301::/48,2001:1458:302::/48,2001:1458:303::/48" --yes
528+
--allowlist "YOUR_SUBNET_1,YOUR_SUBNET_2,YOUR_SUBNET_3" --yes
503529
```
504530
505-
**To customize the IPs:** If you want to change or add monitoring subnets, you can either:
531+
**To disable protection** (not recommended—exposing exporter metrics to any HTTPS client):
506532
507-
1. **At install time:** pass a different `--exporter-allowlist` value to the toolkit installer
508-
2. **Post-install:** Run the helper script with your custom CIDR list (paths may differ; check where helper scripts are installed)
533+
```bash
534+
curl -fsSL https://raw.githubusercontent.com/osg-htc/networking/master/docs/perfsonar/tools_scripts/perfSONAR-toolkit-install.sh \
535+
| sudo bash -s -- --experiment-id 1 --non-interactive --no-exporter-acls
536+
```
509537
510-
The helper script writes `/etc/httpd/conf.d/apache-osg-exporter-restrictions.conf` with Apache `<Location>` blocks using `Require ip` directives, and reloads the web server.
538+
The ACL configuration writes to `/etc/httpd/conf.d/apache-osg-exporter-restrictions.conf` with Apache `<Location>` blocks using `Require ip` directives, and reloads the web server.
511539
512540
??? info "SSH allow-lists and validation"
513541

0 commit comments

Comments
 (0)