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

[Security Solution] fix security empty overview links #101536

Merged
merged 1 commit into from
Jun 9, 2021

Conversation

joeypoon
Copy link
Member

@joeypoon joeypoon commented Jun 7, 2021

Summary

fix security empty overview "Add data with Elastic Agent" and "Add Endpoint Security" links
fix-empty-overview-links

Checklist

Delete any items that are not applicable to this PR.

@joeypoon joeypoon added auto-backport Deprecated - use backport:version if exact versions are needed release_note:skip Skip the PR/issue when compiling release notes Team:Defend Workflows “EDR Workflows” sub-team of Security Solution v7.14.0 v8.0.0 labels Jun 7, 2021
@joeypoon joeypoon requested a review from a team June 7, 2021 22:07
@joeypoon joeypoon force-pushed the fix/security-overview-links branch 2 times, most recently from 95bb471 to a6316d5 Compare June 8, 2021 22:45
@@ -63,7 +63,7 @@ describe('Policy Details', () => {
describe('when displayed with invalid id', () => {
let releaseApiFailure: () => void;
beforeEach(() => {
http.get.mockImplementationOnce(async () => {
http.get.mockImplementation(async () => {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since sendGetEndpointSecurityPackage now gets called, this is no longer the first

@@ -644,7 +644,7 @@ describe('When on the Trusted Apps Page', () => {
});

it('should trigger the List to reload', async () => {
expect(coreStart.http.get.mock.calls[0][0]).toEqual(TRUSTED_APPS_LIST_API);
expect(coreStart.http.get.mock.calls[1][0]).toEqual(TRUSTED_APPS_LIST_API);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since sendGetEndpointSecurityPackage now gets called, this is no longer the first

@joeypoon joeypoon force-pushed the fix/security-overview-links branch from a6316d5 to c2a14f7 Compare June 9, 2021 15:02
@joeypoon joeypoon changed the title fix empty overview links fix security empty overview links Jun 9, 2021
@@ -78,26 +81,14 @@ export const endpointMiddlewareFactory: ImmutableMiddlewareFactory<EndpointState

const { getState, dispatch } = store;

await getEndpointPackageInfo(getState(), dispatch, coreStart);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume there is no way to do this only for when the data is needed in the component? could we trigger off of userChangedUrl action?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had originally considered limiting this to the overview page but then I realized that all the tabs except for cases and admin uses the OverviewEmpty component and admin need this info anyways. I guess we could do a if !isCasesPage.

I was actually thinking about just doing a useEffect in OverviewEmpty to dispatch an explicit action just for getting the endpoint package info. decided to do this instead though for the consistency with how admin tab is doing it.

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
securitySolution 6.9MB 6.9MB +690.0B

History

  • 💔 Build #129978 failed a6316d57622f4e0c2d33785a235bc9a71cf0cfb3
  • 💔 Build #129633 failed f9884386b7b1bcd36ad4d74f785cedb491773714

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

Copy link
Contributor

@paul-tavares paul-tavares left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! 🔥

Left a few comments that are informational only. LGTM to merge 🚢

dispatch: Dispatch<ServerReturnedEndpointPackageInfo>,
coreStart: CoreStart
) {
if (endpointPackageInfo(state)) return;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

its probably unlikely (probably 😄 ), but the package version could change if one installed between checks. Not a big deal since URL that uses this version will still be valid, but wanted to mention it.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that's a good point.

@@ -57,7 +61,7 @@ describe('OverviewEmpty', () => {
fill: false,
label: 'Add Endpoint Security',
onClick: undefined,
url: '/app/home#/tutorial_directory/security',
url: `#/integrations/endpoint-${endpointPackageVersion}/add-integration`,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI:
I had suggested somewhere (can't find it now) that the Fleet integration page support "keywords" in the UI url instead of version, so that we did not have to pull this information before building a link. The idea as to support something like: #/integrations/endpoint-installed/add-integration or #/integrations/endpoint-latest/add-integration and the integration page would just "do the right thing" in pulling in the package information based on the keywords installed or latest. But that has not had any movement.
We also have this issue opened in Fleet to provide a better API for retrieving the package version number - #66777

cc/ @jen-huang , @jfsiii

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that would be very cool.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not exactly the same as keywords, but here is the enhancement issue for allowing to link without version: #93393
it would direct to either the currently installed version, or the latest registry version if not installed
I think we should have this implemented in this release :)

@joeypoon joeypoon marked this pull request as ready for review June 9, 2021 17:09
@elasticmachine
Copy link
Contributor

Pinging @elastic/security-onboarding-and-lifecycle-mgt (Team:Onboarding and Lifecycle Mgt)

@joeypoon joeypoon changed the title fix security empty overview links [Security Solution] fix security empty overview links Jun 9, 2021
@joeypoon joeypoon merged commit 8cf6112 into elastic:master Jun 9, 2021
@joeypoon joeypoon deleted the fix/security-overview-links branch June 9, 2021 20:06
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Jun 9, 2021
@kibanamachine
Copy link
Contributor

💚 Backport successful

Status Branch Result
7.x

This backport PR will be merged automatically after passing CI.

kibanamachine added a commit that referenced this pull request Jun 9, 2021
jloleysens added a commit to jloleysens/kibana that referenced this pull request Jun 10, 2021
…add-agent-flyout

* 'master' of github.com:elastic/kibana: (35 commits)
  [Cases] Improve connectors mapping (elastic#101145)
  [ML] Fixes display of job group badges in recognizer wizard (elastic#101775)
  Fix es_archives path (elastic#101737)
  [kbnArchiver] convert archive names to root-relative paths (elastic#101839)
  [Reporting] Make "ScreenCapturePanel" shareable for Canvas (elastic#100623)
  [Alerting UI] Converted Rules and Connectors management pages to new layout. (elastic#101697)
  [Fleet] Support granular integrations in policy editor (elastic#101531)
  [Security Solution][Detections] Update detection alert mappings to ECS v1.10.0 (elastic#101680)
  [Fleet] Integrations UI: Adjust policies list UI (elastic#101600)
  chore(NA): moving @kbn/server-route-repository into bazel (elastic#101484)
  Support owner and description attributes inside the Manifest file, use in API docs (elastic#101786)
  [Security Solution] fix security empty overview links (elastic#101536)
  Unskips migration tests now that elastic search is fixed (elastic#101682)
  Fix endpoint -> integrations onboarding link (elastic#101804)
  [Alerting] Log warning when rules are not rescheduled due to Saved Object not found error (elastic#101591)
  Update datafeed_high_count_network_denies.json (elastic#101681)
  [Index patterns] Field editor example app (elastic#100524)
  [DOCS] Adding file upload to add data page (elastic#101674)
  [Security Solution][Endpoint] Adds Endpoint Host Isolation Status common component (elastic#101782)
  Upgrade ws v7.3.1->v7.4.2 and v6.2.1->v6.2.2 (elastic#101402)
  ...

# Conflicts:
#	x-pack/plugins/fleet/public/components/agent_enrollment_flyout/agent_policy_selection.tsx
#	x-pack/plugins/fleet/public/components/agent_enrollment_flyout/index.tsx
#	x-pack/plugins/fleet/public/components/agent_enrollment_flyout/managed_instructions.tsx
#	x-pack/plugins/fleet/public/components/agent_enrollment_flyout/standalone_instructions.tsx
jloleysens added a commit to jloleysens/kibana that referenced this pull request Jun 10, 2021
…add-integrations-redirect

* 'master' of github.com:elastic/kibana: (44 commits)
  Allow navigating discover flyout via arrow keys (elastic#101772)
  [Cases] Improve connectors mapping (elastic#101145)
  [ML] Fixes display of job group badges in recognizer wizard (elastic#101775)
  Fix es_archives path (elastic#101737)
  [kbnArchiver] convert archive names to root-relative paths (elastic#101839)
  [Reporting] Make "ScreenCapturePanel" shareable for Canvas (elastic#100623)
  [Alerting UI] Converted Rules and Connectors management pages to new layout. (elastic#101697)
  [Fleet] Support granular integrations in policy editor (elastic#101531)
  [Security Solution][Detections] Update detection alert mappings to ECS v1.10.0 (elastic#101680)
  [Fleet] Integrations UI: Adjust policies list UI (elastic#101600)
  chore(NA): moving @kbn/server-route-repository into bazel (elastic#101484)
  Support owner and description attributes inside the Manifest file, use in API docs (elastic#101786)
  [Security Solution] fix security empty overview links (elastic#101536)
  Unskips migration tests now that elastic search is fixed (elastic#101682)
  Fix endpoint -> integrations onboarding link (elastic#101804)
  [Alerting] Log warning when rules are not rescheduled due to Saved Object not found error (elastic#101591)
  Update datafeed_high_count_network_denies.json (elastic#101681)
  [Index patterns] Field editor example app (elastic#100524)
  [DOCS] Adding file upload to add data page (elastic#101674)
  [Security Solution][Endpoint] Adds Endpoint Host Isolation Status common component (elastic#101782)
  ...

# Conflicts:
#	x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/index.tsx
#	x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/details_page/components/package_policies/package_policies_table.tsx
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-backport Deprecated - use backport:version if exact versions are needed release_note:skip Skip the PR/issue when compiling release notes Team:Defend Workflows “EDR Workflows” sub-team of Security Solution v7.14.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants