Skip to content

fix(software): skip executables of listed programs, Windows components and uninstallers in the Program Files scan CU-17tkuw67w42 - #270

Merged
aliaska-varieva merged 4 commits into
mainfrom
fix/program-files-scan-duplicates
Nov 30, 2026
Merged

aliaska-varieva merged 4 commits into
mainfrom
fix/program-files-scan-duplicates

Report third-party executables under Common Files CU-17tkuw67w42

a014e27
Select commit
Loading
Failed to load commit list.
Flamingo / Flamingo Code Review completed Nov 30, 2026 in 0s

Flamingo Code Review: neutral

2 findings: 🔴 0 action required · 🟠 0 recommended · 🔵 2 informational

Advisory: findings do not block the merge.

  • 🔵 Informational · info · Minor · server/service/osquery_utils/queries.go:1946: programFilesScanDirs ignores Program Files (x86), so the new skip/folder-name dedup never applies to 32-bit installs
  • 🔵 Informational · info · Minor · FLEETMDM-001 · server/service/osquery_utils/queries.go:1764: OPENFRAME sentinel in queries.go omits the required openframe/docs/.md reference

Annotations

Check notice on line 1953 in server/service/osquery_utils/queries.go

See this annotation in the file changed.

@flamingo flamingo / Flamingo Code Review

programFilesScanDirs ignores Program Files (x86), so the new skip/folder-name dedup never applies to 32-bit installs

programFilesScanDirs ignores Program Files (x86), so the new skip/folder-name dedup never applies to 32-bit installs

programFilesScanDirs only cuts on the literal `\program files\`. Paths under `C:\Program Files (x86)\...` do not contain that substring (they contain `\program files (x86)\`), so the function returns nil for every 32-bit install. Both new behaviours added in this diff depend on it: skipProgramFilesScanExe (queries.go:1930) returns false for all x86 paths, and the knownNames folder-name dedup loop (queries.go:1818) iterates over an empty slice. The surrounding upstream code explicitly treats both roots as equivalent (skipInstallPaths lists `\program files\` and `\program files (x86)\` at lines 1760-1761), so the asymmetry is unintended: `C:\Program Files (x86)\Internet Explorer\iexplore.exe` and x86 uninstaller-adjacent Windows component exes are still reported, and x86 apps without install_location still produce duplicate inventory rows.

**What it risks:** Hosts with 32-bit applications keep getting duplicated software entries and spurious Windows-component entries in inventory, the exact problem this change is meant to fix.

**How to fix:** Try both Program Files roots when cutting the path prefix.

Check notice on line 1764 in server/service/osquery_utils/queries.go

See this annotation in the file changed.

@flamingo flamingo / Flamingo Code Review

OPENFRAME sentinel in queries.go omits the required openframe/docs/<doc>.md reference

OPENFRAME sentinel in queries.go omits the required openframe/docs/<doc>.md reference

FLEETMDM-001 requires the opening sentinel in a shared upstream file to be of the form `// >>> OPENFRAME(<slug>): <why> — openframe/docs/<doc>.md`. The block opened at line 1764 of server/service/osquery_utils/queries.go (an upstream fleetdm/fleet file) carries a slug and a rationale but points at an upstream issue (`upstream fleetdm/fleet#59098`) instead of a fork doc under `openframe/docs/`. The same omission applies to the later blocks in this diff (lines ~1770, ~1797, ~1816, ~1892), which carry only `// >>> OPENFRAME(program-files-scan-duplicates)` with no why and no doc path.

**What it risks:** Upstream sync tooling and future maintainers cannot find the fork rationale document for this divergence, so the logic may be dropped or silently re-conflicted on the next fleetdm/fleet merge.

**How to fix:** Add the `openframe/docs/<doc>.md` reference to the opening sentinel (and create/point to that doc), keeping the upstream issue link as additional context.