<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Devops — CraftedSignal Threat Feed</title><link>https://feed.craftedsignal.io/tags/devops/</link><description>Trending threats, MITRE ATT&amp;CK coverage, and detection metadata — refreshed continuously.</description><generator>Hugo</generator><language>en</language><managingEditor>hello@craftedsignal.io</managingEditor><webMaster>hello@craftedsignal.io</webMaster><lastBuildDate>Wed, 03 Jan 2024 14:30:00 +0000</lastBuildDate><atom:link href="https://feed.craftedsignal.io/tags/devops/feed.xml" rel="self" type="application/rss+xml"/><item><title>GitHub Self-Hosted Runner Configuration Changes Detected</title><link>https://feed.craftedsignal.io/briefs/2024-01-github-runner-changes/</link><pubDate>Wed, 03 Jan 2024 14:30:00 +0000</pubDate><author>hello@craftedsignal.io</author><guid isPermaLink="true">https://feed.craftedsignal.io/briefs/2024-01-github-runner-changes/</guid><description>Detection of changes to self-hosted runner configurations in GitHub environments can indicate potential impact, discovery, collection, persistence, privilege escalation, initial access, or stealth activities.</description><content:encoded><![CDATA[<p>This threat brief focuses on detecting changes to self-hosted runner configurations within GitHub environments. Self-hosted runners are systems deployed and managed by users to execute jobs from GitHub Actions, providing flexibility and control over the execution environment. Monitoring these runners is crucial because unauthorized modifications can lead to various malicious activities, including data collection, persistence, privilege escalation, or even initial access. The rule provided detects such changes based on audit logs, requiring administrators to validate the changes through the GitHub UI for complete context. Detecting these modifications early can help prevent or mitigate potential security breaches.</p>
<h2 id="attack-chain">Attack Chain</h2>
<ol>
<li>An attacker gains unauthorized access to a GitHub organization or repository with permissions to manage self-hosted runners. This could be achieved through compromised credentials (T1078.004) or exploiting a vulnerability.</li>
<li>The attacker modifies the configuration of an existing self-hosted runner group or creates a new runner group (org.runner_group_created).</li>
<li>The attacker adds or removes runners from a runner group (org.runner_group_runners_added, org.runner_group_runner_removed, org.runner_group_updated).</li>
<li>Alternatively, the attacker registers a new self-hosted runner within the environment (repo.register_self_hosted_runner).</li>
<li>The attacker removes an existing self-hosted runner from the environment (repo.remove_self_hosted_runner, org.remove_self_hosted_runner).</li>
<li>The attacker uses the compromised runner or runner group to execute malicious code within the GitHub Actions workflow, potentially collecting sensitive data or escalating privileges.</li>
<li>The attacker leverages the compromised runner to establish persistence within the GitHub environment, ensuring continued access.</li>
<li>The attacker exploits the compromised runner to gain initial access to other systems or networks connected to the GitHub environment.</li>
</ol>
<h2 id="impact">Impact</h2>
<p>Compromised self-hosted runners can lead to a range of impacts, including data exfiltration, code injection, and privilege escalation within the targeted GitHub environment. Successful attacks could result in unauthorized access to sensitive repositories, modification of code, or deployment of malicious software. The impact can vary depending on the scope of the compromised runner and the permissions associated with it. The effects could extend beyond the GitHub environment if the compromised runner has access to other systems or networks.</p>
<h2 id="recommendation">Recommendation</h2>
<ul>
<li>Enable the audit log streaming feature in GitHub to capture events related to self-hosted runner modifications, as required by the logsource definition.</li>
<li>Deploy the Sigma rule &ldquo;Github Self Hosted Runner Changes Detected&rdquo; to your SIEM and tune for your specific environment to detect suspicious configuration changes.</li>
<li>Regularly review the audit logs in the GitHub UI to validate any detected changes to self-hosted runners and runner groups to ensure legitimate modifications.</li>
<li>Implement strict access control policies for managing self-hosted runners, limiting permissions to only authorized personnel.</li>
</ul>
]]></content:encoded><category domain="severity">low</category><category domain="type">advisory</category><category>github</category><category>self-hosted-runner</category><category>audit-log</category><category>devops</category><category>supply-chain</category></item><item><title>Execution via GitHub Actions Runner</title><link>https://feed.craftedsignal.io/briefs/2024-01-github-actions-runner-execution/</link><pubDate>Tue, 02 Jan 2024 10:00:00 +0000</pubDate><author>hello@craftedsignal.io</author><guid isPermaLink="true">https://feed.craftedsignal.io/briefs/2024-01-github-actions-runner-execution/</guid><description>Adversaries compromising GitHub Actions workflows can execute arbitrary commands on runner hosts, leading to code execution, reconnaissance, credential harvesting, or network exfiltration.</description><content:encoded><![CDATA[<p>This threat focuses on the exploitation of GitHub Actions runners by malicious actors. By gaining the ability to modify or trigger workflows in a linked GitHub repository, attackers can execute arbitrary commands on the runner host. The attack leverages the <code>Runner.Worker</code> process or shell interpreters launched via runner entrypoint scripts. Successful exploitation can lead to malicious workflow activity, including code execution, reconnaissance, credential harvesting, and network exfiltration. This presents a significant risk, particularly for organizations relying on self-hosted runners, as it allows attackers to potentially compromise the underlying infrastructure and sensitive data. The Elastic detection rule aims to identify such malicious activity.</p>
<h2 id="attack-chain">Attack Chain</h2>
<ol>
<li>An attacker gains unauthorized access to a GitHub repository linked to a self-hosted runner.</li>
<li>The attacker modifies an existing workflow or creates a new one to inject malicious commands.</li>
<li>The compromised workflow is triggered, initiating the <code>Runner.Worker</code> process on the runner host.</li>
<li>The <code>Runner.Worker</code> process executes a shell interpreter (e.g., bash, sh, zsh) via an entrypoint script.</li>
<li>The shell interpreter executes malicious commands specified in the compromised workflow, such as downloading a payload using <code>curl</code> or <code>wget</code>.</li>
<li>The downloaded payload is executed, establishing a reverse shell connection to an attacker-controlled server using <code>nc</code> or <code>socat</code>.</li>
<li>The attacker performs reconnaissance, credential harvesting, or lateral movement within the runner host and connected network.</li>
<li>Sensitive data is exfiltrated from the compromised runner host to the attacker&rsquo;s infrastructure.</li>
</ol>
<h2 id="impact">Impact</h2>
<p>A successful attack can lead to the complete compromise of the self-hosted runner environment. This could result in the theft of sensitive source code, credentials, and other proprietary information. The attack can also be used as a stepping stone for further attacks on the organization&rsquo;s internal network and infrastructure. Affected sectors include software development, DevOps, and any organization using GitHub Actions with self-hosted runners.</p>
<h2 id="recommendation">Recommendation</h2>
<ul>
<li>Deploy the Sigma rule <code>Execution via GitHub Actions Runner</code> to your SIEM to detect suspicious commands executed by the GitHub Actions Runner.</li>
<li>Monitor process creation events for commands like <code>curl</code>, <code>wget</code>, <code>nc</code>, <code>socat</code>, <code>powershell.exe</code>, <code>cmd.exe</code>, <code>bash</code>, and <code>ssh</code> spawned by <code>Runner.Worker</code> or shell interpreters with <code>entrypoint.sh</code> in their command line (see Sigma rule).</li>
<li>Implement strict access control policies for GitHub repositories and workflows to prevent unauthorized modifications.</li>
<li>Regularly review and audit GitHub Actions workflows for suspicious or unexpected commands.</li>
<li>Isolate self-hosted runners in a segmented network to limit the impact of a potential compromise.</li>
<li>Enable Sysmon process-creation logging to provide detailed process execution information for effective detection.</li>
</ul>
]]></content:encoded><category domain="severity">medium</category><category domain="type">advisory</category><category>github-actions</category><category>supply-chain</category><category>execution</category><category>devops</category></item></channel></rss>