Skip to main content

oxigdal_security/scanning/
mod.rs

1//! Security scanning.
2
3pub mod malware;
4pub mod secrets;
5pub mod vulnerability;
6
7use serde::{Deserialize, Serialize};
8
9/// Scan result.
10#[derive(Debug, Clone, Serialize, Deserialize)]
11pub struct ScanResult {
12    /// Scan type.
13    pub scan_type: ScanType,
14    /// Findings.
15    pub findings: Vec<Finding>,
16    /// Scan timestamp.
17    pub scanned_at: chrono::DateTime<chrono::Utc>,
18}
19
20/// Scan type.
21#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
22pub enum ScanType {
23    /// Vulnerability scan.
24    Vulnerability,
25    /// Secret detection.
26    Secrets,
27    /// Malware scan.
28    Malware,
29}
30
31/// Security finding.
32#[derive(Debug, Clone, Serialize, Deserialize)]
33pub struct Finding {
34    /// Finding ID.
35    pub id: String,
36    /// Severity.
37    pub severity: Severity,
38    /// Description.
39    pub description: String,
40    /// Location.
41    pub location: Option<String>,
42}
43
44/// Finding severity.
45#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize)]
46pub enum Severity {
47    /// Informational.
48    Info,
49    /// Low severity.
50    Low,
51    /// Medium severity.
52    Medium,
53    /// High severity.
54    High,
55    /// Critical severity.
56    Critical,
57}