WEBVTT

00:00:01.240 --> 00:00:03.810
Let's move our conversation over to the default scripts

00:00:03.810 --> 00:00:05.760
that Zeek ships with and employs.

00:00:06.540 --> 00:00:08.760
We have a few to cover here before we move into the

00:00:08.760 --> 00:00:10.950
actual optimization and tuning of Zeek.

00:00:11.940 --> 00:00:15.100
Understanding the various scripts that we have to work with goes

00:00:15.100 --> 00:00:18.040
a long way in knowing how we can modify them to make the tool

00:00:18.040 --> 00:00:19.760
more efficient and effective for us.

00:00:21.240 --> 00:00:23.290
We have two directories that we're concerned about when

00:00:23.290 --> 00:00:24.860
talking about the default scripts.

00:00:25.640 --> 00:00:29.560
One is the base directory, and the other is the policy one.

00:00:30.840 --> 00:00:31.710
By default,

00:00:31.720 --> 00:00:35.920
Zeek ships with the base directory loaded along with some policy scripts.

00:00:36.640 --> 00:00:38.760
We'll look into these in the coming demos.

00:00:39.440 --> 00:00:42.650
The policy ones are situational, like I mentioned in the previous clip.

00:00:43.540 --> 00:00:47.070
The base ones contain a lot that help with Zeek's functionality out of

00:00:47.070 --> 00:00:50.160
the box and all of the definitions that it uses.

00:00:50.540 --> 00:00:53.260
And we can modify which ones of these are loaded as well.

00:00:54.940 --> 00:00:58.520
The init‑bare script is something that you likely won't touch,

00:00:58.530 --> 00:01:01.460
but it's great to dive into if you want to see some of the inner

00:01:01.460 --> 00:01:04.150
workings of how Zeek's functionality is created.

00:01:05.040 --> 00:01:08.670
This one is loaded by default when Zeek initializes and when the

00:01:08.670 --> 00:01:11.760
instance is invoked with the Zeek ‑b command.

00:01:12.840 --> 00:01:17.000
This script has so many defined types and variables and vectors declared,

00:01:17.120 --> 00:01:18.360
along with so much more.

00:01:19.040 --> 00:01:19.720
I mean,

00:01:19.730 --> 00:01:23.510
this thing even defines connection record types and many of the other

00:01:23.510 --> 00:01:25.960
objects that we went over in the previous module.

00:01:26.840 --> 00:01:29.660
We'll dive a little bit further into this in the next clip.

00:01:32.040 --> 00:01:35.110
The init‑default script is another one of the base ones

00:01:35.110 --> 00:01:38.140
loaded by default and contains all of the various

00:01:38.140 --> 00:01:40.350
frameworks and utilities that Zeek loads.

00:01:41.140 --> 00:01:43.900
It has the scripts for all of the various protocol and

00:01:43.900 --> 00:01:45.850
file analysis functionality as well.

00:01:46.940 --> 00:01:49.470
Looking at it here, as you can see,

00:01:49.770 --> 00:01:52.050
it enables a lot of the main features and

00:01:52.050 --> 00:01:54.150
functionality of Zeek by loading this one.

00:01:55.240 --> 00:01:58.710
We can circumvent this by using the ‑b command when invoking

00:01:58.710 --> 00:02:01.450
Zeek and only running in the bare bones mode.

00:02:02.740 --> 00:02:05.050
Finally, the local.zeek script.

00:02:05.540 --> 00:02:08.620
This is the one that we've been modifying as we've been adding

00:02:08.620 --> 00:02:11.860
and removing signatures and tuning scripts.

00:02:12.840 --> 00:02:15.680
This one is where we customize our system and define

00:02:15.680 --> 00:02:17.660
exactly which scripts we want to load,

00:02:18.140 --> 00:02:20.450
and I've been mentioning it a lot throughout this course.

00:02:21.340 --> 00:02:24.980
The key here is that we create our own scripts and then

00:02:24.980 --> 00:02:26.860
load them using the local.zeek script.

00:02:28.040 --> 00:02:28.700
Of course,

00:02:28.870 --> 00:02:32.530
we should make sure we use commenting when we can in order to

00:02:32.530 --> 00:02:35.060
ensure we're documenting what we're loading and why.

00:02:36.040 --> 00:02:39.250
This is where most of our customization magic happens though.

00:02:40.940 --> 00:02:44.450
Besides all of those scripts that come with Zeek and are loaded by default,

00:02:44.840 --> 00:02:48.260
we should consider all of the other things in there that are loaded by default.

00:02:49.740 --> 00:02:52.650
We have the packet/protocol processing scripts,

00:02:53.040 --> 00:02:57.060
utilities, various BIFs that we need for the event definitions,

00:02:57.440 --> 00:02:58.660
and so much more.

00:02:59.540 --> 00:03:01.880
Since Zeek is an event‑driven network security

00:03:01.880 --> 00:03:04.460
monitor that performs traffic analysis,

00:03:05.040 --> 00:03:08.490
much of what we find in that base directory is crucial

00:03:08.490 --> 00:03:10.260
to getting value out of the box.

00:03:11.140 --> 00:03:14.250
Let's use the next clip to hop into the lab and explore

00:03:14.250 --> 00:03:16.060
many of these in much more detail.
