Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,12 @@ All notable changes to this project will be documented in this file.

- Document Helm deployed RBAC permissions and remove unnecessary permissions ([#693]).

### Fixed

- Redact the user-provided PKCS#12 keystore password in operator logs. ([#706]).

[#693]: https://github.com/stackabletech/secret-operator/pull/693
[#706]: https://github.com/stackabletech/secret-operator/pull/706

## [26.3.0] - 2026-03-16

Expand Down
5 changes: 4 additions & 1 deletion rust/operator-binary/src/format/convert.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@ pub fn convert(
(WellKnownSecretData::TlsPem(pem), SecretFormat::TlsPkcs12) => {
Ok(WellKnownSecretData::TlsPkcs12(convert_tls_to_pkcs12(
pem,
compat.tls_pkcs12_password.as_deref().unwrap_or_default(),
compat
.tls_pkcs12_password
.as_deref()
.map_or("", String::as_str),
Comment thread
dervoeti marked this conversation as resolved.
Outdated
)?))
}

Expand Down
7 changes: 5 additions & 2 deletions rust/operator-binary/src/format/well_known.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ use stackable_operator::schemars::{self, JsonSchema};
use strum::EnumDiscriminants;

use super::{ConvertError, SecretFiles, convert};
use crate::{backend::ProvisionParts, utils::ResultExt};
use crate::{
backend::ProvisionParts,
utils::{ResultExt, Unloggable},
};

const FILE_PEM_CERT_CERT: &str = "tls.crt";
const FILE_PEM_CERT_KEY: &str = "tls.key";
Expand Down Expand Up @@ -168,7 +171,7 @@ pub struct CompatibilityOptions {
rename = "secrets.stackable.tech/format.compatibility.tls-pkcs12.password",
default
)]
pub tls_pkcs12_password: Option<String>,
pub tls_pkcs12_password: Option<Unloggable<String>>,
}

/// Options to customize the well-known format file names.
Expand Down
7 changes: 7 additions & 0 deletions rust/operator-binary/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ pub fn asn1time_to_offsetdatetime(asn: &Asn1TimeRef) -> Result<OffsetDateTime, A

/// Wrapper for (mostly) secret values that should not be logged.
// When/if migrating to Valuable, provide a dummy implementation of Value too
#[derive(Default)]
Comment thread
Techassi marked this conversation as resolved.
Outdated
pub struct Unloggable<T>(pub T);

impl<T> Debug for Unloggable<T> {
Expand All @@ -201,6 +202,12 @@ impl<T> DerefMut for Unloggable<T> {
}
}

impl<'de, T: serde::Deserialize<'de>> serde::Deserialize<'de> for Unloggable<T> {
fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
T::deserialize(deserializer).map(Unloggable)
}
}

/// Wrapper type for [`Iterator::collect`] that flattens the incoming [`Iterator`].
///
/// This isn't super useful for "regular" collects (just call [`Iterator::flatten`]!),
Expand Down
Loading