<?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>DEV Community: Renjith Ravindranathan</title>
    <description>The latest articles on DEV Community by Renjith Ravindranathan (@mysticrenji).</description>
    <link>https://dev.to/mysticrenji</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.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F453432%2Fdc00ab0a-cc97-44ca-8f92-3fe9347bdadb.png</url>
      <title>DEV Community: Renjith Ravindranathan</title>
      <link>https://dev.to/mysticrenji</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/mysticrenji"/>
    <language>en</language>
    <item>
      <title>Building a Configuration-Driven Databricks Platform on AWS (Part 1)</title>
      <dc:creator>Renjith Ravindranathan</dc:creator>
      <pubDate>Thu, 22 Oct 2026 16:46:36 +0000</pubDate>
      <link>https://dev.to/mysticrenji/provisioning-databricks-on-aws-with-github-actions-part-1-a-configuration-driven-approach-59j6</link>
      <guid>https://dev.to/mysticrenji/provisioning-databricks-on-aws-with-github-actions-part-1-a-configuration-driven-approach-59j6</guid>
      <description>&lt;p&gt;If your platform team is bottlenecked by manual AWS console clicks and fragmented Terraform scripts every time someone needs a new Databricks workspace, you have a scaling problem. &lt;/p&gt;

&lt;p&gt;A request for another Databricks workspace involves more than creating the workspace itself. Someone must choose the AWS network, configure storage and IAM, assign access, decide which compute options teams can use, and make sure the next workspace follows the same rules. &lt;/p&gt;

&lt;p&gt;Terraform can describe those resources. The harder problem is deciding how people request changes, how those requests become Terraform inputs, and how the changes reach AWS and Databricks. &lt;/p&gt;

&lt;p&gt;A configuration-driven approach gives those decisions a consistent, repeatable path:&lt;/p&gt;

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

&lt;p&gt;This article explains that design using the &lt;a href="https://github.com/mysticrenji/databricks-platform" rel="noopener noreferrer"&gt;Databricks Platform Engineering repository&lt;/a&gt;. Part two walks through setting up its development deployment from zero. &lt;/p&gt;

&lt;p&gt;The repository has working development automation, with additional infrastructure and account provisioning for staging. Its production files are configuration scaffolds. That distinction matters when deciding which parts to reuse.&lt;/p&gt;

&lt;h2&gt;
  
  
  Make the workspace request explicit
&lt;/h2&gt;

&lt;p&gt;Suppose a platform team needs a development workspace for data engineers, analysts, and machine learning users. The request includes several decisions:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  Which AWS account and region will host it?&lt;/li&gt;
&lt;li&gt;  Which address ranges belong to its network?&lt;/li&gt;
&lt;li&gt;  Which S3 bucket will hold workspace storage?&lt;/li&gt;
&lt;li&gt;  Which groups receive workspace access?&lt;/li&gt;
&lt;li&gt;  Which compute policies and SQL warehouses are available?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These decisions can live in reviewed configuration files. In this implementation, each deployment has two identifiers:&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;version&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;2&lt;/span&gt;

&lt;span class="na"&gt;environment&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;dev&lt;/span&gt;

&lt;span class="na"&gt;workspace&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;demo&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is an excerpt; the complete document also contains AWS, Databricks, network, storage, and feature settings. The pair &lt;code&gt;dev/demo&lt;/code&gt; identifies the deployment, determining resource naming, Terraform state paths, and GitHub Environment names. The cloud workspace name becomes &lt;code&gt;dev-demo&lt;/code&gt;. &lt;/p&gt;

&lt;p&gt;That gives the platform a repeatable way to distinguish &lt;code&gt;dev/demo&lt;/code&gt;, &lt;code&gt;dev/sandbox&lt;/code&gt;, and &lt;code&gt;staging/shared&lt;/code&gt;. A configuration filename alone does not establish that identity. Adding another workspace means defining another deployment within supported boundaries, then running the same provisioning machinery.&lt;/p&gt;

&lt;h2&gt;
  
  
  Give configuration a clear owner
&lt;/h2&gt;

&lt;p&gt;Configuration becomes difficult to govern when every file can change every setting. A strong developer experience requires separating platform decisions from team requests:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;platform/
  environments/
  compute/
  access/
  terraform-inputs/

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

&lt;/div&gt;



&lt;p&gt;Platform administrators own the environment definitions, approved compute settings, personas, and access boundaries. Workload authors request a persona and access to existing data through &lt;code&gt;workloads/&lt;/code&gt;. They do not choose arbitrary infrastructure settings or create their own compute policies through those requests. &lt;/p&gt;

&lt;p&gt;For example, the platform can define an analyst persona with SQL access. A team can request that persona without deciding the SQL warehouse size or receiving unrestricted cluster creation. &lt;/p&gt;

&lt;p&gt;Some settings still use supplemental JSON under &lt;code&gt;platform/terraform-inputs/&lt;/code&gt;. Those inputs are allowlisted and cannot override settings owned by environment YAML. This is a practical way to extend the configuration model gradually. A setting should move into YAML when its meaning and validation rules are clear.&lt;/p&gt;

&lt;h2&gt;
  
  
  Use Python to validate the request
&lt;/h2&gt;

&lt;p&gt;YAML is easy to read, but readability does not make it safe to deploy. &lt;/p&gt;

&lt;p&gt;Consider a configuration that contains valid YAML syntax but assigns overlapping subnet ranges. Another might name one AWS account while pointing to a deployment role in a different account. Both should fail before cloud authentication.&lt;/p&gt;

&lt;p&gt;The Python adapter checks the document against a schema and applies additional semantic checks. The repository rejects unknown fields, duplicate keys, YAML aliases, invalid types, overlapping subnets, and role/account mismatches. Once validation succeeds, Python renders the inputs consumed by Terraform.&lt;/p&gt;

&lt;p&gt;The responsibilities stay clear:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;strong&gt;YAML:&lt;/strong&gt; declares the requested configuration&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Python:&lt;/strong&gt; validates and translates that configuration&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Terraform:&lt;/strong&gt; manages the resources&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Actions:&lt;/strong&gt; controls execution&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The runners also use isolated copies of the Terraform source. Local variable files, backend files, cached provider directories, and Terraform environment overrides do not silently become deployment inputs. That makes the committed configuration a more dependable description of what the workflow will use.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;⚠️ Validation Limitations:&lt;/strong&gt; Offline validation still has limits. It cannot prove that an S3 bucket name is available, that the deployment identity has every required permission, or that an AWS quota allows another resource. Those checks need live planning or service calls.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Split Terraform state by responsibility
&lt;/h2&gt;

&lt;p&gt;One Terraform state for the whole platform is easy to begin with, but as the platform grows, that state accumulates resources with different owners and different dependencies. &lt;/p&gt;

&lt;p&gt;This implementation uses separate execution roots:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;code&gt;01-infra&lt;/code&gt; owns AWS networking, IAM, storage, optional encryption, and monitoring.&lt;/li&gt;
&lt;li&gt;  &lt;code&gt;02-account&lt;/code&gt; owns Databricks workspace creation, account groups, workspace assignments, and budgets.&lt;/li&gt;
&lt;li&gt;  &lt;code&gt;02-workspace-access&lt;/code&gt; owns dev/demo workspace feature entitlements.&lt;/li&gt;
&lt;li&gt;  &lt;code&gt;03-data-access&lt;/code&gt; owns Unity Catalog integration, storage credentials, locations, catalogs, schemas, and volumes.&lt;/li&gt;
&lt;li&gt;  &lt;code&gt;04-workspace&lt;/code&gt; owns workspace configuration, including policies, warehouses, and jobs.&lt;/li&gt;
&lt;li&gt;  &lt;code&gt;05-permissions&lt;/code&gt; owns approved grants on existing data objects.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Each root owns a separate state file. For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;databricks/dev/demo/01-infra.tfstate
databricks/dev/demo/02-account.tfstate
databricks/dev/demo/02-workspace-access.tfstate
databricks/dev/demo/04-workspace.tfstate
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The state namespace contains both deployment identifiers. The runner rejects keys outside the selected namespace. The account root reads the infrastructure outputs and verifies their environment and workspace identity. It does not simply trust that whichever state file it receives belongs to the requested deployment.&lt;/p&gt;

&lt;p&gt;Separate state also preserves a useful boundary between Databricks account APIs and workspace APIs. Workspace creation uses the account provider. Workspace configuration uses the workspace provider after the workspace exists. &lt;/p&gt;

&lt;p&gt;The tradeoff is orchestration: these roots have dependencies, so they must run in the right order.&lt;/p&gt;

&lt;h2&gt;
  
  
  Follow the actual dependency chain
&lt;/h2&gt;

&lt;p&gt;The current dev/demo provisioning path is:&lt;br&gt;
&lt;/p&gt;

&lt;pre data-lang="mermaid"&gt;&lt;code&gt;graph LR
    A[01-infra] --&amp;gt; B[02-account]
    B --&amp;gt; C[02-workspace-access]
    C --&amp;gt; D[04-workspace compute]&lt;/code&gt;&lt;/pre&gt;



&lt;p&gt;The infrastructure root creates the AWS foundation. The account root uses its outputs to create the workspace and configured groups. The entitlement root then configures which workspace features those groups can use. Finally, the compute runner creates the approved policies, SQL warehouse configuration, and associated permissions.&lt;/p&gt;

&lt;p&gt;This path does not require datasets or a metastore to exist. The dev/demo compute runner deliberately avoids a dependency on &lt;code&gt;03-data-access&lt;/code&gt; when it has no Unity Catalog volume references. &lt;/p&gt;

&lt;p&gt;Data setup follows its own dependency path. If compute policies reference a Unity Catalog volume for logs or an init script, that storage must exist first. The important rule is to express real dependencies. Putting every task into one long workflow can create unnecessary prerequisites, while running everything independently can leave later stages without the IDs and resources they need.&lt;/p&gt;

&lt;h2&gt;
  
  
  Treat access as several decisions
&lt;/h2&gt;

&lt;p&gt;“Give the engineering team access” is too vague for automation. There are several separate questions:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt; Does the group exist at account level?&lt;/li&gt;
&lt;li&gt; Is it assigned to this workspace?&lt;/li&gt;
&lt;li&gt; Which workspace features can it use?&lt;/li&gt;
&lt;li&gt; Which compute resources can it use?&lt;/li&gt;
&lt;li&gt; Which data can it read or change?&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The repository gives these decisions different owners. &lt;/p&gt;

&lt;p&gt;For dev/demo, &lt;code&gt;02-account&lt;/code&gt; creates the admin, engineer, analyst, and ML groups and assigns their workspace roles. Group membership remains external. The entitlement root controls workspace, SQL, and unrestricted compute-creation capabilities. &lt;/p&gt;

&lt;p&gt;The compute root grants access to approved policies or warehouses. Engineers receive access to &lt;code&gt;engineering-standard&lt;/code&gt;; ML users receive access to &lt;code&gt;ml-standard&lt;/code&gt;. Analysts receive access to the analytics SQL warehouse without a cluster-policy grant. &lt;/p&gt;

&lt;p&gt;Unity Catalog grants remain separate. A warehouse permission does not grant permission to read a table, and a workspace role does not replace catalog and schema privileges. Effective access also depends on other memberships, direct grants, workspace defaults, and administrator privileges. Testing only the declared persona configuration can miss permissions granted through another route.&lt;/p&gt;

&lt;h2&gt;
  
  
  Keep pull request checks credential-free
&lt;/h2&gt;

&lt;p&gt;A configuration pull request should receive useful feedback before anyone starts a deployment. &lt;/p&gt;

&lt;p&gt;The validation workflow runs Python tests, validates development and staging templates, renders generated inputs, checks Terraform formatting, and runs mocked Terraform tests. &lt;strong&gt;It does not need AWS or Databricks credentials.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;That allows the repository to test invalid configuration and ownership rules without giving pull request code access to the platform. Live planning is a different operation. It can read state and query services, so it runs through manual workflows with the appropriate identities and target settings. &lt;/p&gt;

&lt;p&gt;A plan-only run also depends on existing upstream resources. For a new deployment, the account plan cannot use infrastructure outputs that have not been created yet. Feature planning cannot resolve groups that do not exist. &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;💡 The Reality of Planning:&lt;/strong&gt; “Plan only” means no changes are applied. It does not mean Terraform can plan every dependent layer before the first layer exists.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Authenticate to AWS and Databricks separately
&lt;/h2&gt;

&lt;p&gt;The workflow talks to two control planes, each with its own identity. &lt;/p&gt;

&lt;p&gt;For AWS, GitHub Actions uses OpenID Connect to assume an IAM role and obtain temporary credentials. The role trust policy restricts which repository and GitHub Environment subjects can assume it. GitHub documents this flow in its &lt;a href="https://docs.github.com/en/actions/how-tos/secure-your-work/security-harden-deployments/oidc-in-aws" rel="noopener noreferrer"&gt;AWS OIDC guide&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;The trust policy and the role permissions answer different questions:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  The trust policy decides who may assume the role.&lt;/li&gt;
&lt;li&gt;  The permission policies decide what the role may do.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For Databricks, the supplied workflow uses a service principal with OAuth machine-to-machine credentials. Its client secret lives in GitHub Environment secrets. &lt;/p&gt;

&lt;p&gt;Databricks also supports workload identity federation, but that is not the authentication path configured by these workflows. Changing to federation requires changes to the integration, rather than simply deleting the existing secret. See the &lt;a href="https://docs.databricks.com/aws/en/dev-tools/auth/oauth-federation-policy" rel="noopener noreferrer"&gt;Databricks federation documentation&lt;/a&gt;. The current setup therefore avoids stored AWS access keys while still requiring management of a Databricks OAuth secret.&lt;/p&gt;

&lt;h2&gt;
  
  
  Apply the plan that was produced
&lt;/h2&gt;

&lt;p&gt;The deployment workflow saves the Terraform plan and applies that saved file. &lt;/p&gt;

&lt;p&gt;Its manifest binds the plan to the source, commit, configuration, generated inputs, backend, and plan hash. The account layer also binds upstream state metadata. The compute runner adds checks against the relevant state snapshots and its expected ownership boundaries. If those inputs change, the workflow requires a new plan.&lt;/p&gt;

&lt;p&gt;Approval policy remains a separate concern. Most supported targets use protected GitHub Environments. Dev/demo has a limited single-administrator exception: a repository administrator must manually start the workflow from &lt;code&gt;main&lt;/code&gt;, enable deployment, provide the exact target confirmation, and satisfy the apply opt-in. That exception does not provide a human pause to approve every individual plan. It authorizes the checked workflow to plan and apply through the selected run.&lt;/p&gt;

&lt;h2&gt;
  
  
  Protect state and plan artifacts
&lt;/h2&gt;

&lt;p&gt;State isolation reduces accidental overlap, but state storage still needs protection. &lt;/p&gt;

&lt;p&gt;The S3 backend uses locking to coordinate state mutations. S3 lockfiles are enabled with &lt;code&gt;use_lockfile&lt;/code&gt;, and bucket versioning supports recovery from accidental changes. HashiCorp documents both in its &lt;a href="https://developer.hashicorp.com/terraform/language/backend/s3" rel="noopener noreferrer"&gt;S3 backend guide&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;GitHub Actions also serializes provisioning and deprovisioning for the same environment/workspace pair. Operators running Terraform elsewhere must still coordinate with that workflow. Plans deserve restricted access too. Marking a Terraform value as sensitive does not remove it from state or saved plans. See HashiCorp’s &lt;a href="https://developer.hashicorp.com/terraform/language/manage-sensitive-data" rel="noopener noreferrer"&gt;sensitive data guidance&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;The repository retains deployment artifacts for one day. Short retention reduces exposure, but it does not replace access controls.&lt;/p&gt;

&lt;h2&gt;
  
  
  Include cost and retirement in the design
&lt;/h2&gt;

&lt;p&gt;A cluster policy defines the settings a cluster may use. Creating that policy does not start a cluster. A SQL warehouse apply can start billable compute. AWS networking, storage, and monitoring can also incur charges without anyone running a notebook. &lt;/p&gt;

&lt;p&gt;The platform configuration therefore includes bounded compute choices and automatic shutdown settings. Its Databricks budget alerts are notifications, not hard spending caps or AWS budgets.&lt;/p&gt;

&lt;p&gt;Retirement needs equally explicit rules. Dependent compute and permissions must be removed before the groups, workspace, and infrastructure they rely on. The provisioning workflow does not automatically own every data resource or grant, so teardown checks for remaining downstream state. &lt;/p&gt;

&lt;p&gt;Storage is retained by default. Permanent storage deletion requires separate confirmation and checks, while Terraform backend history remains preserved.&lt;/p&gt;

&lt;p&gt;A useful starting point is one workspace with a complete lifecycle: validated configuration, clear state ownership, a controlled deployment, persona verification, and a documented retirement path. Once that works, another workspace can reuse the same process with its own identity and reviewed settings.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How is your team currently handling Databricks workspace sprawl? Do you use a similar config-driven approach? Let me know in the comments, or check out the full implementation in the &lt;a href="https://github.com/mysticrenji/databricks-platform" rel="noopener noreferrer"&gt;GitHub repo&lt;/a&gt;.&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>databricks</category>
      <category>terraform</category>
      <category>aws</category>
      <category>github</category>
    </item>
    <item>
      <title>Static Code Analysis using Semgrep App</title>
      <dc:creator>Renjith Ravindranathan</dc:creator>
      <pubDate>Thu, 20 Oct 2022 10:14:00 +0000</pubDate>
      <link>https://dev.to/mysticrenji/static-code-analysis-using-semgrep-app-2168</link>
      <guid>https://dev.to/mysticrenji/static-code-analysis-using-semgrep-app-2168</guid>
      <description>&lt;p&gt;In this short article, we will explore the static code analysis capability of Semgrep. Semgrep is a fast, open-source, static analysis tool that supports most modern languages. It works on a set of rules and rules are customizable as well according to your requirements. The tool is available in the CLI (OSS) version as well as in the SaaS version(Semgrep App). Also, it is very flexible to integrate with your CI pipelines. Let's look at integrating Semgrep with GitLab.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Pre-requisites&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://gitlab.com/users/sign_up" rel="noopener noreferrer"&gt;Gitlab account&lt;/a&gt;&lt;br&gt;
&lt;a href="https://semgrep.dev/login" rel="noopener noreferrer"&gt;Semgrep App Account&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Let's build&lt;/strong&gt;&lt;br&gt;
Semgrep works in such a way that the whole code analysis is done in the agents aka build machines and no sensitive data is being sent to the cloud. The only requirement is to generate an API TOKEN from Semgrep App and pass it to your GitLab pipelines, so they can talk with each other.&lt;/p&gt;

&lt;p&gt;You can create an API token from this &lt;a href="https://semgrep.dev/orgs/mysticrenji/settings/tokens" rel="noopener noreferrer"&gt;link&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2F1q5gi36wx7daqlwqhywl.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2F1q5gi36wx7daqlwqhywl.png" alt=" " width="720" height="205"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Once you have the token generated, the next step is to add the API TOKEN to the GitLab Variables — SEMGREP_APP_TOKEN in your project&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Foy197xkxlyw5t9fvf46g.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Foy197xkxlyw5t9fvf46g.png" alt=" " width="720" height="396"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Let's look at the GitLab pipelines. The pipeline has been just to do the static code analysis for illustration purposes.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;stages:
  - build

# Semgrep static code analysis
semgrep:
  stage: build
  # A Docker image with Semgrep installed.
  image: returntocorp/semgrep
  # Run the "semgrep ci" command on the command line of the docker image.
  script: semgrep ci

  rules:
  # Scan changed files in MRs, (diff-aware scanning):
  - if: $CI_MERGE_REQUEST_IID

  # Scan mainline (default) branches and report all findings.
  - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH

  variables:
    # Connect to Semgrep App through your SEMGREP_APP_TOKEN.
    # Generate a token from Semgrep App &amp;gt; Settings
    # and add it as a variable in your GitLab CI/CD project settings.
    SEMGREP_APP_TOKEN: $SEMGREP_APP_TOKEN
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Result&lt;/strong&gt;&lt;br&gt;
For scanning, I am utilizing an old repository hosted &lt;a href="https://gitlab.com/renjithvr11/flask-mysql-k8s" rel="noopener noreferrer"&gt;here&lt;/a&gt; that consists of Python scripts, Dockerfiles, and Kubernetes Manifests. The outcome is quite nice, as Semgrep was able to catch a few common mistakes in the development. The dashboard shows an overall summary of the findings.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Fqq2xz1bcuig9uuzvmz44.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fqq2xz1bcuig9uuzvmz44.png" alt=" " width="720" height="373"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Let's zoom in on one of the findings run-as-non-root . Typically this message is raised when you have allowed your container to be run as root or in order words you have not specified the user by which the container is executed.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Fi32cdwptjhso0i9f80ys.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fi32cdwptjhso0i9f80ys.png" alt=" " width="720" height="646"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;There is a rule editor which shows the pre-defined rules, against which your code is compared. You may go around it to see, how it evaluates the condition.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Conclusion&lt;/strong&gt;&lt;br&gt;
Semgrep is a good tool to integrate with and it can be integrated with major CI/CD engines like GitLab, GitHub Actions, Azure DevOps, Jenkins, CircleCI, Bitbucket Pipelines, etc. It is worth checking out if it suits your organization's requirements. That’s all for now. Hope you find the article useful and feedbacks are always welcome. Cheers.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;References&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://gitlab.com/renjithvr11/flask-mysql-k8s" rel="noopener noreferrer"&gt;GitLab Repo&lt;/a&gt;&lt;br&gt;
&lt;a href="https://semgrep.dev/docs/" rel="noopener noreferrer"&gt;Semgrep Docs&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In case of any queries, please feel to connect me via the below links&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.linkedin.com/in/rvr88/" rel="noopener noreferrer"&gt;LinkedIn&lt;/a&gt;&lt;br&gt;
&lt;a href="https://twitter.com/mysticrenji" rel="noopener noreferrer"&gt;Twitter&lt;/a&gt;&lt;br&gt;
&lt;a href="https://renjithvr11.medium.com/" rel="noopener noreferrer"&gt;Medium&lt;/a&gt;&lt;/p&gt;

</description>
      <category>security</category>
      <category>staticcodeanalysis</category>
      <category>programming</category>
      <category>devops</category>
    </item>
    <item>
      <title>Essential plugins for Kubectl CLI</title>
      <dc:creator>Renjith Ravindranathan</dc:creator>
      <pubDate>Thu, 20 Oct 2022 06:57:17 +0000</pubDate>
      <link>https://dev.to/mysticrenji/essential-plugins-for-kubectl-cli-5een</link>
      <guid>https://dev.to/mysticrenji/essential-plugins-for-kubectl-cli-5een</guid>
      <description>&lt;p&gt;This is a short article about handy plugins that can be used along with kubectl CLI , which helps you to can reduce a few of your operational tasks from an admin perspective. Basically, we can extend the capabilities kubectl with the power of plugins, like checking the deprecations of components in the cluster or SSHing to the nodes.&lt;/p&gt;

&lt;p&gt;We can install plugins using a plugin manager called krew and there are quite a few available on the website listed here as well. Let's look at how we can get started with plugins :)&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Setup&lt;/strong&gt;&lt;br&gt;
The plugins are added using krew and the primary requirement is to install krew them in the system. You can use the below code snippet in Mac/Linux to install it&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;(
  set -x; cd "$(mktemp -d)" &amp;amp;&amp;amp;
  OS="$(uname | tr '[:upper:]' '[:lower:]')" &amp;amp;&amp;amp;
  ARCH="$(uname -m | sed -e 's/x86_64/amd64/' -e 's/\(arm\)\(64\)\?.*/\1\2/' -e 's/aarch64$/arm64/')" &amp;amp;&amp;amp;
  KREW="krew-${OS}_${ARCH}" &amp;amp;&amp;amp;
  curl -fsSLO "https://github.com/kubernetes-sigs/krew/releases/latest/download/${KREW}.tar.gz" &amp;amp;&amp;amp;
  tar zxvf "${KREW}.tar.gz" &amp;amp;&amp;amp;
  ./"${KREW}" install krew
)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once you have krew it in the system, now it is time to install the additional plugins.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Plugins&lt;/strong&gt;&lt;br&gt;
There are many plugins available in the OSS GitHub repos, but below are some of my personal favorites.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Kubepug&lt;/strong&gt;&lt;br&gt;
KubePug/Deprecations is intended to be a kubectl plugin, which:&lt;/p&gt;

&lt;p&gt;Downloads a swagger.json from a specific Kubernetes version&lt;br&gt;
Parses this Json finding deprecation notices&lt;br&gt;
Verifies the current kubernetes cluster or input files checking whether exists objects in this deprecated API Versions, allowing the user to check before migrating&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;kubectl krew install deprecations
#Usage
kubepug --k8s-version=v1.18.6 # Will verify the current context against v1.18.6 swagger.json
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;2. net-forward&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Simple plugin that lest you create a local port listener on your personal machine that redirects to an arbitrary TCP service that the Cluster can see. This is similar to kubectl port-forward without the restriction that forwarding can only use Pods or Services as destinations.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;kubectl krew install net-forward

#Usage
kubectl net-forward -i 169.254.169.254 -p 3389 -l 3389
I personally use this a lot to debug issues related to environment specific inside the Windows/Linux nodes.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Please feel to try out the plugins on the krew website also, as there are other plugins that could be beneficial to your work.&lt;br&gt;
Hope this info was helpful and thanks for reading the article.!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;References&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://github.com/rikatz/kubepug" rel="noopener noreferrer"&gt;Kubepug&lt;/a&gt;&lt;br&gt;
&lt;a href="https://github.com/antitree/krew-net-forward" rel="noopener noreferrer"&gt;net-forward&lt;/a&gt;&lt;br&gt;
&lt;a href="https://krew.sigs.k8s.io/plugins/" rel="noopener noreferrer"&gt;Krew&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In case of any queries, please feel to connect me via the below links&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.linkedin.com/in/rvr88/" rel="noopener noreferrer"&gt;LinkedIn&lt;/a&gt;&lt;br&gt;
&lt;a href="https://dev.tomysticrenji"&gt;Twitter&lt;/a&gt;&lt;br&gt;
&lt;a href="https://renjithvr11.medium.com/" rel="noopener noreferrer"&gt;Medium&lt;/a&gt;&lt;/p&gt;

</description>
      <category>kubernetes</category>
      <category>maintainence</category>
      <category>technology</category>
      <category>devops</category>
    </item>
  </channel>
</rss>
