Dietmar Maurer [Wed, 21 May 2014 06:59:57 +0000 (08:59 +0200)]
add another test case
Dietmar Maurer [Wed, 21 May 2014 06:56:52 +0000 (08:56 +0200)]
fix for test case test/test-errors1
Dietmar Maurer [Wed, 21 May 2014 06:39:33 +0000 (08:39 +0200)]
add test case to show serious bug
Dietmar Maurer [Wed, 21 May 2014 06:27:55 +0000 (08:27 +0200)]
use GET instead of POST for command that do not change state.
Dietmar Maurer [Wed, 21 May 2014 06:24:07 +0000 (08:24 +0200)]
add new localnet command
Print information about local network (IP/NETWORK/NODENAME).
Dietmar Maurer [Wed, 21 May 2014 05:43:50 +0000 (07:43 +0200)]
rename cluster_network to local_network, introduce local_network alias
So that the user can overwrite it.
Dietmar Maurer [Wed, 21 May 2014 04:48:23 +0000 (06:48 +0200)]
add tests for management ipset
Dietmar Maurer [Wed, 21 May 2014 04:33:55 +0000 (06:33 +0200)]
Introduce new management ipset
The uses can setup a 'management' IPSet to make sure he has access to the GUI
from those IPs.
Dietmar Maurer [Wed, 21 May 2014 04:00:11 +0000 (06:00 +0200)]
do not use ctstate in corosync rule
That is not necessary, because we only reach that rule if ctstate is NEW.
Dietmar Maurer [Tue, 20 May 2014 09:56:06 +0000 (11:56 +0200)]
start alias support for VMs
implement config parser/writer and API. iptables functionatity is missing.
Dietmar Maurer [Tue, 20 May 2014 08:54:51 +0000 (10:54 +0200)]
improve documentation
Dietmar Maurer [Tue, 20 May 2014 08:50:25 +0000 (10:50 +0200)]
do not log simulate warnings to syslog
Dietmar Maurer [Tue, 20 May 2014 08:36:58 +0000 (10:36 +0200)]
add simulate command for easy testing
Dietmar Maurer [Tue, 20 May 2014 07:46:35 +0000 (09:46 +0200)]
move test code to FirewallSimulator.pm
Dietmar Maurer [Tue, 20 May 2014 06:24:31 +0000 (08:24 +0200)]
add tests for corosync multicast addrtype rules
Dietmar Maurer [Tue, 20 May 2014 05:52:46 +0000 (07:52 +0200)]
do not enable VM firewall by default
Else we get different behavior with empty vs. non-existinf <VMID>.fw
Dietmar Maurer [Tue, 20 May 2014 05:38:25 +0000 (07:38 +0200)]
add tests for default rules
Dietmar Maurer [Tue, 20 May 2014 05:36:44 +0000 (07:36 +0200)]
fwtester: set cluster network to 172.16.1.0/24, host_ip to 172.16.1.2
So that we can add test for default rules
Dietmar Maurer [Tue, 20 May 2014 05:35:54 +0000 (07:35 +0200)]
allow tests without cluster.fw and host.fw configuration
Dietmar Maurer [Tue, 20 May 2014 05:34:35 +0000 (07:34 +0200)]
also allow VNC and SPICE traffic inside cluster_network
Dietmar Maurer [Tue, 20 May 2014 04:56:37 +0000 (06:56 +0200)]
do not use -s for outgoing corosync rules
Dietmar Maurer [Tue, 20 May 2014 04:53:37 +0000 (06:53 +0200)]
implement setter for cluster_network
So that we can set values for testing.
Dietmar Maurer [Tue, 20 May 2014 04:33:33 +0000 (06:33 +0200)]
fix regression test for previous commits
Dietmar Maurer [Tue, 20 May 2014 04:15:41 +0000 (06:15 +0200)]
use $accept_action for standard rules
Dietmar Maurer [Tue, 20 May 2014 04:12:55 +0000 (06:12 +0200)]
add standard rules after user rules
Ao that the users can overwrite behavior.
Dietmar Maurer [Tue, 20 May 2014 04:07:50 +0000 (06:07 +0200)]
fix corosync rules (restrict to cluster network)
Dietmar Maurer [Tue, 20 May 2014 03:55:58 +0000 (05:55 +0200)]
remove wrong corosync rules using port 9000
Dietmar Maurer [Mon, 19 May 2014 12:18:40 +0000 (14:18 +0200)]
allow API/SSH/SPICE/VNC traffic on local cluster network by default
Dietmar Maurer [Mon, 19 May 2014 09:33:11 +0000 (11:33 +0200)]
remove unused options
Dietmar Maurer [Mon, 19 May 2014 09:10:58 +0000 (11:10 +0200)]
add init function
Dietmar Maurer [Mon, 19 May 2014 08:58:21 +0000 (10:58 +0200)]
do not restart pvefw-logger with debian triggers
That is not necessary.
Dietmar Maurer [Mon, 19 May 2014 07:20:18 +0000 (09:20 +0200)]
avoid logs by default
Log files can grow really large, so we want to avoid them by default.
Dietmar Maurer [Mon, 19 May 2014 07:14:36 +0000 (09:14 +0200)]
remove unused parameters
Alexandre Derumier [Mon, 19 May 2014 05:40:08 +0000 (07:40 +0200)]
birectionnal macros cleanups
remove reverse direction rules
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
Dietmar Maurer [Mon, 19 May 2014 05:53:00 +0000 (07:53 +0200)]
change rule format: use named parameters
Dietmar Maurer [Fri, 16 May 2014 08:32:01 +0000 (10:32 +0200)]
include manual page
Dietmar Maurer [Fri, 16 May 2014 08:14:33 +0000 (10:14 +0200)]
cleanup firewall service implementation
We now run a separate server called 'pve-firewall' (renamed 'pvefw').
So service and management tool use the same name:
# service pve-firewall start
is the same as
# pve-firewall start
Also removed the read_pvefw_status/save_pvefw_status code.
Alexandre Derumier [Thu, 15 May 2014 11:46:11 +0000 (13:46 +0200)]
bypass PVEFW-VENET-IN|OUT for unfirewalled venet0 ips
we create an ipset PVEFW-venet0 for firewalled venet0 ips,
and only send this matching ips to PVEFW-VENET-IN|OUT
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
Dietmar Maurer [Fri, 16 May 2014 04:24:07 +0000 (06:24 +0200)]
do not abort if security groups does not exists
Simply create an empty chain instead.
Dietmar Maurer [Thu, 15 May 2014 10:53:48 +0000 (12:53 +0200)]
add ipset regression tests
Dietmar Maurer [Thu, 15 May 2014 10:45:08 +0000 (12:45 +0200)]
fwtester: implement ipset testing
Dietmar Maurer [Thu, 15 May 2014 10:17:53 +0000 (12:17 +0200)]
fix blacklist example
Dietmar Maurer [Thu, 15 May 2014 09:49:37 +0000 (11:49 +0200)]
add tests for unconfigured firewall (empty files)
Dietmar Maurer [Thu, 15 May 2014 09:15:29 +0000 (11:15 +0200)]
add group tests for container
Dietmar Maurer [Thu, 15 May 2014 09:01:35 +0000 (11:01 +0200)]
fix security groups for VMs
And add resgression tests for those fixes.
Dietmar Maurer [Thu, 15 May 2014 08:27:35 +0000 (10:27 +0200)]
add security group tests
Dietmar Maurer [Thu, 15 May 2014 08:22:20 +0000 (10:22 +0200)]
fwtester: add ability to run tests on several zones
Dietmar Maurer [Thu, 15 May 2014 06:58:36 +0000 (08:58 +0200)]
correctly emit group rules for host
Dietmar Maurer [Thu, 15 May 2014 06:57:01 +0000 (08:57 +0200)]
fwtester: improve rule_match
Use Net::IP to test source/dest.
Dietmar Maurer [Thu, 15 May 2014 05:18:20 +0000 (07:18 +0200)]
correctly use dest instead of source
Dietmar Maurer [Thu, 15 May 2014 05:15:58 +0000 (07:15 +0200)]
allow GROUP rule without iface
Dietmar Maurer [Thu, 15 May 2014 04:52:23 +0000 (06:52 +0200)]
fwtester: set firewall=1 for test VM interfaces
Alexandre Derumier [Thu, 15 May 2014 04:45:06 +0000 (06:45 +0200)]
only add tap rules for interface with firewall=1
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
Dietmar Maurer [Thu, 15 May 2014 04:37:37 +0000 (06:37 +0200)]
fwtester: simplify code with ne bport zone
Dietmar Maurer [Thu, 15 May 2014 04:05:20 +0000 (06:05 +0200)]
improve error messages
Dietmar Maurer [Wed, 14 May 2014 15:31:11 +0000 (17:31 +0200)]
fwtester: add new zone 'nfwm' to simulate a non-firewalled VM
Dietmar Maurer [Wed, 14 May 2014 15:02:55 +0000 (17:02 +0200)]
fwtester: do not count ENTER/LEAVE
Dietmar Maurer [Wed, 14 May 2014 13:32:55 +0000 (15:32 +0200)]
add README for fwtester.pl
Alexandre Derumier [Tue, 13 May 2014 10:32:08 +0000 (12:32 +0200)]
fix interface in rules for host-in and host-out
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
Dietmar Maurer [Wed, 14 May 2014 12:48:21 +0000 (14:48 +0200)]
add tests for host interface match
Dietmar Maurer [Wed, 14 May 2014 12:12:48 +0000 (14:12 +0200)]
fwtester: support dev regex with -i and -o
Dietmar Maurer [Wed, 14 May 2014 11:55:59 +0000 (13:55 +0200)]
fwtester: fix emulation - correctly set phydev_in
Dietmar Maurer [Wed, 14 May 2014 11:44:02 +0000 (13:44 +0200)]
fwtester: add counters for debugging
Dietmar Maurer [Wed, 14 May 2014 11:20:53 +0000 (13:20 +0200)]
fwtester: do not set packet default values
Alexandre Derumier [Wed, 14 May 2014 06:42:16 +0000 (08:42 +0200)]
move blacklist inside ruleset_chain_add_input_filters
make sense to only add it for IN direction and
like this, non-firewalled vms (tap|veth for now, not matching fwln+) will never check the blacklist rule
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
Alexandre Derumier [Wed, 14 May 2014 06:05:26 +0000 (08:05 +0200)]
remove optimize option
new model is already optimized, no need to have tricks now
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
Dietmar Maurer [Wed, 14 May 2014 10:14:32 +0000 (12:14 +0200)]
fwtester: implement some useful command line option
Dietmar Maurer [Wed, 14 May 2014 09:38:49 +0000 (11:38 +0200)]
fwtester: implement new 'outside' zone
To simulate traffic from/to outside world (vmbr0/eth0)
Dietmar Maurer [Wed, 14 May 2014 08:58:50 +0000 (10:58 +0200)]
fwtester: improve kernel simulation
Dietmar Maurer [Wed, 14 May 2014 05:21:19 +0000 (07:21 +0200)]
delete trailing whitespace cleanup
Alexandre Derumier [Wed, 14 May 2014 03:35:09 +0000 (05:35 +0200)]
allow multiple spaces in venet0 ip list
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
Alexandre Derumier [Wed, 14 May 2014 03:26:55 +0000 (05:26 +0200)]
rename link+ to fwln+
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
Alexandre Derumier [Tue, 13 May 2014 08:19:04 +0000 (10:19 +0200)]
bugfix : allow multiples venet0 ip in 1 container
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
Alexandre Derumier [Mon, 12 May 2014 13:19:16 +0000 (15:19 +0200)]
insert PVEFW-IPS after vm rules generation v2
or it never match it
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
Dietmar Maurer [Tue, 13 May 2014 12:18:08 +0000 (14:18 +0200)]
add Makefile targets for regression tests
Always run tests before assembling a Debian package.
Dietmar Maurer [Tue, 13 May 2014 12:09:49 +0000 (14:09 +0200)]
add regression test infrastructure
Dietmar Maurer [Tue, 13 May 2014 11:49:31 +0000 (13:49 +0200)]
allow to read config from test directory
I will use that for regression tests.
Dietmar Maurer [Mon, 12 May 2014 11:33:19 +0000 (13:33 +0200)]
use PVEFW-VENET-IN/OUT inside PVEFW-INPUT/OUTPUT chains
Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
Dietmar Maurer [Mon, 12 May 2014 11:33:18 +0000 (13:33 +0200)]
move nosmurfs, tcpflags and conntrack established outside tap chains
These should be done fast,
conntrack established can be done in PVE-FORWARD now
smurf and tcpflags can be done in PVEFW-FWBR-IN and PVEFW-VENET-IN (don't
make sense to test them in OUT direction)
-A PVEFW-FORWARD ! -i fwbr+ -j ACCEPT
-A PVEFW-FORWARD -m conntrack --ctstate INVALID -j DROP
-A PVEFW-FORWARD -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
-A PVEFW-FORWARD -m physdev --physdev-in link+ -j PVEFW-FWBR-IN
-A PVEFW-FWBR-IN -p tcp -j PVEFW-tcpflags
-A PVEFW-FWBR-IN -m conntrack --ctstate INVALID,NEW -j PVEFW-smurfs
-A PVEFW-FWBR-IN -m physdev --physdev-out tap123i0 --physdev-is-bridged -j tap123i0-IN
-A PVEFW-FWBR-IN -m physdev --physdev-out veth0.0 --physdev-is-bridged -j veth0.0-IN
-A PVEFW-FORWARD -m physdev --physdev-is-bridged --physdev-out link+ -j PVEFW-FWBR-OUT
-A PVEFW-FWBR-OUT -m physdev --physdev-in tap123i0 -j tap123i0-OUT
-A PVEFW-FWBR-OUT -m physdev --physdev-in veth0.0 -j veth0.0-OUT
Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
Dietmar Maurer [Mon, 12 May 2014 11:33:17 +0000 (13:33 +0200)]
remove dead code
Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
Dietmar Maurer [Mon, 12 May 2014 11:33:16 +0000 (13:33 +0200)]
add PVEFW-VENET-IN && PVEFW-VENET-OUT chains
Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
Dietmar Maurer [Mon, 12 May 2014 11:33:15 +0000 (13:33 +0200)]
remove bridge chains
-A PVEFW-FORWARD ! -i fwbr+ -j ACCEPT
-A PVEFW-FORWARD -m conntrack --ctstate INVALID -j DROP
-A PVEFW-FORWARD -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
-A PVEFW-FORWARD -m physdev --physdev-is-bridged --physdev-in link+ -j PVEFW-FWBR-IN
-A PVEFW-FWBR-IN -m physdev --physdev-out tap123i0 --physdev-is-bridged -j tap123i0-IN
-A PVEFW-FWBR-IN -m physdev --physdev-out veth0.0 --physdev-is-bridged -j veth0.0-IN
-A PVEFW-FORWARD -m physdev --physdev-is-bridged --physdev-out link+ -j PVEFW-FWBR-OUT
-A PVEFW-FWBR-OUT -m physdev --physdev-in tap123i0 -j tap123i0-OUT
-A PVEFW-FWBR-OUT -m physdev --physdev-in veth0.0 -j veth0.0-OUT
Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
Dietmar Maurer [Mon, 12 May 2014 11:33:14 +0000 (13:33 +0200)]
use hex digest to avoid url encoding problems
Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
Dietmar Maurer [Mon, 12 May 2014 11:33:13 +0000 (13:33 +0200)]
avoid error about undefined array
Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
Dietmar Maurer [Tue, 6 May 2014 09:18:25 +0000 (11:18 +0200)]
set RELEASE to 3.2
Dietmar Maurer [Tue, 6 May 2014 09:12:21 +0000 (11:12 +0200)]
remove allow_bridge_route setting
Not needed for new network model with additional bridge.
Dietmar Maurer [Thu, 24 Apr 2014 12:31:13 +0000 (14:31 +0200)]
firewall group API: change 'name' to 'group'
Alexandre Derumier [Tue, 22 Apr 2014 08:44:59 +0000 (10:44 +0200)]
add global ipset blacklist
this is a predefined ipset == blacklist,
which block ips at the begin of PVE-FORWARD.
(usefull in case of ddos attack)
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
Dietmar Maurer [Tue, 22 Apr 2014 10:43:54 +0000 (12:43 +0200)]
generate_ipset: skip undefined ipsets
I introduced that bug when I changed die to warn.
Dietmar Maurer [Tue, 22 Apr 2014 10:37:03 +0000 (12:37 +0200)]
rename save_rules to save_ipset
Dietmar Maurer [Tue, 22 Apr 2014 10:33:05 +0000 (12:33 +0200)]
alias API: implement rename
Dietmar Maurer [Tue, 22 Apr 2014 09:45:52 +0000 (11:45 +0200)]
start API for aliases
Allow comments for aliases.
Dietmar Maurer [Tue, 22 Apr 2014 07:37:53 +0000 (09:37 +0200)]
correctly save aliases
Dietmar Maurer [Tue, 22 Apr 2014 07:08:05 +0000 (09:08 +0200)]
ruleset_generate_vm_rules: use 'warn' instead of 'die'
We want to be able to update our rules, even if somebody defined
a wrong rule for his VM.
Dietmar Maurer [Tue, 22 Apr 2014 07:02:04 +0000 (09:02 +0200)]
ruleset_generate_vm_rule: avoid multiple calls to generate_nfqueue()
Dietmar Maurer [Tue, 22 Apr 2014 06:59:02 +0000 (08:59 +0200)]
generate_nfqueue: code cleanup
Dietmar Maurer [Tue, 22 Apr 2014 06:53:48 +0000 (08:53 +0200)]
ruleset_generate_rule: update all or nothing
And use 'warn' instead of 'die' if alias does not exists.
Alexandre Derumier [Tue, 22 Apr 2014 06:17:00 +0000 (08:17 +0200)]
update update_nf_conntrack_max && nf_conntrack_tcp_timeout_established after modules load
/proc/sys/net/netfilter/nf_conntrack_tcp_timeout_established
and
/proc/sys/net/nf_conntrack_max
are empty by default, because conntrack module is not loaded, until we have apply iptables rules
So, we just need to update them after iptables commit (which load the conntrack modules)
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
Dietmar Maurer [Tue, 22 Apr 2014 06:32:44 +0000 (08:32 +0200)]
code cleanup
Define $ip_alias_name to make it easier to read the code.
Alexandre Derumier [Tue, 22 Apr 2014 05:38:07 +0000 (07:38 +0200)]
iptables_get_chains : allow bridgevlan vmbrXvY
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>