Definitional implementation of Cedar language and utilities for DRT
See the codeThis repository contains the formalization of Cedar and infrastructure for performing differential randomized testing (DRT) between the formalization and Rust production implementation available in cedar.
You can learn more about our formalization efforts in the following blog posts:
cedar-lean contains the Lean formalization of, and proofs about, Cedar.cedar-drt contains code for fuzzing, property-based testing, and differential testing of Cedar.cedar-policy-generators contains code for generating schemas, entities, policies, and requests using the arbitrary crate.See the README in each directory for more information.
cd cedar-leansource ../cedar-drt/set_env_vars.sh (only required if running on AL2)lake updatelake build CedarThe simplest way to build our DRT framework is to use the included Dockerfile:
docker build . -t cedar_drt # ~10 minutes
docker run --rm -it cedar_drt
If you'd rather not use Docker, here are the full instructions for a local build:
cedar repository in the current (cedar-spec) repository.source cedar-drt/set_env_vars.shcd cedar-lean && ../cedar-drt/build_lean_lib.shcd ../cedar-drt && cargo buildThe build has only been tested on Amazon Linux 2.
To run DRT:
source ./set_env_vars.sh.cargo fuzz run -s none <target>.List the available fuzz targets with cargo fuzz list.
Available targets are described in the README in the cedar-drt directory.
That README also explains how to debug build failures, and how to save DRT-generated tests.
Additional commands available with cargo fuzz help.
To work with cedar-drt in VSCode, copy the recommended settings into place:
cp .vscode/settings.json.default .vscode/settings.json
Then add the LEAN_LIB_DIR environment variable so rust-analyzer can find the Lean installation. Run source set_env_vars.sh && echo $LEAN_LIB_DIR, then add the following to your .vscode/settings.json:
"rust-analyzer.cargo.extraEnv": {
"LEAN_LIB_DIR": <$LEAN_LIB_DIR as populated by set_env_vars.sh>
}
See the cedar-lean README for some additional consideration when working with the Lean formalization.
See CONTRIBUTING for more information.
This project is licensed under the Apache-2.0 License.
Lean
76.1%
Rust
23.4%
Definitional implementation of Cedar language and utilities for DRT
See the codeThis repository contains the formalization of Cedar and infrastructure for performing differential randomized testing (DRT) between the formalization and Rust production implementation available in cedar.
You can learn more about our formalization efforts in the following blog posts:
cedar-lean contains the Lean formalization of, and proofs about, Cedar.cedar-drt contains code for fuzzing, property-based testing, and differential testing of Cedar.cedar-policy-generators contains code for generating schemas, entities, policies, and requests using the arbitrary crate.See the README in each directory for more information.
cd cedar-leansource ../cedar-drt/set_env_vars.sh (only required if running on AL2)lake updatelake build CedarThe simplest way to build our DRT framework is to use the included Dockerfile:
docker build . -t cedar_drt # ~10 minutes
docker run --rm -it cedar_drt
If you'd rather not use Docker, here are the full instructions for a local build:
cedar repository in the current (cedar-spec) repository.source cedar-drt/set_env_vars.shcd cedar-lean && ../cedar-drt/build_lean_lib.shcd ../cedar-drt && cargo buildThe build has only been tested on Amazon Linux 2.
To run DRT:
source ./set_env_vars.sh.cargo fuzz run -s none <target>.List the available fuzz targets with cargo fuzz list.
Available targets are described in the README in the cedar-drt directory.
That README also explains how to debug build failures, and how to save DRT-generated tests.
Additional commands available with cargo fuzz help.
To work with cedar-drt in VSCode, copy the recommended settings into place:
cp .vscode/settings.json.default .vscode/settings.json
Then add the LEAN_LIB_DIR environment variable so rust-analyzer can find the Lean installation. Run source set_env_vars.sh && echo $LEAN_LIB_DIR, then add the following to your .vscode/settings.json:
"rust-analyzer.cargo.extraEnv": {
"LEAN_LIB_DIR": <$LEAN_LIB_DIR as populated by set_env_vars.sh>
}
See the cedar-lean README for some additional consideration when working with the Lean formalization.
See CONTRIBUTING for more information.
This project is licensed under the Apache-2.0 License.
Lean
76.1%
Rust
23.4%