syncable_cli/analyzer/security/
mod.rs

1//! # Security Analysis Module
2//!
3//! Modular security analysis with language-specific analyzers for better threat detection.
4//!
5//! This module provides a layered approach to security analysis:
6//! - Core security patterns (generic)
7//! - Language-specific analyzers (JS/TS, Python, etc.)
8//! - Framework-specific detection
9//! - Context-aware severity assessment
10
11use thiserror::Error;
12
13pub mod config;
14pub mod core;
15pub mod patterns;
16pub mod turbo;
17
18pub use config::SecurityAnalysisConfig;
19pub use core::{
20    SecurityAnalyzer, SecurityCategory, SecurityFinding, SecurityReport, SecuritySeverity,
21};
22pub use patterns::SecretPatternManager;
23pub use turbo::{ScanMode, TurboConfig, TurboSecurityAnalyzer};
24
25#[derive(Debug, Error)]
26pub enum SecurityError {
27    #[error("Security analysis failed: {0}")]
28    AnalysisFailed(String),
29
30    #[error("Pattern compilation error: {0}")]
31    PatternError(#[from] regex::Error),
32
33    #[error("IO error: {0}")]
34    Io(#[from] std::io::Error),
35
36    #[error("JavaScript security analysis error: {0}")]
37    JavaScriptError(String),
38}