Local Linux Scans#
This page explains how scans performed by installing the scanner on a Linux server (Local Scan) detect vulnerabilities in OS packages, and where the scan settings are written.
Local Scan is one of the two methods of "Server OS Scan". For how to install the scanner, see "Installation".
Related Blog Post
We've published a hands-on guide on the FutureVuls blog for centrally managing OS software, middleware, and libraries on Linux servers.
Centralized Vulnerability Management for Linux Servers: Covering OS, Middleware, and Libraries
How OS Package Scanning Works#
OS packages are software managed by the OS package manager, such as rpm and deb packages.
Vulnerabilities in OS packages are detected in the following flow.
- The scanner collects the OS type and version of the server and the names and versions of the installed packages, and uploads them to FutureVuls.
- FutureVuls matches the uploaded information against the vulnerability information published by the OS vendor (Linux distributor).
- If any packages are affected, they are displayed on the screen as vulnerabilities.
The terms used in this explanation are as follows.
| Term | Meaning |
|---|---|
| Upstream | The developer of the software. The OS vendor packages the upstream software and distributes it |
| Backport | Applying only the fixes made in a newer upstream version to the older version of the package that the OS distributes |
| OS vendor vulnerability information | Information published by Red Hat, Ubuntu, Debian, and others on the affected packages and fixed versions for each vulnerability. It is provided in formats called OVAL and Security Tracker |
| NVD | The vulnerability database provided by the U.S. National Institute of Standards and Technology (NIST). Affected versions are listed as upstream versions |
Relationship Between Backporting and Detection#
In major Linux distributions, vulnerability fixes are sometimes provided through backporting. In this case, the part of the package version that corresponds to the upstream version does not change, and only the release number assigned by the OS vendor is updated.
The versions in the diagram are hypothetical examples for explanation.
The package version 2.4.1-5 combines the upstream version 2.4.1 with the release number 5 assigned by the OS vendor.
- Upstream fixes the vulnerability in the new version
2.4.2. - Instead of raising the package to
2.4.2, the OS vendor distributes2.4.1-6, which applies only the fix to2.4.1.
The fixed package 2.4.1-6 is still the vulnerable 2.4.1 when you look at its upstream version.
Therefore, you cannot determine whether a package has been fixed from the upstream version alone.
FutureVuls performs detection using the OS vendor vulnerability information.
Because this information lists the fixed version for each OS (2.4.1-6 in the diagram), vulnerabilities fixed through backporting are also determined correctly.
Details of the Detection Logic
For details of the detection logic, refer to the source code of the OSS used as the scanners. The scanner for Server OS Scan is Vuls.
How to Scan and Check Results on Linux#
The scanner runs automatically once a day. To run a scan at any time, or to check scan results and logs, see "Scanner Execution and Scheduling".
Scan Configuration Location#
The configuration file used for scanning is /opt/vuls-saas/config.toml. It is created when you install the scanner.
With Local Scan, you can scan without editing this file. The following example shows the contents after the first scan.
$ cat /opt/vuls-saas/config.toml
version = "v2"
[saas]
GroupID = 0000
Token = "xxxx-xxxxxxxx-xxxx-xxxxxx-xxxxxxxxx"
URL = "https://xxxxxxxxxxxx"
[default]
[servers]
[servers.server1]
user = "vuls-saas"
host = "localhost"
port = "local"
scanMode = ["fast-root"]
[servers.server1.uuids]
server1 = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx"
The main items have the following meanings.
| Item | Meaning |
|---|---|
[saas] |
The destination group for uploads and the scanner token. Set at installation |
[servers.<name>] |
The server to scan. <name> is assigned from the host name at installation |
host / port |
The combination of host = "localhost" and port = "local" scans the server on which the scanner is installed. For the settings to scan other servers, see "Remote Scan" |
scanMode |
The scope of information to collect, such as whether to use root privileges when scanning. The default is fast-root. For details, see "Scan Mode" |
[servers.<name>.uuids] |
The ID that FutureVuls uses to identify the server. Added automatically when the first scan results are uploaded |
For how to change the settings, see "Scanner Settings".
Registering CPEs for OS Packages#
You can also detect vulnerabilities by registering a CPE (an identifier that represents a product name and version) for the OS itself or for OS packages. However, because this tends to produce incorrect detection results, registering CPEs for the OS and OS packages is not recommended. Use scanning with the scanner instead.
The recommended method for each type of target to manage is as follows.
| Target to Manage | Recommended Method |
|---|---|
| The OS and OS packages managed by the package manager | Scanning with the scanner (the method on this page). If you cannot install the scanner, use "Paste Scan" |
| Software not managed by the package manager, such as software built directly from obtained source code | "CPE Scan". Vulnerabilities can be detected when you use the upstream software without modification and the corresponding CPE and vulnerability information are registered |
| Language libraries that an application depends on | "Dependency Library Scan" |
There are two reasons why registering CPEs for the OS and OS packages is not recommended.
| Reason | Description | Resolved by Updating the CPE? |
|---|---|---|
| 1. The registered information becomes outdated | Because CPE Scan does not access the actual machine, the registered CPE does not change even when you update packages | Not resolved if you registered the CPE of the OS (because the CPE of the OS does not represent the version of each package). If you registered a CPE for each package, you need to update the CPE each time you update the package |
| 2. Backports cannot be determined | Vulnerability databases used by CPE Scan, such as NVD, list versions as upstream versions | Not resolved whether you registered the CPE of the OS or a CPE for each package |
For which detection results are used when you register (assign) a CPE to an OS package, see "Vulnerability Detection for OS Packages".
False Positives Occur Because CPE Scans Do Not Access the Live System and Are Unaware of Updates#
When you register the CPE of an OS, all vulnerabilities associated with that OS and version in vulnerability databases such as NVD are detected.
The following example illustrates this (the OS, software, versions, and CVE ID are hypothetical examples for explanation).
| Order | Event | Detection Result from the OS CPE |
|---|---|---|
| 1 | When the OS was released, version 2.0.0-a of package A was bundled with it |
— |
| 2 | The vulnerability CVE-XXXX-0001, which affects 2.0.0-a of package A, was disclosed and registered in NVD |
CVE-XXXX-0001 is detected |
| 3 | You updated package A on the server to the fixed version 2.0.0-b |
CVE-XXXX-0001 continues to be detected (because the update on the actual machine cannot be known) |
False Positives Occur Because the NVD Used for CPE Scans Does Not Support Backporting#
Registering a CPE for each package can also produce incorrect detection results. There are both cases in which a fixed vulnerability continues to be detected (the example in the diagram under "Relationship Between Backporting and Detection") and cases in which a vulnerability that affects the server is not detected (the following example).
Converting the package versions obtained with commands such as rpm -qa into CPEs and registering them does not resolve this problem.
The following uses the OpenSSL vulnerability CVE-2021-3450 as an example to show how the information differs by source.
| Information Source | What It States About CVE-2021-3450 |
|---|---|
| Upstream (OpenSSL vulnerability information) | OpenSSL 1.1.1h and later are affected, and it was fixed in 1.1.1k. Versions older than 1.1.1h are not affected |
| Red Hat Enterprise Linux 8 advisory (RHSA-2021:1024) | Fixed in openssl-1.1.1g-15.el8_3 |
In Red Hat Enterprise Linux 8, the fix is provided for a package whose upstream version is 1.1.1g.
If you apply the upstream affected range (1.1.1h and later, before 1.1.1k) as is to the Red Hat Enterprise Linux 8 package, 1.1.1g falls under the versions that are not affected. As a result, even on a server that uses a package from before the fix (a package older than openssl-1.1.1g-15.el8_3), this vulnerability is not detected when you match by the upstream version. When you match by the OS vendor's information, it is detected as a package from before the fix.
For what NVD and Red Hat state, see "NVD: CVE-2021-3450" and "Red Hat: CVE-2021-3450".
In this way, even for the same CVE ID, the affected versions and fixed versions that are listed differ depending on the information source.
Troubleshooting#
Check the common causes and fixes on the following pages.