You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you've enabled SELinux in enforcing mode, certain perfSONAR operations may generate audit log alerts. This section explains common issues and their fixes.
1224
+
1225
+
### SELinux Basics for perfSONAR
1226
+
1227
+
SELinux enforces mandatory access controls based on file labels and process contexts. perfSONAR services run under specific contexts (e.g., `lsregistrationdaemon_t`, `httpd_t`), and accessed files must have compatible labels.
1228
+
1229
+
**Check SELinux status:**
1230
+
1231
+
```bash
1232
+
sestatus
1233
+
# Expected output: "SELinux status: enabled" and "Current mode: enforcing"
1234
+
```
1235
+
1236
+
### Common SELinux Issues and Fixes
1237
+
1238
+
#### Issue 1: `/etc/perfsonar/lsregistrationdaemon.conf` Has Wrong Label
1239
+
1240
+
**Symptom:** Audit log shows:
1241
+
```
1242
+
SELinux is preventing /usr/bin/perl from getattr access on the file /etc/perfsonar/lsregistrationdaemon.conf.
1243
+
```
1244
+
1245
+
**Root cause:** The configuration file was created or modified (e.g., via restore or manual edit) and has an incorrect SELinux label. The file should be labeled `lsregistrationdaemon_etc_t` but may be labeled `admin_home_t` or have no label.
1246
+
1247
+
**Fix: Apply `restorecon` to relabel the file:**
1248
+
1249
+
```bash
1250
+
# Restore the default SELinux context for the file
Our `perfSONAR-update-lsregistration.sh` helper attempts to automatically apply `restorecon` after writing the configuration file. If `restorecon` is available on your system, it runs without user intervention:
1261
+
1262
+
```bash
1263
+
# Use the helper to restore config (with automatic restorecon attempt)
# Suppress specific alerts (if they are verified as safe):
1339
+
# Add rules to /etc/audit/audit.rules or /etc/audit/rules.d/
1340
+
# (requires audit service restart and SELinux expertise)
1341
+
```
1342
+
1343
+
### Best Practices for SELinux with perfSONAR
1344
+
1345
+
1. **Use automated tools:** Always use the helper scripts (`perfSONAR-update-lsregistration.sh`, `perfSONAR-install-nftables.sh`) which handle SELinux contexts automatically.
1346
+
1347
+
2. **Run `restorecon` after manual edits:** If you manually edit any perfSONAR configuration file, immediately restore the SELinux context:
1348
+
```bash
1349
+
sudo /sbin/restorecon -v /path/to/file
1350
+
```
1351
+
1352
+
3. **Monitor audit logs regularly:** Check `/var/log/audit/audit.log` weekly to catch new issues early.
1353
+
1354
+
4. **Document exceptions:** If you create local SELinux policy modules, document them in your change log so future admins understand why they exist.
1355
+
1356
+
5. **Keep policies minimal:** Only add local policy modules for operations that are verified as safe and necessary. Overly permissive policies increase security risk.
1357
+
1358
+
---
1359
+
1221
1360
## Step 9 – Post-Install Validation
1222
1361
1223
1362
Perform these checks before handing the host over to operations:
0 commit comments