Skip to content

Commit b007b1d

Browse files
Redact args in the logs of audit log service (#20853)
1 parent 65b0538 commit b007b1d

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

components/server/src/audit/AuditLogService.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,16 @@ export class AuditLogService {
5353
action: method,
5454
args: argsScrubbed,
5555
};
56-
log.info("audit", new TrustedValue(logEntry));
56+
// The args param contains workspace IDs and other sensitive data. Since
57+
// it's quite hard to detect them, best way is to simply not log it at
58+
// all. It's still part of the audit database but does not appear in the
59+
// component logs.
60+
const logEntryForLogging = {
61+
...logEntry,
62+
args: ["[redacted]"],
63+
};
64+
65+
log.info("audit", new TrustedValue(logEntryForLogging));
5766
await this.dbAuditLog.recordAuditLog(logEntry);
5867
}
5968

0 commit comments

Comments
 (0)