Skip to content

Commit

Permalink
Adds checker for CVE-2024-3250 (canonical#812)
Browse files Browse the repository at this point in the history
Resolves: canonical#811
  • Loading branch information
sombrafam authored May 8, 2024
1 parent b9b0147 commit 541a407
Show file tree
Hide file tree
Showing 7 changed files with 82 additions and 0 deletions.
5 changes: 5 additions & 0 deletions examples/hotsos-example-juju.short.summary.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,8 @@ potential-issues:
JujuWarnings:
- Juju logs for unit(s) 'nova-compute/0' contain 24 Traceback(s) from the last
48 hours - please check.
bugs-detected:
juju:
https://www.cve.org/CVERecord?id=CVE-2024-3250: This host is running a version
of Juju (2.9.22) that is affected by a known security vulnerability. Please
upgrade to the latest version to get the fix.
4 changes: 4 additions & 0 deletions examples/hotsos-example-juju.summary.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@ juju:
update-status:
logger.go:
'2022-02-10': 195
bugs-detected:
https://www.cve.org/CVERecord?id=CVE-2024-3250: This host is running a version
of Juju (2.9.22) that is affected by a known security vulnerability. Please
upgrade to the latest version to get the fix.
potential-issues:
JujuWarnings:
- Juju logs for unit(s) 'nova-compute/0' contain 24 Traceback(s) from the last
Expand Down
11 changes: 11 additions & 0 deletions hotsos/core/issues/issue_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,17 @@ def url(self):
return "{}{}".format(self.base_url, self.id)


class MitreCVE(CVETypeBase):

@property
def base_url(self):
return 'https://www.cve.org/CVERecord?id='

@property
def url(self):
return "{}{}".format(self.base_url, self.id)


class LaunchpadBug(BugTypeBase):

@property
Expand Down
25 changes: 25 additions & 0 deletions hotsos/defs/scenarios/juju/juju_binary_cve.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
checks:
has_affected_juju_binary:
binary:
handler: hotsos.core.plugins.juju.JujuBinaryInterface
juju:
- min: '1.0.0'
max: '2.9.49'
- min: '3.0.0'
max: '3.1.8'
- min: '3.2.0'
max: '3.3.4'
- min: '3.4.0'
max: '3.4.2'
conclusions:
juju_binary_cve:
decision: has_affected_juju_binary
raises:
type: MitreCVE
cve-id: CVE-2024-3250
message: >-
This host is running a version of Juju ({version}) that is
affected by a known security vulnerability. Please upgrade
to the latest version to get the fix.
format-dict:
version: '@checks.has_affected_juju_binary.requires.version'
18 changes: 18 additions & 0 deletions hotsos/defs/scenarios/juju/juju_pebble_cve.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
checks:
has_affected_pebble_snap:
snap:
pebble:
- min: 646
max: 646
conclusions:
pebble_cve:
decision: has_affected_pebble_snap
raises:
type: MitreCVE
cve-id: CVE-2024-3250
message: >-
This host is running a version of Pebble ({revision}) that is
affected by a known security vulnerability. Please upgrade
to the latest version to get the fix.
format-dict:
revision: '@checks.has_affected_pebble_snap.requires.revision'
10 changes: 10 additions & 0 deletions hotsos/defs/tests/scenarios/juju/juju_binary_cve.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
mock:
patch:
hotsos.core.plugins.juju.resources.JujuBinaryInterface.get_version:
kwargs:
return_value: 3.4.1
raised-bugs:
https://www.cve.org/CVERecord?id=CVE-2024-3250: >-
This host is running a version of Juju (3.4.1) that is
affected by a known security vulnerability. Please upgrade
to the latest version to get the fix.
9 changes: 9 additions & 0 deletions hotsos/defs/tests/scenarios/juju/juju_pebble_cve.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
data-root:
files:
sos_commands/snap/snap_list_--all: |
pebble v1.10.2 646 latest/stable canonical** classic
raised-bugs:
https://www.cve.org/CVERecord?id=CVE-2024-3250: >-
This host is running a version of Pebble (646) that is
affected by a known security vulnerability. Please upgrade
to the latest version to get the fix.

0 comments on commit 541a407

Please sign in to comment.