1
0
mirror of https://github.com/fwbuilder/fwbuilder synced 2025-10-15 23:18:51 +02:00

159 Commits

Author SHA1 Message Date
Vadim Kurland
739edc8c35 fixes #2674 NAT compiler for PF crashed when AttachedNetworks
object was used in Translated Source of a NAT rule.
2011-11-30 18:43:18 -08:00
Vadim Kurland
e681556c0f see #2671, #2672
group and addresses table object names" is in effect. This happened if
the same user-defined group was used in multiple rules or different
rule element of the same rule. In this case generated PF table would
have several copies of the same addresses.

not work right when the same object is used in several different
groups. If the same object was a member of multiple groups and these
groups were used in the same or different rules of the same PF
firewall, compiler used all groups in all rules.
2011-11-21 17:55:53 -08:00
Vadim Kurland
734069f16f see #2667
fixed bug (no number) introduced when I was working on #2667.
Setting broadcast address in the network object with netmask /31
to 255.255.255.255 broke rule shadowing algorithm.
2011-11-16 10:47:21 -08:00
Vadim Kurland
7a614b0908 see #2638 "When CARP password is empty the advskew value is not
read". Should skip "pass <word>" parameter of the ifconfig command
that creates carp interface if user did not set up any password.
2011-08-11 16:55:08 -07:00
Vadim Kurland
6e0654aaa6 see #2636 "carp : Incorrect output in rc.conf.local format". Should
use create_args_carp0 instead of ifconfig_carp0 to set up CARP
interface vhid, pass and adskew parameters.
2011-08-08 15:35:25 -07:00
Vadim Kurland
1fd2ac3a95 fixes #2590 "PF: NAT compiler fails when run-time address table object
is used in a rule"
2011-07-21 14:22:40 -07:00
Vadim Kurland
0790bb8509 see #2513 "Group and Address Table name persistence in generated
config". Compiler for PF can now preserve names of object groups,
dynamic groups, compile-time AddressTable and compile-time DNSName
objects in the generated pf.conf file. This is optional and is
controlled by a checkbox in the firewall settings dialog.
2011-07-11 18:43:29 -07:00
Vadim Kurland
bde7cd1043 clear option "prolog_place" in compiler for iosacl to make sure function CompilerDriver::assembleFwScriptInternal() does not get confused if user switched fw platform 2011-07-06 18:06:11 -07:00
Vadim Kurland
0f7f4ed790 added right test files and re-ran tests for PF 2011-07-05 18:06:35 -07:00
Vadim Kurland
021cadf062 better behavior of FWObjectTypedChildIterator::operator--(); deleted test file that should have been recycled but wasnt 2011-07-05 18:00:48 -07:00
Vadim Kurland
531c5a83fe PolicyCompiler_pf_writers.cpp (processNext): see #2549 "Update
generated route-to configuration for PF versions 4.7 and later",
SF bug 3348931. The "route-to" parameter moved to the end of
pass rules in PF 4.7
2011-07-05 14:00:35 -07:00
Vadim Kurland
344a22feed see #2524 'avoid " {tcp udp icmp} " in place of protocol'. NAT
compiler for PF does not need to generate protocol match "proto {tcp
udp icmp}" when service object used in the NAT rule is "any". The
reason this was done this way is lost in the mist of time; it's been
like this since very early versions of fwbuilder.
2011-06-22 11:03:07 -07:00
Vadim Kurland
3a2041d16d per Mikes request, the GUI now opens rule set object of the firewall
when user opens the firewall or any of its children objects in the
editor. This includes any rule set, interface or any other child
object.

Also moved function Interface::getParentHost() from class Interface to
class Host as static FWObject* Host::getParentHost(FWObject *o). Its
behavior is now more logical, it returns non-NULL pointer only if an
object actually has a parent that is host, firewall or cluster. Old
function Interface::getParentHost() returned non-NULL pointer even
when object was not in the proper position in the tree.

Now this function can be used to get parent host/firewall/cluster for
any child object rather than only interface.

I had to fix bunch of problems in unit tests that got uncovered because
new function behaves in a more strict way (returns NULL when there is
no parent of correct type).
2011-06-05 21:38:46 -07:00
Vadim Kurland
33259ebf81 see #2460 added test for the nat rule with multiple objects in TDst; looks like it works 2011-06-03 19:10:40 -07:00
Vadim Kurland
6a9fdbf3af NATCompiler_pf.cpp (_expand_addr): see #2455 NAT Compiler for PF
should use "(interface)" syntax to the right of "->" in NAT rules.
This now works for all interfaces, including those that have ip
addresses in fwbuilder configuration, when interface object appears in
"Translated Source" in a nat rule. When firewall object appears in
"Translated Source", it gets replaced with a set of its interfaces
which also get translated into "-> (interface)".
2011-06-03 18:59:44 -07:00
Vadim Kurland
15bab71f49 * NATCompiler_ipt.cpp (compile): see #2456 Added support for
single object negation in "Inbound Interface" and "Outbound
Interface" columns in compiler for iptables.

* NATCompiler_pf.cpp (compile): see #2456 Added support for single
object negation in "Interface" rule element of PF NAT rules. Now
compiler can produce PF commands such as "nat on ! em0 ... " (for
PF <4.7) or "match on ! em0 ..." (for PF >= 4.7)

* Compiler.cpp (singleObjectNegation::processNext): moved rule
processor that processes single object negation in any rule
element to the base class Compiler.
2011-06-03 17:54:14 -07:00
Vadim Kurland
f9f78fe7bd using "port 1000:*" in PF nat commands 2011-05-30 21:59:40 -07:00
Vadim Kurland
a544492ced see #2434 "PF compiler should use 'self' keyword where
appropriate". Compiler for PF now uses keyword 'self' in rules
where firewall object is used in Source or Destination.
2011-05-26 14:13:26 -07:00
Vadim Kurland
29bf29f892 see #2394 grammar clean-up; creating policy rules in the right ruleset and renumbering rule set in the end 2011-05-26 12:06:50 -07:00
Vadim Kurland
1199fd926a see #2405 "Tag and classify actions dont work properly with branches".
When branching rule points to a rule set that has rules with Tag and
Classify options, branching should occur in mangle table even when
checkbox "create branch in mangle table" is not checked. The fix in
this change is tentative as it creates branch in chains PREROUTING,
POSTROUTING and OUTPUT. Since target CLASSIFY is only allowed in
POSTROUTING, this may create conflict. Need to test more.
2011-05-14 15:46:23 -07:00
Vadim Kurland
7ef3e583e5 see #2367 added test cases for options tag, classify and route and combinations - test object firewall111 2011-05-10 14:57:12 -07:00
Vadim Kurland
61929176e1 see #2367 no need to split iptables rules with option route because it is terminating by default; checking platform in xslt transformation to dtd21 to correctly set action 2011-05-06 18:11:52 -07:00
Vadim Kurland
7f2dbe58e9 See #2367 upgraded all test files to the latest dtd v21 2011-05-06 16:07:55 -07:00
Vadim Kurland
1c5fbb98a5 fixed xslt script dtd20 -> dtd21 to handle pf_classify_terminating properly 2011-05-06 15:10:48 -07:00
Vadim Kurland
8773642198 see #2367 merge from development 2011-05-05 19:16:47 -07:00
Vadim Kurland
e24a73a560 see #2385 "PF action Classify uses
wrong parameter". This change fixes a bug introduced in 4.2.0
that affects rules with action Classify in PF firewalls.
2011-05-05 18:50:32 -07:00
Vadim Kurland
7232a2195b see #2385 bumped XML DTD version to 21 to make room for the transformation to fix bug #2385. That will be done in branch development 2011-05-05 12:01:18 -07:00
Vadim Kurland
c096684c20 see #2367 merged latest changes from development branch; this merged transformation for v18->v19 XML file upgrades; upgraded test files for PF 2011-05-04 16:44:08 -07:00
Vadim Kurland
9ba2dc42ee * RoutingCompiler_ipt.cpp (compile): see #2359 "Crash when
compiling single rule with IPv6 destination and IPv4 gateway or
interface". Routing compiler for iptables does not support ipv6 at
this time and will issue a warning when user tries to place ipv6
address or network in a routing rule. The warning does not appear
when ipv6 address is a member of a group used in the rule. Also
see #1575.
2011-04-19 14:18:33 -07:00
Vadim Kurland
0aa3eac4d4 * Compiler.cpp (expandGroupsInRuleElement): sorting objects in the
rule element by name after group is expanded, this helps ensure
stable ordering of objects in generated configuration.

* Compiler.cpp (replaceClusterInterfaceInItfRE::processNext):
sorting objects in rule element after cluster interfaces have been
replaced, this helps ensure stable ordering of objects in generated
configuration.

* FWObject.h (FWObjectNameCmpPredicate): moved this class from
gui-specific module to libfwbuilder as it is universally useful.
It can compare FWObject objects by name and can optionally can
follow references; it can be used with std::sort() to sort lists
of FWObject pointers or directly sort rule elements.
2011-03-12 19:50:24 -08:00
Vadim Kurland
fd5eb7d8ce see #2220 AutomaticRules classes for ipt and pf 2011-03-12 15:52:09 -08:00
Vadim Kurland
fcd7c7920b re-ran tests for pix 2011-03-12 15:13:57 -08:00
Vadim Kurland
db9584cab5 fixes #2214 2011-03-11 10:40:40 -08:00
Vadim Kurland
7986214d4d re-ran pf tests and updated files 2011-03-10 21:09:54 -08:00
Vadim Kurland
56f81407f1 fixes #2124 some error messages get multiplied when compiler splits rules 2011-02-20 21:32:58 -08:00
Vadim Kurland
2b342aa67d see #2057 detection of loops in branching rules ; see #2124 some error messages appeared multiple times in generated script 2011-02-20 20:12:18 -08:00
Vadim Kurland
344010c873 see #1920 Setting host interface to unnumbered after it has been assigned IP address doesnt have desired effect 2011-02-20 18:11:16 -08:00
Vadim Kurland
6f5f1ac075 fixes #153 Deprecate Rule::getInterfaceStr() fixes #2123 deprecate rule processor convertInterfaceIdToStr 2011-02-20 17:27:24 -08:00
Vadim Kurland
aea53d35eb see #2116 "When CARP interface IP address cant be assigned error or warning should appear". Script should abort if command trying to add an ip address to an interface fails 2011-02-19 15:33:30 -08:00
Vadim Kurland
a8b65e6506 getting rid of sprintf where I can 2011-02-18 22:09:50 -08:00
Vadim Kurland
66681b9695 see #153 #133 got rid of getInterfaceStr and getInterfaceId in policy and nat compilers for PF 2011-02-18 18:54:21 -08:00
Vadim Kurland
faece9e40c see #2097 more test cases with negation and vlan interfaces 2011-02-17 18:39:17 -08:00
Vadim Kurland
581ccdc68e see #2097 #133 additional test cases 2011-02-17 18:01:45 -08:00
Vadim Kurland
5162212073 see #2097 #133 : no need to replace cluster interfaces with member interfaces in NATCompiler_pf::AssignInterface::processNext() since it was already done in replaceClusterInterfaceInItfOutb 2011-02-17 15:36:28 -08:00
Vadim Kurland
100dca74bb * NATCompiler_pf.cpp (processNext): see #133. MErged code from the
branch, running tests. Making sure rules that have firewall
object in ODst and interface columnblank end up with rdr command
without "on interface" clause as before.
2011-02-17 11:50:14 -08:00
Vadim Kurland
8b158c0a74 * OSConfigurator_bsd_interfaces.cpp (configureInterfaces): make
sure we print "ifconfig" commands for mtu and other parameters for
all interfaces, including those with no ip addresses and bridge
ports (unnumbered interfaces used to be skipped before)
2011-02-16 16:23:54 -08:00
Vadim Kurland
8de52b3f06 fixes #2093 build failed because function QStringList::removeDuplicates() is only available in Qt 4.5 2011-02-16 15:49:02 -08:00
Vadim Kurland
1f8363c84e * configlets/bsd/update_vlans: see #2105: generated script now
supports vlan interfaces with names that do not match vlan IDs
(OpenBSD, FreeBSD, shell script format).
2011-02-16 15:22:47 -08:00
Vadim Kurland
f4858bfc83 fixes #2106 avoid adding pfsync_enable line if it is not needed in rc.conf format 2011-02-16 14:47:10 -08:00
Vadim Kurland
a58445ed16 see #1807, #2104 arrange interface configuration commands in the
generated scritpt in such order that bridge and carp interfaces
are configured after all other interfaces are done.
2011-02-16 14:42:06 -08:00