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

[Entity Analytics] [Entity Store] [API] Changes to support event.ingested as a configurable timestamp field for init and enable endpoints #208201

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
134d938
Changes to support event.ingested as a configurable timestamp files f…
abhishekbhatia1710 Jan 24, 2025
3727e92
[CI] Auto-commit changed files from 'yarn openapi:bundle'
kibanamachine Jan 24, 2025
4b118da
[CI] Auto-commit changed files from 'make api-docs'
kibanamachine Jan 24, 2025
e7ef2de
Merge remote-tracking branch 'origin/main' into ea-11304-configurable…
abhishekbhatia1710 Jan 29, 2025
eac1779
Updating the savedObjects model version for the mappings addition
abhishekbhatia1710 Jan 29, 2025
dd49a9f
[CI] Auto-commit changed files from 'node scripts/check_mappings_upda…
kibanamachine Jan 29, 2025
0df7975
[CI] Auto-commit changed files from 'node scripts/jest_integration -u…
kibanamachine Jan 29, 2025
11d45cb
Adding Changes for checkTypes fix
abhishekbhatia1710 Jan 29, 2025
e0d4dc0
Merge branch 'ea-11304-configurable-sync-timestamp-field' of https://…
abhishekbhatia1710 Jan 29, 2025
a26f522
Changes for checkTypes
abhishekbhatia1710 Jan 29, 2025
4ebc829
Merge branch 'main' into ea-11304-configurable-sync-timestamp-field
elasticmachine Jan 29, 2025
8142565
Removing changes unrelated to the PR
abhishekbhatia1710 Jan 29, 2025
f29f697
remove timestampField from start API docs
hop-dev Jan 29, 2025
f6994c1
remove timestampField config value
hop-dev Jan 29, 2025
6e07f95
[CI] Auto-commit changed files from 'yarn openapi:bundle'
kibanamachine Jan 29, 2025
2175566
[CI] Auto-commit changed files from 'make api-docs'
kibanamachine Jan 29, 2025
9a69854
Merge branch 'main' into ea-11304-configurable-sync-timestamp-field
hop-dev Jan 29, 2025
e5f1406
Merge branch 'ea-11304-configurable-sync-timestamp-field' of github.c…
hop-dev Jan 29, 2025
bd94162
remove body from start calls in tests
hop-dev Jan 29, 2025
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
33 changes: 29 additions & 4 deletions oas_docs/output/kibana.serverless.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9826,6 +9826,10 @@ paths:
description: The timeout for initializing the aggregating transform.
pattern: '[smdh]$'
type: string
timestampField:
default: '@timestamp'
description: The field to use as the timestamp.
type: string
description: Schema for the entity store initialization
required: true
responses:
Expand Down Expand Up @@ -9966,6 +9970,10 @@ paths:
description: The timeout for initializing the aggregating transform.
pattern: '[smdh]$'
type: string
timestampField:
default: '@timestamp'
description: The field to use as the timestamp for the entity type.
type: string
description: Schema for the engine initialization
required: true
responses:
Expand All @@ -9983,7 +9991,7 @@ paths:
post:
operationId: StartEntityEngine
parameters:
- description: The entity type of the engine (either 'user' or 'host').
- description: The entity type of the engine
in: path
name: entityType
required: true
Expand Down Expand Up @@ -51430,6 +51438,8 @@ components:
default: 180s
pattern: '[smdh]$'
type: string
timestampField:
type: string
type:
$ref: '#/components/schemas/Security_Entity_Analytics_API_EntityType'
required:
Expand Down Expand Up @@ -51557,6 +51567,12 @@ components:
required:
- name
- source
event:
type: object
properties:
ingested:
format: date-time
type: string
host:
type: object
properties:
Expand Down Expand Up @@ -51595,7 +51611,6 @@ components:
required:
- name
required:
- '@timestamp'
- host
- entity
Security_Entity_Analytics_API_IdField:
Expand Down Expand Up @@ -51702,6 +51717,12 @@ components:
required:
- name
- source
event:
type: object
properties:
ingested:
format: date-time
type: string
service:
type: object
properties:
Expand All @@ -51712,7 +51733,6 @@ components:
required:
- name
required:
- '@timestamp'
- service
- entity
Security_Entity_Analytics_API_StoreStatus:
Expand Down Expand Up @@ -51758,6 +51778,12 @@ components:
required:
- name
- source
event:
type: object
properties:
ingested:
format: date-time
type: string
user:
type: object
properties:
Expand Down Expand Up @@ -51792,7 +51818,6 @@ components:
required:
- name
required:
- '@timestamp'
- user
- entity
Security_Exceptions_API_CreateExceptionListItemComment:
Expand Down
33 changes: 29 additions & 4 deletions oas_docs/output/kibana.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11916,6 +11916,10 @@ paths:
description: The timeout for initializing the aggregating transform.
pattern: '[smdh]$'
type: string
timestampField:
default: '@timestamp'
description: The field to use as the timestamp.
type: string
description: Schema for the entity store initialization
required: true
responses:
Expand Down Expand Up @@ -12052,6 +12056,10 @@ paths:
description: The timeout for initializing the aggregating transform.
pattern: '[smdh]$'
type: string
timestampField:
default: '@timestamp'
description: The field to use as the timestamp for the entity type.
type: string
description: Schema for the engine initialization
required: true
responses:
Expand All @@ -12068,7 +12076,7 @@ paths:
post:
operationId: StartEntityEngine
parameters:
- description: The entity type of the engine (either 'user' or 'host').
- description: The entity type of the engine
in: path
name: entityType
required: true
Expand Down Expand Up @@ -58120,6 +58128,8 @@ components:
default: 180s
pattern: '[smdh]$'
type: string
timestampField:
type: string
type:
$ref: '#/components/schemas/Security_Entity_Analytics_API_EntityType'
required:
Expand Down Expand Up @@ -58247,6 +58257,12 @@ components:
required:
- name
- source
event:
type: object
properties:
ingested:
format: date-time
type: string
host:
type: object
properties:
Expand Down Expand Up @@ -58285,7 +58301,6 @@ components:
required:
- name
required:
- '@timestamp'
- host
- entity
Security_Entity_Analytics_API_IdField:
Expand Down Expand Up @@ -58392,6 +58407,12 @@ components:
required:
- name
- source
event:
type: object
properties:
ingested:
format: date-time
type: string
service:
type: object
properties:
Expand All @@ -58402,7 +58423,6 @@ components:
required:
- name
required:
- '@timestamp'
- service
- entity
Security_Entity_Analytics_API_StoreStatus:
Expand Down Expand Up @@ -58448,6 +58468,12 @@ components:
required:
- name
- source
event:
type: object
properties:
ingested:
format: date-time
type: string
user:
type: object
properties:
Expand Down Expand Up @@ -58482,7 +58508,6 @@ components:
required:
- name
required:
- '@timestamp'
- user
- entity
Security_Exceptions_API_CreateExceptionListItemComment:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,7 @@
"filter",
"indexPattern",
"status",
"timestampField",
"type"
],
"epm-packages": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1092,6 +1092,9 @@
"status": {
"type": "keyword"
},
"timestampField": {
"type": "keyword"
},
"type": {
"type": "keyword"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ describe('checking migration metadata changes on all registered SO types', () =>
"enterprise_search_telemetry": "9ac912e1417fc8681e0cd383775382117c9e3d3d",
"entity-definition": "1c6bff35c423d5dc5650bc806cf2899e4706a0bc",
"entity-discovery-api-key": "c267a65c69171d1804362155c1378365f5acef88",
"entity-engine-status": "e2de87d84e9f1f72726eb28b7e670ff8021b5eb4",
"entity-engine-status": "09f6a617020708e4f638137e5ef35bd9534133be",
"epm-packages": "8042d4a1522f6c4e6f5486e791b3ffe3a22f88fd",
"epm-packages-assets": "7a3e58efd9a14191d0d1a00b8aaed30a145fd0b1",
"event-annotation-group": "715ba867d8c68f3c9438052210ea1c30a9362582",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ export const EngineDescriptor = z.object({
.regex(/[smdh]$/)
.optional()
.default('24h'),
timestampField: z.string().optional(),
timeout: z
.string()
.regex(/[smdh]$/)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ components:
type: string
default: 24h
pattern: '[smdh]$'
timestampField:
type: string
timeout:
type: string
default: 180s
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ export const InitEntityStoreRequestBody = z.object({
filter: z.string().optional(),
entityTypes: z.array(EntityType).optional(),
enrichPolicyExecutionInterval: Interval.optional(),
/**
* The field to use as the timestamp.
*/
timestampField: z.string().optional().default('@timestamp'),
/**
* The amount of time the transform looks back to calculate the aggregations.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ paths:
$ref: './common.schema.yaml#/components/schemas/EntityType'
enrichPolicyExecutionInterval:
$ref: './common.schema.yaml#/components/schemas/Interval'
timestampField:
type: string
description: The field to use as the timestamp.
default: '@timestamp'
lookbackPeriod:
type: string
default: 24h
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ export const InitEntityEngineRequestBody = z.object({
indexPattern: IndexPattern.optional(),
filter: z.string().optional(),
enrichPolicyExecutionInterval: Interval.optional(),
/**
* The field to use as the timestamp for the entity type.
*/
timestampField: z.string().optional().default('@timestamp'),
/**
* The amount of time the transform looks back to calculate the aggregations.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,10 @@ paths:
type: string
enrichPolicyExecutionInterval:
$ref: '../common.schema.yaml#/components/schemas/Interval'

timestampField:
type: string
description: The field to use as the timestamp for the entity type.
default: '@timestamp'
lookbackPeriod:
type: string
default: 24h
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import { EntityType } from '../common.gen';
export type StartEntityEngineRequestParams = z.infer<typeof StartEntityEngineRequestParams>;
export const StartEntityEngineRequestParams = z.object({
/**
* The entity type of the engine (either 'user' or 'host').
* The entity type of the engine
*/
entityType: EntityType,
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ paths:
required: true
schema:
$ref: '../common.schema.yaml#/components/schemas/EntityType'
description: The entity type of the engine (either 'user' or 'host').
description: The entity type of the engine
responses:
'200':
description: Successful response
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import { AssetCriticalityLevel } from '../../asset_criticality/common.gen';

export type UserEntity = z.infer<typeof UserEntity>;
export const UserEntity = z.object({
'@timestamp': z.string().datetime(),
'@timestamp': z.string().datetime().optional(),
entity: z.object({
name: z.string(),
source: z.string(),
Expand All @@ -41,11 +41,16 @@ export const UserEntity = z.object({
criticality: AssetCriticalityLevel,
})
.optional(),
event: z
.object({
ingested: z.string().datetime().optional(),
})
.optional(),
});

export type HostEntity = z.infer<typeof HostEntity>;
export const HostEntity = z.object({
'@timestamp': z.string().datetime(),
'@timestamp': z.string().datetime().optional(),
entity: z.object({
name: z.string(),
source: z.string(),
Expand All @@ -66,11 +71,16 @@ export const HostEntity = z.object({
criticality: AssetCriticalityLevel,
})
.optional(),
event: z
.object({
ingested: z.string().datetime().optional(),
})
.optional(),
});

export type ServiceEntity = z.infer<typeof ServiceEntity>;
export const ServiceEntity = z.object({
'@timestamp': z.string().datetime(),
'@timestamp': z.string().datetime().optional(),
entity: z.object({
name: z.string(),
source: z.string(),
Expand All @@ -84,6 +94,11 @@ export const ServiceEntity = z.object({
criticality: AssetCriticalityLevel,
})
.optional(),
event: z
.object({
ingested: z.string().datetime().optional(),
})
.optional(),
});

export const EntityInternal = z.union([UserEntity, HostEntity, ServiceEntity]);
Expand Down
Loading