99 p3 clean up sensitive log data (#239)

Fix logging of potentially sensitive data.

* Disable docker automation
This commit is contained in:
Firstyear 2020-05-29 18:13:54 +10:00 committed by GitHub
parent 5eb370bc43
commit 923cf6c0f8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 43 additions and 6 deletions

View file

@ -332,13 +332,23 @@ impl ModifyRequest {
// //
// On loginSuccess, we send a cookie, and that allows the token to be // On loginSuccess, we send a cookie, and that allows the token to be
// generated. The cookie can be shared between servers. // generated. The cookie can be shared between servers.
#[derive(Debug, Serialize, Deserialize)] #[derive(Serialize, Deserialize)]
pub enum AuthCredential { pub enum AuthCredential {
Anonymous, Anonymous,
Password(String), Password(String),
TOTP(u32), TOTP(u32),
} }
impl fmt::Debug for AuthCredential {
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
match self {
AuthCredential::Anonymous => write!(fmt, "Anonymous"),
AuthCredential::Password(_) => write!(fmt, "Password(_)"),
AuthCredential::TOTP(_) => write!(fmt, "TOTP(_)"),
}
}
}
#[derive(Debug, Serialize, Deserialize)] #[derive(Debug, Serialize, Deserialize)]
pub enum AuthStep { pub enum AuthStep {
// name, application id? // name, application id?

View file

@ -66,7 +66,7 @@ impl Handler<AuditScope> for EventLog {
type Result = (); type Result = ();
fn handle(&mut self, event: AuditScope, _: &mut SyncContext<Self>) -> Self::Result { fn handle(&mut self, event: AuditScope, _: &mut SyncContext<Self>) -> Self::Result {
debug!("audit: {}", event); info!("{}", event);
} }
} }

View file

@ -252,7 +252,6 @@ fn compare_attrs(
/// [`access`]: ../access/index.html /// [`access`]: ../access/index.html
/// [`event`]: ../event/index.html /// [`event`]: ../event/index.html
/// ///
#[derive(Debug)]
pub struct Entry<VALID, STATE> { pub struct Entry<VALID, STATE> {
valid: VALID, valid: VALID,
state: STATE, state: STATE,
@ -260,6 +259,17 @@ pub struct Entry<VALID, STATE> {
attrs: BTreeMap<String, BTreeSet<Value>>, attrs: BTreeMap<String, BTreeSet<Value>>,
} }
impl<VALID, STATE> std::fmt::Debug for Entry<VALID, STATE>
where
STATE: std::fmt::Debug,
{
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct("Entry<EntrySealed, _>")
.field("state", &self.state)
.finish()
}
}
impl<STATE> std::fmt::Display for Entry<EntrySealed, STATE> { impl<STATE> std::fmt::Display for Entry<EntrySealed, STATE> {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
write!(f, "{}", self.get_uuid()) write!(f, "{}", self.get_uuid())
@ -341,7 +351,14 @@ impl Entry<EntryInit, EntryNew> {
es: &str, es: &str,
qs: &mut QueryServerWriteTransaction, qs: &mut QueryServerWriteTransaction,
) -> Result<Self, OperationError> { ) -> Result<Self, OperationError> {
if cfg!(test) {
if es.len() > 256 {
let (dsp_es, _) = es.split_at(255);
ltrace!(audit, "Parsing -> {}...", dsp_es);
} else {
ltrace!(audit, "Parsing -> {}", es); ltrace!(audit, "Parsing -> {}", es);
}
}
// str -> Proto entry // str -> Proto entry
let pe: ProtoEntry = try_audit!( let pe: ProtoEntry = try_audit!(
audit, audit,

View file

@ -130,7 +130,7 @@ impl<'a> IdmServerWriteTransaction<'a> {
ae: &AuthEvent, ae: &AuthEvent,
ct: Duration, ct: Duration,
) -> Result<AuthResult, OperationError> { ) -> Result<AuthResult, OperationError> {
ltrace!(au, "Received AuthEvent -> {:?}", ae); ltrace!(au, "Received -> {:?}", ae);
// Match on the auth event, to see what we need to do. // Match on the auth event, to see what we need to do.

View file

@ -202,13 +202,23 @@ impl fmt::Display for SyntaxType {
} }
} }
#[derive(Debug, Clone)] #[derive(Clone)]
pub enum DataValue { pub enum DataValue {
Cred(Credential), Cred(Credential),
SshKey(String), SshKey(String),
RadiusCred(String), RadiusCred(String),
} }
impl std::fmt::Debug for DataValue {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
match self {
DataValue::Cred(_) => write!(f, "DataValue::Cred(_)"),
DataValue::SshKey(_) => write!(f, "DataValue::SshKey(_)"),
DataValue::RadiusCred(_) => write!(f, "DataValue::RadiusCred(_)"),
}
}
}
#[derive(Debug, Clone, Eq, Ord, PartialOrd, PartialEq, Deserialize, Serialize)] #[derive(Debug, Clone, Eq, Ord, PartialOrd, PartialEq, Deserialize, Serialize)]
pub enum PartialValue { pub enum PartialValue {
Utf8(String), Utf8(String),