From b0fb81e47dfb563e12f1a6e32d454b5d55495518 Mon Sep 17 00:00:00 2001 From: Nathan Date: Tue, 18 Jul 2023 21:33:11 +0300 Subject: [PATCH 1/6] commit to merge --- Cargo.lock | 1765 +++++++++++++++++ Cargo.toml | 3 +- cherrybomb-engine/Cargo.lock | 2 - cherrybomb-engine/Cargo.toml | 3 +- cherrybomb-engine/src/config.rs | 4 +- cherrybomb-engine/src/lib.rs | 84 +- .../src/scan/active/active_scanner.rs | 1 - cherrybomb-oas/src/legacy/refs.rs | 5 +- src/telemetry.rs | 2 +- 9 files changed, 1853 insertions(+), 16 deletions(-) create mode 100644 Cargo.lock diff --git a/Cargo.lock b/Cargo.lock new file mode 100644 index 0000000..4569c9b --- /dev/null +++ b/Cargo.lock @@ -0,0 +1,1765 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "addr2line" +version = "0.20.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4fa78e18c64fce05e902adecd7a5eed15a5e0a3439f7b0e169f0252214865e3" +dependencies = [ + "gimli", +] + +[[package]] +name = "adler" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" + +[[package]] +name = "anstream" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ca84f3628370c59db74ee214b3263d58f9aadd9b4fe7e711fd87dc452b7f163" +dependencies = [ + "anstyle", + "anstyle-parse", + "anstyle-query", + "anstyle-wincon", + "colorchoice", + "is-terminal", + "utf8parse", +] + +[[package]] +name = "anstyle" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a30da5c5f2d5e72842e00bcb57657162cdabef0931f40e2deb9b4140440cecd" + +[[package]] +name = "anstyle-parse" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "938874ff5980b03a87c5524b3ae5b59cf99b1d6bc836848df7bc5ada9643c333" +dependencies = [ + "utf8parse", +] + +[[package]] +name = "anstyle-query" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ca11d4be1bab0c8bc8734a9aa7bf4ee8316d462a08c6ac5052f888fef5b494b" +dependencies = [ + "windows-sys", +] + +[[package]] +name = "anstyle-wincon" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "180abfa45703aebe0093f79badacc01b8fd4ea2e35118747e5811127f926e188" +dependencies = [ + "anstyle", + "windows-sys", +] + +[[package]] +name = "anyhow" +version = "1.0.72" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b13c32d80ecc7ab747b80c3784bce54ee8a7a0cc4fbda9bf4cda2cf6fe90854" + +[[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.68" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4319208da049c43661739c5fade2ba182f09d1dc2299b32298d3a31692b17e12" +dependencies = [ + "addr2line", + "cc", + "cfg-if", + "libc", + "miniz_oxide", + "object", + "rustc-demangle", +] + +[[package]] +name = "base64" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" + +[[package]] +name = "base64" +version = "0.21.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "604178f6c5c21f02dc555784810edfb88d34ac2c73b2eae109655649ee73ce3d" + +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "bitflags" +version = "2.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "630be753d4e58660abd17930c71b647fe46c27ea6b63cc59e1e3851406972e42" + +[[package]] +name = "bumpalo" +version = "3.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a3e2c3daef883ecc1b5d58c15adae93470a91d425f3532ba1695849656af3fc1" + +[[package]] +name = "bytes" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "89b2fd2a0dcf38d7971e2194b6b6eebab45ae01067456a7fd93d5547a61b70be" + +[[package]] +name = "cc" +version = "1.0.79" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50d30906286121d95be3d479533b458f87493b30a4b5f79a607db8f5d11aa91f" + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "cherrybomb" +version = "1.0.0" +dependencies = [ + "anyhow", + "cherrybomb-engine", + "clap", + "comfy-table", + "const_format", + "dirs", + "reqwest", + "serde", + "serde_derive", + "serde_json", + "serde_yaml", + "thiserror", + "tokio", + "uuid 1.4.1", +] + +[[package]] +name = "cherrybomb-engine" +version = "0.1.0" +dependencies = [ + "anyhow", + "base64 0.13.1", + "cherrybomb-oas", + "clap", + "reqwest", + "serde", + "serde_json", + "strum 0.23.0", + "strum_macros 0.23.1", + "thiserror", + "url", +] + +[[package]] +name = "cherrybomb-oas" +version = "0.1.0" +dependencies = [ + "colored", + "serde", + "serde_json", + "uuid 0.8.2", +] + +[[package]] +name = "clap" +version = "4.3.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f644d0dac522c8b05ddc39aaaccc5b136d5dc4ff216610c5641e3be5becf56c" +dependencies = [ + "clap_builder", + "clap_derive", + "once_cell", +] + +[[package]] +name = "clap_builder" +version = "4.3.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af410122b9778e024f9e0fb35682cc09cc3f85cad5e8d3ba8f47a9702df6e73d" +dependencies = [ + "anstream", + "anstyle", + "clap_lex", + "strsim", +] + +[[package]] +name = "clap_derive" +version = "4.3.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "54a9bb5758fc5dfe728d1019941681eccaf0cf8a4189b692a0ee2f2ecf90a050" +dependencies = [ + "heck 0.4.1", + "proc-macro2", + "quote", + "syn 2.0.26", +] + +[[package]] +name = "clap_lex" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2da6da31387c7e4ef160ffab6d5e7f00c42626fe39aea70a7b0f1773f7dd6c1b" + +[[package]] +name = "colorchoice" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" + +[[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 = "comfy-table" +version = "6.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e959d788268e3bf9d35ace83e81b124190378e4c91c9067524675e33394b8ba" +dependencies = [ + "crossterm", + "strum 0.24.1", + "strum_macros 0.24.3", + "unicode-width", +] + +[[package]] +name = "const_format" +version = "0.2.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c990efc7a285731f9a4378d81aff2f0e85a2c8781a05ef0f8baa8dac54d0ff48" +dependencies = [ + "const_format_proc_macros", +] + +[[package]] +name = "const_format_proc_macros" +version = "0.2.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e026b6ce194a874cb9cf32cd5772d1ef9767cc8fcb5765948d74f37a9d8b2bf6" +dependencies = [ + "proc-macro2", + "quote", + "unicode-xid", +] + +[[package]] +name = "core-foundation" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "194a7a9e6de53fa55116934067c844d9d749312f75c6f6d0980e8c252f8c2146" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "core-foundation-sys" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e496a50fda8aacccc86d7529e2c1e0892dbd0f898a6b5645b5561b89c3210efa" + +[[package]] +name = "crossterm" +version = "0.26.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a84cda67535339806297f1b331d6dd6320470d2a0fe65381e79ee9e156dd3d13" +dependencies = [ + "bitflags 1.3.2", + "crossterm_winapi", + "libc", + "mio", + "parking_lot", + "signal-hook", + "signal-hook-mio", + "winapi", +] + +[[package]] +name = "crossterm_winapi" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "acdd7c62a3665c7f6830a51635d9ac9b23ed385797f70a83bb8bafe9c572ab2b" +dependencies = [ + "winapi", +] + +[[package]] +name = "dirs" +version = "4.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca3aa72a6f96ea37bbc5aa912f6788242832f75369bdfdadcb0e38423f100059" +dependencies = [ + "dirs-sys", +] + +[[package]] +name = "dirs-sys" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b1d1d91c932ef41c0f2663aa8b0ca0342d444d842c06914aa0a7e352d0bada6" +dependencies = [ + "libc", + "redox_users", + "winapi", +] + +[[package]] +name = "encoding_rs" +version = "0.8.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071a31f4ee85403370b58aca746f01041ede6f0da2730960ad001edc2b71b394" +dependencies = [ + "cfg-if", +] + +[[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.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4bcfec3a70f97c962c307b2d2c56e358cf1d00b558d74262b5f929ee8cc7e73a" +dependencies = [ + "errno-dragonfly", + "libc", + "windows-sys", +] + +[[package]] +name = "errno-dragonfly" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bf" +dependencies = [ + "cc", + "libc", +] + +[[package]] +name = "fastrand" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e51093e27b0797c359783294ca4f0a911c270184cb10f85783b118614a1501be" +dependencies = [ + "instant", +] + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "foreign-types" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" +dependencies = [ + "foreign-types-shared", +] + +[[package]] +name = "foreign-types-shared" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" + +[[package]] +name = "form_urlencoded" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a62bc1cf6f830c2ec14a513a9fb124d0a213a629668a4186f329db21fe045652" +dependencies = [ + "percent-encoding", +] + +[[package]] +name = "futures-channel" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "955518d47e09b25bbebc7a18df10b81f0c766eaf4c4f1cccef2fca5f2a4fb5f2" +dependencies = [ + "futures-core", +] + +[[package]] +name = "futures-core" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4bca583b7e26f571124fe5b7561d49cb2868d79116cfa0eefce955557c6fee8c" + +[[package]] +name = "futures-macro" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.26", +] + +[[package]] +name = "futures-sink" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f43be4fe21a13b9781a69afa4985b0f6ee0e1afab2c6f454a8cf30e2b2237b6e" + +[[package]] +name = "futures-task" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76d3d132be6c0e6aa1534069c705a74a5997a356c0dc2f86a47765e5617c5b65" + +[[package]] +name = "futures-util" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26b01e40b772d54cf6c6d721c1d1abd0647a0106a12ecaa1c186273392a69533" +dependencies = [ + "futures-core", + "futures-macro", + "futures-task", + "pin-project-lite", + "pin-utils", + "slab", +] + +[[package]] +name = "getrandom" +version = "0.2.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be4136b2a15dd319360be1c07d9933517ccf0be8f16bf62a3bee4f0d618df427" +dependencies = [ + "cfg-if", + "libc", + "wasi", +] + +[[package]] +name = "gimli" +version = "0.27.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6c80984affa11d98d1b88b66ac8853f143217b399d3c74116778ff8fdb4ed2e" + +[[package]] +name = "h2" +version = "0.3.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97ec8491ebaf99c8eaa73058b045fe58073cd6be7f596ac993ced0b0a0c01049" +dependencies = [ + "bytes", + "fnv", + "futures-core", + "futures-sink", + "futures-util", + "http", + "indexmap 1.9.3", + "slab", + "tokio", + "tokio-util", + "tracing", +] + +[[package]] +name = "hashbrown" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" + +[[package]] +name = "hashbrown" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c6201b9ff9fd90a5a3bac2e56a830d0caa509576f0e503818ee82c181b3437a" + +[[package]] +name = "heck" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d621efb26863f0e9924c6ac577e8275e5e6b77455db64ffa6c65c904e9e132c" +dependencies = [ + "unicode-segmentation", +] + +[[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.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "443144c8cdadd93ebf52ddb4056d257f5b52c04d3c804e657d19eb73fc33668b" + +[[package]] +name = "http" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd6effc99afb63425aff9b05836f029929e345a6148a14b7ecd5ab67af944482" +dependencies = [ + "bytes", + "fnv", + "itoa", +] + +[[package]] +name = "http-body" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1" +dependencies = [ + "bytes", + "http", + "pin-project-lite", +] + +[[package]] +name = "httparse" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" + +[[package]] +name = "httpdate" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4a1e36c821dbe04574f602848a19f742f4fb3c98d40449f11bcad18d6b17421" + +[[package]] +name = "hyper" +version = "0.14.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffb1cfd654a8219eaef89881fdb3bb3b1cdc5fa75ded05d6933b2b382e395468" +dependencies = [ + "bytes", + "futures-channel", + "futures-core", + "futures-util", + "h2", + "http", + "http-body", + "httparse", + "httpdate", + "itoa", + "pin-project-lite", + "socket2", + "tokio", + "tower-service", + "tracing", + "want", +] + +[[package]] +name = "hyper-rustls" +version = "0.24.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d78e1e73ec14cf7375674f74d7dde185c8206fd9dea6fb6295e8a98098aaa97" +dependencies = [ + "futures-util", + "http", + "hyper", + "rustls", + "tokio", + "tokio-rustls", +] + +[[package]] +name = "hyper-tls" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905" +dependencies = [ + "bytes", + "hyper", + "native-tls", + "tokio", + "tokio-native-tls", +] + +[[package]] +name = "idna" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d20d6b07bfbc108882d88ed8e37d39636dcc260e15e30c45e6ba089610b917c" +dependencies = [ + "unicode-bidi", + "unicode-normalization", +] + +[[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.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d5477fe2230a79769d8dc68e0eabf5437907c0457a5614a9e8dddb67f65eb65d" +dependencies = [ + "equivalent", + "hashbrown 0.14.0", +] + +[[package]] +name = "instant" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "io-lifetimes" +version = "1.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2" +dependencies = [ + "hermit-abi", + "libc", + "windows-sys", +] + +[[package]] +name = "ipnet" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28b29a3cd74f0f4598934efe3aeba42bae0eb4680554128851ebbecb02af14e6" + +[[package]] +name = "is-terminal" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb0889898416213fab133e1d33a0e5858a48177452750691bde3666d0fdbaf8b" +dependencies = [ + "hermit-abi", + "rustix 0.38.4", + "windows-sys", +] + +[[package]] +name = "itoa" +version = "1.0.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" + +[[package]] +name = "js-sys" +version = "0.3.64" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c5f195fe497f702db0f318b07fdd68edb16955aed830df8363d837542f8f935a" +dependencies = [ + "wasm-bindgen", +] + +[[package]] +name = "lazy_static" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" + +[[package]] +name = "libc" +version = "0.2.147" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" + +[[package]] +name = "linux-raw-sys" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" + +[[package]] +name = "linux-raw-sys" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09fc20d2ca12cb9f044c93e3bd6d32d523e6e2ec3db4f7b2939cd99026ecd3f0" + +[[package]] +name = "lock_api" +version = "0.4.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1cc9717a20b1bb222f333e6a92fd32f7d8a18ddc5a3191a11af45dcbf4dcd16" +dependencies = [ + "autocfg", + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b06a4cde4c0f271a446782e3eff8de789548ce57dbc8eca9292c27f4a42004b4" + +[[package]] +name = "memchr" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" + +[[package]] +name = "mime" +version = "0.3.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" + +[[package]] +name = "miniz_oxide" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" +dependencies = [ + "adler", +] + +[[package]] +name = "mio" +version = "0.8.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "927a765cd3fc26206e66b296465fa9d3e5ab003e651c1b3c060e7956d96b19d2" +dependencies = [ + "libc", + "log", + "wasi", + "windows-sys", +] + +[[package]] +name = "native-tls" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07226173c32f2926027b63cce4bcd8076c3552846cbe7925f3aaffeac0a3b92e" +dependencies = [ + "lazy_static", + "libc", + "log", + "openssl", + "openssl-probe", + "openssl-sys", + "schannel", + "security-framework", + "security-framework-sys", + "tempfile", +] + +[[package]] +name = "num_cpus" +version = "1.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" +dependencies = [ + "hermit-abi", + "libc", +] + +[[package]] +name = "object" +version = "0.31.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8bda667d9f2b5051b8833f59f3bf748b28ef54f850f4fcb389a252aa383866d1" +dependencies = [ + "memchr", +] + +[[package]] +name = "once_cell" +version = "1.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" + +[[package]] +name = "openssl" +version = "0.10.55" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "345df152bc43501c5eb9e4654ff05f794effb78d4efe3d53abc158baddc0703d" +dependencies = [ + "bitflags 1.3.2", + "cfg-if", + "foreign-types", + "libc", + "once_cell", + "openssl-macros", + "openssl-sys", +] + +[[package]] +name = "openssl-macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.26", +] + +[[package]] +name = "openssl-probe" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" + +[[package]] +name = "openssl-sys" +version = "0.9.90" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "374533b0e45f3a7ced10fcaeccca020e66656bc03dac384f852e4e5a7a8104a6" +dependencies = [ + "cc", + "libc", + "pkg-config", + "vcpkg", +] + +[[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.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93f00c865fe7cabf650081affecd3871070f26767e7b2070a3ffae14c654b447" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall 0.3.5", + "smallvec", + "windows-targets", +] + +[[package]] +name = "percent-encoding" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" + +[[package]] +name = "pin-project-lite" +version = "0.2.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c40d25201921e5ff0c862a505c6557ea88568a4e3ace775ab55e93f2f4f9d57" + +[[package]] +name = "pin-utils" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" + +[[package]] +name = "pkg-config" +version = "0.3.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26072860ba924cbfa98ea39c8c19b4dd6a4a25423dbdf219c1eca91aa0cf6964" + +[[package]] +name = "proc-macro2" +version = "1.0.66" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "18fb31db3f9bddb2ea821cde30a9f70117e3f119938b5ee630b7403aa6e2ead9" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5fe8a65d69dd0808184ebb5f836ab526bb259db23c657efa38711b1072ee47f0" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "redox_syscall" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" +dependencies = [ + "bitflags 1.3.2", +] + +[[package]] +name = "redox_syscall" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29" +dependencies = [ + "bitflags 1.3.2", +] + +[[package]] +name = "redox_users" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b033d837a7cf162d7993aded9304e30a83213c648b6e389db233191f891e5c2b" +dependencies = [ + "getrandom", + "redox_syscall 0.2.16", + "thiserror", +] + +[[package]] +name = "reqwest" +version = "0.11.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cde824a14b7c14f85caff81225f411faacc04a2013f41670f41443742b1c1c55" +dependencies = [ + "base64 0.21.2", + "bytes", + "encoding_rs", + "futures-core", + "futures-util", + "h2", + "http", + "http-body", + "hyper", + "hyper-rustls", + "hyper-tls", + "ipnet", + "js-sys", + "log", + "mime", + "native-tls", + "once_cell", + "percent-encoding", + "pin-project-lite", + "rustls", + "rustls-pemfile", + "serde", + "serde_json", + "serde_urlencoded", + "tokio", + "tokio-native-tls", + "tokio-rustls", + "tower-service", + "url", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", + "webpki-roots", + "winreg", +] + +[[package]] +name = "ring" +version = "0.16.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3053cf52e236a3ed746dfc745aa9cacf1b791d846bdaf412f60a8d7d6e17c8fc" +dependencies = [ + "cc", + "libc", + "once_cell", + "spin", + "untrusted", + "web-sys", + "winapi", +] + +[[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.37.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4d69718bf81c6127a49dc64e44a742e8bb9213c0ff8869a22c308f84c1d4ab06" +dependencies = [ + "bitflags 1.3.2", + "errno", + "io-lifetimes", + "libc", + "linux-raw-sys 0.3.8", + "windows-sys", +] + +[[package]] +name = "rustix" +version = "0.38.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a962918ea88d644592894bc6dc55acc6c0956488adcebbfb6e273506b7fd6e5" +dependencies = [ + "bitflags 2.3.3", + "errno", + "libc", + "linux-raw-sys 0.4.3", + "windows-sys", +] + +[[package]] +name = "rustls" +version = "0.21.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "79ea77c539259495ce8ca47f53e66ae0330a8819f67e23ac96ca02f50e7b7d36" +dependencies = [ + "log", + "ring", + "rustls-webpki", + "sct", +] + +[[package]] +name = "rustls-pemfile" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d3987094b1d07b653b7dfdc3f70ce9a1da9c51ac18c1b06b662e4f9a0e9f4b2" +dependencies = [ + "base64 0.21.2", +] + +[[package]] +name = "rustls-webpki" +version = "0.101.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "15f36a6828982f422756984e47912a7a51dcbc2a197aa791158f8ca61cd8204e" +dependencies = [ + "ring", + "untrusted", +] + +[[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 = "schannel" +version = "0.1.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c3733bf4cf7ea0880754e19cb5a462007c4a8c1914bff372ccc95b464f1df88" +dependencies = [ + "windows-sys", +] + +[[package]] +name = "scopeguard" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" + +[[package]] +name = "sct" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d53dcdb7c9f8158937a7981b48accfd39a43af418591a5d008c7b22b5e1b7ca4" +dependencies = [ + "ring", + "untrusted", +] + +[[package]] +name = "security-framework" +version = "2.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fc758eb7bffce5b308734e9b0c1468893cae9ff70ebf13e7090be8dcbcc83a8" +dependencies = [ + "bitflags 1.3.2", + "core-foundation", + "core-foundation-sys", + "libc", + "security-framework-sys", +] + +[[package]] +name = "security-framework-sys" +version = "2.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f51d0c0d83bec45f16480d0ce0058397a69e48fcdc52d1dc8855fb68acbd31a7" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "serde" +version = "1.0.171" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30e27d1e4fd7659406c492fd6cfaf2066ba8773de45ca75e855590f856dc34a9" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.171" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "389894603bd18c46fa56231694f8d827779c0951a667087194cf9de94ed24682" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.26", +] + +[[package]] +name = "serde_json" +version = "1.0.103" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d03b412469450d4404fe8499a268edd7f8b79fecb074b0d812ad64ca21f4031b" +dependencies = [ + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "serde_urlencoded" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" +dependencies = [ + "form_urlencoded", + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "serde_yaml" +version = "0.9.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd5f51e3fdb5b9cdd1577e1cb7a733474191b1aca6a72c2e50913241632c1180" +dependencies = [ + "indexmap 2.0.0", + "itoa", + "ryu", + "serde", + "unsafe-libyaml", +] + +[[package]] +name = "signal-hook" +version = "0.3.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b824b6e687aff278cdbf3b36f07aa52d4bd4099699324d5da86a2ebce3aa00b3" +dependencies = [ + "libc", + "signal-hook-registry", +] + +[[package]] +name = "signal-hook-mio" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29ad2e15f37ec9a6cc544097b78a1ec90001e9f71b81338ca39f430adaca99af" +dependencies = [ + "libc", + "mio", + "signal-hook", +] + +[[package]] +name = "signal-hook-registry" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d8229b473baa5980ac72ef434c4415e70c4b5e71b423043adb4ba059f89c99a1" +dependencies = [ + "libc", +] + +[[package]] +name = "slab" +version = "0.4.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6528351c9bc8ab22353f9d776db39a20288e8d6c37ef8cfe3317cf875eecfc2d" +dependencies = [ + "autocfg", +] + +[[package]] +name = "smallvec" +version = "1.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62bb4feee49fdd9f707ef802e22365a35de4b7b299de4763d44bfea899442ff9" + +[[package]] +name = "socket2" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64a4a911eed85daf18834cfaa86a79b7d266ff93ff5ba14005426219480ed662" +dependencies = [ + "libc", + "winapi", +] + +[[package]] +name = "spin" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" + +[[package]] +name = "strsim" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" + +[[package]] +name = "strum" +version = "0.23.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cae14b91c7d11c9a851d3fbc80a963198998c2a64eec840477fa92d8ce9b70bb" + +[[package]] +name = "strum" +version = "0.24.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "063e6045c0e62079840579a7e47a355ae92f60eb74daaf156fb1e84ba164e63f" + +[[package]] +name = "strum_macros" +version = "0.23.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5bb0dc7ee9c15cea6199cde9a127fa16a4c5819af85395457ad72d68edc85a38" +dependencies = [ + "heck 0.3.3", + "proc-macro2", + "quote", + "rustversion", + "syn 1.0.109", +] + +[[package]] +name = "strum_macros" +version = "0.24.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e385be0d24f186b4ce2f9982191e7101bb737312ad61c1f2f984f34bcf85d59" +dependencies = [ + "heck 0.4.1", + "proc-macro2", + "quote", + "rustversion", + "syn 1.0.109", +] + +[[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.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "45c3457aacde3c65315de5031ec191ce46604304d2446e803d71ade03308d970" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "tempfile" +version = "3.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "31c0432476357e58790aaa47a8efb0c5138f137343f3b5f23bd36a27e3b0a6d6" +dependencies = [ + "autocfg", + "cfg-if", + "fastrand", + "redox_syscall 0.3.5", + "rustix 0.37.23", + "windows-sys", +] + +[[package]] +name = "thiserror" +version = "1.0.43" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a35fc5b8971143ca348fa6df4f024d4d55264f3468c71ad1c2f365b0a4d58c42" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.43" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "463fe12d7993d3b327787537ce8dd4dfa058de32fc2b195ef3cde03dc4771e8f" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.26", +] + +[[package]] +name = "tinyvec" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" +dependencies = [ + "tinyvec_macros", +] + +[[package]] +name = "tinyvec_macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" + +[[package]] +name = "tokio" +version = "1.29.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "532826ff75199d5833b9d2c5fe410f29235e25704ee5f0ef599fb51c21f4a4da" +dependencies = [ + "autocfg", + "backtrace", + "bytes", + "libc", + "mio", + "num_cpus", + "pin-project-lite", + "socket2", + "tokio-macros", + "windows-sys", +] + +[[package]] +name = "tokio-macros" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.26", +] + +[[package]] +name = "tokio-native-tls" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" +dependencies = [ + "native-tls", + "tokio", +] + +[[package]] +name = "tokio-rustls" +version = "0.24.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" +dependencies = [ + "rustls", + "tokio", +] + +[[package]] +name = "tokio-util" +version = "0.7.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "806fe8c2c87eccc8b3267cbae29ed3ab2d0bd37fca70ab622e46aaa9375ddb7d" +dependencies = [ + "bytes", + "futures-core", + "futures-sink", + "pin-project-lite", + "tokio", + "tracing", +] + +[[package]] +name = "tower-service" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" + +[[package]] +name = "tracing" +version = "0.1.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" +dependencies = [ + "cfg-if", + "pin-project-lite", + "tracing-core", +] + +[[package]] +name = "tracing-core" +version = "0.1.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0955b8137a1df6f1a2e9a37d8a6656291ff0297c1a97c24e0d8425fe2312f79a" +dependencies = [ + "once_cell", +] + +[[package]] +name = "try-lock" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed" + +[[package]] +name = "unicode-bidi" +version = "0.3.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" + +[[package]] +name = "unicode-ident" +version = "1.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "301abaae475aa91687eb82514b328ab47a211a533026cb25fc3e519b86adfc3c" + +[[package]] +name = "unicode-normalization" +version = "0.1.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" +dependencies = [ + "tinyvec", +] + +[[package]] +name = "unicode-segmentation" +version = "1.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1dd624098567895118886609431a7c3b8f516e41d30e0643f03d94592a147e36" + +[[package]] +name = "unicode-width" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8b" + +[[package]] +name = "unicode-xid" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" + +[[package]] +name = "unsafe-libyaml" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f28467d3e1d3c6586d8f25fa243f544f5800fec42d97032474e17222c2b75cfa" + +[[package]] +name = "untrusted" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" + +[[package]] +name = "url" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50bff7831e19200a85b17131d085c25d7811bc4e186efdaf54bbd132994a88cb" +dependencies = [ + "form_urlencoded", + "idna", + "percent-encoding", +] + +[[package]] +name = "utf8parse" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" + +[[package]] +name = "uuid" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc5cf98d8186244414c848017f0e2676b3fcb46807f6668a97dfe67359a3c4b7" +dependencies = [ + "getrandom", + "serde", +] + +[[package]] +name = "uuid" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "79daa5ed5740825c40b389c5e50312b9c86df53fccd33f281df655642b43869d" +dependencies = [ + "getrandom", +] + +[[package]] +name = "vcpkg" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" + +[[package]] +name = "want" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" +dependencies = [ + "try-lock", +] + +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" + +[[package]] +name = "wasm-bindgen" +version = "0.2.87" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7706a72ab36d8cb1f80ffbf0e071533974a60d0a308d01a5d0375bf60499a342" +dependencies = [ + "cfg-if", + "wasm-bindgen-macro", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.87" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ef2b6d3c510e9625e5fe6f509ab07d66a760f0885d858736483c32ed7809abd" +dependencies = [ + "bumpalo", + "log", + "once_cell", + "proc-macro2", + "quote", + "syn 2.0.26", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-futures" +version = "0.4.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c02dbc21516f9f1f04f187958890d7e6026df8d16540b7ad9492bc34a67cea03" +dependencies = [ + "cfg-if", + "js-sys", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.87" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dee495e55982a3bd48105a7b947fd2a9b4a8ae3010041b9e0faab3f9cd028f1d" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.87" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.26", + "wasm-bindgen-backend", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.87" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca6ad05a4870b2bf5fe995117d3728437bd27d7cd5f06f13c17443ef369775a1" + +[[package]] +name = "web-sys" +version = "0.3.64" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b85cbef8c220a6abc02aefd892dfc0fc23afb1c6a426316ec33253a3877249b" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "webpki" +version = "0.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f095d78192e208183081cc07bc5515ef55216397af48b873e5edcd72637fa1bd" +dependencies = [ + "ring", + "untrusted", +] + +[[package]] +name = "webpki-roots" +version = "0.22.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6c71e40d7d2c34a5106301fb632274ca37242cd0c9d3e64dbece371a40a2d87" +dependencies = [ + "webpki", +] + +[[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-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.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05d4b17490f70499f20b9e791dcf6a299785ce8af4d709018206dc5b4953e95f" +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.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bc" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3" + +[[package]] +name = "windows_i686_gnu" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241" + +[[package]] +name = "windows_i686_msvc" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca2b8a661f7628cbd23440e50b05d705db3686f894fc9580820623656af974b1" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" + +[[package]] +name = "winreg" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "80d0f4e272c85def139476380b12f9ac60926689dd2e01d4923222f40580869d" +dependencies = [ + "winapi", +] diff --git a/Cargo.toml b/Cargo.toml index 011a5fa..ae54d29 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -24,7 +24,8 @@ clap = { version = "4.0.29", features = ["derive"] } const_format = "0.2.30" serde = { version = "^1.0", features = ["derive"] } serde_json = "^1.0" -cherrybomb-engine = "^0.1" +#cherrybomb-engine = "^0.1" +cherrybomb-engine = { path= "./cherrybomb-engine" } serde_yaml = "^0.9.0" uuid = {version = "1.2.2", features = ["v4"] } dirs = "4.0.0" diff --git a/cherrybomb-engine/Cargo.lock b/cherrybomb-engine/Cargo.lock index 0106d75..fc1d8d4 100644 --- a/cherrybomb-engine/Cargo.lock +++ b/cherrybomb-engine/Cargo.lock @@ -87,8 +87,6 @@ dependencies = [ [[package]] name = "cherrybomb-oas" version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69dec5274a0a239037855a6e6753a093e9690522c6883f2a8bc9288a70b86a68" dependencies = [ "colored", "serde", diff --git a/cherrybomb-engine/Cargo.toml b/cherrybomb-engine/Cargo.toml index 1d87b9a..f0e3ffb 100644 --- a/cherrybomb-engine/Cargo.toml +++ b/cherrybomb-engine/Cargo.toml @@ -13,7 +13,8 @@ edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -cherrybomb-oas = "^0.1" +#cherrybomb-oas = "^0.1" +cherrybomb-oas={path = "../cherrybomb-oas"} anyhow = "1.0.66" thiserror = "1.0.37" serde_json = "^1.0" diff --git a/cherrybomb-engine/src/config.rs b/cherrybomb-engine/src/config.rs index 6fb8cae..3856717 100644 --- a/cherrybomb-engine/src/config.rs +++ b/cherrybomb-engine/src/config.rs @@ -6,12 +6,12 @@ pub enum Profile { Info, #[default] Normal, - Intrusive, + Active, Passive, Full, } -#[derive(Deserialize, Debug, Default)] +#[derive(Deserialize, Debug, Default, Clone)] #[serde(default)] pub struct Config { pub file: std::path::PathBuf, diff --git a/cherrybomb-engine/src/lib.rs b/cherrybomb-engine/src/lib.rs index 34429e9..04e7360 100644 --- a/cherrybomb-engine/src/lib.rs +++ b/cherrybomb-engine/src/lib.rs @@ -9,10 +9,13 @@ use crate::scan::active::active_scanner; use crate::scan::active::http_client::auth::Authorization; use cherrybomb_oas::legacy::legacy_oas::*; use config::Config; +use scan::checks::{ActiveChecks, PassiveChecks}; use scan::passive::passive_scanner; use scan::*; use serde_json::{json, Value}; -use std::collections::HashMap; +use std::collections::{HashMap, HashSet}; +use std::vec; +use strum::IntoEnumIterator; fn verbose_print(config: &Config, required: Option, message: &str) { let required = required.unwrap_or(Verbosity::Normal); @@ -20,6 +23,21 @@ fn verbose_print(config: &Config, required: Option, message: &str) { println!("{message}"); } } +//take config and return hashset of checks to remove +fn merge_config_exclude(config: &Config, mut checks: HashSet) -> HashSet { + if !config.passive_exclude.is_empty() { + for passive_check in config.passive_exclude.iter() { + checks.remove(passive_check); + } + } + + if !config.active_exclude.is_empty() { + for active_check in config.active_exclude.iter() { + checks.remove(active_check); + } + } + checks.clone() +} pub async fn run(config: &Config) -> anyhow::Result { verbose_print(config, None, "Starting Cherrybomb..."); @@ -50,14 +68,40 @@ pub async fn run(config: &Config) -> anyhow::Result { return Err(anyhow::anyhow!("Error creating OAS struct: {}", e)); } }; - match config.profile { config::Profile::Info => run_profile_info(&config, &oas, &oas_json), config::Profile::Normal => run_normal_profile(&config, &oas, &oas_json).await, - config::Profile::Intrusive => todo!("Not implemented!"), - config::Profile::Passive => run_passive_profile(&config, &oas, &oas_json), + config::Profile::Active => { + if !&config.passive_include.is_empty() { + let mut n_config = config.clone(); + let mut vec_passive: Vec = PassiveChecks::iter() + .map(|x| x.name().to_string()) + .collect(); + vec_passive.retain(|check| !config.passive_include.contains(check)); + n_config.passive_exclude = vec_passive; + run_normal_profile(&n_config, &oas, &oas_json).await + } else { + run_active_profile(&config, &oas, &oas_json).await + } + } + + config::Profile::Passive => { + if !&config.active_include.is_empty() { + let mut n_config = config.clone(); + let mut vec_active: Vec = + ActiveChecks::iter().map(|x| x.name().to_string()).collect(); + vec_active.retain(|check| !config.active_include.contains(check)); + n_config.active_exclude = vec_active; + run_normal_profile(&n_config, &oas, &oas_json).await + } else { + run_passive_profile(&config, &oas, &oas_json) + } + } config::Profile::Full => run_full_profile(config, &oas, &oas_json).await, } + //into the match add include test into passive and active, so just create a json with passive and active + //return manually + //modify the config.exclude by the difference between include to all others test. } fn run_profile_info(config: &Config, oas: &OAS3_1, oas_json: &Value) -> anyhow::Result { @@ -99,6 +143,13 @@ async fn run_active_profile( Some(Verbosity::Debug), "Creating active scan struct...", ); + let checks = merge_config_exclude( + config, + ActiveChecks::iter().map(|x| x.name().to_string()).collect(), + ); + let active_checks: Vec = ActiveChecks::iter() + .filter(|check| checks.contains(check.name())) + .collect(); let mut active_scan = match active_scanner::ActiveScan::new(oas.clone(), oas_json.clone()) { Ok(scan) => scan, Err(e) => { @@ -110,7 +161,10 @@ async fn run_active_profile( verbose_print(config, None, "Running active scan..."); let temp_auth = Authorization::None; active_scan - .run(active_scanner::ActiveScanType::Full, &temp_auth) + .run( + active_scanner::ActiveScanType::Partial(active_checks), + &temp_auth, + ) .await; let active_result: HashMap<&str, Vec> = active_scan .checks @@ -128,6 +182,17 @@ fn run_passive_profile(config: &Config, oas: &OAS3_1, oas_json: &Value) -> anyho Some(Verbosity::Debug), "Creating passive scan struct...", ); + //create hashsetand excluding checks + let checks = merge_config_exclude( + config, + PassiveChecks::iter() + .map(|x| x.name().to_string()) + .collect(), + ); + //create vector of passive checks to run + let passive_checks = PassiveChecks::iter() + .filter(|check| checks.contains(check.name())) + .collect(); let mut passive_scan = passive_scanner::PassiveSwaggerScan { swagger: oas.clone(), swagger_value: oas_json.clone(), @@ -136,12 +201,13 @@ fn run_passive_profile(config: &Config, oas: &OAS3_1, oas_json: &Value) -> anyho }; // Running passive scan verbose_print(config, None, "Running passive scan..."); - passive_scan.run(passive_scanner::PassiveScanType::Full); + passive_scan.run(passive_scanner::PassiveScanType::Partial(passive_checks)); let passive_result: HashMap<&str, Vec> = passive_scan .passive_checks .iter() .map(|check| (check.name(), check.inner())) .collect(); + Ok(json!({ "passive": passive_result })) } @@ -174,7 +240,11 @@ async fn run_normal_profile( Ok(report) } -async fn run_full_profile(config: &Config, oas: &OAS3_1, oas_json: &Value) -> anyhow::Result { +async fn run_full_profile( + config: &Config, + oas: &OAS3_1, + oas_json: &Value, +) -> anyhow::Result { let mut report = json!({}); let mut results = HashMap::from([ ("active", run_active_profile(config, oas, oas_json).await), diff --git a/cherrybomb-engine/src/scan/active/active_scanner.rs b/cherrybomb-engine/src/scan/active/active_scanner.rs index b760371..86be413 100644 --- a/cherrybomb-engine/src/scan/active/active_scanner.rs +++ b/cherrybomb-engine/src/scan/active/active_scanner.rs @@ -109,7 +109,6 @@ impl Deserialize<'de>> ActiveScan { }; } - fn payloads_generator(oas: &T, oas_value: &Value) -> Vec { let mut payloads = vec![]; for (path, path_item) in oas.get_paths() { diff --git a/cherrybomb-oas/src/legacy/refs.rs b/cherrybomb-oas/src/legacy/refs.rs index cb4640d..5dcf0bc 100644 --- a/cherrybomb-oas/src/legacy/refs.rs +++ b/cherrybomb-oas/src/legacy/refs.rs @@ -27,7 +27,10 @@ impl Reference { } serde_json::from_value(val.clone()).unwrap() } else { - todo!("external references are not supported yet: {:?}", self.param_ref) + todo!( + "external references are not supported yet: {:?}", + self.param_ref + ) } } } diff --git a/src/telemetry.rs b/src/telemetry.rs index dfcb5ba..7e99f56 100644 --- a/src/telemetry.rs +++ b/src/telemetry.rs @@ -9,7 +9,7 @@ pub async fn send(profile: Profile, verbosity: Verbosity) -> anyhow::Result<()> let profile = match profile { Profile::Info => "ep_table", Profile::Normal => "passive and active oas scan", - Profile::Intrusive => "passive and active oas scan", + Profile::Active => "active oas scan", Profile::Passive => "passive oas scan", Profile::Full => "passive and active oas scan", }; From 643df743d926fb0a72b57e1c424ce0699a1f41d2 Mon Sep 17 00:00:00 2001 From: Nathan Date: Tue, 18 Jul 2023 21:40:08 +0300 Subject: [PATCH 2/6] cargo.. --- Cargo.toml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index ae54d29..011a5fa 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -24,8 +24,7 @@ clap = { version = "4.0.29", features = ["derive"] } const_format = "0.2.30" serde = { version = "^1.0", features = ["derive"] } serde_json = "^1.0" -#cherrybomb-engine = "^0.1" -cherrybomb-engine = { path= "./cherrybomb-engine" } +cherrybomb-engine = "^0.1" serde_yaml = "^0.9.0" uuid = {version = "1.2.2", features = ["v4"] } dirs = "4.0.0" From 24e0f9eec7db5ce9a98ed4b357acfd40d5208b7b Mon Sep 17 00:00:00 2001 From: Nathan Date: Thu, 20 Jul 2023 11:47:48 +0300 Subject: [PATCH 3/6] impl --- cherrybomb-engine/src/config.rs | 14 ++++++++++++++ cherrybomb-engine/src/lib.rs | 21 ++------------------- 2 files changed, 16 insertions(+), 19 deletions(-) diff --git a/cherrybomb-engine/src/config.rs b/cherrybomb-engine/src/config.rs index 3856717..0573ce7 100644 --- a/cherrybomb-engine/src/config.rs +++ b/cherrybomb-engine/src/config.rs @@ -25,7 +25,21 @@ pub struct Config { pub security: Vec, pub ignore_tls_errors: bool, pub no_color: bool, + pub active_checks: Vec, + pub passive_checks: Vec } +impl Config { + pub fn update_checks_passive(&mut self, mut vec_checks: Vec ) { + vec_checks.retain(|check| !self.passive_exclude.contains(check)); + self.passive_checks = vec_checks; + + } + pub fn update_checks_active(&mut self, mut vec_checks: Vec ) { + vec_checks.retain(|check| !self.active_exclude.contains(check)); + self.active_checks = vec_checks; + } +} + #[derive(ValueEnum, Deserialize, Clone, Debug, Default, PartialOrd, PartialEq)] pub enum Verbosity { diff --git a/cherrybomb-engine/src/lib.rs b/cherrybomb-engine/src/lib.rs index 04e7360..8f6a92c 100644 --- a/cherrybomb-engine/src/lib.rs +++ b/cherrybomb-engine/src/lib.rs @@ -23,21 +23,7 @@ fn verbose_print(config: &Config, required: Option, message: &str) { println!("{message}"); } } -//take config and return hashset of checks to remove -fn merge_config_exclude(config: &Config, mut checks: HashSet) -> HashSet { - if !config.passive_exclude.is_empty() { - for passive_check in config.passive_exclude.iter() { - checks.remove(passive_check); - } - } - if !config.active_exclude.is_empty() { - for active_check in config.active_exclude.iter() { - checks.remove(active_check); - } - } - checks.clone() -} pub async fn run(config: &Config) -> anyhow::Result { verbose_print(config, None, "Starting Cherrybomb..."); @@ -143,12 +129,9 @@ async fn run_active_profile( Some(Verbosity::Debug), "Creating active scan struct...", ); - let checks = merge_config_exclude( - config, - ActiveChecks::iter().map(|x| x.name().to_string()).collect(), - ); + &config.update_checks_active( ActiveChecks::iter().map(|x| x.name().to_string()).collect()); let active_checks: Vec = ActiveChecks::iter() - .filter(|check| checks.contains(check.name())) + .filter(|check| config.active_checks.contains(check.name().to_string().as_ref())) .collect(); let mut active_scan = match active_scanner::ActiveScan::new(oas.clone(), oas_json.clone()) { Ok(scan) => scan, From 0d7ca25e1bb70de33d0bb99a7b68b8561a4fa75e Mon Sep 17 00:00:00 2001 From: Nathan Date: Thu, 20 Jul 2023 18:34:09 +0300 Subject: [PATCH 4/6] reformat code with matches --- Cargo.toml | 3 +- cherrybomb-engine/src/config.rs | 15 +-- cherrybomb-engine/src/lib.rs | 168 +++++++++++++++++---------- cherrybomb-engine/src/scan/macros.rs | 13 +++ src/main.rs | 2 +- 5 files changed, 128 insertions(+), 73 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 011a5fa..fddbb51 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -24,7 +24,8 @@ clap = { version = "4.0.29", features = ["derive"] } const_format = "0.2.30" serde = { version = "^1.0", features = ["derive"] } serde_json = "^1.0" -cherrybomb-engine = "^0.1" +#cherrybomb-engine = "^0.1" +cherrybomb-engine = {path="cherrybomb-engine"} serde_yaml = "^0.9.0" uuid = {version = "1.2.2", features = ["v4"] } dirs = "4.0.0" diff --git a/cherrybomb-engine/src/config.rs b/cherrybomb-engine/src/config.rs index 0573ce7..13262c7 100644 --- a/cherrybomb-engine/src/config.rs +++ b/cherrybomb-engine/src/config.rs @@ -9,6 +9,7 @@ pub enum Profile { Active, Passive, Full, + OWASP } #[derive(Deserialize, Debug, Default, Clone)] @@ -26,21 +27,21 @@ pub struct Config { pub ignore_tls_errors: bool, pub no_color: bool, pub active_checks: Vec, - pub passive_checks: Vec + pub passive_checks: Vec, } impl Config { - pub fn update_checks_passive(&mut self, mut vec_checks: Vec ) { - vec_checks.retain(|check| !self.passive_exclude.contains(check)); - self.passive_checks = vec_checks; - + pub fn update_checks_passive(&mut self, mut vec_checks: Vec) { + //get a list of passive checks and remove exclude + vec_checks.retain(|check| !self.passive_exclude.contains(check)); + self.passive_checks = vec_checks; } - pub fn update_checks_active(&mut self, mut vec_checks: Vec ) { + pub fn update_checks_active(&mut self, mut vec_checks: Vec) { + //get a list of active checks and remove exclude vec_checks.retain(|check| !self.active_exclude.contains(check)); self.active_checks = vec_checks; } } - #[derive(ValueEnum, Deserialize, Clone, Debug, Default, PartialOrd, PartialEq)] pub enum Verbosity { Quiet, diff --git a/cherrybomb-engine/src/lib.rs b/cherrybomb-engine/src/lib.rs index 8f6a92c..2d059bc 100644 --- a/cherrybomb-engine/src/lib.rs +++ b/cherrybomb-engine/src/lib.rs @@ -24,8 +24,7 @@ fn verbose_print(config: &Config, required: Option, message: &str) { } } - -pub async fn run(config: &Config) -> anyhow::Result { +pub async fn run(config: &mut Config) -> anyhow::Result { verbose_print(config, None, "Starting Cherrybomb..."); // Reading OAS file to string @@ -55,42 +54,31 @@ pub async fn run(config: &Config) -> anyhow::Result { } }; match config.profile { - config::Profile::Info => run_profile_info(&config, &oas, &oas_json), - config::Profile::Normal => run_normal_profile(&config, &oas, &oas_json).await, + config::Profile::Info => run_profile_info(config, &oas, &oas_json), + config::Profile::Normal => run_normal_profile(config, &oas, &oas_json).await, config::Profile::Active => { if !&config.passive_include.is_empty() { - let mut n_config = config.clone(); - let mut vec_passive: Vec = PassiveChecks::iter() - .map(|x| x.name().to_string()) - .collect(); - vec_passive.retain(|check| !config.passive_include.contains(check)); - n_config.passive_exclude = vec_passive; - run_normal_profile(&n_config, &oas, &oas_json).await + config.passive_checks = config.passive_include.clone(); + run_normal_profile(config, &oas, &oas_json).await } else { - run_active_profile(&config, &oas, &oas_json).await + run_active_profile(config, &oas, &oas_json).await } } config::Profile::Passive => { if !&config.active_include.is_empty() { - let mut n_config = config.clone(); - let mut vec_active: Vec = - ActiveChecks::iter().map(|x| x.name().to_string()).collect(); - vec_active.retain(|check| !config.active_include.contains(check)); - n_config.active_exclude = vec_active; - run_normal_profile(&n_config, &oas, &oas_json).await + config.active_checks = config.active_include.clone(); + run_normal_profile(config, &oas, &oas_json).await } else { - run_passive_profile(&config, &oas, &oas_json) + run_passive_profile(config, &oas, &oas_json) } } config::Profile::Full => run_full_profile(config, &oas, &oas_json).await, + config::Profile::OWASP => todo!("not implemented yet!"), } - //into the match add include test into passive and active, so just create a json with passive and active - //return manually - //modify the config.exclude by the difference between include to all others test. } -fn run_profile_info(config: &Config, oas: &OAS3_1, oas_json: &Value) -> anyhow::Result { +fn run_profile_info(config: &mut Config, oas: &OAS3_1, oas_json: &Value) -> anyhow::Result { // Creating parameter list verbose_print(config, None, "Creating param list..."); let param_scan = ParamTable::new::(oas_json); @@ -119,7 +107,7 @@ fn run_profile_info(config: &Config, oas: &OAS3_1, oas_json: &Value) -> anyhow:: } async fn run_active_profile( - config: &Config, + config: &mut Config, oas: &OAS3_1, oas_json: &Value, ) -> anyhow::Result { @@ -129,10 +117,6 @@ async fn run_active_profile( Some(Verbosity::Debug), "Creating active scan struct...", ); - &config.update_checks_active( ActiveChecks::iter().map(|x| x.name().to_string()).collect()); - let active_checks: Vec = ActiveChecks::iter() - .filter(|check| config.active_checks.contains(check.name().to_string().as_ref())) - .collect(); let mut active_scan = match active_scanner::ActiveScan::new(oas.clone(), oas_json.clone()) { Ok(scan) => scan, Err(e) => { @@ -143,59 +127,115 @@ async fn run_active_profile( // Running active scan verbose_print(config, None, "Running active scan..."); let temp_auth = Authorization::None; - active_scan - .run( - active_scanner::ActiveScanType::Partial(active_checks), - &temp_auth, - ) - .await; - let active_result: HashMap<&str, Vec> = active_scan - .checks - .iter() - .map(|check| (check.name(), check.inner())) - .collect(); - let report = json!({ "active": active_result }); - Ok(report) + + let active_result: HashMap<&str, Vec> = match config.active_checks.is_empty() { + true => { + // if empty, active profile and exclude active checks is set + + let all_active_checks = ActiveChecks::iter().map(|x| x.name().to_string()).collect(); + config.update_checks_active(all_active_checks); + + //create a vec of active scan checks + let active_checks = ActiveChecks::create_checks(config.active_checks.clone()); + + active_scan + .run( + active_scanner::ActiveScanType::Partial(active_checks), + &temp_auth, + ) + .await; + active_scan + .checks + .iter() + .map(|check| (check.name(), check.inner())) + .collect() + } + false => { + // if the active_checks not empty, active include_checks and passive profile is set + let active_checks_to_run = ActiveChecks::iter() + .filter(|check| config.active_checks.contains(&check.name().to_string())) + .collect(); + active_scan + .run( + active_scanner::ActiveScanType::Partial(active_checks_to_run), + &temp_auth, + ) + .await; + active_scan + .checks + .iter() + .map(|check| (check.name(), check.inner())) + .collect() + } + }; + + + Ok(json!({ "active": active_result })) } -fn run_passive_profile(config: &Config, oas: &OAS3_1, oas_json: &Value) -> anyhow::Result { - // Creating passive scan struct +fn run_passive_profile( + config: &mut Config, + oas: &OAS3_1, + oas_json: &Value, +) -> anyhow::Result { verbose_print( config, Some(Verbosity::Debug), "Creating passive scan struct...", ); - //create hashsetand excluding checks - let checks = merge_config_exclude( - config, - PassiveChecks::iter() - .map(|x| x.name().to_string()) - .collect(), - ); - //create vector of passive checks to run - let passive_checks = PassiveChecks::iter() - .filter(|check| checks.contains(check.name())) - .collect(); + // Creating passive scan struct let mut passive_scan = passive_scanner::PassiveSwaggerScan { swagger: oas.clone(), swagger_value: oas_json.clone(), - passive_checks: vec![], //TODO create check list from config + passive_checks: vec![], verbosity: 0, }; + // Running passive scan verbose_print(config, None, "Running passive scan..."); - passive_scan.run(passive_scanner::PassiveScanType::Partial(passive_checks)); - let passive_result: HashMap<&str, Vec> = passive_scan - .passive_checks - .iter() - .map(|check| (check.name(), check.inner())) - .collect(); - Ok(json!({ "passive": passive_result })) + let passive_result: HashMap<&str, Vec> = match config.passive_checks.is_empty() { + true => { + // if empty, passive profile and exclude passive checks is set + let all_passive_checks = PassiveChecks::iter() + .map(|x| x.name().to_string()) + .collect(); //collect all passive checks + config.update_checks_passive(all_passive_checks); + + //create vector of passive checks to run + let passive_checks_to_run = PassiveChecks::iter() + .filter(|check| config.active_checks.contains(&check.name().to_string())) + .collect(); + passive_scan.run(passive_scanner::PassiveScanType::Partial( + passive_checks_to_run, + )); + passive_scan + .passive_checks + .iter() + .map(|check| (check.name(), check.inner())) + .collect() + } + false => { + // if the passive_checks not empty,so passive include_checks and active profile is set + let passive_checks_to_run = PassiveChecks::iter() + .filter(|check| config.passive_checks.contains(&check.name().to_string())) + .collect(); + passive_scan.run(passive_scanner::PassiveScanType::Partial( + passive_checks_to_run, + )); + passive_scan + .passive_checks + .iter() + .map(|check| (check.name(), check.inner())) + .collect() + } + }; + Ok(json!({"passive": passive_result})) } + async fn run_normal_profile( - config: &Config, + config: &mut Config, oas: &OAS3_1, oas_json: &Value, ) -> anyhow::Result { @@ -224,7 +264,7 @@ async fn run_normal_profile( } async fn run_full_profile( - config: &Config, + config: &mut Config, oas: &OAS3_1, oas_json: &Value, ) -> anyhow::Result { diff --git a/cherrybomb-engine/src/scan/macros.rs b/cherrybomb-engine/src/scan/macros.rs index de24dc2..59eaa29 100644 --- a/cherrybomb-engine/src/scan/macros.rs +++ b/cherrybomb-engine/src/scan/macros.rs @@ -37,6 +37,12 @@ macro_rules! impl_passive_checks{ )* } } + pub fn create_checks( vec_checks: Vec) ->Vec{ //get a vec of checks name and create check active struct + vec_checks + .into_iter() + .filter_map(|name| ActiveChecks::from_string(&name)) + .collect() + } } impl PassiveSwaggerScan{ @@ -90,7 +96,14 @@ macro_rules! impl_active_checks{ )* } } + pub fn create_checks( vec_checks: Vec) ->Vec{ //get a vec of checks name and create passive check struct + vec_checks + .into_iter() + .filter_map(|name| ActiveChecks::from_string(&name)) + .collect() + } } + impl ActiveScan{ pub async fn run_check(&self,check:ActiveChecks,auth:&Authorization)->ActiveChecks{ match check{ diff --git a/src/main.rs b/src/main.rs index b08a12b..86fef40 100644 --- a/src/main.rs +++ b/src/main.rs @@ -74,7 +74,7 @@ async fn main() -> anyhow::Result { if !opt.no_telemetry { telemetry::send(config.profile.clone(), config.verbosity.clone()).await?; } - let json_val = cherrybomb_engine::run(&config).await?; + let json_val = cherrybomb_engine::run(&mut config).await?; match print_tables(json_val, &opt) { Ok(exit_code) => Ok(exit_code), Err(e) => Err(anyhow::anyhow!("Error printing tables: {}", e)), From bc92ff089742722df89e627bc1198acf16586c87 Mon Sep 17 00:00:00 2001 From: Nathan Date: Sun, 23 Jul 2023 14:33:40 +0300 Subject: [PATCH 5/6] updated macros --- cherrybomb-engine/src/config.rs | 2 +- cherrybomb-engine/src/lib.rs | 44 ++++++++++++++++------------ cherrybomb-engine/src/scan/macros.rs | 6 ++-- 3 files changed, 29 insertions(+), 23 deletions(-) diff --git a/cherrybomb-engine/src/config.rs b/cherrybomb-engine/src/config.rs index 13262c7..6a9ce8a 100644 --- a/cherrybomb-engine/src/config.rs +++ b/cherrybomb-engine/src/config.rs @@ -9,7 +9,7 @@ pub enum Profile { Active, Passive, Full, - OWASP + OWASP, } #[derive(Deserialize, Debug, Default, Clone)] diff --git a/cherrybomb-engine/src/lib.rs b/cherrybomb-engine/src/lib.rs index 2d059bc..f242b24 100644 --- a/cherrybomb-engine/src/lib.rs +++ b/cherrybomb-engine/src/lib.rs @@ -58,7 +58,7 @@ pub async fn run(config: &mut Config) -> anyhow::Result { config::Profile::Normal => run_normal_profile(config, &oas, &oas_json).await, config::Profile::Active => { if !&config.passive_include.is_empty() { - config.passive_checks = config.passive_include.clone(); + config.passive_checks = config.passive_include.clone(); //passive include into passive checks run_normal_profile(config, &oas, &oas_json).await } else { run_active_profile(config, &oas, &oas_json).await @@ -127,16 +127,16 @@ async fn run_active_profile( // Running active scan verbose_print(config, None, "Running active scan..."); let temp_auth = Authorization::None; - let active_result: HashMap<&str, Vec> = match config.active_checks.is_empty() { true => { - // if empty, active profile and exclude active checks is set - + // if empty, active profile and exclude_active checks is set + //create a vec of active scan checks + let all_active_checks = ActiveChecks::iter().map(|x| x.name().to_string()).collect(); config.update_checks_active(all_active_checks); //create a vec of active scan checks - let active_checks = ActiveChecks::create_checks(config.active_checks.clone()); + let active_checks = ActiveChecks::create_checks(&config.active_checks); active_scan .run( @@ -151,10 +151,12 @@ async fn run_active_profile( .collect() } false => { - // if the active_checks not empty, active include_checks and passive profile is set - let active_checks_to_run = ActiveChecks::iter() - .filter(|check| config.active_checks.contains(&check.name().to_string())) - .collect(); + // if the active_checks not empty, active include_checks and passive profile is set + + // let active_checks_to_run = ActiveChecks::iter() + // .filter(|check| config.active_checks.contains(&check.name().to_string())) + // .collect(); + let active_checks_to_run = ActiveChecks::create_checks(&config.active_checks.clone()); //create active check vec active_scan .run( active_scanner::ActiveScanType::Partial(active_checks_to_run), @@ -169,7 +171,6 @@ async fn run_active_profile( } }; - Ok(json!({ "active": active_result })) } @@ -196,16 +197,19 @@ fn run_passive_profile( let passive_result: HashMap<&str, Vec> = match config.passive_checks.is_empty() { true => { - // if empty, passive profile and exclude passive checks is set + // if passive_checks empty, passive profile and exclude passive checks is set let all_passive_checks = PassiveChecks::iter() .map(|x| x.name().to_string()) .collect(); //collect all passive checks config.update_checks_passive(all_passive_checks); //create vector of passive checks to run - let passive_checks_to_run = PassiveChecks::iter() - .filter(|check| config.active_checks.contains(&check.name().to_string())) - .collect(); + + // let passive_checks_to_run = PassiveChecks::iter() + // .filter(|check| config.active_checks.contains(&check.name().to_string())) + // .collect(); + + let passive_checks_to_run = PassiveChecks::create_checks(&config.passive_checks); passive_scan.run(passive_scanner::PassiveScanType::Partial( passive_checks_to_run, )); @@ -216,10 +220,13 @@ fn run_passive_profile( .collect() } false => { - // if the passive_checks not empty,so passive include_checks and active profile is set - let passive_checks_to_run = PassiveChecks::iter() - .filter(|check| config.passive_checks.contains(&check.name().to_string())) - .collect(); + // if the passive_checks not empty, so passive include_checks and active profile is set + + // let passive_checks_to_run = PassiveChecks::iter() + // .filter(|check| config.passive_checks.contains(&check.name().to_string())) + // .collect(); //create vec of passive checks + + let passive_checks_to_run = PassiveChecks::create_checks(&config.passive_checks); passive_scan.run(passive_scanner::PassiveScanType::Partial( passive_checks_to_run, )); @@ -233,7 +240,6 @@ fn run_passive_profile( Ok(json!({"passive": passive_result})) } - async fn run_normal_profile( config: &mut Config, oas: &OAS3_1, diff --git a/cherrybomb-engine/src/scan/macros.rs b/cherrybomb-engine/src/scan/macros.rs index 59eaa29..b2a1dc9 100644 --- a/cherrybomb-engine/src/scan/macros.rs +++ b/cherrybomb-engine/src/scan/macros.rs @@ -37,10 +37,10 @@ macro_rules! impl_passive_checks{ )* } } - pub fn create_checks( vec_checks: Vec) ->Vec{ //get a vec of checks name and create check active struct + pub fn create_checks( vec_checks: &Vec) ->Vec{ //get a vec of checks name and create check passive struct vec_checks .into_iter() - .filter_map(|name| ActiveChecks::from_string(&name)) + .filter_map(|name| PassiveChecks::from_string(&name)) .collect() } @@ -96,7 +96,7 @@ macro_rules! impl_active_checks{ )* } } - pub fn create_checks( vec_checks: Vec) ->Vec{ //get a vec of checks name and create passive check struct + pub fn create_checks( vec_checks: &Vec) ->Vec{ //get a vec of checks name and create passive check struct vec_checks .into_iter() .filter_map(|name| ActiveChecks::from_string(&name)) From a9d51083487f749f8f28836e2a3d5d845adec4f1 Mon Sep 17 00:00:00 2001 From: Nathan Date: Sun, 23 Jul 2023 14:44:49 +0300 Subject: [PATCH 6/6] fixed cargo tml --- Cargo.toml | 3 +-- cherrybomb-engine/Cargo.lock | 2 ++ cherrybomb-engine/Cargo.toml | 3 +-- src/telemetry.rs | 1 + 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index fddbb51..011a5fa 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -24,8 +24,7 @@ clap = { version = "4.0.29", features = ["derive"] } const_format = "0.2.30" serde = { version = "^1.0", features = ["derive"] } serde_json = "^1.0" -#cherrybomb-engine = "^0.1" -cherrybomb-engine = {path="cherrybomb-engine"} +cherrybomb-engine = "^0.1" serde_yaml = "^0.9.0" uuid = {version = "1.2.2", features = ["v4"] } dirs = "4.0.0" diff --git a/cherrybomb-engine/Cargo.lock b/cherrybomb-engine/Cargo.lock index fc1d8d4..0106d75 100644 --- a/cherrybomb-engine/Cargo.lock +++ b/cherrybomb-engine/Cargo.lock @@ -87,6 +87,8 @@ dependencies = [ [[package]] name = "cherrybomb-oas" version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69dec5274a0a239037855a6e6753a093e9690522c6883f2a8bc9288a70b86a68" dependencies = [ "colored", "serde", diff --git a/cherrybomb-engine/Cargo.toml b/cherrybomb-engine/Cargo.toml index f0e3ffb..1d87b9a 100644 --- a/cherrybomb-engine/Cargo.toml +++ b/cherrybomb-engine/Cargo.toml @@ -13,8 +13,7 @@ edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -#cherrybomb-oas = "^0.1" -cherrybomb-oas={path = "../cherrybomb-oas"} +cherrybomb-oas = "^0.1" anyhow = "1.0.66" thiserror = "1.0.37" serde_json = "^1.0" diff --git a/src/telemetry.rs b/src/telemetry.rs index 7e99f56..c8185dd 100644 --- a/src/telemetry.rs +++ b/src/telemetry.rs @@ -12,6 +12,7 @@ pub async fn send(profile: Profile, verbosity: Verbosity) -> anyhow::Result<()> Profile::Active => "active oas scan", Profile::Passive => "passive oas scan", Profile::Full => "passive and active oas scan", + Profile::OWASP => "active oas scan", }; let token = match get_token(verbosity) { Ok(token) => token,