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

feat(general): leverage SARIF helpUri for guideline and SCA link #3492

Merged
merged 2 commits into from
Sep 18, 2022

Conversation

gruebel
Copy link
Contributor

@gruebel gruebel commented Sep 8, 2022

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Description

Fixes #3432

  • Depending on what kind of record it is, it will use either the guideline link or the CVE link to fill in the helpUri field

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my feature, policy, or fix is effective and works
  • New and existing tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

@gruebel gruebel merged commit 4694ead into bridgecrewio:master Sep 18, 2022
@gruebel gruebel deleted the adjust-sarif-output branch September 18, 2022 15:09
help_uri = record.guideline
if record.vulnerability_details:
# use the CVE link, if it is a SCA record
help_uri = record.vulnerability_details.get("link")
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this guaranteed to not end up with the help_uri being empty? That is forbidden by the same spec.

Copy link
Contributor

Choose a reason for hiding this comment

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

@ankon That's a good catch, thanks! Would you like to contribute a short PR to fix this case? 😄
@gruebel FYI

Copy link
Contributor

Choose a reason for hiding this comment

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

Tried, but my python is rusty: #3542

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.

For sarif output, add helpUri property to rules
4 participants