File size: 528 Bytes
2f235a0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
ef83e66
 
2f235a0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
from dataclasses import dataclass, field
from typing import List


@dataclass
class RedFlagRule:
    id: str
    pattern: str
    description: str
    severity: str  # e.g., "low", "medium", "high", "critical"
    source: str    # "admin", "system"
    enabled: bool = True
    keywords: List[str] = field(default_factory=list)


@dataclass
class RedFlagMatch:
    rule_id: str
    pattern: str
    severity: str
    description: str
    matched_text: str
    confidence: float | None = None
    explanation: str | None = None