(client_ip: Option<IpAddr>, violation: &str)
| 654 | } |
| 655 | |
| 656 | pub fn protocol_violation(client_ip: Option<IpAddr>, violation: &str) { |
| 657 | let mut event = SecurityEvent::new( |
| 658 | SecurityEventType::ProtocolViolation, |
| 659 | SecuritySeverity::High, |
| 660 | format!("Protocol violation: {}", violation), |
| 661 | ) |
| 662 | .with_metadata("violation_type".to_string(), violation.to_string()); |
| 663 | |
| 664 | if let Some(ip) = client_ip { |
| 665 | event = event.with_client_ip(ip); |
| 666 | } |
| 667 | |
| 668 | log_security_event(event); |
| 669 | } |
| 670 | |
| 671 | pub fn query_executed( |
| 672 | client_ip: Option<IpAddr>, |