Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

T6188: add description to show firewall (backport #3219) #3264

Merged
merged 4 commits into from
Apr 6, 2024

Conversation

mergify[bot]
Copy link
Contributor

@mergify mergify bot commented Apr 6, 2024

Change Summary

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes)
  • Migration from an old Vyatta component to vyos-1x, please link to related PR inside obsoleted component
  • Other (please describe):

Related Task(s)

https://vyos.dev/T6188

Related PR(s)

Component(s) name

src/op_mode/firewall.py

Proposed changes

This change adds the Firewall Description that exists under the rules config as a column in "show firewall" op-mode commands.

Description column was added for these commands and their subsections:

show firewall statistics
show firewall groups
show firewall <family>

Detail view was added for these commands:

show firewall bridge forward filter detail
show firewall bridge forward filter rule <rule#> detail
show firewall bridge name <chain> detail
show firewall bridge name <chain> rule <rule#> detail

show firewall ipv4 forward filter detail
show firewall ipv4 forward filter rule <rule#> detail
show firewall ipv4 input filter detail
show firewall ipv4 input filter rule <rule#> detail
show firewall ipv4 output filter detail
show firewall ipv4 output filter rule <rule#> detail
show firewall ipv4 name <chain> detail
show firewall ipv4 name <chain> rule <rule#> detail

show firewall ipv6 forward filter detail
show firewall ipv6 forward filter rule <rule#> detail
show firewall ipv6 input filter detail
show firewall ipv6 input filter rule <rule#> detail
show firewall ipv6 output filter detail
show firewall ipv6 output filter rule <rule#> detail
show firewall ipv6 name <chain> detail
show firewall ipv6 name <chain> rule <rule#> detail

show firewall group detail
show firewall group <group> detail

How to test

Type "show firewall" command(s):

l0crian@R86S:~$ show firewall ipv4 forward filter rule 20
Rule Information

---------------------------------
ipv4 Firewall "forward filter"

Rule     Description    Action    Protocol      Packets    Bytes  Conditions
-------  -------------  --------  ----------  ---------  -------  -----------------------------------------------------------------------
20       Bogons         drop      all                 0        0  ip daddr @N_BOGONS oifname "eth0.4040"  prefix "[ipv4-FWD-filter-20-D]"
default                 drop      all                 0        0

Type "show firewall" command with detail option available:

l0crian@R86S:~$ show firewall ipv4 forward filter rule 20 detail
Rule Information

---------------------------------
ipv4 Firewall "forward filter"

 Rule        | 20
 Description | Bogons
 Action      | drop
 Protocol    | all
 Packets     | 0
 Bytes       | 0
 Conditions  | ip daddr @N_BOGONS oifname "eth0.4040"  prefix "[ipv4-FWD-filter-20-D]"

-->

Smoketest result

  • I have read the CONTRIBUTING document
  • I have linked this PR to one or more Phabricator Task(s)
  • I have run the components SMOKETESTS if applicable
  • My commit headlines contain a valid Task id
  • My change requires a change to the documentation
  • I have updated the documentation accordingly

This is an automatic backport of pull request #3219 done by [Mergify](https://mergify.com).

l0crian1 and others added 4 commits April 6, 2024 09:57
      - Added show firewall <sections> detail paths
	modified:   src/op_mode/firewall.py
      - Added Description as a header to normal "show firewall" commands
      - Added 'detail' view which shows the output in a list key-pair format
Description column was added for these commands and their subsections:
show firewall statistics
show firewall groups
show firewall <family>

Detail view was added for these commands:
show firewall bridge forward filter detail
show firewall bridge forward filter rule <rule#> detail
show firewall bridge name <chain> detail
show firewall bridge name <chain> rule <rule#> detail

show firewall ipv4 forward filter detail
show firewall ipv4 forward filter rule <rule#> detail
show firewall ipv4 input filter detail
show firewall ipv4 input filter rule <rule#> detail
show firewall ipv4 output filter detail
show firewall ipv4 output filter rule <rule#> detail
show firewall ipv4 name <chain> detail
show firewall ipv4 name <chain> rule <rule#> detail

show firewall ipv6 forward filter detail
show firewall ipv6 forward filter rule <rule#> detail
show firewall ipv6 input filter detail
show firewall ipv6 input filter rule <rule#> detail
show firewall ipv6 output filter detail
show firewall ipv6 output filter rule <rule#> detail
show firewall ipv6 name <chain> detail
show firewall ipv6 name <chain> rule <rule#> detail

show firewall group detail
show firewall group <group> detail

(cherry picked from commit 025438c)
      - modified:   src/op_mode/firewall.py
Changed behavior of "show firewall" for specific rule to only show rule and not also default-action

(cherry picked from commit a7c5205)
For readability in console sessions, moved the description column to only be shown in the detail view.

Changed wrapping in the detail view for description to 65 characters to prevent full line wrapping in console sessions.

(cherry picked from commit 4dba82c)
@mergify mergify bot mentioned this pull request Apr 6, 2024
12 tasks
@github-actions github-actions bot added the sagitta VyOS 1.4 LTS label Apr 6, 2024
@vyosbot vyosbot requested review from a team, dmbaturin, sarthurdev, zdc, jestabro, sever-sever and c-po and removed request for a team April 6, 2024 09:57
@c-po c-po added the backport label Apr 6, 2024
@dmbaturin dmbaturin merged commit 8280128 into sagitta Apr 6, 2024
4 of 5 checks passed
@mergify mergify bot deleted the mergify/bp/sagitta/pr-3219 branch April 6, 2024 11:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

3 participants