forked from elastic/ecs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
dns.yml
207 lines (175 loc) · 6.88 KB
/
dns.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
---
- name: dns
title: DNS
group: 2
short: Fields describing DNS queries and answers.
description: >
Fields describing DNS queries and answers.
DNS events should either represent a single DNS query prior to getting answers
(`dns.type:query`) or they should represent a full exchange and contain
the query details as well as all of the answers that were provided for this
query (`dns.type:answer`).
type: group
fields:
- name: type
level: extended
type: keyword
short: The type of DNS event captured, query or answer.
description: >
The type of DNS event captured, query or answer.
If your source of DNS events only gives you DNS queries, you should only
create dns events of type `dns.type:query`.
If your source of DNS events gives you answers as well, you should create
one event per query (optionally as soon as the query is seen). And a
second event containing all query details as well as an array of answers.
example: answer
- name: id
level: extended
type: keyword
description: >
The DNS packet identifier assigned by the program that generated the
query. The identifier is copied to the response.
example: 62111
- name: op_code
level: extended
type: keyword
description: >
The DNS operation code that specifies the kind of query in the message.
This value is set by the originator of a query and copied into the
response.
example: QUERY
- name: header_flags
level: extended
type: keyword
short: Array of DNS header flags.
description: >
Array of 2 letter DNS header flags.
Expected values are: AA, TC, RD, RA, AD, CD, DO.
example: [RD, RA]
normalize:
- array
- name: response_code
level: extended
type: keyword
description: The DNS response code.
example: NOERROR
- name: question.name
level: extended
type: keyword
short: The name being queried.
description: >
The name being queried.
If the name field contains non-printable
characters (below 32 or above 126), those characters should be represented
as escaped base 10 integers (\DDD). Back slashes and quotes should be escaped.
Tabs, carriage returns, and line feeds should be converted to \t, \r, and
\n respectively.
example: www.google.com
- name: question.type
level: extended
type: keyword
description: The type of record being queried.
example: AAAA
- name: question.class
level: extended
type: keyword
description: The class of records being queried.
example: IN
- name: question.registered_domain
level: extended
type: keyword
short: The highest registered domain, stripped of the subdomain.
description: >
The highest registered domain, stripped of the subdomain.
For example, the registered domain for "foo.google.com" is "google.com".
This value can be determined precisely with a list like the public
suffix list (http://publicsuffix.org). Trying to approximate this by
simply taking the last two labels will not work well for TLDs such as "co.uk".
example: google.com
- name: question.top_level_domain
level: extended
type: keyword
short: The effective top level domain (com, org, net, co.uk).
description: >
The effective top level domain (eTLD), also known as the domain suffix,
is the last part of the domain name.
For example, the top level domain for google.com is "com".
This value can be determined precisely with a list like the public
suffix list (http://publicsuffix.org). Trying to approximate this by
simply taking the last label will not work well for effective TLDs such as "co.uk".
example: co.uk
- name: question.subdomain
level: extended
type: keyword
short: The subdomain of the domain.
description: >
The subdomain is all of the labels under the registered_domain.
If the domain has multiple levels of subdomain, such as "sub2.sub1.example.com",
the subdomain field should contain "sub2.sub1", with no trailing period.
example: www
- name: answers
level: extended
type: object
short: Array of DNS answers.
description: >
An array containing an object for each answer section returned by
the server.
The main keys that should be present in these objects are defined by ECS.
Records that have more information may contain more keys than what
ECS defines.
Not all DNS data sources give all details about DNS answers.
At minimum, answer objects must contain the `data` key.
If more information is available, map as much of it to ECS as possible,
and add any additional fields to the answer objects as custom fields.
normalize:
- array
- name: answers.name
level: extended
type: keyword
short: The domain name to which this resource record pertains.
description: >
The domain name to which this resource record pertains.
If a chain of CNAME is being resolved, each answer's `name` should be
the one that corresponds with the answer's `data`. It should not simply
be the original `question.name` repeated.
example: www.google.com
- name: answers.type
level: extended
type: keyword
description: The type of data contained in this resource record.
example: CNAME
- name: answers.class
level: extended
type: keyword
description: The class of DNS data contained in this resource record.
example: IN
- name: answers.ttl
level: extended
type: long
description: >
The time interval in seconds that this resource record may be cached
before it should be discarded. Zero values mean that the data should
not be cached.
example: 180
- name: answers.data
level: extended
type: keyword
short: The data describing the resource.
description: >
The data describing the resource.
The meaning of this data depends on the type and class of the resource
record.
example: 10.10.10.10
- name: resolved_ip
level: extended
type: ip
short: Array containing all IPs seen in answers.data
description: >
Array containing all IPs seen in `answers.data`.
The `answers` array can be difficult to use, because of the variety of
data formats it can contain. Extracting all IP addresses seen in there to
`dns.resolved_ip` makes it possible to index them as IP addresses, and
makes them easier to visualize and query for.
example: [10.10.10.10, 10.10.10.11]
normalize:
- array