Skip to content

feat: v1.91 pipeline unification + fail2ban decommission#437

Merged
itcmsgr merged 9 commits intomainfrom
feat/v1.91-pipeline-unification
Apr 16, 2026
Merged

feat: v1.91 pipeline unification + fail2ban decommission#437
itcmsgr merged 9 commits intomainfrom
feat/v1.91-pipeline-unification

Conversation

@itcmsgr
Copy link
Copy Markdown
Owner

@itcmsgr itcmsgr commented Apr 16, 2026

Summary

Combined v1.91 release PR — pipeline metric alignment + fail2ban cleanup.

PR-91A: P-8 dot-notation filter

  • Filter invalid dot-notation metrics from Prometheus textfile export

PR-91C: Shell exporter alignment (P-1 through P-7)

  • nftban_goroutinesnftban_runtime_goroutines
  • nftban_conntrack_entriesnftban_conntrack_used
  • nftban_memory_rss_bytesnftban_proc_rss_bytes
  • nftban_watchdog_{cpu,mem,io,net}_scorenftban_pressure_score{dim=X}
  • nftban_watchdog_modenftban_operating_mode{mode=X}
  • nftban_nftables_rules_totalnftban_nft_rules_total

PR-91D: fail2ban decommission

  • Remove dead Jail/ByJail fields, SourceFail2ban constant, parser cases
  • Keep conflict detection (~50 refs in shell)

Lab verification

  • Go build: PASS (lab4 — nftband + nftban-validate + go vet)

Test plan

  • grep -rn 'SourceFail2ban' internal/ → 0
  • grep -rn 'nftban_nftables_rules_total' . → 0 active emitters
  • Go builds clean
  • All CI gates pass

Supersedes: #434, #435, #436

🤖 Generated with Claude Code

itcmsgr and others added 9 commits April 16, 2026 19:31
The shell exporter collects ~25 metrics using Zabbix dot-notation
(nftban.daemon.cpu_percent, nftban.server.load_1m). These are valid
for Zabbix trapper but invalid Prometheus metric names — dots violate
the [a-zA-Z_:][a-zA-Z0-9_:]* pattern.

The export_prometheus() awk filter already strips |STRING| lines but
did not filter dot-notation names. If Prometheus export is enabled,
these would leak into nftban.prom and cause node_exporter parse errors.

Currently a latent defect (NFTBAN_EXPORT_PROMETHEUS defaults to false),
but this closes the gap before anyone enables it.

Pipeline audit finding: P-8
Ref: V191_PIPELINE_INTEGRITY_AUDIT.md

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Unify metric names across all export surfaces to match the daemon
/metrics contract frozen in v1.90.0. The shell exporter is a relay
of daemon vocabulary, not a parallel namespace.

Renames (shell/collector → daemon canonical):
- P-1: nftban_goroutines → nftban_runtime_goroutines
- P-1b: nftban_daemon_goroutines → nftban_runtime_goroutines
- P-2: nftban_conntrack_entries → nftban_conntrack_used
- P-3: nftban_memory_rss_bytes → nftban_proc_rss_bytes
- P-4: nftban_watchdog_{cpu,mem,io,net}_score → nftban_pressure_score{dim=X}
- P-5: nftban_watchdog_mode (integer) → nftban_operating_mode{mode=X} (one-hot)
- P-6: nftban_nftables_rules_total → nftban_nft_rules_total

Updated across: shell exporter, Go collector, dashboards, alerts,
metrics-registry.json, and HELP/TYPE headers.

Pipeline audit: V191_PIPELINE_INTEGRITY_AUDIT.md (P-1 through P-7)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Remove fail2ban as an ingestion/analytics dimension. No active code
path produces fail2ban data — all references were either dead struct
fields, dead parser constants, or phantom label values.

Removed:
- analytics/types.go: Jail field + ByJail map (zero writers)
- analytics/state.go: legacy jail comment
- banlog/banlog.go: SourceFail2ban constant + case "fail2ban" parser
- handlers_analytics.go: case "fail2ban" display mapping
- metrics-registry.json: "fail2ban" from health_status label values

Kept (conflict detection — required for safe install):
- nftban_firewall_conflicts.sh (~50 refs)
- nftban_checks.sh, cmd_firewall.sh, cmd_health_analysis.sh
- nftbanconf/services.go Fail2banService field

Historical bans.log entries with source=fail2ban are preserved as raw
strings — they pass through the default case in NormalizeSource().

Ref: V191_FAIL2BAN_DECOMMISSION_PLAN.md

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The struct literal at state.go:229 still referenced the removed Jail
field, causing go vet to fail.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
cmd_analytics.go also printed the removed Jail field in IP lookup output.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown
Contributor

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

@itcmsgr itcmsgr merged commit 30e00ff into main Apr 16, 2026
48 checks passed
@itcmsgr itcmsgr deleted the feat/v1.91-pipeline-unification branch April 16, 2026 18:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant