├── LICENSE ├── README.md ├── easyBEATS ├── removeBEATS └── services ├── auditbeat.service ├── filebeat.service ├── heartbeat.service ├── metricbeat.service └── packetbeat.service /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright [yyyy] [name of copyright owner] 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # easyBEATS 2 | 3 | 4 | ### About 5 | 6 | easyBEATS is a project started to make the installation of Beats packages faster and easier for Ubuntu, Mac, and even Raspberry Pi (ARM architecture). The focus was for Rasperry Pi since Elastic does not have a supported release on ARM architecture. easyBEATS also resolves issues related to the outdated golang-go package in the RPi apt repo which prevents the successful installation of Beats newer than v7.3.2. The current version of the script will let you install one or multiple Beats at any version. 7 | 8 | 9 | ## How To Use 10 | 11 | ### Clone the repo 12 | 13 | Install git on your Pi so you can clone from this GitHub repo. 14 | 15 | ``` 16 | sudo apt-get install git -y 17 | ``` 18 | 19 | Clone the repo to your home directory. 20 | 21 | 22 | Now make the install script executable so you can run it. 23 | 24 | ``` 25 | sudo chmod 755 easyBEATS 26 | ``` 27 | 28 | ### Configure the script 29 | There are a few variables we need to define. Open the script with a text editor. 30 | 31 | ``` 32 | vi easyBEATS 33 | ``` 34 | 35 | Review the default options at the top of the script and change as necessary. 36 | 37 | ``` 38 | UPDATE_SYSTEM=true #change to false if you don't want to upgrade your whole system 39 | INSTALL_DEPS=true #change to false if you have already run this script successfully before 40 | USE_SWAP=true #change to fales if you're using a Pi4 with 2GB of RAM or more 41 | WORKING_DIR="beat-factory" #this directory will be created in /home/pi 42 | #visit https://github.com/elastic/beats/releases to find other version numbers and commit numbers 43 | BEAT_VERSION_NUM="7.5.2" #the version number of the Beats release you want to use 44 | BEAT_VERSION="a9c1414" #the commit number of the Beats release you want to use 45 | #add as many beats as you want to BEAT_NAME separated by a space 46 | BEAT_NAME=( metricbeat filebeat ) #metricbeat filebeat packetbeat auditbeat heartbeat 47 | INSTALL_LOCAL=true #set to false if you only want to compile without installing 48 | CLEAN_UP=true #set to false if you want to keep the source files on your Pi 49 | ``` 50 | 51 | Save your changes and quit VI by typing Esc ZZ. 52 | 53 | ### Run the script 54 | 55 | ``` 56 | ./easyBEATS 57 | ``` 58 | 59 | ### Configure your Beats and start them up. 60 | 61 | After the script is finished, configure each of the Beats shippers. Configuration files are found in /etc/$BEAT_NAME 62 | 63 | ``` 64 | #filebeat example 65 | cd /etc/filebeat 66 | sudo vi filebeat.yml 67 | ``` 68 | 69 | For guidance on how to configure, visit [Elastic's documentation](https://www.elastic.co/guide/) and check out the section for Beats. Some of the Beats have modules. Enable these by renaming them. 70 | 71 | ``` 72 | cd /etc/filebeat/modules.d 73 | ls 74 | mv system.yml.disabled system.yml 75 | ``` 76 | 77 | The script has already prepared the system to launch the service at boot / re-boot. You just need to start the service after you configure 78 | 79 | ``` 80 | #filebeat example 81 | sudo systemctl start filebeat.service 82 | ``` 83 | 84 | ### Remove / Uninstall 85 | 86 | If you mess up or you want to remove everything you can run removeBEATS. 87 | 88 | 89 | ## Notes 90 | Tested with metricbeat, packetbeat, and filebeat. Others may work but have not been tested. 91 | 92 | File an issue if you run into a problem or have a question. 93 | 94 | 95 | 96 | ## Additional Info 97 | 98 | Check out [Beats](https://www.elastic.co/products/beats) to learn more. 99 | -------------------------------------------------------------------------------- /easyBEATS: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Script variables 4 | UPDATE_SYSTEM=true #change to false if you don't want to upgrade your whole system 5 | INSTALL_DEPS=true #change to false if you have already run this script successfully before 6 | USE_SWAP=false #change to false if you're using a Pi4 with 2GB of RAM or more 7 | WORKING_DIR="beat-factory" #this directory will be created in /home/pi 8 | #visit https://github.com/elastic/beats/releases to find other version numbers and commit numbers 9 | BEAT_VERSION="v7.16.1" #the version tag name or commit id of the Beats release you want to use 10 | #add as many beats as you want to BEAT_NAME separated by a space 11 | GO_VERSION="1.17.5" # Find versions here: https://go.dev/dl/ 12 | BEAT_NAME=( metricbeat filebeat ) #metricbeat filebeat packetbeat auditbeat heartbeat 13 | INSTALL_LOCAL=true #set to false if you only want to compile without installing 14 | CLEAN_UP=true #set to false if you want to keep the source files on your Pi 15 | 16 | function clean_up { 17 | sudo rm -rf $HOME/${WORKING_DIR} /tmp/beats /tmp/mage 18 | echo "Working directory deleted." 19 | } 20 | 21 | function compile_beats { 22 | for beat in "${BEAT_NAME[@]}"; 23 | do 24 | echo "Compiling $beat" 25 | cd /tmp/beats 26 | go mod download 27 | cd /tmp/beats/$beat 28 | mage build; 29 | echo "$beat created" 30 | done 31 | if [ $USE_SWAP = true ]; 32 | then 33 | sudo swapoff -v /swapfile 34 | sudo rm /swapfile 35 | echo "Swap space disabled." 36 | fi 37 | } 38 | 39 | function configure_swap { 40 | sudo fallocate -l 2G /swapfile 41 | sudo chmod 600 /swapfile 42 | sudo mkswap /swapfile 43 | sudo swapon /swapfile 44 | } 45 | 46 | function checkout_version { 47 | cd /tmp/beats 48 | git fetch 49 | git checkout $BEAT_VERSION 50 | } 51 | 52 | function copy_source_code { 53 | cd /tmp 54 | git clone https://github.com/elastic/beats.git 55 | } 56 | 57 | function install_dependencies { 58 | if [ $(dpkg-query -W -f='${Status}' python-pip 2>/dev/null | grep -c "ok installed") -eq 0 ]; 59 | then 60 | echo "Installing python-pip..." 61 | sudo apt-get install python-pip -y; 62 | fi 63 | 64 | if [ $(dpkg-query -W -f='${Status}' git 2>/dev/null | grep -c "ok installed") -eq 0 ]; 65 | then 66 | echo "Installing git..." 67 | sudo apt-get install git -y; 68 | fi 69 | 70 | if python -c 'import pkgutil; exit(pkgutil.find_loader("virtualenv"))'; 71 | then 72 | echo "Installing virtualenv..." 73 | pip install virtualenv 74 | fi 75 | 76 | if [ $(dpkg-query -W -f='${Status}' make 2>/dev/null | grep -c "ok installed") -eq 0 ]; 77 | then 78 | echo "Installing make..." 79 | sudo apt-get install make -y; 80 | fi 81 | 82 | if [ $(dpkg-query -W -f='${Status}' gcc 2>/dev/null | grep -c "ok installed") -eq 0 ]; 83 | then 84 | echo "Installing GCC..." 85 | sudo apt-get install build-essential manpages-dev -y; 86 | fi 87 | 88 | if [ $(dpkg-query -W -f='${Status}' golang-go 2>/dev/null | grep -c "ok installed") -eq 1 ]; 89 | then 90 | echo "Removing outdated go version" 91 | sudo apt remove golang-go -y; 92 | sudo apt autoremove -y; 93 | fi 94 | 95 | echo "Installing go..." 96 | wget https://dl.google.com/go/go${GO_VERSION}.linux-armv6l.tar.gz 97 | sudo tar -C /usr/share -xzf go${GO_VERSION}.linux-armv6l.tar.gz 98 | sudo chmod -R 775 /usr/share/go/ 99 | sudo chmod -R 777 /usr/share/go/pkg/linux_arm/ 100 | export PATH=$PATH:/usr/share/go/bin; 101 | export GOPATH=$HOME/${WORKING_DIR}; 102 | rm go${GO_VERSION}.linux-armv6l.tar.gz; 103 | 104 | sudo apt-get install libpcap-dev -y 105 | 106 | cd /tmp 107 | git clone https://github.com/magefile/mage 108 | cd mage 109 | go run bootstrap.go 110 | export PATH=$(go env GOPATH)/bin:$PATH 111 | 112 | echo "Dependency installation complete." 113 | } 114 | 115 | function create_working_directory { 116 | mkdir -p $HOME/${WORKING_DIR}/src/github.com/elastic; 117 | echo "Working directory created" 118 | } 119 | 120 | function update_system { 121 | sudo DEBIAN_FRONTEND=noninteractive apt-get -yq update > /dev/null 122 | sudo DEBIAN_FRONTEND=noninteractive apt-get -yq upgrade > /dev/null 123 | echo "System update complete" 124 | } 125 | 126 | function install_local { 127 | for beat in "${BEAT_NAME[@]}"; 128 | do 129 | if [ ! -d /usr/share/$beat ]; 130 | then 131 | echo "Creating /usr/share/$beat directory..." 132 | sudo mkdir -p /usr/share/$beat/bin; 133 | fi 134 | 135 | if [ ! -d /etc/$beat ]; 136 | then 137 | echo "Creating /etc/$beat directory..." 138 | sudo mkdir -p /etc/$beat; 139 | fi 140 | 141 | if [ ! -d /var/lib/$beat ]; 142 | then 143 | echo "Creating /var/lib/$beat directory..." 144 | sudo mkdir -p /var/lib/$beat 145 | fi 146 | 147 | echo "Installing $beat locally..." 148 | sudo cp /tmp/beats/${beat}/${beat} /usr/share/${beat}/bin 149 | sudo cp /tmp/beats/${beat}/${beat}.reference.yml /etc/${beat} 150 | sudo cp /tmp/beats/${beat}/${beat}.yml /etc/${beat} 151 | 152 | if [ $beat = "filebeat" ] || [ $beat = "metricbeat" ]; 153 | then 154 | sudo cp -R /tmp/beats/${beat}/module /usr/share/${beat} 155 | sudo cp -R /tmp/beats/${beat}/modules.d/ /etc/${beat} 156 | fi 157 | 158 | sudo cp $HOME/easyBEATS/services/${beat}.service /lib/systemd/system 159 | 160 | 161 | 162 | sudo chmod -R 755 /etc/${beat}/; 163 | sudo chown -R root:root /etc/${beat}; 164 | sudo chown -R root:root /usr/share/${beat}/*; 165 | sudo /bin/systemctl daemon-reload; 166 | sudo systemctl enable ${beat}; 167 | done 168 | } 169 | 170 | echo "---------------------------------------------------------------" 171 | if [ $UPDATE_SYSTEM = true ]; 172 | then 173 | echo "Performing system update..." 174 | update_system 175 | else 176 | echo "Skipping system update" 177 | fi 178 | 179 | echo "---------------------------------------------------------------" 180 | 181 | if [ ! -d $HOME/${WORKING_DIR} ]; 182 | then 183 | create_working_directory 184 | else 185 | echo "Working directory already exists" 186 | fi 187 | 188 | echo "---------------------------------------------------------------" 189 | 190 | if [ $INSTALL_DEPS = true ]; 191 | then 192 | echo "Installing dependencies..." 193 | install_dependencies 194 | else 195 | export PATH=$PATH:/usr/share/go/bin; 196 | export GOPATH=$HOME/${WORKING_DIR}; 197 | export PATH=$(go env GOPATH)/bin:$PATH; 198 | echo "Skipping dependency installation" 199 | fi 200 | 201 | echo "---------------------------------------------------------------" 202 | 203 | echo "Copying source code from Elastic" 204 | copy_source_code 205 | 206 | echo "---------------------------------------------------------------" 207 | 208 | echo "Checking out Beats version $BEAT_VERSION" 209 | checkout_version 210 | 211 | echo "---------------------------------------------------------------" 212 | 213 | if [ $USE_SWAP = true ]; 214 | then 215 | echo "Configuring swap space..." 216 | configure_swap 217 | else 218 | echo "Proceeding without swap space." 219 | fi 220 | 221 | echo "---------------------------------------------------------------" 222 | 223 | echo "Compiling Beats..." 224 | compile_beats 225 | 226 | echo "---------------------------------------------------------------" 227 | 228 | if [ $INSTALL_LOCAL = true ]; 229 | then 230 | echo "Installing on your local system..." 231 | install_local 232 | fi 233 | 234 | if [ $CLEAN_UP = true ]; 235 | then 236 | echo "Cleaning up working files..." 237 | clean_up 238 | fi 239 | 240 | echo "Complete" 241 | -------------------------------------------------------------------------------- /removeBEATS: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | echo "Stopping services..." 4 | sudo /bin/systemctl daemon-reload 5 | sudo systemctl stop filebeat metricbeat packetbeat auditbeat 6 | sudo systemctl disable filebeat metricbeat packetbeat auditbeat 7 | sudo rm /etc/init.d/filebeat 8 | sudo rm /etc/init.d/metricbeat 9 | sudo rm /etc/init.d/packetbeat 10 | sudo rm /etc/init.d/auditbeat 11 | sudo rm /lib/systemd/system/filebeat.service 12 | sudo rm /lib/systemd/system/auditbeat.service 13 | sudo rm /lib/systemd/system/packetbeat.service 14 | sudo rm /lib/systemd/system/metricbeat.service 15 | sudo /bin/systemctl daemon-reload 16 | echo "Removing Beats... " 17 | sudo apt remove filebeat -y 18 | sudo apt remove packetbeat -y 19 | sudo apt remove auditbeat -y 20 | sudo apt remove metricbeat -y 21 | sudo rm -rf /etc/filebeat 22 | sudo rm -rf /etc/packetbeat 23 | sudo rm -rf /etc/metricbeat 24 | sudo rm -rf /etc/auditbeat 25 | sudo rm -rf /usr/share/filebeat 26 | sudo rm -rf /usr/share/packetbeat 27 | sudo rm -rf /usr/share/metricbeat 28 | sudo rm -rf /usr/share/auditbeat 29 | sudo rm -rf /var/lib/filebeat 30 | sudo rm -rf /var/lib/packetbeat 31 | sudo rm -rf /var/lib/metricbeat 32 | sudo rm -rf /var/lib/auditbeat 33 | sudo rm -rf /var/log/filebeat 34 | sudo rm -rf /var/log/packetbeat 35 | sudo rm -rf /var/log/metricbeat 36 | sudo rm -rf /var/log/auditbeat 37 | sudo /bin/systemctl daemon-reload 38 | echo "Removing Build Directories" 39 | rm -rf $HOME/go 40 | rm -rf $HOME/easyBEATS_log.txt 41 | rm $HOME/pibeat_log.txt 42 | echo "Finished" -------------------------------------------------------------------------------- /services/auditbeat.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Audit the activities of users and processes on your system. 3 | Documentation=https://www.elastic.co/products/beats/auditbeat 4 | Wants=network-online.target 5 | After=network-online.target 6 | 7 | [Service] 8 | 9 | Environment="BEAT_LOG_OPTS=-e" 10 | Environment="BEAT_CONFIG_OPTS=-c /etc/auditbeat/auditbeat.yml" 11 | Environment="BEAT_PATH_OPTS=-path.home /usr/share/auditbeat -path.config /etc/auditbeat -path.data /var/lib/auditbeat -path.logs /var/log/auditbeat" 12 | ExecStart=/usr/share/auditbeat/bin/auditbeat $BEAT_LOG_OPTS $BEAT_CONFIG_OPTS $BEAT_PATH_OPTS 13 | Restart=always 14 | 15 | [Install] 16 | WantedBy=multi-user.target 17 | -------------------------------------------------------------------------------- /services/filebeat.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Filebeat sends log files to Logstash or directly to Elasticsearch. 3 | Documentation=https://www.elastic.co/products/beats/filebeat 4 | Wants=network-online.target 5 | After=network-online.target 6 | 7 | [Service] 8 | 9 | Environment="BEAT_LOG_OPTS=-e" 10 | Environment="BEAT_CONFIG_OPTS=-c /etc/filebeat/filebeat.yml" 11 | Environment="BEAT_PATH_OPTS=-path.home /usr/share/filebeat -path.config /etc/filebeat -path.data /var/lib/filebeat -path.logs /var/log/filebeat" 12 | ExecStart=/usr/share/filebeat/bin/filebeat $BEAT_LOG_OPTS $BEAT_CONFIG_OPTS $BEAT_PATH_OPTS 13 | Restart=always 14 | 15 | [Install] 16 | WantedBy=multi-user.target 17 | -------------------------------------------------------------------------------- /services/heartbeat.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Periodically check the status of your services. 3 | Documentation=https://www.elastic.co/products/beats/heartbeat 4 | Wants=network-online.target 5 | After=network-online.target 6 | 7 | [Service] 8 | 9 | Environment="BEAT_LOG_OPTS=-e" 10 | Environment="BEAT_CONFIG_OPTS=-c /etc/heartbeat/heartbeat.yml" 11 | Environment="BEAT_PATH_OPTS=-path.home /usr/share/heartbeat -path.config /etc/heartbeat -path.data /var/lib/heartbeat -path.logs /var/log/heartbeat" 12 | ExecStart=/usr/share/heartbeat/bin/heartbeat $BEAT_LOG_OPTS $BEAT_CONFIG_OPTS $BEAT_PATH_OPTS 13 | Restart=always 14 | 15 | [Install] 16 | WantedBy=multi-user.target 17 | -------------------------------------------------------------------------------- /services/metricbeat.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Metricbeat is a lightweight shipper for metrics. 3 | Documentation=https://www.elastic.co/products/beats/metricbeat 4 | Wants=network-online.target 5 | After=network-online.target 6 | 7 | [Service] 8 | 9 | Environment="BEAT_LOG_OPTS=-e" 10 | Environment="BEAT_CONFIG_OPTS=-c /etc/metricbeat/metricbeat.yml" 11 | Environment="BEAT_PATH_OPTS=-path.home /usr/share/metricbeat -path.config /etc/metricbeat -path.data /var/lib/metricbeat -path.logs /var/log/metricbeat" 12 | ExecStart=/usr/share/metricbeat/bin/metricbeat $BEAT_LOG_OPTS $BEAT_CONFIG_OPTS $BEAT_PATH_OPTS 13 | Restart=always 14 | 15 | [Install] 16 | WantedBy=multi-user.target 17 | -------------------------------------------------------------------------------- /services/packetbeat.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Packetbeat analyzes network traffic and sends the data to Elasticsearch. 3 | Documentation=https://www.elastic.co/products/beats/packetbeat 4 | Wants=network-online.target 5 | After=network-online.target 6 | 7 | [Service] 8 | 9 | Environment="BEAT_LOG_OPTS=-e" 10 | Environment="BEAT_CONFIG_OPTS=-c /etc/packetbeat/packetbeat.yml" 11 | Environment="BEAT_PATH_OPTS=-path.home /usr/share/packetbeat -path.config /etc/packetbeat -path.data /var/lib/packetbeat -path.logs /var/log/packetbeat" 12 | ExecStart=/usr/share/packetbeat/bin/packetbeat $BEAT_LOG_OPTS $BEAT_CONFIG_OPTS $BEAT_PATH_OPTS 13 | Restart=always 14 | 15 | [Install] 16 | WantedBy=multi-user.target 17 | --------------------------------------------------------------------------------