Compare commits
2 Commits
6e5f62d4dd
...
0.0.3
| Author | SHA1 | Date | |
|---|---|---|---|
| 3c4aeb81f4 | |||
| 2616391b42 |
@@ -10,7 +10,7 @@ jobs:
|
|||||||
name: Release
|
name: Release
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
- name: Increment tag
|
- name: Increment tag
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ jobs:
|
|||||||
- ubuntu-latest
|
- ubuntu-latest
|
||||||
- linux_${{ matrix.arch }}
|
- linux_${{ matrix.arch }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
|
||||||
- name: Setup Trivy
|
- name: Setup Trivy
|
||||||
uses: ./setup-trivy
|
uses: ./setup-trivy
|
||||||
- name: Run Trivy
|
- name: Run Trivy
|
||||||
@@ -24,7 +24,7 @@ jobs:
|
|||||||
runs-on:
|
runs-on:
|
||||||
- ubuntu-latest
|
- ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
|
||||||
- uses: ./setup-trivy
|
- uses: ./setup-trivy
|
||||||
- name: Setup DB
|
- name: Setup DB
|
||||||
id: setup-db
|
id: setup-db
|
||||||
@@ -37,7 +37,7 @@ jobs:
|
|||||||
runs-on:
|
runs-on:
|
||||||
- ubuntu-latest
|
- ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
|
||||||
- id: giff
|
- id: giff
|
||||||
uses: ./get-images-from-files
|
uses: ./get-images-from-files
|
||||||
with:
|
with:
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ jobs:
|
|||||||
name: Prerelease
|
name: Prerelease
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
- name: Increment tag
|
- name: Increment tag
|
||||||
|
|||||||
@@ -4,17 +4,6 @@
|
|||||||
"local>t.behrendt/renovate-configs:common",
|
"local>t.behrendt/renovate-configs:common",
|
||||||
"local>t.behrendt/renovate-configs:action"
|
"local>t.behrendt/renovate-configs:action"
|
||||||
],
|
],
|
||||||
"customManagers": [
|
|
||||||
{
|
|
||||||
"customType": "regex",
|
|
||||||
"description": "Update Trivy docker image",
|
|
||||||
"managerFilePatterns": ["/(^|/)setup-db/action\\.ya?ml$/"],
|
|
||||||
"datasourceTemplate": "docker",
|
|
||||||
"matchStrings": [
|
|
||||||
"default:\\s*\"(?<depName>ghcr\\.io/aquasecurity/trivy):(?<currentValue>[\\d\\.]+)(?:@(?<currentDigest>sha256:[a-f0-9]+))?\""
|
|
||||||
]
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"packageRules": [
|
"packageRules": [
|
||||||
{
|
{
|
||||||
"matchManagers": ["dockerfile", "kubernetes", "helmfile", "helm-values"],
|
"matchManagers": ["dockerfile", "kubernetes", "helmfile", "helm-values"],
|
||||||
|
|||||||
+4
-9
@@ -2,9 +2,7 @@
|
|||||||
|
|
||||||
A reusable Gitea Action that sets up the Trivy vulnerability database, restoring from cache if available.
|
A reusable Gitea Action that sets up the Trivy vulnerability database, restoring from cache if available.
|
||||||
|
|
||||||
The action runs Trivy inside **Docker** with a restricted container configuration so the Trivy runtime is isolated from the host while the database is downloaded into your cache directory.
|
**Note:** This action only sets up the database. Trivy itself must be installed separately (e.g., using the `setup-trivy` action).
|
||||||
|
|
||||||
**Note:** This action only prepares the vulnerability database. If you run Trivy on the runner host for scans (for example `trivy fs .`), install Trivy separately (e.g. with a `setup-trivy` action or your own step).
|
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
@@ -38,9 +36,6 @@ jobs:
|
|||||||
|
|
||||||
## Inputs
|
## Inputs
|
||||||
|
|
||||||
| Input | Description | Required | Default |
|
| Input | Description | Required | Default |
|
||||||
| ---------------- | --------------------------------------------------------------------------- | -------- | ------- |
|
| ----------- | --------------------------------- | -------- | ---------------- |
|
||||||
| `cache-dir` | Path to the Trivy cache directory | No | `${{ runner.temp }}/trivy` |
|
| `cache-dir` | Path to the Trivy cache directory | No | `~/.cache/trivy` |
|
||||||
| `trivy-version` | Docker image reference for Trivy (digest pin recommended) | No | Pinned `ghcr.io/aquasecurity/trivy` image in `action.yaml` |
|
|
||||||
|
|
||||||
**`trivy-version` is optional.** If you omit it, the action uses the default image (version and digest) from `action.yaml`. Set it only when you need a different Trivy image or your own digest pin.
|
|
||||||
|
|||||||
+1
-22
@@ -10,10 +10,6 @@ inputs:
|
|||||||
description: "Path to the Trivy cache directory (default: ${{runner.temp}}/trivy)"
|
description: "Path to the Trivy cache directory (default: ${{runner.temp}}/trivy)"
|
||||||
required: false
|
required: false
|
||||||
default: "${{ runner.temp }}/trivy"
|
default: "${{ runner.temp }}/trivy"
|
||||||
trivy-version:
|
|
||||||
description: "Trivy docker image version to use (full image reference including digest is recommended)"
|
|
||||||
required: false
|
|
||||||
default: "ghcr.io/aquasecurity/trivy:0.69.3@sha256:bcc376de8d77cfe086a917230e818dc9f8528e3c852f7b1aff648949b6258d1c"
|
|
||||||
|
|
||||||
outputs:
|
outputs:
|
||||||
cache-dir:
|
cache-dir:
|
||||||
@@ -36,21 +32,4 @@ runs:
|
|||||||
trivy-db-${{ steps.current-date.outputs.current-date }}
|
trivy-db-${{ steps.current-date.outputs.current-date }}
|
||||||
- if: steps.restore-db.outputs.cache-hit != 'true'
|
- if: steps.restore-db.outputs.cache-hit != 'true'
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: trivy fs --download-db-only --cache-dir "${{ inputs.cache-dir }}"
|
||||||
docker run --rm \
|
|
||||||
--name trivy-db-download \
|
|
||||||
--user "$(id -u):$(id -g)" \
|
|
||||||
--read-only \
|
|
||||||
--env-file /dev/null \
|
|
||||||
--cap-drop ALL \
|
|
||||||
--pids-limit 64 \
|
|
||||||
--memory=512m \
|
|
||||||
--memory-swap=512m \
|
|
||||||
--cpus=1 \
|
|
||||||
--ipc private \
|
|
||||||
--cgroupns private \
|
|
||||||
--security-opt no-new-privileges \
|
|
||||||
--security-opt apparmor=docker-default \
|
|
||||||
--tmpfs /tmp:rw,noexec,nosuid,nodev,size=1g \
|
|
||||||
--mount type=bind,src=${{ inputs.cache-dir }},dst=/cache \
|
|
||||||
${{ inputs.trivy-version }} fs --download-db-only --cache-dir /cache
|
|
||||||
|
|||||||
Reference in New Issue
Block a user