Skip to content

feat: cross-platform CI matrix, sandbox hardening, and operator tooling #140

feat: cross-platform CI matrix, sandbox hardening, and operator tooling

feat: cross-platform CI matrix, sandbox hardening, and operator tooling #140

name: Security Posture
on:
push:
branches: [main, develop]
pull_request:
branches: [main, develop]
workflow_dispatch:
schedule:
- cron: '0 5 * * 1'
permissions:
contents: read
security-events: write
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
defaults:
run:
shell: bash
jobs:
trufflehog:
name: TruffleHog secret scan
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0
- name: TruffleHog scan
uses: trufflesecurity/trufflehog@c3e599b7163e8198a55467f3133db0e7b2a492cb # v3.93.7
with:
extra_args: --only-verified
semgrep:
name: Semgrep security scan
runs-on: ubuntu-24.04
continue-on-error: true
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Install Semgrep
run: |
set -euo pipefail
python3 -m pip install --disable-pip-version-check semgrep==1.114.0
- name: Run Semgrep
run: |
set -euo pipefail
semgrep scan --config p/ci --sarif --output semgrep.sarif .
- name: Upload Semgrep SARIF
if: always()
uses: github/codeql-action/upload-sarif@a65a038433a26f4363cf9f029e3b9ceac831ad5d # v3.28.10
with:
sarif_file: semgrep.sarif
category: semgrep
- name: Upload Semgrep artifact
if: always()
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.1
with:
name: semgrep-report
path: semgrep.sarif
if-no-files-found: ignore
scorecard:
name: OpenSSF Scorecard
runs-on: ubuntu-24.04
continue-on-error: true
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false
- name: Install Scorecard CLI
run: |
set -euo pipefail
sudo apt-get update
sudo apt-get install -y golang-go
mkdir -p "${HOME}/.local/bin"
GOBIN="${HOME}/.local/bin" go install github.com/ossf/scorecard/v5/cmd/scorecard@latest
echo "${HOME}/.local/bin" >> "${GITHUB_PATH}"
- name: Run Scorecard
env:
GITHUB_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
set -euo pipefail
scorecard --repo="github.com/${{ github.repository }}" --format json --show-details > scorecard.json
- name: Upload Scorecard artifact
if: always()
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.1
with:
name: scorecard-report
path: scorecard.json
if-no-files-found: ignore
workflow-policy:
name: Workflow policy checks
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Install policy checker dependencies
run: |
set -euo pipefail
python3 -m pip install --disable-pip-version-check pyyaml==6.0.2
- name: Enforce workflow policy
run: |
set -euo pipefail
python3 .github/scripts/check-workflow-policy.py