]> git.proxmox.com Git - proxmox.git/log
proxmox.git
3 months agosys: bump d/control
Wolfgang Bumiller [Mon, 17 Jun 2024 12:10:56 +0000 (14:10 +0200)]
sys: bump d/control

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
3 months agosys: bmp to 0.5.6-1
Wolfgang Bumiller [Mon, 17 Jun 2024 12:04:58 +0000 (14:04 +0200)]
sys: bmp to 0.5.6-1

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
3 months agosys: use anyhow Error type for create_dir, and improve error messages
Dietmar Maurer [Thu, 13 Jun 2024 09:26:30 +0000 (11:26 +0200)]
sys: use anyhow Error type for create_dir, and improve error messages

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
3 months agoRevert "sys: cleanup, remove unnecessary crate prefix"
Dietmar Maurer [Thu, 13 Jun 2024 09:31:02 +0000 (11:31 +0200)]
Revert "sys: cleanup, remove unnecessary crate prefix"

This reverts commit 26922d179685d24bbd7697433a095a4066310c9a, because
it is necessary.

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
3 months agoauth-api: add PasswordAuthenticator
Wolfgang Bumiller [Wed, 12 Jun 2024 13:12:29 +0000 (15:12 +0200)]
auth-api: add PasswordAuthenticator

This is the PbsAuthenticator with the hardcoded shadow.json/lock
configurable.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
3 months agoproduct-config: add open_secret_lockfile
Wolfgang Bumiller [Wed, 12 Jun 2024 13:28:54 +0000 (15:28 +0200)]
product-config: add open_secret_lockfile

We need this for things like shadow.json.lock.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
3 months agosys: cleanup, remove unnecessary crate prefix
Dietmar Maurer [Thu, 13 Jun 2024 08:20:18 +0000 (10:20 +0200)]
sys: cleanup, remove unnecessary crate prefix

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
3 months agoacme-api: show all certificate subject_alt_names (DNS, IP, EMAIL, URI)
Dietmar Maurer [Tue, 11 Jun 2024 12:11:11 +0000 (14:11 +0200)]
acme-api: show all certificate subject_alt_names (DNS, IP, EMAIL, URI)

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
3 months agosimple-config: bump to 0.1.0-1
Wolfgang Bumiller [Fri, 7 Jun 2024 09:06:08 +0000 (11:06 +0200)]
simple-config: bump to 0.1.0-1

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
3 months agoacme-api: add function to extract certificate data from .pem data
Dietmar Maurer [Thu, 6 Jun 2024 11:42:47 +0000 (13:42 +0200)]
acme-api: add function to extract certificate data from .pem data

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
3 months agoacme-api: implement funtion to create self signed certificates
Dietmar Maurer [Thu, 6 Jun 2024 10:38:03 +0000 (12:38 +0200)]
acme-api: implement funtion to create self signed certificates

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
3 months agoapt: update d/control
Fabian Grünbichler [Thu, 6 Jun 2024 09:34:47 +0000 (11:34 +0200)]
apt: update d/control

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
3 months agobump proxmox-apt to 0.10.10-1
Fabian Grünbichler [Thu, 6 Jun 2024 09:09:27 +0000 (11:09 +0200)]
bump proxmox-apt to 0.10.10-1

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
3 months agoapt: fix test output dir
Fabian Grünbichler [Thu, 6 Jun 2024 09:32:19 +0000 (11:32 +0200)]
apt: fix test output dir

under autopkgtest, the rundir is not writable, but cargo gives us a tmpdir that
we can use in all cases.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
3 months agovarious clippy fixes
Fabian Grünbichler [Thu, 6 Jun 2024 09:21:24 +0000 (11:21 +0200)]
various clippy fixes

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
3 months agoacme-api: pass parameters by reference
Dietmar Maurer [Thu, 6 Jun 2024 08:26:23 +0000 (10:26 +0200)]
acme-api: pass parameters by reference

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
3 months agofix #5513: apt: do not assume that sources.list file exists
Fiona Ebner [Wed, 5 Jun 2024 08:29:24 +0000 (10:29 +0200)]
fix #5513: apt: do not assume that sources.list file exists

Some users might want to switch to using only the newer .sources files
already, which Debian is going to switch to in the long run.

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
3 months agoacme-api: implement revoke certificate helper
Dietmar Maurer [Thu, 6 Jun 2024 08:23:35 +0000 (10:23 +0200)]
acme-api: implement revoke certificate helper

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
3 months agosimple-config: new crate to read/write proxmox simple text config files
Dietmar Maurer [Wed, 5 Jun 2024 11:06:16 +0000 (13:06 +0200)]
simple-config: new crate to read/write proxmox simple text config files

Copied from proxmox-backup/src/tools/config.rs

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
3 months agorun `cargo fmt`
Fabian Grünbichler [Wed, 5 Jun 2024 11:31:06 +0000 (13:31 +0200)]
run `cargo fmt`

(again)

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
3 months agoacme-api: bump to 0.1.0-1
Wolfgang Bumiller [Wed, 5 Jun 2024 10:12:52 +0000 (12:12 +0200)]
acme-api: bump to 0.1.0-1

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
3 months agotime-api: bump version to 0.1.0-1
Wolfgang Bumiller [Wed, 5 Jun 2024 09:28:59 +0000 (11:28 +0200)]
time-api: bump version to 0.1.0-1

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
3 months agosyslog-api: bump to 0.1.0-1
Wolfgang Bumiller [Wed, 5 Jun 2024 09:28:10 +0000 (11:28 +0200)]
syslog-api: bump to 0.1.0-1

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
3 months agonetwork-api: bump to 0.1.0-1
Wolfgang Bumiller [Wed, 5 Jun 2024 09:27:30 +0000 (11:27 +0200)]
network-api: bump to 0.1.0-1

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
3 months agodns-api: bump to 0.1.0-1
Wolfgang Bumiller [Wed, 5 Jun 2024 09:25:30 +0000 (11:25 +0200)]
dns-api: bump to 0.1.0-1

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
3 months agoproduct-config: bump to 0.1.0-1
Wolfgang Bumiller [Wed, 5 Jun 2024 09:26:51 +0000 (11:26 +0200)]
product-config: bump to 0.1.0-1

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
3 months agoconfig-digest: bump to 0.1.0-1
Wolfgang Bumiller [Wed, 5 Jun 2024 09:24:38 +0000 (11:24 +0200)]
config-digest: bump to 0.1.0-1

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
3 months agoacme-api: use replace_secret_config to write acme config files
Dietmar Maurer [Tue, 4 Jun 2024 11:14:20 +0000 (13:14 +0200)]
acme-api: use replace_secret_config to write acme config files

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
3 months agoacme-api: use create_secret_dir from product-config
Dietmar Maurer [Tue, 4 Jun 2024 10:56:57 +0000 (12:56 +0200)]
acme-api: use create_secret_dir from product-config

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
3 months agoproduct-config: new create_secret_dir function
Dietmar Maurer [Tue, 4 Jun 2024 10:53:41 +0000 (12:53 +0200)]
product-config: new create_secret_dir function

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
3 months agoproduct-config: code cleanup
Dietmar Maurer [Tue, 4 Jun 2024 10:52:25 +0000 (12:52 +0200)]
product-config: code cleanup

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
3 months agoacme-api: create all directorties inside init
Dietmar Maurer [Tue, 4 Jun 2024 10:22:16 +0000 (12:22 +0200)]
acme-api: create all directorties inside init

3 months agoproduct_config: introduce priviledged user.
Dietmar Maurer [Tue, 4 Jun 2024 09:14:07 +0000 (11:14 +0200)]
product_config: introduce priviledged user.

Normally root, but can be the same as the api_user if the product
does not use priviledge separation.

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
3 months agoproduct-config: export get_api_user
Dietmar Maurer [Tue, 4 Jun 2024 09:02:23 +0000 (11:02 +0200)]
product-config: export get_api_user

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
3 months agoacme-api: export ChallengeSchemaWrapper
Dietmar Maurer [Mon, 3 Jun 2024 10:55:43 +0000 (12:55 +0200)]
acme-api: export ChallengeSchemaWrapper

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
3 months agoacme-api: export account_config_filename
Dietmar Maurer [Mon, 3 Jun 2024 10:29:16 +0000 (12:29 +0200)]
acme-api: export account_config_filename

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
3 months agoacme-api: make register_account directory parameter optional
Dietmar Maurer [Mon, 3 Jun 2024 08:45:45 +0000 (10:45 +0200)]
acme-api: make register_account directory parameter optional

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
3 months agoacme-api: export known directories
Dietmar Maurer [Mon, 3 Jun 2024 08:39:33 +0000 (10:39 +0200)]
acme-api: export known directories

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
3 months agoacme-api: export api types at top-level
Dietmar Maurer [Mon, 3 Jun 2024 08:03:06 +0000 (10:03 +0200)]
acme-api: export api types at top-level

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
3 months agosyslog-api: add debian control file
Dietmar Maurer [Mon, 3 Jun 2024 07:32:11 +0000 (09:32 +0200)]
syslog-api: add debian control file

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
3 months agonetwork-api: add debian control file
Dietmar Maurer [Mon, 3 Jun 2024 07:29:57 +0000 (09:29 +0200)]
network-api: add debian control file

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
3 months agotime-api: add copyright file
Dietmar Maurer [Mon, 3 Jun 2024 07:27:38 +0000 (09:27 +0200)]
time-api: add copyright file

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
3 months agodns-api: add debian control file
Dietmar Maurer [Mon, 3 Jun 2024 07:24:26 +0000 (09:24 +0200)]
dns-api: add debian control file

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
3 months agodns-api: avoid auto-generated cargo features
Dietmar Maurer [Mon, 3 Jun 2024 07:21:42 +0000 (09:21 +0200)]
dns-api: avoid auto-generated cargo features

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
3 months agoproduct-config: add debian control file
Dietmar Maurer [Mon, 3 Jun 2024 07:14:14 +0000 (09:14 +0200)]
product-config: add debian control file

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
3 months agoacme-api: remove stale feature gate and always compile api types
Dietmar Maurer [Mon, 3 Jun 2024 07:08:16 +0000 (09:08 +0200)]
acme-api: remove stale feature gate and always compile api types

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
3 months agoacme-api: commit missing file
Dietmar Maurer [Fri, 31 May 2024 10:35:42 +0000 (12:35 +0200)]
acme-api: commit missing file

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
3 months agoacme-api: remove useless api-types feature
Dietmar Maurer [Fri, 31 May 2024 10:19:10 +0000 (12:19 +0200)]
acme-api: remove useless api-types feature

We always need those types, so there is no need to make this a feature.

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
3 months agoacme-api: add init method to setup directories
Dietmar Maurer [Fri, 31 May 2024 10:12:23 +0000 (12:12 +0200)]
acme-api: add init method to setup directories

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
3 months agoproduct-config: simplify by removing the configuration directory
Dietmar Maurer [Fri, 31 May 2024 09:29:59 +0000 (11:29 +0200)]
product-config: simplify by removing the configuration directory

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
3 months agoremove system-management-api
Dietmar Maurer [Thu, 30 May 2024 07:53:59 +0000 (09:53 +0200)]
remove system-management-api

Which is now split into separate crates:

- time-api
- network-api
- dns-api
- syslog-api

3 months agosyslog-api: new crate, split out from system-management-api
Dietmar Maurer [Thu, 30 May 2024 07:44:48 +0000 (09:44 +0200)]
syslog-api: new crate, split out from system-management-api

3 months agonetwork-api: new crate, split out from system-management-api
Dietmar Maurer [Thu, 30 May 2024 07:23:08 +0000 (09:23 +0200)]
network-api: new crate, split out from system-management-api

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
3 months agotime-api: new crate, split out from system-managent-api
Dietmar Maurer [Thu, 30 May 2024 06:52:37 +0000 (08:52 +0200)]
time-api: new crate, split out from system-managent-api

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
3 months agodns-api: new crate, split out from system-management-api
Dietmar Maurer [Thu, 30 May 2024 06:43:32 +0000 (08:43 +0200)]
dns-api: new crate, split out from system-management-api

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
3 months agoproduct-config: remove digest implementation (move to proxmox-config-digest crate)
Dietmar Maurer [Wed, 29 May 2024 16:40:11 +0000 (18:40 +0200)]
product-config: remove digest implementation (move to proxmox-config-digest crate)

And use the new proxmox-config-digest crate instead.

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
3 months agoconfig-digest: split out config digest api type into separate crate
Dietmar Maurer [Wed, 29 May 2024 15:59:03 +0000 (17:59 +0200)]
config-digest: split out config digest api type into separate crate

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
3 months agosys: use 0750 as default directory permissions
Dietmar Maurer [Wed, 29 May 2024 09:04:41 +0000 (11:04 +0200)]
sys: use 0750 as default directory permissions

Should not make a difference because default umask is 022 ...

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
4 months agoproduct-config: remove functions to check permissions, which are now in proxmox-sys.
Dietmar Maurer [Wed, 29 May 2024 08:19:00 +0000 (10:19 +0200)]
product-config: remove functions to check permissions, which are now in proxmox-sys.

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
4 months agosys: add helpers to check file and directory permissions
Dietmar Maurer [Wed, 29 May 2024 08:14:24 +0000 (10:14 +0200)]
sys: add helpers to check file and directory permissions

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
4 months agosys: create options: make file parameter generic
Dietmar Maurer [Wed, 29 May 2024 07:28:07 +0000 (09:28 +0200)]
sys: create options: make file parameter generic

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
4 months agoproduct-config: factor out methods to create different file creation options
Dietmar Maurer [Wed, 29 May 2024 05:47:17 +0000 (07:47 +0200)]
product-config: factor out methods to create different file creation options

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
4 months agoproduct-config: use Path instead of str everywhere
Dietmar Maurer [Wed, 29 May 2024 04:52:04 +0000 (06:52 +0200)]
product-config: use Path instead of str everywhere

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
4 months agolang: drop commented-out c_str! implementation variants
Wolfgang Bumiller [Fri, 24 May 2024 10:56:41 +0000 (12:56 +0200)]
lang: drop commented-out c_str! implementation  variants

This was an old version of a const-fn compatible checked c_str
implementation which was never enabled.

When we get rust 1.72, `CStr::from_bytes_with_nul` becomes usable in
const contexts.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
4 months agometrics: influxdb test uri creation
Gabriel Goller [Thu, 23 May 2024 11:18:17 +0000 (13:18 +0200)]
metrics: influxdb test uri creation

Extract the URI creation for write and health URIs. Add unit test to
test the encoding of special characters in the organization and bucket
parameters.

Follow-up-to: bfa73aad ("metrics: encode influxdb org and bucket parameters")
Signed-off-by: Gabriel Goller <g.goller@proxmox.com>
FG: downgraded form_urlencoded version to packaged one
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
4 months agoauth-api: bump version to 0.4.0
Wolfgang Bumiller [Wed, 22 May 2024 13:59:15 +0000 (15:59 +0200)]
auth-api: bump version to 0.4.0

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
4 months agosys: bump version to 0.5.5-1
Wolfgang Bumiller [Wed, 22 May 2024 13:48:00 +0000 (15:48 +0200)]
sys: bump version to 0.5.5-1

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
4 months agoauth-api: rustfmt
Wolfgang Bumiller [Wed, 22 May 2024 13:41:56 +0000 (15:41 +0200)]
auth-api: rustfmt

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
4 months agoauth-api: cleanup a warning
Wolfgang Bumiller [Wed, 22 May 2024 13:40:12 +0000 (15:40 +0200)]
auth-api: cleanup a warning

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
4 months agoauth-api: remove unnecessary allocation
Wolfgang Bumiller [Wed, 22 May 2024 13:38:26 +0000 (15:38 +0200)]
auth-api: remove unnecessary allocation

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
4 months agoauth-api: fix types `compilefail` test
Stefan Sterz [Wed, 6 Mar 2024 12:36:05 +0000 (13:36 +0100)]
auth-api: fix types `compilefail` test

due to missing `use` statements they failed, as they should, but for
the wrong reasons. also adapt a test case that presumably was meant
to test whether `TokennameRef` can be compared, but instead
duplicated the `UsernameRef` test case.

Signed-off-by: Stefan Sterz <s.sterz@proxmox.com>
4 months agosys: crypt: use constant time comparison for password verification
Stefan Sterz [Wed, 6 Mar 2024 12:36:04 +0000 (13:36 +0100)]
sys: crypt: use constant time comparison for password verification

by using `openssl::memcmp::eq()` we can avoid potential timing side
channels as its runtime only depends on the length of the arrays, not
the contents. this requires the two arrays to have the same length, but
that should be a given since the hashes should always have the same
length.

Signed-off-by: Stefan Sterz <s.sterz@proxmox.com>
4 months agosys: crypt: move to yescrypt for password hashing
Stefan Sterz [Wed, 6 Mar 2024 12:36:03 +0000 (13:36 +0100)]
sys: crypt: move to yescrypt for password hashing

previously we used `sha256scrypt` for password hashing. while this may
by safe if used with the correct parameters, we used the default
parameters which are considered unsafe. according to `man crypt(5)`:

> The default CPU time cost parameter is 5000, which is too low for
> modern hardware.

hence, we needed to adapt this code anyway. conveniently, verification
with crypt also works for older hashes as the parameters for the
hashing function are encoded in the output of crypt. so this is a drop
in replacement that will simply use yescrypt for new hashes while
old hashes will still verify properly.

this commit also adds a wrapper for `crypt_gensalt_rn` to more easily
generate correctly formatted salt strings. this is also useful for
switching the cpu time hardness parameter, as otherwise we'd need to
encode that ourselves.

Signed-off-by: Stefan Sterz <s.sterz@proxmox.com>
4 months agoauth-api: move to hmac signing for csrf tokens
Stefan Sterz [Wed, 6 Mar 2024 12:36:02 +0000 (13:36 +0100)]
auth-api: move to hmac signing for csrf tokens

previously we used our own hmac-like implementation for csrf token
signing that simply appended the key to the message (csrf token).
however, this is possibly insecure as an attacker that finds a
collision in the hash function can easily forge a signature. after all,
two messages would then produce the same start conditions before
hashing the key. while this is probably a theoretic attack on our csrf
implementation, it does not hurt to move to the safer standard hmac
implementation that avoids such pitfalls.

this commit re-uses the hmac key wrapper used for the keyring. it also
keeps the old construction around so we can use it for a transition
period between old and new csrf token implementations.

this is a breaking change as it changes the signature of the
`csrf_secret` method of the `AuthContext` trait to return an hmac
key.

also exposes `assemble_csrf_prevention_toke` so we can re-use this
code here instead of duplicating it in e.g. proxmox-backup's
auth_helpers.

Signed-off-by: Stefan Sterz <s.sterz@proxmox.com>
4 months agoauth-api: use constant time comparison for csrf tokens
Stefan Sterz [Wed, 6 Mar 2024 12:36:01 +0000 (13:36 +0100)]
auth-api: use constant time comparison for csrf tokens

by using openssl's `memcmp::eq()` we can avoid potential side-channel
attack on the csrf token comparison. this comparison's runtime only
depends on the length of the two byte vectors, not their contents.

Signed-off-by: Stefan Sterz <s.sterz@proxmox.com>
4 months agoauth-api: add ability to use hmac singing in keyring
Stefan Sterz [Wed, 6 Mar 2024 12:36:00 +0000 (13:36 +0100)]
auth-api: add ability to use hmac singing in keyring

previously we only used asymmetric cryptographic schemes to
authenticate tickets. this is fairly costly and not necessary in every
instance. imagine a service that runs as a single daemon. this daemon
is then the only party that needs to sign and verify tickets. this
makes hmac perfectly suitable for such usecases. hmac has some
advantages over asymmetric schemes:

- much simpler and well reviewed construction
- much faster and better optimized crypto primitives (hash functions)

this commit first introduces a new hmac key wrapper that uses openssl's
hmac implementation and can easily be reused by other parts of the
code. it also refactors the keyring code to make it easier to rotate
new hmac keys into place so switching to hmac keys is easier.

hmac keys are symmetric, so the verification key is the same key as the
signing key. this breaks the previous assumption by the keyring that
these correspond to public and private keys. thus, this commit
introduces two wrapper enums to distinguish between hmac and asymmetric
signature schemes.

the verification of hmac keys is also done via `openssl::memcmp::eq()`
to avoid potential timing side-channel attacks.

below are some simple benchmarks done with criterion.rs to show how much
faster hmac is, no matter the actual hash function:

rsa 4096 + sha256        time:   [2.7825 ms 2.7907 ms 2.7995 ms]
ed25519                  time:   [94.411 µs 94.840 µs 95.324 µs]
hmac sha256              time:   [5.7202 µs 5.7412 µs 5.7645 µs]
hmac sha384              time:   [6.6577 µs 6.6780 µs 6.7006 µs]
hmac sha3_256            time:   [5.6930 µs 5.7114 µs 5.7322 µs]

rsa with 4096 bit keys and a sha256 digest is our current default. the
test itself consists of a single sign + verification cycle. criterion
repeats this test as it sees fit to arrive at the above numbers.

Signed-off-by: Stefan Sterz <s.sterz@proxmox.com>
4 months agoauth-api: move to Ed25519 signatures
Stefan Sterz [Wed, 6 Mar 2024 12:35:59 +0000 (13:35 +0100)]
auth-api: move to Ed25519 signatures

previously we used P-256 as the curve of our choice for ec signatures.
however, in the meantime Ed25519 has become a lot more wide-spread.
this simplifies our ec generation code significantly while keeping the
same security level. Ed25519 was also specifically designed and
reviewed to avoid implementation errors likely making it a more secure
choice

note that Ed25519 as a signature scheme always uses sha512, so signing
or verifying with a chosen digest is not supported.

as this mostly affects newly generated keys, this should not break any
existing setups.

Signed-off-by: Stefan Sterz <s.sterz@proxmox.com>
4 months agoauth-api: move signing into the private key
Stefan Sterz [Wed, 6 Mar 2024 12:35:58 +0000 (13:35 +0100)]
auth-api: move signing into the private key

this commit moves the current ticket signing code into the private key
implementation. the upside is that the caller does not need to deal
with openssl's `Signer` directly. it also simplifies and unifies the
code by using the same helper for verifying a signature and creating it.

also derive `Clone` on `PrivateKey` and `PublicKey`. as they are
essentially thin wrappers around `openssl::pkey::PKey<Private>` and
`openssl::pkey::PKey<Public>`, which can be cloned, deriving `Clone`
just makes them easier to use.

Signed-off-by: Stefan Sterz <s.sterz@proxmox.com>
4 months agoacme-api: add debian packaging
Dietmar Maurer [Fri, 17 May 2024 10:10:13 +0000 (12:10 +0200)]
acme-api: add debian packaging

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
4 months agoacme-api: use product-config instead of custom acme api configuration
Dietmar Maurer [Fri, 17 May 2024 09:52:57 +0000 (11:52 +0200)]
acme-api: use product-config instead of custom acme api configuration

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
4 months agobump proxmox-section-config to 2.0.2-1
Dietmar Maurer [Fri, 17 May 2024 09:04:10 +0000 (11:04 +0200)]
bump proxmox-section-config to 2.0.2-1

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
4 months agosection-config: pass filesystem paths as AsRef<Path>
Dietmar Maurer [Fri, 17 May 2024 08:57:35 +0000 (10:57 +0200)]
section-config: pass filesystem paths as AsRef<Path>

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
4 months agoacme-api: reusable ACME api implementation.
Dietmar Maurer [Wed, 20 Mar 2024 08:59:23 +0000 (09:59 +0100)]
acme-api: reusable ACME api implementation.

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
4 months agobump proxmox-acme to 0.5.2
Dietmar Maurer [Thu, 16 May 2024 09:37:09 +0000 (11:37 +0200)]
bump proxmox-acme to 0.5.2

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
4 months agoacme: add async-client feature
Dietmar Maurer [Wed, 20 Mar 2024 12:03:53 +0000 (13:03 +0100)]
acme: add async-client feature

The client code is copied from propxmox-backup, without the load/safe
account functionality.

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
4 months agoacme: allow to compile/use api types separately.
Dietmar Maurer [Mon, 18 Mar 2024 12:08:23 +0000 (13:08 +0100)]
acme: allow to compile/use api types separately.

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
4 months agosystem-management-api: network: add create_interface and update_interface
Dietmar Maurer [Thu, 16 May 2024 08:24:41 +0000 (10:24 +0200)]
system-management-api: network: add create_interface and update_interface

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
4 months agosystem-management: use ip/cidr schema types from proxmox-schema
Dietmar Maurer [Thu, 16 May 2024 07:42:10 +0000 (09:42 +0200)]
system-management: use ip/cidr schema types from proxmox-schema

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
4 months agobump proxmox-schema to 3.1.1-1
Dietmar Maurer [Thu, 16 May 2024 07:35:50 +0000 (09:35 +0200)]
bump proxmox-schema to 3.1.1-1

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
4 months agoschema: api-types: add ip/cidr api schemas
Dietmar Maurer [Thu, 16 May 2024 07:09:37 +0000 (09:09 +0200)]
schema: api-types: add ip/cidr api schemas

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
4 months agosystem-management-api: rename features (add suffix -api-types)
Dietmar Maurer [Wed, 15 May 2024 11:33:55 +0000 (13:33 +0200)]
system-management-api: rename features (add suffix -api-types)

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
4 months agorename proxmox-system-config-api to proxmox-system-management-api
Dietmar Maurer [Wed, 15 May 2024 11:23:42 +0000 (13:23 +0200)]
rename proxmox-system-config-api to proxmox-system-management-api

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
4 months agosystem-config-api: add syslog feature
Dietmar Maurer [Wed, 15 May 2024 10:31:50 +0000 (12:31 +0200)]
system-config-api: add syslog feature

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
4 months agoRevert "system-config-api: network: add alias 'iface' for interface name."
Dietmar Maurer [Tue, 14 May 2024 09:50:44 +0000 (11:50 +0200)]
Revert "system-config-api: network: add alias 'iface' for interface name."

This reverts commit a4de726601d7f003833e4c040b9fcebe5adc26b4.

Turn out we do not need this.

4 months agosystem-config-api: expose helpers to set ports/slaves as string (list)
Dietmar Maurer [Mon, 13 May 2024 10:25:07 +0000 (12:25 +0200)]
system-config-api: expose helpers to set ports/slaves as string (list)

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
4 months agosystem-config-api: network: add api type to update network interfaces
Dietmar Maurer [Mon, 13 May 2024 08:09:02 +0000 (10:09 +0200)]
system-config-api: network: add api type to update network interfaces

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
4 months agosystem-config-api: cleanup: remove useless serde rename property
Dietmar Maurer [Fri, 10 May 2024 09:15:12 +0000 (11:15 +0200)]
system-config-api: cleanup: remove useless serde rename property

4 months agosystem-config-api: network: add alias 'iface' for interface name.
Dietmar Maurer [Fri, 10 May 2024 08:23:27 +0000 (10:23 +0200)]
system-config-api: network: add alias 'iface' for interface name.

So that we can use the Interface struct with create and update api calls (which
currently use 'iface' instead of 'name').

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
4 months agosystem-config-api: network: add helpers to check for duplicate gateway propertie
Dietmar Maurer [Fri, 10 May 2024 08:08:23 +0000 (10:08 +0200)]
system-config-api: network: add helpers to check for duplicate gateway propertie

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
4 months agosystem-config-api: network: add helpers to set bridge ports and bond slaves
Dietmar Maurer [Fri, 10 May 2024 07:53:27 +0000 (09:53 +0200)]
system-config-api: network: add helpers to set bridge ports and bond slaves

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>