Commit graph

108 commits

Author SHA1 Message Date
Firstyear ad3cf8828f
20250205 3369 firefox pin (#3403)
Improve error message when passkey is missing PIN

Firefox still doesn't support setting a PIN on new devices. Because
of this we need a way to return a better error message for devices
that don't have UV configured.
2025-02-06 00:33:59 +00:00
James 4938c6796b
Add handle_group_error to cli client (#3399)
Closes #2616
2025-02-05 02:52:20 +00:00
Andris Raugulis d4c5a6f4a9
OpenBSD support (#3381)
* Implement OpenBSD support.
2025-02-03 22:39:50 +00:00
Firstyear b3be758b74
20250114 3325 SCIM access control (#3359)
Add an extended query operation to return effective access controls so that UI's can dynamically display what is or is not editable on an entry.
2025-01-20 11:28:22 +00:00
Be 2174b9b251
client: read attestation CA list JSON from file (#3232)
instead of passing a giant blob of JSON as a command argument.
Before, it was not possible to allow all valid authenticators
certified by the FIDO Alliance because

fido-mds-list query -o "status gte valid"

outputs a JSON string longer than Linux allows for command
arguments.

Co-authored-by: Firstyear <william@blackhats.net.au>
2024-12-20 03:02:02 +00:00
Firstyear 50a7d9d700
Allow opt-in of easter eggs (#3308)
So that we can start to add some more easter eggs to the server,
we also need to respect user preferences that may not want them.

This adds a configuration setting to the domain allowing a release
build to opt-in to easter eggs, and development builds to opt-out
of them.
2024-12-19 03:30:35 +00:00
Firstyear 1fbbf323fa
Allow reseting account policy values to defaults (#3306)
* Allow reseting account policy values to defaults

This allows the admin cli to reset account policy values to
defaults by clearing them. Due to how account policy resolves
a lack of value implies the default.
2024-12-18 17:43:56 +10:00
Firstyear 60cc830ebd
Cleanup webauthn features (#3285) 2024-12-12 06:56:12 -05:00
James Hodgkinson 0054fe17fe
Yaleman/issue3229 (#3239)
* Fix wrong success message on kanidm group set-entry-manager #3229
2024-11-25 09:38:46 +10:00
George Wu ed38e92448
Change CLI oauth2 command from set-display-name to set-displayname for consistency. (#3212)
* Change CLI domain command from set-display-name to set-displayname for consistency.

* Also fix CLI.
2024-11-19 04:28:07 +00:00
CEbbinghaus 1b58e4169a
chore: Made oauth2 scopes required in CLI (#3165) 2024-11-01 01:59:27 +00:00
George Wu d2c329f330
Change to text input and use numeric mode for TOTP prompts. (#3154)
* Change to text input and use inputmode numeric for TOTP prompts.

* Fix some typos.
2024-10-27 23:57:28 +00:00
Firstyear 2e6d940691
Remove WASM (#3148)
liberal party took over, more cuts
2024-10-26 17:19:13 +10:00
James Hodgkinson 5a709520dc
OAuth2 Device flow foundations (#3098) 2024-10-26 12:08:48 +10:00
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
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
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
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
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
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
Firstyear bd6d9284c0
20240607 2417 piv (#2829)
Add some more ground work for future PIV/x509 authentication.
2024-06-11 00:54:57 +00:00
James Hodgkinson 3c01a96348
Better WebAuthn and other error responses (#2608) 2024-06-05 09:57:16 +10:00
Firstyear f669f5a0e8
Resolve incorrect handling of tokens in logout flow (#2795) 2024-05-28 16:01:19 +10: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
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
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
Firstyear b4d9cdd7d5
20240301 systemd uid (#2602)
Fixes #2601 Fixes #393 - gid numbers can be part of the systemd nspawn range.

Previously we allocated gid numbers based on the fact that uid_t is a u32, so we allowed 65536 through u32::max. However, there are two major issues with this that I didn't realise. The first is that anything greater than i32::max (2147483648) can confuse the linux kernel. 

The second is that systemd allocates 524288 through 1879048191 to itself for nspawn.

This leaves with with only a few usable ranges.

1000 through 60000
60578 through 61183
65520 through 65533
65536 through 524287
1879048192 through 2147483647

The last range being the largest is the natural and obvious area we should allocate from. This happens to nicely fall in the pattern of 0x7000_0000 through 0x7fff_ffff which allows us to take the last 24 bits of the uuid then applying a bit mask we can ensure that we end up in this range. 

There are now two major issues.

We have now changed our validation code to enforce a tighter range, but we may have already allocated users into these ranges. 

External systems like FreeIPA allocated uid/gid numbers with reckless abandon directly into these ranges. 

As a result we need to make two concessions.

We *secretly* still allow manual allocation of id's from 65536 through to 1879048191 which is the nspawn container range. This happens to be the range that freeipa allocates into. We will never generate an ID in this range, but we will allow it to ease imports since the users of these ranges already have shown they 'don't care' about that range. This also affects SCIM imports for longer term migrations. 

Second is id's that fall outside the valid ranges. In the extremely unlikely event this has occurred, a startup migration has been added to regenerate these id values for affected entries to prevent upgrade issues. 

An accidental effect of this is freeing up the range 524288 to 1879048191 for other subuid uses.
2024-03-07 03:25:54 +00:00
Merlijn eddca4fc86
Feature object graph (#2518)
* Refactor: move the object graph ui to admin web ui
* Add dynamic js loading support
Load viz.js dynamically
* Add some js docs
* chore: cleanup imports
* chore: remove unused clipboard feature
chore: remove unused mermaid.sh
* Messing with the profile.release settings and reverting the changes I tried has now made the build much smaller yay :D
* Refactor: user raw search requests
Assert service-accounts properly
* refactor: new v1 proto structure
* Add self to CONTRIBUTORS.md

---------

Co-authored-by: James Hodgkinson <james@terminaloutcomes.com>
2024-02-29 02:25:40 +00:00
Firstyear fbc021f487
20240221 2489 cleanup api v1 (#2573) 2024-02-27 09:25:02 +00:00
Firstyear 68d788a9f7
20240216 308 resource limits (#2559)
This adds account policy based resource limits to control the maximum
number of entries that an account may query
2024-02-21 00:15:43 +00:00
James Hodgkinson 6b44495704
Ordering auth methods in the CLI (#2508)
* rewriting ordering of authallowed enum
* ordering the authstate in the CLI

---------

Co-authored-by: William Brown <william@blackhats.net.au>
2024-02-15 12:31:01 +10:00
Firstyear 7567514044
Release 1.1.0-rc.16 (#2483) 2024-02-07 04:39:02 +00:00
Firstyear 86916a3d87
Return sshkey label to cli fields (#2440)
* Return ssh label to cli fields
2024-01-20 17:17:57 +10:00