Skip to content

Conversation

@rperez-fo
Copy link

Description

Overwrite git@bitbucket.org 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, "git@bitbucket.org:"):
// build bitbucket url format
// e.g. `git@bitbucket.org: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, "git@bitbucket.org:", "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?

@github-actions
Copy link

This PR is stale because it has been labeled with inactivity.

@github-actions github-actions bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and will be auto-closed. label Apr 22, 2025
@github-actions github-actions bot closed this May 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lifecycle/stale Denotes an issue or PR has remained open with no activity and will be auto-closed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(sarif): check url before converting to string

3 participants