]> git.proxmox.com Git - proxmox-firewall.git/log
proxmox-firewall.git
6 weeks agobump version to 0.3.1
Thomas Lamprecht [Wed, 24 Apr 2024 17:40:43 +0000 (19:40 +0200)]
bump version to 0.3.1

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
6 weeks agofix #5410: config: fix naming scheme for names in firewall config
Stefan Hanreich [Wed, 24 Apr 2024 16:15:20 +0000 (18:15 +0200)]
fix #5410: config: fix naming scheme for names in firewall config

This should bring the allowed names on par with the pve-firewall
naming scheme, allowing also underscores together with minus, as long
it isn't the first character [1].

[1] https://git.proxmox.com/?p=pve-firewall.git;a=blob;f=src/PVE/Firewall.pm;h=0abfeccffc94cec940760e69a894e392dc33f151;hb=29b48c381d14bf425232dc65c9c0d18f95c8f222#l51

Signed-off-by: Stefan Hanreich <s.hanreich@proxmox.com>
 [ TL: expand commit message slightly ]
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
6 weeks agobump version to 0.3.0
Thomas Lamprecht [Tue, 23 Apr 2024 16:34:29 +0000 (18:34 +0200)]
bump version to 0.3.0

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
6 weeks agofirewall: properly handle REJECT rules
Stefan Hanreich [Tue, 23 Apr 2024 16:02:53 +0000 (18:02 +0200)]
firewall: properly handle REJECT rules

Currently we generated DROP statements for all rules involving REJECT.
We only need to generate DROP when in the postrouting chain of tables
with type bridge, since REJECT is disallowed there. Otherwise we jump
into the do-reject chain which properly handles rejects for different
protocol types.

Reported-By: Stefan Sterz <s.sterz@proxmox.com>
Signed-off-by: Stefan Hanreich <s.hanreich@proxmox.com>
6 weeks agobump version to 0.2.1
Thomas Lamprecht [Tue, 23 Apr 2024 11:20:19 +0000 (13:20 +0200)]
bump version to 0.2.1

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
6 weeks agofirewall: properly cleanup tables when firewall is inactive
Stefan Hanreich [Tue, 23 Apr 2024 09:21:39 +0000 (11:21 +0200)]
firewall: properly cleanup tables when firewall is inactive

When executing multiple nft commands they are transactional, either
all get applied or none. When only the host or guest firewall is
active, only one table exists and this causes the delete commands to
fail. To fix this we need to send the delete commands separately.

It might make sense to support running multiple separate batches in
the NftClient in the future in order to avoid having to call nft
twice.

Signed-off-by: Stefan Hanreich <s.hanreich@proxmox.com>
7 weeks agobump version to 0.2.0
Thomas Lamprecht [Fri, 19 Apr 2024 17:42:30 +0000 (19:42 +0200)]
bump version to 0.2.0

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
7 weeks agofirewall: improve systemd unit file
Stefan Hanreich [Fri, 19 Apr 2024 13:00:26 +0000 (15:00 +0200)]
firewall: improve systemd unit file

Explicitly mark the service as simple and remove the PIDFile
attribute, which doesn't do anything with simple services.

Signed-off-by: Stefan Hanreich <s.hanreich@proxmox.com>
7 weeks agofirewall: wait for nft process
Stefan Hanreich [Fri, 19 Apr 2024 13:00:25 +0000 (15:00 +0200)]
firewall: wait for nft process

NftClient never waits for the child process to terminate leading to
defunct leftover processes.

Signed-off-by: Stefan Hanreich <s.hanreich@proxmox.com>
7 weeks agobuildsys: add upload target
Thomas Lamprecht [Thu, 18 Apr 2024 20:02:26 +0000 (22:02 +0200)]
buildsys: add upload target

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
7 weeks agobuildsys: drop bogus DEB variables
Thomas Lamprecht [Thu, 18 Apr 2024 20:02:08 +0000 (22:02 +0200)]
buildsys: drop bogus DEB variables

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
7 weeks agofirewall: add integration test
Stefan Hanreich [Tue, 16 Apr 2024 17:00:15 +0000 (19:00 +0200)]
firewall: add integration test

Signed-off-by: Stefan Hanreich <s.hanreich@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
7 weeks agofirewall: add files for debian packaging
Stefan Hanreich [Fri, 29 Mar 2024 09:53:08 +0000 (10:53 +0100)]
firewall: add files for debian packaging

Suggested-By: Fabian Grünbichler <f.gruenbichler@proxmox.com>
Signed-off-by: Stefan Hanreich <s.hanreich@proxmox.com>
 [ TL: squash in various fixes and clean-ups ]
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
7 weeks agofirewall: add proxmox-firewall binary and move existing code into lib
Stefan Hanreich [Fri, 29 Mar 2024 14:29:15 +0000 (15:29 +0100)]
firewall: add proxmox-firewall binary and move existing code into lib

Co-authored-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Signed-off-by: Stefan Hanreich <s.hanreich@proxmox.com>
Reviewed-by: Lukas Wagner <l.wagner@proxmox.com>
Reviewed-by: Max Carrara <m.carrara@proxmox.com>
7 weeks agofirewall: add ruleset generation logic
Stefan Hanreich [Fri, 29 Mar 2024 14:29:05 +0000 (15:29 +0100)]
firewall: add ruleset generation logic

We create the rules from the firewall config by utilizing the
ToNftRules and ToNftObjects traits to convert the firewall config
structs to nftables objects/chains/rules.

Co-authored-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Signed-off-by: Stefan Hanreich <s.hanreich@proxmox.com>
Reviewed-by: Lukas Wagner <l.wagner@proxmox.com>
Reviewed-by: Max Carrara <m.carrara@proxmox.com>
7 weeks agofirewall: add object generation logic
Stefan Hanreich [Fri, 29 Mar 2024 09:50:20 +0000 (10:50 +0100)]
firewall: add object generation logic

ToNftObjects is basically a conversion trait that converts firewall
config structs into nftables objects. It returns a list of commands
that create the respective nftables objects.

Co-authored-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Signed-off-by: Stefan Hanreich <s.hanreich@proxmox.com>
Reviewed-by: Lukas Wagner <l.wagner@proxmox.com>
Reviewed-by: Max Carrara <m.carrara@proxmox.com>
7 weeks agofirewall: add rule generation logic
Stefan Hanreich [Fri, 29 Mar 2024 15:37:58 +0000 (16:37 +0100)]
firewall: add rule generation logic

ToNftRules is basically a conversion trait for firewall config structs
to convert them into the respective nftables statements.

We are passing a list of rules to the method, which then modifies the
list of rules such that all relevant rules in the list have statements
appended that apply the configured constraints from the firewall
config.

This is particularly relevant for the rule generation logic for
ipsets. Due to how sets work in nftables we need to generate two rules
for every ipset: a rule for the v4 ipset and a rule for the v6 ipset.
This is because sets can only contain either v4 or v6 addresses. By
passing a list of all generated rules we can duplicate all rules and
then add a statement for the v4 or v6 set respectively.

This also enables us to start with multiple rules, which is required
for using log statements in conjunction with limit statements.

Co-authored-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Signed-off-by: Stefan Hanreich <s.hanreich@proxmox.com>
Reviewed-by: Lukas Wagner <l.wagner@proxmox.com>
Reviewed-by: Max Carrara <m.carrara@proxmox.com>
7 weeks agofirewall: add config loader
Stefan Hanreich [Fri, 29 Mar 2024 09:48:30 +0000 (10:48 +0100)]
firewall: add config loader

We load the firewall configuration from the default paths, as well as
only the guest configurations that are local to the node itself. In
the future we could change this to use pmxcfs directly instead.

We also load information from nftables directly about dynamically
created chains (mostly chains for the guest firewall).

Co-authored-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Signed-off-by: Stefan Hanreich <s.hanreich@proxmox.com>
Reviewed-by: Lukas Wagner <l.wagner@proxmox.com>
Reviewed-by: Max Carrara <m.carrara@proxmox.com>
7 weeks agofirewall: add base ruleset
Stefan Hanreich [Fri, 29 Mar 2024 09:51:54 +0000 (10:51 +0100)]
firewall: add base ruleset

This is the skeleton for the firewall that contains all the base
chains required for the firewall.

The file applies atomically, which means that it flushes all objects
and recreates them - except for the cluster/host/guest chain. This
means that it can be run at any point in time, since it only updates
the chains that are not managed by the firewall itself.

This also means that when we change the rules in the chains (e.g.
during an update) we can always just re-run the nft-file and the
firewall should use the new chains while still retaining the
configuration generated by the firewall daemon.

This also means that when re-creating the firewall rules, the
cluster/host/guest chains need to be flushed manually before creating
new rules.

Co-authored-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Signed-off-by: Stefan Hanreich <s.hanreich@proxmox.com>
7 weeks agofirewall: add firewall crate
Stefan Hanreich [Fri, 29 Mar 2024 09:47:10 +0000 (10:47 +0100)]
firewall: add firewall crate

Co-authored-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Signed-off-by: Stefan Hanreich <s.hanreich@proxmox.com>
Reviewed-by: Lukas Wagner <l.wagner@proxmox.com>
Reviewed-by: Max Carrara <m.carrara@proxmox.com>
7 weeks agonftables: add nft client
Stefan Hanreich [Fri, 29 Mar 2024 09:45:58 +0000 (10:45 +0100)]
nftables: add nft client

Add a thin wrapper around nft, which can be used to run commands
defined by the rust types.

Co-authored-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Signed-off-by: Stefan Hanreich <s.hanreich@proxmox.com>
Reviewed-by: Lukas Wagner <l.wagner@proxmox.com>
Reviewed-by: Max Carrara <m.carrara@proxmox.com>
7 weeks agonftables: types: add conversion traits
Stefan Hanreich [Fri, 29 Mar 2024 15:52:06 +0000 (16:52 +0100)]
nftables: types: add conversion traits

Some parts of the firewall config map directly to nftables objects, so
we introduce conversion traits for convenient conversion into the
respective nftables objects / types.

They are guarded behind a feature, so the nftables crate can be used
standalone without depending on the proxmox-ve-config crate.

Co-authored-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Signed-off-by: Stefan Hanreich <s.hanreich@proxmox.com>
Reviewed-by: Lukas Wagner <l.wagner@proxmox.com>
Reviewed-by: Max Carrara <m.carrara@proxmox.com>
7 weeks agonftables: commands: add types
Stefan Hanreich [Wed, 17 Apr 2024 12:55:35 +0000 (14:55 +0200)]
nftables: commands: add types

Add rust types for most of the nftables commands as defined by
libnftables-json [1].

Different commands require different keys to be set for the same type
of object. E.g. deleting an object usually only requires a name +
name of the container (table/chain/rule). Creating an object usually
requires a few more keys, depending on the type of object created.

In order to be able to model the different objects for the different
commands, I've created specific models for a command where necessary.
Parts that are common across multiple commands (e.g. names) have been
moved to their own structs, so they can be reused.

[1] https://manpages.debian.org/bookworm/libnftables1/libnftables-json.5.en.html#COMMAND_OBJECTS

Signed-off-by: Stefan Hanreich <s.hanreich@proxmox.com>
7 weeks agonftables: statement: add conversion traits for config types
Stefan Hanreich [Wed, 17 Apr 2024 12:54:45 +0000 (14:54 +0200)]
nftables: statement: add conversion traits for config types

Some types from the firewall configuration map directly onto nftables
statements. For those we implement conversion traits so we can
conveniently convert between the configuration types and the
respective nftables types.

As with the expressions, those are guarded behind a feature so the
nftables crate can be used standalone without having to pull in the
proxmox-ve-config crate.

Co-authored-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Signed-off-by: Stefan Hanreich <s.hanreich@proxmox.com>
Reviewed-by: Lukas Wagner <l.wagner@proxmox.com>
Reviewed-by: Max Carrara <m.carrara@proxmox.com>
7 weeks agonftables: statement: add types
Stefan Hanreich [Fri, 29 Mar 2024 15:47:21 +0000 (16:47 +0100)]
nftables: statement: add types

Adds an enum containing most of the statements defined in the
nftables-json schema [1].

[1] https://manpages.debian.org/bookworm/libnftables1/libnftables-json.5.en.html#STATEMENTS

Co-authored-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Signed-off-by: Stefan Hanreich <s.hanreich@proxmox.com>
Reviewed-by: Lukas Wagner <l.wagner@proxmox.com>
Reviewed-by: Max Carrara <m.carrara@proxmox.com>
7 weeks agonftables: expression: implement conversion traits for firewall config
Stefan Hanreich [Fri, 29 Mar 2024 13:36:44 +0000 (14:36 +0100)]
nftables: expression: implement conversion traits for firewall config

Some types from the firewall configuration map directly onto nftables
expressions. For those we implement conversion traits so we can
conveniently convert between the configuration types and the
respective nftables types.

Those are guarded behind a feature so the nftables crate can be used
standalone without having to pull in the proxmox-ve-config crate.

Co-authored-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Signed-off-by: Stefan Hanreich <s.hanreich@proxmox.com>
Reviewed-by: Lukas Wagner <l.wagner@proxmox.com>
Reviewed-by: Max Carrara <m.carrara@proxmox.com>
7 weeks agonftables: expression: add types
Stefan Hanreich [Fri, 29 Mar 2024 13:12:59 +0000 (14:12 +0100)]
nftables: expression: add types

Adds an enum containing most of the expressions defined in the
nftables-json schema [1].

[1] https://manpages.debian.org/bookworm/libnftables1/libnftables-json.5.en.html#EXPRESSIONS

Co-authored-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Signed-off-by: Stefan Hanreich <s.hanreich@proxmox.com>
Reviewed-by: Lukas Wagner <l.wagner@proxmox.com>
Reviewed-by: Max Carrara <m.carrara@proxmox.com>
7 weeks agonftables: add helpers
Stefan Hanreich [Fri, 29 Mar 2024 09:34:25 +0000 (10:34 +0100)]
nftables: add helpers

Several objects, statements and expressions in nftables-json require
null values, for instance:

    { "flush": { "ruleset": null }}

For this purpose we define our own Null type, which we can then easily
use for defining types that accept Null as value.

Several keys accept as value either a singular element (string or
object) if there is only one object, but an array if there are
multiple objects. For instance when adding a single element to a set:

           { "element": {
       ...
       "elem": "element1"
           }}

but when adding multiple elements:

           { "element": {
       ...
       "elem": ["element1", "element2"]
           }}

NfVec<T> is a wrapper for Vec<T> that serializes into T iff Vec
contains one element, otherwise it serializes like a Vec would
normally do.

Co-authored-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Signed-off-by: Stefan Hanreich <s.hanreich@proxmox.com>
Reviewed-by: Lukas Wagner <l.wagner@proxmox.com>
Reviewed-by: Max Carrara <m.carrara@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
7 weeks agonftables: add crate for libnftables bindings
Stefan Hanreich [Fri, 29 Mar 2024 09:30:32 +0000 (10:30 +0100)]
nftables: add crate for libnftables bindings

Co-authored-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Signed-off-by: Stefan Hanreich <s.hanreich@proxmox.com>
Reviewed-by: Lukas Wagner <l.wagner@proxmox.com>
Reviewed-by: Max Carrara <m.carrara@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
7 weeks agoconfig: firewall: add conntrack helper types
Stefan Hanreich [Fri, 29 Mar 2024 09:27:17 +0000 (10:27 +0100)]
config: firewall: add conntrack helper types

Co-authored-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Signed-off-by: Stefan Hanreich <s.hanreich@proxmox.com>
Reviewed-by: Lukas Wagner <l.wagner@proxmox.com>
Reviewed-by: Max Carrara <m.carrara@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
7 weeks agoconfig: firewall: add firewall macros
Stefan Hanreich [Fri, 29 Mar 2024 09:26:39 +0000 (10:26 +0100)]
config: firewall: add firewall macros

Co-authored-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Signed-off-by: Stefan Hanreich <s.hanreich@proxmox.com>
Reviewed-by: Lukas Wagner <l.wagner@proxmox.com>
Reviewed-by: Max Carrara <m.carrara@proxmox.com>
7 weeks agoconfig: firewall: add guest-specific config + option types
Stefan Hanreich [Fri, 29 Mar 2024 09:25:08 +0000 (10:25 +0100)]
config: firewall: add guest-specific config + option types

Co-authored-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Signed-off-by: Stefan Hanreich <s.hanreich@proxmox.com>
Reviewed-by: Lukas Wagner <l.wagner@proxmox.com>
Reviewed-by: Max Carrara <m.carrara@proxmox.com>
7 weeks agoconfig: firewall: add host specific config + option types
Stefan Hanreich [Fri, 29 Mar 2024 09:23:36 +0000 (10:23 +0100)]
config: firewall: add host specific config + option types

Co-authored-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Signed-off-by: Stefan Hanreich <s.hanreich@proxmox.com>
Reviewed-by: Lukas Wagner <l.wagner@proxmox.com>
Reviewed-by: Max Carrara <m.carrara@proxmox.com>
7 weeks agoconfig: firewall: add cluster-specific config + option types
Stefan Hanreich [Fri, 29 Mar 2024 09:21:04 +0000 (10:21 +0100)]
config: firewall: add cluster-specific config + option types

Co-authored-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Signed-off-by: Stefan Hanreich <s.hanreich@proxmox.com>
Reviewed-by: Lukas Wagner <l.wagner@proxmox.com>
Reviewed-by: Max Carrara <m.carrara@proxmox.com>
7 weeks agoconfig: firewall: add generic parser for firewall configs
Stefan Hanreich [Fri, 29 Mar 2024 09:19:03 +0000 (10:19 +0100)]
config: firewall: add generic parser for firewall configs

Since the basic format of cluster, host and guest firewall
configurations is the same, we create a generic parser that can handle
the common config format. The main difference is in the available
options, which can be passed via a generic parameter.

Co-authored-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Signed-off-by: Stefan Hanreich <s.hanreich@proxmox.com>
Reviewed-by: Lukas Wagner <l.wagner@proxmox.com>
Reviewed-by: Max Carrara <m.carrara@proxmox.com>
7 weeks agoconfig: firewall: add types for security groups
Stefan Hanreich [Fri, 29 Mar 2024 09:15:33 +0000 (10:15 +0100)]
config: firewall: add types for security groups

Co-authored-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Signed-off-by: Stefan Hanreich <s.hanreich@proxmox.com>
Reviewed-by: Lukas Wagner <l.wagner@proxmox.com>
Reviewed-by: Max Carrara <m.carrara@proxmox.com>
7 weeks agoconfig: firewall: add types for rules
Stefan Hanreich [Fri, 29 Mar 2024 09:14:05 +0000 (10:14 +0100)]
config: firewall: add types for rules

Additionally we implement FromStr for all rule types and parts, which
can be used for parsing firewall config rules. Initial rule parsing
works by parsing the different options into a HashMap and only then
de-serializing a struct from the parsed options.

This intermediate step makes rule parsing a lot easier, since we can
reuse the deserialization logic from serde. Also, we can split the
parsing/deserialization logic from the validation logic.

Co-authored-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Signed-off-by: Stefan Hanreich <s.hanreich@proxmox.com>
Reviewed-by: Lukas Wagner <l.wagner@proxmox.com>
Reviewed-by: Max Carrara <m.carrara@proxmox.com>
7 weeks agoconfig: firewall: add types for ipsets
Stefan Hanreich [Fri, 29 Mar 2024 09:07:58 +0000 (10:07 +0100)]
config: firewall: add types for ipsets

Co-authored-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Signed-off-by: Stefan Hanreich <s.hanreich@proxmox.com>
Reviewed-by: Lukas Wagner <l.wagner@proxmox.com>
Reviewed-by: Max Carrara <m.carrara@proxmox.com>
7 weeks agoconfig: guest: add helpers for parsing guest network config
Stefan Hanreich [Fri, 29 Mar 2024 09:04:38 +0000 (10:04 +0100)]
config: guest: add helpers for parsing guest network config

Currently this is parsing the config files via the filesystem. In the
future we could also get this information from pmxcfs directly via
IPC which should be more performant, particularly for a large number
of VMs.

Co-authored-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Signed-off-by: Stefan Hanreich <s.hanreich@proxmox.com>
Reviewed-by: Lukas Wagner <l.wagner@proxmox.com>
Reviewed-by: Max Carrara <m.carrara@proxmox.com>
7 weeks agoconfig: host: add helpers for host network configuration
Stefan Hanreich [Fri, 29 Mar 2024 09:01:14 +0000 (10:01 +0100)]
config: host: add helpers for host network configuration

Currently the helpers for obtaining the host network configuration
panic on error, which could be avoided by the use of
OnceLock::get_or_init, but this method is currently only available in
nightly versions.

Generally, if there is a problem with obtaining the network config for
the node I would deem it acceptable for now, since that would usually
mean something is amiss with the network configuration and a firewall
won't really do anything then anyway.

Co-authored-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Signed-off-by: Stefan Hanreich <s.hanreich@proxmox.com>
Reviewed-by: Lukas Wagner <l.wagner@proxmox.com>
Reviewed-by: Max Carrara <m.carrara@proxmox.com>
7 weeks agoconfig: firewall: add types for aliases
Stefan Hanreich [Fri, 29 Mar 2024 08:55:33 +0000 (09:55 +0100)]
config: firewall: add types for aliases

Co-authored-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Signed-off-by: Stefan Hanreich <s.hanreich@proxmox.com>
Reviewed-by: Lukas Wagner <l.wagner@proxmox.com>
Reviewed-by: Max Carrara <m.carrara@proxmox.com>
7 weeks agoconfig: firewall: add types for log level and rate limit
Stefan Hanreich [Fri, 29 Mar 2024 08:52:37 +0000 (09:52 +0100)]
config: firewall: add types for log level and rate limit

Adds types for log and (log-)rate-limiting firewall config options as
well as FromStr implementations for parsing them from the config.

Co-authored-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Signed-off-by: Stefan Hanreich <s.hanreich@proxmox.com>
Reviewed-by: Lukas Wagner <l.wagner@proxmox.com>
Reviewed-by: Max Carrara <m.carrara@proxmox.com>
7 weeks agoconfig: firewall: add types for ports
Stefan Hanreich [Fri, 29 Mar 2024 08:48:50 +0000 (09:48 +0100)]
config: firewall: add types for ports

Adds types for all kinds of port-related values in the firewall config
as well as FromStr implementations for parsing them from the config.

Also adds a helper for parsing the named ports from `/etc/services`.

Co-authored-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Signed-off-by: Stefan Hanreich <s.hanreich@proxmox.com>
Reviewed-by: Lukas Wagner <l.wagner@proxmox.com>
Reviewed-by: Max Carrara <m.carrara@proxmox.com>
7 weeks agoconfig: firewall: add types for ip addresses
Stefan Hanreich [Tue, 2 Apr 2024 11:33:33 +0000 (13:33 +0200)]
config: firewall: add types for ip addresses

Includes types for all kinds of IP values that can occur in the
firewall config. Additionally, FromStr implementations are available
for parsing from the config files.

Co-authored-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Signed-off-by: Stefan Hanreich <s.hanreich@proxmox.com>
Reviewed-by: Lukas Wagner <l.wagner@proxmox.com>
Reviewed-by: Max Carrara <m.carrara@proxmox.com>
7 weeks agoconfig: add proxmox-ve-config crate
Stefan Hanreich [Fri, 29 Mar 2024 08:41:50 +0000 (09:41 +0100)]
config: add proxmox-ve-config crate

Co-authored-by: Wolfgang Bumiller<w.bumiller@proxmox.com>
Signed-off-by: Stefan Hanreich <s.hanreich@proxmox.com>
Reviewed-by: Lukas Wagner <l.wagner@proxmox.com>
Reviewed-by: Max Carrara <m.carrara@proxmox.com>