Skip to content

Conversation

@allamiro
Copy link

This PR fixes an issue in BuildRulesForFilesInWritableDirectories.ps1 where publisher rule keys were incorrectly rebuilt when binary name granularity was enabled.

Problem

When PubRuleGranularity is set to pubProductBinary (default) or
pubProdBinVer, the key used for de-duplication is reset instead of appended:

$key = "|" + $pubInfo.BinaryName

This discards the existing publisher and product components, causing different binaries with the same name (in different directories or with different versions/publishers) to collide. As a result, only one DLL is kept. This matches the behavior reported in Issue #43.

Fix

Replace key reassignment with concatenation: and allows multiple binaries with the same name to be processed correctly.

Impact

  • Fixes missing rules for duplicated DLL names in different folders
  • Affects only key construction logic
  • No behavior change for lower-granularity modes

Fixes #43

- Introduced -VirusTotalLookup switch to query VirusTotal API for SHA256 hashes of unsigned files.
- Added -VirusTotalApiKey parameter for API key input, with prompts for user input if not provided.
- Implemented functions for hash normalization and API querying, including error handling and rate limiting.
- Enhanced output to include VirusTotal threat intelligence data in the "Unsigned file info" worksheet.
@allamiro
Copy link
Author

@microsoft-github-policy-service agree

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.

BuildRulesForFilesInWritableDirectories.ps1 issue

1 participant