Skip to content

Commit b038211

Browse files
authored
Change event.type to auditd.message_type (#10536)
`event.type` is a reserved field in ECS so move the current field to `auditd.message_type`.
1 parent 89af30d commit b038211

File tree

10 files changed

+37
-12
lines changed

10 files changed

+37
-12
lines changed

CHANGELOG.next.asciidoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ https://github.com/elastic/beats/compare/v7.0.0-alpha2...master[Check the HEAD d
4040
FIM module. {pull}10195[10195]
4141
- Field `file.origin` changed type from `text` to `keyword`. {pull}10544[10544]
4242
- Rename user fields to ECS in auditd module. {pull}10456[10456]
43+
- Rename `event.type` to `auditd.message_type` in auditd module because event.type is reserved for future use by ECS. {pull}10536[10536]
4344

4445
*Filebeat*
4546

auditbeat/docs/breaking.asciidoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ In version 7.0 the following fields were renamed.
77
[frame="topbot",options="header"]
88
|======================
99
|Old Field|New Field
10+
|`event.type` |`auditd.message_type`
1011
|`process.cwd` |`process.working_directory`
1112
|`source.hostname` |`source.domain`
1213
|`user.auid` |`user.audit.id`

auditbeat/docs/fields.asciidoc

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -302,6 +302,18 @@ This is the path associated with a unix socket.
302302
--
303303
304304
305+
*`auditd.message_type`*::
306+
+
307+
--
308+
type: keyword
309+
310+
example: syscall
311+
312+
The audit message type (e.g. syscall or apparmor_denied).
313+
314+
315+
--
316+
305317
*`auditd.sequence`*::
306318
+
307319
--

auditbeat/module/auditd/_meta/accept.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
"syscall": "accept",
1616
"tty": "(none)"
1717
},
18+
"message_type": "syscall",
1819
"result": "success",
1920
"sequence": 8832,
2021
"session": "unset",
@@ -34,8 +35,7 @@
3435
"event": {
3536
"action": "accepted-connection-from",
3637
"category": "audit-rule",
37-
"module": "auditd",
38-
"type": "syscall"
38+
"module": "auditd"
3939
},
4040
"network": {
4141
"direction": "incoming"

auditbeat/module/auditd/_meta/data.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
"op": "login",
1111
"terminal": "sshd"
1212
},
13+
"message_type": "user_login",
1314
"result": "fail",
1415
"sequence": 19955,
1516
"session": "unset",
@@ -29,8 +30,7 @@
2930
"event": {
3031
"action": "logged-in",
3132
"category": "user-login",
32-
"module": "auditd",
33-
"type": "user_login"
33+
"module": "auditd"
3434
},
3535
"network": {
3636
"direction": "incoming"

auditbeat/module/auditd/_meta/execve.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
"syscall": "execve",
1212
"tty": "pts0"
1313
},
14+
"message_type": "syscall",
1415
"paths": [
1516
{
1617
"dev": "08:01",
@@ -53,8 +54,7 @@
5354
"event": {
5455
"action": "executed",
5556
"category": "audit-rule",
56-
"module": "auditd",
57-
"type": "syscall"
57+
"module": "auditd"
5858
},
5959
"file": {
6060
"device": "00:00",

auditbeat/module/auditd/_meta/fields.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,11 @@
135135
- name: auditd
136136
type: group
137137
fields:
138+
- name: message_type
139+
type: keyword
140+
example: syscall
141+
description: >
142+
The audit message type (e.g. syscall or apparmor_denied).
138143
- name: sequence
139144
type: long
140145
description: >

auditbeat/module/auditd/audit_linux.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -472,15 +472,15 @@ func buildMetricbeatEvent(msgs []*auparse.AuditMessage, config Config) mb.Event
472472
RootFields: common.MapStr{
473473
"event": common.MapStr{
474474
"category": auditEvent.Category.String(),
475-
"type": strings.ToLower(auditEvent.Type.String()),
476475
"action": auditEvent.Summary.Action,
477476
},
478477
},
479478
ModuleFields: common.MapStr{
480-
"sequence": auditEvent.Sequence,
481-
"result": auditEvent.Result,
482-
"session": auditEvent.Session,
483-
"data": createAuditdData(auditEvent.Data),
479+
"message_type": strings.ToLower(auditEvent.Type.String()),
480+
"sequence": auditEvent.Sequence,
481+
"result": auditEvent.Result,
482+
"session": auditEvent.Session,
483+
"data": createAuditdData(auditEvent.Data),
484484
},
485485
}
486486

auditbeat/module/auditd/fields.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dev-tools/ecs-migration.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1613,6 +1613,12 @@
16131613
alias: true
16141614
beat: auditbeat
16151615

1616+
- from: event.type
1617+
to: auditd.message_type
1618+
alias: false
1619+
beat: auditbeat
1620+
comment: event.type is reserved for future use by ECS.
1621+
16161622
# Metricbeat
16171623

16181624
## Metricbeat base fields

0 commit comments

Comments
 (0)