-
Notifications
You must be signed in to change notification settings - Fork 714
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
Add options to hide args and env vars #2306
Conversation
To allow for use of weave-scope in an unauthenticated environment, add options to the probe to hide comand line arguments and environment variables, which might contain secret data. Fixes #2222
Thanks a lot for this! I will try to review it before of the day (Judging from a preliminary, quick look it seems to be good. You even included tests!). |
probe/docker/registry.go
Outdated
@@ -94,7 +96,7 @@ func newDockerClient(endpoint string) (Client, error) { | |||
} | |||
|
|||
// NewRegistry returns a usable Registry. Don't forget to Stop it. | |||
func NewRegistry(interval time.Duration, pipes controls.PipeClient, collectStats bool, hostID string, handlerRegistry *controls.HandlerRegistry, dockerEndpoint string) (Registry, error) { | |||
func NewRegistry(interval time.Duration, pipes controls.PipeClient, collectStats bool, hostID string, handlerRegistry *controls.HandlerRegistry, dockerEndpoint string, noCommandLineArguments bool, noEnvironmentVariables bool) (Registry, error) { |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
LGTM (modulo minor comment) |
probe/docker/controls_test.go
Outdated
registry, _ := docker.NewRegistry(10*time.Second, nil, false, "", hr, "") | ||
registry, _ := docker.NewRegistry(docker.RegistryOptions{ | ||
Interval: 10 * time.Second, | ||
Pipes: nil, |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
probe/docker/registry_test.go
Outdated
registry, _ := docker.NewRegistry(10*time.Second, nil, true, "", hr, "") | ||
registry, _ := docker.NewRegistry(docker.RegistryOptions{ | ||
Interval: 10 * time.Second, | ||
Pipes: nil, |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
prog/probe.go
Outdated
@@ -195,7 +195,16 @@ func probeMain(flags probeFlags, targets []appclient.Target) { | |||
log.Errorf("Docker: problem with bridge %s: %v", flags.dockerBridge, err) | |||
} | |||
} | |||
if registry, err := docker.NewRegistry(flags.dockerInterval, clients, true, hostID, handlerRegistry, dockerEndpoint); err == nil { | |||
if registry, err := docker.NewRegistry(docker.RegistryOptions{ |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
Revert "Add options to hide args and env vars (#2306)"
This has been reverted on master by #2310 because it fails the lint check. |
Thanks. I'll remember to run those manually next time, sorry about that |
To allow for use of weave-scope in an unauthenticated environment,
add options to the probe to hide comand line arguments and
environment variables, which might contain secret data.
Fixes #2222