Release 8.9.0 (and the 10.0.0 prerelase/master) has a semi broken attempt to removed client envs of the build event stream

Open
#33,047 2 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 2 days

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
42/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
java
Domain
build-system

Research direction

Start by reading PR #32039 and commit 56c4403, which introduced client environment redaction in the build event stream. Trace how environment variables are represented in that stream and how command lines are included; the issue identifies those as the two gaps. Done means secrets are not exposed through unstructured command lines and users have a way to whitelist environment variables for remote consumers.

Written by the indexing model from the issue text.

Description

potential release blocker team-Core type: bug untriaged
Description of the bug:

In https://github.com/bazelbuild/bazel/pull/32039 merged into 8.9.0 which follows the commit https://github.com/bazelbuild/bazel/commit/56c4403bbb1e0110ee118b3184d6a5475a1a3493 (on master) client environment variables are redacted from the build event stream.

This is an attempt to remove accidental secret leakage, as environment variables may often contain secrets which are sent to a remote host. This is in and of itself a good feature.

However,

  1. This implementation is incomplete, the environment variables and their content are still sent as unstructured command line.
  2. The implementation leaves no avenue to whitelist environment variables which the client wants to send to the remote server.

In a CI system (for example github), the environment variables contain many relevant pieces of information which describes the current run. Such as which pr the run belongs to etc. This allows consumers to tie many bazel invocations back to a pr and/or group invocations by any other environment property. While this could instead be implemented with build_metadata this would require every clients to generate a .bazelrc with relevant options as environment variables are not possible to use in bazelrc files.

While I think the change is good I think we need to fix these issues before adding it.

Which category does this issue belong to?

No response

What's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.

No response

Which operating system are you running Bazel on?

No response

What is the output of bazel info release?

No response

If bazel info release returns development version or (@non-git), tell us how you built Bazel.

No response

What's the output of git remote get-url origin; git rev-parse HEAD ?

If this is a regression, please try to identify the Bazel commit where the bug was introduced with bazelisk --bisect.

No response

Have you found anything relevant by searching the web?

No response

Any other information, logs, or outputs that you want to share?

No response

Dominant language
Java
Stars
26.2k
Forks
4.7k
Avg merge
3d 11h
Merged PRs (30d)
125

Getting set up

Open in Codespaces

Starts the project's dev container in your browser, under your own GitHub account.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from bazelbuild/bazel

All issues in bazelbuild/bazel

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.