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: use relative workflow paths in SARIF output #77

Merged
merged 1 commit into from
Oct 29, 2024

Conversation

woodruffw
Copy link
Owner

Fixes #57.

Example single SARIF location output with this change:

{
  "logicalLocations": [
    {
      "properties": {
        "symbolic": {
          "annotation": "does not set persist-credentials: false",
          "name": "artipacked.yml",
          "route": {
            "components": [
              {
                "Key": "jobs"
              },
              {
                "Key": "vulnerable-1"
              },
              {
                "Key": "steps"
              },
              {
                "Index": 0
              }
            ]
          }
        }
      }
    }
  ],
  "message": {
    "text": "does not set persist-credentials: false"
  },
  "physicalLocation": {
    "artifactLocation": {
      "uri": ".github/workflows/artipacked.yml",
      "uriBaseId": "%SRCROOT%"
    },
    "region": {
      "endColumn": 80,
      "endLine": 37,
      "snippet": {
        "text": "name: Checkout\n        uses: actions/checkout@v4\n\n      # NOT OK: upload-artifact archives entire repo, including persisted creds"
      },
      "sourceLanguage": "yaml",
      "startColumn": 9,
      "startLine": 34
    }
  }
}

(Observe that logicalLocations is still just the filename, but physicalLocations contains the appropriate relative path.)

@woodruffw woodruffw merged commit e331bfe into main Oct 29, 2024
4 checks passed
@woodruffw woodruffw deleted the ww/fix-sarif-paths branch October 29, 2024 22:41
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.

GHA security report cannot show preview
1 participant