cacao

package
v0.0.0-...-3d897ed Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const CACAO_COMMAND_TYPE_BASH string = "bash"
View Source
const CACAO_COMMAND_TYPE_CALDERA string = "caldera-cmd"
View Source
const CACAO_COMMAND_TYPE_ELASTIC string = "elastic"
View Source
const CACAO_COMMAND_TYPE_HTTP string = "http-api"
View Source
const CACAO_COMMAND_TYPE_JUPYTER string = "juptyer"
View Source
const CACAO_COMMAND_TYPE_KESTREL string = "kestrel"
View Source
const CACAO_COMMAND_TYPE_MANUAL string = "manual"

CACAO command types

View Source
const CACAO_COMMAND_TYPE_OPENC2 string = "openc2-json"
View Source
const CACAO_COMMAND_TYPE_SIGMA string = "sigma"
View Source
const CACAO_COMMAND_TYPE_SSH string = "ssh"
View Source
const CACAO_COMMAND_TYPE_YARA string = "yara"
View Source
const CACAO_NAMESPACE_UUID_STRING string = "aa7caf3a-d55a-4e9a-b34e-056215fba56a"
View Source
const CACAO_SPEC_VERSION_11 string = "1.1"
View Source
const CACAO_SPEC_VERSION_20 string = "2.0"
View Source
const CACAO_STEP_TYPE_11_SINGLE string = "single"
View Source
const CACAO_STEP_TYPE_11_STEP string = "step"
View Source
const CACAO_STEP_TYPE_ACTION string = "action"
View Source
const CACAO_STEP_TYPE_END string = "end"
View Source
const CACAO_STEP_TYPE_IF_COND string = "if-condition"
View Source
const CACAO_STEP_TYPE_PARALLEL string = "parallel"
View Source
const CACAO_STEP_TYPE_PLAYBOOK_ACTION string = "playbook-action"
View Source
const CACAO_STEP_TYPE_START string = "start"

CACAO step types

View Source
const CACAO_STEP_TYPE_SWITCH_COND string = "switch-condition"
View Source
const CACAO_STEP_TYPE_WHILE_COND string = "while-condition"

Variables

This section is empty.

Functions

func ProcessGateway

func ProcessGateway(gateway bpmn.BpmnGateway, specVersion string, parallel bool, stepMap, nextStepMap map[string]string, cacaoPlaybook *CacaoPlaybook)

ProcessGateway processes a gateway and creates the appropriate steps

func ProcessTask

func ProcessTask(task bpmn.BpmnTask, commandType string, specVersion string, stepMap, nextStepMap map[string]string, cacaoPlaybook *CacaoPlaybook)

ProcessTasks processes the tasks in the BPMN and creates the appropriate steps

Types

type CacaoPlaybook

type CacaoPlaybook struct {
	Type               string                      `json:"type"`
	SpecVersion        string                      `json:"spec_version"`
	ID                 string                      `json:"id"`
	Name               string                      `json:"name"`
	Description        string                      `json:"description,omitempty"`
	PlaybookTypes      []string                    `json:"playbook_types,omitempty"`
	CreatedBy          string                      `json:"created_by,omitempty"`
	Created            *time.Time                  `json:"created"`
	Modified           *time.Time                  `json:"modified"`
	Revoked            bool                        `json:"revoked"`
	ValidFrom          *time.Time                  `json:"valid_from,omitempty"`
	ValidUntil         *time.Time                  `json:"valid_until,omitempty"`
	DerivedFrom        string                      `json:"derived-from,omitempty"`
	Priority           int                         `json:"priority"`
	Severity           int                         `json:"severity"`
	Impact             int                         `json:"impact"`
	Labels             []string                    `json:"labels,omitempty"`
	ExternalReferences []ExternalReference         `json:"external_references,omitempty"`
	Markings           []string                    `json:"markings,omitempty"`
	PlaybookVariables  map[string]PlaybookVariable `json:"playbook_variables,omitempty"`
	WorkflowStart      string                      `json:"workflow_start"`
	WorkflowException  string                      `json:"workflow_exception,omitempty"`
	Workflow           map[string]Step             `json:"workflow"`
}

CacaoPlaybook represents a CACAO playbook

func ConvertToCacao

func ConvertToCacao(bpmnDefinition *bpmn.BpmnDefinitions, specVersion string) (*CacaoPlaybook, error)

ConvertToCacao converts a BPMN definition to a CACAO playbook

type Command

type Command struct {
	Type        string `json:"type"`
	Command     string `json:"command"`
	Description string `json:"description"`
}

Command represents a command that can be executed

type ExternalReference

type ExternalReference struct {
	Name        string `json:"name"`
	Description string `json:"description"`
	Source      string `json:"source"`
	URL         string `json:"url"`
	Hash        string `json:"hash"`
	ExternalID  string `json:"external_id"`
}

ExternalReference represents an external reference embedded in a playbook

type PlaybookVariable

type PlaybookVariable struct {
	Type        string `json:"type"`
	Description string `json:"description"`
	Value       string `json:"value"`
	Constant    bool   `json:"constant"`
}

PlaybookVariable represents a variable that can be used in the playbook

type Step

type Step struct {
	Type         string              `json:"type"`
	Name         string              `json:"name,omitempty"`
	OnCompletion string              `json:"on_completion,omitempty"`
	Condition    string              `json:"condition,omitempty"`
	OnTrue       string              `json:"on_true,omitempty"`
	OnFalse      string              `json:"on_false,omitempty"`
	Switch       string              `json:"switch,omitempty"`
	Cases        map[string][]string `json:"cases,omitempty"`
	NextSteps    []string            `json:"next_steps,omitempty"`
	Commands     []Command           `json:"commands,omitempty"`
	InArgs       []string            `json:"in_args,omitempty"`
}

Step represents a step in the workflow

Jump to

Keyboard shortcuts

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