From: David Mulder Date: Wed, 6 Oct 2021 18:46:26 +0000 (-0600) Subject: gp: Add Firewalld ADMX templates X-Git-Tag: ldb-2.5.0~361 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7253405c35247dff192e86598b18d524e1602818;p=thirdparty%2Fsamba.git gp: Add Firewalld ADMX templates Signed-off-by: David Mulder Reviewed-by: Andreas Schneider --- diff --git a/libgpo/admx/en-US/samba.adml b/libgpo/admx/en-US/samba.adml index a954c41a7d0..ad3a37ca142 100755 --- a/libgpo/admx/en-US/samba.adml +++ b/libgpo/admx/en-US/samba.adml @@ -3124,12 +3124,84 @@ Example: 192.9.200.1 192.168.2.61 u Insert the number of current users logged in. - U Insert the string "1 user" or "<n> users" where <n> is the number of current users logged in. - - v Insert the version of the OS, that is, the build-date and such. - - - + U Insert the string "1 user" or "<n> users" where <n> is the number of current users logged in. + + v Insert the version of the OS, that is, the build-date and such. + Firewalld + Zones + A list of zones to create. Existing zones on the host will be unaffected. + +Rule creation for zones is handled in the Rules setting. + Rules + A JSON dictionary, containing zones paired with a list of rules. + +For example, to create rules for the Work and Home zones, specify the following JSON: + +{ + "work": [ + {"rule": {"family": "ipv4"}, "source address": "172.25.1.7", "service name": "ftp", "reject": {}}, + {"rule": {}, "source address": "172.25.1.8", "service name": "ftp", "reject": {}} + ], + "home": [ + {"rule": {}, "protocol value": "icmp", "reject": {}}, + {"rule": {"family": "ipv4"}, "source address": "192.168.1.2/32", "service name": "telnet", "accept": {"limit value": "1/m"}} + ] +} + +An improperly formatted JSON will be ignored. + +The rule structure loosely follows the Firewalld Rich Language Documentation. + +General rule structure: +{ + "rule": { + "family": "ipv4 | ipv6", + "priority": "priority" + }, + "source [not] address | mac | ipset": "address[/mask] | mac-address | ipset", + "destination [not] adress": "address[/mask]", + "service name": "service name", + "port": { + "port": "port value", + "protocol": "tcp | udp" + } + "protocol value": "protocol value", + "icmp-block name": "icmptype name", + "Masquerade": true|false, + "icmp-type": "icmptype name", + "forward-port": { + "port": "port value", + "protocol": "tcp | udp", + "to-port": "port value", + "to-addr": "address" + }, + "source-port": { + "port": "port value", + "protocol": "tcp | udp" + }, + "log": { + "prefix": "prefix text", + "level": "emerg | alert | crit | error | warning | notice | info | debug", + "limit value": "rate/duration" + }, + "audit": { + "limit value": "rate/duration" + }, + "accept" : { + "limit value": "rate/duration" + } | "reject": { + "type": "reject type", + "limit value": "rate/duration" + } | "drop": { + "limit value": "rate/duration" + } | "mark": { + "set": "mark[/mask]", + "limit value": "rate/duration" + } +} + + + Script and arguments @@ -4642,9 +4714,18 @@ Example: 192.9.200.1 192.168.2.61 - Welcome to \s \r \l - - - - - + Welcome to \s \r \l + + + + Firewalld Zones + + + + + {} + + + + + diff --git a/libgpo/admx/samba.admx b/libgpo/admx/samba.admx index d09956d5394..877c9f2ba23 100755 --- a/libgpo/admx/samba.admx +++ b/libgpo/admx/samba.admx @@ -17,12 +17,15 @@ - - - - - - + + + + + + + + + @@ -2525,8 +2528,22 @@ - - - - - + + + + + + + + + + + + + + + + + + +