Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add check for needrestart CVEs #993

Merged
merged 1 commit into from
Nov 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions hotsos/defs/scenarios/system/cve-libmodule-scandeps-perl.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
checks:
has_scandeps_cve:
apt:
libmodule-scandeps-perl:
# Oracular
- min: '1.35-1'
- max: '1.35-1'
# Noble
- min: '1.35-1'
- max: '1.35-1'
# Jammy
- min: '1.31-1'
- max: '1.31-1'
# Focal
- min: '1.27-1'
- max: '1.27-1'
# Bionic
- min: '1.24-1'
- max: '1.24-1'
# Xenial
- min: '1.20-1'
- max: '1.20-1'
conclusions:
scandeps_cve:
decision: has_scandeps_cve
raises:
type: MitreCVE
cve-id: CVE-2024-10224
message: >-
Installed package '{package}' with version {version} has a known
security vulnerability (CVE-2024-10224). Please upgrade to the
latest version to get the fix.
format-dict:
package: '@checks.has_scandeps_cve.requires.package'
version: '@checks.has_scandeps_cve.requires.version'
35 changes: 35 additions & 0 deletions hotsos/defs/scenarios/system/cve-needrestart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
checks:
has_needrestart_cve:
apt:
needrestart:
# Oracular
- min: '3.6-8'
- max: '3.6-8ubuntu4'
# Noble
- min: '3.6-7'
- max: '3.6-7ubuntu4.1'
# Jammy
- min: '3.5-5'
- max: '3.5-5ubuntu2.1'
# Focal
- min: '3.4-6'
- max: '3.4-6ubuntu0.1'
# Bionic
- min: '3.1-1'
- max: '3.1-1ubuntu0.1'
# Xenial
- min: '2.6-1'
- max: '2.6-1'
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just wanted to make sure having all these releases here is actually useful before merging.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

doesnt hurt to have them.

conclusions:
needrestart_cve:
decision: has_needrestart_cve
raises:
type: MitreCVE
cve-id: CVE-2024-48990
message: >-
Installed package '{package}' with version {version} has a known
security vulnerability (CVE-2024-48990). Please upgrade to the
latest version to get the fix.
format-dict:
package: '@checks.has_needrestart_cve.requires.package'
version: '@checks.has_needrestart_cve.requires.version'
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
target-name: cve-libmodule-scandeps-perl.yaml
data-root:
files:
sos_commands/dpkg/dpkg_-l: |
ii libmodule-scandeps-perl 1.31-1ubuntu0.1 all
copy-from-original:
- sos_commands/date/date
- uptime
raised-bugs: # none expected
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
data-root:
files:
sos_commands/dpkg/dpkg_-l: |
ii libmodule-scandeps-perl 1.31-1 all
copy-from-original:
- sos_commands/date/date
- uptime
raised-bugs:
https://www.cve.org/CVERecord?id=CVE-2024-10224: >-
Installed package 'libmodule-scandeps-perl' with version 1.31-1 has a known
security vulnerability (CVE-2024-10224). Please upgrade to the
latest version to get the fix.
9 changes: 9 additions & 0 deletions hotsos/defs/tests/scenarios/system/cve-needrestart-false.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
target-name: cve-needrestart.yaml
data-root:
files:
sos_commands/dpkg/dpkg_-l: |
ii needrestart 3.5-5ubuntu2.2 all
copy-from-original:
- sos_commands/date/date
- uptime
raised-bugs: # none expected
12 changes: 12 additions & 0 deletions hotsos/defs/tests/scenarios/system/cve-needrestart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
data-root:
files:
sos_commands/dpkg/dpkg_-l: |
ii needrestart 3.5-5ubuntu2.1 all
copy-from-original:
- sos_commands/date/date
- uptime
raised-bugs:
https://www.cve.org/CVERecord?id=CVE-2024-48990: >-
Installed package 'needrestart' with version 3.5-5ubuntu2.1 has a known
security vulnerability (CVE-2024-48990). Please upgrade to the
latest version to get the fix.
Loading