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: add scan assets #8022

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
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
4 changes: 2 additions & 2 deletions docs/docs/advanced/air-gap.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ GitHub Container Registry | <ul><li>`ghcr.io`</li><li>`pkg-containers.githubuser

### Self-hosting

You can host Trivy's databases in your own container registry. Please refer to [Self-hosting document](./self-hosting.md#oci-databases) for a detailed guide.
You can host Trivy's databases in your own container registry. Please refer to [Self-hosting document](../scan-asset/self-hosting.md#oci-databases) for a detailed guide.

## Embedded Checks

Expand All @@ -60,7 +60,7 @@ For more information about GitHub connectivity (including specific IP addresses)

### Self-hosting

You can host a copy of VEX Hub on your own internal server. Please refer to the [self-hosting document](./self-hosting.md#vex-hub) for a detailed guide.
You can host a copy of VEX Hub on your own internal server. Please refer to the [self-hosting document](../scan-asset/self-hosting.md#vex-hub) for a detailed guide.

## Maven Central / Remote Repositories

Expand Down
132 changes: 0 additions & 132 deletions docs/docs/advanced/self-hosting.md

This file was deleted.

13 changes: 10 additions & 3 deletions docs/docs/configuration/cache.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,16 @@ The cache directory includes
The cache option is common to all scanners.

## Clear Caches
`trivy clean` subcommand removes caches.
`trivy clean` command removes caches. You can select which cache component to remove:

| option | description |
|-----------------|-------------------------------------------------------------|
| -a/--all | remove all caches |
| --checks-bundle | remove checks bundle |
| --java-db | remove Java database |
| --scan-cache | remove scan cache (container and VM image analysis results) |
| --vex-repo | remove VEX repositories |
| --vuln-db | remove vulnerability database |

```bash
$ trivy clean --scan-cache
Expand All @@ -25,8 +34,6 @@ $ trivy clean --scan-cache

</details>

If you want to delete cached vulnerability databases, use `--vuln-db`.
You can also delete all caches with `--all`.
See `trivy clean --help` for details.

## Cache Directory
Expand Down
129 changes: 0 additions & 129 deletions docs/docs/configuration/db.md

This file was deleted.

66 changes: 66 additions & 0 deletions docs/docs/configuration/scan-assets.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# Scan Assets

This document describes how to configure Trivy's scan asset management behavior.
While assets are automatically managed by default, there are various configuration options available for specific needs.

For details about the scan assets, see [Scan Assets](../scan-asset/index.md).

## Custom Locations

You can configure custom download locations for each asset:

| Asset | Configuration Method | Available Options |
|------------------|------------------------------|-------------------------------------------------------------------|
| Vulnerability DB | `--db-repository` | [OCI Repositories](../scan-asset/index.md#vulnerability-database) |
| Java DB | `--java-db-repository` | [OCI Repositories](../scan-asset/index.md#java-index-database) |
| Checks Bundle | `--checks-bundle-repository` | [OCI Repositories](../scan-asset/index.md#checks-bundle) |
| VEX Repository | [repository.yaml][vex-repo] | [Any VEX repositories][vex-repo] |

For details about hosting options, see [Self-Hosting Assets](../scan-asset/self-hosting.md)

Example usage for OCI registry configuration:

``` bash
trivy image --db-repository registry.my-company.example/trivy-db:2 alpine:3.15
```

Multiple repositories can be specified as fallbacks for OCI assets:

```bash
trivy image --db-repository registry.my-company.example/trivy-db:2 --db-repository ghcr.io/aquasecurity/trivy-db:2 alpine:3.15
```

## Skip Updates

| Asset | Skip Flag | Description |
|------------------|--------------------------|-------------------------------------|
| Vulnerability DB | `--skip-db-update` | Skip vulnerability database updates |
| Java DB | `--skip-java-db-update` | Skip Java database updates |
| Checks Bundle | `--skip-check-update` | Skip policy bundle updates |
| VEX Hub | `--skip-vex-repo-update` | Skip VEX repository updates |

For example,

```bash
trivy image --skip-db-update --skip-java-db-update debian:12
```

## Update Only Mode

| Asset | Update Command/Flag | Description |
|------------------|---------------------------|--------------------------------------|
| Vulnerability DB | `--download-db-only` | Download vulnerability database only |
| Java DB | `--download-java-db-only` | Download Java database only |
| Checks Bundle | N/A | No dedicated download-only flag |
| VEX Hub | `trivy vex repo download` | Download VEX data explicitly |

For example,

```bash
trivy image --download-db-only
```

## Cache Cleanup
See [Clear Caches](./cache.md#clear-caches)

[vex-repo]: ../supply-chain/vex/repo.md
Loading