Skip to content

Commit

Permalink
docs: update client/server docs for misconf and license scanning
Browse files Browse the repository at this point in the history
Signed-off-by: nikpivkin <[email protected]>
  • Loading branch information
nikpivkin committed Jul 31, 2024
1 parent d76feba commit 6c10fdf
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
9 changes: 6 additions & 3 deletions docs/docs/references/modes/client-server.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,12 @@

Trivy has client/server mode. Trivy server has vulnerability database and Trivy client doesn't have to download vulnerability database. It is useful if you want to scan images or files at multiple locations and do not want to download the database at every location.

| Client/Server Mode | Image | Rootfs | Filesystem | Repository | Config | AWS | K8s |
|:---------------------:|:-----:|:------:|:----------:|:----------:|:------:|:---:|:---:|
| Supported |||||| X | X |
| Client/Server Mode | Image | Rootfs | Filesystem | Repository | Config | K8s |
|:---------------------:|:-----:|:------:|:----------:|:----------:|:------:|:---:|
| Supported ||||| X | X |

!!! note
Scanning of misconfigurations and licenses is performed on the client side (as in standalone mode). Otherwise, the client would need to send files to the server that may contain sensitive information. The checks bundle is also downloaded on the client side.

## Server
At first, you need to launch Trivy server. It downloads vulnerability database automatically and continue to fetch the latest DB in the background.
Expand Down
9 changes: 9 additions & 0 deletions pkg/commands/artifact/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,15 @@ func Run(ctx context.Context, opts flag.Options, targetKind TargetKind) (err err
}
}()

if opts.ServerAddr != "" && opts.Scanners.AnyEnabled(types.MisconfigScanner, types.SecretScanner) {
log.WarnContext(ctx,
fmt.Sprintf(
"Trivy runs in client/server mode, but misconfiguration and license scanning will be done on the client side, see %s",
doc.URL("/docs/references/modes/client-server", ""),
),
)
}

if opts.GenerateDefaultConfig {
log.Info("Writing the default config to trivy-default.yaml...")
return viper.SafeWriteConfigAs("trivy-default.yaml")
Expand Down

0 comments on commit 6c10fdf

Please sign in to comment.