Commit graph

143 commits

Author SHA1 Message Date
Firstyear 5a3e5f1e07
20241017 3107 token ttl (#3114) 2024-10-18 03:28:52 +00:00
Firstyear 2075125439
Working scim entry get for person (#3088) 2024-10-15 04:29:45 +00:00
Jinna Kiisuo 03645c8bf2
Improve deb packaging, add aarch64 (#3083)
* feat: Rebuild the deb packaging flow
fix: Add more sudo, GHA likes sudo
fix: Give build_debs.sh only the triplet argument
fix: Work around more GHA weirdness in apt sources
Drop crossbuild as it was only used by debian packaging
docs: Update book and other docs for packaging flow
feat: package kanidm_tools aka kanidm cli
docs: Update packaging docs for latest process and clarity
fix: use full triple in sdynlib variants
fix: Correct kanidm.pam asset placement
fix: Give pam & nss modules a description so the debs get it
fix: Work around wonky libssl3 naming in Ubuntu 24.04
fix: Place kanidm bin correctly :3
feat: Pin all blame on @yaleman :3
WIP: Swap out the submodule reference. Still not the final one though.
refactor: Switch kanidm-pam & kanidm-nss to mandatory deps
While in theory unixd will start and run without them, it also won't do
anything useful.
fix: explicit depends for nss & pam libs without versions
We build the debs on the ubuntu24.04 GHA runner so automatic pins
versions that are too new for 22.04. Ideally we'd run cargo-deb also on
the target images but that'll have to be a future improvement.
* refactor: Switch nss_kanidm & pam_kanidm package naming closer to debian guidance
* feat: Attempt enabling unixd by default with secure defaults
* fix: Relax config permissions so the kanidm user can read
Also, update postinst config instructions
2024-10-15 02:27:48 +00:00
Firstyear 131ff80b32
20240921 ssh keys and unix password in credential update session (#3056) 2024-10-03 05:57:18 +00:00
Firstyear 44b93804e6
Don't reprompt for login when no session exists in cli (#3082)
* Fix handling when session is already removed so that we don't re-prompt for login.
* Remove async recursion
2024-10-03 01:08:47 +00:00
CEbbinghaus dc4a438c31
Feat: Adding POSIX Password fallback (#3067)
* Added Schema for credential fallback
* Added account polcity management to ac migration
* Refactored Ldap & Unix auth to be common
* removed unused methods and renamed unused fields
* Fixed LDAP missing Anonymous logic
* Added CLI argument for configuring primary cred fallback
2024-10-02 19:28:36 +10:00
Firstyear bdeb1a6234
Improve pipe handling on linux (#3069) 2024-09-29 09:36:20 +10:00
James Hodgkinson 004e263f90
CLI image error nicening (#3037)
* fix(scim_proto): fixing an issue with building due to dependencies
* feat(cli): more error message detail when things go wrong with images on the CLI
2024-09-17 04:07:43 +00:00
Firstyear 95fc6fc5bf
20240828 Support Larger Images, Allow Custom Domain Icons (#3016)
Allow setting custom domain icons.
2024-09-05 04:19:27 +00:00
James Hodgkinson db26979a98
fix(kanidm): don't allow empty string fields on CLI (#3018) 2024-09-04 05:29:26 +00:00
Adam C. Stephens 1161da69ef
generate completions for elvish and fish (#3015) 2024-09-03 23:50:59 +00:00
Firstyear 0fac1f301e
20240820 SCIM value (#2992)
Add the basics of scim value serialisation to entries.
2024-08-29 11:38:00 +10:00
James Hodgkinson 3eae7be0bb
OAuth2 Token Type (#3008)
* fix(OAuth2): Invalid `token_type` for token introspection
Fixes #3005

* fix(aut): `assert_eq` instead of `assert ==`

* fix(OAuth2): IANA registry access token types

* fix(OAuth2): deserialize case insensitively
2024-08-25 23:30:20 +00:00
Firstyear 2ea8a0ed88
Expose group rename (#2999)
* feat(cli): add group rename
2024-08-23 06:18:29 +00:00
Firstyear b53c4ba62a
Better Error Message (#2998)
* fix(cli) better error Messages

---------

Co-authored-by: James Hodgkinson <james@terminaloutcomes.com>
2024-08-23 02:51:22 +00:00
James Hodgkinson 3cbda02aa8
Docs updates (#2961) 2024-08-10 09:30:51 +00:00
Firstyear a5cd9b5a33
Fix incorrect logic in cred update flow (#2956)
Incorrect logic in cred update meant that valid transactions would not be allowed to commit as a mistake in the UI flow.

This is a skill issue on my part.
2024-08-08 02:02:02 +00:00
Sebastiano Tocci 12f297e526
Added orca flag to extend privileged authentication expiry (#2949) 2024-08-03 10:37:49 +10:00
Sebastiano Tocci 60e5b0970e
New orca models (#2909)
* Orca is happy, everyone is happy
* added model selection option for Orca and properly included opt.rs inside the file tree instead of using `include!` macro
* added variable login delay to both read and write models!
* Clippy and William are happier this way
* fixed toml syntax for member count and removed old person_count_by_group inside ProfileBuilder
* added strong typing for group names, in the future this should help adding CLI support
* added the `latency_measurer` model and improved the ActorModel trait
* Fixed lots of bugs and made clippy happier
* updated all models to use random backoff time for the login transition
2024-07-30 12:11:01 +10:00
James Hodgkinson 2a7a009482
clippying all the things (#2931)
* clippying all the things
2024-07-26 07:02:37 +00:00
Firstyear 21d3f82aa1
Add scim proto to kanidm, refactor to improve serde performance. (#2933) 2024-07-26 15:54:28 +10:00
James Hodgkinson 01deb706fa
kanidm graph graphviz unfit for scripting bc. of non-graphviz output (#2876)
Fixes #2875 - change to eprintln for output
2024-07-24 06:54:13 +00:00
Firstyear c17aade6c3
Improve workflow when account policy isnt satisfied (#2927)
* Improve workflow when account policy isnt satisfied
* Update tools/cli/src/cli/person.rs

Co-authored-by: James Hodgkinson <james@terminaloutcomes.com>
2024-07-24 09:57:55 +10:00
Firstyear da7ed77dfa
Substring Indexing (#2905) 2024-07-20 03:12:49 +00:00
Firstyear c7fcdc3e4e
Strict redirect URL enforcement (#2917)
Add strict OAuth2 URL enforcement per the RFC. This includes a transition process for the next release so that Admins can come into compliance.
2024-07-20 02:09:50 +00:00
Alin Trăistaru 562f352516
fix typos (#2908)
* fix typos and misspellings
* use proper capitalization
* Apply suggestions from code review
---------

Co-authored-by: James Hodgkinson <james@terminaloutcomes.com>
2024-07-18 03:22:20 +00:00
Firstyear 5af33ade0a
Update mtls cert lifetime (#2886) 2024-07-10 21:35:24 +00:00
Merlijn 4795541719
Offer configuration of images for Oauth2 resources (#2665) 2024-07-06 12:25:55 +10:00
Firstyear f9a77ee1f3
2818 2511 oauth2 urls (#2867)
* Allow multiple origins
* Docs
* Capitalization 'n stuff

---------

Co-authored-by: James Hodgkinson <james@terminaloutcomes.com>
2024-07-05 23:17:26 +00:00
Sebastiano Tocci 772c6ca9f7
added orca docker file, make target and credential reset capabilities (#2846)
* added orca docker file and make target
* made clippy happy
* fixed Orca dockerfile
* Update tools/orca/src/profile.rs
* trying to fix debian builds

---------

Co-authored-by: James Hodgkinson <james@terminaloutcomes.com>
2024-07-04 00:38:10 +00:00
Firstyear b58370adc8
Configurable thread count (#2847)
* added `thread_count` configuration for the server
* added `thread_count` to orca

---------

Co-authored-by: Sebastiano Tocci <sebastiano.tocci@proton.me>
2024-06-21 11:47:36 +10:00
Firstyear 10e15fd6b3
20240613 performance improvements (#2844)
Thanks to @Seba-T's work with Orca, we were able to identify a number of performance issues in certain high load conditions.

This commit contains fixes for the following issues

* Unbounded Memory Growth - due to how ARCache works, to maintain temporal consistency it must retain copies of keys (not values) in a special data set for tracking. The Filter Resolve Cache was using unresolved filters as keys. This caused memory explosions when refint or memberof were updating a group with a large number of members because they would emit a query with hundreds of filter terms that would only be used once and never again, causing the ARCache haunted set to grow without bound. To limit this, we no longer cache large/complex queries for resolution, and in future we may implement some other methods to reduce this like sha256/hmac of the queries.

* When creating a new account, dyngroups would be engaged to add the account as a member due to the matching scope. However the change to the dyngroup was triggering an update of all the dyngroups *members* related memberof attributes. This would mean that adding an account would trigger every other account to be loaded an updated.

* When memberof would iterate over leaf entries and update them one at a time. This mean a large number of small fragmented queries in the case of a lot of leaf entries being updated. Now leaf entries are updated in a single stripe once groups are stabilised.

* Member of would always trigger it's members to always update. Instead, we should only update members where a difference is observed, or all members if the group's memberof itself has changed since this needs to propogate to all leaf entries. This significantly reduces the amount of writes and operations to examine the changed member of set.

* Referential integrity would examine all reference uuids on entries for validity rather than just the reference uuids that were altered within the transaction. This change means that only uuids that were *added* are validated during an operation. 

* During async write backs (delayed actions) these were performed one at a time. Instead, when possible this should be done in a single transaction as the write transaction caches all writes in memory until the commit meaning that by batching we reduce overall latency.

* In the server there can only be one write transaction and many readers. These are guarded by tokio semaphores that act as fair queues - first in gets the lock next. Due to the design of the server readers would be blocked on the *database* semaphore, and writers would block on the write semaphore and THEN the database semaphore. This arrangement was creating a situation which unfairly advantaged readers over writers, as any write would first have to become the head of it's queue, and then compete with all readers to access a db transaction. Instead, we now have a reader semaphore with size threads minus 1, clamped at a minimum of 1. This means that provided there are two or more threads, then a writer will *always* have a database handle available, and readers will pre-queue with each other before queueing on the db ticket. If there is only one thread, then writes and reads will alternate between each other fairly.
2024-06-20 02:50:00 +00:00
Joshua M. Clulow e591b5f2cc
illumos support (#2838)
* disable mimalloc on illumos, in part because it immediately segfaults,
  but also because we prefer libumem and link it into all Rust binaries

* switch from fs2 (unmaintained crate) to fs4 which provides the same
  interface and has wider platform support
2024-06-15 05:20:11 +00:00
Firstyear 9c4e8bb90a
20240611 performance (#2836)
While basking under the shade of the coolabah tree, I was overcome by an intense desire to improve the performance and memory usage of Kanidm.

This pr reduces a major source of repeated small clones, lowers default log level in testing, removes some trace fields that are both large and probably shouldn't be traced, and also changes some lto settings for release builds.
2024-06-12 16:48:49 -07:00
Firstyear bd6d9284c0
20240607 2417 piv (#2829)
Add some more ground work for future PIV/x509 authentication.
2024-06-11 00:54:57 +00:00
Sebastiano Tocci 073ed403ed
Stats collection improvements and a bunch of other stuff (#2820) 2024-06-07 10:18:14 +10:00
James Hodgkinson 3c01a96348
Better WebAuthn and other error responses (#2608) 2024-06-05 09:57:16 +10:00
Firstyear 2c0ff46a32
20240530 nightly warnings (#2806)
* Cleaneup
* Lots of ram saving
2024-05-30 20:22:19 +10:00
Firstyear f669f5a0e8
Resolve incorrect handling of tokens in logout flow (#2795) 2024-05-28 16:01:19 +10:00
Firstyear 1e4f6e85ca
Revive Cookies. (#2788)
* Revive Cookies.
* change from tikv-jemalloc to mimalloc.
2024-05-23 00:45:42 +00:00
James Hodgkinson 7964f55d59
strip out some debug messages unless *really* debugging. (#2767)
* kanidm cli logs on debug level - Fixes #2745
* such clippy like wow
* It's important for a wordsmith to know when to get its fixes in.
* updootin' wasms
2024-05-14 14:56:55 +10:00
James Hodgkinson aefcdc5ee8
Fixing up build for rust 1.78, hiding things behind cfg(test) etc. (#2753)
* fixing up build for rust 1.78, hiding things behind cfg(test) etc.
* cleaning up version identifier handling in book gen
2024-05-07 09:00:55 +10:00
Firstyear 1fb8165825
Update Webauthn and Base64 (#2734) 2024-05-01 04:10:18 +00:00
Firstyear 58cfc8bdf9
Minor upgrade fixes (#2722) 2024-04-24 17:21:45 +10:00
Firstyear acc800f00e
Resolve OAuth2 client/rs confusion (#2719)
* Resolve OAuth2 client/rs confusion

* feedback
2024-04-24 15:34:50 +10:00
Firstyear afd674d346
Add mail support to groups (#2718)
* Add mail support to groups

* Update libs/client/src/group.rs

---------

Co-authored-by: James Hodgkinson <james@terminaloutcomes.com>
2024-04-23 07:08:28 +00:00
Sebastiano Tocci 9354c180af
added profile and memberof search to the basic model (#2712)
Co-authored-by: Firstyear <william@blackhats.net.au>
2024-04-23 10:30:38 +10:00
Firstyear 62bbd7e3ea
20240409 rework orca markov (#2699)
Improve the models and what can be performed in the orca benchmarks.

---------

Co-authored-by: Sebastiano Tocci <seba.tocci@gmail.com>
Co-authored-by: Sebastiano Tocci <sebastiano.tocci@proton.me>
2024-04-16 23:35:16 +00:00
Firstyear d7834b52e6
Begin the basis of the key provider model (#2640)
This completely reworks how we approach and handle cryptographic keys in Kanidm. This is needed as a foundation for replication coordination which will require handling and rotation of cryptographic keys in automated ways. 

This change influences many other parts of the code base in it's implementation.

The primary influences are:

* Modification of how domain user signing keys are revoked or rotated.
* Merging of all existing service-account token keys are retired (retained) keys into the domain to simplify token signing and validation
* Allowing multiple configurations of local command line tools to swap between instances using disparate signing keys.
* Modification of key retrieval to be key id based (KID), removing the need to embed the JWK into tokens

A side effect of this change is that most user authentication sessions and oauth2 sessions will have to be re-established after upgrade. However we feel that session renewal after upgrade is an expected side effect of an upgrade. 

In the future this lays the ground work to remove a large number of legacy key handling processes that have evolved, which will allow large parts of code to be removed.
2024-04-15 23:44:37 +00:00
Dustin Frisch e5702909d0
ldap-sync: allow to use attrs more than once (#2676) 2024-03-25 09:41:24 +00:00