Ufw has a command that lists out profiles to which you can further explore their profile definitions
$ ufw app list
And
$ ufw app PROFILE {app profile title}
I was wondering how you can create a profile for an undefined program, like virtual box and have that profile run the same definitions I have given iptables for my Ubuntu distro.
Not only am I trying to use Ubuntus firewall to service my virtual machine. I am also sincerely curious as how to create a profile for an application that doesn't come with one.
To answer the real question, about how to create your own application file, you only need to know that it is using windows INI file format (yuck).
The ports line can specify multiple ports, with /udp or /tcp, to limit the protocol, otherwise it defaults to both. You have to split the protocol sections up with |.
So, for a real-life set of examples I made:
You can list multiple versions of the app in a single file, like this one from apache:
Once you have defined your application file, put it in
/etc/ufw/applications.d
, then tell ufw to reload the application definitions withUse it with something like:
assuming 192.168.1.10 is the IP of your amanda server.
It's actually all there in the manpage under the "Application Integration" section.
The basic syntax is:
Or you can use the extended syntax to be more specific:
The manpage specifically says not to specify a port number:
This probably means it will let
<app_name>
use whatever port it wants to..Other useful commands:
Which lists the information on
<app_name>
's profile.Which updates
<app_name>
's profile. You can useall
to update all application profiles.You can use the:
command to add a new profile for
<app_name>
and update it, following the rules you set out withufw app default <policy>
.App profiles are stored in
/etc/ufw/applications.d
and sometimes/etc/services
.For more information see
man ufw
.