diff --git a/cmd/fix/fix.go b/cmd/fix/fix.go index 0c91dbac0a..32a842279d 100644 --- a/cmd/fix/fix.go +++ b/cmd/fix/fix.go @@ -27,7 +27,7 @@ func GetFixCmd(ks meta.IKubescape) *cobra.Command { fixCmd := &cobra.Command{ Use: "fix ", - Short: "Fix misconfiguration in files", + Short: "Propose a fix for the misconfiguration found when scanning Kubernetes manifest files", Long: ``, Example: fixCmdExamples, RunE: func(cmd *cobra.Command, args []string) error { diff --git a/cmd/root.go b/cmd/root.go index 877c9f62ae..47f5519466 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -8,12 +8,10 @@ import ( "github.com/kubescape/go-logger/helpers" "github.com/kubescape/kubescape/v2/cmd/completion" "github.com/kubescape/kubescape/v2/cmd/config" - "github.com/kubescape/kubescape/v2/cmd/delete" "github.com/kubescape/kubescape/v2/cmd/download" "github.com/kubescape/kubescape/v2/cmd/fix" "github.com/kubescape/kubescape/v2/cmd/list" "github.com/kubescape/kubescape/v2/cmd/scan" - "github.com/kubescape/kubescape/v2/cmd/submit" "github.com/kubescape/kubescape/v2/cmd/update" "github.com/kubescape/kubescape/v2/cmd/version" "github.com/kubescape/kubescape/v2/core/cautils" @@ -27,11 +25,11 @@ import ( var rootInfo cautils.RootInfo var ksExamples = fmt.Sprintf(` - # Scan command + # Scan a Kubernetes cluster or YAML files for image vulnerabilities and misconfigurations %[1]s scan - # List supported frameworks - %[1]s list frameworks + # List supported controls + %[1]s list controls # Download artifacts (air-gapped environment support) %[1]s download artifacts @@ -74,22 +72,22 @@ func getRootCmd(ks meta.IKubescape) *cobra.Command { rootCmd.PersistentFlags().StringVarP(&rootInfo.Logger, "logger", "l", helpers.InfoLevel.String(), fmt.Sprintf("Logger level. Supported: %s [$KS_LOGGER]", strings.Join(helpers.SupportedLevels(), "/"))) rootCmd.PersistentFlags().StringVar(&rootInfo.CacheDir, "cache-dir", getter.DefaultLocalStore, "Cache directory [$KS_CACHE_DIR]") - rootCmd.PersistentFlags().BoolVarP(&rootInfo.DisableColor, "disable-color", "", false, "Disable Color output for logging") - rootCmd.PersistentFlags().BoolVarP(&rootInfo.EnableColor, "enable-color", "", false, "Force enable Color output for logging") + rootCmd.PersistentFlags().BoolVarP(&rootInfo.DisableColor, "disable-color", "", false, "Disable color output for logging") + rootCmd.PersistentFlags().BoolVarP(&rootInfo.EnableColor, "enable-color", "", false, "Force enable color output for logging") cobra.OnInitialize(initLogger, initLoggerLevel, initEnvironment, initCacheDir) // Supported commands rootCmd.AddCommand(scan.GetScanCommand(ks)) rootCmd.AddCommand(download.GetDownloadCmd(ks)) - rootCmd.AddCommand(delete.GetDeleteCmd(ks)) rootCmd.AddCommand(list.GetListCmd(ks)) - rootCmd.AddCommand(submit.GetSubmitCmd(ks)) rootCmd.AddCommand(completion.GetCompletionCmd()) rootCmd.AddCommand(version.GetVersionCmd()) rootCmd.AddCommand(config.GetConfigCmd(ks)) rootCmd.AddCommand(update.GetUpdateCmd()) rootCmd.AddCommand(fix.GetFixCmd(ks)) + // rootCmd.AddCommand(submit.GetSubmitCmd(ks))// the submit command should be supported after we add a third-party authentication in Kubescape + // rootCmd.AddCommand(delete.GetDeleteCmd(ks)) // the delete command should be supported after we add a third-party authentication in Kubescape return rootCmd } diff --git a/cmd/scan/scan.go b/cmd/scan/scan.go index 8157f64568..19034e3908 100644 --- a/cmd/scan/scan.go +++ b/cmd/scan/scan.go @@ -17,14 +17,14 @@ import ( var scanCmdExamples = fmt.Sprintf(` Scan command is for scanning an existing cluster or kubernetes manifest files based on pre-defined frameworks - # Scan current cluster with all frameworks + # Scan current cluster %[1]s scan - # Scan kubernetes YAML manifest files + # Scan kubernetes manifest files %[1]s scan . # Scan and save the results in the JSON format - %[1]s scan --format json --output results.json --format-version=v2 + %[1]s scan --format json --output results.json # Display all resources %[1]s scan --verbose @@ -39,7 +39,7 @@ func GetScanCommand(ks meta.IKubescape) *cobra.Command { // scanCmd represents the scan command scanCmd := &cobra.Command{ Use: "scan", - Short: "Scan the current running cluster or yaml files", + Short: "Scan a Kubernetes cluster or YAML files for image vulnerabilities and misconfigurations", Long: `The action you want to perform`, Example: scanCmdExamples, Args: func(cmd *cobra.Command, args []string) error { diff --git a/cmd/update/update.go b/cmd/update/update.go index fe373a0daf..48b617377a 100644 --- a/cmd/update/update.go +++ b/cmd/update/update.go @@ -8,6 +8,7 @@ import ( "fmt" logger "github.com/kubescape/go-logger" + "github.com/kubescape/go-logger/helpers" "github.com/kubescape/kubescape/v2/core/cautils" "github.com/spf13/cobra" ) @@ -24,16 +25,16 @@ var updateCmdExamples = fmt.Sprintf(` func GetUpdateCmd() *cobra.Command { updateCmd := &cobra.Command{ Use: "update", - Short: "Update your version", + Short: "Update to latest release version", Long: ``, Example: updateCmdExamples, RunE: func(_ *cobra.Command, args []string) error { //Checking the user's version of kubescape to the latest release if cautils.BuildNumber == cautils.LatestReleaseVersion { //your version == latest version - logger.L().Info(("You are in the latest version")) + logger.L().Info(("Nothing to update, you are running the latest version"), helpers.String("Version", cautils.BuildNumber)) } else { - fmt.Printf("please refer to our installation docs in the following link: %s", installationLink) + fmt.Printf("Please refer to our installation docs in the following link: %s", installationLink) } return nil }, diff --git a/cmd/version/version.go b/cmd/version/version.go index 311888e359..dd4259a65c 100644 --- a/cmd/version/version.go +++ b/cmd/version/version.go @@ -5,6 +5,7 @@ import ( "fmt" "os" + "github.com/kubescape/go-logger" "github.com/kubescape/kubescape/v2/core/cautils" "github.com/spf13/cobra" ) @@ -19,10 +20,10 @@ func GetVersionCmd() *cobra.Command { v := cautils.NewIVersionCheckHandler(ctx) v.CheckLatestVersion(ctx, cautils.NewVersionCheckRequest(cautils.BuildNumber, "", "", "version")) fmt.Fprintf(os.Stdout, - "Your current version is: %s [git enabled in build: %t]\n", + "Your current version is: %s\n", cautils.BuildNumber, - isGitEnabled(), ) + logger.L().Debug(fmt.Sprintf("git enabled in build: %t", isGitEnabled())) return nil }, }