Skip to content

Commit

Permalink
mgr/telemetry: anonymizing smartctl report itself
Browse files Browse the repository at this point in the history
smartctl JSON output contains the device's serial number in two
different keys ('serial_number' & 'output'). Serial is now obfuscated in
both.

Fixes: https://tracker.ceph.com/issues/43939
Signed-off-by: Yaarit Hatuka <yaarit@redhat.com>
(cherry picked from commit be1257f)
  • Loading branch information
yaarith authored and k0ste committed Feb 5, 2020
1 parent c4dc4f0 commit 3c7d09e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/pybind/mgr/telemetry/module.py
Expand Up @@ -400,9 +400,9 @@ def gather_device_report(self):
host, anon_host))

# anonymize the smartctl report itself
for k in ['serial_number']:
if k in m:
m.pop(k)
serial = devid.rsplit('_', 1)[1]
m_str = json.dumps(m)
m = json.loads(m_str.replace(serial, 'deleted'))

if anon_host not in res:
res[anon_host] = {}
Expand Down

0 comments on commit 3c7d09e

Please sign in to comment.