summaryrefslogtreecommitdiffstats
path: root/src/pybind/mgr/telemetry/module.py
diff options
context:
space:
mode:
authorSage Weil <sage@redhat.com>2019-07-25 19:20:52 +0200
committerSage Weil <sage@redhat.com>2019-07-25 19:20:52 +0200
commite82bd5136a7fbfcd305615aafb246ccc27f5bc69 (patch)
tree78bcd58494edb9d09d3d87bf5f949ff3b381aa8f /src/pybind/mgr/telemetry/module.py
parentdoc/mgr/telemetry: update (diff)
downloadceph-e82bd5136a7fbfcd305615aafb246ccc27f5bc69.tar.xz
ceph-e82bd5136a7fbfcd305615aafb246ccc27f5bc69.zip
mgr/telemetry: obscure entity_name with a salt
Signed-off-by: Sage Weil <sage@redhat.com>
Diffstat (limited to '')
-rw-r--r--src/pybind/mgr/telemetry/module.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/pybind/mgr/telemetry/module.py b/src/pybind/mgr/telemetry/module.py
index 495fd5d8c55..4078f32bba2 100644
--- a/src/pybind/mgr/telemetry/module.py
+++ b/src/pybind/mgr/telemetry/module.py
@@ -5,6 +5,7 @@ Collect statistics from Ceph cluster and send this back to the Ceph project
when user has opted-in
"""
import errno
+import hashlib
import json
import re
import requests
@@ -140,6 +141,7 @@ class Module(MgrModule):
self.last_upload = None
self.last_report = dict()
self.report_id = None
+ self.salt = None
def config_notify(self):
for opt in self.MODULE_OPTIONS:
@@ -158,6 +160,11 @@ class Module(MgrModule):
self.report_id = str(uuid.uuid4())
self.set_store('report_id', self.report_id)
+ self.salt = self.get_store('salt', None)
+ if not self.salt:
+ self.salt = str(uuid.uuid4())
+ self.set_store('salt', self.salt)
+
def gather_osd_metadata(self, osd_map):
keys = ["osd_objectstore", "rotational"]
keys += self.metadata_keys
@@ -204,6 +211,13 @@ class Module(MgrModule):
continue
c = json.loads(crashinfo)
del c['utsname_hostname']
+ (etype, eid) = c.get('entity_name', '').split('.')
+ if etype != 'osd':
+ m = hashlib.sha1()
+ m.update(self.salt.encode('utf-8'))
+ m.update(eid.encode('utf-8'))
+ m.update(self.salt.encode('utf-8'))
+ c['entity_name'] = etype + '.' + m.hexdigest()
crashlist.append(c)
return crashlist