ufw

ufw show added command

Bug #987784 reported by Stanislav German-Evtushenko on 2012-04-24
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
ufw
Wishlist
Jamie Strandboge

Bug Description

Hello all,

I'd like to suggest implementing "ufw list" command which prints rules in the same way ufw adds them. It would simplify the usage a lot. For example:

$ ufw reject out to 10.10.10.10 port 8080
Rule added
$ ufw reject out to 10.10.10.20 port 8000
Rule added

$ ufw list
ufw reject out to 10.10.10.10 port 8080
ufw reject out to 10.10.10.20 port 8000

$ ufw list numbered
1 ufw reject out to 10.10.10.10 port 8080
2 ufw reject out to 10.10.10.20 port 8000

Best regards,
Stanislav

Related branches

Jamie Strandboge (jdstrand) wrote :

Thank you for using ufw and filing a bug. I don't understand how this would be better than 'ufw status'. In fact, ufw status actually does this so long as you don't use 'insert' (noting that v4 and v6 rules are kept in separate lists).

Changed in ufw:
assignee: nobody → Jamie Strandboge (jdstrand)
status: New → Incomplete
Jamie Strandboge (jdstrand) wrote :

Can you explain how this would work differently than status and why it would be beneficial?

Yes, sure I can.

I added the rule yesterday and today I have to remove it. In order to do that I run "ufw status" and get:
********************
$ sudo ufw status
Status: active

To Action From
-- ------ ----
10.10.10.10 8080 REJECT Anywhere
********************
After that I start to think how to build command line to delete that rule and it takes a couple of minute.

If we able to use "ufw list" command we just run "ufw list" and get:

ufw reject out to 10.10.10.10 port 8080
... and add "delete" to the line
ufw delete reject out to 10.10.10.10 port 8080
... DONE!

Anders Jackson (anders-jackson) wrote :

I do think that the explanatin in #3 is a good one to make this addition.

I would drop the ufw-part, though, but the rest make it easier to read.
So I do agree that with the same format for output as on the command line, it would be easier for beginners and us who doesn't use ufw that often to manage ufw rules. But it depend how hard it is to interpret and generate.

Changed in ufw:
status: Incomplete → Triaged
importance: Undecided → Wishlist
assignee: Jamie Strandboge (jdstrand) → nobody
Jamie Strandboge (jdstrand) wrote :

Ok, I started implementing this. Rather than calling it 'ufw list', I added the functionality as a 'show' subcommand. Eg:
$ /usr/sbin/ufw show added
Added rules (user):
ufw allow 22
ufw allow to 192.68.0.2
ufw allow 23
ufw allow 24
ufw allow to ::1

Note that because this is generated via parsing the /lib/ufw/user*.rules file, the reconstructed order is an approximation of the actual order (but equivalent).

summary: - ufw list command
+ ufw show added command
Changed in ufw:
assignee: nobody → Jamie Strandboge (jdstrand)
status: Triaged → In Progress
Jamie Strandboge (jdstrand) wrote :

This is committed to trunk and should be in ufw 0.33.

Changed in ufw:
status: In Progress → Fix Committed

Thanks a lot!

Jamie Strandboge (jdstrand) wrote :

This is now in ufw 0.33.

Changed in ufw:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers