Files
HashTool/.gitea/workflows/security.yml
T
poli0981andClaude Opus 5.5 0e1a0f2fd4
CI / build-test (ubuntu-latest) (pull_request) Successful in 1m35s
CI / build-test (windows-latest) (pull_request) Successful in 1m31s
CI / format (pull_request) Successful in 1m4s
Reusable / Qodana / Qodana (pull_request) Successful in 2m40s
Qodana / qodana (pull_request) Successful in 2m40s
Release / prepare (pull_request) Successful in 8s
Security / vulnerable-packages (pull_request) Successful in 1m7s
Reusable / Security / Rust (cargo-deny) (pull_request) Skipped
Security / licenses (pull_request) Successful in 1m27s
Security / workflow-lint (pull_request) Successful in 27s
Reusable / Security / Secrets (gitleaks) (pull_request) Successful in 11s
Reusable / Security / SAST (Opengrep) (pull_request) Successful in 23s
Reusable / Security / Dependencies (osv-scanner) (pull_request) Successful in 15s
Reusable / Security / .NET (NuGetAudit) (pull_request) Successful in 54s
Security / scan (pull_request) Successful in 1m45s
CI / ci-ok (pull_request) Successful in 2s
Release / app (linux) (pull_request) Successful in 6m16s
Release / app (win) (pull_request) Successful in 5m59s
Release / cli (linux-x64) (pull_request) Successful in 1m24s
Release / cli (win-x64) (pull_request) Successful in 1m4s
Release / check (pull_request) Successful in 34s
Release / publish (versioned files, linux) (pull_request) Skipped
Release / publish (win) (pull_request) Skipped
Release / Gitea release (notes + links) (pull_request) Skipped
Release / announce (pull_request) Skipped
CI / build-test (ubuntu-latest) (push) Successful in 4m30s
CI / build-test (windows-latest) (push) Successful in 1m27s
CI / format (push) Successful in 58s
Reusable / Qodana / Qodana (push) Successful in 2m41s
Qodana / qodana (push) Successful in 2m41s
Security / vulnerable-packages (push) Successful in 1m9s
Reusable / Security / Rust (cargo-deny) (push) Skipped
Security / licenses (push) Successful in 1m17s
Security / workflow-lint (push) Successful in 27s
Reusable / Security / Secrets (gitleaks) (push) Successful in 12s
Reusable / Security / SAST (Opengrep) (push) Successful in 26s
Reusable / Security / Dependencies (osv-scanner) (push) Successful in 14s
Reusable / Security / .NET (NuGetAudit) (push) Successful in 58s
Security / scan (push) Successful in 1m50s
CI / ci-ok (push) Successful in 2s
ci: ops workflows at v2026.11.5
The ops repository's v2026.11.5 names the Velopack apps released from Gitea in
the release-pipeline notifier and restores .NET without ICU in the shared
security scan, so the NuGetAudit job goes back to the default ubuntu-latest
runner instead of the maintainer's PC. Every ops call and its ops_ref move to
the tag's commit (b93b371).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-26 12:55:11 +07:00

166 lines
7.0 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
name: Security
# Gitea has no CodeQL, no dependency review and no code-scanning UI (ops runbook §1, migration decision D7). This
# workflow covers instead:
#
# vulnerable-packages NuGet packages with known advisories, transitive ones included (fails on any severity)
# licenses licences of the shipped projects' packages against eng/allowed-licenses.json
# workflow-lint zizmor, actionlint and shellcheck on .gitea/workflows/*.yml
# scan the ops repo's security.yml: gitleaks over the full history, Opengrep (C# and Python rules;
# report only, SARIF as an artifact), osv-scanner (lockfiles; this repo has none) and a
# NuGetAudit restore that fails on high/critical advisories
#
# Weekly as well, so a new advisory against unchanged dependencies turns it red: Monday 13:43 UTC = 20:43 Vietnam
# (this repo's slot in the ops repo's cron registry; the runner is the maintainer's PC and only runs 13:00–16:00 UTC).
on:
push:
branches: [main]
pull_request:
branches: [main]
schedule:
- cron: "43 13 * * 1"
workflow_dispatch:
permissions:
contents: read
concurrency:
group: security-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
env:
DOTNET_NOLOGO: true
DOTNET_CLI_TELEMETRY_OPTOUT: true
AVALONIA_TELEMETRY_OPTOUT: 1
jobs:
# `dotnet package list --vulnerable` always exits 0, so the JSON report is checked explicitly.
vulnerable-packages:
name: vulnerable-packages
runs-on: ubuntu-latest
timeout-minutes: 15
permissions:
contents: read
env:
# The runner's Ubuntu image has no ICU; restoring and listing packages need no cultures.
DOTNET_SYSTEM_GLOBALIZATION_INVARIANT: 1
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: actions/setup-dotnet@0f4a354dd5547a28c70b7853dbd95d5b67886e73 # v6.1.0
with:
global-json-file: global.json
- name: Restore
run: dotnet restore HashTool.slnx
- name: List vulnerable packages
run: |
dotnet package list --project HashTool.slnx --vulnerable --include-transitive --format json > vulnerable.json
jq -r '.projects[]? | .path as $p | .frameworks[]? | (.topLevelPackages[]?, .transitivePackages[]?)
| select((.vulnerabilities // []) | length > 0)
| "\($p): \(.id) \(.resolvedVersion) - \([.vulnerabilities[].severity] | join(", ")) \([.vulnerabilities[].advisoryurl] | join(" "))"' vulnerable.json \
| sort -u | tee vulnerable.txt
if [ -s vulnerable.txt ]; then
echo "::error::Vulnerable NuGet packages found (see above)."
exit 1
fi
echo "No known vulnerable packages."
# Only shipped projects are checked; test and benchmark tools are not redistributed.
licenses:
name: licenses
runs-on: ubuntu-latest
timeout-minutes: 15
permissions:
contents: read
env:
# The runner's Ubuntu image has no ICU; restoring and listing packages need no cultures.
DOTNET_SYSTEM_GLOBALIZATION_INVARIANT: 1
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: actions/setup-dotnet@0f4a354dd5547a28c70b7853dbd95d5b67886e73 # v6.1.0
with:
global-json-file: global.json
- name: Restore
run: |
dotnet tool restore
dotnet restore HashTool.slnx
- name: Check licenses
run: >-
dotnet nuget-license -ji eng/license-inputs.json -t
-a eng/allowed-licenses.json -o Markdown
# The linters without Docker: actionlint and shellcheck as release binaries at pinned versions, SHA-256 verified (the
# pins of the ops repo's ops-lint.yml), zizmor from the hash-locked .github/requirements-ci.txt. Renovate does not
# update the binaries: bump version and checksum together, by hand.
workflow-lint:
name: workflow-lint
runs-on: ubuntu-latest
timeout-minutes: 10
permissions:
contents: read
env:
ACTIONLINT_VERSION: 1.7.12
ACTIONLINT_SHA256: 8aca8db96f1b94770f1b0d72b6dddcb1ebb8123cb3712530b08cc387b349a3d8 # actionlint_1.7.12_linux_amd64.tar.gz
SHELLCHECK_VERSION: v0.11.0
SHELLCHECK_SHA256: 8c3be12b05d5c177a04c29e3c78ce89ac86f1595681cab149b65b97c4e227198 # shellcheck-v0.11.0.linux.x86_64.tar.xz
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0
with:
python-version: "3.12"
- name: Install zizmor
run: |
python -m pip install --quiet --require-hashes --only-binary :all: -r .github/requirements-ci.txt
# The files by name: zizmor only looks for .github/workflows by itself. Offline: its online audits ask GitHub's
# API about the actions, with a token this runner does not have. Any finding at medium or above fails.
- name: zizmor (workflow security audit)
run: zizmor --offline --min-severity medium --config .github/zizmor.yml .gitea/workflows/*.yml
- name: Install actionlint ${{ env.ACTIONLINT_VERSION }} + shellcheck ${{ env.SHELLCHECK_VERSION }}
run: |
set -euo pipefail
tmp="${RUNNER_TEMP:-/tmp}"
bin="$tmp/lint-bin"
mkdir -p "$bin"
curl -fsSL --retry 3 -o "$tmp/actionlint.tar.gz" \
"https://github.com/rhysd/actionlint/releases/download/v${ACTIONLINT_VERSION}/actionlint_${ACTIONLINT_VERSION}_linux_amd64.tar.gz"
echo "${ACTIONLINT_SHA256} $tmp/actionlint.tar.gz" | sha256sum -c -
tar -xzf "$tmp/actionlint.tar.gz" -C "$bin" actionlint
curl -fsSL --retry 3 -o "$tmp/shellcheck.tar.xz" \
"https://github.com/koalaman/shellcheck/releases/download/${SHELLCHECK_VERSION}/shellcheck-${SHELLCHECK_VERSION}.linux.x86_64.tar.xz"
echo "${SHELLCHECK_SHA256} $tmp/shellcheck.tar.xz" | sha256sum -c -
tar -xJf "$tmp/shellcheck.tar.xz" -C "$bin" --strip-components=1 "shellcheck-${SHELLCHECK_VERSION}/shellcheck"
echo "$bin" >> "$GITHUB_PATH"
# .github/actionlint.yaml ignores only the Gitea features actionlint does not know; everything else is an error.
- name: actionlint (workflow syntax and expressions)
run: |
actionlint -version
actionlint -color -config-file .github/actionlint.yaml \
-shellcheck "$(command -v shellcheck)" .gitea/workflows/*.yml
scan:
permissions:
contents: read
uses: poli0981/.github/.gitea/workflows/security.yml@b93b3711b3049a879cfdfd515f7e72c23864da8f # ops v2026.11.5
with:
dotnet: true
dotnet-solution: HashTool.slnx
# eng/*.py: localisation, release notes, release and coverage checks.
python: true