Skip to content

Add Apache Camel Advisories #1792

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

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

kunalsz
Copy link

@kunalsz kunalsz commented Mar 2, 2025

In reference to the issue #1515

Changes Made:

  • Apache Camel Advisory Pipeline added
  • Test written

kunalsz added 2 commits March 2, 2025 16:46
Signed-off-by: kunalsz <[email protected]>
@kunalsz kunalsz changed the title Added Apache Camel Pipeline Add Apache Camel Advisories Mar 26, 2025
Copy link
Member

@keshav-space keshav-space left a comment

Choose a reason for hiding this comment

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

Thanks @kunalsz, see some suggestions and feedback.

Comment on lines +44 to +45
def __init__(self):
super().__init__()
Copy link
Member

Choose a reason for hiding this comment

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

Any reason why we need this? I'm curious, is there something peculiar about the Apache Camel importer that requires it here, but not in the OpenSSL importer here https://github.com/aboutcode-org/vulnerablecode/blob/e2f03f59c276b5ca9554153f2b06da49ead0a889/vulnerabilities/pipelines/openssl_importer.py

return advisory_len


def fetch_advisory_data(url):
Copy link
Member

Choose a reason for hiding this comment

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

It would be much cleaner and easier to parse advisory from text data. See example https://camel.apache.org/security/CVE-2023-34442.txt.asc

Copy link
Author

Choose a reason for hiding this comment

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

Currently the advisories are fetched by parsing the html table. It is easier to parse the fixed rows and columns. In the text data we'll have to use regex to find the correct line corresponding to our need.

Comment on lines +247 to +249
fixed_versions = []
for fixed_version in version_pattern.findall(fixed_version_out):
fixed_versions.append(MavenVersion(fixed_version))
Copy link
Member

Choose a reason for hiding this comment

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

Strange, you’re collecting the fixed versions but not including them in the final AdvisoryData.

Copy link
Author

Choose a reason for hiding this comment

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

I must have neglected it by mistake, I'll include that too

package=PackageURL(
type="maven",
namespace="org.apache.camel",
name="camel",
Copy link
Member

Choose a reason for hiding this comment

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

Component is not always camel. For example, in this advisory https://camel.apache.org/security/CVE-2023-34442.html component is camel-jira.

Copy link
Author

Choose a reason for hiding this comment

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

@keshav-space Yes,you are right about that. There are various components for camel but they are not specified in an easier to parse fashion atleast on the advisory page/text file atleast. For example

Same goes for other advisories also, the component is more exclusively defined on https://issues.apache.org/jira/browse/CAMEL-{ID}. So, should I parse the component from there ?

return response["cveMetadata"]["datePublished"]


def parse_apache_camel_versions(version_string):
Copy link
Member

Choose a reason for hiding this comment

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

This parse function doesn't work correctly. For example, given the affected package statement 2.15.0 up to 2.15.4, 2.16.0 function will produces vers:maven/2.15.0|2.15.4|2.16.0 which is not correct version range.

Copy link
Author

Choose a reason for hiding this comment

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

I'll update the parsing logic

@kunalsz
Copy link
Author

kunalsz commented Apr 17, 2025

@keshav-space Thanks for the review, I'll make the necessary changes and update you.

@kunalsz
Copy link
Author

kunalsz commented Apr 21, 2025

@keshav-space I have update the version parsing logic and it works fine. But I have a doubt on how to incorporate fixed_version in the affected_package

For example:

  • For the affected version string 2.22.x, 2.23.x, 2.24.x, 2.25.x, 3.0.0 up to 3.1.0 the fixed version string is 3.2.0
  • affected string 3.0.0 up to 3.14.5, and 3.15.0 up to 3.18.3, and 3.19.0. fixed string : 3.14.6, 3.18.4 . Here what should be the fixed version for 3.19.0 ? Or should I leave it empty ?
  • Similary in 2.22.x, 2.23.x, 2.24.x, 2.25.0 and 2.25.1, 3.0.0 up to 3.3.0 for which fixed string is 2.25.2, 3.4.0.
  • And lastly the latest affected strings are like Apache Camel 4.10.0 before 4.10.3. Apache Camel 4.8.0 before 4.8.6. for which fixed strings are given in reverse making it tedious to get the fixed version 4.8.6 and 4.10.3

Looking forward to your insights !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants