Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add serial number to CertificateIssued log struct #52

Merged
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions rustica/src/logging/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 signing certificate
pub serial: u64,
/// The configured authority name for the signer
pub authority: String,
/// Certificate type, either User or Host
Expand Down
3 changes: 2 additions & 1 deletion rustica/src/logging/stdout.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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(", ")),
Expand Down
1 change: 1 addition & 0 deletions rustica/src/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Loading