Audit event types
editAudit event types
editWhen you are auditing security events, each request can generate multiple audit events.
The following is a list of the events that can be generated:
|
Logged when a request is denied due to a missing authentication token. |
||
|
Logged when a user successfully authenticates. |
||
|
Logged when the authentication token cannot be matched to a known user. |
||
|
Logged for every realm that fails to present a valid
authentication token. |
||
|
Logged when an authenticated user attempts to execute an action they do not have the necessary privilege to perform. |
||
|
Logged when an authenticated user attempts to execute
an action they have the necessary privilege to perform.
When the |
||
|
Logged when an authenticated user attempts to run as another user that they have the necessary privileges to do. |
||
|
Logged when an authenticated user attempts to run as another user action they do not have the necessary privilege to do so. |
||
|
Logged when the security features detect that the request has
been tampered with. Typically relates to |
||
|
Logged when an incoming TCP connection passes the IP Filter for a specific profile. |
||
|
Logged when an incoming TCP connection does not pass the IP Filter for a specific profile. |
Audit event attributes
editIn 6.5.0, there is a new logfile
audit output format.
This format also brings in a few changes for audit event attributes.
The new format is output to the <clustername>_audit.json
file.
The audit entries are formatted as flat JSON documents (that is to say, no
nested objects), one per line. Hence, the attribute names are JSON keys and they
follow a dotted name syntax. Any attributes that lack a value (null
) are not
output.
The following list shows attributes that are common to all audit events.
Their names and values are analogous to those in the deprecated logfile
or
index
output formats. However, it is expected that the formats will evolve
independently during the 6.x releases, so it is advisable to follow the attribute
descriptions for the format that you are using.
-
@timestamp
- The time, in ISO9601 format, when the event occurred.
-
node.name
-
The name of the node. This can be changed
in the
elasticsearch.yml
config file. -
node.id
- The node id. This is automatically generated and is persistent across full cluster restarts.
-
host.ip
- The bound IP address of the node, with which the node can be communicated with.
-
host.name
- The unresolved node’s hostname.
-
origin.address
- The source IP address of the request associated with this event. This could be the address of the remote client, the address of another cluster node, or the local node’s bound address, if the request originated locally. Unless the remote client connects directly to the cluster, the client address will actually be the address of the first OSI layer 3 proxy in front of the cluster.
-
origin.type
-
The origin type of the request associated with this event:
rest
(request originated from a REST API request),transport
(request was received on the transport channel), orlocal_node
(the local node issued the request). -
event.type
-
The internal processing layer that generated the event:
rest
,transport
orip_filter
. This is different fromorigin.type
because a request originating from the REST API is translated to a number of transport messages, generating audit events withorigin.type: rest
andevent.type: transport
. -
event.action
-
The type of event that occurred:
anonymous_access_denied
,authentication_failed
,authentication_success
,realm_authentication_failed
,access_denied
,access_granted
,connection_denied
,connection_granted
,tampered_request
,run_as_denied
, orrun_as_granted
. -
opaque_id
-
The value of the
X-Opaque-Id
HTTP header (if present) of the request associated with this event. This header can be used freely by the client to mark API calls, as it has no semantics in Elasticsearch. -
x_forwarded_for
-
The verbatim value of the
X-Forwarded-For
HTTP request header (if present) of the request associated with the audit event. This header is commonly added by proxies when they forward requests and the value is the address of the proxied client. When a request crosses multiple proxies the header is a comma delimited list with the last value being the address of the second to last proxy server (the address of the last proxy server is designated by theorigin.address
field).
Audit event attributes of the REST event type
editThe events with event.type
equal to rest
have one of the following event.action
attribute values: authentication_success
, anonymous_access_denied
, authentication_failed
,
realm_authentication_failed
, tampered_request
or run_as_denied
.
These event types also have the following extra attributes (in addition to the
common ones):
-
url.path
- The path part of the URL (between the port and the query string) of the REST request associated with this event. This is URL encoded.
-
url.query
- The query part of the URL (after "?", if present) of the REST request associated with this event. This is URL encoded.
-
request.method
- The HTTP method of the REST request associated with this event. It is one of GET, POST, PUT, DELETE, OPTIONS, HEAD, PATCH, TRACE and CONNECT.
-
request.body
- The full content of the REST request associated with this event, if enabled. This contains the query body. The body is escaped according to the JSON RFC 4627.
Audit event attributes of the transport event type
editThe events with event.type
equal to transport
have one of the following event.action
attribute values: authentication_success
, anonymous_access_denied
, authentication_failed
,
realm_authentication_failed
, access_granted
, access_denied
, run_as_granted
,
run_as_denied
, or tampered_request
.
These event types also have the following extra attributes (in addition to the common
ones):
-
action
- The name of the transport action that was executed. This is like the URL for a REST request.
-
indices
- The indices names array that the request associated with this event pertains to (when applicable).
-
request.name
- The name of the request handler that was executed.
Audit event attributes of the ip_filter event type
editThe events with event.type
equal to ip_filter
have one of the following event.action
attribute values: connection_granted
or connection_denied
.
These event types also have the following extra attributes (in addition to the common
ones):
-
transport_profile
- The transport profile the request targeted.
-
rule
- The IP filtering rule that denied the request.
Extra audit event attributes for specific events
editThere are a few events that have some more attributes in addition to those that have been previously described:
-
authentication_success
:-
realm
- The name of the realm that successfully authenticated the user.
-
user.name
- The name of the effective user. This is usually the same as the authenticated user, but if using the run as authorization functionality this instead denotes the name of the impersonated user.
-
user.run_by.name
- This attribute is present only if the request is using the run as authorization functionality and denotes the name of the authenticated user, which is also known as the impersonator.
-
-
authentication_failed
:-
user.name
- The name of the user that failed authentication. If the request authentication token is invalid or unparsable, this information might be missing.
-
-
realm_authentication_failed
:-
user.name
- The name of the user that failed authentication.
-
realm
- The name of the realm that rejected this authentication. This event is generated for each consulted realm in the chain.
-
-
run_as_denied
andrun_as_granted
:-
user.roles
- The role names of the user as an array.
-
user.name
- The name of the authenticated user which is being granted or denied the impersonation action.
-
user.realm
- The realm name that the authenticated user belongs to.
-
user.run_as.name
- The name of the user as which the impersonation action is granted or denied.
-
user.run_as.realm
- The realm name of that the impersonated user belongs to.
-
-
access_granted
oraccess_denied
:-
user.roles
- The role names of the user as an array.
-
user.name
- The name of the effective user that is being authorized or unauthorized. This is usually the authenticated user, but if using the run as authorization functionality this instead denotes the name of the impersonated user.
-
user.realm
- The realm name that the effective user belongs to.
-
user.run_by.name
- This attribute is present only if the request is using the run as authorization functionality and denoted the name of the authenticated user, which is also known as the impersonator.
-
user.run_by.realm
- This attribute is present only if the request is using the run as authorization functionality and denotes the name of the realm that the authenticated (impersonator) user belongs to.
-
Audit event attributes for the deprecated formats
editThe following table shows the common attributes that can be associated with
every event, when it is output to the <clustername>_access.log
file.
Table 74. Common attributes
Attribute | Description |
---|---|
|
When the event occurred. |
|
The name of the node. |
|
The hostname of the node. |
|
The IP address of the node. |
|
The layer from which this event originated: |
|
The type of event that occurred: |
These are positional attributes, which are printed at the beginning of each log line and are not adjoined by the attribute name.
The attribute origin_address
is also common to every audit event. It is always
named, that is, it is not positional. It denotes the source IP address of the
request associated with this event. This might be the address of the client, the
address of another cluster node, or the local node’s bound address (if the request
originated locally). Unless the client connects directly to the cluster, the
client address is the address of the first OSI layer 3 proxy in front of the
cluster.
In addition, every event might have the opaque_id
attribute, with the value as
it has been passed in by the X-Opaque-Id
HTTP request header. This header can
be used freely by the client to mark API calls, as it has no semantics in
Elasticsearch. Every audit event, generated as part of handling a request thus
marked, contains the opaque_id
attribute.
The following tables show the attributes that can are associated with each type of event, in addition to the common ones previously described:
Table 75. REST anonymous_access_denied attributes
Attribute | Description |
---|---|
|
The REST endpoint URI. |
|
The body of the request, if enabled. |
Table 76. REST authentication_success attributes
Attribute | Description |
---|---|
|
The effective (impersonated) username. Usually this is the same as the authenticated username. |
|
The authenticated (impersonator) username.
This attribute is present only if the request is
using the run as authorization functionality.
Otherwise, the effective user is the same as the
authenticated one, which is indicated by the |
|
The realm that authenticated the user. |
|
The REST endpoint URI. |
|
The REST URI query parameters. |
|
The body of the request, if enabled. |
Table 77. REST authentication_failed attributes
Attribute | Description |
---|---|
|
The principal (username) that failed authentication. If the request’s authentication token is invalid, this information might be missing. |
|
The REST endpoint URI. |
|
The body of the request, if enabled. |
Table 78. REST realm_authentication_failed attributes
Attribute | Description |
---|---|
|
The realm that failed to authenticate the user. A separate entry is logged for each consulted realm. |
|
The principal (username) that failed authentication. |
|
The REST endpoint URI. |
|
The body of the request, if enabled. |
Table 79. REST tampered_request attributes
Attribute | Description |
---|---|
|
The REST endpoint URI. |
|
The body of the request, if enabled. |
Table 80. Transport anonymous_access_denied attributes
Attribute | Description |
---|---|
|
Where the request originated: |
|
The name of the action that was executed. |
|
A comma-separated list of indices this request pertains to (when applicable). |
|
The type of request that was executed. |
Table 81. Transport authentication_success attributes
Attribute | Description |
---|---|
|
Where the request originated: |
|
The effective (impersonated) username. Usually this is the same as the authenticated username. |
|
The authenticated (impersonator) username.
This attribute is present only if the request is
using the run as authorization functionality.
Otherwise, the effective and the authenticated
users are equivalent and are indicated by the
|
|
The realm that authenticated the user. |
|
The name of the action that was executed. |
|
A comma-separated list of indices this request pertains to (when applicable). |
|
The type of request that was executed. |
Table 82. Transport authentication_failed attributes
Attribute | Description |
---|---|
|
Where the request originated: |
|
The effective (impersonated) username. Usually this is the same as the authenticated username. If the request’s authentication token is invalid, this information might be missing. |
|
The authenticated (impersonator) username.
This attribute is present only if the request is
using the run as authorization functionality.
Otherwise, the effective and the authenticated
users are equivalent and are indicated by the
|
|
The name of the action that was executed. |
|
A comma-separated list of indices this request pertains to (when applicable). |
|
The type of request that was executed. |
Table 83. Transport realm_authentication_failed attributes
Attribute | Description |
---|---|
|
The realm that failed to authenticate the user. A separate entry is logged for each consulted realm. |
|
Where the request originated: |
|
The principal (username) that failed authentication. |
|
The name of the action that was executed. |
|
A comma-separated list of indices this request pertains to (when applicable). |
|
The type of request that was executed. |
Table 84. Transport access_granted attributes
Attribute | Description |
---|---|
|
Where the request originated: |
|
The effective (impersonated) username for which authorization succeeded. Unless the request is using the run as authorization functionality, the effective and authenticated usernames are equivalent. |
|
The realm name that |
|
The authenticated (impersonator) username.
This attribute is present only if the request is
using the run as authorization functionality.
Otherwise, the effective and the authenticated
usernames are equivalent and are indicated by the
|
|
The realm name that |
|
The set of roles granting permissions. |
|
The name of the action that was executed. |
|
A comma-separated list of indices this request pertains to (when applicable). |
|
The type of request that was executed. |
Table 85. Transport access_denied attributes
Attribute | Description |
---|---|
|
Where the request originated: |
|
The effective (impersonated) username for which authorization failed. Unless the request is using the run as authorization functionality, the effective and the authenticated usernames are equivalent. |
|
The realm name that |
|
The authenticated (impersonator) username.
This attribute is present only if the request is
using the run as authorization functionality.
Otherwise, the effective and the authenticated
usernames are equivalent and are indicated by the
|
|
The realm name that |
|
The set of roles granting permissions. |
|
The name of the action that was executed. |
|
A comma-separated list of indices this request relates to (when applicable). |
|
The type of request that was executed. |
Table 86. Transport run_as_granted attributes
Attribute | Description |
---|---|
|
Where the request originated: |
|
The authenticated (impersonator) username for which the impersonation operation was granted. |
|
The realm name that the authenticated user belongs to. |
|
The impersonated username. |
|
The realm name that the impersonated username belongs to. |
|
The set of roles granting permissions. |
|
The name of the action that was executed. |
|
A comma-separated list of indices this request relates to (when applicable). |
|
The type of request that was executed. |
Table 87. Transport run_as_denied attributes
Attribute | Description |
---|---|
|
Where the request originated: |
|
The authenticated (impersonator) username for which the impersonation operation was denied. |
|
The realm name that the authenticated user belongs to. |
|
The impersonated username. |
|
The realm name that the impersonated username belongs to. |
|
The set of roles granting permissions. |
|
The name of the action that was executed. |
|
A comma-separated list of indices this request relates to (when applicable). |
|
The type of request that was executed. |
Table 88. Transport tampered_request attributes
Attribute | Description |
---|---|
|
Where the request originated: |
|
The effective (impersonated) username. Unless the request is using the run as authorization functionality, the effective and the authenticated usernames are equivalent. If the requests’s authentication token is invalid, this information might be missing. |
|
The authenticated (impersonator) username.
This attribute is present only if the request is
using the run as authorization functionality.
Otherwise, the effective and the authenticated usernames
are equivalent and are indicated by the |
|
The name of the action that was executed. |
|
A comma-separated list of indices this request pertains to (when applicable). |
|
The type of request that was executed. |
Table 89. IP filter connection_granted attributes
Attribute | Description |
---|---|
|
The transport profile the request targeted. |
|
The IP filtering rule that granted the request. |
Table 90. IP filter connection_denied attributes
Attribute | Description |
---|---|
|
The transport profile the request targeted. |
|
The IP filtering rule that denied the request. |