Skip to content

Commit

Permalink
chore(kube-hunter): Bump up kube-hunter from v0.4.1 to v0.6.1 (#691)
Browse files Browse the repository at this point in the history
Resolves: #631

Signed-off-by: Daniel Pacak <pacak.daniel@gmail.com>
  • Loading branch information
danielpacak committed Aug 30, 2021
1 parent 90c1391 commit 7b1c896
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 13 deletions.
2 changes: 1 addition & 1 deletion docs/settings.md
Expand Up @@ -56,7 +56,7 @@ configuration settings for common use cases. For example, switch Trivy from
| `scanJob.tolerations` | N/A | JSON representation of the [tolerations] to be applied to the scanner pods so that they can run on nodes with matching taints. Example: `'[{"key":"key1", "operator":"Equal", "value":"value1", "effect":"NoSchedule"}]'` |
| `scanJob.annotations` | N/A | One-line comma-separated representation of the annotations which the user wants the scanner pods to be annotated with. Example: `foo=bar,env=stage` will annotate the scanner pods with the annotations `foo: bar` and `env: stage` |
| `kube-bench.imageRef` | `docker.io/aquasec/kube-bench:0.6.3` | kube-bench image reference |
| `kube-hunter.imageRef` | `docker.io/aquasec/kube-hunter:0.4.1` | kube-hunter image reference |
| `kube-hunter.imageRef` | `docker.io/aquasec/kube-hunter:0.6.1` | kube-hunter image reference |
| `kube-hunter.quick` | `"false"` | Whether to use kube-hunter's "quick" scanning mode (subnet 24). Set to `"true"` to enable. |

!!! tip
Expand Down
19 changes: 8 additions & 11 deletions pkg/kubehunter/scanner.go
Expand Up @@ -5,7 +5,6 @@ import (
"fmt"

"github.com/aquasecurity/starboard/pkg/apis/aquasecurity/v1alpha1"
"github.com/aquasecurity/starboard/pkg/ext"
"github.com/aquasecurity/starboard/pkg/kube"
"github.com/aquasecurity/starboard/pkg/runner"
"github.com/aquasecurity/starboard/pkg/starboard"
Expand All @@ -30,9 +29,8 @@ type Config interface {
}

type Scanner struct {
scheme *runtime.Scheme
clientset kubernetes.Interface
ext.IDGenerator
scheme *runtime.Scheme
clientset kubernetes.Interface
opts kube.ScannerOpts
logsReader kube.LogsReader
config starboard.ConfigData
Expand All @@ -45,12 +43,11 @@ func NewScanner(
opts kube.ScannerOpts,
) *Scanner {
return &Scanner{
scheme: scheme,
clientset: clientset,
IDGenerator: ext.NewGoogleUUIDGenerator(),
logsReader: kube.NewLogsReader(clientset),
config: config,
opts: opts,
scheme: scheme,
clientset: clientset,
logsReader: kube.NewLogsReader(clientset),
config: config,
opts: opts,
}
}

Expand Down Expand Up @@ -149,7 +146,7 @@ func (s *Scanner) prepareKubeHunterJob() (*batchv1.Job, error) {

return &batchv1.Job{
ObjectMeta: metav1.ObjectMeta{
Name: s.GenerateID(),
Name: fmt.Sprintf("scan-kubehunterreports-%s", kube.ComputeHash("cluster")),
Namespace: starboard.NamespaceName,
},
Spec: batchv1.JobSpec{
Expand Down
2 changes: 1 addition & 1 deletion pkg/starboard/config.go
Expand Up @@ -77,7 +77,7 @@ func GetDefaultConfig() ConfigData {
keyConfigAuditReportsScanner: string(Polaris),

"kube-bench.imageRef": "docker.io/aquasec/kube-bench:0.6.3",
"kube-hunter.imageRef": "docker.io/aquasec/kube-hunter:0.4.1",
"kube-hunter.imageRef": "docker.io/aquasec/kube-hunter:0.6.1",
"kube-hunter.quick": "false",
}
}
Expand Down

0 comments on commit 7b1c896

Please sign in to comment.