From 0c317c5498c4d583b0759f1e6467f0e3e3d9913d Mon Sep 17 00:00:00 2001 From: Daniel Gasienica <daniel@gasienica.ch> Date: Tue, 6 Mar 2018 12:46:38 -0500 Subject: [PATCH] Redact all private information from logs --- js/logging.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/js/logging.js b/js/logging.js index 45cd0a7e5..babf211a7 100644 --- a/js/logging.js +++ b/js/logging.js @@ -7,7 +7,7 @@ const bunyan = require('bunyan'); const _ = require('lodash'); const debuglogs = require('./modules/debuglogs'); - +const Errors = require('./modules/types/errors'); const ipc = electron.ipcRenderer; const PHONE_REGEX = /\+\d{7,12}(\d{3})/g; @@ -60,7 +60,8 @@ function log(...args) { return item; }); - const toSend = redactGroup(redactPhone(str.join(' '))); + + const toSend = redactAll(str.join(' ')); ipc.send('log-info', toSend); } @@ -95,7 +96,11 @@ function formatLine(entry) { } function format(entries) { - return redactGroup(redactPhone(entries.map(formatLine).join('\n'))); + return redactAll(entries.map(formatLine).join('\n'))); +} + +function redactAll(string) { + return Errors.redactSensitivePaths(redactGroup(redactPhone(string))); } function fetch() {