-
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
Add 'inventory' item to Security navigation menu #204373
Conversation
83dc7b1
to
73fe3bd
Compare
Pinging @elastic/kibana-cloud-security-posture (Team:Cloud Security) |
346c865
to
05e75f5
Compare
x-pack/solutions/security/plugins/security_solution/public/asset_inventory/pages/index.tsx
Outdated
Show resolved
Hide resolved
x-pack/solutions/security/plugins/asset_inventory/public/components/app.tsx
Outdated
Show resolved
Hide resolved
179afb6
to
5c28360
Compare
5c28360
to
c20c974
Compare
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
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
@elasticmachine merge upstream |
|
||
return ( | ||
<SecuritySolutionPageWrapper noPadding> | ||
{assetInventory.getAssetInventoryPage({})} |
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.
Would it make more sense to make it just {assetInventory.getAssetInventoryPage()}
here?
Are we able to assembled the param AppPluginStartDependencies
the function needs in x-pack/solutions/security/plugins/asset_inventory/public/plugin.ts, so we don't need to provided it as a param?
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 agree with you, though this is just temporary because we are not passing in any dependency for now
|
||
export const routes: SecuritySubPluginRoutes = [ | ||
{ | ||
path: ExperimentalFeaturesService.get().assetInventoryStoreEnabled ? ASSET_INVENTORY_PATH : [], |
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 we can just put path: ASSET_INVENTORY_PATH,
here,
I believe the feature flag should have been taken into account via experimentalKey
in x-pack/solutions/security/plugins/security_solution/public/asset_inventory/links.ts
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.
@angorayc Doesn't experimentalKey
only affect the link's visibility based on the flag? Here we wanted to prevent users from accessing the plugin's page by manually entering the URL. If you confirm we still don't need to do that, I can remove it ofc
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.
Yes, SecurityRoutePageWrapper
takes care of that. You can test the page stays unaccessible without this check when the flag is off
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.
@semd I forgot auto-merge was enabled, but will take care of that for sure!
<EuiPageTemplate.Header> | ||
<EuiTitle size="l"> | ||
<h1> | ||
<FormattedMessage id="assetInventory.allAssets" defaultMessage="All Assets" /> |
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.
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.
Hmm I can bring it up in the next UX weekly meeting. I'm just following this Figma mockup.
💚 Build Succeeded
Metrics [docs]Module Count
Public APIs missing comments
Async chunks
Public APIs missing exports
Page load bundle
Unknown metric groupsAPI count
References to deprecated APIs
History
cc @albertoblaz |
return ( | ||
<SecuritySolutionPageWrapper noPadding> | ||
{assetInventory.getAssetInventoryPage({})} | ||
<SpyRoute pageName={SecurityPageName.assetInventory} /> |
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.
That's good, but SecurityRoutePageWrapper
already adds the SpyRoute
implicitly, no need to add it again :)
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.
@semd Didn't know that either, thanks a lot. Will take care of that in a follow-up PR
|
||
export const routes: SecuritySubPluginRoutes = [ | ||
{ | ||
path: ExperimentalFeaturesService.get().assetInventoryStoreEnabled ? ASSET_INVENTORY_PATH : [], |
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.
Yes, SecurityRoutePageWrapper
takes care of that. You can test the page stays unaccessible without this check when the flag is off
## Summary Add 'inventory' item to Security navigation menu (either when the sidebar is expanded and the full navigation menu is shown or when the sidebar is collapsed and only the Security menu is visible). ### Changeset details - Render 'inventory' item and enable `/app/security/asset_inventory` route both conditionally based on feature flag - Async loading/rendering of AssetInventory main page from within SecuritySolution plugin - Delete unnecessary boilerplate existing in AssetInventory ### Out of scope - AssetInventory nav sub-menu is skipped until more concrete requirements are defined on what to do with them ### How to test Activate the feature flag by adding this line to your local `kibana.dev.yml`: ```yml xpack.securitySolution.enableExperimental: ['assetInventoryStoreEnabled'] ``` ### Screenshots <details><summary>Full menu (expanded mode)</summary> <img width="240" alt="Screenshot 2024-12-16 at 13 12 45" src="https://github.com/user-attachments/assets/f0939f38-5be6-481b-ace1-07f46f3622ae" /> </details> <details><summary>Only Security menu (collapsed mode)</summary> <img width="256" alt="Screenshot 2024-12-16 at 13 12 33" src="https://github.com/user-attachments/assets/b0bd62f0-5cea-4b7b-a731-3a53be362192" /> </details> <details><summary>AssetInventory loaded async from within Security Solution</summary> <img width="1640" alt="Screenshot 2024-12-16 at 17 23 01" src="https://github.com/user-attachments/assets/b84716c9-6b18-4225-bf71-62c8ef07b302" /> </details> ### Checklist - [x] If a plugin configuration key changed, check if it needs to be allowlisted in the cloud and added to the [docker list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker) - [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. Navigation item will be added if and only if feature flag is enabled, which shouldn't happen for end users until development is completed.
## Summary Add 'inventory' item to Security navigation menu (either when the sidebar is expanded and the full navigation menu is shown or when the sidebar is collapsed and only the Security menu is visible). ### Changeset details - Render 'inventory' item and enable `/app/security/asset_inventory` route both conditionally based on feature flag - Async loading/rendering of AssetInventory main page from within SecuritySolution plugin - Delete unnecessary boilerplate existing in AssetInventory ### Out of scope - AssetInventory nav sub-menu is skipped until more concrete requirements are defined on what to do with them ### How to test Activate the feature flag by adding this line to your local `kibana.dev.yml`: ```yml xpack.securitySolution.enableExperimental: ['assetInventoryStoreEnabled'] ``` ### Screenshots <details><summary>Full menu (expanded mode)</summary> <img width="240" alt="Screenshot 2024-12-16 at 13 12 45" src="https://github.com/user-attachments/assets/f0939f38-5be6-481b-ace1-07f46f3622ae" /> </details> <details><summary>Only Security menu (collapsed mode)</summary> <img width="256" alt="Screenshot 2024-12-16 at 13 12 33" src="https://github.com/user-attachments/assets/b0bd62f0-5cea-4b7b-a731-3a53be362192" /> </details> <details><summary>AssetInventory loaded async from within Security Solution</summary> <img width="1640" alt="Screenshot 2024-12-16 at 17 23 01" src="https://github.com/user-attachments/assets/b84716c9-6b18-4225-bf71-62c8ef07b302" /> </details> ### Checklist - [x] If a plugin configuration key changed, check if it needs to be allowlisted in the cloud and added to the [docker list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker) - [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. Navigation item will be added if and only if feature flag is enabled, which shouldn't happen for end users until development is completed.
## Summary Add 'inventory' item to Security navigation menu (either when the sidebar is expanded and the full navigation menu is shown or when the sidebar is collapsed and only the Security menu is visible). ### Changeset details - Render 'inventory' item and enable `/app/security/asset_inventory` route both conditionally based on feature flag - Async loading/rendering of AssetInventory main page from within SecuritySolution plugin - Delete unnecessary boilerplate existing in AssetInventory ### Out of scope - AssetInventory nav sub-menu is skipped until more concrete requirements are defined on what to do with them ### How to test Activate the feature flag by adding this line to your local `kibana.dev.yml`: ```yml xpack.securitySolution.enableExperimental: ['assetInventoryStoreEnabled'] ``` ### Screenshots <details><summary>Full menu (expanded mode)</summary> <img width="240" alt="Screenshot 2024-12-16 at 13 12 45" src="https://github.com/user-attachments/assets/f0939f38-5be6-481b-ace1-07f46f3622ae" /> </details> <details><summary>Only Security menu (collapsed mode)</summary> <img width="256" alt="Screenshot 2024-12-16 at 13 12 33" src="https://github.com/user-attachments/assets/b0bd62f0-5cea-4b7b-a731-3a53be362192" /> </details> <details><summary>AssetInventory loaded async from within Security Solution</summary> <img width="1640" alt="Screenshot 2024-12-16 at 17 23 01" src="https://github.com/user-attachments/assets/b84716c9-6b18-4225-bf71-62c8ef07b302" /> </details> ### Checklist - [x] If a plugin configuration key changed, check if it needs to be allowlisted in the cloud and added to the [docker list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker) - [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. Navigation item will be added if and only if feature flag is enabled, which shouldn't happen for end users until development is completed.
Summary
Closes #201706.
Add 'inventory' item to Security navigation menu (either when the sidebar is expanded and the full navigation menu is shown or when the sidebar is collapsed and only the Security menu is visible).
Changeset details
/app/security/asset_inventory
route both conditionally based on feature flagOut of scope
How to test
Activate the feature flag by adding this line to your local
kibana.dev.yml
:Screenshots
Full menu (expanded mode)
Only Security menu (collapsed mode)
AssetInventory loaded async from within Security Solution
Checklist
release_note:*
label is applied per the guidelinesRisks
No risks. Navigation item will be added if and only if feature flag is enabled, which shouldn't happen for end users until development is completed.