Commit Graph

269 Commits

Author SHA1 Message Date
Wolfgang Bumiller
d9f938ef49 pve-rs: bump d/control
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-11-17 12:49:31 +01:00
Wolfgang Bumiller
205c76068d tfa: generate 'incomaptible' entries
for users with incompatible tfa entries, generate an
'incompatible' entry so they cannot log in via the old api

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-11-17 12:33:04 +01:00
Wolfgang Bumiller
c6f231494a note that patch overrides go into the toplevel Cargo.toml
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-11-17 09:36:51 +01:00
Wolfgang Bumiller
84417400ed move proxmox_tfa_api module to proxmox-tfa as api feature
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-11-17 08:43:17 +01:00
Wolfgang Bumiller
7cb0164e4a fix typo
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-11-12 11:00:33 +01:00
Wolfgang Bumiller
c012875339 bump pve-rs to 0.3.1
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-11-12 10:26:23 +01:00
Dominik Csapak
dfbbed5d87 pve-rs/tfa: ignore and discard incomplete u2f entries
it can happen that we have leftover entries with non-completed challenges.
since a user cannot continue here in a sensible way, ignore and discard
them

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-11-12 10:10:38 +01:00
Dominik Csapak
515d6a81d8 pve-rs/tfa: fix off by one trimming
to is the last *valid* character, and ranges end by default with one
less, so extend the range to the actual last character

this fixes an issue that we could not parse old configs with
non-padded base64 values

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-11-12 10:10:20 +01:00
Wolfgang Bumiller
790d11edf1 buildsys: drop -C prefer-dynamic (and rebuild 0.3.0)
also add perl depends

the std library is actually big and not linking dynamically
doesn't add much
besides, the package names for libstd would cause issues
with minor compiler bumps...

the 0.3.0 package is actually built from this commit now,
since the installability checks caught this...

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-11-10 12:32:42 +01:00
Wolfgang Bumiller
fc38788fde buildsys: add upload target
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-11-10 11:58:03 +01:00
Wolfgang Bumiller
f77e2f1a7d bump/release pve-rs as 0.3.0
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-11-10 11:52:34 +01:00
Wolfgang Bumiller
41ccaa5048 pve: TfaConfig: add_totp_entry, add_yubico_entry
fast path to add those two from the old user.cfg

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-11-10 09:53:18 +01:00
Wolfgang Bumiller
3e5228dd73 pve: add_totp anda dd_yubico cannot error, drop Result type
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-11-10 09:53:12 +01:00
Wolfgang Bumiller
951bc726a2 Add some dev tips to a README
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-11-09 12:02:53 +01:00
Wolfgang Bumiller
ec79616bd4 build fix: pmg-rs is not here yet
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-11-09 12:02:53 +01:00
Wolfgang Bumiller
2cc9163892 pve: add tfa api
This consists of two parts:

1) A proxmox_tfa_api module which temporarily lives here but
   will become its own crate.

   Most of this is a copy from ' src/config/tfa.rs with some
   compatibility changes:
   * The #[api] macro is guarded by a feature flag, since we
     cannot use it for PVE.
   * The Userid type is replaced by &str since we don't have
     Userid in PVE either.
   * The file locking/reading is removed, this will stay in
     the corresponding product code, and the main entry
     point is now the TfaConfig object.
   * Access to the runtime active challenges in /run is
     provided via a trait implementation since PVE and PBS
     will use different paths for this.
   Essentially anything pbs-specific was removed and the
   code split into a few submodules (one per tfa type
   basically).

2) The tfa module in pve-rs, which contains:
   * The parser for the OLD /etc/pve/priv/tfa.cfg
   * The parser for the NEW /etc/pve/priv/tfa.cfg
   * These create a blessed PVE::RS::TFA instance which:
     - Wraps access to the TfaConfig rust object.
     - Has methods all the TFA API call implementations
       These are copied from PBS' src/api2/access/tfa.rs,
       and pbs specific code removed.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-11-09 12:02:53 +01:00
Wolfgang Bumiller
9bc3ab23cb move apt to /perl-apt, use PERLMOD_PRODUCT env var
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-11-09 08:59:43 +01:00
Wolfgang Bumiller
1ae868ad78 import pve-rs
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-11-09 08:56:38 +01:00
Wolfgang Bumiller
50754a46aa import basic skeleton
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-11-09 08:54:06 +01:00