Skip to content

.github/workflows: Enable fuzz testing as a nightly CI task #5

.github/workflows: Enable fuzz testing as a nightly CI task

.github/workflows: Enable fuzz testing as a nightly CI task #5

Workflow file for this run

name: Fuzz Testing Nightly
on:
# TODO: Enable when fuzz targets are merged
#schedule:
# 3:00 AM PST monday-saturday
#- cron: '00 11 * * 1-6'
jobs:
image_verify_seed_corpus:
name: Build Image Verifier seed corpus
runs-on: ubuntu-22.04
env:
# Change this to a new random value if you suspect the cache is corrupted
CACHE_BUSTER: 6542f37bb328
steps:
- name: Restore seed corpus
uses: actions/cache/restore@v3
id: image_bundle_restore
with:
path: ./image/verify/fuzz/common_corpus/
key: image_verify-common_corpus-${{ env.CACHE_BUSTER }}
- name: Build seed corpus
if: steps.image_bundle_restore.outputs.cache-hit != 'true'
run: |
mkdir -p image/verify/fuzz/common_corpus
for x in $(seq 01 04); do
cargo run -j$(nproc) --manifest-path=builder/Cargo.toml --release --bin image -- --rom elf2rom_built.rom --fw caliptra-builder_built_fw.bundle; \
mv caliptra-builder_built_fw.bundle image/verify/fuzz/common_corpus/${x}; \
rm elf2rom_built.rom; cargo clean; \
done
- name: Save seed corpus
uses: actions/cache/save@v3
if: steps.image_bundle_restore.outputs.cache-hit != 'true'
with:
path: ./image/verify/fuzz/common_corpus/
key: image_verify-common_corpus-${{ env.CACHE_BUSTER }}
image_verify_libfuzzer_unstructured:
needs: image_verify_seed_corpus
uses: ./.github/workflows/reusable-libfuzzer.yml
with:
name: image_verify
fuzz_target_path: image/verify/fuzz
fuzz_target_name: fuzz_target_1
fuzz_target_max_len: 23692
fuzzer_features:
fuzzer_sanitiser: address
image_verify_libfuzzer_structured:
needs: image_verify_seed_corpus
uses: ./.github/workflows/reusable-libfuzzer.yml
with:
name: image_verify
fuzz_target_path: image/verify/fuzz
fuzz_target_name: fuzz_target_1
fuzz_target_max_len: 23692
fuzzer_features: struct-aware
fuzzer_sanitiser: address
image_verify_afl_unstructured:
needs: image_verify_seed_corpus
uses: ./.github/workflows/reusable-aflplusplus.yml
with:
name: image_verify
fuzz_target_path: image/verify/fuzz
fuzz_target_name: fuzz_target_1
fuzz_target_max_len: 23692
fuzzer_features:
image_verify_afl_structured:
needs: image_verify_seed_corpus
uses: ./.github/workflows/reusable-aflplusplus.yml
with:
name: image_verify
fuzz_target_path: image/verify/fuzz
fuzz_target_name: fuzz_target_1
fuzz_target_max_len: 23692
fuzzer_features: struct-aware