Include the exception value in teh crash dump, but redact it in telemetry.
That way the operator can see it (it's useful info!) but we don't risk
sharing identifying data via telemetry.
Signed-off-by: Sage Weil <sage@newdream.net>
PyObject *l = get_managed_object(formatted_list, boost::python::tag);
if (PyList_Check(l)) {
// skip first line, which is: "Traceback (most recent call last):\n"
- // omit last line, which contains a runtime value that may be identifying!
- for (unsigned i = 1; i < PyList_Size(l) - 1; ++i) {
+ for (unsigned i = 1; i < PyList_Size(l); ++i) {
PyObject *val = PyList_GET_ITEM(l, i);
std::string s = PyUnicode_AsUTF8(val);
s.resize(s.size() - 1); // strip off newline character
if errno:
continue
c = json.loads(crashinfo)
+
+ # redact hostname
del c['utsname_hostname']
+
# entity_name might have more than one '.', beware
(etype, eid) = c.get('entity_name', '').split('.', 1)
m = hashlib.sha1()
m.update(eid.encode('utf-8'))
m.update(self.salt.encode('utf-8'))
c['entity_name'] = etype + '.' + m.hexdigest()
+
+ # redact final line of python tracebacks, as the exception
+ # payload may contain identifying information
+ if 'mgr_module' in c:
+ c['backtrace'][-1] = '<redacted>'
+
crashlist.append(c)
return crashlist