Skip to content

fix(lit-actions): redact js_params/headers/auth_context from logs by default (CPL-369) - #616

Open
GTC6244 wants to merge 5 commits into
mainfrom
feature/cpl-369-h3-user-js_params-headers-logged-at-debug-exported-to-gcp-in
Open

fix(lit-actions): redact js_params/headers/auth_context from logs by default (CPL-369)#616
GTC6244 wants to merge 5 commits into
mainfrom
feature/cpl-369-h3-user-js_params-headers-logged-at-debug-exported-to-gcp-in

Conversation

@GTC6244

@GTC6244 GTC6244 commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Fixes CPL-369 (High). User js_params, request headers, and auth_context were logged at debug and exported to GCP Cloud Logging unless a client opted into a forgeable privacy header — so customer secrets left the TEE by default. This inverts the default: all request-logging sites now redact these fields, gated by a new operator-only LIT_LOG_SENSITIVE_DATA env opt-out that is read once from the process environment and is never client-controllable. DebugExecutionRequest self-redacts, so both gRPC servers (JS runner and gVisor) no longer depend on the forgeable request-id privacy suffix, and the redundant client-header privacy checks were removed. code (truncated), timeouts, and IDs stay visible for debugging; a new unit test asserts secrets never appear in the default log rendering. The existing X-Privacy-Mode full-log-suppression path is left untouched as an optional stronger guarantee.

🤖 Generated with Claude Code

…default (CPL-369)

User js_params, request headers, and auth_context were logged at debug and
exported to GCP Cloud Logging unless a client set a forgeable privacy header —
customer secrets left the TEE by default.

Invert the default: redact these fields in all request-logging sites, gated by
a new operator-only `LIT_LOG_SENSITIVE_DATA` opt-out (read once from the process
env, never client-controllable). DebugExecutionRequest self-redacts, so the
gRPC servers no longer depend on the forgeable request-id privacy suffix.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@GTC6244
GTC6244 requested review from a team and a lite review from Copilot August 5, 2026 16:45

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses CPL-369 by preventing user-supplied sensitive request data from being logged by default in the lit-actions execution path, adding an operator-only env opt-in to re-enable sensitive logging for local debugging, and centralizing redaction in the Debug rendering used at request-log sites.

Changes:

  • Added lit_observability::sensitive_logging_enabled() gated by LIT_LOG_SENSITIVE_DATA, cached once per process.
  • Updated JS runner and gVisor gRPC servers to log DebugExecutionRequest unconditionally (with default redaction) and removed request-id-suffix privacy checks.
  • Implemented self-redacting DebugExecutionRequest and added a unit test asserting default redaction of js_params, auth_context, and http_headers.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
lit-core/lit-observability/src/lib.rs Adds operator-only env-gated sensitive logging toggle (cached).
lit-actions/server/server.rs Switches request logging to rely on DebugExecutionRequest redaction and removes request-id privacy suffix logic.
lit-actions/server/runtime.rs Redacts js_params and headers logging by default, gated by sensitive_logging_enabled().
lit-actions/gvisor-server/src/server.rs Switches request logging to rely on DebugExecutionRequest redaction and removes request-id privacy suffix logic.
lit-actions/grpc/proto.rs Makes DebugExecutionRequest self-redacting by default and adds a unit test for redaction.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread lit-actions/server/server.rs
Comment thread lit-actions/gvisor-server/src/server.rs
Comment thread lit-actions/grpc/proto.rs Outdated
GTC6244 and others added 4 commits August 5, 2026 13:08
…ic test (CPL-369)

Address PR review: restore the explicit privacy-mode branch at both gRPC log
sites so an X-Privacy-Mode request still suppresses non-secret request metadata
(truncated code, ids) — these run before request context is set, so
PrivacyModeLayer cannot filter them. Default redaction of secrets is unchanged.

Also make the redaction unit test deterministic by clearing the opt-in env var
before the cached first read, and correct opt-out -> opt-in wording.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…nned)

smartstring's repo was archived 2026-05-03; the advisory was newly
published and started failing cargo-deny. smartstring 1.0.1 is a
transitive of swc_ecma_lexer <- deno_ast =0.53.2 (lit-actions only),
so it is deno-pinned and not removable in-house. Matches the existing
deno-blocked ignore entries.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants