WEBVTT

00:00:02.240 --> 00:00:05.260
There's more to learn about Suricata's metadata logging and how you

00:00:05.260 --> 00:00:07.760
can change the configuration to suit your needs.

00:00:08.940 --> 00:00:10.360
As we've already explored,

00:00:10.370 --> 00:00:14.080
there are several ways to configure how Suricata generates its outputs,

00:00:14.090 --> 00:00:16.550
and you'll find this information in the suricata.yaml

00:00:16.550 --> 00:00:18.450
file under the outputs section.

00:00:19.440 --> 00:00:23.550
The configuration file lets you not only decide which outputs you want enabled,

00:00:23.940 --> 00:00:25.170
but also which parsers.

00:00:25.170 --> 00:00:27.380
As you saw in the previous demonstration,

00:00:27.640 --> 00:00:31.900
this isn't always as easy as just enabling and disabling these capabilities.

00:00:32.200 --> 00:00:35.380
It's a good idea to have an environment to test Suricata on before

00:00:35.380 --> 00:00:38.970
going straight to production. With outputs, several of them will

00:00:38.970 --> 00:00:41.210
have additional and even unique settings.

00:00:41.560 --> 00:00:43.860
Most of these settings are described right there in

00:00:43.860 --> 00:00:45.750
the suricata.yaml file for you.

00:00:47.140 --> 00:00:50.460
One such output type is flows, and it's worth revisiting here.

00:00:51.140 --> 00:00:54.380
There are two types of flows to consider. Flows themselves are

00:00:54.380 --> 00:00:58.600
bidirectional and consists of a 5‑tuple or 7‑tuple in the case of

00:00:58.600 --> 00:01:03.640
VLANs This 5‑tuple is the protocol, source IP, destination IP, source

00:01:03.640 --> 00:01:08.060
port, and destination port, and for the 7‑tuple, the VLAN IDs.

00:01:08.690 --> 00:01:10.420
Netflow is another type of flow.

00:01:10.610 --> 00:01:12.860
It is unidirectional instead of bidirectional.

00:01:13.240 --> 00:01:14.530
So for each flow record,

00:01:14.540 --> 00:01:18.550
there is in, fact two, netflow records. As flow is generally the more

00:01:18.550 --> 00:01:24.200
useful, netflow is disabled by default. In this slide, you can see an

00:01:24.200 --> 00:01:28.540
example of a flow. In the training VM, you can also grep for the event

00:01:28.540 --> 00:01:32.860
type of flow in the eve.json file to get an idea of how these records

00:01:32.860 --> 00:01:33.450
are structured.

00:01:34.200 --> 00:01:37.310
The flow_id is an important field as it allows us to see other

00:01:37.310 --> 00:01:40.990
records associated with this flow. You can also see source and

00:01:40.990 --> 00:01:43.650
destination IP, ports, protocols,

00:01:43.660 --> 00:01:46.560
application layer protocols, just to name a few fields.

00:01:47.040 --> 00:01:50.810
There is also the flow‑specific section, which includes stats about the flow,

00:01:50.810 --> 00:01:56.530
such as bytes to and from, start and end time, and number of packets. In the

00:01:56.530 --> 00:02:00.950
suricata.yaml file under outputs, eve‑log, types,

00:02:01.080 --> 00:02:04.560
you'll find all of the protocol‑specific loggers. Some may

00:02:04.560 --> 00:02:08.580
provide additional or extended information, in which case it

00:02:08.580 --> 00:02:10.350
may or may not already be enabled.

00:02:10.840 --> 00:02:13.690
You can experiment with enabling and disabling these,

00:02:13.700 --> 00:02:16.440
then compare the appropriate records of each to see if the

00:02:16.440 --> 00:02:20.350
additional information is something of value to you. Since you

00:02:20.350 --> 00:02:23.710
already know how to modify Suricata's configuration, this becomes a

00:02:23.710 --> 00:02:29.990
fairly straightforward exercise. This is an example TLS record. It

00:02:29.990 --> 00:02:31.570
has an event_type of tls.

00:02:31.770 --> 00:02:35.720
There is a flow_id to correlate on, and under the tls‑specific section,

00:02:35.840 --> 00:02:39.660
plenty of useful data extracted from the TLS certificates, such as the

00:02:39.660 --> 00:02:42.950
subject, the fingerprint, and the version, just to name a few.

00:02:43.940 --> 00:02:47.480
Here's another example from the SMB protocol, often used for

00:02:47.480 --> 00:02:49.850
activities like file transfer over a network.

00:02:52.040 --> 00:02:54.320
This is another great protocol to be able to have this

00:02:54.320 --> 00:02:57.210
visibility into. If you haven't started to,

00:02:57.340 --> 00:03:00.860
you should be thinking about how this data not only helps during an incident,

00:03:01.240 --> 00:03:04.590
but how you can use this data through visualizations and dashboards to

00:03:04.590 --> 00:03:07.440
monitor your network for a wide variety of use cases,

00:03:07.660 --> 00:03:09.060
not just malicious activity.

00:03:09.840 --> 00:03:12.690
Each protocol requires some understanding of how it works, and we

00:03:12.690 --> 00:03:16.370
won't get into all the details with SMB. Suffice it to say, you may

00:03:16.370 --> 00:03:18.470
have to do a little research as you dig into the different

00:03:18.470 --> 00:03:20.250
protocols that Suricata supports.

00:03:20.940 --> 00:03:24.390
Suricata can also generate anomaly records, which it does when it

00:03:24.390 --> 00:03:27.390
encounters packets with unexpected or anomalous values.

00:03:27.840 --> 00:03:30.120
These anomalies can help when hunting encrypted network

00:03:30.120 --> 00:03:33.650
traffic, such as the use of common TLS port 443,

00:03:33.760 --> 00:03:38.510
but for unencrypted traffic. You can also enable anomaly logging under the

00:03:38.510 --> 00:03:43.190
outputs, eve‑log section. Under types, the commented values decode,

00:03:43.200 --> 00:03:46.160
stream, and applayer represent the default value.

00:03:46.600 --> 00:03:47.520
To change those,

00:03:47.530 --> 00:03:50.300
you would need to uncomment that line and change the

00:03:50.300 --> 00:03:52.450
value from yes to no or vice versa.

00:03:53.040 --> 00:03:54.330
As previously discussed,

00:03:54.470 --> 00:03:58.070
networks with a high number of anomalies may experience packet processing

00:03:58.070 --> 00:04:02.080
degradation, and we suggest using an approach that limits when anomaly

00:04:02.080 --> 00:04:05.950
logging is enabled to get a sense of what is going on in the network, then

00:04:05.950 --> 00:04:08.010
disabling and attempting to troubleshoot.

00:04:08.540 --> 00:04:11.960
You may also find that leaving some of the anomaly logging enabled,

00:04:12.030 --> 00:04:16.250
such as for the applayer, does not result in a degradation and also

00:04:16.250 --> 00:04:18.560
provides valuable insight into the network.

00:04:19.040 --> 00:04:21.980
This is one of our recurring themes. You'll have to experiment with your

00:04:21.980 --> 00:04:24.560
network to find out what is your optimal settings.

00:04:25.140 --> 00:04:27.220
Let's now take a look at some of these configuration

00:04:27.220 --> 00:04:28.860
items in our next demonstration.
