5
0
mirror of git://git.proxmox.com/git/pve-firewall.git synced 2025-01-21 22:03:52 +03:00

872 Commits

Author SHA1 Message Date
Dominik Csapak
aced7e7d67 fix #2005: only allow ascii port digits
perl accepts non-ascii digits for \d like U+09EA
which do not work with iptables

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2018-12-03 14:10:12 +01:00
Thomas Lamprecht
81d13a9d36 bump version to 3.0-16
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2018-11-30 16:03:11 +01:00
Dominik Csapak
f0e30c996b macro: fix return verification failure
macros are strings not integers

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2018-11-29 14:38:29 +01:00
Thomas Lamprecht
bed701bc0d bump version to 3.0-15
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2018-11-23 14:05:23 +01:00
Rhonda D'Vine
fb03a7e972 d/control: add missing Build-Depends
Found while building in a clean chroot.

Signed-off-by: Rhonda D'Vine <rhonda@proxmox.com>
2018-11-14 10:42:16 +01:00
Rhonda D'Vine
c5b2e6d945 Fix #1971: display firewall rule properties
This is the list of the properties that should get returned in the
pretty print format, too, not just in yaml/json output.

Signed-off-by: Rhonda D'Vine <rhonda@proxmox.com>
2018-11-14 10:42:01 +01:00
Thomas Lamprecht
efd9bf26c5 d/rules: fix pvefw-logger service unit-name
debhelpers on stretch do not care about the wrong uinit name, and the
name used is always the one from --name.
But buster cares, so fix it to the right one.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2018-09-04 09:51:54 +02:00
Wolfgang Bumiller
a24b157ba4 bump version to 3.0-14
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2018-08-24 10:51:19 +02:00
Stoiko Ivanov
4a1072dd84 Fix #1841: ebtables: sort interfaces per guest
Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
2018-08-24 09:58:37 +02:00
Wolfgang Bumiller
cf7dd94bdd bump version to 3.0-13
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2018-06-28 14:47:25 +02:00
Stoiko Ivanov
2e30c5c7ed ebtables: sort guest chains during rulecreation
Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
2018-06-28 14:45:09 +02:00
Thomas Lamprecht
f6163c2e16 api: host, vm: explicit import raise_param_exc
we inherited the import from PVE::RESTHandler but may want to get rid
of it there. So explicitly import it here.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2018-06-18 11:06:09 +02:00
Wolfgang Bumiller
76448f08f4 whitespace fixup
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2018-06-18 11:06:09 +02:00
Wolfgang Bumiller
dd03bf6e2f bump version to 3.0-12
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2018-06-12 12:02:32 +02:00
Wolfgang Bumiller
d9551052a1 fixup active_chains distinction when deleting chains
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2018-06-12 12:00:10 +02:00
Thomas Lamprecht
587a0f205e fixup changelog UNRELEASED 2018-06-06 16:18:48 +02:00
Thomas Lamprecht
a3a51dad63 bump version to 3.0-11 2018-06-06 16:15:01 +02:00
Stoiko Ivanov
2549e7ef48 rename ebtables_enable to ebtables
and register ebtables option with the API

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
2018-06-06 15:51:43 +02:00
Wolfgang Bumiller
423b86effc bump version to 3.0-10
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2018-05-29 15:14:43 +02:00
Wolfgang Bumiller
d4a23c880d typo fixup
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2018-05-29 15:08:25 +02:00
Stoiko Ivanov
84025e9943 Don't change external ebtables rules
* Fixes #1764
  * Introduces ebtables_enable option to cluster config
  * All ebtables chains not created by PVE are left in place
  * get_ruleset_status optionally takes an additional argument
    (a regex indicating which chains should be left intact)

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
2018-05-29 15:00:42 +02:00
Wolfgang Bumiller
567e58ce1b bump version to 3.0-9
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2018-05-17 14:41:40 +02:00
Wolfgang Bumiller
518f67dcda fix PVEFW-FORWARD chain not being used
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2018-05-17 13:09:23 +02:00
Wolfgang Bumiller
ea0d59edd2 bump version to 3.0-8
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2018-04-11 14:26:15 +02:00
Wolfgang Bumiller
fc1f1de97e ebtables_get_chains: deal with empty chains
Since we don't have signatures in ebtables we need to also
see empty chains to not think we have to create them.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Reviewed-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Tested-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2018-03-29 09:55:10 +02:00
Wolfgang Bumiller
f706def5ce add ebtables dependency
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Reviewed-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Tested-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2018-03-28 11:35:06 +02:00
Wolfgang Bumiller
1205831a68 avoid double spaces in ruleset_addrule
ebtables doesn't have comment rules we could store the
digest in, so we need to match the ebtables-save output
instead.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Reviewed-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Tested-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2018-03-28 11:35:06 +02:00
Alexandre Derumier
151c209e05 apply ebtables_ruleset
need ebtables-save && ebtables-restore,  ebtables debian package don't include them.

ebtables-restore need to restore the full ruleset (atomicaly),
so we can't update only 1 chain

Signed-off-by: Alexandre Derumier <aderumier at odiso.com>
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Reviewed-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Tested-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2018-03-28 11:35:06 +02:00
Alexandre Derumier
c5e8b0088f compile ebtables rules
-A FORWARD -j PVEFW-FORWARD
   -A PVEFW-FORWARD -p IPv4 -j ACCEPT  #filter mac in iptables for ipv4, so we can speedup rules with conntrack established
   -A PVEFW-FORWARD -p IPv6 -j ACCEPT
   -A PVEFW-FORWARD -o fwln+ -j PVEFW-FWBR-OUT
	-A PVEFW-FWBR-OUT -i tap110i0 -j tap110i0-OUT
		-A tap110i0-OUT -s ! 36:97:15:91:19:3c -j DROP
		-A tap110i0-OUT -p ARP -j ACCEPT
		-A tap110i0-OUT -j DROP
		-A tap110i0-OUT -j ACCEPT
	-A PVEFW-FWBR-OUT -i veth130.1 -j veth130.1-OUT
		-A veth130.1-OUT -s ! 36:95:a9:ae:f5:ec -j DROP
		-A veth130.1-OUT -j ACCEPT

Signed-off-by: Alexandre Derumier <aderumier at odiso.com>
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Reviewed-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Tested-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2018-03-28 11:35:06 +02:00
Wolfgang Bumiller
d50f24ea6d /etc/services can also define 'sctp' services
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Reviewed-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Tested-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2018-03-28 11:35:06 +02:00
Wolfgang Bumiller
b452ea100a add get_etc_ethertypes
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Reviewed-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Tested-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2018-03-28 11:35:06 +02:00
Wolfgang Bumiller
d6dd6e96e4 parse_protocol_file: support lines without end comments
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Reviewed-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Tested-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2018-03-28 11:35:06 +02:00
Wolfgang Bumiller
58bc569d63 split parser out of get_etc_protocols
Into a reusable parse_protocol_file.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Reviewed-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Tested-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2018-03-28 11:35:06 +02:00
Wolfgang Bumiller
9a19ec817c bump version to 3.0-7
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2018-03-12 14:58:43 +01:00
Fabian Grünbichler
3dffed4c43 multiport: add explaining comment
about ordering single port matches before multiport matches,
and improve readability by adding some blank lines after returns.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2018-03-12 12:48:33 +01:00
Wolfgang Bumiller
f776d6de57 fix and improve multiport handling
The multiport `--ports` parameter is an `OR` match on source
and destination ports, so we should not use it.

We also don't actually use the port count, so let the port
range parser simply return a boolean and use the counter
only for the internal check. This also fixes a regression
caused by the previous multiport check which caused a single
port range to be recognized as a multiport option while it
did not have to be one, causing entries such as the SMB
macro to be added with `--match multiport` mistakenly, which
refused to accept the source port option.

Additionally, we now allow the case with 1 multiport and 1
single port entry: In order for the iptables command to
accept this the single port entry must come first, otherwise
it'll be passed to the multiport matcher (because why
shouldn't it interpret a singular `--Xport` as an alias to
the plural version `--Xports`... *sigh*).

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Fixes: 6a241ca745f7 ("check multiport limit in port ranges")
2018-03-12 12:24:37 +01:00
Dietmar Maurer
8c41d44438 bump version to 3.0-6 2018-03-08 13:53:54 +01:00
Fabian Grünbichler
4382be0afe build: use git rev-parse for GITVERSION
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2018-03-08 13:51:25 +01:00
Fabian Grünbichler
3309bfc87c debian: remove duplicate dh_systemd_enable code
dh_systemd_enable already includes this snippet via the #DEBHELPER#
stanza, no need to duplicate it manually.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2018-03-08 13:51:05 +01:00
Fabian Grünbichler
44e8ce0d15 debian: drop preinst
the only actual code was for upgrading from PVE 3 to PVE 4..

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2018-03-08 13:50:49 +01:00
Fabian Grünbichler
04e57cde93 debian: switch to compat 9
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2018-03-08 13:50:29 +01:00
Fabian Grünbichler
d45e3dc0c6 debian: drop init scripts
and switch to plain dh_systemd_*

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2018-03-08 13:50:18 +01:00
Fabian Grünbichler
2361540014 fix #1319: don't fail postinst with masked service
by using "try-reload-or-restart" instead of "reload-or-restart"

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2018-03-08 13:49:04 +01:00
Wolfgang Bumiller
6a241ca745 check multiport limit in port ranges
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2018-03-08 12:18:20 +01:00
Wolfgang Bumiller
4299c35fc5 bump version to 3.0-5
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2017-12-07 08:31:53 +01:00
Wolfgang Bumiller
7a5a402b56 honor disabled flag on group rules again
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2017-12-07 08:30:01 +01:00
Wolfgang Bumiller
a19d4127e8 bump version to 3.0-4
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2017-11-16 11:42:37 +01:00
Dominik Csapak
53bbbf31e7 sort ipsets so that the digest is consistent
otherwise, editing an ipset randomly works (or not) due to
a wrong digest

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2017-11-15 13:13:54 +01:00
Tom Weber
bf2fa11471 remove ruleset_generate_match, ruleset_generate_action
ruleset_generate_match and ruleset_generate_action not used anymore

Signed-off-by: Tom Weber <pve@junkyard.4t2.com>
2017-10-19 08:00:17 +02:00
Tom Weber
61221d8971 remove unused ruleset_generate_rule_insert
Signed-off-by: Tom Weber <pve@junkyard.4t2.com>
2017-10-19 08:00:17 +02:00