Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 0eee7632ae | |||
| 6588461438 |
Generated
+13
-13
@@ -329,14 +329,14 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "custos-browser"
|
||||
version = "0.19.0"
|
||||
version = "0.19.1"
|
||||
dependencies = [
|
||||
"zeroize",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "custos-gen"
|
||||
version = "0.19.0"
|
||||
version = "0.19.1"
|
||||
dependencies = [
|
||||
"custos-vault",
|
||||
"data-encoding",
|
||||
@@ -348,7 +348,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "custos-kdbx"
|
||||
version = "0.19.0"
|
||||
version = "0.19.1"
|
||||
dependencies = [
|
||||
"aes",
|
||||
"argon2",
|
||||
@@ -369,7 +369,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "custos-keys"
|
||||
version = "0.19.0"
|
||||
version = "0.19.1"
|
||||
dependencies = [
|
||||
"custos-vault",
|
||||
"ed25519-dalek",
|
||||
@@ -382,7 +382,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "custos-native"
|
||||
version = "0.19.0"
|
||||
version = "0.19.1"
|
||||
dependencies = [
|
||||
"custos-browser",
|
||||
"serde_json",
|
||||
@@ -392,11 +392,11 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "custos-qr"
|
||||
version = "0.19.0"
|
||||
version = "0.19.1"
|
||||
|
||||
[[package]]
|
||||
name = "custos-seal"
|
||||
version = "0.19.0"
|
||||
version = "0.19.1"
|
||||
dependencies = [
|
||||
"chacha20poly1305",
|
||||
"hkdf",
|
||||
@@ -409,7 +409,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "custos-share"
|
||||
version = "0.19.0"
|
||||
version = "0.19.1"
|
||||
dependencies = [
|
||||
"argon2",
|
||||
"chacha20poly1305",
|
||||
@@ -426,7 +426,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "custos-sign"
|
||||
version = "0.19.0"
|
||||
version = "0.19.1"
|
||||
dependencies = [
|
||||
"blake2 0.10.6",
|
||||
"data-encoding",
|
||||
@@ -446,7 +446,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "custos-team"
|
||||
version = "0.19.0"
|
||||
version = "0.19.1"
|
||||
dependencies = [
|
||||
"custos-seal",
|
||||
"custos-sign",
|
||||
@@ -464,7 +464,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "custos-totp"
|
||||
version = "0.19.0"
|
||||
version = "0.19.1"
|
||||
dependencies = [
|
||||
"custos-vault",
|
||||
"data-encoding",
|
||||
@@ -477,7 +477,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "custos-vault"
|
||||
version = "0.19.0"
|
||||
version = "0.19.1"
|
||||
dependencies = [
|
||||
"argon2",
|
||||
"bip39",
|
||||
@@ -503,7 +503,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "custos-wasm"
|
||||
version = "0.19.0"
|
||||
version = "0.19.1"
|
||||
dependencies = [
|
||||
"custos-qr",
|
||||
"custos-seal",
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@ resolver = "3"
|
||||
members = ["crates/*"]
|
||||
|
||||
[workspace.package]
|
||||
version = "0.19.0"
|
||||
version = "0.19.1"
|
||||
edition = "2024"
|
||||
license = "MPL-2.0"
|
||||
repository = "https://gitea.marek-novak.cz/mnovak/CustosPublic"
|
||||
|
||||
@@ -90,9 +90,6 @@ pub enum Action {
|
||||
/// The vault was opened with its recovery key: every factor and the key were replaced (`detail`: the used
|
||||
/// key's id). Written by [`Vault::recover`] only.
|
||||
Recovered,
|
||||
/// The Android grant made an app's key (core 0.19.0; `detail`: the key's id, its repository and pipeline).
|
||||
/// Written by [`Vault::android_grant_make_key`] only.
|
||||
AndroidKeyMade,
|
||||
}
|
||||
|
||||
/// What *Connect via SSH* needs.
|
||||
@@ -255,7 +252,7 @@ impl State {
|
||||
|
||||
/// `standing-granted` or `standing-revoked`, with the rule as its detail (cut to what a note may hold).
|
||||
pub(crate) fn standing_note(&mut self, action: Action, detail: &str, now: i64) {
|
||||
debug_assert!(matches!(action, Action::StandingGranted | Action::StandingRevoked | Action::AndroidKeyMade));
|
||||
debug_assert!(matches!(action, Action::StandingGranted | Action::StandingRevoked));
|
||||
let detail: String = detail.chars().filter(|c| !c.is_control()).take(500).collect();
|
||||
self.notice_expiry(now);
|
||||
self.audit.push(SecurityEntry { at: now, action, item: None, auth: None, detail: Some(detail) });
|
||||
|
||||
@@ -1272,7 +1272,9 @@ impl Vault {
|
||||
/// Makes `repo`'s app key under the Android grant, when its first release asks (`custos-sign apk`): the grant
|
||||
/// covers `repo`, `pipeline` is `release`, `via` is local, *Sign only with a card* is not ticked, and there is
|
||||
/// no key under that id. RSA-4096, `CN=<Name>`, the grant's O and C, scoped to exactly `repo` and `release`.
|
||||
/// Writes `android-key-made`. The caller saves. Slow: one RSA-4096 key.
|
||||
/// Writes `standing-granted` with `Android grant made <id> for <repo> pipeline release`: a value every core since
|
||||
/// 0.16.0 reads, so the phone and the web vault still open the vault (core 0.19.1). The caller saves. Slow: one
|
||||
/// RSA-4096 key.
|
||||
pub fn android_grant_make_key(&mut self, repo: &str, pipeline: &str, via: Via, now: i64) -> Result<String, Error> {
|
||||
let no = |why: String| Err(Error::Signing(why));
|
||||
let Some(g) = self.signing.android.clone() else { return no("there is no Android grant".into()) };
|
||||
@@ -1314,8 +1316,8 @@ impl Vault {
|
||||
{
|
||||
g.made.push(id.clone());
|
||||
}
|
||||
let words = format!("{id} for {repo} pipeline {ANDROID_PIPELINE}");
|
||||
self.security.standing_note(crate::security::Action::AndroidKeyMade, &words, now);
|
||||
let words = format!("Android grant made {id} for {repo} pipeline {ANDROID_PIPELINE}");
|
||||
self.security.standing_note(crate::security::Action::StandingGranted, &words, now);
|
||||
Ok(id)
|
||||
}
|
||||
|
||||
|
||||
@@ -100,12 +100,13 @@ fn the_grant_makes_an_apps_key_and_signs_its_first_apk_without_a_card() {
|
||||
let g = v.android_grant().unwrap();
|
||||
assert_eq!((g.uses, g.last_used, g.made.clone()), (2, Some(NOW + 3), s(&["culina-android"])));
|
||||
|
||||
assert_eq!(notes(&v, Action::AndroidKeyMade), ["culina-android for mnovak/Culina pipeline release"]);
|
||||
// Granting, then the key it made: both `standing-granted`, a value cores since 0.16.0 read (core 0.19.1).
|
||||
let granted_note = notes(&v, Action::StandingGranted);
|
||||
assert_eq!(granted_note.len(), 1);
|
||||
assert_eq!(granted_note.len(), 2, "{granted_note:?}");
|
||||
assert!(granted_note[0].contains("Android releases") && granted_note[0].contains("mnovak/*"), "{granted_note:?}");
|
||||
assert_eq!(granted_note[1], "Android grant made culina-android for mnovak/Culina pipeline release");
|
||||
// The public note call cannot write it.
|
||||
assert!(v.security_note(Action::AndroidKeyMade, "x", NOW).is_err());
|
||||
assert!(v.security_note(Action::StandingGranted, "x", NOW).is_err());
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
||||
+4
-3
@@ -150,8 +150,9 @@ core before 0.14.0. Core 0.16.0 adds the `signing` audit outcome `standing` and
|
||||
`standing-granted` and `standing-revoked` (docs/SIGNING.md, "Standing approvals"): a vault in which a standing
|
||||
approval was ever granted does not open in a core before 0.16.0. The rules themselves (`signing.standing`) are a
|
||||
member older cores ignore and drop. Core 0.19.0 adds the member `signing.android` (the Android grant, docs/SIGNING.md "The Android
|
||||
grant"), which older cores ignore and drop (the grant is lost, never widened), and the `security` action
|
||||
`android-key-made`: a vault in which the grant made a key does not open in a core before 0.19.0.
|
||||
grant"), which older cores ignore and drop (the grant is lost, never widened). It adds no closed-list value:
|
||||
a key the grant makes is `standing-granted` in the security audit (core 0.19.1), so a vault with the grant still
|
||||
opens in every core since 0.16.0, as the phone app and the web vault may be.
|
||||
|
||||
### The provision audit (core 0.11.0)
|
||||
|
||||
@@ -215,7 +216,7 @@ an outcome; a code the server then refuses (its exit 10) is not seen by Custos,
|
||||
| `finished` | optional: when that window ended, by *Finish setup*, or `until` once its expiry was noticed |
|
||||
| `ticked` | the checklist items that are ticked: `totp-on-phone`, `hello-approvals`, `narrow-scope`, `rotate-setup`, `no-ssh`, `phone-approves`, and (core 0.13.0) `no-auto-connect`, `no-unattended`, `card-signing` |
|
||||
| `keptScope` | optional: the server scope prefixes *Narrow the server scope* replaced (`ask`, `offer`: at most 64 each, 1–200 characters, no control characters), kept for its undo |
|
||||
| `audit` | `{at, action, item?, auth?, detail?}`; `action` is `setup-started`, `setup-finished`, `setup-expired`, `ticked`, `unticked`, `ssh-connected`, `totp-moved`, or (core 0.13.0) `auto-connected`, `unattended-stored`, `setup-item-removed`, `unattended-signed`, `taken-over`, or (core 0.16.0) `standing-granted`, `standing-revoked` (also for the Android grant), or (core 0.19.0) `android-key-made`, or (core 0.17.0) `recovery-created`, `recovery-removed`, `recovered` (docs/FACTORS.md, "The recovery key"; their `detail` is the key's id); `item` a checklist item (with `ticked`, `unticked`); `auth` is `hello` or `password` (with `unticked`); `detail` (core 0.13.0, the four notes; core 0.16.0, the two standing actions) names what happened, never a value: 1–500 characters, no control characters |
|
||||
| `audit` | `{at, action, item?, auth?, detail?}`; `action` is `setup-started`, `setup-finished`, `setup-expired`, `ticked`, `unticked`, `ssh-connected`, `totp-moved`, or (core 0.13.0) `auto-connected`, `unattended-stored`, `setup-item-removed`, `unattended-signed`, `taken-over`, or (core 0.16.0) `standing-granted`, `standing-revoked` (also for the Android grant and the keys it makes), or (core 0.17.0) `recovery-created`, `recovery-removed`, `recovered` (docs/FACTORS.md, "The recovery key"; their `detail` is the key's id); `item` a checklist item (with `ticked`, `unticked`); `auth` is `hello` or `password` (with `unticked`); `detail` (core 0.13.0, the four notes; core 0.16.0, the two standing actions) names what happened, never a value: 1–500 characters, no control characters |
|
||||
|
||||
The **level** is computed, never stored:
|
||||
|
||||
|
||||
+4
-2
@@ -288,8 +288,10 @@ and counts the use on whichever fitted.
|
||||
pipeline is `release`, `via` is `local`, `card-signing` is not ticked, and the vault has no key under that id. It
|
||||
makes the RSA-4096 key with the certificate `CN=<Name>` (the repository's name, first letter upper case), `O` and `C`
|
||||
from the grant, named `<Name> Android`, scoped to exactly that repository and `release`, adds the id to `made`, and
|
||||
writes `android-key-made` to the security audit (`<id> for <repo> pipeline release`). It is a key like any other:
|
||||
not exportable, removed only as any key is.
|
||||
writes `standing-granted` to the security audit (`Android grant made <id> for <repo> pipeline release`). Core 0.19.0
|
||||
wrote a new action, `android-key-made`, which older cores refuse; 0.19.1 keeps to the values every core since 0.16.0
|
||||
reads, because the phone app and the web vault open the same vault. It is a key like any other: not exportable,
|
||||
removed only as any key is.
|
||||
|
||||
**Granting** (`android_grant_set(repos, o, c, now)`) stores or replaces the grant (the counts and `made` stay) and
|
||||
writes `standing-granted` with `Android releases: <patterns> pipeline release, keys made on first use`. It is
|
||||
|
||||
Reference in New Issue
Block a user