updated clap version 4.x #725
This commit is contained in:
40
Cargo.lock
generated
40
Cargo.lock
generated
@@ -199,20 +199,33 @@ checksum = "86447ad904c7fb335a790c9d7fe3d0d971dc523b8ccd1561a520de9a85302750"
|
||||
dependencies = [
|
||||
"atty",
|
||||
"bitflags",
|
||||
"clap_derive",
|
||||
"clap_lex",
|
||||
"clap_lex 0.2.4",
|
||||
"indexmap",
|
||||
"once_cell",
|
||||
"strsim",
|
||||
"termcolor",
|
||||
"textwrap",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "clap_derive"
|
||||
version = "3.2.18"
|
||||
name = "clap"
|
||||
version = "4.0.9"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "ea0c8bce528c4be4da13ea6fead8965e95b6073585a2f05204bd8f4119f82a65"
|
||||
checksum = "30607dd93c420c6f1f80b544be522a0238a7db35e6a12968d28910983fee0df0"
|
||||
dependencies = [
|
||||
"atty",
|
||||
"bitflags",
|
||||
"clap_derive",
|
||||
"clap_lex 0.3.0",
|
||||
"once_cell",
|
||||
"strsim",
|
||||
"termcolor",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "clap_derive"
|
||||
version = "4.0.9"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "a4a307492e1a34939f79d3b6b9650bd2b971513cd775436bf2b78defeb5af00b"
|
||||
dependencies = [
|
||||
"heck",
|
||||
"proc-macro-error",
|
||||
@@ -230,6 +243,15 @@ dependencies = [
|
||||
"os_str_bytes",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "clap_lex"
|
||||
version = "0.3.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "0d4198f73e42b4936b35b5bb248d81d2b595ecb170da0bac7655c54eedfa8da8"
|
||||
dependencies = [
|
||||
"os_str_bytes",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "comfy-table"
|
||||
version = "6.1.0"
|
||||
@@ -552,7 +574,7 @@ dependencies = [
|
||||
"bitflags",
|
||||
"byteorder",
|
||||
"chrono",
|
||||
"clap",
|
||||
"clap 3.2.22",
|
||||
"crc32fast",
|
||||
"dialoguer",
|
||||
"encoding",
|
||||
@@ -751,7 +773,7 @@ dependencies = [
|
||||
"base64",
|
||||
"bytesize",
|
||||
"chrono",
|
||||
"clap",
|
||||
"clap 4.0.9",
|
||||
"comfy-table",
|
||||
"crossbeam-utils",
|
||||
"csv",
|
||||
@@ -1045,7 +1067,7 @@ dependencies = [
|
||||
"anyhow",
|
||||
"atty",
|
||||
"chrono",
|
||||
"clap",
|
||||
"clap 3.2.22",
|
||||
"file-chunker",
|
||||
"memmap2",
|
||||
"num_cpus",
|
||||
|
||||
@@ -7,7 +7,7 @@ edition = "2021"
|
||||
[dependencies]
|
||||
itertools = "*"
|
||||
dashmap = "*"
|
||||
clap = { version = "3.*", features = ["derive", "cargo"]}
|
||||
clap = { version = "4.*", features = ["derive", "cargo"]}
|
||||
evtx = { git = "https://github.com/Yamato-Security/hayabusa-evtx.git" , features = ["fast-alloc"] , rev = "95b1c6a" }
|
||||
quick-xml = {version = "0.23.*", features = ["serialize"] }
|
||||
serde = { version = "1.*", features = ["derive"] }
|
||||
|
||||
2
rules
2
rules
Submodule rules updated: 28c1de3279...aaf910cdca
@@ -2,7 +2,7 @@ use crate::detections::message::AlertMessage;
|
||||
use crate::detections::pivot::{PivotKeyword, PIVOT_KEYWORD};
|
||||
use crate::detections::utils;
|
||||
use chrono::{DateTime, Utc};
|
||||
use clap::{App, CommandFactory, Parser};
|
||||
use clap::{Command, CommandFactory, Parser};
|
||||
use hashbrown::{HashMap, HashSet};
|
||||
use lazy_static::lazy_static;
|
||||
use regex::Regex;
|
||||
@@ -12,7 +12,7 @@ use std::sync::RwLock;
|
||||
use terminal_size::{terminal_size, Height, Width};
|
||||
|
||||
lazy_static! {
|
||||
pub static ref CONFIG: RwLock<ConfigReader<'static>> = RwLock::new(ConfigReader::new());
|
||||
pub static ref CONFIG: RwLock<ConfigReader> = RwLock::new(ConfigReader::new());
|
||||
pub static ref LEVELMAP: HashMap<String, u128> = {
|
||||
let mut levelmap = HashMap::new();
|
||||
levelmap.insert("INFORMATIONAL".to_owned(), 1);
|
||||
@@ -50,15 +50,15 @@ lazy_static! {
|
||||
convert_option_vecs_to_hs(CONFIG.read().unwrap().args.exclude_status.as_ref());
|
||||
}
|
||||
|
||||
pub struct ConfigReader<'a> {
|
||||
pub app: App<'a>,
|
||||
pub struct ConfigReader {
|
||||
pub app: Command,
|
||||
pub args: Config,
|
||||
pub headless_help: String,
|
||||
pub event_timeline_config: EventInfoConfig,
|
||||
pub target_eventids: TargetEventIds,
|
||||
}
|
||||
|
||||
impl Default for ConfigReader<'_> {
|
||||
impl Default for ConfigReader {
|
||||
fn default() -> Self {
|
||||
Self::new()
|
||||
}
|
||||
@@ -67,12 +67,12 @@ impl Default for ConfigReader<'_> {
|
||||
#[derive(Parser, Clone)]
|
||||
#[clap(
|
||||
name = "Hayabusa",
|
||||
usage = "hayabusa.exe <INPUT> [OTHER-ACTIONS] [OPTIONS]",
|
||||
author = "Yamato Security (https://github.com/Yamato-Security/hayabusa) @SecurityYamato)",
|
||||
help_template = "\n{name} {version}\n{author}\n\n{usage-heading}\n {usage}\n\n{all-args}\n",
|
||||
version,
|
||||
term_width = 400
|
||||
)]
|
||||
#[command(override_usage = "hayabusa.exe <INPUT> [OTHER-ACTIONS] [OPTIONS]")]
|
||||
pub struct Config {
|
||||
/// Directory of multiple .evtx files
|
||||
#[clap(help_heading = Some("INPUT"), short = 'd', long, value_name = "DIRECTORY")]
|
||||
@@ -221,11 +221,11 @@ pub struct Config {
|
||||
pub contributors: bool,
|
||||
|
||||
/// Specify additional target file extensions (ex: evtx_data) (ex: evtx1 evtx2)
|
||||
#[clap(help_heading = Some("ADVANCED"), long = "target-file-ext", multiple_values = true)]
|
||||
#[clap(help_heading = Some("ADVANCED"), long = "target-file-ext")]
|
||||
pub evtx_file_ext: Option<Vec<String>>,
|
||||
|
||||
/// Ignore rules according to status (ex: experimental) (ex: stable test)
|
||||
#[clap(help_heading = Some("FILTERING"), long = "exclude-status", multiple_values = true, value_name = "STATUS")]
|
||||
#[clap(help_heading = Some("FILTERING"), long = "exclude-status", value_name = "STATUS")]
|
||||
pub exclude_status: Option<Vec<String>>,
|
||||
|
||||
/// Specify output profile (minimal, standard, verbose, verbose-all-field-info, verbose-details-and-all-field-info)
|
||||
@@ -253,7 +253,7 @@ pub struct Config {
|
||||
pub html_report: Option<PathBuf>,
|
||||
}
|
||||
|
||||
impl ConfigReader<'_> {
|
||||
impl ConfigReader {
|
||||
pub fn new() -> Self {
|
||||
let parse = Config::parse();
|
||||
let help_term_width = if let Some((Width(w), _)) = *TERM_SIZE {
|
||||
|
||||
Reference in New Issue
Block a user