Your window into the Elastic Stack
Find a file
Alberto Blázquez 5cc1315dd3
Implement Asset Inventory data grid (#206115)
## Summary

Closes https://github.com/elastic/security-team/issues/11270.

### Screenshots

<details><summary>Current state</summary>
<img width="1486" alt="Screenshot 2025-01-15 at 17 28 42"
src="https://github.com/user-attachments/assets/1a39ae67-406c-464d-849b-0fba3380e982"
/>
</details> 

<details><summary>Current state + RiskBadge + Criticality + SearchBar
(implemented in separate PRs)</summary>
<img width="1752" alt="Screenshot 2025-01-13 at 16 34 10"
src="https://github.com/user-attachments/assets/bca30c71-dba3-4505-aba6-a3787ba7f6b1"
/>
</details>

### Definition of done

> [!NOTE]
>  For now it only works with static data until backend is ready

- [x] Implement DataGrid using the `<UnifiedDataTable>` component, based
on
[[EuiDataGrid](https://eui.elastic.co/#/tabular-content/data-grid)](https://eui.elastic.co/#/tabular-content/data-grid),
ensuring consistency with Kibana standards.
- [x] Configure columns as follows:
- **Action column**: No label; includes a button in each row to expand
the `EntityFlyout`.
  - **Risk**: Numerical indicators representing the asset's risk.
  - **Name**: The name or identifier of the asset.
- **Criticality**: Displays priority or severity levels (e.g., High,
Medium, Low). Field `asset.criticality`
- **Source**: Represents the asset source (e.g., Host, Storage,
Database). `asset.source`
- **Last Seen**: Timestamp indicating the last observed data for the
asset.
- [x] Add static/mock data rows to display paginated asset data, with
each row including:
  - Buttons/icons for expanding the `EntityFlyout`.
- [x] Include the following interactive elements:
- [x] Multi-sorting: Allow users to sort by multiple columns (e.g., Risk
and Criticality). **This only works if fields are added manually to the
DataView**
- [x] Columns selector: Provide an option for users to show/hide
specific columns.
- [x] Fullscreen toggle: Allow users to expand the DataGrid to
fullscreen mode for enhanced visibility.
- [x] Pagination controls: Enable navigation across multiple pages of
data.
- [x] Rows per page dropdown: Allow users to select the number of rows
displayed per page (10, 25, 50, 100, 250, 500).
- [x] Enforce constraints:
- Limit search results to 500 at a time using `UnifiedDataTable`'s
pagination helper for loading more data once the limit is reached.

### Out of scope

- Risk score colored badges (implemented in follow-up PR)
- Group-by functionality or switching between grid and grouped views
- Field selector implementation
- Flyout rendering

### Duplicated files

> [!CAUTION]
> As of now, `<UnifiedDataTable>` is a complex component that needs to
be fed with multiple props. For that, we need several components, hooks
and utilities that currently exist within the CSP plugin and are too
coupled with it. It's currently not possible to reuse all this logic
unless we move that into a separate @kbn-package so I had to temporarily
duplicate a bunch of files. This is the list to account them for:

- `hooks/`
  - `use_asset_inventory_data_table/`
    - `index.ts`
    - `use_asset_inventory_data_table.ts`
    - `use_base_es_query.ts`
    - `use_page_size.ts`
    - `use_persisted_query.ts`
    - `use_url_query.ts`
    - `utils.ts`
  - `data_view_context.ts`
  - `use_fields_modal.ts`
  - `use_styles.ts`
- `components/`
  - `additional_controls.tsx`
  - `empty_state.tsx`
  - `fields_selector_modal.tsx`
  - `fields_selector_table.tsx`

This ticket will track progress on this task to remove duplicities and
refactor code to have a single source of truth reusable in both Asset
Inventory and CSP plugins:
- https://github.com/elastic/security-team/issues/11584

### How to test

1. Open the Index Management page in
`http://localhost:5601/kbn/app/management/data/index_management` and
click on "Create index". Then type `asset-inventory-logs` in the
dialog's input.
2. Open the DataViews page in
`http://localhost:5601/kbn/app/management/kibana/dataViews` and click on
"Create Data View".
3. Fill in the flyout form typing the following values before clicking
on the "Save data view to Kibana" button:
    - `asset-inventory-logs` in "name" and "index pattern" fields. 
    - `@timestamp` is the value set on the "Timestamp field".
- Click on "Show advanced settings", then type
`asset-inventory-logs-default` in the "Custom data view ID" field.
4. Open the Inventory page from the Security solution in
`http://localhost:5601/kbn/app/security/asset_inventory`.

<details><summary>Data View Example</summary>
<img width="894" alt="Screenshot 2025-01-10 at 11 09 00"
src="https://github.com/user-attachments/assets/9a20f504-e602-4b67-a24e-0341f447878e"
/>
</details> 

### Checklist

Check the PR satisfies following conditions. 

Reviewers should verify this PR satisfies this list as well.

- [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/src/platform/packages/shared/kbn-i18n/README.md)
- [x] This was checked for breaking HTTP API changes, and any breaking
changes have been approved by the breaking-change committee. The
`release_note:breaking` label should be applied in these situations.
- [x] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

### Risks

No risks at all.
2025-01-16 16:35:49 +01:00
.buildkite Add check to fail CI if any dependencies are unowned (#206679) 2025-01-16 09:59:04 -05:00
.devcontainer Removing experimental for the FIPS mode config (#200734) 2024-11-19 15:23:20 -05:00
.github [APM] Migrate APM Cypress tests to on_merge from on_merge_unsupported_ftrs (#203991) 2025-01-16 12:57:50 +01:00
api_docs [api-docs] 2025-01-16 Daily api_docs build (#206888) 2025-01-16 07:17:04 +00:00
config [Onboarding] [Stack] Add Onboarding experience into Stack (#204351) 2025-01-15 17:03:25 -07:00
dev_docs Add check to fail CI if any dependencies are unowned (#206679) 2025-01-16 09:59:04 -05:00
docs [Docs] Add missing telemetry setting (#206403) 2025-01-15 16:52:16 +01:00
examples [Dashboard][Collapsable Panels] Swap react-grid-layout for kbn-grid-layout (#205341) 2025-01-14 14:51:14 -07:00
kbn_pm Sustainable Kibana Architecture: Move CodeEditor related packages #205587 (#205738) 2025-01-08 15:25:47 +01:00
legacy_rfcs Sustainable Kibana Architecture: Move modules owned by @elastic/kibana-security (#202748) 2025-01-05 12:57:01 +01:00
licenses Adds AGPL 3.0 license (#192025) 2024-09-06 19:02:41 -06:00
oas_docs [Fleet] Added required_versions to agent policy and API with validation (#206600) 2025-01-16 09:18:34 +01:00
packages Add check to fail CI if any dependencies are unowned (#206679) 2025-01-16 09:59:04 -05:00
plugins
scripts Update styled_components_files.js to include all files that import styled-components (#205011) 2025-01-05 16:54:17 +01:00
src [Lens][Heatmap] Add ability to rotate X axis label (#202143) 2025-01-16 15:36:37 +01:00
test [Console] Add a small action for copying variable names to clipboard (#206628) 2025-01-16 09:27:31 +01:00
typings make emotion typing global (#200958) 2024-12-05 12:20:43 -06:00
x-pack Implement Asset Inventory data grid (#206115) 2025-01-16 16:35:49 +01:00
.backportrc.json chore(NA): adds 8.17 into backportrc (#201065) 2024-11-21 06:05:29 +00:00
.bazelignore Remove references to deleted .ci folder (#177168) 2024-02-20 19:54:21 +01:00
.bazeliskversion chore(NA): upgrade bazelisk into v1.11.0 (#125070) 2022-02-09 20:43:57 +00:00
.bazelrc chore(NA): use new and more performant BuildBuddy servers (#130350) 2022-04-18 02:01:38 +01:00
.bazelrc.common Transpile packages on demand, validate all TS projects (#146212) 2022-12-22 19:00:29 -06:00
.bazelversion chore(NA): revert bazel upgrade for v5.2.0 (#135096) 2022-06-24 03:57:21 +01:00
.browserslistrc Add Firefox ESR to browserlistrc (#184462) 2024-05-29 17:53:18 -05:00
.editorconfig
.eslintignore Sustainable Kibana Architecture: Move CodeEditor related packages #205587 (#205738) 2025-01-08 15:25:47 +01:00
.eslintrc.js Reenable ESLint helpers for Observability (#206585) 2025-01-14 17:02:33 +01:00
.gitattributes
.gitignore Sustainable Kibana Architecture: Move modules owned by @elastic/kibana-operations (#202739) 2024-12-31 13:47:59 +01:00
.i18nrc.json SKA: Relocate @kbn/grid-layout (#206821) 2025-01-15 17:39:41 +00:00
.node-version Upgrade Node.js to 20.15.1 (#187791) 2024-07-15 12:34:07 -05:00
.npmrc [npmrc] Fix puppeteer_skip_download configuration (#177673) 2024-02-22 18:59:01 -07:00
.nvmrc Upgrade Node.js to 20.15.1 (#187791) 2024-07-15 12:34:07 -05:00
.prettierignore
.prettierrc
.puppeteerrc Add .puppeteerrc (#179847) 2024-04-03 09:14:39 -05:00
.stylelintignore
.stylelintrc Bump stylelint to ^14 (#136693) 2022-07-20 10:11:00 -05:00
.telemetryrc.json Sustainable Kibana Architecture: Move modules owned by @elastic/kibana-core (#201653) 2025-01-04 11:47:24 -07:00
.yarnrc
BUILD.bazel Transpile packages on demand, validate all TS projects (#146212) 2022-12-22 19:00:29 -06:00
catalog-info.yaml [sonarqube] Disable cron (#190611) 2024-08-15 09:19:09 -05:00
CODE_OF_CONDUCT.md
CONTRIBUTING.md
FAQ.md Fix small typos in the root md files (#134609) 2022-06-23 09:36:11 -05:00
fleet_packages.json [main] Sync bundled packages with Package Storage (#192007) 2024-09-03 12:26:57 -05:00
github_checks_reporter.json
kibana.d.ts Adds AGPL 3.0 license (#192025) 2024-09-06 19:02:41 -06:00
LICENSE.txt Adds AGPL 3.0 license (#192025) 2024-09-06 19:02:41 -06:00
NOTICE.txt [api-docs] 2025-01-01 Daily api_docs build (#205342) 2025-01-01 01:37:13 -06:00
package.json Add check to fail CI if any dependencies are unowned (#206679) 2025-01-16 09:59:04 -05:00
preinstall_check.js Adds AGPL 3.0 license (#192025) 2024-09-06 19:02:41 -06:00
README.md [README] Update version Compatibility with Elasticsearch (#116040) 2022-01-10 10:31:21 -05:00
renovate.json Add check to fail CI if any dependencies are unowned (#206679) 2025-01-16 09:59:04 -05:00
RISK_MATRIX.mdx
run_fleet_setup_parallel.sh Sustainable Kibana Architecture: Move modules owned by @elastic/fleet (#202422) 2024-12-24 15:32:43 +01:00
SECURITY.md
sonar-project.properties [sonarqube] update memory, cpu (#190547) 2024-09-09 16:16:30 -05:00
STYLEGUIDE.mdx [styleguide] update path to scss theme (#140742) 2022-09-15 10:41:14 -04:00
tsconfig.base.json SKA: Relocate @kbn/grid-layout (#206821) 2025-01-15 17:39:41 +00:00
tsconfig.browser.json
tsconfig.browser_bazel.json
tsconfig.json Transpile packages on demand, validate all TS projects (#146212) 2022-12-22 19:00:29 -06:00
TYPESCRIPT.md Fix small typos in the root md files (#134609) 2022-06-23 09:36:11 -05:00
updatecli-compose.yaml deps(updatecli): bump all policies (#195865) 2024-10-15 07:37:12 -05:00
versions.json chore(NA): update versions after v7.17.28 bump (#206648) 2025-01-15 00:28:08 +00:00
WORKSPACE.bazel chore(NA): remove usage of re2 and replace it with a non native module (#188134) 2024-07-15 20:33:28 +01:00
yarn.lock Add check to fail CI if any dependencies are unowned (#206679) 2025-01-16 09:59:04 -05:00

Kibana

Kibana is your window into the Elastic Stack. Specifically, it's a browser-based analytics and search dashboard for Elasticsearch.

Getting Started

If you just want to try Kibana out, check out the Elastic Stack Getting Started Page to give it a whirl.

If you're interested in diving a bit deeper and getting a taste of Kibana's capabilities, head over to the Kibana Getting Started Page.

Using a Kibana Release

If you want to use a Kibana release in production, give it a test run, or just play around:

Building and Running Kibana, and/or Contributing Code

You might want to build Kibana locally to contribute some code, test out the latest features, or try out an open PR:

Documentation

Visit Elastic.co for the full Kibana documentation.

For information about building the documentation, see the README in elastic/docs.

Version Compatibility with Elasticsearch

Ideally, you should be running Elasticsearch and Kibana with matching version numbers. If your Elasticsearch has an older version number or a newer major number than Kibana, then Kibana will fail to run. If Elasticsearch has a newer minor or patch number than Kibana, then the Kibana Server will log a warning.

Note: The version numbers below are only examples, meant to illustrate the relationships between different types of version numbers.

Situation Example Kibana version Example ES version Outcome
Versions are the same. 7.15.1 7.15.1 💚 OK
ES patch number is newer. 7.15.0 7.15.1 ⚠️ Logged warning
ES minor number is newer. 7.14.2 7.15.0 ⚠️ Logged warning
ES major number is newer. 7.15.1 8.0.0 🚫 Fatal error
ES patch number is older. 7.15.1 7.15.0 ⚠️ Logged warning
ES minor number is older. 7.15.1 7.14.2 🚫 Fatal error
ES major number is older. 8.0.0 7.15.1 🚫 Fatal error

Questions? Problems? Suggestions?

  • If you've found a bug or want to request a feature, please create a GitHub Issue. Please check to make sure someone else hasn't already created an issue for the same topic.
  • Need help using Kibana? Ask away on our Kibana Discuss Forum and a fellow community member or Elastic engineer will be glad to help you out.