<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Nitin Naidu</title>
    <description>The latest articles on Forem by Nitin Naidu (@nimblenitin).</description>
    <link>https://forem.com/nimblenitin</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1217419%2F7cde627e-ddc1-4a41-a3fb-64dc3ab1a7cb.jpeg</url>
      <title>Forem: Nitin Naidu</title>
      <link>https://forem.com/nimblenitin</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/nimblenitin"/>
    <language>en</language>
    <item>
      <title>How to Prevent Secret Leaks in Your Repositories</title>
      <dc:creator>Nitin Naidu</dc:creator>
      <pubDate>Tue, 09 Jan 2024 08:38:06 +0000</pubDate>
      <link>https://forem.com/infracloud/how-to-prevent-secret-leaks-in-your-repositories-1enh</link>
      <guid>https://forem.com/infracloud/how-to-prevent-secret-leaks-in-your-repositories-1enh</guid>
      <description>&lt;p&gt;Securing secrets exposed through Git repositories is crucial, considering it is one of the common ways of becoming vulnerable to security breaches. A survey by &lt;a href="https://www.gitguardian.com/files/the-state-of-secrets-sprawl-report-2023"&gt;GitGuardian's State of Secrets Sprawl 2023 report&lt;/a&gt; states that 1 in 10 authors exposed a secret while pushing code in GitHub and 10Mn new secrets detected in public GitHub commits in just the year 2022 (an increase of 67% compared to 2021). &lt;/p&gt;

&lt;p&gt;Git repositories can be secured by enabling secret scanning in repositories for any secrets already committed so that the exposed secrets can be identified and removed. While running scans can be a first step, one can also run checks for secrets getting committed during each commit so that such potential leaks are identified even before they happen, ultimately helping to follow the “Shift left” practice during code integration. &lt;/p&gt;

&lt;p&gt;In this blog post, we will explore features in common Git hosting platforms that help avoid secret exposure. We will also explore an independent open source tool as an alternative.&lt;/p&gt;

&lt;h2&gt;
  
  
  How does secret scanning usually work?
&lt;/h2&gt;

&lt;p&gt;Secret scanning relies on regular expressions (regex) to identify patterns associated with sensitive information in code repositories. Regular expressions are sequences of characters that define a search pattern and are widely used for text matching. The secret scanning regex patterns are crafted to recognize standard formats of sensitive data, such as API keys, passwords, and access tokens.&lt;/p&gt;

&lt;p&gt;For instance, a regex pattern to catch any AWS access keys exposed might be something like AKIA[0-9A-Z]{16}. This regex pattern matches strings starting with "AKIA" followed by exactly 16 characters, each character being a digit or an uppercase letter. This could be used to identify AWS Access Key IDs, which are 20-character identifiers starting with "AKIA."&lt;/p&gt;

&lt;h2&gt;
  
  
  Securing secrets in Git hosting platforms with in-house features
&lt;/h2&gt;

&lt;p&gt;With the recognition of the increasing number of secret exposures in the Git hosting platforms, many of the platforms have taken the initiative to address this issue by providing in-house features to avoid secret exposure on their platforms, and, if already exposed, ways to proactively flag it and take necessary action. Simple settings are available in these platforms to activate functionalities such as secret scanning, alerts for secrets pushed in pull requests, and blocking any incoming pull requests with exposed secrets. &lt;/p&gt;

&lt;p&gt;Some of the platforms also have vendor partnerships to identify tool-specific vulnerabilities and actively maintain a list of patterns to recognize secrets, which are constantly updated. Utilizing AI (Artificial intelligence) is another option to extend the capabilities of secret scanning.&lt;/p&gt;

&lt;p&gt;Let's have a brief look at what functionalities the major Git hosting platforms provide, which may or not fit your requirements for a secure repository.&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Secret scanning with GitHub repository
&lt;/h3&gt;

&lt;p&gt;GitHub provides the feature to scan for secrets existing in your repository as well as to put a      restriction on pushing any secrets to the repository.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--I66ZcMjF--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ruu6k26bcgeevsoeyxpy.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--I66ZcMjF--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ruu6k26bcgeevsoeyxpy.png" alt="Enabling GitHub secret scanning" width="800" height="175"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://learn.microsoft.com/en-us/azure/devops/repos/security/configure-github-advanced-security-features?view=azure-devops&amp;amp;tabs=yaml#set-up-secret-scanning"&gt;Enabling GitHub secret scanning&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;GitHub enables secret scanning for:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Owners of public repositories on GitHub.com.&lt;/li&gt;
&lt;li&gt;Organizations with public repositories.&lt;/li&gt;
&lt;li&gt;Organizations using GitHub Enterprise Cloud for public repositories (free) and private/internal repositories (with GitHub Advanced Security license).&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;When secret scanning identifies a secret in a commit, issue description, or comment, GitHub generates an alert. Alerts are sent to the registered email and can be viewed in the Security tab of the repository.&lt;/p&gt;

&lt;p&gt;Also, GitHub allows you to enable secret push restriction at the repository setting and at the user level as a setting to avoid pushing to any repository, even if the setting is not enabled at the repository level. Check out the below links:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://docs.github.com/en/code-security/secret-scanning/configuring-secret-scanning-for-your-repositories"&gt;Enable secret scanning in GitHub repository&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://docs.github.com/en/code-security/secret-scanning/push-protection-for-repositories-and-organizations"&gt;Enable push protection for repositories&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://docs.github.com/en/code-security/secret-scanning/push-protection-for-users"&gt;Enable push protection for users&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It is interesting to note that GitHub has a feature to use &lt;a href="https://docs.github.com/en/code-security/secret-scanning/about-the-regular-expression-generator-for-custom-patterns"&gt;AI for generating regular expression&lt;/a&gt; which comes with an enterprise account. It is still in the beta stage but could help catch more secrets through regular expression. Further, you can read about &lt;a href="https://docs.github.com/en/code-security/secret-scanning/troubleshooting-secret-scanning"&gt;troubleshooting secret scanning&lt;/a&gt; to understand why secret scanning might miss your secrets while scanning. &lt;/p&gt;

&lt;h3&gt;
  
  
  2. Secret scanning with Azure DevOps repository
&lt;/h3&gt;

&lt;p&gt;Microsoft Azure provides secret scanning in the Azure DevOps repository under the GitHub Advanced Security license for the Azure DevOps repository. It provides secret scanning and push protection along with other features such as dependency scanning and code scanning. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--N00NEDdz--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mseogthxobjh5946jatl.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--N00NEDdz--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mseogthxobjh5946jatl.png" alt="Enabling Azure DevOps secret scanning" width="800" height="510"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://learn.microsoft.com/en-us/azure/devops/repos/security/configure-github-advanced-security-features?view=azure-devops&amp;amp;tabs=yaml#set-up-secret-scanning"&gt;Enabling Azure DevOps secret scanning&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;Secret scanning push protection and repository scanning are automatically enabled when you &lt;a href="https://learn.microsoft.com/en-us/azure/devops/repos/security/configure-github-advanced-security-features?view=azure-devops&amp;amp;tabs=yaml"&gt;turn on Advanced Security&lt;/a&gt;. The scan details are displayed on the Azure DevOps Advanced Security page, where the user can take action on the alert. &lt;/p&gt;

&lt;p&gt;Push protection works to stop any commits done in the command line and web interface as well. You can read the official documentation to learn more about &lt;a href="https://learn.microsoft.com/en-us/azure/devops/repos/security/github-advanced-security-secret-scanning?view=azure-devops"&gt;Azure DevOps secret scanning&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Secret scanning with Bitbucket repository
&lt;/h3&gt;

&lt;p&gt;Bitbucket scans your repositories for secrets and triggers notifications when leaked secrets are detected within new commits. Email notifications are sent to everyone involved in the commit history of the secret: the authors, committers, and the developer who pushed or merged the code containing secrets into the repositories.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--QOG8ntyP--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/j1ki8jl4hvobcgqxb50w.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--QOG8ntyP--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/j1ki8jl4hvobcgqxb50w.png" alt="Enabling Bitbucket secret scanning" width="800" height="399"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://confluence.atlassian.com/bitbucketserver083/secret-scanning-1155483983.html"&gt;Enabling Bitbucket secret scanning&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;Secret scanning is enabled by default in the Bitbucket instance, and both global and system admins can disable or enable secret scanning by modifying the configuration properties in the bitbucket.properties file. The functionality is provided without any additional cost. However, while writing this blog post, Bitbucket does not provide the functionality to proactively prevent any secrets from being committed to the repositories.&lt;/p&gt;

&lt;p&gt;You can read the official website page to learn more about this feature of the &lt;a href="https://confluence.atlassian.com/bitbucketserver/secret-scanning-1157471613.html"&gt;Bitbucket repository&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  4. Secret scanning with GitLab repository
&lt;/h3&gt;

&lt;p&gt;GitLab proactively scans Git repositories to detect potential secrets (API keys, passwords, tokens, etc.) before they're accidentally committed and exposed. Secret scanning in GitLab runs a job to scan for secrets in the repository once it is enabled. It can be configured by enabling Auto DevOps or editing .gitlab-ci.yml. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--7OGQYdT1--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/q0ugaejnv5kkfkzkwpqc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--7OGQYdT1--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/q0ugaejnv5kkfkzkwpqc.png" alt="Secret scanning in GitLab" width="800" height="161"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;GitLab provides the functionality as a combination of free and paid tier. In the free tier, one can run a scan, but certain features, such as security dashboards, are not available.&lt;/p&gt;

&lt;p&gt;You can read official documentation to learn more about &lt;a href="https://docs.gitlab.com/ee/user/application_security/secret_detection/"&gt;GitLab’s offering to secure secrets&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Open source tools
&lt;/h2&gt;

&lt;p&gt;While we explored the in-built functionality provided by Git hosting platforms, there are scenarios where users may not be able to roll the end-to-end security in place to prevent any secret exposure in the Git repository due to certain constraints such as missing features, etc. End-to-end security means not only securing secrets already exposed in the Git repository but also adding a preventive step for users while doing commits locally. Some repository platforms provide all these features, such as GitHub and Azure DevOps repository, while others do not. At the same time, one also needs to buy an additional license to enable these features on some of the platforms. A crucial point to note is that if there is no step to stop the user from committing secrets locally, the secret is anyway compromised even if you have restrictions to disallow remote commits since the secrets may leave the user’s system.&lt;/p&gt;

&lt;p&gt;To address these, we will explore open source tools as an alternative. We will check out how you can leverage Gitleaks in different ways to enforce security around secrets. The steps used for Gitleaks are similar to some of the other tools. While there are multiple tools available, one can select the tool based on the exact requirement. Below is a summary of the common tools and their features:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Feature&lt;/th&gt;
&lt;th&gt;&lt;a href="https://github.com/trufflesecurity/trufflehog"&gt;TruffleHog&lt;/a&gt;&lt;/th&gt;
&lt;th&gt;&lt;a href="https://github.com/gitleaks/gitleaks"&gt;Gitleaks&lt;/a&gt;&lt;/th&gt;
&lt;th&gt;&lt;a href="https://github.com/awslabs/git-secrets"&gt;git-secrets&lt;/a&gt;&lt;/th&gt;
&lt;th&gt;&lt;a href="https://github.com/Infisical/infisical"&gt;Infisical&lt;/a&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Language&lt;/td&gt;
&lt;td&gt;Python&lt;/td&gt;
&lt;td&gt;Go&lt;/td&gt;
&lt;td&gt;Shell&lt;/td&gt;
&lt;td&gt;Go&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Secret Detection Methods&lt;/td&gt;
&lt;td&gt;Regex patterns, keyword lists, custom detectors&lt;/td&gt;
&lt;td&gt;Regex patterns, custom patterns, machine learning&lt;/td&gt;
&lt;td&gt;Regex patterns, custom patterns&lt;/td&gt;
&lt;td&gt;AI-powered secret detection, pattern matching, anomaly detection&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Ease of Use&lt;/td&gt;
&lt;td&gt;Easy to set up and run&lt;/td&gt;
&lt;td&gt;Easy to set up and run&lt;/td&gt;
&lt;td&gt;Easy to set up and run&lt;/td&gt;
&lt;td&gt;Requires minimal user configuration&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Customization&lt;/td&gt;
&lt;td&gt;Highly customizable with custom detectors and patterns&lt;/td&gt;
&lt;td&gt;Moderately customizable with custom patterns&lt;/td&gt;
&lt;td&gt;Limited customization options&lt;/td&gt;
&lt;td&gt;Highly customizable with flexible policies and configuration options&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Integrations&lt;/td&gt;
&lt;td&gt;CI/CD pipelines, IDEs, security platforms&lt;/td&gt;
&lt;td&gt;CI/CD pipelines, GitHub, GitLab&lt;/td&gt;
&lt;td&gt;CI/CD pipelines, GitHub, GitLab&lt;/td&gt;
&lt;td&gt;Extensive integrations with DevOps tools and platforms&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Pricing&lt;/td&gt;
&lt;td&gt;Open source (free)&lt;/td&gt;
&lt;td&gt;Open source (free)&lt;/td&gt;
&lt;td&gt;Open source (free)&lt;/td&gt;
&lt;td&gt;Open source + paid (with additional features)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Overall Suitability&lt;/td&gt;
&lt;td&gt;Suitable for developers and small teams&lt;/td&gt;
&lt;td&gt;Suitable for developers and small teams&lt;/td&gt;
&lt;td&gt;Suitable for developers and small teams&lt;/td&gt;
&lt;td&gt;Suitable for enterprises and organizations with complex security needs&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;⭐ on Github&lt;/td&gt;
&lt;td&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ATnLAYEe--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://img.shields.io/github/stars/trufflesecurity/trufflehog" alt="GitHub Repo stars" width="88" height="20"&gt;&lt;/td&gt;
&lt;td&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--2A1A9ibh--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://img.shields.io/github/stars/gitleaks/gitleaks" alt="GitHub Repo stars" width="88" height="20"&gt;&lt;/td&gt;
&lt;td&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--SUtobs46--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://img.shields.io/github/stars/awslabs/git-secrets" alt="GitHub Repo stars" width="88" height="20"&gt;&lt;/td&gt;
&lt;td&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--r-FUKcvW--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://img.shields.io/github/stars/Infisical/infisical" alt="GitHub Repo stars" width="88" height="20"&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  Secret scanning with Gitleaks
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://github.com/gitleaks/gitleaks"&gt;Gitleaks&lt;/a&gt; is an open source independent tool for detecting and preventing hardcoded secrets like passwords, API keys, and tokens in Git repositories. Gitleaks is an easy-to-use, all-in-one solution for detecting secrets, past or present, in your code. It can be a great option in case one is unable to implement steps to secure leaks of secrets into the Git repository end-to-end, starting from preventing any commits made by users in the local system to scanning for any secrets already pushed to repositories.&lt;/p&gt;

&lt;p&gt;Gitleaks can be utilized to scan for secrets in:  &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;GitHub action pipeline.&lt;/li&gt;
&lt;li&gt;As a pre-commit file to scan for secrets every time a user runs a commit command.&lt;/li&gt;
&lt;li&gt;To scan for secrets in the user's local repository before and after the Git commit with the Gitleaks CLI command.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  1. Using Gitleaks in GitHub action pipeline
&lt;/h3&gt;

&lt;p&gt;A simple example of using Gitleaks in your GitHub action is as follows:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;gitleaks&lt;/span&gt;
&lt;span class="na"&gt;on&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;pull_request&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;push&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;workflow_dispatch&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;schedule&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;cron&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;0&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;4&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;*&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;*&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;*"&lt;/span&gt; &lt;span class="c1"&gt;# run once a day at 4 AM&lt;/span&gt;
&lt;span class="na"&gt;jobs&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;scan&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;gitleaks&lt;/span&gt;
    &lt;span class="na"&gt;runs-on&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;ubuntu-latest&lt;/span&gt;
    &lt;span class="na"&gt;steps&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;actions/checkout@v3&lt;/span&gt;
        &lt;span class="na"&gt;with&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
          &lt;span class="na"&gt;fetch-depth&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;gitleaks/gitleaks-action@v2&lt;/span&gt;
        &lt;span class="na"&gt;env&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
          &lt;span class="na"&gt;GITHUB_TOKEN&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;${{ secrets.GITHUB_TOKEN }}&lt;/span&gt;
          &lt;span class="na"&gt;GITLEAKS_LICENSE&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;${{ secrets.GITLEAKS_LICENSE}}&lt;/span&gt; &lt;span class="c1"&gt;# Only required for Organizations, not personal accounts.&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;a href="https://dev.to/blogs/github-actions-demystified/"&gt;GitHub Actions&lt;/a&gt; workflow will automate the process of running Gitleaks to scan a repository for sensitive information, and it can be triggered by various events such as pull requests, pushes, manual requests, or on a scheduled basis.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Using Gitleaks as a pre-commit
&lt;/h3&gt;

&lt;p&gt;Whenever a user clones the repository and tries to commit a file with a secret, it will give a warning to remove the secrets with Gitleaks as a pre-commit file. Follow the steps to implement it:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://pre-commit.com/#install"&gt;Install pre-commit&lt;/a&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Create a &lt;code&gt;.pre-commit-config.yaml&lt;/code&gt; file at the root of your repository with the following content:&lt;br&gt;
repos:&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;repos&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;repo&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;https://github.com/gitleaks/gitleaks&lt;/span&gt;
    &lt;span class="na"&gt;rev&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;v8.16.1&lt;/span&gt;
    &lt;span class="na"&gt;hooks&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;id&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;gitleaks&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Auto-update the config to the latest repository version by executing &lt;code&gt;pre-commit autoupdate&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Install with &lt;code&gt;pre-commit install&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Now you're all set! &lt;/p&gt;

&lt;h3&gt;
  
  
  3. Using Gitleaks in the user's local system
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Pre-commit&lt;/strong&gt; - The &lt;strong&gt;protect&lt;/strong&gt; command can scan uncommitted changes in a Git repository. This command should be used on developer machines to follow shift left practice in security.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;In your repository, run the below command, and it will let you know if any secrets are detected. You can use &lt;code&gt;--staged&lt;/code&gt; along with the command to check for any secrets after adding new files to the staging area.&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;gitleaks protect &lt;span class="nt"&gt;-v&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Post-commit&lt;/strong&gt; - The &lt;strong&gt;detect&lt;/strong&gt; command can be used to scan repositories, directories, and files for scanning any secrets committed &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;In your repository, run the below command, and it will let you know if any secrets are detected.&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;gitleaks detect &lt;span class="nt"&gt;-v&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Gitleaks allows you to add custom configuration rules if you want to detect a particular pattern of secrets. It can be quite helpful to control false positives or to catch any particular pattern of secrets. For installation and to read more on the tool, check out the official GitHub documentation for &lt;a href="https://github.com/gitleaks/gitleaks"&gt;Gitleaks&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Securing secrets can seem like a trivial task, but can be a crucial part of your step to have a secure repository and avoid unwanted security breaches. While some of the Git repository host platforms provide in-house features to scan your repository for secrets and also provide a barrier to any commits with secrets, some do not. You can leverage an independent open source tool like Gitleaks to prevent secret leaks in your repositories.  &lt;/p&gt;

&lt;p&gt;Furthermore, you might want to do some additional configuration work to ensure you can catch any secrets with particular patterns or ignore certain ones you do not want to flag, which are false positives. While securing the repository is one of the important measures to implement security, also check out &lt;a href="https://dev.to/blogs/implement-devsecops-secure-ci-cd-pipeline/"&gt;implementing DevSecOps to secure your CI/CD pipeline&lt;/a&gt; for achieving adequate security in place for your organization from the integration of code to deployment and monitoring.&lt;/p&gt;

&lt;p&gt;I hope you found this blog post informative and engaging. I’d love to hear your thoughts on this post. Let’s connect and start a conversation on &lt;a href="https://www.linkedin.com/in/nitin-naidu-4b86a7129/?originalSubdomain=in"&gt;LinkedIn&lt;/a&gt;. &lt;/p&gt;

&lt;p&gt;Looking for help with securing your infrastructure or want to outsource DevSecOps to the experts? Learn why so many startups &amp;amp; enterprises consider us as one of the &lt;a href="https://dev.to/devsecops-consulting-services/"&gt;best DevSecOps consulting &amp;amp; services companies&lt;/a&gt;.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Mastering Platform Engineering with Kratix</title>
      <dc:creator>Nitin Naidu</dc:creator>
      <pubDate>Sat, 25 Nov 2023 11:22:20 +0000</pubDate>
      <link>https://forem.com/infracloud/mastering-platform-engineering-with-kratix-115a</link>
      <guid>https://forem.com/infracloud/mastering-platform-engineering-with-kratix-115a</guid>
      <description>&lt;p&gt;The &lt;a href="https://dev.to/blogs/devops-to-platform-engineering-how-we-got-here/"&gt;evolution of DevOps to Platform Engineering&lt;/a&gt; is an interesting transformation occurring in the current technology landscape. &lt;a href="https://dev.to/blogs/platform-engineering-101/"&gt;Platform engineering&lt;/a&gt; includes the creation of innovative engineering solutions that help developers reduce the time spent on non-development activities such as infrastructure deployment so they can focus on application development and delivery.   &lt;/p&gt;

&lt;p&gt;The adoption of platform engineering is supported by various engineering solutions such as the IDP (Internal Development Platform) - for example Backstage. Some of these tools focus on creating a central dashboard for developers while some help platform engineers to build platform-as-a-service which could be as simple as helping to set up an environment for development by running a single command.   &lt;/p&gt;

&lt;p&gt;In this blog post, we will explore Kratix, a tool that enables you to build and deliver platform-as-a-service.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is Kratix?
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://kratix.io/" rel="noopener noreferrer"&gt;Kratix&lt;/a&gt; is an open source framework, offering platform engineers the capability to deliver platform as a product. Kratix empowers platform engineers to elevate their platform-building capabilities by harnessing the power of Kubernetes and GitOps at the same time providing means to include business logic as well in the service being offered.&lt;/p&gt;

&lt;p&gt;Unlike other frameworks and tooling which focus exclusively on application-developer experience, Kratix focuses on empowering platform engineers to build better platforms. With teams adopting platform engineering technologies, Kratix could be an asset to your platform team if they are looking to deliver day-to-day platform engineering tasks as a self-service option for developers. Kratix could be an advantage if your platform team is looking to save up their time servicing individual requests from developers. While that said, Kratix is a flexible tool and can work alongside other tools as well and supports a wide range of use cases.  &lt;/p&gt;

&lt;p&gt;For visualizing how you may use Kratix, consider a situation where your QA team wants to test an application in a particular environment. This environment may include resources like a virtual network with a database and a Kubernetes cluster. The database and Kubernetes cluster may be required to be deployed with a particular version.&lt;/p&gt;

&lt;h3&gt;
  
  
  Without Kratix
&lt;/h3&gt;

&lt;p&gt;In a typical business environment, it would involve raising a ticket and assigning it to the platform team who would then pick up the task and deliver it. This would entail platform engineers scrambling to put together the environment by firing up scripts and performing other activities while chasing the deadline given to deliver the task. &lt;/p&gt;

&lt;h3&gt;
  
  
  With Kratix
&lt;/h3&gt;

&lt;p&gt;With Kratix, one would create a Promise which contains configuration to service a request such as environment creation. This Promise would entertain any request from the developer for an environment creation, with a couple of inputs from the developer, the Promise would run in the Kubernetes cluster and create the environment. In the background, the Promise would use Terraform CRD (Custom Resource Definition), and pipeline among others to deliver the task. We will discuss more about its working further down the blog post.  &lt;/p&gt;

&lt;p&gt;While this is just a simple use case, one could leverage this tool to deliver a comprehensive platform as a product with compliance, and business logic among others. &lt;/p&gt;

&lt;h2&gt;
  
  
  Features of Kratix
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Promise
&lt;/h3&gt;

&lt;p&gt;Promise is a transparent agreement between application and platform teams by shaping and implementing well-defined abstractions which are defined in a YAML document and created by the platform team. The Promise is installed on the Kubernetes cluster to fulfill the requirements asked by the developer or any stakeholder.   &lt;/p&gt;

&lt;p&gt;What’s in a Promise?&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fj6c1y3bke2k0sh7bipag.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fj6c1y3bke2k0sh7bipag.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;API&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
The API (in Kubernetes terms, the CRD) that application developers would use to request a Resource from the Kratix Promise. It defines the options that users can configure when they request the Promise.  &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Dependencies&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
A collection of prerequisites that enable the creation of a Resource that must be pre-installed on any destination. It could be Jenkins CRD (Custom Resource Definition) and the operator required to deploy Jenkins.  &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Workflows&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Workflows allow you to define a pipeline that would run on on creation, maintenance, or update of a resource. The pipeline can constitute steps to convert user input to the operator’s expected document and much more. The pipeline can also help you to perform any tasks outside the Kubernetes cluster such as sending a Slack alert if the deployment has failed.     &lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;You can check out the &lt;a href="https://github.com/infracloudio/promise-postgresql/blob/main/promise.yaml" rel="noopener noreferrer"&gt;Promise to deploy a PostgreSQL resource&lt;/a&gt; defined in YAML configuration to understand how the API, dependencies, and workflow come together to form a Promise.  &lt;/p&gt;

&lt;h3&gt;
  
  
  Compound Promise
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://kratix.io/docs/main/guides/compound-promises" rel="noopener noreferrer"&gt;Compound Promises&lt;/a&gt; are Promises inside a Promise as a dependency which could be a way to deploy your entire stack starting from application to database packaged as one. Considering a business environment, a compound Promise could be your way of doing much more than deploying a single resource.   &lt;/p&gt;

&lt;p&gt;It could mean integrating a host of tasks starting from installing the Promise in a main cluster to installing dependencies such as CRDs in the worker cluster and also use cases like creating a golden path. It could involve creating a Promise that would include taking care of security, networking, storage, compliance, and deployment tasks while setting up an environment.&lt;/p&gt;

&lt;h3&gt;
  
  
  Kratix marketplace
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://kratix.io/marketplace" rel="noopener noreferrer"&gt;Kratix marketplace&lt;/a&gt; is a place where you can find Promises that are created by the community and the Kratix team. This means you might not have to create a Promise from scratch, you could reuse existing Promises. If the need is not exactly in line with your requirement, you can go ahead and use it as a base Promise and build upon it to customize it as per your need. You can find multiple pre-created Promises for use cases such as deploying your monitoring stack - Prometheus and Grafana to setting up RabbitMQ or Kafka.&lt;/p&gt;

&lt;h2&gt;
  
  
  Integration of Kratix with other tools
&lt;/h2&gt;

&lt;p&gt;Kratix complements many tools such as &lt;a href="https://dev.to/blogs/starting-platform-engineering-journey-backstage/"&gt;Backstage&lt;/a&gt;, &lt;a href="https://dev.to/kubernetes-school/writing-k8s-operator-kluster/"&gt;Kubernetes operators&lt;/a&gt;, and Terraform among others. For instance, using Kratix you could create a Promise that could deploy Backstage views. This would be encoding the view as a configuration in Kratix. You could deploy these views as and when required any number of times.   &lt;/p&gt;

&lt;p&gt;Kratix could be used in tandem with the Terraform operator. Deploying cloud resources could be achieved through a Promise. A developer could simply request a virtual machine creation by requesting the resource and the Promise would service it by leveraging Terraform CRD to create the resource on the cloud.&lt;/p&gt;

&lt;h2&gt;
  
  
  How does Kratix work?
&lt;/h2&gt;

&lt;p&gt;Kratix is built on top of Kubernetes. As mentioned earlier the working of Kratix revolves around a Promise. The Promise which contains the nuts and bolts to service the request would service any requests on a Kubernetes cluster. Kratix allows implementation in a single or multi-cluster architecture. In a single cluster, the Promise that fulfills requests for resource creation would be deployed in the same cluster where any incoming resource creation request would also happen. While in multi-cluster, you can have a platform cluster where Promise would be deployed and any incoming resource creation requests would be created in a separate worker cluster by the Promise. A simple visualization of Kratix in action is pictured below.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8t4n0n62deso0e9tskj9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8t4n0n62deso0e9tskj9.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Implementing Kratix
&lt;/h2&gt;

&lt;p&gt;To understand how Kratix can be implemented, we will install a Promise that fulfills a request for PostgreSQL resource creation. The Promise will be deployed on a single kind cluster called the platform cluster. In this example, you can think of the worker and platform cluster as one. This Promise consists of a base Promise from Kratix. This Promise accepts certain inputs from the user and creates the PostgreSQL resource based on the inputs. The base Promise has been updated to accept a new field ‘deployedBy’ which the user can also input during request. This field will be added as a label to the PostgreSQL resource which will be created.  &lt;/p&gt;

&lt;p&gt;The basic input parameters that the requester can pass include the name of the database, the name of the superuser who is deploying the resource, the namespace where it is getting deployed, and the label ‘deployedBy’.  &lt;/p&gt;

&lt;p&gt;The Promise for PostgreSQL is preconfigured with values such as CPU and memory limits for the PostgreSQL pod. A platform engineer could go a step beyond and also configure granular level access (reader, writer, and owner), node affinity, and many more which are specific to their business requirements. This helps the platform engineer to do away with intervention in every PostgreSQL deployment executed. At the same time, the developer has to just run a command with basic inputs to get the PostgreSQL up and running without having to worry about other database-related configurations which the developer does not have to decide upon. All of those could be pre-configured by a platform engineer in the Promise.&lt;/p&gt;

&lt;p&gt;Below are the steps to perform the said use case:  &lt;/p&gt;

&lt;h3&gt;
  
  
  Prerequisites
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;a href="https://docs.docker.com/engine/install/" rel="noopener noreferrer"&gt;Docker&lt;/a&gt; should be installed &lt;/li&gt;
&lt;li&gt;Kind should be installed (&lt;a href="https://kind.sigs.k8s.io/#installation-and-usage" rel="noopener noreferrer"&gt;find how to install kind&lt;/a&gt;)&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Steps
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Kratix Installation  &lt;/p&gt;

&lt;p&gt;You can follow the &lt;a href="https://kratix.io/docs/main/guides/installing-kratix/single-cluster" rel="noopener noreferrer"&gt;official documentation to install Kratix&lt;/a&gt; as a single cluster setup.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Get the PostgreSQL Promise.&lt;/p&gt;

&lt;p&gt;Clone the PostgreSQL Promise which is a base Promise from Kratix updated to have a new input parameter- ‘deployed by:’. Check out the &lt;a href="https://github.com/infracloudio/promise-postgresql/blob/main/promise.yaml" rel="noopener noreferrer"&gt;promise.yaml&lt;/a&gt; and &lt;a href="https://github.com/infracloudio/promise-postgresql/blob/main/resource-request.yaml" rel="noopener noreferrer"&gt;resource-request.yaml&lt;/a&gt;. The promise.yaml contains Promise configuration which is usually set by the platform team. The resource-request.yaml is the file that is used by the user to request PostgreSQL resource creation by adding the required input in the file.&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt; git clone https://github.com/infracloudio/promise-postgresql.git  
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Create pipeline image.  &lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The pipeline in Kratix Promise for our use case creates manifest file based on user input any time user requests the resource. The manifest is required by Postgres Operator to create Postgres instance. This pipeline which consists of bash script that takes input and outputs &lt;a href="https://github.com/infracloudio/promise-postgresql/blob/main/internal/configure-pipeline/resources/minimal-postgres-manifest.yaml" rel="noopener noreferrer"&gt;minimal-postgres-manifest.yaml&lt;/a&gt; will be converted into a Docker image using a &lt;a href="https://github.com/infracloudio/promise-postgresql/blob/main/internal/configure-pipeline/Dockerfile" rel="noopener noreferrer"&gt;Dockerfile&lt;/a&gt; which we will use in subsequent steps. The rationale for this approach is the reusability of the pipeline once it's transformed into an image. The pipeline, once encapsulated in the form of a Docker image, can be easily reused across different Promise.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ cd promise-postgresql/internal/configure-pipeline  

$ docker build . --tag kratix-workshop/postgres-configure-pipeline:dev  
[+] Building 0.2s (10/10) FINISHED  
docker:default  
=&amp;gt; [internal] load build definition from Dockerfile                    
=&amp;gt; =&amp;gt; transferring dockerfile: 399B                                           
=&amp;gt; [internal] load .dockerignore                                             
=&amp;gt; =&amp;gt; transferring context: 2B                                               
=&amp;gt; [internal] load metadata for docker.io/library/alpine:latest               
=&amp;gt; [1/5] FROM docker.io/library/alpine  
=&amp;gt; [internal] load build context                                              
=&amp;gt; =&amp;gt; transferring context: 127B                                             
=&amp;gt; CACHED [2/5] RUN [ "mkdir", "/tmp/transfer" ]                              
=&amp;gt; CACHED [3/5] RUN apk update &amp;amp;&amp;amp; apk add --no-cache yq                       
=&amp;gt; CACHED [4/5] ADD resources/* /tmp/transfer/                                
=&amp;gt; CACHED [5/5] ADD execute-pipeline execute-pipeline                         
=&amp;gt; exporting to image                                                        
=&amp;gt; =&amp;gt; exporting layers                                                         
=&amp;gt; =&amp;gt; writing image sha256:XX  
=&amp;gt; =&amp;gt; naming to docker.io/kratix-workshop/postgres-configure-pipeline:dev  
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Give the kind cluster - ‘platform’ access to your pipeline image.&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;kind load docker-image kratix-workshop/postgres-configure-pipeline:dev &lt;span class="nt"&gt;--name&lt;/span&gt; platform   
Image: &lt;span class="s2"&gt;"kratix-workshop/postgres-configure-pipeline:dev"&lt;/span&gt; with ID &lt;span class="s2"&gt;"sha256:XXXXX"&lt;/span&gt;    
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Install Postgres Promise on the platform cluster and verify.    &lt;/p&gt;

&lt;p&gt;Make sure you are in the promise-postgresql folder while running the below command.&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;nitin@NITIN-NAIDU:~/kratix/Promise-postgresql&lt;span class="nv"&gt;$ &lt;/span&gt;kubectl apply   
&lt;span class="nt"&gt;--filename&lt;/span&gt; Promise.yaml  
Promise.platform.kratix.io/postgresql created  
nitin@NITIN-NAIDU:~/kratix/Promise-postgresql&lt;span class="nv"&gt;$ &lt;/span&gt;kubectl get crds  
NAME                                   CREATED AT
bucketstatestores.platform.kratix.io   2023-10-17T12:48:08Z  
certificaterequests.cert-manager.io    2023-10-17T12:47:14Z  
certificates.cert-manager.io           2023-10-17T12:47:14Z  
challenges.acme.cert-manager.io        2023-10-17T12:47:14Z  
clusterissuers.cert-manager.io         2023-10-17T12:47:14Z  
destinations.platform.kratix.io        2023-10-17T12:48:08Z  
gitstatestores.platform.kratix.io      2023-10-17T12:48:08Z  
issuers.cert-manager.io                2023-10-17T12:47:14Z  
orders.acme.cert-manager.io            2023-10-17T12:47:14Z  
postgresqls.marketplace.kratix.io      2023-10-17T12:50:31Z  
Promises.platform.kratix.io            2023-10-17T12:48:08Z  
workplacements.platform.kratix.io      2023-10-17T12:48:08Z  
works.platform.kratix.io               2023-10-17T12:48:08Z  

nitin@NITIN-NAIDU:~/kratix/Promise-postgresql&lt;span class="nv"&gt;$ &lt;/span&gt;kubectl &lt;span class="nt"&gt;--namespace&lt;/span&gt; default get pods  
NAME                                 READY   STATUS      RESTARTS   AGE        minio-create-bucket-pzjsr            0/1     Completed   0          22m      
postgres-operator-64cbcd6fdf-2dpkk   1/1     Running     0          14m    
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Verifying your Kratix Promise can be fulfilled.&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;nitin@NITIN-NAIDU:~/kratix/Promise-postgresql&lt;span class="nv"&gt;$ &lt;/span&gt;kubectl apply   
&lt;span class="nt"&gt;--filename&lt;/span&gt; resource-request.yaml  
postgresql.marketplace.kratix.io/example created  

nitin@NITIN-NAIDU:~/kratix/Promise-postgresql&lt;span class="nv"&gt;$ &lt;/span&gt;kubectl get pods  
NAME                                        READY   STATUS      RESTARTS   AGE  
acid-example-postgresql-0                   1/1     Running     0          29m  
configure-pipeline-postgresql-8b724-nx2ct   0/1     Completed   0          30m  
minio-create-bucket-pzjsr                   0/1     Completed   0          53m  
postgres-operator-64cbcd6fdf-2dpkk          1/1     Running     0          45m  

nitin@NITIN-NAIDU:~/kratix/Promise-postgresql&lt;span class="nv"&gt;$ &lt;/span&gt;kubectl get pods &lt;span class="nt"&gt;--selector&lt;/span&gt; &lt;span class="nv"&gt;deployedBy&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;InfraCloud  
NAME                        READY   STATUS    RESTARTS   AGE  
acid-example-postgresql-0   1/1     Running   0          30  
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;There we go! We just deployed a customized Kratix Promise which helped to fulfill a request to install PostgreSQL in the Kubernetes cluster with the label - deployedBy and other inputs that the user provided during creation. We ran a command as a developer/user to request a resource which was successfully serviced.    &lt;/p&gt;

&lt;p&gt;Next, you can follow the &lt;a href="https://kratix.io/docs/main/guides/writing-a-promise" rel="noopener noreferrer"&gt;official documentation to create a Kratix Promise&lt;/a&gt; of your own with business-specific requirements.  &lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;With platform engineering evolving, leveraging a tool such as Kratix would be beneficial to present your platform as a service, thereby alleviating the load on platform engineers and developers.  &lt;/p&gt;

&lt;p&gt;&lt;a href="https://kratix.io/marketplace" rel="noopener noreferrer"&gt;Kratix marketplace&lt;/a&gt; is a great place for you to use Promise developed by the community out-of-the-box. While some Promises may fit your requirements right away others may require customization to better cater to your specific needs. &lt;/p&gt;

&lt;p&gt;In a nutshell, Kratix is a Kubernetes native flexible tool that could be used to create an abstraction for non-development activities for developers and serve as a handy tool for a platform engineer to create this abstraction for vivid platform engineering tasks. &lt;/p&gt;

&lt;p&gt;Feel free to connect with our &lt;a href="https://dev.to/platform-engineering-consulting/"&gt;platform engineering consulting&lt;/a&gt; team to adopt tools such as Kratix and enable a shift to adopting platform engineering in your organization. You can reach out to me on &lt;a href="https://www.linkedin.com/in/nitin-naidu-4b86a7129/" rel="noopener noreferrer"&gt;LinkedIn&lt;/a&gt; to start a conversation regarding this blog post.&lt;/p&gt;

&lt;h2&gt;
  
  
  References
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://kratix.io/docs/main/intro" rel="noopener noreferrer"&gt;Kratix official documentation&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>devops</category>
      <category>sitereliabilityengineering</category>
      <category>opensource</category>
      <category>platformengineering</category>
    </item>
  </channel>
</rss>
