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.
[appname]
title=1-liner here
description=a longer line here
ports=1,2,3,4,5,6,7,8,9,10,30/tcp|50/udp|53
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:
[puppet]
title=puppet configuration manager
description=Puppet Open Source from http://www.puppetlabs.com/
ports=80,443,8140/tcp
[AMANDA]
title=AMANDA Backup
description=AMANDA the Advanced Maryland Automatic Network Disk Archiver
ports=10080
You can list multiple versions of the app in a single file, like this one from apache:
===start of apache2.2-common file===
[Apache]
title=Web Server
description=Apache v2 is the next generation of the omnipresent Apache web server.
ports=80/tcp
[Apache Secure]
title=Web Server (HTTPS)
description=Apache v2 is the next generation of the omnipresent Apache web server.
ports=443/tcp
[Apache Full]
title=Web Server (HTTP,HTTPS)
description=Apache v2 is the next generation of the omnipresent Apache web server.
ports=80,443/tcp
===end of file===
Once you have defined your application file, put it in /etc/ufw/applications.d, then tell ufw to reload the application definitions with
ufw app update appname
ufw app info appname
Use it with something like:
ufw allow from 192.168.1.10 to any app amanda
ufw allow amanda
assuming 192.168.1.10 is the IP of your amanda server.
xx/tcp|yy/udp. In other words, the separation between protocols should be a pipe, not a comma like in your example – Hilikus Jul 07 '15 at 05:24netstatto find the application name...is that right? It worked for me at least. Is it case sensitive? I'm not really sure what the relationship is between the "appname" in the application file vs. the title vs. the process name, etc. – intcreator Mar 08 '18 at 22:50xx/tcp,xy/tcp,xz/tcporxx/tcp|xy/tcp|xz/tcp– errolflynn May 21 '19 at 16:45ports=1|2|3|4|5/udp|6/udp|7|8/tcp|9/tcp|10|30/tcp|50/udp|53– Micah Henning May 14 '20 at 00:151,2/tcpmeans port 1 and 2 are both TCP. To specify another port list with a different protocol, use the pipe.1,2/tcp|3,4/udp. – Gerard ONeill Sep 03 '24 at 18:10