mirror of
https://github.com/aquasecurity/trivy.git
synced 2025-12-23 07:29:00 -08:00
feat(k8s): scan secrets (#2178)
This commit is contained in:
@@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
This feature might change without preserving backwards compatibility.
|
This feature might change without preserving backwards compatibility.
|
||||||
|
|
||||||
Scan your Kubernetes cluster for both Vulnerabilities and Misconfigurations.
|
Scan your Kubernetes cluster for both Vulnerabilities, Secrets and Misconfigurations.
|
||||||
|
|
||||||
Trivy uses your local kubectl configuration to access the API server to list artifacts.
|
Trivy uses your local kubectl configuration to access the API server to list artifacts.
|
||||||
|
|
||||||
@@ -24,6 +24,14 @@ Filter by severity:
|
|||||||
$ trivy k8s --severity=CRITICAL --report=all
|
$ trivy k8s --severity=CRITICAL --report=all
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Filter by security check (Vulnerabilties, Secrets or Misconfigurations):
|
||||||
|
|
||||||
|
```
|
||||||
|
$ trivy k8s --security-checks=secret --report=summary
|
||||||
|
# or
|
||||||
|
$ trivy k8s --security-checks=config --report=summary
|
||||||
|
```
|
||||||
|
|
||||||
Scan a specific namespace:
|
Scan a specific namespace:
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -806,13 +806,17 @@ func NewPluginCommand() *cli.Command {
|
|||||||
func NewK8sCommand() *cli.Command {
|
func NewK8sCommand() *cli.Command {
|
||||||
k8sSecurityChecksFlag := withValue(
|
k8sSecurityChecksFlag := withValue(
|
||||||
securityChecksFlag,
|
securityChecksFlag,
|
||||||
fmt.Sprintf("%s,%s", types.SecurityCheckVulnerability, types.SecurityCheckConfig),
|
fmt.Sprintf(
|
||||||
|
"%s,%s,%s",
|
||||||
|
types.SecurityCheckVulnerability,
|
||||||
|
types.SecurityCheckConfig,
|
||||||
|
types.SecurityCheckSecret),
|
||||||
)
|
)
|
||||||
|
|
||||||
return &cli.Command{
|
return &cli.Command{
|
||||||
Name: "kubernetes",
|
Name: "kubernetes",
|
||||||
Aliases: []string{"k8s"},
|
Aliases: []string{"k8s"},
|
||||||
Usage: "scan kubernetes vulnerabilities and misconfigurations",
|
Usage: "scan kubernetes vulnerabilities, secrets and misconfigurations",
|
||||||
CustomHelpTemplate: cli.CommandHelpTemplate + `EXAMPLES:
|
CustomHelpTemplate: cli.CommandHelpTemplate + `EXAMPLES:
|
||||||
- cluster scanning:
|
- cluster scanning:
|
||||||
$ trivy k8s --report summary
|
$ trivy k8s --report summary
|
||||||
|
|||||||
Reference in New Issue
Block a user