Add boolean-expression rules now that ApplicationInspector 1.10.2 fixes the verifier
@gfs is already working on this.
Since Sep 10, 2026.
- #786 by @copilot-swe-agent — closed without merging
- Dominant language
- C#
- Stars
- 1k
- Forks
- 131
- Avg merge
- 1m
- Merged PRs (30d)
- 1
Description
Follow-up to #780, which closed a set of SDL coverage gaps but deliberately left out the boolean-expression rules.
Why this was deferred
ApplicationInspector 1.10.1 shipped boolean expression support, but a rule supplying both expression and conditions behaved correctly at scan time while the rule verifier reported its must-not-match samples as failures. DefaultRulesTests.ValidateDefaultRules runs that verifier, so a correct rule could not merge, and writing rules that break CI was not worth doing.
That is fixed in ApplicationInspector 1.10.2 by ApplicationInspector#656, which moves the capture reduction into a shared CaptureFilter so the verifier and the analyzer answer the same question. 1.10.2 is published.
Work
Branch gfs-sdl-boolean-expression-rules is pushed and stacked on #780. It contains HANDOFF-boolean-expression-rules.md with the full detail; summary:
- Bump
Microsoft.CST.ApplicationInspector.RulesEngineand...Loggingfrom 1.10.1 to 1.10.2. - Confirm the verifier fix is real before building on it. The handoff note gives a rule that fails under 1.10.1 and should pass under 1.10.2. If it still fails, stop.
- Apply the merged
DS440016, given in full in the handoff. It collapses the two same-ID entries intls_generic.jsoninto one rule via(curlFlag AND NOT tls13) OR p0 OR ..., retiring a duplicate ID. This was built and reviewed already; it just had nowhere to live. - Write the soundness-gap rules. The old shape can only express
P AND NOT (C0 OR C1), meaning "no mitigation at all", where cookie flags and HSTS needP AND NOT (C0 AND C1), meaning "any required mitigation missing". The partially hardened case is what is currently missed: a cookie withSecurebut noHttpOnlyis a real finding DevSkim cannot report. - Consider tightening
DS132784(Java XXE) from file scope to factory scope, which would justify raising it aboveManualReview. - Changelog entry, and delete the handoff file.
Note on environment
This needs to run somewhere with access to the package feed. The machine the original work was done on could reach neither nuget.org nor the configured Azure DevOps feed, which is why 1.10.2 could not simply be picked up there. Codespaces or any environment with normal restore access is fine.
Worth knowing before starting
Two findings from the original investigation that are easy to lose time on:
- Boolean operators over pattern labels alone are nearly useless. A finding comes from exactly one pattern, so at any finding every other pattern label is false.
a AND bis rejected outright,a AND NOT bis identical to plaina, anda XOR bis identical toa OR b. All the real expressiveness needs patterns and conditions in the same expression. - When testing with ApplicationInspector's own CLI, filter SARIF results by rule ID. Its output includes findings from its built-in rules, and ordinary test content like
curl http://xtrips several. "The SARIF has results" is not evidence your rule matched.
The handoff file also covers the hand-maintained <EmbeddedResource> allowlist, expression syntax constraints, and the nbgv-derived changelog heading.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.