Documentation
¶
Index ¶
- type APIConfig
- type APIResponse
- type BusinessImpact
- type CallbackConfig
- type ComplianceImpact
- type CompliancePenalty
- type ComplianceViolation
- type EnhancedThreat
- type EnterpriseAPIServer
- type EnterpriseConfig
- type EnterpriseIntegrationLayer
- func (eil *EnterpriseIntegrationLayer) ExecuteEnterpriseScan(ctx context.Context, request *EnterpriseScanRequest) (*EnterpriseScanResult, error)
- func (eil *EnterpriseIntegrationLayer) GetIntegrationMetrics() *IntegrationMetrics
- func (eil *EnterpriseIntegrationLayer) GetMLModelMetrics() map[string]*ml.ModelMetrics
- func (eil *EnterpriseIntegrationLayer) GetTenantMetrics(ctx context.Context, tenantID string) (*multitenant.TenantMetricsSnapshot, error)
- func (eil *EnterpriseIntegrationLayer) Initialize(ctx context.Context) error
- type EnterpriseScanRequest
- type EnterpriseScanResult
- type IntegrationMetrics
- type IntegrationSettings
- type MitigationOption
- type OperationalImpact
- type OutputFormat
- type RemediationCost
- type RevenueImpact
- type RiskAssessment
- type RiskFactor
- type ScanMetrics
- type ScanPriority
- type ScanRequestAPI
- type ScanStatus
- type ScanType
- type TenantRequestAPI
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APIConfig ¶
type APIConfig struct {
Port int `json:"port"`
Host string `json:"host"`
TLSEnabled bool `json:"tls_enabled"`
CertFile string `json:"cert_file"`
KeyFile string `json:"key_file"`
CORSEnabled bool `json:"cors_enabled"`
AllowedOrigins []string `json:"allowed_origins"`
AuthenticationEnabled bool `json:"authentication_enabled"`
APIKeyRequired bool `json:"api_key_required"`
JWTSecret string `json:"jwt_secret"`
RequestTimeout time.Duration `json:"request_timeout"`
MaxRequestSize int64 `json:"max_request_size"`
LoggingEnabled bool `json:"logging_enabled"`
MetricsEnabled bool `json:"metrics_enabled"`
}
APIConfig configures the enterprise API server
type APIResponse ¶
type APIResponse struct {
Success bool `json:"success"`
Data interface{} `json:"data,omitempty"`
Error string `json:"error,omitempty"`
Message string `json:"message,omitempty"`
Timestamp time.Time `json:"timestamp"`
RequestID string `json:"request_id,omitempty"`
}
APIResponse represents a standard API response
type BusinessImpact ¶
type BusinessImpact struct {
Criticality string `json:"criticality"`
AffectedSystems []string `json:"affected_systems"`
UserImpact string `json:"user_impact"`
RevenueImpact *RevenueImpact `json:"revenue_impact"`
ReputationImpact string `json:"reputation_impact"`
OperationalImpact *OperationalImpact `json:"operational_impact"`
}
BusinessImpact assesses business impact of threats
type CallbackConfig ¶
type CallbackConfig struct {
URL string `json:"url"`
Method string `json:"method"`
Headers map[string]string `json:"headers"`
Timeout time.Duration `json:"timeout"`
}
CallbackConfig configures scan completion callbacks
type ComplianceImpact ¶
type ComplianceImpact struct {
Frameworks []string `json:"frameworks"`
Violations []ComplianceViolation `json:"violations"`
ReportingRequired bool `json:"reporting_required"`
Penalties *CompliancePenalty `json:"penalties"`
}
ComplianceImpact assesses regulatory compliance impact
type CompliancePenalty ¶
type CompliancePenalty struct {
MaxFine float64 `json:"max_fine"`
Currency string `json:"currency"`
OtherPenalties []string `json:"other_penalties"`
}
CompliancePenalty represents potential compliance penalties
type ComplianceViolation ¶
type ComplianceViolation struct {
Framework string `json:"framework"`
Requirement string `json:"requirement"`
Severity string `json:"severity"`
Description string `json:"description"`
}
ComplianceViolation represents a specific compliance violation
type EnhancedThreat ¶
type EnhancedThreat struct {
*types.Threat
MLPrediction *ml.ThreatPrediction `json:"ml_prediction"`
RemediationResult *policy.RemediationResult `json:"remediation_result"`
RiskAssessment *RiskAssessment `json:"risk_assessment"`
BusinessImpact *BusinessImpact `json:"business_impact"`
ComplianceImpact *ComplianceImpact `json:"compliance_impact"`
}
EnhancedThreat represents a threat with ML predictions and remediation info
type EnterpriseAPIServer ¶
type EnterpriseAPIServer struct {
// contains filtered or unexported fields
}
EnterpriseAPIServer provides REST API endpoints for enterprise features
func NewEnterpriseAPIServer ¶
func NewEnterpriseAPIServer(integrationLayer *EnterpriseIntegrationLayer, config *APIConfig) *EnterpriseAPIServer
NewEnterpriseAPIServer creates a new enterprise API server
type EnterpriseConfig ¶
type EnterpriseConfig struct {
MultiTenantEnabled bool `json:"multi_tenant_enabled"`
MLPredictionEnabled bool `json:"ml_prediction_enabled"`
AutoRemediationEnabled bool `json:"auto_remediation_enabled"`
PRGenerationEnabled bool `json:"pr_generation_enabled"`
TenantConfig *multitenant.MultiTenantConfig `json:"tenant_config"`
PredictorConfig *ml.PredictorConfig `json:"predictor_config"`
RemediationConfig *policy.RemediationConfig `json:"remediation_config"`
DependencyConfig *policy.DependencyUpdaterConfig `json:"dependency_config"`
PRConfig *policy.PRGeneratorConfig `json:"pr_config"`
IntegrationSettings *IntegrationSettings `json:"integration_settings"`
}
EnterpriseConfig configures the enterprise integration layer
type EnterpriseIntegrationLayer ¶
type EnterpriseIntegrationLayer struct {
// contains filtered or unexported fields
}
EnterpriseIntegrationLayer provides unified access to all enterprise features
func NewEnterpriseIntegrationLayer ¶
func NewEnterpriseIntegrationLayer(config *EnterpriseConfig) *EnterpriseIntegrationLayer
NewEnterpriseIntegrationLayer creates a new enterprise integration layer
func (*EnterpriseIntegrationLayer) ExecuteEnterpriseScan ¶
func (eil *EnterpriseIntegrationLayer) ExecuteEnterpriseScan(ctx context.Context, request *EnterpriseScanRequest) (*EnterpriseScanResult, error)
ExecuteEnterpriseScan performs a comprehensive enterprise scan
func (*EnterpriseIntegrationLayer) GetIntegrationMetrics ¶
func (eil *EnterpriseIntegrationLayer) GetIntegrationMetrics() *IntegrationMetrics
GetIntegrationMetrics returns overall integration metrics
func (*EnterpriseIntegrationLayer) GetMLModelMetrics ¶
func (eil *EnterpriseIntegrationLayer) GetMLModelMetrics() map[string]*ml.ModelMetrics
GetMLModelMetrics returns ML model performance metrics
func (*EnterpriseIntegrationLayer) GetTenantMetrics ¶
func (eil *EnterpriseIntegrationLayer) GetTenantMetrics(ctx context.Context, tenantID string) (*multitenant.TenantMetricsSnapshot, error)
GetTenantMetrics returns metrics for a specific tenant
func (*EnterpriseIntegrationLayer) Initialize ¶
func (eil *EnterpriseIntegrationLayer) Initialize(ctx context.Context) error
Initialize initializes all enterprise components
type EnterpriseScanRequest ¶
type EnterpriseScanRequest struct {
TenantID string `json:"tenant_id"`
RepositoryURL string `json:"repository_url"`
Branch string `json:"branch"`
ScanType ScanType `json:"scan_type"`
MLPredictionEnabled bool `json:"ml_prediction_enabled"`
AutoRemediationEnabled bool `json:"auto_remediation_enabled"`
PRGenerationEnabled bool `json:"pr_generation_enabled"`
OutputFormats []OutputFormat `json:"output_formats"`
PolicyOverrides map[string]interface{} `json:"policy_overrides"`
Metadata map[string]interface{} `json:"metadata"`
Priority ScanPriority `json:"priority"`
Callback *CallbackConfig `json:"callback"`
}
EnterpriseScanRequest represents a comprehensive scan request
type EnterpriseScanResult ¶
type EnterpriseScanResult struct {
ScanID string `json:"scan_id"`
TenantID string `json:"tenant_id"`
RepositoryURL string `json:"repository_url"`
Branch string `json:"branch"`
ScanType ScanType `json:"scan_type"`
StartTime time.Time `json:"start_time"`
EndTime time.Time `json:"end_time"`
Duration time.Duration `json:"duration"`
Status ScanStatus `json:"status"`
ThreatsDetected []*EnhancedThreat `json:"threats_detected"`
MLPredictions []*ml.ThreatPrediction `json:"ml_predictions"`
RemediationResults []*policy.RemediationResult `json:"remediation_results"`
PullRequests []*policy.PRResult `json:"pull_requests"`
Outputs map[OutputFormat]string `json:"outputs"`
Metrics *ScanMetrics `json:"metrics"`
Errors []string `json:"errors"`
Warnings []string `json:"warnings"`
Metadata map[string]interface{} `json:"metadata"`
}
EnterpriseScanResult represents comprehensive scan results
type IntegrationMetrics ¶
type IntegrationMetrics struct {
// contains filtered or unexported fields
}
IntegrationMetrics tracks enterprise integration performance
func NewIntegrationMetrics ¶
func NewIntegrationMetrics() *IntegrationMetrics
type IntegrationSettings ¶
type IntegrationSettings struct {
MaxConcurrentScans int `json:"max_concurrent_scans"`
ScanTimeout time.Duration `json:"scan_timeout"`
RetryAttempts int `json:"retry_attempts"`
RetryDelay time.Duration `json:"retry_delay"`
CacheEnabled bool `json:"cache_enabled"`
CacheTTL time.Duration `json:"cache_ttl"`
MetricsEnabled bool `json:"metrics_enabled"`
AuditEnabled bool `json:"audit_enabled"`
NotificationsEnabled bool `json:"notifications_enabled"`
}
IntegrationSettings configures integration behavior
type MitigationOption ¶
type MitigationOption struct {
Name string `json:"name"`
Description string `json:"description"`
Effectiveness float64 `json:"effectiveness"`
Complexity string `json:"complexity"`
TimeRequired time.Duration `json:"time_required"`
Cost *RemediationCost `json:"cost"`
}
MitigationOption represents a possible mitigation approach
type OperationalImpact ¶
type OperationalImpact struct {
ServiceDisruption bool `json:"service_disruption"`
DataLoss bool `json:"data_loss"`
SecurityBreach bool `json:"security_breach"`
RecoveryTime time.Duration `json:"recovery_time"`
ResourcesRequired []string `json:"resources_required"`
}
OperationalImpact describes operational consequences
type OutputFormat ¶
type OutputFormat string
OutputFormat defines the output format for scan results
const ( OutputFormatJSON OutputFormat = "json" OutputFormatSARIF OutputFormat = "sarif" OutputFormatSPDX OutputFormat = "spdx" OutputFormatCycloneDX OutputFormat = "cyclonedx" OutputFormatCSV OutputFormat = "csv" OutputFormatXML OutputFormat = "xml" )
type RemediationCost ¶
type RemediationCost struct {
DeveloperHours float64 `json:"developer_hours"`
TestingHours float64 `json:"testing_hours"`
Downtime time.Duration `json:"downtime"`
MonetaryCost float64 `json:"monetary_cost"`
Currency string `json:"currency"`
}
RemediationCost represents the cost of remediation
type RevenueImpact ¶
type RevenueImpact struct {
PotentialLoss float64 `json:"potential_loss"`
Currency string `json:"currency"`
Timeframe string `json:"timeframe"`
Confidence float64 `json:"confidence"`
}
RevenueImpact quantifies potential revenue impact
type RiskAssessment ¶
type RiskAssessment struct {
OverallRisk types.Severity `json:"overall_risk"`
RiskScore float64 `json:"risk_score"`
RiskFactors []RiskFactor `json:"risk_factors"`
MitigationOptions []MitigationOption `json:"mitigation_options"`
TimeToRemediate time.Duration `json:"time_to_remediate"`
CostToRemediate *RemediationCost `json:"cost_to_remediate"`
}
RiskAssessment provides detailed risk analysis
type RiskFactor ¶
type RiskFactor struct {
Name string `json:"name"`
Description string `json:"description"`
Weight float64 `json:"weight"`
Score float64 `json:"score"`
Category string `json:"category"`
}
RiskFactor represents a contributing risk factor
type ScanMetrics ¶
type ScanMetrics struct {
PackagesScanned int `json:"packages_scanned"`
ThreatsDetected int `json:"threats_detected"`
CriticalThreats int `json:"critical_threats"`
HighThreats int `json:"high_threats"`
MediumThreats int `json:"medium_threats"`
LowThreats int `json:"low_threats"`
MLPredictionsGenerated int `json:"ml_predictions_generated"`
RemediationsExecuted int `json:"remediations_executed"`
PRsGenerated int `json:"prs_generated"`
ScanDuration time.Duration `json:"scan_duration"`
MLPredictionTime time.Duration `json:"ml_prediction_time"`
RemediationTime time.Duration `json:"remediation_time"`
OutputGenerationTime time.Duration `json:"output_generation_time"`
}
ScanMetrics provides detailed scan performance metrics
type ScanPriority ¶
type ScanPriority string
ScanPriority defines the priority of a scan
const ( ScanPriorityLow ScanPriority = "low" ScanPriorityNormal ScanPriority = "normal" ScanPriorityHigh ScanPriority = "high" ScanPriorityCritical ScanPriority = "critical" )
type ScanRequestAPI ¶
type ScanRequestAPI struct {
TenantID string `json:"tenant_id"`
RepositoryURL string `json:"repository_url" validate:"required,url"`
Branch string `json:"branch"`
ScanType string `json:"scan_type"`
MLPredictionEnabled bool `json:"ml_prediction_enabled"`
AutoRemediationEnabled bool `json:"auto_remediation_enabled"`
PRGenerationEnabled bool `json:"pr_generation_enabled"`
OutputFormats []string `json:"output_formats"`
PolicyOverrides map[string]interface{} `json:"policy_overrides"`
Metadata map[string]interface{} `json:"metadata"`
Priority string `json:"priority"`
CallbackURL string `json:"callback_url"`
CallbackMethod string `json:"callback_method"`
CallbackHeaders map[string]string `json:"callback_headers"`
CallbackTimeout int `json:"callback_timeout"`
}
ScanRequestAPI represents an API scan request
type ScanStatus ¶
type ScanStatus string
ScanStatus represents the status of a scan
const ( ScanStatusPending ScanStatus = "pending" ScanStatusRunning ScanStatus = "running" ScanStatusCompleted ScanStatus = "completed" ScanStatusFailed ScanStatus = "failed" ScanStatusCancelled ScanStatus = "cancelled" )
type TenantRequestAPI ¶
type TenantRequestAPI struct {
Name string `json:"name" validate:"required"`
Description string `json:"description"`
Plan string `json:"plan"`
Quotas map[string]interface{} `json:"quotas"`
Settings map[string]interface{} `json:"settings"`
Metadata map[string]interface{} `json:"metadata"`
}
TenantRequestAPI represents an API tenant request