Skip to content

Commit 09f4184

Browse files
albertoblazkibanamachineopauloh
authored andcommitted
Create the "Asset Inventory" Kibana Plugin (elastic#202291)
## Summary Closes elastic#201704. Create an empty "Asset Inventory" plugin with the minimal boilerplate required to set it up, install it and run it on Kibana with a blank slate. I generated the files using the `node scripts/generate_plugin <NAME>` script as per [this documentation page](https://docs.elastic.dev/kibana-dev-docs/getting-started/hello-world-app#2-option-2---use-the-automatic-plugin-generator). ### Screenshots <details><summary>Main page (Sample page)</summary> <img width="2498" alt="Screenshot 2024-11-29 at 14 20 57" src="https://github.com/user-attachments/assets/9d8a3751-519b-4661-bc90-cbb1e836b111"> </details> ### Implementation details - [x] Generated a new Kibana plugin with minimal boilerplate and zero dependencies - [x] Use [Cloud Security Posture](https://github.com/elastic/kibana/tree/main/x-pack/plugins/cloud_security_posture) plugin as configuration reference - [x] Render "Inventory" title on the main page - [x] Ensure the plugin is properly integrated into Kibana's build and can be loaded without errors - [x] Place the plugin under the `x-pack/plugins` directory - [x] Include Readme file - [x] Introduce placeholders for initialization of pipelines and transforms following [Cloud Security Posture](https://github.com/elastic/kibana/blob/main/x-pack/plugins/cloud_security_posture/server/plugin.ts) plugin initialize function. ### PR Checklist - [ ] No docs for now ~~[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html) was added for features that require explanation or tutorials~~ - [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 since this is totally green-field and will be hidden by a feature toggle. --------- Co-authored-by: kibanamachine <[email protected]> Co-authored-by: Paulo Silva <[email protected]>
1 parent 5981061 commit 09f4184

File tree

21 files changed

+462
-0
lines changed

21 files changed

+462
-0
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -867,6 +867,7 @@ x-pack/plugins/ai_infra/llm_tasks @elastic/appex-ai-infra
867867
x-pack/plugins/ai_infra/product_doc_base @elastic/appex-ai-infra
868868
x-pack/plugins/aiops @elastic/ml-ui
869869
x-pack/plugins/alerting @elastic/response-ops
870+
x-pack/plugins/asset_inventory @elastic/kibana-cloud-security-posture
870871
x-pack/plugins/banners @elastic/appex-sharedux
871872
x-pack/plugins/canvas @elastic/kibana-presentation
872873
x-pack/plugins/cases @elastic/response-ops

docs/developer/plugin-list.asciidoc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -470,6 +470,10 @@ The plugin exposes the static DefaultEditorController class to consume.
470470
|WARNING: Missing README.
471471
472472
473+
|{kib-repo}blob/{branch}/x-pack/plugins/asset_inventory/README.md[assetInventory]
474+
|Centralized asset inventory experience within the Elastic Security solution. A central place for users to view and manage all their assets from different environments.
475+
476+
473477
|{kib-repo}blob/{branch}/x-pack/plugins/banners/README.md[banners]
474478
|Allow to add a header banner that will be displayed on every page of the Kibana application
475479

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,7 @@
191191
"@kbn/apm-utils": "link:packages/kbn-apm-utils",
192192
"@kbn/app-link-test-plugin": "link:test/plugin_functional/plugins/app_link_test",
193193
"@kbn/application-usage-test-plugin": "link:x-pack/test/usage_collection/plugins/application_usage_test",
194+
"@kbn/asset-inventory-plugin": "link:x-pack/plugins/asset_inventory",
194195
"@kbn/audit-log-plugin": "link:x-pack/test/security_api_integration/plugins/audit_log",
195196
"@kbn/avc-banner": "link:packages/kbn-avc-banner",
196197
"@kbn/banners-plugin": "link:x-pack/plugins/banners",

packages/kbn-optimizer/limits.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ pageLoadAssetSize:
55
aiops: 17680
66
alerting: 106936
77
apm: 64385
8+
assetInventory: 18478
89
banners: 17946
910
bfetch: 22837
1011
canvas: 29355

tsconfig.base.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,8 @@
9696
"@kbn/app-link-test-plugin/*": ["test/plugin_functional/plugins/app_link_test/*"],
9797
"@kbn/application-usage-test-plugin": ["x-pack/test/usage_collection/plugins/application_usage_test"],
9898
"@kbn/application-usage-test-plugin/*": ["x-pack/test/usage_collection/plugins/application_usage_test/*"],
99+
"@kbn/asset-inventory-plugin": ["x-pack/plugins/asset_inventory"],
100+
"@kbn/asset-inventory-plugin/*": ["x-pack/plugins/asset_inventory/*"],
99101
"@kbn/audit-log-plugin": ["x-pack/test/security_api_integration/plugins/audit_log"],
100102
"@kbn/audit-log-plugin/*": ["x-pack/test/security_api_integration/plugins/audit_log/*"],
101103
"@kbn/avc-banner": ["packages/kbn-avc-banner"],
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Asset Inventory Kibana Plugin
2+
3+
Centralized asset inventory experience within the Elastic Security solution. A central place for users to view and manage all their assets from different environments.
4+
5+
---
6+
7+
## Development
8+
9+
See the [kibana contributing guide](https://github.com/elastic/kibana/blob/main/CONTRIBUTING.md) for instructions setting up your development environment.
10+
11+
## Testing
12+
13+
For general guidelines, read [Kibana Testing Guide](https://www.elastic.co/guide/en/kibana/current/development-tests.html) for more details
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
/*
2+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
3+
* or more contributor license agreements. Licensed under the Elastic License
4+
* 2.0; you may not use this file except in compliance with the Elastic License
5+
* 2.0.
6+
*/
7+
export const PLUGIN_ID = 'assetInventory';
8+
export const PLUGIN_NAME = 'assetInventory';
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"type": "plugin",
3+
"id": "@kbn/asset-inventory-plugin",
4+
"owner": ["@elastic/kibana-cloud-security-posture"],
5+
"group": "security",
6+
"visibility": "private",
7+
"description": "Centralized asset inventory experience within the Elastic Security solution. A central place for users to view and manage all their assets from different environments",
8+
"plugin": {
9+
"id": "assetInventory",
10+
"browser": true,
11+
"server": true,
12+
"configPath": ["xpack", "assetInventory"],
13+
"requiredPlugins": [],
14+
"requiredBundles": [],
15+
"optionalPlugins": []
16+
}
17+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"author": "Elastic",
3+
"name": "@kbn/asset-inventory-plugin",
4+
"version": "1.0.0",
5+
"private": true,
6+
"license": "Elastic License 2.0"
7+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
/*
2+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
3+
* or more contributor license agreements. Licensed under the Elastic License
4+
* 2.0; you may not use this file except in compliance with the Elastic License
5+
* 2.0.
6+
*/
7+
import React from 'react';
8+
import ReactDOM from 'react-dom';
9+
import type { AppMountParameters, CoreStart } from '@kbn/core/public';
10+
import type { AppPluginStartDependencies } from './types';
11+
import { AssetInventoryApp } from './components/app';
12+
13+
export const renderApp = (
14+
{ notifications, http }: CoreStart,
15+
{}: AppPluginStartDependencies,
16+
{ appBasePath, element }: AppMountParameters
17+
) => {
18+
ReactDOM.render(
19+
<AssetInventoryApp basename={appBasePath} notifications={notifications} http={http} />,
20+
element
21+
);
22+
23+
return () => ReactDOM.unmountComponentAtNode(element);
24+
};

0 commit comments

Comments
 (0)