-
Notifications
You must be signed in to change notification settings - Fork 1
65 lines (62 loc) · 2.09 KB
/
Copy pathfuzz.yml
File metadata and controls
65 lines (62 loc) · 2.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
name: Fuzz
# Fuzz targets are excluded from the default cargo workspace and require
# nightly + cargo-fuzz. Run on demand or on a slow schedule, not on every
# PR.
on:
workflow_dispatch:
inputs:
duration_secs:
description: "Per-target fuzz duration (seconds)"
required: false
default: "60"
schedule:
# Sunday 03:30 UTC — once a week is enough for the parser surface
# we're covering; bump if/when we add more targets.
- cron: "30 3 * * 0"
# Default to a read-only token. The job uploads artifacts on failure,
# which is satisfied by `contents: read` plus `actions/upload-artifact`'s
# own scoping; no write access to repo contents is needed.
permissions:
contents: read
jobs:
fuzz:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
target:
- tlv_list_parse
- tlv_list_parse_lenient
- raw_tlv_parse
- packet_unauth_parse
- packet_auth_parse
- agentx_decode_header
- agentx_decode_oid
steps:
- uses: actions/checkout@v4
- name: Install nightly toolchain
uses: dtolnay/rust-toolchain@nightly
- name: Install cargo-fuzz
run: cargo install cargo-fuzz
- name: Run fuzz target
env:
# Use env-var indirection per GitHub security guidance: matrix
# values are author-controlled, but pulling them through env
# protects against future template changes that might let
# untrusted input slip in.
FUZZ_TARGET: ${{ matrix.target }}
DURATION: ${{ github.event.inputs.duration_secs || '60' }}
run: |
cd fuzz
cargo +nightly fuzz run "$FUZZ_TARGET" -- -max_total_time="$DURATION"
- name: Upload crashes (if any)
if: failure()
uses: actions/upload-artifact@v4
env:
FUZZ_TARGET: ${{ matrix.target }}
with:
name: fuzz-crashes-${{ matrix.target }}
path: |
fuzz/artifacts/${{ matrix.target }}/
fuzz/corpus/${{ matrix.target }}/
if-no-files-found: ignore