5
0
mirror of git://git.proxmox.com/git/pve-firewall.git synced 2025-08-25 21:49:30 +03:00

891 Commits

Author SHA1 Message Date
3c57745acd followup: use default burst limit of 5
it does not hurt and can be be used to see high frequeny occurences
of certain rules which hit.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-03-19 14:36:42 +01:00
3489f8a2b9 fix: #2123 Logging of user defined firewall rules
This allows a user to log traffic filtered by a self defined firewall rule.
Therefore the API is extended to include a 'log' option allow to specify the
log level for each rule individually.

The 'log' option can also be specified in the fw config. In order to reduce the
log amount, logging is limited to 1 entry per second.

For now the rule has to be created or edited via the pvesh API call or via the
firewall config in order to set the log level.

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
2019-03-19 13:39:55 +01:00
33efd363ab ebtables: test layer2_protocols in an external chain
We need the not matching DROP outside the main tapchain,
in a specific proto chain, and a ACCEPT in the main tap chain.

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2019-03-12 07:35:56 +01:00
401c141b36 ebtables: add arp filtering
This implemented arp filtering if ipfilter is enable
https://bugzilla.proxmox.com/show_bug.cgi?id=2125

They are another filters possible (ipv4,rarp),
i don't known if we need them.

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2019-03-12 07:35:56 +01:00
d8ea08e395 bump version to 3.0-18
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-03-04 10:27:42 +01:00
07731b19db d/control: bump version dependency to pve-doc-generator
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-02-22 13:31:32 +01:00
2b9ac8633a 1891 Add zsh command completion for pve-firewall
Adds the zsh command completion scripts for pve-firewall.

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
2019-02-22 11:44:49 +01:00
b4c72cfae9 daemon: cleanup '+' character at begin of line
this stray '+' was introduced by
commit 151c209e05 while it had no
effect let's remove it nonetheless.
2019-02-20 07:22:02 +01:00
45c8eeb8bd Fix unitialized value $mark in bitwise operation
Signed-off-by: Alwin Antreich <a.antreich@proxmox.com>
2019-02-18 10:38:05 +01:00
d8d4dd6749 log reject : add space after policy REJECT like drop
For log consistency and parsing, we already have a space after "policy DROP: "
but not REJECT

ex:

DROP
135 6 tap135i1-IN 05/Feb/2019:10:59:55 +0100 policy DROP: IN=.....

REJECT
232 6 tap232i1-IN 05/Feb/2019:10:59:28 +0100 policy REJECT:IN=....
2019-02-05 11:29:25 +01:00
b409c8a834 followup: avoid long hash access, use own variable
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-02-04 14:22:41 +01:00
27c49e251c Fix #1606 Add nf_conntrack_allow_invalid option
This adds the nf_conntrack_allow_invalid host firewall option to allow to disable
the dropping of invalid packets from the connection tracker point of view.
This is needed for some rare setups with asymmetrical multi-path routing.

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
2019-02-04 14:13:22 +01:00
05018f6e8b buildsys: build a dbgsym package
don't forcefully strip debug components out of the firewall
logger...

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2019-01-25 10:56:18 +01:00
91d88bc517 bump version to 3.0-17
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-01-09 16:56:32 +01:00
77331e89ed log and ignore ENOBUFS in nfct_catch
nfct_catch sets ENOBUFS if not enough buffer space is available. log
and continue operation instead of stopping. in addition log possible
other errors set by nfct_catch

Signed-off-by: David Limbeck <d.limbeck@proxmox.com>
2019-01-09 16:27:20 +01:00
b4e43fe3da fixup va_arg usage
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2019-01-09 14:26:00 +01:00
6c27f4f30b add log_nf_conntrack host firewall option
add log_nf_conntrack host firewall option to enable or disable logging
of connections. restarts pvefw-logger if the option changes in the
config. the pvefw-logger is always restarted in the beginning to make
sure the current config is applied.

Signed-off-by: David Limbeck <d.limbeck@proxmox.com>
2018-12-13 14:26:24 +01:00
fdf943fe82 add conntrack logging via libnetfilter_conntrack
add conntrack logging to pvefw-logger including timestamps (requires
/proc/sys/net/netfilter/nf_conntrack_timestamp to be 1).
this allows the tracking of sessions (start, end timestamps with
nf_conntrack_timestamp on [DESTROY] messages). commit includes
Build-Depends inclusion of libnetfilter-conntrack-dev and
libnetfilter_conntrack library in the Makefile.

Signed-off-by: David Limbeck <d.limbeck@proxmox.com>
2018-12-13 14:26:24 +01:00
12be0dfe9f fix #2004: do not allow backwards ranges
ranges like 10:5 are allowed by us, but iptables throws an error
that is only visible in the syslog and the firewall rules do not
get updated

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2018-12-03 14:11:08 +01:00
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
81d13a9d36 bump version to 3.0-16
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2018-11-30 16:03:11 +01:00
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
bed701bc0d bump version to 3.0-15
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2018-11-23 14:05:23 +01:00
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
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
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
a24b157ba4 bump version to 3.0-14
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2018-08-24 10:51:19 +02:00
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
cf7dd94bdd bump version to 3.0-13
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2018-06-28 14:47:25 +02:00
2e30c5c7ed ebtables: sort guest chains during rulecreation
Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
2018-06-28 14:45:09 +02:00
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
76448f08f4 whitespace fixup
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2018-06-18 11:06:09 +02:00
dd03bf6e2f bump version to 3.0-12
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2018-06-12 12:02:32 +02:00
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
587a0f205e fixup changelog UNRELEASED 2018-06-06 16:18:48 +02:00
a3a51dad63 bump version to 3.0-11 2018-06-06 16:15:01 +02:00
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
423b86effc bump version to 3.0-10
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2018-05-29 15:14:43 +02:00
d4a23c880d typo fixup
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2018-05-29 15:08:25 +02:00
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
567e58ce1b bump version to 3.0-9
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2018-05-17 14:41:40 +02:00
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
ea0d59edd2 bump version to 3.0-8
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2018-04-11 14:26:15 +02:00
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
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
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
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
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
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
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