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

fix(report): handle [email protected] schema for misconfigs in sarif report #8399

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

rperez-fo
Copy link

Description

Overwrite [email protected] schema for misconfigs in sarif report.

Related issues

Related PRs

Checklist

  • I've read the guidelines for contributing to this repository.
  • I've followed the conventions in the PR title.
  • I've added tests that prove my fix is effective or that my feature works.
  • I've updated the documentation with the relevant information (if needed).
  • I've added usage information (if the PR introduces new options)
  • I've included a "before" and "after" example to the description (if the PR is a user interface change).

@rperez-fo rperez-fo requested a review from knqyf263 as a code owner February 13, 2025 17:15
@CLAassistant
Copy link

CLAassistant commented Feb 13, 2025

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


Ricardo Perez seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

Comment on lines +360 to +366
case strings.HasPrefix(s, "[email protected]:"):
// build bitbucket url format
// e.g. `[email protected]:terraform-aws-modules/terraform-aws-s3-bucket.git?ref=v4.2.0/main.tf` -> `bitbucket.org/terraform-aws-modules/terraform-aws-s3-bucket/src/v4.2.0/main.tf`
// cf. https://github.com/aquasecurity/trivy/issues/8154
s = strings.ReplaceAll(s, "[email protected]:", "bitbucket.org/")
s = strings.ReplaceAll(s, ".git", "")
s = strings.ReplaceAll(s, "?ref=", "/src/")
Copy link
Member

Choose a reason for hiding this comment

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

Maybe we can refactor this logic out into a function as it's also repeated with GitHub?

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.

fix(sarif): check url before converting to string
3 participants