[Cloud Posture] Update latest findings index mapping (#131504)

This commit is contained in:
Uri Weisman 2022-05-18 12:18:03 +03:00 committed by GitHub
parent 6a5b31cd4f
commit 59c55a4434
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 23 additions and 21 deletions

View file

@ -37,7 +37,7 @@ const getDescriptionDisplay = (value: unknown) => {
return <EuiText size="s">{value as string}</EuiText>;
};
export const prepareDescriptionList = (data: Record<string, unknown>) =>
export const prepareDescriptionList = (data: any) =>
Object.entries(getFlattenedObject(data))
.sort((a, b) => a[0].localeCompare(b[0]))
.map(([key, value]) => ({

View file

@ -51,11 +51,10 @@ const getFakeFindings = (name: string): CspFinding & { id: string } => ({
},
resource: {
name: chance.string(),
filename: chance.string(),
type: chance.string(),
path: chance.string(),
uid: chance.string(),
mode: chance.string(),
raw: {} as any,
sub_type: chance.string(),
id: chance.string(),
},
cycle_id: chance.string(),
host: {} as any,

View file

@ -63,13 +63,11 @@ interface CspFindingResult {
}
interface CspFindingResource {
uid: string;
filename: string;
// gid: string;
mode: string;
path: string;
type: string;
name: string;
sub_type: string;
raw: object;
id: string;
type: string;
[other_keys: string]: unknown;
}

View file

@ -21,7 +21,6 @@ export const latestFindingsMapping: MappingTypeMapping = {
},
},
},
agent: {
properties: {
id: {
@ -49,7 +48,17 @@ export const latestFindingsMapping: MappingTypeMapping = {
},
resource: {
properties: {
filename: {
type: {
type: 'keyword',
ignore_above: 256,
},
id: {
type: 'text',
},
name: {
type: 'text',
},
sub_type: {
type: 'text',
fields: {
keyword: {
@ -58,18 +67,14 @@ export const latestFindingsMapping: MappingTypeMapping = {
},
},
},
type: {
type: 'text',
fields: {
keyword: {
ignore_above: 1024,
type: 'keyword',
},
},
raw: {
type: 'object',
enabled: false,
},
},
},
resource_id: {
// deprecated - the new field is resource.id
type: 'text',
fields: {
keyword: {