-
Notifications
You must be signed in to change notification settings - Fork 8.6k
[core.logging] Ensure LogMeta is ECS-compliant. #96350
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
Merged
Merged
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
3aba9b2
Add initial types for ECS.
lukeelmers 9f92dbe
Expose ECS types & enforce LogMeta to conform to ECS.
lukeelmers ff87325
Update core to conform to ECS LogMeta.
lukeelmers 9448244
Update security plugin to conform to ECS LogMeta.
lukeelmers 3d5ba7b
Update actions plugin to conform to ECS LogMeta.
lukeelmers 2f9e622
Update alerting plugin to conform to ECS LogMeta.
lukeelmers 2d63e5b
Update generated docs.
lukeelmers d2810ea
Address initial feedback.
lukeelmers 2702ee6
Update generated docs.
lukeelmers 4c929ff
Update metrics snapshot test.
lukeelmers b878341
Fix audit logging type errors.
lukeelmers 63e8c10
Merge branch 'master' into feat/ecs-logs
lukeelmers 78e631a
Fix usage counters type error.
lukeelmers 7133d50
Fix jest tests.
lukeelmers fb3e7eb
Core's logger values always overwrite LogMeta.
lukeelmers ce675d2
Clarify behavior of filterEvent and add tests.
lukeelmers 28ef538
Merge branch 'master' into feat/ecs-logs
kibanamachine a0a2bad
Merge branch 'master' into feat/ecs-logs
kibanamachine File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| /* | ||
| * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
| * or more contributor license agreements. Licensed under the Elastic License | ||
| * 2.0 and the Server Side Public License, v 1; you may not use this file except | ||
| * in compliance with, at your election, the Elastic License 2.0 or the Server | ||
| * Side Public License, v 1. | ||
| */ | ||
|
|
||
| /** | ||
| * https://www.elastic.co/guide/en/ecs/1.9/ecs-agent.html | ||
| * | ||
| * @internal | ||
| */ | ||
| export interface EcsAgent { | ||
| build?: { original: string }; | ||
| ephemeral_id?: string; | ||
| id?: string; | ||
| name?: string; | ||
| type?: string; | ||
| version?: string; | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| /* | ||
| * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
| * or more contributor license agreements. Licensed under the Elastic License | ||
| * 2.0 and the Server Side Public License, v 1; you may not use this file except | ||
| * in compliance with, at your election, the Elastic License 2.0 or the Server | ||
| * Side Public License, v 1. | ||
| */ | ||
|
|
||
| /** | ||
| * https://www.elastic.co/guide/en/ecs/1.9/ecs-as.html | ||
| * | ||
| * @internal | ||
| */ | ||
| export interface EcsAutonomousSystem { | ||
| number?: number; | ||
| organization?: { name: string }; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| /* | ||
| * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
| * or more contributor license agreements. Licensed under the Elastic License | ||
| * 2.0 and the Server Side Public License, v 1; you may not use this file except | ||
| * in compliance with, at your election, the Elastic License 2.0 or the Server | ||
| * Side Public License, v 1. | ||
| */ | ||
|
|
||
| /** | ||
| * https://www.elastic.co/guide/en/ecs/1.9/ecs-base.html | ||
| * | ||
| * @internal | ||
| */ | ||
| export interface EcsBase { | ||
| ['@timestamp']: string; | ||
| labels?: Record<string, unknown>; | ||
| message?: string; | ||
| tags?: string[]; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| /* | ||
| * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
| * or more contributor license agreements. Licensed under the Elastic License | ||
| * 2.0 and the Server Side Public License, v 1; you may not use this file except | ||
| * in compliance with, at your election, the Elastic License 2.0 or the Server | ||
| * Side Public License, v 1. | ||
| */ | ||
|
|
||
| import { EcsAutonomousSystem } from './autonomous_system'; | ||
| import { EcsGeo } from './geo'; | ||
| import { EcsNestedUser } from './user'; | ||
|
|
||
| interface NestedFields { | ||
| as?: EcsAutonomousSystem; | ||
| geo?: EcsGeo; | ||
| user?: EcsNestedUser; | ||
| } | ||
|
|
||
| /** | ||
| * https://www.elastic.co/guide/en/ecs/1.9/ecs-client.html | ||
| * | ||
| * @internal | ||
| */ | ||
| export interface EcsClient extends NestedFields { | ||
| address?: string; | ||
| bytes?: number; | ||
| domain?: string; | ||
| ip?: string; | ||
| mac?: string; | ||
| nat?: { ip?: string; port?: number }; | ||
| packets?: number; | ||
| port?: number; | ||
| registered_domain?: string; | ||
| subdomain?: string; | ||
| top_level_domain?: string; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| /* | ||
| * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
| * or more contributor license agreements. Licensed under the Elastic License | ||
| * 2.0 and the Server Side Public License, v 1; you may not use this file except | ||
| * in compliance with, at your election, the Elastic License 2.0 or the Server | ||
| * Side Public License, v 1. | ||
| */ | ||
|
|
||
| /** | ||
| * https://www.elastic.co/guide/en/ecs/1.9/ecs-cloud.html | ||
| * | ||
| * @internal | ||
| */ | ||
| export interface EcsCloud { | ||
| account?: { id?: string; name?: string }; | ||
| availability_zone?: string; | ||
| instance?: { id?: string; name?: string }; | ||
| machine?: { type: string }; | ||
| project?: { id?: string; name?: string }; | ||
| provider?: string; | ||
| region?: string; | ||
| service?: { name: string }; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| /* | ||
| * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
| * or more contributor license agreements. Licensed under the Elastic License | ||
| * 2.0 and the Server Side Public License, v 1; you may not use this file except | ||
| * in compliance with, at your election, the Elastic License 2.0 or the Server | ||
| * Side Public License, v 1. | ||
| */ | ||
|
|
||
| /** | ||
| * https://www.elastic.co/guide/en/ecs/1.9/ecs-code_signature.html | ||
| * | ||
| * @internal | ||
| */ | ||
| export interface EcsCodeSignature { | ||
| exists?: boolean; | ||
| signing_id?: string; | ||
| status?: string; | ||
| subject_name?: string; | ||
| team_id?: string; | ||
| trusted?: boolean; | ||
| valid?: boolean; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| /* | ||
| * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
| * or more contributor license agreements. Licensed under the Elastic License | ||
| * 2.0 and the Server Side Public License, v 1; you may not use this file except | ||
| * in compliance with, at your election, the Elastic License 2.0 or the Server | ||
| * Side Public License, v 1. | ||
| */ | ||
|
|
||
| /** | ||
| * https://www.elastic.co/guide/en/ecs/1.9/ecs-container.html | ||
| * | ||
| * @internal | ||
| */ | ||
| export interface EcsContainer { | ||
| id?: string; | ||
| image?: { name?: string; tag?: string[] }; | ||
| labels?: Record<string, unknown>; | ||
| name?: string; | ||
| runtime?: string; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| /* | ||
| * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
| * or more contributor license agreements. Licensed under the Elastic License | ||
| * 2.0 and the Server Side Public License, v 1; you may not use this file except | ||
| * in compliance with, at your election, the Elastic License 2.0 or the Server | ||
| * Side Public License, v 1. | ||
| */ | ||
|
|
||
| import { EcsAutonomousSystem } from './autonomous_system'; | ||
| import { EcsGeo } from './geo'; | ||
| import { EcsNestedUser } from './user'; | ||
|
|
||
| interface NestedFields { | ||
| as?: EcsAutonomousSystem; | ||
| geo?: EcsGeo; | ||
| user?: EcsNestedUser; | ||
| } | ||
|
|
||
| /** | ||
| * https://www.elastic.co/guide/en/ecs/1.9/ecs-destination.html | ||
| * | ||
| * @internal | ||
| */ | ||
| export interface EcsDestination extends NestedFields { | ||
| address?: string; | ||
| bytes?: number; | ||
| domain?: string; | ||
| ip?: string; | ||
| mac?: string; | ||
| nat?: { ip?: string; port?: number }; | ||
| packets?: number; | ||
| port?: number; | ||
| registered_domain?: string; | ||
| subdomain?: string; | ||
| top_level_domain?: string; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| /* | ||
| * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
| * or more contributor license agreements. Licensed under the Elastic License | ||
| * 2.0 and the Server Side Public License, v 1; you may not use this file except | ||
| * in compliance with, at your election, the Elastic License 2.0 or the Server | ||
| * Side Public License, v 1. | ||
| */ | ||
|
|
||
| import { EcsCodeSignature } from './code_signature'; | ||
| import { EcsHash } from './hash'; | ||
| import { EcsPe } from './pe'; | ||
|
|
||
| interface NestedFields { | ||
| code_signature?: EcsCodeSignature; | ||
| hash?: EcsHash; | ||
| pe?: EcsPe; | ||
| } | ||
|
|
||
| /** | ||
| * https://www.elastic.co/guide/en/ecs/1.9/ecs-dll.html | ||
| * | ||
| * @internal | ||
| */ | ||
| export interface EcsDll extends NestedFields { | ||
| name?: string; | ||
| path?: string; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| /* | ||
| * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
| * or more contributor license agreements. Licensed under the Elastic License | ||
| * 2.0 and the Server Side Public License, v 1; you may not use this file except | ||
| * in compliance with, at your election, the Elastic License 2.0 or the Server | ||
| * Side Public License, v 1. | ||
| */ | ||
|
|
||
| /** | ||
| * https://www.elastic.co/guide/en/ecs/1.9/ecs-dns.html | ||
| * | ||
| * @internal | ||
| */ | ||
| export interface EcsDns { | ||
| answers?: Answer[]; | ||
| header_flags?: string[]; | ||
| id?: number; | ||
| op_code?: string; | ||
| question?: Question; | ||
| resolved_ip?: string[]; | ||
| response_code?: string; | ||
| type?: string; | ||
| } | ||
|
|
||
| interface Answer { | ||
| data: string; | ||
| class?: string; | ||
| name?: string; | ||
| ttl?: number; | ||
| type?: string; | ||
| } | ||
|
|
||
| interface Question { | ||
| class?: string; | ||
| name?: string; | ||
| registered_domain?: string; | ||
| subdomain?: string; | ||
| top_level_domain?: string; | ||
| type?: string; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| /* | ||
| * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
| * or more contributor license agreements. Licensed under the Elastic License | ||
| * 2.0 and the Server Side Public License, v 1; you may not use this file except | ||
| * in compliance with, at your election, the Elastic License 2.0 or the Server | ||
| * Side Public License, v 1. | ||
| */ | ||
|
|
||
| /** | ||
| * https://www.elastic.co/guide/en/ecs/1.9/ecs-error.html | ||
| * | ||
| * @internal | ||
| */ | ||
| export interface EcsError { | ||
| code?: string; | ||
| id?: string; | ||
| message?: string; | ||
| stack_trace?: string; | ||
| type?: string; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,91 @@ | ||
| /* | ||
| * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
| * or more contributor license agreements. Licensed under the Elastic License | ||
| * 2.0 and the Server Side Public License, v 1; you may not use this file except | ||
| * in compliance with, at your election, the Elastic License 2.0 or the Server | ||
| * Side Public License, v 1. | ||
| */ | ||
|
|
||
| /** | ||
| * https://www.elastic.co/guide/en/ecs/1.9/ecs-event.html | ||
| * | ||
| * @internal | ||
| */ | ||
| export interface EcsEvent { | ||
| action?: string; | ||
| category?: EcsEventCategory[]; | ||
| code?: string; | ||
| created?: string; | ||
| dataset?: string; | ||
| duration?: number; | ||
| end?: string; | ||
| hash?: string; | ||
| id?: string; | ||
| ingested?: string; | ||
| kind?: EcsEventKind; | ||
| module?: string; | ||
| original?: string; | ||
| outcome?: EcsEventOutcome; | ||
| provider?: string; | ||
| reason?: string; | ||
| reference?: string; | ||
| risk_score?: number; | ||
| risk_score_norm?: number; | ||
| sequence?: number; | ||
| severity?: number; | ||
| start?: string; | ||
| timezone?: string; | ||
| type?: EcsEventType[]; | ||
| url?: string; | ||
| } | ||
|
|
||
| /** | ||
| * @public | ||
| */ | ||
| export type EcsEventCategory = | ||
|
lukeelmers marked this conversation as resolved.
Outdated
|
||
| | 'authentication' | ||
| | 'configuration' | ||
| | 'database' | ||
| | 'driver' | ||
| | 'file' | ||
| | 'host' | ||
| | 'iam' | ||
| | 'intrusion_detection' | ||
| | 'malware' | ||
| | 'network' | ||
| | 'package' | ||
| | 'process' | ||
| | 'registry' | ||
| | 'session' | ||
| | 'web'; | ||
|
|
||
| /** | ||
| * @public | ||
| */ | ||
| export type EcsEventKind = 'alert' | 'event' | 'metric' | 'state' | 'pipeline_error' | 'signal'; | ||
|
|
||
| /** | ||
| * @public | ||
| */ | ||
| export type EcsEventOutcome = 'failure' | 'success' | 'unknown'; | ||
|
|
||
| /** | ||
| * @public | ||
| */ | ||
| export type EcsEventType = | ||
| | 'access' | ||
| | 'admin' | ||
| | 'allowed' | ||
| | 'change' | ||
| | 'connection' | ||
| | 'creation' | ||
| | 'deletion' | ||
| | 'denied' | ||
| | 'end' | ||
| | 'error' | ||
| | 'group' | ||
| | 'info' | ||
| | 'installation' | ||
| | 'protocol' | ||
| | 'start' | ||
| | 'user'; | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.