Commit graph

125 commits

Author SHA1 Message Date
Cee Chen
a88cfc825d
Upgrade EUI to v95.9.0 (#190752)
`v95.7.0`  `v95.9.0`

> [!CAUTION]
> This PR contains the final set of Emotion conversions for all EuiForm
components.
> If your plugin contains any custom CSS/styling to **EuiFormRow,
EuiFormControlLayout, EuiCheckbox, EuiRadio, or EuiSwitch**, ⚠️ make
sure to QA your UI to ensure no visual regressions have occurred! ⚠️

---

## [`v95.9.0`](https://github.com/elastic/eui/releases/v95.9.0)

- Updated `EuiSearchBar`'s optional `box.schema` prop with a new
`recognizedFields` configuration. This allows specifying the phrases
that will be parsed as field clauses
([#7960](https://github.com/elastic/eui/pull/7960))
- Updated `EuiIcon` with a new `tokenSemanticText` glyph
([#7971](https://github.com/elastic/eui/pull/7971))
- Added support for TypeScript 5
([#7980](https://github.com/elastic/eui/pull/7980))

**Bug fixes**

- Fixed `EuiSelectableTemplateSitewide` styles when used within a
dark-themed `EuiHeader`
([#7977](https://github.com/elastic/eui/pull/7977))

## [`v95.8.0`](https://github.com/elastic/eui/releases/v95.8.0)

- Updated `EuiHeaderLinks`'s mobile menu to set a slight popover padding
by default ([#7961](https://github.com/elastic/eui/pull/7961))
- This can be overridden via `popoverProps.panelPaddingSize` if needed.
- Updated `EuiHeaderLink` to default to a size of `s` (down from `m`)
([#7961](https://github.com/elastic/eui/pull/7961))

**Accessibility**

- Updated the `aria-label` attribute for the `EuiFieldSearch` clear
button ([#7970](https://github.com/elastic/eui/pull/7970))

**Bug fixes**

- Fixed a visual bug with `<EuiDualRange showInput="inputWithPopover"
/>` form controls ([#7957](https://github.com/elastic/eui/pull/7957))

**Deprecations**

- Deprecated `EuiFormRow`'s `columnCompressedSwitch` display prop. Use
`columnCompressed` instead, which will automatically account for child
`EuiSwitch`es ([#7968](https://github.com/elastic/eui/pull/7968))
- Deprecated `EuiFormRow`'s `rowCompressed` display prop. Use `row`
instead for vertical forms, or `centerCompressed` for inline forms
([#7968](https://github.com/elastic/eui/pull/7968))
- (Styling) Updated `EuiFormRow`'s `hasEmptySpaceLabel` prop to no
longer attempt to automatically align its content to a vertical center.
Use the `display="center"` prop for that instead
([#7968](https://github.com/elastic/eui/pull/7968))

**CSS-in-JS conversions**

- Converted `EuiFormControlLayout` to Emotion
([#7954](https://github.com/elastic/eui/pull/7954))
- Removed `.euiFormControlLayout--*icons` classNames and
`--eui-form-control-layout-icons-padding` CSS var. Use
`--euiFormControlRightIconsCount` or `--euiFormControlLeftIconsCount`
instead
- Converted `EuiFormLayoutDelimited` to Emotion
([#7957](https://github.com/elastic/eui/pull/7957))
- Fixed `cloneElementWithCss` throwing an error when used multiple times
without a `key` prop ([#7957](https://github.com/elastic/eui/pull/7957))
- Updated `cloneElementWithCss` utility to support a third argument that
allows prepending vs. appending the cloned Emotion css className
([#7957](https://github.com/elastic/eui/pull/7957))
- Removed `@euiFormControlLayoutClearIcon` Sass mixin
([#7959](https://github.com/elastic/eui/pull/7959))
- Converted `EuiDescribedFormGroup` to Emotion
([#7964](https://github.com/elastic/eui/pull/7964))
- Converted `EuiForm`, `EuiFormHelpText`, and `EuiFormErrorText` to
Emotion ([#7966](https://github.com/elastic/eui/pull/7966))
- Converted `EuiFormLabel` and `EuiFormLegend` to Emotion; Removed
`@euiFormLabel` mixin
([#7967](https://github.com/elastic/eui/pull/7967))
- Converted `EuiFormRow` to Emotion
([#7968](https://github.com/elastic/eui/pull/7968))
- Converted `EuiCheckbox` to Emotion
([#7969](https://github.com/elastic/eui/pull/7969))
- Converted `EuiRadio` to Emotion
([#7969](https://github.com/elastic/eui/pull/7969))
- Converted `EuiSwitch` to Emotion
([#7969](https://github.com/elastic/eui/pull/7969))
- Removed the following Sass variables:
([#7969](https://github.com/elastic/eui/pull/7969))
  - `$euiFormCustomControlDisabledIconColor`
  - `$euiFormCustomControlBorderColor`
  - `$euiRadioSize`
  - `$euiCheckBoxSize`
  - `$euiCheckboxBorderRadius`
  - `$euiSwitchHeight` (and compressed/mini variants)
  - `$euiSwitchWidth` (and compressed/mini variants)
  - `$euiSwitchThumbSize` (and compressed/mini variants)
  - `$euiSwitchIconHeight`
  - `$euiSwitchOffColor`
- Removed the following Sass mixins:
([#7969](https://github.com/elastic/eui/pull/7969))
  - `euiIconBackground`
  - `euiCustomControl`
  - `euiCustomControlSelected`
  - `euiCustomControlDisabled`
  - `euiCustomControlFocused`

---------

Co-authored-by: Marta Bondyra <4283304+mbondyra@users.noreply.github.com>
2024-08-30 17:47:17 -07:00
Candace Park
d85069292c
[Security Solution][Event Filters] Fix autocomplete infinite loop bug when deleting the field combobox in event filters form (#189980)
## Summary
- [x] Fixes a bug where the user would not be able to clear out the
Field combo box in the Event Filters form
- [x] Adds a clear out button to the field combo box

Testing steps:
- Navigate to Security > Manage > Event Filters > Add event filter
- Fill out the Field and Value section and select out of the builder
- Try to clear out field either by backspacing the selection or with the
`x` button
- Successfully clear out the field 

# Screenshots

![infinitebug](https://github.com/user-attachments/assets/05c40764-ea93-4650-8273-7212d78889c2)

---------

Co-authored-by: Tomasz Ciecierski <tomasz.ciecierski@elastic.co>
Co-authored-by: Ashokaditya <ashokaditya@elastic.co>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2024-08-29 20:31:11 -05:00
Candace Park
e767ef47d3
[Security Solution][Endpoint Exceptions] Wildcard warning with IS operator for endpoint exceptions creation/editing (#182903)
## Summary

- [x] Adds a warning message under the value, a callout and a
confirmation warning modal to endpoint exceptions if an entry contains
the "IS" operator with a wildcard value
- [x] Unit Tests

# Screenshots

![image](d28b093f-77a1-4266-865f-657826879d0c)

![image](70646034-73eb-4f7b-a84b-afaf4d32561c)

---------

Co-authored-by: Vitalii Dmyterko <92328789+vitaliidm@users.noreply.github.com>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2024-06-11 15:03:02 -07:00
Patryk Kopyciński
0780c19322
Add explicit children types (#181257)
## Summary

Prep work for React@18 bump

tl;dr In React@18 `React.FC` doesn't contain `children` anymore, so in
order to make the bump easier I have decided to split the effort in
multiple faces and hopefully this will make it easier for everyone

This PR focuses only on adding explicit `children` declaration either by
using `React.PropsWithChildren` type or by adding `children:
React.ReactNode` to the existing props types

https://github.com/DefinitelyTyped/DefinitelyTyped/issues/46691

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Sergi Massaneda <sergi.massaneda@gmail.com>
Co-authored-by: Marco Vettorello <marco.vettorello@elastic.co>
Co-authored-by: James Gowdy <jgowdy@elastic.co>
2024-04-29 16:56:41 +01:00
Candace Park
47c7174bff
[Security Solution][Admin][Event Filters] Wildcard warning with IS operator for event filters creation/editing (#178440)
## Summary

- [x] Adds updated warning messaging for trusted apps entries that use
wildcards `*?` with the "IS" operator
- [x] Three different warnings: callout, individual entry item warnings
and a final confirmation modal when the user tries to add an event
filter with ineffective IS / wildcard combination entry.
- [x] Unit tests
- [x] Fixes bug in endpoint exceptions where there is a missing tooltip
icon for the wildcard performance warning

# Screenshots

![image](fd960261-66cc-44f2-b437-bbd9bd3809ab)

![image](da580273-740c-49db-bef9-d79fe0f0ca35)

Bug Fix

![image](8ebbfd83-4286-4ac1-a858-0d390fbfd4b6)
2024-04-16 09:59:02 -07:00
Khristinin Nikita
35dc121c95
Value lists modal window (#179339)
##  Value List Items Modal Window

Experimental flag: **valueListItemsModal**

it's temporarily true and will be set to false, before merge


2aafe007-734f-4c0e-b542-5eca229e310d

Added a new modal window that lets users interact with value lists
directly. This modal supports viewing, searching, adding, deleting,
updating, and uploading items.

Where to find the modal window:
- Value list popup
- Exception editing and viewing on both the rule page and shared
exceptions management page
Permissions:

Add, edit, delete, and upload buttons are hidden for read-only users.
The modal link is not shown to users without read permissions.


### Changes to API
I added optional **refresh** flag for list items API, because we want to
see the changes in UI, when editing list items

### How to review

All new components is here -
`x-pack/plugins/security_solution/public/value_list/`
New hooks - `packages/kbn-securitysolution-list-hooks/`
API calls - `packages/kbn-securitysolution-list-api`
Actual API - `x-pack/plugins/lists/server/routes`

There also some props drilling into exceptions package, which is not
ideal, please let me know if you have better ideas

[test plan](https://github.com/elastic/security-team/pull/9128)

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2024-04-15 19:45:52 +02:00
Alexey Antonov
b63c9e2824
fix: [Rules > Add/Edit rule exception][AXE-CORE]: Form elements must have an accessible label (#177923)
Closes: https://github.com/elastic/security-team/issues/8572
Closes: https://github.com/elastic/security-team/issues/8573
Closes: https://github.com/elastic/security-team/issues/8613
Closes: https://github.com/elastic/security-team/issues/8614

## Description

The [axe browser plugin](https://deque.com/axe) is reporting two form
elements without labels in the Create endpoint exception flyout.
Screenshot attached below.

### Steps to recreate

1. Open [Shared Exception
Lists](https://kibana.siem.estc.dev/app/security/exceptions)
2. Click the Create Endpoint Exception button
3. Run an axe browser scan in Chrome, Edge, or Firefox
4. Verify the form label missing errors

### Screens 

#### a11y attributes

<img width="1419" alt="image"
src="61ef3ea1-bd65-46e0-9274-ae9aa329a04d">


#### Axe report

<img width="1419" alt="image"
src="df5ba30c-78f5-4418-b3b6-09a028e1c606">

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Vitalii Dmyterko <92328789+vitaliidm@users.noreply.github.com>
2024-03-06 06:57:42 -07:00
Tiago Costa
86a74a7fea
skip flaky suite (#178026) 2024-03-05 18:36:41 +00:00
Vitalii Dmyterko
3bb38a5718
[Security Solution][Detection Engine] fixes list index requests behaviour (#177416)
## Summary

- while working on https://github.com/elastic/security-team/issues/8589,
discovered list index requests fired when navigating between pages, even
though state of list index is unlikely to change
- fixes case when admin user opens Security for the first time, goes to
multiple pages and can see 409 error of multiple index create requests
- to avoid multiple index requests when user navigates to different
pages, I introduced react-query hooks with `Infinity` mins stale time,
which means, query result would be cached for entire user's session
before page reload or user logout/login.
Downside of this approach, if user does delete list index through API,
they would need to refresh browser page to update index status. But
delete index API is not event documented and its usage would affect
different aspect of the app.
Alternative, might be, to refresh index status when user opens lists
flyout. But given unlike scenario of user using undocumented delete
index API, I think we can skip this refresh call on every flyout open


### Before
#### Multiple lists/index requests


8c82a270-4578-4a98-9be9-1ca3d7b00d17


#### Multiple create index requests and 409 error


a7a1718c-5bb2-4427-9819-f72e98b55a9c


### After

#### Single lists/index request



d5060a31-469c-4fc3-bc40-b6e4d3e65a48

#### No multiple create index requests



3c5cb04f-8b26-47c0-ab79-2fe1c41671dd

---------

Co-authored-by: Ryland Herrick <ryalnd@gmail.com>
2024-03-05 14:10:58 +00:00
Tomasz Kajtoch
b043545208
Upgrade EUI to v91.0.0 (with backports) (#170716)
`v90.0.0``v91.0.0-backport.0`

⚠️ While this upgrade pings many teams and has a large code diff, **the
majority of the changes are snapshots or tests-related** and do not
touch source code, so should theoretically only need a code review and
not dedicated QA.

The changes in EUI that required a large swathe of these updates are:

- **EuiPopover** removed an extra unnecessary `<div>` wrapper on its
anchors, which affected many snapshots and a few CSS overrides, which
should have been updated
- **EuiButtonGroup** now renders `<button>` elements instead of `<input
type="radio">` elements for single selection, which affected both
snapshots and E2E tests
- **EuiSuperDatePicker**'s absolute date input now requires an `Enter`
keypress when parsing dates (affected E2E tests)
- **EuiComboBox**, when rendered with `singleSelection={{ plainText:
'true' }}`, no longer renders a pill (i.e. text). This combobox type now
behaves more like an `EuiFieldText`, where the selection is rendered via
input `value` instead. This affected a high amount of E2E tests (both
FTR and Cypress), both in terms of updating assertions and changing
selections, but should **not** significantly affect user experience -
see https://github.com/elastic/eui/pull/7332 for more.

---

##
[`v91.0.0-backport.0`](https://github.com/elastic/eui/tree/v91.0.0-backport.0)

**This is a backport release only intended for use by Kibana.**

- Added `esqlVis`, `pipeBreaks`, and `pipeNoBreaks` icon glyphs.
- `EuiSelectable` now allows configurable text truncation via
`listProps.truncationProps`
([#7388](https://github.com/elastic/eui/pull/7388))
- `EuiTextTruncate` now supports a new `calculationDelayMs` prop for
working around font loading or layout shifting scenarios
([#7388](https://github.com/elastic/eui/pull/7388))

**Bug fixes**

- Fixed a bug with `EuiSelectable`s with custom `truncationProps`, where
scrollbar widths were not being accounted for
([#7392](https://github.com/elastic/eui/pull/7392))

## [`91.0.0`](https://github.com/elastic/eui/tree/v91.0.0)

- Updated the background color of `EuiPopover`s in dark mode to increase
visibility & contrast against other page/panel backgrounds
([#7310](https://github.com/elastic/eui/pull/7310))
- Memoized `EuiDataGrid` to prevent unneeded re-renders
([#7324](https://github.com/elastic/eui/pull/7324))
- Added a configurable `role` prop to `EuiAccordion`
([#7326](https://github.com/elastic/eui/pull/7326))
- Added a configurable `role` prop to `EuiGlobalToastList`
([#7328](https://github.com/elastic/eui/pull/7328))
- For greater flexibility, `EuiSuperDatePicker` now allows users to
paste ISO 8601, RFC 2822, and Unix timestamps in the `Absolute` tab
input, in addition to timestamps in the `dateFormat` prop
([#7331](https://github.com/elastic/eui/pull/7331))
- Plain text `EuiComboBox`es now behave more like a normal text
field/input. Backspacing will no longer delete the entire value, and
selected values can now be double clicked and copied.
([#7332](https://github.com/elastic/eui/pull/7332))
- `EuiDataGrid`'s display settings popover now allows users to clear the
"Lines per row" input before typing in a new number
([#7338](https://github.com/elastic/eui/pull/7338))
- Improved the UX of `EuiSuperDatePicker`'s Absolute tab for users
manually typing in timestamps
([#7341](https://github.com/elastic/eui/pull/7341))
- Updated `EuiI18n`s with multiple `tokens` to accept dynamic `values`
([#7341](https://github.com/elastic/eui/pull/7341))

**Bug fixes**

- Fixed `EuiComboBox`'s `onSearchChange` callback to pass the correct
`hasMatchingOptions` value
([#7334](https://github.com/elastic/eui/pull/7334))
- Fixed an `EuiSelectableTemplateSitewide` bug where the `popoverButton`
behavior would break if passed a non-DOM React wrapper
([#7339](https://github.com/elastic/eui/pull/7339))

**Deprecations**

- `EuiPopover`: deprecated `anchorClassName`. Use `className` instead
([#7311](https://github.com/elastic/eui/pull/7311))
- `EuiPopover`: deprecated `buttonRef`. Use `popoverRef` instead
([#7311](https://github.com/elastic/eui/pull/7311))
- `EuiPopover`: removed extra `.euiPopover__anchor` div wrapper. Target
`.euiPopover` instead if necessary
([#7311](https://github.com/elastic/eui/pull/7311))
- Deprecated `EuiButtonGroup`'s `name` prop. This can safely be removed.
([#7325](https://github.com/elastic/eui/pull/7325))

**Breaking changes**

- Removed deprecated `euiPaletteComplimentary` - use
`euiPaletteComplementary` Instead
([#7333](https://github.com/elastic/eui/pull/7333))

**Accessibility**

- Updated `type="single"` `EuiButtonGroup`s to render standard buttons
instead of radio buttons under the hood, per recent a11y recommendations
([#7325](https://github.com/elastic/eui/pull/7325))
- `EuiAccordion` now defaults to a less screenreader-noisy `group` role
instead of `region`. If your accordion contains significant enough
content to be a document landmark role, you may re-configure it back to
`region`. ([#7326](https://github.com/elastic/eui/pull/7326))
- Reduced screen reader noisiness when sorting `EuiDataGrid` columns via
toolbar ([#7327](https://github.com/elastic/eui/pull/7327))
- `EuiGlobalToastList` now defaults to a `log` role. If your toasts will
always require immediate user action, consider (with caution) using the
`alert` role instead.
([#7328](https://github.com/elastic/eui/pull/7328))

**CSS-in-JS conversions**

- Updated `$euiFontFamily` and `$euiCodeFontFamily` to match Emotion
fonts ([#7332](https://github.com/elastic/eui/pull/7332))

---------

Co-authored-by: Cee Chen <constance.chen@elastic.co>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Cee Chen <549407+cee-chen@users.noreply.github.com>
Co-authored-by: Stratoula Kalafateli <efstratia.kalafateli@elastic.co>
2023-12-18 11:15:15 -06:00
Gergő Ábrahám
44d7c0ae95
[EDR Workflows] Add matches capabilities to Endpoint Exception creation (#166002)
## Summary

This PR adds `matches` (`wildcard include`) and `does not match`
(`wildcard exclude`) to fields which support them when creating an
Endpoint exception.

For backwards compatibility with Endpoints < 8.2.0, Manifest Manager
adds the following entry to Endpoint Exceptions containing _only_
wildcards:
```json
{
  "field": "event.module",
  "operator": "included",
  "type": "exact_cased",
  "value": "endpoint"
}
```

> [!Note]
> Warnings for wrongly formatted wildcards don't seem to work correctly
at the moment. #170495 will bring some changes in the related functions,
so this PR is waiting on that to be merged.


<img width="1465" alt="image"
src="db04fe0b-4cb3-4cba-a6d7-622a2239f059">

## Sample manifests
### Linux
⚠️ On Linux, the type is always `wildcard_cased`, see the following
comment for details:
https://github.com/elastic/kibana/pull/120349#issuecomment-989963682
```json
{
  "entries": [
    {
      "type": "simple",
      "entries": [
        {
          "field": "file.path",
          "operator": "included",
          "type": "wildcard_cased",
          "value": "*/test/*"
        },
        {
          "field": "event.module",
          "operator": "included",
          "type": "exact_cased",
          "value": "endpoint"
        }
      ]
    }
  ]
}
```

### Windows
```json
{
  "entries": [
    {
      "type": "simple",
      "entries": [
        {
          "field": "file.path",
          "operator": "included",
          "type": "wildcard_caseless",
          "value": "*/test/*"
        },
        {
          "field": "event.module",
          "operator": "included",
          "type": "exact_cased",
          "value": "endpoint"
        }
      ]
    }
  ]
}
```

### Checklist

Delete any items that are not applicable to this PR.

- [ ] 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
- [ ] [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
- [ ] Any UI touched in this PR is usable by keyboard only (learn more
about [keyboard accessibility](https://webaim.org/techniques/keyboard/))
- [ ] 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))
- [ ] 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)
- [ ] 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))
- [ ] This was checked for [cross-browser
compatibility](https://www.elastic.co/support/matrix#matrix_browsers)
2023-12-05 01:59:45 -07:00
Candace Park
69b2cd2b38
[Security Solution][Admin][Policy][Event Filters] Update event filters creation to include more match options (#170495)
## Summary

- [x] Adds a `matches` and `does not match` operator option to all
eligible event filter creation entry fields that support matches
- [x] Updates the existing warning to only appear if that is the
`file.path.text` entry field is selected
- [x] Generalize the warning for wildcard usage if operator is matches
and a wildcard is used in the value
- [x] Updates wildcard warning tooltip to include "Creating event
filters with both `matches` and `does not match` operators may
significantly decrease performance."
- [x] Unit tests

# Screenshots

![efmatch](9efad4f7-e49f-4542-9052-08e578ea4f6b)

Warning about wildcards affecting Endpoint performance
<img width="1219" alt="image"
src="5bceec10-6387-44d5-bc7f-76de1816ce46">


# Event Filter & Artifact 
**LINUX**

![image](4bba92ff-965a-47d9-b2e8-0a94b322acd8)
<details open>
<summary> linux artifact entry </summary>
<p>

```
{
  "entries": [
    {
      "type": "simple",
      "entries": [
        {
          "field": "event.category",
          "operator": "included",
          "type": "wildcard_cased",
          "value": "network"
        },
        {
          "field": "process.name",
          "operator": "included",
          "type": "exact_cased",
          "value": "network"
        }
      ]
    }
  ]
}
```
</p>
</details open>

**WINDOWS**

![image](e44020c7-0701-482a-bb74-6a1150b5552c)
<details open>
<summary> windows artifact entry </summary>
<p>

```
{
  "entries": [
    {
      "type": "simple",
      "entries": [
        {
          "field": "event.kind",
          "operator": "included",
          "type": "wildcard_cased",
          "value": "event"
        },
        {
          "field": "process.name",
          "operator": "included",
          "type": "exact_caseless",
          "value": "event"
        },
        {
          "field": "event.category",
          "operator": "included",
          "type": "wildcard_cased",
          "value": "authentication"
        },
        {
          "field": "process.name",
          "operator": "included",
          "type": "exact_caseless",
          "value": "authentication"
        }
      ]
    }
  ]
}
```
</p>
</details open>

**MAC**

![image](9c1782f8-2386-4cf0-8236-fa613bb6f9ee)

<details open>
<summary> mac artifact entry</summary>
<p>

```
{
  "entries": [
    {
      "type": "simple",
      "entries": [
        {
          "field": "event.id",
          "operator": "included",
          "type": "wildcard_cased",
          "value": "071e1cfc-8333-4c6c-965a-00678c7b1d61"
        },
        {
          "field": "process.name",
          "operator": "included",
          "type": "exact_caseless",
          "value": "071e1cfc-8333-4c6c-965a-00678c7b1d61"
        },
        {
          "field": "file.path",
          "operator": "included",
          "type": "wildcard_cased",
          "value": "C:\\My Documents\\business\\January\\processName"
        },
        {
          "field": "process.name",
          "operator": "included",
          "type": "exact_caseless",
          "value": "C:\\My Documents\\business\\January\\processName"
        }
      ]
    }
  ]
}
```
</p>
</details open>
2023-11-27 00:39:44 -07:00
Marta Bondyra
3a784106df
[testing] replace testing-library/dom package with testing-library/react (#170594)
## Summary

Removes `testing-library/dom` from dependencies. As all the utilities
from`dom` are available already in `testing-library/react`, there's no
need to have both `dom` and `react` libraries available in our
package.json.

Following the [@testing-library/react
documentation:](https://testing-library.com/docs/react-testing-library/intro)

> [React Testing
Library](https://github.com/testing-library/react-testing-library)
builds on top of DOM Testing Library by adding APIs for working with
React components.

Let's just import everything from `testing-library/react`, this way we
won't need to worry about inconsistencies between `testing-library/dom`
we have in our `package.json` and the one that is
`testing-library/react` dependency.
2023-11-08 15:53:48 +01:00
David Sánchez
6a0fa94cbb
[Security Solution][Endpoint] Adapt exception list api calls to versioned router (#165658)
## Summary

- Adds version to http calls for endpoint exceptions at Lists API.
- Fixes unit test.

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2023-09-07 17:35:15 +02:00
Kevin Logan
1a3aefe6ec
[Security Solution][EDR Workflows] Remove the filter on Endpoint Exceptions and Event Filters creation to allow more user flexibility (#162193)
## Summary

This PR removes the predefined sets of Exceptions for Endpoint
Exceptions and Event Filters. This comes after user feedback that we are
too restrictive in which fields we allow users to write Exceptions or
Event Filters for. This will give users much more freedom in creating
Exceptions and Event Filters.

The `filterIndexPatterns()` function is entirely removed as Endpoint
Exceptions and Event Filters were the only features using it. Following
that, the props for many downstream components was updated to remove
reference to this filtering function.

Further, in working the the Endpoint and Protections teams, there are no
concerns with removing these filters from an Endpoint perspective and
the added flexibility for users is welcome.

User now has access to all the fields that we pull back from the index
mappings.

<img width="1728" alt="image"
src="8ccb6b33-e7e7-42d6-a9a9-68e65c3be57d">

<img width="1728" alt="image"
src="35f26431-07b2-4995-932c-6c5023ced7fd">

### 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)
- [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>
2023-08-03 12:53:17 -04:00
Alex Szabo
8cf68dc6ba
[Ops] Bump Node.js to version 18 (#160289)
## Summary

Bumps node.js to 18.17.0 (replacement for PR #144012 which was later
reverted)

As a result, these categorical additions were needed: 
- `node` evocations will need the `--openssl-legacy-provider` flag,
wherever it would use certain crypto functionalities
- tests required updating of the expected HTTPS Agent call arguments,
`noDelay` seems to be a default
 - `window.[NAME]` fields cannot be written directly
 - some stricter typechecks

This is using our in-house built node.js 18 versions through the URLs
the proxy-cache. (built with
https://github.com/elastic/kibana-custom-nodejs-builds/pull/4)

These urls are served from a bucket, where the RHEL7/Centos7 compatible
node distributables are. (see:
https://github.com/elastic/kibana-ci-proxy-cache/pull/7)

Further todos: 
 - [x] check docs wording and consistency
 - [ ] update the dependency report
 - [x] explain custom builds in documentation
 - [x] node_sass prebuilts

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Tiago Costa <tiago.costa@elastic.co>
Co-authored-by: Thomas Watson <w@tson.dk>
2023-07-27 14:12:48 +02:00
Wafaa Nasr
fdd709b025
[Security Solution] [Exceptions] Fix Exception Auto-populate from Alert actions (#159908)
## Summary

- Addresses  https://github.com/elastic/kibana/issues/159784

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2023-06-28 12:14:19 +01:00
Ievgen Sorokopud
31b34771c5
[Security Solution] Improve rules exception flyout opening for the indices with huge amount of fields (#159216)
## Summary

Original ticket:
[#158751](https://github.com/elastic/kibana/issues/158751)

These changes improve the rule's exceptions flyout opening experience.
We had a few complaints that it is very slow to open it and sometimes it
throws an exception about the limited response size.

To fix this, we decided to load extended field's data (conflicts and
unmapped info) only when user selects some field instead of fetching
this data for all fields on flyout opening.

## NOTES:

After these changes we gonna do next steps related to fields loading
when user creates/edits rule exceptions:
1. We will call `_fields_for_wildcard` **WITHOUT**
`include_unmapped=true` parameter to fetch all fields specs on exception
flyout loading
2. We will call `_fields_for_wildcard` **WITH** `include_unmapped=true`
for only one field when user selects it from the dropdown menu

With these changes we will improve slow exception flyout opening when
user has lots of fields which are unmapped in different indices. If for
some reason user has a lot of (thousands) conflicting fields around
indices then the loading is still might be slow as the
`_fields_for_wildcard` call will return conflicts information even
without `include_unmapped=true` parameter.

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2023-06-15 05:57:15 -07:00
Yara Tercero
11155329cc
[Security Solution][Exceptions] - Add exception list duplication options with and without expired items (#154991)
## Summary

Adds the following:

- Add the option to duplicate from the shared exception list management
actions dropdowns
  - User can select to include exception items with expired TTL
  - User can select to not include exception items with expired TTL 
  - Cypress tests added for both options
2023-04-21 16:01:43 -07:00
Yara Tercero
9a095602f8
[Security Solution][Exceptions] - Fix exception operator logic when mapping conflict (#155071)
## Summary

Addresses https://github.com/elastic/kibana/issues/154962 .
2023-04-17 17:05:55 -04:00
Jason Stoltzfus
c339ca8394
Upgraded EUI to v76.0.0 (#152506)
👋 Hi all - the biggest breaking change of this PR is around two icon
type changes/renames.

1. ⚠️ **The  `alert` icon is now named `warning`**
- <img width="103" alt=""
src="https://user-images.githubusercontent.com/549407/223561599-8913e88c-676f-47cd-aaed-81b64783bd81.png"
align="middle">
- This change should have been automatically converted on your behalf by
the EUI team, **but if for some reason** we missed making this
conversion in this PR and your icon(s) are now broken, please ping us or
let us know in this PR (or fix yourself after this PR merges).
- In some cases, teams were using this icon for error messages,
alongside the `danger` color. In those cases, we opinionatedly changed
those icon usages to the new `error` icon instead of using the old
alert/warning icon.

2. 🛑 **The `crossInACircleFilled` icon has been removed, and a new
`error` icon added**
- <img width="84" alt=""
src="https://user-images.githubusercontent.com/549407/223561892-4406bdf6-1a55-49ac-85ad-3a11eb7c090d.png"
align="middle">
- The conversion for this breaking change was not straightforward. This
was the path we used to determine what to change `crossInACircleFilled`
usages to:
- If the icon was associated with errors or error messages, we changed
it to the new `error` icon.
- If a "delete" action was associated with this icon, we changed it to
the `trash` icon instead.
- If a "clear" action was associated with this icon, we changed it to
just the `cross` icon, or in some cases `minusInCircleFilled` (if used
alongside `plusInCircleFilled`).
- Again, if we made a mistake during this conversion or missed your
plugin, please feel free to ping us.

## Summary

`eui@75.1.2`  `eui@76.0.2`

## [`76.0.2`](https://github.com/elastic/eui/tree/v76.0.2)

**Bug fixes**

- Added a legacy `alert` alias for the `warning` `EuiIcon` type
([#6640](https://github.com/elastic/eui/pull/6640))

## [`76.0.1`](https://github.com/elastic/eui/tree/v76.0.1)

**Bug fixes**

- Fixed broken icons on all `isInvalid` form controls
([#6629](https://github.com/elastic/eui/pull/6629))

## [`76.0.0`](https://github.com/elastic/eui/tree/v76.0.0)

- Added `pivot` glyph to `EuiIcon`
([#6605](https://github.com/elastic/eui/pull/6605))
- Added the `displayHeaderCellProps` API to `EuiDataGrid`'s columns,
which allows passing custom props directly to column header cells
([#6609](https://github.com/elastic/eui/pull/6609))
- Added the new `headerCellProps`/`footerCellProps` APIs to
`EuiDataGrid`'s control columns, which allows passing custom props
directly to control column header or footer cells
([#6609](https://github.com/elastic/eui/pull/6609))
- Added a new `footerCellRender` API to `EuiDataGrid`'s control columns,
which allows completely customizing control column rendering (previously
rendered an empty cell)
([#6609](https://github.com/elastic/eui/pull/6609))
- Updated the styling of nested ordered lists in `EuiText` to align with
GitHub's list style, which is a popular format used in Markdown or MDX
formatting ([#6615](https://github.com/elastic/eui/pull/6615))
- Added a margin-bottom property exclusively to the direct child `ul`
and `ol` elements of the `EuiText` component
([#6615](https://github.com/elastic/eui/pull/6615))
- Fix issue with badges appearing within an `EuiBadgeGroup`, where the
CSS rule to override the `margin-inline-start` was not being applied
correctly due to the order of appearance in the CSS rules
([#6618](https://github.com/elastic/eui/pull/6618))

**Bug fixes**

- Fixed `EuiDataGrid` footer control columns rendering with cell
expansion popovers when they should not have been
([#6609](https://github.com/elastic/eui/pull/6609))
- Fixed an `EuiSkipLink` bug where main content loading in
progressively/dynamically after the skip link rendered was not being
correctly focused ([#6613](https://github.com/elastic/eui/pull/6613))

**Breaking changes**

- Renamed `EuiIcon`'s `alert` to `warning`
([#6608](https://github.com/elastic/eui/pull/6608))
- Removed `EuiIcon`'s `crossInACircleFilled` in favor of `error`
([#6608](https://github.com/elastic/eui/pull/6608))

---------

Co-authored-by: Davey Holler <daveyholler@hey.com>
Co-authored-by: Constance Chen <constance.chen@elastic.co>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Jon <jon@elastic.co>
2023-03-14 14:27:40 -05:00
Yara Tercero
586f9a1461
[Security Solution][Exceptions] - Fix bug allowing user to type in custom field option for endpoint exception (#152619)
## Summary

Addresses https://github.com/elastic/kibana/issues/149814
2023-03-08 01:32:16 -07:00
Ievgen Sorokopud
7f9139f070
[Security Solution] Exceptions: Cypress tests to cover mapping conflicts functionality (#151366)
## Summary

This PR adds cypress tests to cover new rule exceptions functionality
introduced in [this PR](https://github.com/elastic/kibana/pull/149149).

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2023-03-07 22:21:51 +01:00
Ievgen Sorokopud
ce9631850d
[Security Solution][Alerts] Update mapping conflicts warning message (#152726)
## Summary

These changes update warning message that we show to user to indicate
index mapping conflicts while selecting a field to build a Rule
Exception.

New tooltip message:

<img width="829" alt="Screenshot 2023-03-06 at 16 18 51"
src="https://user-images.githubusercontent.com/2700761/223154197-ee4ed680-5cc1-4b48-82d8-e225aa24519b.png">

[Main ticket](https://github.com/elastic/kibana/issues/146845)
Addition to [this PR](https://github.com/elastic/kibana/pull/149149)


cc @nastasha-solomon
2023-03-06 19:23:26 +01:00
Yara Tercero
7a03aeaed9
[Security Solution][Exceptions] - Fix bug displaying filepath warning for non endpoint exception items (#151570)
## Summary

Addresses https://github.com/elastic/kibana/issues/145970

Fix bug displaying filepath warning for non endpoint exception items
2023-02-22 10:56:59 -08:00
Khristinin Nikita
d93eaa0109
Fix validation for entry fields in exception form (#151654)
## Change validation logic for entry exception field.

Close:
[https://github.com/elastic/kibana/issues/143051](https://github.com/elastic/kibana/issues/143051)

Previously we didn't keep a validation state per field which caused a
reset of validation if we still had invalid fields. Or we can have an
invalid state for the form, but we removed the invalid field. You can
see the videos on the ticket above.

## Solution:
Keep validation state per field, like:
```js 
{
   [entry.id]: true,
}
```
This state can keep old fields, which already were removed, this is why
we use the selector to get the actual amount of errors.



https://user-images.githubusercontent.com/7609147/220337447-95c1558c-aa85-43d1-87e8-76370aeaf141.mov

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-02-21 16:59:54 +01:00
Davis Plumlee
92a1689e95
[Security Solution][Exceptions] Rule exceptions TTL - Expiration (#145180) 2023-02-07 16:20:39 -05:00
Ievgen Sorokopud
84efdaa330
[Security Solution][Alerts] Provide more information about rule exception behavior before creation (#149149)
## Summary

These changes surface mapping issues when exceptions are created. We
gonna warn the user about type conflicts and unmapped indices.

Tooltip warning inside the field selection dropdown menu:

<img width="2020" alt="Screenshot 2023-01-18 at 19 01 44"
src="https://user-images.githubusercontent.com/2700761/213261684-61d21068-12bc-408f-8d20-1a196e0719a7.png">

Warning text underneath the dropdown menu when user picks the field
which has mapping issues:


https://user-images.githubusercontent.com/2700761/215467838-5d39ff75-3a2e-44ef-ba89-57cd3975310c.mov

Main ticket #146845

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2023-02-06 15:08:47 +01:00
Khristinin Nikita
35e02bcf64
Add sorting for exceptions cards (#145070)
## Add sorting for shared exceptions

Currently is possible to sort by Name, Created At, Created By


https://user-images.githubusercontent.com/7609147/201640150-dc9d53e4-0d34-4da1-8522-9899d35e7359.mov

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Devin W. Hurley <snowmiser111@gmail.com>
2022-11-15 13:55:38 -07:00
Yara Tercero
6c5d816c01
[Security Solution][Exceptions] - Update add/edit exception flyouts (#143127)
* squashed commit of updates to add/edit flyouts for exception, added cypress tests and unit tests

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Devin W. Hurley <devin.hurley@elastic.co>
2022-10-19 15:13:18 -04:00
Yara Tercero
0149bd063c
[Security Solution][Exceptions] - Common flyout components (#142054)
## Summary

Adds components shared between new add/edit exception flyouts. Does not yet modify the flyouts themselves. Trying to break down what would be an even larger PR into chunks.
2022-10-05 11:38:33 -07:00
Wafaa Nasr
0fcfaec2dd
remove alignCenter to prevent the icon from adjusting (#141365)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2022-09-22 18:16:31 +02:00
Davis Plumlee
51699fa21a
[Security Solution] Value list exceptions (#133254) 2022-09-19 22:41:28 +02:00
Yara Tercero
194e0d7144
[Security Solution][Exceptions] - Initial updates to exceptions viewer UX (#138770)
## Summary

**API changes**
- Adds API for determining the list-rule references. 
- Updates the exception items find api to include the `search` param which allows for simple search queries - used with the EUI search bar

**UI updates**
- Moved the exception components into new `rule_exceptions` folder per suggested folder structure updates listed [here](https://github.com/elastic/kibana/issues/138600)
- Updates the rule details tabs to split endpoint and rule exceptions into their own tabs
- Updates the viewer utilities header now that these different exception types are split
- Updates exception item UI to match new designs
- Updates the UI for when there are no items
- Removes `use_exception_list_items` hook as it is no longer in use
- Flyouts (add/edit) remain untouched
2022-09-08 16:41:52 -04:00
Wafaa Nasr
f107c273af
Fix/100018 import value list sorting (#138381)
* add sortField and sortOrder to findLists params

* move tests for list-hooks

* pass sortField and sortOrder from Flyout component + tests + remove obsolete test files

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2022-08-10 13:07:32 +02:00
Marshall Main
fe97c24de2
[Security Solution][Platform] Only allow wildcard exceptions on string fields (#137129)
* Only allow wildcard exceptions on string fields

* Fix unit tests and move to the right place
2022-07-26 12:41:19 -07:00
Marshall Main
aaa3107dbc
[Security Solution][Alerts] Detection engine wildcard exceptions (#136147)
* Implement wildcard exceptions for detection rules

* Fix index pattern retrieval on edit exceptions flyout

* Fix API integration test logic

* Fix entry_renderer linting

* Remove bad fix idea

* Add 'does not match' operator to UI

* Fix test

* Add unit tests

* Add wildcard exceptions to list of DE exception operators

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2022-07-19 15:03:47 -07:00
Yara Tercero
ff3853cfa9
[Security Solution][Exceptions] - Fixes exception builder bug that includes matches operator (#136340)
## Summary

Addresses Kibana issue #36224
2022-07-19 08:15:49 -07:00
Yara Tercero
4235294f08
[Security Solution][Exceptions] - Fix exceptions builder validation bug (#131989)
Addresses #86258

The variable tracking state needed to be cleared on operator change. If you didn't change operators, then invalidating and then validating an entry worked as expected, but if you switched operators, the error state was not being cleared causing the builder to read that there was an error state.
2022-05-11 10:49:07 -07:00
Nodir Latipov
7c01257055
[Unified Search] Move autocomplete logic to unified search plugin (#129977)
* feat: move autocomplete logic from data plugin to unified search

* minor fix after comments

* updated Documentation: data.autocomplete -> unifiedSearch.autocomplete

* changed renameFromRoot order for autocomplete

* removed extra renameFromRoot in config deprecations, updated test

* added configPath for unified search plugin

* Update kibana.json

* updated path to autocomplete

* fix conflict

* fix conflict

* [CI] Auto-commit changed files from 'node scripts/eslint --no-cache --fix'

* fix Linting

* fix functional_with_es_ssl test
2022-04-22 11:02:56 +05:00
spalger
3730dd0779 fix all violations 2022-04-16 01:37:30 -05:00
David Sánchez
a07c47c652
Set filter to undefined when it's empty on findExceptionLists method (#128455)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2022-03-29 12:44:31 +02:00
David Sánchez
968f350989
Create generic get filter method to be used with an array of list id's (#127983)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2022-03-24 08:23:21 +01:00
Ashokaditya
0d0ff4e749
[Security Solution][Endpoint] Update warning text for event filter matches operator (#127958)
* Update warning text for event filter matches operator when file path has wildcards

fixes elastic/security-team/issues/3199

* update text

review changes
2022-03-17 13:10:28 -07:00
Ashokaditya
9d53810791
[Security Solution][Endpoint] Adds matches wildcard operator for file.path.text field for Event Filters (#125202)
* labels for wildcard path entries

fixes elastic/security-team/issues/2525

* consistent naming and add missing tests

refs elastic/kibana/pull/120679

* add autocompletion for wildcard

fixes elastic/security-team/issues/2525

* ensure event filter artifacts have correct wildcard type for process.name entry

fixes elastic/security-team/issues/2525
fixes elastic/security-team/issues/2723

* set warning for input values

fixes elastic/security-team/issues/2525

* lift path validations to packages

fixes elastic/security-team/issues/2525

* Add more tests

fixes elastic/security-team/issues/2525

* Add wildcards to event filter generator

* fix merge i18n check

* Remove not match/excluded operator for now

review changes

* add mixed entries for wildcard

review changes

* comparison typo

refs 06c868b6d1

* fix vulnerable regex

review changes

* ignore empty space on input

review changes

* update component

review changes

* use const enum

review changes

* update type imports to use ConditionEntryField, OperatingSystem, TrustedAppEntryTypes
2022-03-02 11:55:58 -07:00
Davis Plumlee
2aafd3be99
[Security Solution] Exceptions Flyout follow-up (#125159) 2022-02-23 18:44:45 -05:00
David Sánchez
d965ba791a
[Security Solution][Endpoint] Event filters ux adjustments for 8.1 (#123853)
* Don't show a default value '-' for emoty descriptions on artifacts list. Also removes empty spaces

* Update copy to say 'event filters' instead of 'exceptions'

* Decrease spacing between avatar and comments textbox

* Adds extra spacing between last exception builder field and the buttons group

* Reduces effect scope togle width to by dynamic depending on translations

* Makes effected policy button group persistent across different artifact forms

* Removes unused import

* Center button group for small devices
2022-01-27 15:30:49 +01:00
Matthew Kime
d4fdd35543
[dataViews] no more IndexPatternBase, IndexPatternFieldBase (#121836)
* remove IndexPatternFieldBase and IndexPatternBase references
2021-12-22 08:46:21 -06:00
Frank Hassanabad
d874c4c798
Removes tech debt from export all (#120170)
## Summary

See: https://github.com/elastic/kibana/issues/110903

This removes the `export *` from:
* lists plugin

This also adds `import type` and `export type` in a few areas and fixes the `LicenseType` by changing it from `server` to using the version from `common` to remove the restricted paths. This extra addition prevents more memory leaks when we run jest.
2021-12-02 09:42:51 -07:00
Frank Hassanabad
e2c916a577
[Security Solutions] Removes plugins/data/public deprecations from security_solutions plugin (#118938)
## Summary

This removes all the areas marked as deprecated from `.../src/plugins/data/public` with their `@kbn/es-query` equivalent or it uses the directly exported version from `.../src/plugins/data/public`. Anywhere else this adds the `import type {` where it can to encourage the build system to do more type erasures.

### 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
2021-11-17 19:08:10 -07:00