Skip to content

feat(fuzz): mutation fuzzer with schema-conformance oracle #5

feat(fuzz): mutation fuzzer with schema-conformance oracle

feat(fuzz): mutation fuzzer with schema-conformance oracle #5

Workflow file for this run

name: fuzz
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
fuzz:
runs-on: ubuntu-22.04
env:
OPENRESTY_PREFIX: "/usr/local/openresty"
FUZZ_BUDGET: "120"
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y build-essential libncurses5-dev libreadline-dev libssl-dev perl lua5.1 liblua5.1-0-dev
- name: Install OpenResty
run: |
wget -qO - https://openresty.org/package/pubkey.gpg | sudo gpg --dearmor -o /usr/share/keyrings/openresty.gpg
echo "deb [signed-by=/usr/share/keyrings/openresty.gpg] http://openresty.org/package/ubuntu $(lsb_release -sc) main" | sudo tee /etc/apt/sources.list.d/openresty.list
sudo apt-get update
sudo apt-get install -y openresty
- name: Install LuaRocks
run: |
LUAROCKS_VER=3.12.0
wget -q "https://github.com/luarocks/luarocks/archive/v${LUAROCKS_VER}.tar.gz"
tar xzf "v${LUAROCKS_VER}.tar.gz"
cd "luarocks-${LUAROCKS_VER}"
./configure --with-lua=$OPENRESTY_PREFIX/luajit
make build && sudo make install
cd .. && rm -rf "luarocks-${LUAROCKS_VER}" "v${LUAROCKS_VER}.tar.gz"
# Configure OpenSSL paths for rocks that need it
OPENSSL_PREFIX=$OPENRESTY_PREFIX/openssl3
if [ ! -d "$OPENSSL_PREFIX" ]; then
OPENSSL_PREFIX=$OPENRESTY_PREFIX/openssl111
fi
if [ ! -d "$OPENSSL_PREFIX" ]; then
OPENSSL_PREFIX=$OPENRESTY_PREFIX/openssl
fi
if [ -d "$OPENSSL_PREFIX" ]; then
luarocks config variables.OPENSSL_LIBDIR ${OPENSSL_PREFIX}/lib
luarocks config variables.OPENSSL_INCDIR ${OPENSSL_PREFIX}/include
fi
- name: Install Lua dependencies
run: |
sudo luarocks install jsonschema
sudo luarocks install lua-resty-radixtree
- name: Run mutation fuzzer
run: |
export PATH=$OPENRESTY_PREFIX/nginx/sbin:$OPENRESTY_PREFIX/bin:$PATH
make fuzz FUZZ_BUDGET=$FUZZ_BUDGET
- name: Upload findings
if: failure()
uses: actions/upload-artifact@v4
with:
name: fuzz-findings-${{ github.run_id }}
path: fuzz/out/
retention-days: 30