Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[8.x] [Security Solution][Notes] - fix createdBy filter for notes management page (#197706) #197910

Closed
wants to merge 1,784 commits into from

Conversation

PhilippeOberti
Copy link
Contributor

Backport

This will backport the following commits from main to 8.x:

Questions ?

Please refer to the Backport tool documentation

viajes7 and others added 30 commits October 22, 2024 10:12
…lastic#196786)

## Summary

Fixes elastic#194751 

In `EuiForm`, if the value of `isInvalid` is true, it will render
addressFormErrors tip messages.

And In `step_logistics.tsx`, `isInValid` is setted by
`isInvalid={isSubmitted && !isFormValid}`

But form `submit` method set `isSubmitted` to true first, then validate
form. At this time, `isSubmitted is true` and `isFormValid is
unedfined`. So addressFormErrors shows immediately.


![image](https://github.com/user-attachments/assets/687a359d-ed33-4860-8d96-4543f2ef4898)

**So, maybe when `isSubmitting` is true, addressFormErrors should not be
shown.**

Co-authored-by: Elastic Machine <[email protected]>
## Summary

Assign files within `x-pack/test/accessibility/apps/group[1|2|3]`

### Why I assigned them:

Assigned advanced_settings due to
elastic#175255

Assigned dashboard_controls due to
elastic#190797

Assigned dashboard_links due to
elastic#174772

Assigned dashboard_panel_options due to
elastic#178596

Assigned grok_debugger due to
https://github.com/elastic/kibana/blob/main/x-pack/plugins/grokdebugger/kibana.jsonc#L4

Assigned helpers due to elastic#164341
(call site)

Assigned home due to elastic#103192

Assigned index_lifecycle_management due to
elastic#116207

Assigned ingest_node_pipelines due to
elastic#113783

Assigned kibana_overview due to
https://github.com/elastic/kibana/blob/f00ac7a8a21463e6bb4a2784c3a3884f36c62900/x-pack/plugins/grokdebugger/kibana.jsonc#L4

Assigned management due to elastic#165705

Assigned painless_lab due to
https://github.com/elastic/kibana/blob/main/x-pack/plugins/painless_lab/kibana.jsonc#L4

Assigned search_profiler due to
elastic#195343

Assigned uptime due to
https://github.com/elastic/kibana/blob/main/x-pack/plugins/observability_solution/uptime/kibana.jsonc#L4

Assigned lens due to elastic#175893

Assigned ml_anomaly_detection due to
elastic#162126

Assigned canvas due to elastic#164376

Assigned cc replication due to
elastic#149069

Assigned enterpise search due to
elastic#79359

Assigned graph to due elastic#190797

Assigned license_management due to
https://github.com/elastic/kibana/blob/main/x-pack/plugins/license_management/kibana.jsonc#L4

Assigned maps due to elastic#155161

Assigned observability due to
https://github.com/elastic/kibana/blob/main/x-pack/plugins/observability_solution/observability/kibana.jsonc#L4

Assigned remote clusters due to
elastic#96989

Assigned reporting due to elastic#121435

Assigned rollup_jobs due to
https://github.com/elastic/kibana/blob/d57bc9a5d7d64f86b550eff7997605a3090aee9a/x-pack/plugins/rollup/kibana.jsonc#L4

Assigned watcher due to elastic#119717


Contributes to: elastic#194817

---------

Co-authored-by: kibanamachine <[email protected]>
Co-authored-by: Elastic Machine <[email protected]>
Co-authored-by: Rodney Norris <[email protected]>
Part of elastic#196155

New Synthtrace scenario created:
[k8s_entities.ts](https://github.com/elastic/kibana/pull/197077/files#diff-33a935a5fb8848d743e40d89b018ed8ac82ae992c0778cd6cea072d091aa0647)

```
node scripts/synthtrace k8s_entities.ts --clean --live
```


Cluster sample data:
```
 {
        "_index": ".entities.v1.latest.builtin_kubernetes_cluster_ecss_from_ecs_data",
        "_id": "2060900000000000",
        "_score": 1,
        "_source": {
          "entity": {
            "type": "kubernetes_cluster_ecs",
            "id": "2060900000000000",
            "definitionId": "builtin_kubernetes_cluster_ecs",
            "displayName": "cluster_foo",
            "lastSeenTimestamp": "2024-10-21T16:15:17.570Z"
          },
          "orchestrator": {
            "cluster": {
              "name": "cluster_foo"
            }
          },
          "event": {
            "ingested": "2024-10-21T16:15:17.570Z"
          }
        }
      },
      {
        "_index": ".entities.v1.latest.builtin_kubernetes_cluster_semconvs_from_ecs_data",
        "_id": "2060900000000000",
        "_score": 1,
        "_source": {
          "entity": {
            "type": "kubernetes_cluster_semconv",
            "id": "2060900000000000",
            "definitionId": "builtin_kubernetes_cluster_semconv",
            "displayName": "cluster_foo",
            "lastSeenTimestamp": "2024-10-21T16:15:17.570Z"
          },
          "k8s": {
            "cluster": {
              "uid": "cluster_foo"
            }
          },
          "event": {
            "ingested": "2024-10-21T16:15:17.570Z"
          }
        }
      },
```
## Summary

The component template used when enabling the risk engine is not Kibana
space-agnostic, as the component template in every space is named
`.risk-score-mappings`. This caused issues during the cleanup process,
where it attempted to delete the same component template from each space
but failed because other spaces' index templates were still referencing
it.



### 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
- [x] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed



### For maintainers

- [ ] This was checked for breaking API changes and was [labeled
appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#_add_your_labels)
- [ ] This will appear in the **Release Notes** and follow the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

---------

Co-authored-by: kibanamachine <[email protected]>
…r cards clicked (elastic#196291)

## Summary
elastic#196145

To verify:

1. Add these lines to `kibana.dev.yml`
```
logging.browser.root.level: debug
telemetry.optIn: true
```
2. In the onboarding hub, expand the integration card.
It should log `onboarding_tab_${tabId}` on tabs clicked.




https://github.com/user-attachments/assets/bd30c9ed-7c99-4ca0-93e7-6d9bf0146e62


It should log `onboarding_card_${integrationId}` on integration cards
clicked.


https://github.com/user-attachments/assets/58750d88-7bbf-4b27-8e54-587f3f6f32c2


3. Manage integrations callout link clicked::
`onboarding_manage_integrations`;
4. Endpoint callout link clicked: `onboarding_endpoint_learn_more`;
5. Agentless callout link clicked: `onboarding_agentless_learn_more`;
6. Agent still required callout link clicked:
`onboarding_agent_required`;

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

## Summary

Fix EDOT collector permissions.

## Details

Adds `traces-*-*` index privilege and removed unnecessary `apm`
application privileges:

```json
{
  "standalone_agent": {
    "cluster": [
      "monitor"
    ],
    "indices": [
      {
        "names": [
          "logs-*-*",
          "metrics-*-*",
          "traces-*-*"
        ],
        "privileges": [
          "auto_configure",
          "create_doc"
        ],
        "allow_restricted_indices": false
      }
    ],
    "applications": []
  }
}
```
## Summary

Removes the following unused dependencies:

- `@cfworker/json-schema`
- `flat`
- `font-awesome`
- `html2canvas`
- `@formatjs/cli`
- `@formatjs/cli-lib`
- `@types/babel__core`
- `@types/babel__generator`
- `@types/babel__helper-plugin-utils`
- `@types/event-stream`
- `@types/flat`
- `@types/md5`
- `@types/pegjs`
- `@types/tapable`
- `@types/zen-observable`
- `debug`
- `html`


Also removes `pbf` from `devDependencies`, as it already exists in the
production `dependencies` list.
# Summary

Adds a new API deprecations feature inside core.
This feature enabled plugin developers to mark their versioned and
unversioned public routes as deprecated.
These deprecations will be surfaced to the users through UA to help them
understand the deprecation and address it before upgrading. This PR also
surfaces these deprecations to UA.

Closes elastic#117241

1. Core service to flag deprecated routes
2. UA code to surface and resolve deprecated routes

## Flagging a deprecated Route

### The route deprecation option
We have three types of route deprecations:

- `type: bump`: A version bump deprecation means the API has a new
version and the current version will be removed in the future in favor
of the newer version.
- `type: remove`: This API will be completely removed. You will no
longer be able to use it in the future.
- `type: migrate`: This API will be migrated to a different API and will
be removed in the future in favor of the other API.


All route deprecations expect a documentation link to help users
navigate. We might add a generic documentation link and drop this
requirement in the future but for now this is required.

### Deprecated Route Example
Full examples can be found in the `routing_example` example plugin
located in this directory:
`examples/routing_example/server/routes/deprecated_routes`

```ts
router[versioned?].get(
    {
      path: '/',
      options: {
        deprecated: {
           documentationUrl: 'https://google.com',
           severity: 'warning',
           reason: {
              type: 'bump',
              newApiVersion: '2024-10-13',
            },
        },
      },
    },
    async (context, req, res) => {
...
```

## Surfaced API deprecations in UA

The list of deprecated APIs will be listed inside Kibana deprecations
along with the already supported config deprecations.
<img width="1728" alt="image"
src="https://github.com/user-attachments/assets/5bece704-b80b-4397-8ba2-6235f8995e4a">


Users can click on the list item to learn more about each deprecation
and mark it as resolved
<img width="1476" alt="image"
src="https://github.com/user-attachments/assets/91c9207b-b246-482d-a5e4-21d0c61582a8">



### Marking as resolved
Users can click on mark as resolved button in the UA to hide the
deprecation from the Kiban deprecations list.
We keep track on when this button was clicked and how many times the API
has been called. If the API is called again the deprecation will
re-appear inside the list. We might add a feature in the future to
permenantly supress the API deprecation from showing in the list through
a configuration (elastic#196089)

If the API has been marked as resolved before we show this in the flyout
message:
> The API GET /api/deprecations/ has been called 25 times. The last time
the API was called was on Monday, October 14, 2024 1:08 PM +03:00.
> The api has been called 2 times since the last time it was marked as
resolved on Monday, October 14, 2024 1:08 PM +03:00


Once marked as resolved the flyout exists and we show this to the user
until they refresh the page
<img width="1453" alt="image"
src="https://github.com/user-attachments/assets/8bb5bc8b-d1a3-478f-9489-23cfa7db6350">


## Telemetry:
We keep track of 2 new things for telemetry purposes:
1. The number of times the deprecated API has been called
2. The number of times the deprecated API has been resolved (how many
times the mark as resolved button in UA was clicked)

## Code review
- [x] Core team is expected to review the whole PR
- [ ] Docs team to review the copy and update the UA displayed texts
(title, description, and manual steps)
- [x] kibana-management team is expected to review the UA code changes
and UI
- [ ] A few teams are only required to approve this PR and update their
`deprecated: true` route param to the new deprecationInfo object we now
expect. There is an issue tracker to address those in separate PRs later
on: elastic#196095

## Testing

Run kibana locally with the test example plugin that has deprecated
routes
```
yarn start --plugin-path=examples/routing_example --plugin-path=examples/developer_examples
```

The following comprehensive deprecated routes examples are registered
inside the folder:
`examples/routing_example/server/routes/deprecated_routes`

Run them in the console to trigger the deprecation condition so they
show up in the UA:

```
# Versioned routes: Version 1 is deprecated
GET kbn:/api/routing_example/d/versioned?apiVersion=1
GET kbn:/api/routing_example/d/versioned?apiVersion=2

# Non-versioned routes
GET kbn:/api/routing_example/d/removed_route
POST kbn:/api/routing_example/d/migrated_route
{}
```

1. You can also mark as deprecated in the UA to remove the deprecation
from the list.
2. Check the telemetry response to see the reported data about the
deprecated route.
3. Calling version 2 of the API does not do anything since it is not
deprecated unlike version `1` (`GET
kbn:/api/routing_example/d/versioned?apiVersion=2`)
4. Internally you can see the deprecations counters from the dev console
by running the following:
```
GET .kibana_usage_counters/_search
{
    "query": {
        "bool": {
            "should": [
              {"match": { "usage-counter.counterType": "deprecated_api_call:total"}},
              {"match": { "usage-counter.counterType": "deprecated_api_call:resolved"}},
              {"match": { "usage-counter.counterType": "deprecated_api_call:marked_as_resolved"}}
            ]
        }
    }
}

```

---------

Co-authored-by: kibanamachine <[email protected]>
Co-authored-by: florent-leborgne <[email protected]>
Co-authored-by: Elastic Machine <[email protected]>
## Summary

This PR adds a new type of error (`ReportingSavedObjectNotFoundError`)
which gets thrown when passed in saved object doesn't eixst.

This produces a log like this:
```
[2024-10-22T15:09:26.768+02:00][ERROR][plugins.reporting.runTask] Error: ReportingError(code: reporting_saved_object_not_found) "Error: Saved object [index-pattern/ff959d40-b880-11e8-a6d9-e546fe2bba5f] not found"
```

Closes: elastic#191548
Closes: elastic#196620

---------

Co-authored-by: kibanamachine <[email protected]>
## Summary

Semantic text feature was disabled by default due to ML node unable to
scale down. With the relevant
[PR](elastic/elasticsearch#114323) & subsequent
[fix](elastic/elasticsearch#115189) merged, ML
node now auto scales when there is no activity. Therefore enabling
semantic_text feature in es3.

### Testing instructions
* start serverless instance
* visit index management index details page -> mappings
* Click Add field 
* Confirm `semantic_text` is shown in the field type form
…#197182)

## Summary

Partially addresses elastic#189258

This change will likely supercede
elastic#196817

When parsing, currently ES|QL parsers adds extraneous multiply by 1 or
multiply by -1 nodes when parsing arithmetic unary expressions.

For example, `-(x)` is parsed as `-1 * x`.

This change, reverts these when pretty-printing using the
`BasicPrettyPrinter`: `-1 * x` is pretty printed as `-x`.


### Checklist

Delete any items that are not applicable to this PR.

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


### For maintainers

- [x] This was checked for breaking API changes and was [labeled
appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#_add_your_labels)
…uplicate Service Name (elastic#196431)

## Summary

This PR includes:
- Addressed the comments from
elastic#193642
- Fix CSS to display usage items of inference endpoints
![Screenshot 2024-10-22 at 9 50
47 AM](https://github.com/user-attachments/assets/02cd6323-f9aa-4af6-9a4a-c410ca38b2d9)
- Aligned header buttons with title
![Screenshot 2024-10-22 at 9 51
18 AM](https://github.com/user-attachments/assets/98cea438-634d-4cfe-b55a-a07bf56ecc8c)
- removed duplicate "Elasticsearch"  from Service dropdown
![Screenshot 2024-10-22 at 9 51
54 AM](https://github.com/user-attachments/assets/e4eb0d91-9440-4730-bf63-28695d1060b2)



### 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]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [X] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [X] 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: Elastic Machine <[email protected]>
Co-authored-by: kibanamachine <[email protected]>
)

## Summary

Closing https://github.com/elastic/kibana-team/issues/1132 to avoid an
issue with Canvas, that is planned to be removed in 10.x. @kbn/flot is
being used by the monitoring team so I'm not removing it from Kibana in
this PR.
…astic#196756)

Closes elastic#190647

## Summary

This PR swaps the interaction of `kbn-grid-layout` so that you are now
dragging/resizing the **actual element** rather than the preview - i.e.
the preview now shows the **real** / grid aligned location (i.e. where
the panel will land once the interaction stops), while the element shows
the non-grid-aligned location.

**Dragging**

| Before | After |
|--------|--------|
| ![Oct-18-2024
09-10-52](https://github.com/user-attachments/assets/f117124d-3200-4c7b-a5f7-6a4bc767ebff)
| ![Oct-18-2024
09-07-25](https://github.com/user-attachments/assets/483d481a-a752-4455-b9bd-2d89ec273454)
|


**Resizing**

| Before | After |
|--------|--------|
| ![Oct-18-2024
09-11-21](https://github.com/user-attachments/assets/64e4314d-b641-4b0c-a4a9-93e3f0d21cbc)
| ![Oct-18-2024
09-07-55](https://github.com/user-attachments/assets/755be726-38bc-475b-a85d-7696262c4b4f)
|

This serves as more than just a visual update - because we are dragging
the real element, the mouse stays "locked" to the drag and/or resize
handler, which means we have introduced the possibility for an `onDrop`
event. This is necessary in order to keep the current "unsaved changes"
behaviour on Dashboard, where changes are triggered only once the panel
is actually **dropped** and not when other panels move as a consequence
of a drag event.

To make this possible, I also removed the `GridOverlay` component - it
was creating a transparent `div` **over the entire grid** on
interaction, which meant that focus was lost as soon as the interaction
started. If we want to restore the "scroll up" and "scroll down" buttons
(which we were unsure about, anyway), we would need to rethink this
(i.e. just render two fixed-position buttons without any overlay).

### Checklist

- [x] This was checked for [cross-browser
compatibility](https://www.elastic.co/support/matrix#matrix_browsers)


### For maintainers

- [ ] This was checked for breaking API changes and was [labeled
appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#_add_your_labels)
- [ ] This will appear in the **Release Notes** and follow the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
## Summary

Closes elastic#196981

- Updated Search Index Details with data test suite to check for index
documents first, this should help reduce flakey tests in MKI since we
will ensure the documents are available before moving forward
- Updated URL checks to use regex instead `.equal` with the mocked
value. This should ensure the tests can pass in MKI and with integration
testing
- Removed the navigation check for the Maps page, this was causing
intermittent failures due to a modal on the page.
- Updated the getting started test suite to use `developer` role instead
of `admin`

### 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
- [x] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
Co-authored-by: elastic-renovate-prod[bot] <174716857+elastic-renovate-prod[bot]@users.noreply.github.com>
…e the unassociated note advanced setting under the Security Solution section (elastic#197312)

## Summary

This PR tackles 2 small tasks:
- move the unassociated advanced settings introduced in [this
PR](elastic#194947) under the `Security
Solution` category instead of `General`
- make some copy changes on the notes functionality, mainly the
following ([copy changes
document](https://docs.google.com/document/d/10blyxRfkMIR8gk4cw6nFzajA-L63iUzQaxQXHauL8LM/edit#heading=h.mlyibn1i5q84))
  - make sure we don't use a capital `N` for the word `note`
  - make sure that we use a capital `T` for the word `timeline`
  - change some of the no message and callout texts
  - prioritize using `attach` instead of `associate`

All changes have been done with @nastasha-solomon.

elastic#193495
This PR is a simple update of our versions file after the recent bumps.
…public access (elastic#193757)

## Summary

Fixes elastic#192957 

Removes the `internal/_find` route from public access by moving the
hard-coded `options` into the route builder functions.

---------

Co-authored-by: Elastic Machine <[email protected]>
…hen there are no dataviews (elastic#196658)

## Summary

Closes elastic#176159

Try ES|QL button now navigates to dashboard with an ES|QL chart
embedded.


![meow](https://github.com/user-attachments/assets/47ae19f5-1ed2-49f1-aceb-1f7287f58251)


### 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
- [ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed

---------

Co-authored-by: kibanamachine <[email protected]>
auto-merge was automatically disabled October 28, 2024 20:18

Pull request was closed

Copy link

❌ Author of the following commits did not sign a Contributor Agreement:
, , , , , 7dd66b3, , , , , ,

Please, read and sign the above mentioned agreement if you want to contribute to this project

@PhilippeOberti PhilippeOberti deleted the backport/8.x/pr-197706 branch October 28, 2024 20:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport Team:Threat Hunting:Investigations Security Solution Investigations Team
Projects
None yet
Development

Successfully merging this pull request may close these issues.