Skip to content

feat(cleanup): decommission fail2ban as active data source#436

Closed
itcmsgr wants to merge 3 commits intomainfrom
feat/p91d-fail2ban-decommission
Closed

feat(cleanup): decommission fail2ban as active data source#436
itcmsgr wants to merge 3 commits intomainfrom
feat/p91d-fail2ban-decommission

Conversation

@itcmsgr
Copy link
Copy Markdown
Owner

@itcmsgr itcmsgr commented Apr 16, 2026

Summary

  • Remove fail2ban as an ingestion/analytics dimension
  • No active code path produces fail2ban data (verified: zero writers)
  • Conflict detection code is explicitly KEPT (required for safe install)

Removed

File What Lines
analytics/types.go Jail field + ByJail map 2
analytics/state.go Legacy jail comment 1
banlog/banlog.go SourceFail2ban constant + case "fail2ban" 3
handlers_analytics.go case "fail2ban" display mapping 2
metrics-registry.json "fail2ban" from health_status labels 1

Kept (conflict detection)

  • nftban_firewall_conflicts.sh (~50 refs)
  • nftban_checks.sh, cmd_firewall.sh, cmd_health_analysis.sh
  • nftbanconf/services.go Fail2banService field

Test plan

  • grep -rn 'SourceFail2ban' internal/ → 0 matches
  • grep -rn '\.Jail\b' internal/analytics/ → 0 matches
  • grep -rn 'ByJail' internal/analytics/ → 0 matches
  • grep -c 'fail2ban' cli/lib/nftban/core/nftban_firewall_conflicts.sh → still ~50
  • Go builds clean, all tests pass

Ref: V191_FAIL2BAN_DECOMMISSION_PLAN.md

🤖 Generated with Claude Code

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>
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 16, 2026

Dependency Review

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

Scanned Files

None

itcmsgr and others added 2 commits April 16, 2026 19:47
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>
@itcmsgr
Copy link
Copy Markdown
Owner Author

itcmsgr commented Apr 16, 2026

Superseded by #437 (combined v1.91 PR)

@itcmsgr itcmsgr closed this Apr 16, 2026
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