Skip to content

Allow Users to Override help: markdown SARIF ouput in custom rules #697

Closed

Description

Is your feature request related to a problem? Please describe.

There is not currently a way to modify the help: markdown: value in the SARIF. This refers to the text that will be displayed at the bottom of a GitHub Code Scanning alert (screenshot below). This value also refers to a hard coded to a link that points to the DevSkim repo. We cannot override this through the DevSkim tool itself, the rule, or actions options.

Image

Describe the solution you'd like
Allow this field to be customizable through the devskim custom rule syntax.

Describe alternatives you've considered
We have considered implementing some sort of post-processing of the SARIF to enable the behavior we expect, but this seems brittle.

Additional context
The rule we tested this is run with the following general architecture:

  • Devskim action
  • Devskim custom rules in an NPM package
  • Run devskim through the devskim actions workflow

Activity

  1. gfs commented on Jul 29, 2025

    @gfs
    Contributor

    Ah, I see this issue. We are setting the Text value in the Sarif based on the rule configured recommendation or description but the Markdown value is always left generic like so:

    // If recommendation is present use that, otherwise use description if present, otherwise use the HelpUri
    Text = !string.IsNullOrEmpty(devskimRule.Recommendation) ? devskimRule.Recommendation :
    (!string.IsNullOrEmpty(devskimRule.Description) ? devskimRule.Description : $"Visit {helpUri} for guidance on this issue."),
    Markdown = $"Visit [{helpUri}]({helpUri}) for guidance on this issue."

    I should be able to make a quick fix for that. After which the best value to populate to have the string you want show up in the Sarif would be the Recommendation field of the rule specification:

    [JsonProperty(PropertyName = "recommendation")]
    [JsonPropertyName("recommendation")]
    public string? Recommendation { get; set; }

    For example:

    "recommendation": "Review to ensure that a TLS protocol agility is maintained.",

  2. added 2 commits that reference this issue on Jul 29, 2025
    061d3bb
    594266a
  3. added a commit that references this issue on Jul 30, 2025
    c93fbb0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions