-
Notifications
You must be signed in to change notification settings - Fork 73
Fix: Update parsing of CVE issue title to use regex-based extraction #151
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
Conversation
Updated parsing flow: - Extracts leading CVE block and description, - Parses CVEs only from the leading block. - Raises LookupError when leading CVE block is not found. Signed-off-by: arivappa <4rivappa@proton.me>
mtardy
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey, thanks a lot for that!!
Exception
Raises a LookupError if the title does not start with a valid CVE block.
This will fail the whole fetch-cve-feed.sh bash script run.Example:
Traceback (most recent call last):
File "/workspaces/sig-security/sig-security-tooling/cve-feed/hack/fetch-official-cve-feed.py", line 108, in
cve_ids, description = parse_cve_title(item['title'])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/workspaces/sig-security/sig-security-tooling/cve-feed/hack/fetch-official-cve-feed.py", line 32, in parse_cve_title
raise LookupError(f"Title does not start with CVE block: {title}")
LookupError: Title does not start with CVE block:
Looks nice but if we can just warn instead of fail since it would just be a "one entry issue", and return a non zero error code (so that prow generates a warn email) that would be perfect.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
Thanks a lot, this looks better, Tabitha updated some of the titles of the issues so now the diff looks like this:
361c361
< "summary": "Bypass of seccomp profile enforcement ",
---
> "summary": "Bypass of seccomp profile enforcement",
881c881
< "summary": "`kubectl:-http-cache=<world-accessible dir>` creates world-writeable cached schema files",
---
> "summary": "`kubectl --http-cache=<world-accessible dir>` creates world-writeable cached schema files",Next step would be to print to stderr information about the non_parsable_cve_list so that we can debug this further easily. Thank you!
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: 4rivappa, mtardy The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Description
This update replaces the parsing logic with a regex-based approach that:
Resolves #145
Differences between prev JSON and newly generated JSON
Exception
Raises a
LookupErrorif the title does not start with a valid CVE block.This will fail the whole
fetch-cve-feed.shbash script run.Example: