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] [Sourcerer] [Feature Branch] Update to use Kibana Data Views #114806

Merged
merged 243 commits into from
Nov 4, 2021
Merged
Show file tree
Hide file tree
Changes from 197 commits
Commits
Show all changes
243 commits
Select commit Hold shift + click to select a range
4deabab
initialize default KIP
stephmilovic Jul 19, 2021
8c452c2
rm configIndexPatterns
stephmilovic Jul 19, 2021
fde9056
no more config patterns
stephmilovic Jul 20, 2021
919a310
fix sourcerer jest
stephmilovic Jul 21, 2021
3b6cf6a
another test fix
stephmilovic Jul 21, 2021
957bb97
Merge branch 'master' into sourcerer_kip
stephmilovic Jul 21, 2021
8458b6f
more test fixes
stephmilovic Jul 21, 2021
c3df135
rm some comments
stephmilovic Jul 21, 2021
0342da6
Merge branch 'master' into sourcerer_kip
stephmilovic Jul 21, 2021
af76d50
Merge branch 'master' into sourcerer_kip
stephmilovic Jul 22, 2021
a386a11
why
stephmilovic Jul 22, 2021
d10ec88
fix cy
stephmilovic Jul 23, 2021
33d44f1
Merge branch 'master' into sourcerer_kip
stephmilovic Jul 23, 2021
e79a9b1
merge
stephmilovic Jul 26, 2021
3c13e86
k
stephmilovic Jul 26, 2021
6cc917c
move to server
stephmilovic Jul 27, 2021
343354d
rm cy com
stephmilovic Jul 27, 2021
86bc00d
ui for permissions and fix tests
stephmilovic Jul 27, 2021
255bc1f
pass as arg
stephmilovic Jul 27, 2021
434f9bb
fix mistakes
stephmilovic Jul 27, 2021
49098d4
fix types
stephmilovic Jul 27, 2021
de97889
merge master
stephmilovic Aug 3, 2021
ffc08eb
fix ml test
stephmilovic Aug 4, 2021
23fba2c
Merge branch 'master' into sourcerer_kip
stephmilovic Aug 4, 2021
385a91d
start
stephmilovic Aug 5, 2021
11c741d
Merge branch 'master' into sourcerer_kip
kibanamachine Aug 5, 2021
4e81552
wip
stephmilovic Aug 5, 2021
f4341d9
default sourcerer working me thinks
stephmilovic Aug 5, 2021
32025be
Merge branch 'sourcerer_kip' of github.com:stephmilovic/kibana into s…
stephmilovic Aug 5, 2021
e33abe3
Merge branch 'sourcerer_kip' into sourcerer_kip_as
stephmilovic Aug 5, 2021
bfeb49f
rm some logs
stephmilovic Aug 5, 2021
ff8aa1c
idk
stephmilovic Aug 9, 2021
e986d9d
fix conflicts
stephmilovic Aug 9, 2021
bc751f0
Merge branch 'sourcerer_kip' into sourcerer_kip_as
stephmilovic Aug 9, 2021
19a1e9a
Merge branch 'master' into sourcerer_kip
kibanamachine Aug 9, 2021
1431aa8
updates from advanced settings
stephmilovic Aug 9, 2021
2c81a43
combo box is back
stephmilovic Aug 9, 2021
6ea14db
working default need indicesExist
stephmilovic Aug 9, 2021
f7760d7
Merge branch 'master' into sourcerer_kip
stephmilovic Aug 10, 2021
51625e6
Merge branch 'sourcerer_kip' of github.com:stephmilovic/kibana into s…
stephmilovic Aug 10, 2021
7ddc9fb
Merge branch 'sourcerer_kip' into sourcerer_kip_as
stephmilovic Aug 10, 2021
f591809
working better
stephmilovic Aug 10, 2021
d687623
sanity check
stephmilovic Aug 11, 2021
5748a6c
merge w master
stephmilovic Aug 31, 2021
7ceef3a
merge master
stephmilovic Aug 31, 2021
68efdd2
Merge branch 'sourcerer_kip' into sourcerer_kip_as
stephmilovic Aug 31, 2021
09dd0e8
Merge branch 'master' into sourcerer_kip
stephmilovic Aug 31, 2021
45a1b15
Merge branch 'sourcerer_kip' into sourcerer_kip_as
stephmilovic Aug 31, 2021
74e4c31
logs
stephmilovic Aug 31, 2021
31c0b16
fix merge conflicts
stephmilovic Sep 1, 2021
232a520
fix conflicts
stephmilovic Sep 1, 2021
5e6331c
hey
stephmilovic Sep 1, 2021
eaebc6b
fix big ol bugsy wugsy
stephmilovic Sep 1, 2021
ffe5370
fixed some things, wrote a test
stephmilovic Sep 1, 2021
3492cb0
Merge branch 'master' into sourcerer_kip
stephmilovic Sep 2, 2021
bbd8616
Merge branch 'master' into sourcerer_kip_as
stephmilovic Sep 2, 2021
7db7a32
Merge branch 'sourcerer_kip' into sourcerer_kip_as
stephmilovic Sep 2, 2021
67ee52b
url state just works wow what a good morning
stephmilovic Sep 2, 2021
ebf9455
Merge branch 'master' into sourcerer_kip
stephmilovic Sep 2, 2021
4312ac2
Merge branch 'sourcerer_kip' into sourcerer_kip_as
stephmilovic Sep 2, 2021
bff7ccc
start on timeline sourcerer
stephmilovic Sep 2, 2021
43661fa
fix bug
stephmilovic Sep 2, 2021
1fe521e
fix some tests and simplify
stephmilovic Sep 3, 2021
0705be6
fixing tests and types
stephmilovic Sep 3, 2021
a93d4c6
maeffn type pass wut
stephmilovic Sep 3, 2021
f80ca48
fixing
stephmilovic Sep 3, 2021
3d32cf5
About to do timeline stuff
stephmilovic Sep 7, 2021
26231bb
get rid of bad selector
stephmilovic Sep 7, 2021
bbc7865
Merge branch 'master' into sourcerer_kip
stephmilovic Sep 7, 2021
2f5d60a
Merge branch 'sourcerer_kip' into sourcerer_kip_as
stephmilovic Sep 7, 2021
8c1b8d0
server side dataViewId
stephmilovic Sep 7, 2021
f52c33b
added prop to timeline and passes type check
stephmilovic Sep 7, 2021
b035d4b
by golly i think i did it
stephmilovic Sep 7, 2021
08f22aa
rm logs
stephmilovic Sep 7, 2021
290a4e1
undo myob
stephmilovic Sep 7, 2021
415ad8d
revert whoops
stephmilovic Sep 7, 2021
d8c3f20
jest fixing
stephmilovic Sep 7, 2021
bcc8061
jest fixing
stephmilovic Sep 8, 2021
03be321
Merge branch 'master' into sourcerer_kip
stephmilovic Sep 8, 2021
38b679c
Merge branch 'sourcerer_kip' into sourcerer_kip_as
stephmilovic Sep 8, 2021
5ae36e5
make runtime fields return runtime values, duh
stephmilovic Sep 9, 2021
b35251c
fix test
stephmilovic Sep 9, 2021
c083cdd
merge master
stephmilovic Sep 9, 2021
7c86ed6
merge in masteR
stephmilovic Sep 9, 2021
e32f7af
renames
stephmilovic Sep 9, 2021
a7b851d
fix translations
stephmilovic Sep 9, 2021
26ef3ee
more renaming
stephmilovic Sep 10, 2021
6f856a4
updates fields api and enforce types
stephmilovic Sep 10, 2021
be70eca
better types
stephmilovic Sep 10, 2021
302f4a3
yay
stephmilovic Sep 10, 2021
0903dc1
add issue comments
stephmilovic Sep 10, 2021
0e209ff
Merge branch 'master' into sourcerer_kip
stephmilovic Sep 10, 2021
382d27c
Merge branch 'sourcerer_kip' into sourcerer_kip_as
stephmilovic Sep 10, 2021
352d437
fix index pattern when siem signal index is null
stephmilovic Sep 10, 2021
7e81988
Merge branch 'master' into sourcerer_kip
stephmilovic Sep 13, 2021
6f79940
Merge branch 'sourcerer_kip' into sourcerer_kip_as
stephmilovic Sep 13, 2021
a8483e0
fix private rtf
stephmilovic Sep 13, 2021
438a5c9
wip
stephmilovic Sep 14, 2021
10b7f27
Merge branch 'master' into sourcerer_kip
stephmilovic Sep 14, 2021
b9a8d40
why did i do this in one commit jeeeeez
stephmilovic Sep 14, 2021
c9a1905
merge in
stephmilovic Sep 14, 2021
85fac4b
fix
stephmilovic Sep 14, 2021
1c6c34e
cy wip
stephmilovic Sep 14, 2021
f50b40d
fix whoops
stephmilovic Sep 14, 2021
7e50a47
fix migration and add another test
stephmilovic Sep 15, 2021
03b7ba2
bs
stephmilovic Sep 16, 2021
5936acf
Merge branch 'master' into sourcerer_kip
stephmilovic Sep 16, 2021
cdf8171
merged
stephmilovic Sep 16, 2021
54be286
working on unit tests
stephmilovic Sep 16, 2021
d9588fd
jest wip
stephmilovic Sep 20, 2021
b9b224c
resolve
stephmilovic Sep 20, 2021
12f5ae5
fix conflicts
stephmilovic Sep 20, 2021
84865d3
fix conflicts
stephmilovic Sep 20, 2021
a7e31ec
add more tests
stephmilovic Sep 20, 2021
2c1aabe
more test
stephmilovic Sep 20, 2021
ddc4ffe
more tests wiP
stephmilovic Sep 20, 2021
dbfa580
Merge branch 'sourcerer_kip_as' into sourcerer_kip_bs
stephmilovic Sep 20, 2021
3d03457
ruleRegistry:false caps
stephmilovic Sep 21, 2021
a79e9eb
Merge branch 'master' into sourcerer_kip
stephmilovic Sep 21, 2021
d81fed2
Merge branch 'sourcerer_kip' into sourcerer_kip_as
stephmilovic Sep 21, 2021
2bc12b2
fix eslint and i18n
stephmilovic Sep 21, 2021
de87a9e
what happened
stephmilovic Sep 22, 2021
f3c8d41
Merge branch 'master' into sourcerer_kip
stephmilovic Sep 22, 2021
83cc7d2
fix merge conflicts
stephmilovic Sep 22, 2021
aa5b258
Merge branch 'sourcerer_kip_as' into sourcerer_kip_cs
stephmilovic Sep 22, 2021
70c5292
fix type err
stephmilovic Sep 22, 2021
935b551
Merge branch 'sourcerer_kip_as' into sourcerer_kip_cs
stephmilovic Sep 22, 2021
9fa9a2f
this is not elegant
stephmilovic Sep 22, 2021
8730d63
its A solution. not THE solution
stephmilovic Sep 22, 2021
d1ba923
news
stephmilovic Sep 22, 2021
0832cfe
works with no ruleRegistry
stephmilovic Sep 23, 2021
016d18b
fixed
stephmilovic Sep 23, 2021
cc98f56
comments
stephmilovic Sep 23, 2021
38e8f6e
Merge branch 'master' into sourcerer_kip_as
kibanamachine Sep 23, 2021
7c7a968
fixes for url state
stephmilovic Sep 23, 2021
883929a
Merge branch 'sourcerer_kip_as' of github.com:stephmilovic/kibana int…
stephmilovic Sep 23, 2021
9af3d1e
fix jest
stephmilovic Sep 23, 2021
a49893a
more jest fixing
stephmilovic Sep 23, 2021
26c30ff
Merge branch 'master' into sourcerer_kip_as
kibanamachine Sep 25, 2021
55020b1
push console logs for X
stephmilovic Sep 27, 2021
5f96a4d
fix bug
stephmilovic Sep 28, 2021
656739e
resolve conflicts
stephmilovic Sep 28, 2021
e7ae515
fixes
stephmilovic Sep 28, 2021
82b7327
merged w master
stephmilovic Sep 28, 2021
72cae51
cypress is one crazy mofo
stephmilovic Sep 29, 2021
bed0e0b
all ready
stephmilovic Sep 29, 2021
96558bc
make everything happy
stephmilovic Sep 29, 2021
9efc307
fix conflict
stephmilovic Sep 29, 2021
71b590a
wildcard to siem signals default index in sourcerer
stephmilovic Sep 30, 2021
be89ffb
fix lil whoops
stephmilovic Sep 30, 2021
377108d
rm useMemo from sourcerer components
stephmilovic Sep 30, 2021
fff38a7
cleanup comment
stephmilovic Sep 30, 2021
33760fd
Fix top n
stephmilovic Sep 30, 2021
552b64e
fix lil whoops again
stephmilovic Sep 30, 2021
4bdb491
fix jest
stephmilovic Oct 1, 2021
4c65fcb
merge in master
stephmilovic Oct 1, 2021
95516b0
stopping point commit
stephmilovic Oct 1, 2021
9b01c57
resolve tests
stephmilovic Oct 4, 2021
ab6c47e
merge in master
stephmilovic Oct 4, 2021
9c825e9
rm whoops
stephmilovic Oct 4, 2021
f6b7b38
fix trnslations and other cleanups
stephmilovic Oct 4, 2021
b202ff2
review i
stephmilovic Oct 4, 2021
c3471e6
add test for johnny
stephmilovic Oct 4, 2021
3b17d0f
Merge branch 'master' into sourcerer_kip_as
stephmilovic Oct 4, 2021
d535295
rm test comments
stephmilovic Oct 4, 2021
358cad8
review ii
stephmilovic Oct 5, 2021
d8cf285
fix cypress
stephmilovic Oct 5, 2021
4df9c41
revert
stephmilovic Oct 5, 2021
1d2e8ed
fix conflict
stephmilovic Oct 5, 2021
f715950
Merge branch 'master' into sourcerer_kip_as
stephmilovic Oct 5, 2021
aebe8e0
revert some stuff
stephmilovic Oct 5, 2021
1552c11
add trick to cypress
stephmilovic Oct 5, 2021
36c4a7b
rm wildcard from pattern
stephmilovic Oct 5, 2021
87bd0ab
fix jest
stephmilovic Oct 6, 2021
732e3dc
Merge branch 'master' into sourcerer_kip_as
stephmilovic Oct 6, 2021
8e8d84c
Merge branch 'master' into sourcerer_kip_as
kibanamachine Oct 6, 2021
b7a3caf
fix timeline bug
stephmilovic Oct 6, 2021
0f5c93b
resolve conflicts
stephmilovic Oct 7, 2021
e04ffb0
Merge branch 'master' into sourcerer_kip_as
stephmilovic Oct 7, 2021
6e2a364
fix routes
stephmilovic Oct 7, 2021
7d804a2
Resolve merge
stephmilovic Oct 11, 2021
f6635c8
Fix types
stephmilovic Oct 11, 2021
f4d8061
resolve conflicts
stephmilovic Oct 13, 2021
ffcd6ed
fix cases privileges test
stephmilovic Oct 14, 2021
8441b4e
Merge branch 'master' into sourcerer_kip_as
stephmilovic Oct 14, 2021
5a4f97d
fix bug pablo found
stephmilovic Oct 15, 2021
64e1232
pick events merge conflict
stephmilovic Oct 15, 2021
79699a5
Merge branch 'master' into sourcerer_kip_as
stephmilovic Oct 15, 2021
9cad466
Merge branch 'master' into sourcerer_kip_as
kibanamachine Oct 18, 2021
9d0fc8f
Merge branch 'master' into sourcerer_kip_as
kibanamachine Oct 18, 2021
d592c1b
hide signal index on default sourcerer
stephmilovic Oct 18, 2021
13e6971
Merge branch 'sourcerer_kip_as' of github.com:elastic/kibana into sou…
stephmilovic Oct 18, 2021
fc516ea
Merge branch 'master' into sourcerer_kip_as
kibanamachine Oct 18, 2021
6a167d8
rm validatePatterns
stephmilovic Oct 19, 2021
770f206
Merge branch 'sourcerer_kip_as' of github.com:elastic/kibana into sou…
stephmilovic Oct 19, 2021
db06e55
simplify
stephmilovic Oct 19, 2021
2a868e4
Merge branch 'master' into sourcerer_kip_as
kibanamachine Oct 19, 2021
a7eafca
review iii
stephmilovic Oct 19, 2021
becd6bc
Merge branch 'master' into sourcerer_kip_as
stephmilovic Oct 19, 2021
33caa21
Merge branch 'master' into sourcerer_kip_as
stephmilovic Oct 19, 2021
27f153c
Merge branch 'master' into sourcerer_kip_as
stephmilovic Oct 19, 2021
53bd342
replace validatePatternListActive
stephmilovic Oct 19, 2021
fc4c9bf
revert silly
stephmilovic Oct 19, 2021
856cfe7
fix merge
stephmilovic Oct 20, 2021
6699b29
ok dont do the migration fine
stephmilovic Oct 21, 2021
e1721d5
merge in masteR
stephmilovic Oct 21, 2021
db696c9
Add `.catch()` statement to ES calls in order to get better stacktraces
paul-tavares Oct 21, 2021
b6d8110
Improve efficiency of getHostEndpoint() search strategy method
paul-tavares Oct 21, 2021
62a9811
Refactor `getHostEndpoint()` to use new Metadata service as well as t…
paul-tavares Oct 25, 2021
ca81cd9
Resolve conflicts
stephmilovic Oct 25, 2021
90b87a1
Merge remote-tracking branch 'upstream/master' into task/olm-1926-all…
paul-tavares Oct 26, 2021
1f4ea7c
doing this
stephmilovic Oct 26, 2021
f882d4a
fix test thanks angela
stephmilovic Oct 26, 2021
a848216
Merge remote-tracking branch 'upstream/master' into task/olm-1926-all…
paul-tavares Oct 26, 2021
052e07e
Merge remote-tracking branch 'upstream/master' into task/olm-1926-all…
paul-tavares Oct 26, 2021
c4c22f7
resolve conflicts
stephmilovic Oct 27, 2021
0e63da9
fix type
stephmilovic Oct 27, 2021
39b6f71
rm todos
stephmilovic Oct 27, 2021
3ca181d
rm todos
stephmilovic Oct 27, 2021
0ef0126
Merge branch 'master' into task/olm-1926-allow-non-superuser-to-read-…
kibanamachine Oct 27, 2021
2e4c7bd
fix type
stephmilovic Oct 27, 2021
2578fe3
Merge branch 'master' into sourcerer_kip_as
stephmilovic Oct 27, 2021
cdcf869
as const message
stephmilovic Oct 27, 2021
acea7a6
Merge branch 'master' into task/olm-1926-allow-non-superuser-to-read-…
kibanamachine Oct 27, 2021
7e8cadb
Merge acea7a6d04749b25dbff4f6e98e75ee5158dc6bf into 4be1d8f4384dd6b66…
paul-tavares Oct 27, 2021
be170e1
Merge commit 'refs/pull/116202/merge' of https://github.com/elastic/k…
stephmilovic Oct 27, 2021
4e14750
Merge branch 'master' into sourcerer_kip_as
kibanamachine Oct 27, 2021
f92432c
fix detections roles
stephmilovic Oct 27, 2021
08fba07
Merge branch 'sourcerer_kip_as' of https://github.com/elastic/kibana …
stephmilovic Oct 27, 2021
748d97a
better comments
stephmilovic Oct 27, 2021
0db5636
Revert "Merge commit 'refs/pull/116202/merge' of https://github.com/e…
stephmilovic Oct 27, 2021
2332990
Merge branch 'master' into sourcerer_kip_as
stephmilovic Oct 28, 2021
585668d
Merge branch 'master' into sourcerer_kip_as
stephmilovic Oct 28, 2021
2e7c4e6
wip
stephmilovic Oct 28, 2021
fc5a57e
this might work
stephmilovic Oct 28, 2021
e4972f4
fix
stephmilovic Oct 28, 2021
3704a28
Show results if sourcerer initiates signal index, whether or not it e…
stephmilovic Oct 28, 2021
479014c
fix mock
stephmilovic Oct 29, 2021
2c8adfd
Merge branch 'main' into sourcerer_kip_as
kibanamachine Nov 1, 2021
7b13681
fix merge
stephmilovic Nov 2, 2021
8286a33
Merge branch 'main' into sourcerer_kip_as
stephmilovic Nov 3, 2021
ac0b022
[Security Solution] [Sourcerer] Store and type cleanup (#116640)
stephmilovic Nov 4, 2021
6a68772
Small cleanup
stephmilovic Nov 4, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,10 @@ interface FieldSubType {
export class IndexPatternsFetcher {
private elasticsearchClient: ElasticsearchClient;
private allowNoIndices: boolean;

constructor(elasticsearchClient: ElasticsearchClient, allowNoIndices: boolean = false) {
this.elasticsearchClient = elasticsearchClient;
this.allowNoIndices = allowNoIndices;
}

/**
* Get a list of field objects for an index pattern that may contain wildcards
*
Expand All @@ -60,23 +58,16 @@ export class IndexPatternsFetcher {
}): Promise<FieldDescriptor[]> {
const { pattern, metaFields, fieldCapsOptions, type, rollupIndex } = options;
const patternList = Array.isArray(pattern) ? pattern : pattern.split(',');
let patternListActive: string[] = patternList;
// if only one pattern, don't bother with validation. We let getFieldCapabilities fail if the single pattern is bad regardless
if (patternList.length > 1) {
patternListActive = await this.validatePatternListActive(patternList);
}
const fieldCapsResponse = await getFieldCapabilities(
this.elasticsearchClient,
// if none of the patterns are active, pass the original list to get an error
patternListActive.length > 0 ? patternListActive : patternList,
patternList,
metaFields,
{
allow_no_indices: fieldCapsOptions
? fieldCapsOptions.allow_no_indices
: this.allowNoIndices,
}
);

if (type === 'rollup' && rollupIndex) {
const rollupFields: FieldDescriptor[] = [];
const rollupIndexCapabilities = getCapabilitiesForRollupIndices(
Expand All @@ -87,13 +78,11 @@ export class IndexPatternsFetcher {
).body
)[rollupIndex].aggs;
const fieldCapsResponseObj = keyBy(fieldCapsResponse, 'name');

// Keep meta fields
metaFields!.forEach(
(field: string) =>
fieldCapsResponseObj[field] && rollupFields.push(fieldCapsResponseObj[field])
);

return mergeCapabilitiesWithFields(
rollupIndexCapabilities,
fieldCapsResponseObj,
Expand Down Expand Up @@ -127,34 +116,4 @@ export class IndexPatternsFetcher {
}
return await getFieldCapabilities(this.elasticsearchClient, indices, metaFields);
}

/**
* Returns an index pattern list of only those index pattern strings in the given list that return indices
*
* @param patternList string[]
* @return {Promise<string[]>}
*/
async validatePatternListActive(patternList: string[]) {
const result = await Promise.all(
patternList
.map((pattern) =>
this.elasticsearchClient.count({
index: pattern,
})
)
.map((p) =>
p.catch((e) => {
if (e.body.error.type === 'index_not_found_exception') {
return { body: { count: 0 } };
}
throw e;
})
)
);
return result.reduce(
(acc: string[], { body: { count } }, patternListIndex) =>
count > 0 ? [...acc, patternList[patternListIndex]] : acc,
[]
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,8 @@ export function AlertsTableTGrid(props: AlertsTableTGridProps) {
},
renderCellValue: getRenderCellValue({ setFlyoutAlert }),
rowRenderers: NO_ROW_RENDER,
// TODO: implement Kibana data view runtime fields in observability
runtimeMappings: {},
start: rangeFrom,
setRefetch,
sort: [
Expand Down
12 changes: 11 additions & 1 deletion x-pack/plugins/security_solution/common/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
import type { TransformConfigSchema } from './transforms/types';
import { ENABLE_CASE_CONNECTOR } from '../../cases/common';
import { METADATA_TRANSFORMS_PATTERN } from './endpoint/constants';
import { SavedObjectReference } from '../../../../src/core/types';
import { DATA_VIEW_SAVED_OBJECT_TYPE } from '../../../../src/plugins/data/common';

export const APP_ID = 'securitySolution';
export const CASES_FEATURE_ID = 'securitySolutionCases';
Expand All @@ -23,6 +25,8 @@ export const DEFAULT_DATE_FORMAT_TZ = 'dateFormat:tz';
export const DEFAULT_DARK_MODE = 'theme:darkMode';
export const DEFAULT_INDEX_KEY = 'securitySolution:defaultIndex';
export const DEFAULT_NUMBER_FORMAT = 'format:number:defaultPattern';
export const DEFAULT_DATA_VIEW_ID = 'security-solution';
export const DEFAULT_TIME_FIELD = '@timestamp';
export const DEFAULT_TIME_RANGE = 'timepicker:timeDefaults';
export const DEFAULT_REFRESH_RATE_INTERVAL = 'timepicker:refreshIntervalDefaults';
export const DEFAULT_APP_TIME_RANGE = 'securitySolution:timeDefaults';
Expand All @@ -37,7 +41,6 @@ export const DEFAULT_MAX_SIGNALS = 100;
export const DEFAULT_SEARCH_AFTER_PAGE_SIZE = 100;
export const DEFAULT_ANOMALY_SCORE = 'securitySolution:defaultAnomalyScore';
export const DEFAULT_MAX_TABLE_QUERY_SIZE = 10000;
export const DEFAULT_SCALE_DATE_FORMAT = 'dateFormat:scaled';
export const DEFAULT_FROM = 'now/d';
export const DEFAULT_TO = 'now/d';
export const DEFAULT_INTERVAL_PAUSE = true;
Expand Down Expand Up @@ -146,6 +149,12 @@ export const DEFAULT_INDEX_PATTERN = [
'winlogbeat-*',
];

export const defaultDataViewRef: SavedObjectReference = {
id: DEFAULT_DATA_VIEW_ID,
name: 'dataViewId',
type: DATA_VIEW_SAVED_OBJECT_TYPE,
};

export const DEFAULT_INDEX_PATTERN_EXPERIMENTAL = [
// TODO: Steph/ueba TEMP for testing UEBA data
'ml_host_risk_score_*',
Expand Down Expand Up @@ -258,6 +267,7 @@ export const TIMELINE_PREPACKAGED_URL = `${TIMELINE_URL}/_prepackaged`;

export const NOTE_URL = '/api/note';
export const PINNED_EVENT_URL = '/api/pinned_event';
export const SOURCERER_API_URL = '/api/sourcerer';

/**
* Default signals index key for kibana.dev.yml
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,79 +5,15 @@
* 2.0.
*/

import type { IFieldSubType } from '@kbn/es-query';

import type {
IEsSearchRequest,
IEsSearchResponse,
IIndexPattern,
} from '../../../../../../src/plugins/data/common';
import type { DocValueFields, Maybe } from '../common';

interface FieldInfo {
category: string;
description?: string;
example?: string | number;
format?: string;
name: string;
type?: string;
}

export interface IndexField {
/** Where the field belong */
category: string;
/** Example of field's value */
example?: Maybe<string | number>;
/** whether the field's belong to an alias index */
indexes: Array<Maybe<string>>;
/** The name of the field */
name: string;
/** The type of the field's values as recognized by Kibana */
type: string;
/** Whether the field's values can be efficiently searched for */
searchable: boolean;
/** Whether the field's values can be aggregated */
aggregatable: boolean;
/** Description of the field */
description?: Maybe<string>;
format?: Maybe<string>;
/** the elastic type as mapped in the index */
esTypes?: string[];
subType?: IFieldSubType;
readFromDocValues: boolean;
}

export type BeatFields = Record<string, FieldInfo>;

export interface IndexFieldsStrategyRequest extends IEsSearchRequest {
indices: string[];
onlyCheckIfIndicesExist: boolean;
}

export interface IndexFieldsStrategyResponse extends IEsSearchResponse {
indexFields: IndexField[];
indicesExist: string[];
}

export interface BrowserField {
aggregatable: boolean;
category: string;
description: string | null;
example: string | number | null;
fields: Readonly<Record<string, Partial<BrowserField>>>;
format: string;
indexes: string[];
name: string;
searchable: boolean;
type: string;
subType?: IFieldSubType;
}

export type BrowserFields = Readonly<Record<string, Partial<BrowserField>>>;

export const EMPTY_BROWSER_FIELDS = {};
export const EMPTY_DOCVALUE_FIELD: DocValueFields[] = [];
export const EMPTY_INDEX_PATTERN: IIndexPattern = {
fields: [],
title: '',
};
export {
FieldInfo,
IndexField,
BeatFields,
IndexFieldsStrategyRequest,
IndexFieldsStrategyResponse,
BrowserField,
BrowserFields,
EMPTY_BROWSER_FIELDS,
EMPTY_DOCVALUE_FIELD,
EMPTY_INDEX_PATTERN,
} from '../../../../timelines/common';
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export { LastEventIndexKey } from '../../../../../../timelines/common';
export type {
LastTimeDetails,
TimelineEventsLastEventTimeStrategyResponse,
TimelineKpiStrategyRequest,
TimelineKpiStrategyResponse,
TimelineEventsLastEventTimeRequestOptions,
} from '../../../../../../timelines/common';
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
* 2.0.
*/

import { MappingRuntimeFields } from '@elastic/elasticsearch/api/types';
import { IEsSearchRequest } from '../../../../../../src/plugins/data/common';
import { ESQuery } from '../../typed_json';
import {
Expand Down Expand Up @@ -41,6 +42,7 @@ export interface TimelineRequestBasicOptions extends IEsSearchRequest {
defaultIndex: string[];
docValueFields?: DocValueFields[];
factoryQueryType?: TimelineFactoryQueryTypes;
runtimeMappings: MappingRuntimeFields;
}

export interface TimelineRequestSortField<Field = string> extends SortField<Field> {
Expand Down Expand Up @@ -171,6 +173,7 @@ export interface SortTimelineInput {
export interface TimelineInput {
columns?: Maybe<ColumnHeaderInput[]>;
dataProviders?: Maybe<DataProviderInput[]>;
dataViewId?: Maybe<string>;
description?: Maybe<string>;
eqlOptions?: Maybe<EqlOptionsInput>;
eventType?: Maybe<string>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,7 @@ export type TimelineTypeLiteralWithNull = runtimeTypes.TypeOf<typeof TimelineTyp
export const SavedTimelineRuntimeType = runtimeTypes.partial({
columns: unionWithNullType(runtimeTypes.array(SavedColumnHeaderRuntimeType)),
dataProviders: unionWithNullType(runtimeTypes.array(SavedDataProviderRuntimeType)),
dataViewId: unionWithNullType(runtimeTypes.string),
description: unionWithNullType(runtimeTypes.string),
eqlOptions: unionWithNullType(EqlOptionsRuntimeType),
eventType: unionWithNullType(runtimeTypes.string),
Expand Down Expand Up @@ -719,6 +720,7 @@ export interface TimelineResult {
created?: Maybe<number>;
createdBy?: Maybe<string>;
dataProviders?: Maybe<DataProviderResult[]>;
dataViewId?: Maybe<string>;
dateRange?: Maybe<DateRangePickerResult>;
description?: Maybe<string>;
eqlOptions?: Maybe<EqlOptionsResult>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,19 +38,20 @@ export interface SortColumnTimeline {
}

export interface TimelinePersistInput {
id: string;
columns: ColumnHeaderOptions[];
dataProviders?: DataProvider[];
dataViewId: string;
dateRange?: {
start: string;
end: string;
};
defaultColumns?: ColumnHeaderOptions[];
excludedRowRendererIds?: RowRendererId[];
expandedDetail?: TimelineExpandedDetail;
filters?: Filter[];
columns: ColumnHeaderOptions[];
defaultColumns?: ColumnHeaderOptions[];
itemsPerPage?: number;
id: string;
indexNames: string[];
itemsPerPage?: number;
kqlQuery?: {
filterQuery: SerializedFilterQuery | null;
};
Expand Down
7 changes: 6 additions & 1 deletion x-pack/plugins/security_solution/cypress/cypress.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,10 @@
"video": false,
"videosFolder": "../../../target/kibana-security-solution/cypress/videos",
"viewportHeight": 900,
"viewportWidth": 1440
"viewportWidth": 1440,
"env": {
"protocol": "http",
"hostname": "localhost",
"configport": "5601"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"savedObjectId":"46cca0e0-2580-11ec-8e56-9dafa0b0343b","version":"WzIyNjIzNCwxXQ==","columns":[{"id":"@timestamp"},{"id":"user.name"},{"id":"event.category"},{"id":"event.action"},{"id":"host.name"}],"kqlMode":"filter","kqlQuery":{"filterQuery":{"kuery":{"expression":"host.name: *","kind":"kuery"}}},"dateRange":{"start":"1514809376000","end":"1577881376000"},"description":"This is the best timeline","title":"Security Timeline","created":1633399341550,"createdBy":"elastic","updated":1633399341550,"updatedBy":"elastic","savedQueryId":null,"dataViewId":null,"timelineType":"default","sort":[],"eventNotes":[],"globalNotes":[],"pinnedEventIds":[]}
Loading