diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index c50e8c73..bc95ffd3 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -10,19 +10,47 @@ env: jobs: build: - - runs-on: ubuntu-latest - + strategy: + fail-fast: false + matrix: + info: + - { + os: "ubuntu-latest", + target: "x86_64-unknown-linux-gnu", + cross: false, + } + - { + os: "ubuntu-latest", + target: "x86_64-unknown-linux-musl", + cross: true, + } + - { os: "macOS-latest", target: "x86_64-apple-darwin", cross: false } + - { os: "macOS-latest", target: "aarch64-apple-darwin", cross: false } + - { + os: "windows-latest", + target: "x86_64-pc-windows-msvc", + cross: false, + } + - { + os: "windows-latest", + target: "i686-pc-windows-msvc", + cross: false, + } + runs-on: ${{ matrix.info.os }} steps: - uses: actions/checkout@v2 with: submodules: recursive - - uses: actions-rs/toolchain@v1 + - name: Set up Rust toolchain + if: ${{ steps.skip_check.outputs.should_skip != 'true' }} + uses: dtolnay/rust-toolchain@88e7c2e1da2693cf72d58fce9416206818e61dea # https://github.com/dtolnay/rust-toolchain/commit/88e7c2e1da2693cf72d58fce9416206818e61dea with: toolchain: stable - profile: minimal - components: rustfmt - override: true + components: rustfmt, clippy + target: ${{ matrix.info.target }} + - name: Enable Rust cache + if: ${{ steps.skip_check.outputs.should_skip != 'true' }} + uses: Swatinem/rust-cache@cb2cf0cc7c5198d3364b9630e2c3d457f160790c # 1.4.0 - name: Fmt Check run: cargo fmt -- --check - name: Prepare Clippy @@ -32,7 +60,17 @@ jobs: with: args: --all-targets -- -D warnings token: ${{ secrets.GITHUB_TOKEN }} - - name: Build - run: cargo build --verbose + - name: Build tests + if: ${{ steps.skip_check.outputs.should_skip != 'true' }} + uses: ClementTsang/cargo-action@v0.0.2 + with: + command: test + args: --no-run --locked ${{ matrix.features }} --target=${{ matrix.info.target }} + use-cross: ${{ matrix.info.cross }} + cross-version: 0.2.4 + env: + RUST_BACKTRACE: full - name: Run tests - run: RUST_TEST_THREADS=1 cargo test --verbose \ No newline at end of file + env: + RUST_TEST_THREADS: 1 + run: cargo test --verbose \ No newline at end of file diff --git a/CHANGELOG-Japanese.md b/CHANGELOG-Japanese.md index e06b8a38..296b665b 100644 --- a/CHANGELOG-Japanese.md +++ b/CHANGELOG-Japanese.md @@ -1,5 +1,13 @@ # 変更点 +## 1.x.x [2022/XX/XX] + +**新機能:** + +**改善:** + +**バグ修正:** + ## v1.6.0 [2022/09/16] **新機能:** diff --git a/CHANGELOG.md b/CHANGELOG.md index 32092666..52eb2549 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changes +## 1.x.x [2022/XX/XX] + +**New Features:** + +**Enhancements:** + +**Bug Fixes:** + ## v1.6.0 [2022/09/16] **New Features:** diff --git a/Cargo.lock b/Cargo.lock index ed2c707e..e07add2c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -193,9 +193,9 @@ dependencies = [ [[package]] name = "clap" -version = "3.2.21" +version = "3.2.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ed5341b2301a26ab80be5cbdced622e80ed808483c52e45e3310a877d3b37d7" +checksum = "86447ad904c7fb335a790c9d7fe3d0d971dc523b8ccd1561a520de9a85302750" dependencies = [ "atty", "bitflags", @@ -720,7 +720,7 @@ dependencies = [ [[package]] name = "hayabusa" -version = "1.6.0" +version = "1.7.0-dev" dependencies = [ "base64", "bytesize", @@ -860,14 +860,13 @@ dependencies = [ [[package]] name = "iana-time-zone" -version = "0.1.48" +version = "0.1.50" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "237a0714f28b1ee39ccec0770ccb544eb02c9ef2c82bb096230eefcffa6468b0" +checksum = "fd911b35d940d2bd0bea0f9100068e5b97b51a1cbe13d13382f132e0365257a0" dependencies = [ "android_system_properties", "core-foundation-sys", "js-sys", - "once_cell", "wasm-bindgen", "winapi", ] @@ -892,18 +891,6 @@ dependencies = [ "hashbrown", ] -[[package]] -name = "indicatif" -version = "0.16.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d207dc617c7a380ab07ff572a6e52fa202a2a8f355860ac9c38e23f8196be1b" -dependencies = [ - "console", - "lazy_static", - "number_prefix", - "regex", -] - [[package]] name = "indoc" version = "1.0.7" @@ -936,9 +923,9 @@ dependencies = [ [[package]] name = "itertools" -version = "0.10.4" +version = "0.10.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8bf247779e67a9082a4790b45e71ac7cfd1321331a5c856a74a9faebdab78d0" +checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" dependencies = [ "either", ] @@ -978,9 +965,9 @@ dependencies = [ [[package]] name = "jobserver" -version = "0.1.24" +version = "0.1.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af25a77299a7f711a01975c35a6a424eb6862092cc2d6c72c4ed6cbc56dfc1fa" +checksum = "068b1ee6743e4d11fb9c6a1e6064b3693a1b600e7f5f5988047d98b3dc9fb90b" dependencies = [ "libc", ] @@ -996,19 +983,17 @@ dependencies = [ [[package]] name = "krapslog" -version = "0.4.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70d4d54b2c8b875b6692487e5269cb66f12cd51af11fe1807f135ad0d6b771de" +checksum = "6a5e504b81adacf85c2e9e5c4e419a9e657a2a8ff4c5153f8586bfdd8b3083ab" dependencies = [ "anyhow", "atty", "chrono", "clap", "file-chunker", - "indicatif", "memmap2", "num_cpus", - "progress-streams", "rayon", "regex", "tempfile", @@ -1023,9 +1008,9 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.132" +version = "0.2.133" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8371e4e5341c3a96db127eb2465ac681ced4c433e01dd0e938adbef26ba93ba5" +checksum = "c0f80d65747a3e43d1596c7c5492d95d5edddaabd45a7fcdb02b95f644164966" [[package]] name = "libgit2-sys" @@ -1081,9 +1066,9 @@ checksum = "d4d2456c373231a208ad294c33dc5bff30051eafd954cd4caae83a712b12854d" [[package]] name = "lock_api" -version = "0.4.8" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f80bf5aacaf25cbfc8210d1cfb718f2bf3b11c4c54e5afe36c236853a8ec390" +checksum = "435011366fe56583b16cf956f9df0095b405b82d76425bc8981c0e22e60ec4df" dependencies = [ "autocfg", "scopeguard", @@ -1208,17 +1193,11 @@ dependencies = [ "libc", ] -[[package]] -name = "number_prefix" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "830b246a0e5f20af87141b25c173cd1b609bd7779a4617d6ec582abaf90870f3" - [[package]] name = "once_cell" -version = "1.14.0" +version = "1.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f7254b99e31cad77da24b08ebf628882739a608578bb1bcdfc1f9c21260d7c0" +checksum = "e82dad04139b71a90c080c8463fe0dc7902db5192d939bd0950f074d014339e1" [[package]] name = "openssl" @@ -1399,12 +1378,6 @@ dependencies = [ "unicode-ident", ] -[[package]] -name = "progress-streams" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e965d96c8162c607b0cd8d66047ad3c9fd35273c134d994327882c6e47f986a7" - [[package]] name = "pulldown-cmark" version = "0.9.2" @@ -1578,9 +1551,9 @@ dependencies = [ [[package]] name = "rustix" -version = "0.35.9" +version = "0.35.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72c825b8aa8010eb9ee99b75f05e10180b9278d161583034d7574c9d617aeada" +checksum = "af895b90e5c071badc3136fc10ff0bcfc98747eadbaf43ed8f214e07ba8f8477" dependencies = [ "bitflags", "errno", @@ -1643,18 +1616,18 @@ checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" [[package]] name = "serde" -version = "1.0.144" +version = "1.0.145" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f747710de3dcd43b88c9168773254e809d8ddbdf9653b84e2554ab219f17860" +checksum = "728eb6351430bccb993660dfffc5a72f91ccc1295abaa8ce19b27ebe4f75568b" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.144" +version = "1.0.145" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94ed3a816fb1d101812f83e789f888322c34e291f894f19590dc310963e87a00" +checksum = "81fa1584d3d1bcacd84c277a0dfe21f5b0f6accf4a23d04d4c6d61f1af522b4c" dependencies = [ "proc-macro2", "quote", @@ -1850,9 +1823,9 @@ dependencies = [ [[package]] name = "syn" -version = "1.0.99" +version = "1.0.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58dbef6ec655055e20b86b15a8cc6d439cca19b667537ac6a1369572d151ab13" +checksum = "52205623b1b0f064a4e71182c3b18ae902267282930c6d5462c91b859668426e" dependencies = [ "proc-macro2", "quote", @@ -2108,9 +2081,9 @@ checksum = "dcc811dc4066ac62f84f11307873c4850cb653bfa9b1719cee2bd2204a4bc5dd" [[package]] name = "unicode-normalization" -version = "0.1.21" +version = "0.1.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "854cbdc4f7bc6ae19c820d44abdc3277ac3e1b2b93db20a636825d9322fb60e6" +checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" dependencies = [ "tinyvec", ] diff --git a/Cargo.toml b/Cargo.toml index b672d7c7..20401c76 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "hayabusa" -version = "1.6.0" +version = "1.7.0-dev" authors = ["Yamato Security @SecurityYamato"] edition = "2021" diff --git a/rules b/rules index fa75078d..fe99c87c 160000 --- a/rules +++ b/rules @@ -1 +1 @@ -Subproject commit fa75078de6763374a4a4efd10d0d74dfa35241b1 +Subproject commit fe99c87c886ca5b66b5e67242eeddfacc469d420 diff --git a/src/detections/detection.rs b/src/detections/detection.rs index f1b5af43..507a3ec8 100644 --- a/src/detections/detection.rs +++ b/src/detections/detection.rs @@ -364,7 +364,7 @@ impl Detection { } let detect_info = DetectInfo { - rulepath: (&rule.rulepath).to_owned(), + rulepath: rule.rulepath.to_owned(), ruletitle: rule.yaml["title"].as_str().unwrap_or("-").to_string(), level: LEVEL_ABBR.get(&level).unwrap_or(&level).to_string(), computername: record_info.record["Event"]["System"]["Computer"] @@ -495,7 +495,7 @@ impl Detection { } let detect_info = DetectInfo { - rulepath: (&rule.rulepath).to_owned(), + rulepath: rule.rulepath.to_owned(), ruletitle: rule.yaml["title"].as_str().unwrap_or("-").to_string(), level: LEVEL_ABBR.get(&level).unwrap_or(&level).to_string(), computername: "-".to_owned(),