From 67ed5c813aef38ee001e077e425e43d310a051ec Mon Sep 17 00:00:00 2001 From: Andrew Kroh Date: Wed, 16 May 2018 03:41:39 -0400 Subject: [PATCH] Don't instantiate MetricSets with the setup command (#7112) This will allow `auditbeat setup` to run without requiring elevated privileges to create the audit socket. Fixes #7111 --- CHANGELOG.asciidoc | 1 + metricbeat/beater/metricbeat.go | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc index 894d3c37827..7f6fe598e10 100644 --- a/CHANGELOG.asciidoc +++ b/CHANGELOG.asciidoc @@ -67,6 +67,7 @@ https://github.com/elastic/beats/compare/v6.2.3...master[Check the HEAD diff] - Add hex decoding for the name field in audit path records. {pull}6687[6687] - Fixed a deadlock in the file_integrity module under Windows. {issue}6864[6864] - Fixed parsing of AppArmor audit messages. {pull}6978[6978] +- Allow `auditbeat setup` to run without requiring elevated privileges for the audit client. {issue}7111[7111] *Filebeat* diff --git a/metricbeat/beater/metricbeat.go b/metricbeat/beater/metricbeat.go index f0d26263a93..dd11cba1e83 100644 --- a/metricbeat/beater/metricbeat.go +++ b/metricbeat/beater/metricbeat.go @@ -98,6 +98,11 @@ func newMetricbeat(b *beat.Beat, c *common.Config, options ...Option) (*Metricbe applyOption(metricbeat) } + if b.InSetupCmd { + // Return without instantiating the metricsets. + return metricbeat, nil + } + moduleOptions := append( []module.Option{module.WithMaxStartDelay(config.MaxStartDelay)}, metricbeat.moduleOptions...)