Skip to content
This repository has been archived by the owner on Nov 1, 2023. It is now read-only.

Commit

Permalink
Replace machine name in telemetry with "Redacted"
Browse files Browse the repository at this point in the history
  • Loading branch information
stas committed Sep 13, 2021
1 parent 44da180 commit 57e40c7
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/agent/onefuzz-telemetry/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -427,12 +427,21 @@ mod global {
}
}

const REDACTED : &str = "Redacted";
pub fn set_appinsights_clients(
instance_key: Option<InstanceTelemetryKey>,
microsoft_key: Option<MicrosoftTelemetryKey>,
) {
let instance_client = instance_key.map(|k| TelemetryClient::new(k.to_string()));
let microsoft_client = microsoft_key.map(|k| TelemetryClient::new(k.to_string()));
let microsoft_client = microsoft_key.map(|k| {
let mut tc = TelemetryClient::new(k.to_string());
//Redact IP and machine name from telemetry
tc.context_mut().tags_mut().location_mut().set_ip("0.0.0.0".to_string());
tc.context_mut().tags_mut().cloud_mut().set_role_instance(REDACTED.to_string());
tc.context_mut().tags_mut().device_mut().set_id(REDACTED.to_string());
tc
});

global::set_clients(instance_client, microsoft_client);
}

Expand Down

0 comments on commit 57e40c7

Please sign in to comment.