diff --git a/commands/dig.go b/commands/dig.go index ec70a50..b86d9b6 100644 --- a/commands/dig.go +++ b/commands/dig.go @@ -70,7 +70,7 @@ arguments.`, return nil }, - RunE: func(cmd *cobra.Command, args []string) error { + RunE: func(_ *cobra.Command, args []string) error { // handles the "all" or "a" and erase the args with the bucket list // PreRun should guarantee that len(args) != 0 but in case if len(args) != 0 { diff --git a/commands/gen.go b/commands/gen.go index 96cc775..8ae90f6 100644 --- a/commands/gen.go +++ b/commands/gen.go @@ -40,7 +40,7 @@ boolean flags to disabled security features. Examples: # Fuzz the API server admission kdigger gen --fuzz-pod --fuzz-init --fuzz-container | kubectl apply --dry-run=server -f -`, - RunE: func(cmd *cobra.Command, args []string) error { + RunE: func(_ *cobra.Command, args []string) error { // all puts all the boolean flags to true if genAll { opts.HostNetwork = true diff --git a/commands/list.go b/commands/list.go index 785b241..92bc512 100644 --- a/commands/list.go +++ b/commands/list.go @@ -12,7 +12,7 @@ var listCmd = &cobra.Command{ Short: "List available buckets or describe specific ones", Long: `This command lists the available buckets in the binary. It show their names, aliases and descriptions. You can pass specific buckets as arguments to have their information.`, - RunE: func(cmd *cobra.Command, args []string) error { + RunE: func(_ *cobra.Command, args []string) error { var bucketList []string if len(args) == 0 { diff --git a/commands/root.go b/commands/root.go index 483db7e..a07c524 100644 --- a/commands/root.go +++ b/commands/root.go @@ -48,7 +48,7 @@ var rootCmd = &cobra.Command{ cluster. For that you can use multiples buckets. Buckets are plugins that can scan specific aspects of a cluster or bring expertise to automate the Kubernetes pentest process.`, - PersistentPreRunE: func(cmd *cobra.Command, args []string) error { + PersistentPreRunE: func(_ *cobra.Command, _ []string) error { if output != outputHuman && output != outputJSON { return fmt.Errorf("output flag must be one of %s|%s, got %q", outputHuman, outputJSON, output) } diff --git a/commands/version.go b/commands/version.go index f1006f6..baf713b 100644 --- a/commands/version.go +++ b/commands/version.go @@ -22,7 +22,7 @@ var versionCmd = &cobra.Command{ Aliases: []string{"v"}, Short: "Print the version information", Long: `Print the version tag and git commit hash.`, - RunE: func(cmd *cobra.Command, args []string) error { + RunE: func(_ *cobra.Command, _ []string) error { // leveraging bucket results to print even if it's not a plugin res := bucket.NewResults("Version") res.SetHeaders([]string{"tag", "gitCommit", "goVersion", "builderArch"}) diff --git a/pkg/kgen/kgen.go b/pkg/kgen/kgen.go index b0e156e..44295fa 100644 --- a/pkg/kgen/kgen.go +++ b/pkg/kgen/kgen.go @@ -84,7 +84,7 @@ func FuzzPodSecurityContext(sc **v1.PodSecurityContext) { } }, // let's ignore Windows for now - func(e *v1.WindowsSecurityContextOptions, c fuzz.Continue) { + func(e *v1.WindowsSecurityContextOptions, _ fuzz.Continue) { *e = v1.WindowsSecurityContextOptions{} }, // for supplementalGroups, runAsUser and runAsGroup value that must be between 0 and 2147483647, inclusive @@ -103,7 +103,7 @@ func FuzzPodSecurityContext(sc **v1.PodSecurityContext) { func FuzzContainerSecurityContext(sc **v1.SecurityContext) { // add .NilChange(0) to disable nil pointers generation, by default is 0.2 f := fuzz.New().NilChance(fuzzNilChances).Funcs( - func(e *v1.WindowsSecurityContextOptions, c fuzz.Continue) { + func(e *v1.WindowsSecurityContextOptions, _ fuzz.Continue) { *e = v1.WindowsSecurityContextOptions{} }, func(e *v1.Capability, c fuzz.Continue) { @@ -119,9 +119,9 @@ func FuzzContainerSecurityContext(sc **v1.SecurityContext) { } else { length := c.Intn(fuzzCapabilityRandomMaxLen) for i := 0; i < length; i++ { - var cap v1.Capability - c.Fuzz(&cap) - *e = append(*e, cap) + var capa v1.Capability + c.Fuzz(&capa) + *e = append(*e, capa) } } }, diff --git a/pkg/plugins/cgroups/cgroups.go b/pkg/plugins/cgroups/cgroups.go index d77a328..2eb9744 100644 --- a/pkg/plugins/cgroups/cgroups.go +++ b/pkg/plugins/cgroups/cgroups.go @@ -56,7 +56,7 @@ func Register(b *bucket.Buckets) { }) } -func NewCgroupsBucket(config bucket.Config) (*Bucket, error) { +func NewCgroupsBucket(_ bucket.Config) (*Bucket, error) { return &Bucket{}, nil } diff --git a/pkg/plugins/cloudmetadata/cloudmetadata.go b/pkg/plugins/cloudmetadata/cloudmetadata.go index 1c243d6..11614f3 100644 --- a/pkg/plugins/cloudmetadata/cloudmetadata.go +++ b/pkg/plugins/cloudmetadata/cloudmetadata.go @@ -143,6 +143,6 @@ func Register(b *bucket.Buckets) { }) } -func NewCloudMetadataBucket(config bucket.Config) (*Bucket, error) { +func NewCloudMetadataBucket(_ bucket.Config) (*Bucket, error) { return &Bucket{}, nil } diff --git a/pkg/plugins/containerdetect/containerdetect.go b/pkg/plugins/containerdetect/containerdetect.go index 3b1971c..cba8156 100644 --- a/pkg/plugins/containerdetect/containerdetect.go +++ b/pkg/plugins/containerdetect/containerdetect.go @@ -129,6 +129,6 @@ func Register(b *bucket.Buckets) { }) } -func NewContainerDetectBucket(config bucket.Config) (*Bucket, error) { +func NewContainerDetectBucket(_ bucket.Config) (*Bucket, error) { return &Bucket{}, nil } diff --git a/pkg/plugins/devices/devices.go b/pkg/plugins/devices/devices.go index fe332bf..6bc8b6f 100644 --- a/pkg/plugins/devices/devices.go +++ b/pkg/plugins/devices/devices.go @@ -51,7 +51,7 @@ func Register(b *bucket.Buckets) { }) } -func NewDevicesBucket(config bucket.Config) (*Bucket, error) { +func NewDevicesBucket(_ bucket.Config) (*Bucket, error) { return &Bucket{}, nil } diff --git a/pkg/plugins/environment/environment.go b/pkg/plugins/environment/environment.go index fb3af6a..26bc910 100644 --- a/pkg/plugins/environment/environment.go +++ b/pkg/plugins/environment/environment.go @@ -46,7 +46,7 @@ func Register(b *bucket.Buckets) { }) } -func NewEnvironmentBucket(config bucket.Config) (*Bucket, error) { +func NewEnvironmentBucket(_ bucket.Config) (*Bucket, error) { return &Bucket{}, nil } diff --git a/pkg/plugins/mount/mount.go b/pkg/plugins/mount/mount.go index c1b33a2..73fd4a6 100644 --- a/pkg/plugins/mount/mount.go +++ b/pkg/plugins/mount/mount.go @@ -48,7 +48,7 @@ func Register(b *bucket.Buckets) { }) } -func NewMountBucket(config bucket.Config) (*Bucket, error) { +func NewMountBucket(_ bucket.Config) (*Bucket, error) { return &Bucket{}, nil } diff --git a/pkg/plugins/node/node.go b/pkg/plugins/node/node.go index ba240dc..dea471f 100644 --- a/pkg/plugins/node/node.go +++ b/pkg/plugins/node/node.go @@ -63,7 +63,7 @@ func Register(b *bucket.Buckets) { }) } -func NewNodeBucket(config bucket.Config) (*Bucket, error) { +func NewNodeBucket(_ bucket.Config) (*Bucket, error) { return &Bucket{}, nil } diff --git a/pkg/plugins/pidnamespace/pidnamespace.go b/pkg/plugins/pidnamespace/pidnamespace.go index 222486c..53985e7 100644 --- a/pkg/plugins/pidnamespace/pidnamespace.go +++ b/pkg/plugins/pidnamespace/pidnamespace.go @@ -49,7 +49,7 @@ func Register(b *bucket.Buckets) { }) } -func NewPIDNamespaceBucket(config bucket.Config) (*Bucket, error) { +func NewPIDNamespaceBucket(_ bucket.Config) (*Bucket, error) { return &Bucket{}, nil } diff --git a/pkg/plugins/processes/processes.go b/pkg/plugins/processes/processes.go index c979097..f45944c 100644 --- a/pkg/plugins/processes/processes.go +++ b/pkg/plugins/processes/processes.go @@ -56,6 +56,6 @@ func Register(b *bucket.Buckets) { }) } -func NewProcessesBucket(config bucket.Config) (*Bucket, error) { +func NewProcessesBucket(_ bucket.Config) (*Bucket, error) { return &Bucket{}, nil } diff --git a/pkg/plugins/runtime/runtime.go b/pkg/plugins/runtime/runtime.go index 49f069b..494bc29 100644 --- a/pkg/plugins/runtime/runtime.go +++ b/pkg/plugins/runtime/runtime.go @@ -26,6 +26,6 @@ func Register(b *bucket.Buckets) { }) } -func NewRuntimeBucket(config bucket.Config) (*Bucket, error) { +func NewRuntimeBucket(_ bucket.Config) (*Bucket, error) { return &Bucket{}, nil } diff --git a/pkg/plugins/services/services.go b/pkg/plugins/services/services.go index d2af06d..77bd142 100644 --- a/pkg/plugins/services/services.go +++ b/pkg/plugins/services/services.go @@ -42,6 +42,6 @@ func Register(b *bucket.Buckets) { }) } -func NewServicesBucket(config bucket.Config) (*Bucket, error) { +func NewServicesBucket(_ bucket.Config) (*Bucket, error) { return &Bucket{}, nil } diff --git a/pkg/plugins/syscalls/syscalls.go b/pkg/plugins/syscalls/syscalls.go index 3934289..64c2299 100644 --- a/pkg/plugins/syscalls/syscalls.go +++ b/pkg/plugins/syscalls/syscalls.go @@ -26,6 +26,6 @@ func Register(b *bucket.Buckets) { }) } -func NewSyscallsBucket(config bucket.Config) (*Bucket, error) { +func NewSyscallsBucket(_ bucket.Config) (*Bucket, error) { return &Bucket{}, nil } diff --git a/pkg/plugins/template/template.go b/pkg/plugins/template/template.go index 73517b5..4a132dc 100644 --- a/pkg/plugins/template/template.go +++ b/pkg/plugins/template/template.go @@ -33,6 +33,6 @@ func Register(b *bucket.Buckets) { }) } -func NewTemplateBucket(config bucket.Config) (*Bucket, error) { +func NewTemplateBucket(_ bucket.Config) (*Bucket, error) { return &Bucket{}, nil } diff --git a/pkg/plugins/token/token.go b/pkg/plugins/token/token.go index 065af42..5786627 100644 --- a/pkg/plugins/token/token.go +++ b/pkg/plugins/token/token.go @@ -57,7 +57,7 @@ func Register(b *bucket.Buckets) { }) } -func NewTokenBucket(c bucket.Config) (*Bucket, error) { +func NewTokenBucket(_ bucket.Config) (*Bucket, error) { return &Bucket{}, nil } diff --git a/pkg/plugins/userid/userid.go b/pkg/plugins/userid/userid.go index 78ca99e..8307bbc 100644 --- a/pkg/plugins/userid/userid.go +++ b/pkg/plugins/userid/userid.go @@ -54,6 +54,6 @@ func Register(b *bucket.Buckets) { }) } -func NewUserIDBucket(config bucket.Config) (*Bucket, error) { +func NewUserIDBucket(_ bucket.Config) (*Bucket, error) { return &Bucket{}, nil } diff --git a/pkg/plugins/usernamespace/usernamespace.go b/pkg/plugins/usernamespace/usernamespace.go index a062f3d..25d3278 100644 --- a/pkg/plugins/usernamespace/usernamespace.go +++ b/pkg/plugins/usernamespace/usernamespace.go @@ -26,6 +26,6 @@ func Register(b *bucket.Buckets) { }) } -func NewUserNamespaceBucket(config bucket.Config) (*Bucket, error) { +func NewUserNamespaceBucket(_ bucket.Config) (*Bucket, error) { return &Bucket{}, nil }