Package de.cuioss.http.security.monitoring


@NullMarked package de.cuioss.http.security.monitoring
Security event monitoring and logging for HTTP validation.

This package provides comprehensive monitoring capabilities for security events, including attack pattern detection, event counting, and structured logging for security information and event management (SIEM) integration.

Monitoring Components

Event Tracking

The monitoring system tracks various types of security events:

  • Attack Attempts - Path traversal, injection, encoding attacks
  • Validation Failures - Character set violations, length limit breaches
  • Configuration Changes - Security policy modifications
  • Performance Metrics - Validation timing and resource usage

Usage Example


 // Create event counter
 SecurityEventCounter eventCounter = new SecurityEventCounter();

 // Use in validation pipeline
 try {
     String validated = validator.validate(input);
 } catch (UrlSecurityException e) {
     // Increment counter for this failure type
     eventCounter.increment(e.getFailureType());

     // Log structured security event
     CuiLogger logger = new CuiLogger(MyClass.class);
     logger.warn(URLSecurityLogMessages.WARN.PATH_TRAVERSAL_DETECTED, input);
 }

 // Query event statistics
 long pathTraversalCount = eventCounter.getCount(UrlSecurityFailureType.PATH_TRAVERSAL_DETECTED);
 

SIEM Integration

The monitoring system is designed for enterprise security monitoring:

  • Structured log messages with consistent identifiers
  • Configurable log levels for different event types
  • Thread-safe counters for metrics collection
  • Support for real-time alerting based on event patterns

Package Nullability

This package follows strict nullability conventions using JSpecify annotations:

  • All parameters and return values are non-null by default
  • Nullable parameters and return values are explicitly annotated with @Nullable
Since:
1.0
See Also: