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

Allow running porter without hiding sensitive values #1708

Open
carolynvs opened this issue Aug 10, 2021 · 3 comments · May be fixed by #1729
Open

Allow running porter without hiding sensitive values #1708

carolynvs opened this issue Aug 10, 2021 · 3 comments · May be fixed by #1729
Assignees
Labels
2 - 🍕 Pizza should be eaten daily enhancement New code incoming! hold Waiting for something else before moving forward user experience 🌈💖 Make it easier for everyone to use Porter

Comments

@carolynvs
Copy link
Member

I suggest adding a config setting that disables hiding sensitive values in porter's output. It is hard as hell to debug when you can't search for key values that you are looking for because they are ***'d out. This would be a v1 change, but could be released after v1.

I originally wanted to put this behind the --debug flag but we have #1429 which would remove that flag entirely anyway. Plus this will be more explicit.

@carolynvs carolynvs added enhancement New code incoming! user experience 🌈💖 Make it easier for everyone to use Porter 2 - 🍕 Pizza should be eaten daily labels Aug 10, 2021
@carolynvs carolynvs added this to Inbox in Porter and Mixins via automation Aug 10, 2021
@carolynvs
Copy link
Member Author

This change should be made against the release/v1 branch.

What we can do is add a global flag (configure it just like debug) to the root command created in cmd/porter/main.go, called --show-sensitive. When this flag is set (defaults to false), we should not set any sensitive values on the censored writer. Instead we can just write directly to the underlying writer.

func (c *Context) SetSensitiveValues(vals []string) {
if len(vals) > 0 {
out := NewCensoredWriter(c.Out)
out.SetSensitiveValues(vals)
c.Out = out
err := NewCensoredWriter(c.Err)
err.SetSensitiveValues(vals)
c.Err = err
}
}

I think that we should also change the New function for Context to set Out and Err directly to os.Stdout and os.Stderr since the SetSensitiveValues function already takes care of creating and configuring a CensoredWriter.

We can test this with a unit test in context_test.go.

@carolynvs carolynvs added the help wanted Good for someone who has contributed before label Aug 20, 2021
@ThorstenHans
Copy link
Contributor

I'll take this one.

@ThorstenHans ThorstenHans linked a pull request Aug 21, 2021 that will close this issue
3 tasks
@carolynvs carolynvs removed the help wanted Good for someone who has contributed before label May 20, 2022
@carolynvs carolynvs added the hold Waiting for something else before moving forward label Sep 29, 2022
@carolynvs
Copy link
Member Author

Putting this on hold since we are redoing how we hide sensitive values now that we are going through TraceLogger. See #sensitive

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2 - 🍕 Pizza should be eaten daily enhancement New code incoming! hold Waiting for something else before moving forward user experience 🌈💖 Make it easier for everyone to use Porter
Projects
Development

Successfully merging a pull request may close this issue.

2 participants