-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Explore entrypoint binary redacting secrets from logs #3373
Comments
Issues go stale after 90d of inactivity. /lifecycle stale Send feedback to tektoncd/plumbing. |
/remove-lifecycle stale This still needs investigation |
@imjasonh I'm not sure where this discussion would belong, but would be nice if Tekton also considers "secret parameters". e.g. so that if I have a task whose output is a token (secret) I can pass to the next step seamlessly without having to create a k8s secret in order to have it |
@renannprado I think "secret params" (or results) would be a separate issue, though it might end up sharing the same redaction code. Results today are very much not secret, and shouldn't be treated as such. Anybody who can view a TaskRun's underlying Pod status can see results data, whether or not they have access to the TaskRun, etc. Redacting from logs could be useful, but we'd need to close that hole too before we recommend people put sensitive data in results. |
@imjasonh do you have interest in developing this feature? it doesn't seem very complicated to develop (I guess it depends on how hard is it to get the metadata to the pipeline inside of this method hehe), maybe I could develop it if some guidance/mentoring is provided. Of course, after developing it, I would love to contribute to a feature like the "secret parameters" too, but that's another story :) |
A small suggestion but it might go a long way in enterprise adoption. Rather than show a static "redacted" message, why not show the key of the secret itself. That way, the users have a way of identifying which secret it is. Secrets can differ across environments. Typically you may have different secrets driven by DBs for specific environment such as Dev, staging prod. Would love to hear more on this! |
Issues go stale after 90d of inactivity. /lifecycle stale Send feedback to tektoncd/plumbing. |
Stale issues rot after 30d of inactivity. /lifecycle rotten Send feedback to tektoncd/plumbing. |
Rotten issues close after 30d of inactivity. /close Send feedback to tektoncd/plumbing. |
@tekton-robot: Closing this issue. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
IMHO redacting secrets is important and has to be implemented. /reopen |
@renannprado: You can't reopen an issue/PR unless you authored it or you are a collaborator. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/remove-lifecycle rotten |
@afrittoli: Reopened this issue. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Stemmed from #3365 though there have been other cases it's come up.
Today, if the user specifies a
script:
without shebang, we assume#!/bin/bash
andset -euxo pipefail
-- we consider this a reasonable default script preamble, butset -x
especially can surprise some users that might be using secrets in their script, and don't expect those to be emitted to output logs. One solution (as described in #3365) is to set your own preamble or to otherwise disable-x
so commands aren't logged.But we might be able to do better. The entrypoint binary we inject to run the user's command (including
script
s), today passes the sub-command's stdout directly to its own stdout (same with stderr). It could consider doing something smarter in this case, and take a set of byte sequences to redact from stdout/stderr, which could be passed as secret references into the Pod.The entrypoint binary could then place this filter around stdout and stderr to replace detected secrets with some descriptive placeholder like
[REDACTED]
, instead of passing through potentially sensitive valeus to logs.Considerations:
/kind feature
The text was updated successfully, but these errors were encountered: