Check input schema (#33)

This commit is contained in:
Jonas Plum
2022-02-27 12:25:41 +01:00
committed by GitHub
parent 54312893a2
commit 338aba8342
38 changed files with 3221 additions and 1676 deletions

View File

@@ -659,7 +659,7 @@
"content" : {
"application/json" : {
"schema" : {
"$ref" : "#/components/schemas/Job"
"$ref" : "#/components/schemas/JobUpdate"
}
}
},
@@ -3404,7 +3404,7 @@
},
"/tickets/{id}/playbooks/{playbookID}/task/{taskID}" : {
"put" : {
"operationId" : "setTask",
"operationId" : "setTaskData",
"parameters" : [ {
"description" : "Ticket ID",
"example" : 8123,
@@ -3438,11 +3438,11 @@
"content" : {
"application/json" : {
"schema" : {
"$ref" : "#/components/schemas/Task"
"type" : "object"
}
}
},
"description" : "Task",
"description" : "Task data",
"required" : true
},
"responses" : {
@@ -3628,9 +3628,9 @@
"security" : [ {
"roles" : [ "ticket:write" ]
} ],
"summary" : "Set a ticket playbook task",
"summary" : "Set a ticket playbook task data",
"tags" : [ "tickets" ],
"x-codegen-request-body-name" : "task"
"x-codegen-request-body-name" : "data"
}
},
"/tickets/{id}/playbooks/{playbookID}/task/{taskID}/complete" : {
@@ -3865,6 +3865,235 @@
"x-codegen-request-body-name" : "data"
}
},
"/tickets/{id}/playbooks/{playbookID}/task/{taskID}/owner" : {
"put" : {
"operationId" : "setTaskOwner",
"parameters" : [ {
"description" : "Ticket ID",
"example" : 8123,
"in" : "path",
"name" : "id",
"required" : true,
"schema" : {
"format" : "int64",
"type" : "integer"
}
}, {
"description" : "Playbook ID",
"example" : "phishing",
"in" : "path",
"name" : "playbookID",
"required" : true,
"schema" : {
"type" : "string"
}
}, {
"description" : "Task ID",
"example" : "board",
"in" : "path",
"name" : "taskID",
"required" : true,
"schema" : {
"type" : "string"
}
} ],
"requestBody" : {
"content" : {
"application/json" : {
"schema" : {
"type" : "string"
}
}
},
"description" : "Task owner",
"required" : true
},
"responses" : {
"200" : {
"content" : {
"application/json" : {
"schema" : {
"$ref" : "#/components/schemas/TicketWithTickets"
}
},
"test" : {
"example" : {
"artifacts" : [ {
"name" : "94d5cab6f5fe3422a447ab15436e7a672bc0c09a",
"status" : "unknown"
}, {
"name" : "http://www.customerviral.io/scalable/vertical/killer",
"status" : "clean"
}, {
"name" : "leadreintermediate.io",
"status" : "malicious"
} ],
"created" : "2021-10-02T16:04:59.078+0000",
"id" : 8123,
"modified" : "2021-12-12T12:12:12.000+0000",
"name" : "live zebra",
"owner" : "demo",
"playbooks" : {
"phishing" : {
"name" : "Phishing",
"tasks" : {
"block-iocs" : {
"active" : false,
"created" : "2021-12-12T12:12:12.000+0000",
"done" : false,
"name" : "Block IOCs",
"order" : 6,
"type" : "task"
},
"block-sender" : {
"active" : false,
"created" : "2021-12-12T12:12:12.000+0000",
"done" : false,
"name" : "Block sender",
"next" : {
"extract-iocs" : ""
},
"order" : 3,
"type" : "task"
},
"board" : {
"active" : true,
"created" : "2021-12-12T12:12:12.000+0000",
"done" : false,
"name" : "Board Involvement?",
"next" : {
"escalate" : "boardInvolved == true",
"mail-available" : "boardInvolved == false"
},
"order" : 0,
"owner" : "eve",
"schema" : {
"properties" : {
"boardInvolved" : {
"default" : false,
"title" : "A board member is involved.",
"type" : "boolean"
}
},
"required" : [ "boardInvolved" ],
"title" : "Board Involvement?",
"type" : "object"
},
"type" : "input"
},
"escalate" : {
"active" : false,
"created" : "2021-12-12T12:12:12.000+0000",
"done" : false,
"name" : "Escalate to CISO",
"order" : 1,
"type" : "task"
},
"extract-iocs" : {
"active" : false,
"created" : "2021-12-12T12:12:12.000+0000",
"done" : false,
"name" : "Extract IOCs",
"next" : {
"block-iocs" : ""
},
"order" : 5,
"schema" : {
"properties" : {
"iocs" : {
"items" : {
"type" : "string"
},
"title" : "IOCs",
"type" : "array"
}
},
"title" : "Extract IOCs",
"type" : "object"
},
"type" : "input"
},
"mail-available" : {
"active" : false,
"created" : "2021-12-12T12:12:12.000+0000",
"done" : false,
"name" : "Mail available",
"next" : {
"block-sender" : "schemaKey == 'yes'",
"extract-iocs" : "schemaKey == 'yes'",
"search-email-gateway" : "schemaKey == 'no'"
},
"order" : 2,
"schema" : {
"oneOf" : [ {
"properties" : {
"mail" : {
"title" : "Mail",
"type" : "string",
"x-display" : "textarea"
},
"schemaKey" : {
"const" : "yes",
"type" : "string"
}
},
"required" : [ "mail" ],
"title" : "Yes"
}, {
"properties" : {
"schemaKey" : {
"const" : "no",
"type" : "string"
}
},
"title" : "No"
} ],
"title" : "Mail available",
"type" : "object"
},
"type" : "input"
},
"search-email-gateway" : {
"active" : false,
"created" : "2021-12-12T12:12:12.000+0000",
"done" : false,
"name" : "Search email gateway",
"next" : {
"extract-iocs" : ""
},
"order" : 4,
"type" : "task"
}
}
}
},
"references" : [ {
"href" : "https://www.leadmaximize.net/e-services/back-end",
"name" : "performance"
}, {
"href" : "http://www.corporateinteractive.name/rich",
"name" : "autumn"
}, {
"href" : "https://www.corporateintuitive.org/intuitive/platforms/integrate",
"name" : "suggest"
} ],
"schema" : "{\n \"definitions\": {},\n \"$schema\": \"http://json-schema.org/draft-07/schema#\",\n \"$id\": \"https://example.com/object1618746510.json\",\n \"title\": \"Event\",\n \"type\": \"object\",\n \"required\": [\n \"severity\",\n \"description\",\n \"tlp\"\n ],\n \"properties\": {\n \"severity\": {\n \"$id\": \"#root/severity\",\n \"title\": \"Severity\",\n \"type\": \"string\",\n \"default\": \"Medium\",\n \"nx-enum\": [\n \"Low\",\n \"Medium\",\n \"High\"\n ],\n \"x-cols\": 6,\n \"x-class\": \"pr-2\",\n \"x-display\": \"icon\",\n \"x-itemIcon\": \"icon\",\n \"oneOf\": [\n {\n \"const\": \"Low\",\n \"title\": \"Low\",\n \"icon\": \"mdi-chevron-up\"\n },\n {\n \"const\": \"Medium\",\n \"title\": \"Medium\",\n \"icon\": \"mdi-chevron-double-up\"\n },\n {\n \"const\": \"High\",\n \"title\": \"High\",\n \"icon\": \"mdi-chevron-triple-up\"\n }\n ]\n },\n \"tlp\": {\n \"$id\": \"#root/tlp\",\n \"title\": \"TLP\",\n \"type\": \"string\",\n \"nx-enum\": [\n \"White\",\n \"Green\",\n \"Amber\",\n \"Red\"\n ],\n \"x-cols\": 6,\n \"x-class\": \"pr-2\",\n \"x-display\": \"icon\",\n \"x-itemIcon\": \"icon\",\n \"oneOf\": [\n {\n \"const\": \"White\",\n \"title\": \"White\",\n \"icon\": \"mdi-alpha-w\"\n },\n {\n \"const\": \"Green\",\n \"title\": \"Green\",\n \"icon\": \"mdi-alpha-g\"\n },\n {\n \"const\": \"Amber\",\n \"title\": \"Amber\",\n \"icon\": \"mdi-alpha-a\"\n },\n {\n \"const\": \"Red\",\n \"title\": \"Red\",\n \"icon\": \"mdi-alpha-r\"\n }\n ]\n },\n \"description\": {\n \"$id\": \"#root/description\",\n \"title\": \"Description\",\n \"type\": \"string\",\n \"x-display\": \"textarea\",\n \"x-class\": \"pr-2\"\n }\n }\n}\n",
"status" : "closed",
"type" : "incident"
}
}
},
"description" : "successful operation"
}
},
"security" : [ {
"roles" : [ "ticket:write" ]
} ],
"summary" : "Set a ticket playbook task owner",
"tags" : [ "tickets" ],
"x-codegen-request-body-name" : "owner"
}
},
"/tickets/{id}/playbooks/{playbookID}/task/{taskID}/run" : {
"post" : {
"operationId" : "runTask",
@@ -3928,10 +4157,7 @@
"content" : {
"application/json" : {
"schema" : {
"items" : {
"$ref" : "#/components/schemas/Reference"
},
"type" : "array"
"$ref" : "#/components/schemas/ReferenceArray"
}
}
},
@@ -4390,10 +4616,7 @@
"content" : {
"application/json" : {
"schema" : {
"items" : {
"$ref" : "#/components/schemas/TicketForm"
},
"type" : "array"
"$ref" : "#/components/schemas/TicketFormArray"
}
}
},
@@ -5295,6 +5518,28 @@
"required" : [ "automation", "id", "status" ],
"type" : "object"
},
"JobUpdate" : {
"properties" : {
"container" : {
"type" : "string"
},
"log" : {
"type" : "string"
},
"output" : {
"properties" : { },
"type" : "object"
},
"running" : {
"type" : "boolean"
},
"status" : {
"type" : "string"
}
},
"required" : [ "running", "status" ],
"type" : "object"
},
"Link" : {
"properties" : {
"id" : {
@@ -5478,6 +5723,12 @@
"required" : [ "href", "name" ],
"type" : "object"
},
"ReferenceArray" : {
"items" : {
"$ref" : "#/components/schemas/Reference"
},
"type" : "array"
},
"Rule" : {
"properties" : {
"condition" : {
@@ -5655,62 +5906,6 @@
"required" : [ "created", "done", "name", "type" ],
"type" : "object"
},
"TaskForm" : {
"properties" : {
"automation" : {
"type" : "string"
},
"closed" : {
"format" : "date-time",
"type" : "string"
},
"created" : {
"format" : "date-time",
"type" : "string"
},
"data" : {
"properties" : { },
"type" : "object"
},
"done" : {
"type" : "boolean"
},
"join" : {
"example" : false,
"type" : "boolean"
},
"name" : {
"example" : "Inform user",
"type" : "string"
},
"next" : {
"additionalProperties" : {
"type" : "string"
},
"type" : "object"
},
"owner" : {
"type" : "string"
},
"payload" : {
"additionalProperties" : {
"type" : "string"
},
"type" : "object"
},
"schema" : {
"properties" : { },
"type" : "object"
},
"type" : {
"enum" : [ "task", "input", "automation" ],
"example" : "task",
"type" : "string"
}
},
"required" : [ "name", "type" ],
"type" : "object"
},
"TaskOrigin" : {
"properties" : {
"playbook_id" : {
@@ -5992,6 +6187,12 @@
"required" : [ "name", "status", "type" ],
"type" : "object"
},
"TicketFormArray" : {
"items" : {
"$ref" : "#/components/schemas/TicketForm"
},
"type" : "array"
},
"TicketList" : {
"properties" : {
"count" : {