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 access provides access control and security auditing functionality
|
Package access provides access control and security auditing functionality |
|
adapters
Package adapters provides adapter implementations for security interfaces
|
Package adapters provides adapter implementations for security interfaces |
|
api
Package api provides a RESTful API for the access control system
|
Package api provides a RESTful API for the access control system |
|
audit
Package audit provides comprehensive security audit logging functionality
|
Package audit provides comprehensive security audit logging functionality |
|
audit/trail
Package trail provides a comprehensive audit trail system for tracking all operations
|
Package trail provides a comprehensive audit trail system for tracking all operations |
|
common
Package common provides common constants and utilities for the security access control system
|
Package common provides common constants and utilities for the security access control system |
|
converters
Package converters provides conversion functions between different data models
|
Package converters provides conversion functions between different data models |
|
db
Package db provides database implementations for the access control system
|
Package db provides database implementations for the access control system |
|
db/adapter
Package adapter provides adapters for the access control system
|
Package adapter provides adapters for the access control system |
|
impl
Package impl provides implementations of the security access interfaces
|
Package impl provides implementations of the security access interfaces |
|
interfaces
Package interfaces defines common interfaces and types for the access control system
|
Package interfaces defines common interfaces and types for the access control system |
|
mfa
Package mfa provides multi-factor authentication functionality
|
Package mfa provides multi-factor authentication functionality |
|
models
Package models provides common data models for the security system
|
Package models provides common data models for the security system |
|
rbac
Package rbac provides enhanced role-based access control functionality
|
Package rbac provides enhanced role-based access control functionality |
|
tests
Package tests provides testing utilities for the access control system
|
Package tests provides testing utilities for the access control system |
|
types
Package types defines common types for the security access control system
|
Package types defines common types for the security access control system |
|
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. |