{ "swagger": "2.0", "info": { "contact": {} }, "paths": { "/trigger/workflow": { "post": { "description": "trigger workflow", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "trigger" ], "summary": "trigger a workflow with via cacao payload", "parameters": [ { "description": "execute playbook by payload", "name": "playbook", "in": "body", "required": true, "schema": { "$ref": "#/definitions/cacao.Playbook" } } ], "responses": { "200": { "description": "{\"execution_id\":\"uuid\",\"payload\":\"playbook--uuid\"}" } } } }, "/workflow/": { "get": { "description": "get UUIDs for workflow", "produces": [ "application/json" ], "tags": [ "workflow" ], "summary": "gets all the UUIDs for the stored workflows", "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "type": "string" } } } } }, "post": { "description": "submit a new workflow api", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "workflow" ], "summary": "submit workflow via the api", "parameters": [ { "description": "workflow", "name": "data", "in": "body", "required": true, "schema": { "$ref": "#/definitions/cacao.Playbook" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/cacao.Playbook" } } } } }, "/workflow/{id}": { "get": { "description": "get workflow by ID", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "workflow" ], "summary": "get CACAO playbook workflow by its ID", "parameters": [ { "type": "string", "description": "workflow ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/cacao.Playbook" } } } }, "put": { "description": "update workflow by ID", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "workflow" ], "summary": "update workflow", "parameters": [ { "type": "string", "description": "workflow ID", "name": "id", "in": "path", "required": true }, { "description": "workflow", "name": "data", "in": "body", "required": true, "schema": { "$ref": "#/definitions/cacao.Playbook" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/cacao.Playbook" } } } }, "delete": { "description": "delete workflow by ID", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "workflow" ], "summary": "delete worflow", "parameters": [ { "type": "string", "description": "workflow ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK" } } } } }, "definitions": { "cacao.AgentTarget": { "type": "object", "required": [ "id", "name", "type" ], "properties": { "address": { "type": "object", "additionalProperties": { "type": "array", "items": { "type": "string" } } }, "agent_target_extensions": { "type": "array", "items": { "type": "string" } }, "authentication_info": { "type": "string" }, "category": { "type": "array", "items": { "type": "string" } }, "contact": { "$ref": "#/definitions/cacao.Contact" }, "description": { "type": "string" }, "http_url": { "type": "string" }, "id": { "type": "string" }, "location": { "$ref": "#/definitions/cacao.CivicLocation" }, "logical": { "type": "array", "items": { "type": "string" } }, "name": { "type": "string" }, "port": { "type": "string" }, "sector": { "type": "string" }, "type": { "type": "string" } } }, "cacao.AuthenticationInformation": { "type": "object", "required": [ "id", "type" ], "properties": { "description": { "type": "string" }, "id": { "type": "string" }, "kms": { "type": "boolean" }, "kms_key_identifier": { "type": "string" }, "name": { "type": "string" }, "oauth_header": { "type": "string" }, "password": { "type": "string" }, "private_key": { "type": "string" }, "token": { "type": "string" }, "type": { "type": "string" }, "user_id": { "type": "string" }, "username": { "type": "string" } } }, "cacao.CivicLocation": { "type": "object", "properties": { "administrative_area": { "type": "string" }, "building_details": { "type": "string" }, "city": { "type": "string" }, "country": { "type": "string" }, "description": { "type": "string" }, "latitude": { "type": "string" }, "longitude": { "type": "string" }, "name": { "type": "string" }, "network_details": { "type": "string" }, "postal_code": { "type": "string" }, "precision": { "type": "string" }, "region": { "type": "string" }, "street_address": { "type": "string" } } }, "cacao.Command": { "type": "object", "required": [ "command", "type" ], "properties": { "command": { "type": "string" }, "command_b64": { "type": "string" }, "content": { "type": "string" }, "content_b64": { "type": "string" }, "description": { "type": "string" }, "headers": { "type": "object", "additionalProperties": { "type": "string" } }, "playbook_activity": { "type": "string" }, "type": { "type": "string" }, "version": { "type": "string" } } }, "cacao.Contact": { "type": "object" }, "cacao.DataMarking": { "type": "object", "properties": { "affected_party_notifications": { "type": "string" }, "attribution": { "type": "string" }, "created": { "type": "string" }, "created_by": { "type": "string" }, "description": { "type": "string" }, "encrypt_in_transit": { "type": "string" }, "end_date": { "type": "string" }, "external_references": { "type": "array", "items": { "$ref": "#/definitions/cacao.ExternalReferences" } }, "id": { "type": "string" }, "iep_version": { "type": "string" }, "labels": { "type": "array", "items": { "type": "string" } }, "name": { "type": "string" }, "permitted_actions": { "type": "string" }, "revoked": { "type": "boolean" }, "start_date": { "type": "string" }, "statement": { "type": "string" }, "tlp": { "type": "string" }, "tlpv2_level": { "type": "string" }, "type": { "type": "string" }, "unmodified_resale": { "type": "string" }, "valid_from": { "type": "string" }, "valid_until": { "type": "string" } } }, "cacao.ExternalReferences": { "type": "object", "required": [ "description", "name", "source", "url" ], "properties": { "description": { "type": "string" }, "name": { "type": "string" }, "source": { "type": "string" }, "url": { "type": "string" } } }, "cacao.Playbook": { "type": "object", "required": [ "created", "created_by", "description", "external_references", "id", "impact", "labels", "modified", "name", "playbook_types", "priority", "severity", "spec_version", "type", "valid_from", "valid_until", "workflow", "workflow_exception", "workflow_start" ], "properties": { "agent_definitions": { "type": "object", "additionalProperties": { "$ref": "#/definitions/cacao.AgentTarget" } }, "authentication_info_definitions": { "type": "object", "additionalProperties": { "$ref": "#/definitions/cacao.AuthenticationInformation" } }, "created": { "description": "date time is already validate by the field type!", "type": "string" }, "created_by": { "type": "string" }, "data_marking_definitions": { "$ref": "#/definitions/cacao.DataMarking" }, "derived_from": { "type": "array", "items": { "type": "string" } }, "description": { "type": "string" }, "external_references": { "type": "array", "items": { "$ref": "#/definitions/cacao.ExternalReferences" } }, "id": { "type": "string" }, "impact": { "type": "integer" }, "labels": { "type": "array", "items": { "type": "string" } }, "markings": { "type": "array", "items": { "type": "string" } }, "modified": { "description": ",datetime=2006-01-02T15:04:05Z07:00\"`", "type": "string" }, "name": { "type": "string" }, "playbook_types": { "type": "array", "items": { "type": "string" } }, "priority": { "type": "integer" }, "severity": { "type": "integer" }, "spec_version": { "type": "string" }, "target_definitions": { "type": "object", "additionalProperties": { "$ref": "#/definitions/cacao.AgentTarget" } }, "type": { "type": "string" }, "valid_from": { "type": "string" }, "valid_until": { "type": "string" }, "workflow": { "$ref": "#/definitions/cacao.Workflow" }, "workflow_exception": { "type": "string" }, "workflow_start": { "type": "string" } } }, "cacao.Step": { "type": "object", "properties": { "agent": { "type": "string" }, "authentication_info": { "type": "string" }, "cases": { "type": "object", "additionalProperties": { "type": "string" } }, "commands": { "type": "array", "items": { "$ref": "#/definitions/cacao.Command" } }, "condition": { "type": "string" }, "delay": { "type": "integer" }, "description": { "type": "string" }, "external_references": { "type": "array", "items": { "$ref": "#/definitions/cacao.ExternalReferences" } }, "id": { "type": "string" }, "in_args": { "type": "array", "items": { "type": "string" } }, "name": { "type": "string" }, "next_steps": { "type": "array", "items": { "type": "string" } }, "on_completion": { "type": "string" }, "on_failure": { "type": "string" }, "on_false": { "type": "string" }, "on_success": { "type": "string" }, "on_true": { "type": "string" }, "out_args": { "type": "array", "items": { "type": "string" } }, "owner": { "type": "string" }, "playbook_id": { "type": "string" }, "playbook_variables": { "type": "object", "additionalProperties": { "$ref": "#/definitions/cacao.Variables" } }, "playbook_version": { "type": "string" }, "switch": { "type": "string" }, "targets": { "type": "array", "items": { "type": "string" } }, "timeout": { "type": "integer" }, "type": { "type": "string" } } }, "cacao.Variables": { "type": "object", "properties": { "constant": { "type": "boolean" }, "description": { "type": "string" }, "external": { "type": "boolean" }, "name": { "type": "string" }, "type": { "type": "string" }, "value": { "type": "string" } } }, "cacao.Workflow": { "type": "object", "additionalProperties": { "$ref": "#/definitions/cacao.Step" } } } }