Skip to content

Commit

Permalink
filter by initial policy ID
Browse files Browse the repository at this point in the history
  • Loading branch information
pzl committed Aug 27, 2020
1 parent 4b5a067 commit 636190b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ import { getHostPolicyResponseHandler } from './handlers';

export const BASE_POLICY_RESPONSE_ROUTE = `/api/endpoint/policy_response`;

export const INITIAL_POLICY_ID = '00000000-0000-0000-0000-000000000000';

export function registerPolicyRoutes(router: IRouter, endpointAppContext: EndpointAppContext) {
router.get(
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import { SearchResponse } from 'elasticsearch';
import { ILegacyScopedClusterClient } from 'kibana/server';
import { GetHostPolicyResponse, HostPolicyResponse } from '../../../../common/endpoint/types';
import { INITIAL_POLICY_ID } from './index';

export function getESQueryPolicyResponseByHostID(hostID: string, index: string) {
return {
Expand All @@ -20,7 +21,7 @@ export function getESQueryPolicyResponseByHostID(hostID: string, index: string)
},
must_not: {
term: {
'Endpoint.policy.applied.name': 'initial',
'Endpoint.policy.applied.id': INITIAL_POLICY_ID,
},
},
},
Expand Down

0 comments on commit 636190b

Please sign in to comment.