Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

edits to doc content #247

Merged
merged 4 commits into from
Dec 20, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions apps/cnspec/cmd/bundle.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func init() {
policyBundlesCmd.AddCommand(policyFmtCmd)

// bundle add
policyUploadCmd.Flags().String("policy-version", "", "Override the version of each policy in the bundle")
policyUploadCmd.Flags().String("policy-version", "", "Override the version of each policy in the bundle.")
policyBundlesCmd.AddCommand(policyUploadCmd)

rootCmd.AddCommand(policyBundlesCmd)
Expand All @@ -49,7 +49,7 @@ var embedPolicyTemplate []byte

var policyInitCmd = &cobra.Command{
Use: "init [path]",
Short: "Create an example policy bundle that can be used as a starting point. If no filename is provided, `example-policy.mql.yml` is used",
Short: "Create an example policy bundle that you can use as a starting point. If you don't provide a filename, cnspec uses `example-policy.mql.yml`.",
Args: cobra.MaximumNArgs(1),
Run: func(cmd *cobra.Command, args []string) {
name := "example-policy.mql.yaml"
Expand Down Expand Up @@ -79,7 +79,7 @@ func validate(policyBundle *policy.Bundle) []string {
policyId := strconv.Itoa(i)

if policy.Uid == "" {
errors = append(errors, fmt.Sprintf("policy %s does not define a uid", policyId))
errors = append(errors, fmt.Sprintf("policy %s does not define a UID", policyId))
} else {
policyId = policy.Uid
}
Expand All @@ -93,7 +93,7 @@ func validate(policyBundle *policy.Bundle) []string {
query := policyBundle.Queries[j]
queryId := strconv.Itoa(j)
if query.Uid == "" {
errors = append(errors, fmt.Sprintf("query %s does not define a uid", queryId))
errors = append(errors, fmt.Sprintf("query %s does not define a UID", queryId))
} else {
queryId = query.Uid
}
Expand Down Expand Up @@ -200,7 +200,7 @@ func formatFile(filename string) error {
var policyFmtCmd = &cobra.Command{
Use: "format [path]",
Aliases: []string{"fmt"},
Short: "Apply style formatting to policy bundles",
Short: "Apply style formatting to policy bundles.",
Args: cobra.MinimumNArgs(1),
Run: func(cmd *cobra.Command, args []string) {
for _, path := range args {
Expand All @@ -217,7 +217,7 @@ var policyFmtCmd = &cobra.Command{

var policyUploadCmd = &cobra.Command{
Use: "upload [path]",
Short: "Adds a user-owned policy to Mondoo's Query Hub",
Short: "Add a user-owned policy to Mondoo Query Hub.",
Args: cobra.ExactArgs(1),
PreRun: func(cmd *cobra.Command, args []string) {
viper.BindPFlag("policy-version", cmd.Flags().Lookup("policy-version"))
Expand Down
10 changes: 4 additions & 6 deletions apps/cnspec/cmd/login.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,13 @@ var loginCmd = &cobra.Command{
Aliases: []string{"register"},
Short: "Register with Mondoo Platform",
Long: `
Log in to Mondoo platform by using a registration token. To pass in the token, use
Log in to Mondoo platform using a registration token. To pass in the token, use
the '--token' flag.

You can generate a new registration token via the Mondoo Dashboard
https://console.mondoo.com -> Space -> Settings -> Registration Token. Copy the token and pass it in
as the '--token' argument.
You can generate a new registration token on the Mondoo Dashboard. Go to
https://console.mondoo.com -> Space -> Settings -> Registration Token. Copy the token and pass it as the '--token' argument.

Every client remains logged in until you explicitly log out. You can
log out by using 'logout' subcommand.
You remain logged in until you explicitly log out using the 'logout' subcommand.
`,
PreRun: func(cmd *cobra.Command, args []string) {
viper.BindPFlag("api_endpoint", cmd.Flags().Lookup("api-endpoint"))
Expand Down
38 changes: 19 additions & 19 deletions apps/cnspec/cmd/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,32 +20,32 @@ var execCmd = builder.NewProviderCommand(builder.CommandOpts{
Short: "Run an MQL query",
Long: `Run an MQL query on the CLI and displays its results.`,
CommonFlags: func(cmd *cobra.Command) {
cmd.Flags().Bool("parse", false, "Parse the query and return the logical structure")
cmd.Flags().Bool("ast", false, "Parse the query and return the Abstract Syntax Tree (AST)")
cmd.Flags().BoolP("json", "j", false, "Run the query and return the object in a JSON structure")
cmd.Flags().String("query", "", "MQL query to be executed")
cmd.Flags().Bool("parse", false, "Parse the query and return the logical structure.")
cmd.Flags().Bool("ast", false, "Parse the query and return the abstract syntax tree (AST).")
cmd.Flags().BoolP("json", "j", false, "Run the query and return the object in a JSON structure.")
cmd.Flags().String("query", "", "MQL query to execute.")
cmd.Flags().MarkHidden("query")
cmd.Flags().StringP("command", "c", "", "MQL query to be executed")
cmd.Flags().StringP("command", "c", "", "MQL query to execute.")

cmd.Flags().StringP("password", "p", "", "Connection password e.g. for ssh/winrm")
cmd.Flags().Bool("ask-pass", false, "Prompt for connection password")
cmd.Flags().StringP("identity-file", "i", "", "Select a file from which the identity (private key) for public key authentication is read.")
cmd.Flags().Bool("insecure", false, "Disable TLS/SSL checks or SSH hostkey config")
cmd.Flags().Bool("sudo", false, "Elevate privileges with sudo")
cmd.Flags().String("platform-id", "", "Select an specific asset by providing the platform id for the target")
cmd.Flags().Bool("instances", false, "Also scan instances (only applies to api targets like aws, azure or gcp)")
cmd.Flags().Bool("host-machines", false, "Also scan host machines like ESXi server")
cmd.Flags().StringP("password", "p", "", "Connection password (such as for ssh/winrm).")
cmd.Flags().Bool("ask-pass", false, "Prompt for connection password.")
cmd.Flags().StringP("identity-file", "i", "", "Select the file from which to read the identity (private key) for public key authentication.")
cmd.Flags().Bool("insecure", false, "Disable TLS/SSL checks or SSH hostkey config.")
cmd.Flags().Bool("sudo", false, "Elevate privileges with sudo.")
cmd.Flags().String("platform-id", "", "Select a specific target asset by providing its platform ID.")
cmd.Flags().Bool("instances", false, "Also scan instances. This only applies to API targets like AWS, Azure or GCP.")
cmd.Flags().Bool("host-machines", false, "Also scan host machines like ESXi servers.")

cmd.Flags().Bool("record", false, "Record provider calls (only works for operating system providers)")
cmd.Flags().Bool("record", false, "Record provider calls. This only works for operating system providers.")
cmd.Flags().MarkHidden("record")

cmd.Flags().String("record-file", "", "File path to for the recorded provider calls (only works for operating system providers)")
cmd.Flags().String("record-file", "", "File path for the recorded provider calls. This only works for operating system providers.")
cmd.Flags().MarkHidden("record-file")

cmd.Flags().String("path", "", "Path to a local file or directory that the connection should use")
cmd.Flags().StringToString("option", nil, "Additional connection options, multiple options can be passed in via --option key=value")
cmd.Flags().String("discover", common.DiscoveryAuto, "Enable the discovery of nested assets. Supported are 'all|auto|instances|host-instances|host-machines|container|container-images|pods|cronjobs|statefulsets|deployments|jobs|replicasets|daemonsets'")
cmd.Flags().StringToString("discover-filter", nil, "Additional filter for asset discovery")
cmd.Flags().String("path", "", "Path to a local file or directory for the connection to use.")
cmd.Flags().StringToString("option", nil, "Additional connection options. You can pass in multiple options using `--option key=value`")
cmd.Flags().String("discover", common.DiscoveryAuto, "Enable the discovery of nested assets. Supports: 'all|auto|instances|host-instances|host-machines|container|container-images|pods|cronjobs|statefulsets|deployments|jobs|replicasets|daemonsets'")
cmd.Flags().StringToString("discover-filter", nil, "Additional filter for asset discovery.")
},
CommonPreRun: func(cmd *cobra.Command, args []string) {
// for all assets
Expand Down
Loading