Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .clusterfuzzlite/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,8 @@
# Only meant to run inside ClusterFuzzLite or OSS-Fuzz, which provide
# compile_native_go_fuzzer_v2.

compile_native_go_fuzzer_v2 github.com/urunc-dev/urunc/pkg/unikontainers FuzzGetUnikernelConfig FuzzGetUnikernelConfig
fuzzer=FuzzGetUnikernelConfig
compile_native_go_fuzzer_v2 github.com/urunc-dev/urunc/pkg/unikontainers "$fuzzer" "$fuzzer"

# compile_native_go_fuzzer_v2 exits 0 when it cannot find the function.
test -x "$OUT/$fuzzer"
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Keep .git: needed by git describe for version embedding.
# COMMIT is also passed as a build-arg from CI to avoid a -dirty suffix.
*
!/.clusterfuzzlite
!/.git
!/cmd
!/deployment
Expand Down
5 changes: 5 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ updates:
- "minor"
- "patch"

- package-ecosystem: "docker"
directory: "/.clusterfuzzlite"
schedule:
interval: "weekly"

- package-ecosystem: "github-actions"
directory: "/"
schedule:
Expand Down
85 changes: 85 additions & 0 deletions .github/workflows/fuzz_batch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
name: urunc fuzzing (batch)

on:
workflow_dispatch:
schedule:
- cron: '0 0 * * *'

permissions:
contents: read

# Shared with fuzz_prune.yml. Both download the corpus, change it and upload
# it again, so overlapping runs would overwrite each other's corpus.
concurrency:
group: clusterfuzzlite-corpus
cancel-in-progress: false

jobs:
fuzz:
name: ClusterFuzzLite batch fuzzing
runs-on: ubuntu-24.04
timeout-minutes: 60
# The ClusterFuzzLite actions run mutable :v1 images, so this job only
# gets read access. The upload-sarif job uploads the results.
permissions:
contents: read
actions: read
outputs:
build: ${{ steps.build.outcome }}
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@351661ca32ac09a36dc5ee2d536e3128f2a3c8ed # v2.22.0
with:
egress-policy: audit

- name: Build fuzz targets
id: build
uses: google/clusterfuzzlite/actions/build_fuzzers@884713a6c30a92e5e8544c39945cd7cb630abcd1 # v1
with:
language: go

- name: Run fuzz targets
uses: google/clusterfuzzlite/actions/run_fuzzers@884713a6c30a92e5e8544c39945cd7cb630abcd1 # v1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
language: go
mode: batch
fuzz-seconds: 1800
output-sarif: true

- name: Save SARIF results
if: always() && steps.build.outcome == 'success'
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: fuzz-sarif
path: cifuzz-sarif/results.sarif
if-no-files-found: error
retention-days: 7

upload-sarif:
name: Upload SARIF
needs: fuzz
# Also after a crash, which fails the fuzz job.
if: always() && needs.fuzz.outputs.build == 'success'
runs-on: ubuntu-24.04
permissions:
contents: read
# for github/codeql-action/upload-sarif to upload SARIF results
security-events: write
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@351661ca32ac09a36dc5ee2d536e3128f2a3c8ed # v2.22.0
with:
egress-policy: audit

- name: Download SARIF results
uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
with:
name: fuzz-sarif
path: cifuzz-sarif

- name: Upload SARIF
uses: github/codeql-action/upload-sarif@9b3254085494b55a0f7c4c2b3d2d52cc712ce370 # v4.39.1
with:
sarif_file: cifuzz-sarif/results.sarif
checkout_path: cifuzz-sarif
36 changes: 0 additions & 36 deletions .github/workflows/fuzz_nightly.yml

This file was deleted.

12 changes: 10 additions & 2 deletions .github/workflows/fuzz_prune.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,25 @@ name: urunc fuzzing (corpus pruning)
on:
workflow_dispatch:
schedule:
- cron: '30 13 * * *'
- cron: '30 13 * * 0'

permissions:
contents: read
actions: read

# Shared with fuzz_batch.yml. Both download the corpus, change it and upload
# it again, so overlapping runs would overwrite each other's corpus.
concurrency:
group: clusterfuzzlite-corpus
cancel-in-progress: false

jobs:
prune:
name: ClusterFuzzLite corpus pruning
runs-on: ubuntu-24.04
timeout-minutes: 30
permissions:
contents: read
actions: read
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@351661ca32ac09a36dc5ee2d536e3128f2a3c8ed # v2.22.0
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/scorecard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,6 @@ jobs:
# Upload the results to GitHub's code scanning dashboard (optional).
# Commenting out will disable upload of results to your repo's Code Scanning dashboard
- name: "Upload to code-scanning"
uses: github/codeql-action/upload-sarif@9b3254085494b55a0f7c4c2b3d2d52cc712ce370 # v3.29.5
uses: github/codeql-action/upload-sarif@9b3254085494b55a0f7c4c2b3d2d52cc712ce370 # v4.39.1
with:
sarif_file: results.sarif