Skip to content

Commit

Permalink
docs: add RPM archives
Browse files Browse the repository at this point in the history
Signed-off-by: knqyf263 <[email protected]>
  • Loading branch information
knqyf263 committed Oct 2, 2024
1 parent c1fa209 commit 9ed5d88
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 7 deletions.
4 changes: 2 additions & 2 deletions docs/docs/coverage/os/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,14 @@ Trivy supports operating systems for
| [Photon OS](photon.md) | 1.0, 2.0, 3.0, 4.0 | tndf/yum/rpm |
| [Debian GNU/Linux](debian.md) | 7, 8, 9, 10, 11, 12 | apt/dpkg |
| [Ubuntu](ubuntu.md) | All versions supported by Canonical | apt/dpkg |
| [OSs with installed Conda](conda.md) | - | conda |
| [OSs with installed Conda](../others/conda.md) | - | conda |

## Supported container images

| Container image | Supported Versions | Package Managers |
|-----------------------------------------------|-------------------------------------|------------------|
| [Google Distroless](google-distroless.md)[^2] | Any | apt/dpkg |
| [Bitnami](bitnami.md) | Any | - |
| [Bitnami](../others/bitnami.md) | Any | - |

Each page gives more details.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
Scanning results may be inaccurate.

While it is not an OS, this page describes the details of the [container images provided by Bitnami](https://github.com/bitnami/containers).
Bitnami images are based on [Debian](debian.md).
Please see [the Debian page](debian.md) for OS packages.
Bitnami images are based on [Debian](../os/debian.md).
Please see [the Debian page](../os/debian.md) for OS packages.

Trivy supports the following scanners for Bitnami packages.

Expand Down
File renamed without changes.
38 changes: 38 additions & 0 deletions docs/docs/coverage/others/rpm.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# RPM Archives

!!! warning "EXPERIMENTAL"
This feature might change without preserving backwards compatibility.

Trivy supports the following scanners for RPM archives.

| Scanner | Supported |
|:-------------:|:---------:|
| SBOM ||
| Vulnerability |[^1] |
| License ||

The table below outlines the features offered by Trivy.

## SBOM
Trivy analyzes RPM archives matching `*.rpm`.
This feature is currently disabled by default but can be enabled with an environment variable, `TRIVY_EXPERIMENTAL_RPM_ARCHIVE`.

```shell
TRIVY_EXPERIMENTAL_RPM_ARCHIVE=true trivy fs ./rpms -f cyclonedx -o rpms.cdx.json
```

## Vulnerability
Since RPM files don't have OS information, you need to generate SBOM, fill in the OS information manually and then scan the SBOM for vulnerabilities.

For example:

```shell
$ TRIVY_EXPERIMENTAL_RPM_ARCHIVE=true trivy fs ./rpms -f cyclonedx -o rpms.cdx.json
$ jq '(.components[] | select(.type == "operating-system")) |= (.name = "redhat" | .version = "7.9")' rpms.cdx.json > rpms-res.cdx.json
$ trivy sbom ./rpms-res.cdx.json
```

## License
If licenses are included in the RPM archive, Trivy extracts it.

[^1]: Need to generate SBOM first and add OS information to that SBOM
2 changes: 1 addition & 1 deletion docs/docs/supply-chain/sbom.md
Original file line number Diff line number Diff line change
Expand Up @@ -743,7 +743,7 @@ Trivy searches for SBOM files in container images with the following extensions:
- `.cdx`
- `.cdx.json`

In addition, Trivy automatically detects SBOM files in [Bitnami images](https://github.com/bitnami/containers), [see here](../coverage/os/bitnami.md) for more details.
In addition, Trivy automatically detects SBOM files in [Bitnami images](https://github.com/bitnami/containers), [see here](../coverage/others/bitnami.md) for more details.

It is enabled in the following targets.

Expand Down
6 changes: 4 additions & 2 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ nav:
- Azure Linux (CBL-Mariner): docs/coverage/os/azure.md
- CentOS: docs/coverage/os/centos.md
- Chainguard: docs/coverage/os/chainguard.md
- Conda: docs/coverage/os/conda.md
- Debian: docs/coverage/os/debian.md
- Oracle Linux: docs/coverage/os/oracle.md
- Photon OS: docs/coverage/os/photon.md
Expand All @@ -88,7 +87,6 @@ nav:
- Ubuntu: docs/coverage/os/ubuntu.md
- Wolfi: docs/coverage/os/wolfi.md
- Google Distroless (Images): docs/coverage/os/google-distroless.md
- Bitnami (Images): docs/coverage/os/bitnami.md
- Language:
- Overview: docs/coverage/language/index.md
- C/C++: docs/coverage/language/c.md
Expand All @@ -112,6 +110,10 @@ nav:
- Helm: docs/coverage/iac/helm.md
- Kubernetes: docs/coverage/iac/kubernetes.md
- Terraform: docs/coverage/iac/terraform.md
- Others:
- Bitnami Images: docs/coverage/others/bitnami.md
- Conda: docs/coverage/others/conda.md
- RPM Archives: docs/coverage/others/rpm.md
- Kubernetes: docs/coverage/kubernetes.md
- Configuration:
- Overview: docs/configuration/index.md
Expand Down

0 comments on commit 9ed5d88

Please sign in to comment.