WEBVTT

00:00:00.740 --> 00:00:04.010
It's now time to check the Globomantics search API.

00:00:04.650 --> 00:00:07.520
That's the last of the three components that they want to secure,

00:00:07.750 --> 00:00:09.860
and it's built using the .NET platform.

00:00:10.560 --> 00:00:14.260
We'll learn how we can configure Dependency‑Check for ongoing monitoring by

00:00:14.260 --> 00:00:17.820
setting severity failure levels and suppressing false positives.

00:00:19.100 --> 00:00:19.770
This time,

00:00:20.100 --> 00:00:23.980
Globomantics want us to configure Dependency‑Check to fail whenever genuine

00:00:23.980 --> 00:00:28.200
vulnerabilities above a certain level are found so that they can use that

00:00:28.200 --> 00:00:30.630
failure to trigger an alert in their monitoring system.

00:00:31.640 --> 00:00:32.320
In fact,

00:00:32.330 --> 00:00:34.990
Dependency‑Check has a feature for that built right into it,

00:00:35.060 --> 00:00:36.920
so we're going to take advantage of that.

00:00:37.600 --> 00:00:40.640
It's called fail on CVSS.

00:00:40.640 --> 00:00:44.600
CVSS, or common vulnerability scoring system,

00:00:44.760 --> 00:00:47.940
is a structured scoring framework that rates a security

00:00:47.940 --> 00:00:50.680
vulnerability on a scale of 0 to 10.

00:00:52.140 --> 00:00:54.560
There is actually a lot of additional information about the

00:00:54.560 --> 00:00:57.920
vulnerability encoded in a full CVSS rating,

00:00:58.100 --> 00:01:01.140
but we're just going to look at the numeric score in this course.

00:01:03.070 --> 00:01:06.440
This table shows how they map to objective descriptions,

00:01:06.480 --> 00:01:12.690
0.1 to 3.9 is low, 4.0 to 6.9 is medium,

00:01:13.150 --> 00:01:19.550
7 to 8.9 is high, and then 9.0 to 10.0 would be critical.

00:01:20.830 --> 00:01:22.820
Remember that Log4Shell vulnerability that we

00:01:22.820 --> 00:01:24.390
mentioned at the beginning of this course?

00:01:24.560 --> 00:01:27.340
Well, it got a 10.0 on this scale.

00:01:29.000 --> 00:01:31.830
Globomantics have asked us to make this command fail for

00:01:31.830 --> 00:01:34.190
anything high or critical for now.

00:01:34.500 --> 00:01:38.540
That will be a 7.0 or greater on the CVSS scale,

00:01:38.810 --> 00:01:45.400
and we can do this by adding the flag ‑‑failOnCVSS 7.0.

00:01:45.570 --> 00:01:46.660
That's case sensitive.

00:01:48.610 --> 00:01:53.250
I'm going to run that, and when it completes,

00:01:53.300 --> 00:01:56.290
sure enough, Dependency‑Check has issued a failure.

00:01:57.500 --> 00:01:59.760
Let's take a look at the report to understand why.

00:02:02.000 --> 00:02:06.550
We've got one medium severity, which is below the threshold Globomantics gave us,

00:02:06.640 --> 00:02:10.350
and one high severity vulnerability in the log4net logging library.

00:02:11.100 --> 00:02:12.810
That will be what's caused the failure.

00:02:13.000 --> 00:02:14.510
We'll need to do something about that.

00:02:15.840 --> 00:02:18.400
We'll follow the steps that I outlined in the previous clip.

00:02:19.810 --> 00:02:22.020
First of all, could we patch?

00:02:22.510 --> 00:02:24.190
Well it looks like we probably could.

00:02:24.650 --> 00:02:28.880
The report says the vulnerability doesn't exist in 2.0.10.

00:02:29.070 --> 00:02:33.830
Well we're on 2.0.9, so that upgrade would probably not be too disruptive.

00:02:34.910 --> 00:02:37.820
But let's assume for demo purposes that patching is not

00:02:37.820 --> 00:02:39.980
an option here for whatever reason.

00:02:41.190 --> 00:02:45.630
We then need to investigate to see if our app specifically is vulnerable.

00:02:45.950 --> 00:02:47.090
Reading the description,

00:02:47.090 --> 00:02:53.170
we see this allows for XML external entity‑based attacks in applications that

00:02:53.170 --> 00:02:56.820
accept attacker controlled log4net configuration files.

00:02:58.170 --> 00:02:58.750
Okay,

00:02:58.760 --> 00:03:01.340
so the attack vector here is if the attacker has

00:03:01.340 --> 00:03:04.170
control of a logging configuration file.

00:03:05.640 --> 00:03:06.370
In this case,

00:03:06.380 --> 00:03:09.760
I happen to know that the configuration file is safe from attackers.

00:03:09.770 --> 00:03:12.280
It's not hosted on any network location,

00:03:12.590 --> 00:03:15.970
the build process is tightly controlled to authorized developers,

00:03:16.080 --> 00:03:20.710
and the API does not accept or pass configuration files from users.

00:03:21.400 --> 00:03:24.940
In our specific application, this is a false positive.

00:03:26.700 --> 00:03:30.490
Globomantics did say that they only wanted the task to fail for genuine

00:03:30.500 --> 00:03:33.100
high severity vulnerabilities in their application,

00:03:33.110 --> 00:03:36.260
which means we need to suppress this CVE report so that it

00:03:36.260 --> 00:03:38.150
doesn't cause a failure going forward.

00:03:39.900 --> 00:03:43.360
In Dependency‑Check, this is done by creating a suppression file,

00:03:43.580 --> 00:03:46.490
and the HTML report gives us a helping hand with this.

00:03:47.890 --> 00:03:51.060
If we click the Suppress button next to the CVE listing,

00:03:51.070 --> 00:03:53.940
we get a pop‑up with some auto‑generated XML.

00:03:54.390 --> 00:03:58.320
The idea is that we copy this XML snippet and add it to our suppression file.

00:03:58.910 --> 00:04:01.160
We don't actually have a suppression file yet,

00:04:01.260 --> 00:04:05.320
but we can hit the Complete XML Doc button and hopefully we get

00:04:05.320 --> 00:04:07.420
the contents of an entire suppression file.

00:04:09.160 --> 00:04:11.790
I'm going to take that XML and add it to a new file

00:04:11.790 --> 00:04:15.120
called suppression.xml in my project root.

00:04:16.670 --> 00:04:19.540
According to the best practice that we discussed in the previous clip,

00:04:19.550 --> 00:04:21.410
I'm going to do two additional things.

00:04:22.100 --> 00:04:22.610
First,

00:04:22.620 --> 00:04:25.750
I'm going to add to the notes field an explanation of

00:04:25.750 --> 00:04:30.850
why we are suppressing this report, and two,

00:04:30.860 --> 00:04:35.050
I'm going to add an until attribute to the suppress XML tag

00:04:35.120 --> 00:04:37.340
with an expiry date 3 months from now.

00:04:38.560 --> 00:04:39.340
In 3 months,

00:04:39.350 --> 00:04:41.980
I want this to start failing again so that we can check

00:04:41.980 --> 00:04:43.750
that the situation hasn't changed.

00:04:46.570 --> 00:04:50.370
Finally, we can run Dependency‑Check with another command line argument,

00:04:50.730 --> 00:04:55.730
‑‑suppression and the path to the file that we just created.

00:04:58.710 --> 00:05:03.090
You'll see that this time Dependency‑Check has completed without error.
