-
Notifications
You must be signed in to change notification settings - Fork 197
/
find_vulnerabilities.go
51 lines (38 loc) · 1.4 KB
/
find_vulnerabilities.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
package cmd
import (
"fmt"
"github.com/spf13/cobra"
"k8s.io/cli-runtime/pkg/genericclioptions"
)
// Deprecated
// Use NewScanVulnerabilityReportsCmd instead.
func NewFindVulnerabilitiesCmd(executable string, cf *genericclioptions.ConfigFlags) *cobra.Command {
cmd := &cobra.Command{
Aliases: []string{"vulns", "vuln"},
Use: "vulnerabilities (NAME | TYPE/NAME)",
Deprecated: "please use 'scan vulnerabilityreports' instead",
Short: vulnerabilitiesCmdShort,
Long: vulnerabilitiesCmdLong,
Example: fmt.Sprintf(` # Scan a pod with the specified name
%[1]s find vulnerabilities nginx
# Scan a pod with the specified name in the specified namespace
%[1]s find vulns po/nginx -n staging
# Scan a replicaset with the specified name
%[1]s find vuln replicaset/nginx
# Scan a replicationcontroller with the given name
%[1]s find vulns rc/nginx
# Scan a deployment with the specified name
%[1]s find vulns deployments.apps/nginx
# Scan a daemonset with the specified name
%[1]s find vulns daemonsets/nginx
# Scan a statefulset with the specified name
%[1]s vulns sts/redis
# Scan a job with the specified name
%[1]s find vulns job/my-job
# Scan a cronjob with the specified name and the specified scan job timeout
%[1]s find vulns cj/my-cronjob --scan-job-timeout 2m`, executable),
RunE: ScanVulnerabilityReports(cf),
}
registerScannerOpts(cmd)
return cmd
}