Commit graph

73465 commits

Author SHA1 Message Date
James Gowdy
e7e5105965
[ML] Fixing groups dropdown in AD job wizards (#180785)
Fixing bug introduced in https://github.com/elastic/kibana/pull/176788
The `jobService` hasn't been initialised when being used to load the
groups.
2024-04-15 16:37:46 +01:00
Marshall Main
59055c687b
[Security Solution] Add retry to getMetrics to reduce flake (#180704)
## Summary

API integration tests added in #180094 fail occasionally on main, but
pass consistently locally and in the flaky test runner. This PR adds a
retry to the `getMetrics` request in hopes of removing the flakiness.

Flake issues:
https://github.com/elastic/kibana/issues/180530
https://github.com/elastic/kibana/issues/180641

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2024-04-15 08:34:57 -07:00
Tiago Costa
9e6617df97
skip flaky suite (#180688) 2024-04-15 16:29:30 +01:00
Luke G
69ef1f6a87
fix empty ent. guard (#180465)
## Summary

@angorayc found an issue with another upselling page, this adds the
updated logic to that screen as well.
2024-04-15 10:27:35 -05:00
Dario Gieselaar
352eb7f5ac
[Obs AI Assistant] Remove APM functions, add changes function (#179729)
Closes #179660.

#### Changes:

- **Remove APM specific functions**. This cuts down on token cost in
some cases, and generally creates a more cohesive story for all
Observability data.
- **Add an `get_apm_dataset_info` function**. This allows the LLM to
more easily see where data is stored.
- **Introduces a `changes` function**. Returns change points for any
kind of logs (using `categorize_text`) or metrics data.
- **Increased the no of max function calls from 5 to 8**. With
`get_dataset_info` and `get_apm_dataset_info` being called more often
this becomes more necessary.
- **Improve accuracy of SORT commands**. Removes some examples from the
docs where a STATS command is being used without creating a column. This
seems to limit hallucinations from the LLM where it tries to SORT on an
expression instead of a column.

![CleanShot 2024-04-10 at 08 57
05@2x](d1d8fbae-c09a-419a-b343-9449b88dd346)

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2024-04-15 08:22:41 -07:00
Gergő Ábrahám
12ec883713
[EDR Workflows] Option to sync antivirus registration with malware settings (#180484)
## Summary

Adds option to Defend integration's Antivirus Registration card to sync
registration with Malware settings.

<img width="1220" alt="image"
src="ac7716ec-5bf6-4aa2-9fdf-3f8fa1ebfe93">


![sync](2729038d-11d7-45f7-acae-415ee818cd43)


## Details:
- it adds a new field to `PolicyConfig`: `antivirus_registration.mode`,
which can be `enabled`, `disabled` or `sync_with_malware_prevent`
<img width="313" alt="image"
src="fc38799c-e620-4dbc-a727-576c5c827065">

- this field is **not** used by Endpoint: instead the existing
`antivirus_registration.enabled` field is derived from this field, so
it's compatible with older Endpoints, too
- the calculation of `antivirus_registration.enabled` happens both on
client side and on server side (in Fleet's `packagePolicyUpdate` ingest
callback)
- default value for new policy is the same: `disabled`, as in previous
version
- adds migration





### 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>
Co-authored-by: David Sánchez <davidsansol92@gmail.com>
Co-authored-by: Joe Peeples <joe.peeples@elastic.co>
2024-04-15 17:04:48 +02:00
Efe Gürkan YALAMAN
d346112340
[Search] Add index name to sync job detail flyout (#180789)
## Summary

Adds index name to sync job flyout

<img width="1274" alt="Screenshot 2024-04-15 at 13 19 45"
src="fc5a228e-6168-45bc-a5b5-5024b3c67e59">
<img width="1266" alt="Screenshot 2024-04-15 at 13 19 39"
src="d8a10683-2de1-4d65-8fc6-9950a5b29525">

### 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
- [ ] [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
- [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)

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2024-04-15 17:04:00 +02:00
Jiawei Wu
ed4fade69e
[RAM][HTTP Versioning] Version Public Rule Update Route (#179587)
## Summary

Issue: https://github.com/elastic/kibana/issues/179476
Parent issue: https://github.com/elastic/kibana/issues/157883

This PR versions the update (`PUT '/api/alerting/rule/{id}'`) route.
Still using `config-schema` for now, even though we will eventually
switch to `zod` when core is ready with openapi doc generation support
in the versioned router.

We are now validating update data using the update data schema when
calling `rulesClient->update`. We are also validating (but not throwing)
the updated rule as well.

### 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: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2024-04-15 23:45:54 +09:00
Tiago Costa
091fd14721
skip flaky suite (#180748) 2024-04-15 15:26:37 +01:00
Tiago Costa
5ab3b9cf8a
skip flaky suite (#160277) 2024-04-15 15:24:04 +01:00
Dario Gieselaar
23dd7cdabf
[Obs AI Assistant] Update ES|QL docs for 8.14 (#180757)
Updates the ES|QL docs for 8.14. Biggest change is probably the rename
of AUTO_BUCKET to BUCKET, and the fact that aggregation functions now
support expressions.
2024-04-15 15:59:58 +02:00
Dario Gieselaar
3c78e27762
[Obs AI Assistant] Simulated function calling (#180621)
Closes [#180235](https://github.com/elastic/kibana/issues/180235).

Adds an advanced setting to enable simulated function calling. Simulated
function calling is an alternative for models/APIs that do not natively
(via the API) support function calling. Instead of using the API, we
inject functions into the system prompt, tell the LLM how to call it via
plain text, and extract the function calls from the response message.

For Bedrock this is currently always used. (We previously used XML, but
now use JSON Schema).

For OpenAI, we only use it when the advanced setting is on. 

If it has been enabled, we show a warning:

![CleanShot 2024-04-11 at 17 50
48@2x](72270763-af21-422c-b560-e56ee09c4718)

We _don't_ show this warning for Bedrock if the setting is not on, even
though we always use it.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2024-04-15 06:54:46 -07:00
Mark Hopkin
47582c45c2
[Entity Analytics] Move routes and constants into folders owned by the entity analytics team (#180702)
## Summary

Closes #180531
This pull request moves entity analytics route registration and url
definition into files owned by our team.

Currently, to add a new route we require a code owners review from both
the `security-detections-response` and `security-threat-hunting` teams
unnecessarily. This is because we needed to change the following files:

- `x-pack/plugins/security_solution/common/constants.ts`
- `x-pack/plugins/security_solution/server/routes/index.ts`

As recommended by @maximpn
[here](https://github.com/elastic/kibana/pull/179930#pullrequestreview-1992231221)

I have also removed redundant feature flag checks for enabling risk
scoring and risk engine privileges routes, these feature flags are
enabled now.

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2024-04-15 06:50:57 -07:00
Carlos Crespo
bf73f173db
[Infra] Add new metrics tab and redesign of hosts overview metrics section (#180447)
closes [#175446](https://github.com/elastic/kibana/issues/175446)
## Summary

Adds new Metrics tab and redesigns the metrics section in the Overview
tab




766305ce-23c6-4001-ab20-2230decc02a1




### Extra changes
- Replaced usages of asset name in favor of asset id to filter asset
data across the Asset Details components - which will help when it
starts supporting more asset types
- Renamed some translation keys to use `assetDetails` instead of
`nodeDetails`

### How to test
- Start a local Kibana instance
- Navigate to Infrastructure > Hosts
- Open the flyout for a host
  - Overview tab 
    - Check if the metrics section matches the design and AC
  - Metrics tab
    - Check if it matches the design the design and AC
- Check the above in the full page view.

---------

Co-authored-by: Cauê Marcondes <55978943+cauemarcondes@users.noreply.github.com>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: jennypavlova <dzheni.pavlova@elastic.co>
2024-04-15 15:41:13 +02:00
Justin Kambic
a73de7319c
[Observability Onboarding] Export package list from fleet (#179301)
## Summary

Resolves https://github.com/elastic/kibana/issues/178945.
Resolves #178947.
Resolves https://github.com/elastic/kibana/issues/178952.

~Undergoing the work to export package list in a sharable way while
minimally impacting the existing implementation used by the Fleet team.~


### Update

Updated to provide the flows for all three paths of the form. Synthetics
and APM still link to their respective apps. Logs icons link to the
embedded flows.

#### Things to test

- Check that the integration cards behave in a manner you'd expect.
There's a lot of custom card creation happening and it's possible I have
made a mistake in some linking.
- Icons: there are a few icons that don't correspond to the design. I
wasn't able to find the correct `src` for the colored-in APM logo, for
example, and I'm not sure where the one logs icon lives. I've used the
`logoFilebeat` icon in its place as it's quite similar and is heavily
used in the integrations list.
- For the searchable integrations list, I was unsure if I should re-hide
it when the user changes their radio selection in the top-level
question. Right now it'll just stay as-is with their original query.
- The `Collections` feature, make sure collection buttons properly apply
the search query.

~This now works with the exported package list grid from Fleet. I've
introduced a real package list in place of the dummy grid that we had
before. I also added a searchable grid below.~

~Surely there are some things to iron out still. I also still consider
the code rough, so if you should choose to review it you will likely
find areas you want to see improved.~


![20240405171834](b3e4553a-1841-4c57-9713-81571fae1b44)

---

**Note:** I will likely extract the Fleet-specific pieces of this to a
separate patch that we can merge to Kibana `main` to make it easier for
the Fleet team to review the changes. We can then merge those upstream
and pull them into our feature branch.

^^ this is still true, before we merged this I'll likely pull out the
Fleet-specific modifications we need and have the Fleet team review them
separately. We can still merge this to the feature branch in the
meantime and resolve it later.

---------

Co-authored-by: Joe Reuter <johannes.reuter@elastic.co>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Thom Heymann <190132+thomheymann@users.noreply.github.com>
2024-04-15 09:20:53 -04:00
Angela Chuang
01e2379929
[SecuritySolution] Display full name in greetings (#180670)
## Summary

We could find the user's full name might not always be available from
the 1st image below, but username should always exist.
Previously, we displayed username straight away and it didn't look good.
[bug](https://github.com/elastic/kibana/issues/177204)
In this PR, we change the logic and display user's full name if it
exists, otherwise fallback to the username.


**No Full Name scenario - It displays username**

<img width="2293" alt="Screenshot 2024-04-12 at 09 58 52"
src="355e5a3d-e8f8-4204-8234-8eddd14691e1">


<img width="2559" alt="Screenshot 2024-04-12 at 09 59 18"
src="14ba8250-57cf-4fc1-9bdf-a3ac021b91c8">

**Full Name available scenario - It displays the full name**

<img width="2291" alt="Screenshot 2024-04-12 at 10 07 28"
src="57cb5aa2-ae23-4e0b-bd13-7b6d72edce40">
<img width="2557" alt="Screenshot 2024-04-12 at 10 08 24"
src="a4cbd64f-7eef-454b-a5fc-e12f25a82ea5">

### 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

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2024-04-15 15:15:48 +02:00
Efe Gürkan YALAMAN
bcd709352a
[Search] Make connectors searchable from global search bar (#180365)
## Summary

Add connectors search provider to globalSearch. We can now search the
connectors available. Crawlers are searchable through their index as we
don't have a path for them.

Also fixed an issue with creating a new connector/crawler due to a
recent path change.



972b1a8d-a620-4f7a-b458-81d121d8db48


### 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
- [ ] [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))

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2024-04-15 15:14:57 +02:00
Luke G
3ab221324a
[Security Solution][Timeline] Fix 'is one of' filter dsl (#180455)
## Summary

This PR fixes https://github.com/elastic/kibana/issues/175002 

Follow steps defined in the linked issue during testing, but generally
this is about adding custom filter in the timeline query tab.
2024-04-15 06:06:38 -07:00
Angela Chuang
b84591786a
[SecuritySolution] Remove chartEmbeddablesEnabled feature flag and unused code (#173675) 2024-04-15 05:58:08 -07:00
Vitalii Dmyterko
786200791b
[Security Solution][Detection Engine] fixes IM timestamp override errors (#180567)
## Summary

- addresses https://github.com/elastic/kibana/issues/174573


ES can return negative sort id for date field, when sort order set to
desc
this could happen when event has empty sort field

Example:



<details>
<summary>DESC query</summary>

```JSON
POST /indicator-match/_search?allow_no_indices=true&ignore_unavailable=true
{
  "query": {
    "bool": {
      "filter": [
        {
          "bool": {
            "must": [],
            "filter": [
              {
                "query_string": {
                  "query": "*"
                }
              }
            ],
            "should": [],
            "must_not": []
          }
        },
        {
          "bool": {
            "minimum_should_match": 1,
            "should": [
              {
                "range": {
                  "event.ingested": {
                    "lte": "2024-04-10T16:31:58.289Z",
                    "gte": "2024-02-28T16:11:58.289Z",
                    "format": "strict_date_optional_time"
                  }
                }
              },
              {
                "bool": {
                  "filter": [
                    {
                      "range": {
                        "@timestamp": {
                          "lte": "2024-04-10T16:31:58.289Z",
                          "gte": "2024-02-28T16:11:58.289Z",
                          "format": "strict_date_optional_time"
                        }
                      }
                    },
                    {
                      "bool": {
                        "must_not": {
                          "exists": {
                            "field": "event.ingested"
                          }
                        }
                      }
                    }
                  ]
                }
              }
            ]
          }
        }
      ]
    }
  },
  "fields": [
    {
      "field": "*",
      "include_unmapped": true
    },
    {
      "field": "event.ingested",
      "format": "strict_date_optional_time"
    },
    {
      "field": "@timestamp",
      "format": "strict_date_optional_time"
    }
  ],
  "runtime_mappings": {
    "kibana.combined_timestamp": {
      "type": "date",
      "script": {
        "source": """
              if (doc.containsKey(params.timestampOverride) && doc[params.timestampOverride].size()!=0) {
                emit(doc[params.timestampOverride].value.millis);
              } else {
                emit(doc['@timestamp'].value.millis);
              }
            """,
        "params": {
          "timestampOverride": "event.ingested"
        }
      }
    }
  },
  "sort": [
    {
      "event.ingested": {
        "order": "desc",
        "unmapped_type": "date"
      }
    },
    {
      "@timestamp": {
        "order": "asc",
        "unmapped_type": "date"
      }
    }
  ],
  "size": 100
}
```

RESPONSE:

```JSON
{
  "took": 1,
  "timed_out": false,
  "_shards": {
    "total": 1,
    "successful": 1,
    "skipped": 0,
    "failed": 0
  },
  "hits": {
    "total": {
      "value": 1,
      "relation": "eq"
    },
    "max_score": null,
    "hits": [
      {
        "_index": "indicator-match",
        "_id": "OnS8x44BMOVU2ZdAUiTo",
        "_score": null,
        "_source": {
          "@timestamp": "2024-04-09T18:45:02.000Z",
          "agent.name": "test"
        },
        "fields": {
          "kibana.combined_timestamp": [
            "2024-04-09T18:45:02.000Z"
          ],
          "@timestamp": [
            "2024-04-09T18:45:02.000Z"
          ],
          "agent.name": [
            "test"
          ]
        },
        "sort": [
          -9223372036854776000,
          1712688302000
        ]
      }
    ]
  }
}
```

</details>

Subsequent query with sort values of 
```JSON
        "searhAfter": [
          -9223372036854776000,
          1712688302000
        ]
```

would lead to the failure

```JSON

{
  "error": {
    "root_cause": [
      {
        "type": "parse_exception",
        "reason": "failed to parse date field [-9223372036854776000] with format [strict_date_optional_time||epoch_millis]: [failed to parse date field [-9223372036854776000] with format [strict_date_optional_time||epoch_millis]]"
      }
    ],
    "type": "search_phase_execution_exception",
    "reason": "all shards failed",
    "phase": "query",
    "grouped": true,
    "failed_shards": [
      {
        "shard": 0,
        "index": "indicator-match",
        "node": "518tWuE1QK6Lm0NII7NhEg",
        "reason": {
          "type": "parse_exception",
          "reason": "failed to parse date field [-9223372036854776000] with format [strict_date_optional_time||epoch_millis]: [failed to parse date field [-9223372036854776000] with format [strict_date_optional_time||epoch_millis]]",
          "caused_by": {
            "type": "illegal_argument_exception",
            "reason": "failed to parse date field [-9223372036854776000] with format [strict_date_optional_time||epoch_millis]",
            "caused_by": {
              "type": "date_time_parse_exception",
              "reason": "Failed to parse with all enclosed parsers"
            }
          }
        }
      }
    ]
  },
  "status": 400
}

```

This does not happen when sort is set to ASC, since ES returns positive
value in sort ids

Example of response when sort order set to ASC


<details>
<summary>ASC query</summary>

```JSON
POST /indicator-match/_search?allow_no_indices=true&ignore_unavailable=true
{
  "query": {
    "bool": {
      "filter": [
        {
          "bool": {
            "must": [],
            "filter": [
              {
                "query_string": {
                  "query": "*"
                }
              }
            ],
            "should": [],
            "must_not": []
          }
        },
        {
          "bool": {
            "minimum_should_match": 1,
            "should": [
              {
                "range": {
                  "event.ingested": {
                    "lte": "2024-04-10T16:31:58.289Z",
                    "gte": "2024-02-28T16:11:58.289Z",
                    "format": "strict_date_optional_time"
                  }
                }
              },
              {
                "bool": {
                  "filter": [
                    {
                      "range": {
                        "@timestamp": {
                          "lte": "2024-04-10T16:31:58.289Z",
                          "gte": "2024-02-28T16:11:58.289Z",
                          "format": "strict_date_optional_time"
                        }
                      }
                    },
                    {
                      "bool": {
                        "must_not": {
                          "exists": {
                            "field": "event.ingested"
                          }
                        }
                      }
                    }
                  ]
                }
              }
            ]
          }
        }
      ]
    }
  },
  "fields": [
    {
      "field": "*",
      "include_unmapped": true
    },
    {
      "field": "event.ingested",
      "format": "strict_date_optional_time"
    },
    {
      "field": "@timestamp",
      "format": "strict_date_optional_time"
    }
  ],
  "runtime_mappings": {
    "kibana.combined_timestamp": {
      "type": "date",
      "script": {
        "source": """
              if (doc.containsKey(params.timestampOverride) && doc[params.timestampOverride].size()!=0) {
                emit(doc[params.timestampOverride].value.millis);
              } else {
                emit(doc['@timestamp'].value.millis);
              }
            """,
        "params": {
          "timestampOverride": "event.ingested"
        }
      }
    }
  },
  "sort": [
    {
      "event.ingested": {
        "order": "asc",
        "unmapped_type": "date"
      }
    },
    {
      "@timestamp": {
        "order": "asc",
        "unmapped_type": "date"
      }
    }
  ],
  "size": 100
}
```

RESPONSE:

```JSON
{
  "took": 2,
  "timed_out": false,
  "_shards": {
    "total": 1,
    "successful": 1,
    "skipped": 0,
    "failed": 0
  },
  "hits": {
    "total": {
      "value": 1,
      "relation": "eq"
    },
    "max_score": null,
    "hits": [
      {
        "_index": "indicator-match",
        "_id": "OnS8x44BMOVU2ZdAUiTo",
        "_score": null,
        "_source": {
          "@timestamp": "2024-04-09T18:45:02.000Z",
          "agent.name": "test"
        },
        "fields": {
          "kibana.combined_timestamp": [
            "2024-04-09T18:45:02.000Z"
          ],
          "@timestamp": [
            "2024-04-09T18:45:02.000Z"
          ],
          "agent.name": [
            "test"
          ]
        },
        "sort": [
          9223372036854776000,
          1712688302000
        ]
      }
    ]
  }
}
```

</details>


### 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-04-15 05:24:08 -07:00
Julia Rechkunova
35930c0599
[Discover][ES|QL] Update inspect details for the main ES|QL fetch (#180204)
- Closes https://github.com/elastic/kibana/issues/175419

## Summary

This PR enables customization for title/description we show in Inspector
flyout for ES|QL requests.

<img width="500" alt="Screenshot 2024-04-09 at 15 25 11"
src="9636458b-496f-4a87-bd1c-8d125f867752">
<img width="500" alt="Screenshot 2024-04-09 at 15 25 20"
src="3efe83c1-49ef-47e5-867f-eae3f00ca488">



### 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
2024-04-15 14:04:58 +02:00
Tomasz Ciecierski
59edae292c
[Osquery] Unskip add_integration.cy.ts (#180733) 2024-04-15 13:33:10 +02:00
Tiago Vila Verde
abb8f6bb31
[Security Solution][Entity Analytics] Show contributions on risk explainability expanded tab (#179657)
This PR adds the contribution scores used when calculating an entity's
risk score.
These can be viewed by opening an entity's details flyout and clicking
on `View risk contributions` which will open the explainability tab.

The new tab now shows the contribution from different contexts and
individual alerts. Currently, there's only one context: Asset
Criticality.
The alert inputs shown are the top 10 (at most) alerts used as an input
at the time of the scoring calculation. If the final score used more
than 10 alerts, we display a message indicating the leftover sum
contribution.

This work also updates the server side in order to store the
contribution of each individual alert in the risk document itself. We
now query the document to retrieve the inputs and then fetch the
respective alerts on opening the tab.

Example:
![Screenshot 2024-04-05 at 14 34
24](a4efed46-05cd-4e31-9345-f46472358544)

### How to test

1. Generate some alerts - you can use
https://github.com/elastic/security-documents-generator
2. Enable risk scoring via `Security > Manage > Entity Risk Score`  
3. Open the entity details flyout and click `View risk contributions`

Make sure to enable Asset Criticality in `Stack Management > Advanced
Settings` if you want to see the criticality contributions.

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2024-04-15 13:32:43 +02:00
Bena Kansara
382be7ea3f
[Observability rules] Add baseline alert detail pages (#180256)
Closes https://github.com/elastic/kibana/issues/179338

Added baseline alert details page for:
- Inventory rule
- Metric threshold rule
- Error count threshold rule
- Failed transaction rate threshold rule
- APM Anomaly rule
- Elasticsearch query rule
- Anomaly detection rule

Example of Elasticsearch query alert details page:

<img width="1483" alt="Screenshot 2024-04-08 at 23 35 16"
src="acd1c9ba-9711-4bfe-97e3-71aa56a2c57c">
2024-04-15 04:31:34 -07:00
Efe Gürkan YALAMAN
3670d5eafc
[Search] Add ability to cancel syncs individually (#180739)
## Summary


2eda78f4-8f44-407d-8e45-e9447e49d3e1


Add ability to cancel syncs individually via connectors api. Add loading
indicator for sync jobs table
Add delete syncs confirmation modal.
Add listeners for the syncs to trigger loading and refetching jobs with
2 sec delays.


### 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
- [ ] [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] 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)

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2024-04-15 03:40:06 -07:00
Chenhui Wang
af34cc88a4
Collect top 5 errors for sync jobs (#180431)
## Summary

This Task update the usage collector to collect the top 5 errors for
sync jobs.


### 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

- [ ] 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: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2024-04-15 18:31:26 +08:00
Cristina Amico
f1abe4f7eb
[Fleet] Expose agent logging level in agent policy settings (#180607)
Closes https://github.com/elastic/kibana/issues/158861

## Summary
Expose agent logging level in agent policy settings. 
The new setting is added via the new settings framework and will show up
under "advanced settings". It's currently hidden until the agent
supports it.

### Testing
Enable the settings config:
https://github.com/elastic/kibana/pull/180597#discussion_r1562448034
- Go to the agent policy settings form
- Under advanced settings there is a new dropdown "Agent logging level".
Choose a value and save the policy
- The new value should be retained after saving
- Go to the agent policies tab and select action "View policy"
- The new field should be visible under `agent.logging.level`

<details>
  <summary> Screenshots</summary>
  
![Screenshot 2024-04-12 at 16 21
46](b3083bb5-703a-44c6-a00d-da9d64a2b083)
![Screenshot 2024-04-12 at 16 21
52](bd934262-86f0-4b11-b7b4-d4be72f00715)
![Screenshot 2024-04-12 at 16 22
28](4a352c82-f274-4779-9718-85135f84b0c8)
![Screenshot 2024-04-12 at 16 27
48](11e20051-f91b-44c1-b795-76ef6804cf78)

</details>

### Checklist
- [ ] 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)
- [ ] [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: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2024-04-15 03:05:27 -07:00
Alex Szabo
fd90462486
fix formatting for skipped tests (#180779)
## Summary
Follow up on: 
 - https://github.com/elastic/kibana/issues/180756
 - https://github.com/elastic/kibana/issues/180755

Context:
https://elastic.slack.com/archives/C013B57RRGE/p1713169263454469
2024-04-15 12:04:23 +02:00
Kibana Machine
a47ac32660 skip failing test suite (#180755) 2024-04-15 05:38:45 -04:00
Kibana Machine
4f8e07ad8f skip failing test suite (#180756) 2024-04-15 05:36:47 -04:00
Julia Rechkunova
9cf478b4a3
[Discover] Unskip field token flaky tests (#180721)
- Closes https://github.com/elastic/kibana/issues/180622

75x
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/5668
2024-04-15 01:56:02 -07:00
Dzmitry Lemechko
dcf7206ad3
[ci] increase perf run step timeout to 90m (#180738)
## Summary

Running journeys on CI works takes longer vs bare metal and folks are
adding more journeys. Increasing timeout for the step.
2024-04-15 00:33:43 -07:00
Kibana Machine
ce0162030b
[api-docs] 2024-04-15 Daily api_docs build (#180763)
Generated by
https://buildkite.com/elastic/kibana-api-docs-daily/builds/674
2024-04-15 05:23:49 +00:00
Kibana Machine
3f75f6aa5d
[api-docs] 2024-04-14 Daily api_docs build (#180760)
Generated by
https://buildkite.com/elastic/kibana-api-docs-daily/builds/673
2024-04-14 09:01:02 +00:00
Stratoula Kalafateli
3655f68eb0
[ES|QL] Query history design feedback (#180579) 2024-04-14 09:45:32 +02:00
Drew Tate
bec1755030
[ES|QL] Add more functions to the validator (#180640)
## Summary

- [x]
[`SIGNUM`](https://www.elastic.co/guide/en/elasticsearch/reference/master/esql-functions-operators.html#esql-signum)
- [x] spatial functions
- [x]
[`ST_CENTROID_AGG`](https://www.elastic.co/guide/en/elasticsearch/reference/master/esql-functions-operators.html#esql-agg-st-centroid)
- [x]
[`ST_CONTAINS`](https://www.elastic.co/guide/en/elasticsearch/reference/master/esql-functions-operators.html#esql-st_contains)
- [x]
[`ST_DISJOINT`](https://www.elastic.co/guide/en/elasticsearch/reference/master/esql-functions-operators.html#esql-st_disjoint)
- [x]
[`ST_INTERSECTS`](https://www.elastic.co/guide/en/elasticsearch/reference/master/esql-functions-operators.html#esql-st_intersects)
- [x]
[`ST_WITHIN`](https://www.elastic.co/guide/en/elasticsearch/reference/master/esql-functions-operators.html#esql-st_within)
- [x]
[`ST_X`](https://www.elastic.co/guide/en/elasticsearch/reference/master/esql-functions-operators.html#esql-st_x)
- [x]
[`ST_Y`](https://www.elastic.co/guide/en/elasticsearch/reference/master/esql-functions-operators.html#esql-st_y)
- [x]
[`MV_SLICE`](https://www.elastic.co/guide/en/elasticsearch/reference/master/esql-functions-operators.html#esql-mv_slice)
- [x]
[`MV_ZIP`](https://www.elastic.co/guide/en/elasticsearch/reference/master/esql-functions-operators.html#esql-mv_zip)

### Checklist

- [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
2024-04-13 08:54:45 +02:00
Stratoula Kalafateli
fd9722cab0
[ES|QL] Fixes the problem with Discover and queries without the from command (#180692)
## Summary

Closes https://github.com/elastic/kibana/issues/163417

When there was no from command in the query we were using the current
dataview. This might have the @timestamp field which is not returned by
the `ROW ...` or `Show meta` commands. So the histogram was failing.

I am solving this issue by creating a dataview based on the current
dataview but without the timeFieldName

<img width="1677" alt="image"
src="81b79634-8c2e-4346-bd34-48ae7580ab89">

I still think we should find another way to deal with these commands but
for now this is a nice way forward

**Before:**

<img width="1679" alt="image"
src="68ec6f76-6721-472b-8b49-7c719ad04208">



### 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
2024-04-13 08:52:09 +02:00
Kibana Machine
386f26bd7d
[api-docs] 2024-04-13 Daily api_docs build (#180754)
Generated by
https://buildkite.com/elastic/kibana-api-docs-daily/builds/672
2024-04-13 05:11:04 +00:00
Dominique Clarke
672bb5a54b
[SLOs] synthetics availability - add cardinality count for group by (#178454)
## Summary

Adds group by cardinality count to the synthetics availability SLO
indicator

Resolves https://github.com/elastic/kibana/issues/178409
Resolves https://github.com/elastic/kibana/issues/178140

Also, it's come to my attention that
https://github.com/elastic/kibana/issues/178341 was not fixed by a
previous PR. This PR now also resolves
https://github.com/elastic/kibana/issues/178341

### Testing

1. Create an cluster with oblt-cli and add the config to your
`kibana.dev.yml`
2. Navigate to the Synthetics app. Create at least two synthetic
monitors
3. Navigate to SLO create. Select the synthetic availability indicator
4. Check the group by cardinality callout. The cardinality should
reflect the number of monitor/location combinations
<img width="730" alt="Screenshot 2024-04-12 at 1 04 57 PM"
src="a05ffaff-c01b-4107-8f8d-2ea8362fe72e">
5. Now filter by monitor name or tag. The group by cardinality should
reflect the number of monitors that match the filters
<img width="733" alt="Screenshot 2024-04-12 at 1 05 11 PM"
src="079c74ea-dd1c-45f2-bf0e-2dbefea30f96">

### Testing https://github.com/elastic/kibana/issues/178341
To test the fix for https://github.com/elastic/kibana/issues/178341,
create a simple custom kql SLO with a group by. Add a overall filter
that would impact the overall group by count. Verify that the group by
count accurately reflects the overall filter.
2024-04-12 21:40:30 -04:00
Tim Sullivan
b67ab78a65
[Logstash] Remove usage of deprecated SharedUX utils (#180512)
## Summary

Partially addresses https://github.com/elastic/kibana-team/issues/805

Follows https://github.com/elastic/kibana/pull/180003

These changes come up from searching in the code and finding where
certain kinds of deprecated AppEx-SharedUX modules are imported.
**Reviewers: Please interact with critical paths through the UI
components touched in this PR, ESPECIALLY in terms of testing dark mode
and i18n.**

This focuses on code owned by the Logstash team.

### 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
- [ ] 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)
2024-04-12 17:38:03 -07:00
Yuliia Naumenko
5a53ca9bfc
[Security AI Assistant] Update anonymization privileges (#180732)
Added new sub-feature to AI-Assistant which allows to grant user role
privilege to edit Anonymization fields:
<img width="761" alt="Screenshot 2024-04-11 at 7 29 50 PM"
src="d4358178-d8e9-4c68-b7d4-a19d2befa29b">



How to test:
1. Create user role, which has access to Security and Actions/Connectors
and AI Assistant.
2. Customize sub-feature privileges: Remove checkbox for Update
anonymization fields.
3. Save role.
4. Create/update existing user with the new role.
5. Go to Security AI Assistant settings and open Anonymization tab.
6. For the user role with removed privilege to edit anonymization, all
actionable buttons should be disabled. Button Save will remain enabled,
because it correspond to all Assistant settings.
7. Public API "/api/elastic_assistant/anonymization_fields/_bulk_action"
should return "Forbidden" 403 access error.

How it looks when no privilege for the user role:
<img width="771" alt="Screenshot 2024-04-12 at 10 12 34 AM"
src="7c3b6c92-12cb-46ae-8356-dc687c82726f">

@patrykkopycinski please adopt it after merging this PR to the new UX

---------

Co-authored-by: Garrett Spong <garrett.spong@elastic.co>
2024-04-12 17:19:36 -07:00
Christophe Alladoum
a3db876ab7
[8.14] Add advanced setting to disable memory scan on behavior alerts (#180636)
## Summary

On behavior alerts with Defend, the default behavior is to enrich the
alert by scanning some memory regions against Yara memory signatures.

This PR adds an advanced setting to opt-out of this behavior.


### 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)


### 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: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Daniel Ferullo <56368752+ferullo@users.noreply.github.com>
2024-04-12 15:20:56 -07:00
Hannah Mudge
d3c7e180fd
[Controls] Fix controls on fields with custom label (#180615)
Closes https://github.com/elastic/kibana/issues/180613

## Summary

We were incorrectly using the field's `displayName` (i.e. the custom
label) rather than the `name` (i.e. the field's actual name) when
referencing it in the compatible types registry - this was causing an
error to be thrown because the entry for the custom label did not exist.
This fixes the attached bug by replacing `displayName` with `name`.


### Checklist

- [x]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials -
https://github.com/elastic/kibana/pull/180626
- [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

- [ ] 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)
2024-04-12 14:21:34 -06:00
Nathan Reese
49282980c7
fixes onFetchContextChanged calls onFetch with outdated values (#180322)
Closes https://github.com/elastic/kibana/issues/180225

Test instructions
1. start kibana with `yarn start --run-examples`
2. install web logs sample data set
3. create new dashboard, Click "Add panel" and select "Unified search
example"
4. Set time range to last 7 days
5. create a filter "bytes >= 15000". Ensure panel updates
6. Click reload, ensure panel re-fetches data
7. Try a bunch of other things in Unified search UI and ensure panel
fetches data as expected

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2024-04-12 13:57:36 -06:00
Shahzad
29e8394c3d
[Synthetics] Monitor CRUD's public api's (#169928)
## Summary

Part of https://github.com/elastic/kibana/issues/169547

View docs at [Changed
pages](https://kibana_169928.docs-preview.app.elstc.co/diff)

Add monitor api public api 

### Testing

Make sure you have some monitors populated before testing this PR and
before switching to the branch

- [ ] Try editing already added monitors via API
- [ ] Test adding monitors via API, and then edit those via and
subsqeuently try editing via API the same monitor
- [ ] Test editing monitors via API
- [ ] Test deleting monitors via API
- [ ] Test getting monitors via API
- [ ] Testing private as well public locations

Basic workflow that i am interesting in testing is to make sure, you can
add/edit via both API and UI without any issues


Test each of HTTP/TCP/ICMP browser examples

<img width="1728" alt="image"
src="3575d93a-5f04-4c80-ac62-038643f466f8">

---------

Co-authored-by: Justin Kambic <jk@elastic.co>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Dominique Clarke <dominique.clarke@elastic.co>
2024-04-12 15:10:11 -04:00
Yuliia Naumenko
447a7303e2
[Security Solution] Removed unused dependency for savedObjects plugin (#180649)
Related to Kibana team request to cleanup unused dependencies
https://github.com/elastic/kibana/issues/46435#issuecomment-1887231084
2024-04-12 11:19:15 -07:00
Kibana Machine
8e17cc4cfe skip failing test suite (#170593) 2024-04-12 14:09:25 -04:00
Tiago Costa
de06723746
skip flaky suite (#170593) 2024-04-12 19:08:50 +01:00
Kibana Machine
4174fc2923 skip failing test suite (#169701) 2024-04-12 14:07:33 -04:00
Tiago Costa
1123ef6641
skip flaky suite (#169701) 2024-04-12 19:06:51 +01:00