Skip to content
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

Redact sensitive values on config logging #409

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ezdac
Copy link
Collaborator

@ezdac ezdac commented Sep 18, 2023

This introduces another shconfig tag sensitive.
When using the LogConfig function, all values tagged with sensitive will be redacted upon logging and a (sensitive) value will be shown instead.
The tree-traversal based dict-parsing function might not be the most efficient, but logging of the config values is expected to be done infrequently / once only.

}
}

// GetSensitiveRecursive will return all sensitive config paths.
func GetSensitiveRecursive(root Config) map[string]any {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We use struct{} as the value type for maps used like sets. I think we should also do this here as it makes the code a bit clearer. In case I'm wrong and we need the value, I don't understand why this isn't a bool.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants