8 Commits

Author SHA1 Message Date
276e99b893 sync 2026-03-25 18:54:57 +01:00
bdbbf62d54 chore(deps): update https://gitea.t000-n.de/t.behrendt/actions action to v0.2.1 (#9)
All checks were successful
CD / Release (push) Successful in 57s
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [https://gitea.t000-n.de/t.behrendt/actions](https://gitea.t000-n.de/t.behrendt/actions) | action | minor | `0.1.5` → `0.2.1` |

---

### Release Notes

<details>
<summary>t.behrendt/actions (https://gitea.t000-n.de/t.behrendt/actions)</summary>

### [`v0.2.1`](https://gitea.t000-n.de/t.behrendt/actions/compare/0.2.0...0.2.1)

[Compare Source](https://gitea.t000-n.de/t.behrendt/actions/compare/0.2.0...0.2.1)

### [`v0.2.0`](https://gitea.t000-n.de/t.behrendt/actions/compare/0.1.7...0.2.0)

[Compare Source](https://gitea.t000-n.de/t.behrendt/actions/compare/0.1.7...0.2.0)

### [`v0.1.7`](https://gitea.t000-n.de/t.behrendt/actions/compare/0.1.6...0.1.7)

[Compare Source](https://gitea.t000-n.de/t.behrendt/actions/compare/0.1.6...0.1.7)

### [`v0.1.6`](https://gitea.t000-n.de/t.behrendt/actions/compare/0.1.5...0.1.6)

[Compare Source](https://gitea.t000-n.de/t.behrendt/actions/compare/0.1.5...0.1.6)

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My41LjQiLCJ1cGRhdGVkSW5WZXIiOiI0My41LjQiLCJ0YXJnZXRCcmFuY2giOiJtYWluIiwibGFiZWxzIjpbImFjdGlvbiIsImRlcHMiXX0=-->

Reviewed-on: t.behrendt/trivy-workflows#9
Reviewed-by: t.behrendt <t.behrendt@noreply.localhost>
Co-authored-by: Renovate Bot <renovate@t00n.de>
Co-committed-by: Renovate Bot <renovate@t00n.de>
2026-03-15 21:52:55 +01:00
755e1d877b chore(deps): update https://gitea.t000-n.de/t.behrendt/trivy-actions action to v1.4.7 (#10)
Some checks failed
CD / Release (push) Has been cancelled
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [https://gitea.t000-n.de/t.behrendt/trivy-actions](https://gitea.t000-n.de/t.behrendt/trivy-actions) | action | patch | `1.4.5` → `1.4.7` |

---

### Release Notes

<details>
<summary>t.behrendt/trivy-actions (https://gitea.t000-n.de/t.behrendt/trivy-actions)</summary>

### [`v1.4.7`](https://gitea.t000-n.de/t.behrendt/trivy-actions/compare/1.4.6...1.4.7)

[Compare Source](https://gitea.t000-n.de/t.behrendt/trivy-actions/compare/1.4.6...1.4.7)

### [`v1.4.6`](https://gitea.t000-n.de/t.behrendt/trivy-actions/compare/1.4.5...1.4.6)

[Compare Source](https://gitea.t000-n.de/t.behrendt/trivy-actions/compare/1.4.5...1.4.6)

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My41LjQiLCJ1cGRhdGVkSW5WZXIiOiI0My41LjQiLCJ0YXJnZXRCcmFuY2giOiJtYWluIiwibGFiZWxzIjpbImFjdGlvbiIsImRlcHMiXX0=-->

Reviewed-on: t.behrendt/trivy-workflows#10
Reviewed-by: t.behrendt <t.behrendt@noreply.localhost>
Co-authored-by: Renovate Bot <renovate@t00n.de>
Co-committed-by: Renovate Bot <renovate@t00n.de>
2026-03-15 21:52:47 +01:00
21d6d0a0d4 chore(deps): update https://gitea.t000-n.de/t.behrendt/actions action to v0.1.5 (#6)
All checks were successful
CD / Release (push) Successful in 6s
This PR contains the following updates:

| Package | Type | Update | Change | Pending |
|---|---|---|---|---|
| [https://gitea.t000-n.de/t.behrendt/actions](https://gitea.t000-n.de/t.behrendt/actions) | action | patch | `0.1.4` → `0.1.5` | `0.2.1` (+3) |

---

### Release Notes

<details>
<summary>t.behrendt/actions (https://gitea.t000-n.de/t.behrendt/actions)</summary>

### [`v0.1.5`](https://gitea.t000-n.de/t.behrendt/actions/compare/0.1.4...0.1.5)

[Compare Source](https://gitea.t000-n.de/t.behrendt/actions/compare/0.1.4...0.1.5)

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My41LjQiLCJ1cGRhdGVkSW5WZXIiOiI0My41LjQiLCJ0YXJnZXRCcmFuY2giOiJtYWluIiwibGFiZWxzIjpbImFjdGlvbiIsImRlcHMiXX0=-->

Reviewed-on: t.behrendt/trivy-workflows#6
Reviewed-by: t.behrendt <t.behrendt@noreply.localhost>
Co-authored-by: Renovate Bot <renovate@t00n.de>
Co-committed-by: Renovate Bot <renovate@t00n.de>
2026-02-27 19:07:41 +01:00
a1df1e3972 chore(deps): update https://gitea.t000-n.de/t.behrendt/conventional-semantic-git-tag-increment action to v0.1.29 (#7)
All checks were successful
CD / Release (push) Successful in 2m42s
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [https://gitea.t000-n.de/t.behrendt/conventional-semantic-git-tag-increment](https://gitea.t000-n.de/t.behrendt/conventional-semantic-git-tag-increment) | action | patch | `0.1.28` → `0.1.29` |

---

### Release Notes

<details>
<summary>t.behrendt/conventional-semantic-git-tag-increment (https://gitea.t000-n.de/t.behrendt/conventional-semantic-git-tag-increment)</summary>

### [`v0.1.29`](https://gitea.t000-n.de/t.behrendt/conventional-semantic-git-tag-increment/compare/0.1.28...0.1.29)

[Compare Source](https://gitea.t000-n.de/t.behrendt/conventional-semantic-git-tag-increment/compare/0.1.28...0.1.29)

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My41LjQiLCJ1cGRhdGVkSW5WZXIiOiI0My41LjQiLCJ0YXJnZXRCcmFuY2giOiJtYWluIiwibGFiZWxzIjpbImFjdGlvbiIsImRlcHMiXX0=-->

Reviewed-on: t.behrendt/trivy-workflows#7
Reviewed-by: t.behrendt <t.behrendt@noreply.localhost>
Co-authored-by: Renovate Bot <renovate@t00n.de>
Co-committed-by: Renovate Bot <renovate@t00n.de>
2026-02-27 19:03:54 +01:00
96f653553f feat: add fs scan (#3)
All checks were successful
CD / Release (push) Successful in 21s
Reviewed-on: t.behrendt/trivy-workflows#3
Co-authored-by: Timo Behrendt <t.behrendt@t00n.de>
Co-committed-by: Timo Behrendt <t.behrendt@t00n.de>
2026-02-26 22:06:28 +01:00
18b347368a chore: bump trivy-actions (#4)
All checks were successful
CD / Release (push) Successful in 5s
Reviewed-on: t.behrendt/trivy-workflows#4
Co-authored-by: Timo Behrendt <t.behrendt@t00n.de>
Co-committed-by: Timo Behrendt <t.behrendt@t00n.de>
2026-02-26 21:54:54 +01:00
4b9138d8f8 feat: add run-trivy-scan (#2)
All checks were successful
CD / Release (push) Successful in 22s
Reviewed-on: t.behrendt/trivy-workflows#2
Co-authored-by: Timo Behrendt <t.behrendt@t00n.de>
Co-committed-by: Timo Behrendt <t.behrendt@t00n.de>
2026-02-25 22:30:42 +01:00
4 changed files with 164 additions and 5 deletions

View File

@@ -15,10 +15,10 @@ jobs:
fetch-depth: 0 fetch-depth: 0
- name: Increment tag - name: Increment tag
id: tag id: tag
uses: https://gitea.t000-n.de/t.behrendt/conventional-semantic-git-tag-increment@8d27605e8e6b2990e92e5aa75d703e602b8c4b2a # 0.1.28 uses: https://gitea.t000-n.de/t.behrendt/conventional-semantic-git-tag-increment@41b7e04221df8a033bec841d40a097b76e5f67ff # 0.1.29
with: with:
token: ${{ secrets.GITEA_TOKEN }} token: ${{ secrets.GITEA_TOKEN }}
- name: Push tag - name: Push tag
uses: https://gitea.t000-n.de/t.behrendt/actions/release-git-tag@8973a9f9ff51c16b937364e0047e7ad07e937d3f # 0.1.4 uses: https://gitea.t000-n.de/t.behrendt/actions/release-git-tag@3925c92fc33f3d2bc87d28d21ab691b7e6dd6cdf # 0.2.1
with: with:
tag: ${{ steps.tag.outputs.new-tag }} tag: ${{ steps.tag.outputs.new-tag }}

View File

@@ -13,11 +13,11 @@ jobs:
fetch-depth: 0 fetch-depth: 0
- name: Increment tag - name: Increment tag
id: tag id: tag
uses: https://gitea.t000-n.de/t.behrendt/conventional-semantic-git-tag-increment@8d27605e8e6b2990e92e5aa75d703e602b8c4b2a # 0.1.28 uses: https://gitea.t000-n.de/t.behrendt/conventional-semantic-git-tag-increment@41b7e04221df8a033bec841d40a097b76e5f67ff # 0.1.29
with: with:
token: ${{ secrets.GITEA_TOKEN }} token: ${{ secrets.GITEA_TOKEN }}
prerelease: true prerelease: true
- name: Push tag - name: Push tag
uses: https://gitea.t000-n.de/t.behrendt/actions/release-git-tag@8973a9f9ff51c16b937364e0047e7ad07e937d3f # 0.1.4 uses: https://gitea.t000-n.de/t.behrendt/actions/release-git-tag@3925c92fc33f3d2bc87d28d21ab691b7e6dd6cdf # 0.2.1
with: with:
tag: ${{ steps.tag.outputs.new-tag }} tag: ${{ steps.tag.outputs.new-tag }}

View File

@@ -0,0 +1,75 @@
name: Run Sec Scan
on:
workflow_call:
inputs:
ecosystems:
description: "Comma-separated ecosystems for setup-osv-db (see sec-actions/setup-osv-db)."
required: false
type: string
default: "github-actions,npm,go,docker"
cache-bucket-hours:
description: "Cache key time bucket (hours) for setup-osv-db."
required: false
type: number
default: 24
osv-scanner-image:
description: "Container image for OSV-Scanner (run with hardened docker options)."
required: false
type: string
default: "ghcr.io/google/osv-scanner:latest"
outputs:
merged-sarif-artifact:
description: "Artifact name containing the SARIF file (download this artifact; file inside is merged-sarif.json)."
value: ${{ jobs.osv-scan.outputs.merged-sarif-artifact }}
merged-sarif-path:
description: "Path to the SARIF file inside the artifact (merged-sarif.json)."
value: ${{ jobs.osv-scan.outputs.merged-sarif-path }}
jobs:
osv-scan:
runs-on: ubuntu-latest
outputs:
merged-sarif-artifact: ${{ steps.meta.outputs.merged-sarif-artifact }}
merged-sarif-path: ${{ steps.meta.outputs.merged-sarif-path }}
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Setup offline OSV DB
id: setup-db
uses: https://gitea.t000-n.de/t.behrendt/sec-actions/setup-osv-db@main
with:
ecosystems: ${{ inputs.ecosystems }}
cache-bucket-hours: ${{ inputs.cache-bucket-hours }}
- name: Run OSV-Scanner in Docker (offline, no network, read-only)
id: scan
run: |
set -euo pipefail
SARIF_HOST_DIR="${RUNNER_TEMP}/osv-sarif-out"
mkdir -p "${SARIF_HOST_DIR}"
CACHE="${{ steps.setup-db.outputs.cache-dir }}"
IMAGE="${{ inputs.osv-scanner-image }}"
docker run --rm \
--network none \
--read-only \
--tmpfs /tmp:rw,noexec,nosuid,size=256m \
--cap-drop ALL \
--security-opt no-new-privileges \
-v "${GITHUB_WORKSPACE}:/work:ro" \
-v "${CACHE}:/osv-db:ro" \
-v "${SARIF_HOST_DIR}:/out" \
-e OSV_SCANNER_LOCAL_DB_CACHE_DIRECTORY=/osv-db \
"${IMAGE}" \
scan source --offline-vulnerabilities --format sarif --output /out/merged-sarif.json -r /work
- name: Artifact metadata
id: meta
run: |
echo "merged-sarif-artifact=merged-sarif" >> "$GITHUB_OUTPUT"
echo "merged-sarif-path=merged-sarif.json" >> "$GITHUB_OUTPUT"
- uses: https://github.com/ChristopherHX/gitea-upload-artifact@v4
with:
name: merged-sarif
path: ${{ runner.temp }}/osv-sarif-out/merged-sarif.json

View File

@@ -1,2 +1,86 @@
# trivy-workflows # Sec Workflows
## Run Sec Scan (reusable workflow)
Reusable workflow that restores the [OSV-Scanner](https://google.github.io/osv-scanner/) offline vulnerability database via **`setup-osv-db`**, runs **`osv-scanner scan source`** with **`--offline-vulnerabilities`**, and publishes a single SARIF artifact. It does **not** upload to TAS; callers download the artifact and use it (e.g. with `tas-upload-sarif`).
Scanning uses [Google OSV](https://osv.dev/) data (not Trivy). The scanner runs **only** inside Docker with **no container network**, a **read-only** root filesystem (plus a small **`tmpfs`** for `/tmp`), **all capabilities dropped**, and **`no-new-privileges`**. The workspace and the local OSV DB are bind-mounted **read-only**; SARIF is written to a dedicated host directory mounted read-write at `/out` in the container.
**Workflow file:** [.gitea/workflows/run-sec-scan.yaml](.gitea/workflows/run-sec-scan.yaml)
### Offline DB (`setup-osv-db`)
The workflow uses the **`setup-osv-db`** action from the **`sec-actions`** repository (replacing the former `trivy-actions` / `setup-trivy` flow). That action prepares `OSV_SCANNER_LOCAL_DB_CACHE_DIRECTORY` for use with `--offline-vulnerabilities` (see [OSV-Scanner offline mode](https://google.github.io/osv-scanner/usage/offline-mode/)).
## Usage
### Call from another workflow (same repo)
```yaml
jobs:
sec:
uses: ./.gitea/workflows/run-sec-scan.yaml
with:
ecosystems: PyPI,npm,Go
cache-bucket-hours: 6
use-sarif:
needs: sec
runs-on: ubuntu-latest
steps:
- name: Download SARIF
uses: https://github.com/ChristopherHX/gitea-download-artifact@v4
with:
name: ${{ needs.sec.outputs.merged-sarif-artifact }}
path: sarif
# Path to file: sarif/${{ needs.sec.outputs.merged-sarif-path }}
# - uses: .../tas-upload-sarif@...
# with:
# sarif-file: sarif/${{ needs.sec.outputs.merged-sarif-path }}
```
### Call from another repository
Use the **full workflow path** including `.gitea/workflows/` and the filename. Gitea does not accept a bare repo path like `.../sec-actions/run-sec-scan@ref`.
**With absolute URL:**
```yaml
jobs:
sec:
uses: https://gitea.t000-n.de/t.behrendt/sec-workflows/.gitea/workflows/run-sec-scan.yaml@1.0.0
with:
ecosystems: github-actions,npm,go,Alpine
```
**With owner/repo path** (same server as the caller):
```yaml
jobs:
sec:
uses: t.behrendt/sec-workflows/.gitea/workflows/run-sec-scan.yaml@1.0.0
with:
ecosystems: github-actions,npm,go,docker
```
Pin the same tag or commit in `uses:` that you intend to run. Reusable actions referenced **inside** this workflow (for example `sec-actions/setup-osv-db`) are pinned in the workflow file; update that repo reference when you release new **sec-actions** versions.
### Inputs
| Input | Type | Default | Description |
| --------------------- | ------ | ----------------------------------- | --------------------------------------------------------------------------- |
| `ecosystems` | string | `github-actions,npm,go,docker` | Passed to **`setup-osv-db`** (`docker` maps to **Linux** in that action). |
| `cache-bucket-hours` | number | `24` | Passed to **`setup-osv-db`** for `actions/cache` key bucketing. |
| `osv-scanner-image` | string | `ghcr.io/google/osv-scanner:latest` | Image for the hardened **`docker run`** (offline scan; no network in run). Pin a digest or tag for reproducibility. |
### Outputs
| Output | Description |
| ----------------------- | ------------------------------------------------------------------- |
| `merged-sarif-artifact` | Artifact name to pass to `download-artifact` (e.g. `merged-sarif`). |
| `merged-sarif-path` | Path to the file inside that artifact (e.g. `merged-sarif.json`). |
After downloading the artifact, the SARIF file is at `<download-path>/${{ needs.<job>.outputs.merged-sarif-path }}`.
## Migration from Trivy
Earlier revisions used **Trivy** (`setup-trivy`, `setup-db` from **trivy-actions**) for config, filesystem, and image scans. This workflow now targets **OSV-Scanner** source scans with an **offline OSV database** only. Replacing IaC or container-image vulnerability semantics may require additional tooling outside this repository.