Skip to content

feat: add SearchPath rule coverage - #1175

Open
w3lld1 wants to merge 4 commits into
mandiant:masterfrom
w3lld1:feat/searchpath-rule
Open

feat: add SearchPath rule coverage#1175
w3lld1 wants to merge 4 commits into
mandiant:masterfrom
w3lld1:feat/searchpath-rule

Conversation

@w3lld1

@w3lld1 w3lld1 commented Jul 29, 2026

Copy link
Copy Markdown

Summary

I added a nursery rule that identifies calls to the Windows SearchPath API. The base API feature covers both SearchPathA and SearchPathW while keeping the rule concise.

Validation

  • python scripts/capafmt.py --check rules/nursery/search-for-file-via-searchpath.yml
  • python scripts/lint.py --thorough -t "search for file via SearchPath" -v rules/
  • Verified capa's API symbol normalization maps both SearchPathA and SearchPathW to kernel32.SearchPath
  • git diff --check

The full corpus CI suite was not run locally because it requires the separate capa-testfiles corpus; I left that validation to CI.

Fixes #1174

@google-cla

google-cla Bot commented Jul 29, 2026

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@w3lld1

w3lld1 commented Jul 29, 2026

Copy link
Copy Markdown
Author

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

Signed

@mike-hunhoff mike-hunhoff left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thank you @w3lld1 , I've left a few comments for your review. We can merge when those are addressed, assuming CI passes.

Comment thread nursery/search-for-file-via-searchpath.yml Outdated
Comment thread nursery/search-for-file-via-searchpath.yml Outdated
Comment thread nursery/search-for-file-via-searchpath.yml Outdated
@w3lld1

w3lld1 commented Jul 29, 2026

Copy link
Copy Markdown
Author

Thanks — addressed all three review comments in 48bac900:

  • renamed the rule to “search for file via WinAPI”;
  • kept the canonical SearchPathA reference;
  • generalized the API feature to SearchPath.

Fresh validation:

  • focused YAML structure assertions;
  • git diff --check.

@mike-hunhoff mike-hunhoff left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

One last quick change before merge, assuming CI passes.

Comment thread nursery/search-for-file-via-searchpath.yml Outdated
@w3lld1

w3lld1 commented Jul 29, 2026

Copy link
Copy Markdown
Author

Addressed the final suggestion in b48d8076 by removing the reference block. I rechecked the YAML structure and git diff --check.

@mike-hunhoff

Copy link
Copy Markdown
Collaborator

@w3lld1 CI if failing:

    (nursery)  search for file via WinAPI
      WARN: filename doesn't match the rule name: Rename rule file to match the 
rule name, expected: "search-for-file-via-winapi.yml", found: 
"search-for-file-via-searchpath.yml"

Please address and ensure lints are passing locally before requesting another review.

@w3lld1

w3lld1 commented Aug 1, 2026

Copy link
Copy Markdown
Author

Thanks — renamed the rule file to search-for-file-via-winapi.yml in 2f8c3c4. I verified that the YAML parses, the normalized rule name matches the filename, and git diff --check passes.

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.

add rule coverage for SearchPathA/W

2 participants