Skip to content

Commit 26db139

Browse files
committed
docs: log-ref update
1 parent 0c314fb commit 26db139

3 files changed

Lines changed: 1 addition & 94 deletions

File tree

crate/server/src/routes/crl.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ pub(crate) async fn get_crl_public(
128128
);
129129

130130
let Some((crl_der, generated_at, next_update_str)) =
131-
crate::core::operations::generate_crl::get_cached_crl(&issuer_id, &kms, &kms).await
131+
crate::core::operations::generate_crl::get_cached_crl(&issuer_id, &kms).await
132132
else {
133133
return Ok(HttpResponse::NotFound()
134134
.content_type("text/plain; charset=utf-8")

crate/test_kms_server/src/crl_tests.rs

Lines changed: 0 additions & 87 deletions
Original file line numberDiff line numberDiff line change
@@ -1121,90 +1121,3 @@ async fn test_crl_invalid_format_returns_400() {
11211121

11221122
resources.cleanup(&client).await;
11231123
}
1124-
1125-
/// Retrieve the `PrivateKeyLink` attribute from a certificate to get the CA signing key ID.
1126-
async fn get_linked_private_key_id(client: &KmsClient, cert_id: &str) -> String {
1127-
client
1128-
.get_attributes(GetAttributes::from(cert_id))
1129-
.await
1130-
.expect("GetAttributes should succeed")
1131-
.attributes
1132-
.get_link(LinkType::PrivateKeyLink)
1133-
.expect("certificate must have a PrivateKeyLink attribute")
1134-
.to_string()
1135-
}
1136-
1137-
/// Test: CRL must include revoked certificates regardless of which user owns them.
1138-
///
1139-
/// RFC 5280 §5.1 requires a CRL to list every certificate issued by the CA that
1140-
/// has been revoked, irrespective of who owns the certificate in the KMS database.
1141-
///
1142-
/// **Regression guard** for the `find_all` fix: prior to the fix, `find_revoked_certificates`
1143-
/// used a user-scoped `find()` call. Because `find()` only returns objects accessible to
1144-
/// the requesting user, certificates owned by other users were silently omitted.
1145-
/// If the fix is reverted, this test fails with `"expected 3, got 1"`.
1146-
///
1147-
/// Setup (cert-auth server — owner and user are distinct DB identities):
1148-
/// - `owner.client@acme.com` creates CA, issues leaf-1 → DB owner = owner
1149-
/// - `user.client@acme.com` issues leaf-2, leaf-3 → DB owner = user
1150-
/// - All 3 revoked
1151-
/// - Owner generates CRL → must contain all 3 serial numbers
1152-
#[tokio::test]
1153-
async fn test_crl_contains_certs_from_all_users() {
1154-
init_test_logging();
1155-
// Use mTLS cert-auth server: owner and user are distinct DB identities.
1156-
// The cert-auth server has no CO configured, so generate_crl is accessible
1157-
// to the object owner (owner.client@acme.com owns the CA).
1158-
let ctx = start_default_test_kms_server_with_cert_auth().await;
1159-
let owner = ctx.get_owner_client();
1160-
let user = ctx.get_user_client();
1161-
let mut resources = TestResources::new();
1162-
1163-
// 1. Owner creates CA (owner.client@acme.com owns the CA cert and CA private key)
1164-
let ca_id = create_named_ca(&owner, "MultiOwner-CRL-CA", &mut resources).await;
1165-
let ca_sk_id = get_linked_private_key_id(&owner, &ca_id).await;
1166-
resources.track(ca_sk_id.clone());
1167-
1168-
// 2. Grant user.client@acme.com the Certify permission on both the CA cert and CA
1169-
// private key so they can issue leaf certificates without being the owner.
1170-
// The server resolves the issuer private key via PrivateKeyLink and calls
1171-
// retrieve_object_for_operation(KmipOperation::Certify) on each.
1172-
for uid in [&ca_id, &ca_sk_id] {
1173-
owner
1174-
.grant_access(Access {
1175-
unique_identifier: Some(UniqueIdentifier::TextString(uid.clone())),
1176-
user_id: "user.client@acme.com".to_owned(),
1177-
operation_types: vec![KmipOperation::Certify],
1178-
})
1179-
.await
1180-
.expect("grant Certify access should succeed");
1181-
}
1182-
1183-
// 3. Owner issues leaf-1 (DB owner = owner.client@acme.com)
1184-
let leaf1 = issue_cert(&owner, &ca_id, "leaf1.multi-owner-crl", &mut resources).await;
1185-
1186-
// 4. User issues leaf-2 and leaf-3 (DB owner = user.client@acme.com)
1187-
let leaf2 = issue_cert(&user, &ca_id, "leaf2.multi-owner-crl", &mut resources).await;
1188-
let leaf3 = issue_cert(&user, &ca_id, "leaf3.multi-owner-crl", &mut resources).await;
1189-
1190-
// 5. Revoke all three certificates
1191-
revoke_cert(&owner, &leaf1, RevocationReasonCode::Superseded).await;
1192-
revoke_cert(&user, &leaf2, RevocationReasonCode::Superseded).await;
1193-
revoke_cert(&user, &leaf3, RevocationReasonCode::KeyCompromise).await;
1194-
1195-
// 6. Owner generates CRL for the CA.
1196-
// With find_all: sees all 3 revoked certs regardless of DB ownership → len == 3.
1197-
// Without fix (find scoped to owner): only sees leaf-1 → len == 1, assertion fails.
1198-
let crl = fetch_crl_der(&owner, &ca_id, 7).await;
1199-
let revoked = crl.get_revoked().expect("CRL must contain revoked entries");
1200-
1201-
assert_eq!(
1202-
revoked.len(),
1203-
3,
1204-
"CRL must contain all 3 revoked certificates regardless of DB owner: \
1205-
leaf-1 (owned by owner.client@acme.com) + \
1206-
leaf-2 + leaf-3 (both owned by user.client@acme.com)"
1207-
);
1208-
1209-
resources.cleanup(&owner).await;
1210-
}

documentation/docs/configuration/log-reference.md

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -704,9 +704,6 @@ Crate path: `crate/server`
704704
| `info` | `Auto-CRL: triggered CRL regeneration for issuer '{issuer_id}' after certificate revocation` | `src/core/operations/revoke.rs` | `issuer_id`, `user` | Emitted on every successful auto-regen trigger. |
705705
| `warn` | `Auto-CRL: CRL regeneration failed for issuer '{issuer_id}': {e}` | `src/core/operations/revoke.rs` | `issuer_id`, `e` | Signing or DB error during auto-regen; Revoke still succeeds. |
706706
| `error` (audit) | `CRYPTO_OFFICER_ACCESS: crypto officer generating CRL (find_all bypass)` | `src/core/operations/generate_crl.rs` | `user`, `issuer_id` | Emitted every time a CO generates a CRL; always visible regardless of `RUST_LOG`. |
707-
| `info` | `Auto-CRL: triggered CRL regeneration for issuer '{issuer_id}' after certificate revocation` | `src/core/operations/revoke.rs` | `issuer_id`, `user` | Emitted on every successful auto-regen trigger. |
708-
| `warn` | `Auto-CRL: failed to resolve Crypto Officer for issuer '{issuer_id}': {e}` | `src/core/operations/revoke.rs` | `issuer_id`, `e` | DB error while looking up CO activation; CRL not updated. |
709-
| `warn` | `Auto-CRL: CRL regeneration failed for issuer '{issuer_id}': {e}` | `src/core/operations/revoke.rs` | `issuer_id`, `e` | Signing or DB error during auto-regen; Revoke still succeeds. |
710707
| `trace` | `Found {} revoked certificate(s) for issuer '{}'` | `src/core/operations/generate_crl.rs` | - | - |
711708
| `trace` | `Skipping certificate '{}': cannot parse DER: {e}` | `src/core/operations/generate_crl.rs` | `e` | - |
712709
| `warn` | `Failed to load CRL from database for issuer '{issuer_id}': {e}` | `src/core/operations/generate_crl.rs` | `issuer_id`, `e` | - |
@@ -718,9 +715,6 @@ Crate path: `crate/server`
718715
| `debug` | `[crl-refresh-cron] Running scheduled CRL refresh check` | `src/cron.rs` | - | - |
719716
| `debug` | `[crl-refresh-cron] Shutdown signal received; stopping` | `src/cron.rs` | - | - |
720717
| `error` | `CRYPTO_OFFICER_ACCESS: crypto officer generating CRL (find_all bypass)` | `src/core/operations/generate_crl.rs` | - | - |
721-
| `warn` | `Auto-CRL: no active Crypto Officer found for issuer '{issuer_id}'; skipping CRL regeneration after certificate revocation. Complete a CO ceremony or call GET /certificates/{issuer_id}/crl manually.` | `src/core/operations/revoke.rs` | `issuer_id` | - |
722-
| `warn` | `Failed to load CRL from database for issuer '{issuer_id}': {e}` | `src/core/operations/generate_crl.rs` | `issuer_id`, `e` | - |
723-
| `warn` | `Failed to persist CRL to database for issuer '{issuer_certificate_id}': {e}` | `src/core/operations/generate_crl.rs` | `issuer_certificate_id`, `e` | - |
724718
| `warn` | `OPA request failed (fail-closed deny): {e}` | `src/core/opa/client.rs` | `e` | - |
725719
| `warn` | `OPA response parse failed (fail-closed deny): {e}` | `src/core/opa/client.rs` | `e` | - |
726720
| `warn` | `OPA returned non-2xx (fail-closed deny): {status} — {body_text}` | `src/core/opa/client.rs` | `status`, `body_text` | - |

0 commit comments

Comments
 (0)