[PATCH] D90526: [clangd] Add -log=public to redact all request info from index server logs

Sam McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sat Oct 31 03:30:45 PDT 2020


sammccall created this revision.
sammccall added reviewers: kadircet, kbobyrev.
Herald added subscribers: cfe-commits, usaxena95, arphaman.
Herald added a project: clang.
sammccall requested review of this revision.
Herald added subscribers: MaskRay, ilya-biryukov.

The index server has access to potentially-sensitive information, e.g. a
sequence of fuzzyFind requests reveals details about code completions in the
editor which in turn reveals details about the code being edited.
This information is necessary to provide the service, and our intention[1] is it
should never be retained beyond the scope of the request (e.g. not logged).

At the same time, some log messages should be exposed:

- server startup/index reloads etc that don't pertain to a user request
- basic request logs (method, latency, #results, error code) for monitoring
- errors while handling requests, without request-specific data

The -log=public design accommodates these by allowing three types of logs:

- those not associated with any user RPC request (via context-propagation)
- those explicitly tagged as [public] in the log line
- logging of format strings only, with no interpolated data (error level only)

[1] Specifically: Google is likely to run public instances of this server
for LLVM and potentially other projects, they will run in this configuration.
The details agreed in a Google-internal privacy review.
As clangd developers, we'd encourage others to use this configuration for public
instances too.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D90526

Files:
  clang-tools-extra/clangd/index/remote/server/Server.cpp
  clang-tools-extra/clangd/support/Logger.cpp
  clang-tools-extra/clangd/support/Logger.h
  clang-tools-extra/clangd/unittests/ClangdLSPServerTests.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D90526.302077.patch
Type: text/x-patch
Size: 9950 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20201031/5539de5c/attachment.bin>


More information about the cfe-commits mailing list