Commit graph

146 commits

Author SHA1 Message Date
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
Firstyear 285f4362b2
20230224 2437 orca remodel (#2591) 2024-03-09 16:09:15 +10: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
James Hodgkinson 4096b8f02d
Changing to allow startup without a config file (#2582)
* Changing to allow startup without a config file, using environment variables
2024-02-27 15:40:00 +10:00
James Hodgkinson 4efdb7208f
of course I started looking at clippy things and now I can't stop (#2560) 2024-02-21 00:52:10 +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 097db70c3d
prctl compile-time fixes, also chasing lints (#2558)
* fixing up error handling for prctl calls
* minor clippy lintypoos
* making clippy happier
* clippizing a test
* more clippy-calming
* adding tpm-udev to ubuntu flows for testing
* rebuilt wasm
* moving from rg to grep because someone doesn't like nice things
* such clippy like wow
* clippy config to the rescue
2024-02-20 18:21:33 +10: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 9050188b29
Add tools for remigration and domain level raising (#2481) 2024-02-06 10:01:06 +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
James Hodgkinson e02e0501eb
Adding max_ber_size option in config for ldap sync (#2416) 2024-01-19 10:42:04 +10:00
Firstyear 8dc884f38e
2390 1980 allow native applications (#2428) 2024-01-16 10:44:12 +10:00
Matthew Wilks d56691f12d
Change OAuth2 RS Origin from the CLI (#2418)
* Enable changing the origin of an OAuth2 RS
2024-01-06 14:57:10 +10:00
Firstyear 5c445a4704
20231218 ipa sync unix password (#2374)
* Add support for importing the users password as unix password
2023-12-18 11:20:37 +10:00
Firstyear d09c2448ff
1481 2024 access control rework (#2366)
Rework default access controls to better separate roles and access profiles.
2023-12-17 23:10:13 +00:00
Firstyear 4bd5d584cb
20231204 ipa sync minor improvements (#2357) 2023-12-04 16:58:15 +10:00
Firstyear 76269f9de2
20231129 webauthn attestation (#2351)
This adds full support for attestation of webauthn/passkeys.
2023-12-03 06:13:52 +00:00
Firstyear 31b939fca3
20231128 freeipa migration (#2338)
* Add more weak password formats for freeipa
* Verification of freeipa migration from older ipa versions
2023-11-29 10:43:15 +10:00
Firstyear ac299b5286
Update to the latest compact-jwt version (#2331) 2023-11-24 02:53:22 +00:00
Firstyear bb8914c70d
20231120 2320 sssd compat (#2328) 2023-11-22 10:18:03 +10:00
Firstyear 8a40f5ab7b
Fix spelling (#2303) 2023-11-11 03:04:35 +00:00
Firstyear 47bcea7708
20231109 1122 credential class (#2300)
* Add CredentialType for acc pol
* Reword ui hints
* Finish account policy
* Clean up artefacts
2023-11-11 09:26:44 +10:00
James Hodgkinson 12f1de8358
Update OpenAPI schema gen to actually... be kinda sorta valid. (#2296)
* updating lockfile

* OpenAPI validation issues
Fixes #2295

* clippy sez no

* adding another validator, more specs
2023-11-07 11:35:17 +10:00
Firstyear b7852d1d71
pw min length in account policy (#2289) 2023-11-05 10:33:25 +10:00
James Hodgkinson 7025a9ff55
Feature: kanidm CLI pulling OpenAPI schema (#2285)
* diag is super noisy when you actually turn on logging... even though it wasn't an error?
* adding api download-schema to the CLI
* docs
2023-11-03 17:37:27 +10:00
James Hodgkinson 85c2b0fd82
Problems with bash completion autocomplete (#2281)
refers #2280
2023-11-02 10:55:32 +10:00
Allan dbf476fe5e
Remove unused imports and clippy lint (#2276)
* Fix unused import errors
* Apply clippy get_first lint
* Add contributor

---------

Co-authored-by: James Hodgkinson <james@terminaloutcomes.com>
2023-11-01 05:54:29 +00:00
James Hodgkinson 3bfc347c53
CLI integration test beginnings (#2261)
* more integration test things, using assert_cmd to test the CLI end-to-end
* packagez
* making clippy happy
* making deno happy
2023-10-30 06:10:54 +00:00
William Brown ecc46bb015 Add book chapter + cli 2023-10-28 13:07:06 +10:00
James Hodgkinson ad3c491d07
Bug chasing (#2257)
* service-account validity expire-at doesn't accept all time nouns as defined by docs
Fixes #2153
* realised a logic bug
* making clippy happy while I'm here
* returning an empty set from the creds if the creds attribute is not found, which is then handled downstream
2023-10-27 05:30:38 +00:00
Samuel Cabrero 99ba97088d
cargo fmt + clippy (#2241)
Signed-off-by: Samuel Cabrero <scabrero@suse.de>
2023-10-27 04:40:24 +00:00
James Hodgkinson 18b4b7549f
service-account or person validity show returns for non-existing identity (#2258)
Fixes #2152
2023-10-27 04:00:37 +00:00
James Hodgkinson 208d7c9932
don't need write if we are not writing (#2256) 2023-10-27 13:34:53 +10:00
Firstyear afe9d28754
20231019 1122 account policy basics (#2245)
---------

Co-authored-by: James Hodgkinson <james@terminaloutcomes.com>
2023-10-22 11:16:42 +00:00
James Hodgkinson 6850a17e8c
Windows build fixes and test coverage (#2220)
* adding testing for users functions
* turning KanidmClient build error into a ClientError
* removing a redundant closure
2023-10-17 07:18:07 +00:00
Firstyear 8bcf1935a5
20231012 346 name deny list (#2214)
* Migrate to improved system config reload, cleanup acc pol
* Denied names feature
2023-10-13 08:50:36 +10:00
James Hodgkinson d9da1eeca0
Chasing yaks down dark alleyways (#2207)
* adding some test coverage because there was some rando panic-inducing thing
* ldap constants
* documenting a macro
* helpful weird errors
* the war on strings continues
* less json more better
* testing things fixing bugs
* idm_domain_reset_token_key wasn't working, added a test and fixed it (we weren't testing it)
* idm_domain_set_ldap_basedn - adding tests
* adding testing for idm_account_credential_update_cancel_mfareg
* warning of deprecation
2023-10-11 15:44:29 +10:00
Firstyear a91bf55471
20231008 remove expect used (#2191)
* Stop using expect on some tasks
2023-10-08 17:39:00 +10:00
James Hodgkinson e7f594a1c1
In-system image storage (#2112)
* In-system image storage refers to #2057
* adding multipart feature to axum
* thanks to @Firstyear for fixing my bufs
* fixing coverage test things
* clippy-calming
* more tests, jpg acropalypse tests, benches
* spelling
* lockfile updates
* linting
2023-10-04 17:24:12 +10:00
James Hodgkinson c998a1eda5
bindaddress default doesn't match documentation (#2150)
Fixes #2147
2023-09-26 09:38:07 +10:00
James Hodgkinson 9b2fab7bb1
CLI and kanidm_client changes to handle errors and TLS validation changes (#2127)
* pulling out exitcode, adding hyper dep to handle errors (was already transitively there due to reqwest)
* adding better error handling, more options for client things
2023-09-19 13:31:19 +10:00
James Hodgkinson a239fbdd94
Yaleman/issue989 (#2111)
* adding version command to ssh_authorizedkys
* adding version and help to kanidm_unixd_tasks
2023-09-16 14:22:03 +10:00
James Hodgkinson d5ed335b52
Cinco de yakko (#2108)
* there are always more yaks
* see? ldap yaks.
* fixing stupid radius container build thing
2023-09-16 12:11:06 +10:00
James Hodgkinson 383592d921
Schema dooby doo ... yon (#2103)
Refers #1987

Notable changes:

- in server/lib/src/entry.rs - aiming to pass the enum instead of the strings
    - changed signature of add_ava to take Attribute instead of &str (which is used in the entry_init macro... which was fun)
    - set_ava<T> now takes Attribute
- added TryFrom<&AttrString> for Attribute
2023-09-12 11:47:24 +10:00
James Hodgkinson 4b7563adc8
CLI and test things (#2080)
* testing things actually run is handy
* adding build mode to scripts
* uh, so I started messing with handling exit codes...
2023-09-09 09:35:59 +10:00
James Hodgkinson 98884931c5
minor tweaks to Orca (#2077) 2023-09-07 19:04:54 +10:00
Firstyear eee9b09338
improve wording of webauthn cli interaction (#2073)
Co-authored-by: James Hodgkinson <james@terminaloutcomes.com>
2023-09-05 16:37:52 +10:00
Sebastiano Tocci 47e953bfd2
wopsies, missing imports (#2023)
* wopsies, missing imports
* more clippy and fmt
* adding test build for kanidm with idv-tui feature
* making codespell happy

---------

Co-authored-by: James Hodgkinson <james@terminaloutcomes.com>
2023-08-23 22:40:25 +10:00
Sebastiano Tocci 70b19f0630
idv cli (#2001) 2023-08-23 20:51:24 +10:00
James Hodgkinson 753ef82a4b
Trying to fix the (current) container build failures (#2021)
* fixing containers again
2023-08-23 14:42:19 +10:00
Sebastiano Tocci eb7527379b
Configurable session timeouts (#1965)
* added `auth_session_expiry` and `auth_privilege_expiry`
* Added `AcountPolicy` struct
* spelling and stuff
* added cli tools
2023-08-22 11:00:43 +10:00
oddlama 17e4ad52f8
fix: output an array in json mode for kanidm group list (#2016) 2023-08-22 08:17:58 +10:00
oddlama 544689ddac
feat: add json output modes for person list and system oauth2 list (#2017) 2023-08-22 08:17:34 +10:00
James Hodgkinson 05b35df413
Less human strings more enums (#1989)
* statics or enums you choose
* acp rewrite, defined SchemaAcp as a test
* macros and targetscopes and filters oh my
2023-08-21 17:16:43 +10:00
James Hodgkinson 83f189fed3
error handling and web server logging fixes (#1960)
* Fixing the setup_dev_environment script
* clippy calming
* handle_internalunixusertokenread throwing 500's without context
Fixes #1958
2023-08-14 20:47:49 +10:00
James Hodgkinson e2fb53cc42
Orca tweaks (#1963)
* playing with orca things
* updating orca profile defaults
* reverting setup script so #1960 doesn't get stomped
* more options
2023-08-14 17:42:21 +10:00
James Hodgkinson 9246293922
Fighting with zypper, tagging our images (#1964)
* fighting weird build issues

* labels are better outside

* ugh that stupid linter

* why do you always lint on me

* neat

* adding comments
2023-08-14 10:06:53 +10:00
Firstyear bf3e16cbd3
Resolve issue with publishing (#1925)
* Resolve issue with publishing

* Fix version
2023-08-01 17:25:32 +10:00
Firstyear cccc20ea42
20230731 release (#1921)
* Cleanup how we check for last git commit to avoid an insecure dep
* Resolve unmaintained or old deps
* Fix ci
2023-07-31 22:27:21 +10:00
James Hodgkinson ea4d755d7b
chasing weirdness (#1910)
* security headers, fixing error on empty username, handling login without SPN better

* making deno happy

* cleaning up windows build
2023-07-31 10:49:59 +10:00
Firstyear e17dcc0ddb
1788 admin unix socket (#1880) 2023-07-24 10:05:10 +10:00
Firstyear 79ff5e9775
1785 allow sync attr yielding via partial write admin (#1879) 2023-07-19 11:42:53 +10:00
Firstyear 578e064b10
Alter filter generation to exclude empty conditions (#1877) 2023-07-19 11:42:18 +10:00
Firstyear 4f3f7e2708
Revert to opensuse based radius container. (#1878) 2023-07-19 11:41:57 +10:00
Firstyear 60a1cdf9d8
Sync account import improvements (#1873) 2023-07-18 08:49:22 +10:00
James Hodgkinson 5cd62eb974
Upgraded clap, removing atty as a dependency (#1849)
* upgraded clap, removing atty as a dependency
* changing the PR template so when you add a list up the top it doesn't break the bottom
2023-07-13 12:19:28 +10:00
Firstyear 8e1e533f40
1792 public oauth clients (#1821) 2023-07-07 18:53:31 +10:00
James Hodgkinson cc35654388
Converting from tide to axum (#1797)
* Starting to chase down testing
* commenting out unused/inactive endpoints, adding more tests
* clippyism
* making clippy happy v2
* testing when things are not right
* moar checkpoint
* splitting up testkit things a bit
* moving https -> tide
* mad lad be crabbin
* spawning like a frog
* something something different spawning
* woot it works ish
* more server things
* adding version header to requests
* adding kopid_middleware
* well that was supposed to be an hour... four later
* more nonsense
* carrying on with the conversion
* first pass through the conversion is DONE!
* less pub more better
* session storage works better, fixed some paths
* axum-csp version thing
* try a typedheader
* better openssl config things
* updating lockfile
* http2
* actually sending JSON when we say we will!
* just about to do something dumb
* flargl
* more yak shaving
* So many clippy-isms, fixing up a query handler bleep bloop
* So many clippy-isms, fixing up a query handler bleep bloop
* fmt
* all tests pass including basic web logins and nav
* so much clippyism
* stripping out old comments
* fmt
* commenty things
* stripping out tide
* updates
* de-tiding things
* fmt
* adding optional header matching ,thanks @cuberoot74088
* oauth2 stuff to match #1807 but in axum
* CLIPPY IS FINALLY SATED
* moving scim from /v1/scim to /scim
* one day clippy will make sense
* cleanups
* removing sketching middleware
* cleanup, strip a broken test endpoint (routemap), more clippy
* docs fmt
* pulling axum-csp from the wrong cargo.toml
* docs fmt
* fmt fixes
2023-07-05 22:26:39 +10:00
Firstyear 17fa61ceeb
Add client UX for redirecting to an external portal for synced accounts (#1791) 2023-07-05 09:13:06 +10:00
Firstyear 28c8e9df69
Improve cli to support multi-domain handling. (#1786) 2023-06-27 16:45:45 +10:00
James Hodgkinson cc1cc691f3
Started chasing noise, found some code to delete... (#1768)
logging changes:

* Offering auth mechanisms -> debug
* 404's aren't really warnings
* double tombstone message, one goes to debug

other changes:

* CSP changes to allow the bootstrap images to load
* more testing javascriptfile things, I R 
* it's nice to know where things are
* putting non-rust web things in static/ instead of src/
* RequestCredentials::SameOrigin is the default, also adding a utility function to save dupe code. Wow this saved... kilobytes.
* removing commented code, fixing up codespell config
* clippyisms
* wtf, gha
* dee-gloo-ing some things
* adding some ubuntu build test things
* sigh rustwasm/wasm-pack/issues/1138
* more do_request things
* packaging things
* hilarious dev env setup script
* updated script works, all the UI works, including the experimental UI for naughty crabs
* deb package fixes
* fixed some notes
* setup experimental UI tweaks
2023-06-27 11:38:22 +10:00
Firstyear a20dd3b113
Remove r2d2 - sad beep noises (#1766) 2023-06-24 16:15:31 +10:00
Firstyear d5670d0add
Ux improvements - Allow enrolling other devices (#1764) 2023-06-24 12:24:13 +10:00
Firstyear 4725d625af
Remove scripts that are no longer required (#1759) 2023-06-21 15:52:19 +10:00
James Hodgkinson 41d8fece68
OAuth2 secret JSON (#1758)
* clippyisms
* adding JSON support for oauth2 show-basic-token, slight refactor on OutputMode
2023-06-21 13:53:22 +10:00
James Hodgkinson a9547d7150
Allow account locking with expire-at 'epoch' and 'now' (#1757)
Fixes #1755
2023-06-21 11:46:59 +10:00
Firstyear 6513fae5e2
1737 1739 sync - map uidnumbers mail (#1741) 2023-06-16 19:15:36 +10:00
Firstyear 0eaab19775
20230608 ldap sync (#1728) 2023-06-13 14:26:50 +10:00
James Hodgkinson 18fe86db26
X-Forwarded-For catcher - improve ip addr parsing (#1725) 2023-06-12 12:14:34 +10:00
Yuxuan Lu 4f3bfd1025
Save two more kay strokes (#1708) 2023-06-07 06:24:53 +10:00
Yuxuan Lu f4b355c299
Automatically login & reauth (#1691)
* Automatically login & reauth
* Revert automatical format by vscode
* Only ask user to choose username once
* Use dialoguer::Confirm; fix logic
2023-06-05 22:03:52 +10:00
James Hodgkinson fcab605320
Time travelling (#1648)
* yeet the time package into the future (updating min time version to 0.3.21)
* CI change to catch web ui builds in future, updating SCIM requirements
* removing allow deprecated flag
* making references to rfc3339 formatter shorter
* clippyisms
* fmt
2023-05-25 08:25:16 +10:00
cuberoot74088 8de3641614
Fix use-reset-token command hint (#1639)
* Fix use-reset-token command hint

running

`kanidm person credential create-reset-token` 

prints out information how to do credential reset.

This fixes the provided cli command.

* Update book with use-reset-token

* Update kanidm.rs on use-reset-token
2023-05-17 08:35:24 +10:00
Firstyear 33f0034b80
20230424 clippppppppppppyyyyyyyy (#1574)
* Resolve a lot of clips
2023-04-26 21:55:42 +10:00
James Hodgkinson ec8e5dfc31
more-merge unixd commands (#1568)
* fixing unix packaging
* stripping out actions-rs/toolchain
* fixing an error in the qrcode def in cargo.toml
2023-04-25 22:36:17 +10:00
Firstyear c1f62674f5
1496 ldap basedn config (#1500) 2023-03-29 09:34:43 +10:00
Firstyear 4718f2dc6b
1115 priv (reauth, sudo) mode (#1479) 2023-03-27 11:38:09 +10:00
James Hodgkinson d26bef17b6
checks for a minimum number of arguments (#1452) 2023-03-13 18:57:00 +10:00
James Hodgkinson 5573ab9224
RADIUS container fixes (#1424) 2023-03-07 11:50:45 +10:00
Firstyear e33beea89d
1399 cleanup cli docs (#1413)
* Cleanup cli args
* Update book
* Update wasm
* making the CI happy


---------

Co-authored-by: James Hodgkinson <james@terminaloutcomes.com>
2023-03-02 12:47:23 +10:00
Firstyear 00cca81012
1399 cleanup reorg (#1412) 2023-03-01 13:10:52 +10:00