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

SARIF Results don't show container image name #315

Open
mat-sylvia-mark43 opened this issue Feb 29, 2024 · 1 comment
Open

SARIF Results don't show container image name #315

mat-sylvia-mark43 opened this issue Feb 29, 2024 · 1 comment

Comments

@mat-sylvia-mark43
Copy link

mat-sylvia-mark43 commented Feb 29, 2024

When outputting scans to a SARIF, and subsequently uploading this to Github Advanced Security, the code scanning alert doesn't show the image name and tag. This makes it a bit cumbersome to determine what the alert is for. A path is shown, but not to the dockerfile or anything that aids in determining the corresponding image name+tag in a meaningful way.

@austimkelly
Copy link

I presume you mean the locations dictionary and the uri pointing to the build cache?

"locations": [
            {
              "physicalLocation": {
                "artifactLocation": {
                  "uri": "root/.cache/pypoetry/virtualenvs/ghast-VsnhxLU2-py3.10/lib/python3.10/site-packages/cryptography-37.0.4.dist-info/METADATA",
                  "uriBaseId": "ROOTPATH"
                },
                "region": {
                  "startLine": 1,
                  "startColumn": 1,
                  "endLine": 1,
                  "endColumn": 1
                }
              },

So IFF the originating package file (e.g. requirements.txt) is:

  1. touched so it is part of the PR and
  2. can be referenced by the build

The alert will never be part of the PR. You will just get several alerts someone will have to triage at a later time.

I made a little line mapper POC (just hard-coded to pyproject.toml) and it works in a basic demo. I'm not sure all the variations that would have to be considered to make this more robust though (i.e. can it scale?)

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

No branches or pull requests

2 participants