]> git.proxmox.com Git - pve-firewall.git/log
pve-firewall.git
7 years agobuild-depends: add dh-systemd
Wolfgang Bumiller [Tue, 28 Jun 2016 13:02:01 +0000 (15:02 +0200)]
build-depends: add dh-systemd

7 years agobump version to 2.0-29
Dietmar Maurer [Fri, 3 Jun 2016 14:46:55 +0000 (16:46 +0200)]
bump version to 2.0-29

7 years agoprevent overwriting ipsets/sec. groups by renaming
Dominik Csapak [Fri, 3 Jun 2016 14:11:27 +0000 (16:11 +0200)]
prevent overwriting ipsets/sec. groups by renaming

we did not check if the target name of the group/ipset
already existed, so we overwrote them

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
7 years agofix allowed group name length
Dominik Csapak [Fri, 3 Jun 2016 13:14:24 +0000 (15:14 +0200)]
fix allowed group name length

the allowed length for an iptable chain is 28 chars

we had a max set of 20 but a format of
GROUP-<name>-IN and
GROUP-<name>-OUT

where <name> is the group name

but GROUP--OUT are 10 chars so we just allow 18 chars max

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
7 years agomake group digest stable
Dominik Csapak [Fri, 3 Jun 2016 13:14:23 +0000 (15:14 +0200)]
make group digest stable

if we had mulitple security groups and wanted to
edit one, we did not have a stable digest,
because perl hashes are not sorted

this patch sorts the keys before hashing

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
7 years agobump version to 2.0-28
Dietmar Maurer [Fri, 3 Jun 2016 09:02:06 +0000 (11:02 +0200)]
bump version to 2.0-28

7 years agouse pve-common's ipv4_mask_hash_localnet
Wolfgang Bumiller [Fri, 3 Jun 2016 08:40:13 +0000 (10:40 +0200)]
use pve-common's ipv4_mask_hash_localnet

7 years agobump version to 2.0-27
Dietmar Maurer [Tue, 17 May 2016 06:00:12 +0000 (08:00 +0200)]
bump version to 2.0-27

7 years agofix #972: make PVEFW-FWBR-* rule order stable
Fabian Grünbichler [Fri, 13 May 2016 08:23:10 +0000 (10:23 +0200)]
fix #972: make PVEFW-FWBR-* rule order stable

by sorting the VM/CT IDs and the VM/CT config keys before
iterating over them.

7 years agobump version to 2.0-26
Dietmar Maurer [Mon, 9 May 2016 08:02:07 +0000 (10:02 +0200)]
bump version to 2.0-26

7 years agoinstall sysctl file set set rp_filter=2
Dietmar Maurer [Mon, 9 May 2016 07:58:15 +0000 (09:58 +0200)]
install sysctl file set set rp_filter=2

To avoid that packet gets accepted to early in fwbr. We had the
same setting in package vzctl (Proxmox VE 3.X).

7 years agobump version to 2.0-25
Dietmar Maurer [Thu, 21 Apr 2016 07:59:01 +0000 (09:59 +0200)]
bump version to 2.0-25

7 years agofix #945: add uninitialized check in lxc ipset compilation
Fabian Grünbichler [Wed, 20 Apr 2016 07:54:39 +0000 (09:54 +0200)]
fix #945: add uninitialized check in lxc ipset compilation

8 years agouse pve-doc-generator, bump version to 2.0-24
Dietmar Maurer [Wed, 6 Apr 2016 08:55:08 +0000 (10:55 +0200)]
use pve-doc-generator, bump version to 2.0-24

8 years agomove option definition to PVE::Firewall
Dietmar Maurer [Fri, 1 Apr 2016 10:30:59 +0000 (12:30 +0200)]
move option definition to PVE::Firewall

So that we can auto-generate docs.

8 years agobump version to 2.0-23
Dietmar Maurer [Fri, 1 Apr 2016 05:36:19 +0000 (07:36 +0200)]
bump version to 2.0-23

8 years agouse only the top bit for our accept marks
Wolfgang Bumiller [Thu, 31 Mar 2016 11:59:46 +0000 (13:59 +0200)]
use only the top bit for our accept marks

This way we can let the remaining 31 bits be used by the
user.
Note that the routing decision has already been made when
these tables are being traversed, so the fwmark will not be
usable for routing rules (ip-rule(8)), but the mark can
still be used for other tasks such as traffic control (tc)
which happens on the outgoing interface.

8 years agoadd description to DHCPv6 macro
Dietmar Maurer [Fri, 1 Apr 2016 05:29:29 +0000 (07:29 +0200)]
add description to DHCPv6 macro

8 years agocleanup descriptions (use single quote instead of backticks)
Dietmar Maurer [Thu, 31 Mar 2016 08:06:48 +0000 (10:06 +0200)]
cleanup descriptions (use single quote instead of backticks)

8 years agocleanup descriptions (correctly quote backslash)
Dietmar Maurer [Thu, 31 Mar 2016 07:59:39 +0000 (09:59 +0200)]
cleanup descriptions (correctly quote backslash)

8 years agoadd property descriptions to improve docs
Dietmar Maurer [Thu, 31 Mar 2016 06:06:02 +0000 (08:06 +0200)]
add property descriptions to improve docs

8 years agobump version to 2.0-22
Dietmar Maurer [Tue, 8 Mar 2016 10:47:55 +0000 (11:47 +0100)]
bump version to 2.0-22

8 years agoUse cfs_config_path from PVE::QemuConfig
Fabian Grünbichler [Mon, 7 Mar 2016 11:42:02 +0000 (12:42 +0100)]
Use cfs_config_path from PVE::QemuConfig

update after refactoring

8 years agoLXC refactoring
Fabian Grünbichler [Thu, 3 Mar 2016 09:43:36 +0000 (10:43 +0100)]
LXC refactoring

call cfs_config_path and parse_lxc_network in
PVE::LXC::Config instead of PVE::LXC

8 years agobump version to 2.0-21
Dietmar Maurer [Thu, 3 Mar 2016 08:43:56 +0000 (09:43 +0100)]
bump version to 2.0-21

8 years agowhitespace cleanup
Wolfgang Bumiller [Wed, 2 Mar 2016 11:59:17 +0000 (12:59 +0100)]
whitespace cleanup

8 years agotest: add test for implicitly allowed container IP
Wolfgang Bumiller [Wed, 2 Mar 2016 11:59:16 +0000 (12:59 +0100)]
test: add test for implicitly allowed container IP

8 years agoipfilter: include configured container IPs by default
Wolfgang Bumiller [Wed, 2 Mar 2016 11:59:15 +0000 (12:59 +0100)]
ipfilter: include configured container IPs by default

8 years agoadded the 'ipfilter' option
Wolfgang Bumiller [Wed, 2 Mar 2016 11:59:14 +0000 (12:59 +0100)]
added the 'ipfilter' option

This effectively acts like adding an emtpy 'ipfilter-netX'
ipset for every firewall-enabled interface.

8 years agoipv6: fix ip_compress_address_call
Wolfgang Bumiller [Tue, 1 Mar 2016 11:20:16 +0000 (12:20 +0100)]
ipv6: fix ip_compress_address_call

This only takes an address and not a CIDR notation. It does
preserve the suffix but ended up compressing
fc00:0000::0000/64 to fc00::0000/64 instead of fc00::/64 and
thus caused the firewall to always show there are pending
changes when ipv6 addresses were available.

8 years agouse systemctl reload-or-restart on update
Wolfgang Bumiller [Tue, 1 Mar 2016 11:20:21 +0000 (12:20 +0100)]
use systemctl reload-or-restart on update

dh_installinit's -R option uses 'restart' causing a
stop-start cycle with systemd. We really don't want that.

8 years agoipfilter: imiplicitly add the default link local address
Wolfgang Bumiller [Tue, 1 Mar 2016 11:20:20 +0000 (12:20 +0100)]
ipfilter: imiplicitly add the default link local address

When adding an ipset for a device via the 'ipfilter-net$NUM'
name we now implicitly add the default link local address
based on the device's MAC address and a 'nomatch' entry for
the rest of fe80::/10. This is comparable to an ARP/MAC
filter in IPv4 with the main difference that it explicitly
works at IP level.

8 years agosplit compile_ipsets() out of compile_iptables_filter()
Wolfgang Bumiller [Tue, 1 Mar 2016 11:20:19 +0000 (12:20 +0100)]
split compile_ipsets() out of compile_iptables_filter()

compile_iptables_filter() is called twice, once to get the
ipv4 ruleset + ipsets and ones to get the ipv6 ruleset. The
second call still generates ipsets which are discarded so it
makes sense to do this in a separate step.

8 years agocleanup after old change
Wolfgang Bumiller [Tue, 1 Mar 2016 11:20:18 +0000 (12:20 +0100)]
cleanup after old change

get_ipset_cmdlist() had a delete parameter in one commit,
removed in the one after that (dd7a13fddc) and this call
was not updated accordingly with the second patch.

8 years agondp: use PVEFW-SET-ACCEPT-MARK and move rules further down
Wolfgang Bumiller [Tue, 1 Mar 2016 11:20:17 +0000 (12:20 +0100)]
ndp: use PVEFW-SET-ACCEPT-MARK and move rules further down

On host level: moved NDP to after connection tracking and
switched to RETURN instead of ACCEPT.

On VM level:
The output direction now uses the accept-mark like the dhcp
option does, too.
Also moved NDP rules below the macfilter & ipset rules.

8 years agoonly allow icmp names in the destination port field
Wolfgang Bumiller [Tue, 1 Mar 2016 11:20:15 +0000 (12:20 +0100)]
only allow icmp names in the destination port field

We generate ICMP rules from the destination port field,
so allowing them in the source port field only confuses
people.

8 years agobump version to 2.0-20
Dietmar Maurer [Mon, 29 Feb 2016 11:40:36 +0000 (12:40 +0100)]
bump version to 2.0-20

8 years agofix 901: encode unicode characters in sha digest
Dominik Csapak [Mon, 29 Feb 2016 11:36:19 +0000 (12:36 +0100)]
fix 901: encode unicode characters in sha digest

if we do not do this, Digest::SHA->add croaks when it detects
wide symbols

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
8 years agobump version to 2.0-19
Dietmar Maurer [Sat, 27 Feb 2016 09:25:12 +0000 (10:25 +0100)]
bump version to 2.0-19

8 years agoAdd radv option to VM options.
Wolfgang Bumiller [Thu, 25 Feb 2016 12:07:02 +0000 (13:07 +0100)]
Add radv option to VM options.

By default firewalled VMs should not be allowed to send
router advertisement packets.

8 years agobump version to 2.0-18
Dietmar Maurer [Fri, 19 Feb 2016 09:01:40 +0000 (10:01 +0100)]
bump version to 2.0-18

8 years agoAdd router-solicitation to NeighborDiscovery macro
Wolfgang Bumiller [Fri, 19 Feb 2016 08:43:33 +0000 (09:43 +0100)]
Add router-solicitation to NeighborDiscovery macro

to be more consistent with the host-wide NDP option.
This macro is now mostly useful to disable NDP on VMs.

8 years agoAdd ndp option to host and VM firewall options
Wolfgang Bumiller [Fri, 19 Feb 2016 08:43:32 +0000 (09:43 +0100)]
Add ndp option to host and VM firewall options

It's is enabled by default.

8 years agobump version to 2.0-17
Dietmar Maurer [Mon, 8 Feb 2016 13:09:58 +0000 (14:09 +0100)]
bump version to 2.0-17

8 years agoDon't leave empty FW config files behind
Fabian Grünbichler [Mon, 8 Feb 2016 08:14:03 +0000 (09:14 +0100)]
Don't leave empty FW config files behind

Unlink FW config files instead of setting their content
to nothing.

8 years agopvefw-logger.c: remove unused var
Dietmar Maurer [Tue, 26 Jan 2016 15:54:41 +0000 (16:54 +0100)]
pvefw-logger.c: remove unused var

8 years agobump version to 2.0-16
Dietmar Maurer [Tue, 26 Jan 2016 15:52:44 +0000 (16:52 +0100)]
bump version to 2.0-16

8 years agologger: basic ipv6 support
Wolfgang Bumiller [Tue, 26 Jan 2016 11:03:04 +0000 (12:03 +0100)]
logger: basic ipv6 support

Support for:
 * IPv6 main header
 * ICMPv6:
   - echo request/reply
   - NDP
   - redirects
 * destination unreachable message
 * packet too big message
 * time exceeded message
 * parameter problem messages:
   - erroneous header
   - bad next-header
   - bad ipv6 option
 * extension headers:
   - routing
   - fragmentation
   - skipping over: hopopts, destopts and mobile home

8 years agofactor out IPPROTO switch for reuse
Wolfgang Bumiller [Tue, 26 Jan 2016 11:03:03 +0000 (12:03 +0100)]
factor out IPPROTO switch for reuse

8 years agoadd DHCPv6 macro
Wolfgang Bumiller [Tue, 26 Jan 2016 11:03:02 +0000 (12:03 +0100)]
add DHCPv6 macro

8 years agoadd dhcpv6 support to the dhcp option
Wolfgang Bumiller [Tue, 26 Jan 2016 11:03:01 +0000 (12:03 +0100)]
add dhcpv6 support to the dhcp option

8 years agomake LEPRINT* macros safe to use with if/else pairs
Wolfgang Bumiller [Tue, 26 Jan 2016 09:22:51 +0000 (10:22 +0100)]
make LEPRINT* macros safe to use with if/else pairs

8 years agoset RELEASE=4.1
Dietmar Maurer [Thu, 7 Jan 2016 15:36:18 +0000 (16:36 +0100)]
set RELEASE=4.1

8 years agobump version to 2.0-15
Dietmar Maurer [Thu, 7 Jan 2016 15:34:09 +0000 (16:34 +0100)]
bump version to 2.0-15

8 years agouse $security_group_name_pattern in iptables_get_chains
Wolfgang Bumiller [Thu, 7 Jan 2016 13:11:35 +0000 (14:11 +0100)]
use $security_group_name_pattern in iptables_get_chains

Fixes #859

8 years agofix some regular expressions mixups
Wolfgang Bumiller [Thu, 7 Jan 2016 13:11:34 +0000 (14:11 +0100)]
fix some regular expressions mixups

Replacing some (:?...) with (?:...) which makes more sense
here.

8 years agobump version to 2.0-14
Dietmar Maurer [Fri, 27 Nov 2015 09:53:21 +0000 (10:53 +0100)]
bump version to 2.0-14

8 years agopve-firewall.service: WantedBy=multi-user.target
Dietmar Maurer [Fri, 27 Nov 2015 09:50:42 +0000 (10:50 +0100)]
pve-firewall.service: WantedBy=multi-user.target

Instead of network-online.target, which is a very special systemd target
which is not always pulled.

8 years agofix typo: s/stemd-modules-load.service/systemd-modules-load.service/
Dietmar Maurer [Tue, 24 Nov 2015 06:45:55 +0000 (07:45 +0100)]
fix typo: s/stemd-modules-load.service/systemd-modules-load.service/

8 years agobump version to 2.0-13
Dietmar Maurer [Fri, 23 Oct 2015 11:22:17 +0000 (13:22 +0200)]
bump version to 2.0-13

8 years agoallow numeric icmp types
Wolfgang Bumiller [Fri, 23 Oct 2015 09:35:29 +0000 (11:35 +0200)]
allow numeric icmp types

8 years agomake clean fix
Wolfgang Bumiller [Thu, 22 Oct 2015 13:43:38 +0000 (15:43 +0200)]
make clean fix

8 years agobump version to 2.0-12
Dietmar Maurer [Thu, 24 Sep 2015 10:15:41 +0000 (12:15 +0200)]
bump version to 2.0-12

8 years agouse service class to generate pod and bash-completion files
Dietmar Maurer [Thu, 24 Sep 2015 10:13:10 +0000 (12:13 +0200)]
use service class to generate pod and bash-completion files

8 years agoconvert pve-firewall into a PVE::Service class
Dietmar Maurer [Thu, 24 Sep 2015 08:40:24 +0000 (10:40 +0200)]
convert pve-firewall into a PVE::Service class

8 years agoadd better inline documentation
Dietmar Maurer [Wed, 16 Sep 2015 09:25:24 +0000 (11:25 +0200)]
add better inline documentation

8 years agobump version to 2.0-11
Dietmar Maurer [Tue, 8 Sep 2015 05:54:52 +0000 (07:54 +0200)]
bump version to 2.0-11

8 years agoiptables_get_chains: fix veth device name
Dietmar Maurer [Tue, 8 Sep 2015 05:49:10 +0000 (07:49 +0200)]
iptables_get_chains: fix veth device name

8 years agobump version to 2.0-10
Dietmar Maurer [Tue, 25 Aug 2015 04:48:10 +0000 (06:48 +0200)]
bump version to 2.0-10

8 years agosubroutine for cloning vm's firewall config file
Alen Grizonic [Mon, 24 Aug 2015 09:32:37 +0000 (11:32 +0200)]
subroutine for cloning vm's firewall config file

8 years agobump version to 2.0-9
Dietmar Maurer [Wed, 19 Aug 2015 13:43:15 +0000 (15:43 +0200)]
bump version to 2.0-9

8 years agofirewall remove config file subroutine added
Alen Grizonic [Wed, 19 Aug 2015 08:34:12 +0000 (10:34 +0200)]
firewall remove config file subroutine added

Signed-off-by: Alen Grizonic <a.grizonic@proxmox.com>
8 years agobump version to 2.0-8
Dietmar Maurer [Wed, 12 Aug 2015 10:02:53 +0000 (12:02 +0200)]
bump version to 2.0-8

8 years agoadopt regresion tests for lxc containers
Dietmar Maurer [Wed, 12 Aug 2015 09:59:18 +0000 (11:59 +0200)]
adopt regresion tests for lxc containers

Removed OpenVZ venet code.

8 years agoremoved firewall code for openVZ
Alen Grizonic [Tue, 11 Aug 2015 12:50:53 +0000 (14:50 +0200)]
removed firewall code for openVZ

[PATCH 2/2] changed to [PATCH] with the following fix:

Subroutine verify_rule (re)fixed to correctly check only for "net\d+" interface device names

8 years agobump version to 2.0-7
Dietmar Maurer [Mon, 10 Aug 2015 07:21:35 +0000 (09:21 +0200)]
bump version to 2.0-7

8 years agoadded firewall code for lxc
Alen Grizonic [Fri, 7 Aug 2015 14:18:34 +0000 (16:18 +0200)]
added firewall code for lxc

Signed-off-by: Alen Grizonic <a.grizonic@proxmox.com>
8 years agobump version to 2.0-6
Dietmar Maurer [Tue, 4 Aug 2015 09:15:11 +0000 (11:15 +0200)]
bump version to 2.0-6

8 years agofirewall ipversion comparison fix
Alen Grizonic [Tue, 4 Aug 2015 08:55:24 +0000 (10:55 +0200)]
firewall ipversion comparison fix

Signed-off-by: Alen Grizonic <a.grizonic@proxmox.com>
8 years agolocal_network: ipv6 support + correctness
Wolfgang Bumiller [Tue, 28 Jul 2015 06:46:05 +0000 (08:46 +0200)]
local_network: ipv6 support + correctness

Net::IP->overlaps returns more than just true or false, as
it tests both directions, we need IP_B_IN_A_OVERLAP in our
test.
Removed return on mask eq '0.0.0.0' as this doesn't exist in
the $ipv4_mask_hash_localnet.

8 years agofix ipv6 address normalization
Wolfgang Bumiller [Tue, 28 Jul 2015 06:46:04 +0000 (08:46 +0200)]
fix ipv6 address normalization

inet_ntop only takes an addres, not a CIDR notation. Since
the normalized address should just be a compressed
lower-case address, Net::IP::ip_compress_address should be
sufficient.

inet_ntop didn't succeed before, the result of which was
that ipsets weren't generated at all for ipv6 address ranges.

8 years agobump version to 2.0-5
Dietmar Maurer [Mon, 27 Jul 2015 11:21:24 +0000 (13:21 +0200)]
bump version to 2.0-5

8 years agoipv6 neighbor discovery and solicitation macros
Wolfgang Bumiller [Mon, 6 Jul 2015 08:10:45 +0000 (10:10 +0200)]
ipv6 neighbor discovery and solicitation macros

8 years agoAdd ipv6 macros to the macro list
Wolfgang Bumiller [Mon, 6 Jul 2015 08:07:49 +0000 (10:07 +0200)]
Add ipv6 macros to the macro list

Additionally there's now a way to specify ipv6-only or
ipv4-only macros.

8 years agoip6tables accepts both spellings of the word neighbor
Wolfgang Bumiller [Fri, 3 Jul 2015 08:17:21 +0000 (10:17 +0200)]
ip6tables accepts both spellings of the word neighbor

8 years agofirewall - Ceph macro added
Alen Grizonic [Tue, 14 Jul 2015 12:04:57 +0000 (14:04 +0200)]
firewall - Ceph macro added

Signed-off-by: Alen Grizonic <a.grizonic@proxmox.com>
8 years agofix path for DOCDIR
Dietmar Maurer [Sat, 27 Jun 2015 14:34:40 +0000 (16:34 +0200)]
fix path for DOCDIR

8 years agobump version to 2.0-4
Dietmar Maurer [Sat, 27 Jun 2015 14:26:48 +0000 (16:26 +0200)]
bump version to 2.0-4

8 years agocorrectly install manual pages
Dietmar Maurer [Sat, 27 Jun 2015 14:25:44 +0000 (16:25 +0200)]
correctly install manual pages

8 years agofix lintian warning command-with-path-in-maintainer-script
Dietmar Maurer [Sat, 27 Jun 2015 14:24:58 +0000 (16:24 +0200)]
fix lintian warning command-with-path-in-maintainer-script

8 years agofirewall instant API call apply
Alen Grizonic [Thu, 25 Jun 2015 09:36:42 +0000 (11:36 +0200)]
firewall instant API call apply

8 years agofirewall_module_duplicate
Alen Grizonic [Wed, 24 Jun 2015 11:46:09 +0000 (13:46 +0200)]
firewall_module_duplicate

removed duplicated line of Data::Dumper use

Signed-off-by: Alen Grizonic <a.grizonic@proxmox.com>
8 years agofirewall autodisable
Alen Grizonic [Thu, 25 Jun 2015 08:06:27 +0000 (10:06 +0200)]
firewall autodisable

firewall enable parameter type changed from boolean to integer so it can store
the timestamp of the firewall enable call to avoid an admin remote lockout

Signed-off-by: Alen Grizonic <a.grizonic@proxmox.com>
8 years agobump version to 2.0-3
Dietmar Maurer [Mon, 1 Jun 2015 10:33:27 +0000 (12:33 +0200)]
bump version to 2.0-3

8 years agouse noawait trigers for pve-api-updates
Dietmar Maurer [Mon, 1 Jun 2015 10:32:17 +0000 (12:32 +0200)]
use noawait trigers for pve-api-updates

8 years agobump version to 2.0-2
Dietmar Maurer [Tue, 5 May 2015 13:10:42 +0000 (15:10 +0200)]
bump version to 2.0-2

8 years agotrigger pve-api-updates event
Dietmar Maurer [Tue, 5 May 2015 13:09:48 +0000 (15:09 +0200)]
trigger pve-api-updates event

9 years agoallow admins to delete security groups
Dietmar Maurer [Wed, 18 Mar 2015 05:08:53 +0000 (06:08 +0100)]
allow admins to delete security groups

9 years agoalways use local_network alias if specified by user
Dietmar Maurer [Mon, 16 Mar 2015 05:30:43 +0000 (06:30 +0100)]
always use local_network alias if specified by user

9 years agocorrectly emit ipv6 rules for host firewall
Dietmar Maurer [Sun, 15 Mar 2015 09:11:00 +0000 (10:11 +0100)]
correctly emit ipv6 rules for host firewall