{"id":5395,"date":"2020-04-12T13:00:53","date_gmt":"2020-04-12T10:00:53","guid":{"rendered":"https:\/\/kifarunix.com\/?p=5395"},"modified":"2021-03-20T21:38:12","modified_gmt":"2021-03-20T18:38:12","slug":"install-and-setup-kolide-fleet-on-ubuntu-18-04","status":"publish","type":"post","link":"https:\/\/kifarunix.com\/install-and-setup-kolide-fleet-on-ubuntu-18-04\/","title":{"rendered":"Install and Setup Kolide Fleet on Ubuntu 18.04"},"content":{"rendered":"\n<p>In this guide, we are going to learn how to install and Setup Kolide Fleet on Ubuntu 18.04. <a rel=\"noreferrer noopener\" href=\"https:\/\/www.kolide.com\/fleet\/\" target=\"_blank\">Kolide Fleet<\/a> is an opensource Osquery manager that expand Osquery capabilities from a single machine to your entire fleet. It queries a dynamic sets of hosts and watch the data stream in for immediate analysis and investigation.<\/p>\n\n\n\n<p>Kolide Fleet has retired. Check the new replacement, the Fleetdm Fleet.<\/p>\n\n\n\n<p><a href=\"https:\/\/kifarunix.com\/install-fleet-osquery-manager-on-ubuntu\/\" target=\"_blank\" aria-label=\" (opens in a new tab)\" rel=\"noreferrer noopener\" class=\"rank-math-link\">Install Fleet Osquery Manager on Ubuntu 20.04<\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Install and Setup Kolide Fleet on Ubuntu 18.04<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Run system update<\/h3>\n\n\n\n<p>Resynchronize your system packages to their latest versions.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>apt update<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Download Kolide Fleet BInary Installer<\/h3>\n\n\n\n<p>Kolide Fleet application is distributed as a single static binary which serves the Fleet web interface, the Fleet application API endpoints and the osquery TLS server API endpoints.<\/p>\n\n\n\n<p>To download the latest Kolide Fleet binary, simply execute the command below;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>wget https:\/\/github.com\/kolide\/fleet\/releases\/latest\/download\/fleet.zip<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Install and Setup Kolide Fleet on Ubuntu 18.04<\/h3>\n\n\n\n<p>Once the Fleet binary is downloaded, extract the Kolide Fleet binaries for Linux platform.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>unzip fleet.zip 'linux\/*' -d fleet<\/code><\/pre>\n\n\n\n<p>The command above extracts the Kolide Fleet binaries, the&nbsp;<strong>fleet<\/strong>&nbsp;and&nbsp;<strong>fleetctl<\/strong>&nbsp;binaries to&nbsp;<strong>fleet\/linux<\/strong>&nbsp;directory.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>ls fleet\/linux\/<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\"><code><strong>fleet<\/strong>  <strong>fleetctl<\/strong><\/code><\/pre>\n\n\n\n<p>The installation of Kolide Fleet binaries is therefore as easy as copying them to binary directories e.g <strong><code>\/usr\/bin<\/code><\/strong>.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>cp fleet\/linux\/* \/usr\/bin\/<\/code><\/pre>\n\n\n\n<p>Kolide Fleet is now installed;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>ls \/usr\/bin\/fleet*<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>\/usr\/bin\/fleet \/usr\/bin\/fleetctl<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Install and Setup Kolide Fleet Dependencies on Ubuntu 18.04<\/h3>\n\n\n\n<p>Kolide Fleet requires MySQL\/MariaDB for its database and Redis server for ingesting and queueing the results of distributed queries, cache data, etc.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Install MariaDB 10.4 Database on Ubuntu 18.04<\/h4>\n\n\n\n<p>Create MariaDB 10.4 APT repository<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>apt install software-properties-common<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>apt-key adv --recv-keys --keyserver hkp:\/\/keyserver.ubuntu.com:80 0xF1656F24C74CD1D8<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>add-apt-repository 'deb [arch=amd64,arm64,ppc64el] http:\/\/sfo1.mirrors.digitalocean.com\/mariadb\/repo\/10.4\/ubuntu bionic main'<\/code><\/pre>\n\n\n\n<p>Update your package cache.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>apt update<\/code><\/pre>\n\n\n\n<p>Run the command install MariaDB server.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>apt install mariadb-server mariadb-client<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">Running MariaDB<\/h4>\n\n\n\n<p>MariaDB server is started and enabled to run on system boot upon installation. You can check the status;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>systemctl status mariadb<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>systemctl is-enabled mariadb<\/code><\/pre>\n\n\n\n<p>Run the initial MySQL security script,&nbsp;<strong>mysql_secure_installation<\/strong>, to remove anonymous database users, test tables, disable remote root login.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>mysql_secure_installation<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">Create Kolide Fleet Database and Database User<\/h4>\n\n\n\n<p>By default, MariaDB 10.4 uses unix_socket for authentication by default and hence, can login by just running,&nbsp;<code><strong>mysql -u root<\/strong><\/code>. If have however enabled password authentication, simply run;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>mysql -u root -p<\/code><\/pre>\n\n\n\n<p>Next, create the Kolide database.<\/p>\n\n\n\n<p><strong>Note:<\/strong> <strong>the database database names used here are not standard. Choose any name of your preference.<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>create database kolide;<\/code><\/pre>\n\n\n\n<p>Create Kollide Fleet database user with all grants on Kolide DB created above.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>grant all on kolide.* to kolideadmin@localhost identified by 'StrongP@SS';<\/code><\/pre>\n\n\n\n<p>Reload privileges tables and exit the database;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>flush privileges;<br>exit<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">Install Redis on Ubuntu 18.04<\/h4>\n\n\n\n<p>Run the command below to install Redis on Ubuntu 18.04.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>apt install redis<\/code><\/pre>\n\n\n\n<p>Redis is set to start and enabled on system boot upon installation.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Running&nbsp; Kolide Fleet Server on Ubuntu 18.04<\/h3>\n\n\n\n<h4 class=\"wp-block-heading\">Initialize Kolide Fleet Database<\/h4>\n\n\n\n<p>To initialize Fleet infrastructure after installing and setting up all the requirements above, use the&nbsp;<code>fleet prepare db<\/code>&nbsp;as follows;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>fleet prepare db --mysql_address=127.0.0.1:3306 --mysql_database=kolide --mysql_username=kolideadmin --mysql_password=StrongP@SS<\/code><\/pre>\n\n\n\n<p>If the initialization is complete, you should get the output,<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>Migrations completed.<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">Generate SSL\/TLS Certificates<\/h4>\n\n\n\n<p>Fleet serve is used to run the main HTTPS server. Hence, run the command below to generate self-signed certificates.<\/p>\n\n\n\n<p>NOTE: <strong>If you are using Self Signed Certificates as in this demo, DO NOT use wildcards or enrollment of hosts won&#8217;t work.<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout \/etc\/ssl\/private\/kolide.key -out \/etc\/ssl\/certs\/kolide.cert -subj \"\/CN=kolide.kifarunix-demo.com\/\"<\/code><\/pre>\n\n\n\n<p><strong>If you can, use the commercial TLS certificates from your preferred trusted CA.<\/strong><\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Generate Json Web Token<\/h4>\n\n\n\n<p>Generate a random&nbsp;<code>Json Web Token (JWT)<\/code>&nbsp;key for signing and verify session tokens. This will be required when running the&nbsp;<strong>fleet serve<\/strong>&nbsp;command for use with&nbsp;<strong>\u2013auth_jwt_key<\/strong>&nbsp;option. <strong>Fleet server won&#8217;t start without this option<\/strong>.<\/p>\n\n\n\n<p>To help with auto-generating the token, simply run the fleet server command without this option.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>fleet serve --mysql_address=127.0.0.1:3306 \\\n--mysql_database=kolide --mysql_username=kolideadmin --mysql_password=StrongP@SS \\\n--server_cert=\/etc\/ssl\/certs\/kolide.cert --server_key=\/etc\/ssl\/private\/kolide.key \\\n--logging_json<\/code><\/pre>\n\n\n\n<p>The command fails and auto-generates a random key for you;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>################################################################################\n# ERROR:\n#   A value must be supplied for --auth_jwt_key. This value is used to create\n#   session tokens for users.\n#\n#   Consider using the following randomly generated key:\n#   <strong>WS+Q2v6RyJdZgJDCHFWgak5HtxzPDhH8<\/strong>\n################################################################################<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">Testing Kolide Fleet<\/h4>\n\n\n\n<p>Once you get a random key, rerun the command with the option and the key provided. <\/p>\n\n\n\n<p>Kolide Fleet is setup and thus you need to run the command below to verify that it can run successfully using the&nbsp;<strong>fleet serve<\/strong>&nbsp;command as shown below.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>fleet serve --mysql_address=127.0.0.1:3306 \\\n--mysql_database=kolide --mysql_username=kolideadmin --mysql_password=StrongP@SS \\\n--server_cert=\/etc\/ssl\/certs\/kolide.cert --server_key=\/etc\/ssl\/private\/kolide.key \\\n--logging_json --auth_jwt_key=<strong>WS+Q2v6RyJdZgJDCHFWgak5HtxzPDhH8<\/strong><\/code><\/pre>\n\n\n\n<p>If all is well, you should see that Fleet server is now running on&nbsp;<strong>0.0.0.0:8080<\/strong>&nbsp;and hence can be accessed on&nbsp;<strong>https:\/\/&lt;server-IP&gt;:8080<\/strong>.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>{\"component\":\"service\",\"err\":null,\"method\":\"ListUsers\",\"took\":\"921.991\u00b5s\",\"ts\":\"2020-04-12T07:06:41.184166743Z\",\"user\":\"none\"}\n{\"address\":\"0.0.0.0:8080\",\"msg\":\"listening\",\"transport\":\"https\",\"ts\":\"2020-04-12T07:06:41.185827799Z\"}<\/code><\/pre>\n\n\n\n<p>Press Ctrl+c to stop Kolide Fleet server.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Create Kolide Fleet Systemd Service Unit on Ubuntu 18.04<\/h3>\n\n\n\n<p>Once you have verified that Kolide Fleet is running fine, create a systemd service file.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>vim \/etc\/systemd\/system\/kolide-fleet.service<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>&#91;Unit]\nDescription=Kolide Fleet Osquery Fleet Manager\nAfter=network.target\n\n&#91;Service]\nLimitNOFILE=8192\nExecStart=\/usr\/bin\/fleet serve \\\n  --mysql_address=127.0.0.1:3306 \\\n  --mysql_database=kolide \\\n  --mysql_username=kolideadmin \\\n  --mysql_password=StrongP@SS \\\n  --redis_address=127.0.0.1:6379 \\\n  --server_cert=\/etc\/ssl\/certs\/kolide.cert \\\n  --server_key=\/etc\/ssl\/private\/kolide.key \\\n  --auth_jwt_key=WS+Q2v6RyJdZgJDCHFWgak5HtxzPDhH8 \\\n  --logging_json\nExecStop=\/bin\/kill -15 $(ps aux | grep \"fleet serve\" | grep -v grep | awk '{print$2}')\n\n&#91;Install]\nWantedBy=multi-user.target<\/code><\/pre>\n\n\n\n<p>Save and exit the file.<\/p>\n\n\n\n<p>Reload systemd configurations.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>systemctl daemon-reload<\/code><\/pre>\n\n\n\n<p>Start and enable Kolide Fleet service.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>systemctl enable --now kolide-fleet<\/code><\/pre>\n\n\n\n<p>Check the status;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>systemctl status kolide-fleet<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>\u25cf kolide-fleet.service - Kolide Fleet Osquery Fleet Manager\n   Loaded: loaded (\/etc\/systemd\/system\/kolide-fleet.service; enabled; vendor preset: enabled)\n   Active: active (running) since Sun 2020-04-12 10:23:44 EAT; 3s ago\n Main PID: 6777 (fleet)\n    Tasks: 6 (limit: 1108)\n   CGroup: \/system.slice\/kolide-fleet.service\n           \u2514\u25006777 \/usr\/bin\/fleet serve --mysql_address=127.0.0.1:3306 --mysql_database=kolide --mysql_username=kolideadmin --mysql_password=StrongP@SS \n\nApr 12 10:23:44 u18 systemd&#91;1]: Started Kolide Fleet Osquery Fleet Manager.\nApr 12 10:23:44 u18 fleet&#91;6777]: {\"component\":\"service\",\"err\":null,\"method\":\"ListUsers\",\"took\":\"218.912\u00b5s\",\"ts\":\"2020-04-12T07:23:44.414494933Z\",\"user\"\nApr 12 10:23:44 u18 fleet&#91;6777]: {\"address\":\"0.0.0.0:8080\",\"msg\":\"listening\",\"transport\":\"https\",\"ts\":\"2020-04-12T07:23:44.418368662Z\"}<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Access Kolide Fleet Web Interface<\/h3>\n\n\n\n<p>Kolide Fleet can be accessed on the browser using the URL&nbsp;<strong>https:\/\/&lt;server-IP_OR_hostname&gt;:8080<\/strong>.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1331\" height=\"643\" src=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2019\/08\/kolide-UI.png\" alt=\"kolide fleet osquery manager ubuntu 18.04\" class=\"wp-image-3981\" title=\"\" srcset=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2019\/08\/kolide-UI.png 1331w, https:\/\/kifarunix.com\/wp-content\/uploads\/2019\/08\/kolide-UI-768x371.png 768w\" sizes=\"(max-width: 1331px) 100vw, 1331px\" \/><\/figure>\n\n\n\n<p>Setup your username, password, email, organization details and proceed to Kollide Web interface.<\/p>\n\n\n\n<figure class=\"wp-block-gallery columns-1 is-cropped wp-block-gallery-1 is-layout-flex wp-block-gallery-is-layout-flex\"><ul class=\"blocks-gallery-grid\"><li class=\"blocks-gallery-item\"><figure><img loading=\"lazy\" decoding=\"async\" width=\"1352\" height=\"565\" src=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2020\/04\/kolide-UI.png\" alt=\"\" data-id=\"5399\" data-full-url=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2020\/04\/kolide-UI.png?v=1586683048\" data-link=\"https:\/\/kifarunix.com\/?attachment_id=5399\" class=\"wp-image-5399\" title=\"\" srcset=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2020\/04\/kolide-UI.png?v=1586683048 1352w, https:\/\/kifarunix.com\/wp-content\/uploads\/2020\/04\/kolide-UI-768x321.png?v=1586683048 768w\" sizes=\"(max-width: 1352px) 100vw, 1352px\" \/><\/figure><\/li><\/ul><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">Adding New Hosts to Kolide Fleet<\/h3>\n\n\n\n<p>Next, install osquery on the host servers you want to enroll. We have already covered the installation of osquery on Debian 10 and Ubuntu 18.04 in our previous guide, see the links below;<\/p>\n\n\n\n<p><a href=\"https:\/\/kifarunix.com\/how-to-install-osquery-on-ubuntu-18-04\/\" target=\"_blank\" rel=\"noreferrer noopener\">How to Install Osquery on Ubuntu 18.04<\/a><\/p>\n\n\n\n<p><a rel=\"noreferrer noopener\" href=\"https:\/\/kifarunix.com\/install-osquery-on-debian-10-buster\/\" target=\"_blank\">Install Osquery on Debian 10 Buster<\/a><\/p>\n\n\n\n<p>Once osquery is installed, add your host to Kolide by navigating to&nbsp;<strong>Hosts &gt; Add New Hosts<\/strong>.<\/p>\n\n\n\n<p>When you click&nbsp;<strong>Add new host<\/strong>, a wizard like in below pops up with the instructions on how to add hosts to fleet instance.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"535\" height=\"631\" src=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2019\/08\/kolide-new-host.png\" alt=\"Add Kolide Fleet instance Ubuntu 18.04\" class=\"wp-image-3983\" title=\"\"><\/figure><\/div>\n\n\n\n<p>To enroll your osquery hosts, you need the secret key and the TLS certificate. Hence, Copy the secret key and click&nbsp;<strong><code>Fetch Fleet Certificate<\/code><\/strong>&nbsp;to download.<\/p>\n\n\n\n<p>On the host to enroll to the Kolide Fleet, install the secret key and the certificate as follows;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>echo \"qzAJao+jKVsoZi6Ck1OgheS5VPhfqPRc\" &gt; \/var\/osquery\/secret<\/code><\/pre>\n\n\n\n<p>Copy the TLS certificate to the host being enrolled on Kolide Fleet. Replace host-address with the host IP\/address.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>scp kolide.kifarunix-demo.com_8080.pem koromicha@<strong>host-address<\/strong>:kolide.kifarunix-demo.com.pem<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>sudo cp kolide.kifarunix-demo.com.pem \/var\/osquery\/<\/code><\/pre>\n\n\n\n<p>On the host being enrolled, verify the TLS server certificate;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>openssl s_client -connect kolide.kifarunix-demo.com:8080 -CAfile \/var\/osquery\/kolide.kifarunix-demo.com.pem<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>---\nSSL handshake has read 1353 bytes and written 391 bytes\n<strong>Verification: OK<\/strong>\n---<\/code><\/pre>\n\n\n\n<p>Next, stop the <code><strong>osqueryd<\/strong><\/code> if it is running;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>systemctl stop osqueryd<\/code><\/pre>\n\n\n\n<p>Run osqueryd with the following options on the host being enrolled, replacing the&nbsp;<strong>\u2013enroll_secret_path<\/strong>&nbsp;and&nbsp;<strong>\u2013tls_server_certs<\/strong>&nbsp;accordingly.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/usr\/bin\/osqueryd --enroll_secret_path=\/var\/osquery\/secret \\\n--tls_server_certs=\/var\/osquery\/kolide.kifarunix-demo.com.pem \\\n--tls_hostname=kolide.kifarunix-demo.com:8080 \\\n--host_identifier=uuid \\\n--enroll_tls_endpoint=\/api\/v1\/osquery\/enroll \\\n--config_plugin=tls \\\n--config_tls_endpoint=\/api\/v1\/osquery\/config \\\n--config_refresh=10 \\\n--disable_distributed=false \\\n--distributed_plugin=tls \\\n--distributed_interval=3 \\\n--distributed_tls_max_attempts=3 \\\n--distributed_tls_read_endpoint=\/api\/v1\/osquery\/distributed\/read \\\n--distributed_tls_write_endpoint=\/api\/v1\/osquery\/distributed\/write \\\n--logger_plugin=tls \\\n--logger_tls_endpoint=\/api\/v1\/osquery\/log \\\n--logger_tls_period=10<\/code><\/pre>\n\n\n\n<p>If all goes well, you should see some output similar to;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>I0412 12:13:40.467630 15162 events.cpp:863] Event publisher not enabled: auditeventpublisher: Publisher disabled via configuration\nI0412 12:13:40.467813 15162 events.cpp:863] Event publisher not enabled: syslog: Publisher disabled via configuration\nI0412 12:13:40.498387 15175 distributed.cpp:117] Executing distributed query: kolide_detail_query_network_interface: select ia.interface, address, mask, broadcast, point_to_point,\n                               id.interface, mac, id.type, mtu, metric, ipackets, opackets,\n                               ibytes, obytes, ierrors, oerrors, idrops, odrops, last_change\n                        from interface_details id join interface_addresses ia\n                               on ia.interface = id.interface where length(mac) &gt; 0\n                               order by (ibytes + obytes) desc\nI0412 12:13:40.501811 15175 distributed.cpp:117] Executing distributed query: kolide_detail_query_os_version: select * from os_version limit 1\nI0412 12:13:40.503866 15175 distributed.cpp:117] Executing distributed query: kolide_detail_query_osquery_flags: select name, value from osquery_flags where name in (\"distributed_interval\", \"config_tls_refresh\", \"config_refresh\", \"logger_tls_period\")\nI0412 12:13:40.506964 15175 distributed.cpp:117] Executing distributed query: kolide_detail_query_osquery_info: select * from osquery_info limit 1\nI0412 12:13:40.509542 15175 distributed.cpp:117] Executing distributed query: kolide_detail_query_system_info: select * from system_info limit 1\nI0412 12:13:40.518357 15175 distributed.cpp:117] Executing distributed query: kolide_detail_query_uptime: select * from uptime limit 1\nI0412 12:13:40.522809 15175 distributed.cpp:117] Executing distributed query: kolide_label_query_6: select 1;\nI0412 12:13:40.526031 15175 distributed.cpp:117] Executing distributed query: kolide_label_query_8: select 1 from os_version where platform = 'ubuntu';\nI0412 12:13:40.528300 15175 distributed.cpp:117] Executing distributed query: kolide_label_query_9: select 1 from os_version where platform = 'centos' or name like '%centos%'<\/code><\/pre>\n\n\n\n<p>Your host should now be enrolled on your Kolide Fleet Server.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1348\" height=\"581\" src=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2020\/04\/kolide-fleet-hosts.png\" alt=\"Enroll Ubuntu 18.04 osquery on Kolide Fleet manager\" class=\"wp-image-5400\" title=\"\" srcset=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2020\/04\/kolide-fleet-hosts.png?v=1586683481 1348w, https:\/\/kifarunix.com\/wp-content\/uploads\/2020\/04\/kolide-fleet-hosts-768x331.png?v=1586683481 768w\" sizes=\"(max-width: 1348px) 100vw, 1348px\" \/><\/figure>\n\n\n\n<p>To run Osquery with the details enrollment details above, edit its service file such that it looks like as in below;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>vim \/etc\/systemd\/system\/osqueryd.service<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>&#91;Unit]\nDescription=The osquery Daemon\nAfter=network.service syslog.service\n\n&#91;Service]\nTimeoutStartSec=0\nEnvironmentFile=\/etc\/default\/osqueryd\nExecStartPre=\/bin\/sh -c \"if &#91; ! -f $FLAG_FILE ]; then touch $FLAG_FILE; fi\"\nExecStartPre=\/bin\/sh -c \"if &#91; -f $LOCAL_PIDFILE ]; then mv $LOCAL_PIDFILE $PIDFILE; fi\"\nExecStart=\/usr\/bin\/osqueryd \\\n  --flagfile $FLAG_FILE \\\n  --config_path $CONFIG_FILE \\\n  --enroll_secret_path=\/var\/osquery\/secret \\\n  --tls_server_certs=\/var\/osquery\/server.pem \\\n  --tls_hostname=kolide.kifarunix-demo.com:8080 \\\n  --host_identifier=uuid \\\n  --enroll_tls_endpoint=\/api\/v1\/osquery\/enroll \\\n  --config_plugin=tls \\\n  --config_tls_endpoint=\/api\/v1\/osquery\/config \\\n  --config_refresh=10 \\\n  --disable_distributed=false \\\n  --distributed_plugin=tls \\\n  --distributed_interval=3 \\\n  --distributed_tls_max_attempts=3 \\\n  --distributed_tls_read_endpoint=\/api\/v1\/osquery\/distributed\/read \\\n  --distributed_tls_write_endpoint=\/api\/v1\/osquery\/distributed\/write \\\n  -logger_plugin=tls \\\n  --logger_tls_endpoint=\/api\/v1\/osquery\/log \\\n  --logger_tls_period=10\nRestart=on-failure\nKillMode=process\nKillSignal=SIGTERM\n\n&#91;Install]\nWantedBy=multi-user.target<\/code><\/pre>\n\n\n\n<p>Reload system daemons.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>systemctl daemon-reload<\/code><\/pre>\n\n\n\n<p>Start osqueryd.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>systemctl start osqueryd<\/code><\/pre>\n\n\n\n<p>Check status;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>systemctl status osqueryd<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>\u25cf osqueryd.service - The osquery Daemon\n   Loaded: loaded (\/etc\/systemd\/system\/osqueryd.service; disabled; vendor preset: enabled)\n   Active: active (running) since Sun 2020-04-12 12:31:14 EAT; 9s ago\n  Process: 15281 ExecStartPre=\/bin\/sh -c if &#91; -f $LOCAL_PIDFILE ]; then mv $LOCAL_PIDFILE $PIDFILE; fi (code=exited, status=0\/SUCCESS)\n  Process: 15279 ExecStartPre=\/bin\/sh -c if &#91; ! -f $FLAG_FILE ]; then touch $FLAG_FILE; fi (code=exited, status=0\/SUCCESS)\n Main PID: 15282 (osqueryd)\n    Tasks: 18 (limit: 2315)\n   CGroup: \/system.slice\/osqueryd.service\n           \u251c\u250015282 \/usr\/bin\/osqueryd --flagfile \/etc\/osquery\/osquery.flags --config_path \/etc\/osquery\/osquery.conf --enroll_secret_path=\/var\/osquery\/se\n           \u2514\u250015284 \/usr\/bin\/osqueryd\n...<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Querying Host from Kolide Fleet Osquery Manager<\/h3>\n\n\n\n<p>Once the hosts are enrolled, you can query them directly from Kolide Fleet.<\/p>\n\n\n\n<p>For example, to query non system users with the query:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code><strong>select username,directory,uid,gid,shell from users where uid &gt;= 1000;<\/strong><\/code><\/pre>\n\n\n\n<p>Click Query on the left panel &gt; Create new query. Define the Name of the Query, the query itself, Description, the target host.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1346\" height=\"567\" src=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2020\/04\/query-nonsystem-users-kolide.png\" alt=\"\" class=\"wp-image-5403\" title=\"\" srcset=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2020\/04\/query-nonsystem-users-kolide.png?v=1586685079 1346w, https:\/\/kifarunix.com\/wp-content\/uploads\/2020\/04\/query-nonsystem-users-kolide-768x324.png?v=1586685079 768w\" sizes=\"(max-width: 1346px) 100vw, 1346px\" \/><\/figure>\n\n\n\n<p>Click RUN to execute the query. You can save the query if you want.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1338\" height=\"470\" src=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2020\/04\/query-results-kolide.png\" alt=\"\" class=\"wp-image-5404\" title=\"\" srcset=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2020\/04\/query-results-kolide.png?v=1586685095 1338w, https:\/\/kifarunix.com\/wp-content\/uploads\/2020\/04\/query-results-kolide-768x270.png?v=1586685095 768w\" sizes=\"(max-width: 1338px) 100vw, 1338px\" \/><\/figure>\n\n\n\n<p>And Boom!!! You got Kolide Fleet working on Ubuntu 18.04 and is able to query remote hosts running Osquery. That marks the end of your guide on how to install and setup Kolide Fleet on Ubuntu 18.04.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Related Tutorials<\/h3>\n\n\n\n<p><a rel=\"noreferrer noopener\" href=\"https:\/\/kifarunix.com\/install-kolide-fleet-osquery-fleet-manager-on-debian-10\/\" target=\"_blank\">Install Kolide Fleet Osquery Fleet Manager on Debian 10<\/a><\/p>\n\n\n\n<p><a href=\"https:\/\/kifarunix.com\/install-glpi-itsm-tool-on-centos-8\/\" target=\"_blank\" rel=\"noreferrer noopener\">Install GLPI ITSM Tool on CentOS 8<\/a><\/p>\n\n\n\n<p><a href=\"https:\/\/kifarunix.com\/install-ossec-agent-on-centos-8\/\" target=\"_blank\" rel=\"noreferrer noopener\">Install OSSEC Agent on CentOS 8<\/a><\/p>\n\n\n\n<p><a rel=\"noreferrer noopener\" href=\"https:\/\/kifarunix.com\/install-ocs-ng-inventory-on-centos-8\/\" target=\"_blank\">Install OCS-NG Inventory on CentOS 8<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this guide, we are going to learn how to install and Setup Kolide Fleet on Ubuntu 18.04. Kolide Fleet is an opensource Osquery manager<\/p>\n","protected":false},"author":1,"featured_media":8325,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"rank_math_lock_modified_date":false,"footnotes":""},"categories":[121,1070,72,1065],"tags":[1411,1072,1413,1412,1066],"class_list":["post-5395","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-howtos","category-kolide","category-monitoring","category-osquery","tag-install-kolide-fleet-ubuntu-18-04","tag-kolide-fleet","tag-kolide-osquery-manager","tag-kolide-ubuntu-18-04","tag-osquery","generate-columns","tablet-grid-50","mobile-grid-100","grid-parent","grid-50","resize-featured-image"],"_links":{"self":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts\/5395"}],"collection":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/comments?post=5395"}],"version-history":[{"count":5,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts\/5395\/revisions"}],"predecessor-version":[{"id":8353,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts\/5395\/revisions\/8353"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/media\/8325"}],"wp:attachment":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/media?parent=5395"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/categories?post=5395"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/tags?post=5395"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}