Documentation
¶
Index ¶
- Constants
- type CaseResponse
- type Client
- func (c *Client) CreateCase(title, description, severity, owner string, tags []string) (*CaseResponse, error)
- func (c *Client) CreateKibanaCaseQueryRule(connectorID, routeKey string) (*KibanaRule, error)
- func (c *Client) CreateKibanaConnector(name, webhookURL, secret string) (*KibanaConnectorResponse, error)
- func (c *Client) CreateKibanaQueryRule(index, connectorID, routeKey string) (*KibanaRuleResponse, error)
- func (c *Client) DeleteKibanaConnector(connectorID string) error
- func (c *Client) DeleteKibanaRule(ruleID string) error
- func (c *Client) EnsureKibanaRuleHasConnector(ruleID, connectorID string) error
- func (c *Client) FindKibanaWebhookConnector(webhookURL string) (*KibanaConnectorResponse, error)
- func (c *Client) GetCase(caseID string) (*CaseResponse, error)
- func (c *Client) GetDocument(index, documentID string) (*GetDocumentResponse, error)
- func (c *Client) GetKibanaRule(ruleID string) (*KibanaRuleDetails, error)
- func (c *Client) GetKibanaRuleDefaultActionGroupID(ruleTypeID string) (string, error)
- func (c *Client) IndexDocument(index, documentID string, doc map[string]any) (*IndexDocumentResponse, error)
- func (c *Client) ListCases() ([]CaseResponse, error)
- func (c *Client) ListCasesUpdatedSince(since string, statuses, severities, tags []string) ([]CaseResponse, error)
- func (c *Client) ListDocuments(index string) ([]SearchHit, error)
- func (c *Client) ListIndices() ([]IndexInfo, error)
- func (c *Client) ListKibanaConnectors() ([]KibanaConnectorResponse, error)
- func (c *Client) ListKibanaRules() ([]KibanaRule, error)
- func (c *Client) ListKibanaSpaces() ([]KibanaSpace, error)
- func (c *Client) RemoveKibanaRuleConnector(ruleID, connectorID string) error
- func (c *Client) SearchDocumentsAfter(index, afterTimestamp string, size int) ([]SearchHit, error)
- func (c *Client) UpdateCase(caseID, version string, updates map[string]any) (*CaseResponse, error)
- func (c *Client) UpdateDocument(index, documentID string, fields map[string]any) (*IndexDocumentResponse, error)
- func (c *Client) ValidateCredentials() error
- func (c *Client) ValidateKibana() error
- type Configuration
- type CreateCase
- func (c *CreateCase) Actions() []core.Action
- func (c *CreateCase) Cancel(_ core.ExecutionContext) error
- func (c *CreateCase) Cleanup(_ core.SetupContext) error
- func (c *CreateCase) Color() string
- func (c *CreateCase) Configuration() []configuration.Field
- func (c *CreateCase) Description() string
- func (c *CreateCase) Documentation() string
- func (c *CreateCase) ExampleOutput() map[string]any
- func (c *CreateCase) Execute(ctx core.ExecutionContext) error
- func (c *CreateCase) HandleAction(_ core.ActionContext) error
- func (c *CreateCase) HandleWebhook(_ core.WebhookRequestContext) (int, *core.WebhookResponseBody, error)
- func (c *CreateCase) Icon() string
- func (c *CreateCase) Label() string
- func (c *CreateCase) Name() string
- func (c *CreateCase) OutputChannels(_ any) []core.OutputChannel
- func (c *CreateCase) ProcessQueueItem(ctx core.ProcessQueueContext) (*uuid.UUID, error)
- func (c *CreateCase) Setup(ctx core.SetupContext) error
- type CreateCaseConfiguration
- type Elastic
- func (e *Elastic) Actions() []core.Action
- func (e *Elastic) Cleanup(_ core.IntegrationCleanupContext) error
- func (e *Elastic) Components() []core.Component
- func (e *Elastic) Configuration() []configuration.Field
- func (e *Elastic) Description() string
- func (e *Elastic) HandleAction(_ core.IntegrationActionContext) error
- func (e *Elastic) HandleRequest(_ core.HTTPRequestContext)
- func (e *Elastic) Icon() string
- func (e *Elastic) Instructions() string
- func (e *Elastic) Label() string
- func (e *Elastic) ListResources(resourceType string, ctx core.ListResourcesContext) ([]core.IntegrationResource, error)
- func (e *Elastic) Name() string
- func (e *Elastic) Sync(ctx core.SyncContext) error
- func (e *Elastic) Triggers() []core.Trigger
- type ElasticWebhookHandler
- func (h *ElasticWebhookHandler) Cleanup(ctx core.WebhookHandlerContext) error
- func (h *ElasticWebhookHandler) CompareConfig(a, b any) (bool, error)
- func (h *ElasticWebhookHandler) Merge(current, requested any) (any, bool, error)
- func (h *ElasticWebhookHandler) Setup(ctx core.WebhookHandlerContext) (any, error)
- type GetCase
- func (c *GetCase) Actions() []core.Action
- func (c *GetCase) Cancel(_ core.ExecutionContext) error
- func (c *GetCase) Cleanup(_ core.SetupContext) error
- func (c *GetCase) Color() string
- func (c *GetCase) Configuration() []configuration.Field
- func (c *GetCase) Description() string
- func (c *GetCase) Documentation() string
- func (c *GetCase) ExampleOutput() map[string]any
- func (c *GetCase) Execute(ctx core.ExecutionContext) error
- func (c *GetCase) HandleAction(_ core.ActionContext) error
- func (c *GetCase) HandleWebhook(_ core.WebhookRequestContext) (int, *core.WebhookResponseBody, error)
- func (c *GetCase) Icon() string
- func (c *GetCase) Label() string
- func (c *GetCase) Name() string
- func (c *GetCase) OutputChannels(_ any) []core.OutputChannel
- func (c *GetCase) ProcessQueueItem(ctx core.ProcessQueueContext) (*uuid.UUID, error)
- func (c *GetCase) Setup(ctx core.SetupContext) error
- type GetCaseConfiguration
- type GetCaseNodeMetadata
- type GetDocument
- func (c *GetDocument) Actions() []core.Action
- func (c *GetDocument) Cancel(_ core.ExecutionContext) error
- func (c *GetDocument) Cleanup(_ core.SetupContext) error
- func (c *GetDocument) Color() string
- func (c *GetDocument) Configuration() []configuration.Field
- func (c *GetDocument) Description() string
- func (c *GetDocument) Documentation() string
- func (c *GetDocument) ExampleOutput() map[string]any
- func (c *GetDocument) Execute(ctx core.ExecutionContext) error
- func (c *GetDocument) HandleAction(_ core.ActionContext) error
- func (c *GetDocument) HandleWebhook(_ core.WebhookRequestContext) (int, *core.WebhookResponseBody, error)
- func (c *GetDocument) Icon() string
- func (c *GetDocument) Label() string
- func (c *GetDocument) Name() string
- func (c *GetDocument) OutputChannels(_ any) []core.OutputChannel
- func (c *GetDocument) ProcessQueueItem(ctx core.ProcessQueueContext) (*uuid.UUID, error)
- func (c *GetDocument) Setup(ctx core.SetupContext) error
- type GetDocumentConfiguration
- type GetDocumentResponse
- type GetDocumentSetupMetadata
- type IndexDocument
- func (c *IndexDocument) Actions() []core.Action
- func (c *IndexDocument) Cancel(_ core.ExecutionContext) error
- func (c *IndexDocument) Cleanup(_ core.SetupContext) error
- func (c *IndexDocument) Color() string
- func (c *IndexDocument) Configuration() []configuration.Field
- func (c *IndexDocument) Description() string
- func (c *IndexDocument) Documentation() string
- func (c *IndexDocument) ExampleOutput() map[string]any
- func (c *IndexDocument) Execute(ctx core.ExecutionContext) error
- func (c *IndexDocument) HandleAction(_ core.ActionContext) error
- func (c *IndexDocument) HandleWebhook(_ core.WebhookRequestContext) (int, *core.WebhookResponseBody, error)
- func (c *IndexDocument) Icon() string
- func (c *IndexDocument) Label() string
- func (c *IndexDocument) Name() string
- func (c *IndexDocument) OutputChannels(_ any) []core.OutputChannel
- func (c *IndexDocument) ProcessQueueItem(ctx core.ProcessQueueContext) (*uuid.UUID, error)
- func (c *IndexDocument) Setup(ctx core.SetupContext) error
- type IndexDocumentConfiguration
- type IndexDocumentResponse
- type IndexDocumentSetupMetadata
- type IndexInfo
- type KibanaAPIError
- type KibanaConnectorResponse
- type KibanaRule
- type KibanaRuleAction
- type KibanaRuleActionFrequency
- type KibanaRuleAlertDelay
- type KibanaRuleDetails
- type KibanaRuleFlapping
- type KibanaRuleResponse
- type KibanaRuleSchedule
- type KibanaRuleType
- type KibanaSpace
- type OnAlertFires
- func (t *OnAlertFires) Actions() []core.Action
- func (t *OnAlertFires) Cleanup(_ core.TriggerContext) error
- func (t *OnAlertFires) Color() string
- func (t *OnAlertFires) Configuration() []configuration.Field
- func (t *OnAlertFires) Description() string
- func (t *OnAlertFires) Documentation() string
- func (t *OnAlertFires) ExampleData() map[string]any
- func (t *OnAlertFires) HandleAction(_ core.TriggerActionContext) (map[string]any, error)
- func (t *OnAlertFires) HandleWebhook(ctx core.WebhookRequestContext) (int, *core.WebhookResponseBody, error)
- func (t *OnAlertFires) Icon() string
- func (t *OnAlertFires) Label() string
- func (t *OnAlertFires) Name() string
- func (t *OnAlertFires) Setup(ctx core.TriggerContext) error
- type OnAlertFiresConfiguration
- type OnAlertFiresMetadata
- type OnCaseStatusChange
- func (t *OnCaseStatusChange) Actions() []core.Action
- func (t *OnCaseStatusChange) Cleanup(ctx core.TriggerContext) error
- func (t *OnCaseStatusChange) Color() string
- func (t *OnCaseStatusChange) Configuration() []configuration.Field
- func (t *OnCaseStatusChange) Description() string
- func (t *OnCaseStatusChange) Documentation() string
- func (t *OnCaseStatusChange) ExampleData() map[string]any
- func (t *OnCaseStatusChange) HandleAction(ctx core.TriggerActionContext) (map[string]any, error)
- func (t *OnCaseStatusChange) HandleWebhook(ctx core.WebhookRequestContext) (int, *core.WebhookResponseBody, error)
- func (t *OnCaseStatusChange) Icon() string
- func (t *OnCaseStatusChange) Label() string
- func (t *OnCaseStatusChange) Name() string
- func (t *OnCaseStatusChange) Setup(ctx core.TriggerContext) error
- type OnCaseStatusChangeConfiguration
- type OnCaseStatusChangeMetadata
- type OnDocumentIndexed
- func (t *OnDocumentIndexed) Actions() []core.Action
- func (t *OnDocumentIndexed) Cleanup(ctx core.TriggerContext) error
- func (t *OnDocumentIndexed) Color() string
- func (t *OnDocumentIndexed) Configuration() []configuration.Field
- func (t *OnDocumentIndexed) Description() string
- func (t *OnDocumentIndexed) Documentation() string
- func (t *OnDocumentIndexed) ExampleData() map[string]any
- func (t *OnDocumentIndexed) HandleAction(ctx core.TriggerActionContext) (map[string]any, error)
- func (t *OnDocumentIndexed) HandleWebhook(ctx core.WebhookRequestContext) (int, *core.WebhookResponseBody, error)
- func (t *OnDocumentIndexed) Icon() string
- func (t *OnDocumentIndexed) Label() string
- func (t *OnDocumentIndexed) Name() string
- func (t *OnDocumentIndexed) Setup(ctx core.TriggerContext) error
- type OnDocumentIndexedConfiguration
- type OnDocumentIndexedMetadata
- type SearchHit
- type UpdateCase
- func (c *UpdateCase) Actions() []core.Action
- func (c *UpdateCase) Cancel(_ core.ExecutionContext) error
- func (c *UpdateCase) Cleanup(_ core.SetupContext) error
- func (c *UpdateCase) Color() string
- func (c *UpdateCase) Configuration() []configuration.Field
- func (c *UpdateCase) Description() string
- func (c *UpdateCase) Documentation() string
- func (c *UpdateCase) ExampleOutput() map[string]any
- func (c *UpdateCase) Execute(ctx core.ExecutionContext) error
- func (c *UpdateCase) HandleAction(_ core.ActionContext) error
- func (c *UpdateCase) HandleWebhook(_ core.WebhookRequestContext) (int, *core.WebhookResponseBody, error)
- func (c *UpdateCase) Icon() string
- func (c *UpdateCase) Label() string
- func (c *UpdateCase) Name() string
- func (c *UpdateCase) OutputChannels(_ any) []core.OutputChannel
- func (c *UpdateCase) ProcessQueueItem(ctx core.ProcessQueueContext) (*uuid.UUID, error)
- func (c *UpdateCase) Setup(ctx core.SetupContext) error
- type UpdateCaseConfiguration
- type UpdateCaseNodeMetadata
- type UpdateDocument
- func (c *UpdateDocument) Actions() []core.Action
- func (c *UpdateDocument) Cancel(_ core.ExecutionContext) error
- func (c *UpdateDocument) Cleanup(_ core.SetupContext) error
- func (c *UpdateDocument) Color() string
- func (c *UpdateDocument) Configuration() []configuration.Field
- func (c *UpdateDocument) Description() string
- func (c *UpdateDocument) Documentation() string
- func (c *UpdateDocument) ExampleOutput() map[string]any
- func (c *UpdateDocument) Execute(ctx core.ExecutionContext) error
- func (c *UpdateDocument) HandleAction(_ core.ActionContext) error
- func (c *UpdateDocument) HandleWebhook(_ core.WebhookRequestContext) (int, *core.WebhookResponseBody, error)
- func (c *UpdateDocument) Icon() string
- func (c *UpdateDocument) Label() string
- func (c *UpdateDocument) Name() string
- func (c *UpdateDocument) OutputChannels(_ any) []core.OutputChannel
- func (c *UpdateDocument) ProcessQueueItem(ctx core.ProcessQueueContext) (*uuid.UUID, error)
- func (c *UpdateDocument) Setup(ctx core.SetupContext) error
- type UpdateDocumentConfiguration
- type UpdateDocumentSetupMetadata
Constants ¶
const ( ResourceTypeIndex = "elastic.index" ResourceTypeDocument = "elastic.document" ResourceTypeKibanaRule = "elastic.kibana.rule" ResourceTypeKibanaSpace = "elastic.kibana.space" ResourceTypeKibanaAlertSeverity = "elastic.kibana.alert.severity" ResourceTypeKibanaAlertStatus = "elastic.kibana.alert.status" ResourceTypeCase = "elastic.case" ResourceTypeCaseStatus = "elastic.case.status" ResourceTypeCaseSeverity = "elastic.case.severity" ResourceTypeCaseVersion = "elastic.case.version" )
const KibanaConnectorName = "SuperPlane Alert"
KibanaConnectorName is the display name used for all Kibana webhook connectors created by SuperPlane. Used by triggers to locate the shared connector.
const SigningHeaderName = "X-Superplane-Secret"
SigningHeaderName is the HTTP header Kibana will include on every webhook delivery to prove the request originates from the configured connector.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CaseResponse ¶
type CaseResponse struct {
ID string `json:"id"`
Title string `json:"title"`
Description string `json:"description"`
Status string `json:"status"`
Severity string `json:"severity"`
Tags []string `json:"tags"`
Version string `json:"version"`
CreatedAt string `json:"created_at"`
UpdatedAt string `json:"updated_at"`
}
CaseResponse is the relevant subset of a Kibana case.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func NewClient ¶
func NewClient(httpCtx core.HTTPContext, ctx core.IntegrationContext) (*Client, error)
func (*Client) CreateCase ¶
func (c *Client) CreateCase(title, description, severity, owner string, tags []string) (*CaseResponse, error)
CreateCase creates a new case in Kibana. connector is always set to none. owner must be one of: "cases", "securitySolution", "observability".
func (*Client) CreateKibanaCaseQueryRule ¶
func (c *Client) CreateKibanaCaseQueryRule(connectorID, routeKey string) (*KibanaRule, error)
CreateKibanaCaseQueryRule creates a Kibana Elasticsearch query rule that signals SuperPlane whenever cases are updated in the current 1-minute window.
func (*Client) CreateKibanaConnector ¶
func (c *Client) CreateKibanaConnector(name, webhookURL, secret string) (*KibanaConnectorResponse, error)
CreateKibanaConnector creates a Kibana Webhook connector that POSTs to webhookURL and includes the signing secret as the X-Superplane-Secret header.
func (*Client) CreateKibanaQueryRule ¶
func (c *Client) CreateKibanaQueryRule(index, connectorID, routeKey string) (*KibanaRuleResponse, error)
CreateKibanaQueryRule creates a Kibana Elasticsearch query rule that fires connectorID whenever new documents appear in index within a 1-minute window.
func (*Client) DeleteKibanaConnector ¶
DeleteKibanaConnector removes a Kibana connector by ID. A 404 response is treated as success: the connector is already gone.
func (*Client) DeleteKibanaRule ¶
DeleteKibanaRule removes a Kibana alerting rule by ID. A 404 response is treated as success: the rule is already gone.
func (*Client) EnsureKibanaRuleHasConnector ¶
func (*Client) FindKibanaWebhookConnector ¶
func (c *Client) FindKibanaWebhookConnector(webhookURL string) (*KibanaConnectorResponse, error)
func (*Client) GetCase ¶
func (c *Client) GetCase(caseID string) (*CaseResponse, error)
GetCase retrieves a Kibana case by ID.
func (*Client) GetDocument ¶
func (c *Client) GetDocument(index, documentID string) (*GetDocumentResponse, error)
GetDocument retrieves a document by index and document ID.
func (*Client) GetKibanaRule ¶
func (c *Client) GetKibanaRule(ruleID string) (*KibanaRuleDetails, error)
func (*Client) GetKibanaRuleDefaultActionGroupID ¶
func (*Client) IndexDocument ¶
func (c *Client) IndexDocument(index, documentID string, doc map[string]any) (*IndexDocumentResponse, error)
IndexDocument writes doc to the given index. If documentID is non-empty the document is written at that ID (PUT, enabling idempotent writes); otherwise Elasticsearch generates an ID (POST).
func (*Client) ListCases ¶
func (c *Client) ListCases() ([]CaseResponse, error)
ListCases returns all cases sorted by updatedAt descending.
func (*Client) ListCasesUpdatedSince ¶
func (c *Client) ListCasesUpdatedSince(since string, statuses, severities, tags []string) ([]CaseResponse, error)
ListCasesUpdatedSince returns cases sorted by updatedAt descending, filtered to those updated strictly after the given ISO timestamp. Stops fetching pages once it encounters a case updated before or at the checkpoint.
func (*Client) ListDocuments ¶
ListDocuments returns up to 100 documents from an index for use in resource pickers.
func (*Client) ListIndices ¶
ListIndices returns all user-facing indices from the cluster, excluding dot-prefixed system indices (e.g. .kibana, .security-*).
func (*Client) ListKibanaConnectors ¶
func (c *Client) ListKibanaConnectors() ([]KibanaConnectorResponse, error)
func (*Client) ListKibanaRules ¶
func (c *Client) ListKibanaRules() ([]KibanaRule, error)
ListKibanaRules returns all alerting rules from Kibana, paginating as needed.
func (*Client) ListKibanaSpaces ¶
func (c *Client) ListKibanaSpaces() ([]KibanaSpace, error)
ListKibanaSpaces returns all spaces from Kibana.
func (*Client) RemoveKibanaRuleConnector ¶
func (*Client) SearchDocumentsAfter ¶
SearchDocumentsAfter queries an index for documents where @timestamp is strictly greater than afterTimestamp, sorted ascending.
func (*Client) UpdateCase ¶
UpdateCase applies a partial update to an existing Kibana case. updates is a map of fields to change; id and version are always included. version is required by Kibana for optimistic concurrency.
func (*Client) UpdateDocument ¶
func (c *Client) UpdateDocument(index, documentID string, fields map[string]any) (*IndexDocumentResponse, error)
UpdateDocument applies a partial update to an existing document. Uses POST /{index}/_update/{id} with body {"doc": fields}. Reuses IndexDocumentResponse since the response shape is identical.
func (*Client) ValidateCredentials ¶
ValidateCredentials checks that the configured URL and credentials are valid by performing a GET / against the cluster info endpoint.
func (*Client) ValidateKibana ¶
ValidateKibana checks that the Kibana URL is reachable and that the credentials have permission to manage connectors (required for webhook setup).
type Configuration ¶
type CreateCase ¶
type CreateCase struct{}
func (*CreateCase) Actions ¶
func (c *CreateCase) Actions() []core.Action
func (*CreateCase) Cancel ¶
func (c *CreateCase) Cancel(_ core.ExecutionContext) error
func (*CreateCase) Cleanup ¶
func (c *CreateCase) Cleanup(_ core.SetupContext) error
func (*CreateCase) Color ¶
func (c *CreateCase) Color() string
func (*CreateCase) Configuration ¶
func (c *CreateCase) Configuration() []configuration.Field
func (*CreateCase) Description ¶
func (c *CreateCase) Description() string
func (*CreateCase) Documentation ¶
func (c *CreateCase) Documentation() string
func (*CreateCase) ExampleOutput ¶
func (c *CreateCase) ExampleOutput() map[string]any
func (*CreateCase) Execute ¶
func (c *CreateCase) Execute(ctx core.ExecutionContext) error
func (*CreateCase) HandleAction ¶
func (c *CreateCase) HandleAction(_ core.ActionContext) error
func (*CreateCase) HandleWebhook ¶
func (c *CreateCase) HandleWebhook(_ core.WebhookRequestContext) (int, *core.WebhookResponseBody, error)
func (*CreateCase) Icon ¶
func (c *CreateCase) Icon() string
func (*CreateCase) Label ¶
func (c *CreateCase) Label() string
func (*CreateCase) Name ¶
func (c *CreateCase) Name() string
func (*CreateCase) OutputChannels ¶
func (c *CreateCase) OutputChannels(_ any) []core.OutputChannel
func (*CreateCase) ProcessQueueItem ¶
func (c *CreateCase) ProcessQueueItem(ctx core.ProcessQueueContext) (*uuid.UUID, error)
func (*CreateCase) Setup ¶
func (c *CreateCase) Setup(ctx core.SetupContext) error
type CreateCaseConfiguration ¶
type CreateCaseConfiguration struct {
Title string `json:"title" mapstructure:"title"`
Description string `json:"description" mapstructure:"description"`
Severity string `json:"severity" mapstructure:"severity"`
Owner string `json:"owner" mapstructure:"owner"`
Tags []string `json:"tags" mapstructure:"tags"`
}
type Elastic ¶
type Elastic struct{}
func (*Elastic) Components ¶
func (*Elastic) Configuration ¶
func (e *Elastic) Configuration() []configuration.Field
func (*Elastic) Description ¶
func (*Elastic) HandleAction ¶
func (e *Elastic) HandleAction(_ core.IntegrationActionContext) error
func (*Elastic) HandleRequest ¶
func (e *Elastic) HandleRequest(_ core.HTTPRequestContext)
func (*Elastic) Instructions ¶
func (*Elastic) ListResources ¶
func (e *Elastic) ListResources(resourceType string, ctx core.ListResourcesContext) ([]core.IntegrationResource, error)
type ElasticWebhookHandler ¶
type ElasticWebhookHandler struct{}
ElasticWebhookHandler automatically creates and tears down Kibana Webhook connectors when the OnAlertFires trigger is set up or removed.
func (*ElasticWebhookHandler) Cleanup ¶
func (h *ElasticWebhookHandler) Cleanup(ctx core.WebhookHandlerContext) error
func (*ElasticWebhookHandler) CompareConfig ¶
func (h *ElasticWebhookHandler) CompareConfig(a, b any) (bool, error)
func (*ElasticWebhookHandler) Merge ¶
func (h *ElasticWebhookHandler) Merge(current, requested any) (any, bool, error)
func (*ElasticWebhookHandler) Setup ¶
func (h *ElasticWebhookHandler) Setup(ctx core.WebhookHandlerContext) (any, error)
type GetCase ¶
type GetCase struct{}
func (*GetCase) Configuration ¶
func (c *GetCase) Configuration() []configuration.Field
func (*GetCase) Description ¶
func (*GetCase) Documentation ¶
func (*GetCase) ExampleOutput ¶
func (*GetCase) HandleAction ¶
func (c *GetCase) HandleAction(_ core.ActionContext) error
func (*GetCase) HandleWebhook ¶
func (c *GetCase) HandleWebhook(_ core.WebhookRequestContext) (int, *core.WebhookResponseBody, error)
func (*GetCase) OutputChannels ¶
func (c *GetCase) OutputChannels(_ any) []core.OutputChannel
func (*GetCase) ProcessQueueItem ¶
type GetCaseConfiguration ¶
type GetCaseConfiguration struct {
CaseID string `json:"caseId" mapstructure:"caseId"`
}
type GetCaseNodeMetadata ¶
type GetCaseNodeMetadata struct {
CaseName string `json:"caseName,omitempty" mapstructure:"caseName"`
}
type GetDocument ¶
type GetDocument struct{}
func (*GetDocument) Actions ¶
func (c *GetDocument) Actions() []core.Action
func (*GetDocument) Cancel ¶
func (c *GetDocument) Cancel(_ core.ExecutionContext) error
func (*GetDocument) Cleanup ¶
func (c *GetDocument) Cleanup(_ core.SetupContext) error
func (*GetDocument) Color ¶
func (c *GetDocument) Color() string
func (*GetDocument) Configuration ¶
func (c *GetDocument) Configuration() []configuration.Field
func (*GetDocument) Description ¶
func (c *GetDocument) Description() string
func (*GetDocument) Documentation ¶
func (c *GetDocument) Documentation() string
func (*GetDocument) ExampleOutput ¶
func (c *GetDocument) ExampleOutput() map[string]any
func (*GetDocument) Execute ¶
func (c *GetDocument) Execute(ctx core.ExecutionContext) error
func (*GetDocument) HandleAction ¶
func (c *GetDocument) HandleAction(_ core.ActionContext) error
func (*GetDocument) HandleWebhook ¶
func (c *GetDocument) HandleWebhook(_ core.WebhookRequestContext) (int, *core.WebhookResponseBody, error)
func (*GetDocument) Icon ¶
func (c *GetDocument) Icon() string
func (*GetDocument) Label ¶
func (c *GetDocument) Label() string
func (*GetDocument) Name ¶
func (c *GetDocument) Name() string
func (*GetDocument) OutputChannels ¶
func (c *GetDocument) OutputChannels(_ any) []core.OutputChannel
func (*GetDocument) ProcessQueueItem ¶
func (c *GetDocument) ProcessQueueItem(ctx core.ProcessQueueContext) (*uuid.UUID, error)
func (*GetDocument) Setup ¶
func (c *GetDocument) Setup(ctx core.SetupContext) error
type GetDocumentResponse ¶
type GetDocumentResponse struct {
ID string `json:"_id"`
Index string `json:"_index"`
Version int `json:"_version"`
Found bool `json:"found"`
Source map[string]any `json:"_source"`
}
GetDocumentResponse is returned by GET /{index}/_doc/{id}.
type IndexDocument ¶
type IndexDocument struct{}
func (*IndexDocument) Actions ¶
func (c *IndexDocument) Actions() []core.Action
func (*IndexDocument) Cancel ¶
func (c *IndexDocument) Cancel(_ core.ExecutionContext) error
func (*IndexDocument) Cleanup ¶
func (c *IndexDocument) Cleanup(_ core.SetupContext) error
func (*IndexDocument) Color ¶
func (c *IndexDocument) Color() string
func (*IndexDocument) Configuration ¶
func (c *IndexDocument) Configuration() []configuration.Field
func (*IndexDocument) Description ¶
func (c *IndexDocument) Description() string
func (*IndexDocument) Documentation ¶
func (c *IndexDocument) Documentation() string
func (*IndexDocument) ExampleOutput ¶
func (c *IndexDocument) ExampleOutput() map[string]any
func (*IndexDocument) Execute ¶
func (c *IndexDocument) Execute(ctx core.ExecutionContext) error
func (*IndexDocument) HandleAction ¶
func (c *IndexDocument) HandleAction(_ core.ActionContext) error
func (*IndexDocument) HandleWebhook ¶
func (c *IndexDocument) HandleWebhook(_ core.WebhookRequestContext) (int, *core.WebhookResponseBody, error)
func (*IndexDocument) Icon ¶
func (c *IndexDocument) Icon() string
func (*IndexDocument) Label ¶
func (c *IndexDocument) Label() string
func (*IndexDocument) Name ¶
func (c *IndexDocument) Name() string
func (*IndexDocument) OutputChannels ¶
func (c *IndexDocument) OutputChannels(_ any) []core.OutputChannel
func (*IndexDocument) ProcessQueueItem ¶
func (c *IndexDocument) ProcessQueueItem(ctx core.ProcessQueueContext) (*uuid.UUID, error)
func (*IndexDocument) Setup ¶
func (c *IndexDocument) Setup(ctx core.SetupContext) error
type IndexDocumentResponse ¶
type IndexDocumentResponse struct {
ID string `json:"_id"`
Index string `json:"_index"`
Result string `json:"result"`
Version int `json:"_version"`
Shards struct {
Successful int `json:"successful"`
Failed int `json:"failed"`
} `json:"_shards"`
}
IndexDocumentResponse represents the Elasticsearch index/create response.
type IndexDocumentSetupMetadata ¶
type IndexDocumentSetupMetadata struct {
Index string `json:"index" mapstructure:"index"`
}
type IndexInfo ¶
type IndexInfo struct {
Index string `json:"index"`
}
IndexInfo holds the minimal fields returned by GET /_cat/indices.
type KibanaAPIError ¶
KibanaAPIError is returned by execKibanaRequest for non-2xx responses so callers can check the status code (e.g. treat 404 as a no-op on delete).
func (*KibanaAPIError) Error ¶
func (e *KibanaAPIError) Error() string
type KibanaConnectorResponse ¶
type KibanaConnectorResponse struct {
ID string `json:"id"`
Name string `json:"name"`
ConnectorTypeID string `json:"connector_type_id"`
ReferencedByCount int `json:"referenced_by_count"`
Config struct {
URL string `json:"url"`
Method string `json:"method"`
Headers map[string]string `json:"headers"`
} `json:"config"`
}
KibanaConnectorResponse is the relevant subset of the Kibana connector API response.
type KibanaRule ¶
KibanaRule is the relevant subset of a Kibana alerting rule.
type KibanaRuleAction ¶
type KibanaRuleAction struct {
ID string `json:"id"`
Group string `json:"group"`
Params map[string]any `json:"params"`
Frequency *KibanaRuleActionFrequency `json:"frequency,omitempty"`
UseAlertDataForTemplate bool `json:"use_alert_data_for_template,omitempty"`
UUID string `json:"uuid,omitempty"`
AlertsFilter map[string]any `json:"alerts_filter,omitempty"`
}
type KibanaRuleAlertDelay ¶
type KibanaRuleAlertDelay struct {
Active int `json:"active"`
}
type KibanaRuleDetails ¶
type KibanaRuleDetails struct {
ID string `json:"id"`
Name string `json:"name"`
Consumer string `json:"consumer"`
Params map[string]any `json:"params"`
RuleTypeID string `json:"rule_type_id"`
Schedule KibanaRuleSchedule `json:"schedule"`
Tags []string `json:"tags"`
Actions []KibanaRuleAction `json:"actions"`
AlertDelay *KibanaRuleAlertDelay `json:"alert_delay,omitempty"`
}
type KibanaRuleFlapping ¶
type KibanaRuleResponse ¶
KibanaRuleResponse is the relevant subset of the Kibana alerting rule API response.
type KibanaRuleSchedule ¶
type KibanaRuleSchedule struct {
Interval string `json:"interval"`
}
type KibanaRuleType ¶
type KibanaSpace ¶
KibanaSpace is the relevant subset of a Kibana space.
type OnAlertFires ¶
type OnAlertFires struct{}
func (*OnAlertFires) Actions ¶
func (t *OnAlertFires) Actions() []core.Action
func (*OnAlertFires) Cleanup ¶
func (t *OnAlertFires) Cleanup(_ core.TriggerContext) error
func (*OnAlertFires) Color ¶
func (t *OnAlertFires) Color() string
func (*OnAlertFires) Configuration ¶
func (t *OnAlertFires) Configuration() []configuration.Field
func (*OnAlertFires) Description ¶
func (t *OnAlertFires) Description() string
func (*OnAlertFires) Documentation ¶
func (t *OnAlertFires) Documentation() string
func (*OnAlertFires) ExampleData ¶
func (t *OnAlertFires) ExampleData() map[string]any
func (*OnAlertFires) HandleAction ¶
func (t *OnAlertFires) HandleAction(_ core.TriggerActionContext) (map[string]any, error)
func (*OnAlertFires) HandleWebhook ¶
func (t *OnAlertFires) HandleWebhook(ctx core.WebhookRequestContext) (int, *core.WebhookResponseBody, error)
func (*OnAlertFires) Icon ¶
func (t *OnAlertFires) Icon() string
func (*OnAlertFires) Label ¶
func (t *OnAlertFires) Label() string
func (*OnAlertFires) Name ¶
func (t *OnAlertFires) Name() string
func (*OnAlertFires) Setup ¶
func (t *OnAlertFires) Setup(ctx core.TriggerContext) error
type OnAlertFiresConfiguration ¶
type OnAlertFiresConfiguration struct {
Rule string `json:"rule" mapstructure:"rule"`
Spaces []string `json:"spaces" mapstructure:"spaces"`
Tags []configuration.Predicate `json:"tags" mapstructure:"tags"`
Severities []string `json:"severities" mapstructure:"severities"`
Statuses []string `json:"statuses" mapstructure:"statuses"`
}
type OnAlertFiresMetadata ¶
type OnCaseStatusChange ¶
type OnCaseStatusChange struct{}
func (*OnCaseStatusChange) Actions ¶
func (t *OnCaseStatusChange) Actions() []core.Action
func (*OnCaseStatusChange) Cleanup ¶
func (t *OnCaseStatusChange) Cleanup(ctx core.TriggerContext) error
func (*OnCaseStatusChange) Color ¶
func (t *OnCaseStatusChange) Color() string
func (*OnCaseStatusChange) Configuration ¶
func (t *OnCaseStatusChange) Configuration() []configuration.Field
func (*OnCaseStatusChange) Description ¶
func (t *OnCaseStatusChange) Description() string
func (*OnCaseStatusChange) Documentation ¶
func (t *OnCaseStatusChange) Documentation() string
func (*OnCaseStatusChange) ExampleData ¶
func (t *OnCaseStatusChange) ExampleData() map[string]any
func (*OnCaseStatusChange) HandleAction ¶
func (t *OnCaseStatusChange) HandleAction(ctx core.TriggerActionContext) (map[string]any, error)
func (*OnCaseStatusChange) HandleWebhook ¶
func (t *OnCaseStatusChange) HandleWebhook(ctx core.WebhookRequestContext) (int, *core.WebhookResponseBody, error)
func (*OnCaseStatusChange) Icon ¶
func (t *OnCaseStatusChange) Icon() string
func (*OnCaseStatusChange) Label ¶
func (t *OnCaseStatusChange) Label() string
func (*OnCaseStatusChange) Name ¶
func (t *OnCaseStatusChange) Name() string
func (*OnCaseStatusChange) Setup ¶
func (t *OnCaseStatusChange) Setup(ctx core.TriggerContext) error
type OnCaseStatusChangeConfiguration ¶
type OnCaseStatusChangeConfiguration struct {
Cases []string `json:"cases" mapstructure:"cases"`
Statuses []string `json:"statuses" mapstructure:"statuses"`
Severities []string `json:"severities" mapstructure:"severities"`
Tags []configuration.Predicate `json:"tags" mapstructure:"tags"`
}
type OnCaseStatusChangeMetadata ¶
type OnCaseStatusChangeMetadata struct {
LastPollTime string `json:"lastPollTime,omitempty" mapstructure:"lastPollTime"`
CaseNames map[string]string `json:"caseNames,omitempty" mapstructure:"caseNames"`
CaseStatuses map[string]string `json:"caseStatuses,omitempty" mapstructure:"caseStatuses"`
RouteKey string `json:"routeKey,omitempty" mapstructure:"routeKey"`
RuleID string `json:"ruleId,omitempty" mapstructure:"ruleId"`
}
type OnDocumentIndexed ¶
type OnDocumentIndexed struct{}
func (*OnDocumentIndexed) Actions ¶
func (t *OnDocumentIndexed) Actions() []core.Action
func (*OnDocumentIndexed) Cleanup ¶
func (t *OnDocumentIndexed) Cleanup(ctx core.TriggerContext) error
func (*OnDocumentIndexed) Color ¶
func (t *OnDocumentIndexed) Color() string
func (*OnDocumentIndexed) Configuration ¶
func (t *OnDocumentIndexed) Configuration() []configuration.Field
func (*OnDocumentIndexed) Description ¶
func (t *OnDocumentIndexed) Description() string
func (*OnDocumentIndexed) Documentation ¶
func (t *OnDocumentIndexed) Documentation() string
func (*OnDocumentIndexed) ExampleData ¶
func (t *OnDocumentIndexed) ExampleData() map[string]any
func (*OnDocumentIndexed) HandleAction ¶
func (t *OnDocumentIndexed) HandleAction(ctx core.TriggerActionContext) (map[string]any, error)
func (*OnDocumentIndexed) HandleWebhook ¶
func (t *OnDocumentIndexed) HandleWebhook(ctx core.WebhookRequestContext) (int, *core.WebhookResponseBody, error)
func (*OnDocumentIndexed) Icon ¶
func (t *OnDocumentIndexed) Icon() string
func (*OnDocumentIndexed) Label ¶
func (t *OnDocumentIndexed) Label() string
func (*OnDocumentIndexed) Name ¶
func (t *OnDocumentIndexed) Name() string
func (*OnDocumentIndexed) Setup ¶
func (t *OnDocumentIndexed) Setup(ctx core.TriggerContext) error
type OnDocumentIndexedConfiguration ¶
type OnDocumentIndexedConfiguration struct {
Index string `json:"index" mapstructure:"index"`
}
type OnDocumentIndexedMetadata ¶
type OnDocumentIndexedMetadata struct {
LastTimestamp string `json:"lastTimestamp,omitempty" mapstructure:"lastTimestamp"`
RouteKey string `json:"routeKey,omitempty" mapstructure:"routeKey"`
RuleID string `json:"ruleId,omitempty" mapstructure:"ruleId"`
Index string `json:"index,omitempty" mapstructure:"index"`
}
type SearchHit ¶
type SearchHit struct {
ID string `json:"_id"`
Index string `json:"_index"`
Source map[string]any `json:"_source"`
}
SearchHit represents a single document result from an Elasticsearch search.
func (*SearchHit) TimestampValue ¶
TimestampValue extracts the @timestamp value from the source as a string. Returns "" if the field is absent or not a string.
type UpdateCase ¶
type UpdateCase struct{}
func (*UpdateCase) Actions ¶
func (c *UpdateCase) Actions() []core.Action
func (*UpdateCase) Cancel ¶
func (c *UpdateCase) Cancel(_ core.ExecutionContext) error
func (*UpdateCase) Cleanup ¶
func (c *UpdateCase) Cleanup(_ core.SetupContext) error
func (*UpdateCase) Color ¶
func (c *UpdateCase) Color() string
func (*UpdateCase) Configuration ¶
func (c *UpdateCase) Configuration() []configuration.Field
func (*UpdateCase) Description ¶
func (c *UpdateCase) Description() string
func (*UpdateCase) Documentation ¶
func (c *UpdateCase) Documentation() string
func (*UpdateCase) ExampleOutput ¶
func (c *UpdateCase) ExampleOutput() map[string]any
func (*UpdateCase) Execute ¶
func (c *UpdateCase) Execute(ctx core.ExecutionContext) error
func (*UpdateCase) HandleAction ¶
func (c *UpdateCase) HandleAction(_ core.ActionContext) error
func (*UpdateCase) HandleWebhook ¶
func (c *UpdateCase) HandleWebhook(_ core.WebhookRequestContext) (int, *core.WebhookResponseBody, error)
func (*UpdateCase) Icon ¶
func (c *UpdateCase) Icon() string
func (*UpdateCase) Label ¶
func (c *UpdateCase) Label() string
func (*UpdateCase) Name ¶
func (c *UpdateCase) Name() string
func (*UpdateCase) OutputChannels ¶
func (c *UpdateCase) OutputChannels(_ any) []core.OutputChannel
func (*UpdateCase) ProcessQueueItem ¶
func (c *UpdateCase) ProcessQueueItem(ctx core.ProcessQueueContext) (*uuid.UUID, error)
func (*UpdateCase) Setup ¶
func (c *UpdateCase) Setup(ctx core.SetupContext) error
type UpdateCaseConfiguration ¶
type UpdateCaseConfiguration struct {
CaseID string `json:"case" mapstructure:"case"`
Title string `json:"title" mapstructure:"title"`
Description string `json:"description" mapstructure:"description"`
Status string `json:"status" mapstructure:"status"`
Severity string `json:"severity" mapstructure:"severity"`
Tags []string `json:"tags" mapstructure:"tags"`
}
type UpdateCaseNodeMetadata ¶
type UpdateCaseNodeMetadata struct {
CaseName string `json:"caseName,omitempty" mapstructure:"caseName"`
}
type UpdateDocument ¶
type UpdateDocument struct{}
func (*UpdateDocument) Actions ¶
func (c *UpdateDocument) Actions() []core.Action
func (*UpdateDocument) Cancel ¶
func (c *UpdateDocument) Cancel(_ core.ExecutionContext) error
func (*UpdateDocument) Cleanup ¶
func (c *UpdateDocument) Cleanup(_ core.SetupContext) error
func (*UpdateDocument) Color ¶
func (c *UpdateDocument) Color() string
func (*UpdateDocument) Configuration ¶
func (c *UpdateDocument) Configuration() []configuration.Field
func (*UpdateDocument) Description ¶
func (c *UpdateDocument) Description() string
func (*UpdateDocument) Documentation ¶
func (c *UpdateDocument) Documentation() string
func (*UpdateDocument) ExampleOutput ¶
func (c *UpdateDocument) ExampleOutput() map[string]any
func (*UpdateDocument) Execute ¶
func (c *UpdateDocument) Execute(ctx core.ExecutionContext) error
func (*UpdateDocument) HandleAction ¶
func (c *UpdateDocument) HandleAction(_ core.ActionContext) error
func (*UpdateDocument) HandleWebhook ¶
func (c *UpdateDocument) HandleWebhook(_ core.WebhookRequestContext) (int, *core.WebhookResponseBody, error)
func (*UpdateDocument) Icon ¶
func (c *UpdateDocument) Icon() string
func (*UpdateDocument) Label ¶
func (c *UpdateDocument) Label() string
func (*UpdateDocument) Name ¶
func (c *UpdateDocument) Name() string
func (*UpdateDocument) OutputChannels ¶
func (c *UpdateDocument) OutputChannels(_ any) []core.OutputChannel
func (*UpdateDocument) ProcessQueueItem ¶
func (c *UpdateDocument) ProcessQueueItem(ctx core.ProcessQueueContext) (*uuid.UUID, error)
func (*UpdateDocument) Setup ¶
func (c *UpdateDocument) Setup(ctx core.SetupContext) error