Repository navigation
fix(deployer): stop printing rendered templates to logs - #60
Merged
Merged
Conversation
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.
Problem
The deployer rendered the template with
oc process --localand then:$GITHUB_ENV(TEMPLATE<<EOF). GitHub prints job env vars in theenv:header of every later step, so the full rendered template, including any Secret values, showed up in the log of every following step in the caller's job;debug: true, echoed the full template before and after lite mode.Secret masking does not reliably catch this: the output is JSON, which escapes characters such as
&,<,>and quotes (\u0026etc.), so a masked secret containing them no longer matches and is printed in clear.Fix
Stop showing template contents at all instead of relying on redaction:
chmod 600file under$RUNNER_TEMP; only its path is passed on (step output)oc apply/oc createand the rollout lookup all read that filedebug: truenow listskind/nameonlyumask 077viamktempin$RUNNER_TEMP; a finalif: always()step (runs on success, failure and cancellation) removes it withrm -f, which cannot fail; the lite-mode intermediate is removed by atrap ... EXITin its own step, and lite mode no longer writes.template*.jsoninto the workspaceTEMPLATEenv var is no longer exported to the caller's joboc apply/oc createoutput is unchanged (kind/name only).