Skip to content

Security Scans

Security Scans #1

Workflow file for this run

name: Security Scans
"on":
workflow_call:
inputs:
checkout_ref:
description: "Git ref to scan"
required: true
type: string
workflow_dispatch:
inputs:
checkout_ref:
description: "Git ref to scan"
required: true
type: string
permissions:
contents: read
security-events: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
scans:
name: Run Security Scans
runs-on: ubuntu-latest
timeout-minutes: 35
steps:
- name: Checkout workflow helpers
uses: actions/checkout@v6
- name: Checkout release source
uses: actions/checkout@v6
with:
ref: ${{ inputs.checkout_ref }}
path: release-src
- name: Set up Go
uses: actions/setup-go@v6
with:
go-version-file: release-src/go.mod
cache-dependency-path: release-src/go.sum
- name: Install scanner prerequisites
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends ca-certificates curl
sudo curl -fsSL "https://dl.k8s.io/release/v1.32.2/bin/linux/amd64/kubectl" -o /usr/local/bin/kubectl
sudo chmod +x /usr/local/bin/kubectl
- name: Install osv-scanner
run: |
mkdir -p "${RUNNER_TEMP:-/tmp}/bin"
GOBIN="${RUNNER_TEMP:-/tmp}/bin" go install github.com/google/osv-scanner/v2/cmd/osv-scanner@v2.3.5
echo "${RUNNER_TEMP:-/tmp}/bin" >>"${GITHUB_PATH}"
- name: Install grype
run: |
mkdir -p "${RUNNER_TEMP:-/tmp}/bin"
curl -fsSL https://raw.githubusercontent.com/anchore/grype/main/install.sh \
| sh -s -- -b "${RUNNER_TEMP:-/tmp}/bin" v0.104.4
echo "${RUNNER_TEMP:-/tmp}/bin" >>"${GITHUB_PATH}"
- name: Install kubescape
run: |
mkdir -p "${RUNNER_TEMP:-/tmp}/bin"
curl -fsSL \
-o "${RUNNER_TEMP:-/tmp}/bin/kubescape" \
https://github.com/kubescape/kubescape/releases/download/v4.0.3/kubescape_4.0.3_linux_amd64
chmod +x "${RUNNER_TEMP:-/tmp}/bin/kubescape"
echo "${RUNNER_TEMP:-/tmp}/bin" >>"${GITHUB_PATH}"
- name: Run security scan bundle
run: SCAN_ROOT=release-src scripts/ci/run-security-scans.sh
- name: Upload security scan artifacts
if: always()
uses: actions/upload-artifact@v7
with:
name: security-scans
path: tmp/security-scans/latest/
if-no-files-found: warn