auditbeat 6.2.0

Closes #23767.

Signed-off-by: FX Coudert <fxcoudert@gmail.com>
This commit is contained in:
Tyler Langlois 2018-02-06 12:04:36 -07:00 committed by FX Coudert
parent 26030423a6
commit 8f0f5a8871

View file

@ -1,8 +1,8 @@
class Auditbeat < Formula
desc "Lightweight Shipper for Audit Data"
homepage "https://www.elastic.co/products/beats/auditbeat"
url "https://github.com/elastic/beats/archive/v6.1.3.tar.gz"
sha256 "5a21ce1eca7eab2b8214b54a7f4690cd557cd05073119f861025330e1b4006a3"
url "https://github.com/elastic/beats/archive/v6.2.0.tar.gz"
sha256 "f4cf4dee93ae5803d7c07573e96f73ee421cf9f3154615c9c518137c1956feab"
head "https://github.com/elastic/beats.git"
bottle do
@ -35,11 +35,10 @@ class Auditbeat < Formula
# prevent downloading binary wheels
inreplace "../libbeat/scripts/Makefile", "pip install", "pip install --no-binary :all"
system "make"
system "make", "update"
system "make", "DEV_OS=darwin", "update"
(libexec/"bin").install "auditbeat"
libexec.install "_meta/kibana"
inreplace "auditbeat.yml", /^- module: audit\n^ metricsets: \[kernel\]\n^ kernel.audit_rules: \|/, "#- module: audit\n# metricsets: [kernel]\n# kernel.audit_rules: |"
(etc/"auditbeat").install Dir["auditbeat*.yml"]
prefix.install_metafiles
end
@ -83,15 +82,12 @@ class Auditbeat < Formula
(testpath/"files").mkpath
(testpath/"config/auditbeat.yml").write <<~EOS
auditbeat.modules:
- module: audit
metricsets: [file]
file.paths:
- module: file_integrity
paths:
- #{testpath}/files
output.file:
path: "#{testpath}/auditbeat"
filename: auditbeat
codec.format:
string: '%{[audit]}'
EOS
pid = fork do
exec "#{bin}/auditbeat", "-path.config", testpath/"config", "-path.data", testpath/"data"
@ -102,7 +98,7 @@ class Auditbeat < Formula
touch testpath/"files/touch"
sleep 30
s = IO.readlines(testpath/"auditbeat/auditbeat").last(1)[0]
assert_match "\"action\":\"created\"", s
assert_match "\"action\":\[\"created\"\]", s
realdirpath = File.realdirpath(testpath)
assert_match "\"path\":\"#{realdirpath}/files/touch\"", s
ensure