From 71d2fb975d649c575999addd53808d379fb9e51a Mon Sep 17 00:00:00 2001 From: Andrew Kroh Date: Tue, 12 Dec 2017 10:15:50 -0500 Subject: [PATCH] Rename Auditbeat modules This changes the audit.file and audit.kernel metricsets into modules named file_integrity and auditd, respectively. This requires existing users to update their configuration. The dashboards need to be updated to account for these changes. Closes #5422 (see the issue for more details) --- CHANGELOG.asciidoc | 3 + Vagrantfile | 38 +- auditbeat/Makefile | 7 +- auditbeat/_meta/fields.common.yml | 29 +- auditbeat/auditbeat.reference.yml | 37 +- auditbeat/auditbeat.yml | 10 +- auditbeat/cmd/root.go | 9 +- auditbeat/core/eventmod.go | 16 + auditbeat/docs/fields.asciidoc | 445 ++++----- auditbeat/docs/modules/audit.asciidoc | 75 -- auditbeat/docs/modules/audit/file.asciidoc | 19 - auditbeat/docs/modules/audit/kernel.asciidoc | 19 - auditbeat/docs/modules/auditd.asciidoc | 222 +++++ .../docs/modules/file_integrity.asciidoc | 120 +++ auditbeat/docs/modules_list.asciidoc | 6 +- auditbeat/main.go | 6 +- auditbeat/module/audit/_meta/config.yml.tpl | 91 -- auditbeat/module/audit/_meta/docs.asciidoc | 6 - auditbeat/module/audit/_meta/fields.yml | 11 - auditbeat/module/audit/doc.go | 4 - auditbeat/module/audit/file/_meta/data.json | 34 - auditbeat/module/audit/file/_meta/fields.yml | 124 --- .../module/audit/kernel/_meta/fields.yml | 859 ----------------- .../module/audit/kernel/audit_unsupported.go | 21 - auditbeat/module/audit/kernel/doc.go | 3 - auditbeat/module/audit/module.yml | 12 - auditbeat/module/auditd/_meta/config.yml.tpl | 40 + .../{audit/kernel => auditd}/_meta/data.json | 11 +- .../kernel => auditd}/_meta/docs.asciidoc | 58 +- auditbeat/module/auditd/_meta/fields.yml | 862 ++++++++++++++++++ .../5.x/dashboard/AV0tXkjYg1PYniApZbKP.json | 0 .../visualization/AV0tV05vg1PYniApZbA2.json | 0 .../visualization/AV0tVcg6g1PYniApZa-v.json | 0 .../visualization/AV0tW0djg1PYniApZbGL.json | 0 .../visualization/AV0tWL-Yg1PYniApZbCs.json | 0 .../visualization/AV0tWSdXg1PYniApZbDU.json | 0 .../visualization/AV0tY6jwg1PYniApZbRY.json | 0 .../visualization/AV0tav8Ag1PYniApZbbK.json | 0 .../visualization/AV0tbcUdg1PYniApZbe1.json | 0 .../visualization/AV0tc_xZg1PYniApZbnL.json | 0 .../visualization/AV0te0TCg1PYniApZbw9.json | 0 .../visualization/AV0tes4Eg1PYniApZbwV.json | 0 .../dashboard/auditbeat-file-integrity.json | 0 .../auditbeat-kernel-executions.json | 0 .../dashboard/auditbeat-kernel-overview.json | 0 .../dashboard/auditbeat-kernel-sockets.json | 0 .../{audit/kernel => auditd}/audit_linux.go | 81 +- .../kernel => auditd}/audit_linux_test.go | 112 ++- auditbeat/module/auditd/audit_unsupported.go | 22 + .../module/{audit/kernel => auditd}/config.go | 35 +- .../kernel => auditd}/config_linux_test.go | 8 +- auditbeat/module/auditd/doc.go | 3 + .../kernel => auditd}/mock_linux_test.go | 2 +- auditbeat/module/auditd/module.yml | 9 + .../file_integrity/_meta/config.yml.tpl | 48 + .../module/file_integrity/_meta/data.json | 30 + .../_meta/docs.asciidoc | 52 +- .../module/file_integrity/_meta/fields.yml | 121 +++ .../{audit/file => file_integrity}/action.go | 2 +- .../{audit/file => file_integrity}/config.go | 26 +- .../file => file_integrity}/config_test.go | 26 +- .../{audit/file => file_integrity}/event.go | 17 +- .../file => file_integrity}/event_test.go | 2 +- .../eventreader_fsevents.go | 2 +- .../eventreader_fsnotify.go | 4 +- .../eventreader_test.go | 6 +- .../eventreader_unsupported.go | 2 +- .../file => file_integrity}/fileinfo_bsd.go | 2 +- .../file => file_integrity}/fileinfo_linux.go | 2 +- .../file => file_integrity}/fileinfo_posix.go | 2 +- .../file => file_integrity}/fileinfo_test.go | 2 +- .../fileinfo_windows.go | 2 +- .../file => file_integrity}/flatbuffers.go | 4 +- .../flatbuffers_test.go | 2 +- .../file => file_integrity}/metricset.go | 50 +- .../file => file_integrity}/metricset_test.go | 70 +- auditbeat/module/file_integrity/module.yml | 3 + .../monitor/filetree.go | 0 .../monitor/filetree_test.go | 0 .../monitor/monitor.go | 0 .../monitor/monitor_test.go | 0 .../monitor/nonrecursive.go | 0 .../monitor/recursive.go | 0 .../{audit/file => file_integrity}/scanner.go | 2 +- .../file => file_integrity}/scanner_test.go | 2 +- .../{audit/file => file_integrity}/schema.fbs | 0 .../file => file_integrity}/schema/Action.go | 0 .../file => file_integrity}/schema/Event.go | 0 .../file => file_integrity}/schema/Hash.go | 0 .../schema/Metadata.go | 0 .../file => file_integrity}/schema/Source.go | 0 .../file => file_integrity}/schema/Type.go | 0 .../security_windows.go | 2 +- .../security_windows_test.go | 2 +- .../zsecurity_windows.go | 2 +- auditbeat/scripts/docs_collector.py | 14 +- metricbeat/mb/testing/data_generator.go | 22 +- 97 files changed, 2106 insertions(+), 1886 deletions(-) create mode 100644 auditbeat/core/eventmod.go delete mode 100644 auditbeat/docs/modules/audit.asciidoc delete mode 100644 auditbeat/docs/modules/audit/file.asciidoc delete mode 100644 auditbeat/docs/modules/audit/kernel.asciidoc create mode 100644 auditbeat/docs/modules/auditd.asciidoc create mode 100644 auditbeat/docs/modules/file_integrity.asciidoc delete mode 100644 auditbeat/module/audit/_meta/config.yml.tpl delete mode 100644 auditbeat/module/audit/_meta/docs.asciidoc delete mode 100644 auditbeat/module/audit/_meta/fields.yml delete mode 100644 auditbeat/module/audit/doc.go delete mode 100644 auditbeat/module/audit/file/_meta/data.json delete mode 100644 auditbeat/module/audit/file/_meta/fields.yml delete mode 100644 auditbeat/module/audit/kernel/_meta/fields.yml delete mode 100644 auditbeat/module/audit/kernel/audit_unsupported.go delete mode 100644 auditbeat/module/audit/kernel/doc.go delete mode 100644 auditbeat/module/audit/module.yml create mode 100644 auditbeat/module/auditd/_meta/config.yml.tpl rename auditbeat/module/{audit/kernel => auditd}/_meta/data.json (86%) rename auditbeat/module/{audit/kernel => auditd}/_meta/docs.asciidoc (77%) create mode 100644 auditbeat/module/auditd/_meta/fields.yml rename auditbeat/module/{audit => auditd}/_meta/kibana/5.x/dashboard/AV0tXkjYg1PYniApZbKP.json (100%) rename auditbeat/module/{audit => auditd}/_meta/kibana/5.x/visualization/AV0tV05vg1PYniApZbA2.json (100%) rename auditbeat/module/{audit => auditd}/_meta/kibana/5.x/visualization/AV0tVcg6g1PYniApZa-v.json (100%) rename auditbeat/module/{audit => auditd}/_meta/kibana/5.x/visualization/AV0tW0djg1PYniApZbGL.json (100%) rename auditbeat/module/{audit => auditd}/_meta/kibana/5.x/visualization/AV0tWL-Yg1PYniApZbCs.json (100%) rename auditbeat/module/{audit => auditd}/_meta/kibana/5.x/visualization/AV0tWSdXg1PYniApZbDU.json (100%) rename auditbeat/module/{audit => auditd}/_meta/kibana/5.x/visualization/AV0tY6jwg1PYniApZbRY.json (100%) rename auditbeat/module/{audit => auditd}/_meta/kibana/5.x/visualization/AV0tav8Ag1PYniApZbbK.json (100%) rename auditbeat/module/{audit => auditd}/_meta/kibana/5.x/visualization/AV0tbcUdg1PYniApZbe1.json (100%) rename auditbeat/module/{audit => auditd}/_meta/kibana/5.x/visualization/AV0tc_xZg1PYniApZbnL.json (100%) rename auditbeat/module/{audit => auditd}/_meta/kibana/5.x/visualization/AV0te0TCg1PYniApZbw9.json (100%) rename auditbeat/module/{audit => auditd}/_meta/kibana/5.x/visualization/AV0tes4Eg1PYniApZbwV.json (100%) rename auditbeat/module/{audit => auditd}/_meta/kibana/default/dashboard/auditbeat-file-integrity.json (100%) rename auditbeat/module/{audit => auditd}/_meta/kibana/default/dashboard/auditbeat-kernel-executions.json (100%) rename auditbeat/module/{audit => auditd}/_meta/kibana/default/dashboard/auditbeat-kernel-overview.json (100%) rename auditbeat/module/{audit => auditd}/_meta/kibana/default/dashboard/auditbeat-kernel-sockets.json (100%) rename auditbeat/module/{audit/kernel => auditd}/audit_linux.go (85%) rename auditbeat/module/{audit/kernel => auditd}/audit_linux_test.go (60%) create mode 100644 auditbeat/module/auditd/audit_unsupported.go rename auditbeat/module/{audit/kernel => auditd}/config.go (65%) rename auditbeat/module/{audit/kernel => auditd}/config_linux_test.go (95%) create mode 100644 auditbeat/module/auditd/doc.go rename auditbeat/module/{audit/kernel => auditd}/mock_linux_test.go (99%) create mode 100644 auditbeat/module/auditd/module.yml create mode 100644 auditbeat/module/file_integrity/_meta/config.yml.tpl create mode 100644 auditbeat/module/file_integrity/_meta/data.json rename auditbeat/module/{audit/file => file_integrity}/_meta/docs.asciidoc (62%) create mode 100644 auditbeat/module/file_integrity/_meta/fields.yml rename auditbeat/module/{audit/file => file_integrity}/action.go (99%) rename auditbeat/module/{audit/file => file_integrity}/config.go (73%) rename auditbeat/module/{audit/file => file_integrity}/config_test.go (76%) rename auditbeat/module/{audit/file => file_integrity}/event.go (96%) rename auditbeat/module/{audit/file => file_integrity}/event_test.go (99%) rename auditbeat/module/{audit/file => file_integrity}/eventreader_fsevents.go (99%) rename auditbeat/module/{audit/file => file_integrity}/eventreader_fsnotify.go (95%) rename auditbeat/module/{audit/file => file_integrity}/eventreader_test.go (98%) rename auditbeat/module/{audit/file => file_integrity}/eventreader_unsupported.go (90%) rename auditbeat/module/{audit/file => file_integrity}/fileinfo_bsd.go (92%) rename auditbeat/module/{audit/file => file_integrity}/fileinfo_linux.go (91%) rename auditbeat/module/{audit/file => file_integrity}/fileinfo_posix.go (98%) rename auditbeat/module/{audit/file => file_integrity}/fileinfo_test.go (98%) rename auditbeat/module/{audit/file => file_integrity}/fileinfo_windows.go (99%) rename auditbeat/module/{audit/file => file_integrity}/flatbuffers.go (98%) rename auditbeat/module/{audit/file => file_integrity}/flatbuffers_test.go (98%) rename auditbeat/module/{audit/file => file_integrity}/metricset.go (82%) rename auditbeat/module/{audit/file => file_integrity}/metricset_test.go (58%) create mode 100644 auditbeat/module/file_integrity/module.yml rename auditbeat/module/{audit/file => file_integrity}/monitor/filetree.go (100%) rename auditbeat/module/{audit/file => file_integrity}/monitor/filetree_test.go (100%) rename auditbeat/module/{audit/file => file_integrity}/monitor/monitor.go (100%) rename auditbeat/module/{audit/file => file_integrity}/monitor/monitor_test.go (100%) rename auditbeat/module/{audit/file => file_integrity}/monitor/nonrecursive.go (100%) rename auditbeat/module/{audit/file => file_integrity}/monitor/recursive.go (100%) rename auditbeat/module/{audit/file => file_integrity}/scanner.go (99%) rename auditbeat/module/{audit/file => file_integrity}/scanner_test.go (99%) rename auditbeat/module/{audit/file => file_integrity}/schema.fbs (100%) rename auditbeat/module/{audit/file => file_integrity}/schema/Action.go (100%) rename auditbeat/module/{audit/file => file_integrity}/schema/Event.go (100%) rename auditbeat/module/{audit/file => file_integrity}/schema/Hash.go (100%) rename auditbeat/module/{audit/file => file_integrity}/schema/Metadata.go (100%) rename auditbeat/module/{audit/file => file_integrity}/schema/Source.go (100%) rename auditbeat/module/{audit/file => file_integrity}/schema/Type.go (100%) rename auditbeat/module/{audit/file => file_integrity}/security_windows.go (98%) rename auditbeat/module/{audit/file => file_integrity}/security_windows_test.go (97%) rename auditbeat/module/{audit/file => file_integrity}/zsecurity_windows.go (97%) diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc index 79080f1b2a4..b6c982a2e0e 100644 --- a/CHANGELOG.asciidoc +++ b/CHANGELOG.asciidoc @@ -21,6 +21,9 @@ https://github.com/elastic/beats/compare/v6.0.0-beta2...master[Check the HEAD di *Auditbeat* - Changed `audit.file.path` to be a multi-field so that path is searchable. {pull}5625[5625] +- Split the audit.kernel and audit.file metricsets into their own modules + named auditd and file_integrity, respectively. This change requires + existing users to update their config. {issue}5422[5422] *Filebeat* diff --git a/Vagrantfile b/Vagrantfile index 5a6950ffaf0..7c17d55b6dc 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -52,16 +52,19 @@ echo 'Creating github.com/elastic in the GOPATH' mkdir -p ~/go/src/github.com/elastic echo 'Symlinking /vagrant to ~/go/src/github.com/elastic' cd ~/go/src/github.com/elastic -if [ -d "/vagrant" ]; then ln -s /vagrant beats; fi +if [ -d "/vagrant" ] && [ ! -e "beats" ]; then ln -s /vagrant beats; fi SCRIPT # Linux GVM $linuxGvmProvision = <