mirror of
https://github.com/aquasecurity/trivy.git
synced 2025-12-22 23:26:39 -08:00
feat(kubernetes): Add report flag for summary (#2112)
* feat(k8s): Add report flag for summary * chore: add headings to the severity columns * chore: make the default output of k8s summary table Signed-off-by: Owen Rumney <owen.rumney@aquasec.com>
This commit is contained in:
@@ -12,6 +12,7 @@ import (
|
||||
|
||||
"github.com/aquasecurity/trivy-db/pkg/metadata"
|
||||
dbTypes "github.com/aquasecurity/trivy-db/pkg/types"
|
||||
|
||||
"github.com/aquasecurity/trivy/pkg/commands/artifact"
|
||||
"github.com/aquasecurity/trivy/pkg/commands/option"
|
||||
"github.com/aquasecurity/trivy/pkg/commands/plugin"
|
||||
@@ -215,6 +216,12 @@ var (
|
||||
EnvVars: []string{"TRIVY_K8S_NAMESPACE"},
|
||||
}
|
||||
|
||||
reportFlag = cli.StringFlag{
|
||||
Name: "report",
|
||||
Value: "summary",
|
||||
Usage: "specify a report format for the output. (all,summary default: all)",
|
||||
}
|
||||
|
||||
// TODO: remove this flag after a sufficient deprecation period.
|
||||
lightFlag = cli.BoolFlag{
|
||||
Name: "light",
|
||||
@@ -789,6 +796,7 @@ func NewK8sCommand() *cli.Command {
|
||||
Action: artifact.K8sRun,
|
||||
Flags: []cli.Flag{
|
||||
&namespaceFlag,
|
||||
&reportFlag,
|
||||
&outputFlag,
|
||||
&severityFlag,
|
||||
&exitCodeFlag,
|
||||
|
||||
Reference in New Issue
Block a user