Skip to content

fix(nft): command compatibility hotfix — 3 broken patterns (v1.87.2)#427

Merged
itcmsgr merged 3 commits intomainfrom
fix/nft-command-compatibility
Apr 15, 2026
Merged

fix(nft): command compatibility hotfix — 3 broken patterns (v1.87.2)#427
itcmsgr merged 3 commits intomainfrom
fix/nft-command-compatibility

Conversation

@itcmsgr
Copy link
Copy Markdown
Owner

@itcmsgr itcmsgr commented Apr 15, 2026

3 broken nft command patterns fixed across 8 locations (Go + shell).

Rule: list <plural> <family> <table> = broken on v1.0.x-v1.1.x.
Fix: global or singular forms, filter in code.

Verified: counters working, 27/27 CLI pass, both AlmaLinux + Ubuntu.

🤖 Generated with Claude Code

…87.2)

Three nft command patterns broken on fleet nftables v1.0.2-v1.1.1:
- `nft list counters <family> <table>` — BROKEN
- `nft list chains <family> <table>` — BROKEN
- `nft list sets <family> <table>` — BROKEN

The rule: `list <plural> <family> <table>` = broken.
The fix: use global or singular forms, filter in code.

Go fixes:
- rule_counters.go: single `nft -j list counters` (global), filter
  by family+table in parseNamedCountersJSONFiltered(). Single nft
  call for both families. Prometheus path also fixed.
- evidence_chains.go: `nft list table <family> nftban` instead of
  broken `nft list chains <family> nftban`.

Shell fixes:
- cmd_stats.sh: `nft -j list counters` + jq filter for drop/exceeded
  counters only (not all counters — that was summing accepts too).
- cmd_firewall.sh: `nft list table $table` instead of broken
  `nft list sets/chains $table`. Single dump, extract both.
- nft_crosscheck.sh: `nft list table` for set iteration.

2 new tests: parseNamedCountersJSONFiltered with mixed families +
foreign table exclusion.

Verified: counters now show real enforcement data on both AlmaLinux
and Ubuntu. 27/27 CLI runtime pass on both distros.

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

github-actions Bot commented Apr 15, 2026

Dependency Review

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

Scanned Files

None

@itcmsgr itcmsgr force-pushed the fix/nft-command-compatibility branch from 9839720 to c130263 Compare April 15, 2026 21:31
Comment thread internal/metrics/rule_counters.go
Comment thread internal/metrics/rule_counters.go
@itcmsgr itcmsgr merged commit be8ddd6 into main Apr 15, 2026
47 of 48 checks passed
@itcmsgr itcmsgr deleted the fix/nft-command-compatibility branch April 15, 2026 21:37
itcmsgr added a commit that referenced this pull request Apr 15, 2026
3 broken nft command patterns fixed across 8 locations.
Counter evidence now working on all fleet hosts.

PR: #427.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
itcmsgr added a commit that referenced this pull request Apr 16, 2026
3 broken nft command patterns fixed across 8 locations.
Counter evidence now working on all fleet hosts.

PR: #427.

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.

2 participants