Skip to content

Commit

Permalink
[Cloud Posture] Update latest findings index mapping (#131504)
Browse files Browse the repository at this point in the history
  • Loading branch information
uri-weisman authored May 18, 2022
1 parent 6a5b31c commit 59c55a4
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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]) => ({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ export const latestFindingsMapping: MappingTypeMapping = {
},
},
},

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

0 comments on commit 59c55a4

Please sign in to comment.