Skip to content
Merged
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
61 changes: 61 additions & 0 deletions .github/workflows/fuzzing.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Fuzzing

on:
schedule:
- cron: '0 7 * * 1' # Runs at 07:00 on monday every week

workflow_dispatch:

permissions:
contents: read

jobs:
fuzzing:
name: Fuzzing
runs-on: ubuntu-22.04
if: github.event.repository.fork == false
steps:
- name: Check out code
uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.9

- name: Install Bazel
run: |
sudo apt-get update
sudo apt-get install -y wget
wget -c https://github.com/bazelbuild/bazelisk/releases/download/v1.18.0/bazelisk-linux-amd64
chmod +x bazelisk-linux-amd64
sudo mv bazelisk-linux-amd64 /usr/local/bin/bazel
bazel --version

- name: Install Fuzzing Dependencies
run: |
pip install --upgrade atheris
pip install --upgrade atheris-libprotobuf-mutator
pip install --upgrade protobuf
- name: Install Cve-bin-tool
run: |
python -m pip install --upgrade pip
python -m pip install --upgrade setuptools
python -m pip install --upgrade -r dev-requirements.txt
python -m pip install --upgrade .

- name: Run Fuzzing
id: fuzzing
env:
PYTHONPATH: ${{ github.workspace }}
run: |
cd fuzz
export PYTHONPATH="$PYTHONPATH:/generated"
fuzzing_scripts=($(ls *.py))
echo "Found Fuzzing scripts: ${fuzzing_scripts[@]}"
current_week=($(date -u +%U))
echo "Current week number: $current_week"
at_index=$((($(date -u +%U) % ${#fuzzing_scripts[@]})))
selected_script="${fuzzing_scripts[$at_index]}"
echo "Selected script: $selected_script"
timeout --preserve-status --signal=SIGINT 60m python $selected_script