-
Notifications
You must be signed in to change notification settings - Fork 259
Configuration Guide
Heisenbug edited this page Mar 5, 2026
·
1 revision
-
csf.confis the control center for firewall behavior, LFD automation, and UI exposure. - Safe rollout depends on validation (
csftest.pl), staged reloads, and log review. - Keep policy explicit: only open required ports, only enable features you actively use.
-
/etc/csf/csf.conf— primary behavior controls -
/etc/csf/csf.allow— always-allow list -
/etc/csf/csf.deny— permanent deny list -
/etc/csf/csf.ignore— entities LFD should ignore -
/var/log/lfd.log— operational truth for decisions and side effects
Deep reference: csf Command Line Options
- Edit one area at a time.
- Validate module/capability support.
- Reload CSF + LFD.
- Verify logs and expected access paths.
perl /etc/csf/csftest.pl
csf -ra
tail -n 100 /var/log/lfd.log- Keep
TESTING="1"during initial validation. - In testing mode, LFD daemon protections are not enforced normally.
- Move to
TESTING="0"only after verified access and expected rule behavior.
- Define allowed inbound/outbound TCP ports explicitly.
- Remove ports for services you do not actually run.
- Keep UDP policy minimal (commonly DNS/NTP + app-specific needs).
- Avoid broad UDP openings unless there is a clear requirement.
- Controls deny list growth and rotation pressure.
- Conservative values help avoid rule-table overhead on constrained hosts.
- Optional global connection-tracking defense.
- Useful against certain abuse patterns, but can false-positive on busy protocols.
- The integrated UI is high-privilege; keep disabled unless needed.
- If enabled, use a browser-safe high port and strict
ui.allowscope. - Keep private-network UI blocking enabled unless architecture explicitly requires otherwise.
- Set ports for real services only.
- Keep
TESTING="1". - Run
csf -raand validate remote management access. - Review
/var/log/lfd.log. - Set
TESTING="0", reload again, and re-verify.
- Changing multiple subsystems at once (harder root-cause analysis).
- Skipping log verification after reload.
- UI enabled without allowlist discipline.
- Port lists copied from templates without service-level validation.
- Login tracking thresholds → Login Tracking
- Process tracking and ignores → Process Tracking
- Directory watch behavior → Directory Watching
- Advanced allow/deny filters → Advanced Allow/Deny Filters
- Flood/connection controls → Port Flood Protection, Connection Limit Protection
- Performance optimization playbook → Performance & Scale Tuning
- IPv6 policy and safe rollout → IPv6 Deployment & Hardening
- Cheatsheet: Commands
- Cheatsheet: Structure
- Cheatsheet: Example Configs
- Performance & Scale Tuning
- IPv6 Deployment & Hardening
- Troubleshooting & Recovery
Last reviewed: 2026-02-25
- Security Features Guide
- Cloud & Container Hardening
- Automation & IaC
- IPv6 Deployment & Hardening
- IP Block Lists
- Reference Map
- Introduction
- csf Principles
- lfd Principles
- csf CLI Options
- lfd CLI Options
- Login Tracking
- Regex Custom Cookbook
- Script Email Alerts
- Process Tracking
- Directory Watching
- Advanced Filters
- Multiple Ethernet
- Generic Linux
- FTP Issues
- Messenger Service
- Block Reporting
- Port Flood
- Pre/Post Scripts
- Port Knocking
- Connection Limit
- Port/IP Redirect
- Integrated UI
- RESTRICT_SYSLOG
- Exim SMTP AUTH
- UI Skinning
- InterWorx
- CentOS Web Panel