Documentation
¶
Index ¶
- Constants
- type GitHubConfig
- type Manager
- func (m *Manager) AddNotification(report *Report, channel string, success bool, details string) error
- func (m *Manager) CreateReport(incidentType, severity, title, description string, details map[string]string) (*Report, error)
- func (m *Manager) GetIncidentsByType(incidentType string) ([]*Report, error)
- func (m *Manager) GetOpenIncidents() ([]*Report, error)
- func (m *Manager) ListReports() ([]*Report, error)
- func (m *Manager) LoadReport(id string) (*Report, error)
- func (m *Manager) ResolveReport(report *Report, resolutionNotes string) error
- func (m *Manager) SaveReport(report *Report) error
- func (m *Manager) UpdateReport(report *Report) error
- type NotificationConfig
- type NotificationRecord
- type Notifier
- type Report
- type SlackConfig
Constants ¶
const ( IncidentDirName = ".dsops/incidents" AuditLogName = ".dsops/audit.log" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GitHubConfig ¶
type GitHubConfig struct {
Token string `yaml:"token"` // GitHub personal access token
Owner string `yaml:"owner"` // Repository owner
Repository string `yaml:"repository"` // Repository name
Labels []string `yaml:"labels,omitempty"` // Labels to add to issues
}
GitHubConfig holds GitHub integration configuration
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager handles incident creation and management
func NewManager ¶
NewManager creates a new incident manager
func (*Manager) AddNotification ¶
func (m *Manager) AddNotification(report *Report, channel string, success bool, details string) error
AddNotification records a notification being sent
func (*Manager) CreateReport ¶
func (m *Manager) CreateReport(incidentType, severity, title, description string, details map[string]string) (*Report, error)
CreateReport creates a new incident report
func (*Manager) GetIncidentsByType ¶
GetIncidentsByType returns incidents of a specific type
func (*Manager) GetOpenIncidents ¶
GetOpenIncidents returns all open incidents
func (*Manager) ListReports ¶
ListReports returns all incident reports
func (*Manager) LoadReport ¶
LoadReport loads an incident report by ID
func (*Manager) ResolveReport ¶
ResolveReport marks an incident as resolved
func (*Manager) SaveReport ¶
SaveReport saves an incident report to disk
func (*Manager) UpdateReport ¶
UpdateReport updates an existing report
type NotificationConfig ¶
type NotificationConfig struct {
Slack *SlackConfig `yaml:"slack,omitempty"`
GitHub *GitHubConfig `yaml:"github,omitempty"`
}
NotificationConfig holds configuration for incident notifications
type NotificationRecord ¶
type NotificationRecord struct {
Channel string `json:"channel"` // slack, github, email
Timestamp time.Time `json:"timestamp"`
Success bool `json:"success"`
Details string `json:"details,omitempty"`
}
NotificationRecord tracks sent notifications
type Notifier ¶
type Notifier struct {
// contains filtered or unexported fields
}
Notifier handles sending incident notifications
func NewNotifier ¶
func NewNotifier(config NotificationConfig) *Notifier
NewNotifier creates a new notifier
func (*Notifier) SendNotifications ¶
func (n *Notifier) SendNotifications(report *Report) []NotificationRecord
SendNotifications sends notifications to all configured channels
type Report ¶
type Report struct {
ID string `json:"id"`
Timestamp time.Time `json:"timestamp"`
Type string `json:"type"`
Severity string `json:"severity"` // critical, high, medium, low
Title string `json:"title"`
Description string `json:"description"`
Details map[string]string `json:"details"`
// Affected resources
AffectedFiles []string `json:"affected_files,omitempty"`
AffectedSecrets []string `json:"affected_secrets,omitempty"`
AffectedCommits []string `json:"affected_commits,omitempty"`
// Response actions
ActionsRequired []string `json:"actions_required"`
ActionsTaken []string `json:"actions_taken,omitempty"`
// Notification status
NotificationsSent []NotificationRecord `json:"notifications_sent,omitempty"`
// Resolution
Status string `json:"status"` // open, investigating, resolved
ResolvedAt *time.Time `json:"resolved_at,omitempty"`
ResolutionNotes string `json:"resolution_notes,omitempty"`
}
Report represents a security incident report
type SlackConfig ¶
type SlackConfig struct {
WebhookURL string `yaml:"webhook_url"`
Channel string `yaml:"channel,omitempty"`
Username string `yaml:"username,omitempty"`
}
SlackConfig holds Slack webhook configuration