Commit Graph

2044 Commits

Author SHA1 Message Date
Wolfgang Bumiller
8547ee31da tfa: also reset counters when unlocking tfa
Since this requires access to the user data, we need to add
a generic parameter to the unlock methods.
To avoid having to create another major API bump affecting
all our products this short after release, we keep the old
version around with the old behavior.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2023-07-04 14:45:18 +02:00
Fabian Grünbichler
415d60daf9 release file: extend component fixup to bookworm
else mirroring bookworm-security will skip *all* components..

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2023-06-29 13:11:17 +02:00
Thomas Lamprecht
2a070da065 proxmox-rest-server: bump to 0.4.1-1
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-06-27 12:44:52 +02:00
Thomas Lamprecht
880abd859b proxmox-apt: bump version to 0.10.2-1
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-06-27 12:36:05 +02:00
Wolfgang Bumiller
54cb9be8ed bump proxmox-ldap to 0.2.0-1
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2023-06-26 14:22:50 +02:00
Stefan Sterz
7f135263a9 ldap: add check_connection function
this function checks if a given connection could work. it uses the
current config to connect to an ldap directory and perform a search
with the provided base_dn. this enables us to verify a connection
before storing it in a more meaningful way than with a regex.

Signed-off-by: Stefan Sterz <s.sterz@proxmox.com>
2023-06-26 14:15:35 +02:00
Stefan Sterz
599a6a49da ldap: remove support for unauthenticated binds
by using the default empty string if no password was provided,
unauthenticated binds were possible. to bring pbs in-line with pve,
switch to throwing an error in this case instead. however, this will
break any pre-existing setup that relied on this behavior.

Signed-off-by: Stefan Sterz <s.sterz@proxmox.com>
2023-06-26 14:15:33 +02:00
Wolfgang Bumiller
962ce920a0 bump proxmox-human-byte to 0.1.0-1
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2023-06-26 13:37:29 +02:00
Wolfgang Bumiller
c611afcf0d human-byte: update copyright format
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2023-06-26 13:37:29 +02:00
Lukas Wagner
77dbc2fe18 human-byte: move tests to their sub module
The `#[cfg(test)]` directive ensures that the tests are not compiled
for non-test builds.

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
2023-06-26 13:24:51 +02:00
Lukas Wagner
c3545d6644 add proxmox-human-byte crate
The module previously lived in `pbs-api-types`, however turned out to
be useful in other places as well (POM, proxmox-notify), so it is moved
here as its own micro-crate.

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
2023-06-26 13:24:48 +02:00
Wolfgang Bumiller
d5b9f166a2 cargo fmt
bigger changes are only in the new crates
rest are minor ones

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2023-06-23 11:50:39 +02:00
Fabian Grünbichler
b687edc1a0 rest: remove full static file path from error messages
this triggers certain security scanners, and having the requested path instead
gives basically the same information anyhow.

reported on the forum: https://forum.proxmox.com/threads/404-path-disclosure-vulnerability.129187/

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2023-06-23 11:46:52 +02:00
Wolfgang Bumiller
5791af8ff4 ldap: rustfmt
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2023-06-23 11:20:25 +02:00
Lukas Wagner
378e2380b7 ldap: surround user filter expression in parenthesis if not already
In PVE, the `filter` attribute is surrounded in () if it is not already,
allowing "uid=test" as well as "(uid=test)" [1].

A forum user [2] just ran into this inconsistency, so I decided to adjust
the behavior.

[1] https://git.proxmox.com/?p=pve-common.git;a=blob;f=src/PVE/LDAP.pm;h=ff98e367e63265bf76c0f302847c3749eea095a6;hb=HEAD#l115
[2] https://forum.proxmox.com/threads/ldap-query-for-security-group-members.127882/

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
2023-06-23 11:19:04 +02:00
Maximiliano Sandoval
84edb20eb8 tfa: Improve TOTP algorithm parsing
It is very common for TOTP URIs to contain the algorithm in lowercase,
hence we convert to lowercase when doing From<&str> for Algorithm.

Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
2023-06-20 12:39:46 +02:00
Wolfgang Bumiller
16d512b4d9 bump proxmox-compression to 0.2.1-1
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2023-06-15 11:01:19 +02:00
Wolfgang Bumiller
5b55ea797a compression: match style fixup
if the match arms are this far away from the actual `match`
keyword, this needs to be split up...

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2023-06-15 10:37:59 +02:00
Dominik Csapak
af46b655d4 compression: zip_directory: improve error handling
when zipping a directory, our intention was to skip over files that
cannot be zipped (e.g. the file can't be read/vanished/etc.), so we
ignored errors and simply logged it.

but when 'add_entry' fails, we will never actually restore, since every
error there is fatal to the point that the zip cannot be finished thats
because we take the 'target' sink out of self, and only insert it again
after all writes succeeded. so if an error occurs in between 'target' is
not put into self again (and never will be) and the zip cannot be
finished (even if we would catch all those intermediate errors and
restore 'target', we don't know in which state the output was, so we're
unable to finish a valid zip)

to fix that, split the actual 'add_entry' part there out of the async
move block and treat its errors always as fatal

without this, we generate heaps of log lines even after an error
occurred, and can never recover

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2023-06-15 10:28:50 +02:00
Wolfgang Bumiller
39a486f574 bump proxmox-tfa to 4.0.3
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2023-06-14 13:52:20 +02:00
Wolfgang Bumiller
5f1a0bc0c9 tfa: make TfaUser fields public
So we can print them in the proxmox-backup-manager CLI text
output.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2023-06-14 13:50:38 +02:00
Wolfgang Bumiller
ba39c5f990 auth-api: bump d/control
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2023-06-14 13:50:29 +02:00
Wolfgang Bumiller
cc091c4fe5 bump proxmox-auth-api to 0.3.0
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2023-06-14 09:55:31 +02:00
Wolfgang Bumiller
a228a22918 auth-api: set PAM_RHOST during pam authentication
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2023-06-14 09:32:03 +02:00
Wolfgang Bumiller
8f08039e7e auth-api: drop pam crate
it's too limited

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2023-06-14 08:51:43 +02:00
Fabian Grünbichler
c8433e3219 fix #4653: (In)Release file: improve handling of special suites
APT doesn't mind a repository with either "/" or "./" as suite/distribution,
such as

 deb https://example.com/debian ./

in that case, the 'dists' part of the URL and the trailing slash (which would
be encoded as '_') is dropped in the file name in '/var/lib/apt/lists/'.

Other suite values with a trailing or leading '/' are rejected with an error by APT:

 E: Malformed entry 1 in sources file /etc/apt/sources.list.d/test.list (absolute Suite Component)
 E: The list of sources could not be read.

so this should be the only special case requiring handling.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2023-06-06 18:24:39 +02:00
Fabian Grünbichler
27cd025053 fallback to Release file for Origin retrieval
APT will not store the InRelease file in some cases, and some repositories
might not even have one in the first place.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2023-06-06 18:24:39 +02:00
Wolfgang Bumiller
35dc1b0b8d bump proxmox-tfa to 4.0.2
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2023-06-05 08:59:55 +02:00
Thomas Lamprecht
0fb7ec0c32 buildsys: also cleanup *.build files for convenience
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-06-04 18:27:46 +02:00
Thomas Lamprecht
45432b689d apt: bump version to 0.10.1-1
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-06-03 18:29:04 +02:00
Thomas Lamprecht
a367f6a0d8 build.sh: split overly long line
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-06-03 16:48:10 +02:00
Thomas Lamprecht
ce6a87d513 buildsys: don't try to resolve dependency metadata when assembling crate list
A build-system that needs all build-dependencies even for a simple
make clean invocation is a PITA..

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-06-03 16:39:39 +02:00
Fiona Ebner
cc17861f54 apt: tests: add tests for Ceph Quincy repository detection on Bookworm
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
2023-06-03 14:39:05 +02:00
Fiona Ebner
06ad528c94 apt: tests: code cleanup to avoid useless vector
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
2023-06-03 14:39:05 +02:00
Fiona Ebner
9b7c5339d7 apt: tests: create temporary test directories in CARGO_TARGET_TMPDIR
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
2023-06-03 14:39:05 +02:00
Fiona Ebner
bae15e2408 apt: split Ceph main repository into no-subscription and enterprise
The old 'main' component stays valid, pointing to no-subscription,
which means the is_referenced_repository() check needs a special case
for it. It will eventually go away, together with the handles for
Quincy.

Alternatively, the standard repository's info() could've been changed
to return multiple possible components, similar to URLs, but as
opposed to URLs, there could be a standard repository that wants to
have multiple components and it feels a bit unnatural, because
multiple components are usually not aliases of the same. And adapting
is_referenced_repository() would be needed here too. So overall, the
above alternative just felt better.

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
2023-06-03 14:39:05 +02:00
Fiona Ebner
21b58c3384 apt: drop older Ceph standard repositories
On Proxmox VE 8, only Quincy and newer will be supported.

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
2023-06-03 14:39:05 +02:00
Wolfgang Bumiller
4508c8b23c add some missing d/source/format files
For crates which already used (native) versioning.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2023-06-02 08:44:50 +02:00
Wolfgang Bumiller
abd2558b01 tfa: reduce default lockout time to an hour
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2023-06-01 15:10:53 +02:00
Wolfgang Bumiller
adb868ee08 tfa: include lockout status in the tfa user list
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2023-06-01 12:22:18 +02:00
Wolfgang Bumiller
c5a9fa8595 bump proxmox-tfa to 4.0.1
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2023-05-31 12:54:47 +02:00
Wolfgang Bumiller
f3666afd22 tfa: add d/source/format
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2023-05-31 12:54:47 +02:00
Wolfgang Bumiller
a26ec45d74 tfa: add api::methods::unlock_tfa
This mostly serves as documentation for the API call to be
implemented across our products. It's otherwise already just
a oneliner on the TfaConfig.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2023-05-31 12:54:47 +02:00
Wolfgang Bumiller
46c15171e6 buildsys: remove format.debcarg.hint file
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2023-05-31 12:54:47 +02:00
Wolfgang Bumiller
656ec1e7db bump proxmox-openid to 0.10.0-1
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2023-05-24 09:50:33 +02:00
Wolfgang Bumiller
c25c1cf4cd bump proxmox-apt to 0.10.0-1
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2023-05-24 09:50:33 +02:00
Wolfgang Bumiller
3c85df6830 proxmox-apt: update tests to expect bookworm
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2023-05-24 09:50:33 +02:00
Wolfgang Bumiller
077a83f401 add proxmox-apt and proxmox-openid to workspace
and fixup d/copyright

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2023-05-24 09:24:27 +02:00
Wolfgang Bumiller
6253f263ce Merge branch 'proxmox-openid-merge' 2023-05-24 09:22:09 +02:00
Wolfgang Bumiller
68ebe9ec8a Merge branch 'proxmox-apt-merge' 2023-05-24 09:22:04 +02:00