Skip to content

Commit

Permalink
Update --validate flag description
Browse files Browse the repository at this point in the history
  • Loading branch information
Baruch Odem committed Feb 15, 2024
1 parent 92ce317 commit fb82f36
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ Flags:
--report-path strings path to generate report files. The output format will be determined by the file extension (.json, .yaml, .sarif)
--rule strings select rules by name or tag to apply to this scan
--stdout-format string stdout output format, available formats are: json, yaml, sarif (default "yaml")
--validate Validate the secrets found
--validate trigger additional validation to check if discovered secrets are active or revoked
-v, --version version for 2ms

Use "2ms [command] --help" for more information about a command.
Expand All @@ -161,7 +161,7 @@ Use "2ms [command] --help" for more information about a command.
## Validity Check
From the help message: `--validate Validate the secrets found`.
From the help message: `--validate trigger additional validation to check if discovered secrets are active or revoked`.
The `--validate` flag will check the validity of the secrets found. For example, if it is a Github token, it will check if the token is valid by making a request to the Github API. We will use the less intrusive method to check the validity of the secret.
Expand Down
2 changes: 1 addition & 1 deletion cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ func Execute() (int, error) {
rootCmd.PersistentFlags().StringSliceVar(&secretsConfigVar.SpecialList, specialRulesFlagName, []string{}, "special (non-default) rules to apply.\nThis list is not affected by the --rule and --ignore-rule flags.")
rootCmd.PersistentFlags().Var(&ignoreOnExitVar, ignoreOnExitFlagName, "defines which kind of non-zero exits code should be ignored\naccepts: all, results, errors, none\nexample: if 'results' is set, only engine errors will make 2ms exit code different from 0")
rootCmd.PersistentFlags().IntVar(&secretsConfigVar.MaxTargetMegabytes, maxTargetMegabytesFlagName, 0, "files larger than this will be skipped.\nOmit or set to 0 to disable this check.")
rootCmd.PersistentFlags().BoolVar(&validateVar, validate, false, "Validate the secrets found")
rootCmd.PersistentFlags().BoolVar(&validateVar, validate, false, "trigger additional validation to check if discovered secrets are active or revoked")

rootCmd.AddCommand(secrets.GetRulesCommand(&secretsConfigVar))

Expand Down

0 comments on commit fb82f36

Please sign in to comment.