<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/">
    <channel>
        <title>Elastic Security Labs - Articles by Raquel Tabuyo</title>
        <link>https://www.elastic.co/security-labs</link>
        <description>Trusted security news &amp; research from the team at Elastic.</description>
        <lastBuildDate>Fri, 01 May 2026 16:12:48 GMT</lastBuildDate>
        <docs>https://validator.w3.org/feed/docs/rss2.html</docs>
        <generator>https://github.com/jpmonette/feed</generator>
        <image>
            <title>Elastic Security Labs - Articles by Raquel Tabuyo</title>
            <url>https://www.elastic.co/security-labs/assets/security-labs-thumbnail.png</url>
            <link>https://www.elastic.co/security-labs</link>
        </image>
        <copyright>© 2026. elasticsearch B.V. All Rights Reserved</copyright>
        <item>
            <title><![CDATA[DFIR: From alert to root cause using Osquery without leaving Elastic Security]]></title>
            <link>https://www.elastic.co/security-labs/dfir-osquery-elastic-security</link>
            <guid>dfir-osquery-elastic-security</guid>
            <pubDate>Fri, 01 May 2026 00:00:00 GMT</pubDate>
            <description><![CDATA[Learn how to perform distributed, real-time Digital Forensics and Incident Response (DFIR) using Osquery and Elastic to investigate threats at scale without relying on disk imaging.]]></description>
            <content:encoded><![CDATA[<p>Modern DFIR doesn't start with a disk image. That model worked when environments were smaller, endpoints were static, and time wasn't the primary constraint. Endpoints are now ephemeral, fleets scale to thousands of hosts, and attackers operate on timelines measured in minutes. By the time a full forensic image is collected, the system may no longer exist.</p>
<p>Forensics today is no longer about collecting everything. It's about asking the right questions, in real time, across your entire environment.</p>
<p>This is where distributed, query-driven forensics comes in and why tools like <a href="https://osquery.io/">Osquery</a> have become foundational to modern Digital Forensics and Incident Response (DFIR). Most DFIR workflows have a hidden cost: the time lost switching between your endpoint detection and response (EDR), your security information and event management (SIEM), and your forensic tooling. Elastic Security eliminates that gap entirely, from a blocked alert to a deep-dive forensic query, without leaving the platform or losing investigative context.</p>
<hr />
<h2>Rethinking forensics in modern environments</h2>
<p><a href="https://www.sans.org/cybersecurity-focus-areas/digital-forensics-incident-response">DFIR</a> has traditionally been treated as a post-incident activity. Evidence was collected, systems were imaged, and analysis happened after the attacker had already completed their objectives. That model assumed stability: stable hosts, predictable timelines, and the ability to pause systems for investigation.</p>
<p>Today, those assumptions no longer hold.</p>
<p>Infrastructure is dynamic, endpoints are frequently reimaged or short-lived, and attackers operate on timelines measured in minutes rather than days. Waiting to collect full forensic images isn’t just inefficient; it’s also operationally infeasible. By the time analysis begins, the system may no longer exist, or the attacker may have already moved laterally.</p>
<p>As a result, DFIR has evolved into a live, iterative discipline. Investigators no longer rely on full disk acquisition as a starting point. Instead, they interrogate endpoints directly, retrieving only the artifacts that matter, when they matter.</p>
<h2>From disk imaging to distributed DFIR</h2>
<p>This shift represents a fundamental change in how investigations are performed.</p>
<p>Rather than centralizing evidence and analyzing it in isolation, investigators now distribute their questions across the environment. Each endpoint becomes a source of truth that can be queried in real time. Instead of waiting hours for data collection, analysts can validate hypotheses in seconds, pivot quickly, and refine their investigation as new evidence emerges.</p>
<p>This model enables a far more responsive workflow. Questions lead to queries, queries lead to insights, and insights drive the next steps of the investigation.</p>
<h2>Osquery as a forensic interface</h2>
<p>At the center of this model is Osquery, which exposes operating system (OS) artifacts as structured tables that can be queried using SQL. Processes, network connections, file activity, registry entries, and execution artifacts become immediately accessible without the need for heavyweight collection.</p>
<p>This abstraction transforms the OS into a queryable forensic dataset. Instead of navigating multiple tools or collecting large volumes of raw data, investigators can focus on answering specific questions with precision.</p>
<p>To support this, Elastic doesn't just integrate <a href="https://www.elastic.co/docs/reference/integrations/osquery_manager">Osquery Manager</a>, but we also build our own Osquery <a href="https://github.com/elastic/beats/blob/main/x-pack/osquerybeat/ext/osquery-extension/README.md">extensions</a> to cover critical forensic artifacts that aren’t natively available. We make these extensions available within Elastic Security and contribute them back to the community. This includes visibility into areas such as <a href="https://github.com/elastic/beats/blob/main/x-pack/osquerybeat/ext/osquery-extension/docs/tables/elastic_browser_history.md">browser history</a>, <a href="https://github.com/elastic/beats/blob/main/x-pack/osquerybeat/ext/osquery-extension/docs/tables/elastic_amcache_application_file.md">AmCache</a>, and <a href="https://github.com/elastic/beats/blob/main/x-pack/osquerybeat/ext/osquery-extension/docs/tables/elastic_jumplists.md">jumplists</a>, enabling deeper insight into user activity and execution patterns directly from the endpoint. We have contributed to Osquery with YARA memory scanning and OpenHandles too.The <a href="https://www.elastic.co/docs/solutions/security/investigate/examine-osquery-results">Osquery results</a> are automatically stored in an Elasticsearch index and can easily be <a href="https://www.elastic.co/docs/solutions/security/investigate/osquery#osquery-map-fields">mapped to the Elastic Common Schema</a> (ECS).</p>
<p>Beyond individual <a href="https://www.elastic.co/docs/solutions/security/investigate/osquery#osquery-run-query">live queries</a>, Elastic also provides <a href="https://github.com/elastic/integrations/blob/main/packages/osquery_manager/artifacts_matrix.md#core-forensic-artifacts-coverage">out-of-the-box Osquery curated queries</a> designed for forensic investigations, also mapped to ECS. These queries target the forensic artifacts that matter most during an investigation, such as Prefetch files that prove execution, Shimcache entries that confirm a binary existed on disk, registry keys that expose persistence mechanisms, and scheduled tasks that reveal attacker footholds.</p>
<h2>From alert triaging to forensic reconstruction</h2>
<p>Alerts are often the entry point into an investigation, but in a modern security operations center (SOC), they signify active defense. <a href="https://www.elastic.co/docs/reference/integrations/endpoint">Elastic Defend</a> provides this first line of active protection. This native Elastic Endpoint Security integration operates at the kernel level for deep visibility and enforcement, consistently earning top AV-Comparatives scores. Beyond alerts, Elastic Defend provides continuous enforcement, stopping threats like ransomware, malware, and in-memory exploits, using advanced behavioral preventions. While investigations begin with a signal, damage is already mitigated.</p>
<p>However, once a threat is neutralized, the key critical question remains: What actually happened?</p>
<p>This is where <a href="https://www.elastic.co/docs/solutions/security/investigate/osquery">investigating with Osquery</a> becomes essential. While Elastic Defend neutralizes the threat and captures the real-time telemetry, Osquery acts as your deep-dive forensic interface. It allows you to interrogate the endpoint for specific, high-fidelity artifacts, such as execution history in the Shimcache or manual navigation in Shellbags, to reconstruct a definitive timeline with evidence that goes beyond telemetry.</p>
<p>Together, Elastic Defend and Osquery form a complementary system that spans the full detection and response lifecycle. One provides continuous visibility and alerting; the other delivers the forensic depth required to investigate and validate those alerts. This combination allows analysts to move easily from detection to investigation, bridging the gap between signal and understanding.</p>
<h2>Hunts: Operationalizing forensic and threat hunting investigations</h2>
<p>As investigations progress, many of the same questions are repeatedly asked across different incidents. Rather than rebuilding queries each time, these can be standardized into reusable <em>hunts</em>.</p>
<p>Apart from curated queries, Elastic also provides <a href="https://github.com/elastic/integrations/blob/main/packages/osquery_manager/artifacts_matrix.md#artifacts-by-investigative-goal">curated Osquery packs</a> aligned with common attacker tactics and techniques. These <a href="https://www.elastic.co/docs/solutions/security/investigate/osquery#osquery-schedule-query">packs can be scheduled</a> and allow analysts to quickly validate suspicious process execution, identify potential defense evasion behavior, and detect signs of lateral movement without writing queries from scratch.</p>
<p>In this scenario, hunts enable the investigation to expand beyond a single host. Analysts can rapidly determine whether similar execution patterns or indicators exist elsewhere in the environment, significantly accelerating the investigation process.</p>
<h2>Scaling the investigation</h2>
<p>Once key indicators such as domains or file hashes are identified, the investigation can be extended across the entire environment. Queries used for validation can be reused to identify similar activity on other endpoints.</p>
<p>This approach allows analysts to determine the scope of the incident, identify additional affected systems, and prioritize response efforts based on impact. Osquery, combined with Elastic across the environment, enables centralized query execution and fleet-wide forensics investigations.</p>
<h2>From investigation to response</h2>
<p>Up to this point, the focus has been on understanding what happened. Modern DFIR, however, requires the ability to act on those findings immediately.</p>
<p>By combining Osquery with Elastic Defend, investigators can move directly from analysis to <a href="https://www.elastic.co/docs/solutions/security/endpoint-response-actions">response</a> within the same workflow.</p>
<p>Once malicious execution is confirmed, the affected host can be <a href="https://www.elastic.co/docs/solutions/security/endpoint-response-actions#_isolate">isolated</a> to prevent further communication and reduce the risk of lateral movement. In situations requiring deeper analysis, investigators can also collect a <a href="https://www.elastic.co/docs/solutions/security/endpoint-response-actions#memory-dump">memory dump</a> from the endpoint.</p>
<p>This memory dump can be downloaded and analyzed using external tools, such as Volatility, enabling further investigation of in-memory activity that may not be visible through traditional artifacts.</p>
<p>The Osquery and Elastic Defend combination allows analysts to move easily from detection to investigation to response, reducing friction and accelerating the overall DFIR process.</p>
<h2>Detection with Osquery: From telemetry to signal</h2>
<p>While Osquery is often used for live investigations, it also plays an important role in detection. When executed through scheduled packs, Osquery continuously collects endpoint data that can be used within Elastic Security to <a href="https://www.elastic.co/docs/solutions/security/detect-and-alert/using-the-rule-ui">create SIEM detection rules</a>. The results of these queries are indexed in <code>logs-Osquery_manager.result*</code>, making them searchable and usable as a detection data source.</p>
<p>Each query execution is identified by the <code>action.id</code> field. For scheduled packs, this follows a consistent naming convention: <code>pack_{pack_name}_{query_name}</code>. This allows analysts to reference specific queries when building detection logic, effectively turning Osquery packs into reusable detection building blocks.</p>
<p>This creates a natural feedback loop between investigation and detection. Queries initially used during forensic analysis can be operationalized into scheduled packs, continuously running across the environment and surfacing suspicious behavior automatically, bridging the gap between reactive investigation and proactive detection. Moreover, Osquery <a href="https://www.elastic.co/docs/solutions/security/investigate/run-osquery-from-alerts">can be run directly from alerts</a>, as part of <a href="https://www.elastic.co/docs/solutions/security/investigate/run-osquery-from-investigation-guides">investigation guides</a> and as a <a href="https://www.elastic.co/docs/solutions/security/investigate/add-osquery-response-actions">response action in a detection rule</a>.</p>
<h2>Investigation scenario: From malicious alert to root cause</h2>
<p>Consider a scenario where a user receives a phishing email offering a “100% discount” through a shared download link. The message appears convincing enough to prompt interaction, leading the user to download a file from the provided link.</p>
<p>Shortly after, Elastic Defend triggers an alert indicating that malware execution was detected and terminated. The payload is identified as <a href="https://en.wikipedia.org/wiki/Mimikatz">Mimikatz</a>, a well-known tool used for credential access.</p>
<p><img src="https://www.elastic.co/security-labs/assets/images/dfir-osquery-elastic-security/image7.png" alt="Process alert" title="Alert details and analyzer view showing a critical malware detection alert. The left panel displays an analyzer graph of related processes, including explorer.exe, cmd.exe, powershell.exe, conhost.exe, and mimikatz.exe. The right panel lists alert information such as status, risk score, host name, rule name, file path, file hash, and process details." /></p>
<p>At this stage, the immediate threat has been blocked, but key questions remain unanswered. How did the file reach the endpoint? Was it executed by the user? Was this an isolated event or part of a broader attack?</p>
<p>Detection provides the signal but not the full story.</p>
<p>To understand the root cause, the investigation shifts to Osquery.</p>
<p>The first step is to identify how the file was introduced onto the system. Since the initial vector is a phishing link, browser artifacts provide a natural starting point. We’ll use the suspicious <a href="https://github.com/elastic/integrations/blob/main/packages/osquery_manager/kibana/osquery_saved_query/osquery_manager-b352f3c9-c630-47ec-83bb-5887fe0bb874.json">browser history query</a> that removes all possible false positives from the <a href="https://github.com/elastic/beats/blob/main/x-pack/osquerybeat/ext/osquery-extension/docs/tables/elastic_browser_history.md">Elastic <code>browser history</code> table</a>.</p>
<p>This query helps identify whether the user accessed a suspicious link consistent with the phishing lure.</p>
<p><img src="https://www.elastic.co/security-labs/assets/images/dfir-osquery-elastic-security/image8.png" alt="History results" title="Browser history query results showing a table of osquery events from win11‑lab1, including event action, category, type, tags, URL domain and full URL, user name, and user agent name. The query description reads “Browser history from Elastic osquery extension,” and the entries display limewire‑related domains accessed by user lab1." /></p>
<p><img src="https://www.elastic.co/security-labs/assets/images/dfir-osquery-elastic-security/image1.png" alt="History details" title="Browser history query result details showing a table of fields and values, including event category, event time, browser, domain, URL, title, username, tags, and user agent name. The entry reflects activity associated with limewire.com accessed by user lab1." /></p>
<p>We see that the user <strong>lab1</strong> accessed through Edge browser a link that, in theory, contains a <strong>discount</strong> zip file to be downloaded, and we can consider these findings as new <a href="https://www.microsoft.com/en-us/security/business/security-101/what-are-indicators-of-compromise-ioc">indicators of compromise</a> (IoCs).</p>
<p>In order to confirm whether the file was actually downloaded and therefore, the user clicked on the previous link, we can use the <a href="https://osquery.io/schema/5.22.1/#file"><code>file</code> table</a>, checking for the presence of this zip file on disk, meaning the user clicked on that previous link. We’ll use the <a href="https://github.com/elastic/integrations/blob/main/packages/osquery_manager/kibana/osquery_saved_query/osquery_manager-f8e71a30-b621-11ef-9c4a-8b2c7c5a1d3e.json">Elastic file query</a> that also checks the file hash of that file on VirusTotal. We can see that this <strong>discount.zip</strong> file has a <a href="https://www.virustotal.com/gui/file/d86e5d2701b548dfbe0419bcffb2ae82c6ccdeb6dc9612050273c543a6f5215a">malicious reputation</a>, being in reality Mimikatz.</p>
<p><img src="https://www.elastic.co/security-labs/assets/images/dfir-osquery-elastic-security/image2.png" alt="File lookup" title="File query results with VirusTotal link showing a search for “discount.zip” and a results table listing one matching entry from win11‑lab1. A side panel displays the field “osquery_vt_link” with a VirusTotal URL for the file." /></p>
<p>Next, we validate whether a file was downloaded and executed as a result of that interaction. To determine whether the file was executed, we pivot into execution artifacts, such as <a href="https://forensafe.com/blogs/shimcache.html"><strong>Shimcache</strong></a> <strong><a href="https://forensafe.com/blogs/UserAssist.html">UserAssist</a>,  <a href="https://www.forensafe.com/blogs/shellbags.html">Shellbags</a>,</strong> and <strong><a href="https://www.forensafe.com/blogs/prefetch.html">Prefetch</a></strong>.</p>
<p><a href="https://osquery.io/schema/5.22.1/#shellbags"><code>Shellbags</code></a> clearly shows the drill-down behavior: The user didn't just open the folder; they navigated three levels deep into the x64 directory where the Mimikatz binary usually lives.</p>
<pre><code class="language-sql">SELECT
  path,
  datetime(accessed_time, 'unixepoch') AS access_time
FROM shellbags
WHERE path LIKE '%discount%';
</code></pre>
<p><img src="https://www.elastic.co/security-labs/assets/images/dfir-osquery-elastic-security/image5.png" alt="Shellbags view" title="Shellbags query results showing a table with agent name, access time, and path fields. The entries list win11‑lab1 with access times from April 10, 2026, and paths referencing discount and mimikatz‑master directories." /></p>
<p>The <a href="https://osquery.io/schema/5.22.1/#shimcache"><code>shimcache</code></a> tracks every executable that has been &quot;seen&quot; by the OS for compatibility purposes. Even if the file was never actually run, its presence here proves it existed in that path.</p>
<pre><code class="language-sql">SELECT
  path,
  datetime(modified_time, 'unixepoch') AS last_run_human_readable,
  modified_time AS raw_timestamp
FROM shimcache
WHERE path LIKE '%discount%'
  OR path LIKE '%mimikatz%';
</code></pre>
<p><img src="https://www.elastic.co/security-labs/assets/images/dfir-osquery-elastic-security/image3.png" alt="Shimcache view" title="Shimcache query results showing a table with agent name, last run time, file path, and raw timestamp. The entry lists win11‑lab1 with a last run time from April 10, 2026, and a path pointing to mimikatz.exe in the discount and mimikatz‑master directories." /></p>
<p>NOTE: The &quot;1970&quot; date in the <code>raw_timestamp</code> column is a known forensics community issue. It results from a unit mismatch: Osquery stores timestamps in Unix epoch seconds, but the UI interprets this value as milliseconds. This calculation error compresses 56 years into roughly 20 days, causing the date to display as late January 1970 instead of April 2026. For forensic accuracy, the <code>last_run_human_readable</code> column remains the authoritative record, as it was correctly converted using second-based logic in the SQL query to reflect the true execution timeline.</p>
<p>To verify whether the user manually executed it, the <a href="https://osquery.io/schema/5.22.1/#userassist"><code>userassist</code></a> table is perfect. It tracks GUI-based execution (files launched via Windows Explorer).</p>
<pre><code class="language-sql">SELECT
  path,
  count,
  datetime(last_execution_time, 'unixepoch') AS last_run_human_readable
FROM userassist
WHERE path LIKE '%discount%'
  OR path LIKE '%mimikatz%';
</code></pre>
<p><img src="https://www.elastic.co/security-labs/assets/images/dfir-osquery-elastic-security/image6.png" alt="Userassist view" title="Userassist query results showing a table with agent name, execution count, last run time, and file path. The entry lists win11‑lab1 with two executions and a path pointing to mimikatz.exe in the discount and mimikatz‑master directories" /></p>
<p><a href="https://osquery.io/schema/5.22.1/#prefetch"><code>Prefetch</code></a> is the black box that proves an application was actually launched. Analyzing the prefetch, we can get a timeline of the events, identifying that the root cause was a malicious phishing email.</p>
<pre><code class="language-sql">SELECT
  filename,
  run_count,
  datetime(last_run_time, 'unixepoch') AS last_run_utc,
  last_run_time AS raw_timestamp
FROM prefetch
WHERE (
  filename LIKE 'OLK.EXE%' OR
  filename LIKE 'MSEDGE%' OR
  filename LIKE 'MIMIKATZ%'
)
AND last_run_time BETWEEN 1775815200 AND 1775822400
ORDER BY last_run_time ASC;
</code></pre>
<p><img src="https://www.elastic.co/security-labs/assets/images/dfir-osquery-elastic-security/image4.png" alt="Prefetch view" title="Prefetch query results showing a table with agent name, filename, last run time, raw timestamp, and run count. Entries for win11‑lab1 list OLK.EXE, MSEDGEWEBVIEW2.EXE, MSEDGE.EXE, and MIMIKATZ.EXE with their associated run counts and timestamps." /></p>
<p>The forensic evidence confirms a linear attack path when the user <strong>lab1</strong> initiated the new Outlook client, evidenced by the simultaneous execution of OLK.EXE and its integrated web engine, MSEDGEWEBVIEW2.EXE. This was immediately followed by MSEDGE.EXE, indicating the browser was summoned to handle the phishing redirect and download. The trail turns from automated activity to manual intent where Shellbags recorded the user deliberately navigating the extracted discount folder in their Downloads directory. This window of manual interaction eventually culminated in the final execution of MIMIKATZ.EXE. The 26-minute gap between the Shellbag entry (manual folder access) and the Prefetch entry (Mimikatz execution) is forensically consistent with a human-in-the-loop (HITL) attack scenario, where the user reads the email, clicks the link, waits for the download, extracts the zip, looks around the folder (Shellbags at 11:09), and finally works up the courage (or curiosity) to double-click the <code>.exe</code>.</p>
<h2>Transform forensics to investigate and respond at scale</h2>
<p>Twenty-six minutes. That's how long it took a user to go from opening a phishing email to executing Mimikatz. And it took us less time than that to reconstruct the entire attack chain, without a disk image, without a dedicated forensic workstation, and without leaving Elastic.</p>
<p>That's what scalable DFIR looks like in practice: not a process change, not a platform migration, but the ability to ask the right question of the right endpoint at the right moment and to get an answer before the attacker takes their next step.</p>
<p>The investigation never stops. Neither should your forensics.</p>
<p>Forensics is now essential for large-scale investigation and response, moving beyond being a mere post-incident activity. The evolution of forensics at Elastic continues, with our next phase focusing on incorporating automation and AI. Get ready to unlock the full power of forensics by combining it with workflows and agentic AI, we'll be diving into this topic in an upcoming blog post. Stay tuned!</p>
<h2>Get started with Elastic Security</h2>
<p>Start your <a href="https://cloud.elastic.co/registration">free trial</a> of Elastic Security today and experience the benefits of Elastic Defend and Osquery. Improve your forensics skills by enhancing your threat detection capabilities and gaining deeper visibility into potential threats before they escalate.</p>
<h2>Frequently Asked Questions</h2>
<p><strong>Q: How do I perform forensic investigations at scale without disk imaging?</strong> A: Elastic Security combines Osquery and Elastic Defend to enable distributed, query-driven forensics across your entire fleet. Osquery exposes OS artifacts as SQL-queryable tables, so investigators can retrieve execution history, file activity, and registry entries from thousands of endpoints in real time without collecting full disk images.</p>
<p><strong>Q: How do I reconstruct an attack timeline using Osquery?</strong> A: Elastic Security's Osquery integration gives you access to execution artifacts like Prefetch, Shimcache, UserAssist, and Shellbags as queryable tables. By chaining queries across these sources you can reconstruct the full sequence of user and attacker actions, including file downloads, folder navigation, and binary execution, without a forensic workstation.</p>
<p><strong>Q: How does Osquery integrate with Elastic Security for incident response?</strong> A: Elastic Security includes Osquery Manager natively, with curated forensic queries and packs mapped to ECS. Results are indexed automatically, making them searchable alongside alert data and usable as detection rule inputs. Osquery can also be run directly from alerts, investigation guides, and detection rule response actions.</p>
<p><strong>Q: Can I detect threats with Osquery in addition to investigating them?</strong> A: Yes. Scheduled Osquery packs continuously collect endpoint data that Elastic Security indexes under <code>logs-osquery_manager.result*</code>, which can be used as a detection data source for SIEM rules. Queries developed during forensic investigations can be operationalized into scheduled packs, creating a feedback loop between reactive investigation and proactive detection.</p>]]></content:encoded>
            <category>security-labs</category>
            <enclosure url="https://www.elastic.co/security-labs/assets/images/dfir-osquery-elastic-security/dfir-osquery-elastic-security.webp" length="0" type="image/webp"/>
        </item>
    </channel>
</rss>