From 7f7c080b67c0465ed3fb13cf9ceb0932d5ff63cc Mon Sep 17 00:00:00 2001 From: Justus Adam Date: Wed, 1 May 2024 11:00:47 -0400 Subject: [PATCH] Remove props (#147) ## What Changed? All the policies from `props` have moved to the [paralegal-bench](https://github.com/brownsys/paralegal-bench) repository ## Why Does It Need To? Policies are now colocated with the applications they check. ## Checklist - [x] Above description has been filled out so that upon quash merge we have a good record of what changed. - [x] New functions, methods, types are documented. Old documentation is updated if necessary - [x] Documentation in Notion has been updated - [x] Tests for new behaviors are provided - [ ] New test suites (if any) ave been added to the CI tests (in `.github/workflows/rust.yml`) either as compiler test or integration test. *Or* justification for their omission from CI has been provided in this PR description. --- Makefile.toml | 7 - props/Cargo.lock | 950 --------------------------------- props/Cargo.toml | 2 - props/lemmy/.cargo/config.toml | 2 - props/lemmy/Cargo.toml | 8 - props/lemmy/src/main.rs | 61 --- props/plume/Cargo.toml | 9 - props/plume/src/main.rs | 70 --- props/websubmit/Cargo.toml | 9 - props/websubmit/src/main.rs | 322 ----------- 10 files changed, 1440 deletions(-) delete mode 100644 props/Cargo.lock delete mode 100644 props/Cargo.toml delete mode 100644 props/lemmy/.cargo/config.toml delete mode 100644 props/lemmy/Cargo.toml delete mode 100644 props/lemmy/src/main.rs delete mode 100644 props/plume/Cargo.toml delete mode 100644 props/plume/src/main.rs delete mode 100644 props/websubmit/Cargo.toml delete mode 100644 props/websubmit/src/main.rs diff --git a/Makefile.toml b/Makefile.toml index af7c447308..dcc529badd 100644 --- a/Makefile.toml +++ b/Makefile.toml @@ -27,7 +27,6 @@ description = "The suite of synthetic tests for the PDG and the policy framweork dependencies = [ "analyzer-tests", "policy-framework-tests", - "test-policies", "guide-project", ] @@ -76,12 +75,6 @@ description = "Tests related to the correctness of the policy framework." command = "cargo" args = ["test", "-p", "paralegal-policy", "--lib"] -[tasks.test-policies] -description = "Attempts to build the test policies to ensure their API is still served." -cwd = "props" -command = "cargo" -args = ["build"] - [tasks.guide-project] description = "Build and run the policy from the guide." cwd = "guide/deletion-policy" diff --git a/props/Cargo.lock b/props/Cargo.lock deleted file mode 100644 index 48dbb9fd20..0000000000 --- a/props/Cargo.lock +++ /dev/null @@ -1,950 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "addr2line" -version = "0.21.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" -dependencies = [ - "gimli", -] - -[[package]] -name = "adler" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" - -[[package]] -name = "ahash" -version = "0.7.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a824f2aa7e75a0c98c5a504fceb80649e9c35265d44525b5f94de4771a395cd" -dependencies = [ - "getrandom", - "once_cell", - "version_check", -] - -[[package]] -name = "anyhow" -version = "1.0.75" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4668cab20f66d8d020e1fbc0ebe47217433c1b6c8f2040faf858554e394ace6" -dependencies = [ - "backtrace", -] - -[[package]] -name = "atty" -version = "0.2.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" -dependencies = [ - "hermit-abi 0.1.19", - "libc", - "winapi", -] - -[[package]] -name = "autocfg" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" - -[[package]] -name = "backtrace" -version = "0.3.69" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2089b7e3f35b9dd2d0ed921ead4f6d318c27680d4a5bd167b3ee120edb105837" -dependencies = [ - "addr2line", - "cc", - "cfg-if", - "libc", - "miniz_oxide", - "object", - "rustc-demangle", -] - -[[package]] -name = "bitflags" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" - -[[package]] -name = "bitflags" -version = "2.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07" - -[[package]] -name = "bitvec" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bc2832c24239b0141d5674bb9174f9d68a8b5b3f2753311927c172ca46f7e9c" -dependencies = [ - "funty", - "radium", - "tap", - "wyz", -] - -[[package]] -name = "byteorder" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" - -[[package]] -name = "cc" -version = "1.0.83" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" -dependencies = [ - "libc", -] - -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - -[[package]] -name = "clap" -version = "3.2.25" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ea181bf566f71cb9a5d17a59e1871af638180a18fb0035c92ae62b705207123" -dependencies = [ - "atty", - "bitflags 1.3.2", - "clap_derive", - "clap_lex", - "indexmap 1.9.3", - "once_cell", - "strsim", - "termcolor", - "textwrap", -] - -[[package]] -name = "clap_derive" -version = "3.2.25" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae6371b8bdc8b7d3959e9cf7b22d4435ef3e79e138688421ec654acf8c81b008" -dependencies = [ - "heck", - "proc-macro-error", - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "clap_lex" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2850f2f5a82cbf437dd5af4d49848fbdfc27c157c3d010345776f952765261c5" -dependencies = [ - "os_str_bytes", -] - -[[package]] -name = "colored" -version = "1.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a5f741c91823341bebf717d4c71bda820630ce065443b58bd1b7451af008355" -dependencies = [ - "is-terminal", - "lazy_static", - "winapi", -] - -[[package]] -name = "colored" -version = "2.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2674ec482fbc38012cf31e6c42ba0177b431a0cb6f15fe40efa5aab1bda516f6" -dependencies = [ - "is-terminal", - "lazy_static", - "windows-sys", -] - -[[package]] -name = "deranged" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f32d04922c60427da6f9fef14d042d9edddef64cb9d4ce0d64d0685fbeb1fd3" -dependencies = [ - "powerfmt", -] - -[[package]] -name = "dot" -version = "0.1.4-dev" -source = "git+https://github.com/JustusAdam/dot-rust?rev=ff2b42ceda98c639c8ea3cbfc56b83d6e06e8106#ff2b42ceda98c639c8ea3cbfc56b83d6e06e8106" - -[[package]] -name = "either" -version = "1.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" - -[[package]] -name = "equivalent" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" - -[[package]] -name = "errno" -version = "0.3.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f258a7194e7f7c2a7837a8913aeab7fd8c383457034fa20ce4dd3dcb813e8eb8" -dependencies = [ - "libc", - "windows-sys", -] - -[[package]] -name = "fixedbitset" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" - -[[package]] -name = "flowistry_pdg" -version = "0.1.0" -source = "git+https://github.com/brownsys/flowistry?rev=d1fcc76509032dd94f5255fd03c0ad0397efe834#d1fcc76509032dd94f5255fd03c0ad0397efe834" -dependencies = [ - "cfg-if", - "internment", - "serde", -] - -[[package]] -name = "funty" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" - -[[package]] -name = "fxhash" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c31b6d751ae2c7f11320402d34e41349dd1016f8d5d45e48c4312bc8625af50c" -dependencies = [ - "byteorder", -] - -[[package]] -name = "getrandom" -version = "0.2.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe9006bed769170c11f845cf00c7c1e9092aeb3f268e007c3e760ac68008070f" -dependencies = [ - "cfg-if", - "libc", - "wasi", -] - -[[package]] -name = "gimli" -version = "0.28.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fb8d784f27acf97159b40fc4db5ecd8aa23b9ad5ef69cdd136d3bc80665f0c0" - -[[package]] -name = "hashbrown" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" -dependencies = [ - "ahash", -] - -[[package]] -name = "hashbrown" -version = "0.14.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" - -[[package]] -name = "heck" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" - -[[package]] -name = "hermit-abi" -version = "0.1.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" -dependencies = [ - "libc", -] - -[[package]] -name = "hermit-abi" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d77f7ec81a6d05a3abb01ab6eb7590f6083d08449fe5a1c8b1e620283546ccb7" - -[[package]] -name = "index_vec" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74086667896a940438f2118212f313abba4aff3831fef6f4b17d02add5c8bb60" - -[[package]] -name = "indexical" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "467e4f95baab3c675f5e42553f822b34e176aa13c322ec8c258743825deaafb6" -dependencies = [ - "bitvec", - "fxhash", - "index_vec", - "splitmut", - "take_mut", -] - -[[package]] -name = "indexmap" -version = "1.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" -dependencies = [ - "autocfg", - "hashbrown 0.12.3", -] - -[[package]] -name = "indexmap" -version = "2.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "233cf39063f058ea2caae4091bf4a3ef70a653afbc026f5c4a4135d114e3c177" -dependencies = [ - "equivalent", - "hashbrown 0.14.3", -] - -[[package]] -name = "internment" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e976188335292f66a1533fd41d5c2ce24b32dc2c000569b8dccf4e57f489806" -dependencies = [ - "hashbrown 0.12.3", - "parking_lot", - "serde", -] - -[[package]] -name = "is-terminal" -version = "0.4.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb0889898416213fab133e1d33a0e5858a48177452750691bde3666d0fdbaf8b" -dependencies = [ - "hermit-abi 0.3.3", - "rustix", - "windows-sys", -] - -[[package]] -name = "itertools" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1c173a5686ce8bfa551b3563d0c2170bf24ca44da99c7ca4bfdab5418c3fe57" -dependencies = [ - "either", -] - -[[package]] -name = "itertools" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569" -dependencies = [ - "either", -] - -[[package]] -name = "itoa" -version = "1.0.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" - -[[package]] -name = "lazy_static" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" - -[[package]] -name = "lemmy" -version = "0.1.0" -dependencies = [ - "anyhow", - "paralegal-policy", -] - -[[package]] -name = "libc" -version = "0.2.150" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89d92a4743f9a61002fae18374ed11e7973f530cb3a3255fb354818118b2203c" - -[[package]] -name = "linux-raw-sys" -version = "0.4.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "969488b55f8ac402214f3f5fd243ebb7206cf82de60d3172994707a4bcc2b829" - -[[package]] -name = "lock_api" -version = "0.4.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c168f8615b12bc01f9c17e2eb0cc07dcae1940121185446edc3744920e8ef45" -dependencies = [ - "autocfg", - "scopeguard", -] - -[[package]] -name = "log" -version = "0.4.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" - -[[package]] -name = "memchr" -version = "2.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f665ee40bc4a3c5590afb1e9677db74a508659dfd71e126420da8274909a0167" - -[[package]] -name = "miniz_oxide" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" -dependencies = [ - "adler", -] - -[[package]] -name = "num_threads" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2819ce041d2ee131036f4fc9d6ae7ae125a3a40e97ba64d04fe799ad9dabbb44" -dependencies = [ - "libc", -] - -[[package]] -name = "object" -version = "0.32.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cf5f9dd3933bd50a9e1f149ec995f39ae2c496d31fd772c1fd45ebc27e902b0" -dependencies = [ - "memchr", -] - -[[package]] -name = "once_cell" -version = "1.18.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" - -[[package]] -name = "os_str_bytes" -version = "6.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2355d85b9a3786f481747ced0e0ff2ba35213a1f9bd406ed906554d7af805a1" - -[[package]] -name = "paralegal-policy" -version = "0.1.0" -dependencies = [ - "anyhow", - "bitvec", - "colored 1.9.4", - "indexical", - "itertools 0.12.1", - "lazy_static", - "log", - "paralegal-spdg", - "petgraph", - "serde_json", - "simple_logger", - "strum", -] - -[[package]] -name = "paralegal-spdg" -version = "0.1.0" -dependencies = [ - "cfg-if", - "dot", - "flowistry_pdg", - "indexical", - "internment", - "itertools 0.11.0", - "log", - "petgraph", - "serde", - "static_assertions", - "strum", -] - -[[package]] -name = "parking_lot" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" -dependencies = [ - "lock_api", - "parking_lot_core", -] - -[[package]] -name = "parking_lot_core" -version = "0.9.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c42a9226546d68acdd9c0a280d17ce19bfe27a46bf68784e4066115788d008e" -dependencies = [ - "cfg-if", - "libc", - "redox_syscall", - "smallvec", - "windows-targets", -] - -[[package]] -name = "petgraph" -version = "0.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1d3afd2628e69da2be385eb6f2fd57c8ac7977ceeff6dc166ff1657b0e386a9" -dependencies = [ - "fixedbitset", - "indexmap 2.2.3", - "serde", - "serde_derive", -] - -[[package]] -name = "plume" -version = "0.1.0" -dependencies = [ - "anyhow", - "clap", - "paralegal-policy", -] - -[[package]] -name = "powerfmt" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" - -[[package]] -name = "proc-macro-error" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" -dependencies = [ - "proc-macro-error-attr", - "proc-macro2", - "quote", - "syn 1.0.109", - "version_check", -] - -[[package]] -name = "proc-macro-error-attr" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" -dependencies = [ - "proc-macro2", - "quote", - "version_check", -] - -[[package]] -name = "proc-macro2" -version = "1.0.78" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "quote" -version = "1.0.35" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "radium" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09" - -[[package]] -name = "redox_syscall" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" -dependencies = [ - "bitflags 1.3.2", -] - -[[package]] -name = "rustc-demangle" -version = "0.1.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" - -[[package]] -name = "rustix" -version = "0.38.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ad981d6c340a49cdc40a1028d9c6084ec7e9fa33fcb839cab656a267071e234" -dependencies = [ - "bitflags 2.4.1", - "errno", - "libc", - "linux-raw-sys", - "windows-sys", -] - -[[package]] -name = "rustversion" -version = "1.0.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4" - -[[package]] -name = "ryu" -version = "1.0.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" - -[[package]] -name = "scopeguard" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" - -[[package]] -name = "serde" -version = "1.0.196" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "870026e60fa08c69f064aa766c10f10b1d62db9ccd4d0abb206472bee0ce3b32" -dependencies = [ - "serde_derive", -] - -[[package]] -name = "serde_derive" -version = "1.0.196" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33c85360c95e7d137454dc81d9a4ed2b8efd8fbe19cee57357b32b9771fccb67" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.49", -] - -[[package]] -name = "serde_json" -version = "1.0.108" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d1c7e3eac408d115102c4c24ad393e0821bb3a5df4d506a80f85f7a742a526b" -dependencies = [ - "itoa", - "ryu", - "serde", -] - -[[package]] -name = "simple_logger" -version = "2.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48047e77b528151aaf841a10a9025f9459da80ba820e425ff7eb005708a76dc7" -dependencies = [ - "atty", - "colored 2.0.4", - "log", - "time", - "winapi", -] - -[[package]] -name = "smallvec" -version = "1.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4dccd0940a2dcdf68d092b8cbab7dc0ad8fa938bf95787e1b916b0e3d0e8e970" - -[[package]] -name = "splitmut" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c85070f382340e8b23a75808e83573ddf65f9ad9143df9573ca37c1ed2ee956a" - -[[package]] -name = "static_assertions" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" - -[[package]] -name = "strsim" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" - -[[package]] -name = "strum" -version = "0.25.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290d54ea6f91c969195bdbcd7442c8c2a2ba87da8bf60a7ee86a235d4bc1e125" -dependencies = [ - "strum_macros", -] - -[[package]] -name = "strum_macros" -version = "0.25.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23dc1fa9ac9c169a78ba62f0b841814b7abae11bdd047b9c58f893439e309ea0" -dependencies = [ - "heck", - "proc-macro2", - "quote", - "rustversion", - "syn 2.0.49", -] - -[[package]] -name = "syn" -version = "1.0.109" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "syn" -version = "2.0.49" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "915aea9e586f80826ee59f8453c1101f9d1c4b3964cd2460185ee8e299ada496" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "take_mut" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f764005d11ee5f36500a149ace24e00e3da98b0158b3e2d53a7495660d3f4d60" - -[[package]] -name = "tap" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" - -[[package]] -name = "termcolor" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff1bc3d3f05aff0403e8ac0d92ced918ec05b666a43f83297ccef5bea8a3d449" -dependencies = [ - "winapi-util", -] - -[[package]] -name = "textwrap" -version = "0.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "222a222a5bfe1bba4a77b45ec488a741b3cb8872e5e499451fd7d0129c9c7c3d" - -[[package]] -name = "time" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4a34ab300f2dee6e562c10a046fc05e358b29f9bf92277f30c3c8d82275f6f5" -dependencies = [ - "deranged", - "itoa", - "libc", - "num_threads", - "powerfmt", - "serde", - "time-core", - "time-macros", -] - -[[package]] -name = "time-core" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" - -[[package]] -name = "time-macros" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ad70d68dba9e1f8aceda7aa6711965dfec1cac869f311a51bd08b3a2ccbce20" -dependencies = [ - "time-core", -] - -[[package]] -name = "unicode-ident" -version = "1.0.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" - -[[package]] -name = "version_check" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" - -[[package]] -name = "wasi" -version = "0.11.0+wasi-snapshot-preview1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" - -[[package]] -name = "websubmit" -version = "0.1.0" -dependencies = [ - "anyhow", - "clap", - "paralegal-policy", -] - -[[package]] -name = "winapi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" -dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", -] - -[[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" - -[[package]] -name = "winapi-util" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f29e6f9198ba0d26b4c9f07dbe6f9ed633e1f3d5b8b414090084349e46a52596" -dependencies = [ - "winapi", -] - -[[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" - -[[package]] -name = "windows-sys" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" -dependencies = [ - "windows-targets", -] - -[[package]] -name = "windows-targets" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" -dependencies = [ - "windows_aarch64_gnullvm", - "windows_aarch64_msvc", - "windows_i686_gnu", - "windows_i686_msvc", - "windows_x86_64_gnu", - "windows_x86_64_gnullvm", - "windows_x86_64_msvc", -] - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" - -[[package]] -name = "windows_i686_gnu" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" - -[[package]] -name = "windows_i686_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" - -[[package]] -name = "wyz" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05f360fc0b24296329c78fda852a1e9ae82de9cf7b27dae4b7f62f118f77b9ed" -dependencies = [ - "tap", -] diff --git a/props/Cargo.toml b/props/Cargo.toml deleted file mode 100644 index 3c874ef25f..0000000000 --- a/props/Cargo.toml +++ /dev/null @@ -1,2 +0,0 @@ -[workspace] -members = ["lemmy", "websubmit", "plume"] diff --git a/props/lemmy/.cargo/config.toml b/props/lemmy/.cargo/config.toml deleted file mode 100644 index b3c8c8be6f..0000000000 --- a/props/lemmy/.cargo/config.toml +++ /dev/null @@ -1,2 +0,0 @@ -[build] -rustflags = ["-C", "prefer-dynamic", "-C", "rpath"] \ No newline at end of file diff --git a/props/lemmy/Cargo.toml b/props/lemmy/Cargo.toml deleted file mode 100644 index 625aedaca1..0000000000 --- a/props/lemmy/Cargo.toml +++ /dev/null @@ -1,8 +0,0 @@ -[package] -name = "lemmy" -version = "0.1.0" -edition = "2021" - -[dependencies] -paralegal-policy = { path = "../../crates/paralegal-policy" } -anyhow = "1" diff --git a/props/lemmy/src/main.rs b/props/lemmy/src/main.rs deleted file mode 100644 index 0ef0780c4b..0000000000 --- a/props/lemmy/src/main.rs +++ /dev/null @@ -1,61 +0,0 @@ -extern crate anyhow; - -use anyhow::{anyhow, Result}; -use std::sync::Arc; - -use paralegal_policy::{ - assert_error, - paralegal_spdg::{traverse::EdgeSelection, GlobalNode, Identifier}, - Marker, PolicyContext, -}; - -pub struct CommunityProp { - cx: Arc, -} - -impl CommunityProp { - pub fn new(cx: Arc) -> Self { - CommunityProp { cx } - } - - fn flow_to_auth(&self, sink: GlobalNode, marker: Marker) -> bool { - let mut auth_nodes = self - .cx - .all_nodes_for_ctrl(sink.controller_id()) - .filter(|n| self.cx.has_marker(marker, *n)); - - auth_nodes.any(|src| self.cx.flows_to(src, sink, EdgeSelection::Control)) - } - - pub fn check(&mut self) { - let db_community_write = Marker::new_intern("db_community_write"); - let community_delete_check = Marker::new_intern("community_delete_check"); - let community_ban_check = Marker::new_intern("community_ban_check"); - - for c_id in self.cx.desc().controllers.keys() { - for write_sink in self - .cx - .all_nodes_for_ctrl(*c_id) - .filter(|n| self.cx.has_marker(db_community_write, *n)) - { - let ok = self.flow_to_auth(write_sink, community_delete_check) - && self.flow_to_auth(write_sink, community_ban_check); - assert_error!(self.cx, !ok, "Found a failure!"); - } - } - } -} - -fn main() -> Result<()> { - let lemmy_dir = std::env::args() - .nth(1) - .ok_or_else(|| anyhow!("expected an argument"))?; - paralegal_policy::SPDGGenCommand::global() - .run(lemmy_dir)? - .with_context(|ctx| { - ctx.named_policy(Identifier::new_intern("Community Policy"), |ctx| { - CommunityProp::new(ctx).check(); - Ok(()) - }) - }) -} diff --git a/props/plume/Cargo.toml b/props/plume/Cargo.toml deleted file mode 100644 index 7643f26687..0000000000 --- a/props/plume/Cargo.toml +++ /dev/null @@ -1,9 +0,0 @@ -[package] -name = "plume" -version = "0.1.0" -edition = "2021" - -[dependencies] -paralegal-policy = { path = "../../crates/paralegal-policy" } -anyhow = "1" -clap = { version = "3", features = ["derive"] } diff --git a/props/plume/src/main.rs b/props/plume/src/main.rs deleted file mode 100644 index 81ab6cf35c..0000000000 --- a/props/plume/src/main.rs +++ /dev/null @@ -1,70 +0,0 @@ -use anyhow::Result; -use std::sync::Arc; - -use paralegal_policy::{paralegal_spdg::traverse::EdgeSelection, Context, Diagnostics, Marker}; - -macro_rules! marker { - ($id:ident) => { - Marker::new_intern(stringify!($id)) - }; -} - -fn check(ctx: Arc) -> Result<()> { - let user_data_types = ctx.marked_type(marker!(user_data)); - - let found = ctx.all_controllers().find(|(deleter_id, _)| { - let delete_sinks = ctx - .all_nodes_for_ctrl(*deleter_id) - .filter(|n| ctx.has_marker(marker!(to_delete), *n)) - .collect::>(); - user_data_types.iter().all(|&t| { - let sources = ctx.srcs_with_type(*deleter_id, t).collect::>(); - ctx.any_flows(&sources, &delete_sinks, EdgeSelection::Data) - .is_some() - }) - }); - if found.is_none() { - ctx.error("Could not find a function deleting all types"); - } - if let Some((found, _)) = found { - println!( - "Found {} deletes all user data types", - ctx.desc().controllers[&found].name - ); - for t in user_data_types { - println!("Found user data {}", ctx.describe_def(*t)); - } - } - Ok(()) -} - -#[derive(clap::Parser)] -struct Args { - plume_dir: std::path::PathBuf, - /// Additional arguments to pass to cargo, this is intended to be used to - /// enable the features that toggle the bugs, like `delete-comments`. - #[clap(last = true)] - cargo_args: Vec, -} - -fn main() -> Result<()> { - use clap::Parser; - let args = Args::try_parse()?; - - let mut cmd = paralegal_policy::SPDGGenCommand::global(); - cmd.get_command().args([ - "--external-annotations", - "external-annotations.toml", - "--abort-after-analysis", - "--target", - "plume-models", - "--", - "--no-default-features", - "--features", - "postgres", - ]); - cmd.get_command().args(args.cargo_args); - cmd.run(args.plume_dir)?.with_context(check)?; - println!("Successfully finished"); - Ok(()) -} diff --git a/props/websubmit/Cargo.toml b/props/websubmit/Cargo.toml deleted file mode 100644 index 1b64092141..0000000000 --- a/props/websubmit/Cargo.toml +++ /dev/null @@ -1,9 +0,0 @@ -[package] -name = "websubmit" -version = "0.1.0" -edition = "2021" - -[dependencies] -paralegal-policy = { path = "../../crates/paralegal-policy" } -anyhow = "1" -clap = { version = "3", features = ["derive"] } diff --git a/props/websubmit/src/main.rs b/props/websubmit/src/main.rs deleted file mode 100644 index 61078a8f37..0000000000 --- a/props/websubmit/src/main.rs +++ /dev/null @@ -1,322 +0,0 @@ -extern crate anyhow; -use std::sync::Arc; - -use anyhow::{bail, Result}; -use clap::Parser; -use paralegal_policy::{assert_error, paralegal_spdg, Context, Marker, PolicyContext}; -use paralegal_spdg::{traverse::EdgeSelection, Identifier}; - -macro_rules! marker { - ($id:ident) => { - Marker::new_intern(stringify!($id)) - }; -} - -/// Asserts that there exists one controller which calls a deletion -/// function on every value (or an equivalent type) that is ever stored. -pub struct DeletionProp { - cx: Arc, -} - -impl DeletionProp { - pub fn new(cx: Arc) -> Self { - DeletionProp { cx } - } - - pub fn check(self) -> Result { - // All types marked "sensitive" - let types_to_check = self - .cx - .marked_type(marker!(sensitive)) - .iter() - .filter(|t| { - { - // If there is any controller - self.cx.desc().controllers.keys().any(|ctrl_id| { - // Where a source of that type - self.cx.srcs_with_type(*ctrl_id, **t).any(|sens_src| { - // Has data influence on - self.cx - .influencees(sens_src, EdgeSelection::Data) - .any(|influencee| { - // A node with marker "influences" - self.cx.has_marker(marker!(stores), influencee) - }) - }) - }) - } - }) - // Mapped to their otype - .flat_map(|t| self.cx.otypes(*t)) - .collect::>(); - let found_deleter = self.cx.desc().controllers.keys().any(|ctrl_id| { - // For all types to check - types_to_check.iter().all(|ty| { - // If there is any src of that type - self.cx.srcs_with_type(*ctrl_id, **ty).any(|node| { - // That has data flow influence on - self.cx - .influencees(node, EdgeSelection::Data) - // A node with marker "deletes" - .any(|influencee| self.cx.has_marker(marker!(deletes), influencee)) - }) - }) - }); - - assert_error!( - self.cx, - found_deleter, - "Did not find valid deleter for all types." - ); - for ty in types_to_check { - assert_error!( - self.cx, - found_deleter, - format!("Type: {}", self.cx.describe_def(*ty)) - ) - } - - Ok(found_deleter) - } -} - -pub fn run_del_policy(ctx: Arc) -> Result { - ctx.named_policy(Identifier::new_intern("Deletion"), |ctx| { - DeletionProp::new(ctx).check() - }) -} - -/// Storing data in the database must be associated to a user. This is -/// necessary for e.g. the deletion to work. -pub struct ScopedStorageProp { - cx: Arc, -} - -impl ScopedStorageProp { - pub fn new(cx: Arc) -> Self { - ScopedStorageProp { cx } - } - - pub fn check(self) -> Result { - for c_id in self.cx.desc().controllers.keys() { - let scopes = self - .cx - .all_nodes_for_ctrl(*c_id) - .filter(|node| self.cx.has_marker(marker!(scopes_store), *node)) - .collect::>(); - let stores = self - .cx - .all_nodes_for_ctrl(*c_id) - .filter(|node| self.cx.has_marker(marker!(stores), *node)) - .collect::>(); - let mut sensitives = self - .cx - .all_nodes_for_ctrl(*c_id) - .filter(|node| self.cx.has_marker(marker!(sensitive), *node)); - - let controller_valid = sensitives.all(|sens| { - stores.iter().all(|&store| { - // sensitive flows to store implies some scope flows to store callsite - !(self.cx.flows_to(sens, store, EdgeSelection::Data)) || { - let store_callsite = self.cx.inputs_of(self.cx.associated_call_site(store)); - // The sink that scope flows to may be another CallArgument attached to the store's CallSite, it doesn't need to be store itself. - let found_scope = scopes.iter().any(|scope| { - self.cx - .flows_to(*scope, &store_callsite, EdgeSelection::Data) - && self - .cx - .influencers(*scope, EdgeSelection::Data) - .any(|i| self.cx.has_marker(marker!(auth_witness), i)) - }); - assert_error!( - self.cx, - found_scope, - format!( - "Stored sensitive isn't scoped. sensitive {} stored here: {}", - self.cx.describe_node(sens), - self.cx.describe_node(store) - ) - ); - found_scope - } - }) - }); - - assert_error!( - self.cx, - controller_valid, - format!( - "Violation detected for controller: {}", - self.cx.desc().controllers[c_id].name - ), - ); - - if !controller_valid { - return Ok(controller_valid); - } - } - Ok(true) - } -} - -pub fn run_sc_policy(ctx: Arc) -> Result { - ctx.named_policy(Identifier::new_intern("Scoped Storage"), |ctx| { - ScopedStorageProp::new(ctx).check() - }) -} - -/// If sensitive data is released, the release must be scoped, and all inputs to the scope must be safe. -pub struct AuthDisclosureProp { - cx: Arc, -} - -impl AuthDisclosureProp { - pub fn new(cx: Arc) -> Self { - AuthDisclosureProp { cx } - } - - pub fn check(self) -> Result { - for c_id in self.cx.desc().controllers.keys() { - // All srcs that have no influencers - let roots = self - .cx - .roots(*c_id, EdgeSelection::Data) - .collect::>(); - - let safe_scopes = self - .cx - // All nodes marked "safe" - .all_nodes_for_ctrl(*c_id) - .filter(|n| self.cx.has_marker(marker!(safe_source), *n)) - // And all nodes marked "safe_with_bless" - .chain(self.cx.all_nodes_for_ctrl(*c_id).filter(|node| { - self.cx.has_marker(marker!(safe_source_with_bless), *node) - && self - .cx - // That are influenced by a node marked "bless" - .influencers(*node, EdgeSelection::Both) - .any(|b| self.cx.has_marker(marker!(bless_safe_source), b)) - })) - .collect::>(); - let sinks = self - .cx - .all_nodes_for_ctrl(*c_id) - .filter(|n| self.cx.has_marker(marker!(sink), *n)) - .collect::>(); - let sensitives = self - .cx - .all_nodes_for_ctrl(*c_id) - .filter(|node| self.cx.has_marker(marker!(sensitive), *node)); - - for sens in sensitives { - for sink in sinks.iter() { - // sensitive flows to store implies - if !self.cx.flows_to(sens, *sink, EdgeSelection::Data) { - continue; - } - - let sink_callsite = self.cx.inputs_of(self.cx.associated_call_site(*sink)); - - // scopes for the store - let store_scopes = self - .cx - .influencers(&sink_callsite, EdgeSelection::Data) - .filter(|n| self.cx.has_marker(marker!(scopes), *n)) - .collect::>(); - assert_error!( - self.cx, - !store_scopes.is_empty(), - format!( - "Did not find any scopes for sink {}", - self.cx.describe_node(*sink) - ) - ); - - // all flows are safe before scope - let safe_before_scope = self.cx.always_happens_before( - roots.iter().cloned(), - |n| safe_scopes.contains(&n), - |n| store_scopes.contains(&n), - )?; - - assert_error!( - self.cx, - safe_before_scope.holds(), - format!( - "Sensitive {} flowed to sink {} which did not have safe scopes", - self.cx.describe_node(sens), - self.cx.describe_node(*sink), - ) - ); - safe_before_scope.report(self.cx.clone()); - - if !safe_before_scope.holds() { - return Ok(false); - } - } - } - } - Ok(true) - } -} - -pub fn run_dis_policy(ctx: Arc) -> Result { - ctx.named_policy(Identifier::new_intern("Authorized Disclosure"), |ctx| { - AuthDisclosureProp::new(ctx).check() - }) -} - -#[derive(Parser)] -struct Args { - /// path to WebSubmit directory. - #[clap(long)] - ws_dir: std::path::PathBuf, - - /// edit--- - #[clap(long, default_value = "none")] - edit_type: String, - - /// sc, del, or dis. - #[clap(long)] - policy: Option, -} - -fn main() -> Result<()> { - let args = Args::parse(); - - let prop = match args.policy { - Some(s) => match s.as_str() { - "sc" => run_sc_policy, - "del" => run_del_policy, - "dis" => run_dis_policy, - other => bail!("don't recognize the property name '{other}'"), - }, - None => |ctx: Arc| { - run_dis_policy(ctx.clone()).and(run_sc_policy(ctx.clone()).and(run_del_policy(ctx))) - }, - }; - - let mut command = paralegal_policy::SPDGGenCommand::global(); - command.get_command().args([ - "--model-version", - "v2", - "--inline-elision", - "--skip-sigs", - "--abort-after-analysis", - "--external-annotations", - format!( - "{}baseline-external-annotations.toml", - args.ws_dir.to_string_lossy() - ) - .as_str(), - ]); - - if args.edit_type.as_str() != "none" { - command - .get_command() - .args(["--", "--features", &args.edit_type]); - } - command.run(args.ws_dir)?.with_context(prop)?; - - Ok(()) -}