Skip to content

Redact secrets from all log messages #1354

@aluzzardi

Description

@aluzzardi

Currently, dagger redacts secrets while forwarding buildkit events to the logger.

It works great to strip away secrets leaked by the CUE layer (e.g. #Exec & { command: "echo secret: $(cat /secret)" } shows up as secret: ***), however it doesn't strip away secrets leaked by Dagger itself in Go.

It's currently implemented in Client.logSolveStatus() (the goroutine that bridges buildkit events to the logger), which uses an internal secureSprintf function to strip away secrets.

An alternative would be to move this logic into a zerolog hook if possible: https://github.com/rs/zerolog#hooks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions