Skip to content

feat: grouped firewall rules view - #7

Merged
Jamkris merged 2 commits into
mainfrom
feat/firewall-grouped-view
Jul 10, 2026
Merged

feat: grouped firewall rules view#7
Jamkris merged 2 commits into
mainfrom
feat/firewall-grouped-view

Conversation

@Jamkris

@Jamkris Jamkris commented Jul 10, 2026

Copy link
Copy Markdown
Owner

Summary

Large rulesets (1000+ rules) were one flat table. This groups rules by table → chain in collapsible sections.

  • bastion/fwview.py group_rules_by_table() — pure grouping (sorted by family/table; chains in ruleset order), fully tested.
  • Firewall rules render as <details> per table (auto-open when ≤3 tables), each with per-chain subsections and readable expressions.
  • A filter that hides non-matching rows and auto-opens/collapses the groups with matches.

Test plan

  • python -m pytest -q → 169 passed. New: tests/test_fwview.py + a grouped-render web test.

Summary by cubic

Groups firewall rules by table and chain into collapsible sections, with a smart filter that auto-expands matches and restores default collapse when cleared. Adds visible row separators to make large rulesets easier to scan.

  • New Features

    • Added group_rules_by_table() in bastion/fwview.py (sorted by family/table; preserves chain order).
    • Firewall view renders one
      Details per table with per-chain subsections; auto-opens when ≤3. Filter hides non-matching rows and auto-opens matches.
  • Bug Fixes

    • Clearing the filter restores each table’s default open/closed state.
    • Added visible row separators in grouped tables for readability.

Written for commit 31f5c67. Summary will update on new commits.

Review in cubic

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 7 files

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread bastion/web/templates/views/firewall.html Outdated
Comment thread bastion/web/templates/base.html Outdated
@Jamkris
Jamkris merged commit 831f849 into main Jul 10, 2026
4 checks passed
@Jamkris
Jamkris deleted the feat/firewall-grouped-view branch July 10, 2026 03:45
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