Skip to content

Commit

Permalink
[Security Solution] [Resolver] Remove related events api (elastic#79036)
Browse files Browse the repository at this point in the history
* Removing old related events route

* Removing outer describe block

Co-authored-by: Elastic Machine <[email protected]>
  • Loading branch information
jonathan-buttner and elasticmachine committed Oct 12, 2020
1 parent f3a5dcb commit 3e5aecc
Show file tree
Hide file tree
Showing 13 changed files with 124 additions and 705 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,23 +23,6 @@ export const validateTree = {
}),
};

/**
* Used to validate GET requests for non process events for a specific event.
*/
export const validateRelatedEvents = {
params: schema.object({ id: schema.string({ minLength: 1 }) }),
query: schema.object({
events: schema.number({ defaultValue: 1000, min: 1, max: 10000 }),
afterEvent: schema.maybe(schema.string()),
legacyEndpointID: schema.maybe(schema.string({ minLength: 1 })),
}),
body: schema.nullable(
schema.object({
filter: schema.maybe(schema.string()),
})
),
};

/**
* Used to validate POST requests for `/resolver/events` api.
*/
Expand Down
10 changes: 0 additions & 10 deletions x-pack/plugins/security_solution/common/endpoint/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,6 @@ export interface SafeResolverTree {
*/
entityID: string;
children: SafeResolverChildren;
relatedEvents: Omit<SafeResolverRelatedEvents, 'entityID'>;
relatedAlerts: Omit<ResolverRelatedAlerts, 'entityID'>;
ancestry: SafeResolverAncestry;
lifecycle: SafeResolverEvent[];
Expand Down Expand Up @@ -267,15 +266,6 @@ export interface ResolverRelatedEvents {
nextEvent: string | null;
}

/**
* Safe version of `ResolverRelatedEvents`
*/
export interface SafeResolverRelatedEvents {
entityID: string;
events: SafeResolverEvent[];
nextEvent: string | null;
}

/**
* Response structure for the events route.
* `nextEvent` will be set to null when at the time of querying there were no more results to retrieve from ES.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,12 @@ import { IRouter } from 'kibana/server';
import { EndpointAppContext } from '../types';
import {
validateTree,
validateRelatedEvents,
validateEvents,
validateChildren,
validateAncestry,
validateAlerts,
validateEntities,
} from '../../../common/endpoint/schema/resolver';
import { handleRelatedEvents } from './resolver/related_events';
import { handleChildren } from './resolver/children';
import { handleAncestry } from './resolver/ancestry';
import { handleTree } from './resolver/tree';
Expand All @@ -26,17 +24,6 @@ import { handleEvents } from './resolver/events';
export function registerResolverRoutes(router: IRouter, endpointAppContext: EndpointAppContext) {
const log = endpointAppContext.logFactory.get('resolver');

// this route will be removed in favor of the one below
router.post(
{
// @deprecated use `/resolver/events` instead
path: '/api/endpoint/resolver/{id}/events',
validate: validateRelatedEvents,
options: { authRequired: true },
},
handleRelatedEvents(log, endpointAppContext)
);

router.post(
{
path: '/api/endpoint/resolver/events',
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit 3e5aecc

Please sign in to comment.