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

Event categorisation fields #242

Merged
merged 6 commits into from
Dec 7, 2018
Merged
Show file tree
Hide file tree
Changes from 5 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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.DS_Store
*.pyc
env
*.sw?
5 changes: 3 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ All notable changes to this project will be documented in this file based on the
to `network.packets`. #179
* Remove `network.inbound.bytes`, `network.inbound.packets`,
`network.outbound.bytes` and `network.outbound.packets`. #179
* Changed the `event.type` definition to be only reserved. #242

### Bugfixes

Expand All @@ -31,16 +32,16 @@ All notable changes to this project will be documented in this file based on the
* Add `user.full_name` field. #201
* Add `network.community_id` field. #208
* Add fields `geo.country_name` and `geo.region_iso_code`. #214
* Add `event.kind` and `event.outcome`. #242

### Improvements
* Improved the definition of the file fields #196
* Improved the definition of the agent fields #192
* Improve definition of events, logs, and metrics in event section #194
* Improved the definition of network fields in intro section #197
* Improved the definition of host fields #195

* Improved the definitions for `event.category` and `event.action`. #242
* Clarify the semantics of `network.direction`. #212

* Add `source.bytes`, `source.packets`, `destination.bytes` and `destination.packets`. #179

### Deprecated
Expand Down
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -197,9 +197,11 @@ The event fields are used for context information about the log or metric event
| Field | Description | Level | Type | Example |
|---|---|---|---|---|
| <a name="event.id"></a>event.id | Unique ID to describe the event. | core | keyword | `8a4f500d` |
| <a name="event.category"></a>event.category | Event category.<br/>This can be a user defined category. | core | keyword | `metrics` |
| <a name="event.type"></a>event.type | A type given to this kind of event which can be used for grouping.<br/>This is normally defined by the user. | core | keyword | `nginx-stats-metrics` |
| <a name="event.action"></a>event.action | The action captured by the event. The type of action will vary from system to system but is likely to include actions by security services, such as blocking or quarantining; as well as more generic actions such as login events, file i/o or proxy forwarding events.<br/>The value is normally defined by the user. | core | keyword | `reject` |
| <a name="event.kind"></a>event.kind | The kind of the event.<br/>This gives information about what type of information the event contains, without being specific to the contents of the event. Examples are `event`, `state`, `alarm`. Warning: In future versions of ECS, we plan to provide a list of acceptable values for this field, please use with caution. | core | keyword | `state` |
| <a name="event.category"></a>event.category | Event category.<br/>This contains high-level information about the contents of the event. It is more generic than `event.action`, in the sense that typically a category contains multiple actions. Warning: In future versions of ECS, we plan to provide a list of acceptable values for this field, please use with caution. | core | keyword | `user-management` |
| <a name="event.action"></a>event.action | The action captured by the event.<br/>This describes the information in the event. It is more specific than `event.category`. Examples are `group-add`, `process-started`, `file-created`. The value is normally defined by the implementer. | core | keyword | `user-password-change` |
| <a name="event.outcome"></a>event.outcome | The outcome of the event.<br/>If the event describes an action, this fields contains the outcome of that action. Examples outcomes are `success` and `failure`. Warning: In future versions of ECS, we plan to provide a list of acceptable values for this field, please use with caution. | core | keyword | `success` |
| <a name="event.type"></a>event.type | Reserved for future usage.<br/>Please avoid using this field for user data. | core | keyword | |
| <a name="event.module"></a>event.module | Name of the module this data is coming from.<br/>This information is coming from the modules used in Beats or Logstash. | core | keyword | `mysql` |
| <a name="event.dataset"></a>event.dataset | Name of the dataset.<br/>The concept of a `dataset` (fileset / metricset) is used in Beats as a subset of modules. It contains the information which is currently stored in metricset.name and metricset.module or fileset.name. | core | keyword | `stats` |
| <a name="event.severity"></a>event.severity | Severity describes the severity of the event. What the different severity values mean can very different between use cases. It's up to the implementer to make sure severities are consistent across events. | core | long | `7` |
Expand Down
55 changes: 42 additions & 13 deletions fields.yml
Original file line number Diff line number Diff line change
Expand Up @@ -396,35 +396,64 @@
Unique ID to describe the event.
example: 8a4f500d

- name: kind
level: core
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, only spotted now but these fields should go into extended for now.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I moved event.kind and event.outcome to extended.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll be proposing pushing these to core sometime in the future :-)

type: keyword
description: >
The kind of the event.

This gives information about what type of information the event
contains, without being specific to the contents of the event. Examples
are `event`, `state`, `alarm`. Warning: In future versions of ECS, we
plan to provide a list of acceptable values for this field, please use
with caution.
example: state

- name: category
level: core
type: keyword
description: >
Event category.

This can be a user defined category.
example: metrics
This contains high-level information about the contents of the event. It
is more generic than `event.action`, in the sense that typically a
category contains multiple actions. Warning: In future versions of ECS,
we plan to provide a list of acceptable values for this field, please
use with caution.

- name: type
example: user-management
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The plan with this field is to have a predetermined set of categories (a few tens of them). Having the field now in ECS sets us up for a sort of breaking change when we come up with that list.

Therefore I think the description can remain as is, but we should add a warning telling people that they're using this field at their own risk, because it will soon be a field that should be populated with prescribed values.

It won't be the end of the world, though. It's not going to break ingestion or anything. It's just that Elastic solutions will expect this field to contain certain values, so if some sources populate this differently, they won't have the best experience...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning added.


- name: action
level: core
type: keyword
description: >
A type given to this kind of event which can be used for grouping.
The action captured by the event.

This is normally defined by the user.
example: nginx-stats-metrics
This describes the information in the event. It is more specific than
`event.category`. Examples are `group-add`, `process-started`,
`file-created`. The value is normally defined by the implementer.
example: user-password-change

- name: action
- name: outcome
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

outcome is also meant to be a field with prescribed content. We should add a similar warning as what I suggest for event.category. More or less "We're about to come up with a list of prescribed values, so use with caution."

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning added.

level: core
type: keyword
description: >
The outcome of the event.

If the event describes an action, this fields contains the outcome of
that action. Examples outcomes are `success` and `failure`. Warning: In
future versions of ECS, we plan to provide a list of acceptable values
for this field, please use with caution.

example: success

- name: type
level: core
type: keyword
description: >
The action captured by the event. The type of action will vary from
system to system but is likely to include actions by security services,
such as blocking or quarantining; as well as more generic actions such
as login events, file i/o or proxy forwarding events.
Reserved for future usage.

The value is normally defined by the user.
example: reject
Please avoid using this field for user data.

- name: module
level: core
Expand Down
8 changes: 5 additions & 3 deletions schema.csv
Original file line number Diff line number Diff line change
Expand Up @@ -38,21 +38,23 @@ ecs.version,keyword,core,1.0.0-beta1
error.code,keyword,core,
error.id,keyword,core,
error.message,text,core,
event.action,keyword,core,reject
event.category,keyword,core,metrics
event.action,keyword,core,user-password-change
event.category,keyword,core,user-management
event.created,date,core,
event.dataset,keyword,core,stats
event.duration,long,core,
event.end,date,extended,
event.hash,keyword,extended,123456789012345678901234567890ABCD
event.id,keyword,core,8a4f500d
event.kind,keyword,core,state
event.module,keyword,core,mysql
event.original,keyword,core,Sep 19 08:26:10 host CEF:0&#124;Security&#124; threatmanager&#124;1.0&#124;100&#124; worm successfully stopped&#124;10&#124;src=10.0.0.1 dst=2.1.2.2spt=1232
event.outcome,keyword,core,success
event.risk_score,float,core,
event.risk_score_norm,float,extended,
event.severity,long,core,7
event.start,date,extended,
event.type,keyword,core,nginx-stats-metrics
event.type,keyword,core,
file.ctime,date,extended,
file.device,keyword,extended,
file.extension,keyword,extended,png
Expand Down
55 changes: 42 additions & 13 deletions schemas/event.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,35 +14,64 @@
Unique ID to describe the event.
example: 8a4f500d

- name: kind
level: extended
type: keyword
description: >
The kind of the event.

This gives information about what type of information the event
contains, without being specific to the contents of the event. Examples
are `event`, `state`, `alarm`. Warning: In future versions of ECS, we
plan to provide a list of acceptable values for this field, please use
with caution.
example: state

- name: category
level: core
type: keyword
description: >
Event category.

This can be a user defined category.
example: metrics
This contains high-level information about the contents of the event. It
is more generic than `event.action`, in the sense that typically a
category contains multiple actions. Warning: In future versions of ECS,
we plan to provide a list of acceptable values for this field, please
use with caution.

- name: type
example: user-management

- name: action
level: core
type: keyword
description: >
A type given to this kind of event which can be used for grouping.
The action captured by the event.

This is normally defined by the user.
example: nginx-stats-metrics
This describes the information in the event. It is more specific than
`event.category`. Examples are `group-add`, `process-started`,
`file-created`. The value is normally defined by the implementer.
example: user-password-change

- name: action
- name: outcome
level: extended
type: keyword
description: >
The outcome of the event.

If the event describes an action, this fields contains the outcome of
that action. Examples outcomes are `success` and `failure`. Warning: In
future versions of ECS, we plan to provide a list of acceptable values
for this field, please use with caution.

example: success

- name: type
level: core
type: keyword
description: >
The action captured by the event. The type of action will vary from
system to system but is likely to include actions by security services,
such as blocking or quarantining; as well as more generic actions such
as login events, file i/o or proxy forwarding events.
Reserved for future usage.

The value is normally defined by the user.
example: reject
Please avoid using this field for user data.

- name: module
level: core
Expand Down
8 changes: 8 additions & 0 deletions template.json
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,10 @@
"ignore_above": 1024,
"type": "keyword"
},
"kind": {
"ignore_above": 1024,
"type": "keyword"
},
"module": {
"ignore_above": 1024,
"type": "keyword"
Expand All @@ -242,6 +246,10 @@
"index": false,
"type": "keyword"
},
"outcome": {
"ignore_above": 1024,
"type": "keyword"
},
"risk_score": {
"type": "float"
},
Expand Down