-
Notifications
You must be signed in to change notification settings - Fork 148
76 lines (63 loc) · 2.34 KB
/
fuzzer.yml
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
66
67
68
69
70
71
72
73
74
75
76
name: "Fuzzer Workflow"
on:
schedule:
# At the end of every day
- cron: "0 0 * * *"
jobs:
run-fuzzers:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
ref: ${{ github.head_ref }}
- name: Cache Inputs
id: cache-inputs
uses: actions/cache@v3
with:
# Path where the inputs for the fuzzer are stored
path: fuzzer/hfuzz_workspace/fuzz_json/input
key: ${{ runner.os }}-inputs
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y build-essential
sudo apt-get install binutils-dev
sudo apt-get install libunwind-dev
sudo curl https://sh.rustup.rs -sSf | bash -s -- -y --default-toolchain nightly
- name: Set Environment Variable
run: echo "PATH="/root/.cargo/bin:${PATH}"" >> $GITHUB_ENV
- name: Install Honggfuzz
run: cargo install honggfuzz
# If has cached inputs starts with them or else starts from 0
- name: Initializing fuzzer with previous inputs
run: |
cd fuzzer
HFUZZ_RUN_ARGS="--dict=json.dict --run_time 10800 --timeout 60" cargo hfuzz run fuzz_json
# run the fuzzer with minimize to reduce inputs
- name: Initializing fuzzer with minimize
run: |
cd fuzzer
HFUZZ_RUN_ARGS="--dict=json.dict --minimize --timeout 60 -T" cargo hfuzz run fuzz_json
- uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: changing report
file_pattern: '*/hfuzz_workspace/fuzzer/fuzz_json/HONGGFUZZ* */hfuzz_workspace/fuzzer/fuzz_json/*.fuzz'
# Checkout current and last commit for the diff
- name: Checkout commits
uses: actions/checkout@v3
with:
fetch-depth: 2
# Check if any new crashes were added
- name: Check diff
id: check_file_changed
run: echo "report=$(git diff --name-only HEAD^ HEAD -- fuzzer/hfuzz_workspace/fuzz_json/*.fuzz)" >> $GITHUB_OUTPUT
# If a new crash was found, create an issue
- name: Create issue
uses: JasonEtco/create-an-issue@v2
if: ${{ steps.check_file_changed.outputs.report != '' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CRASH_REPORT: ${{ steps.check_file_changed.outputs.report }}
with:
filename: .github/ISSUE_TEMPLATE/crash_report.md