mirror of
https://github.com/pewdiepie-archdaemon/odysseus.git
synced 2026-06-16 09:45:24 -04:00
93825a505c
* ci: add security scanning suite and governance
Consolidates the security CI work into one reviewable change. Adds, as
separate workflow files under .github/workflows/:
- secret-scan.yml gitleaks (pinned + checksum-verified), full history
- workflow-security.yml actionlint + zizmor, audits the workflows themselves
- dependency-review.yml PR dependency gate + advisory pip-audit
- container-scan.yml hadolint (blocking) + Trivy image scan (advisory)
- codeql.yml CodeQL for Python and JS, main + weekly
Plus .github/dependabot.yml (pip/npm/actions/docker), .github/CODEOWNERS,
and docs/security-ci.md explaining each check and the one-time settings.
All additive: no existing files are modified. Actions are pinned to commit
SHAs, tokens default-deny (permissions: {}), advisory scans never block,
and SARIF upload is gated to push so fork PRs do not fail on a read-only
token. Composes with the correctness CI in #1015.
* ci(security): isolate Trivy from the Dockerfile lint gate
Address review on #1314 (points 2 and 3).
container-scan.yml now runs only hadolint (the blocking Dockerfile lint)
and keeps the broad pull_request + push:[main] trigger so the required
check always reports and never hangs a PR.
The advisory image scan moves to container-trivy.yml, split by event:
- pull_request / workflow_dispatch: build and scan under contents:read
only, no SARIF upload. The image build runs PR-supplied Dockerfile
instructions, so this path holds no write scope.
- push to main: build, scan, and upload SARIF with security-events:write.
Only this trusted path is granted write.
This stops PR jobs from requesting security-events:write they never use,
and a paths-ignore (matching docker-publish.yml) skips the image rebuild
on docs-only changes.
docs/security-ci.md: correct the trigger description to "every pull
request and every push to main", matching the workflows and the existing
ci.yml convention.
Verified locally: zizmor --offline --min-severity=low and actionlint are
clean on the changed and new workflow files.
---------
Co-authored-by: Alexandre Teixeira <111787685+alteixeira20@users.noreply.github.com>
72 lines
2.3 KiB
YAML
72 lines
2.3 KiB
YAML
# Supply-chain review
|
|
#
|
|
# Purpose: defend against "side-chain" / supply-chain attacks -- a pull request
|
|
# that adds (or bumps) a dependency to a version with a known vulnerability or a
|
|
# disallowed license. Two layers:
|
|
#
|
|
# - dependency-review: runs ONLY on pull requests. It compares the
|
|
# dependencies before and after the PR and blocks the merge if the change
|
|
# pulls in a package with a known security advisory. This is the gate.
|
|
# - pip-audit: scans the project's current Python requirements against the
|
|
# advisory database. Advisory only (it never blocks a merge), because it can
|
|
# flag a pre-existing issue in an already-shipped dependency.
|
|
|
|
name: Dependency review
|
|
|
|
on:
|
|
pull_request:
|
|
push:
|
|
branches: [main]
|
|
workflow_dispatch:
|
|
|
|
# Default-deny token; jobs grant only read access.
|
|
permissions: {}
|
|
|
|
concurrency:
|
|
group: dependency-review-${{ github.workflow }}-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
dependency-review:
|
|
name: dependency-review (PR gate)
|
|
# Only meaningful on a pull request -- it needs a base..head diff to review.
|
|
if: github.event_name == 'pull_request'
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: read
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
with:
|
|
persist-credentials: false
|
|
|
|
- name: Review dependency changes
|
|
uses: actions/dependency-review-action@a1d282b36b6f3519aa1f3fc636f609c47dddb294 # v5.0.0
|
|
with:
|
|
# Fail the PR on any newly introduced moderate-or-worse advisory.
|
|
fail-on-severity: moderate
|
|
|
|
pip-audit:
|
|
name: pip-audit (advisory)
|
|
runs-on: ubuntu-latest
|
|
# Advisory: report known-vulnerable Python deps without blocking the merge.
|
|
continue-on-error: true
|
|
permissions:
|
|
contents: read
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
with:
|
|
persist-credentials: false
|
|
|
|
- name: Set up Python
|
|
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
|
|
with:
|
|
python-version: '3.12'
|
|
|
|
- name: Run pip-audit on requirements
|
|
run: |
|
|
set -euo pipefail
|
|
pip install pip-audit==2.10.0
|
|
pip-audit -r requirements.txt -r requirements-optional.txt --strict
|