Class URLSecurityLogMessages

java.lang.Object
de.cuioss.http.security.monitoring.URLSecurityLogMessages

public final class URLSecurityLogMessages extends Object
Structured log messages for HTTP security validation events.

This class provides predefined, structured log messages for all types of HTTP security events that can occur during URL validation. It follows the CUI LogRecord pattern to ensure consistent, parseable, and actionable security logs.

Design Principles

  • Structured Logging - All messages follow consistent format with identifiers
  • Security Focus - Messages designed for security monitoring and alerting
  • Actionable - Each message provides context needed for response
  • Standardized - Uses CUI LogRecord pattern for consistency

Message Categories

  • WARN - Security violations that were blocked but indicate potential attacks
  • ERROR - Critical security failures or system errors during validation
  • INFO - Security-relevant events that don't indicate attacks
  • DEBUG - Detailed validation information for troubleshooting

Usage Examples

 // Log a path traversal attack
 logger.warn(URLSecurityLogMessages.WARN.PATH_TRAVERSAL_DETECTED.format("../../../etc/passwd"));

 // Log a validation failure with details
 logger.error(URLSecurityLogMessages.ERROR.VALIDATION_FAILED.format(
     "PATH_TRAVERSAL_DETECTED", "/api/../admin"));

 // Log configuration information
 logger.info(URLSecurityLogMessages.INFO.VALIDATION_ENABLED.format("PATH", "strict"));

 // Log detailed validation steps
 logger.debug(URLSecurityLogMessages.DEBUG.VALIDATION_STEP.format("DecodingStage", "url encoded"));
 

Message Format

All messages follow the pattern: URLSecurity-[ID]: [message with parameters]

This format enables easy parsing by log analysis tools and SIEM systems for security monitoring.

Implements: Task S2 from HTTP verification specification
Since:
1.0
See Also: