Skip to content

Upgrade and Breaking Changes

Heisenbug edited this page Mar 5, 2026 · 1 revision

Home · Install & Migrate · Changelog

At a glance

  • Use this page when planning CSF upgrades in production.
  • Not every release is risky, but some changes can alter detection behavior, firewall application, or integration flows.
  • Treat upgrades as controlled operations: baseline → canary → validation → rollout.

What counts as a breaking or high-impact change

In CSF/LFD operations, “breaking” is broader than compile/runtime failure. It can include:

  • changed login/abuse regex behavior (different block/no-block outcomes)
  • changed defaults that alter policy posture
  • integration behavior changes (Cloudflare, Messenger, panel integrations)
  • backend/toolchain shifts (iptables-nft/module behavior)
  • changed file/template generation behavior

10-minute upgrade decision flow

Use this quick flow before every production update:

  1. Read newest release entries in changelog.txt.
  2. Classify risk (R1/R2/R3).
  3. If R2 or R3, run canary first.
  4. Validate canary with service + access + false-positive checks.
  5. Roll forward in waves only if canary is clean.
  6. Keep rollback path active until full-wave validation is complete.

Source of truth for release changes

Check these before every upgrade wave:

  • Local changelog (on installed hosts): /etc/csf/changelog.txt
  • Upstream release notes/changelog in source distribution
  • Effective csf.conf on each environment (not just assumptions from docs)

Quick commands:

csf -v
csf -c

# review latest release notes locally
sed -n '1,220p' /etc/csf/changelog.txt

Risk classification model (simple and practical)

Class Description Rollout style
R1 UI/docs/minor display fixes, no enforcement logic changes normal maintenance window
R2 detection/config behavior touched, but controlled impact canary first, staged rollout
R3 enforcement/backend/integration changes with outage potential strict canary + explicit rollback gate

Pre-upgrade gate checklist

Before applying csf -u on a production node:

  • Out-of-band access confirmed (IPMI/console/serial/provider rescue)
  • /etc/csf/ backup captured
  • trusted admin IPs verified in csf.allow (and csf.ignore if required)
  • current version and key config values recorded
  • rollout order and blast radius agreed (canary first)

Baseline capture (before change)

# 1) Version and key config
csf -v
grep -E '^(TESTING|IPV6|LF_IPSET|DENY_IP_LIMIT|DENY_TEMP_IP_LIMIT|LF_TRIGGER|LF_SELECT|CT_LIMIT|PORTFLOOD|CONNLIMIT|MESSENGER|MESSENGERV3|CF_ENABLE|CLUSTER_)' /etc/csf/csf.conf

# 2) Backup config and lists
backup_dir="/root/csf-backup-$(date +%F-%H%M%S)"
mkdir -p "$backup_dir"
cp -a /etc/csf "$backup_dir/"

# 3) Baseline behavior snapshots
csf -t > "$backup_dir/temp-blocks.before.txt"
iptables -S > "$backup_dir/iptables.before.txt" 2>/dev/null || true
ip6tables -S > "$backup_dir/ip6tables.before.txt" 2>/dev/null || true

Recommended rollout workflow

Phase 1 — Canary

  1. Upgrade one representative node:
csf -u
csf -ra
  1. Validate (see post-upgrade checklist below).
  2. Observe for a full business cycle where possible (peak and off-peak traffic).

Phase 2 — Controlled wave

  • Expand to a small subset of similar-role nodes.
  • Re-check false positives/alerts and reload timing.

Phase 3 — Full rollout

  • Only after canary/wave are stable.
  • Keep emergency rollback path active until verification complete.

Post-upgrade validation checklist

# service and parser health
systemctl status lfd 2>/dev/null || service lfd status
tail -n 200 /var/log/lfd.log

# firewall rules and connectivity
csf -l
csf -l6

# optional: compare rule count against baseline
iptables -S | wc -l
ip6tables -S | wc -l

Confirm:

  • trusted admin access still works
  • expected services reachable (IPv4 + IPv6 where enabled)
  • no sudden false-positive spike
  • no repeated restart/test failures (Messenger/UI/integration hooks)

High-risk areas to inspect after upgrades

Prioritize focused checks if release notes touch:

  1. Regex/detection changes
    • login tracking, panel auth, mod_security parsing
  2. Firewall backend behavior
    • iptables/ip6tables/nft path and module compatibility
  3. Messenger/UI paths
    • generated include files, web-server test/restart hooks
  4. Integration features
    • Cloudflare trigger behavior, clustering transport/config controls
  5. CC/blocklist handling
    • large list performance, IPSET behavior, CIDR filtering impact

Rollback strategy (fast operational fallback)

If the upgrade causes instability:

  1. Stop iterative experiments over SSH.
  2. Use console/OOB channel.
  3. Restore known-good config backup from /etc/csf snapshot.
  4. Reload safely:
csf -ra
  1. If access remains unstable, temporarily reduce enforcement (TESTING="1" or controlled flush/disable) until root cause is isolated.

Downgrading binary/package version is environment-specific. Keep previous installer artifacts and change records if strict rollback to prior release is required.

Upgrade decision matrix

Situation Decision
Security fix with active exploit relevance fast-track with strict canary
Detection/parser behavior changes only canary + staged rollout
UI-only or docs-only changes regular maintenance window
Mixed backend + detection changes full R3 process with explicit rollback gate

See also

Last reviewed: 2026-02-27


← Install & Migrate · FAQ

Clone this wiki locally