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

Message string for each result in SARIF report. #199

Open
yongyan-gh opened this issue Nov 15, 2021 · 1 comment
Open

Message string for each result in SARIF report. #199

yongyan-gh opened this issue Nov 15, 2021 · 1 comment
Labels
enhancement New feature or request

Comments

@yongyan-gh
Copy link
Contributor

yongyan-gh commented Nov 15, 2021

Please consider creating message strings for each instance of a rule violation (result).
A message string should contain enough information to enable a user to resolve the problem. It can include dynamic information indicates the instance of a rule violation. e.g. "{0} in the '{1}' organization’s '{2}' project are currently exposed to builds for repository forks."
A tutorial about message string can be found at https://github.com/microsoft/sarif-tutorials/blob/main/docs/Authoring-rule-metadata-and-result-messages.md#message-strings

Related Issue: #33

@VeraBE VeraBE added this to the Committed Backlog milestone Nov 15, 2021
@VeraBE VeraBE added the enhancement New feature or request label Nov 15, 2021
@JohnathonMohr
Copy link
Contributor

PowerShell results especially don't play well with SARIF right now because we're limited by the strings the ARM TTK outputs for descriptions, and the SARIF writer assumes each rule will have a standard description that's constant for all violations, in addition to a possible instance-specific message for failures.

  • The JSON rules have a standard description that's the same for all rules, but lacks instance-specific messaging.
  • The TTK has instance-specific messaging, but no standard description (failures simply write to the console output, and BPA captures those messages, which contain details of the specific failures).
    • This means the first violation of a given PowerShell rule becomes the "standard description" for all other violations, which is really confusing when the description contains mentions of specific items in the template that only apply to the first violation.

Some thought is needed in designing a messaging system that will work for rules in general (JSON rules can use it immediately). The PowerShell rule messaging can be updated to work properly once a proper PowerShell engine is implemented (that isn't just a wrapper around TTK).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants