system

package
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: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteWorkbench

func DeleteWorkbench(
	ctx context.Context,
	client api.Client,
	id string,
) (string, error)

DeleteWorkbench removes an active workbench from the server. id is typically a path, as returned by CreateWorkbench e.g. "import/pending/ExempleWorkbench.json".

Types

type Capabilities

type Capabilities string
const (
	CapabilitiesConnectorAPI                         Capabilities = "CONNECTORAPI"
	CapabilitiesKnowledge                            Capabilities = "KNOWLEDGE"
	CapabilitiesKnowledgeKNUpdate                    Capabilities = "KNOWLEDGE_KNUPDATE"
	CapabilitiesKnowledgeKNParticipate               Capabilities = "KNOWLEDGE_KNPARTICIPATE"
	CapabilitiesKnowledgeKNUpdateKNDelete            Capabilities = "KNOWLEDGE_KNUPDATE_KNDELETE"
	CapabilitiesKnowledgeKNUpdateKNOrgAreStrict      Capabilities = "KNOWLEDGE_KNUPDATE_KNORGARESTRICT"
	CapabilitiesKnowledgeKNUpdateKNManageAuthMembers Capabilities = "KNOWLEDGE_KNUPDATE_KNMANAGEAUTHMEMBERS"
	CapabilitiesKnowledgeKNUpload                    Capabilities = "KNOWLEDGE_KNUPLOAD"
	CapabilitiesKnowledgeKNAskImport                 Capabilities = "KNOWLEDGE_KNASKIMPORT"
	CapabilitiesKnowledgeKNGetExport                 Capabilities = "KNOWLEDGE_KNGETEXPORT"
	CapabilitiesKnowledgeKNGetExportKNAskExport      Capabilities = "KNOWLEDGE_KNGETEXPORT_KNASKEXPORT"
	CapabilitiesKnowledgeKNEnrichment                Capabilities = "KNOWLEDGE_KNENRICHMENT"
	CapabilitiesExplore                              Capabilities = "EXPLORE"
	CapabilitiesExploreEXUpdate                      Capabilities = "EXPLORE_EXUPDATE"
	CapabilitiesExploreEXUpdateEXDelete              Capabilities = "EXPLORE_EXUPDATE_EXDELETE"
	CapabilitiesExploreEXUpdatePublish               Capabilities = "EXPLORE_EXUPDATE_PUBLISH"
	CapabilitiesModules                              Capabilities = "MODULES"
	CapabilitiesModulesModManage                     Capabilities = "MODULES_MODMANAGE"
	CapabilitiesSettings                             Capabilities = "SETTINGS"
	CapabilitiesSettingsSetAccesses                  Capabilities = "SETTINGS_SETACCESSES"
	CapabilitiesSettingsSetMarkings                  Capabilities = "SETTINGS_SETMARKINGS"
	CapabilitiesSettingsSetLables                    Capabilities = "SETTINGS_SETLABELS"
	CapabilitiesTAXIIAPISetCollections               Capabilities = "TAXIIAPI_SETCOLLECTIONS"
	CapabilitiesTAXIIAPISetCSVMappers                Capabilities = "TAXIIAPI_SETCSVMAPPERS"
	CapabilitiesVirtualOrganizationAdmin             Capabilities = "VIRTUAL_ORGANIZATION_ADMIN"
)

type Capability

type Capability struct {
	graphql.Capability `gocti:",squash"`
}

func (Capability) DefaultProperties

func (c Capability) DefaultProperties() string

func (Capability) IDsByNames

func (c Capability) IDsByNames(ctx context.Context, client api.Client, names []Capabilities) ([]string, error)

func (Capability) ListQueryString

func (c Capability) ListQueryString(customAttributes string) string

func (Capability) ListResponseField

func (c Capability) ListResponseField() string

type CapabilityNotFoundError

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

func (CapabilityNotFoundError) Error

func (err CapabilityNotFoundError) Error() string

type CaseTemplate

type CaseTemplate struct {
	graphql.CaseTemplate `gocti:",squash"`
}

func (CaseTemplate) CreateQueryString

func (c CaseTemplate) CreateQueryString(customAttributes string) string

func (CaseTemplate) CreateResponseField

func (c CaseTemplate) CreateResponseField() string

func (CaseTemplate) DefaultProperties

func (c CaseTemplate) DefaultProperties() string

func (CaseTemplate) DeleteQueryString

func (c CaseTemplate) DeleteQueryString() string

func (CaseTemplate) DeleteResponseField

func (c CaseTemplate) DeleteResponseField() string

func (CaseTemplate) ListQueryString

func (c CaseTemplate) ListQueryString(customAttributes string) string

func (CaseTemplate) ListResponseField

func (c CaseTemplate) ListResponseField() string

func (CaseTemplate) ReadQueryString

func (c CaseTemplate) ReadQueryString(customAttributes string) string

func (CaseTemplate) ReadResponseField

func (c CaseTemplate) ReadResponseField() string

type CaseTemplateAddInput

type CaseTemplateAddInput struct {
	// CaseTemplateAddInput
	Name        string     `gocti:"name"        json:"name,omitempty"`
	Description string     `gocti:"description" json:"description,omitempty"`
	Created     *time.Time `gocti:"created"     json:"created,omitempty"`
	Tasks       []string   `gocti:"tasks"       json:"tasks,omitempty"`
}

CaseTemplateAddInput represents a GraphQL INPUT_OBJECT Some fields from the OpenCTI schema may be missing (See the examples for ways to expand an existing type).

func (CaseTemplateAddInput) Input

func (input CaseTemplateAddInput) Input() (map[string]any, error)

type Group

type Group struct {
	graphql.Group `gocti:",squash"`
}

func (Group) AssignMarkingDefinition

func (g Group) AssignMarkingDefinition(
	ctx context.Context,
	client api.Client,
	markingDefinitionID string,
) (map[string]any, error)

func (Group) AssignMaxConfidenceLevel

func (g Group) AssignMaxConfidenceLevel(
	ctx context.Context,
	client api.Client,
	confidenceLevel int,
) (map[string]any, error)

func (Group) AssignRole

func (g Group) AssignRole(
	ctx context.Context,
	client api.Client,
	roleID string,
) (map[string]any, error)

func (Group) CreateQueryString

func (g Group) CreateQueryString(customAttributes string) string

func (Group) CreateResponseField

func (g Group) CreateResponseField() string

func (Group) DefaultProperties

func (g Group) DefaultProperties() string

func (Group) DeleteQueryString

func (g Group) DeleteQueryString() string

func (Group) DeleteResponseField

func (g Group) DeleteResponseField() string

func (Group) EditResponseField

func (g Group) EditResponseField() string

func (Group) ListQueryString

func (g Group) ListQueryString(customAttributes string) string

func (Group) ListResponseField

func (g Group) ListResponseField() string

func (Group) ReadQueryString

func (g Group) ReadQueryString(customAttributes string) string

func (Group) ReadResponseField

func (g Group) ReadResponseField() string

func (Group) SetOption

func (g Group) SetOption(
	ctx context.Context,
	client api.Client,
	option GroupOption,
	value bool,
) (map[string]any, error)

func (Group) UnassignMarkingDefinition added in v0.3.0

func (g Group) UnassignMarkingDefinition(
	ctx context.Context,
	client api.Client,
	markingDefinitionID string,
) (map[string]any, error)

func (Group) UnassignRole added in v0.3.0

func (g Group) UnassignRole(
	ctx context.Context,
	client api.Client,
	roleID string,
) (map[string]any, error)

type GroupAddInput

type GroupAddInput struct {
	// GroupAddInput
	Name                 string                       `gocti:"name"                   json:"name,omitempty"`
	Description          string                       `gocti:"description"            json:"description,omitempty"`
	DefaultAssignation   bool                         `gocti:"default_assignation"    json:"default_assignation,omitempty"`
	NoCreators           bool                         `gocti:"no_creators"            json:"no_creators,omitempty"`
	RestrictDelete       bool                         `gocti:"restrict_delete"        json:"restrict_delete,omitempty"`
	AutoNewMarking       bool                         `gocti:"auto_new_marking"       json:"auto_new_marking,omitempty"`
	ClientMutationID     string                       `gocti:"clientMutationId"       json:"clientMutationId,omitempty"`
	GroupConfidenceLevel graphql.ConfidenceLevelInput `gocti:"group_confidence_level" json:"group_confidence_level,omitempty"`
}

GroupAddInput represents a GraphQL INPUT_OBJECT Some fields from the OpenCTI schema may be missing (See the examples for ways to expand an existing type).

func (GroupAddInput) Input

func (input GroupAddInput) Input() (map[string]any, error)

type GroupOption

type GroupOption string
const (
	GroupOptionAutoNewMarking     GroupOption = "auto_new_marking"
	GroupOptionDefaultAssignation GroupOption = "default_assignation"
)

type Role

type Role struct {
	graphql.Role `gocti:",squash"`
}

func (Role) AssignCapability

func (r Role) AssignCapability(
	ctx context.Context,
	client api.Client,
	capabilityID string,
) (map[string]any, error)

func (Role) CreateQueryString

func (r Role) CreateQueryString(customAttributes string) string

func (Role) CreateResponseField

func (r Role) CreateResponseField() string

func (Role) DefaultProperties

func (r Role) DefaultProperties() string

func (Role) DeleteQueryString

func (r Role) DeleteQueryString() string

func (Role) DeleteResponseField

func (r Role) DeleteResponseField() string

func (Role) EditResponseField

func (r Role) EditResponseField() string

func (Role) ListQueryString

func (r Role) ListQueryString(customAttributes string) string

func (Role) ListResponseField

func (r Role) ListResponseField() string

func (Role) ReadQueryString

func (r Role) ReadQueryString(customAttributes string) string

func (Role) ReadResponseField

func (r Role) ReadResponseField() string

func (Role) UnassignCapability added in v0.3.0

func (r Role) UnassignCapability(
	ctx context.Context,
	client api.Client,
	capabilityID string,
) (map[string]any, error)

type RoleAddInput

type RoleAddInput struct {
	// RoleAddInput
	Name             string `gocti:"name"             json:"name,omitempty"`
	Description      string `gocti:"description"      json:"description,omitempty"`
	ClientMutationID string `gocti:"clientMutationId" json:"clientMutationId,omitempty"`
}

RoleAddInput represents a GraphQL INPUT_OBJECT Some fields from the OpenCTI schema may be missing (See the examples for ways to expand an existing type).

func (RoleAddInput) Input

func (input RoleAddInput) Input() (map[string]any, error)

type StatusTemplate

type StatusTemplate struct {
	graphql.StatusTemplate `gocti:",squash"`
}

func (StatusTemplate) CreateQueryString

func (s StatusTemplate) CreateQueryString(customAttributes string) string

func (StatusTemplate) CreateResponseField

func (s StatusTemplate) CreateResponseField() string

func (StatusTemplate) DefaultProperties

func (s StatusTemplate) DefaultProperties() string

func (StatusTemplate) DeleteQueryString

func (s StatusTemplate) DeleteQueryString() string

func (StatusTemplate) DeleteResponseField

func (s StatusTemplate) DeleteResponseField() string

func (StatusTemplate) ListQueryString

func (s StatusTemplate) ListQueryString(customAttributes string) string

func (StatusTemplate) ListResponseField

func (s StatusTemplate) ListResponseField() string

func (StatusTemplate) ReadQueryString

func (s StatusTemplate) ReadQueryString(customAttributes string) string

func (StatusTemplate) ReadResponseField

func (s StatusTemplate) ReadResponseField() string

type StatusTemplateAddInput

type StatusTemplateAddInput struct {
	// StatusTemplateAddInput
	Name  string `gocti:"name"  json:"name,omitempty"`
	Color string `gocti:"color" json:"color,omitempty"`
}

StatusTemplateAddInput represents a GraphQL INPUT_OBJECT Some fields from the OpenCTI schema may be missing (See the examples for ways to expand an existing type).

func (StatusTemplateAddInput) Input

func (input StatusTemplateAddInput) Input() (map[string]any, error)

type SubType

type SubType struct {
	graphql.SubType `gocti:",squash"`
}

func (SubType) DefaultProperties

func (s SubType) DefaultProperties() string

func (SubType) DeleteQueryString

func (s SubType) DeleteQueryString() string

func (SubType) DeleteResponseField

func (s SubType) DeleteResponseField() string

func (SubType) EditResponseField

func (s SubType) EditResponseField() string

func (SubType) ListQueryString

func (s SubType) ListQueryString(customAttributes string) string

func (SubType) ListResponseField

func (s SubType) ListResponseField() string

func (SubType) ReadQueryString

func (s SubType) ReadQueryString(customAttributes string) string

func (SubType) ReadResponseField

func (s SubType) ReadResponseField() string

func (SubType) SetStatusInWorkFlow

func (s SubType) SetStatusInWorkFlow(
	ctx context.Context,
	client api.Client,
	workflowType, statusTemplateID string,
	statusTemplateOrder int,
) (map[string]any, error)

func (SubType) UnsetStatusInWorkFlow added in v0.3.0

func (s SubType) UnsetStatusInWorkFlow(
	ctx context.Context,
	client api.Client,
	workflowType, statusTemplateID string,
) (map[string]any, error)

type TaskTemplate

type TaskTemplate struct {
	graphql.TaskTemplate `gocti:",squash"`
}

func (TaskTemplate) CreateQueryString

func (t TaskTemplate) CreateQueryString(customAttributes string) string

func (TaskTemplate) CreateResponseField

func (t TaskTemplate) CreateResponseField() string

func (TaskTemplate) DefaultProperties

func (t TaskTemplate) DefaultProperties() string

func (TaskTemplate) DeleteQueryString

func (t TaskTemplate) DeleteQueryString() string

func (TaskTemplate) DeleteResponseField

func (t TaskTemplate) DeleteResponseField() string

func (TaskTemplate) ListQueryString

func (t TaskTemplate) ListQueryString(customAttributes string) string

func (TaskTemplate) ListResponseField

func (t TaskTemplate) ListResponseField() string

func (TaskTemplate) ReadQueryString

func (t TaskTemplate) ReadQueryString(customAttributes string) string

func (TaskTemplate) ReadResponseField

func (t TaskTemplate) ReadResponseField() string

type TaskTemplateAddInput

type TaskTemplateAddInput struct {
	// TaskTemplateAddInput
	Name        string `gocti:"name"        json:"name,omitempty"`
	Description string `gocti:"description" json:"description,omitempty"`
}

TaskTemplateAddInput represents a GraphQL INPUT_OBJECT Some fields from the OpenCTI schema may be missing (See the examples for ways to expand an existing type).

func (TaskTemplateAddInput) Input

func (input TaskTemplateAddInput) Input() (map[string]any, error)

type User

type User struct {
	graphql.User `gocti:",squash"`
}

func (User) AssignGroup

func (u User) AssignGroup(
	ctx context.Context,
	client api.Client,
	groupID string,
) (map[string]any, error)

func (User) CreateQueryString

func (u User) CreateQueryString(customAttributes string) string

func (User) CreateResponseField

func (u User) CreateResponseField() string

func (User) DefaultProperties

func (u User) DefaultProperties() string

func (User) DeleteQueryString

func (u User) DeleteQueryString() string

func (User) DeleteResponseField

func (u User) DeleteResponseField() string

func (User) EditResponseField

func (u User) EditResponseField() string

func (User) ListQueryString

func (u User) ListQueryString(customAttributes string) string

func (User) ListResponseField

func (u User) ListResponseField() string

func (User) ReadQueryString

func (u User) ReadQueryString(customAttributes string) string

func (User) ReadResponseField

func (u User) ReadResponseField() string

func (User) UnassignGroup added in v0.3.0

func (u User) UnassignGroup(
	ctx context.Context,
	client api.Client,
	groupID string,
) (map[string]any, error)

type UserAddInput

type UserAddInput struct {
	// UserAddInput
	UserEmail            string                       `gocti:"user_email"              json:"user_email,omitempty"`
	Name                 string                       `gocti:"name"                    json:"name,omitempty"`
	Password             string                       `gocti:"password"                json:"password,omitempty"`
	Firstname            string                       `gocti:"firstname"               json:"firstname,omitempty"`
	Lastname             string                       `gocti:"lastname"                json:"lastname,omitempty"`
	Description          string                       `gocti:"description"             json:"description,omitempty"`
	Language             string                       `gocti:"language"                json:"language,omitempty"`
	Theme                string                       `gocti:"theme"                   json:"theme,omitempty"`
	ObjectOrganization   []string                     `gocti:"objectOrganization"      json:"objectOrganization,omitempty"`
	AccountStatus        string                       `gocti:"account_status"          json:"account_status,omitempty"`
	AccountLockAfterDate *time.Time                   `gocti:"account_lock_after_date" json:"account_lock_after_date,omitempty"`
	UnitSystem           string                       `gocti:"unit_system"             json:"unit_system,omitempty"`
	SubmenuShowIcons     bool                         `gocti:"submenu_show_icons"      json:"submenu_show_icons,omitempty"`
	SubmenuAutoCollapse  bool                         `gocti:"submenu_auto_collapse"   json:"submenu_auto_collapse,omitempty"`
	MonochromeLabels     bool                         `gocti:"monochrome_labels"       json:"monochrome_labels,omitempty"`
	Groups               []string                     `gocti:"groups"                  json:"groups,omitempty"`
	UserConfidenceLevel  graphql.ConfidenceLevelInput `gocti:"user_confidence_level"   json:"user_confidence_level,omitempty"`
}

UserAddInput represents a GraphQL INPUT_OBJECT Some fields from the OpenCTI schema may be missing (See the examples for ways to expand an existing type).

func (UserAddInput) Input

func (input UserAddInput) Input() (map[string]any, error)

type Workbench

type Workbench struct {
	ID           string        `gocti:"id"`
	Name         string        `gocti:"name"`
	Size         int           `gocti:"size"`
	LastModified time.Time     `gocti:"lastModified"`
	UploadStatus graphql.State `gocti:"uploadStatus"`
	URL          string        `gocti:"-"`
}

func CreateWorkbench

func CreateWorkbench(
	ctx context.Context,
	client api.Client,
	file api.File,
	errOnExisting bool,
) (Workbench, error)

CreateWorkbench creates a new Workbench on the server based on the provided file. The api.File struct must contain all Name, Data, and MIME-type. Workbench name will match the file name. File Data is typically a valid stix bundle formatted as JSON.

Jump to

Keyboard shortcuts

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