diff --git a/rustica/src/logging/influx.rs b/rustica/src/logging/influx.rs index c4649e75..3997b5dd 100644 --- a/rustica/src/logging/influx.rs +++ b/rustica/src/logging/influx.rs @@ -54,6 +54,7 @@ impl RusticaLogger for InfluxLogger { .into_query(&self.dataset) .add_tag("fingerprint", ci.fingerprint.clone()) .add_tag("mtls_identities", ci.mtls_identities.join(",")) + .add_tag("serial", ci.serial) .add_field("principals", ci.principals.join(",")); let client = self.client.clone(); diff --git a/rustica/src/logging/mod.rs b/rustica/src/logging/mod.rs index 7bd05b3e..c59eb6bd 100644 --- a/rustica/src/logging/mod.rs +++ b/rustica/src/logging/mod.rs @@ -41,6 +41,8 @@ pub struct CertificateIssued { pub fingerprint: String, /// The fingerprint of the signing certificate pub signed_by: String, + /// The serial number of the signed certificate + pub serial: u64, /// The configured authority name for the signer pub authority: String, /// Certificate type, either User or Host diff --git a/rustica/src/logging/stdout.rs b/rustica/src/logging/stdout.rs index 4ba81ac7..7e545543 100644 --- a/rustica/src/logging/stdout.rs +++ b/rustica/src/logging/stdout.rs @@ -18,7 +18,7 @@ impl RusticaLogger for StdoutLogger { match &log.log { Log::CertificateIssued(ci) => { info!( - "[{}] Certificate issued for: [{}] Authority: [{}] Identified by: [{}] Principals granted: [{}] Extensions: [{:?}] CriticalOptions: [{:?}] Valid After: [{}] Valid Before: [{}]", + "[{}] Certificate issued for: [{}] Authority: [{}] Identified by: [{}] Principals granted: [{}] Extensions: [{:?}] CriticalOptions: [{:?}] Valid After: [{}] Valid Before: [{}] Serial Number: [{}]", ci.certificate_type, ci.fingerprint, ci.authority, @@ -28,6 +28,7 @@ impl RusticaLogger for StdoutLogger { ci.critical_options, ci.valid_after, ci.valid_before, + ci.serial, ) } Log::KeyRegistered(kr) => info!("Key registered: [{}] Identified by: [{}]", kr.fingerprint, kr.mtls_identities.join(", ")), diff --git a/rustica/src/server.rs b/rustica/src/server.rs index 00a8e7a8..11fb7c68 100644 --- a/rustica/src/server.rs +++ b/rustica/src/server.rs @@ -634,6 +634,7 @@ impl Rustica for RusticaServer { fingerprint, signed_by: ca_cert.fingerprint().hash, authority: authority.to_string(), + serial: authorization.serial, certificate_type: req_cert_type.to_string(), mtls_identities, principals: authorization.principals,