Commit graph

88 commits

Author SHA1 Message Date
Firstyear b27fd2f3de
Do not require instances to exist during optional config load ()
* Do not require instances to exist during optional config load

We were incorrectly requiring every config file to have the named
instance be present during configuration loading. This led to a
situation where if /etc/kanidm/config didn't have a user configured
instance from their ~/.config/kanidm, that the cli would fail to
load.

* CLIPS FOR THE CLIP GODS
2025-05-02 04:40:23 +00:00
Firstyear aaf43c7b06
Drop fernet in favour of JWE ()
This drops the use of fernet from OAuth2 in favour of JWE. To achieve
this cleanly, we swap OAuth2 to using our internel key object handler
so that in future we can consider the use of pkcs11 devices. This also
makes it easier in general to handle any future cryptographic changes.
2025-04-30 16:42:22 +10:00
Firstyear b13951a79b
Add set-description to group tooling () 2025-03-18 21:54:20 +10:00
Firstyear 63deda350c
20250225 improve test performance ()
* Ignore tests that are no longer used.

Each time a library or binary is added, that requires compilation to create
the *empty* test harness, which then is executed and takes multiple seconds
to start up, do nothing, and return success.

This removes test's for libraries that aren't actually using or running
any tests.

Additionally, each time a new test binary is added, that adds a ton of
compilation time, but also test execution time as the binary for each
test runner must start up, execute, and shutdown. So this merges all
the testkit integration tests to a single running which significantly
speeds up test execution.

* Improve IDL exists behaviour, improve memberof verification

Again to improve test performance. This improves the validation of idx
existance to be a faster SQLite call, caches the results as needed.

Memberof was taking up a large amount of time in verify phases of test
finalisation, and so a better in memory version has been added.

* Disable TLS native roots when not needed

* Cleanup tests that are hitting native certs, or do nothing at all
2025-03-04 10:36:53 +10:00
Sebastiano Tocci 9611a7f976
Fixes : add configurable maximum queryable attributes for LDAP () 2025-02-21 12:14:47 +10:00
sinavir f40679cd52
Accept invalid certs and fix token_cache_path ()
* Add accept-invalid-certs option for cli
* Fix token_cache_path behavior

---------

Co-authored-by: sinavir <sinavir@sinavir.fr>
2025-02-20 08:07:48 +00:00
Firstyear 50a7d9d700
Allow opt-in of easter eggs ()
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 ()
* 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
James Hodgkinson c1ed939c28
Allow OAuth2 loopback redirects if the path matches () 2024-11-30 05:40:05 +00:00
Firstyear 2e6d940691
Remove WASM ()
liberal party took over, more cuts
2024-10-26 17:19:13 +10:00
James Hodgkinson 5a709520dc
OAuth2 Device flow foundations () 2024-10-26 12:08:48 +10:00
Firstyear 5a3e5f1e07
20241017 3107 token ttl () 2024-10-18 03:28:52 +00:00
Firstyear 8c8f72381f
Add the strict flag on client creates for developers () 2024-10-16 13:58:57 +10:00
Firstyear 2075125439
Working scim entry get for person () 2024-10-15 04:29:45 +00:00
James Hodgkinson 6b48054a2e
fix(http): status content type should be JSON () 2024-10-15 01:28:07 +00:00
Firstyear 131ff80b32
20240921 ssh keys and unix password in credential update session () 2024-10-03 05:57:18 +00:00
CEbbinghaus dc4a438c31
Feat: Adding POSIX Password fallback ()
* 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 d3891e301f
20240810 SCIM entry basic () 2024-09-12 12:53:43 +10:00
Firstyear 95fc6fc5bf
20240828 Support Larger Images, Allow Custom Domain Icons ()
Allow setting custom domain icons.
2024-09-05 04:19:27 +00:00
Firstyear 2ea8a0ed88
Expose group rename ()
* feat(cli): add group rename
2024-08-23 06:18:29 +00:00
Firstyear 239f4594dd
20240810 application passwords ()
Add the server side components for application passwords. This adds the needed datatypes and handling via the ldap components.

Admin tools will be in a follow up PR. 

Signed-off-by: Samuel Cabrero <scabrero@suse.de>
Co-authored-by: Samuel Cabrero <scabrero@suse.de>
2024-08-20 06:44:37 +00:00
Firstyear b1099dfa3b
Foundations of pam/nss multi resolver
This starts the support for multi-resolver operation as well as a system level nss resolver.

In future we'll add the remaining support to auth system users with pam too.
2024-08-15 23:54:35 +00:00
Firstyear 7bbb193cdf
20240725 allow connection to older servers ()
Co-authored-by: James Hodgkinson <james@terminaloutcomes.com>
2024-07-25 16:11:14 +10:00
Firstyear da7ed77dfa
Substring Indexing () 2024-07-20 03:12:49 +00:00
Firstyear c7fcdc3e4e
Strict redirect URL enforcement ()
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
James Hodgkinson eddec88429
making the internals of kanidmclientconfig public for other users ()
* making the internals of kanidmclientconfig public for other users
* clippyisms
2024-07-15 10:28:23 +00:00
Firstyear d7a5097527
htmx logout tidy up () 2024-07-15 07:11:00 +00:00
Firstyear b1480e36f0
20240703 htmx ()
Complete the remainder of the HTMX rewrite of the login page.
2024-07-07 03:36:47 +00:00
Firstyear f9a77ee1f3
2818 2511 oauth2 urls ()
* Allow multiple origins
* Docs
* Capitalization 'n stuff

---------

Co-authored-by: James Hodgkinson <james@terminaloutcomes.com>
2024-07-05 23:17:26 +00:00
Firstyear 9c4e8bb90a
20240611 performance ()
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 ()
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 () 2024-06-05 09:57:16 +10:00
Firstyear 1e7b94b7cf
Regrets Dot Pee Enn Gee ()
Upgrade Axum

Co-authored-by: James Hodgkinson <james@terminaloutcomes.com>
2024-05-30 12:50:45 +10:00
James Hodgkinson 1d0a606e69
WIP: serialization and domain info setting wonkiness () 2024-05-28 11:49:30 +10:00
Firstyear 1e4f6e85ca
Revive Cookies. ()
* Revive Cookies.
* change from tikv-jemalloc to mimalloc.
2024-05-23 00:45:42 +00:00
James Hodgkinson ff02ec2417
Don't need to check versions when there's an intermediary reporting connectivity issues ()
* don't need to check versions when there's an intermediary reporting connectivity, skip it on 502 and 504
2024-05-14 02:47:39 +00:00
Firstyear afd674d346
Add mail support to groups ()
* 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 ()
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 ()
Fixes  Fixes  - 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
Vladimir Dronnikov 221445d387
expose group patch for parity ()
Co-authored-by: James Hodgkinson <james@terminaloutcomes.com>
2024-03-07 09:54:20 +10:00
Firstyear fbc021f487
20240221 2489 cleanup api v1 () 2024-02-27 09:25:02 +00:00
James Hodgkinson 4efdb7208f
of course I started looking at clippy things and now I can't stop () 2024-02-21 00:52:10 +00:00
Firstyear 68d788a9f7
20240216 308 resource limits ()
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
Firstyear 816fde766f
Fix update intent ttl parameters () 2024-02-16 07:02:36 +00:00
Firstyear d42268269a
20240125 2217 client credentials grant ()
* Huge fix of a replication problem.
* Update test
* Increase min replication level
* Client Credentials Grant implementation
2024-02-01 02:00:29 +00:00
James Hodgkinson c8bd1739f9
PyKanidm updates and testing ()
* otel can eprintln kthx

* started python integration tests, features

* more tests more things

* adding heaps more things

* updating docs

* fixing python test

* fixing errors, updating integration test

* Add models for OAuth2, Person, ServiceAccount and add missing endpoints

* Alias Group to GroupInfo to keep it retrocompatible

* Fixed issues from review

* adding oauth2rs_get_basic_secret

* adding oauth2rs_get_basic_secret

* Fixed mypy issues

* adding more error logs

* updating test scripts and configs

* fixing tests and validating things

* more errors

---------

Co-authored-by: Dogeek <simon.bordeyne@gmail.com>
2024-01-31 03:27:43 +00:00
Firstyear 86916a3d87
Return sshkey label to cli fields ()
* Return ssh label to cli fields
2024-01-20 17:17:57 +10:00
Firstyear 8dc884f38e
2390 1980 allow native applications () 2024-01-16 10:44:12 +10:00
Firstyear 3b0b350c9e
cookies () 2024-01-13 09:21:59 +10:00
Firstyear d09c2448ff
1481 2024 access control rework ()
Rework default access controls to better separate roles and access profiles.
2023-12-17 23:10:13 +00:00