All articles

Detecting, fixing and keeping up with vulnerabilities on Unraid

A short while ago I came across an awesome plugin for Unraid called CVE Lens, which makes it a lot easier to detect vulnerable dependencies and keep up with vulnerabilities in both Docker containers and the operating system.

A short while ago I came across an awesome plugin for Unraid called CVE Lens, which solves a problem I have been thinking about for a while regarding the security of my homelab.

I use Unraid as my main server at home and run a bunch of different Docker containers on it. I try to keep both Unraid and my containers up to date, but just because Unraid tells me that all my containers are up to date does not necessarily mean that the software running inside them is free of known vulnerabilities.

A Docker image can contain hundreds of different packages and dependencies that you normally don't think much about. Some of these might be vulnerable even if the application itself is running the latest available version.

Working with cybersecurity professionally, vulnerability management is something I am already quite familiar with. So why not implement some of the same principles in my own homelab?

CVE Lens on my Unraid dashboard

So what is CVE Lens?#

CVE Lens is an open-source Unraid plugin, previously known as Trivy Scan. It uses Trivy to examine container images and certain software installed on the host. It also uses Grype to check mapped Unraid system packages against NVD vulnerability information.

The nice thing is that you get the results directly in the Unraid web interface rather than having to maintain a separate vulnerability management platform.

Installing the plugin#

In the Unraid web interface, navigate to Plugins > Install Plugin and paste the following URL:

Plain text
https://raw.githubusercontent.com/luuvasara/unraid-cve-lens/main/unraid-cve-lens.plg

The plugin requires Unraid 6.12 or newer, with Docker enabled and your array started. As with any third-party plugin, I would recommend reviewing the GitHub repository before installing it on your server.

Once installed, navigate to Settings > CVE Lens and start a scan. The first scan can take some time as the vulnerability databases require around 5-6 GB of disk space with the default configuration. Subsequent scans can reuse these databases.

CVE Lens settings and scan configuration

What does a vulnerability scan actually tell us?#

For each reported CVE, we can look at the affected software, installed version, severity and whether a fix is known. The report also indicates targets that could not be scanned.

This is where I think the plugin becomes really useful. Instead of manually checking security advisories for every application in my homelab, I can use one report as a starting point for investigating my exposure.

Overview of vulnerabilities detected on my Unraid server

One important thing to keep in mind is that a detected CVE does not automatically mean that someone can exploit it in your environment. It also does not mean that your server has been compromised.

Prioritizing vulnerabilities#

If you have a decent number of containers running, you will probably end up with quite a few findings. Going through every single one of them is not necessarily a good use of your time.

CVE Lens provides two additional pieces of information that are useful alongside severity:

  • CISA KEV: Whether there is evidence that the vulnerability has been exploited in the wild.
  • EPSS: An estimated probability that the vulnerability will be exploited in the wild within the next 30 days.

I would personally start with vulnerabilities that are known to be exploited, especially in services that are accessible from outside my network. I would also look closely at containers that have access to sensitive data, run with elevated permissions or have access to the Docker socket.

A medium-severity vulnerability in an internet-facing application might be more important to me than a critical vulnerability in a dependency that is not reachable in my setup.

Expanded CVE with affected packages and remediation information

How do we actually fix the vulnerabilities?#

If there is a newer container image available, the first thing I would do is update the container through the Unraid Docker interface. Before updating anything important, make sure you have a backup of its application data.

After updating, run another scan and check whether the vulnerability is still present.

You can also use the following read-only command from the Unraid terminal to get an overview of your containers and the images they reference:

Bash
docker ps -a --format 'table {{.Names}}\t{{.Image}}\t{{.Status}}'

If you are already running the newest image and it still contains the vulnerable dependency, there might not be much you can do until the image maintainer publishes a fix. For a custom image that you maintain yourself, you can update the vulnerable dependency and rebuild the image instead.

Depending on the risk, you could also restrict network access, disable an affected feature or temporarily stop the container while waiting for a fix.

For vulnerabilities in Unraid itself, check the official release notes and update to a supported patched release. I would avoid manually replacing system packages. Also keep in mind that backported security fixes can sometimes cause version-based scanners to report vulnerabilities that have already been fixed.

Vulnerability report after updating an affected container

Keeping up with newly discovered vulnerabilities#

One of the most useful things about this plugin is the ability to schedule scans and receive notifications for newly detected fixable critical vulnerabilities and certain newly identified exploited CVEs.

My preferred setup would be to run a scan every night, preferably at a time when the server is not doing anything else particularly resource intensive. I would also include stopped containers, since there might be a reason to start one of them again later.

For example, a daily scan at 03:00 can be configured using this cron expression:

Plain text
0 3 * * *

The reason I want recurring scans is that an image that had no known vulnerabilities yesterday might have several today, even though I haven't changed anything on my server. New CVEs are disclosed all the time.

Scheduled scans and vulnerability notifications

Scanning Docker images before installing them#

Another useful feature is the ability to check a published image directly from its registry without deploying it. This is something I would especially consider when trying out a new self-hosted application.

For example, you can enter the following image reference in the image scanning tab after the initial database download:

Plain text
postgres:17

A clean scan is not proof that an image is trustworthy, but it gives me one more piece of information before deciding whether I want to introduce it into my environment.

Scanning a Docker image before deployment

What are the limitations?#

As much as I like the idea of having this sort of functionality built into Unraid, it is important to understand what it does not do.

The plugin is not an antivirus, an EDR or an intrusion detection system. It cannot tell me whether a container has been compromised, and matching known vulnerable software versions will not catch every possible security issue.

I would still make sure that my services are properly isolated, that I have good backups and that applications are not unnecessarily exposed to the internet.

Conclusion#

CVE Lens is a pretty interesting addition to the Unraid ecosystem and something I would recommend looking into if you run a lot of Docker containers in your homelab.

What I like about it is that it makes vulnerability management a lot more accessible without having to set up and maintain a completely separate platform.

For me, the goal is not necessarily to get the vulnerability count down to zero. The goal is to know what I am running, understand what risks I am exposed to, fix what I can and make informed decisions about the vulnerabilities I cannot fix yet.

Keeping software up to date is important, but having visibility into what is actually vulnerable is just as important.

References#

Article partly written with AI tools#
Back to all articlesFollow via RSS