[all-commits] [llvm/llvm-project] 65eaec: [clangd] Add -log=public to redact all request inf...

Sam McCall via All-commits all-commits at lists.llvm.org
Mon Nov 2 12:25:37 PST 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 65eaec9bd3f23f113a195edf8f2d544ec8e34b4e
      https://github.com/llvm/llvm-project/commit/65eaec9bd3f23f113a195edf8f2d544ec8e34b4e
  Author: Sam McCall <sam.mccall at gmail.com>
  Date:   2020-11-02 (Mon, 02 Nov 2020)

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

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

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.

Differential Revision: https://reviews.llvm.org/D90526




More information about the All-commits mailing list