ufw

ufw show added command

Bug #987784 reported by Stanislav German-Evtushenko
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
ufw
Fix Released
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

Revision history for this message
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
Revision history for this message
Jamie Strandboge (jdstrand) wrote :

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

Revision history for this message
Stanislav German-Evtushenko (giner) wrote :

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!

Revision history for this message
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
Revision history for this message
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
Revision history for this message
Jamie Strandboge (jdstrand) wrote :

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

Changed in ufw:
status: In Progress → Fix Committed
Revision history for this message
Stanislav German-Evtushenko (giner) wrote :

Thanks a lot!

Revision history for this message
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  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.