Documentation
¶
Overview ¶
Package security provides security utilities for the LLMrecon tool.
Index ¶
- type SecurityConfig
- type SecurityManager
- func (sm *SecurityManager) ApplyMiddleware(handler http.Handler) http.Handler
- func (sm *SecurityManager) Close() error
- func (sm *SecurityManager) ConfigureTLSForServer() (*http.Server, error)
- func (sm *SecurityManager) CreatePinnedClient(hostname string, pins []string) *http.Client
- func (sm *SecurityManager) CreateSecureClient(name string, config *communication.TLSConfig) (*http.Client, error)
- func (sm *SecurityManager) GetAnomalyDetector() *api.AnomalyDetector
- func (sm *SecurityManager) GetCertificatePinner() *communication.CertificatePinner
- func (sm *SecurityManager) GetErrorHandler() *communication.ErrorHandler
- func (sm *SecurityManager) GetIPAllowlist() *api.IPAllowlist
- func (sm *SecurityManager) GetRateLimiter() *api.RateLimiter
- func (sm *SecurityManager) GetSecureLogger() *api.SecureLogger
- func (sm *SecurityManager) GetTLSManager() *communication.TLSManager
- func (sm *SecurityManager) HandleError(w http.ResponseWriter, r *http.Request, err error, defaultMessage string)
- func (sm *SecurityManager) Log(level api.LogLevel, requestID string, message string, err error)
- func (sm *SecurityManager) NewSecureError(code string, message string, level communication.ErrorLevel, ...) *communication.SecureError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SecurityConfig ¶
type SecurityConfig struct {
// TLS configuration
TLSConfig *communication.TLSConfig
// Rate limiter configuration
RateLimiterConfig *api.RateLimiterConfig
// IP allowlist configuration
IPAllowlistConfig *api.IPAllowlistConfig
// Secure logger configuration
SecureLoggerConfig *api.SecureLoggerConfig
// Anomaly detector configuration
AnomalyDetectorConfig *api.AnomalyDetectorConfig
// Development mode
DevelopmentMode bool
// Log file path
LogFilePath string
}
SecurityConfig represents the configuration for the security manager
func DefaultSecurityConfig ¶
func DefaultSecurityConfig() *SecurityConfig
DefaultSecurityConfig returns the default security configuration
type SecurityManager ¶
type SecurityManager struct {
// contains filtered or unexported fields
}
SecurityManager manages security components
func NewSecurityManager ¶
func NewSecurityManager(config *SecurityConfig) (*SecurityManager, error)
NewSecurityManager creates a new security manager
func (*SecurityManager) ApplyMiddleware ¶
func (sm *SecurityManager) ApplyMiddleware(handler http.Handler) http.Handler
ApplyMiddleware applies all security middleware to a handler
func (*SecurityManager) Close ¶
func (sm *SecurityManager) Close() error
Close closes the security manager and releases resources
func (*SecurityManager) ConfigureTLSForServer ¶
func (sm *SecurityManager) ConfigureTLSForServer() (*http.Server, error)
ConfigureTLSForServer configures TLS for an HTTP server
func (*SecurityManager) CreatePinnedClient ¶
func (sm *SecurityManager) CreatePinnedClient(hostname string, pins []string) *http.Client
CreatePinnedClient creates a client with certificate pinning
func (*SecurityManager) CreateSecureClient ¶
func (sm *SecurityManager) CreateSecureClient(name string, config *communication.TLSConfig) (*http.Client, error)
CreateSecureClient creates a secure HTTP client
func (*SecurityManager) GetAnomalyDetector ¶
func (sm *SecurityManager) GetAnomalyDetector() *api.AnomalyDetector
GetAnomalyDetector returns the anomaly detector
func (*SecurityManager) GetCertificatePinner ¶
func (sm *SecurityManager) GetCertificatePinner() *communication.CertificatePinner
GetCertificatePinner returns the certificate pinner
func (*SecurityManager) GetErrorHandler ¶
func (sm *SecurityManager) GetErrorHandler() *communication.ErrorHandler
GetErrorHandler returns the error handler
func (*SecurityManager) GetIPAllowlist ¶
func (sm *SecurityManager) GetIPAllowlist() *api.IPAllowlist
GetIPAllowlist returns the IP allowlist
func (*SecurityManager) GetRateLimiter ¶
func (sm *SecurityManager) GetRateLimiter() *api.RateLimiter
GetRateLimiter returns the rate limiter
func (*SecurityManager) GetSecureLogger ¶
func (sm *SecurityManager) GetSecureLogger() *api.SecureLogger
GetSecureLogger returns the secure logger
func (*SecurityManager) GetTLSManager ¶
func (sm *SecurityManager) GetTLSManager() *communication.TLSManager
GetTLSManager returns the TLS manager
func (*SecurityManager) HandleError ¶
func (sm *SecurityManager) HandleError(w http.ResponseWriter, r *http.Request, err error, defaultMessage string)
HandleError handles an error securely
func (*SecurityManager) NewSecureError ¶
func (sm *SecurityManager) NewSecureError(code string, message string, level communication.ErrorLevel, originalError error) *communication.SecureError
NewSecureError creates a new secure error
Directories
¶
| Path | Synopsis |
|---|---|
|
Package api provides API protection mechanisms for the LLMrecon tool.
|
Package api provides API protection mechanisms for the LLMrecon tool. |
|
Package audit provides audit logging functionality for security-sensitive operations.
|
Package audit provides audit logging functionality for security-sensitive operations. |
|
Package communication provides secure communication utilities for the LLMrecon tool.
|
Package communication provides secure communication utilities for the LLMrecon tool. |
|
Package keystore provides secure storage for cryptographic keys and sensitive materials.
|
Package keystore provides secure storage for cryptographic keys and sensitive materials. |
|
examples
command
Example program demonstrating the usage of the keystore package
|
Example program demonstrating the usage of the keystore package |
|
Package prompt provides protection against prompt injection and other LLM-specific security threats
|
Package prompt provides protection against prompt injection and other LLM-specific security threats |
|
Package vault provides a secure credential management system for the LLMreconing Tool.
|
Package vault provides a secure credential management system for the LLMreconing Tool. |