1399 cleanup reorg (#1412)
11
.gitignore
vendored
|
@ -1,5 +1,4 @@
|
||||||
altnames.cnf
|
altnames.cnf
|
||||||
|
|
||||||
.DS_Store
|
.DS_Store
|
||||||
.backup*_test.json
|
.backup*_test.json
|
||||||
.backup_test.db
|
.backup_test.db
|
||||||
|
@ -9,15 +8,13 @@ altnames.cnf
|
||||||
test.db
|
test.db
|
||||||
cargo_vendor_config
|
cargo_vendor_config
|
||||||
/vendor
|
/vendor
|
||||||
kanidm_rlm_python/test_data/certs/
|
rlm_python/test_data/certs/
|
||||||
vendor.tar.gz
|
rlm_python/test_data/ca.pem
|
||||||
kanidm_rlm_python/test_data/ca.pem
|
scripts/loc.sh
|
||||||
loc.sh
|
|
||||||
vendor.tar.*
|
vendor.tar.*
|
||||||
*.patch
|
*.patch
|
||||||
orca/example_profiles/small/orca-edited.toml
|
tools/orca/example_profiles/small/orca-edited.toml
|
||||||
/docs/
|
/docs/
|
||||||
kanidm_unix_int/pam_tester/Cargo.lock
|
|
||||||
.vscode/
|
.vscode/
|
||||||
|
|
||||||
# kanidm simple packaging
|
# kanidm simple packaging
|
||||||
|
|
31
Cargo.lock
generated
|
@ -1152,9 +1152,9 @@ version = "1.1.0-alpha.12-dev"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"clap",
|
"clap",
|
||||||
"clap_complete",
|
"clap_complete",
|
||||||
|
"kanidm_lib_file_permissions",
|
||||||
"kanidm_proto",
|
"kanidm_proto",
|
||||||
"kanidmd_core",
|
"kanidmd_core",
|
||||||
"kanidmd_lib",
|
|
||||||
"profiles",
|
"profiles",
|
||||||
"reqwest",
|
"reqwest",
|
||||||
"serde",
|
"serde",
|
||||||
|
@ -2270,6 +2270,30 @@ dependencies = [
|
||||||
"webauthn-rs-proto",
|
"webauthn-rs-proto",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "kanidm_lib_crypto"
|
||||||
|
version = "0.1.0"
|
||||||
|
dependencies = [
|
||||||
|
"base64 0.13.1",
|
||||||
|
"base64urlsafedata",
|
||||||
|
"hex",
|
||||||
|
"kanidm_proto",
|
||||||
|
"openssl",
|
||||||
|
"openssl-sys",
|
||||||
|
"rand 0.8.5",
|
||||||
|
"serde",
|
||||||
|
"sketching",
|
||||||
|
"tracing",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "kanidm_lib_file_permissions"
|
||||||
|
version = "0.1.0"
|
||||||
|
dependencies = [
|
||||||
|
"users",
|
||||||
|
"whoami",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "kanidm_proto"
|
name = "kanidm_proto"
|
||||||
version = "1.1.0-alpha.12-dev"
|
version = "1.1.0-alpha.12-dev"
|
||||||
|
@ -2325,9 +2349,10 @@ dependencies = [
|
||||||
"clap_complete",
|
"clap_complete",
|
||||||
"futures",
|
"futures",
|
||||||
"kanidm_client",
|
"kanidm_client",
|
||||||
|
"kanidm_lib_crypto",
|
||||||
|
"kanidm_lib_file_permissions",
|
||||||
"kanidm_proto",
|
"kanidm_proto",
|
||||||
"kanidmd_core",
|
"kanidmd_core",
|
||||||
"kanidmd_lib",
|
|
||||||
"libc",
|
"libc",
|
||||||
"libsqlite3-sys",
|
"libsqlite3-sys",
|
||||||
"lru 0.8.1",
|
"lru 0.8.1",
|
||||||
|
@ -2398,8 +2423,8 @@ dependencies = [
|
||||||
"futures",
|
"futures",
|
||||||
"futures-util",
|
"futures-util",
|
||||||
"hashbrown",
|
"hashbrown",
|
||||||
"hex",
|
|
||||||
"idlset",
|
"idlset",
|
||||||
|
"kanidm_lib_crypto",
|
||||||
"kanidm_proto",
|
"kanidm_proto",
|
||||||
"kanidmd_lib_macros",
|
"kanidmd_lib_macros",
|
||||||
"lazy_static",
|
"lazy_static",
|
||||||
|
|
60
Cargo.toml
|
@ -4,23 +4,25 @@ lto = "thin"
|
||||||
|
|
||||||
[workspace]
|
[workspace]
|
||||||
members = [
|
members = [
|
||||||
"iam_migrations/freeipa",
|
"proto",
|
||||||
"kanidm_client",
|
"tools/cli",
|
||||||
"kanidm_proto",
|
"tools/iam_migrations/freeipa",
|
||||||
"kanidm_tools",
|
"tools/orca",
|
||||||
"kanidm_unix_int",
|
"unix_integration",
|
||||||
"kanidm_unix_int/nss_kanidm",
|
"unix_integration/nss_kanidm",
|
||||||
"kanidm_unix_int/pam_kanidm",
|
"unix_integration/pam_kanidm",
|
||||||
"kanidmd_web_ui",
|
"server/web_ui",
|
||||||
"kanidmd/daemon",
|
"server/daemon",
|
||||||
"kanidmd/lib",
|
"server/lib",
|
||||||
"kanidmd/lib-macros",
|
"server/lib-macros",
|
||||||
"kanidmd/core",
|
"server/core",
|
||||||
"kanidmd/testkit",
|
"server/testkit",
|
||||||
"kanidmd/testkit-macros",
|
"server/testkit-macros",
|
||||||
"orca",
|
"libs/client",
|
||||||
"profiles",
|
"libs/crypto",
|
||||||
"sketching"
|
"libs/file_permissions",
|
||||||
|
"libs/profiles",
|
||||||
|
"libs/sketching"
|
||||||
]
|
]
|
||||||
|
|
||||||
[workspace.package]
|
[workspace.package]
|
||||||
|
@ -69,14 +71,16 @@ http-types = "^2.12.0"
|
||||||
idlset = "^0.2.4"
|
idlset = "^0.2.4"
|
||||||
# idlset = { path = "../idlset" }
|
# idlset = { path = "../idlset" }
|
||||||
js-sys = "^0.3.58"
|
js-sys = "^0.3.58"
|
||||||
kanidmd_core = { path = "./kanidmd/core" }
|
kanidmd_core = { path = "./server/core" }
|
||||||
kanidmd_idm = { path = "./kanidmd/idm" }
|
kanidmd_idm = { path = "./server/idm" }
|
||||||
kanidmd_lib = { path = "./kanidmd/lib" }
|
kanidmd_lib = { path = "./server/lib" }
|
||||||
kanidmd_lib_macros = { path = "./kanidmd/lib-macros" }
|
kanidmd_lib_macros = { path = "./server/lib-macros" }
|
||||||
kanidmd_testkit = { path = "./kanidmd/testkit" }
|
kanidm_lib_crypto = { path = "./libs/crypto" }
|
||||||
kanidm_client = { path = "./kanidm_client", version = "1.1.0-alpha.11" }
|
kanidm_lib_file_permissions = { path = "./libs/file_permissions" }
|
||||||
kanidm_proto = { path = "./kanidm_proto", version = "1.1.0-alpha.11" }
|
kanidmd_testkit = { path = "./server/testkit" }
|
||||||
kanidm_unix_int = { path = "./kanidm_unix_int" }
|
kanidm_client = { path = "./libs/client", version = "1.1.0-alpha.11" }
|
||||||
|
kanidm_proto = { path = "./proto", version = "1.1.0-alpha.11" }
|
||||||
|
kanidm_unix_int = { path = "./unix_integration" }
|
||||||
last-git-commit = "0.2.0"
|
last-git-commit = "0.2.0"
|
||||||
# REMOVE this
|
# REMOVE this
|
||||||
lazy_static = "^1.4.0"
|
lazy_static = "^1.4.0"
|
||||||
|
@ -100,7 +104,7 @@ openssl = "^0.10.45"
|
||||||
paste = "^1.0.11"
|
paste = "^1.0.11"
|
||||||
pkg-config = "^0.3.26"
|
pkg-config = "^0.3.26"
|
||||||
proc-macro2 = "1.0.51"
|
proc-macro2 = "1.0.51"
|
||||||
profiles = { path = "./profiles" }
|
profiles = { path = "./libs/profiles" }
|
||||||
qrcode = "^0.12.0"
|
qrcode = "^0.12.0"
|
||||||
quote = "1"
|
quote = "1"
|
||||||
r2d2 = "^0.8.9"
|
r2d2 = "^0.8.9"
|
||||||
|
@ -120,12 +124,12 @@ serde_cbor = { version = "0.12.0-dev", package = "serde_cbor_2" }
|
||||||
serde_json = "^1.0.93"
|
serde_json = "^1.0.93"
|
||||||
serde-wasm-bindgen = "0.4"
|
serde-wasm-bindgen = "0.4"
|
||||||
shellexpand = "^2.1.2"
|
shellexpand = "^2.1.2"
|
||||||
sketching = { path = "./sketching" }
|
sketching = { path = "./libs/sketching" }
|
||||||
smartstring = "^1.0.1"
|
smartstring = "^1.0.1"
|
||||||
smolset = "^1.3.1"
|
smolset = "^1.3.1"
|
||||||
sshkeys = "^0.3.1"
|
sshkeys = "^0.3.1"
|
||||||
syn = { version = "1.0.109", features = ["full"] }
|
syn = { version = "1.0.109", features = ["full"] }
|
||||||
testkit-macros = { path = "./kanidmd/testkit-macros" }
|
testkit-macros = { path = "./server/testkit-macros" }
|
||||||
tide = "^0.16.0"
|
tide = "^0.16.0"
|
||||||
# Including brotli *very* slow, so don't do that. Including the "default" feature pulls a mime-type list from the internet on build, which isn't used.
|
# Including brotli *very* slow, so don't do that. Including the "default" feature pulls a mime-type list from the internet on build, which isn't used.
|
||||||
tide-compress = { version="0.10.6", default-features = false, features = [ "gzip", "regex-check" ] }
|
tide-compress = { version="0.10.6", default-features = false, features = [ "gzip", "regex-check" ] }
|
||||||
|
|
|
@ -52,7 +52,7 @@ See our [code of conduct]
|
||||||
See our documentation on [rights and ethics]
|
See our documentation on [rights and ethics]
|
||||||
|
|
||||||
[code of conduct]: https://github.com/kanidm/kanidm/blob/master/CODE_OF_CONDUCT.md
|
[code of conduct]: https://github.com/kanidm/kanidm/blob/master/CODE_OF_CONDUCT.md
|
||||||
[rights and ethics]: https://github.com/kanidm/kanidm/blob/master/ethics/README.md
|
[rights and ethics]: https://github.com/kanidm/kanidm/blob/master/project_docs/ethics/README.md
|
||||||
|
|
||||||
## Getting in Contact / Questions
|
## Getting in Contact / Questions
|
||||||
|
|
||||||
|
|
|
@ -48,6 +48,7 @@
|
||||||
# For Developers
|
# For Developers
|
||||||
|
|
||||||
- [Developer Guide](DEVELOPER_README.md)
|
- [Developer Guide](DEVELOPER_README.md)
|
||||||
|
- [FAQ](developers/faq.md)
|
||||||
- [Design Documents]()
|
- [Design Documents]()
|
||||||
- [Access Profiles 2022](developers/designs/access_profiles_rework_2022.md)
|
- [Access Profiles 2022](developers/designs/access_profiles_rework_2022.md)
|
||||||
- [Access Profiles Original](developers/designs/access_profiles_and_security.md)
|
- [Access Profiles Original](developers/designs/access_profiles_and_security.md)
|
Before Width: | Height: | Size: 40 KiB After Width: | Height: | Size: 40 KiB |
Before Width: | Height: | Size: 63 KiB After Width: | Height: | Size: 63 KiB |
Before Width: | Height: | Size: 103 KiB After Width: | Height: | Size: 103 KiB |
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 10 KiB |
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |
|
@ -1,46 +0,0 @@
|
||||||
use std::time::Duration;
|
|
||||||
|
|
||||||
use super::{Password, PBKDF2_MIN_NIST_COST};
|
|
||||||
|
|
||||||
#[derive(Debug)]
|
|
||||||
pub struct CryptoPolicy {
|
|
||||||
pub(crate) pbkdf2_cost: usize,
|
|
||||||
}
|
|
||||||
|
|
||||||
impl CryptoPolicy {
|
|
||||||
#[cfg(test)]
|
|
||||||
pub(crate) fn minimum() -> Self {
|
|
||||||
CryptoPolicy {
|
|
||||||
pbkdf2_cost: PBKDF2_MIN_NIST_COST,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn time_target(t: Duration) -> Self {
|
|
||||||
let r = match Password::bench_pbkdf2(PBKDF2_MIN_NIST_COST * 10) {
|
|
||||||
Some(bt) => {
|
|
||||||
let ubt = bt.as_nanos() as usize;
|
|
||||||
|
|
||||||
// Get the cost per thousand rounds
|
|
||||||
let per_thou = (PBKDF2_MIN_NIST_COST * 10) / 1000;
|
|
||||||
let t_per_thou = ubt / per_thou;
|
|
||||||
// eprintln!("{} / {}", ubt, per_thou);
|
|
||||||
|
|
||||||
// Now we need the attacker work in nanos
|
|
||||||
let attack_time = t.as_nanos() as usize;
|
|
||||||
let r = (attack_time / t_per_thou) * 1000;
|
|
||||||
|
|
||||||
// eprintln!("({} / {} ) * 1000", attack_time, t_per_thou);
|
|
||||||
// eprintln!("Maybe rounds -> {}", r);
|
|
||||||
|
|
||||||
if r < PBKDF2_MIN_NIST_COST {
|
|
||||||
PBKDF2_MIN_NIST_COST
|
|
||||||
} else {
|
|
||||||
r
|
|
||||||
}
|
|
||||||
}
|
|
||||||
None => PBKDF2_MIN_NIST_COST,
|
|
||||||
};
|
|
||||||
|
|
||||||
CryptoPolicy { pbkdf2_cost: r }
|
|
||||||
}
|
|
||||||
}
|
|