Closed Bug 1132202 Opened 10 years ago Closed 8 years ago

docker-worker: Redact accidentally leaked secrets from logs - search for secret substrings, replace with ***

Categories

(Taskcluster :: Workers, defect)

x86_64
Linux
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED INVALID

People

(Reporter: jonasfj, Unassigned)

Details

(Whiteboard: [docker-worker])

When using encrypted environment variables, or if someday we inject temp creds into the task container users could accidentally print these in the terminal. I suggest that docker-worker maintains a list of secret substrings. It then greps live log and logs for these substrings and replaces them with *****. The feature should be enabled by default, but it should be possible to disable with a feature flag. Note, that this helps prevent accidental leaks, it doesn't prevent intentional leaks. Examples of strings to redact: - the variable name and variable value of encrypted environment variables (we know these can just grep the logs for them) - injected temporary credentials, we don't do inject these yet. But simply search replace for the generate clientId and accessToken would be trivial, as would replace the certificate string. Users could accidentally leak these... With a simple `env` command in bash, which is useful for logging env vars in the log. Again, this would only protect against accidental leaks. But if something is in an encrypted env var it's probably not intended to be public).
Component: TaskCluster → Docker-Worker
Product: Testing → Taskcluster
Whiteboard: [docker-worker]
Component: Docker-Worker → Worker
We are telling users not to use encrypted env vars, and we do not inject temporary credentials. Secrets should come from the secrets API, which is not something docker-worker will be aware of. So I don't think there's anything to fix here.
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → INVALID
Component: Worker → Workers
You need to log in before you can comment on or make changes to this bug.