Skip to content

Audit

Audit #24

Workflow file for this run

name: Audit
on:
workflow_call:
schedule:
- cron: "0 13 * * 1" # Weekly Monday 21:00 Philippine Standard Time (UTC+8) (13:00 UTC)
permissions:
contents: read
jobs:
trivy:
name: Run Trivy Scan
runs-on: ubuntu-latest
timeout-minutes: 15
permissions:
contents: read
security-events: write
steps:
- name: Harden runner
uses: step-security/harden-runner@20cf305ff2072d973412fa9b1e3a4f227bda3c76 # v2.14.0
with:
egress-policy: audit
- name: Checkout
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- name: Run Trivy
id: trivy_scan
continue-on-error: true
uses: aquasecurity/trivy-action@b6643a29fecd7f34b3597bc6acb0a98b03d33ff8 # v0.33.1
with:
version: v0.66.0
scan-type: fs
scan-ref: .
trivy-config: trivy.yaml
format: sarif
output: trivy.sarif
cache: true
- name: Upload SARIF as artifact (PRs)
if: github.event_name == 'pull_request'
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
with:
name: trivy-sarif
path: trivy.sarif
- name: Fail if Trivy found issues
if: steps.trivy_scan.outcome == 'failure'
run: exit 1
osv:
name: Run OSV Scan
uses: google/osv-scanner-action/.github/workflows/osv-scanner-reusable-pr.yml@375a0e8ebdc98e99b02ac4338a724f5750f21213 # v2.3.1
permissions:
actions: read
security-events: write
contents: read
with:
scan-args: |-
--recursive
./
upload-sarif: true
gitleaks:
name: Run Gitleaks Scan
runs-on: ubuntu-latest
timeout-minutes: 10
permissions:
contents: read
pull-requests: read
steps:
- name: Harden runner
uses: step-security/harden-runner@20cf305ff2072d973412fa9b1e3a4f227bda3c76 # v2.14.0
with:
egress-policy: audit
- name: Checkout
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
fetch-depth: 0
- name: Scan repository for secrets
uses: gitleaks/gitleaks-action@ff98106e4c7b2bc287b24eaf42907196329070c7 # v2.3.9
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}