Skip to content

Commit

Permalink
docs: Update CLI help text (#132)
Browse files Browse the repository at this point in the history
* update docs link

* Clean up flag descriptions

* Remove single file example scan
  • Loading branch information
markmichon committed Nov 22, 2022
1 parent f7fc96a commit 04a5606
Show file tree
Hide file tree
Showing 13 changed files with 146 additions and 105 deletions.
4 changes: 2 additions & 2 deletions docs/_data/curio.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ options:
usage: help for this command
see_also:
- ' config - Scan config files for misconfigurations'
- ' init - writes default config to curio.yml'
- ' scan - Scan git repository'
- ' init - Generates a default config to `curio.yml`'
- ' scan - Scan a directory or file'
- ' version - Print the version'
aliases:
11 changes: 7 additions & 4 deletions docs/_data/curio_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,29 @@ name: ' config'
synopsis: Scan config files for misconfigurations
usage: ' config [flags] DIR'
options:
- name: context
usage: |
Expand context of schema classification e.g., --context=health, to include data types particular to health
- name: disable-domain-resolution
default_value: "false"
usage: |
do not attempt to resolve detected domains during classification (default false), eg. --disable-domain-resolution=true
Do not attempt to resolve detected domains during classification (default false), e.g. --disable-domain-resolution=true
- name: domain-resolution-timeout
default_value: 3s
usage: |
set timeout when attempting to resolve detected domains during classification (default 3 seconds), eg. --domain-resolution-timeout=TODO
Set timeout when attempting to resolve detected domains during classification (default 3 seconds), e.g. --domain-resolution-timeout=3s
- name: help
shorthand: h
default_value: "false"
usage: help for config
- name: internal-domains
default_value: '[]'
usage: |
define regular expressions for better classification of private or unreachable domains eg. --internal-domains="*.my-company.com,private.sh"
Define regular expressions for better classification of private or unreachable domains e.g. --internal-domains="*.my-company.com,private.sh"
- name: skip-path
default_value: '[]'
usage: |
specify the comma separated files and directories to skip (supports * syntax), eg. --skip-path users/*.go,users/admin.sql
Specify the comma separated files and directories to skip. Supports * syntax, e.g. --skip-path users/*.go,users/admin.sql
see_also:
- ' - '
aliases: conf
39 changes: 24 additions & 15 deletions docs/_data/curio_init.yaml
Original file line number Diff line number Diff line change
@@ -1,20 +1,25 @@
name: ' init'
synopsis: writes default config to curio.yml
synopsis: Generates a default config to `curio.yml`
usage: ' init [flags]'
options:
- name: config-file
usage: file from which to load configurations
usage: Load configuration from the defined path
- name: context
usage: |
Expand context of schema classification e.g., --context=health, to include data types particular to health
- name: debug
default_value: "false"
usage: enable debug logs
usage: Enable debug logs
- name: disable-domain-resolution
default_value: "false"
usage: |
do not attempt to resolve detected domains during classification (default false), eg. --disable-domain-resolution=true
Do not attempt to resolve detected domains during classification (default false), e.g. --disable-domain-resolution=true
- name: domain-resolution-timeout
default_value: 3s
usage: |
set timeout when attempting to resolve detected domains during classification (default 3 seconds), eg. --domain-resolution-timeout=TODO
Set timeout when attempting to resolve detected domains during classification (default 3 seconds), e.g. --domain-resolution-timeout=3s
- name: existing-worker
usage: URL of an existing worker
- name: file-size-max
default_value: "25000000"
usage: ignore files with file size larger than this config
Expand All @@ -24,36 +29,40 @@ options:
- name: format
shorthand: f
default_value: json
usage: format (json)
usage: Specify report format (json, yaml)
- name: help
shorthand: h
default_value: "false"
usage: help for init
- name: internal-domains
default_value: '[]'
usage: |
define regular expressions for better classification of private or unreachable domains eg. --internal-domains="*.my-company.com,private.sh"
Define regular expressions for better classification of private or unreachable domains e.g. --internal-domains="*.my-company.com,private.sh"
- name: memory-max
default_value: "800000000"
usage: |
if memory needed to scan a file surpasses this limit, skip the file
- name: only-policy
default_value: '[]'
usage: |
specify the comma separated ids of the policies you would like to run. Skips all other policies.
- name: output
usage: path where to save report
usage: Specify output path for report
- name: quiet
default_value: "false"
usage: Suppress non-essential messages
- name: report
default_value: detectors
usage: specify the kind of report (detectors)
usage: |
Specify the kind of report (detectors, dataflow, policies, stats)
- name: skip-path
default_value: '[]'
usage: |
specify the comma separated files and directories to skip (supports * syntax), eg. --skip-path users/*.go,users/admin.sql
Specify the comma separated files and directories to skip. Supports * syntax, e.g. --skip-path users/*.go,users/admin.sql
- name: skip-policy
default_value: '[]'
usage: |
specify the comma separated ids of the policies you would like to skip. Runs all other policies.
- name: only-policy
default_value: '[]'
usage: |
specify the comma separated ids of the policies you would like to run. Skips all other policies.
- name: timeout
default_value: 10m0s
usage: time allowed to complete scan
Expand All @@ -77,4 +86,4 @@ options:
usage: number of processing workers to spawn
see_also:
- ' - '
aliases:
aliases:
45 changes: 26 additions & 19 deletions docs/_data/curio_scan.yaml
Original file line number Diff line number Diff line change
@@ -1,20 +1,25 @@
name: ' scan'
synopsis: Scan git repository
usage: ' scan [flags] PATH'
synopsis: Scan a directory or file
usage: ' scan [flags] <path>'
options:
- name: config-file
usage: file from which to load configurations
usage: Load configuration from the defined path
- name: context
usage: |
Expand context of schema classification e.g., --context=health, to include data types particular to health
- name: debug
default_value: "false"
usage: enable debug logs
usage: Enable debug logs
- name: disable-domain-resolution
default_value: "false"
usage: |
do not attempt to resolve detected domains during classification (default false), eg. --disable-domain-resolution=true
Do not attempt to resolve detected domains during classification (default false), e.g. --disable-domain-resolution=true
- name: domain-resolution-timeout
default_value: 3s
usage: |
set timeout when attempting to resolve detected domains during classification (default 3 seconds), eg. --domain-resolution-timeout=TODO
Set timeout when attempting to resolve detected domains during classification (default 3 seconds), e.g. --domain-resolution-timeout=3s
- name: existing-worker
usage: URL of an existing worker
- name: file-size-max
default_value: "25000000"
usage: ignore files with file size larger than this config
Expand All @@ -24,36 +29,40 @@ options:
- name: format
shorthand: f
default_value: json
usage: format (json)
usage: Specify report format (json, yaml)
- name: help
shorthand: h
default_value: "false"
usage: help for scan
- name: internal-domains
default_value: '[]'
usage: |
define regular expressions for better classification of private or unreachable domains eg. --internal-domains="*.my-company.com,private.sh"
Define regular expressions for better classification of private or unreachable domains e.g. --internal-domains="*.my-company.com,private.sh"
- name: memory-max
default_value: "800000000"
usage: |
if memory needed to scan a file surpasses this limit, skip the file
- name: only-policy
default_value: '[]'
usage: |
specify the comma separated ids of the policies you would like to run. Skips all other policies.
- name: output
usage: path where to save report
usage: Specify output path for report
- name: quiet
default_value: "false"
usage: Suppress non-essential messages
- name: report
default_value: detectors
usage: specify the kind of report (detectors)
usage: |
Specify the kind of report (detectors, dataflow, policies, stats)
- name: skip-path
default_value: '[]'
usage: |
specify the comma separated files and directories to skip (supports * syntax), eg. --skip-path users/*.go,users/admin.sql
Specify the comma separated files and directories to skip. Supports * syntax, e.g. --skip-path users/*.go,users/admin.sql
- name: skip-policy
default_value: '[]'
usage: |
specify the comma separated ids of the policies you would like to skip. Runs all other policies.
- name: only-policy
default_value: '[]'
usage: |
specify the comma separated ids of the policies you would like to run. Skips all other policies.
- name: timeout
default_value: 10m0s
usage: time allowed to complete scan
Expand All @@ -76,10 +85,8 @@ options:
default_value: "1"
usage: number of processing workers to spawn
example: |4-
# Scan a local project including language-specific files
$ curio s /path/to/your_project
# Scan a single file
$ curio s ./curio-ci-test/Pipfile.lock
# Scan a local project, including language-specific files
$ curio scan /path/to/your_project
see_also:
- ' - '
aliases: s
26 changes: 20 additions & 6 deletions integration/flags/.snapshots/TestMetadataFlags-help
Original file line number Diff line number Diff line change
@@ -1,13 +1,27 @@
Curio is a tool for scanning policy breaches
Curio - discover sensitive data flows and security risks.

Scan Example:
# Scan local repository
$ curio scan <repository>
Usage: curio <command> [flags]

Available Commands:
scan Scan git repository
init Writes default config to curio.yml
scan Scan a directory or file
init Write the default config to curio.yml
version Print the version

Examples:
# Scan local directory or file
$ curio scan <path>

# Scan current directory and output the data flow to a file
$ curio scan --report dataflow --output <output-path> .

Learn More:
Curio scans your source code to discover sensitive data flows
and data security risks in your codebase. This includes detecting
PHI, PII, and PD usage in data stores, internal APIs, and external
APIs. You can run Curio locally or as part of your CI/CD pipeline.

For more examples, tutorials, and to learn more about the project
visit https://curio.sh

--

32 changes: 15 additions & 17 deletions integration/flags/.snapshots/TestMetadataFlags-help-scan
Original file line number Diff line number Diff line change
@@ -1,24 +1,22 @@
Scan git repository
Scan a directory or file

Usage:
scan [flags] PATH
scan [flags] <path>
Aliases:
scan, s
Examples:
# Scan a local project including language-specific files
$ curio s /path/to/your_project
# Scan a single file
$ curio s ./curio-ci-test/Pipfile.lock
# Scan a local project, including language-specific files
$ curio scan /path/to/your_project


Scan Flags
--context string expand context of schema classification e.g. --context=health to include data types particular to health
--debug enable debug logs
--disable-domain-resolution do not attempt to resolve detected domains during classification (default false), eg. --disable-domain-resolution=true
--domain-resolution-timeout duration set timeout when attempting to resolve detected domains during classification (default 3 seconds), eg. --domain-resolution-timeout=TODO (default 3s)
--internal-domains strings define regular expressions for better classification of private or unreachable domains eg. --internal-domains="*.my-company.com,private.sh"
--quiet suppress non-essential messages
--skip-path strings specify the comma separated files and directories to skip (supports * syntax), eg. --skip-path users/*.go,users/admin.sql
--context string Expand context of schema classification e.g., --context=health, to include data types particular to health
--debug Enable debug logs
--disable-domain-resolution Do not attempt to resolve detected domains during classification (default false), e.g. --disable-domain-resolution=true
--domain-resolution-timeout duration Set timeout when attempting to resolve detected domains during classification (default 3 seconds), e.g. --domain-resolution-timeout=3s (default 3s)
--internal-domains strings Define regular expressions for better classification of private or unreachable domains e.g. --internal-domains="*.my-company.com,private.sh"
--quiet Suppress non-essential messages
--skip-path strings Specify the comma separated files and directories to skip. Supports * syntax, e.g. --skip-path users/*.go,users/admin.sql

Policy Flags
--only-policy strings specify the comma separated ids of the policies you would like to run. Skips all other policies.
Expand All @@ -37,12 +35,12 @@ Worker Flags
--workers int number of processing workers to spawn (default 1)

Report Flags
-f, --format string format (json, yaml) (default "json")
--output string path where to save report
--report string specify the kind of report (detectors, dataflow, policies, stats) (default "detectors")
-f, --format string Specify report format (json, yaml) (default "json")
--output string Specify output path for report
--report string Specify the kind of report (detectors, dataflow, policies, stats) (default "detectors")

General Flags
--config-file string file from which to load configurations
--config-file string Load configuration from the defined path


--
Expand Down
32 changes: 15 additions & 17 deletions integration/flags/.snapshots/TestMetadataFlags-scan-help
Original file line number Diff line number Diff line change
@@ -1,24 +1,22 @@
Scan git repository
Scan a directory or file

Usage:
scan [flags] PATH
scan [flags] <path>
Aliases:
scan, s
Examples:
# Scan a local project including language-specific files
$ curio s /path/to/your_project
# Scan a single file
$ curio s ./curio-ci-test/Pipfile.lock
# Scan a local project, including language-specific files
$ curio scan /path/to/your_project


Scan Flags
--context string expand context of schema classification e.g. --context=health to include data types particular to health
--debug enable debug logs
--disable-domain-resolution do not attempt to resolve detected domains during classification (default false), eg. --disable-domain-resolution=true
--domain-resolution-timeout duration set timeout when attempting to resolve detected domains during classification (default 3 seconds), eg. --domain-resolution-timeout=TODO (default 3s)
--internal-domains strings define regular expressions for better classification of private or unreachable domains eg. --internal-domains="*.my-company.com,private.sh"
--quiet suppress non-essential messages
--skip-path strings specify the comma separated files and directories to skip (supports * syntax), eg. --skip-path users/*.go,users/admin.sql
--context string Expand context of schema classification e.g., --context=health, to include data types particular to health
--debug Enable debug logs
--disable-domain-resolution Do not attempt to resolve detected domains during classification (default false), e.g. --disable-domain-resolution=true
--domain-resolution-timeout duration Set timeout when attempting to resolve detected domains during classification (default 3 seconds), e.g. --domain-resolution-timeout=3s (default 3s)
--internal-domains strings Define regular expressions for better classification of private or unreachable domains e.g. --internal-domains="*.my-company.com,private.sh"
--quiet Suppress non-essential messages
--skip-path strings Specify the comma separated files and directories to skip. Supports * syntax, e.g. --skip-path users/*.go,users/admin.sql

Policy Flags
--only-policy strings specify the comma separated ids of the policies you would like to run. Skips all other policies.
Expand All @@ -37,12 +35,12 @@ Worker Flags
--workers int number of processing workers to spawn (default 1)

Report Flags
-f, --format string format (json, yaml) (default "json")
--output string path where to save report
--report string specify the kind of report (detectors, dataflow, policies, stats) (default "detectors")
-f, --format string Specify report format (json, yaml) (default "json")
--output string Specify output path for report
--report string Specify the kind of report (detectors, dataflow, policies, stats) (default "detectors")

General Flags
--config-file string file from which to load configurations
--config-file string Load configuration from the defined path


--
Expand Down
Loading

0 comments on commit 04a5606

Please sign in to comment.