Fix osquery detection of vscode extensions (#33523)

<!-- Add the related story/sub-task/bug number, like Resolves #123, or
remove if NA -->
**Related issue:** Resolves #33520 

Recent changes to the users query accidentally introduced an ambiguous
column error with the vscode extensions query. Fixed the SELECT
statement in vscode_extensions to properly account for this

No changes file added since this is an unreleased bug and the feature
has a changes file

# Checklist for submitter

If some of the following don't apply, delete the relevant line.

- [x] Changes file added for user-visible changes in `changes/`,
`orbit/changes/` or `ee/fleetd-chrome/changes`.
See [Changes
files](https://github.com/fleetdm/fleet/blob/main/docs/Contributing/guides/committing-changes.md#changes-files)
for more information.

- [x] Input data is properly validated, `SELECT *` is avoided, SQL
injection is prevented (using placeholders for values in statements)
- [x] If paths of existing endpoints are modified without backwards
compatibility, checked the frontend/CLI for any necessary changes

## Testing

No automated tests in this area so no tests to update/add

- [x] Added/updated automated tests
- [x] Where appropriate, [automated tests simulate multiple hosts and
test for host
isolation](https://github.com/fleetdm/fleet/blob/main/docs/Contributing/reference/patterns-backend.md#unit-testing)
(updates to one hosts's records do not affect another)

- [x] QA'd all new/changed functionality manually

For unreleased bug fixes in a release candidate, one of:

- [x] Confirmed that the fix is not expected to adversely impact load
test results
This commit is contained in:
Jordan Montgomery
2025-09-26 15:22:45 -04:00
committed by GitHub
parent 7f0be5a084
commit cfbc9d8829
2 changed files with 6 additions and 4 deletions
@@ -944,7 +944,7 @@ SELECT
name,
version,
'' AS bundle_identifier,
uuid AS extension_id,
vscode_extensions.uuid AS extension_id,
'' AS browser,
'vscode_extensions' AS source,
publisher AS vendor,
+5 -3
View File
@@ -979,7 +979,7 @@ SELECT
name,
version,
'' AS bundle_identifier,
uuid AS extension_id,
vscode_extensions.uuid AS extension_id,
'' AS browser,
'vscode_extensions' AS source,
publisher AS vendor,
@@ -1815,8 +1815,10 @@ const (
archKernelName = `^linux(?:-(?:lts|zen|hardened))?$`
)
var kernelRegex = regexp.MustCompile(linuxImageRegex)
var archKernelRegex = regexp.MustCompile(archKernelName)
var (
kernelRegex = regexp.MustCompile(linuxImageRegex)
archKernelRegex = regexp.MustCompile(archKernelName)
)
func directIngestSoftware(ctx context.Context, logger log.Logger, host *fleet.Host, ds fleet.Datastore, rows []map[string]string) error {
var software []fleet.Software