From 80d1097a75bd884165d56544fa4e748c132dac4d Mon Sep 17 00:00:00 2001 From: Berne Campbell Date: Wed, 9 Dec 2020 15:32:47 +1100 Subject: [PATCH] Make docker.sock hunting optional --- main.go | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/main.go b/main.go index fcadf79..a4df35b 100644 --- a/main.go +++ b/main.go @@ -20,7 +20,8 @@ import ( ) var ( - debug bool + debug bool + docker_sock_hunt bool ) func main() { @@ -36,6 +37,7 @@ func main() { // Setup the global flags. p.FlagSet = flag.NewFlagSet("ship", flag.ExitOnError) p.FlagSet.BoolVar(&debug, "d", false, "enable debug logging") + p.FlagSet.BoolVar(&docker_sock_hunt, "s", false, "enable docker sock hunting") // Set the before function. p.Before = func(ctx context.Context) error { @@ -99,9 +101,11 @@ func main() { seccompIter() - // Docker.sock - fmt.Println("Looking for Docker.sock") - getValidSockets("/") + if docker_sock_hunt { + // Docker.sock + fmt.Println("Looking for Docker.sock") + getValidSockets("/") + } return nil }