Skip to content

Drop misleading "partialFingerprints required" check from ADO/GH rules#2893

Open
michaelcfanning wants to merge 1 commit into
mainfrom
mikefan/remove-partialfingerprints-required
Open

Drop misleading "partialFingerprints required" check from ADO/GH rules#2893
michaelcfanning wants to merge 1 commit into
mainfrom
mikefan/remove-partialfingerprints-required

Conversation

@michaelcfanning
Copy link
Copy Markdown
Member

Drop misleading "partialFingerprints required" check from ADO/GH rules

What

BaseProvideRequiredResultProperties (Base1015), the shared base for the four ProvideRequiredResultProperties validators (ADO1015, ADO1017, GH1015, GH1017), flagged any result missing partialFingerprints as an error against the Ado and Ghas rule kinds, with the message:

"This result object does not provide a partialFingerprints dictionary. This property is required by the {service} service."

That is required is wrong for both consumers.

Why

Advanced Security for Azure DevOps

  • The AdvancedSecurity-Publish task computes partialFingerprints automatically when a SARIF log omits them. (Integrate non-Microsoft scanning tools — Result fingerprint generation)
  • Sprint 245 added ruleId to the computed fingerprint inputs.
  • Sprint 255 added an explicit opt-in pipeline variable, advancedsecurity.publish.allowmissingpartialfingerprints, for URI-located findings (containers, DAST) where source-derived fingerprints don't apply.

GitHub code scanning

  • The upload-sarif action back-fills partialFingerprints from source when a SARIF log uploaded via that path omits them. (SARIF support for code scanning — Fingerprint generation)
  • They are recommended (not required) for direct /code-scanning/sarifs REST uploads, where back-filling does not occur, to avoid duplicate alerts.

AI producers

  • AI2011 already advises AI producers not to persist fingerprints, which is the opposite of what Base1015 was demanding. Producers should not be in the position of choosing which Multitool rule to violate.

The change

  • Base1015.ProvideRequiredResultProperties.cs — drop the result.PartialFingerprints == null check and its message-resource-list entry. Add a comment with the GHAZDO and GitHub doc citations.
  • RuleResources.resx / .Designer.cs — drop the Base1015_..._MissingPartialFingerprints_Text resource. Strip the "Provide the 'partialFingerprints' dictionary..." sentence from the ADO1015 and GH1015 FullDescription resource strings.
  • Test.FunctionalTests.Sarif/.../BaselineOption/ExpectedOutputs/TEST1001..TEST1008.*.sarif — regenerated via the framework's standard Rebaseline<suite>.cmd flow. The diff is exactly the disappearance of Error_MissingPartialFingerprints firings and the matching messageStrings / fullDescription text. All other rule firings, baselining behavior, and result counts are preserved.
  • ReleaseHistory.md — UNRELEASED entry.

The genuinely-required checks in Base1015 (message, message.text, locations array, non-empty locations) are kept. Only the stale partial-fingerprints check is removed.

Diff scope

 ReleaseHistory.md                              |   1 +
 Base1015.ProvideRequiredResultProperties.cs    |  16 +-
 RuleResources.Designer.cs                      |   9 -
 RuleResources.resx                             |  11 +-
 8 BaselineOption ExpectedOutputs *.sarif       | 3632 +-
 12 files changed, 26 insertions(+), 3643 deletions(-)

Verification

  • Sarif.Multitool.Library unit suite: 90/90 pass (1 pre-existing skip)
  • Sarif functional suite: 118/118 pass

The shared base class for the SARIF/ADO/GH "ProvideRequiredResultProperties"
validators (Base1015) flagged any result that omitted partialFingerprints as
an error against the ADO Advanced Security and GitHub Advanced Security
service rule kinds. The message text said the property "is required by the
{service} service." That is wrong for both consumers:

* Advanced Security for Azure DevOps computes partialFingerprints
  automatically when the AdvancedSecurity-Publish task ingests a SARIF log
  that omits them (and Sprint 255 added an explicit opt-in,
  advancedsecurity.publish.allowmissingpartialfingerprints, for findings
  that aren't located on source).

* GitHub code scanning back-fills partialFingerprints from source when a
  SARIF log uploaded via the upload-sarif action omits them. They are only
  recommended for direct REST uploads via /code-scanning/sarifs to avoid
  duplicate alerts.

Producers — particularly AI producers covered by AI2011 — have legitimate
reasons to omit partialFingerprints rather than fabricate identity values.
This change removes the partialFingerprints check from Base1015 entirely
so ADO1015/ADO1017 and GH1015/GH1017 no longer fire on omission. The
genuinely-required checks in the same base (message, message.text,
locations array, non-empty locations) are preserved.

Scope:
* Base1015.ProvideRequiredResultProperties.cs — remove the
  result.PartialFingerprints == null check and its message-resource list
  entry; add an explanatory comment with the GHAZDO and GH docs citations.
* RuleResources.resx / .Designer.cs — remove the
  Base1015_..._MissingPartialFingerprints_Text resource; remove the
  "Provide the 'partialFingerprints' dictionary..." sentence from the
  ADO1015 and GH1015 FullDescription resource strings.
* BaselineOption functional-test expected outputs (TEST1001-TEST1008) —
  regenerated via the test framework's standard rebaseline flow. The diff
  reflects only the disappearance of Error_MissingPartialFingerprints
  firings and the corresponding messageStrings / fullDescription text;
  all other rule firings, baselining behavior, and result counts are
  preserved.
* ReleaseHistory.md — UNRELEASED entry.

Verified: full Sarif.Multitool.Library unit suite (90/90) and full
Sarif functional suite (118/118) green after the change.

Co-authored-by: Copilot &lt;223556219+Copilot@users.noreply.github.com&gt;
Comment thread ReleaseHistory.md
# SARIF Package Release History (SDK, Driver, Converters, and Multitool)

## **UNRELEASED**
* BUGFIX: Drop the missing-`partialFingerprints` check from `BaseProvideRequiredResultProperties` (Base1015), which removes the firing for ADO1015/ADO1017 and GH1015/GH1017. Both Advanced Security for Azure DevOps and GitHub code scanning compute `partialFingerprints` automatically when omitted, so the `error`-level "this property is required by the {service} service" message was misleading. See [GHAZDO third-party SARIF docs](https://learn.microsoft.com/azure/devops/repos/security/github-advanced-security-code-scanning-third-party) (Sprint 245 `ruleId` inclusion, Sprint 255 `advancedsecurity.publish.allowmissingpartialfingerprints`) and [GitHub code scanning SARIF support — Fingerprint generation](https://docs.github.com/code-security/code-scanning/integrating-with-code-scanning/sarif-support-for-code-scanning#fingerprint-generation). AI producers are already advised against persisting fingerprints by AI2011.
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should be BUG and also check ordering, BUG doesn't usually come before BRK

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.

2 participants