Skip to content

Commit

Permalink
[RAC] - removed changes to security solution (elastic#19)
Browse files Browse the repository at this point in the history
Removed changes made to security solution. They will be added separately later when integrating with security solution specifically.
  • Loading branch information
yctercero committed Jun 30, 2021
1 parent ed094cd commit 833a51f
Show file tree
Hide file tree
Showing 13 changed files with 10 additions and 30 deletions.
Expand Up @@ -1956,6 +1956,7 @@ describe('AlertingAuthorization', () => {
name: 'myOtherAppAlertType',
producer: 'alerts',
enabledInLicense: true,
isExportable: true,
};
const myAppAlertType: RegistryAlertType = {
actionGroups: [],
Expand All @@ -1967,6 +1968,7 @@ describe('AlertingAuthorization', () => {
name: 'myAppAlertType',
producer: 'myApp',
enabledInLicense: true,
isExportable: true,
};
const mySecondAppAlertType: RegistryAlertType = {
actionGroups: [],
Expand All @@ -1978,6 +1980,7 @@ describe('AlertingAuthorization', () => {
name: 'mySecondAppAlertType',
producer: 'myApp',
enabledInLicense: true,
isExportable: true,
};
const setOfAlertTypes = new Set([myAppAlertType, myOtherAppAlertType, mySecondAppAlertType]);

Expand Down
Expand Up @@ -51,7 +51,7 @@ describe('Alert details with unmapped fields', () => {

it('Displays the unmapped field on the table', () => {
const expectedUnmmappedField = {
row: 56,
row: 55,
field: 'unmapped',
text: 'This is the unmapped field',
};
Expand Down
Expand Up @@ -77,9 +77,6 @@
}
}
},
"owner": {
"type": "keyword"
},
"rule": {
"properties": {
"id": {
Expand Down
Expand Up @@ -34,7 +34,6 @@ export const sampleRuleSO = <T extends RuleParams>(params: T): SavedObject<Alert
actions: [],
enabled: true,
name: 'rule-name',
consumer: 'siem',
tags: ['some fake tag 1', 'some fake tag 2'],
createdBy: 'sample user',
createdAt: '2020-03-27T22:55:59.577Z',
Expand Down
Expand Up @@ -50,7 +50,6 @@ describe('buildBulkBody', () => {
_meta: {
version: SIGNALS_TEMPLATE_VERSION,
},
owner: 'siem',
parent: {
id: sampleIdGuid,
type: 'event',
Expand Down Expand Up @@ -115,7 +114,6 @@ describe('buildBulkBody', () => {
_meta: {
version: SIGNALS_TEMPLATE_VERSION,
},
owner: 'siem',
parent: {
id: sampleIdGuid,
type: 'event',
Expand Down Expand Up @@ -203,7 +201,6 @@ describe('buildBulkBody', () => {
kind: 'event',
module: 'system',
},
owner: 'siem',
parent: {
id: sampleIdGuid,
type: 'event',
Expand Down Expand Up @@ -267,7 +264,6 @@ describe('buildBulkBody', () => {
dataset: 'socket',
module: 'system',
},
owner: 'siem',
parent: {
id: sampleIdGuid,
type: 'event',
Expand Down Expand Up @@ -324,7 +320,6 @@ describe('buildBulkBody', () => {
original_event: {
kind: 'event',
},
owner: 'siem',
parent: {
id: sampleIdGuid,
type: 'event',
Expand Down Expand Up @@ -381,7 +376,6 @@ describe('buildBulkBody', () => {
version: SIGNALS_TEMPLATE_VERSION,
},
original_signal: 123,
owner: 'siem',
parent: {
id: sampleIdGuid,
type: 'event',
Expand Down Expand Up @@ -438,7 +432,6 @@ describe('buildBulkBody', () => {
version: SIGNALS_TEMPLATE_VERSION,
},
original_signal: { child_1: { child_2: 'nested data' } },
owner: 'siem',
parent: {
id: sampleIdGuid,
type: 'event',
Expand Down Expand Up @@ -495,7 +488,6 @@ describe('buildSignalFromSequence', () => {
_meta: {
version: SIGNALS_TEMPLATE_VERSION,
},
owner: 'siem',
parents: [
{
id: sampleIdGuid,
Expand Down Expand Up @@ -580,7 +572,6 @@ describe('buildSignalFromSequence', () => {
_meta: {
version: SIGNALS_TEMPLATE_VERSION,
},
owner: 'siem',
parents: [
{
id: sampleIdGuid,
Expand Down Expand Up @@ -668,7 +659,6 @@ describe('buildSignalFromEvent', () => {
version: SIGNALS_TEMPLATE_VERSION,
},
original_time: '2020-04-20T21:27:45.000Z',
owner: 'siem',
parent: {
id: sampleIdGuid,
rule: '04128c15-0d1b-4716-a4c5-46997ac7f3bd',
Expand Down
Expand Up @@ -108,7 +108,7 @@ export const buildSignalFromSequence = (
ruleSO: SavedObject<AlertAttributes>
): SignalHit => {
const rule = buildRuleWithoutOverrides(ruleSO);
const signal: Signal = buildSignal(events, rule, ruleSO.attributes.consumer);
const signal: Signal = buildSignal(events, rule);
const mergedEvents = objectArrayIntersection(events.map((event) => event._source));
return {
...mergedEvents,
Expand Down
Expand Up @@ -31,7 +31,7 @@ describe('buildSignal', () => {
delete doc._source.event;
const rule = getRulesSchemaMock();
const signal = {
...buildSignal([doc], rule, 'siem'),
...buildSignal([doc], rule),
...additionalSignalFields(doc),
};
const expected: Signal = {
Expand Down Expand Up @@ -61,7 +61,6 @@ describe('buildSignal', () => {
},
],
original_time: '2020-04-20T21:27:45.000Z',
owner: 'siem',
status: 'open',
rule: {
author: [],
Expand Down Expand Up @@ -113,7 +112,7 @@ describe('buildSignal', () => {
};
const rule = getRulesSchemaMock();
const signal = {
...buildSignal([doc], rule, 'siem'),
...buildSignal([doc], rule),
...additionalSignalFields(doc),
};
const expected: Signal = {
Expand Down Expand Up @@ -143,7 +142,6 @@ describe('buildSignal', () => {
},
],
original_time: '2020-04-20T21:27:45.000Z',
owner: 'siem',
original_event: {
action: 'socket_opened',
dataset: 'socket',
Expand Down
Expand Up @@ -77,7 +77,7 @@ export const removeClashes = (doc: BaseSignalHit): BaseSignalHit => {
* @param docs The parent signals/events of the new signal to be built.
* @param rule The rule that is generating the new signal.
*/
export const buildSignal = (docs: BaseSignalHit[], rule: RulesSchema, owner: string): Signal => {
export const buildSignal = (docs: BaseSignalHit[], rule: RulesSchema): Signal => {
const _meta = {
version: SIGNALS_TEMPLATE_VERSION,
};
Expand All @@ -93,7 +93,6 @@ export const buildSignal = (docs: BaseSignalHit[], rule: RulesSchema, owner: str
parents,
ancestors,
status: 'open',
owner,
rule,
depth,
};
Expand Down
Expand Up @@ -34,7 +34,6 @@ describe('eql_executor', () => {
actions: [],
enabled: true,
name: 'rule-name',
consumer: 'siem',
tags: ['some fake tag 1', 'some fake tag 2'],
createdBy: 'sample user',
createdAt: '2020-03-27T22:55:59.577Z',
Expand Down
Expand Up @@ -31,7 +31,6 @@ describe('threshold_executor', () => {
actions: [],
enabled: true,
name: 'rule-name',
consumer: 'siem',
tags: ['some fake tag 1', 'some fake tag 2'],
createdBy: 'sample user',
createdAt: '2020-03-27T22:55:59.577Z',
Expand Down
Expand Up @@ -225,7 +225,6 @@ export interface Signal {
};
original_time?: string;
original_event?: SearchTypes;
owner?: string;
status: Status;
threshold_result?: ThresholdResult;
original_signal?: SearchTypes;
Expand All @@ -250,7 +249,6 @@ export interface AlertAttributes<T extends RuleParams = RuleParams> {
schedule: {
interval: string;
};
consumer: string;
throttle: string;
params: T;
}
Expand Down
4 changes: 2 additions & 2 deletions x-pack/plugins/security_solution/server/plugin.ts
Expand Up @@ -341,7 +341,7 @@ export class Plugin implements IPlugin<PluginSetup, PluginStart, SetupPlugins, S
all: {
app: [APP_ID, 'kibana'],
catalogue: ['securitySolution'],
api: ['securitySolution', 'lists-all', 'lists-read', 'rac'],
api: ['securitySolution', 'lists-all', 'lists-read'],
savedObject: {
all: ['alert', 'exception-list', 'exception-list-agnostic', ...savedObjectTypes],
read: [],
Expand All @@ -362,7 +362,7 @@ export class Plugin implements IPlugin<PluginSetup, PluginStart, SetupPlugins, S
read: {
app: [APP_ID, 'kibana'],
catalogue: ['securitySolution'],
api: ['securitySolution', 'lists-read', 'rac'],
api: ['securitySolution', 'lists-read'],
savedObject: {
all: [],
read: ['exception-list', 'exception-list-agnostic', ...savedObjectTypes],
Expand Down
2 changes: 0 additions & 2 deletions x-pack/plugins/security_solution/server/types.ts
Expand Up @@ -9,7 +9,6 @@ import type { IRouter, RequestHandlerContext } from 'src/core/server';
import type { ListsApiRequestHandlerContext } from '../../lists/server';
import type { LicensingApiRequestHandlerContext } from '../../licensing/server';
import type { AlertingApiRequestHandlerContext } from '../../alerting/server';
import type { RacApiRequestHandlerContext } from '../../rule_registry/server';

import { AppClient } from './client';

Expand All @@ -24,7 +23,6 @@ export type SecuritySolutionRequestHandlerContext = RequestHandlerContext & {
licensing: LicensingApiRequestHandlerContext;
alerting: AlertingApiRequestHandlerContext;
lists?: ListsApiRequestHandlerContext;
ruleRegistry?: RacApiRequestHandlerContext;
};

export type SecuritySolutionPluginRouter = IRouter<SecuritySolutionRequestHandlerContext>;

0 comments on commit 833a51f

Please sign in to comment.