Commit graph

542 commits

Author SHA1 Message Date
Patryk Kopyciński
0be8295ed0
[Security Assistant] Fix langgraph issues (#189287)
## Summary

- Fixed `Regenerate` button for Gemini
- Fixed auto title functionality
- Enabled `assistantBedrockChat` by default

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2024-07-31 15:32:29 -05:00
Brijesh Khunt
696190db60
TheHive Case Connector (#180138)
## Summary

TheHive is a new case connector, enabling users to seamlessly transfer
elastic cases to TheHive Security Incident Response Platform. This
connector facilitates sub-actions such as creating cases, updating
cases, and adding comments and creating alerts.

**create connector**

![thehive-connector](1e9a3fc5-c17a-40b5-8a49-87cd0fd74863)

**test connector**
1. **create case**


![thehive-params-case-test](2652ea5e-8b47-42d9-9b11-c055efe291b3)

2. **create alert**


![thehive-params-alert-test](8c8759c0-609c-4e34-bc21-35d648e684ab)


### Checklist

Delete any items that are not applicable to this PR.

- [x] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)
- [ ]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [x] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [x] Any UI touched in this PR is usable by keyboard only (learn more
about [keyboard accessibility](https://webaim.org/techniques/keyboard/))
- [x] Any UI touched in this PR does not create any new axe failures
(run axe in browser:
[FF](https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/),
[Chrome](https://chrome.google.com/webstore/detail/axe-web-accessibility-tes/lhdoppojpmngadmnindnejefpokejbdd?hl=en-US))
- [x] If a plugin configuration key changed, check if it needs to be
allowlisted in the cloud and added to the [docker
list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)
- [x] This renders correctly on smaller devices using a responsive
layout. (You can test this [in your
browser](https://www.browserstack.com/guide/responsive-testing-on-local-server))
- [x] This was checked for [cross-browser
compatibility](https://www.elastic.co/support/matrix#matrix_browsers)

### For maintainers

- [ ] This was checked for breaking API changes and was [labeled
appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Janki Salvi <jankigaurav.salvi@elastic.co>
Co-authored-by: Janki Salvi <117571355+js-jankisalvi@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2024-07-30 11:36:21 +03:00
Lisa Cawley
e6795e5b0a
[DOCS][OAS] Add descriptions, tags, deprecation to connector APIs (#184956) 2024-07-25 16:46:30 -05:00
Nick Partridge
49a985625b
Upgrade prettier dependencies (#188032)
## Summary

- Upgrade `prettier` to `v2.8.x`.
- Upgrade related decencies.
- Adds `prettier` group to renovate config.
- Fixes bootstrapping type error.

## Main Changes

### Add parentheses for `TypeofTypeAnnotation` to improve readability

[link](https://github.com/prettier/prettier/blob/main/CHANGELOG.md#add-parentheses-for-typeoftypeannotation-to-improve-readability-14458-by-fisker)

```ts
// Input
type A = (typeof node.children)[];

// Prettier 2.8.4
type A = typeof node.children[];

// Prettier 2.8.5
type A = (typeof node.children)[];
```

### Add parentheses to head of `ExpressionStatement` instead of the
whole statement


[link](https://github.com/prettier/prettier/blob/main/CHANGELOG.md#add-parentheses-to-head-of-expressionstatement-instead-of-the-whole-statement-14077-by-fisker)

```ts
// Input
({}).toString.call(foo) === "[object Array]"
  ? foo.forEach(iterateArray)
  : iterateObject(foo);

// Prettier 2.8.1
({}.toString.call(foo) === "[object Array]"
  ? foo.forEach(iterateArray)
  : iterateObject(foo));

// Prettier 2.8.2
({}).toString.call(foo.forEach) === "[object Array]"
  ? foo.forEach(iterateArray)
  : iterateObject(foo);
```

## Details

This started because I noticed we were on `typescript@^5` but still on
an old prettier that complained about use of new TS features such as
[`satisfies`](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-4-9.html#the-satisfies-operator).

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2024-07-24 17:29:05 +01:00
Patryk Kopyciński
26dd61efa2
BedrockChat & GeminiChat (#186809)
## Summary

Adopted `BedrockChat` from `@langchain/community` package that adds
support for tools calling
https://js.langchain.com/v0.2/docs/integrations/chat/bedrock/

Adopted `ChatGoogleGenerativeAI ` from `@langchain/google-genai` package
that adds support for tools calling
https://js.langchain.com/v0.2/docs/integrations/chat/google_generativeai

Hidden behind FF:
`--xpack.securitySolution.enableExperimental=[assistantBedrockChat]`

As of this PR `integration_assistant` is still going to use
`ActionsClientSimpleChatModel`. After the FF will be enabled by default
we will switch `integration_assistant` to use new chat model.

Thank you @stephmilovic a ton 🙇

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Steph Milovic <stephanie.milovic@elastic.co>
Co-authored-by: Garrett Spong <spong@users.noreply.github.com>
2024-07-23 15:17:21 -05:00
Paul Tavares
1cae23769a
[Security Solution][Endpoint] Add logic to SentinelOne response actions to check and complete kill-process actions (#188033)
## Summary

#### Security Solution

- adds logic to the SentinelOne response actions client to check on the
status of `kill-process` actions in SentinelOne and writes response
document to ES if complete


#### Stack Connector changes to SentinelOne Connector

- Added new sub-action: `downloadRemoteScriptResults()`: returns a
`Stream` allowing the download of a SentinelOne task execution results
2024-07-17 16:56:42 +02:00
Pierre Gayvallet
d0b807403c
Improve features plugin's contract type names (#187944)
## Summary

Fix https://github.com/elastic/kibana/issues/65999

Change the `features` plugin's contract type names to follow our naming
convensions and to avoid needing to rename them during imports

(and yeah, I'm triggering a review from 30 teams again for a type
rename, just for the fun of it)

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2024-07-17 15:33:32 +01:00
Paul Tavares
df22162faf
[Security Solution][Endpoint] Add kill-process API support for SentinelOne agents (#186133)
## Summary

#### Security Solution changes:

- Adds new feature flag for `kill-process` operation against SentinelOne
hosts
- Adds support for `kill-process` to the existing api for `agent_type`
of `sentinel_one`



#### Stack Connectors changes:

The following changes were done to the SentinelOne connector:

- Added additional query param to the `getRemoteScripts()` sub-action
2024-07-09 14:26:44 +02:00
Steph Milovic
2b5ff77095
[Security solution] Add model parameter to token telemetry (#187783) 2024-07-08 12:53:25 -06:00
Pierre Gayvallet
b6fcfac9c1
[Kibana logging system] Add conditional evaluation based on level for logging APIs (#187225)
## Summary

*(Yeah, the title is pretty bad I apologize, I couldn't find something
sexy. OTOH, "sexy" and "logging" are usually antonyms, like "sport car"
and "fiat panda", or "server language" and "javascript")*

### 1. Provide a more developer-friendly alternative to
`Logger.isLevelEnabled`.


**With `isLevelEnabled`**
```ts
if(logger.isLevelEnabled('info')) {
  const message = someExpensiveMessageProbablyBasedOnJsonStringifyOrSomething(); 
  logger.info(message);
}
```

**With this PR:**
```ts
logger.info(() => someExpensiveMessageProbablyBasedOnJsonStringifyOrSomething());
``` 

### 2. Adapt calls to `log.debug` (arguably) costly to use this syntax

Aka any call relying on `JSON.stringify` or function calls.

I used the new syntax for those, except when the tests were too
complicated to fix or when the code did not allow it (e.g. untyped let
variables infered from return from assignations don't play well with
closures)
2024-07-08 23:53:02 +10:00
Tim Sullivan
dc12ac8e9a
[Actions Plugin] Use server-side authc.getCurrentUser from core.security (#186924)
Part of https://github.com/elastic/kibana/issues/186574

Background: This PR serves as an example of a plugin migrating away from
depending on the Security plugin, which is a high priority effort for
the last release before 9.0. The Actions plugin uses the
`authc.getCurrentUser` method to attribute the current user to persisted
actions that are created in the system.

### Checklist

Delete any items that are not applicable to this PR.

- [X] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
2024-07-02 08:33:32 -07:00
Alejandro Fernández Haro
00337de019
[Config Service] Ignore unknown config on Serverless (#187006) 2024-07-01 12:32:22 -05:00
Steph Milovic
061a5efda0
[GenAI Connectors] Token telemetry (#186936) 2024-06-28 09:36:18 -06:00
Tomasz Ciecierski
9c7d050577
[EDR Workflows] Enable Crowdstrike feature flags (#186801) 2024-06-28 16:35:44 +02:00
Steph Milovic
c13419e166
[GenAI Connectors] Bump default Gemini and Bedrock versions (#186671) 2024-06-24 11:52:23 -06:00
Lisa Cawley
a021e48e2b
[OAS] Refresh connectors API document (#186141) 2024-06-18 11:50:35 -07:00
Ersin Erdal
51bc0dc039
Add connector and actionTaskParams modelVersions (#184542)
Resolves: #177059

This PR adds model versions for `action` and `action_task_params` saved
objects.
I also re-organised the schema and model version file structure in
alerting, task_manager and actions plugins.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2024-06-18 16:31:16 +02:00
Antonio
3a2e1621f4
[ResponseOps][Connectors] SSL for Cases Webhook (#185925)
Fixes #180255

## Summary

Adds API support and UI for CA and client-side SSL certificate
authentication to the Cases webhook connector.

<img width="977" alt="aux"
src="03495377-edfb-4f02-9fd1-3e0ca1d2b0fb">

This PR is to merge a feature branch into `main`.

This feature branch is composed of the following PRs:
- https://github.com/elastic/kibana/pull/183711
- https://github.com/elastic/kibana/pull/183919
- https://github.com/elastic/kibana/pull/184313

### How to test

@cnasikas kindly provided a node server that can be setup locally to
test the certificates against.

Ping me offline and i will send you the rar. You will need to configure
a connector of type `Cases Webhook connector`.

#### Configuring `Authentication`:

The project folder has two sets of keys, one for Alice and one for Bob.
The Alice keys should work and the Bob keys are expected to be
unauthorized.

- For `CRT and KEY File` use:
  - `alice_cert.pem` and `alice_key.pem` respectively (or `bob_*`)
- For `PFX File` use:
  - `alice.p12` or `bob.p12`.
- Toggle `Add certificate authority`.
- Select `Verification mode` to be `none`.

#### Configuring `Create case`:

Only the URL is relevant. It should be
`https://localhost:9999/authenticate`.

Everything else can have whatever values you want.

### Release Notes

The Cases webhook connector now supports SSL certificate authentication.
2024-06-18 11:45:41 +02:00
rohanxz
a9f5375fa8
Gemini Connector Assistant Integration (#184741) 2024-06-17 11:35:48 -06:00
Lisa Cawley
055483e013
[OAS] Fix Google Gemini connector API definitions (#186058) 2024-06-13 16:40:13 -07:00
Marius Iversen
9ed2865838
New Integration Assistant plugin (#184296)
## Summary

This is a PR to add a new backend plugin (frontend will be done in
separate [PR](https://github.com/elastic/kibana/pull/184546)).

The purpose of the plugin is to provide a set of API routes that is used
to perform a variety of GenAI workflows to generate new integrations
based on provided inputs.

It reuses the existing GenAI connectors for its LLM communication, and
provides a set of API's to create ECS mapping, Categorization, Related
Fields and an API to generate the actual integration package zip, which
is forwarded to the UI component.

### Planned follow-up changes:

As the PR is getting way too large, some planned changes would be added
in much smaller follow-ups. This includes mostly more improved try/catch
for certain routes, adding debug/error log entries where relevant,
especially for the API endpoints themself, some more unit and end2end
tests.

- OpenAPI spec for the API will be handled in a separate PR
- All the missing unit tests will be added as a followup PR

### Testing

The `integration_assistant` plugin will be disabled by default while
it's being implemented so we can iterate and merge partial PRs without
interfering with the releases. This config will work as our feature
flag:


6aefd4ff7b/x-pack/plugins/integration_assistant/server/config.ts (L11-L13)

To test it add this to your _kibana.dev.yml_:
```
xpack.integration_assistant.enabled: true
```

### Checklist

Delete any items that are not applicable to this PR.

- [x]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios

### Risk Matrix

Delete this section if it is not applicable to this PR.

Before closing this PR, invite QA, stakeholders, and other developers to
identify risks that should be tested prior to the change/feature
release.

When forming the risk matrix, consider some of the following examples
and how they may potentially impact the change:

| Risk | Probability | Severity | Mitigation/Notes |

|---------------------------|-------------|----------|-------------------------|
| Multiple Spaces&mdash;unexpected behavior in non-default Kibana Space.
| Low | High | Integration tests will verify that all features are still
supported in non-default Kibana Space and when user switches between
spaces. |
| Multiple nodes&mdash;Elasticsearch polling might have race conditions
when multiple Kibana nodes are polling for the same tasks. | High | Low
| Tasks are idempotent, so executing them multiple times will not result
in logical error, but will degrade performance. To test for this case we
add plenty of unit tests around this logic and document manual testing
procedure. |
| Code should gracefully handle cases when feature X or plugin Y are
disabled. | Medium | High | Unit tests will verify that any feature flag
or plugin combination still results in our service operational. |
| [See more potential risk
examples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx) |


### For maintainers

- [ ] This was checked for breaking API changes and was [labeled
appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

---------

Co-authored-by: Patryk Kopycinski <contact@patrykkopycinski.com>
Co-authored-by: Sergi Massaneda <sergi.massaneda@elastic.co>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Bharat Pasupula <saibharatchandra.pasupula@elastic.co>
Co-authored-by: Bharat Pasupula <123897612+bhapas@users.noreply.github.com>
2024-06-13 16:48:36 -06:00
Christos Nasikas
75f3af5711
[ResponseOps][Connectors] Add support of additional fields for ServiceNow ITSM and SecOps (#184023)
## Summary

This PR adds support for additional fields for the ServiceNow ITSM and
SecOps connector. The additional fields will not be available to the
recovered action.

<img width="607" alt="Screenshot 2024-05-27 at 6 29 26 PM"
src="7d397d7b-2b0b-4399-8d3a-0725ad04a10d">

## Testing

Verify that:

1. Existing rules with ITSM and SecOps configured continue working as
expected.
2. Can create rules with an ITSM action and set some additional fields
supported by ITSM. You can find the available in the Elastic
transformation map inside ServiceNow.
3. The "additional fields" verification in the UI is working as
expected.
4. The "additional fields" are not shown when you set a recovered
action.

Fixes: https://github.com/elastic/kibana/issues/183609

### Checklist

Delete any items that are not applicable to this PR.

- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios

### For maintainers

- [x] This was checked for breaking API changes and was [labeled
appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

## Release notes

Pass any field to ServiceNow using the ServiceNow ITSM and SecOps
connectors with a JSON field called "additional fields".

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2024-06-13 03:02:58 -07:00
honeyn303
1ff87eb551
Gemini connector integration (#183668) 2024-06-06 11:52:35 -06:00
Jean-Louis Leysens
dd1864b876
[OAS] Refactor description -> summary (#184651)
## Summary

Per [the OAS docs](https://swagger.io/specification/), they have an info
object with a `summary` and `description` field. This PR refactors the
existing router `description` field to to OAS `summary` (that is how it
has been used) and introduces a "new" `description` field that will be
used for the longer form descriptions.

## Resources
* https://swagger.io/specification/

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: lcawl <lcawley@elastic.co>
2024-06-06 06:49:41 -07:00
Steph Milovic
d9aa9893c6
Connector token client fixes (#184550) 2024-05-31 09:39:54 -06:00
Ersin Erdal
9f12976c82
Mark missing encryption key errors as Framework error (#184424)
Resolves: #180418

This PR marks `Encrypted Saved Objects plugin is missing encryption key`
errors as framework error.
2024-05-30 15:50:59 +02:00
Devin W. Hurley
00c922fae3
[Security Solution] [Detections] Display rule warning when action is disabled but rule ran successfully (#182741)
## Summary

Ref: https://github.com/elastic/security-team/issues/8699


Co-authored-by: Yara Tercero <yctercero@users.noreply.github.com>
Co-authored-by: Vitalii Dmyterko <92328789+vitaliidm@users.noreply.github.com>
2024-05-29 20:05:05 -04:00
Ersin Erdal
5794235d0d
Set validation errors in subaction framework as user errors (#184317)
Resolves: #183867

This PR sets schema validation errors in subaction framework as user
error.

## To validate: 
- Create a connector with subaction. (e.g. IBM Resilient)
- Modify schema validation code to get it throw an error 
```
 action.schema.validate({...subActionParams, foo:'bar'});
```
- Create a rule with that connector. And let it run, there should be a
user error on /`api/task_manager/metrics` API
2024-05-28 20:16:18 +02:00
Patrick Mueller
c7eda998a9
[ResponseOps] add license check for connector execution (#181504)
resolves https://github.com/elastic/response-ops-team/issues/198

## Summary

Ensures that connector execution doesn't occur for connectors that need a higher license than what is currently being used.

## To Verify

The basic idea is to create a > basic license connector in a trial license, and then downgrade the license to basic and see if that connector can still be run. Any connector besides server log and index can be used - those are the only connectors licensed for basic.

Start ES as follows to run with a trial license:

    yarn es snapshot --license trial

Create a connector, and also create an alerting rule which uses the connector, and is arranged to always be active and alert on check intervals (not on status change). Ensure the connector runs when the alert is active, and that you can run it in "test" mode from the connector page.

Then go here, to change your license to basic:

  http://localhost:5601/app/management/stack/license_management

You should now see the following sorts of messages logged by Kibana:

```
[ERROR][plugins.taskManager] Task actions:.email "a0df7b77-b6e5-461e-9699-178d6878f235" failed: Error: Action type .email is disabled because your basic license does not support it. Please upgrade your license.
[WARN ][plugins.alerting.index-threshold] Rule "c6780109-15b8-4816-ba96-266e4ddc482d" skipped scheduling action "gmail" because it is disabled
[ERROR][plugins.actions] Action 'gmail' failed: Action type .email is disabled because your basic license does not support it. Please upgrade your license.
```

When attenpting to "test" the connector, you should see the following result:

```
Test failed to run

The following error was found:
Forbidden
```

(we'll attempt to improve the message later as a follow-up)

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2024-05-28 13:57:50 -04:00
Ying Mao
1e9a2ed689
[Response Ops][Action] Using error source from connector type executors if defined. (#184015)
Resolves https://github.com/elastic/kibana/issues/180419

## Summary

Updates action executor to use error source from errors thrown within
the connector type executor, defaulting to framework error if no error
source is specified.

## To Verify

Modify the server log connector to throw a user error:

```
--- a/x-pack/plugins/stack_connectors/server/connector_types/server_log/index.ts
+++ b/x-pack/plugins/stack_connectors/server/connector_types/server_log/index.ts
@@ -14,6 +14,7 @@ import type {
   ActionTypeExecutorOptions as ConnectorTypeExecutorOptions,
   ActionTypeExecutorResult as ConnectorTypeExecutorResult,
 } from '@kbn/actions-plugin/server/types';
+import { createTaskRunError, TaskErrorSource } from '@kbn/task-manager-plugin/server';
 import {
   AlertingConnectorFeatureId,
   UptimeConnectorFeatureId,
@@ -78,6 +79,7 @@ async function executor(
   execOptions: ServerLogConnectorTypeExecutorOptions
 ): Promise<ConnectorTypeExecutorResult<void>> {
   const { actionId, params, logger } = execOptions;
+  throw createTaskRunError(new Error('fail'), TaskErrorSource.USER);

   const sanitizedMessage = withoutControlCharacters(params.message);
```

Create a rule that will trigger a server log action. Let the action run
and then check the metrics endpoint at
https://localhost:5601/api/task_manager/metrics?reset=false to see that
this error was captured as a user error.

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2024-05-24 09:47:28 -04:00
Lisa Cawley
c86e32c376
[HTTP] Make connector APIs public (#184068) 2024-05-23 09:34:17 -07:00
Alexi Doak
3890189eee
[ResponseOps] Removing usage of scripted_metric within the actions telemetry (#183290)
Resolves https://github.com/elastic/kibana/issues/181850

## Summary
The Elasticsearch team is looking at limiting the usage of
`scripted_metric` within serverless, and this PR updates the telemetry
code that uses scripted_metric within the actions plugin.


### Checklist

- [ ] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios


### To verify
The best way to verify this PR is to verify that the telemetry
functional tests pass. The data should be reported the same as it was
before this change.

Here are the list of fields that were calculated using
`scripted_metric`:
- count_total
- count_by_type
- count_gen_ai_provider_types
- count_active_total
- count_active_by_type
-  count_actions_executions_per_day
- count_actions_executions_by_type_per_day
- count_actions_executions_failed_per_day
- count_actions_executions_failed_by_type_per_day

If you'd like to run the telemetry locally:
- Create a couple of rules with different actions
- Change actions telemetry task
[schedule](https://github.com/elastic/kibana/blob/main/x-pack/plugins/actions/server/usage/task.ts#L22)
interval 1 min
- Run [Telemetry usage payload
API](https://docs.elastic.dev/telemetry/collection/snapshot-telemetry#telemetry-usage-payload-api)
in your browser console to verify the telemetry data looks the same
2024-05-22 10:58:36 -07:00
Christos Nasikas
4b7d014582
Change all connectors to use the basic auth header instead of the auth property of axios (#183162)
## Summary

Fixes: https://github.com/elastic/kibana/issues/182391

## Framework changes

- Utils to construct basic header from username and password: [`fad6bde`
(#183162)](fad6bde6af),
[`b10d103`
(#183162)](b10d103bd9)
- Automatically convert `auth` to basic auth header in the sub-actions
framework: [`ee27353`
(#183162)](ee27353051)
- Automatically convert `auth` to basic auth header in axios utils:
[`94753a7`
(#183162)](94753a7342)

## Jira

Commit: [`c366163`
(#183162)](c366163486)

## All ServiceNow connectors

Commit: [`4324d93`
(#183162)](4324d931f7)

## IBM Resilient

IBM Resilient already uses the basic auth headers. PR
https://github.com/elastic/kibana/pull/180561 added this functionality.
The connector was manually tested when reviewing the PR.

In [`7d9edab`
(#183162)](7d9edabd6e)
I updated the connector to use the new util function.

## Webhook

Commit: [`1a62c77`
(#183162)](1a62c77d46)

## Cases webhook

Commit: [`104f881`
(#183162)](104f881251)

## xMatters

Commit: [`ea7be2b`
(#183162)](ea7be2bbee)

## Connectors that do not use the `axios` `auth` property

- D3Security
- Email
- Microsoft Teams
- OpenAI
- Opsgenie
- PagerDuty
- Sentinel One
- Slack
- Slack API
- Swimlane
- Tines
- Torq

### Checklist

Delete any items that are not applicable to this PR.

- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed

### Risk Matrix

Delete this section if it is not applicable to this PR.

Before closing this PR, invite QA, stakeholders, and other developers to
identify risks that should be tested prior to the change/feature
release.

When forming the risk matrix, consider some of the following examples
and how they may potentially impact the change:

| Risk | Probability | Severity | Mitigation/Notes |

|---------------------------|-------------|----------|-------------------------|
| Connectors not working correctly | Low | High | Unit test and manual
testing of all connectors affected |


### For maintainers

- [x] This was checked for breaking API changes and was [labeled
appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

---------

Co-authored-by: “jeramysoucy” <jeramy.soucy@elastic.co>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2024-05-17 04:18:01 -07:00
Lisa Cawley
8dcd5fd557
[OAS] Fix examples in Webhook - Case Management connector (#182311) 2024-05-09 13:15:22 -07:00
Jean-Louis Leysens
1e80b0114e
[HTTP/OAS] Added response schemas for /api/status (#181277)
## Summary

Part https://github.com/elastic/kibana/issues/180056. Adds new response
schemas to the `/api/status` endpoint for the purposes of OAS
generation.

## How to test

1. Start ES
2. Add `server.oas.enabled: true` to `kibana.dev.yml`
3. Start Kibana `yarn start --no-base-path`
4. `curl -s -uelastic:changeme
http://localhost:5601/api/oas\?pathStartsWith\=/api/status | jq`

<details>

<summary>output</summary>

```json
{
  "openapi": "3.0.0",
  "info": {
    "title": "Kibana HTTP APIs",
    "version": "0.0.0"
  },
  "servers": [
    {
      "url": "http://localhost:5601"
    }
  ],
  "paths": {
    "/api/status": {
      "get": {
        "summary": "Get Kibana's current status.",
        "responses": {
          "200": {
            "description": "Get Kibana's current status.",
            "content": {
              "application/json; Elastic-Api-Version=2023-10-31": {
                "schema": {
                  "description": "Kibana's operational status. A minimal response is sent for unauthorized users.",
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/core.status.response"
                    },
                    {
                      "$ref": "#/components/schemas/core.status.redactedResponse"
                    }
                  ]
                }
              }
            }
          },
          "503": {
            "description": "Get Kibana's current status.",
            "content": {
              "application/json; Elastic-Api-Version=2023-10-31": {
                "schema": {
                  "description": "Kibana's operational status. A minimal response is sent for unauthorized users.",
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/core.status.response"
                    },
                    {
                      "$ref": "#/components/schemas/core.status.redactedResponse"
                    }
                  ]
                }
              }
            }
          }
        },
        "parameters": [
          {
            "in": "header",
            "name": "elastic-api-version",
            "description": "The version of the API to use",
            "schema": {
              "type": "string",
              "enum": [
                "2023-10-31"
              ],
              "default": "2023-10-31"
            }
          },
          {
            "name": "v7format",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean"
            },
            "description": "Set to \"true\" to get the response in v7 format."
          },
          {
            "name": "v8format",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean"
            },
            "description": "Set to \"true\" to get the response in v8 format."
          }
        ],
        "operationId": "/api/status#0"
      }
    }
  },
  "components": {
    "schemas": {
      "core.status.response": {
        "description": "Kibana's operational status as well as a detailed breakdown of plugin statuses indication of various loads (like event loop utilization and network traffic) at time of request.",
        "type": "object",
        "properties": {
          "name": {
            "description": "Kibana instance name.",
            "type": "string"
          },
          "uuid": {
            "description": "Unique, generated Kibana instance UUID. This UUID should persist even if the Kibana process restarts.",
            "type": "string"
          },
          "version": {
            "type": "object",
            "properties": {
              "number": {
                "description": "A semantic version number.",
                "type": "string"
              },
              "build_hash": {
                "description": "A unique hash value representing the git commit of this Kibana build.",
                "type": "string"
              },
              "build_number": {
                "description": "A monotonically increasing number, each subsequent build will have a higher number.",
                "type": "number"
              },
              "build_snapshot": {
                "description": "Whether this build is a snapshot build.",
                "type": "boolean"
              },
              "build_flavor": {
                "description": "The build flavour determines configuration and behavior of Kibana. On premise users will almost always run the \"traditional\" flavour, while other flavours are reserved for Elastic-specific use cases.",
                "anyOf": [
                  {
                    "enum": [
                      "serverless"
                    ],
                    "type": "string"
                  },
                  {
                    "enum": [
                      "traditional"
                    ],
                    "type": "string"
                  }
                ]
              },
              "build_date": {
                "description": "The date and time of this build.",
                "type": "string"
              }
            },
            "additionalProperties": false,
            "required": [
              "number",
              "build_hash",
              "build_number",
              "build_snapshot",
              "build_flavor",
              "build_date"
            ]
          },
          "status": {
            "type": "object",
            "properties": {
              "overall": {
                "type": "object",
                "properties": {
                  "level": {
                    "description": "Service status levels as human and machine readable values.",
                    "anyOf": [
                      {
                        "enum": [
                          "available"
                        ],
                        "type": "string"
                      },
                      {
                        "enum": [
                          "degraded"
                        ],
                        "type": "string"
                      },
                      {
                        "enum": [
                          "unavailable"
                        ],
                        "type": "string"
                      },
                      {
                        "enum": [
                          "critical"
                        ],
                        "type": "string"
                      }
                    ]
                  },
                  "summary": {
                    "description": "A human readable summary of the service status.",
                    "type": "string"
                  },
                  "detail": {
                    "description": "Human readable detail of the service status.",
                    "type": "string"
                  },
                  "documentationUrl": {
                    "description": "A URL to further documentation regarding this service.",
                    "type": "string"
                  },
                  "meta": {
                    "description": "An unstructured set of extra metadata about this service.",
                    "type": "object",
                    "additionalProperties": {}
                  }
                },
                "additionalProperties": false,
                "required": [
                  "level",
                  "summary",
                  "meta"
                ]
              },
              "core": {
                "description": "Statuses of core Kibana services.",
                "type": "object",
                "properties": {
                  "elasticsearch": {
                    "type": "object",
                    "properties": {
                      "level": {
                        "description": "Service status levels as human and machine readable values.",
                        "anyOf": [
                          {
                            "enum": [
                              "available"
                            ],
                            "type": "string"
                          },
                          {
                            "enum": [
                              "degraded"
                            ],
                            "type": "string"
                          },
                          {
                            "enum": [
                              "unavailable"
                            ],
                            "type": "string"
                          },
                          {
                            "enum": [
                              "critical"
                            ],
                            "type": "string"
                          }
                        ]
                      },
                      "summary": {
                        "description": "A human readable summary of the service status.",
                        "type": "string"
                      },
                      "detail": {
                        "description": "Human readable detail of the service status.",
                        "type": "string"
                      },
                      "documentationUrl": {
                        "description": "A URL to further documentation regarding this service.",
                        "type": "string"
                      },
                      "meta": {
                        "description": "An unstructured set of extra metadata about this service.",
                        "type": "object",
                        "additionalProperties": {}
                      }
                    },
                    "additionalProperties": false,
                    "required": [
                      "level",
                      "summary",
                      "meta"
                    ]
                  },
                  "savedObjects": {
                    "type": "object",
                    "properties": {
                      "level": {
                        "description": "Service status levels as human and machine readable values.",
                        "anyOf": [
                          {
                            "enum": [
                              "available"
                            ],
                            "type": "string"
                          },
                          {
                            "enum": [
                              "degraded"
                            ],
                            "type": "string"
                          },
                          {
                            "enum": [
                              "unavailable"
                            ],
                            "type": "string"
                          },
                          {
                            "enum": [
                              "critical"
                            ],
                            "type": "string"
                          }
                        ]
                      },
                      "summary": {
                        "description": "A human readable summary of the service status.",
                        "type": "string"
                      },
                      "detail": {
                        "description": "Human readable detail of the service status.",
                        "type": "string"
                      },
                      "documentationUrl": {
                        "description": "A URL to further documentation regarding this service.",
                        "type": "string"
                      },
                      "meta": {
                        "description": "An unstructured set of extra metadata about this service.",
                        "type": "object",
                        "additionalProperties": {}
                      }
                    },
                    "additionalProperties": false,
                    "required": [
                      "level",
                      "summary",
                      "meta"
                    ]
                  }
                },
                "additionalProperties": false,
                "required": [
                  "elasticsearch",
                  "savedObjects"
                ]
              },
              "plugins": {
                "description": "A dynamic mapping of plugin ID to plugin status.",
                "type": "object",
                "additionalProperties": {
                  "type": "object",
                  "properties": {
                    "level": {
                      "description": "Service status levels as human and machine readable values.",
                      "anyOf": [
                        {
                          "enum": [
                            "available"
                          ],
                          "type": "string"
                        },
                        {
                          "enum": [
                            "degraded"
                          ],
                          "type": "string"
                        },
                        {
                          "enum": [
                            "unavailable"
                          ],
                          "type": "string"
                        },
                        {
                          "enum": [
                            "critical"
                          ],
                          "type": "string"
                        }
                      ]
                    },
                    "summary": {
                      "description": "A human readable summary of the service status.",
                      "type": "string"
                    },
                    "detail": {
                      "description": "Human readable detail of the service status.",
                      "type": "string"
                    },
                    "documentationUrl": {
                      "description": "A URL to further documentation regarding this service.",
                      "type": "string"
                    },
                    "meta": {
                      "description": "An unstructured set of extra metadata about this service.",
                      "type": "object",
                      "additionalProperties": {}
                    }
                  },
                  "additionalProperties": false,
                  "required": [
                    "level",
                    "summary",
                    "meta"
                  ]
                }
              }
            },
            "additionalProperties": false,
            "required": [
              "overall",
              "core",
              "plugins"
            ]
          },
          "metrics": {
            "description": "Metric groups collected by Kibana.",
            "type": "object",
            "properties": {
              "elasticsearch_client": {
                "description": "Current network metrics of Kibana's Elasticsearch client.",
                "type": "object",
                "properties": {
                  "totalActiveSockets": {
                    "description": "Count of network sockets currently in use.",
                    "type": "number"
                  },
                  "totalIdleSockets": {
                    "description": "Count of network sockets currently idle.",
                    "type": "number"
                  },
                  "totalQueuedRequests": {
                    "description": "Count of requests not yet assigned to sockets.",
                    "type": "number"
                  }
                },
                "additionalProperties": false,
                "required": [
                  "totalActiveSockets",
                  "totalIdleSockets",
                  "totalQueuedRequests"
                ]
              },
              "last_updated": {
                "description": "The time metrics were collected.",
                "type": "string"
              },
              "collection_interval_in_millis": {
                "description": "The interval at which metrics should be collected.",
                "type": "number"
              }
            },
            "additionalProperties": false,
            "required": [
              "elasticsearch_client",
              "last_updated",
              "collection_interval_in_millis"
            ]
          }
        },
        "additionalProperties": false,
        "required": [
          "name",
          "uuid",
          "version",
          "status",
          "metrics"
        ]
      },
      "core.status.redactedResponse": {
        "description": "A minimal representation of Kibana's operational status.",
        "type": "object",
        "properties": {
          "status": {
            "type": "object",
            "properties": {
              "overall": {
                "type": "object",
                "properties": {
                  "level": {
                    "description": "Service status levels as human and machine readable values.",
                    "anyOf": [
                      {
                        "enum": [
                          "available"
                        ],
                        "type": "string"
                      },
                      {
                        "enum": [
                          "degraded"
                        ],
                        "type": "string"
                      },
                      {
                        "enum": [
                          "unavailable"
                        ],
                        "type": "string"
                      },
                      {
                        "enum": [
                          "critical"
                        ],
                        "type": "string"
                      }
                    ]
                  }
                },
                "additionalProperties": false,
                "required": [
                  "level"
                ]
              }
            },
            "additionalProperties": false,
            "required": [
              "overall"
            ]
          }
        },
        "additionalProperties": false,
        "required": [
          "status"
        ]
      }
    },
    "securitySchemes": {
      "basicAuth": {
        "type": "http",
        "scheme": "basic"
      },
      "apiKeyAuth": {
        "type": "apiKey",
        "in": "header",
        "name": "Authorization"
      }
    }
  },
  "security": [
    {
      "basicAuth": []
    }
  ]
}
```

</details>

Related to https://github.com/elastic/kibana/pull/181622

## Notes

* Tip from @lcawl : "If you want to see Bump previews of your files too,
I’ve been doing it via the preview command per
https://docs.bump.sh/help/continuous-integration/cli/#bump-preview-file"
2024-05-07 10:28:33 +02:00
Alejandro Fernández Haro
593d391172
Add @typescript-eslint/no-floating-promises (#181456)
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Aleh Zasypkin <aleh.zasypkin@elastic.co>
Co-authored-by: Patrick Mueller <patrick.mueller@elastic.co>
2024-05-01 08:41:31 -07:00
Janki Salvi
b3f7c5cf0d
[Cases] Update IBM resilient connector to use sub action framework (#180561)
## Summary

Fixes https://github.com/elastic/response-ops-team/issues/186
This PR updates IBM resilient connector to use CaseConnector of sub
action framework.

### Steps to verify
Expectation: IBM connector should work as before in all below scenarios:
- Create an IBM resilient connector
- Test the connector
- Create an alert and use this connector as action
- Use this connector in Cases

### Flaky test runner
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/5667

### Checklist

Delete any items that are not applicable to this PR.

- [x] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)
- [ ]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [x] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2024-04-25 08:40:58 +02:00
Christos Nasikas
42fa118b7d
[Cases] Populate user info from fake requests (#180671)
## Summary

Set a system user name when the request is fake. This is helpful to show
user information to the case created by the case action.

## Testing

1. Create a rule with a case action
2. In the created case verify that the `elastic/kibana` user is shown
and not the `Unknown` user

<img width="2297" alt="Screenshot 2024-04-22 at 10 37 46 PM"
src="abfcec4c-f2a4-4663-84e0-1816ada69167">


### Checklist

Delete any items that are not applicable to this PR.

- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios

### For maintainers

- [x] This was checked for breaking API changes and was [labeled
appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2024-04-24 16:38:24 +03:00
Janki Salvi
1ab7a2cbed
[Cases] Update case connector framework to use generic types (#181059)
## Summary

This PR addresses comments mentioned in
[here](https://github.com/elastic/kibana/pull/180561#issuecomment-2058751525)

It fixes CaseConnector bugs by updating its methods to use generic types
for params and response.

### Checklist

- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2024-04-23 02:45:47 -07:00
Steph Milovic
5c39f1b552
[GenAI Connectors] Add optional timeout parameter to GenAI connectors (#181207) 2024-04-22 19:00:27 -07:00
Kevin Lacabane
e8fe9dbd1d
[Obs AI Assistant] move rule connector to observability_ai_assistant_app (#180949)
## Summary

Resolves https://github.com/elastic/kibana/issues/180910

This change simply moves the rule_connector introduced in
https://github.com/elastic/kibana/pull/179980 to the
`observability_ai_assistant_app` plugin. There are not functional
changes.
Also added some unit tests

### Testing
See testing section in https://github.com/elastic/kibana/pull/179980

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2024-04-22 15:01:24 +02:00
Tomasz Ciecierski
b66be1f69b
[EDR Workflows] Add Crowdstrike connector and Actions (#180175) 2024-04-17 11:51:19 -07:00
Steph Milovic
7bd8815301
[GenAI Connectors] Fix AbortSignal implementation (#180855)
## Bugs Fixed

1. The OpenAI `invokeAI` method did not properly handle `signal`
2. Bedrock did not have a `signal` implementation at all 😳

## Summary

In my [LangChain streaming
PR](https://github.com/elastic/kibana/pull/174126), I poorly implemented
a fix to stop the stream on the server when "Stop generating..." was hit
on the client. I did this by piping through an `AbortSignal` to
`invokeStream`/`invokeAsyncIterator` subactions. However, in the
`invokeAI` subaction I did not properly remove `signal` before
`JSON.strinigfy`ing the body, so the below error was happening in the
security non-streaming implementation. Additionally, for Bedrock I
somehow only implemented `signal` in part of the type and nothing else,
so token tracking would be off when Stop generating button is hit 🤦

<img width="1376" alt="Screenshot 2024-04-15 at 2 00 38 PM"
src="e57241d9-9fd2-4dd3-bb3a-72a7c61a3d4b">


## To test

1. Turn off streaming in the Security AI Assistant and select an OpenAI
connector (LangChain off)
3. Send a message
4. Ensure expected results (prior the above error would occur)

The test of the Bedrock connector will be harder to confirm. Where the
issue would show up would be subtle, in the token counter. Before I
implemented the signal in the Bedrock connector, if you ask Bedrock to
repeat a word 100 times with streaming enabled, and then hit "Stop
generating..." after 10 words, you would see a token count for
`completion_tokens` be equivalent to ~100 tokens as the full response
would have "streamed" on the server. After this bug fix, if you hit
"Stop generating..." after 10 words, you will see a token count for
`completion_tokens` be equivalent to ~15 tokens as it takes a second for
the `abort()` to reach the server. To be clear, this bug would not have
shown in persistent storage because we call abort in
`handleStreamStorage` ASAP instead of relying on axios to complete its
abort.
2024-04-16 13:23:14 -06:00
Paul Tavares
28d71486ab
[Connectors] Add support to SentinelOne connector for Security Solution get-file response action (#180637)
## Summary

Changes done in SentinelOne connector in support of Security Solution
`get-file` response action (forthcoming):

- Added `fetchAgentFiles()` sub-action
- Added `downloadAgentFile()` sub-action
- Added `getActivities()` sub-action
- Improved error messages for SentinelOne API failures
- Added `logger.debug()` to Sub-Actions connector `validateResponse()`
to output data that failed validation
2024-04-16 14:43:46 -04:00
Kevin Lacabane
66587d8940
[Obs AI Assistant] ai assistant system connector (#179980)
## Summary

Creates a system connector that can call the observability ai assistant
to execute actions on behalf of user. The connector is tagged as tech
preview.

The connector can be triggered when an alert fires. Connector can be
configured with an initial message to the assistant which generates an
answer and triggers potential actions on the assistant side. The current
experimental scenario is to ask the assistant to generate a report of
the alert that fired (by initially providing some context in the first
message), recalling any information/potential resolutions of previous
occurrences stored in the knowledge base and also including other active
alerts that may be related. One last step that can be asked to the
assistant is to trigger an action, currently only sending the report (or
any other message) to a preconfigured slack webhook is supported.

## Testing
_Note: when asked to send a message to another connector (in our case
slack), we'll try to include a link to the generated conversation. It is
only possible to generate this link if
[server.publicBaseUrl](https://www.elastic.co/guide/en/kibana/current/settings.html#server-publicBaseUrl)
is correctly set in kibana settings._

- Create a slack webhook connector
- Get slack webhook. I can share one and invite you to the workspace, or
if you want to create one:
    - create personal workspace at https://slack.com/signin#workspaces
    - create an app for that workspace at https://api.slack.com/apps
- under Features > OAuth & Permissions > Scopes > Bot Token Scopes, add
`incoming-webhook` permission
    - install the app
    - webhook url is available under Features > Incoming Webhooks
- Create a rule that can be triggered with available documents and
attach observability AI assistant connector. (I use `Error Count
Threshold` and generate errors via `node scripts/synthtrace
many_errors.ts --live`)
- configure the connector with one genai connector and a message with
instructions. Example:
```
High error count alert has triggered. Execute the following steps:
  - create a graph of the error count for the service impacted by the alert for the last 24h
  - to help troubleshoot recall past occurrences of this alarm, also any other active alerts. Generate a report with all the found informations and send it to slack connector as a single message. Also include the link to this conversation in the report
```
- Track alert status and verify connector was executed. You should get a
slack notification sent by the assistant, and a new conversation will be
stored

TODO
- unit/integration tests - see
https://github.com/elastic/kibana/pull/168369 for reference
implementation
- documentation

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Dario Gieselaar <dario.gieselaar@elastic.co>
2024-04-15 22:22:06 +02:00
Christos Nasikas
b735d8c569
[Cases] Case action (#168369)
## Summary

Depends on: https://github.com/elastic/kibana/pull/166267,
https://github.com/elastic/kibana/pull/170326,
https://github.com/elastic/kibana/pull/169484,
https://github.com/elastic/kibana/pull/173740,
https://github.com/elastic/kibana/pull/173763,
https://github.com/elastic/kibana/pull/178068,
https://github.com/elastic/kibana/pull/178307,
https://github.com/elastic/kibana/pull/178600,
https://github.com/elastic/kibana/pull/180437

PRs:
- https://github.com/elastic/kibana/pull/168370
- https://github.com/elastic/kibana/pull/169229
- https://github.com/elastic/kibana/pull/171754
- https://github.com/elastic/kibana/pull/172709
- https://github.com/elastic/kibana/pull/173012
- https://github.com/elastic/kibana/pull/175107
- https://github.com/elastic/kibana/pull/175452
- https://github.com/elastic/kibana/pull/175505
- https://github.com/elastic/kibana/pull/177033
- https://github.com/elastic/kibana/pull/178277
- https://github.com/elastic/kibana/pull/177139
- https://github.com/elastic/kibana/pull/179796

Fixes: https://github.com/elastic/kibana/issues/153837

## Testing

Run Kibana with `--run-examples` if you want to use the "Always firing"
rule.

Create a rule with a case action in observability and the stack. The
security solution is not supported. You should not be able to assign a
case action in a security solution rule.

1. Test the "Reopen closed cases" configuration.
2. Test the "Grouping by" configuration. Only one field is allowed. Not
all fields are persisted in alerts. If you select a field not part of
the alert the case action will create a case where the grouping value is
set to `unknow`.
3. Test the "Time window" feature. You can comment out the validation to
test for shorter times.
4. Verify that the case action is experimental.
5. Verify that based on the rule type the case is created in the correct
solution.
6. Verify that you cannot create a rule with the case action on the
basic license.
7. Verify that the execution of the case action fails if you do not have
permission for cases. Pending work on the system actions framework level
to not allow users to create rules with system actions where they do not
have permission.
8. Stress test the case action by creating multiple rules.

### Checklist

Delete any items that are not applicable to this PR.

- [x]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios

### For maintainers

- [x] This was checked for breaking API changes and was [labeled
appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

## Release notes

Automatically create cases when an alert is triggered.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: adcoelho <antonio.coelho@elastic.co>
Co-authored-by: Janki Salvi <117571355+js-jankisalvi@users.noreply.github.com>
2024-04-12 12:01:17 +03:00
Jean-Louis Leysens
5336a237db
[HTTP/OAS] Prepare @kbn/config-schema for generating OAS (#180184)
## Summary

Introduces a set of meta fields that will be used to track metadata lost
in how we currently use `joi` inside of `@kbn/config-schema`.

## Notes

* Related https://github.com/elastic/kibana/issues/180056
* Changes cherry-picked from
https://github.com/elastic/kibana/pull/156357
* Changes are not used for anything in this PR, they are intended to
enable our OAS generation scripts
2024-04-09 07:22:10 -07:00
Yan Savitski
56fe25ddc7
Add connectors support for playground (#179676)
## Summary

- Add connectors flyout to playground
- Add set up gen-ai panel
- Create feature connector id
- Use encrypted objects on the server
- Use management Locator for navigating to connectors management
- Pass dependencies to embeddable app

<img width="397" alt="image"
src="499797f9-1dfa-4806-a364-32d2533945cd">
<img width="1004" alt="image"
src="3171be7c-b3f7-4c8e-99ff-0d81c7b2b9c9">

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2024-04-08 15:58:34 -07:00
Lisa Cawley
be980dff28
[DOCS] Add custom fields to Jira connectors (#180007) 2024-04-05 10:04:07 -07:00
Ersin Erdal
2005cefab5
Remove secrets from the connectors before validating in actionsClient getAll (#179837)
Fixes: #179480

## To verify:
Please follow the steps described in the issue.
2024-04-05 18:26:46 +02:00