<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Cybereason - Medium]]></title>
        <description><![CDATA[Combine managed endpoint prevention, detection, and response to secure your organization against cyber threats. Defend it all with Cybereason. - Medium]]></description>
        <link>https://medium.com/cybereason?source=rss----e6390eb687d4---4</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>Cybereason - Medium</title>
            <link>https://medium.com/cybereason?source=rss----e6390eb687d4---4</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 16 Nov 2026 16:07:26 GMT</lastBuildDate>
        <atom:link href="https://medium.com/feed/cybereason" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Code Integrity in the Kernel]]></title>
            <link>https://medium.com/cybereason/code-integrity-in-the-kernel-66b3f5cce5f?source=rss----e6390eb687d4---4</link>
            <guid isPermaLink="false">https://medium.com/p/66b3f5cce5f</guid>
            <category><![CDATA[user-mode]]></category>
            <category><![CDATA[kernel-mode]]></category>
            <category><![CDATA[windows-10]]></category>
            <category><![CDATA[authentication]]></category>
            <category><![CDATA[openssl]]></category>
            <dc:creator><![CDATA[Ido Moshe]]></dc:creator>
            <pubDate>Wed, 04 Mar 2020 14:43:15 GMT</pubDate>
            <atom:updated>2020-03-08T09:35:59.518Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>A research by </strong><a href="https://twitter.com/IdoMoshe4"><strong>Ido Moshe</strong></a><strong> and </strong><a href="https://twitter.com/lironzua"><strong>Liron Zuarets</strong></a></p><p>There are cases where you need to reliably identify a process before you allow it to take certain actions. Verifying its <a href="https://docs.microsoft.com/en-us/archive/blogs/ieinternals/everything-you-need-to-know-about-authenticode-code-signing">Authenticode signature</a> is a trusted way to do that. The user mode dll <a href="https://docs.microsoft.com/en-us/windows/win32/api/wintrust/">wintrust</a> provides an API specifically for this purpose.</p><p>But what if you need to reliably authenticate PEs in kernel mode? You may need to do this because:</p><ul><li>The user mode portion of your application is not available, either because of your early stage in the process or failures or configuration issues.</li><li>You want to gain inline access to process actions so you can prevent them if the process is not verified.</li><li>Or, the classic case of how the Windows kernel verifies drivers when they are loaded. This, obviously, must be done in kernel mode.</li></ul><p>While how to do this has been asked numerous times across many different forums, we were unable to find any implementation of this shared online.</p><p>Some suggest that you should implement it yourself, while others suggest importing OpenSSL sources into your project. Others delegate this task to code in user mode. But all of these alternatives have major drawbacks:</p><ol><li>Parsing complex ASN.1 structures is prone to errors.</li><li>Importing a lot of source code into the driver isn’t a great idea, as every bug fix in OpenSSL will result in re-importing of this code.</li><li>Going through user mode can be ineffective, and, as noted above, user mode is not always available.</li></ol><p>The ability to authenticate a file exists in the kernel mode library <strong>ci.dll</strong>. <a href="https://j00ru.vexillium.org/2010/06/insight-into-the-driver-signature-enforcement/">j00ru’s</a> research shows that ntoskrnl initializes the <em>CI</em> module through the <em>CiInitialize() </em>function, which in return fills a function pointer struct with a list of callbacks. If we can use these functions or other <em>CI</em> exports to verify the integrity and authenticity of a running process or file, this would be a game changer for kernel drivers.</p><p>Other than ntoskernel, we’ve spotted two drivers that link against ci.dll and use its exports:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/706/0*N8ODhWoDcV8yP-CY" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*O39rhyS8cSBoVYtd" /></figure><p>This means drivers can link with this module and call interesting functions like <em>CiValidateFileObject()</em>, whose name suggests that it might do exactly what we’re looking for!</p><p>In this write-up, we shed some light on <em>CI</em>,<em> </em>and provide code example that can serve as a basis for further research.</p><h3>Background Knowledge</h3><p>We recommend familiarity with the following subjects before diving into ci.dll:</p><ul><li><a href="https://docs.microsoft.com/en-us/windows/win32/debug/pe-format#the-attribute-certificate-table-image-only">PE security directory</a></li><li><a href="https://docs.microsoft.com/en-us/windows/win32/api/wintrust/ns-wintrust-win_certificate">WIN_CERTIFICATE structure</a></li><li><a href="https://tools.ietf.org/html/rfc2315">PKCS 7 SignedData structure</a></li><li><a href="https://knowledge.digicert.com/solution/SO4583.html">X.509 certificate structure</a></li><li><a href="https://en.wikipedia.org/wiki/Trusted_timestamping">Timestamping of certificates</a></li></ul><h3>The Research</h3><p>On Windows 10, <em>CI</em> exports the following functions:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/857/0*ZEy6sz4F9jGh-gQd" /><figcaption>CI exported functions</figcaption></figure><p>As we mentioned above, calling <em>CiInitialize()</em> will return a structure named <em>g_CiCallbacks </em>with even more functions (see [1], [2], [3] for more info). One of these functions, <em>CiValidateImageHeader()</em>, is used by ntoskernel.exe when a driver is being loaded to verify its signature:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/926/0*ZPGbjhU52xjQ9-ei" /><figcaption>call stack for driver signature validation during loading</figcaption></figure><p>Our research leverages the exported function <em>CiCheckSignedFile()</em> and the data structures it interacts with. As we’ll see later, these data structures appear in other <em>CI </em>functions, which allows us to expand the research to them as well.</p><h4>CiCheckSignedFile()</h4><p><em>CiCheckSignedFile()</em> receives 8 parameters, but it’s not clear by its name what these parameters may be. However, we are able to infer the parameters by inspecting the inner functions, for example, <em>MinCryptGetHashAlgorithmFromWinCertificate():</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*6swaV5A1zTDQOnmh" /><figcaption>checking the struct members of WIN_CERTIFICATE</figcaption></figure><p>We recognize the constants 0x200, 2 as being typical to the <em>WIN_CERTIFICATE </em>structure, which gives us the 4th and 5th parameters. We can find the rest of the input parameters in a similar way. The output parameters are a completely different story, as we’ll see later…</p><p>After some reversing, here’s the function signature:</p><pre>NTSTATUS CiCheckSignedFile(</pre><pre>    __In__ const PVOID digestBuffer,</pre><pre>    __In__ int digestSize,</pre><pre>    __In__ int digestIdentifier,</pre><pre>    __In__ const LPWIN_CERTIFICATE winCert,</pre><pre>    __In__ int sizeOfSecurityDirectory,</pre><pre>    __Out__ PolicyInfo* policyInfoForSigner,</pre><pre>    __Out__ LARGE_INTEGER* signingTime,</pre><pre>    __Out__ PolicyInfo* policyInfoForTimestampingAuthority</pre><pre>);</pre><p><strong>How does the function work?</strong></p><p>The caller provides the function with the file digest (buffer and algorithm type) and a pointer to the Authenticode signature.</p><p>The function verifies the signature and the digest by:</p><ol><li>Iterating over the file signatures and fetching a signature that uses the given digest algorithm.</li><li>Verifying the signature (and the certificate) and extracting the file digest that appears in it.</li><li>Comparing the extracted digest with the digest provided by the caller.</li></ol><p>In addition to verifying the file signature, the function provides the caller with various details regarding the signature that was verified.</p><blockquote>The last part is very interesting, because knowing that the file is properly signed is not enough; We also want to know <strong>who</strong> signed it. We’ll address this need in the next section.</blockquote><h4>PolicyInfo Structure</h4><p>By now, we have all the input parameters to <em>CiCheckSignedFile()</em> and are able to call it. But we know nothing about the <em>PolicyInfo </em>structure except its size (0x30 on Windows 10/x64).</p><p>Being an output parameter, we were hoping this structure would somehow provide hints about the identity of the signer and save us the trouble of extracting it ourselves. So, we call the function and inspect the memory to see what data <em>PolicyInfo </em>is filled with. The memory seems to contain an address and some large numbers.</p><p>This struct is being populated in the inner function <em>MinCryptVerifyCertificateWithPolicy2()</em>:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/790/0*uk8XTYu48SR8weF5" /><figcaption>populating PolicyInfo struct</figcaption></figure><p>Some code in this function seems to check if a value does not exceed a certain range. In the context of certificate verification, we suspect this range is the time period in which the certificate is valid, which turns out to be correct:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*zPH1cCTboQ1xg9Le" /><figcaption>checking certificate validity period</figcaption></figure><p>This leads to the following struct:</p><pre>typedef struct _PolicyInfo</pre><pre>{</pre><pre>    int structSize;</pre><pre>    NTSTATUS verificationStatus;</pre><pre>    int flags;</pre><pre>    PVOID someBuffer; // later known as certChainInfo;</pre><pre>    FILETIME revocationTime;</pre><pre>    FILETIME notBeforeTime;</pre><pre>    FILETIME notAfterTime;</pre><pre>} PolicyInfo, *pPolicyInfo;</pre><p>While the certificate validity period can be interesting, it doesn’t give us a strong identification of the signer. As we discover later, most of the information resides in the member <em>certChainInfo</em>, which we discuss next.</p><h4>CertChainInfo Buffer</h4><p>While inspecting <em>PolicyInfo’s </em>memory, we can see it points to a memory location outside the structure: a dynamically allocated buffer. This allocation is done in <em>I_MinCryptAddChainInfo()</em>, a function whose name hints about the purpose of the buffer.</p><p>We reverse this buffer by inspecting its memory layout:</p><ul><li>In the first few bytes, there are pointers to various locations inside the buffer.</li><li>In these pointed locations there are repeating patterns and pointers to locations further inside the buffer.</li><li>In these last pointed locations, we find some text that looks like excerpts from a certificate.</li></ul><p>As it turns out, this buffer contains data about the entire certificate chain, both in a parsed format (i.e. organized in sub-structures) and in a raw data format (i.e. ASN.1 blobs of certificates, keys, EKUs).</p><p>This makes it easy for the caller to check who the subject and issuer of the certificate are, what the certificate chain consists of, and what hash algorithms are used for creating each certificate.</p><p>To better explain the format of this buffer and the sub-structures we derive from it, we will show you its memory layout on a 32-bit machine. Using a 32-bit machine reduces the clutter because there are less padding bytes added for alignment requirements.</p><p>This was taken for Notepad.exe (signed by Microsoft):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*j9XJvCBYGJ-JybT0" /><figcaption>memory view of CertChainInfo buffer</figcaption></figure><p>What do we see here?</p><ul><li>At the top of the buffer there are two 4-byte numbers. One is an address that tells us where to find a series of structs of type <em>CertChainMember, </em>and one is a counter for how many of them there are (2).</li><li>The first <em>CertChainMember </em>is at address 0x89BF45C8 surrounded in black. We formalize this chunk into the following struct:</li></ul><pre>typedef struct _CertChainMember</pre><pre>{</pre><pre>    int digestIdetifier;   // e.g. 0x800c for SHA256</pre><pre>    int digestSize;        // e.g. 0x20 for SHA256</pre><pre>    BYTE digestBuffer[64]; // contains the digest itself</pre><pre>    CertificatePartyName subjectName; // pointer to the subject name</pre><pre>    CertificatePartyName issuerName;  // pointer to the issuer name</pre><pre>    Asn1BlobPtr certificate; // pointer to certificate (ASN.1)</pre><pre>} CertChainMember, * pCertChainMember;</pre><blockquote>This is what we referred to earlier as parsed data; you don’t have to parse the certificate yourself in order to fetch the subject or issuer.</blockquote><ul><li>The last few bytes of <em>CertChainMember</em> point to locations further inside the buffer.</li><li>The following 96 bytes contain the second <em>CertChainMember</em>, which is not marked for the sake of readability. It contains information about the next certificate in the chain.</li><li>After the two <em>CertChainMembers</em>, at address 0x89BF4688 surrounded in blue, there is the subject name in plain text.</li><li>At address 0x89BF4699 surrounded in orange, there is the issuer name in plain text.</li><li>At address 0x89BF46BE pointed out by a red arrow, there is the start of the ASN.1 blob that contains the actual certificate. The memory is displayed in groups of 4-bytes in little-endian, so the first two bytes of the certificate are actually 0x3082, and not 0x3131 as the drawing suggests.</li></ul><p>A similar series of pointers and structs exists for public keys and EKUs (Extended Key Usage). In other words, <em>CI</em> picks up several interesting bits of data from the certificate and makes them readily available for the caller in the form of sub-structures. But it also includes raw, unparsed data in case the caller needs something else from it.</p><p><strong>Note:</strong> Both <em>PolicyInfo</em> and <em>CertChainInfo</em> structures begin with the size of the struct. Since these structs were expanded across OS versions, you must check this size before attempting to access the other struct members.</p><p>The complete breakdown of the <em>CertChainInfo</em> buffer, along with the various sub-structures, can be found in the file <em>ci.h</em> in the repository.</p><h4>CiFreePolicyInfo()</h4><p>This function frees the <em>certChainInfo </em>buffer of <em>PolicyInfo</em>, which is allocated by <em>CiCheckSignedFile()</em> and other <em>CI</em> functions that populate the <em>PolicyInfo</em> structure. The function also resets the other struct members. It must be called in order to avoid memory leaks.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/853/0*rdeAKAnt5_h6ka0W" /><figcaption>implementation of CiFreePolicyInfo()</figcaption></figure><p>Since the function checks internally if there is memory to free, it’s safe to call it even if <em>PolicyInfo </em>was not populated.</p><h4>CiValidateFileObject()</h4><p>As we saw earlier, <em>CiCheckSignedFile()</em><strong><em> </em></strong>makes the caller work quite a bit before it can call it; The caller has to compute the file hash and parse the PE in order to provide the function with the location of the signatures.</p><p>However, the function <em>CiValidateFileObject()</em> does this work for the caller. We didn’t have to start from scratch here, as it shares some of its parameters with <em>CiCheckSignedFile()</em>:</p><pre>NTSTATUS CiValidateFileObject(</pre><pre>    __In__ struct _FILE_OBJECT* fileObject,</pre><pre>    __In__ int a2,</pre><pre>    __In__ int a3,</pre><pre>    __Out__ PolicyInfo* policyInfoForSigner,</pre><pre>    __Out__ PolicyInfo* policyInfoForTimestampingAuthority,</pre><pre>    __Out__ LARGE_INTEGER* signingTime,</pre><pre>    __Out__ BYTE* digestBuffer,</pre><pre>    __Out__ int* digestSize,</pre><pre>    __Out__int* digestIdentifier</pre><pre>);</pre><p>This function maps the file in kernel space and extracts its signature:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*VwUKawczTjsmNnRo" /><figcaption>mapping the file in system space done by CiValidateFileObject()</figcaption></figure><p>It also calculates the file digest, and, if you provide it with a non-null buffer of sufficient length, it will fill it up with this digest.</p><p>Since this function was only added in recent Windows versions, we did not focus our research on it. If we were to continue the research, we would focus on understanding its verification policy.</p><p>Note that it uses a more strict policy than <em>CiCheckSignedFile()</em>, which means it can fail verification for a PE that <em>CiCheckSignedFile()</em> approved. This may be affected by the values of parameters 2 and 3, which we haven’t reversed.</p><h3>Github Repo</h3><p>In order to demonstrate the use of ci.dll for validating PE signatures, we complemented this writeup with a <a href="https://github.com/Ido-Moshe-Github/CiDllDemo">Github repository</a>.</p><p>The repository contains a very simple driver that tries to verify the PE signature of every new process using the ci.dll functions we described here. If the file’s signature was verified successfully, the driver will parse the output PolicyInfo structure in order to extract the signing certificate and its details.</p><p>We encourage you to experiment with this repo to get your initial bearings in <em>CI</em> and expand the research.</p><h3>Linking With ci.dll</h3><p>Finally, we’d like to describe the procedure of linking with this undocumented library. While it may seem like a dry, technical aspect of using <em>CI</em>, we found it to be non-trivial, and you might need to go through the same procedure in case you expand the research with more functions.</p><p>When linking with a certain dll, you’d typically use an import library provided by the vendor. In our case, no .lib file was provided by Microsoft and we had to generate it ourselves. Once generated, this file should be added as a linker input in the project properties. The following are the steps required to produce the .lib file:</p><h4>64-bit</h4><ul><li>Get the exported functions from the dll, using dumpbin utility:</li></ul><pre>dumpbin /EXPORTS c:\windows\system32\ci.dll</pre><ul><li>Create a .def file. It will look something like this:</li></ul><pre>LIBRARY ci.dll</pre><pre>EXPORTS</pre><pre>CiCheckSignedFile</pre><pre>CiFreePolicyInfo</pre><pre>CiValidateFileObject</pre><ul><li>Generate the .lib file using the lib utility:</li></ul><pre>lib /def:ci.def /machine:x64 /out:ci.lib</pre><h4>32-bit</h4><p>Here is where the situation gets a bit trickier, since in 32-bit, function names reflect the sum of the arguments (in bytes), for example:</p><pre>CiFreePolicyInfo@4</pre><p>But ci.dll is exporting the functions without this decoration, so we need to create a .lib file that makes this translation. For that, we used [4] and [5].</p><ul><li>Create a .def file as explained in the first two stages the 64-bit section above.</li><li>Create a C++ file with functions stubs that have the same signatures but dummy bodies. You basically mimic what the vendor did when exporting the functions from their code. For example:</li></ul><pre>extern “C” __declspec(dllexport)<br>PVOID _stdcall CiFreePolicyInfo(PVOID policyInfoPtr)</pre><pre>{</pre><pre>    return nullptr;</pre><pre>}</pre><ul><li>Compile it into an OBJ file.</li><li>Generate the .lib file using the lib utility, this time with the OBJ file:</li></ul><pre>lib /def:ci.def /machine:x86 /out:ci.lib &lt;obj file&gt;</pre><p>The Github repository contains the code for the stubs.</p><h3>Summary</h3><p>This blog demonstrates how to use a subgroup of the <em>CI</em> API. This lets us validate Authenticode signatures in Kernel mode without implementing it ourselves. We hope this write-up will pave the way for further research of this dll.</p><p>We’d like to give a shout out to several people who helped bringing this write-up to life:</p><p><a href="https://twitter.com/Yuvalko3">Yuval Kovacs</a><strong>, </strong><a href="https://twitter.com/PhilipTsukerman">Philip Tsukerman</a>, <a href="https://twitter.com/m417z">Michael Maltsev</a>, <a href="https://twitter.com/hackerxbella">Allie Mellen</a>.</p><p><a href="https://www.cybereason.com/blog/code-integrity-in-the-kernel-a-look-into-cidll"><em>This research was originally posted on cybereason.com.</em></a></p><h3>References</h3><p>[1] Microsoft, <a href="https://csrc.nist.gov/csrc/media/projects/cryptographic-module-validation-program/documents/security-policies/140sp3093.pdf">FIPS 140 Validation</a></p><p>[2] Paul Rascagner, <a href="https://www.sekoia.fr/blog/windows-driver-signing-bypass-by-derusbi/">Windows Driver Signing Bypass</a></p><p>[3] j00ru, <a href="https://j00ru.vexillium.org/2010/06/insight-into-the-driver-signature-enforcement/">A quick insight into the Driver Signature Enforcement</a></p><p>[4] Jim Beveridge, <a href="https://qualapps.blogspot.com/2007/08/how-to-create-32-bit-import-libraries.html">how-to-create-32-bit-import-libraries</a></p><p>[5] Microsoft, <a href="https://jeffpar.github.io/kbarchive/kb/131/Q131313/">HOWTO: Create 32-bit Import Libraries</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=66b3f5cce5f" width="1" height="1" alt=""><hr><p><a href="https://medium.com/cybereason/code-integrity-in-the-kernel-66b3f5cce5f">Code Integrity in the Kernel</a> was originally published in <a href="https://medium.com/cybereason">Cybereason</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Activation Contexts — A Love Story]]></title>
            <link>https://medium.com/cybereason/activation-contexts-a-love-story-9666d5b1e03?source=rss----e6390eb687d4---4</link>
            <guid isPermaLink="false">https://medium.com/p/9666d5b1e03</guid>
            <category><![CDATA[activation-contexts]]></category>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[microsoft-azure]]></category>
            <category><![CDATA[security-research]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Philip Tsukerman]]></dc:creator>
            <pubDate>Mon, 02 Dec 2019 14:01:01 GMT</pubDate>
            <atom:updated>2019-12-02T14:01:01.847Z</atom:updated>
            <content:encoded><![CDATA[<h3>Activation Contexts — A Love Story</h3><p><strong>TL;DR — Microsoft Windows loads a version of the Microsoft.Windows.SystemCompatible assembly manifest into every process. By tampering with it, you can inject DLL side-loading opportunities into every process and perform COM hijacking without touching the registry. The only hitch? If the manifest is replaced by another version, it might kill your persistence by surprise.</strong></p><p>Not all research projects are created equal, and there are many that never deliver on the promise of useful information. Luckily, the confrontations with wrong assumptions, moments of feeling like an idiot, and various rabbit holes along the way are still going to teach you quite a lot, so not all is in vain. This post is about one such project, which is why it will be mostly focused on my process and not the perhaps anticlimactic conclusions.</p><p><strong>Microsoft.Windows.Actctx </strong>is an interesting COM object that provides some rather intriguing <a href="https://www.slideshare.net/enigma0x3/windows-operating-system-archaeology">capabilities</a> for attackers that have, for the most part, been covered by <a href="https://twitter.com/subtee">Casey Smith</a>. As an example, it can give you the ability to create COM objects without going through the registry. When I first started to mess around with it, I first wondered, “<em>What else can it do?</em>” and “<em>Are there any other objects which could provide a similar capability?</em>”. To answer, I did what I always do with COM objects, which is trying to find if there are any other objects or interfaces implemented by the same executable. I fired up the ever reliable <a href="https://github.com/tyranid/oleviewdotnet">OleViewDotNet</a>, searched for the ProgID, and encountered this result:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/768/1*KBL1QnUA-BSCM6LqBB4dmA.png" /><figcaption>I was really expecting more stuff here.</figcaption></figure><p>Feeling rather confused and betrayed by this, I searched the registry directly, which again gave me nothing. I tried to debug the creation of the object while setting a breakpoint on library loads, and was finally greeted by the library implementing the object — sxsoa.dll. A quick reverse engineering effort led me to the conclusion that there probably aren’t any secret extra capabilities in the dll, but now I was left with an even more interesting question …How is Windows able to find and create this object?</p><p>The first step to answering this question was to reverse the <em>CLSIDFromProgID </em>function, which translates the friendly ProgID name of the ActCtx object to a CLSID. Originally, I assumed that there would be a rather simple function that looks stuff up in the registry, and maybe has some hardcoded/otherwise registered external object lists. It turned out to be a bit more complicated than that, as there were a couple of indirect calls to class methods and interfaces for which I did not have a definition.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/910/1*pqG-1GxlWw_CAugV6hcyFQ.png" /><figcaption>The functionality isn’t immediately apparent without recovering the various interface definitions.</figcaption></figure><p>There were actually some symbols for the <em>CComCatalog </em>class returned from the <em>GetComCatalogObject</em>, which gave me some interesting clues about the different ways to “register” a COM object and might be a fun target for further exploratory research.</p><pre>struct __cppobj CComCatalog : IComCatalog, IComCatalogSCM, IComCatalogInternalImpl, IComCatalog2, IComCatalog2Internal, IWinRTCatalogInternal, IComCatalogSettings, IComCatalogTreatAsClass, IPackagedComProxyStubCatalogInternal, IPackagedComClassCatalogInternal, ITypeLibCatalogInternal</pre><pre>{</pre><pre>int m_cRef;</pre><pre>IComCatalogInternal *m_pCatalogRegNative;</pre><pre>IComCatalogInternal *m_pCatalogCOMBaseInCLB;</pre><pre>IComCatalogInternal *m_pCatalogRegX86Wow;</pre><pre>IComCatalogInternal *m_pCatalogRegArm32Wow;</pre><pre>IComCatalogInternal *m_pCatalogCLB;</pre><pre>IComCatalogInternal *m_pCatalogSxS;</pre><pre>IComCatalogInternal *m_pCatalogBuiltInActivationStore;</pre><pre>IComCatalogInternal *m_pCatalogPerUserActivationStore;</pre><pre>IComCatalogInternal *m_pCatalogInboxAppsStore;</pre><pre>Microsoft::WRL::ComPtr&lt;IComCatalogInternal&gt; m_pCatalogPrivateHive;</pre><pre>Microsoft::WRL::ComPtr&lt;IComCatalogInternal&gt; m_pCatalogPackagedComAllPackages;</pre><pre>Microsoft::WRL::ComPtr&lt;IComCatalogInternal&gt; m_pCatalogPackagedComCurrentPackage;</pre><pre>};</pre><p>My next step was to debug <em>CLSIDFromProgID </em>when creating the ActCtx object, where I discovered that the CLSID itself is supplied by the <em>CComSxSClassInfo::GetConfiguredClsid </em>function. This is when things finally started to click. SxS, which is short for <a href="https://docs.microsoft.com/en-us/windows/win32/sbscs/isolated-applications-and-side-by-side-assemblies-portal"><strong>S</strong>ide-<strong>b</strong>y-<strong>S</strong>ide Assemblies</a>, is the mechanism by which ActCtx can create COM objects without registration, and is a feature of Windows that is supposed to provide applications with the ability to use specific versions of libraries without fear of versioning conflicts that come from a different, incompatible version of a library that is suddenly registered, overriding the one needed by the application. Basically, you parse an XML-formatted manifest (just like the ones supplied to ActCtx) into a structure called an Activation Context, and the current Activation Context determines the various objects and libraries that need to be redirected to a specific implementation. ActCtx simply creates a new Activation Context using the supplied manifest, and then makes it the current context when creating a new object with the CreateObject method. A very well written post on the subject can be found <a href="https://omnicognate.wordpress.com/2009/10/05/winsxs/">here</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/804/1*dZv849ykJzF2SB9MLiCqIA.png" /><figcaption>Setting a manifest for ActCtx and using it to create a new object,</figcaption></figure><p>Returning to our main question, I didn’t immediately suspect SxS as a source of our ActCtx registration. There was absolutely no manifest provided with my test harness, so there shouldn’t be any redirections at all!</p><p>Luckily, I was able to find <a href="https://github.com/deroko/activationcontext">this awesome utility</a>, to parse and output Activation Contexts, and was immediately confronted by a curious command line option:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/817/1*uRKWiqujxgaWNKDw1W_06A.png" /></figure><p>So apparently, apart from the dynamic, per-process current Activation Context, there exists something called a “System Default Activation Context”, which defines redirections globally. This is pretty weird. I have not yet thought of a reason to use this instead of just putting the same information in the registry. Nonetheless, running the tool gives us the following output, and validates my assumptions:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/614/1*vHMNjZBmquSru4EwLNWwIw.png" /><figcaption>Finally, some info about ActCtx!</figcaption></figure><p>At least part of the mystery has been solved. Processes are able to discover and create ActCtx because it’s information is always embedded in the System Default Activation Context (let’s just agree to call it the SDAC from now on), even if the application doesn’t use a manifest. This poses an interesting opportunity, as finding and manipulating the source of this system-wide context could possibly allow us to inject redirections into pretty much every process on the machine, which could become an extremely interesting persistence mechanism!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/727/1*EUDyML3bn-wJsGjVRgQ3sg.png" /><figcaption>Activation Contexts in the PEB, including our elusive SystemDefaultActivationContextData field.</figcaption></figure><p>The most logical place to look for the origin of the SDAC is during process creation, so the most straightforward approach is to make a process spawn a child and debug them both during creation, trying to pinpoint the phase in which the SDAC appears. The <em>NtCreateUserProcess </em>syscall is a nice first suspect, as it’s where the kernel actually creates and sets up the process and its relevant structures. Alas, stepping over it and checking the state of the child shows us that this is not the right answer:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/416/1*Bxhb4rq4CAt9i12xceUjzw.png" /><figcaption>No Activation Contexts here, yet…</figcaption></figure><p>At least now we know that this happens somewhere in the user-mode part of process creation, which is why our next step is to look at the <em>CreateProcessInternal</em> function, identify interesting calls (mostly by name, at first), and then step over them to see if this fills the SDAC field of the child process. This method eventually led me to discover that the SDAC field is populated after a call to <em>ntdll!CsrClientCallServer</em>.</p><p>The <a href="https://j00ru.vexillium.org/2010/05/windows-csrss-cross-version-api-table/"><em>CsrClientCallServer</em> </a>function implements the ALPC interface between Win32 processes and the <a href="https://j00ru.vexillium.org/2010/07/windows-csrss-write-up-the-basics/">CSRSS</a> process. This means that the creation and mapping of the SDAC to the child process is done by CSRSS at the request of the parent. Instead of trying to reverse engineer the whole path between processes, adding yet another rabbit hole to the ever expanding scope of this project, I decided to simply look at csrss.exe statically, and search for some suspicious strings and function names. This quickly led me (through a bunch of other imported dlls) to the sxssrv.dll library, which fortunately contained the descriptively named <em>BaseSrvSxsDoSystemDefaultActivationContext </em>function.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/893/1*-wwH6NjFQgVJ7Tjb9eAzwQ.png" /><figcaption>Look, an assembly name!</figcaption></figure><p><em>BaseSrvSxsDoSystemDefaultActivationContext </em>checks if there already exists a section containing the SDAC in a global variable, and if it doesn’t, creates a new activation context from a hardcoded assembly name, which it then saves and maps to the child process. Afterwards, it manually updates the PEB of the child with the pointer to the SDAC, which can now be used by the child. That’s it, we finally know the exact origin of the SDAC, and can now start tampering with it. :)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/921/1*NiPT3PyNysdNYRtnbUzRJQ.png" /><figcaption>Mapping the SDAC and updating the PEB.</figcaption></figure><p>Searching for the hardcoded assembly name (a specific version of Microsoft.Windows.SystemCompatible) in the WinSxS folder yields a manifest file, which looks like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0_qK26HXkz4kOOzCZmZ2Iw.png" /><figcaption>The ActCtx “registration” is actually inside that IsolationAutomation manifest,</figcaption></figure><p>The file itself is only accessible to TrustedInstaller, but using <a href="https://docs.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-createfilea">FILE_FLAG_BACKUP_SEMANTICS</a> will allow us to modify it. Sadly, I didn’t find a way to tamper with this without admin privileges.</p><p>We can now treat this just like any manifest file. This means that you can supply additional dependencies, and even inject your own COM/DLL redirections into this manifest. Modifying this file can give you opportunities to side-load libraries into pretty much every process on the machine, and to implement COM hijacking (via COM redirection) without ever touching the registry!</p><p>Implementing these hijacks is left as an exercise to the reader. :)</p><p>There’s a serious shortcoming to this method, and it’s the fact that the hardcoded assembly file changes between updates, which means you are at risk of suddenly losing your sneaky persistence after a while. This disappointingly makes the whole thing much less useful for actual long term engagements.</p><p>While the eventual conclusions from the project aren’t exactly the *most* useful thing, and various mistakes (such as ignoring the existence of SxS in the beginning, and forgetting about csrss and sxssrv.dll) made the whole process much longer than it should have been, this was still pretty fun to do. Flailing around like this taught me a whole bunch of new things about Windows, which might be very useful for future research. :)</p><p>Have you tried messing around with activation contexts? Comment on this post with your thoughts.</p><p>FIN</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9666d5b1e03" width="1" height="1" alt=""><hr><p><a href="https://medium.com/cybereason/activation-contexts-a-love-story-9666d5b1e03">Activation Contexts — A Love Story</a> was originally published in <a href="https://medium.com/cybereason">Cybereason</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[From In-House Managed RabbitMQ to GCP PubSub]]></title>
            <link>https://medium.com/cybereason/from-in-house-managed-rabbitmq-to-gcp-pubsub-b291bf248bee?source=rss----e6390eb687d4---4</link>
            <guid isPermaLink="false">https://medium.com/p/b291bf248bee</guid>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[gcp]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[rabbitmq]]></category>
            <category><![CDATA[queue]]></category>
            <dc:creator><![CDATA[Liron Kreiss]]></dc:creator>
            <pubDate>Mon, 18 Nov 2019 16:05:02 GMT</pubDate>
            <atom:updated>2019-11-18T16:05:02.392Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Lessons learned from our journey in the world of queue technologies.</em></p><p>At Cybereason, we ran with <a href="https://www.rabbitmq.com/">RabbitMQ</a> in production as a message broker between two of our services for over a year. We had a Kubernetes cluster consisting of Rabbit containers and an autoscaler pod. The deployment was single-tenant with a cluster for each of our customers, and our DevOps team managed the entire system in-house.</p><p><em>Are we speaking your language? Check out </em><a href="https://www.cybereason.com/careers"><em>our careers page for open role</em></a><em>s.</em></p><p>In most cases, the system worked as expected, however, things got dirty at scale. We faced cluster issues with persistency and partitioning. Working at scale also brought with it costs: more clusters, more pods per cluster, more DevOps people needed to manage the system. The ongoing deployment issues, combined with the cost of the system, forced us to redesign. The first decision we made was to outsource the queuing system, since we recognized it would reduce our costs significantly.</p><p>We started to explore our options. Though RabbitMQ is one of the best queueing technologies on the market, we chose to replace it. The candidates for a successor were AWS SQS and GCP PubSub. The title already gave it away that we went with GCP PubSub, but here is why.</p><ol><li>Most of our production environments are deployed in GCP. We anticipated it would be easier to integrate due to security requirements and to enable a smoother deployment.</li><li>PubSub supports signing many subscriptions to the same topic, which matched our architecture’s future plans. In <a href="https://aws.amazon.com/sqs/">SQS</a>, you’ll have to deploy <a href="https://aws.amazon.com/sns/">SNS</a>.</li></ol><h3><strong>Proof of Concept Phase</strong></h3><p>Our team was largely unfamiliar with GCP PubSub, so we started with a proof of concept. We wanted to get familiar with the product’s capabilities and limitations before deployment. During the POC, we learned about two major parts of GCP PubSub that were crucial for us:</p><ol><li><strong>Dependency Issues</strong>: PubSub only supports specific <a href="https://developers.google.com/protocol-buffers">protobuf</a> and <a href="https://grpc.io/blog/pubsub/">grpc’s</a> versions that conflict with our monolith’s legacy versions of these packages.</li><li><strong>Deployment Process</strong>: We learned what the deployment needs in terms of providing service accounts, permissions management, etc.</li></ol><p>The POC’s definition of done was an end-to-end environment with PubSub as a replacement of RabbitMQ. No design discussions took place during that time. Reflecting back on the process, we realize that, although most proof of concept’s solely prove a concept, if it takes two engineers several days to implement, it might be wiser to bring the POC closer to the actual implementation. In this specific project, from resources to time considerations, it definitely would have made more sense to bring the POC closer to the actual implementation.</p><h3>Implementation Phase</h3><p>The implementation phase was divided into two parts: handling the dependency issues and implementing it on our monolith and microservice.</p><p><strong>Part 1: Handling Dependency Issues</strong></p><p>A huge part of implementing GCP PubSub was ensuring the smallest impact possible on the other monolith’s domains. We decided to <a href="https://maven.apache.org/plugins/maven-shade-plugin/">shade</a> the legacy protobuf and grpc versions. By shading these versions, we were able to solve the dependency issues, and more importantly, it saved us from a potentially major refactoring process to upgrade the legacy version in the monolith.</p><p><strong>Part 2: GCP PubSub Implementation in our Monolith and Microservice</strong></p><p>We had to make several design decisions after the POC ended that resulted in a major refactoring of the current system. We faced a couple challenges that affected the timeline for implementation.</p><ul><li><strong>Feature Flag:</strong> We decided to keep RabbitMQ with a feature flag, the system’s design for supporting both queues was challenging and limited us with the PubSub design.</li><li><strong>Production Bugs:</strong> During the beginning of the implementation phase, we identified a bug that required a refactoring of the original Rabbit system and raised more architecture questions.</li><li><strong>Altering the Retry Process: </strong>With GCP PubSub, you pay per request. In order to optimize costs, we altered our queue’s retry process, as shown below.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/897/1*r_auKCf_0NuWmajRyMMqAg.png" /><figcaption>Our new queue retry process after moving to GCP PubSub.</figcaption></figure><ul><li><strong>Wrapping the PubSub client: </strong>Whether to wrap the PubSub client or consume it as a library was a question. The positives to wrapping the client is that it would prevent code duplication and make PubSub more accessible to other teams in our organization. However, PubSub already has a strong Java client and wrapping it up can limit us in the future. We chose to move forward with the wrapper, but there is a chance we will discard it in the future.</li><li><strong>Independent Services: </strong>One of our goals in the project was to make our services as independent as possible by allowing them to create their own subscriptions. PubSub, however, only supports this if the service has permissions for every topic and subscription in the project. Since we are currently running in single-tenant mode, this didn’t meet our security requirements and our services are not (yet!) fully independent.</li></ul><h3>Summary</h3><p>We will be rolling out GCP PubSub to production shortly, where we will undoubtedly learn more about the impact of replacing RabbitMQ as our queue system. The lessons raised here pose some open questions about this project and its future implementation. There is never a definite “right” or “wrong” in projects like these, but documenting the process and reflecting back on it is always the best way to iteratively improve.</p><p><em>Interested in joining our team and solving these kinds of problems? Check out </em><a href="https://www.cybereason.com/careers"><em>our careers page for open role</em></a><em>s.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b291bf248bee" width="1" height="1" alt=""><hr><p><a href="https://medium.com/cybereason/from-in-house-managed-rabbitmq-to-gcp-pubsub-b291bf248bee">From In-House Managed RabbitMQ to GCP PubSub</a> was originally published in <a href="https://medium.com/cybereason">Cybereason</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Best of Black Hat 2019 — A special series of episodes on the Malicious Life podcast]]></title>
            <link>https://medium.com/cybereason/best-of-black-hat-2019-a-special-series-of-episodes-on-the-malicious-life-podcast-19136727217b?source=rss----e6390eb687d4---4</link>
            <guid isPermaLink="false">https://medium.com/p/19136727217b</guid>
            <category><![CDATA[security]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[blackhat]]></category>
            <category><![CDATA[malicious-life]]></category>
            <category><![CDATA[podcast]]></category>
            <dc:creator><![CDATA[Ran Levi]]></dc:creator>
            <pubDate>Fri, 25 Oct 2019 14:38:39 GMT</pubDate>
            <atom:updated>2019-10-25T14:39:21.765Z</atom:updated>
            <content:encoded><![CDATA[<h3>Best of Black Hat 2019 — A special series of episodes on the Malicious Life podcast</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6ApxfPhIxiP91b8rh39Sag.jpeg" /></figure><p>This year’s Black Hat wasn’t very much fun for me. The problem wasn’t the convention, which was engaging and full of interesting people as usual. The problem was me. More specifically, it was the nasty bug that I caught on the flight to Las Vegas. I was quite sick and miserable for most of the three-day conference. Fortunately, I had just enough strength left in me to interview some of the conference’s best speakers. I’ve used those interviews to create a special series of episodes for <a href="https://malicious.life/">the Malicious Life podcast</a>.</p><p>For those who aren’t familiar with our show, <a href="https://www.cybereason.com/malicious-life">Malicious Life</a> tells the lesser-known stories of cyber security. It’s hosted by me, <a href="http://www.linkedin.com/in/ranlevi">Ran Levi</a>, and includes commentary from real hackers, security experts, journalists, and politicians.</p><p>So far, Malicious Life has recorded more than 50 episodes. We’ve covered some of the most interesting hacks and malware in the history of cyber security. Our favorites cover events like <a href="https://malicious.life/episode/episode-7-stuxnet-part-1/">Stuxnet</a>, the <a href="https://play.acast.com/s/cyber/c2a58953-1344-4750-9043-218193577648">Ashley Madison hack</a>, and the <a href="https://malicious.life/episode/episode-45/">Equifax data breach</a>. With the Black Hat 2019 series, we continue to report on some of the most exciting work in our field.</p><h3>Episode 1: Responding to a Cyber Attack with Missiles</h3><p>Guests: <a href="https://twitter.com/mikko?ref_src=twsrc%5Egoogle%7Ctwcamp%5Eserp%7Ctwgr%5Eauthor">Mikko Hypponen</a> and Prof. Gen. (Ret.) Isaac Ben Israel</p><p><a href="https://malicious.life/episode/episode-54/">Link To Episode</a></p><p>Is the use of deadly force a legitimate — and practical — response to cyber-attacks? I interviewed <a href="https://mikko.hypponen.com/">Mikko Hypponen</a>, a well-known veteran of cyber security, to hear his thoughts on the future of kinetic and cyber warfare. This episode includes his thoughts and those of Prof. Ben Israel, the “founding father” of Israel’s cyber forces. Tune in to hear his answers to questions like:</p><p>· What lessons did Israel learn from the Yom Kippur War of 1973 about the best way to manage its offensive cyber units?</p><p>· How can governments ‘signal’ to their opponents their cyber power, without actually deploying cyber weapons?</p><h3>Episode 2: Detecting Deep Fakes With Mice (Airs Nov. 24th)</h3><p>Guests: George Williams &amp; Alex Comerford (Data Science), Jonathan Saunders (Univ. of Oregon)</p><p>In the last few years, we’ve seen more and more Deep Fakes, those AI-generated videos and images that are breathtakingly and even eerily realistic. Many of those Deep Fakes feature human-like speech, and that’s what I discuss with my three guests in this episode. We cover some of the most exciting methods of Deep Fake detection, including — believe it or not — using mice to tell human and artificial voices apart. You don’t want to miss this one.</p><h3>Episode 3: Cyber Insurance (Airs, Nov. 14th)</h3><p>Guest: Jeffrey Smith (Cyber Risk Underwriters)</p><p>Cyber insurance has always had a shaky reputation among security professionals. Even Black Hat used to blacklist talks about cyber insurance. When I learned about that shady part of the conference’s history, I had to make an episode about it.</p><p>The episode features expert Jeffrey Smith and his frank discussion of why insuring against hacks and breaches can be challenging. Tune in to find out:</p><p>· Why the cyber insurance industry has grown out of its early hardships</p><p>· Why small and medium-sized businesses need the services that the industry has to offer</p><h3>Episode 4: Human Side Channels (Airs Dec. 14)</h3><p>Guest: Matt Wixey (PwC)</p><p>Cybersecurity has always used ‘side channels’ for gathering important information. For example, most professionals in the industry know that your browser and screen resolution can identify you among thousands of other anonymous users.</p><p>Matt Wixey, my guest for this episode, suggests a different set of such metadata: a human side channel. Through his research, he’s learned that the speed and style of a hacker’s typing can reveal a lot about an attacker. Even the exact BASH switches an attacker uses, such as set -o vs. set -O, can help a defender identify an attack as it happens. Join us as we explore the intersection of computer science, psychology, and old-school police detective work.</p><p>This is a series that you don’t want to miss. <a href="https://malicious.life/feed/podcast/">Subscribe today</a> and join us on the cutting edge.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=19136727217b" width="1" height="1" alt=""><hr><p><a href="https://medium.com/cybereason/best-of-black-hat-2019-a-special-series-of-episodes-on-the-malicious-life-podcast-19136727217b">Best of Black Hat 2019 — A special series of episodes on the Malicious Life podcast</a> was originally published in <a href="https://medium.com/cybereason">Cybereason</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[3 Straightforward Ways to Build a SOC]]></title>
            <link>https://medium.com/cybereason/3-straightforward-ways-to-build-a-soc-a9d8962f3e42?source=rss----e6390eb687d4---4</link>
            <guid isPermaLink="false">https://medium.com/p/a9d8962f3e42</guid>
            <category><![CDATA[opsec]]></category>
            <category><![CDATA[security-operation-center]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[security]]></category>
            <category><![CDATA[infosec]]></category>
            <dc:creator><![CDATA[Jacob Berry]]></dc:creator>
            <pubDate>Thu, 15 Aug 2019 12:59:57 GMT</pubDate>
            <atom:updated>2019-08-15T13:13:51.374Z</atom:updated>
            <content:encoded><![CDATA[<p>Two of the key capabilities defenders must have include <a href="https://www.cybereason.com/platform">detection and response</a>. Detection and response often take the form of a security operations center (SOC). A SOC is the holistic approach to the people, processes, and technology involved in detecting, analyzing, and engaging the first level response to a cybersecurity incident. SOCs start with this core mission and employ a variety of individuals from junior level analysts to senior malware analysts.</p><p>In many organizations, a SOC is built organically and inherits responsibilities that lead to additional processes to manage. Many factors contribute to SOCs, and it’s important to understand there is no one-size-fits-all approach to the SOC. The size of the SOC depends on the organization’s security maturity level and relies on the goals of the overall organization. It needs to be properly aligned to protect the fundamental risk scenarios that impact an organization, whether compliance related or leveled up to business risk.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*JljR4RlQtD_q0SEM" /></figure><p>SOCs are the first line of defense for businesses when addressing cyber threats. At the very least, they handle the beginning stages of containment actions during an incident. They actively monitor the environment, hunt for threats, and establish plans to escalate breaches or initiate incident response procedures.</p><p>When trying to address the question “Is my SOC as effective as possible?”, one of the most challenging components you will face is staffing. Some common, difficult to answer questions can include:</p><ul><li>How do you find the right people?</li><li>How do you retain the right people?</li><li>Do you need to staff overnight or on weekends?</li><li>What responsibility do you want to directly manage?</li><li>What work can you outsource?</li><li>How do these decisions impact your overall mission to effectively stop a breach before damage occurs?</li></ul><p>Staffing is a complex issue for any department that just compounds with highly intensive security roles.</p><p><strong><em>We’re holding a </em></strong><a href="https://www.cybereason.com/fridaysessions"><strong><em>security sessions and seasonals event</em></strong></a><strong><em> in our office Friday — come meet up with me. I want to hear your thoughts on the state of the SOC.</em></strong></p><h4>How Do You Build an Effective SOC?</h4><p>What type of SOC you want to build depends on the resources available to you and the experience of your team. It’s critical to <a href="https://www.cybereason.com/the-right-roles-for-siem-edr-soar-in-the-soc">consider the technologies</a> and processes you want to use.</p><p>What skill level is needed to use these technologies? What experience is required to handle the processes you envision or have established?</p><p>These questions become more difficult to answer as you consider additional factors, such as the need for security 24/7, across geographies. If you have advanced resources and an existing team, you may be more inclined to have an in-house SOC. In contrast, with limited resources and a small team, you are more likely to have a fully outsourced SOC.</p><p>There are three common ways to build a SOC:</p><ul><li><strong>In-house:</strong> The security organization owns hiring and defines all processes.</li><li><strong>Semi-outsourced:</strong> Some staff and processes are outsourced.</li><li><strong>Outsourced:</strong> All hiring and most processes are a third-party responsibility.</li></ul><h4>Building an In-house SOC</h4><p>Building an in-house SOC gives you total control <a href="https://www.cybereason.com/unleashing-the-true-potential-mitre-attck?hsCtaTracking=d8b5fccc-df9b-4621-86be-9d72ad635e7f%7C31de2ef9-bf97-4290-a751-4c3ec822e56c">over the security process</a>. This can be invaluable for organizations with existing, knowledgeable teams that use customized workflows and have a complete understanding of their environment. These teams are typically well-funded, have multiple junior and senior analysts, and may even have a dedicated <a href="https://www.cybereason.com/blog/how-to-generate-a-hypothesis-for-a-threat-hunt-techniques">threat hunting team</a>.</p><p>The difficulty with an in-house SOC comes from resource requirements. In-house SOCs need to be managed and require funding and other resources from the larger organization. They need to be staffed with the right talent, and they need to have outlined <a href="https://www.forbes.com/sites/samcurry/2019/05/29/security-leadership-by-scrum/">metrics for success</a>. In-house SOCs are most valuable for organizations that are ready to handle the responsibility and have the time to develop a critical department that has the resources to succeed.</p><p><strong>Pros:</strong> Granular control of the security process and of the team.</p><p><strong>Cons: </strong>Takes a long time to establish, to hire, and train the team.</p><blockquote><strong>Insight from the Cybereason CSO, Sam Curry:</strong></blockquote><blockquote><em>To some degree, the talent gap in cybersecurity is a self-inflicted wound: we have both designed for only the best among us and have required that before becoming a security expert analysts have to become experts in dozens of subskills. The path can be made more welcoming and approachable. Our goal should be to take anyone with an inclination and no technical phobia and get them started on the cybersecurity path: doing security early and learning as they go. The tools could be made more approachable and more transparent to the tasks of security with design changes and focus on users without falling afoul of leaky abstraction and not understanding how it works under the hood. Our goal should be to take a math major, a physics major, a history major or a curious car mechanic who has the right </em><strong><em>attitude</em></strong><em> and make a novice on the path to an intermediate analyst within 6 months if not less!</em></blockquote><blockquote><a href="https://www.forbes.com/sites/samcurry/#39a7229324b6">Read his blog on Forbes.</a></blockquote><h4>Building a Semi-outsourced SOC</h4><p>Building a semi-outsourced SOC gives you control over your security process with the added benefit of an expert, external team on hand. This gives you the flexibility to assign night shifts or other inconvenient shifts like weekends and holidays, to an external team you can trust to handle incidents. It also gives you more freedom on the hiring process, as you can have a smaller internal team augmented with a larger external team.</p><p>For example, having a semi-outsourced SOC is a great option for security teams that want to be fully in-house, but aren’t ready for the responsibility yet. Starting with an inexperienced team that is backed by a group of experts can give your team the freedom to grow into expert analysts without the risk.</p><p>Alternatively, an experienced internal team can benefit and retain talent by focusing on critical events while offloading monotonous work to an external team. This is a great way to help prevent internal team burn out. This strategy can also be used to up-level a SOC to address incident response issues, or allow for a hybrid team that can handle advanced analysis, incident response, and threat hunting.</p><p><strong>Pros: </strong>Flexibility, the opportunity for growth, and improved talent retention<strong>.</strong></p><p><strong>Cons: </strong>Takes time to hire a team and manage talent. May also have additional cost considerations.</p><h4>Building an Outsourced SOC</h4><p>An outsourced SOC is the<a href="https://www.cybereason.com/platform/managed-detection-response-mdr"> total handoff of the security operations center</a> to an external third party. Fully outsourced SOCs are convenient for organizations that don’t want to hire security analysts or establish processes to build a security program. You offload the work onto a managed service that has an <a href="https://www.cybereason.com/nocturnus">expert team ready</a> to take care of the heavy lifting for you. If you want, you can hire in-house threat hunters and incident responders or outsource those as well. This is the hands-off, let-me-be-safe approach to cybersecurity.</p><p>While a fully outsourced SOC is an attractive option, the complexity of some environments and the lack of control can make achieving security objectives more challenging. While this is not the case with every environment, it’s important to have a good understanding of the risk profile of your environment and how to detect an attack so you can choose the appropriate way to build a SOC for your organization.</p><p><strong>Pros: </strong>Much easier to operate, with excellent risk management with less investment from your organization.</p><p><strong>Cons:</strong> Can be difficult to implement in complex environments.</p><blockquote><strong>Insight From Justin Bell, Senior Engineer, Trustwave:</strong></blockquote><blockquote><em>At Trustwave, we have 9 SOCs distributed globally which allows us to provide 24/7x365 coverage for triage and response no matter what time or where in the world assets are located.</em></blockquote><blockquote><em>We provide a portal that allows direct interaction with analysts, view data and perform actions with your security services/devices ensuring you still close with the defenders protecting your organization</em></blockquote><blockquote><em>Another advantage to an outsourced SOC is the deep expertise access you get. Our Spiderlab’s team is composed of 250+ researchers, ethical hackers and incident responders. This deep bench alleviates an organization from having to find the right talent and freeing up management to focus on other pressing security issues.</em></blockquote><h3>Outsource Wisely</h3><p>With the existing talent shortage, it makes sense for the majority of organizations to incorporate some form of outsourcing into their SOC. These are the three effective models for establishing a SOC, though they are not strict guidelines for how every security team must organize. Each security team has different needs, and it’s important to customize your SOC accordingly. What are your thoughts on SOCs? Do you outsource?</p><p><strong><em>Leave a comment below, or </em></strong><a href="https://www.cybereason.com/fridaysessions"><strong><em>join me this Friday</em></strong></a><strong><em> at our Boston headquarters for Security Sessions and Seasonals. Let’s chat about your SOC and your favorite IPA.</em></strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a9d8962f3e42" width="1" height="1" alt=""><hr><p><a href="https://medium.com/cybereason/3-straightforward-ways-to-build-a-soc-a9d8962f3e42">3 Straightforward Ways to Build a SOC</a> was originally published in <a href="https://medium.com/cybereason">Cybereason</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>