-
Notifications
You must be signed in to change notification settings - Fork 0
Hardening + honesty pass: logger/FORTIFY/fuzzing, LSM-hook BTF detection fix, opt-in signal-fallback #179
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Hardening + honesty pass: logger/FORTIFY/fuzzing, LSM-hook BTF detection fix, opt-in signal-fallback #179
Changes from 5 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
2dc773d
fix(logging,policy): const char* log field + correct policy-gen guard…
ErenAri ed1bbb8
build: strengthen userspace hardening (_FORTIFY_SOURCE=3, stack-clash…
ErenAri 249a882
ci(fuzz): ClusterFuzzLite integration + OSS-Fuzz-compatible fuzz build
ErenAri 978c212
fix(bpf): detect optional LSM hooks by their bpf_lsm_-prefixed BTF sy…
ErenAri e9909c5
feat(net): opt-in signal-fallback connect enforcement for non-BPF-LSM…
ErenAri af412a4
Merge origin/main into chore/hardening-phase0-1
ErenAri File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| # ClusterFuzzLite / OSS-Fuzz build image for the AegisBPF userspace fuzzers. | ||
| # The userspace library (policy parser, event/JSON decoders, network rules, | ||
| # signed-bundle parser) is the attacker-influenced input boundary; BPF object | ||
| # compilation is skipped here (SKIP_BPF_BUILD=ON) since fuzzers target userspace. | ||
| FROM gcr.io/oss-fuzz-base/base-builder:latest | ||
|
|
||
| RUN apt-get update && apt-get install -y --no-install-recommends \ | ||
| cmake \ | ||
| ninja-build \ | ||
| pkg-config \ | ||
| libbpf-dev \ | ||
| zlib1g-dev \ | ||
| && rm -rf /var/lib/apt/lists/* | ||
|
|
||
| COPY . $SRC/aegisbpf | ||
| WORKDIR $SRC/aegisbpf | ||
| COPY .clusterfuzzlite/build.sh $SRC/build.sh |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| #!/bin/bash -eu | ||
| # | ||
| # OSS-Fuzz / ClusterFuzzLite build script for AegisBPF userspace fuzzers. | ||
| # | ||
| # The fuzzing engine and sanitizer come from the OSS-Fuzz/CFLite environment | ||
| # ($CC/$CXX/$CFLAGS/$CXXFLAGS/$LIB_FUZZING_ENGINE). CMake honors $LIB_FUZZING_ENGINE | ||
| # (see the ENABLE_FUZZING block in CMakeLists.txt) and links it instead of the | ||
| # local-only -fsanitize=fuzzer,address. We do not set CMAKE_BUILD_TYPE so the | ||
| # injected $CXXFLAGS fully control optimization/instrumentation. | ||
|
|
||
| cd "$SRC/aegisbpf" | ||
|
|
||
| cmake -S . -B build-fuzz -G Ninja \ | ||
| -DENABLE_FUZZING=ON \ | ||
| -DBUILD_TESTING=OFF \ | ||
| -DSKIP_BPF_BUILD=ON | ||
|
|
||
| FUZZERS="fuzz_policy fuzz_bundle fuzz_network fuzz_path fuzz_event" | ||
| cmake --build build-fuzz --target ${FUZZERS} | ||
|
|
||
| for f in ${FUZZERS}; do | ||
| cp "build-fuzz/${f}" "${OUT}/" | ||
| # Ship checked-in seed corpora as <fuzzer>_seed_corpus.zip when present. | ||
| if [ -d "tests/fuzz/corpus/${f}" ]; then | ||
| (cd "tests/fuzz/corpus/${f}" && zip -q -r "${OUT}/${f}_seed_corpus.zip" .) | ||
| fi | ||
| done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| language: c++ | ||
| main_repo: "https://github.com/ErenAri/Aegis-BPF" | ||
| sanitizers: | ||
| - address | ||
| - undefined | ||
| fuzzing_engines: | ||
| - libfuzzer |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| name: ClusterFuzzLite PR | ||
|
|
||
| # Free, in-repo continuous fuzzing of the userspace input-parsing surface. | ||
| # Builds the libFuzzer harnesses in the OSS-Fuzz base image and fuzzes only the | ||
| # code changed by the PR (mode: code-change), failing the check on a new crash. | ||
| # No run: steps and no untrusted event input are used (injection-safe). | ||
| on: | ||
| pull_request: | ||
| paths: | ||
| - 'src/**' | ||
| - 'tests/fuzz/**' | ||
| - '.clusterfuzzlite/**' | ||
| - 'CMakeLists.txt' | ||
|
|
||
| permissions: read-all | ||
|
|
||
| concurrency: | ||
| group: cflite-pr-${{ github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| jobs: | ||
| PR: | ||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| sanitizer: [address, undefined] | ||
| steps: | ||
| - name: Build fuzzers (${{ matrix.sanitizer }}) | ||
| id: build | ||
| uses: google/clusterfuzzlite/actions/build_fuzzers@v1 | ||
| with: | ||
| language: c++ | ||
| sanitizer: ${{ matrix.sanitizer }} | ||
| - name: Run fuzzers (${{ matrix.sanitizer }}) | ||
| id: run | ||
| uses: google/clusterfuzzlite/actions/run_fuzzers@v1 | ||
| with: | ||
| github-token: ${{ secrets.GITHUB_TOKEN }} | ||
| fuzz-seconds: 300 | ||
| mode: 'code-change' | ||
| sanitizer: ${{ matrix.sanitizer }} | ||
| output-sarif: true | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.