Fix all CI/CD errors: clippy warnings and compilation errors

- Remove unused import std::path::Path from hooks.rs
- Add #[derive(Debug)] to EbpfDetector
- Add missing mitre_analysis field to DetectionResult
- Change GhostError::Process to GhostError::Detection (variant doesn't exist)
- Prefix all unused event parameters with underscore in ebpf.rs
- Fix formatting in hooks.rs

All tests passing (24 total). Clippy clean with -D warnings.
This commit is contained in:
pandaadir05
2025-11-20 15:18:57 +02:00
parent 655585d9ef
commit efdd086c4e
3 changed files with 17 additions and 15 deletions

View File

@@ -13,6 +13,7 @@ use std::time::{Duration, SystemTime};
/// Linux eBPF-based Process Injection Detection
/// Provides kernel-level tracing and detection capabilities on Linux systems
#[cfg(target_os = "linux")]
#[derive(Debug)]
pub struct EbpfDetector {
program_manager: EbpfProgramManager,
event_processor: EbpfEventProcessor,
@@ -800,7 +801,7 @@ impl ProcessCreateHandler {
#[cfg(target_os = "linux")]
impl EventHandler for ProcessCreateHandler {
fn handle_event(&mut self, event: &EbpfEvent) -> Option<DetectionEvent> {
fn handle_event(&mut self, _event: &EbpfEvent) -> Option<DetectionEvent> {
// Process creation event handling logic
None
}
@@ -822,7 +823,7 @@ impl MemoryMapHandler {
#[cfg(target_os = "linux")]
impl EventHandler for MemoryMapHandler {
fn handle_event(&mut self, event: &EbpfEvent) -> Option<DetectionEvent> {
fn handle_event(&mut self, _event: &EbpfEvent) -> Option<DetectionEvent> {
// Memory mapping event handling logic
None
}
@@ -844,7 +845,7 @@ impl MemoryProtectHandler {
#[cfg(target_os = "linux")]
impl EventHandler for MemoryProtectHandler {
fn handle_event(&mut self, event: &EbpfEvent) -> Option<DetectionEvent> {
fn handle_event(&mut self, _event: &EbpfEvent) -> Option<DetectionEvent> {
// Memory protection change event handling logic
None
}
@@ -866,7 +867,7 @@ impl InjectionHandler {
#[cfg(target_os = "linux")]
impl EventHandler for InjectionHandler {
fn handle_event(&mut self, event: &EbpfEvent) -> Option<DetectionEvent> {
fn handle_event(&mut self, _event: &EbpfEvent) -> Option<DetectionEvent> {
// Process injection event handling logic
None
}
@@ -907,7 +908,7 @@ impl EbpfEventProcessor {
self.event_handlers.insert(event_type, handler);
}
pub fn process_event(&mut self, event: EbpfEvent) -> Option<DetectionEvent> {
pub fn process_event(&mut self, _event: EbpfEvent) -> Option<DetectionEvent> {
// Event processing logic
None
}
@@ -937,7 +938,7 @@ impl EbpfFilterManager {
self.active_filters.insert(filter.filter_id.clone(), filter);
}
pub fn should_process(&self, event: &EbpfEvent) -> bool {
pub fn should_process(&self, _event: &EbpfEvent) -> bool {
// Filter evaluation logic
true
}