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

Filebeat: osquery module #5971

Merged
merged 5 commits into from
Jan 10, 2018
Merged
Show file tree
Hide file tree
Changes from all 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
59 changes: 59 additions & 0 deletions filebeat/docs/fields.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ grouped in the following categories:
* <<exported-fields-logstash>>
* <<exported-fields-mysql>>
* <<exported-fields-nginx>>
* <<exported-fields-osquery>>
* <<exported-fields-postgresql>>
* <<exported-fields-redis>>
* <<exported-fields-system>>
Expand Down Expand Up @@ -1535,6 +1536,64 @@ type: text
The error message


[[exported-fields-osquery]]
== Osquery fields

Fields exported by the `osquery` module



[float]
== osquery fields




[float]
== result fields

Common fields exported by the result metricset.



[float]
=== `osquery.result.name`

type: keyword

The name of the query that generated this event.


[float]
=== `osquery.result.action`

type: keyword

For incremental data, marks whether the entry was added or removed. It can be one of "added", "removed", or "snapshot".


[float]
=== `osquery.result.host_identifier`

type: keyword

The identifier for the host on which the osquery agent is running. Normally the hostname.


[float]
=== `osquery.result.unix_time`

type: long

Unix timestamp of the event, in seconds since the epoch. Used for computing the `@timestamp` column.


[float]
=== `osquery.result.calendar_time`

String representation of the collection time, as formatted by osquery.


[[exported-fields-postgresql]]
== PostgreSQL fields

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
80 changes: 80 additions & 0 deletions filebeat/docs/modules/osquery.asciidoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
////
This file is generated! See scripts/docs_collector.py
////

[[filebeat-module-osquery]]
:modulename: osquery

== Osquery module

The +{modulename}+ module collects and decodes the result logs written by
https://osquery.readthedocs.io/en/latest/introduction/using-osqueryd/[osqueryd]
in the JSON format. To set up osqueryd follow the osquery installation
instructions for your operating system and configure the `filesystem` logging
driver (the default). Make sure UTC timestamps are enabled.

include::../include/what-happens.asciidoc[]


[float]
=== Compatibility

The +{modulename}+ module was tested with logs from osquery version 2.10.2.
Since the results are written in the JSON format, it is likely that this module
works with any version of osquery.

This module is available on Linux, macOS, and Windows.

[float]
=== Example dashboard

This module comes with a sample dashboard for visualizing the data collected by
the "compliance" pack. To collect this data, enable the `id-compliance` pack in
the osquery configuration file.

[role="screenshot"]
image::./images/kibana-osquery-compatibility.png[]

include::../include/configuring-intro.asciidoc[]

The following example shows how to set paths in the +modules.d/{modulename}.yml+
file to override the default paths for the syslog and authorization logs:

["source","yaml",subs="attributes"]
-----
- module: osquery
result:
enabled: true
var.paths: ["/path/to/osqueryd.results.log*"]
-----


To specify the same settings at the command line, you use:

["source","sh",subs="attributes"]
-----
./{beatname_lc} --modules {modulename} -M "osquery.result.var.paths=[/path/to/osqueryd.results.log*]"
-----

include::../include/config-option-intro.asciidoc[]

[float]
==== `result` fileset settings

include::../include/var-paths.asciidoc[]

*`var.use_namespace`*::

If true, all fields exported by this module are prefixed with `osquery.result`.
Set to false to copy the fields in the root of the document. If enabled, this
setting also disables the renaming of some fields (e.g. `hostIdentifier` to
`host_identifier`). Note that if you set this to false, the sample dashboards
coming with this module won't work correctly. The default is true.


[float]
=== Fields

For a description of each field in the module, see the
<<exported-fields-osquery,exported fields>> section.

2 changes: 2 additions & 0 deletions filebeat/docs/modules_list.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ This file is generated! See scripts/docs_collector.py
* <<filebeat-module-logstash>>
* <<filebeat-module-mysql>>
* <<filebeat-module-nginx>>
* <<filebeat-module-osquery>>
* <<filebeat-module-postgresql>>
* <<filebeat-module-redis>>
* <<filebeat-module-system>>
Expand All @@ -26,6 +27,7 @@ include::modules/kafka.asciidoc[]
include::modules/logstash.asciidoc[]
include::modules/mysql.asciidoc[]
include::modules/nginx.asciidoc[]
include::modules/osquery.asciidoc[]
include::modules/postgresql.asciidoc[]
include::modules/redis.asciidoc[]
include::modules/system.asciidoc[]
Expand Down
14 changes: 14 additions & 0 deletions filebeat/filebeat.reference.yml
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,20 @@ filebeat.modules:
# can be added under this section.
#prospector:

#------------------------------- Osquery Module ------------------------------
- module: osquery
result:
enabled: true

# Set custom paths for the log files. If left empty,
# Filebeat will choose the paths depending on your OS.
#var.paths:

# If true, all fields created by this module are prefixed with
# `osquery.result`. Set to false to copy the fields in the root
# of the document. The default is true.
#var.use_namespace: true

#----------------------------- PostgreSQL Module -----------------------------
#- module: postgresql
# Logs
Expand Down
2 changes: 1 addition & 1 deletion filebeat/module/kafka/log/ingest/pipeline.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
{
"rename": {
"field": "@timestamp",
"target_field": "beat.read_time"
"target_field": "read_timestamp"
Copy link
Contributor

Choose a reason for hiding this comment

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

@tsg This seems to be a breaking change? Also saw there is no CHANGELOG for this PR.

}
},
{
Expand Down
12 changes: 12 additions & 0 deletions filebeat/module/osquery/_meta/config.reference.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
- module: osquery
result:
enabled: true

# Set custom paths for the log files. If left empty,
# Filebeat will choose the paths depending on your OS.
#var.paths:

# If true, all fields created by this module are prefixed with
# `osquery.result`. Set to false to copy the fields in the root
# of the document. The default is true.
#var.use_namespace: true
12 changes: 12 additions & 0 deletions filebeat/module/osquery/_meta/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
- module: osquery
result:
enabled: true

# Set custom paths for the log files. If left empty,
# Filebeat will choose the paths depending on your OS.
#var.paths:

# If true, all fields created by this module are prefixed with
# `osquery.result`. Set to false to copy the fields in the root
# of the document. The default is true.
#var.use_namespace: true
67 changes: 67 additions & 0 deletions filebeat/module/osquery/_meta/docs.asciidoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
:modulename: osquery

== Osquery module

The +{modulename}+ module collects and decodes the result logs written by
https://osquery.readthedocs.io/en/latest/introduction/using-osqueryd/[osqueryd]
in the JSON format. To set up osqueryd follow the osquery installation
instructions for your operating system and configure the `filesystem` logging
driver (the default). Make sure UTC timestamps are enabled.

include::../include/what-happens.asciidoc[]


[float]
=== Compatibility

The +{modulename}+ module was tested with logs from osquery version 2.10.2.
Since the results are written in the JSON format, it is likely that this module
works with any version of osquery.

This module is available on Linux, macOS, and Windows.

[float]
=== Example dashboard

This module comes with a sample dashboard for visualizing the data collected by
the "compliance" pack. To collect this data, enable the `id-compliance` pack in
the osquery configuration file.

[role="screenshot"]
image::./images/kibana-osquery-compatibility.png[]

include::../include/configuring-intro.asciidoc[]

The following example shows how to set paths in the +modules.d/{modulename}.yml+
file to override the default paths for the syslog and authorization logs:

["source","yaml",subs="attributes"]
-----
- module: osquery
result:
enabled: true
var.paths: ["/path/to/osqueryd.results.log*"]
-----


To specify the same settings at the command line, you use:

["source","sh",subs="attributes"]
-----
./{beatname_lc} --modules {modulename} -M "osquery.result.var.paths=[/path/to/osqueryd.results.log*]"
-----

include::../include/config-option-intro.asciidoc[]

[float]
==== `result` fileset settings

include::../include/var-paths.asciidoc[]

*`var.use_namespace`*::

If true, all fields exported by this module are prefixed with `osquery.result`.
Set to false to copy the fields in the root of the document. If enabled, this
setting also disables the renaming of some fields (e.g. `hostIdentifier` to
`host_identifier`). Note that if you set this to false, the sample dashboards
coming with this module won't work correctly. The default is true.
9 changes: 9 additions & 0 deletions filebeat/module/osquery/_meta/fields.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
- key: osquery
title: "Osquery"
description: >
Fields exported by the `osquery` module
fields:
- name: osquery
type: group
description: >
fields:
Loading