resources

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 13, 2026 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Package resources exposes TheHive metadata, schemas, rules, and facts as MCP resources, covering both static embedded content and dynamic API-backed lookups.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAlertCreateSchemaHandler

func GetAlertCreateSchemaHandler() ([]mcp.ResourceContents, error)

GetAlertCreateSchemaHandler returns the alert create-input schema.

func GetAlertFactHandler

func GetAlertFactHandler() ([]mcp.ResourceContents, error)

GetAlertFactHandler returns the alert documentation fact resource.

func GetAlertSchemaHandler

func GetAlertSchemaHandler() ([]mcp.ResourceContents, error)

GetAlertSchemaHandler returns the alert output schema.

func GetAlertUpdateSchemaHandler

func GetAlertUpdateSchemaHandler() ([]mcp.ResourceContents, error)

GetAlertUpdateSchemaHandler returns the alert update-input schema.

func GetAnalyzerFactHandler

func GetAnalyzerFactHandler() ([]mcp.ResourceContents, error)

GetAnalyzerFactHandler returns the analyzer documentation fact resource.

func GetAvailableAnalyzers

func GetAvailableAnalyzers(ctx context.Context, _ mcp.ReadResourceRequest) ([]mcp.ResourceContents, error)

GetAvailableAnalyzers returns the Cortex analyzers the session may use as a JSON resource.

func GetAvailableCaseStatuses

func GetAvailableCaseStatuses(ctx context.Context, _ mcp.ReadResourceRequest) ([]mcp.ResourceContents, error)

GetAvailableCaseStatuses returns the configured case status values as a JSON resource.

func GetAvailableCaseTemplates

func GetAvailableCaseTemplates(ctx context.Context, _ mcp.ReadResourceRequest) ([]mcp.ResourceContents, error)

GetAvailableCaseTemplates returns the organisation's case templates as a JSON resource.

func GetAvailableCustomFields

func GetAvailableCustomFields(ctx context.Context, _ mcp.ReadResourceRequest) ([]mcp.ResourceContents, error)

GetAvailableCustomFields returns the organisation's custom fields as a JSON resource.

func GetAvailableObservableTypes

func GetAvailableObservableTypes(ctx context.Context, _ mcp.ReadResourceRequest) ([]mcp.ResourceContents, error)

GetAvailableObservableTypes returns the configured observable data types as a JSON resource.

func GetAvailableResponders

func GetAvailableResponders(ctx context.Context, req mcp.ReadResourceRequest) ([]mcp.ResourceContents, error)

GetAvailableResponders returns the Cortex responders for the entity named by the request's entityType and entityId parameters as a JSON resource.

func GetAvailableUsers

func GetAvailableUsers(ctx context.Context, _ mcp.ReadResourceRequest) ([]mcp.ResourceContents, error)

GetAvailableUsers returns the organisation's users as a JSON resource.

func GetCaseCreateSchemaHandler

func GetCaseCreateSchemaHandler() ([]mcp.ResourceContents, error)

GetCaseCreateSchemaHandler returns the case create-input schema.

func GetCaseFactHandler

func GetCaseFactHandler() ([]mcp.ResourceContents, error)

GetCaseFactHandler returns the case documentation fact resource.

func GetCaseSchemaHandler

func GetCaseSchemaHandler() ([]mcp.ResourceContents, error)

GetCaseSchemaHandler returns the case output schema.

func GetCaseTemplateCreateSchemaHandler added in v0.3.3

func GetCaseTemplateCreateSchemaHandler() ([]mcp.ResourceContents, error)

GetCaseTemplateCreateSchemaHandler returns the case template create-input schema.

func GetCaseTemplateFactHandler added in v0.3.3

func GetCaseTemplateFactHandler() ([]mcp.ResourceContents, error)

GetCaseTemplateFactHandler returns the case template documentation fact resource.

func GetCaseTemplateSchemaHandler

func GetCaseTemplateSchemaHandler() ([]mcp.ResourceContents, error)

GetCaseTemplateSchemaHandler returns the case template output schema.

func GetCaseTemplateUpdateSchemaHandler added in v0.3.3

func GetCaseTemplateUpdateSchemaHandler() ([]mcp.ResourceContents, error)

GetCaseTemplateUpdateSchemaHandler returns the case template update-input schema.

func GetCaseUpdateSchemaHandler

func GetCaseUpdateSchemaHandler() ([]mcp.ResourceContents, error)

GetCaseUpdateSchemaHandler returns the case update-input schema.

func GetCatalogData

func GetCatalogData() map[string]any

GetCatalogData returns the resource catalog's category structure.

func GetCurrentPermissions

func GetCurrentPermissions(ctx context.Context, _ mcp.ReadResourceRequest) ([]mcp.ResourceContents, error)

GetCurrentPermissions returns the session's active permission configuration as a JSON resource.

func GetCurrentUser

func GetCurrentUser(ctx context.Context, _ mcp.ReadResourceRequest) ([]mcp.ResourceContents, error)

GetCurrentUser returns the authenticated user's information as a JSON resource.

func GetDateFactHandler

func GetDateFactHandler() ([]mcp.ResourceContents, error)

GetDateFactHandler returns the current server time as a fact resource.

func GetFilterDslDocHandler added in v1.0.0

func GetFilterDslDocHandler() ([]mcp.ResourceContents, error)

GetFilterDslDocHandler returns the filter DSL cheatsheet document.

func GetFilterSchemaHandler

func GetFilterSchemaHandler() ([]mcp.ResourceContents, error)

GetFilterSchemaHandler returns the filter schema.

func GetFilteringRuleHandler

func GetFilteringRuleHandler() ([]mcp.ResourceContents, error)

GetFilteringRuleHandler returns TheHive filtering rule content.

func GetFormattingRuleHandler

func GetFormattingRuleHandler() ([]mcp.ResourceContents, error)

GetFormattingRuleHandler returns TheHive formatting rule content.

func GetHiveFactHandler

func GetHiveFactHandler() ([]mcp.ResourceContents, error)

GetHiveFactHandler returns the TheHive platform overview fact resource.

func GetIntegrityRuleHandler

func GetIntegrityRuleHandler() ([]mcp.ResourceContents, error)

GetIntegrityRuleHandler returns TheHive integrity rule content.

func GetObservableCreateSchemaHandler

func GetObservableCreateSchemaHandler() ([]mcp.ResourceContents, error)

GetObservableCreateSchemaHandler returns the observable create-input schema.

func GetObservableFactHandler

func GetObservableFactHandler() ([]mcp.ResourceContents, error)

GetObservableFactHandler returns the observable documentation fact resource.

func GetObservableSchemaHandler

func GetObservableSchemaHandler() ([]mcp.ResourceContents, error)

GetObservableSchemaHandler returns the observable output schema.

func GetObservableUpdateSchemaHandler

func GetObservableUpdateSchemaHandler() ([]mcp.ResourceContents, error)

GetObservableUpdateSchemaHandler returns the observable update-input schema.

func GetPageCreateSchemaHandler added in v0.3.3

func GetPageCreateSchemaHandler() ([]mcp.ResourceContents, error)

GetPageCreateSchemaHandler returns the page create-input schema.

func GetPageFactHandler added in v0.3.3

func GetPageFactHandler() ([]mcp.ResourceContents, error)

GetPageFactHandler returns the page documentation fact resource.

func GetPageSchemaHandler added in v0.3.3

func GetPageSchemaHandler() ([]mcp.ResourceContents, error)

GetPageSchemaHandler returns the page output schema.

func GetPageUpdateSchemaHandler added in v0.3.3

func GetPageUpdateSchemaHandler() ([]mcp.ResourceContents, error)

GetPageUpdateSchemaHandler returns the page update-input schema.

func GetPatternFactHandler added in v0.3.3

func GetPatternFactHandler() ([]mcp.ResourceContents, error)

GetPatternFactHandler returns the pattern documentation fact resource.

func GetPatternSchemaHandler added in v0.3.3

func GetPatternSchemaHandler() ([]mcp.ResourceContents, error)

GetPatternSchemaHandler returns the pattern output schema.

func GetProcedureCreateSchemaHandler added in v0.3.3

func GetProcedureCreateSchemaHandler() ([]mcp.ResourceContents, error)

GetProcedureCreateSchemaHandler returns the procedure create-input schema.

func GetProcedureFactHandler added in v0.3.3

func GetProcedureFactHandler() ([]mcp.ResourceContents, error)

GetProcedureFactHandler returns the procedure documentation fact resource.

func GetProcedureSchemaHandler added in v0.3.3

func GetProcedureSchemaHandler() ([]mcp.ResourceContents, error)

GetProcedureSchemaHandler returns the procedure output schema.

func GetProcedureUpdateSchemaHandler added in v0.3.3

func GetProcedureUpdateSchemaHandler() ([]mcp.ResourceContents, error)

GetProcedureUpdateSchemaHandler returns the procedure update-input schema.

func GetResourceCatalog

func GetResourceCatalog(_ context.Context, _ mcp.ReadResourceRequest) ([]mcp.ResourceContents, error)

GetResourceCatalog returns the catalog (uses the same GetCatalogData)

func GetResponderFactHandler

func GetResponderFactHandler() ([]mcp.ResourceContents, error)

GetResponderFactHandler returns the responder documentation fact resource.

func GetTaskCreateSchemaHandler

func GetTaskCreateSchemaHandler() ([]mcp.ResourceContents, error)

GetTaskCreateSchemaHandler returns the task create-input schema.

func GetTaskFactHandler

func GetTaskFactHandler() ([]mcp.ResourceContents, error)

GetTaskFactHandler returns the task documentation fact resource.

func GetTaskSchemaHandler

func GetTaskSchemaHandler() ([]mcp.ResourceContents, error)

GetTaskSchemaHandler returns the task output schema.

func GetTaskUpdateSchemaHandler

func GetTaskUpdateSchemaHandler() ([]mcp.ResourceContents, error)

GetTaskUpdateSchemaHandler returns the task update-input schema.

func RegisterDynamicResources

func RegisterDynamicResources(registry *ResourceRegistry)

RegisterDynamicResources registers the API-backed metadata resources on the registry.

func RegisterFactResources

func RegisterFactResources(registry *ResourceRegistry)

RegisterFactResources registers the fact and documentation resources on the registry.

func RegisterRuleResources

func RegisterRuleResources(registry *ResourceRegistry)

RegisterRuleResources registers the rule resources on the registry.

func RegisterSchemaResources

func RegisterSchemaResources(registry *ResourceRegistry)

RegisterSchemaResources registers the entity schema resources on the registry.

func RegisterStaticResources

func RegisterStaticResources(registry *ResourceRegistry)

RegisterStaticResources registers all static schema, rule, and fact resources.

Types

type DateData

type DateData struct {
	CurrentDate string
}

DateData carries the current date into the date fact template.

type ResourceRegistry

type ResourceRegistry struct {
	// contains filtered or unexported fields
}

ResourceRegistry manages resource registration and lookup

func NewResourceRegistry

func NewResourceRegistry() *ResourceRegistry

NewResourceRegistry returns an empty ResourceRegistry ready for registration.

func (*ResourceRegistry) Get

Get retrieves a resource and its handler

func (*ResourceRegistry) ListByCategory

func (r *ResourceRegistry) ListByCategory(category string) ([]map[string]any, []map[string]any)

ListByCategory returns resources and subcategories at the specified level

func (*ResourceRegistry) Register

func (r *ResourceRegistry) Register(resource mcp.Resource, handler func(context.Context, mcp.ReadResourceRequest) ([]mcp.ResourceContents, error))

Register adds a resource to the registry

func (*ResourceRegistry) RegisterAll

func (r *ResourceRegistry) RegisterAll(s *server.MCPServer)

RegisterAll registers all resources with the MCP server

func (*ResourceRegistry) RegisterCategoryMetadata

func (r *ResourceRegistry) RegisterCategoryMetadata(categories []map[string]any)

RegisterCategoryMetadata stores category and subcategory descriptions from catalog

type SimplifiedUser

type SimplifiedUser struct {
	ID           string `json:"_id"`
	Name         string `json:"name"`
	Email        string `json:"email"`
	Organisation string `json:"organisation"`
	Profile      string `json:"profile"`
	Type         string `json:"type"`
}

SimplifiedUser is a trimmed-down view of a TheHive user for assignment lookups.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL