{"id":25010,"date":"2024-08-01T03:20:57","date_gmt":"2024-08-01T11:20:57","guid":{"rendered":"https:\/\/www.palada.net\/index.php\/2024\/08\/01\/news-18740\/"},"modified":"2024-08-01T03:20:57","modified_gmt":"2024-08-01T11:20:57","slug":"news-18740","status":"publish","type":"post","link":"https:\/\/www.palada.net\/index.php\/2024\/08\/01\/news-18740\/","title":{"rendered":"Driving lessons: The kernel drivers in Sophos Intercept X Advanced"},"content":{"rendered":"<p><strong>Credit to Author: Matt Wixey| Date: Thu, 01 Aug 2024 09:42:02 +0000<\/strong><\/p>\n<div class=\"entry-content lg:prose-lg mx-auto prose max-w-4xl\">\n<p>Operating in \u2018kernel-space\u2019 \u2013 the most privileged layer of an operating system, with direct access to memory, hardware, resource management, and storage \u2013 is vitally important for security products. It enables them to monitor \u2018user-space\u2019 \u2013 the non-privileged environment where applications run \u2013 and protect against malware that executes in that environment, even when it tries to evade detection. But kernel access also allows security products to counter more insidious threats within the kernel itself. As we\u2019ve reported previously, for example, some threat actors use <a href=\"https:\/\/news.sophos.com\/en-us\/2024\/03\/04\/itll-be-back-attackers-still-abusing-terminator-tool-and-variants\/\">BYOVD (Bring Your Own Vulnerable Driver) attacks<\/a>, or <a href=\"https:\/\/news.sophos.com\/en-us\/2022\/12\/13\/signed-driver-malware-moves-up-the-software-trust-chain\/\">attempt to get their own malicious drivers cryptographically signed<\/a>, in order to access kernel-space and take advantage of that elevated level of access.<\/p>\n<p>However, from a security standpoint, working in kernel-space comes with its own risks. A wrong step in this environment \u2013 such as a bad update to a kernel driver \u2013 can cause outages. If the driver in question starts at boot time, when the operating system first loads, that can lead to prolonged impacts, potentially requiring affected hosts to be started in a recovery mode to mitigate the problem and allow the machines to boot normally.<\/p>\n<p>Sophos\u2019 Intercept X Advanced product uses five kernel drivers as of release 2024.2. All drivers are extensively tested* with applicable flags enabled and disabled, and shipped with new flags disabled. (Sophos Intercept X and Sophos Central use feature flags to gradually enable new features. Feature flags are deployed through Sophos Central. New features are typically \u2018guarded\u2019 by feature flags \u2013 turned off unless the flag is enabled &#8211; so that the feature can be rolled out gradually and potentially revised before wider enablement.)<\/p>\n<p>In this article, in the interests of transparency, we\u2019ll explore what those drivers are, what they do, when they start, how they\u2019re signed, and what their inputs are. We\u2019ll also explore some of the safeguards we put in place around these drivers to minimize the risk of disruption (such as staged rollouts, as mentioned above; we provide an example of this later in the article), and the options available to customers when it comes to configuring them. It\u2019s also worth noting that Intercept X Advanced and all its components, including the kernel drivers, has been part of <a href=\"https:\/\/bugcrowd.com\/engagements\/sophos\">an external bug bounty program<\/a> since December 14, 2017; we welcome scrutiny via external bug bounty submissions, and we foster a culture of collaboration with the research community.<\/p>\n<p><em>* &#8216;Testing&#8217; refers to a range of internal testing, including Microsoft-provided tools and verifiers<\/em><\/p>\n<h1>Overview<\/h1>\n<p>The following table provides an at-a-glance overview of the five kernel drivers which are part of Intercept X Advanced release 2024.2.<\/p>\n<p><em>Table 1: An overview of the kernel drivers in Intercept X Advanced2024.2<\/em><br \/> <em>* Microsoft Windows Early Launch Anti-malware Publisher<\/em><br \/> <em>+ Microsoft Windows Hardware Compatibility Publisher<\/em><\/p>\n<p><a href=\"https:\/\/news.sophos.com\/wp-content\/uploads\/2024\/08\/kernel_blog.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-956557\" src=\"https:\/\/news.sophos.com\/wp-content\/uploads\/2024\/08\/kernel_blog.jpg\" alt=\"A graphic showing user-space and the kernel (with hardware below) and how Sophos user-space components interact with the kernel drivers mentioned in the post\" width=\"640\" height=\"377\" srcset=\"https:\/\/news.sophos.com\/wp-content\/uploads\/2024\/08\/kernel_blog.jpg 1188w, https:\/\/news.sophos.com\/wp-content\/uploads\/2024\/08\/kernel_blog.jpg?resize=300,177 300w, https:\/\/news.sophos.com\/wp-content\/uploads\/2024\/08\/kernel_blog.jpg?resize=768,452 768w, https:\/\/news.sophos.com\/wp-content\/uploads\/2024\/08\/kernel_blog.jpg?resize=1024,603 1024w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/a><\/p>\n<p><em>Figure 1: A conceptual depiction of user-space\/kernel boundaries and where Intercept X Advanced components operate<\/em><\/p>\n<h1>SophosEL.sys<\/h1>\n<p><strong>What it does:<\/strong> SophosEL.sys is the Sophos <a href=\"https:\/\/learn.microsoft.com\/en-us\/windows-hardware\/drivers\/install\/early-launch-antimalware\">Early Launch<\/a> Anti-Malware (ELAM) driver.<\/p>\n<p><strong>Inputs:<\/strong> This driver has one input \u2013 a blocklist of known-bad drivers which must be prevented from executing as boot start drivers at machine startup. This blocklist, located at the registry key below, is set by Sophos user-space threat detection logic when it detects a malicious driver. At the next boot cycle, SophosEL.sys ensures that this driver is not loaded.<\/p>\n<table>\n<tbody>\n<tr>\n<td width=\"371\">Input<\/td>\n<td width=\"118\">Description<\/td>\n<td width=\"112\">Protection<\/td>\n<\/tr>\n<tr>\n<td width=\"371\">HKLMSYSTEMCurrentControlSetServicesSophos ELAMConfig<\/td>\n<td width=\"118\">Blocklist of known-bad drivers<\/td>\n<td width=\"112\"><a href=\"https:\/\/learn.microsoft.com\/en-us\/windows\/win32\/secauthz\/dacls-and-aces\">DACLs<\/a>; Sophos Tamper Protected<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<p><strong>Customer options: <\/strong>Customers can configure remediation and allowed items in the <a href=\"https:\/\/docs.sophos.com\/central\/customer\/help\/en-us\/ManageYourProducts\/EndpointProtection\/ThreatProtectionPolicy\/index.html\">Threat Protection policy<\/a> from Sophos Central.<\/p>\n<p><strong>Additional measures:<\/strong> Any Microsoft or Sophos-signed driver is exempt from cleanup\/blocking.<\/p>\n<h1>SophosED.sys<\/h1>\n<p><strong>What it does:<\/strong> SophosED.sys (Endpoint Defense) is a boot start driver, started during ELAM processing and before many other kernel drivers are loaded, Windows user-space is initialized, and the system drive is mounted. It has three broad responsibilities:<\/p>\n<ol>\n<li>Providing tamper protection for the Sophos installation and configuration<\/li>\n<li>Exposing system activity events to Sophos user-space components for protection and detection<\/li>\n<li>Recording low-level system activity events to the Sophos Event Journals for after-the-fact forensics and analysis<\/li>\n<\/ol>\n<p><strong>Inputs:<\/strong> Since SophosED.sys starts before the filesystem is available, its entire configuration is provided through its service key. Note that all the below inputs are under HKLMSYSTEMCurrentControlSetServicesSophos Endpoint Defense.<\/p>\n<h2>Filter driver altitudes inputs<\/h2>\n<p>SophosED.sys registers with Windows as <a href=\"https:\/\/learn.microsoft.com\/en-us\/windows-hardware\/drivers\/ifs\/filter-manager-concepts\">a Mini-Filter driver<\/a> at multiple <a href=\"https:\/\/learn.microsoft.com\/en-us\/windows-hardware\/drivers\/ifs\/load-order-groups-and-altitudes-for-minifilter-drivers\">altitudes<\/a> (a unique identifier that defines a driver\u2019s position on the \u2018stack\u2019 of drivers, with \u2018lower\u2019 drivers being closer to bare metal) <a href=\"https:\/\/learn.microsoft.com\/en-us\/windows-hardware\/drivers\/ifs\/allocated-altitudes\">allocated and approved by Microsoft<\/a>.<\/p>\n<table>\n<tbody>\n<tr>\n<td width=\"371\">Input<\/td>\n<td width=\"124\">Description<\/td>\n<td width=\"106\">Protection<\/td>\n<\/tr>\n<tr>\n<td width=\"371\">HKLMSYSTEMCurrentControlSetServicesSophos Endpoint DefenseInstances<\/td>\n<td width=\"124\">Multiple altitudes allocated by Microsoft<\/td>\n<td width=\"106\">DACLs; Sophos Tamper Protected<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2>Tamper Protection inputs<\/h2>\n<p>Sophos Tamper Protection is configured by a combination of customer policies, Sophos feature flags, and signed manifests built into the agent.<\/p>\n<table>\n<tbody>\n<tr>\n<td width=\"371\">Input<\/td>\n<td width=\"124\">Description<\/td>\n<td width=\"106\">Protection<\/td>\n<\/tr>\n<tr>\n<td width=\"371\">HKLMSYSTEMCurrentControlSetServicesSophos Endpoint DefenseTamperProtectionConfig<\/td>\n<td width=\"124\">Customer policy (On\/Off, configuration password*)<\/td>\n<td width=\"106\">DACLs; Sophos Tamper Protected<\/td>\n<\/tr>\n<tr>\n<td width=\"371\">HKLMSYSTEMCurrentControlSetServicesSophos Endpoint DefenseTamperProtectionComponents<\/p>\n<p>HKLMSYSTEMCurrentControlSetServicesSophos Endpoint DefenseTamperProtectionServices<\/td>\n<td width=\"124\">Manifest of protected keys, folders, services etc<\/td>\n<td width=\"106\">Signed; verified by driver before loading<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><em>* The configuration password is hashed with PBKDF2-SHA512 and a salt<\/em><\/p>\n<h2>System Activity Events inputs<\/h2>\n<p>The Sophos Central Threat Protection policy supports multiple configuration options, which Sophos user-space processes write to the SophosED.sys registry key, so that they\u2019re available when the driver is loaded.<\/p>\n<table>\n<tbody>\n<tr>\n<td width=\"371\">Input<\/td>\n<td width=\"124\">Description<\/td>\n<td width=\"106\">Protection<\/td>\n<\/tr>\n<tr>\n<td width=\"371\">HKLMSYSTEMCurrentControlSetServicesSophos Endpoint DefenseScanningConfig<\/td>\n<td width=\"124\">Customer policy (On\/Off, exclusions, and lots more)<\/td>\n<td width=\"106\">DACLs; Sophos Tamper Protected<\/td>\n<\/tr>\n<tr>\n<td width=\"371\">HKLMSYSTEMCurrentControlSetServicesSophos Endpoint DefenseEndpointFlags<\/td>\n<td width=\"124\">Sophos feature flags (various)<\/td>\n<td width=\"106\">DACLs; Sophos Tamper Protected<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2>Event Journal inputs<\/h2>\n<table>\n<tbody>\n<tr>\n<td width=\"371\">Input<\/td>\n<td width=\"124\">Description<\/td>\n<td width=\"106\">Protection<\/td>\n<\/tr>\n<tr>\n<td width=\"371\">HLKMSYSTEMCurrentControlSetServicesSophos Endpoint DefenseEventJournalConfig<\/td>\n<td width=\"124\">Customer policy (exclusions, disk limits)<\/td>\n<td width=\"106\">DACLs; Sophos Tamper Protected<\/td>\n<\/tr>\n<tr>\n<td width=\"371\">HLKMSYSTEMCurrentControlSetServicesSophos Endpoint DefenseEventJournalFeatures<\/td>\n<td width=\"124\">If a subkey exists with a DWORD value Enabled =1, event journals are enabled<\/td>\n<td width=\"106\">DACLs; Sophos Tamper Protected<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><strong>Customer options:<\/strong> Customers can configure disk limits and manage exclusions in Sophos Central Threat Protection policy.<\/p>\n<p><strong>Additional measures:<\/strong> If a driver facility is available (based on a combination of Customer Policy plus Sophos flag), then Sophos user-space processes can configure various parameters at runtime:<\/p>\n<ul>\n<li>A bitmask of mitigations to apply per-process<\/li>\n<li>What events to enable or disable for each process<\/li>\n<li>The amount of time the driver should wait for a response from user-space (or whether it should be an asynchronous notification).<\/li>\n<\/ul>\n<h1>Sntp.sys<\/h1>\n<p><strong>What it does:<\/strong> Sntp.sys (Sophos Network Threat Protection) is a kernel driver that registers for various <a href=\"https:\/\/learn.microsoft.com\/en-us\/windows\/win32\/fwp\/windows-filtering-platform-start-page\">Windows Filtering Platform<\/a> events to intercept and potentially modify network flow data. Depending on features enabled by Sophos Central Threat Protection and Web Control policies, different filters and callouts are registered.<\/p>\n<p><strong>Inputs:<\/strong> Feature configuration is communicated to the driver from one or more of the following user mode processes:<\/p>\n<ul>\n<li>SophosNtpService.exe<\/li>\n<li>SophosNetFilter.exe<\/li>\n<li>SophosIPS.exe<\/li>\n<li>SSPService.exe<\/li>\n<\/ul>\n<p>User-space processes communicate with the driver via the <a href=\"https:\/\/learn.microsoft.com\/en-us\/windows-hardware\/drivers\/wdf\/\">Windows Driver Framework<\/a>, using IOCTLs, Read, and Write. Communications to and from the driver are protected, only accepting connections from authorized and authentic Sophos processes.<\/p>\n<p><strong>Customer options:<\/strong> The filter driver intercepts network traffic by browser and non-browser processes based on the policies defined in Sophos Central. Processing of the intercepted traffic is performed in user-space by SophosNetFilter.exe and SophosIPS.exe, which may send modified content back to the driver (for example, to display a block page for malicious content).<\/p>\n<p><strong>Additional measures:<\/strong> Customers can add individual sites to their allow or block list in Sophos Central.<\/p>\n<h1>Hmpalert.sys<\/h1>\n<p><strong>What it does:<\/strong> Hmpalert.sys enforces Sophos CryptoGuard, which detects and prevents bulk encryption of files by ransomware. It also configures what exploit mitigations are enforced as processes are executed.<\/p>\n<p><strong>Inputs:<\/strong> Hmpalert.sys has a number of inputs, including several registry subkeys and IOCTLS.<\/p>\n<table>\n<tbody>\n<tr>\n<td width=\"385\">Input<\/td>\n<td width=\"124\">Description<\/td>\n<td width=\"106\">Protection<\/td>\n<\/tr>\n<tr>\n<td width=\"385\">HKLMSYSTEMCurrentControlSetServiceshmpalert<\/td>\n<td width=\"124\">Software configuration<\/td>\n<td width=\"106\">DACLs; Sophos Tamper Protected<\/td>\n<\/tr>\n<tr>\n<td width=\"385\">HKLM SYSTEMCurrentControlSetServiceshmpalertConfig<\/td>\n<td width=\"124\">Customer policy<\/td>\n<td width=\"106\">DACLs; Sophos Tamper Protected<\/td>\n<\/tr>\n<tr>\n<td width=\"385\">HKLM SYSTEMCurrentControlSetServicesSophos Endpoint DefenseEndpointFlags<\/td>\n<td width=\"124\">Sophos feature flags (various)<\/td>\n<td width=\"106\">DACLs; Sophos Tamper Protected<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><strong>Customer options: <\/strong>Customers can enable\/disable exploit mitigations and manage exclusions in Sophos Central Threat Protection policy.<\/p>\n<p><strong>Additional measures: <\/strong>N\/A<\/p>\n<h1>SophosZtnaTap.sys<\/h1>\n<p><strong>What it does:<\/strong> SophosZtnaTap.sys is a Sophos-built OpenVPN TAP driver. If the customer deploys the Sophos Zero Trust Network Access (ZTNA) agent, the driver intercepts DNS lookups for managed applications, and redirects traffic for those applications to the applicable Sophos ZTNA gateways. ZTNA applications and gateways are configured through Sophos Central policies and stored in the registry.<\/p>\n<p><strong>Inputs:<\/strong> Inputs into SophosZtnaTap.sys are via a registry subkey.<\/p>\n<table>\n<tbody>\n<tr>\n<td width=\"427\">Input<\/td>\n<td width=\"96\">Description<\/td>\n<td width=\"78\">Protection<\/td>\n<\/tr>\n<tr>\n<td width=\"427\">HKLMSOFTWARESophosManagementPolicyNetworkPerimeter<\/td>\n<td width=\"96\">Customer policy (ZTNA Applications, Gateways, and certificates)<\/td>\n<td width=\"78\">DACLs; Sophos Tamper Protected<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><strong>Customer options: <\/strong>Customers can manage their ZTNA-protected applications and gateways from Sophos Central.<\/p>\n<p><strong>Additional measures: <\/strong>N\/A<\/p>\n<h1>Gradual deployment example: CryptoGuard ExFAT<\/h1>\n<p>Sophos CryptoGuard has protected against bulk encryption on permanent disks for over a decade. Intercept X version 2024.1.1 introduced a new feature, CryptoGuard ExFAT, which extends this protection to ExFAT partitions (typically found on removable USB drives).<\/p>\n<p>CryptoGuard ExFAT development and testing took place in September 2023 through March 2024. This feature was guarded by the flag \u2018hmpa.cryptoguard-exfat.available.\u2019<\/p>\n<p>Sophos Engineering ran the software internally with the flag enabled (our \u2018Dogfood release\u2019) starting March 22, 2024.<\/p>\n<p>Intercept X version 2024.1.1 was released to Sophos, then to customers using our gradual software deployment process, between May 21, 2024 through June 6, 2024. At this stage the feature was still dormant for everyone apart from Sophos engineers.<\/p>\n<p>The \u2019hmpa.cryptoguard-exfat.available\u2019 flag was enabled using our gradual flag enablement process, between June 10, 2024 through June 26, 2024.<\/p>\n<h1>Customer control<\/h1>\n<p>Customers can select a fixed software version (<a href=\"https:\/\/community.sophos.com\/intercept-x-endpoint\/f\/recommended-reads\/139527\/sophos-central-endpoint-software-management-esm-visualization\">Endpoint Software Management<\/a>: Fixed-term support, Long-term support). This locks the software and flags until the customer selects a different software package. Customers who use the \u2018Sophos recommended\u2019 option receive new software periodically. Aside from software rollouts, they also receive gradual feature-flag enablements for new features in the software, as with a normal software release. Sophos has evolved this process to improve stability and avoid enabling new events globally for all customers.<\/p>\n<h1>Conclusion<\/h1>\n<p>Kernel drivers are fundamental to the Intercept X Advanced product \u2013 and to robust Windows endpoint security, in general &#8211; but we also acknowledge that operating in kernel-space is not without its risks.<\/p>\n<p>In this article, we\u2019ve walked through the kernel drivers in Intercept X Advanced (as of release 2024.02), what they do, how they\u2019re signed, what their inputs are, the control customers have over their management, and additional safeguards we\u2019ve put in place \u2013 including gradual, phased rollouts of new features, and exemptions to minimize the risk of disruption.<\/p>\n<p>While no safeguard can ever eliminate risk altogether, we wanted to share the details of our drivers in the interests of transparency, and to explain in depth how we approach the complex problem of trying to protect our customers from threats, in as safe a manner as possible.<\/p>\n<\/p><\/div>\n<p><a href=\"https:\/\/news.sophos.com\/en-us\/2024\/08\/01\/driving-lessons-the-kernel-drivers-in-sophos-intercept-x-advanced\/\" target=\"bwo\" >http:\/\/feeds.feedburner.com\/sophos\/dgdY<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/news.sophos.com\/wp-content\/uploads\/2024\/08\/shutterstock_1892841982.jpg\"\/><\/p>\n<p><strong>Credit to Author: Matt Wixey| Date: Thu, 01 Aug 2024 09:42:02 +0000<\/strong><\/p>\n<p>Operating in kernel-space is necessary, but risky \u2013 here\u2019s how we do it in Sophos Intercept X Advanced<\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"colormag_page_container_layout":"default_layout","colormag_page_sidebar_layout":"default_layout","footnotes":""},"categories":[10378,10377],"tags":[12048,28131,19712,20445,27030,16771],"class_list":["post-25010","post","type-post","status-publish","format-standard","hentry","category-security","category-sophos","tag-cryptoguard","tag-drivers","tag-intercept-x-advanced","tag-kernel","tag-sophos-x-ops","tag-threat-research"],"_links":{"self":[{"href":"https:\/\/www.palada.net\/index.php\/wp-json\/wp\/v2\/posts\/25010","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.palada.net\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.palada.net\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.palada.net\/index.php\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/www.palada.net\/index.php\/wp-json\/wp\/v2\/comments?post=25010"}],"version-history":[{"count":0,"href":"https:\/\/www.palada.net\/index.php\/wp-json\/wp\/v2\/posts\/25010\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.palada.net\/index.php\/wp-json\/wp\/v2\/media?parent=25010"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.palada.net\/index.php\/wp-json\/wp\/v2\/categories?post=25010"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.palada.net\/index.php\/wp-json\/wp\/v2\/tags?post=25010"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}