gocti

package module
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2025 License: MIT Imports: 19 Imported by: 0

README

GoCTI Banner

GoCTI

Unofficial OpenCTI Go client. GoCTI is under development, hence breaking changes are to be expected until a version 1.0.0 is released.

GoCTI is currently compatible with OpenCTI version 6.4.9.

Like with pycti, the OpenCTI platform version supported by GoCTI should exactly match the version of your OpenCTI instance. No guarantees can be made with regards to back and forwards compatibility.

Feedback and suggestions are welcome through Github issues.

Quick Start

go get github.com/weisshorn-cyd/gocti
Create a new Client
// The client supports additional options: See api/options.go
client, err := api.NewOpenCTIAPIClient(
	"http://localhost:8080",
	"my_secret_token",
    api.WithHealthCheck(),
)
Interact with Platform Data

The client holds a basic Query method to make any GraphQl query to OpenCTI:

func (client *OpenCTIAPIClient) Query(
	ctx context.Context,
	query string,
	variables any,
) (map[string]any, error)

Entities have their own methods for creation, deletion, listing, and reading. These return a (list of) structs representing the target entity. These are also methods held by the client. For example, to create a malware entity:

malware, err := client.CreateMalware(ctx, "", entity.MalwareAddInput{
	Name:        "Example Malware",
	Description: "An example of a very malicious malware.",
})

Each method has a customAttributes field which specifies which GraphQL attributes the underlying query should return. For methods that return specific Go types (e.g. the CreateMalware method above), this indicates which fields of the return value will be set. If the empty string is provided as value for customAttributes, then the default attributes will be set for these methods. These are defined for each type.

List methods have a boolean parameter getAll. If set to true, the method will return everything in the platform that matches the underlying query. In case the query returns large amounts of data, it is recommended to set it to false and use the paginated list approach instead.

Generic and structured methods to list, read, create, and delete data are available through the api package. These methods can be used on the fly to add functionality to GoCTI that is missing for your specific use case.

Entities

The entities that are implemented can be found under the entity folder. They more or less match what is available via pycti.

System Management

Additional entities have been implemented for platform management. Some of them have special methods attached to perform specific tasks (see system/utils.go).

Examples

Examples are provided in the examples folder:

  • entity_creation shows what is considered as common usage of GoCTI
  • list_report_ips highlights current limitations and how to circumvent them by customizing GoCTI on the fly
  • system_management is an example of GoCTI's system management capabilities
  • pagination shows how to list data with pagination
  • custom_struct_parsing shows how to use custom structs and automated parsing to query exactly what data you need from the server
  • decode_graphql_interface shows how to convert a field of type GraphQL interface into an implementation and back

GoCTI design principles

GoCTI code is partially generated using GraphQL introspection.

The aim is to provide the most common functionality out of the box, i.e. the user should not have to write a GraphQL query or know of specific GraphQL types or interfaces for most use cases. There should be no ambiguity as to which fields are supported by a given object.

At the same time, GoCTI can be extended on the fly to cater for more niche or precise usage scenarios.

GoCTI does not directly reason about STIX, it only considers the data schema implemented in OpenCTI.

Development

A makefile provides targets useful for development.

Changelog

Each pull request must update the [Unreleased] entry in the changelog.

Updating supported OpenCTI version

When updating the supported OpenCTI version:

  • Update the docker-compose file
  • Update the pycti version in project.toml
  • Update the changelog with: - Support OpenCTI version X.Y.Z
  • Update the version in the readme
  • Regenerate the files through make generate
Release a new version of GoCTI

The source of truth for the GoCTI version is the changelog file.

To create a release, open a pull request:

  • Change the [Unreleased] section in the changelog into the corresponding version [X.Y.Z] - YYYY-MM-DD
  • Update the version information in gocti.go and project.toml accordingly
  • Assign the label release to the pull request
  • A new release will be created on merge by the release action

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrMissingURL   = errors.New("an URL must be set")
	ErrMissingToken = errors.New("a token must be set")

	ErrEmptyFileName = errors.New("file has empty filename")
	ErrEmptyMIMEType = errors.New("file has empty MIME type")
)

Functions

This section is empty.

Types

type Config

type Config struct {
	// Api Config
	DefaultTimeout     time.Duration `default:"10s" envconfig:"TIMEOUT"`
	HealthCheckTimeout time.Duration `default:"3s"  envconfig:"HEALTH_CHECK_TIMEOUT"`

	LogLevel slog.Level `default:"info" envconfig:"LOG_LEVEL"`

	// List Config - Overrides 'list/options.go' default values if set
	PageSize  int    `default:"-1"    envconfig:"PAGE_SIZE"`
	OrderBy   string `default:"UNSET" envconfig:"ORDER_BY"`
	OrderMode string `default:"UNSET" envconfig:"ORDER_MODE"`
}

Config holds all the OpenCTIAPIClient parameters that can be set by environment variables.

type OpenCTIAPIClient

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

OpenCTIAPIClient is the main gocti client to interact with the OpenCTI platform.

func NewOpenCTIAPIClient

func NewOpenCTIAPIClient(
	url, token string,
	opts ...Option,
) (*OpenCTIAPIClient, error)

NewOpenCTIAPIClient returns a pointer to a properly initialised OpenCTIAPIClient.

func (*OpenCTIAPIClient) CreateAttackPattern

func (client *OpenCTIAPIClient) CreateAttackPattern(
	ctx context.Context,
	customAttributes string,
	input entity.AttackPatternAddInput,
) (entity.AttackPattern, error)

func (*OpenCTIAPIClient) CreateCampaign

func (client *OpenCTIAPIClient) CreateCampaign(
	ctx context.Context,
	customAttributes string,
	input entity.CampaignAddInput,
) (entity.Campaign, error)

func (*OpenCTIAPIClient) CreateCaseIncident

func (client *OpenCTIAPIClient) CreateCaseIncident(
	ctx context.Context,
	customAttributes string,
	input entity.CaseIncidentAddInput,
) (entity.CaseIncident, error)

func (*OpenCTIAPIClient) CreateCaseRfi

func (client *OpenCTIAPIClient) CreateCaseRfi(
	ctx context.Context,
	customAttributes string,
	input entity.CaseRfiAddInput,
) (entity.CaseRfi, error)

func (*OpenCTIAPIClient) CreateCaseRft

func (client *OpenCTIAPIClient) CreateCaseRft(
	ctx context.Context,
	customAttributes string,
	input entity.CaseRftAddInput,
) (entity.CaseRft, error)

func (*OpenCTIAPIClient) CreateCaseTemplate

func (client *OpenCTIAPIClient) CreateCaseTemplate(
	ctx context.Context,
	customAttributes string,
	input system.CaseTemplateAddInput,
) (system.CaseTemplate, error)

func (*OpenCTIAPIClient) CreateChannel

func (client *OpenCTIAPIClient) CreateChannel(
	ctx context.Context,
	customAttributes string,
	input entity.ChannelAddInput,
) (entity.Channel, error)

func (*OpenCTIAPIClient) CreateCourseOfAction

func (client *OpenCTIAPIClient) CreateCourseOfAction(
	ctx context.Context,
	customAttributes string,
	input entity.CourseOfActionAddInput,
) (entity.CourseOfAction, error)

func (*OpenCTIAPIClient) CreateDataComponent

func (client *OpenCTIAPIClient) CreateDataComponent(
	ctx context.Context,
	customAttributes string,
	input entity.DataComponentAddInput,
) (entity.DataComponent, error)

func (*OpenCTIAPIClient) CreateDataSource

func (client *OpenCTIAPIClient) CreateDataSource(
	ctx context.Context,
	customAttributes string,
	input entity.DataSourceAddInput,
) (entity.DataSource, error)

func (*OpenCTIAPIClient) CreateEvent

func (client *OpenCTIAPIClient) CreateEvent(
	ctx context.Context,
	customAttributes string,
	input entity.EventAddInput,
) (entity.Event, error)

func (*OpenCTIAPIClient) CreateExternalReference

func (client *OpenCTIAPIClient) CreateExternalReference(
	ctx context.Context,
	customAttributes string,
	input entity.ExternalReferenceAddInput,
) (entity.ExternalReference, error)

func (*OpenCTIAPIClient) CreateFeedback

func (client *OpenCTIAPIClient) CreateFeedback(
	ctx context.Context,
	customAttributes string,
	input entity.FeedbackAddInput,
) (entity.Feedback, error)

func (*OpenCTIAPIClient) CreateGroup

func (client *OpenCTIAPIClient) CreateGroup(
	ctx context.Context,
	customAttributes string,
	input system.GroupAddInput,
) (system.Group, error)

func (*OpenCTIAPIClient) CreateGrouping

func (client *OpenCTIAPIClient) CreateGrouping(
	ctx context.Context,
	customAttributes string,
	input entity.GroupingAddInput,
) (entity.Grouping, error)

func (*OpenCTIAPIClient) CreateIdentity

func (client *OpenCTIAPIClient) CreateIdentity(
	ctx context.Context,
	customAttributes string,
	input entity.IdentityAddInput,
) (entity.Identity, error)

func (*OpenCTIAPIClient) CreateIncident

func (client *OpenCTIAPIClient) CreateIncident(
	ctx context.Context,
	customAttributes string,
	input entity.IncidentAddInput,
) (entity.Incident, error)

func (*OpenCTIAPIClient) CreateIndicator

func (client *OpenCTIAPIClient) CreateIndicator(
	ctx context.Context,
	customAttributes string,
	input entity.IndicatorAddInput,
) (entity.Indicator, error)

func (*OpenCTIAPIClient) CreateInfrastructure

func (client *OpenCTIAPIClient) CreateInfrastructure(
	ctx context.Context,
	customAttributes string,
	input entity.InfrastructureAddInput,
) (entity.Infrastructure, error)

func (*OpenCTIAPIClient) CreateIntrusionSet

func (client *OpenCTIAPIClient) CreateIntrusionSet(
	ctx context.Context,
	customAttributes string,
	input entity.IntrusionSetAddInput,
) (entity.IntrusionSet, error)

func (*OpenCTIAPIClient) CreateKillChainPhase

func (client *OpenCTIAPIClient) CreateKillChainPhase(
	ctx context.Context,
	customAttributes string,
	input entity.KillChainPhaseAddInput,
) (entity.KillChainPhase, error)

func (*OpenCTIAPIClient) CreateLabel

func (client *OpenCTIAPIClient) CreateLabel(
	ctx context.Context,
	customAttributes string,
	input entity.LabelAddInput,
) (entity.Label, error)

func (*OpenCTIAPIClient) CreateLanguage

func (client *OpenCTIAPIClient) CreateLanguage(
	ctx context.Context,
	customAttributes string,
	input entity.LanguageAddInput,
) (entity.Language, error)

func (*OpenCTIAPIClient) CreateLocation

func (client *OpenCTIAPIClient) CreateLocation(
	ctx context.Context,
	customAttributes string,
	input entity.LocationAddInput,
) (entity.Location, error)

func (*OpenCTIAPIClient) CreateMalware

func (client *OpenCTIAPIClient) CreateMalware(
	ctx context.Context,
	customAttributes string,
	input entity.MalwareAddInput,
) (entity.Malware, error)

func (*OpenCTIAPIClient) CreateMalwareAnalysis

func (client *OpenCTIAPIClient) CreateMalwareAnalysis(
	ctx context.Context,
	customAttributes string,
	input entity.MalwareAnalysisAddInput,
) (entity.MalwareAnalysis, error)

func (*OpenCTIAPIClient) CreateMarkingDefinition

func (client *OpenCTIAPIClient) CreateMarkingDefinition(
	ctx context.Context,
	customAttributes string,
	input entity.MarkingDefinitionAddInput,
) (entity.MarkingDefinition, error)

func (*OpenCTIAPIClient) CreateNarrative

func (client *OpenCTIAPIClient) CreateNarrative(
	ctx context.Context,
	customAttributes string,
	input entity.NarrativeAddInput,
) (entity.Narrative, error)

func (*OpenCTIAPIClient) CreateNote

func (client *OpenCTIAPIClient) CreateNote(
	ctx context.Context,
	customAttributes string,
	input entity.NoteAddInput,
) (entity.Note, error)

func (*OpenCTIAPIClient) CreateObservedData

func (client *OpenCTIAPIClient) CreateObservedData(
	ctx context.Context,
	customAttributes string,
	input entity.ObservedDataAddInput,
) (entity.ObservedData, error)

func (*OpenCTIAPIClient) CreateOpinion

func (client *OpenCTIAPIClient) CreateOpinion(
	ctx context.Context,
	customAttributes string,
	input entity.OpinionAddInput,
) (entity.Opinion, error)

func (*OpenCTIAPIClient) CreateReport

func (client *OpenCTIAPIClient) CreateReport(
	ctx context.Context,
	customAttributes string,
	input entity.ReportAddInput,
) (entity.Report, error)

func (*OpenCTIAPIClient) CreateRole

func (client *OpenCTIAPIClient) CreateRole(
	ctx context.Context,
	customAttributes string,
	input system.RoleAddInput,
) (system.Role, error)

func (*OpenCTIAPIClient) CreateStatusTemplate

func (client *OpenCTIAPIClient) CreateStatusTemplate(
	ctx context.Context,
	customAttributes string,
	input system.StatusTemplateAddInput,
) (system.StatusTemplate, error)

func (*OpenCTIAPIClient) CreateStixCoreRelationship

func (client *OpenCTIAPIClient) CreateStixCoreRelationship(
	ctx context.Context,
	customAttributes string,
	input entity.StixCoreRelationshipAddInput,
) (entity.StixCoreRelationship, error)

func (*OpenCTIAPIClient) CreateStixCyberObservable

func (client *OpenCTIAPIClient) CreateStixCyberObservable(
	ctx context.Context,
	customAttributes string,
	input entity.StixCyberObservableAddInput,
) (entity.StixCyberObservable, error)

func (*OpenCTIAPIClient) CreateStixDomainObject

func (client *OpenCTIAPIClient) CreateStixDomainObject(
	ctx context.Context,
	customAttributes string,
	input entity.StixDomainObjectAddInput,
) (entity.StixDomainObject, error)

func (*OpenCTIAPIClient) CreateTask

func (client *OpenCTIAPIClient) CreateTask(
	ctx context.Context,
	customAttributes string,
	input entity.TaskAddInput,
) (entity.Task, error)

func (*OpenCTIAPIClient) CreateTaskTemplate

func (client *OpenCTIAPIClient) CreateTaskTemplate(
	ctx context.Context,
	customAttributes string,
	input system.TaskTemplateAddInput,
) (system.TaskTemplate, error)

func (*OpenCTIAPIClient) CreateThreatActorGroup

func (client *OpenCTIAPIClient) CreateThreatActorGroup(
	ctx context.Context,
	customAttributes string,
	input entity.ThreatActorGroupAddInput,
) (entity.ThreatActorGroup, error)

func (*OpenCTIAPIClient) CreateThreatActorIndividual

func (client *OpenCTIAPIClient) CreateThreatActorIndividual(
	ctx context.Context,
	customAttributes string,
	input entity.ThreatActorIndividualAddInput,
) (entity.ThreatActorIndividual, error)

func (*OpenCTIAPIClient) CreateTool

func (client *OpenCTIAPIClient) CreateTool(
	ctx context.Context,
	customAttributes string,
	input entity.ToolAddInput,
) (entity.Tool, error)

func (*OpenCTIAPIClient) CreateUser

func (client *OpenCTIAPIClient) CreateUser(
	ctx context.Context,
	customAttributes string,
	input system.UserAddInput,
) (system.User, error)

func (*OpenCTIAPIClient) CreateVocabulary

func (client *OpenCTIAPIClient) CreateVocabulary(
	ctx context.Context,
	customAttributes string,
	input entity.VocabularyAddInput,
) (entity.Vocabulary, error)

func (*OpenCTIAPIClient) CreateVulnerability

func (client *OpenCTIAPIClient) CreateVulnerability(
	ctx context.Context,
	customAttributes string,
	input entity.VulnerabilityAddInput,
) (entity.Vulnerability, error)

func (*OpenCTIAPIClient) DefaultOrderBy

func (client *OpenCTIAPIClient) DefaultOrderBy() (string, bool)

DefaultOrderBy returns the default field name for ordering list queries and an ok expression indicating if the value has been set (true) or not (false) by the user via env variables or OpenCTIAPIClient constructor options. The zero value is returned if not set.

func (*OpenCTIAPIClient) DefaultOrderMode

func (client *OpenCTIAPIClient) DefaultOrderMode() (string, bool)

DefaultOrderMode returns the default mode for ordering list queries and an ok expression indicating if the value has been set (true) or not (false) by the user via env variables or OpenCTIAPIClient constructor options. The zero value is returned if not set.

func (*OpenCTIAPIClient) DefaultPageSize

func (client *OpenCTIAPIClient) DefaultPageSize() (int, bool)

DefaultPageSize returns the default pagination size for list queries and an ok expression indicating if the value has been set (true) or not (false) by the user via env variables or OpenCTIAPIClient constructor options. The zero value is returned if not set.

func (*OpenCTIAPIClient) DeleteAttackPattern

func (client *OpenCTIAPIClient) DeleteAttackPattern(
	ctx context.Context,
	id string,
) (string, error)

func (*OpenCTIAPIClient) DeleteCampaign

func (client *OpenCTIAPIClient) DeleteCampaign(
	ctx context.Context,
	id string,
) (string, error)

func (*OpenCTIAPIClient) DeleteCaseIncident

func (client *OpenCTIAPIClient) DeleteCaseIncident(
	ctx context.Context,
	id string,
) (string, error)

func (*OpenCTIAPIClient) DeleteCaseRfi

func (client *OpenCTIAPIClient) DeleteCaseRfi(
	ctx context.Context,
	id string,
) (string, error)

func (*OpenCTIAPIClient) DeleteCaseRft

func (client *OpenCTIAPIClient) DeleteCaseRft(
	ctx context.Context,
	id string,
) (string, error)

func (*OpenCTIAPIClient) DeleteCaseTemplate

func (client *OpenCTIAPIClient) DeleteCaseTemplate(
	ctx context.Context,
	id string,
) (string, error)

func (*OpenCTIAPIClient) DeleteChannel

func (client *OpenCTIAPIClient) DeleteChannel(
	ctx context.Context,
	id string,
) (string, error)

func (*OpenCTIAPIClient) DeleteCourseOfAction

func (client *OpenCTIAPIClient) DeleteCourseOfAction(
	ctx context.Context,
	id string,
) (string, error)

func (*OpenCTIAPIClient) DeleteDataComponent

func (client *OpenCTIAPIClient) DeleteDataComponent(
	ctx context.Context,
	id string,
) (string, error)

func (*OpenCTIAPIClient) DeleteDataSource

func (client *OpenCTIAPIClient) DeleteDataSource(
	ctx context.Context,
	id string,
) (string, error)

func (*OpenCTIAPIClient) DeleteEvent

func (client *OpenCTIAPIClient) DeleteEvent(
	ctx context.Context,
	id string,
) (string, error)

func (*OpenCTIAPIClient) DeleteExternalReference

func (client *OpenCTIAPIClient) DeleteExternalReference(
	ctx context.Context,
	id string,
) (string, error)

func (*OpenCTIAPIClient) DeleteFeedback

func (client *OpenCTIAPIClient) DeleteFeedback(
	ctx context.Context,
	id string,
) (string, error)

func (*OpenCTIAPIClient) DeleteGroup

func (client *OpenCTIAPIClient) DeleteGroup(
	ctx context.Context,
	id string,
) (string, error)

func (*OpenCTIAPIClient) DeleteGrouping

func (client *OpenCTIAPIClient) DeleteGrouping(
	ctx context.Context,
	id string,
) (string, error)

func (*OpenCTIAPIClient) DeleteIdentity

func (client *OpenCTIAPIClient) DeleteIdentity(
	ctx context.Context,
	id string,
) (string, error)

func (*OpenCTIAPIClient) DeleteIncident

func (client *OpenCTIAPIClient) DeleteIncident(
	ctx context.Context,
	id string,
) (string, error)

func (*OpenCTIAPIClient) DeleteIndicator

func (client *OpenCTIAPIClient) DeleteIndicator(
	ctx context.Context,
	id string,
) (string, error)

func (*OpenCTIAPIClient) DeleteInfrastructure

func (client *OpenCTIAPIClient) DeleteInfrastructure(
	ctx context.Context,
	id string,
) (string, error)

func (*OpenCTIAPIClient) DeleteIntrusionSet

func (client *OpenCTIAPIClient) DeleteIntrusionSet(
	ctx context.Context,
	id string,
) (string, error)

func (*OpenCTIAPIClient) DeleteKillChainPhase

func (client *OpenCTIAPIClient) DeleteKillChainPhase(
	ctx context.Context,
	id string,
) (string, error)

func (*OpenCTIAPIClient) DeleteLabel

func (client *OpenCTIAPIClient) DeleteLabel(
	ctx context.Context,
	id string,
) (string, error)

func (*OpenCTIAPIClient) DeleteLanguage

func (client *OpenCTIAPIClient) DeleteLanguage(
	ctx context.Context,
	id string,
) (string, error)

func (*OpenCTIAPIClient) DeleteLocation

func (client *OpenCTIAPIClient) DeleteLocation(
	ctx context.Context,
	id string,
) (string, error)

func (*OpenCTIAPIClient) DeleteMalware

func (client *OpenCTIAPIClient) DeleteMalware(
	ctx context.Context,
	id string,
) (string, error)

func (*OpenCTIAPIClient) DeleteMalwareAnalysis

func (client *OpenCTIAPIClient) DeleteMalwareAnalysis(
	ctx context.Context,
	id string,
) (string, error)

func (*OpenCTIAPIClient) DeleteMarkingDefinition

func (client *OpenCTIAPIClient) DeleteMarkingDefinition(
	ctx context.Context,
	id string,
) (string, error)

func (*OpenCTIAPIClient) DeleteNarrative

func (client *OpenCTIAPIClient) DeleteNarrative(
	ctx context.Context,
	id string,
) (string, error)

func (*OpenCTIAPIClient) DeleteNote

func (client *OpenCTIAPIClient) DeleteNote(
	ctx context.Context,
	id string,
) (string, error)

func (*OpenCTIAPIClient) DeleteObservedData

func (client *OpenCTIAPIClient) DeleteObservedData(
	ctx context.Context,
	id string,
) (string, error)

func (*OpenCTIAPIClient) DeleteOpinion

func (client *OpenCTIAPIClient) DeleteOpinion(
	ctx context.Context,
	id string,
) (string, error)

func (*OpenCTIAPIClient) DeleteReport

func (client *OpenCTIAPIClient) DeleteReport(
	ctx context.Context,
	id string,
) (string, error)

func (*OpenCTIAPIClient) DeleteRole

func (client *OpenCTIAPIClient) DeleteRole(
	ctx context.Context,
	id string,
) (string, error)

func (*OpenCTIAPIClient) DeleteStatusTemplate

func (client *OpenCTIAPIClient) DeleteStatusTemplate(
	ctx context.Context,
	id string,
) (string, error)

func (*OpenCTIAPIClient) DeleteStixCoreObject

func (client *OpenCTIAPIClient) DeleteStixCoreObject(
	ctx context.Context,
	id string,
) (string, error)

func (*OpenCTIAPIClient) DeleteStixCoreRelationship

func (client *OpenCTIAPIClient) DeleteStixCoreRelationship(
	ctx context.Context,
	id string,
) (string, error)

func (*OpenCTIAPIClient) DeleteStixCyberObservable

func (client *OpenCTIAPIClient) DeleteStixCyberObservable(
	ctx context.Context,
	id string,
) (string, error)

func (*OpenCTIAPIClient) DeleteStixDomainObject

func (client *OpenCTIAPIClient) DeleteStixDomainObject(
	ctx context.Context,
	id string,
) (string, error)

func (*OpenCTIAPIClient) DeleteSubType

func (client *OpenCTIAPIClient) DeleteSubType(
	ctx context.Context,
	id string,
) (string, error)

func (*OpenCTIAPIClient) DeleteTask

func (client *OpenCTIAPIClient) DeleteTask(
	ctx context.Context,
	id string,
) (string, error)

func (*OpenCTIAPIClient) DeleteTaskTemplate

func (client *OpenCTIAPIClient) DeleteTaskTemplate(
	ctx context.Context,
	id string,
) (string, error)

func (*OpenCTIAPIClient) DeleteThreatActorGroup

func (client *OpenCTIAPIClient) DeleteThreatActorGroup(
	ctx context.Context,
	id string,
) (string, error)

func (*OpenCTIAPIClient) DeleteThreatActorIndividual

func (client *OpenCTIAPIClient) DeleteThreatActorIndividual(
	ctx context.Context,
	id string,
) (string, error)

func (*OpenCTIAPIClient) DeleteTool

func (client *OpenCTIAPIClient) DeleteTool(
	ctx context.Context,
	id string,
) (string, error)

func (*OpenCTIAPIClient) DeleteUser

func (client *OpenCTIAPIClient) DeleteUser(
	ctx context.Context,
	id string,
) (string, error)

func (*OpenCTIAPIClient) DeleteVocabulary

func (client *OpenCTIAPIClient) DeleteVocabulary(
	ctx context.Context,
	id string,
) (string, error)

func (*OpenCTIAPIClient) DeleteVulnerability

func (client *OpenCTIAPIClient) DeleteVulnerability(
	ctx context.Context,
	id string,
) (string, error)

func (*OpenCTIAPIClient) HealthCheck

func (client *OpenCTIAPIClient) HealthCheck(ctx context.Context) error

HealthCheck tries to query the OpenCTI version from the server, returning any error it encounters.

func (*OpenCTIAPIClient) Impersonate

func (client *OpenCTIAPIClient) Impersonate(ctx context.Context, username string) error

Impersonate will setup the OpenCTIAPIClient to impersonate the given user for exactly one query.

func (*OpenCTIAPIClient) ListAttackPatterns

func (client *OpenCTIAPIClient) ListAttackPatterns(
	ctx context.Context,
	customAttributes string,
	getAll bool,
	pageInfo *graphql.PageInfo,
	opts ...list.Option,
) ([]entity.AttackPattern, error)

Available list.Option parameters:

func (*OpenCTIAPIClient) ListCampaigns

func (client *OpenCTIAPIClient) ListCampaigns(
	ctx context.Context,
	customAttributes string,
	getAll bool,
	pageInfo *graphql.PageInfo,
	opts ...list.Option,
) ([]entity.Campaign, error)

Available list.Option parameters:

func (*OpenCTIAPIClient) ListCapabilities

func (client *OpenCTIAPIClient) ListCapabilities(
	ctx context.Context,
	customAttributes string,
	getAll bool,
	pageInfo *graphql.PageInfo,
	opts ...list.Option,
) ([]system.Capability, error)

Available list.Option parameters:

func (*OpenCTIAPIClient) ListCaseIncidents

func (client *OpenCTIAPIClient) ListCaseIncidents(
	ctx context.Context,
	customAttributes string,
	getAll bool,
	pageInfo *graphql.PageInfo,
	opts ...list.Option,
) ([]entity.CaseIncident, error)

Available list.Option parameters:

func (*OpenCTIAPIClient) ListCaseRfis

func (client *OpenCTIAPIClient) ListCaseRfis(
	ctx context.Context,
	customAttributes string,
	getAll bool,
	pageInfo *graphql.PageInfo,
	opts ...list.Option,
) ([]entity.CaseRfi, error)

Available list.Option parameters:

func (*OpenCTIAPIClient) ListCaseRfts

func (client *OpenCTIAPIClient) ListCaseRfts(
	ctx context.Context,
	customAttributes string,
	getAll bool,
	pageInfo *graphql.PageInfo,
	opts ...list.Option,
) ([]entity.CaseRft, error)

Available list.Option parameters:

func (*OpenCTIAPIClient) ListCaseTemplates

func (client *OpenCTIAPIClient) ListCaseTemplates(
	ctx context.Context,
	customAttributes string,
	getAll bool,
	pageInfo *graphql.PageInfo,
	opts ...list.Option,
) ([]system.CaseTemplate, error)

Available list.Option parameters:

func (*OpenCTIAPIClient) ListChannels

func (client *OpenCTIAPIClient) ListChannels(
	ctx context.Context,
	customAttributes string,
	getAll bool,
	pageInfo *graphql.PageInfo,
	opts ...list.Option,
) ([]entity.Channel, error)

Available list.Option parameters:

func (*OpenCTIAPIClient) ListCoursesOfAction

func (client *OpenCTIAPIClient) ListCoursesOfAction(
	ctx context.Context,
	customAttributes string,
	getAll bool,
	pageInfo *graphql.PageInfo,
	opts ...list.Option,
) ([]entity.CourseOfAction, error)

Available list.Option parameters:

func (*OpenCTIAPIClient) ListDataComponents

func (client *OpenCTIAPIClient) ListDataComponents(
	ctx context.Context,
	customAttributes string,
	getAll bool,
	pageInfo *graphql.PageInfo,
	opts ...list.Option,
) ([]entity.DataComponent, error)

Available list.Option parameters:

func (*OpenCTIAPIClient) ListDataSources

func (client *OpenCTIAPIClient) ListDataSources(
	ctx context.Context,
	customAttributes string,
	getAll bool,
	pageInfo *graphql.PageInfo,
	opts ...list.Option,
) ([]entity.DataSource, error)

Available list.Option parameters:

func (*OpenCTIAPIClient) ListEvents

func (client *OpenCTIAPIClient) ListEvents(
	ctx context.Context,
	customAttributes string,
	getAll bool,
	pageInfo *graphql.PageInfo,
	opts ...list.Option,
) ([]entity.Event, error)

Available list.Option parameters:

func (*OpenCTIAPIClient) ListExternalReferences

func (client *OpenCTIAPIClient) ListExternalReferences(
	ctx context.Context,
	customAttributes string,
	getAll bool,
	pageInfo *graphql.PageInfo,
	opts ...list.Option,
) ([]entity.ExternalReference, error)

Available list.Option parameters:

func (*OpenCTIAPIClient) ListFeedbacks

func (client *OpenCTIAPIClient) ListFeedbacks(
	ctx context.Context,
	customAttributes string,
	getAll bool,
	pageInfo *graphql.PageInfo,
	opts ...list.Option,
) ([]entity.Feedback, error)

Available list.Option parameters:

func (*OpenCTIAPIClient) ListGroupings

func (client *OpenCTIAPIClient) ListGroupings(
	ctx context.Context,
	customAttributes string,
	getAll bool,
	pageInfo *graphql.PageInfo,
	opts ...list.Option,
) ([]entity.Grouping, error)

Available list.Option parameters:

func (*OpenCTIAPIClient) ListGroups

func (client *OpenCTIAPIClient) ListGroups(
	ctx context.Context,
	customAttributes string,
	getAll bool,
	pageInfo *graphql.PageInfo,
	opts ...list.Option,
) ([]system.Group, error)

Available list.Option parameters:

func (*OpenCTIAPIClient) ListIdentities

func (client *OpenCTIAPIClient) ListIdentities(
	ctx context.Context,
	customAttributes string,
	getAll bool,
	pageInfo *graphql.PageInfo,
	opts ...list.Option,
) ([]entity.Identity, error)

Available list.Option parameters:

func (*OpenCTIAPIClient) ListIncidents

func (client *OpenCTIAPIClient) ListIncidents(
	ctx context.Context,
	customAttributes string,
	getAll bool,
	pageInfo *graphql.PageInfo,
	opts ...list.Option,
) ([]entity.Incident, error)

Available list.Option parameters:

func (*OpenCTIAPIClient) ListIndicators

func (client *OpenCTIAPIClient) ListIndicators(
	ctx context.Context,
	customAttributes string,
	getAll bool,
	pageInfo *graphql.PageInfo,
	opts ...list.Option,
) ([]entity.Indicator, error)

Available list.Option parameters:

func (*OpenCTIAPIClient) ListInfrastructures

func (client *OpenCTIAPIClient) ListInfrastructures(
	ctx context.Context,
	customAttributes string,
	getAll bool,
	pageInfo *graphql.PageInfo,
	opts ...list.Option,
) ([]entity.Infrastructure, error)

Available list.Option parameters:

func (*OpenCTIAPIClient) ListIntrusionSets

func (client *OpenCTIAPIClient) ListIntrusionSets(
	ctx context.Context,
	customAttributes string,
	getAll bool,
	pageInfo *graphql.PageInfo,
	opts ...list.Option,
) ([]entity.IntrusionSet, error)

Available list.Option parameters:

func (*OpenCTIAPIClient) ListKillChainPhases

func (client *OpenCTIAPIClient) ListKillChainPhases(
	ctx context.Context,
	customAttributes string,
	getAll bool,
	pageInfo *graphql.PageInfo,
	opts ...list.Option,
) ([]entity.KillChainPhase, error)

Available list.Option parameters:

func (*OpenCTIAPIClient) ListLabels

func (client *OpenCTIAPIClient) ListLabels(
	ctx context.Context,
	customAttributes string,
	getAll bool,
	pageInfo *graphql.PageInfo,
	opts ...list.Option,
) ([]entity.Label, error)

Available list.Option parameters:

func (*OpenCTIAPIClient) ListLanguages

func (client *OpenCTIAPIClient) ListLanguages(
	ctx context.Context,
	customAttributes string,
	getAll bool,
	pageInfo *graphql.PageInfo,
	opts ...list.Option,
) ([]entity.Language, error)

Available list.Option parameters:

func (*OpenCTIAPIClient) ListLocations

func (client *OpenCTIAPIClient) ListLocations(
	ctx context.Context,
	customAttributes string,
	getAll bool,
	pageInfo *graphql.PageInfo,
	opts ...list.Option,
) ([]entity.Location, error)

Available list.Option parameters:

func (*OpenCTIAPIClient) ListMalwareAnalyses

func (client *OpenCTIAPIClient) ListMalwareAnalyses(
	ctx context.Context,
	customAttributes string,
	getAll bool,
	pageInfo *graphql.PageInfo,
	opts ...list.Option,
) ([]entity.MalwareAnalysis, error)

Available list.Option parameters:

func (*OpenCTIAPIClient) ListMalwares

func (client *OpenCTIAPIClient) ListMalwares(
	ctx context.Context,
	customAttributes string,
	getAll bool,
	pageInfo *graphql.PageInfo,
	opts ...list.Option,
) ([]entity.Malware, error)

Available list.Option parameters:

func (*OpenCTIAPIClient) ListMarkingDefinitions

func (client *OpenCTIAPIClient) ListMarkingDefinitions(
	ctx context.Context,
	customAttributes string,
	getAll bool,
	pageInfo *graphql.PageInfo,
	opts ...list.Option,
) ([]entity.MarkingDefinition, error)

Available list.Option parameters:

func (*OpenCTIAPIClient) ListNarratives

func (client *OpenCTIAPIClient) ListNarratives(
	ctx context.Context,
	customAttributes string,
	getAll bool,
	pageInfo *graphql.PageInfo,
	opts ...list.Option,
) ([]entity.Narrative, error)

Available list.Option parameters:

func (*OpenCTIAPIClient) ListNotes

func (client *OpenCTIAPIClient) ListNotes(
	ctx context.Context,
	customAttributes string,
	getAll bool,
	pageInfo *graphql.PageInfo,
	opts ...list.Option,
) ([]entity.Note, error)

Available list.Option parameters:

func (*OpenCTIAPIClient) ListObservedDatas

func (client *OpenCTIAPIClient) ListObservedDatas(
	ctx context.Context,
	customAttributes string,
	getAll bool,
	pageInfo *graphql.PageInfo,
	opts ...list.Option,
) ([]entity.ObservedData, error)

Available list.Option parameters:

func (*OpenCTIAPIClient) ListOpinions

func (client *OpenCTIAPIClient) ListOpinions(
	ctx context.Context,
	customAttributes string,
	getAll bool,
	pageInfo *graphql.PageInfo,
	opts ...list.Option,
) ([]entity.Opinion, error)

Available list.Option parameters:

func (*OpenCTIAPIClient) ListReports

func (client *OpenCTIAPIClient) ListReports(
	ctx context.Context,
	customAttributes string,
	getAll bool,
	pageInfo *graphql.PageInfo,
	opts ...list.Option,
) ([]entity.Report, error)

Available list.Option parameters:

func (*OpenCTIAPIClient) ListRoles

func (client *OpenCTIAPIClient) ListRoles(
	ctx context.Context,
	customAttributes string,
	getAll bool,
	pageInfo *graphql.PageInfo,
	opts ...list.Option,
) ([]system.Role, error)

Available list.Option parameters:

func (*OpenCTIAPIClient) ListStatusTemplates

func (client *OpenCTIAPIClient) ListStatusTemplates(
	ctx context.Context,
	customAttributes string,
	getAll bool,
	pageInfo *graphql.PageInfo,
	opts ...list.Option,
) ([]system.StatusTemplate, error)

Available list.Option parameters:

func (*OpenCTIAPIClient) ListStixCoreObjects

func (client *OpenCTIAPIClient) ListStixCoreObjects(
	ctx context.Context,
	customAttributes string,
	getAll bool,
	pageInfo *graphql.PageInfo,
	opts ...list.Option,
) ([]entity.StixCoreObject, error)

Available list.Option parameters:

func (*OpenCTIAPIClient) ListStixCyberObservables

func (client *OpenCTIAPIClient) ListStixCyberObservables(
	ctx context.Context,
	customAttributes string,
	getAll bool,
	pageInfo *graphql.PageInfo,
	opts ...list.Option,
) ([]entity.StixCyberObservable, error)

Available list.Option parameters:

func (*OpenCTIAPIClient) ListStixDomainObjects

func (client *OpenCTIAPIClient) ListStixDomainObjects(
	ctx context.Context,
	customAttributes string,
	getAll bool,
	pageInfo *graphql.PageInfo,
	opts ...list.Option,
) ([]entity.StixDomainObject, error)

Available list.Option parameters:

func (*OpenCTIAPIClient) ListSubTypes

func (client *OpenCTIAPIClient) ListSubTypes(
	ctx context.Context,
	customAttributes string,
	getAll bool,
	pageInfo *graphql.PageInfo,
	opts ...list.Option,
) ([]system.SubType, error)

Available list.Option parameters:

func (*OpenCTIAPIClient) ListTaskTemplates

func (client *OpenCTIAPIClient) ListTaskTemplates(
	ctx context.Context,
	customAttributes string,
	getAll bool,
	pageInfo *graphql.PageInfo,
	opts ...list.Option,
) ([]system.TaskTemplate, error)

Available list.Option parameters:

func (*OpenCTIAPIClient) ListTasks

func (client *OpenCTIAPIClient) ListTasks(
	ctx context.Context,
	customAttributes string,
	getAll bool,
	pageInfo *graphql.PageInfo,
	opts ...list.Option,
) ([]entity.Task, error)

Available list.Option parameters:

func (*OpenCTIAPIClient) ListThreatActorGroups

func (client *OpenCTIAPIClient) ListThreatActorGroups(
	ctx context.Context,
	customAttributes string,
	getAll bool,
	pageInfo *graphql.PageInfo,
	opts ...list.Option,
) ([]entity.ThreatActorGroup, error)

Available list.Option parameters:

func (*OpenCTIAPIClient) ListThreatActorIndividuals

func (client *OpenCTIAPIClient) ListThreatActorIndividuals(
	ctx context.Context,
	customAttributes string,
	getAll bool,
	pageInfo *graphql.PageInfo,
	opts ...list.Option,
) ([]entity.ThreatActorIndividual, error)

Available list.Option parameters:

func (*OpenCTIAPIClient) ListThreatActors

func (client *OpenCTIAPIClient) ListThreatActors(
	ctx context.Context,
	customAttributes string,
	getAll bool,
	pageInfo *graphql.PageInfo,
	opts ...list.Option,
) ([]entity.ThreatActor, error)

Available list.Option parameters:

func (*OpenCTIAPIClient) ListTools

func (client *OpenCTIAPIClient) ListTools(
	ctx context.Context,
	customAttributes string,
	getAll bool,
	pageInfo *graphql.PageInfo,
	opts ...list.Option,
) ([]entity.Tool, error)

Available list.Option parameters:

func (*OpenCTIAPIClient) ListUsers

func (client *OpenCTIAPIClient) ListUsers(
	ctx context.Context,
	customAttributes string,
	getAll bool,
	pageInfo *graphql.PageInfo,
	opts ...list.Option,
) ([]system.User, error)

Available list.Option parameters:

func (*OpenCTIAPIClient) ListVocabularies

func (client *OpenCTIAPIClient) ListVocabularies(
	ctx context.Context,
	customAttributes string,
	getAll bool,
	pageInfo *graphql.PageInfo,
	opts ...list.Option,
) ([]entity.Vocabulary, error)

Available list.Option parameters:

func (*OpenCTIAPIClient) ListVulnerabilities

func (client *OpenCTIAPIClient) ListVulnerabilities(
	ctx context.Context,
	customAttributes string,
	getAll bool,
	pageInfo *graphql.PageInfo,
	opts ...list.Option,
) ([]entity.Vulnerability, error)

Available list.Option parameters:

func (*OpenCTIAPIClient) Logger

func (client *OpenCTIAPIClient) Logger() *slog.Logger

Logger returns the OpenCTIAPIClient stored logger.

func (*OpenCTIAPIClient) Query

func (client *OpenCTIAPIClient) Query(
	ctx context.Context,
	query string,
	variables map[string]any,
) (map[string]any, error)

Query sends the provided query string, with optional variables, to the OpenCTI GraphQL server and returns the response.

func (*OpenCTIAPIClient) ReadAttackPattern

func (client *OpenCTIAPIClient) ReadAttackPattern(
	ctx context.Context,
	customAttributes, id string,
) (entity.AttackPattern, error)

func (*OpenCTIAPIClient) ReadCampaign

func (client *OpenCTIAPIClient) ReadCampaign(
	ctx context.Context,
	customAttributes, id string,
) (entity.Campaign, error)

func (*OpenCTIAPIClient) ReadCaseIncident

func (client *OpenCTIAPIClient) ReadCaseIncident(
	ctx context.Context,
	customAttributes, id string,
) (entity.CaseIncident, error)

func (*OpenCTIAPIClient) ReadCaseRfi

func (client *OpenCTIAPIClient) ReadCaseRfi(
	ctx context.Context,
	customAttributes, id string,
) (entity.CaseRfi, error)

func (*OpenCTIAPIClient) ReadCaseRft

func (client *OpenCTIAPIClient) ReadCaseRft(
	ctx context.Context,
	customAttributes, id string,
) (entity.CaseRft, error)

func (*OpenCTIAPIClient) ReadCaseTemplate

func (client *OpenCTIAPIClient) ReadCaseTemplate(
	ctx context.Context,
	customAttributes, id string,
) (system.CaseTemplate, error)

func (*OpenCTIAPIClient) ReadChannel

func (client *OpenCTIAPIClient) ReadChannel(
	ctx context.Context,
	customAttributes, id string,
) (entity.Channel, error)

func (*OpenCTIAPIClient) ReadCourseOfAction

func (client *OpenCTIAPIClient) ReadCourseOfAction(
	ctx context.Context,
	customAttributes, id string,
) (entity.CourseOfAction, error)

func (*OpenCTIAPIClient) ReadDataComponent

func (client *OpenCTIAPIClient) ReadDataComponent(
	ctx context.Context,
	customAttributes, id string,
) (entity.DataComponent, error)

func (*OpenCTIAPIClient) ReadDataSource

func (client *OpenCTIAPIClient) ReadDataSource(
	ctx context.Context,
	customAttributes, id string,
) (entity.DataSource, error)

func (*OpenCTIAPIClient) ReadEvent

func (client *OpenCTIAPIClient) ReadEvent(
	ctx context.Context,
	customAttributes, id string,
) (entity.Event, error)

func (*OpenCTIAPIClient) ReadExternalReference

func (client *OpenCTIAPIClient) ReadExternalReference(
	ctx context.Context,
	customAttributes, id string,
) (entity.ExternalReference, error)

func (*OpenCTIAPIClient) ReadFeedback

func (client *OpenCTIAPIClient) ReadFeedback(
	ctx context.Context,
	customAttributes, id string,
) (entity.Feedback, error)

func (*OpenCTIAPIClient) ReadGroup

func (client *OpenCTIAPIClient) ReadGroup(
	ctx context.Context,
	customAttributes, id string,
) (system.Group, error)

func (*OpenCTIAPIClient) ReadGrouping

func (client *OpenCTIAPIClient) ReadGrouping(
	ctx context.Context,
	customAttributes, id string,
) (entity.Grouping, error)

func (*OpenCTIAPIClient) ReadIdentity

func (client *OpenCTIAPIClient) ReadIdentity(
	ctx context.Context,
	customAttributes, id string,
) (entity.Identity, error)

func (*OpenCTIAPIClient) ReadIncident

func (client *OpenCTIAPIClient) ReadIncident(
	ctx context.Context,
	customAttributes, id string,
) (entity.Incident, error)

func (*OpenCTIAPIClient) ReadIndicator

func (client *OpenCTIAPIClient) ReadIndicator(
	ctx context.Context,
	customAttributes, id string,
) (entity.Indicator, error)

func (*OpenCTIAPIClient) ReadInfrastructure

func (client *OpenCTIAPIClient) ReadInfrastructure(
	ctx context.Context,
	customAttributes, id string,
) (entity.Infrastructure, error)

func (*OpenCTIAPIClient) ReadIntrusionSet

func (client *OpenCTIAPIClient) ReadIntrusionSet(
	ctx context.Context,
	customAttributes, id string,
) (entity.IntrusionSet, error)

func (*OpenCTIAPIClient) ReadKillChainPhase

func (client *OpenCTIAPIClient) ReadKillChainPhase(
	ctx context.Context,
	customAttributes, id string,
) (entity.KillChainPhase, error)

func (*OpenCTIAPIClient) ReadLabel

func (client *OpenCTIAPIClient) ReadLabel(
	ctx context.Context,
	customAttributes, id string,
) (entity.Label, error)

func (*OpenCTIAPIClient) ReadLanguage

func (client *OpenCTIAPIClient) ReadLanguage(
	ctx context.Context,
	customAttributes, id string,
) (entity.Language, error)

func (*OpenCTIAPIClient) ReadLocation

func (client *OpenCTIAPIClient) ReadLocation(
	ctx context.Context,
	customAttributes, id string,
) (entity.Location, error)

func (*OpenCTIAPIClient) ReadMalware

func (client *OpenCTIAPIClient) ReadMalware(
	ctx context.Context,
	customAttributes, id string,
) (entity.Malware, error)

func (*OpenCTIAPIClient) ReadMalwareAnalysis

func (client *OpenCTIAPIClient) ReadMalwareAnalysis(
	ctx context.Context,
	customAttributes, id string,
) (entity.MalwareAnalysis, error)

func (*OpenCTIAPIClient) ReadMarkingDefinition

func (client *OpenCTIAPIClient) ReadMarkingDefinition(
	ctx context.Context,
	customAttributes, id string,
) (entity.MarkingDefinition, error)

func (*OpenCTIAPIClient) ReadNarrative

func (client *OpenCTIAPIClient) ReadNarrative(
	ctx context.Context,
	customAttributes, id string,
) (entity.Narrative, error)

func (*OpenCTIAPIClient) ReadNote

func (client *OpenCTIAPIClient) ReadNote(
	ctx context.Context,
	customAttributes, id string,
) (entity.Note, error)

func (*OpenCTIAPIClient) ReadObservedData

func (client *OpenCTIAPIClient) ReadObservedData(
	ctx context.Context,
	customAttributes, id string,
) (entity.ObservedData, error)

func (*OpenCTIAPIClient) ReadOpinion

func (client *OpenCTIAPIClient) ReadOpinion(
	ctx context.Context,
	customAttributes, id string,
) (entity.Opinion, error)

func (*OpenCTIAPIClient) ReadReport

func (client *OpenCTIAPIClient) ReadReport(
	ctx context.Context,
	customAttributes, id string,
) (entity.Report, error)

func (*OpenCTIAPIClient) ReadRole

func (client *OpenCTIAPIClient) ReadRole(
	ctx context.Context,
	customAttributes, id string,
) (system.Role, error)

func (*OpenCTIAPIClient) ReadStatusTemplate

func (client *OpenCTIAPIClient) ReadStatusTemplate(
	ctx context.Context,
	customAttributes, id string,
) (system.StatusTemplate, error)

func (*OpenCTIAPIClient) ReadStixCoreObject

func (client *OpenCTIAPIClient) ReadStixCoreObject(
	ctx context.Context,
	customAttributes, id string,
) (entity.StixCoreObject, error)

func (*OpenCTIAPIClient) ReadStixCoreRelationship

func (client *OpenCTIAPIClient) ReadStixCoreRelationship(
	ctx context.Context,
	customAttributes, id string,
) (entity.StixCoreRelationship, error)

func (*OpenCTIAPIClient) ReadStixCyberObservable

func (client *OpenCTIAPIClient) ReadStixCyberObservable(
	ctx context.Context,
	customAttributes, id string,
) (entity.StixCyberObservable, error)

func (*OpenCTIAPIClient) ReadStixDomainObject

func (client *OpenCTIAPIClient) ReadStixDomainObject(
	ctx context.Context,
	customAttributes, id string,
) (entity.StixDomainObject, error)

func (*OpenCTIAPIClient) ReadSubType

func (client *OpenCTIAPIClient) ReadSubType(
	ctx context.Context,
	customAttributes, id string,
) (system.SubType, error)

func (*OpenCTIAPIClient) ReadTask

func (client *OpenCTIAPIClient) ReadTask(
	ctx context.Context,
	customAttributes, id string,
) (entity.Task, error)

func (*OpenCTIAPIClient) ReadTaskTemplate

func (client *OpenCTIAPIClient) ReadTaskTemplate(
	ctx context.Context,
	customAttributes, id string,
) (system.TaskTemplate, error)

func (*OpenCTIAPIClient) ReadThreatActor

func (client *OpenCTIAPIClient) ReadThreatActor(
	ctx context.Context,
	customAttributes, id string,
) (entity.ThreatActor, error)

func (*OpenCTIAPIClient) ReadThreatActorGroup

func (client *OpenCTIAPIClient) ReadThreatActorGroup(
	ctx context.Context,
	customAttributes, id string,
) (entity.ThreatActorGroup, error)

func (*OpenCTIAPIClient) ReadThreatActorIndividual

func (client *OpenCTIAPIClient) ReadThreatActorIndividual(
	ctx context.Context,
	customAttributes, id string,
) (entity.ThreatActorIndividual, error)

func (*OpenCTIAPIClient) ReadTool

func (client *OpenCTIAPIClient) ReadTool(
	ctx context.Context,
	customAttributes, id string,
) (entity.Tool, error)

func (*OpenCTIAPIClient) ReadUser

func (client *OpenCTIAPIClient) ReadUser(
	ctx context.Context,
	customAttributes, id string,
) (system.User, error)

func (*OpenCTIAPIClient) ReadVocabulary

func (client *OpenCTIAPIClient) ReadVocabulary(
	ctx context.Context,
	customAttributes, id string,
) (entity.Vocabulary, error)

func (*OpenCTIAPIClient) ReadVulnerability

func (client *OpenCTIAPIClient) ReadVulnerability(
	ctx context.Context,
	customAttributes, id string,
) (entity.Vulnerability, error)

type OpenCTIGraphQLError

type OpenCTIGraphQLError struct {
	Name       string                  `json:"name"`
	Message    string                  `json:"message"`
	TimeThrown string                  `json:"time_thrown"`
	Data       OpenCTIGraphQLErrorData `json:"data"`
}

func (OpenCTIGraphQLError) Error

func (err OpenCTIGraphQLError) Error() string

type OpenCTIGraphQLErrorData

type OpenCTIGraphQLErrorData struct {
	HTTPStatus int    `json:"http_status"`
	Genre      string `json:"genre"`
	Reason     string `json:"reason"`
}

type Option

type Option func(c *OpenCTIAPIClient)

func WithDefaultOrderBy

func WithDefaultOrderBy(orderBy string) Option

func WithDefaultOrderMode

func WithDefaultOrderMode(orderMode string) Option

func WithDefaultPageSize

func WithDefaultPageSize(pageSize int) Option

func WithDefaultTimeout

func WithDefaultTimeout(timeout time.Duration) Option

func WithHealthCheck

func WithHealthCheck() Option

func WithHealthCheckTimeout

func WithHealthCheckTimeout(timeout time.Duration) Option

func WithLogLevel

func WithLogLevel(level slog.Level) Option

func WithLogger

func WithLogger(log *slog.Logger) Option

func WithTransport

func WithTransport(transport http.RoundTripper) Option

type UnexpectedStatusCodeError

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

func (UnexpectedStatusCodeError) Error

func (err UnexpectedStatusCodeError) Error() string

type UserNotFoundError

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

func (UserNotFoundError) Error

func (err UserNotFoundError) Error() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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