-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Create the "Asset Inventory" Kibana Plugin #202291
Create the "Asset Inventory" Kibana Plugin #202291
Conversation
2c5c68d
to
4df3e74
Compare
// TODO initialize transforms here | ||
// await initializeTransform(esClient, <TRANSFORM_HERE>, logger); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NOTE: Placeholder for transforms initialization. Please let me know if this is enough or if I should uncomment the line and add some specific transforms
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file was copy-pasted from x-pack/plugins/cloud_security_posture/server/create_transforms/create_transforms.ts
. Let me know if we should reuse it somehow instead
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO it would be better to add this when you know you need it so it is not forgotten.
🤔 Asset Inventory likely needs transformers, however, are the changes for asset inventory minimal? Maybe we should consider creating a shared transformer package
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we should consider creating a shared transformer package
I think that's a great idea, the transform methods can be adapted to be more general, and we can also leverage our team package where we see fit.
If you prefer that can be done on a follow-up PR, we can keep this file for now and create a follow-up Github issue to move to the shared package.
// TODO Invoke initialize() when it's due | ||
// this.initialize(core).catch(() => {}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NOTE: Uncomment this line to initialize transforms on start
"public/**/*.json", | ||
"server/**/*.ts", | ||
"server/**/*.json", | ||
// "../../typings/**/*", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To-do: Remove comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just thinking if it would be easier to exclude. 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall LGTM, there are some project files I think we should not need, but the code looks good to go except for 1 suggestion.
showSearchBar={true} | ||
useDefaultBehaviors={true} | ||
/> | ||
<EuiPageTemplate restrictWidth="1000px"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are we restricting the width to 1000px
?
🤔 Should we use break points here?
https://eui.elastic.co/#/theming/breakpoints/values
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was auto-generated by the script. I agree we should change it but the UI is not relevant at this point. We just wanted to have an empty plugin to start working upon it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO it would be better to add this when you know you need it so it is not forgotten.
🤔 Asset Inventory likely needs transformers, however, are the changes for asset inventory minimal? Maybe we should consider creating a shared transformer package
"public/**/*.json", | ||
"server/**/*.ts", | ||
"server/**/*.json", | ||
// "../../typings/**/*", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just thinking if it would be easier to exclude. 🤔
One thing that I did see in the Fleet plugin was that they had their Cypress test in the plugin directory, which is WAY more convenient than having them in I am not saying we should use Cypress or Selinium, but keeping the integration tests local would make more sense if we can. |
Yeah, 100% agree. I prefer having source code and tests next to each other rather than in a totally different folder. I haven't created any |
98c00bb
to
031a4fc
Compare
Pinging @elastic/kibana-cloud-security-posture (Team:Cloud Security) |
"xpack", | ||
"assetInventory" | ||
], | ||
"requiredPlugins": ["navigation"], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's ok as it is to get started with the plugin, and then we add the required plugins as needed
I am pretty sure that we need the
security
if the plugin falls in the Security section of Kibana.
security is actually not related to the security solution, it's a plugin that exposes authorization and authentication services. Not needed at the moment as there's no server-side API implemented.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we should consider creating a shared transformer package
I think that's a great idea, the transform methods can be adapted to be more general, and we can also leverage our team package where we see fit.
If you prefer that can be done on a follow-up PR, we can keep this file for now and create a follow-up Github issue to move to the shared package.
- Move to x-pack/plugins folder
- Add author - Use consistent naming - Remove unused scripts - Add license - Set version to 1.0.0
- Will style with @emotion/react instead
- package.json, tsconfig.json, yarn.lock
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, thanks for providing a great starter for the asset inventory plugin
💛 Build succeeded, but was flaky
Failed CI StepsMetrics [docs]Module Count
Public APIs missing comments
Async chunks
Page load bundle
Unknown metric groupsAPI count
async chunk count
ESLint disabled line counts
References to deprecated APIs
Total ESLint disabled count
History
cc @albertoblaz |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Starting backport for target branches: 8.x https://github.com/elastic/kibana/actions/runs/12137753913 |
💔 All backports failed
Manual backportTo create the backport manually run:
Questions ?Please refer to the Backport tool documentation |
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
# Backport This will backport the following commits from `main` to `8.x`: - [Create the "Asset Inventory" Kibana Plugin (#202291)](#202291) <!--- Backport version: 8.9.8 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Alberto Blázquez","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-12-03T10:29:53Z","message":"Create the \"Asset Inventory\" Kibana Plugin (#202291)\n\n## Summary\r\n\r\nCloses https://github.com/elastic/kibana/issues/201704.\r\n\r\nCreate an empty \"Asset Inventory\" plugin with the minimal boilerplate\r\nrequired to set it up, install it and run it on Kibana with a blank\r\nslate.\r\n\r\nI generated the files using the `node scripts/generate_plugin <NAME>`\r\nscript as per [this documentation\r\npage](https://docs.elastic.dev/kibana-dev-docs/getting-started/hello-world-app#2-option-2---use-the-automatic-plugin-generator).\r\n\r\n### Screenshots\r\n\r\n\r\n<details><summary>Main page (Sample page)</summary>\r\n<img width=\"2498\" alt=\"Screenshot 2024-11-29 at 14 20 57\"\r\nsrc=\"https://github.com/user-attachments/assets/9d8a3751-519b-4661-bc90-cbb1e836b111\">\r\n</details> \r\n\r\n### Implementation details\r\n\r\n- [x] Generated a new Kibana plugin with minimal boilerplate and zero\r\ndependencies\r\n- [x] Use [Cloud Security\r\nPosture](https://github.com/elastic/kibana/tree/main/x-pack/plugins/cloud_security_posture)\r\nplugin as configuration reference\r\n- [x] Render \"Inventory\" title on the main page\r\n- [x] Ensure the plugin is properly integrated into Kibana's build and\r\ncan be loaded without errors\r\n- [x] Place the plugin under the `x-pack/plugins` directory\r\n- [x] Include Readme file\r\n- [x] Introduce placeholders for initialization of pipelines and\r\ntransforms following [Cloud Security\r\nPosture](https://github.com/elastic/kibana/blob/main/x-pack/plugins/cloud_security_posture/server/plugin.ts)\r\nplugin initialize function.\r\n\r\n### PR Checklist\r\n\r\n- [ ] No docs for now\r\n~~[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)\r\nwas added for features that require explanation or tutorials~~\r\n- [x] The PR description includes the appropriate Release Notes section,\r\nand the correct `release_note:*` label is applied per the\r\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\r\n\r\n### Risks\r\n\r\nNo risks at all since this is totally green-field and will be hidden by\r\na feature toggle.\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine <[email protected]>\r\nCo-authored-by: Paulo Silva <[email protected]>","sha":"e5b1773971656ad9529935832675b5f9c1849594","branchLabelMapping":{"^v9.0.0$":"main","^v8.18.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","v9.0.0","Team:Cloud Security","backport:prev-minor","backport:version","v8.18.0"],"number":202291,"url":"https://github.com/elastic/kibana/pull/202291","mergeCommit":{"message":"Create the \"Asset Inventory\" Kibana Plugin (#202291)\n\n## Summary\r\n\r\nCloses https://github.com/elastic/kibana/issues/201704.\r\n\r\nCreate an empty \"Asset Inventory\" plugin with the minimal boilerplate\r\nrequired to set it up, install it and run it on Kibana with a blank\r\nslate.\r\n\r\nI generated the files using the `node scripts/generate_plugin <NAME>`\r\nscript as per [this documentation\r\npage](https://docs.elastic.dev/kibana-dev-docs/getting-started/hello-world-app#2-option-2---use-the-automatic-plugin-generator).\r\n\r\n### Screenshots\r\n\r\n\r\n<details><summary>Main page (Sample page)</summary>\r\n<img width=\"2498\" alt=\"Screenshot 2024-11-29 at 14 20 57\"\r\nsrc=\"https://github.com/user-attachments/assets/9d8a3751-519b-4661-bc90-cbb1e836b111\">\r\n</details> \r\n\r\n### Implementation details\r\n\r\n- [x] Generated a new Kibana plugin with minimal boilerplate and zero\r\ndependencies\r\n- [x] Use [Cloud Security\r\nPosture](https://github.com/elastic/kibana/tree/main/x-pack/plugins/cloud_security_posture)\r\nplugin as configuration reference\r\n- [x] Render \"Inventory\" title on the main page\r\n- [x] Ensure the plugin is properly integrated into Kibana's build and\r\ncan be loaded without errors\r\n- [x] Place the plugin under the `x-pack/plugins` directory\r\n- [x] Include Readme file\r\n- [x] Introduce placeholders for initialization of pipelines and\r\ntransforms following [Cloud Security\r\nPosture](https://github.com/elastic/kibana/blob/main/x-pack/plugins/cloud_security_posture/server/plugin.ts)\r\nplugin initialize function.\r\n\r\n### PR Checklist\r\n\r\n- [ ] No docs for now\r\n~~[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)\r\nwas added for features that require explanation or tutorials~~\r\n- [x] The PR description includes the appropriate Release Notes section,\r\nand the correct `release_note:*` label is applied per the\r\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\r\n\r\n### Risks\r\n\r\nNo risks at all since this is totally green-field and will be hidden by\r\na feature toggle.\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine <[email protected]>\r\nCo-authored-by: Paulo Silva <[email protected]>","sha":"e5b1773971656ad9529935832675b5f9c1849594"}},"sourceBranch":"main","suggestedTargetBranches":["8.x"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","labelRegex":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/202291","number":202291,"mergeCommit":{"message":"Create the \"Asset Inventory\" Kibana Plugin (#202291)\n\n## Summary\r\n\r\nCloses https://github.com/elastic/kibana/issues/201704.\r\n\r\nCreate an empty \"Asset Inventory\" plugin with the minimal boilerplate\r\nrequired to set it up, install it and run it on Kibana with a blank\r\nslate.\r\n\r\nI generated the files using the `node scripts/generate_plugin <NAME>`\r\nscript as per [this documentation\r\npage](https://docs.elastic.dev/kibana-dev-docs/getting-started/hello-world-app#2-option-2---use-the-automatic-plugin-generator).\r\n\r\n### Screenshots\r\n\r\n\r\n<details><summary>Main page (Sample page)</summary>\r\n<img width=\"2498\" alt=\"Screenshot 2024-11-29 at 14 20 57\"\r\nsrc=\"https://github.com/user-attachments/assets/9d8a3751-519b-4661-bc90-cbb1e836b111\">\r\n</details> \r\n\r\n### Implementation details\r\n\r\n- [x] Generated a new Kibana plugin with minimal boilerplate and zero\r\ndependencies\r\n- [x] Use [Cloud Security\r\nPosture](https://github.com/elastic/kibana/tree/main/x-pack/plugins/cloud_security_posture)\r\nplugin as configuration reference\r\n- [x] Render \"Inventory\" title on the main page\r\n- [x] Ensure the plugin is properly integrated into Kibana's build and\r\ncan be loaded without errors\r\n- [x] Place the plugin under the `x-pack/plugins` directory\r\n- [x] Include Readme file\r\n- [x] Introduce placeholders for initialization of pipelines and\r\ntransforms following [Cloud Security\r\nPosture](https://github.com/elastic/kibana/blob/main/x-pack/plugins/cloud_security_posture/server/plugin.ts)\r\nplugin initialize function.\r\n\r\n### PR Checklist\r\n\r\n- [ ] No docs for now\r\n~~[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)\r\nwas added for features that require explanation or tutorials~~\r\n- [x] The PR description includes the appropriate Release Notes section,\r\nand the correct `release_note:*` label is applied per the\r\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\r\n\r\n### Risks\r\n\r\nNo risks at all since this is totally green-field and will be hidden by\r\na feature toggle.\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine <[email protected]>\r\nCo-authored-by: Paulo Silva <[email protected]>","sha":"e5b1773971656ad9529935832675b5f9c1849594"}},{"branch":"8.x","label":"v8.18.0","labelRegex":"^v8.18.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> --------- Co-authored-by: kibanamachine <[email protected]>
## 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]>
## 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]>
## 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]>
Summary
Closes #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.Screenshots
Main page (Sample page)
Implementation details
x-pack/plugins
directoryPR Checklist
Documentation was added for features that require explanation or tutorialsrelease_note:*
label is applied per the guidelinesRisks
No risks at all since this is totally green-field and will be hidden by a feature toggle.