You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/content/en/docs/core-components/api-manual.md
+17-16Lines changed: 17 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,8 +15,9 @@ We will use HTTP status codes https://en.wikipedia.org/wiki/List_of_HTTP_status_
15
15
16
16
```plantuml
17
17
@startuml
18
-
protocol Reporter {
18
+
protocol Manual {
19
19
GET /manual
20
+
GET /manual/{execution-id}/{step-id}
20
21
POST /manual/continue
21
22
}
22
23
@enduml
@@ -33,7 +34,7 @@ Get all pending manual actions objects that are currently waiting in SOARCA.
33
34
None
34
35
35
36
##### Response
36
-
200/OK with payload list of:
37
+
200/OK with body a list of:
37
38
38
39
39
40
@@ -45,8 +46,8 @@ None
45
46
|step_id |UUID |string |The id of the step executed by the execution
46
47
|description |description of the step|string |The description from the workflow step
47
48
|command |command |string |The command for the agent either command
48
-
|command_is_base64 |true \| false |bool |Indicate the command is in base 64
49
-
|targets |cacao agent-target |dictionary |Map of [cacao agent-target](https://docs.oasis-open.org/cacao/security-playbooks/v2.0/cs01/security-playbooks-v2.0-cs01.html#_Toc152256509) with the target(s) of this command
49
+
|command_is_base64 |true \| false |bool |Indicates if the command is in Base64
50
+
|target |cacao agent-target |object |Map of [cacao agent-target](https://docs.oasis-open.org/cacao/security-playbooks/v2.0/cs01/security-playbooks-v2.0-cs01.html#_Toc152256509) with the target(s) of this command
50
51
|out_args |cacao variables |dictionary |Map of [cacao variables](https://docs.oasis-open.org/cacao/security-playbooks/v2.0/cs01/security-playbooks-v2.0-cs01.html#_Toc152256555) handled in the step out args with current values and definitions
51
52
52
53
@@ -97,7 +98,7 @@ Get pending manual actions objects that are currently waiting in SOARCA for spec
97
98
None
98
99
99
100
##### Response
100
-
200/OK with payload:
101
+
200/OK with body:
101
102
102
103
103
104
@@ -109,7 +110,7 @@ None
109
110
|step_id |UUID |string |The id of the step executed by the execution
110
111
|description |description of the step|string |The description from the workflow step
111
112
|command |command |string |The command for the agent either command
112
-
|command_is_base64 |true \| false |bool |Indicate the command is in base 64
113
+
|command_is_base64 |true \| false |bool |Indicates if the command is in Base64
113
114
|targets |cacao agent-target |dictionary |Map of [cacao agent-target](https://docs.oasis-open.org/cacao/security-playbooks/v2.0/cs01/security-playbooks-v2.0-cs01.html#_Toc152256509) with the target(s) of this command
114
115
|out_args |cacao variables |dictionary |Map of [cacao variables](https://docs.oasis-open.org/cacao/security-playbooks/v2.0/cs01/security-playbooks-v2.0-cs01.html#_Toc152256555) handled in the step out args with current values and definitions
115
116
@@ -154,7 +155,7 @@ None
154
155
General error
155
156
156
157
#### POST `/manual/continue`
157
-
Respond to manual command pending in SOARCA, if out_args are defined they must be filled in and returned in the payload body. Only value is required in the response of the variable. You can however return the entire object. Of the object does not match the original out_arg the call we be considered as failed.
158
+
Respond to manual command pending in SOARCA, if out_args are defined they must be filled in and returned in the payload body. Only value is required in the response of the variable. You can however return the entire object. If the object does not match the original out_arg, the call we be considered as failed.
158
159
159
160
##### Call payload
160
161
|field |content |type | description |
@@ -163,9 +164,8 @@ Respond to manual command pending in SOARCA, if out_args are defined they must b
163
164
|execution_id |UUID |string |The id of the execution
164
165
|playbook_id |UUID |string |The id of the CACAO playbook executed by the execution
165
166
|step_id |UUID |string |The id of the step executed by the execution
166
-
|response_status |enum |string |Can be either `success` or `failed`
167
-
|response_out_args |cacao variables |dictionary |Map of [cacao variables](https://docs.oasis-open.org/cacao/security-playbooks/v2.0/cs01/security-playbooks-v2.0-cs01.html#_Toc152256555) handled in the step out args with current values and definitions
168
-
167
+
|response_status |enum |string |`success` indicates successfull fulfilment of the manual request. `failure` indicates failed satisfaction of the request
168
+
|response_out_args |cacao variables |dictionary |Map of cacao variables names to cacao variable struct. Only name, type, and value are mandatory
169
169
170
170
171
171
```plantuml
@@ -176,15 +176,15 @@ Respond to manual command pending in SOARCA, if out_args are defined they must b
176
176
"execution_id" : "<execution-id>",
177
177
"playbook_id" : "<playbook-id>",
178
178
"step_id" : "<step-id>",
179
-
"response_status" : "success | failed",
179
+
"response_status" : "success | failure",
180
180
"response_out_args": {
181
181
"<variable-name-1>" : {
182
-
"type": "<type>",
182
+
"type": "<variable-type>",
183
183
"name": "<variable-name>",
184
-
"description": "<description>",
185
184
"value": "<value>",
186
-
"constant": "<true/false>",
187
-
"external": "<true/false>"
185
+
"description": "<description> (ignored)",
186
+
"constant": "<true/false> (ignored)",
187
+
"external": "<true/false> (ignored)"
188
188
}
189
189
}
190
190
}
@@ -193,7 +193,8 @@ Respond to manual command pending in SOARCA, if out_args are defined they must b
Copy file name to clipboardExpand all lines: docs/content/en/docs/core-components/modules.md
+183-4Lines changed: 183 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -322,20 +322,199 @@ This example will start an operation that executes the ability with ID `36eecb80
322
322
```
323
323
324
324
### Manual capability
325
-
This capability executes [manual Commands](https://docs.oasis-open.org/cacao/security-playbooks/v2.0/cs01/security-playbooks-v2.0-cs01.html#_Toc152256491) and provides them through the [SOARCA api](/docs/core-components/api-manual).
325
+
This capability executes [manual Commands](https://docs.oasis-open.org/cacao/security-playbooks/v2.0/cs01/security-playbooks-v2.0-cs01.html#_Toc152256491) and provides them natively through the [SOARCA api](/docs/core-components/api-manual), though other integrations are possible.
326
326
327
327
328
-
<!--The manual capability will allow an operator to interact with a playbook. It could allow one to perform a manual step that could not be automated, enter a variable to the playbook execution or a combination of these operations.
328
+
The manual capability will allow an operator to interact with a playbook. It could allow one to perform a manual step that could not be automated, enter a variable to the playbook execution or a combination of these operations.
329
329
330
-
The main way to interact with the manual step is through SOARCA's [manual api](/docs/core-components/api-manual). The manual step should provide a timeout SOARCA will by default use a timeout of 10 minutes. If a timeout occurs the step is considered as failed.-->
330
+
The manual step should provide a timeout. SOARCA will by default use a timeout of 10 minutes. If a timeout occurs, the step is considered as failed.
331
331
332
+
#### Manual capability architecture
332
333
334
+
In essence, executing a manual command involves the following actions:
335
+
1. A message, the `command` of a manual command, is posted *somewhere*, *somehow*, together with the variables of which values is expected to be assigned or updated (if any).
336
+
2. The playbook execution stops, waiting for *something* to respond to the message with the variables values.
337
+
3. Once something replies, the variables are streamed inside the playbook execution and handled accordingly.
333
338
339
+
It should be possible to post a manual command message anywhere and in any way, and allow anything to respond back. Hence, SOARCA adopts a flexible architecture to accomodate different ways of manual *interactions*. Below a view of the architecture.
334
340
341
+
When a playbook execution hits an Action step with a manual command, the *ManualCapability* will queue the instruction into the *CapabilityInteraction* module. The module does essentially three things:
342
+
1. it stores the status of the manual command, and implements the SOARCA API interactions with the manual command.
343
+
2. If manual integrations are defined for the SOARCA instance, the *CapabilityInteraction* module notifies the manual integration modules, so that they can handle the manual command in turn.
344
+
3. It waits for the manual command to be satisfied either via SOARCA APIs, or via manual integrations. The first to respond amongst the two, resolves the manual command. The resolution of the command may or may not assign new values to variables in the playbook. Finally the *CapabilityInteraction* module replies to the *ManualCommand* module.
345
+
346
+
Ultimately the *ManualCapability* then completes its execution, having eventually updated the values for the variables in the outArgs of the command. Timeouts or errors are handled opportunely.
The default and internally-supported way to interact with the manual step is through SOARCA's [manual api](/docs/core-components/api-manual).
399
+
Besides SOARCA's [manual api](/docs/core-components/api-manual), SOARCA is designed to allow for configuration of additional ways that a manual command should be executed. In particular, there can be *one* manual integration (besides the native manual APIs) per running SOARCA instance.
400
+
Integration's code should implement the *IInteractionIntegrationNotifier* interface, returning the result of the manual command execution in form of an `InteractionIntegrationResponse` object, into the respective channel.
401
+
402
+
The diagram below displays in some detail the way the manual interactions components work.
Note that whoever resolves the manual command first, whether via the manualAPI, or a third party integration, then the command results are returned to the workflow execution, and the manual command is removed from the pending list. Hence, if a manual command is resolved e.g. via the manual integration, a postContinue API call for that same command will not go through, as the command will have been resolved already, and hence removed from the registry of pending manual commands.
475
+
476
+
The diagram below shows instead what happens when a timeout occurs for the manual command.
api -> interaction : GetPendingCommand(execution.metadata)
508
+
interaction -> api : no pending command (404)
509
+
end
510
+
511
+
512
+
@enduml
513
+
```
335
514
336
515
#### Success and failure
337
516
338
-
In SOARCA the manual step is considered successful if a response is made through the [manual api](/docs/core-components/api-manual). The manual command can specify a timeout but if none is specified SOARCA will use a default timeout of 10 minutes. If a timeout occurs the step is considered as failed and SOARCA will return an error to the decomposer.
517
+
In SOARCA the manual step is considered successful if a response is made through the [manual api](/docs/core-components/api-manual), or an integration. The manual command can specify a timeout, but if none is specified SOARCA will use a default timeout of 10 minutes. If a timeout occurs the step is considered as failed and SOARCA will return an error to the decomposer.
0 commit comments