WEBVTT

00:00:00.140 --> 00:00:00.660
Hello.

00:00:00.790 --> 00:00:03.500
In this setup and configuration demo of Winlogbeat,

00:00:03.500 --> 00:00:07.080
we will start by validating the installation and look at how it

00:00:07.080 --> 00:00:09.160
relates to the rest of the Elastic cluster.

00:00:09.740 --> 00:00:10.230
Then,

00:00:10.370 --> 00:00:13.770
we'll take a brief look at an example configuration file so we

00:00:13.770 --> 00:00:16.059
have an idea of the options available to us.

00:00:16.740 --> 00:00:20.270
Then, when we're ready to modify the Winlogbeat configuration,

00:00:20.510 --> 00:00:24.260
I have a readymade template you can use as a starting point for your deployment.

00:00:25.340 --> 00:00:27.640
Finally, after completing these tasks,

00:00:27.830 --> 00:00:30.160
I'll show you how to start the Winlogbeat service.

00:00:31.140 --> 00:00:33.660
The software version of the Elastic components in your

00:00:33.660 --> 00:00:36.480
environment should generally be the same across the stack

00:00:36.490 --> 00:00:38.250
to avoid compatibility issues.

00:00:38.740 --> 00:00:42.100
This virtual machine is one of several Windows 10 workstations

00:00:42.110 --> 00:00:45.050
in the Globomantics enterprise environment where I've already

00:00:45.050 --> 00:00:47.350
installed version 8 of Winlogbeat.

00:00:48.240 --> 00:00:50.780
The Elasticsearch cluster where all of the logs will be

00:00:50.780 --> 00:00:53.760
received and stored also uses version 8.

00:00:55.240 --> 00:00:58.160
I want to remind you that this is an intermediate‑level course,

00:00:58.350 --> 00:00:59.800
so I'm going to make some assumptions,

00:00:59.800 --> 00:01:02.980
the first of which is that you can download and install

00:01:02.980 --> 00:01:04.860
Windows software like Winlogbeat.

00:01:06.040 --> 00:01:10.150
We will spend most of our time focusing on the setup and configuration process.

00:01:11.140 --> 00:01:15.360
The Winlogbeat configuration files are located under the ProgramData directory.

00:01:16.440 --> 00:01:19.860
Notice there is a reference file and an example config file.

00:01:20.540 --> 00:01:24.030
Let's take a quick look at the winlogbeat.example.yml file and

00:01:24.030 --> 00:01:25.850
go over some of the configuration options.

00:01:26.640 --> 00:01:31.300
Now, I won't be able to cover every feature in this short course; however,

00:01:31.310 --> 00:01:33.250
resources will be provided at the end.

00:01:35.040 --> 00:01:38.820
The event logs section specifies which logs we want to ship

00:01:38.830 --> 00:01:41.850
from the endpoint to our output destination.

00:01:42.540 --> 00:01:46.760
The minimum configuration you need is the name of the log or log channel.

00:01:48.740 --> 00:01:52.760
There are additional modifiers that affect how the selected logs are processed.

00:01:53.340 --> 00:01:54.080
For instance,

00:01:54.290 --> 00:01:58.270
the event_id field allows you to filter only the specific events

00:01:58.270 --> 00:02:00.560
you want to be sent to your output source.

00:02:01.540 --> 00:02:05.950
You can also add metadata tags or ignore old log events.

00:02:06.640 --> 00:02:11.460
The lines that do not have modifiers will send all the available event IDs.

00:02:11.460 --> 00:02:15.160
For those of you that have Windows Event Forwarding in your environment,

00:02:15.640 --> 00:02:19.340
you can install Winlogbeat on each of the Windows Event Collectors and

00:02:19.340 --> 00:02:22.260
ensure this section has the forwarded events configured.

00:02:23.040 --> 00:02:27.560
Winlogbeat has a default template that controls index lifecycle management,

00:02:28.140 --> 00:02:30.560
the number of shards, and field mappings.

00:02:31.240 --> 00:02:35.270
The default template is recommended for most deployments; however,

00:02:35.390 --> 00:02:38.060
if you need to make adjustments, you can make them here.

00:02:40.740 --> 00:02:44.460
The Kibana dashboards for Winlogbeat are not loaded by default,

00:02:44.840 --> 00:02:48.880
but you can enable that feature here if you want them loaded.

00:02:48.880 --> 00:02:53.720
The setup configuration options only need to be run once,

00:02:53.890 --> 00:02:56.740
and I recommend using a separate Elasticsearch user

00:02:56.740 --> 00:02:58.960
account with elevated privileges.

00:02:59.740 --> 00:03:03.340
Another consideration is that you will have to disable index template

00:03:03.340 --> 00:03:07.570
loading if you're not sending logs directly to Elasticsearch.

00:03:07.570 --> 00:03:13.160
This section controls where the logs are sent when events are generated.

00:03:13.160 --> 00:03:17.500
The most resilient deployment for an enterprise environment is to use

00:03:17.500 --> 00:03:22.250
a log broker such as Kafka or Logstash and then have the broker send

00:03:22.250 --> 00:03:24.250
the logs to the Elasticsearch cluster.

00:03:25.340 --> 00:03:28.550
However, you can ship directly to Elasticsearch.

00:03:29.440 --> 00:03:29.950
Now,

00:03:30.050 --> 00:03:32.840
each endpoint will have the credentials necessary to

00:03:32.850 --> 00:03:35.600
interact directly with the Elasticsearch API.

00:03:35.600 --> 00:03:40.510
You must scope the API or user account permissions.

00:03:40.510 --> 00:03:46.600
Keep in mind that a compromised endpoint with an API key or username/password

00:03:46.610 --> 00:03:51.280
with excessive permissions could provide an adversary with the ability to add

00:03:51.280 --> 00:03:53.660
and remove data from your Elasticsearch cluster.

00:03:54.640 --> 00:03:56.930
When we look at the operational configuration file,

00:03:57.130 --> 00:03:58.750
I'll talk more about these concerns.

00:04:00.640 --> 00:04:03.790
The last section of this configuration will allow you to add

00:04:03.790 --> 00:04:06.420
metadata information to all your event logs,

00:04:06.500 --> 00:04:09.960
such as MAC address, hostname, operating system.

00:04:10.940 --> 00:04:12.590
If you have a cloud‑based system,

00:04:12.600 --> 00:04:15.150
it will also enrich your event data with the cloud

00:04:15.150 --> 00:04:17.060
provider's details about the endpoint.

00:04:18.440 --> 00:04:21.329
I've put together a Winlogbeat configuration that can

00:04:21.329 --> 00:04:23.450
serve as a great starting point.

00:04:24.140 --> 00:04:27.880
I aggregated event log sources and event IDs from the

00:04:27.880 --> 00:04:30.260
NSA's Spotting the Adversary whitepaper,

00:04:30.640 --> 00:04:33.050
Microsoft's Windows Event IDs to Monitor,

00:04:33.340 --> 00:04:35.440
and what's known as the Sexy Six Event IDs.

00:04:36.540 --> 00:04:38.640
Since this course is focused on Winlogbeat,

00:04:38.810 --> 00:04:41.950
I did not include Sysmon event logs because that requires

00:04:41.950 --> 00:04:44.550
additional software installation and configuration.

00:04:46.040 --> 00:04:48.760
The configuration file is located on my GitHub,

00:04:48.770 --> 00:04:53.020
but I've included a copy with the course resources if you want to follow along.

00:04:53.020 --> 00:04:55.470
So once it's downloaded,

00:04:55.580 --> 00:04:59.910
we need to extract and copy it over to the Winlogbeat configuration directory

00:05:00.150 --> 00:05:03.650
and open it up in a preferred editor as an administrator.

00:05:04.840 --> 00:05:06.570
Okay, here we are.

00:05:06.570 --> 00:05:10.210
It might be tempting to remove the event IDs and

00:05:10.210 --> 00:05:13.250
configure each log source to send all logs,

00:05:13.740 --> 00:05:15.100
but that's not optimal.

00:05:15.100 --> 00:05:18.690
You will be generating a lot of logs that may not have

00:05:18.690 --> 00:05:20.350
much value for threat detection.

00:05:21.340 --> 00:05:26.190
Additionally, the fear of missing incidents leads organizations to,

00:05:26.190 --> 00:05:28.860
as they say, log all the things,

00:05:29.740 --> 00:05:34.270
which generates large volumes of events and alerts that

00:05:34.270 --> 00:05:36.840
have led to analysis and alert fatigue.

00:05:37.940 --> 00:05:38.820
Nevertheless,

00:05:39.020 --> 00:05:42.550
this configuration is a great place to start and build upon

00:05:42.550 --> 00:05:44.450
using your organizational requirements.

00:05:45.840 --> 00:05:49.160
We will be making changes in this section of the configuration file.

00:05:50.240 --> 00:05:51.860
I'll start with the metadata tag.

00:05:52.640 --> 00:05:56.150
There's already a list containing endpoint and HR.

00:05:56.740 --> 00:05:59.360
Let's change HR to Globomantics.

00:05:59.360 --> 00:06:02.290
If this were a domain controller,

00:06:02.530 --> 00:06:06.110
I would change the endpoint tag to dc or any other

00:06:06.110 --> 00:06:08.060
descriptive tag that would be helpful.

00:06:09.040 --> 00:06:13.450
Next, I'll update the domain name for Kibana and Elasticsearch.

00:06:13.450 --> 00:06:18.750
Then, I'll use the winlogbeat setup command to manually load the dashboards,

00:06:18.880 --> 00:06:21.330
index templates, and ingest pipelines.

00:06:21.330 --> 00:06:26.960
To do that, we must connect directly to Kibana and the Elasticsearch cluster.

00:06:28.240 --> 00:06:31.860
Remember, if you're using TLS, and you should be,

00:06:32.110 --> 00:06:36.270
you will need to ensure that the Elasticsearch cluster's certificate authority

00:06:36.270 --> 00:06:39.750
certificate is installed in the Windows Certificate Store.

00:06:40.840 --> 00:06:43.860
Yet another detail to keep in mind is that for

00:06:43.860 --> 00:06:46.860
whichever output system you choose, Kafka,

00:06:47.340 --> 00:06:50.130
Logstash, directly to Elasticsearch,

00:06:50.130 --> 00:06:54.350
the certificate validation could fail if the hostname or IP

00:06:54.350 --> 00:06:57.920
address you use is not referenced in the common name field of

00:06:57.920 --> 00:06:59.560
the respective TLS certificate.

00:07:00.440 --> 00:07:00.860
Now,

00:07:01.440 --> 00:07:04.300
you may have noticed that there are no plaintext passwords

00:07:04.310 --> 00:07:07.050
or API credentials visible in this file.

00:07:07.940 --> 00:07:08.580
Instead,

00:07:08.880 --> 00:07:13.660
the best practice is to use the Winlogbeat keystore to secure our credentials.

00:07:15.140 --> 00:07:19.160
The command to create the keystore is winlogbeat keystore create.

00:07:20.640 --> 00:07:21.120
Then,

00:07:21.130 --> 00:07:24.680
we need to use the winlogbeat keystore add command for each

00:07:24.680 --> 00:07:26.660
variable name used in our config file.

00:07:27.840 --> 00:07:32.550
Winlogbeat keystore list displays which variables have been created.

00:07:33.340 --> 00:07:34.000
Remember,

00:07:34.220 --> 00:07:37.720
you must run the keystore commands with the same user that you

00:07:37.720 --> 00:07:39.850
will use to start the Winlogbeat service.

00:07:41.540 --> 00:07:42.050
Okay,

00:07:42.740 --> 00:07:46.130
now that we have the Winlogbeat configuration modified for our

00:07:46.130 --> 00:07:48.960
environment and the keystore variables created,

00:07:49.180 --> 00:07:51.990
it's time to run the winlogbeat setup command.

00:07:51.990 --> 00:07:56.850
This command only needs to be run once on one of your endpoints.

00:07:57.540 --> 00:08:02.600
I created the Beats admin user account and API key using the Kibana web UI

00:08:02.600 --> 00:08:07.460
and I scoped the permissions. Once setup is complete,

00:08:07.840 --> 00:08:11.990
I will comment out the credential information for the Beats admin user and

00:08:11.990 --> 00:08:18.560
enable the API key. The best practice guidance is to create a unique API per

00:08:18.560 --> 00:08:23.380
endpoint, especially if you do not use a keystore variable or scope the

00:08:23.380 --> 00:08:25.460
permissions to the functionality necessary.

00:08:26.640 --> 00:08:29.680
Now, before we start the Winlogbeat service,

00:08:29.860 --> 00:08:34.390
we can double check the configuration using the winlogbeat test config

00:08:34.390 --> 00:08:39.659
command. Nice! Looks like we're good to go and all that's left is to

00:08:39.669 --> 00:08:44.340
enter the command Start‑Service winlogbeat. Make sure you're in a

00:08:44.340 --> 00:08:46.250
PowerShell session or it won't work.

00:08:47.240 --> 00:08:47.750
That's it.

00:08:48.240 --> 00:08:52.340
We now have a Winlogbeat agent running on our Windows workstation,

00:08:52.470 --> 00:08:56.460
shipping a scoped set of event logs to our elasticsearch cluster.

00:08:57.040 --> 00:08:58.150
See you in the next clip.
