Repository navigation
[Osquery_manager] Windows Amcache saved queries - #18121
Conversation
Vale Linting ResultsSummary: 4 warnings, 1 suggestion found
|
| File | Line | Rule | Message |
|---|---|---|---|
| packages/osquery_manager/artifacts_matrix.md | 35 | Elastic.Latinisms | Latin terms and abbreviations are a common source of confusion. Use 'using' instead of 'via'. |
| packages/osquery_manager/artifacts_matrix.md | 40 | Elastic.Latinisms | Latin terms and abbreviations are a common source of confusion. Use 'using' instead of 'via'. |
| packages/osquery_manager/artifacts_matrix.md | 41 | Elastic.Latinisms | Latin terms and abbreviations are a common source of confusion. Use 'using' instead of 'via'. |
| packages/osquery_manager/artifacts_matrix.md | 42 | Elastic.Latinisms | Latin terms and abbreviations are a common source of confusion. Use 'using' instead of 'via'. |
💡 Suggestions (1)
| File | Line | Rule | Message |
|---|---|---|---|
| packages/osquery_manager/artifacts_matrix.md | 40 | Elastic.WordChoice | Consider using 'open' instead of 'launch', unless the term is in the UI. |
The Vale linter checks documentation changes against the Elastic Docs style guide.
To use Vale locally or report issues, refer to Elastic style guide for Vale.
calladoum-elastic
left a comment
There was a problem hiding this comment.
minor comments, otherwise good
| "attributes": { | ||
| "created_at": "2026-03-27T00:00:00.000Z", | ||
| "created_by": "elastic", | ||
| "description": "Amcache Driver Packages: Enumerates driver package metadata from the Windows Amcache.hve registry hive (Root\\InventoryDriverPackage). Records package class, version, provider, directory, and associated hardware IDs. Links to both DeviceContainers and DevicePnPs for cross-referencing driver provenance. MITRE ATT&CK: T1014 (Rootkit), T1068 (Exploitation for Privilege Escalation).", |
There was a problem hiding this comment.
Records package class, version, provider, directory, and associated hardware IDs.
Those fields don't seem to be exposed to ES?
Also isn't this redundant with d55fb469-b20d-43aa-902a-f0e71cf036a6 ?
There was a problem hiding this comment.
Records package class, version, provider, directory, and associated hardware IDs.
Those fields don't seem to be exposed to ES?
Good catch — I've added ECS mappings for package.version → version and file.path → inf (the INF file that describes the driver package). The remaining fields (class, class_guid, provider, directory, hwids) still land in ES under their raw osquery column names via SELECT *, but there's no natural ECS field to map them to.
Also isn't this redundant with d55fb469?
Imho they're complementary, not redundant. They query different Amcache tables:
- d55fb469 (Driver Forensics) :
elastic_amcache_driver_binary(Root\InventoryDriverBinary) - individual driver binaries with signing status, kernel-mode flag, company name - bcef7e6e (Driver Packages) :
elastic_amcache_driver_package(Root\InventoryDriverPackage) - the installation packages that delivered those drivers: INF path, class, provider, hardware IDs
Is that ok?
| } | ||
| }, | ||
| { | ||
| "key": "event.action", |
There was a problem hiding this comment.
Wondering if event.action is fit here. Maybe event.provider ?
Not a blocker
| { | ||
| "key": "tags", | ||
| "value": { | ||
| "value": ["osquery", "amcache", "forensics", "execution_artifacts", "combined", "windows"] |
There was a problem hiding this comment.
Suggestion: Since you've already identified in the descriptions for each artifact collected the associated MITRE code, it could be useful for DFIR to also add it as a tag so it can be queried directly?
There was a problem hiding this comment.
That's a left over, I am going to remove the MITRE as we do not use it in any other queries. Sorry for the noise!
| "attributes": { | ||
| "created_at": "2026-03-27T00:00:00.000Z", | ||
| "created_by": "elastic", | ||
| "description": "Amcache Application Forensics: Combined application and file inventory from the Windows Amcache.hve registry hive. Enumerates installed applications and associated binary files with SHA1 hashes, publishers, install dates, file paths, binary types, and USN journal references. The Amcache records metadata about binaries present on the system including file paths, hashes, timestamps, and install/interaction information. NOTE: Execution must be corroborated with additional artifacts (Prefetch, ShimCache, UserAssist). MITRE ATT&CK: T1204 (User Execution). References: https://www.ssi.gouv.fr/uploads/2019/01/anssi-coriin_2019-analysis_amcache.pdf", |
There was a problem hiding this comment.
Nit: the link to SSI Gouv.fr doesn't bring you to the PDF, but to the generic page
| "description": "Amcache Application Forensics: Combined application and file inventory from the Windows Amcache.hve registry hive. Enumerates installed applications and associated binary files with SHA1 hashes, publishers, install dates, file paths, binary types, and USN journal references. The Amcache records metadata about binaries present on the system including file paths, hashes, timestamps, and install/interaction information. NOTE: Execution must be corroborated with additional artifacts (Prefetch, ShimCache, UserAssist). MITRE ATT&CK: T1204 (User Execution). References: https://www.ssi.gouv.fr/uploads/2019/01/anssi-coriin_2019-analysis_amcache.pdf", | |
| "description": "Amcache Application Forensics: Combined application and file inventory from the Windows Amcache.hve registry hive. Enumerates installed applications and associated binary files with SHA1 hashes, publishers, install dates, file paths, binary types, and USN journal references. The Amcache records metadata about binaries present on the system including file paths, hashes, timestamps, and install/interaction information. NOTE: Execution must be corroborated with additional artifacts (Prefetch, ShimCache, UserAssist). MITRE ATT&CK: T1204 (User Execution). References: https://cyber.gouv.fr/documents/632/anssi-coriin_2019-analysis_amcache-v2.pdf", |
There was a problem hiding this comment.
Thanks, that's a good catch. In the end I decided to remove it - since we do not reference any analysis elsewhere.
… Packages, remove MITRE references
# Conflicts: # packages/osquery_manager/changelog.yml
💚 Build Succeeded
History
cc @tomsonpl |
|
Package osquery_manager - 1.27.0 containing this change is available at https://epr.elastic.co/package/osquery_manager/1.27.0/ |
Summary
This PR adds 7 new Windows Amcache saved queries to the
osquery_managerintegration and includes all of them in the existingforensic-process-executionpack. The queries provide full coverage of the WindowsAmcache.hveregistry hive — a forensic artifact that records metadata about binaries present on the system including file paths, SHA1 hashes, timestamps, and installation/interaction history.The Amcache hive is structured around 6 distinct inventory keys (
InventoryApplication,InventoryApplicationFile,InventoryApplicationShortcut,InventoryDriverBinary,InventoryDriverPackage,InventoryDevicePnp). This PR covers all 6 via dedicated queries, plus 2 additional enriched cross-table JOIN queries that correlate related artifacts together into single-query views.Coverage Added
amcache_application_forensics_windows_elasticamcache_driver_forensics_windows_elasticamcache_shortcut_windows_elasticamcache_device_pnp_windows_elasticamcache_driver_package_windows_elasticamcache_application_enriched_windows_elasticamcache_driver_enriched_windows_elasticPack updated:
forensic-process-execution— all 7 queries added (c8a1b2d3)Query Details
🪟 Amcache Application Forensics —
amcache_application_forensics_windows_elasticDescription
Combined application and file inventory from the Windows

Amcache.hveregistry hive. Enumerates installed applications and their associated binary files with SHA1 hashes, publishers, install dates, file paths, binary types, and USN journal references. The view mergesInventoryApplicationandInventoryApplicationFileinto a unified result.Detection Focus
Platform
Windows
Interval
3600seconds (1 hour)Timeout
180secondsQuery ID
amcache_application_forensics_windows_elasticFile
osquery_manager-5b2e3867-a277-4269-b3eb-9158d10965df.json
ECS Field Mappings
event.category→["process"]event.type→["info"]event.action→"osquery.amcache_application"file.path→lower_case_long_pathfile.name→namefile.hash.sha1→file_sha1file.size→sizepackage.name→product_namepackage.version→product_versionuser.id→user_sidtags→["osquery", "amcache", "forensics", "execution_artifacts", "windows"]SQL Query
🪟 Amcache Driver Forensics —
amcache_driver_forensics_windows_elasticDescription
Enumerates driver binaries recorded in the Windows

Amcache.hveregistry hive (Root\InventoryDriverBinary). Identifies unsigned drivers, third-party kernel-mode drivers, and out-of-box drivers. Results are sorted with unsigned and kernel-mode drivers first for rapid forensic triage. Useful for detecting rootkits, vulnerable drivers (BYOVD — Bring Your Own Vulnerable Driver), and unauthorized driver installations.Detection Focus
driver_signed != '1') surfaced first in results for immediate triagedriver_is_kernel_mode = '1') which execute in ring-0 and represent the highest privilege levelPlatform
Windows
Interval
7200seconds (2 hours)Timeout
180secondsQuery ID
amcache_driver_forensics_windows_elasticFile
osquery_manager-d55fb469-b20d-43aa-902a-f0e71cf036a6.json
ECS Field Mappings
event.category→["driver"]event.type→["info"]event.action→"osquery.amcache_driver"file.name→driver_namefile.code_signature.subject_name→driver_companyfile.code_signature.signed→is_signedpackage.name→productpackage.version→product_versiontags→["osquery", "amcache", "forensics", "driver_analysis", "windows"]SQL Query
🪟 Amcache Application Shortcuts —
amcache_shortcut_windows_elasticDescription
Enumerates LNK (shortcut) files recorded in the Windows

Amcache.hveregistry hive (Root\InventoryApplicationShortcut). Tracks Start Menu shortcuts with their target paths and program associations. Useful for forensic investigation of application execution evidence and persistence mechanisms via Start Menu manipulation.Detection Focus
Platform
Windows
Interval
3600seconds (1 hour)Timeout
180secondsQuery ID
amcache_shortcut_windows_elasticFile
osquery_manager-c1382246-e840-4270-b095-677b6c6be796.json
ECS Field Mappings
event.category→["file"]event.type→["info"]event.action→"osquery.amcache_shortcut"file.path→shortcut_pathtags→["osquery", "amcache", "forensics", "shortcuts", "execution_artifacts", "windows"]SQL Query
🪟 Amcache Device PnP —
amcache_device_pnp_windows_elasticDescription
Enumerates Plug and Play device history from the Windows

Amcache.hveregistry hive (Root\InventoryDevicePnp). Records USB, Bluetooth, and peripheral device connections with manufacturer, model, driver information, install dates, and hardware IDs. Useful for forensic investigation of unauthorized device connections, data exfiltration via removable media, and hardware-based attacks.Detection Focus
Platform
Windows
Interval
7200seconds (2 hours)Timeout
180secondsQuery ID
amcache_device_pnp_windows_elasticFile
osquery_manager-5bc9de27-6ae5-4148-b087-97d2669f6f27.json
ECS Field Mappings
event.category→["host"]event.type→["info"]event.action→"osquery.amcache_device_pnp"tags→["osquery", "amcache", "forensics", "device_inventory", "usb_forensics", "windows"]SQL Query
🪟 Amcache Driver Packages —
amcache_driver_package_windows_elasticDescription
Enumerates driver package metadata from the Windows

Amcache.hveregistry hive (Root\InventoryDriverPackage). Records package class, version, provider, directory, and associated hardware IDs. Links to bothDeviceContainersandDevicePnPsfor cross-referencing driver provenance. Complements the driver binary query by providing the package-level view of driver introductions.Detection Focus
Platform
Windows
Interval
7200seconds (2 hours)Timeout
180secondsQuery ID
amcache_driver_package_windows_elasticFile
osquery_manager-bcef7e6e-31df-4d72-a296-2e7657f49d64.json
ECS Field Mappings
event.category→["driver"]event.type→["info"]event.action→"osquery.amcache_driver_package"tags→["osquery", "amcache", "forensics", "driver_analysis", "windows"]SQL Query
🪟 Amcache Application Enriched —
amcache_application_enriched_windows_elasticDescription
Full application forensics view joining application inventory, file details, and Start Menu shortcuts from the Windows
Amcache.hveregistry hive. Combineselastic_amcache_applications_view(mergingInventoryApplication+InventoryApplicationFile) withInventoryApplicationShortcutviaprogram_id. Provides a single-query view of every installed application with its associated binary files and shortcut launch points. This is a superset of the standalone Application Forensics (#2) and Shortcuts (#2b) queries.Screenshot 2026-03-30 at 13.25.44
Detection Focus
program_idjoin key correlates the application-level record with its file-level and shortcut-level recordsshortcut_aumid(Application User Model ID) useful for identifying Store/Modern apps vs. Win32 applicationsshortcut_target_pathcompared tolower_case_long_pathdetects mismatches that may indicate shortcut hijackingPlatform
Windows
Interval
3600seconds (1 hour)Timeout
180secondsQuery ID
amcache_application_enriched_windows_elasticFile
osquery_manager-abed45b1-6b61-4398-b607-a7a6b09e6dc6.json
ECS Field Mappings
event.category→["process"]event.type→["info"]event.action→"osquery.amcache_application_enriched"file.path→lower_case_long_pathfile.name→namefile.hash.sha1→file_sha1file.size→sizepackage.name→product_namepackage.version→product_versionuser.id→user_sidtags→["osquery", "amcache", "forensics", "execution_artifacts", "combined", "windows"]SQL Query
🪟 Amcache Driver Enriched —
amcache_driver_enriched_windows_elasticDescription
Full driver forensics view joining driver binaries with PnP device history from the Windows
Amcache.hveregistry hive. CombinesInventoryDriverBinarywithInventoryDevicePnpviaservicename — the runtime binding that links a driver binary to the physical device(s) it services. Results sorted with unsigned and kernel-mode drivers first for rapid forensic triage. This is a superset of the standalone Driver Forensics (#2a) and Device PnP (#2c) queries.Device columns are prefixed with

device_to avoid column name collisions when both tables share field names (timestamp,description,driver_name, etc.).Detection Focus
device_problem_codeidentifies devices that failed to load or were blocked — potential indicator of driver conflicts or security product interferencedevice_enumerator(USB, ACPI, PCI, etc.) distinguishes removable media drivers from built-in hardware driversdevice_first_install_datevs.device_install_datereveals whether a device reappeared after a prior removaldevice_hw_idanddevice_compidenable matching against public lists of known-vulnerable hardware IDsPlatform
Windows
Interval
7200seconds (2 hours)Timeout
180secondsQuery ID
amcache_driver_enriched_windows_elasticFile
osquery_manager-743c6727-2a18-46cc-9e23-215ca38b3373.json
ECS Field Mappings
event.category→["driver"]event.type→["info"]event.action→"osquery.amcache_driver_enriched"file.name→driver_namefile.code_signature.subject_name→driver_companyfile.code_signature.signed→is_signedpackage.name→productpackage.version→product_versiontags→["osquery", "amcache", "forensics", "driver_analysis", "device_inventory", "combined", "windows"]SQL Query
Pack Update:
forensic-process-executionAll 7 Amcache queries have been added to the existing
forensic-process-executionpack. The pack description has been updated to reflect the expanded Amcache coverage:Pack file: osquery_manager-c8a1b2d3-e4f5-4a6b-8c7d-9e0f1a2b3c4d.json
Query Design Notes
Why separate atomic queries AND enriched JOIN queries?
The 5 atomic queries (Application, Drivers, Shortcuts, Device PnP, Driver Packages) each target a single Amcache inventory key. They are fast, low-overhead, and appropriate for scheduled collection with high frequency. The 2 enriched queries (Application Enriched, Driver Enriched) perform cross-table JOINs and are designed for incident response scenarios where the analyst needs a complete correlated picture in a single query result.
In practice:
Result ordering strategy
The Driver Forensics and Driver Enriched queries use a multi-level
ORDER BYwithCASEexpressions to prioritize the most forensically significant records first:driver_signed != '1') — highest risk, surface firstdriver_is_kernel_mode = '1') — ring-0 execution contextdriver_in_box != '1') — not shipped with Windowstimestamp DESC) — most recent activity first within each groupAmcache.hve structure reference
InventoryApplication+InventoryApplicationFileelastic_amcache_applications_viewInventoryApplicationShortcutelastic_amcache_application_shortcutInventoryDriverBinaryelastic_amcache_driver_binaryInventoryDriverPackageelastic_amcache_driver_packageInventoryDevicePnpelastic_amcache_device_pnpPrerequisite: Elastic Agent osquery extension amcache support
The
elastic_amcache_*tables are not part of the standard osquery table set. They are provided by the Elastic Agent osquery extension. Agents must be running a version of Elastic Agent that ships the amcache extension tables. Queries will return no results (not errors) on agents where the extension is not loaded.