try again
CI / Test Merge SARIF Files (pull_request) Successful in 4s
CI / Test Setup DB (pull_request) Successful in 6s
CI / Test Get Images From Files (pull_request) Successful in 5s
CI / Test scan-image (pull_request) Failing after 6s
CI / Test scan-fs (pull_request) Failing after 1m14s
CI / Test scan-config (pull_request) Failing after 1m2s
CI / Test Merge SARIF Files (pull_request) Successful in 4s
CI / Test Setup DB (pull_request) Successful in 6s
CI / Test Get Images From Files (pull_request) Successful in 5s
CI / Test scan-image (pull_request) Failing after 6s
CI / Test scan-fs (pull_request) Failing after 1m14s
CI / Test scan-config (pull_request) Failing after 1m2s
This commit is contained in:
@@ -6,6 +6,8 @@ The directory you pass as **`scan-path`** is bind-mounted **read-only** at `/sca
|
||||
|
||||
**Misconfiguration scans do not need outbound network.** This action sets **`--network none`** so the container cannot reach the network. Rego check bundles are not fetched online (`--skip-check-update`); use a Trivy image that already includes the checks you need, or rely on the embedded defaults.
|
||||
|
||||
**Docker-in-Docker:** **`cache-dir`** and **`output-dir`** default under **`runner.temp`** so bind mounts work when the job runs in a container with DinD. **`scan-path`** must also be on the same shared volume the Docker daemon uses (often under your runner’s work/temp tree); see [setup-db](../setup-db) README.
|
||||
|
||||
## Prerequisites
|
||||
|
||||
- Docker on the runner.
|
||||
@@ -23,6 +25,7 @@ The directory you pass as **`scan-path`** is bind-mounted **read-only** at `/sca
|
||||
uses: ./scan-config
|
||||
with:
|
||||
scan-path: ${{ github.workspace }}
|
||||
# On DinD, if bind mounts fail, use a path under ${{ runner.temp }} (or your runner’s shared work dir) instead.
|
||||
cache-dir: ${{ steps.db.outputs.cache-dir }}
|
||||
output-dir: ${{ runner.temp }}/trivy-reports
|
||||
output-file: misconfig.sarif
|
||||
@@ -38,8 +41,8 @@ The directory you pass as **`scan-path`** is bind-mounted **read-only** at `/sca
|
||||
| Input | Description | Required | Default |
|
||||
| --------------- | --------------------------------------------------------------------------- | -------- | ------- |
|
||||
| `scan-path` | Host directory to scan (mounted read-only at `/scan`) | Yes | — |
|
||||
| `cache-dir` | Trivy cache directory (mounted read-only at `/cache`) | No | `${{ runner.temp }}/trivy` |
|
||||
| `output-dir` | Host directory for the report (mounted read-write at `/out`) | Yes | — |
|
||||
| `cache-dir` | Trivy cache directory (read-only at `/cache`; created if missing) | No | `${{ runner.temp }}/trivy` |
|
||||
| `output-dir` | Report directory (read-write at `/out`; created if missing) | Yes | — |
|
||||
| `output-file` | SARIF file name only (no `/`); created under `output-dir` | Yes | — |
|
||||
| `trivy-version` | Trivy Docker image (digest pin recommended) | No | Same pin as `setup-db` / see `action.yaml` |
|
||||
|
||||
@@ -53,5 +56,5 @@ The directory you pass as **`scan-path`** is bind-mounted **read-only** at `/sca
|
||||
|
||||
## Notes
|
||||
|
||||
- Paths should exist or be creatable: **`output-dir`** is created with `mkdir -p` if missing; **`scan-path`** and **`cache-dir`** must already exist.
|
||||
- **`cache-dir`** and **`output-dir`** are created with `mkdir -p` if missing. **`scan-path`** must already exist and be bind-mountable (see DinD note above).
|
||||
- The step still fails if Docker or the container exits non-zero before Trivy completes (e.g. mount or runtime errors).
|
||||
|
||||
Reference in New Issue
Block a user