[SERVER-36479] Log redaction does not show planSummary when slow queries are logged Created: 07/Aug/18  Updated: 29/Oct/23  Resolved: 18/Aug/18

Status: Closed
Project: Core Server
Component/s: Logging, Security
Affects Version/s: 3.4.14, 4.0.0
Fix Version/s: 3.4.17, 3.6.8, 4.0.2, 4.1.3

Type: Bug Priority: Major - P3
Reporter: Dmitry Ryabtsev Assignee: Kelsey Schubert
Resolution: Fixed Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Related
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v4.0, v3.6, v3.4
Participants:
Case:

 Description   

At present when log redaction is enabled, the planSummary section of the log message (if it's a for a slow query) gets redacted completely:

2018-08-07T12:10:40.348+1000 I COMMAND  [conn11] command test.t appName: "MongoDB Shell" command: find { find: "###", filter: { a: "###", b: "###" }, $db: "###" } planSummary: ### keysExamined:1 docsExamined:1 cursorExhausted:1 numYields:0 nreturned:1 reslen:138 locks:{ Global: { acquireCount: { r: 1 } }, Database: { acquireCount: { r: 1 } }, Collection: { acquireCount: { r: 1 } } } protocol:op_msg 19ms

That makes it difficult to understand why a query is perfoming the way it is. It should not be necessary to have planSummary redacted completely. The redaction should only happen for sensitive elements (just as we do it for the query shape), if they happen to appear under planSummary.

This is the un-redacted message that shows that there is nothing sensitive under planSummary in this particular example:

2018-08-07T12:11:02.992+1000 I COMMAND  [conn11] command test.t appName: "MongoDB Shell" command: find { find: "t", filter: { a: "a", b: "b" }, $db: "test" } planSummary: IXSCAN { a: 1, b: 1 } keysExamined:1 docsExamined:1 cursorExhausted:1 numYields:0 nreturned:1 reslen:138 locks:{ Global: { acquireCount: { r: 1 } }, Database: { acquireCount: { r: 1 } }, Collection: { acquireCount: { r: 1 } } } protocol:op_msg 0ms



 Comments   
Comment by Githook User [ 29/Aug/18 ]

Author:

{'name': 'Kelsey Schubert', 'email': 'kelsey@mongodb.com', 'username': 'Schubes'}

Message: SERVER-36479 Don't redact planSummary in logs

(cherry picked from commit f19a83eb8aedfe11dc2ac7ac454f3eb51b5a86cb)
Branch: v3.4
https://github.com/mongodb/mongo/commit/7c14a47868643bb691a507a92fe25541f998eca4

Comment by Githook User [ 21/Aug/18 ]

Author:

{'name': 'Kelsey Schubert', 'email': 'kelsey@mongodb.com', 'username': 'Schubes'}

Message: SERVER-36479 Don't redact planSummary in logs

(cherry picked from commit f19a83eb8aedfe11dc2ac7ac454f3eb51b5a86cb)
Branch: v3.6
https://github.com/mongodb/mongo/commit/eca2a99916c7fd7c74f8efbb836d5d2458d7a450

Comment by Githook User [ 21/Aug/18 ]

Author:

{'name': 'Kelsey Schubert', 'email': 'kelsey@mongodb.com', 'username': 'Schubes'}

Message: SERVER-36479 Don't redact planSummary in logs

(cherry picked from commit f19a83eb8aedfe11dc2ac7ac454f3eb51b5a86cb)
Branch: v4.0
https://github.com/mongodb/mongo/commit/c0ba6b5de5fba5beeb60d4888d5120f821248dbf

Comment by Githook User [ 18/Aug/18 ]

Author:

{'name': 'Kelsey Schubert', 'email': 'kelsey@mongodb.com', 'username': 'Schubes'}

Message: SERVER-36479 Don't redact planSummary in logs
Branch: master
https://github.com/mongodb/mongo/commit/f19a83eb8aedfe11dc2ac7ac454f3eb51b5a86cb

Generated at Thu Feb 08 04:43:14 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.