Repository navigation
Conversation
Ansible output of install_package and other steps can contain build repository URLs with the build system token, e.g. in package manager errors, and the runner logs it through the task logger. Its records propagate to the root logger of the Celery worker, whose handlers don't use RedactingFormatter, so the token ended up in the worker log. Mask the records with a logger filter instead, which runs before any handler, including the ones of parent loggers.
Contributor
Author
|
Superseded by #249. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #247.
Ansible output of
install_packageand the other playbook steps can contain build repository URLs with the build system token, e.g. in dnf/apk errors. That output is already masked in the uploaded artifacts, but the runner also logs it through the task logger (Cannot install package %s: %s,Repositories: %s,Modified repo url: %s). Those records propagate to the Celery worker's root logger, whose handlers don't useRedactingFormatter, so the token ended up in the worker log.Changes
alts/shared/utils/log_utils.py: addRedactingFilter, which masks the record message, exception text and stack info in place.alts/worker/runners/base.py: attach it to the test task logger. Logger filters run before any handler, including parent loggers' handlers.Testing
tests/shared/test_log_utils.py: new test logs through a child logger into a parent handler with a plain formatter (like the Celery worker log), including an exception; 12 passed.stdout_callback = yaml) of dnf/apt/apk errors with credential URLs is still masked byredact_secretsin plain, single- and double-quoted styles.The same gap exists on master.
🤖 Generated with Claude Code