St. Cloud State UniversityÂ
LAB-02: The Zeek (Bro) Network Security Monitor-Installation and ConfigurationÂ
PART-01: How to Install Zeek (formerly Bro) NIDS on CentOS 8
This guide assumes you’ll be installing Zeek on CentOS 8, given how popular CentOS tends to be in the enterprise. However, the guide should work for any RHEL-based flavors of Linux. For Debian-based systems, there will be some modifications required, including using apt-get vs yum for installing Linux packages. Nothing that a search couldn’t help you figure out.
First, we’ll optimize CentOS to efficiently capture packets and then compile Zeek from source to start monitoring network traffic.
In this section, we’ll walkthrough following steps:
sudo yum install network-scripts
sudo ethtool -g enp2s0 Ring parameters for enp2s0:
Pre-set maximums:
RX:Â Â Â Â Â Â Â Â Â Â Â Â 4096 RX Mini:Â Â Â Â Â Â Â 0
RX Jumbo:Â Â Â Â Â Â 0
TX:Â Â Â Â Â Â Â Â Â Â Â Â 4096
Current hardware settings:
RX:Â Â Â Â Â Â Â Â Â Â Â Â 256 RX Mini:Â Â Â Â Â Â Â 0
RX Jumbo:Â Â Â Â Â Â 0
TX:Â Â Â Â Â Â Â Â Â Â Â Â 256
NM_CONTROLLED=no
BOOTPROTO=none ONBOOT=yes
IPV6INIT=no
ETHTOOL_OPTS=”-G ${DEVICE} rx <max ring parameter determined from step 1 above>; -K ${DEVICE} rx off; -K ${DEVICE} tx off; -K ${DEVICE} sg off; -K ${DEVICE} tso off; -K ${DEVICE} ufo off; -K ${DEVICE} gso off; -K ${DEVICE} gro off; -K ${DEVICE} lro off”
TYPE=Ethernet
BOOTPROTO=none
DEFROUTE=yes
IPV4_FAILURE_FATAL=no IPV6INIT=no
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes IPV6_PEERDNS=yes
IPV6_PEERROUTES=yes
IPV6_FAILURE_FATAL=no
NAME=enp2s0
UUID=b22f5d92-3f1e-430b-b660-cb9376d8c0c0 DEVICE=enp2s0 ONBOOT=yes
PEERDNS=yes
PEERROUTES=yes USERS=root
NM_CONTROLLED=no
ETHTOOL_OPTS=”-G ${DEVICE} rx 4096; -K ${DEVICE} rx off; -K ${DEVICE} tx off; -K ${DEVICE} sg off; -K ${DEVICE} tso off; -K ${DEVICE} ufo off; -K ${DEVICE} gso off; -K ${DEVICE} gro off; -K ${DEVICE} lro off”
sudo systemctl enable network
sudo systemctl restart network
[Unit]
Description=Makes an interface run in promiscuous mode at boot
After=network.target
[Service]
Type=oneshot
ExecStart=/usr/sbin/ip link set dev enp2s0 promisc on
TimeoutStartSec=0
RemainAfterExit=yes
[Install]
WantedBy=default.target
sudo chmod u+x /etc/systemd/system/promisc.service sudo systemctl start promisc.service sudo systemctl enable promisc.service
Created symlink from
/etc/systemd/system/default.target.wants/promisc.service to /etc/systemd/system/promisc.service.
ip a show enp2s0 | grep -i promisc
3: enp2s0: < BROADCAST,MULTICAST,PROMISC,UP,LOWER_UP > mtu 1500 qdisc pfifo_fast state UP group default qlen 1000.
Â
# CentOS-PowerTools.repo
#
# The mirror system uses the connecting IP address of the client and the
# update status of each mirror to pick mirrors that are updated to and
# geographically close to the client. You should use this for CentOS updates
# unless you are manually picking other mirrors.
#
# If the mirrorlist= does not work for you, as a fall back you can try the # remarked out baseurl= line instead.
[PowerTools]
name=CentOS-$releasever – PowerTools
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&r epo=PowerTools&infra=$infra
#baseurl=http://mirror.centos.org/$contentdir/$releasever/PowerTools/$basearc h/os/ gpgcheck=1 enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
sudo yum –enablerepo=extras install epel-release
sudo yum install cmake make gcc gcc-c++ flex bison jemalloc-devel libpcap-devel openssl-devel platform-python-devel swig zlib-devel
sudo yum update sudo reboot
sudo yum install libmaxminddb-devel
tar xzvf GeoLite2-City.tar.gz
sudo mv GeoLite2-City_YYYYMMDD/GeoLite2-City.mmdb
/usr/share/GeoIP/GeoLite2-City.mmdb
sudo groupadd zeek sudo useradd zeek -g zeek
sudo passwd zeek
sudo mkdir /opt/zeek sudo chown -R zeek:zeek /opt/zeek sudo chmod 750 /opt/zeek
su zeek
cd
wget https://download.zeek.org/zeek-3.2.1.tar.gz tar -xzvf zeek-3.2.1.tar.gz cd zeek-3.2.1
./configure –prefix=/opt/zeek –enable-jemalloc make make install
Note: This will take *a while* to compile.
Exit
sudo setcap cap_net_raw=eip /opt/zeek/bin/zeek sudo setcap cap_net_raw=eip /opt/zeek/bin/capstats
pathmunge /opt/zeek/bin
# Example ZeekControl node configuration. | |
# Below is an example clustered configuration on a single host.
[logger] | ||
type=logger | ||
host=localhost
[manager] | ||
type=manager | ||
host=localhost
[proxy-1] type=proxy host=localhost
[worker-1] type=worker host=localhost interface=enp2s0
[worker-2] type=worker host=localhost interface=enp2s0
In the event you have two or more sniffing interfaces (e.g. enp2s0 and enp3s0), see the example configuration below which assigns each interface its own worker.
# Example ZeekControl node configuration. | |
# Below is an example clustered configuration on a single host.
[logger] | ||
type=logger | ||
host=localhost
Get Proposal Presentation Assignment Help Now!!
[manager] | ||
type=manager | ||
host=localhost
[proxy-1] type=proxy host=localhost
[worker-1] type=worker host=localhost interface=enp2s0
[worker-2] type=worker host=localhost interface=enp3s0
zeekctl deploy checking configurations … installing … removing old policies in /opt/zeek/spool/installed-scripts-do-not-touch/site
…
removing old policies in /opt/zeek/spool/installed-scripts-do-not-touch/auto
… creating policy directories … installing site policies … generating cluster-layout.zeek … generating local-networks.zeek … generating zeekctl-config.zeek … generating zeekctl-config.sh …
stopping …
stopping workers … stopping proxy … stopping manager … stopping logger …
starting … starting logger … starting manager … starting proxy … starting workers …
Name        Type   Host            Status   Pid   Started | |
logger      logger localhost       running  1774  10 Oct 23:15:31 manager     manager localhost       running  1820  10 Oct 23:15:32 proxy-1     proxy  localhost       running  1865  10 Oct 23:15:33 worker-1-1  worker localhost       running  1950  10 Oct 23:15:35 worker-1-2  worker localhost       running  1951  10 Oct 23:15:35 worker-2-1  worker localhost       running  1955  10 Oct 23:15:35 |
worker-2-2  worker localhost       running  1954  10 Oct 23:15:35
If you see the following errors:
zeekctl deploy
Error: worker-1-1 terminated immediately after starting; check output with “diag”
Error: worker-1-2 terminated immediately after starting; check output with “diag”
Error: worker-2-1 terminated immediately after starting; check output with “diag”
Error: worker-2-2 terminated immediately after starting; check output with “diag” Then try re-running the sudo setcap commands from earlier.
sudo setcap cap_net_raw=eip /opt/zeek/bin/zeek sudo setcap cap_net_raw=eip /opt/zeek/bin/capstats
ls -l total 2276
-rw-rw-r–. 1 zeek zeek  1573 Oct 10 23:15 broker.log
-rw-rw-r–. 1 zeek zeek   593 Oct 10 23:45 capture_loss.log
-rw-rw-r–. 1 zeek zeek  1970 Oct 10 23:15 cluster.log
-rw-rw-r–. 1 zeek zeek 673435 Oct 10 23:52 conn.log
-rw-rw-r–. 1 zeek zeek 580865 Oct 10 23:52 dns.log
-rw-rw-r–. 1 zeek zeek  3830 Oct 10 23:49 dpd.log
-rw-rw-r–. 1 zeek zeek  1406 Oct 10 23:47 files.log
-rw-rw-r–. 1 zeek zeek 26108 Oct 10 23:48 http.log
-rw-rw-r–. 1 zeek zeek 24646 Oct 10 23:15 loaded_scripts.log
-rw-rw-r–. 1 zeek zeek   753 Oct 10 23:18 notice.log
-rw-rw-r–. 1 zeek zeek   187 Oct 10 23:15 packet_filter.log
-rw-rw-r–. 1 zeek zeek   743 Oct 10 23:46 software.log
-rw-rw-r–. 1 zeek zeek 86512 Oct 10 23:51 ssl.log
-rw-rw-r–. 1 zeek zeek  5446 Oct 10 23:50 stats.log
-rw-rw-r–. 1 zeek zeek     0 Oct 10 23:15 stderr.log
-rw-rw-r–. 1 zeek zeek   188 Oct 10 23:15 stdout.log
-rw-rw-r–. 1 zeek zeek 240866 Oct 10 23:51 weird.log
zeekctl diag
ZeekControl features a cron command to check for and restart crashed nodes and to perform other maintenance tasks. To take advantage of this, let’s set up a cron job.
crontab -e
*/5 * * * * /opt/zeek/bin/zeekctl cron
Â
PART-02: Zeek Package Manager
Now we’ll introduce the Zeek Package Manager to extend Zeek’s functionality with packages contributed by the Zeek community. A full list of available packages can be viewed on the Zeek Package Browser. We will focus on configuring Zeek to use AF_PACKET to further optimize packet capture and analysis. We’ll also install additional useful packages.
In this section, we’ll walkthrough following steps:
cd pwd /home/zeek
zkg autoconfig
This will create a configuration file in /home/zeek/.zkg/config. Upon completion it should look something like the following. zeek = https://github.com/zeek/packages
[paths]
state_dir = /home/zeek/.zkg script_dir = /opt/zeek/share/zeek/site plugin_dir = /opt/zeek/lib/zeek/plugins zeek_dist = /home/zeek/zeek-3.1.5
zeekctl stop
zkg install zeek/j-gras/zeek-af_packet-plugin
The following packages will be INSTALLED:Â Â zeek/j-gras/zeek-af_packet-plugin (2.0.0)
Proceed? [Y/n] y
Running unit tests for “zeek/j-gras/zeek-af_packet-plugin”
Installing “zeek/j-gras/zeek-af_packet-plugin”…….
Installed “zeek/j-gras/bro-af_packet-plugin” (2.0.0)
# Example ZeekControl node configuration. | |
# Below is an example clustered configuration on a single host.
[logger] | ||
type=logger | ||
host=localhost
[manager] | ||
type=manager | ||
host=localhost
[proxy-1] type=proxy host=localhost
[worker-1] type=worker host=localhost interface=af_packet::enp2s0 lb_method=custom lb_procs=2 pin_cpus=0,1
In the event you have two or more sniffing interfaces (e.g. enp2s0 and enp3s0), see the example configuration below which assigns each interface its own worker, load balanced across two cores, again using AF_PACKET. Note the addition of unique af_packet_fanout_id values for each of the sniffing interfaces.
Â
# Example ZeekControl node configuration. | |
# Below is an example clustered configuration on a single host.
[logger] | ||
type=logger | ||
host=localhost
[manager] | ||
type=manager | ||
host=localhost
[proxy-1] type=proxy host=localhost
[worker-1] type=worker host=localhost interface=af_packet::enp2s0 lb_method=custom lb_procs=2 pin_cpus=0,1 af_packet_fanout_id=2
[worker-2] type=worker host=localhost interface=af_packet::enp3s0 lb_method=custom lb_procs=2 pin_cpus=2,3 af_packet_fanout_id=3
sudo setcap cap_net_raw=eip /opt/zeek/bin/zeek sudo setcap cap_net_raw=eip /opt/zeek/bin/capstats
zeekctl deploy
If you see the following errors, try re-running the sudo setcap commands from the previous step.
zeekctl deploy
Error: worker-1-1 terminated immediately after starting; check output with “diag”
Error: worker-1-2 terminated immediately after starting; check output with “diag”
Error: worker-2-1 terminated immediately after starting; check output with “diag”
Error: worker-2-2 terminated immediately after starting; check output with “diag”
zeekctl stop
Proceed? [Y/n] y
Installed “zeek/j-gras/add-interfaces” (master) Loaded “zeek/j-gras/add-interfaces”
## Enables interfaces for all active streams        const enable_all_logs = T &redef;        ## Streams not to add interfaces for        const exclude_logs: set[Log::ID] = { } &redef;
## Streams to add interfaces for
const include_logs: set[Log::ID] = { } &redef; }
zkg install zeek/salesforce/ja3
The following packages will be INSTALLED:Â Â zeek/salesforce/ja3 (master)
Proceed? [Y/n] y
Installing “zeek/salesforce/ja3”
Installed “zeek/salesforce/ja3” (master) Loaded “zeek/salesforce/ja3”
zkg install zeek/salesforce/hassh The following packages will be INSTALLED:Â Â zeek/salesforce/hassh (master)
Proceed? [Y/n] y
Installing “zeek/salesforce/hassh”
Installed “zeek/salesforce/hassh” (master)
Loaded “zeek/salesforce/hassh”
# Load Zeek Packages @load packages
zeekctl deploy
Refresh package source: zeek No changes Refresh installed packages New outdated packages:
zeek/salesforce/hassh (master)
This indicates that zeek/salesforce/hassh needs to be updated.
The following packages will be UPGRADED: zeek/salesforce/hassh (master)
Proceed? [Y/n] y
Upgraded “zeek/salesforce/hassh” (master)
What is the ELK Stack?
The ELK Stack is a collection of three open-source products — Elasticsearch,Logstash, and Kibana — all developed, managed and maintained by Elastic. Elasticsearch is a NoSQL database that is based on the Lucene search engine. Logstash is a log pipeline tool that accepts inputs from various sources, executes different transformations, and exports the data to various targets. Kibana is a visualization layer that works on top of Elasticsearch. The stack also includes a family of log shippers called Beats, which led Elastic to rename ELK as the Elastic Stack.
Together, these different open source products are most commonly used for centralized logging in IT environments (though there are many more use cases for the ELK Stack including business intelligence, security and compliance, and web analytics). Logstash collects and parses logs, and then Elasticsearch indexes and stores the information. Kibana then presents the data in visualizations that provide actionable insights into one’s environment.
NOTE-1: Please add all group member’s names (LAST_NAME, FIRST_NAME), the group number and page numbers of the report.
NOTE-2: Please add all group member’s contributions to complete and submit this lab as a percentage as shown below at the end of the report. (Before submitting to D2L all of the group members must know or aware their reported contribution as a percentage in the lab report)
Example:Â
Member-01: 100% Member-02:Â Â 75% Member-03: 100%
[1]. https://www.ericooi.com/zeekurity-zen-part-i-how-to-install-zeek-on-centos-8/ [2]. https://www.ericooi.com/zeekurity-zen-part-ii-zeek-package-manager/
[3]. https://sematext.com/blog/bro-ids-network-security-elasticsearch/
Why Choose Us
Quality Papers
We value our clients. For this reason, we ensure that each paper is written carefully as per the instructions provided by the client. Our editing team also checks all the papers to ensure that they have been completed as per the expectations.
Professional Academic Writers
Over the years, our Acme Homework has managed to secure the most qualified, reliable and experienced team of writers. The company has also ensured continued training and development of the team members to ensure that it keep up with the rising Academic Trends.
Affordable Prices
Our prices are fairly priced in such a way that ensures affordability. Additionally, you can get a free price quotation by clicking on the "Place Order" button.
On-Time delivery
We pay strict attention on deadlines. For this reason, we ensure that all papers are submitted earlier, even before the deadline indicated by the customer. For this reason, the client can go through the work and review everything.
100% Originality
At Grade One Essays, all papers are plagiarism-free as they are written from scratch. We have taken strict measures to ensure that there is no similarity on all papers and that citations are included as per the standards set.
Customer Support 24/7
Our support team is readily available to provide any guidance/help on our platform at any time of the day/night. Feel free to contact us via the Chat window or support email: support@gradeoneessays.com.
Try it now!
How it works?
Follow these simple steps to get your paper done
Place your order
Fill in the order form and provide all details of your assignment.
Proceed with the payment
Choose the payment system that suits you most.
Receive the final file
Once your paper is ready, we will email it to you.
Our Services
Grade One Essays has stood as the world’s leading custom essay writing services providers. Once you enter all the details in the order form under the place order button, the rest is up to us.
Essays
At Grade One Essays, we prioritize on all aspects that bring about a good grade such as impeccable grammar, proper structure, zero-plagiarism and conformance to guidelines. Our experienced team of writers will help you completed your essays and other assignments.
Admissions
Admission and Business Papers
Be assured that you’ll definitely get accepted to the Master’s level program at any university once you enter all the details in the order form. We won’t leave you here; we will also help you secure a good position in your aspired workplace by creating an outstanding resume or portfolio once you place an order.
Editing
Editing and Proofreading
Our skilled editing and writing team will help you restructure you paper, paraphrase, correct grammar and replace plagiarized sections on your paper just on time. The service is geared toward eliminating any mistakes and rather enhancing better quality.
Coursework
Technical papers
We have writers in almost all fields including the most technical fields. You don’t have to worry about the complexity of your paper. Simply enter as much details as possible in the place order section.