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.
Issue #, if available:
CryptoAlg-2133
Description of changes:
This adds a new CI workflow to ACCP which runs Cryptofuzz for a fixed amount of time on each PR and reports any failures. Cryptofuzz is a fuzzing framework backed by LLVM's LibFuzzer project. It performs fuzz testing on cryptographic libraries at the granularity of cryptographic algorithms and also performs differential testing against the cryptographic libraries that it fuzzes.
The implementation here is unapologetically derivative of the AWS-LC integration with Cryptofuzz. It follows an architecture reminiscent of our existing CI stacks, but differs in that it runs on a newly defined docker image
amazonlinux-2_clang-11x_cryptofuzz_x86
which uses clang as the compiler and has Cryptofuzz related assets baked into it. Clang is necessary here because LibFuzzer (invoked via -fsantize=fuzzer) is only available from LLVM based compilers.The ACCPGitHubFuzzCIStack spins up a VPC containing an EFS filesystem which contains the outputs of any Cryptofuzz findings as well as a running corpus of interesting inputs discovered over time. Codebuild containers of the fuzzer mount this filesystem at runtime.
In the CI workflow, it builds ACCP and "links" it into the Cryptofuzz binary. It then runs Cryptofuzz to completion. We depart from the AWS-LC template by explicitly specifying the algorithms to fuzz because ACCP supports a much smaller subset of algorithms as OpenSSL. Without this, the fuzzer will end up fuzzing OpenSSL more than ACCP due to the random nature of LibFuzzer.
To get ACCP working with Cryptofuzz, we adapt the existing Java module in CryptoFuzz to support installing ACCP as a JCE provider. We also configure LSAN suppressions to avoid false positives that would break the build.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.