Skip to content
This repository has been archived by the owner on Sep 4, 2020. It is now read-only.

Use uriBaseId to specify root for relative urls #7

Open
prabhu opened this issue Jan 14, 2020 · 1 comment
Open

Use uriBaseId to specify root for relative urls #7

prabhu opened this issue Jan 14, 2020 · 1 comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@prabhu
Copy link
Contributor

prabhu commented Jan 14, 2020

For some tools that generate relative urls such as gitleaks, pmd the code auto-prefixes workspace for each result to make the location absolute. As per SARIF specification, it should be possible to specify uriBaseId and retain relative urls.

https://docs.oasis-open.org/sarif/sarif/v2.1.0/cs01/sarif-v2.1.0-cs01.html#_Toc16012377 - section 3.4.14

This should also improve performance by a few seconds since we dont have to do things like this.

https://github.com/AppThreat/sast-scan/blob/master/lib/convert.py#L261
https://github.com/AppThreat/sast-scan/blob/master/lib/xml_parser.py#L50

@prabhu prabhu added good first issue Good for newcomers help wanted Extra attention is needed enhancement New feature or request labels Jan 14, 2020
@prabhu
Copy link
Contributor Author

prabhu commented Jan 17, 2020

Example:

"originalUriBaseIds": {
        "PROJECTROOT": {
          "uri": "file://build.example.com/work/"
        },
        "SRCROOT": {
          "uri": " src/",
          "uriBaseId": "PROJECTROOT"
        },
        "BINROOT": {
          "uri": " bin/",
          "uriBaseId": "PROJECTROOT"
        }
}

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant