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

[Cloud Posture] Update latest findings index mapping #131504

Merged
merged 16 commits into from
May 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
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