ufw

[feature request] UFW export/import function

Bug #1861168 reported by Frank
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
ufw
Confirmed
Wishlist
Unassigned

Bug Description

Hello, is it possible to implement an export/import feature into UFW? This would increase the user friendliness of the program for people that are less handy with linux and firewalls. I also read the manpage of UFW but couldn't find where the configuration files are located, I had to go to stackoverflow to find the answer.

A use case would be, user installs ufw and adds rules(e.g. 80, 8080, 443, 22, 3306), user exports the firewall configuration to a desired folder (ufw export ./firewall rules/export 28-01-2020.log), user logs in to second device with ufw installed and runs ufw import /firewall rules/export 28-01-2020.log.

the "Export" feature is simply a command that copies the correct configuration files(even if ufw changes the location of the file) to a desired location, that way users don't have to dig into the filesystem to find the configuration files of ufw.

Frank (f2b-owesome)
affects: ufw (Ubuntu) → ufw
Changed in ufw:
importance: Undecided → Wishlist
Revision history for this message
Jamie Strandboge (jdstrand) wrote :

This is technically possible for simple cases, but error prone when people modify the before/after.rules files directly. If the two systems have the same version of ufw installed, one can:

$ sudo tar -zcvf ./ufw-backup.tar.gz /etc/default/ufw /etc/ufw

Then on the remote system:
$ sudo ufw disable
$ sudo tar -C / -zxvpf ./ufw-backup.tar.gz
$ sudo ufw enable

Changed in ufw:
status: New → Confirmed
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.