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

Task/endpointlist actions #76555

Merged
merged 16 commits into from Sep 14, 2020
Merged

Conversation

parkiino
Copy link
Contributor

@parkiino parkiino commented Sep 2, 2020

Summary

Issue: https://github.com/elastic/security-team/issues/115

  • Adds an Actions column to the Endpoint List
  • Action Menu contains 3 links: Security Solution Hosts Page, Ingest Agent Details Page, and Ingest Policy Details Page
  • Tests
  • Additionally adds an update to the ingest manager script to enroll an agent

endpointactions
gif doesn't include the last action, because the correct agent id wasn't grabbed when i mocked the data, the link works tho

Checklist

Delete any items that are not applicable to this PR.

For maintainers

@parkiino parkiino added v8.0.0 release_note:skip Skip the PR/issue when compiling release notes Team:Endpoint Management Feature:Endpoint Elastic Endpoint feature v7.10.0 labels Sep 2, 2020
@parkiino parkiino requested a review from a team as a code owner September 2, 2020 18:55
@parkiino parkiino requested a review from a team September 2, 2020 18:55
@parkiino parkiino requested a review from a team as a code owner September 2, 2020 18:55
@elasticmachine
Copy link
Contributor

Pinging @elastic/endpoint-management (Team:Endpoint Management)

@elasticmachine
Copy link
Contributor

Pinging @elastic/endpoint-app-team (Feature:Endpoint)

@botelastic botelastic bot added the Team:Fleet Team label for Observability Data Collection Fleet team label Sep 2, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/ingest-management (Team:Ingest Management)

@@ -104,6 +104,7 @@ async function enroll(kibanaURL: string, apiKey: string, log: ToolingLog): Promi
ip: '127.0.0.1',
system: `${os.type()} ${os.release()}`,
memory: os.totalmem(),
elastic: { agent: { version: '8.0.0' } },
Copy link
Member

Choose a reason for hiding this comment

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

maybe we can rely on kibana package.json version here?

Copy link
Contributor

Choose a reason for hiding this comment

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

👍

@parkiino that's something that I was also planning to do in the pending PR that enhances our dev data generator loader utility

Copy link
Contributor Author

@parkiino parkiino Sep 3, 2020

Choose a reason for hiding this comment

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

ok good to know

@@ -52,6 +52,8 @@ export interface EndpointState {
endpointPackageInfo?: GetPackagesResponse['response'][0];
/** tracks the list of policies IDs used in Host metadata that may no longer exist */
nonExistingPolicies: Record<string, boolean>;
/** List of Agent Policies Ids*/
agentPolicies: Record<string, string>;
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe:

Suggested change
agentPolicies: Record<string, string>;
agentPolicies: PolicyIds['agentPolicy']

@@ -52,6 +52,8 @@ export interface EndpointState {
endpointPackageInfo?: GetPackagesResponse['response'][0];
/** tracks the list of policies IDs used in Host metadata that may no longer exist */
nonExistingPolicies: Record<string, boolean>;
/** List of Agent Policies Ids*/
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you expand the description here a bit. Maybe:

Suggested change
/** List of Agent Policies Ids*/
/** A a list of Package Policy IDs (received via Endpoint metadata/policy response) mapped to associated Fleet parent Agent Config */

data-test-subj="hostLink"
appId="securitySolution"
appPath={`hosts/${item.metadata.host.hostname}`}
href={`${services?.application?.getUrlForApp('securitySolution')}/hosts/${
Copy link
Contributor

Choose a reason for hiding this comment

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

For the Security Solution URLs, I think methods exists (similar to the ones we have) that return both the path and the href. We should use those instead of building these paths manually

appPath={`#/policies/${
agentPolicies[item.metadata.Endpoint.policy.applied.id]
}`}
href={`${services?.application?.getUrlForApp('ingestManager')}#/policies/${
Copy link
Contributor

Choose a reason for hiding this comment

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

I just found that Ingest also has a set of methods that allows us to get the path to the different pages:

export const pagePathGetters: {
[key in StaticPage]: () => string;
} &
{
[key in DynamicPage]: (values: DynamicPagePathValues) => string;
} = {
overview: () => '/',
integrations: () => '/integrations',
integrations_all: () => '/integrations',
integrations_installed: () => '/integrations/installed',
integration_details: ({ pkgkey, panel }) =>
`/integrations/detail/${pkgkey}${panel ? `/${panel}` : ''}`,
policies: () => '/policies',
policies_list: () => '/policies',
policy_details: ({ policyId, tabId }) => `/policies/${policyId}${tabId ? `/${tabId}` : ''}`,
add_integration_from_policy: ({ policyId }) => `/policies/${policyId}/add-integration`,
add_integration_to_policy: ({ pkgkey }) => `/integrations/${pkgkey}/add-integration`,
edit_integration: ({ policyId, packagePolicyId }) =>
`/policies/${policyId}/edit-integration/${packagePolicyId}`,
fleet: () => '/fleet',
fleet_agent_list: ({ kuery }) => `/fleet/agents${kuery ? `?kuery=${kuery}` : ''}`,
fleet_agent_details: ({ agentId, tabId }) =>
`/fleet/agents/${agentId}${tabId ? `/${tabId}` : ''}`,
fleet_enrollment_tokens: () => '/fleet/enrollment-tokens',
data_streams: () => '/data-streams',
};

This however, does not seem to be exported at the ingest_manager/public level, so we can't reference it just yet. but maybe we open a separate issue to use it and then refactor this here (and possibly other locations in our code) to use it?

cc:/ @jen-huang , @nchaulet 😬

Copy link
Contributor

Choose a reason for hiding this comment

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

feel free to export and use this whenever :)

@@ -106,7 +109,7 @@ const endpointListApiPathHandlerMocks = ({
// Do policies referenced in endpoint list exist
// just returns 1 single agent policy that includes all of the packagePolicy IDs provided
[INGEST_API_AGENT_POLICIES]: (): GetAgentPoliciesResponse => {
const agentPolicy = generator.generateAgentPolicy();
// const agentPolicy = generator.generateAgentPolicy();
Copy link
Contributor Author

Choose a reason for hiding this comment

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

will remove this

Copy link
Contributor

@kevinlog kevinlog left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Build metrics

async chunks size

id value diff baseline
securitySolution 10.0MB +15.5KB 10.0MB

page load bundle size

id value diff baseline
ingestManager 468.6KB +268.0B 468.4KB
securitySolution 793.2KB +240.0B 793.0KB
total +508.0B

History

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.

LGTM 👍

🚀


// @ts-ignore
Copy link
Contributor

Choose a reason for hiding this comment

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

Interesting - what was the TS error?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

image

@parkiino parkiino merged commit 1a49c4e into elastic:master Sep 14, 2020
gmmorris added a commit to gmmorris/kibana that referenced this pull request Sep 14, 2020
* master: (65 commits)
  [Security Solution][Resolver] Analyzed event styling (elastic#77115)
  filter invalid SOs from the searc hresults in Task Manager (elastic#76891)
  [RUM Dashboard] Visitors by region map (elastic#77135)
  [Security Solution][Endpoint][Admin] Task/endpoint list actions (elastic#76555)
  [Ingest pipelines] Forms for processors T-U (elastic#76710)
  updating datatable type (elastic#77320)
  [ML] Fix custom URLs processing for security app (elastic#76957)
  [telemetry] add schema guideline + schema_check new check for --path config (elastic#75747)
  [ML] Transforms: API schemas and integration tests (elastic#75164)
  [Mappings editor] Add support for wildcard field type (elastic#76574)
  [Ingest Manager] Fix flyout instruction selection (elastic#77071)
  [Telemetry Tools] update lodash to 4.17 (elastic#77317)
  [APM] Service inventory redesign (elastic#76744)
  Hide management sections based on cluster/index privileges (elastic#67791)
  [Snapshot Restore] Disable steps when form is invalid (elastic#76540)
  [Mappings editor] Add support for positive_score_impact to rank_feature (elastic#76824)
  Update apm.ts (elastic#77310)
  [OBS] Remove beta badge, change news feed size and add external icon to news feed link (elastic#77164)
  [Discover] Convert legacy sort to be compatible with multi sort (elastic#76986)
  [APM] API Snapshot Testing (elastic#77229)
  ...
gmmorris added a commit to gmmorris/kibana that referenced this pull request Sep 14, 2020
* master: (65 commits)
  [Security Solution][Resolver] Analyzed event styling (elastic#77115)
  filter invalid SOs from the searc hresults in Task Manager (elastic#76891)
  [RUM Dashboard] Visitors by region map (elastic#77135)
  [Security Solution][Endpoint][Admin] Task/endpoint list actions (elastic#76555)
  [Ingest pipelines] Forms for processors T-U (elastic#76710)
  updating datatable type (elastic#77320)
  [ML] Fix custom URLs processing for security app (elastic#76957)
  [telemetry] add schema guideline + schema_check new check for --path config (elastic#75747)
  [ML] Transforms: API schemas and integration tests (elastic#75164)
  [Mappings editor] Add support for wildcard field type (elastic#76574)
  [Ingest Manager] Fix flyout instruction selection (elastic#77071)
  [Telemetry Tools] update lodash to 4.17 (elastic#77317)
  [APM] Service inventory redesign (elastic#76744)
  Hide management sections based on cluster/index privileges (elastic#67791)
  [Snapshot Restore] Disable steps when form is invalid (elastic#76540)
  [Mappings editor] Add support for positive_score_impact to rank_feature (elastic#76824)
  Update apm.ts (elastic#77310)
  [OBS] Remove beta badge, change news feed size and add external icon to news feed link (elastic#77164)
  [Discover] Convert legacy sort to be compatible with multi sort (elastic#76986)
  [APM] API Snapshot Testing (elastic#77229)
  ...
@kibanamachine kibanamachine added the backport missing Added to PRs automatically when the are determined to be missing a backport. label Sep 16, 2020
@kibanamachine
Copy link
Contributor

Friendly reminder: Looks like this PR hasn’t been backported yet.
To create backports run node scripts/backport --pr 76555 or prevent reminders by adding the backport:skip label.

parkiino added a commit that referenced this pull request Sep 16, 2020
…) (#77636)

Endpoint list actions to security solution endpoint admin
Co-authored-by: Paul Tavares <paul.tavares@elastic.co>
@kibanamachine kibanamachine removed the backport missing Added to PRs automatically when the are determined to be missing a backport. label Sep 16, 2020
@parkiino parkiino deleted the task/endpointlist-actions branch September 16, 2020 18:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Endpoint Elastic Endpoint feature release_note:skip Skip the PR/issue when compiling release notes Team:Fleet Team label for Observability Data Collection Fleet team v7.10.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants