Commit Graph

123 Commits

Author SHA1 Message Date
Peter Müller
66c3619872 Early spring clean: Remove trailing whitespaces, and correct licence headers
Bumping across one of our scripts with very long trailing whitespaces, I
thought it might be a good idea to clean these up. Doing so, some
missing or inconsistent licence headers were fixed.

There is no need in shipping all these files en bloc, as their
functionality won't change.

Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
2022-02-18 23:54:57 +00:00
Stefan Schantl
0341e11fe1 fwhosts.cgi: Fix check to limit amount of ports in custom service groups.
iptables multiport only supports up to 15 elements for each protocol (TCP or UDP).
That can be single ports or portranges (they count doubble).

This commit extends the check to calculate the amount of used TCP and/or
UDP ports of all existing entries in a group, by increasing the amount
for the service which should be added.

If the amount of ports for TCP or UDP ports become greater than the
limit of 15 the error message will be displayed.

Fixes #11323.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Reviewed-by: Michael Tremer <michael.tremer@ipfire.org>
Reviewed-by: Bernhard Bitsch <bbitsch@ipfire.org>
2021-11-19 07:13:42 +01:00
Peter Müller
6f36132e68 fwhosts.cgi: properly fetch configured IPsec N2N subnets
Previously, the getcolor() function did not correctly process IPsec
N2N connections with more than one remote network configured, resulting
in networks mistakenly marked as being part of a VPN connection, or vice
versa.

Fixes: #11235

Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
Acked-by: Stefan Schantl <stefan.schantl@ipfire.org>
Reviewed-by: Michael Tremer <michael.tremer@ipfire.org>
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2021-08-09 07:50:57 +00:00
Michael Tremer
0b0e6d586b fwhosts.cgi: Use new system methods
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2021-06-10 14:30:53 +01:00
Jonatan Schlag
8186b37230 Hardcode theme to ipfire
This disables the theme support and makes it impossible to use any other
themes than the ipfire default theme.

The only intention of this patch is to hardcode the theme to ipfire.
To change any cgi we have is an ugly way, but the only way to do this
fast. The colour handling needs certainly to be improved as well, but
this will and should be done in other patches.

Signed-off-by: Jonatan Schlag <jonatan.schlag@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2021-04-08 10:11:34 +00:00
Stefan Schantl
d3f7af8144 fwhosts.cgi: Fix function call.
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2020-06-13 19:10:38 +02:00
Stefan Schantl
9aadc465a3 fwhosts.cgi: Rework code to use location-functions.pl
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2020-06-12 19:46:24 +02:00
Alexander Marx
2754623fa9 BUG11825: firewall: Renaming a network/host group doesn't update rules
Code only changed field 6 of hash (target group) and not field 4 (source group).
Also if using geoip it was only field 4 of hash (source group) and not field 6 of hash (target group)
Added new code that changes both fields to reflect the change in the firewallrules immediately.

fixes: #11825

Signed-off-by: Alexander Marx <alexander.marx@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2018-08-24 11:44:45 +01:00
Alexander Marx
6d92ee11de BUG11559: fwhosts
When creating firewallrules or using firewall groups,
it should be possible to select a single IpSec subnet if there is more than one.

This patch adds the changes to the firewall groups.
Signed-off-by: Alexander Marx <alexander.marx@ipfire.org>
Tested-by: Peter Müller <peter.mueller@link38.eu>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2018-05-09 14:48:46 +01:00
Peter Müller
40a930bda5 BUG:11312 Fix renaming GeoIP groups
When renaming a GeoIP Group, the corresponding names in
firewallrules (if any) are not changed accordingly. Now
when changing a GeoIP Group the firewallrules are renamed
correctly.

Slightly improved first version of this patch (contained
a blank line with trailing whitespace). No functionality
changed, patch has been confirmed as working correctly.

Fixes: #11312
Signed-off-by: Peter Müller <peter.mueller@link38.eu>
Signed-off-by: Alexander Marx <alexander.marx@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2018-04-27 11:04:05 +01:00
Alexander Marx
e924369706 Delete unused function from fwhosts.cgi
This function is not used by any other script.

Signed-off-by: Alexander Marx <alexander.marx@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2017-06-14 15:52:33 +01:00
Alexander Marx
b7ab17ad83 BUG11278: It is not possible to create subnets of internal networks in firewallgroups
Fixes: #11278

When creating networks which are part of an internal network, there was an errormessage displayed and the creation was prohibited.
Now it is possible to create such subnets. This is used at own risk! Users have to take care of the firewallrule sequence.
It is possible to create situations that are not wanted.

Signed-off-by: Alexander Marx <alexander.marx@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2017-06-07 17:19:30 +01:00
Alexander Marx
bc4a68812b BUG11242: Fix for adding 2 VPN Hosts/network with same name
If one has an IPSec network named "aaa" and an OpenVPn Host with the same name
it was not possible to group them together because of the same name.
Now the Network type is also checked wich allows Entries with same name, but different networks.

Fixes: #11242

Signed-off-by: Alexander Marx <alexander.marx@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2016-11-17 14:11:50 +00:00
Alexander Marx
f770b72899 BUG10940: remove leading zeros in ip address
in firewallgroups (hosts) an error was created when using ip adresses
like 192.168.000.008. Now all leading zeros are deleted in
firewallgroups and in the firewall itself when using single ip addresses
as source or target.

Signed-off-by: Alexander Marx <alexander.marx@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2015-11-09 17:32:59 +00:00
Stefan Schantl
1ed8aedfdb fwhosts.cgi: Fix fw-reload detection when adding new entries to a geoip group.
Read-in firewall config files for detection if the current group is used
by at least one firewall rule and mark the firewall to need a reload if
neccessary.

Fixes #10771.
2015-03-15 11:41:50 +01:00
Stefan Schantl
93bfe63d55 Merge branch 'seventeen-geoip' into next-geoip 2015-03-15 11:38:45 +01:00
Alexander Marx
85abeb1376 BUG10753: Fix servicegroups to have only max. 15 services per protocol 2015-02-25 08:09:05 +01:00
Stefan Schantl
4313aa18e9 fwhosts.cgi: Add support for GeoIP groups. 2015-02-08 13:37:06 +01:00
Michael Tremer
b14e0f7d0e Merge remote-tracking branch 'amarx/fw-checksubnet' into next 2014-09-26 12:59:26 +02:00
Michael Tremer
df6649b0fe Merge remote-tracking branch 'amarx/firewall-dnat' into next
Conflicts:
	config/firewall/rules.pl
2014-09-26 12:55:55 +02:00
Alexander Marx
d8cc443938 fw-groups: fix language strings 2014-09-19 13:44:20 +02:00
Alexander Marx
3928f52b39 fw-groups: cleanup checksubnets
Now the checksubnets function from general-functions.pl is used.
2014-09-05 08:09:54 +02:00
Alexander Marx
48f07c1957 Firewall: make DNAT only accessible from selected source network
We added RED to the standard networks and now portforwardings are only
useable from the selected source. If selected "all" the portforwarding
can be used from any internal network. Else the access is only grnated
from the selected source network.
2014-07-18 08:44:45 +02:00
Dominik Hassler
6ace85e360 - bugfix: allow subnets of green/blue/orange/red as network group 2014-07-09 23:51:01 +02:00
Alexander Marx
7fa1b16e5d Firewall: Fix slow generation of host table in firewall groups 2014-05-07 12:13:13 +02:00
Alexander Marx
bc595f0985 Firewall: Bug10513 2014-04-17 12:38:59 +02:00
Alexander Marx
eae92b2baf Firewall: Bug 10514 fixed 2014-04-14 23:16:59 +02:00
Alexander Marx
1ccfb89eab Firewall: fix coloring of internet hosts 2014-04-07 16:53:01 +02:00
Alexander Marx
a72ae687c6 Firewall: Bugfix: Remark in hostgroups and servicegroups was not changeable
Another Bugfix: Layout of hostgroups was broken when more than 1 vpn
connection is defined. There where dropdownboxes for every vpn
connection instead of only one
2014-03-17 14:09:17 +01:00
Alexander Marx
dadffbf738 fwhost.cgi: disable "use warnings" 2014-03-13 15:37:33 +01:00
Alexander Marx
40962f9760 Firewall: Bugfix - when creating a new hostgroup, the system checked for existing name in servicegroups instead of hostgroups 2014-03-04 14:40:59 +01:00
Alexander Marx
7429ee78b6 Firewall: Fix oversized Textfields 2014-03-04 14:07:04 +01:00
Alexander Marx
f620fa34df Firewall: Fix Bug 10490 and broken colorization of tables in firewall groups 2014-03-04 11:37:58 +01:00
Alf Høgemark
f8aa06792f cgi-bin: Add title attribute to input type image where missing
Almost all of <input type="image"... has both an alt and a
title attribute, but some are missing title, and when the icon
is not very clear, it makes it harder to understand what the icon
does. By adding title, the browser displays text when mouse pointer
is over the icon.

Also add missing quotes for alt and title attributes where needed.
2014-02-19 18:31:02 +01:00
Alexander Marx
726e688235 Firewallgroups: added untranslated string 'name' 2014-01-29 14:32:34 +01:00
Alexander Marx
b985d3160a FIREWALL: changes column title in firewall-groups from IP Address to IP/MAC Address 2014-01-29 14:32:31 +01:00
Alexander Marx
aeefcc9caa Firewall: modified firewall-groups so that they can be empty even if used in rules
Now one can create a group, use it in a rule and then delete every entry
from the group. (The firewallrule then will be displayed yellow and
disabled).
2014-01-11 12:13:45 +01:00
Alexander Marx
4d74a20df0 Layout of fwhosts title 2014-01-09 16:26:40 +01:00
Alexander Marx
bc8ecbd6ae Layout changes fwhosts.cgi 2014-01-09 15:05:00 +01:00
Alexander Marx
902a15be1d fifteen-theme: made all tables in firewall-groups themeable 2014-01-07 09:34:01 +01:00
Alexander Marx
49da7d7975 Firewall: added check if firewallrules need to be updated when editing services or servicegroups 2014-01-06 14:18:19 +01:00
Alexander Marx
a8b113e73d Firewall: Now servicegroups and networkgroups can be renamed 2013-12-20 12:10:35 +01:00
Alexander Marx
5f037986b7 Firewall: added JS to automatically select radiobuttons in fwhosts 2013-12-20 12:10:03 +01:00
Alexander Marx
484269ceac FIrewall: Rewrote complete counters for firewall-groups (hosts,networks, network-groups) 2013-12-20 12:09:52 +01:00
Alexander Marx
3a162dc14f Firewall: rebuild complete counter procedure in firewall-groups. This way the counters are on the fly generated and stable. also this is a prequisite to the new option that firewall-servicegroups can be rolled out by installation 2013-12-10 12:21:48 +01:00
Alexander Marx
fe2bae3b74 Firewall: Fix BETA8 - It was not possible to delete single services from servicegroups 2013-12-09 09:33:21 +01:00
Alexander Marx
82b837cff8 Firewall: Added new feature: Now protocols can be added to servicegroups (GRE,AH,ESP,IPIP,IPV6) 2013-12-06 08:47:11 +01:00
Alexander Marx
7db6ad6acb Firewall: appended check of maximum ports per protocol. portranges 100:200 count as 2 ports 2013-11-13 00:34:08 +01:00
Alexander Marx
49192c7b31 Firewall: The maximum of definable services in a servicegroup is limited to 13 per protocol (tcp,udp) because iptables can only handle max 13 services in Multiport 2013-11-13 00:33:46 +01:00
Alexander Marx
f8cbcb7c8a Firewall: Bugfix: When creating a servcie in firewall-groups and selecting a protocol other than icmp, the enty in the ruletable shows correct values PLUS the "all icmp-types" under ICMP.
Now the ICMP FIeld is emtpy when selecting another protocol than icmp
2013-11-08 13:41:06 +01:00