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

docs(repo): Update trivy repo usage and example #5049

Merged
merged 1 commit into from
Aug 28, 2023
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
2 changes: 1 addition & 1 deletion docs/docs/references/configuration/cli/trivy.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ trivy [global flags] command [flags] target
* [trivy kubernetes](trivy_kubernetes.md) - [EXPERIMENTAL] Scan kubernetes cluster
* [trivy module](trivy_module.md) - Manage modules
* [trivy plugin](trivy_plugin.md) - Manage plugins
* [trivy repository](trivy_repository.md) - Scan a remote repository
* [trivy repository](trivy_repository.md) - Scan a repository
* [trivy rootfs](trivy_rootfs.md) - Scan rootfs
* [trivy sbom](trivy_sbom.md) - Scan SBOM for vulnerabilities
* [trivy server](trivy_server.md) - Server mode
Expand Down
6 changes: 4 additions & 2 deletions docs/docs/references/configuration/cli/trivy_repository.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
## trivy repository

Scan a remote repository
Scan a repository

```
trivy repository [flags] REPO_URL
trivy repository [flags] (REPO_PATH | REPO_URL)
```

### Examples

```
# Scan your remote git repository
$ trivy repo https://github.com/knqyf263/trivy-ci-test
# Scan your local git repository
$ trivy repo /path/to/your/repository
```

### Options
Expand Down
6 changes: 3 additions & 3 deletions docs/docs/target/repository.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,23 +86,23 @@ It is disabled by default and can be enabled with `--scanners config`.
See [here](../scanner/misconfiguration/index.md) for the detail.

```shell
$ trivy repo --scanners config [YOUR_REPO_URL]
$ trivy repo --scanners config (REPO_PATH | REPO_URL)
```

### Secrets
It is enabled by default.
See [here](../scanner/secret.md) for the detail.

```shell
$ trivy repo [YOUR_REPO_URL]
$ trivy repo (REPO_PATH | REPO_URL)
```

### Licenses
It is disabled by default.
See [here](../scanner/license.md) for the detail.

```shell
$ trivy repo --scanners license [YOUR_REPO_URL]
$ trivy repo --scanners license (REPO_PATH | REPO_URL)
```

## SBOM generation
Expand Down
2 changes: 1 addition & 1 deletion docs/tutorials/shell/shell-completion.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ image -- Scan a container image
kubernetes -- scan kubernetes cluster
module -- Manage modules
plugin -- Manage plugins
repository -- Scan a remote repository
repository -- Scan a repository
rootfs -- Scan rootfs
sbom -- Scan SBOM for vulnerabilities
server -- Server mode
Expand Down
8 changes: 5 additions & 3 deletions pkg/commands/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -443,12 +443,14 @@ func NewRepositoryCommand(globalFlags *flag.GlobalFlagGroup) *cobra.Command {
repoFlags.ReportFlagGroup.ExitOnEOL = nil // disable '--exit-on-eol'

cmd := &cobra.Command{
Use: "repository [flags] REPO_URL",
Use: "repository [flags] (REPO_PATH | REPO_URL)",
Aliases: []string{"repo"},
GroupID: groupScanning,
Short: "Scan a remote repository",
Short: "Scan a repository",
Example: ` # Scan your remote git repository
$ trivy repo https://github.com/knqyf263/trivy-ci-test`,
$ trivy repo https://github.com/knqyf263/trivy-ci-test
# Scan your local git repository
$ trivy repo /path/to/your/repository`,
PreRunE: func(cmd *cobra.Command, args []string) error {
if err := repoFlags.Bind(cmd); err != nil {
return xerrors.Errorf("flag bind error: %w", err)
Expand Down
Loading