Skip to content

Commit

Permalink
Merge branch 'main' into artifacts/cloud-testing
Browse files Browse the repository at this point in the history
  • Loading branch information
jbudz committed Apr 13, 2022
2 parents 5a3a3c6 + ab1bec3 commit 8935c94
Show file tree
Hide file tree
Showing 219 changed files with 3,456 additions and 1,869 deletions.
11 changes: 11 additions & 0 deletions .buildkite/pipelines/pull_request/response_ops.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
steps:
- command: .buildkite/scripts/steps/functional/response_ops_cases.sh
label: 'Cases Cypress Tests on Security Solution'
agents:
queue: ci-group-6
depends_on: build
timeout_in_minutes: 120
retry:
automatic:
- exit_status: '*'
limit: 1
8 changes: 7 additions & 1 deletion .buildkite/scripts/pipelines/pull_request/pipeline.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ const uploadPipeline = (pipelineContent) => {
if (
(await doAnyChangesMatch([
/^x-pack\/plugins\/security_solution/,
/^x-pack\/plugins\/cases/,
/^x-pack\/plugins\/lists/,
/^x-pack\/plugins\/timelines/,
/^x-pack\/test\/security_solution_cypress/,
Expand All @@ -77,6 +76,13 @@ const uploadPipeline = (pipelineContent) => {
pipeline.push(getPipeline('.buildkite/pipelines/pull_request/security_solution.yml'));
}

if (
(await doAnyChangesMatch([/^x-pack\/plugins\/cases/])) ||
process.env.GITHUB_PR_LABELS.includes('ci:all-cypress-suites')
) {
pipeline.push(getPipeline('.buildkite/pipelines/pull_request/response_ops.yml'));
}

if (
(await doAnyChangesMatch([/^x-pack\/plugins\/apm/])) ||
process.env.GITHUB_PR_LABELS.includes('ci:all-cypress-suites')
Expand Down
17 changes: 17 additions & 0 deletions .buildkite/scripts/steps/functional/response_ops_cases.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/usr/bin/env bash

set -euo pipefail

source .buildkite/scripts/steps/functional/common.sh

export JOB=kibana-security-solution-chrome

echo "--- Response Ops Cases Cypress Tests on Security Solution"

cd "$XPACK_DIR"

checks-reporter-with-killswitch "Response Ops Cases Cypress Tests on Security Solution" \
node scripts/functional_tests \
--debug --bail \
--kibana-install-dir "$KIBANA_BUILD_LOCATION" \
--config test/security_solution_cypress/cases_cli_config.ts
9 changes: 7 additions & 2 deletions docs/api/cases.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,15 @@ these APIs:
* <<cases-api-get-case>>
* <<cases-api-get-status>>
* <<cases-api-get-comments>>
* {security-guide}/cases-get-connector.html[Get current connector]
* <<cases-get-configuration>>
* <<cases-api-get-reporters>>
* <<cases-api-get-tag>>
* {security-guide}/cases-api-push.html[Push case]
* {security-guide}/assign-connector.html[Set default Elastic Security UI connector]
* <<cases-api-set-configuration>>
* {security-guide}/case-api-update-connector.html[Update case configurations]
* <<cases-api-update>>
* <<cases-api-update-comment>>
* <<cases-api-update-configuration>>

//ADD
include::cases/cases-api-add-comment.asciidoc[leveloffset=+1]
Expand All @@ -40,8 +41,12 @@ include::cases/cases-api-get-case-activity.asciidoc[leveloffset=+1]
include::cases/cases-api-get-case.asciidoc[leveloffset=+1]
include::cases/cases-api-get-status.asciidoc[leveloffset=+1]
include::cases/cases-api-get-comments.asciidoc[leveloffset=+1]
include::cases/cases-api-get-configuration.asciidoc[leveloffset=+1]
include::cases/cases-api-get-reporters.asciidoc[leveloffset=+1]
include::cases/cases-api-get-tags.asciidoc[leveloffset=+1]
//SET
include::cases/cases-api-set-configuration.asciidoc[leveloffset=+1]
//UPDATE
include::cases/cases-api-update.asciidoc[leveloffset=+1]
include::cases/cases-api-update-comment.asciidoc[leveloffset=+1]
include::cases/cases-api-update-configuration.asciidoc[leveloffset=+1]
95 changes: 95 additions & 0 deletions docs/api/cases/cases-api-get-configuration.asciidoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
[[cases-get-configuration]]
== Get case configuration API
++++
<titleabbrev>Get configuration</titleabbrev>
++++

Retrieves external connection details, such as the closure type and
default connector for cases.

=== {api-request-title}

`GET <kibana host>:<port>/api/cases/configure`

`GET <kibana host>:<port>/s/<space_id>/api/cases/configure`

=== {api-prereq-title}

You must have `read` privileges for the *Cases* feature in the *Management*,
*{observability}*, or *Security* section of the
<<kibana-feature-privileges,{kib} feature privileges>>, depending on the
`owner` of the case configuration.

=== {api-path-parms-title}

`<space_id>`::
(Optional, string) An identifier for the space. If it is not specified, the
default space is used.

=== {api-query-parms-title}

`owner`::
(Optional, string or array of strings) A filter to limit the retrieved
details to a specific set of applications. Valid values are: `cases`,
`observability`, and `securitySolution`. If this parameter is omitted, the
response contains information for all applications that the user has access to
read.

=== Response code

`200`::
Indicates a successful call.

=== Example

[source,sh]
--------------------------------------------------
GET api/cases/configure?owner=securitySolution
--------------------------------------------------
// KIBANA

The API returns the following type of information:

[source,json]
--------------------------------------------------
[
{
"owner": "securitySolution",
"closure_type": "close-by-user",
"created_at": "2020-03-30T13:31:38.083Z",
"created_by": {
"email": "[email protected]",
"full_name": "Mr Admin",
"username": "admin"
},
"updated_at": null,
"updated_by": null,
"connector": {
"id": "131d4448-abe0-4789-939d-8ef60680b498",
"name": "my-jira",
"type": ".jira",
"fields": null
},
"mappings": [
{
"source": "title",
"target": "summary",
"action_type": "overwrite"
},
{
"source": "description",
"target": "description",
"action_type": "overwrite"
},
{
"source": "comments",
"target": "comments",
"action_type": "append"
}
],
"version": "WzE3NywxXQ==",
"error": null,
"id": "7349772f-421a-4de3-b8bb-2d9b22ccee30"
}
]
--------------------------------------------------
19 changes: 6 additions & 13 deletions docs/api/cases/cases-api-get-tags.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<titleabbrev>Get tags</titleabbrev>
++++

Aggregates and returns all unique tags from all cases.
Aggregates and returns a list of case tags.

=== Request

Expand All @@ -21,20 +21,16 @@ You must have `read` privileges for the *Cases* feature in the *Management*,

=== Path parameters

`<case_id>`::
(Required, string) An identifier for the case to retrieve. Use
<<cases-api-find-cases>> to retrieve case IDs.

`<space_id>`::
(Optional, string) An identifier for the space. If it is not specified, the
default space is used.

=== Query parameters

`owner`::
(Optional, string or array of strings) Specifies the set of applications to
limit the retrieved tags. If not specified, the response contains all tags from
cases that the user has access to read.
(Optional, string or array of strings) A filter to limit the retrieved tags to a specific set of applications.
Valid values are: `cases`, `observability`, and `securitySolution`. If this parameter is omitted, the response
contains tags from all cases that the user has access to read.

==== Response code

Expand All @@ -43,16 +39,13 @@ cases that the user has access to read.

==== Example

Gets all tags for all cases:

[source,sh]
--------------------------------------------------
GET api/cases/tags
--------------------------------------------------
// KIBANA

The API returns a JSON object with the names and email addresses of users who
opened cases. For example:
The API returns a JSON object with tags from all the cases that the user has access to read. For example:

[source,json]
--------------------------------------------------
Expand All @@ -62,4 +55,4 @@ opened cases. For example:
"social engineering",
"bubblegum"
]
--------------------------------------------------
--------------------------------------------------
Loading

0 comments on commit 8935c94

Please sign in to comment.