From c65de5ea5bf779257a930f70d65c605a0e5ab796 Mon Sep 17 00:00:00 2001 From: D050513 Date: Fri, 18 Aug 2023 00:14:29 +0200 Subject: [PATCH] log modifications with success: true --- srv/log2restv2.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/srv/log2restv2.js b/srv/log2restv2.js index 9488fe7..f56ea54 100644 --- a/srv/log2restv2.js +++ b/srv/log2restv2.js @@ -22,11 +22,17 @@ module.exports = class AuditLog2RESTv2 extends AuditLogService { const { event, data } = req // event.match() is used to support the old event names - if (event === 'SensitiveDataRead' || event.match(/^dataAccess/i)) return this._handle(data, 'DATA_ACCESS') - if (event === 'PersonalDataModified' || event.match(/^dataModification/i)) + if (event === 'SensitiveDataRead' || event.match(/^dataAccess/i)) { + return this._handle(data, 'DATA_ACCESS') + } + if (event === 'PersonalDataModified' || event.match(/^dataModification/i)) { + data.success = true return this._handle(data, 'DATA_MODIFICATION') - if (event === 'ConfigurationModified' || event.match(/^configChange/i)) + } + if (event === 'ConfigurationModified' || event.match(/^configChange/i)) { + data.success = true return this._handle(data, 'CONFIGURATION_CHANGE') + } if (event === 'SecurityEvent' || event.match(/^security/i)) { if (typeof data.data === 'object') data.data = JSON.stringify(data.data) return this._handle(data, 'SECURITY_EVENT')