Scaffolding inicial do Xexéu: workspace Rust, Docker Compose e documentação EN/PT-BR
This commit is contained in:
commit
244c89b6ae
40 files changed
+1296
No files matched your search
@@ -0,0 +1,17 @@
|
||||
[package]
|
||||
name = "xexeu-cli"
|
||||
description = "Xexéu: continuous attack-surface auditing daemon, scanner and CLI"
|
||||
version.workspace = true
|
||||
edition.workspace = true
|
||||
license.workspace = true
|
||||
repository.workspace = true
|
||||
authors.workspace = true
|
||||
rust-version.workspace = true
|
||||
|
||||
[[bin]]
|
||||
name = "xexeu"
|
||||
path = "src/main.rs"
|
||||
|
||||
[dependencies]
|
||||
xexeu-core = { path = "../xexeu-core" }
|
||||
clap = { version = "4", features = ["derive"] }
|
||||
@@ -0,0 +1,134 @@
|
||||
use clap::{Parser, Subcommand};
|
||||
use std::path::PathBuf;
|
||||
|
||||
#[derive(Parser)]
|
||||
#[command(
|
||||
name = "xexeu",
|
||||
about = "Xexéu — continuous attack-surface and vulnerability auditing",
|
||||
version
|
||||
)]
|
||||
struct Cli {
|
||||
#[command(subcommand)]
|
||||
command: Command,
|
||||
}
|
||||
|
||||
#[derive(Subcommand)]
|
||||
enum Command {
|
||||
/// Run the API server, batch ingestion, diffs and the embedded dashboard.
|
||||
Serve {
|
||||
#[arg(long, default_value = "0.0.0.0:8788")]
|
||||
bind: String,
|
||||
#[arg(long, default_value = "config/xexeu.toml")]
|
||||
config: PathBuf,
|
||||
#[arg(long, default_value = "data/sweeps")]
|
||||
sweeps: PathBuf,
|
||||
#[arg(long, default_value = "data/xexeu")]
|
||||
data_dir: PathBuf,
|
||||
},
|
||||
/// Run the continuous scheduler and scan engine, writing sweep batches.
|
||||
Scanner {
|
||||
#[arg(long, default_value = "config/xexeu.toml")]
|
||||
config: PathBuf,
|
||||
#[arg(long, default_value = "data/sweeps")]
|
||||
out: PathBuf,
|
||||
},
|
||||
/// Run a single sweep for diagnostics.
|
||||
Scan {
|
||||
#[arg(long)]
|
||||
group: Option<String>,
|
||||
#[arg(long)]
|
||||
once: bool,
|
||||
#[arg(long, default_value = "config/xexeu.toml")]
|
||||
config: PathBuf,
|
||||
#[arg(long, default_value = "data/sweeps")]
|
||||
out: PathBuf,
|
||||
},
|
||||
/// Inspect the configuration.
|
||||
Config {
|
||||
#[command(subcommand)]
|
||||
action: ConfigAction,
|
||||
},
|
||||
/// Synchronize or import vulnerability feeds.
|
||||
Feeds {
|
||||
#[command(subcommand)]
|
||||
action: FeedsAction,
|
||||
},
|
||||
/// Query change events.
|
||||
Changes {
|
||||
#[arg(long, default_value = "24h")]
|
||||
since: String,
|
||||
#[arg(long, default_value = "data/xexeu")]
|
||||
data_dir: PathBuf,
|
||||
},
|
||||
/// Export the current state.
|
||||
Export {
|
||||
#[arg(long, default_value = "json")]
|
||||
format: String,
|
||||
#[arg(long, default_value = "data/xexeu")]
|
||||
data_dir: PathBuf,
|
||||
},
|
||||
/// Check the runtime environment.
|
||||
Doctor {
|
||||
#[arg(long)]
|
||||
json: bool,
|
||||
},
|
||||
}
|
||||
|
||||
#[derive(Subcommand)]
|
||||
enum ConfigAction {
|
||||
/// Validate the configuration and print the effective cadence per group.
|
||||
Check {
|
||||
#[arg(long, default_value = "config/xexeu.toml")]
|
||||
config: PathBuf,
|
||||
},
|
||||
}
|
||||
|
||||
#[derive(Subcommand)]
|
||||
enum FeedsAction {
|
||||
/// Download NVD and CISA KEV feeds incrementally.
|
||||
Sync {
|
||||
#[arg(long, default_value = "config/xexeu.toml")]
|
||||
config: PathBuf,
|
||||
},
|
||||
/// Import feed files copied manually for isolated networks.
|
||||
Import {
|
||||
directory: PathBuf,
|
||||
#[arg(long, default_value = "config/xexeu.toml")]
|
||||
config: PathBuf,
|
||||
},
|
||||
}
|
||||
|
||||
fn main() {
|
||||
let cli = Cli::parse();
|
||||
match cli.command {
|
||||
Command::Serve {
|
||||
bind: _,
|
||||
config: _,
|
||||
sweeps: _,
|
||||
data_dir: _,
|
||||
} => not_implemented("serve"),
|
||||
Command::Scanner { config: _, out: _ } => not_implemented("scanner"),
|
||||
Command::Scan {
|
||||
group: _,
|
||||
once: _,
|
||||
config: _,
|
||||
out: _,
|
||||
} => not_implemented("scan"),
|
||||
Command::Config { action: _ } => not_implemented("config"),
|
||||
Command::Feeds { action: _ } => not_implemented("feeds"),
|
||||
Command::Changes {
|
||||
since: _,
|
||||
data_dir: _,
|
||||
} => not_implemented("changes"),
|
||||
Command::Export {
|
||||
format: _,
|
||||
data_dir: _,
|
||||
} => not_implemented("export"),
|
||||
Command::Doctor { json: _ } => not_implemented("doctor"),
|
||||
}
|
||||
}
|
||||
|
||||
fn not_implemented(command: &str) -> ! {
|
||||
eprintln!("{command}: não implementado ainda");
|
||||
std::process::exit(1);
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
[package]
|
||||
name = "xexeu-core"
|
||||
description = "Xexéu: continuous attack-surface and vulnerability auditing core"
|
||||
version.workspace = true
|
||||
edition.workspace = true
|
||||
license.workspace = true
|
||||
repository.workspace = true
|
||||
authors.workspace = true
|
||||
rust-version.workspace = true
|
||||
|
||||
[dependencies]
|
||||
serde = { version = "1", features = ["derive"] }
|
||||
thiserror = "1"
|
||||
@@ -0,0 +1,2 @@
|
||||
//! Sweep batch format: atomically written by the scanner and idempotently read by the server.
|
||||
// TODO: implement batch writing, manifest handling and idempotent ingestion.
|
||||
@@ -0,0 +1,2 @@
|
||||
//! Parses and validates `xexeu.toml`: authorized scope, defaults, profiles and target groups.
|
||||
// TODO: implement configuration parsing and validation.
|
||||
@@ -0,0 +1,2 @@
|
||||
//! Compares a sweep with the current state inside the swept scope and emits deterministic change events.
|
||||
// TODO: implement the scoped diff algorithm and event ordering.
|
||||
@@ -0,0 +1,2 @@
|
||||
//! Environment checks: effective capabilities, nmap availability, feed age and libduckdb linkage.
|
||||
// TODO: implement doctor checks.
|
||||
@@ -0,0 +1,13 @@
|
||||
//! Xexéu core: configuration, scheduling, scanning, vulnerability correlation,
|
||||
//! storage and diffing for continuous attack-surface auditing.
|
||||
|
||||
pub mod batch;
|
||||
pub mod config;
|
||||
pub mod diff;
|
||||
pub mod doctor;
|
||||
pub mod scan;
|
||||
pub mod schedule;
|
||||
pub mod storage;
|
||||
pub mod targets;
|
||||
pub mod update;
|
||||
pub mod vuln;
|
||||
@@ -0,0 +1,2 @@
|
||||
//! Host discovery via ARP on the local L2 segment, ICMP echo and TCP SYN/ACK ping.
|
||||
// TODO: implement host discovery for the native engine.
|
||||
@@ -0,0 +1,2 @@
|
||||
//! Banner capture and light probes (HTTP, SSH, SMTP/FTP/IMAP, TLS certificate, DNS, NTP) yielding product, version and candidate CPE.
|
||||
// TODO: implement service fingerprinting and CPE candidate generation.
|
||||
@@ -0,0 +1,6 @@
|
||||
//! Scan engine: host discovery, port scanning, service fingerprinting and the optional nmap adapter.
|
||||
|
||||
pub mod discovery;
|
||||
pub mod fingerprint;
|
||||
pub mod nmap;
|
||||
pub mod ports;
|
||||
@@ -0,0 +1,2 @@
|
||||
//! Optional adapter that runs the external `nmap -oX -` and converts its XML into the same observation model.
|
||||
// TODO: implement the nmap adapter and XML conversion.
|
||||
@@ -0,0 +1,2 @@
|
||||
//! TCP SYN half-open scanning, degraded TCP connect mode and UDP probes per protocol.
|
||||
// TODO: implement TCP SYN, TCP connect and UDP port scanning.
|
||||
@@ -0,0 +1,2 @@
|
||||
//! Group scheduler: next run from cron, jitter, non-overlap and the shared global rate budget.
|
||||
// TODO: implement cron parsing, next-run calculation and budget-aware ordering.
|
||||
@@ -0,0 +1,2 @@
|
||||
//! DuckDB + Parquet storage for sweeps, observations, the deduplicated current state and events.
|
||||
// TODO: implement the storage layer with the server as the single writer.
|
||||
@@ -0,0 +1,2 @@
|
||||
//! Expands targets (CIDR, ranges, DNS names), applies exclusions and derives the effective cadence per host.
|
||||
// TODO: implement target expansion, exclusions and per-host cadence calculation.
|
||||
@@ -0,0 +1,2 @@
|
||||
//! Checks for a newer release through the Gitea Releases API, mirroring the Acauã updater.
|
||||
// TODO: implement the release update check.
|
||||
@@ -0,0 +1,2 @@
|
||||
//! Safe configuration checks: weak TLS, expiring certificates, weak SSH algorithms, exposed admin services and cleartext protocols.
|
||||
// TODO: implement non-intrusive configuration checks.
|
||||
@@ -0,0 +1,2 @@
|
||||
//! Imports and incrementally syncs NVD CVE JSON 2.0 and the CISA KEV catalog into the local base.
|
||||
// TODO: implement feed sync and offline import.
|
||||
@@ -0,0 +1,2 @@
|
||||
//! Correlates a candidate CPE with NVD configurations, honoring version ranges and assigning a confidence level.
|
||||
// TODO: implement CPE-to-CVE matching with version-range comparison.
|
||||
@@ -0,0 +1,5 @@
|
||||
//! Vulnerability knowledge: feed ingestion, CPE-to-CVE matching and safe configuration checks.
|
||||
|
||||
pub mod checks;
|
||||
pub mod feeds;
|
||||
pub mod matcher;
|
||||
Reference in new issue
Block a user