WEBVTT

00:00:00.840 --> 00:00:05.180
Okay, so we've created a granular rule for changes to the preload file,

00:00:05.180 --> 00:00:09.350
but how do we trigger a remediation script when this rule fires?

00:00:09.640 --> 00:00:10.280
For this,

00:00:10.290 --> 00:00:14.660
we're going to go into the ossec.conf and create an active‑response command.

00:00:21.040 --> 00:00:24.550
Okay, let's go to our first active‑response configuration.

00:00:28.640 --> 00:00:31.300
Here we define the command that we're going to trigger.

00:00:31.590 --> 00:00:34.680
In our case, this is a script I made for this tutorial,

00:00:34.680 --> 00:00:37.470
deny‑invisible‑process.py.

00:00:38.040 --> 00:00:41.940
As we can see in the SUMMARY, this script runs the unhide command.

00:00:41.940 --> 00:00:44.470
Unhide just looks for hidden processes.

00:00:45.140 --> 00:00:48.350
If a process is found, our script will kill the process.

00:00:48.940 --> 00:00:53.050
Within the executable tag, we specify what script we're going to execute.

00:00:54.140 --> 00:00:58.620
Active‑response commands expect the script to be within the bin directory.

00:00:58.620 --> 00:01:02.560
After we define the command, we need to map the command to a rule.

00:01:03.940 --> 00:01:06.250
We do this within the active‑response section.

00:01:07.840 --> 00:01:08.720
As you can tell,

00:01:08.730 --> 00:01:12.320
we declare the command within the command tag. The location

00:01:12.320 --> 00:01:14.970
command declares where the script is executed.

00:01:15.340 --> 00:01:16.130
In our case,

00:01:16.260 --> 00:01:19.840
we want the script to execute on the host where the alert was generated,

00:01:19.840 --> 00:01:24.740
in other words, the Victim container, so we declare local here.

00:01:24.740 --> 00:01:28.090
To see what other location options are available,

00:01:28.090 --> 00:01:30.170
please see course notes number 13.

00:01:30.940 --> 00:01:34.760
Rules_id is our trigger rule, so in this case,

00:01:34.770 --> 00:01:38.580
changes to the preload file, which is rule 100,000,

00:01:38.670 --> 00:01:41.560
would trigger our deny‑invisible‑process command.

00:01:42.240 --> 00:01:44.760
As an aside, if you'd like to see the actual script,

00:01:45.240 --> 00:01:47.070
please see course notes number 14.
