<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[ls-lrt.com]]></title><description><![CDATA[A Tech blogging site.  write on Cyber Security, Privacy, DevSecOps and Many More ! Stay tuned :-)]]></description><link>https://samirparhi.com</link><image><url>https://cdn.hashnode.com/res/hashnode/image/upload/v1740974661194/fe43ce65-37d4-4cc0-adfe-9a5d6f7a86ec.png</url><title>ls-lrt.com</title><link>https://samirparhi.com</link></image><generator>RSS for Node</generator><lastBuildDate>Tue, 14 Apr 2026 03:04:13 GMT</lastBuildDate><atom:link href="https://samirparhi.com/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[🌱 A Quick Lesson learnt on Domain Takeovers]]></title><description><![CDATA[A little experience about something that happened recently with my website, s9lab.dev , and how I learned an important lesson about keeping your domain safe. 🧠
So, the other day, I was trying to verify my custom domain for my GitHub Pages site. But ...]]></description><link>https://samirparhi.com/a-quick-lesson-learnt-on-domain-takeovers</link><guid isPermaLink="true">https://samirparhi.com/a-quick-lesson-learnt-on-domain-takeovers</guid><category><![CDATA[#cybersecurity]]></category><category><![CDATA[GitHub]]></category><category><![CDATA[Custom Domain]]></category><category><![CDATA[Web Security]]></category><category><![CDATA[namecheap]]></category><dc:creator><![CDATA[Samir Ranjan Parhi]]></dc:creator><pubDate>Fri, 18 Apr 2025 11:52:53 GMT</pubDate><content:encoded><![CDATA[<p>A little experience about something that happened recently with my website, s9lab.dev , and how I learned an important lesson about keeping your domain safe. 🧠</p>
<p>So, the other day, I was trying to verify my custom domain for my GitHub Pages site. But guess what? 😱 I got an error saying the domain name was already taken! At first, I thought, <em>"Wait, did my domain expire? Or was it auctioned off?"</em> 🤔</p>
<p>I checked with my DNS provider, and everything looked fine. Then I remembered a GitHub Actions vulnerability issue I’d heard about recently. Could that have caused the problem? Nope! That wasn’t it either.</p>
<p>Turns out, my site was victim of a domain takeover attack . 🚨 This was new to me, so I dug deeper, learned more</p>
<p><strong>What Exactly is a Domain Takeover Attack?</strong></p>
<p>Imagine this: Someone else takes over your custom domain and uses it to publish <em>their</em> GitHub Pages site instead of yours. Yep, scary stuff! 😨</p>
<p><strong>When Can Domain Takeovers Happen?</strong></p>
<p>Here are some common scenarios where this can happen:<br />👉 You delete your repository.<br />👉 Your billing plan gets downgraded.<br />👉 Any change that disconnects your custom domain or disables GitHub Pages—but your domain is still pointing to GitHub Pages and isn’t verified.</p>
<p>If you’re using GitHub Pages to host your site with a custom domain, it’s SUPER important to verify your domain . 🔐 This small step can save you from potential takeovers.</p>
<p><strong>How to Protect Your Domain:  
</strong>GitHub has clear steps for verifying your custom domain. Here’s the link to follow: <a target="_blank" href="https://chat.qwen.ai/c/guest#">GitHub Docs</a> .</p>
<p>Always double-check your settings and verify your domain. It’s like locking the door to your digital house! 🏠🔑</p>
<p>Now <a target="_blank" href="https://s9lab.dev">https://s9lab.dev</a> is in safe hands and up ✨</p>
]]></content:encoded></item><item><title><![CDATA[1: Performing API Operation]]></title><description><![CDATA[Ansible is not only limited to doing certain configuration , rather you can repurpose it to perform various API operation. Even you can create a playbook which can do an integration test by pipelining various api methods (GET, POST, DELETE, PUT) and ...]]></description><link>https://samirparhi.com/1-performing-api-operation</link><guid isPermaLink="true">https://samirparhi.com/1-performing-api-operation</guid><category><![CDATA[ansible]]></category><category><![CDATA[ansible-playbook]]></category><category><![CDATA[Jinja2]]></category><dc:creator><![CDATA[Samir Ranjan Parhi]]></dc:creator><pubDate>Wed, 26 Mar 2025 15:23:53 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1742793680772/8eb29d6c-9c02-43a2-bf9d-bfc3575be080.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Ansible is not only limited to doing certain configuration , rather you can repurpose it to perform various API operation. Even you can create a playbook which can do an integration test by pipelining various api methods (GET, POST, DELETE, PUT) and validate the <code>json</code> data.</p>
<p>In this blog we will understand this by taking a simple case study.</p>
<p><strong>Problem statement :</strong> Find out the top 10 <code>Julia</code> repository which has highest <code>GitHub</code> star</p>
<p>to do this we would need few things:</p>
<ul>
<li><p>GitHub api endpoint uri: <a target="_blank" href="https://api.github.com/search/repositories">https://api.github.com/search/repositories</a></p>
</li>
<li><p>query filter : "q": “language:julia”, "sort": "stars", "per_page": 100</p>
</li>
<li><p>Authorization token header.</p>
</li>
<li><p>store the response json.</p>
</li>
</ul>
<p>Now let’s understand how can we achieve it using ansible. Ansible has a module called <code>ansible.builtin.uri</code> which can be used to perform this task. official</p>
<p>Lets Write the playbook</p>
<pre><code class="lang-yaml"><span class="hljs-bullet">-</span> <span class="hljs-attr">hosts:</span> <span class="hljs-string">localhost</span>
  <span class="hljs-attr">gather_facts:</span> <span class="hljs-literal">false</span>
  <span class="hljs-attr">vars:</span>
    <span class="hljs-attr">Q:</span> <span class="hljs-string">"language:julia"</span>
    <span class="hljs-attr">type:</span> <span class="hljs-string">"repositories"</span>
    <span class="hljs-attr">per_page:</span> <span class="hljs-string">"10"</span>
  <span class="hljs-attr">tasks:</span>
    <span class="hljs-bullet">-</span> <span class="hljs-attr">name:</span> <span class="hljs-string">Set</span> <span class="hljs-string">GitHub</span> <span class="hljs-string">PAT</span> <span class="hljs-string">fact</span>
      <span class="hljs-attr">set_fact:</span>
        <span class="hljs-attr">github_pat:</span> <span class="hljs-string">"<span class="hljs-template-variable">{{ lookup('env', 'GITHUB_TOKEN') | default('', true) }}</span>"</span>
    <span class="hljs-bullet">-</span> <span class="hljs-attr">name:</span> <span class="hljs-string">Set</span> <span class="hljs-string">GitHub</span> <span class="hljs-string">Address</span>
      <span class="hljs-attr">set_fact:</span>
        <span class="hljs-attr">github_addr:</span> <span class="hljs-string">"https://api.github.com/search/repositories?q=<span class="hljs-template-variable">{{ Q }}</span>&amp;per_page=<span class="hljs-template-variable">{{ per_page }}</span>&amp;page=1&amp;sort=stars"</span>
    <span class="hljs-bullet">-</span> <span class="hljs-attr">name:</span> <span class="hljs-string">get</span> <span class="hljs-string">Response</span> <span class="hljs-string">from</span> <span class="hljs-string">and</span> <span class="hljs-string">APi</span>
      <span class="hljs-attr">ansible.builtin.uri:</span>
        <span class="hljs-attr">url:</span> <span class="hljs-string">"<span class="hljs-template-variable">{{ github_addr }}</span>"</span>
        <span class="hljs-attr">status_code:</span> [<span class="hljs-number">200</span>, <span class="hljs-number">201</span>]
        <span class="hljs-attr">method:</span> <span class="hljs-string">get</span>
        <span class="hljs-attr">headers:</span>
          <span class="hljs-attr">Authorization:</span> <span class="hljs-string">"<span class="hljs-template-variable">{{ github_pat }}</span>"</span>
        <span class="hljs-attr">return_content:</span> <span class="hljs-literal">yes</span>
      <span class="hljs-attr">register:</span> <span class="hljs-string">api_response</span>
   <span class="hljs-bullet">-</span> <span class="hljs-attr">name:</span> <span class="hljs-string">find</span> <span class="hljs-string">length</span> <span class="hljs-string">of</span> <span class="hljs-string">the</span> <span class="hljs-string">Repo</span>
      <span class="hljs-attr">ansible.builtin.debug:</span>
        <span class="hljs-attr">msg:</span> <span class="hljs-string">"<span class="hljs-template-variable">{{ item.name }}</span>"</span>

   <span class="hljs-bullet">-</span> <span class="hljs-attr">name:</span> <span class="hljs-string">Add</span> <span class="hljs-string">only</span> <span class="hljs-string">names</span> <span class="hljs-string">to</span> <span class="hljs-string">a</span> <span class="hljs-string">dictionary</span>
     <span class="hljs-attr">ansible.builtin.set_fact:</span>
         <span class="hljs-attr">result_repo_name:</span> <span class="hljs-string">"<span class="hljs-template-variable">{{ result_repo_name | default({}) | combine( item ) }}</span>"</span>
     <span class="hljs-attr">loop:</span> <span class="hljs-string">"<span class="hljs-template-variable">{{ api_response.json.items }}</span>"</span>
</code></pre>
<p>in the above code <code>status_code</code> specifies what is the intended status code for this task. in this context 200, 201 . If the status code is beyond 200 or 201 i,e 3xx, 4xx, 5xx the task will fail.</p>
<p>if you closely observe we are using the <code>register</code> key. so the output response will be store inside the variable <code>api_response</code> and we can further extend this playbook to do other tasks.<br />Like we did adding only names to a Dictionary.</p>
<p>So Now the important thing is what all are the debugging steps:</p>
<ul>
<li>when you use <code>ansible.builtin.uri</code> the response which get registered in the variable are under a Dictionary called <code>json</code></li>
</ul>
<p>if you debug <code>api_response</code> you can find the the output as below :</p>
<pre><code class="lang-json">
  <span class="hljs-string">"date"</span>: <span class="hljs-string">"Wed, 26 Mar 2025 14:32:21 GMT"</span>,
  <span class="hljs-string">"elapsed"</span>: <span class="hljs-number">0</span>,
  <span class="hljs-string">"failed"</span>: <span class="hljs-literal">false</span>,
  <span class="hljs-string">"json"</span>: {
      <span class="hljs-attr">"incomplete_results"</span>: <span class="hljs-literal">false</span>,
      <span class="hljs-attr">"items"</span>: [
          {
              <span class="hljs-attr">"allow_forking"</span>: <span class="hljs-literal">true</span>,
              <span class="hljs-attr">"archived"</span>: <span class="hljs-literal">false</span>,
              <span class="hljs-attr">"assignees_url"</span>: <span class="hljs-string">"https://api.github.com/repos/JuliaLang/julia/assignees{/user}"</span>,
              <span class="hljs-attr">"blobs_url"</span>: <span class="hljs-string">"https://api.github.com/repos/JuliaLang/julia/git/blobs{/sha}"</span>,
              <span class="hljs-attr">"branches_url"</span>: <span class="hljs-string">"https://api.github.com/repos/JuliaLang/julia/branches{/branch}"</span>,
              <span class="hljs-attr">"clone_url"</span>: <span class="hljs-string">"https://github.com/JuliaLang/julia.git"</span>,
              <span class="hljs-attr">"fork"</span>: <span class="hljs-literal">false</span>,
              <span class="hljs-attr">"forks"</span>: <span class="hljs-number">5556</span>,
              <span class="hljs-attr">"forks_count"</span>: <span class="hljs-number">5556</span>,
              <span class="hljs-attr">"forks_url"</span>: <span class="hljs-string">"https://api.github.com/repos/JuliaLang/julia/forks"</span>,
              <span class="hljs-attr">"full_name"</span>: <span class="hljs-string">"JuliaLang/julia"</span>,
              <span class="hljs-attr">"git_commits_url"</span>: <span class="hljs-string">"https://api.github.com/repos/JuliaLang/julia/git/commits{/sha}"</span>,
              <span class="hljs-attr">"git_refs_url"</span>: <span class="hljs-string">"h
              },
              {
                "</span>allow_forking<span class="hljs-string">": true,
                "</span>archived<span class="hljs-string">": false,
                "</span>assignees_url<span class="hljs-string">": "</span>https:<span class="hljs-comment">//api.github.com/repos/fonsp/Pluto.jl/assignees{/user}",</span>
                <span class="hljs-string">"blobs_url"</span>: <span class="hljs-string">"https://api.github.com/repos/fonsp/Pluto.jl/git/blobs{/sha}"</span>,
                <span class="hljs-attr">"branches_url"</span>: <span class="hljs-string">"https://api.github.com/repos/fonsp/Pluto.jl/branches{/branch}"</span>,
                <span class="hljs-attr">"clone_url"</span>: <span class="hljs-string">"https://github.com/fonsp/Pluto.jl.git"</span>,
                <span class="hljs-attr">"fork"</span>: <span class="hljs-literal">false</span>,
                <span class="hljs-attr">"forks"</span>: <span class="hljs-number">5556</span>,
                <span class="hljs-attr">"forks"</span>: <span class="hljs-number">294</span>,
                <span class="hljs-attr">"forks_count"</span>: <span class="hljs-number">294</span>,
                <span class="hljs-attr">"forks_url"</span>: <span class="hljs-string">"https://api.github.com/repos/fonsp/Pluto.jl/forks"</span>,
                <span class="hljs-attr">"full_name"</span>: <span class="hljs-string">"fonsp/Pluto.jl"</span>,
                <span class="hljs-attr">"git_commits_url"</span>: <span class="hljs-string">"https://api.github.com/repos/fonsp/Pluto.jl/git/commits{/sha}"</span>

              }
      ]
</code></pre>
<p>Now if you want to display let’s say <code>blobs_url</code> of a repo you need to write it as below :  </p>
<p>❌ Wrong Way:</p>
<pre><code class="lang-yaml">   <span class="hljs-bullet">-</span> <span class="hljs-attr">name:</span> <span class="hljs-string">Add</span> <span class="hljs-string">only</span> <span class="hljs-string">names</span> <span class="hljs-string">to</span> <span class="hljs-string">a</span> <span class="hljs-string">dictionary</span>
     <span class="hljs-attr">ansible.builtin.set_fact:</span>
         <span class="hljs-attr">result_repo_name:</span> <span class="hljs-string">"<span class="hljs-template-variable">{{ item.blob_url }}</span>"</span>
     <span class="hljs-attr">loop:</span> <span class="hljs-string">"<span class="hljs-template-variable">{{ api_response[json][items] }}</span>"</span>
</code></pre>
<p>✅ Right approaches:</p>
<pre><code class="lang-yaml">   <span class="hljs-bullet">-</span> <span class="hljs-attr">name:</span> <span class="hljs-string">Add</span> <span class="hljs-string">only</span> <span class="hljs-string">names</span> <span class="hljs-string">to</span> <span class="hljs-string">a</span> <span class="hljs-string">dictionary</span>
     <span class="hljs-attr">ansible.builtin.set_fact:</span>
         <span class="hljs-attr">result_repo_name:</span> <span class="hljs-string">"<span class="hljs-template-variable">{{ item.blob_url }}</span>"</span>
     <span class="hljs-attr">loop:</span> <span class="hljs-string">"<span class="hljs-template-variable">{{ api_response.json.items }}</span>"</span>
</code></pre>
<h3 id="heading-why">Why ?</h3>
<p>Coz if you use <code>[]</code> notation it expect whatever inside <code>[]</code> should be a <strong>static</strong> variable and ansible want you to define that variable may be you can get <code>variable</code> undefined error. But when you use <code>.</code> notation it is to access the variable inside a dictionary which is <strong>dynamic.</strong>  </p>
<p>🖋️ <strong>Tip of the Day (Jinja2) :</strong>  </p>
<p>you can not use Jinja2 template in <code>vars</code>. Jinja2 template are only get populated during run times. <code>set_fact</code> in ansible are the way to declare a varriable in any programming language.</p>
<p>❌ Wrong approaches:</p>
<pre><code class="lang-yaml">  <span class="hljs-bullet">-</span> <span class="hljs-attr">hosts:</span> <span class="hljs-string">localhost</span>
    <span class="hljs-attr">gather_facts:</span> <span class="hljs-literal">false</span>
    <span class="hljs-attr">vars:</span>
      <span class="hljs-attr">github_pat:</span> <span class="hljs-string">"<span class="hljs-template-variable">{{ lookup('env', 'GITHUB_TOKEN') | default('', true) }}</span>"</span>
    <span class="hljs-bullet">-</span> <span class="hljs-attr">name:</span> <span class="hljs-string">debug</span> <span class="hljs-string">github</span> <span class="hljs-string">token</span>
      <span class="hljs-attr">debug:</span>
        <span class="hljs-attr">var:</span> <span class="hljs-string">"<span class="hljs-template-variable">{{ github_pat }}</span>"</span>
</code></pre>
<p>✅ Right approaches:</p>
<pre><code class="lang-yaml"><span class="hljs-bullet">-</span> <span class="hljs-attr">hosts:</span> <span class="hljs-string">localhost</span>
  <span class="hljs-attr">gather_facts:</span> <span class="hljs-literal">false</span>

  <span class="hljs-attr">tasks:</span>
    <span class="hljs-bullet">-</span> <span class="hljs-attr">name:</span> <span class="hljs-string">Set</span> <span class="hljs-string">GitHub</span> <span class="hljs-string">PAT</span> <span class="hljs-string">fact</span>
      <span class="hljs-attr">set_fact:</span>
        <span class="hljs-attr">github_pat:</span> <span class="hljs-string">"<span class="hljs-template-variable">{{ lookup('env', 'GITHUB_TOKEN') | default('', true) }}</span>"</span>
    <span class="hljs-bullet">-</span> <span class="hljs-attr">name:</span> <span class="hljs-string">debug</span> <span class="hljs-string">github</span> <span class="hljs-string">token</span>
      <span class="hljs-attr">debug:</span>
        <span class="hljs-attr">var:</span> <span class="hljs-string">"<span class="hljs-template-variable">{{ github_pat }}</span>"</span>
</code></pre>
<p>More things to unlock 🔓. Happy Ansibling !</p>
]]></content:encoded></item><item><title><![CDATA[A Draft: Empowering the Future of Education with AI 🎓🤖]]></title><description><![CDATA[This is my brainchild—a mission to transform education and ensure that every institution is equipped with cutting-edge AI-powered tools! 💡📚
💭 Imagine a world where students stay ahead of the curve, mastering AI-driven skills that make them more pr...]]></description><link>https://samirparhi.com/a-draft-empowering-the-future-of-education-with-ai</link><guid isPermaLink="true">https://samirparhi.com/a-draft-empowering-the-future-of-education-with-ai</guid><category><![CDATA[s9lab.dev]]></category><category><![CDATA[AI]]></category><category><![CDATA[#ai-tools]]></category><category><![CDATA[lab]]></category><dc:creator><![CDATA[Samir Ranjan Parhi]]></dc:creator><pubDate>Thu, 06 Mar 2025 15:33:38 GMT</pubDate><content:encoded><![CDATA[<p>This is my <strong>brainchild</strong>—a mission to transform education and ensure that every institution is equipped with cutting-edge <strong>AI-powered tools</strong>! 💡📚</p>
<p>💭 Imagine a world where students <strong>stay ahead of the curve</strong>, mastering AI-driven skills that make them more <strong>productive, innovative, and future-ready</strong>! 🔥✨</p>
<p>But wait, there’s more! 🤯</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1741274992488/0a3c94b8-eba4-458d-9632-cefba2c94bee.png" alt /></p>
<p>💡 This lab will empower them to <strong>deploy &amp; run their AI models</strong> at a cost <strong>as low as their pocket money</strong>! 💰⚡ Making AI accessible, affordable, and truly <strong>for everyone</strong>!</p>
<p>Let’s bridge the gap between <strong>education &amp; AI</strong>—because the future belongs to those who adapt <strong>today!</strong> 💯</p>
<p>Who's in to revolutionize learning? Drop a 🔥 in the comments if you believe AI should be a part of every classroom! ⬇️</p>
<p>The plan is below:</p>
<p>Will this be beneficial ? This is just the foundation , More to reveal 🤗</p>
<p>Do let me know your thought 💭</p>
]]></content:encoded></item><item><title><![CDATA[The System Design for Various Use case Fully Automated]]></title><description><![CDATA[We will explore two key pipeline designs: one focusing on DevSecOps automation for containerized environments and the other on Infrastructure as Code (IaC) pipelines for managing Kubernetes clusters. Both pipelines help automate various stages of sec...]]></description><link>https://samirparhi.com/the-system-design-for-various-use-case-fully-automated</link><guid isPermaLink="true">https://samirparhi.com/the-system-design-for-various-use-case-fully-automated</guid><category><![CDATA[DevSecOps]]></category><category><![CDATA[Azure]]></category><category><![CDATA[ci-cd]]></category><category><![CDATA[containers]]></category><dc:creator><![CDATA[Samir Ranjan Parhi]]></dc:creator><pubDate>Tue, 04 Mar 2025 11:29:07 GMT</pubDate><content:encoded><![CDATA[<p>We will explore two key pipeline designs: one focusing on <strong>DevSecOps automation</strong> for containerized environments and the other on <strong>Infrastructure as Code (IaC)</strong> pipelines for managing Kubernetes clusters. Both pipelines help automate various stages of security checks, image verification, and deployment, making operations more efficient and secure.</p>
<p>This pipeline automates the process of building, scanning, signing, and deploying container images while ensuring compliance with security policies. Here's how it works:</p>
<ul>
<li><p><strong>Code Base (GitHub):</strong> The pipeline is triggered when a pull request (PR) is raised.</p>
</li>
<li><p><strong>Build Code and Container:</strong> The application code is built, followed by container creation.</p>
</li>
<li><p><strong>Trivy Static Container Scan:</strong> A security scan is performed to check for vulnerabilities and misconfigurations.</p>
</li>
<li><p><strong>Condition Check:</strong> The scan results are analyzed. If the container passes, the process continues. If it fails, the team is notified via email or Slack.</p>
</li>
<li><p><strong>Attach Image Using Cosign:</strong> If the scan is successful, the container image is signed using <strong>Cosign</strong> for added security.</p>
</li>
<li><p><strong>Upload Image to Registry:</strong> The signed image is pushed to the container registry for deployment.</p>
</li>
<li><p><strong>Visualize with Grafana:</strong> The metrics related to the build and scan processes are visualized using <strong>Grafana</strong> for continuous monitoring.</p>
</li>
</ul>
<p><img src="https://raw.githubusercontent.com/samirparhi-dev/samirparhi-dev/main/blog/DevSecOpsPipeline.png" alt="Our Architecture" /></p>
<h3 id="heading-infrastructure-as-code-pipeline"><strong>Infrastructure as Code Pipeline</strong></h3>
<p>This pipeline leverages <strong>IaC (Infrastructure as Code)</strong> and <strong>GitOps principles</strong> to provision and secure Kubernetes clusters.</p>
<h4 id="heading-iac-pipeline-steps"><strong>IaC Pipeline Steps:</strong></h4>
<ul>
<li><p><strong>Infra as Code (GitHub):</strong> The process starts with version-controlled infrastructure code scripts.</p>
</li>
<li><p><strong>Release Candidate:</strong> A PR is raised, signaling the release of the new infrastructure configuration.</p>
</li>
<li><p><strong>OpenTofu Script Execution:</strong> The <strong>OpenTofu</strong> tool is used to apply the infrastructure changes.</p>
</li>
<li><p><strong>Provision Kubernetes Cluster:</strong> A new Kubernetes cluster is provisioned using the approved configurations.</p>
</li>
<li><p><strong>Security Scans (Kube-Bench):</strong> The newly created cluster is scanned for vulnerabilities using tools like <strong>kube-bench</strong> , <strong>Trivy</strong> , and others.</p>
</li>
<li><p><strong>Continuous Deployment:</strong> After the scans pass, the infrastructure is deployed.</p>
</li>
<li><p><strong>Observability:</strong> Metrics related to infrastructure health and security are monitored using <strong>Grafana</strong> and other observability tools.</p>
</li>
<li><p><strong>Improvements:</strong> The pipeline continuously loops back for improvements based on the observability insights.</p>
</li>
</ul>
<p><img src="https://raw.githubusercontent.com/samirparhi-dev/samirparhi-dev/main/blog/Infra-as-a-code-pipeline.png" alt="Our Architecture" /></p>
<p>These are just <strong>Fundamentals</strong> for Achieving Basic Security Ops using cloud technology.</p>
<p><strong>Happy Learning!</strong></p>
]]></content:encoded></item><item><title><![CDATA[A step towards Accelerating Open-source Community with s9lab.dev 🌏]]></title><description><![CDATA[We are Moving Fast! Artificial Intelligence (AI), Machine Learning (ML), and especially Generative AI are revolutionizing industries. It’s easy to get overwhelmed by the amount of information out there. But for newcomers, this flood of resources can ...]]></description><link>https://samirparhi.com/a-step-towards-accelerating-open-source-community-with-s9labdev</link><guid isPermaLink="true">https://samirparhi.com/a-step-towards-accelerating-open-source-community-with-s9labdev</guid><category><![CDATA[s9lab]]></category><category><![CDATA[Kubernetes]]></category><category><![CDATA[containers]]></category><category><![CDATA[Rust]]></category><category><![CDATA[rust lang]]></category><category><![CDATA[Julia]]></category><category><![CDATA[Open Source]]></category><dc:creator><![CDATA[Samir Ranjan Parhi]]></dc:creator><pubDate>Mon, 03 Mar 2025 06:35:05 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1740996925747/5a0bcfd8-0197-4978-9c9c-bf4fdd06a565.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>We are Moving Fast! Artificial Intelligence (AI), Machine Learning (ML), and especially Generative AI are revolutionizing industries. It’s easy to get overwhelmed by the amount of information out there. But for newcomers, this flood of resources can feel like trying to drink from a firehose! 😅</p>
<p>That’s when s9lab.dev was born! 🎉—what if we could create a one-stop hub that simplifies the exploration of open-source tools and technologies for contributors, developers, system designers, cybersecurity enthusiasts, blockchain buffs, and curious learners alike.</p>
<p>s9lab.dev envisioned as a <strong>Collection of collections</strong> (think of bucket lists or arrays 😉), designed to guide you through cutting-edge resources related to AI, ML, and beyond, whether you're just starting out or diving into advanced topics</p>
<h3 id="heading-available-collections-till-date"><strong>Available Collections Till Date:</strong></h3>
<p>1️⃣ <a target="_blank" href="https://s9lab.dev/oss-vectordb-repos/"><strong>Open Source Vector DBs</strong></a> 🫙</p>
<p>Dive into a handpicked list of vector databases, essential for modern AI/ML applications. Perfect for building multi-agent systems or finding the right tool for specific tasks.</p>
<p> 2️⃣ <a target="_blank" href="https://s9lab.dev/awsome-julia-repos/"><strong>Epic Julia Repositories</strong></a> 🧪</p>
<p> Julia—a programming language that’s faster, smarter, and mathematically robust—is poised to take the tech world by storm. Explore repositories that showcase Julia’s potential in AI/ML and beyond. Trust me, it’s underrated now but will soon shine brighter than Python or R! ✨</p>
<p>3️⃣ <a target="_blank" href="https://s9lab.dev/awsome-rust-repos/"><strong>Awesome Rust Repositories</strong></a> ⚙️</p>
<p>Rust is my personal favorite—a language built for speed, safety, and scalability. If you’re into futuristic, resilient systems, this collection has everything written in Rust. From web apps to low-level system design, Rust has got you covered! </p>
<p>4️⃣ <a target="_blank" href="https://s9lab.dev/ai-ml-tool-collection/"><strong>AI/ML Inference Tools</strong></a> 🤖</p>
<p>Need tools to deploy and run AI models? This collection brings together all the essentials for inference tasks. While it’s still growing, we’re working on making it more structured and insightful. Stay tuned! </p>
<p>5️⃣ <a target="_blank" href="https://s9lab.dev/modern-ai-ml-infra/"><strong>Modern AI/ML Infrastructure</strong></a> 🛠️ </p>
<p>Deploying ML models shouldn’t be a headache. This directory highlights cost-effective and tailored infrastructure options to suit your needs. Whether you’re scaling up or starting small, we’ve got the right pointers for you! </p>
<p>🙌 <strong>An Open Invitation to Everyone</strong></p>
<p>The journey of <a target="_blank" href="https://s9lab.dev">s9lab.dev</a> has been exciting so far, but I truly believe the best is yet to come—and it starts with <strong>YOU</strong> ! 🌟 </p>
<p>This project is a labor of love, but I know that magic happens when brilliant minds collaborate. That’s why I’m putting out an open invitation to all tech enthusiasts, developers, and creators who share the vision of making learning and development accessible to everyone. Let’s collaborate to:</p>
<ul>
<li><p>Curate New Collections  </p>
</li>
<li><p>Refine Existing Ones  </p>
</li>
<li><p>Spread the Word  </p>
</li>
<li><p>Brainstorm Ideas  </p>
<p>  Together, we can transform <a target="_blank" href="https://s9lab.dev">s9lab.dev</a> into a vibrant hub of knowledge and innovation—a place where learners and contributors thrive. 🚀</p>
</li>
</ul>
<p>🌟 <strong>The Future is Bright</strong></p>
<p>This is just the beginning! s9lab.dev has the potential to evolve into a vibrant ecosystem that caters to every type of learner and creator—whether you’re a developer, system designer, cybersecurity expert, blockchain enthusiast, or simply someone curious about tech.</p>
<p>I firmly believe that the power of open source lies in shared knowledge and collective effort. That’s why s9lab.dev is—and always will be—completely open source. ❤️</p>
<p>Let’s shape the future of <strong>Community learning</strong> —one collection at a time! 🚀</p>
]]></content:encoded></item><item><title><![CDATA[The Gen AI. Tools made my College days alive]]></title><description><![CDATA[This blog is a good read if you are still poking in to your mobile to read some interesting and relatable Tech stories. Here I share my Experience which resembles the way Generative AI is behaving these days.
Today I was curious to understand and lea...]]></description><link>https://samirparhi.com/the-gen-ai-tools-made-my-college-days-alive</link><guid isPermaLink="true">https://samirparhi.com/the-gen-ai-tools-made-my-college-days-alive</guid><category><![CDATA[genai]]></category><category><![CDATA[chatgpt]]></category><category><![CDATA[gemini]]></category><category><![CDATA[Open Source]]></category><category><![CDATA[mlops]]></category><dc:creator><![CDATA[Samir Ranjan Parhi]]></dc:creator><pubDate>Mon, 29 Apr 2024 18:43:34 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1714449736161/185056af-dc71-4aa8-a8eb-c200c1ffa9a7.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>This blog is a good read if you are still poking in to your mobile to read some interesting and relatable Tech stories. Here I share my Experience which resembles the way Generative AI is behaving these days.</p>
<p>Today I was curious to understand and learn the behaviour of Gen AI. So, I was learning a topic on a Kubernetes policy tool Gatekeeper that implements Open policy agent (OPA) a well know CNCF project. As GenAI has been trending in these days I thought of taking help of two well known tool ChatGPT and Gemini.</p>
<p>I spent good amount of time on ChatGPT and Gemini, In this 3 hours I started asking about basic Questions and it worked liked wonder. I thought I am with the best companion ever for learning.</p>
<p>Resemblance with Real experience:</p>
<blockquote>
<p><em>Reminded me when I was a fresher and started giving my job interviews . I had all the theoretical knowledge and I was able to crak the first round and was high on confidence.</em></p>
</blockquote>
<p> These flawless responses inspired me to explore further with more complex queries, hoping to have an insightful conversation. Instead, the tool  responded with inaccurate information frequently, When I pointed out these inaccuracies, it responded with partially corrected statements, each reply was prefixed with <code>"Apologies for the oversight"&lt; ......&gt;".</code></p>
<p>I realised AI brilliance can sometimes be deceptive..</p>
<p> this again mirrored moments from my interviews:</p>
<blockquote>
<p><em>During my second round of  interviews, some of the interviewers were kind enough and allowed me to correct myself when I made mistakes. I cleverly navigated these situations by confidently prefacing my answers with,</em> <code>"Sorry, I just recalled".</code><em>as I heard somewhere " you should be confident in the interviews even if you are wrong". Interestingly this approach proven worked many times.</em></p>
</blockquote>
<p>After few conversation from these AI tools , my curiosity turned into amusement.</p>
<p> As I delved deeper, the responses began citing :<code>"As of my last update in January 2022</code>",&lt;...&gt;</p>
<p>Despite feeling frustrated and tired after almost 5 hours . I admired the confidence of these AI tools they were still eager to assist . ChatGPT's  Prompt was Continuously beckoning with <code>"How can I help you today?".</code>  Gemini Star blinks as though analyzing the forthcoming question's response.</p>
<p>Suddenly, few college days memories flashed in the back of my mind which was more relevance in this context of Gen AI tool.</p>
<p>Here begins the Story :</p>
<p> It was the 2nd semester in my engineering (in 2009).  Himanshu and I breezed through the semester until the exam schedule dropped. Usually we work hard day before the semester and struggled to avoid back papers 😁. thanks to those summery (Alok) book📖.</p>
<p>Let me explain the hard work phase :</p>
<p>Somehow, our hostel mates recognized Himanshu and me as the brilliant students, relying on us for answers to all their questions like ChatGPT or Gemini. We didn't want them to feel hopeless. During semesters our hostel room was houseful,  Some of them seemed to be Dull but they had hope on us.</p>
<p>To start with</p>
<ul>
<li>we close the door and open YouTube and play a Verse from Bhagavad Gita . The most play one was chapter-2 verse-47.</li>
</ul>
<blockquote>
<p>     <em>"Karmanye vadhikaraste Ma Phaleshu Kadachana |</em></p>
<p>     <em>Ma Karma Phala Hetur Bhur Ma Te Sango Stv Akarmani ||</em></p>
<p>Meaning :</p>
<p>You have right to perform your prescribed duty, but you are not entitled to the fruits of actions.</p>
</blockquote>
<ul>
<li><p>Through this sloka, we inspire/ motivate them to at least fill up the answer booklet rather leaving it blank, at least you can hope to pass.</p>
</li>
<li><p>Now everyone is energetic Ready to consume all the Knowlwdge like blackholes.</p>
</li>
<li><p>I start reading the summery book📚 (Alok) and Himanshu  illustrates them like the Krishna 🕉️.</p>
</li>
<li><p>As always there was no question or doubt. A classy example of last hope.</p>
</li>
<li><p>Now its time to break for sleep to wake up on time to the exam hall.</p>
</li>
</ul>
<p> In the exam hall, as I received the Thermodynamics question paper , I quickly noticed that I only had answers for three 1-mark questions and one 5-mark question.</p>
<p>I acted like a AI tool 😉, decided to write those four answers at the beginning, Because first impression lasts long. From there, I began writing whatever came to mind, sometimes straying out of context and occasionally presenting contradictory views. However, I never left the answer paper blank, understanding that <code>my duty was to perform, regardless of the outcome being beyond my control.</code></p>
<p><mark>This is how the renowned Gen AI tools are Behaving these days 📝</mark></p>
<p>On result day, I wasn't particularly worried, as I understood the potential outcomes. However, like any normal human, I still felt a sense of hope. Coincidentally, I had passed with a C-grade, which was beyond my expectations. Now I realized the power and sweet spot. And the history repeats.</p>
<p>Moral of the story:</p>
<ul>
<li><p>Gen AI Is immature now so use Responsively. It may mislead often</p>
</li>
<li><p>Validate each piece of info you get from tool then  Accept or learn</p>
</li>
<li><p>Can give you baseline Idea, To know the fundamentals please refer official guides and evident articles to enforce your analysis and research.</p>
</li>
</ul>
<p>Cherised memory with <a target="_blank" href="https://www.linkedin.com/in/tossali-nanda-2343aa55/">Tossali</a>, <a target="_blank" href="https://www.linkedin.com/in/himansu-sekhar/">Himanshu</a> and <a target="_blank" href="https://www.linkedin.com/in/sidharth-tripathy-4a6b90161/">Sidharth</a> 🍻.</p>
<p>Do let me know if you like my stroy !</p>
]]></content:encoded></item><item><title><![CDATA[Tale of Dependencies (Vendor lock-in, vendor neutrality and Managed Services)]]></title><description><![CDATA[Once upon a time in the software industry, Big companies looked for reliable partners (aka vendors) to manage their services. Meanwhile, these vendors focused on retaining existing clients and offering tailored solutions or products directly. In this...]]></description><link>https://samirparhi.com/tale-of-dependencies</link><guid isPermaLink="true">https://samirparhi.com/tale-of-dependencies</guid><category><![CDATA[#vendorneutral]]></category><category><![CDATA[Open Source]]></category><category><![CDATA[managed security services]]></category><category><![CDATA[#cybersecurity]]></category><category><![CDATA[SaaS]]></category><dc:creator><![CDATA[Samir Ranjan Parhi]]></dc:creator><pubDate>Fri, 12 Apr 2024 17:01:39 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1712940886408/8f0373b0-355c-4996-a1db-cec666f969d6.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Once upon a time in the software industry, Big companies looked for reliable partners (aka vendors) to manage their services. Meanwhile, these vendors focused on retaining existing clients and offering tailored solutions or products directly. In this process Organizations of all sectors were investing double, even sometimes five or ten times the amount to support a product/service. This sparked a global interest in service offerings, igniting a revolution in the software industry.</p>
<p>Imagine a Banking application:</p>
<ol>
<li><p>Business partner (CRM) software was from vendor X,</p>
</li>
<li><p>Loan and CIBIL management software from company Y, and</p>
</li>
<li><p>Staff management (HR) software from company Z.</p>
</li>
</ol>
<p> Sounds like a robust setup, Actually Not?</p>
<p>Yes, stitching these pieces together (integration), wasn't as simple as snapping Lego bricks together. There is a dependency on these three companies, anytime you try to do some changes to one or the other software in this eco system . This is what we know as vendor lock-in.</p>
<p>This situation was well leveraged by a lot of vendors to create business suite software (like ERPs and CRMs) Down the lane leads to monopolize the market and further tightening the grip of vendor lock-in. Unfortunately Start-Ups were not able to leverage these kind of software as these solutions were not just expensive but also monopolized the market.</p>
<p>Every challenge birth innovation, and that's where APIs (Application programming interfaces) came into existence. APIs  made software more extensible, structured and work independently. This empowered organizations to embrace open-source solutions (though not directly) and break free from vendor lock-in.</p>
<p>when we talk about adaptation of opensource, of course we give the business to foster on their expertise without fearing about technological enablement, in the same time security risks lurked around the corner as opensource project embrace the code commits from a wide audience worldwide. Fear tends to business opportunities, several companies and consulting firms stepped in to provide managed services by adapting open-source solutions and specializing in managed services and offer a unique way of utilizing open-source software, sometimes referred to as SaaS. With a focus on security, upgrades, and scalability, managed services bridged the gap between vendor locking and vendor neutrality in the economic way.</p>
<p> Now the trend is freemium, which hurts the Open-source contributors at a point of time, but no worries we can always fork</p>
<p> With each chapter, innovation paves the way for businesses to thrive, breaking barriers and embracing new possibilities.</p>
<p>This was a quick take from my experience :-)  </p>
<p>Stay tuned for more!</p>
]]></content:encoded></item><item><title><![CDATA[Building a Dynamic Data Pipeline from Scratch with Snowflake and Python]]></title><description><![CDATA[Data Pipelines are very crucial to data modeling and training. In this blog, we will design a pipeline from scratch using Python , Snowflake , and NumPy .

The Problem Statement
Sells 44 is an e-commerce platform that needs some user data for its cam...]]></description><link>https://samirparhi.com/building-a-dynamic-data-pipeline-from-scratch-with-snowflake-and-python</link><guid isPermaLink="true">https://samirparhi.com/building-a-dynamic-data-pipeline-from-scratch-with-snowflake-and-python</guid><category><![CDATA[snowflake tutorial]]></category><category><![CDATA[GitHub]]></category><category><![CDATA[github-actions]]></category><category><![CDATA[Python]]></category><category><![CDATA[Data Science]]></category><category><![CDATA[AI]]></category><dc:creator><![CDATA[Samir Ranjan Parhi]]></dc:creator><pubDate>Thu, 11 Apr 2024 18:30:00 GMT</pubDate><content:encoded><![CDATA[<p>Data Pipelines are very crucial to data modeling and training. In this blog, we will design a pipeline from scratch using <strong>Python</strong> , <strong>Snowflake</strong> , and <strong>NumPy</strong> .</p>
<hr />
<h3 id="heading-the-problem-statement"><strong>The Problem Statement</strong></h3>
<p>Sells 44 is an e-commerce platform that needs some user data for its campaign. You are hence asked to extract sales data from <strong>Snowflake</strong> , perform transformations using <strong>Pandas</strong> and <strong>NumPy</strong> (e.g., handling missing values and aggregating sales by region), and then save the final output back to <strong>Snowflake</strong> or to a <strong>CSV</strong> for further analysis.</p>
<hr />
<h3 id="heading-system-design"><strong>System Design</strong></h3>
<h4 id="heading-1-components"><strong>1. Components</strong></h4>
<ul>
<li><p><strong>Snowflake:</strong> The cloud-based data warehouse where the raw sales data is stored.</p>
</li>
<li><p><strong>Python:</strong> The programming language used for data pipeline orchestration.</p>
</li>
<li><p><strong>Snowflake Connector for Python:</strong> This allows seamless interaction with Snowflake to extract and load data.</p>
</li>
<li><p><strong>Pandas:</strong> Used for data manipulation, cleaning, and transformation.</p>
</li>
<li><p><strong>NumPy:</strong> Used for numerical operations and advanced calculations.</p>
</li>
<li><p><strong>CSV Output or Data Persistence:</strong> The final transformed data can be written back to Snowflake or exported as a CSV for external use.</p>
</li>
</ul>
<h4 id="heading-2-flow-the-etl-process"><strong>2. Flow (The ETL Process)</strong></h4>
<ul>
<li><p><strong>Extract:</strong> Fetch raw sales data from Snowflake.</p>
</li>
<li><p><strong>Transform:</strong> Clean the data using Pandas (handle missing values, filter, group, and calculate). Use NumPy for any complex numerical operations.</p>
</li>
<li><p><strong>Load:</strong> Save the transformed data either back into Snowflake or export it as a CSV for further reporting.</p>
<ul>
<li><p><strong>Establish a Snowflake Connection:</strong> Connects to Snowflake using your credentials and account information.</p>
</li>
<li><p><strong>Extract:</strong> Runs a SQL query to fetch sales data.</p>
</li>
<li><p><strong>Pandas Transformation:</strong></p>
<ul>
<li><p><strong>Missing Values:</strong> Fills missing values in the <code>sales_amount</code> column with the mean.</p>
</li>
<li><p><strong>NumPy Transformation:</strong> Applies a log transformation to scale the sales data using NumPy.</p>
</li>
<li><p><strong>Aggregation:</strong> Groups the data by region and aggregates the total sales.</p>
</li>
</ul>
</li>
<li><p><strong>Load:</strong> Saves the transformed data to a CSV file or writes it back to Snowflake.</p>
</li>
</ul>
</li>
</ul>
<h3 id="heading-lets-code-it"><strong>Let’s Code It</strong></h3>
<h4 id="heading-1-setup-the-snowflake-connector"><strong>1. Setup the Snowflake Connector</strong></h4>
<p>You'll need to install the Snowflake connector and Pandas library:</p>
<pre><code class="lang-python">pip install snowflake-connector-python pandas numpy
</code></pre>
<h4 id="heading-2-code-for-the-data-pipeline"><strong>2. Code for the Data Pipeline:</strong></h4>
<pre><code class="lang-python"><span class="hljs-keyword">import</span> snowflake.connector
<span class="hljs-keyword">import</span> pandas <span class="hljs-keyword">as</span> pd
<span class="hljs-keyword">import</span> numpy <span class="hljs-keyword">as</span> np

<span class="hljs-comment"># Step 1: Establish connection to Snowflake</span>
conn = snowflake.connector.connect(
    user=<span class="hljs-string">'your_username'</span>,
    password=<span class="hljs-string">'your_password'</span>,
    account=<span class="hljs-string">'your_account_url'</span>
)

<span class="hljs-comment"># Step 2: Query Snowflake to extract data</span>
query = <span class="hljs-string">"""
SELECT region, sales_amount, sales_date
FROM sales_data
WHERE sales_date &gt;= '2024-01-01'
"""</span>

<span class="hljs-comment"># Step 3: Execute the query and fetch data</span>
cur = conn.cursor()
cur.execute(query)
data = cur.fetchall()

<span class="hljs-comment"># Step 4: Load the data into a Pandas DataFrame</span>
columns = [<span class="hljs-string">'region'</span>, <span class="hljs-string">'sales_amount'</span>, <span class="hljs-string">'sales_date'</span>]
df = pd.DataFrame(data, columns=columns)

<span class="hljs-comment"># Step 5: Data Cleaning and Transformation</span>
<span class="hljs-comment"># Fill missing values in the 'sales_amount' column with the mean</span>
df[<span class="hljs-string">'sales_amount'</span>].fillna(df[<span class="hljs-string">'sales_amount'</span>].mean(), inplace=<span class="hljs-literal">True</span>)

<span class="hljs-comment"># Use NumPy to apply advanced numerical transformations (e.g., scaling)</span>
df[<span class="hljs-string">'scaled_sales'</span>] = np.log(df[<span class="hljs-string">'sales_amount'</span>] + <span class="hljs-number">1</span>)

<span class="hljs-comment"># Aggregate sales by region</span>
aggregated_data = df.groupby(<span class="hljs-string">'region'</span>)[<span class="hljs-string">'sales_amount'</span>].sum().reset_index()

<span class="hljs-comment"># Step 6: Save the transformed data back to Snowflake or to a CSV</span>
<span class="hljs-comment"># Save to CSV</span>
aggregated_data.to_csv(<span class="hljs-string">'aggregated_sales_data.csv'</span>, index=<span class="hljs-literal">False</span>)

<span class="hljs-comment"># Alternatively, you can write the data back to Snowflake:</span>
<span class="hljs-comment"># cur.execute("CREATE OR REPLACE TABLE transformed_sales_data (region STRING, total_sales FLOAT)")</span>
<span class="hljs-comment"># for index, row in aggregated_data.iterrows():</span>
<span class="hljs-comment">#     cur.execute(f"INSERT INTO transformed_sales_data (region, total_sales) VALUES ('{row['region']}', {row['sales_amount']})")</span>

<span class="hljs-comment"># Close the cursor and connection</span>
cur.close()
conn.close()

print(<span class="hljs-string">"Data pipeline completed successfully!"</span>)
</code></pre>
<h3 id="heading-scalability"><strong>Scalability</strong></h3>
<p>The architecture allows easy scaling as <strong>Snowflake</strong> handles large datasets efficiently. <strong>Python’s</strong> flexibility enables more complex transformations if needed.</p>
<h3 id="heading-deployment-considerations"><strong>Deployment Considerations</strong></h3>
<p>The pipeline can be scheduled using <strong>Jenkins jobs</strong> or <strong>GitHub Actions</strong> .</p>
<h4 id="heading-example-github-action-workflow"><strong>Example GitHub Action Workflow:</strong></h4>
<pre><code class="lang-python">name: Snowflake Pipeline Schedule

<span class="hljs-comment"># Schedule to run daily at 12:00 AM (UTC)</span>
on:
  schedule:
    - cron: <span class="hljs-string">'0 0 * * *'</span>

  workflow_dispatch: <span class="hljs-comment"># Allows manual trigger</span>

jobs:
  run-snowflake-pipeline:
    runs-on: ubuntu-latest

    steps:
    <span class="hljs-comment"># Step 1: Checkout the repository code</span>
    - name: Checkout code
      uses: actions/checkout@v3

    <span class="hljs-comment"># Step 2: Set up Python environment</span>
    - name: Set up Python <span class="hljs-number">3.</span>x
      uses: actions/setup-python@v4
      <span class="hljs-keyword">with</span>:
        python-version: <span class="hljs-string">'3.x'</span>

    <span class="hljs-comment"># Step 3: Install dependencies</span>
    - name: Install dependencies
      run: |
        python -m pip install --upgrade pip
        pip install snowflake-connector-python pandas numpy

    <span class="hljs-comment"># Step 4: Run the Snowflake pipeline</span>
    - name: Run Snowflake Data Pipeline
      env:
        SNOWFLAKE_USER: ${{ secrets.SNOWFLAKE_USER }}
        SNOWFLAKE_PASSWORD: ${{ secrets.SNOWFLAKE_PASSWORD }}
        SNOWFLAKE_ACCOUNT: ${{ secrets.SNOWFLAKE_ACCOUNT }}
      run: |
        python snowflake_pipeline.py
</code></pre>
<p>This pipeline demonstrates how to build a robust <strong>ETL process</strong> using <strong>Snowflake</strong> , <strong>Python</strong> , <strong>Pandas</strong> , and <strong>NumPy</strong> . It is scalable, efficient, and can be automated for recurring tasks.</p>
<p><strong>Happy Coding!</strong></p>
]]></content:encoded></item><item><title><![CDATA[SBOM: Know the Software's source of truth]]></title><description><![CDATA[Over the years, our focus has been on enhancing our software's functionality and striving for vendor neutrality. We've integrated various freely available modules from diverse sources to expand our applications. However, we inadvertently overlooked v...]]></description><link>https://samirparhi.com/sbom</link><guid isPermaLink="true">https://samirparhi.com/sbom</guid><category><![CDATA[Open Source]]></category><category><![CDATA[#cybersecurity]]></category><category><![CDATA[sbom]]></category><category><![CDATA[containers]]></category><category><![CDATA[Kubernetes]]></category><dc:creator><![CDATA[Samir Ranjan Parhi]]></dc:creator><pubDate>Tue, 12 Mar 2024 07:51:35 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1710230206601/e06e8d65-652c-4a83-b4f3-8c91ede6782c.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Over the years, our focus has been on enhancing our software's functionality and striving for vendor neutrality. We've integrated various freely available modules from diverse sources to expand our applications. However, we inadvertently overlooked verifying the authenticity of these sources.</p>
<p>Nowadays, with privacy concerns escalating across individuals and organisations, we've started scrutinising the origins of each code segment extensively. This scrutiny is aimed at ensuring that we can confidently deliver authentic products to our end-users without compromising on features while maintaining compatibility with other software.</p>
<p>The term <strong>SBOM</strong> (<strong>S</strong>oftware <strong>B</strong>ill <strong>o</strong>f <strong>M</strong>aterials) has become increasingly prominent in industry discussions over the past year. It's likely that we'll see a surge in demands for this skill set in the near future.</p>
<p>SBOM is to establishing trust, much like how blockchain operates. For instance, in a blockchain scenario:</p>
<p>when purchasing a diamond ring, the blockchain ensures the authenticity of the product from its mining origins to its delivery to the customer, despite involving numerous vendors and steps in the supply chain.</p>
<p>Similarly, SBOM applies this logic to software. While we may utilise various modules or dependencies in our codebase to create impressive products, SBOM provides crucial information regarding the authenticity and vulnerabilities of these third-party components.</p>
<h3 id="heading-so-sbom-is-for-whom">So, SBOM is for Whom?</h3>
<p>Technically for Everyone (because privacy is our Rights not an option 😊)</p>
<ol>
<li><p>Primarily for developers, solution architects/Consultants, delivery partners,</p>
</li>
<li><p>Companies or individuals consuming the software</p>
</li>
<li><p>Vendors or agencies providing its ongoing support (AMC).</p>
</li>
</ol>
<h3 id="heading-for-whom-it-is-a-whistle-blower">For whom it is a whistle blower?</h3>
<p>Based on recent analyses from various articles, it's evident that there's a growing trend towards embracing and promoting open source. While this is a positive development, the open nature of such projects means that they attract contributors and collaborators from around the globe who share their code. However, this openness also introduces potential risks. In some cases, developers may not adhere to best coding practices, particularly in popular codebases where thorough code reviews might not occur. Consequently, there's a heightened risk of subpar code being committed to the codebase.</p>
<h3 id="heading-whats-the-solution-then">What's the solution then?</h3>
<p>Indeed, thanks to the global open-source community, initiatives have been taken to develop and promote SBOM tools, enabling meticulous scrutiny of each code segment. These tools can operate during various stages, including raising a PR, building applications, and containerizing code, ensuring thorough checks even when end customers consume the software. This advancement provides developers and technical professionals involved in product development with peace of mind. The SBOM tool space continues to evolve and improve daily. Let's delve into some of these open-source SBOM tools:</p>
<ol>
<li><p>Sbomit: <a target="_blank" href="https://sbomit.dev/">https://sbomit.dev</a></p>
</li>
<li><p>Fossology: <a target="_blank" href="https://www.fossology.org/">https://www.fossology.org</a></p>
</li>
<li><p>Cyclonedx: <a target="_blank" href="https://cyclonedx.org/">https://cyclonedx.org</a></p>
</li>
<li><p>Tldrlegal: <a target="_blank" href="https://www.tldrlegal.com/">https://www.tldrlegal.com</a></p>
</li>
<li><p>Dep Scan: <a target="_blank" href="https://github.com/owasp-dep-scan/dep-scan">https://github.com/owasp-dep-scan/dep-scan</a></p>
</li>
<li><p>BOM for K8S: <a target="_blank" href="https://github.com/kubernetes-sigs/bom">https://github.com/kubernetes-sigs/bom</a></p>
</li>
<li><p>SW360: <a target="_blank" href="https://projects.eclipse.org/projects/technology.sw360">https://projects.eclipse.org/projects/technology.sw360</a></p>
</li>
<li><p>Tern: <a target="_blank" href="https://github.com/tern-tools/tern">https://github.com/tern-tools/tern</a></p>
</li>
<li><p>scancode-toolkit: <a target="_blank" href="https://github.com/nexB/scancode-toolkit">https://github.com/nexB/scancode-toolkit</a></p>
</li>
<li><p>Fossid: <a target="_blank" href="https://fossid.com/open-source-audit-services/">https://fossid.com/open-source-audit-services/</a></p>
</li>
<li><p>Leanix: <a target="_blank" href="https://www.leanix.net/en/wiki/trm/software-bill-of-materials">https://www.leanix.net/en/wiki/trm/software-bill-of-materials</a></p>
</li>
<li><p>Yoctoproject: <a target="_blank" href="https://www.yoctoproject.org/">https://www.yoctoproject.org</a></p>
</li>
<li><p>Bomutils: <a target="_blank" href="https://github.com/hogliux/bomutils">https://github.com/hogliux/bomutils</a></p>
</li>
</ol>
<p><strong>Popular Reporting Standards:</strong></p>
<p>SPDX : <a target="_blank" href="https://spdx.dev/use/tools/open-source-tools/">https://spdx.dev/use/tools/open-source-tools/</a></p>
<h3 id="heading-is-there-a-way-to-ensure-end-user-confidence">Is there a way to ensure End-user Confidence ?</h3>
<p>Absolutely, we possess the means to attest and sign our products, thereby offering transparency regarding the risk posture to end customers. Credit goes to the open-source community for dedicating efforts to develop tools capable of attesting and verifying containerized binaries and files. This allows any end customer to verify the risk posture of the software being consumed using the generated certificate.</p>
<p>Few Open Source Attestation Tools are listed below :</p>
<p><strong>Tools:</strong></p>
<ol>
<li><p>Sigstore's Cosign: <a target="_blank" href="https://www.sigstore.dev/">https://www.sigstore.dev</a>  (GitHub: <a target="_blank" href="https://github.com/sigstore/cosign">https://github.com/sigstore/cosign</a>)</p>
</li>
<li><p>Notary: <a target="_blank" href="https://github.com/notaryproject/notary">https://github.com/notaryproject/notary</a></p>
</li>
<li><p>DCT: <a target="_blank" href="https://docs.docker.com/engine/security/trust/">https://docs.docker.com/engine/security/trust</a></p>
</li>
<li><p>In-toto: <a target="_blank" href="https://github.com/in-toto/attestation">https://github.com/in-toto/attestation</a></p>
</li>
<li><p>Portieris: <a target="_blank" href="https://github.com/IBM/portieris">https://github.com/IBM/portieris</a></p>
</li>
</ol>
<p><strong>Open Source Frameworks:</strong></p>
<p>TUF: <a target="_blank" href="https://theupdateframework.io/">https://theupdateframework.io</a></p>
<p><strong>Open Source Registries:</strong></p>
<p>Harbor: <a target="_blank" href="https://goharbor.io/docs/2.7.0/working-with-projects/working-with-images/sign-images/">https://goharbor.io/docs/2.7.0/working-with-projects/working-with-images/sign-images/</a></p>
<p>Docker Hub: &lt;you know the link right🤔&gt;</p>
<p>In conclusion, SBOM is becoming indispensable in ensuring software authenticity and security, benefiting stakeholders across the development and consumption spectrum.</p>
<p>Hope you loved reading it. 🍻</p>
]]></content:encoded></item><item><title><![CDATA[Cross-Site Scripting (XSS) Vulnerability and Mitigation in Web Applications]]></title><description><![CDATA[Introduction
In the realm of web security, Cross-Site Scripting (XSS) stands as one of the most prevalent and hazardous vulnerabilities. With its ability to manipulate the interaction between a web application and its users, XSS can lead to unauthori...]]></description><link>https://samirparhi.com/cross-site-scripting-xss-vulnerability-and-mitigation-in-web-applications</link><guid isPermaLink="true">https://samirparhi.com/cross-site-scripting-xss-vulnerability-and-mitigation-in-web-applications</guid><category><![CDATA[#cybersecurity]]></category><category><![CDATA[cyberattack]]></category><category><![CDATA[Open Source]]></category><category><![CDATA[Java]]></category><category><![CDATA[Springboot]]></category><dc:creator><![CDATA[Samir Ranjan Parhi]]></dc:creator><pubDate>Fri, 25 Aug 2023 08:59:45 GMT</pubDate><content:encoded><![CDATA[<p><strong>Introduction</strong></p>
<p>In the realm of web security, Cross-Site Scripting (XSS) stands as one of the most prevalent and hazardous vulnerabilities. With its ability to manipulate the interaction between a web application and its users, XSS can lead to unauthorized data exposure, session hijacking, and even malware distribution. This article delves into the concept of XSS, highlighting its potential impact and providing insight into securing applications against this threat.</p>
<p><strong>Understanding Cross-Site Scripting (XSS)</strong></p>
<p>At its core, XSS is a vulnerability that arises when a web application incorporates untrusted data into its output, allowing attackers to inject malicious scripts into the content delivered to other users. This often happens when user-generated content isn't properly sanitized before being displayed. The impact of an XSS attack can vary, from stealing sensitive information to impersonating users or even taking control of their accounts.</p>
<p><strong>Analyzing the Vulnerable Code</strong></p>
<p>Let's analyze a code snippet that fetches data from an API and processes it. This sample code contains potential XSS vulnerabilities:</p>
<pre><code class="lang-java"><span class="hljs-function"><span class="hljs-keyword">public</span> String <span class="hljs-title">getInfofromAPI</span><span class="hljs-params">(String Authorization, String comingRequest)</span> <span class="hljs-keyword">throws</span> Exception </span>{
        String returnOBJ = <span class="hljs-keyword">null</span>;
        String tempResponse = <span class="hljs-keyword">null</span>;
        RestTemplate restTemplate = <span class="hljs-keyword">new</span> RestTemplate();
        MultiValueMap&lt;String, String&gt; headers = <span class="hljs-keyword">new</span> LinkedMultiValueMap&lt;String, String&gt;();
        headers.add(<span class="hljs-string">"Content-Type"</span>, <span class="hljs-string">"application/json"</span>);
        headers.add(<span class="hljs-string">"AUTHORIZATION"</span>, Authorization);
        String encodedRequest = URLEncoder.encode(comingRequest, <span class="hljs-string">"UTF-8"</span>);
        HttpEntity&lt;Object&gt; request = <span class="hljs-keyword">new</span> HttpEntity&lt;Object&gt;(encodedRequest, headers);
        ResponseEntity&lt;String&gt; response = restTemplate.exchange(requiredURL, HttpMethod.POST, request,
                String.class);
        <span class="hljs-keyword">return</span> returnOBJ;
}
</code></pre>
<p>The key vulnerability here lies in the potential mishandling of the <code>returnOBJ</code> data. If the JSON response contains user-controlled data that is not properly sanitized before being processed or displayed, an attacker could inject malicious scripts.</p>
<p><strong>Mitigating XSS Vulnerabilities</strong></p>
<ol>
<li><p><strong>Input Validation and Sanitization:</strong> Implement strict input validation and sanitize all incoming data. In the case of user-generated content, utilize output encoding functions to ensure that any data displayed on the web page is treated as plain text rather than executable code.</p>
</li>
<li><p><strong>Content Security Policy (CSP):</strong> Utilize CSP headers to restrict the sources from which content can be loaded onto your web page. This can prevent the execution of scripts from unauthorized sources.</p>
</li>
<li><p><strong>Contextual Output Encoding:</strong> Encode output based on its context. Different encoding methods should be used for HTML, JavaScript, and URL contexts to ensure the correct interpretation of data.</p>
</li>
<li><p><strong>Use Framework Security Features:</strong> Many web frameworks offer security features to prevent XSS, such as automatic output encoding. Leverage these features to protect your application.</p>
</li>
<li><p><strong>Regular Security Audits:</strong> Regularly audit your application's codebase for potential vulnerabilities, including XSS. Automated tools and manual reviews can help identify and address security issues.</p>
</li>
</ol>
<p>Now as we understood, Let's rewrite the above code by mitigating the XSS Vulnerabilities using the User input sanitization method.</p>
<pre><code class="lang-java"><span class="hljs-function"><span class="hljs-keyword">public</span> String <span class="hljs-title">getResponseFromAPI</span><span class="hljs-params">(String Authorization, String comingRequest)</span> <span class="hljs-keyword">throws</span> Exception </span>{
        String returnOBJ = <span class="hljs-keyword">null</span>;
        String tempResponse = <span class="hljs-keyword">null</span>;
        RestTemplate restTemplate = <span class="hljs-keyword">new</span> RestTemplate();
        MultiValueMap&lt;String, String&gt; headers = <span class="hljs-keyword">new</span> LinkedMultiValueMap&lt;String, String&gt;();
        headers.add(<span class="hljs-string">"Content-Type"</span>, <span class="hljs-string">"application/json"</span>);
        headers.add(<span class="hljs-string">"AUTHORIZATION"</span>, Authorization);
        String encodedRequest = URLEncoder.encode(comingRequest, <span class="hljs-string">"UTF-8"</span>);
        HttpEntity&lt;Object&gt; request = <span class="hljs-keyword">new</span> HttpEntity&lt;Object&gt;(encodedRequest, headers);
        ResponseEntity&lt;String&gt; response = restTemplate.exchange(destinationURL, HttpMethod.POST, request,
                String.class);
        tempResponse = response.getBody();
        // Desired key-value pairs and their types
        String desiredKey1 = "Name";
        Class&lt;?&gt; desiredValueType1 = String.class;

        String desiredKey2 = "createdDate";
        Class&lt;?&gt; desiredValueType2 = Timestamp.class;
        // Parse the JSON response
        ObjectMapper objectMapper = <span class="hljs-keyword">new</span> ObjectMapper();
        JsonNode jsonNode = objectMapper.readTree(tempResponse);

        <span class="hljs-comment">// Check if the desired key-value pairs exist</span>
        <span class="hljs-keyword">if</span> (jsonNode.has(desiredKey1) &amp;&amp; jsonNode.has(desiredKey2)) {
            <span class="hljs-keyword">if</span> (jsonNode.get(desiredKey1).getClass().equals(desiredValueType1)) {
                <span class="hljs-keyword">if</span> (jsonNode.get(desiredKey2).getClass().equals(desiredValueType2)) {
                    returnOBJ = objectMapper.writeValueAsString(jsonNode);
                } <span class="hljs-keyword">else</span> {
                    System.out.println(<span class="hljs-string">"Value type for key2 does not match the desired type."</span>);
                }
            } <span class="hljs-keyword">else</span> {
                System.out.println(<span class="hljs-string">"Value type for key1 does not match the desired type."</span>);
            }
        } <span class="hljs-keyword">else</span> {
            System.out.println(<span class="hljs-string">"Desired key-value pairs not found in the JSON response."</span>);
        }
        <span class="hljs-keyword">return</span> returnOBJ;

    }
}
</code></pre>
<p>In the above code, we have validated if the Response we got has the Appropriate <code>key</code> and the corresponding <code>value</code> is of required data type.</p>
<p><strong>Conclusion</strong></p>
<p>Cross-site scripting (XSS) remains a significant threat to web applications, making them susceptible to data breaches and unauthorized access. By understanding the nature of XSS vulnerabilities and implementing proper security measures, developers can fortify their applications against these risks. Input validation, output encoding, and leveraging security features provided by frameworks are crucial steps in mitigating XSS and creating a safer online experience for users.</p>
<p>Happy Learning 🎉</p>
]]></content:encoded></item><item><title><![CDATA[Parameters to Consider while choosing an Open-Source tool.]]></title><description><![CDATA[When deciding on an open-source tool for a specific purpose, there are several key parameters you should consider to ensure the tool meets your needs and is a good fit for your project. Here are some important parameters to keep in mind:

Functionali...]]></description><link>https://samirparhi.com/parameters-to-consider-while-choosing-an-open-source-tool</link><guid isPermaLink="true">https://samirparhi.com/parameters-to-consider-while-choosing-an-open-source-tool</guid><category><![CDATA[Open Source]]></category><category><![CDATA[chooseAnOpenSourceTool]]></category><dc:creator><![CDATA[Samir Ranjan Parhi]]></dc:creator><pubDate>Wed, 09 Aug 2023 06:19:03 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/stock/unsplash/X5FDG7k5M94/upload/83eff15133e72297c9f646fafc174774.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>When deciding on an open-source tool for a specific purpose, there are several key parameters you should consider to ensure the tool meets your needs and is a good fit for your project. Here are some important parameters to keep in mind:</p>
<ol>
<li><p><strong>Functionality</strong>: The tool should have the features and capabilities required to fulfil your project's objectives. Make a list of the specific functions you need and compare them with the tool's capabilities.</p>
</li>
<li><p><strong>Ease of Use</strong>: Consider the tool's user interface, documentation, and overall usability. An intuitive and well-documented tool can save you time and effort during the learning and implementation phases.</p>
</li>
<li><p><strong>Community and Support</strong>: A strong and active community can provide valuable assistance, share knowledge, and contribute to the tool's improvement. Check the community size, forums, mailing lists, and support resources.</p>
</li>
<li><p><strong>Documentation</strong>: Comprehensive and up-to-date documentation is crucial for understanding how to use the tool effectively. It should include installation guides, tutorials, API references, and troubleshooting information.</p>
</li>
<li><p><strong>Popularity and Adoption</strong>: Tools with a larger user base often have better community support, more frequent updates, and a higher chance of long-term maintenance.</p>
</li>
<li><p><strong>Licensing</strong>: Open-source tools come with various licenses, some of which may have restrictions on usage, distribution, or modification. Ensure the tool's license aligns with your project's requirements and legal obligations.</p>
</li>
<li><p><strong>Customization and Extensibility</strong>: Determine whether the tool can be customized or extended to suit your specific needs. A highly customizable tool can be adapted to fit your project's unique requirements.</p>
</li>
<li><p><strong>Performance</strong>: Evaluate the tool's performance in terms of speed, resource usage, and scalability. Ensure it can handle the expected workload without significant bottlenecks.</p>
</li>
<li><p><strong>Security</strong>: Assess the tool's security features, vulnerabilities, and track record for addressing security issues promptly. Security is crucial, especially if the tool handles sensitive data or interacts with external systems.</p>
</li>
<li><p><strong>Compatibility and Integrations</strong>: Check if the tool can integrate seamlessly with your existing infrastructure, software, or other tools you're using. Compatibility can save time and reduce implementation challenges.</p>
</li>
<li><p><strong>Longevity and Maintenance</strong>: Consider the tool's development activity and the frequency of updates. An actively maintained tool is less likely to become outdated or abandoned.</p>
</li>
<li><p><strong>Vendor Lock-In</strong>: Be cautious of tools that might lead to vendor lock-in, making it difficult to switch to alternative solutions in the future. Open standards and open data formats can help mitigate this risk.</p>
</li>
<li><p><strong>Scalability</strong>: If your project is expected to grow, ensure that the tool can scale with increasing demand and handle larger datasets or user loads.</p>
</li>
<li><p><strong>Cost and Budget</strong>: While open-source tools are often cost-effective, consider any associated costs such as training, customization, and support.</p>
</li>
<li><p><strong>Reviews and Feedback</strong>: Research online reviews, user testimonials, and case studies to gather insights from others who have used the tool for similar purposes.</p>
</li>
<li><p><strong>Ease of Installation and Setup</strong>: Consider how straightforward it is to install, configure, and set up the tool. A complex installation process might hinder your project's progress.</p>
</li>
<li><p><strong>Ecosystem</strong>: Check if the tool is part of a larger ecosystem of related tools or libraries that can enhance its functionality.</p>
</li>
</ol>
<p>By carefully evaluating these parameters, you can make an informed decision about which open-source tool best aligns with your project's requirements and goals.</p>
<p>Let me know your thoughts !</p>
]]></content:encoded></item><item><title><![CDATA[Uncontrolled Data Used in Path Expression: A Cyber Security Threat]]></title><description><![CDATA[Path expressions are used in a variety of software applications to construct file paths. However, if these expressions are not properly validated, they can be used by attackers to gain unauthorized access to sensitive data or systems.
This type of at...]]></description><link>https://samirparhi.com/uncontrolled-data-used-in-path-expression-a-cyber-security-threat</link><guid isPermaLink="true">https://samirparhi.com/uncontrolled-data-used-in-path-expression-a-cyber-security-threat</guid><category><![CDATA[#cybersecurity]]></category><category><![CDATA[Open Source]]></category><category><![CDATA[Java]]></category><category><![CDATA[Cloud]]></category><category><![CDATA[pathtraversal]]></category><dc:creator><![CDATA[Samir Ranjan Parhi]]></dc:creator><pubDate>Mon, 31 Jul 2023 05:09:13 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/stock/unsplash/4dKy7d3lkKM/upload/04abeb7595cc7c37f5fcac64cd008924.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Path expressions are used in a variety of software applications to construct file paths. However, if these expressions are not properly validated, they can be used by attackers to gain unauthorized access to sensitive data or systems.</p>
<p>This type of attack is known as <strong>path traversal</strong>, and it can be used to access files that are outside of the intended directory structure. For example, an attacker could provide a path expression that includes a "../" sequence, which would cause the application to traverse up one directory level. This could allow the attacker to access files that they would not otherwise be able to see.</p>
<p>Path traversal attacks can also be used to exploit vulnerabilities in web applications. For example, an attacker could provide a path expression that includes a ".." sequence in a web form. If the application does not properly validate the input, the attacker could use this to access the application's filesystem.</p>
<p>To prevent path traversal attacks, it is important to properly validate all user input that is used to construct path expressions. This can be done by using a regular expression to ensure that the input only contains valid characters. Additionally, it is important to restrict the access that users have to sensitive files and directories.</p>
<p>Here are some tips for preventing path traversal attacks:</p>
<ul>
<li><p>Use a regular expression to validate all user input that is used to construct path expressions.</p>
</li>
<li><p>Restrict the access that users have to sensitive files and directories.</p>
</li>
<li><p>Use a web application firewall (WAF) to filter out malicious requests.</p>
</li>
<li><p>Keep your software up to date with the latest security patches.</p>
</li>
</ul>
<p>By following these tips, you can help to protect your applications from path traversal attacks.</p>
<p><strong>Here are some examples of path traversal attacks:</strong></p>
<ul>
<li><p><code>file:///etc/passwd</code> - This path expression would allow an attacker to access the <code>passwd</code> file, which contains the usernames and passwords of all users on the system.</p>
</li>
<li><p><a target="_blank" href="http://localhost/../etc/passwd"><code>http://localhost/../etc/passwd</code></a> - This path expression would allow an attacker to access the <code>passwd</code> file from a web application.</p>
</li>
<li><p><code>c:\\windows\\system32\\cmd.exe</code> - This path expression would allow an attacker to execute a command on a Windows system.</p>
</li>
</ul>
<p><strong>Code:</strong></p>
<p>This example illustrates how important it is to properly validate all user input that is used to construct path expressions. By validating the input, you can help to protect your applications from path traversal attacks.</p>
<pre><code class="lang-java"><span class="hljs-keyword">import</span> java.io.File;
<span class="hljs-keyword">import</span> java.io.IOException;

<span class="hljs-keyword">public</span> <span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">PathTraversalExample</span> </span>{

    <span class="hljs-function"><span class="hljs-keyword">public</span> <span class="hljs-keyword">static</span> <span class="hljs-keyword">void</span> <span class="hljs-title">main</span><span class="hljs-params">(String[] args)</span> <span class="hljs-keyword">throws</span> IOException </span>{
        String filename = <span class="hljs-string">"/etc/passwd"</span>;

        <span class="hljs-comment">// This code is vulnerable to path traversal attacks.</span>
        File file = <span class="hljs-keyword">new</span> File(filename);
        System.out.println(file.exists());

        <span class="hljs-comment">// This code is safe from path traversal attacks.</span>
        String sanitizedFilename = filename.replaceAll(<span class="hljs-string">"../"</span>, <span class="hljs-string">""</span>);
        File safeFile = <span class="hljs-keyword">new</span> File(sanitizedFilename);
        System.out.println(safeFile.exists());
    }
}
</code></pre>
<p>In this example, the <code>filename</code> variable is used to construct a file path. If the user provides a path that includes a ".." sequence, the application will traverse up one directory level. This could allow the attacker to access the <code>etc/passwd</code> file, which contains the usernames and passwords of all users on the system.</p>
<p>The <code>sanitizedFilename</code> variable is created by replacing all occurrences of the ".." sequence with an empty string. This ensures that the path expression is safe from path traversal attacks.</p>
<p>If you provide a path that includes a ".." sequence, the application will print <code>false</code>. If you provide a safe path, the application will print <code>true</code>.</p>
<p><strong>If you think that your application may be vulnerable to path traversal attacks, there are a few things you can do:</strong></p>
<ul>
<li><p>Scan your application for vulnerabilities using a security scanner.</p>
</li>
<li><p>Review the source code of your application to look for potential vulnerabilities.</p>
</li>
<li><p>Contact the vendor of your application for security updates.</p>
</li>
</ul>
<p>By taking these steps, you can help to protect your application from path traversal attacks.</p>
<p>Happy Learning</p>
]]></content:encoded></item><item><title><![CDATA[Protecting Apps from SQL Injection (Type: Query built from user-controlled sources)]]></title><description><![CDATA[It is essential in the field of software development to provide people control over their data and experiences. Users' experiences are improved when they can build unique queries using user-controlled sources, which also gives them a sense of control...]]></description><link>https://samirparhi.com/protecting-apps-from-sql-injection-type-query-built-from-user-controlled-sources</link><guid isPermaLink="true">https://samirparhi.com/protecting-apps-from-sql-injection-type-query-built-from-user-controlled-sources</guid><category><![CDATA[#cybersecurity]]></category><category><![CDATA[cybersecurity]]></category><category><![CDATA[#sqlinjection]]></category><category><![CDATA[user experience]]></category><category><![CDATA[Open Source]]></category><dc:creator><![CDATA[Samir Ranjan Parhi]]></dc:creator><pubDate>Wed, 26 Jul 2023 12:24:57 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/stock/unsplash/Y9kOsyoWyaU/upload/ee49c618b53a27597fd6435caffee750.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>It is essential in the field of software development to provide people control over their data and experiences. Users' experiences are improved when they can build unique queries using user-controlled sources, which also gives them a sense of control and flexibility. This strategy has a lot of advantages, but it also has its share of drawbacks and potential problems.</p>
<h3 id="heading-security-concerns">Security Concerns:</h3>
<p>The security of user-controlled queries is one of the most important challenges. Malicious users could take advantage of security flaws like SQL injection, giving them access to the application's data or the ability to change it. The following recommendation can be used to resolve this problem:</p>
<p>a. Input Validation: Thoroughly validate and sanitize user input to prevent unauthorized characters or SQL commands from being executed.</p>
<p>a. Parameterized Queries: When working with databases, utilize parameterized queries to avoid directly inserting user input into the query.</p>
<p>c. The least privilege principle: Make sure that the database user for the application has the fewest rights necessary to carry out the needed actions, minimizing the possible impact of an attack.</p>
<p>Example: The below method implements a Java example of Parameterised query:</p>
<pre><code class="lang-java"><span class="hljs-keyword">import</span> java.sql.Timestamp;
<span class="hljs-comment">//Include your main class here with method</span>
<span class="hljs-comment">//The method declaration for update a product in a Schema</span>
<span class="hljs-function"><span class="hljs-keyword">public</span> <span class="hljs-keyword">int</span> <span class="hljs-title">updateProduct</span><span class="hljs-params">(String schemaName, String tableName, Strin proudId,
            String autoIncreamentColumn, String user)</span> <span class="hljs-keyword">throws</span> Exception </span>{
        jdbcTemplate = getJdbcTemplate();
        String query = <span class="hljs-string">" UPDATE "</span> + schemaName + <span class="hljs-string">"."</span> + tableName
                + <span class="hljs-string">" SET processed = 'P' , SyncedDate = ?, Syncedby = ? WHERE "</span> + autoIncreamentColumn
                + <span class="hljs-string">" IN ("</span> + proudId + <span class="hljs-string">")"</span>;

        Timestamp syncedDate = <span class="hljs-keyword">new</span> Timestamp(System.currentTimeMillis());
        <span class="hljs-keyword">int</span> updatedRows = jdbcTemplate.update(query, syncedDate, user);

        <span class="hljs-keyword">return</span> updatedRows;

    }
</code></pre>
<p>Here <code>?</code> denotes the positional parameters for <code>syncedDate</code> and <code>user</code> .</p>
<h3 id="heading-complexities">Complexities :</h3>
<p><strong>Performance Impact:</strong></p>
<p>Allowing users to create complex and dynamic queries can impact the application's performance, especially with large datasets. To mitigate performance issues:</p>
<p>a. Limit Complexity: Set reasonable constraints on the complexity and size of user-generated queries to prevent excessive database load.</p>
<p>b. Caching: Implement caching mechanisms to store frequently accessed query results, reducing the need to execute the same query repeatedly.</p>
<p>c. Indexing: Optimize the database schema with appropriate indexes to improve query performance.</p>
<p><strong>Data Integrity:</strong></p>
<p>When users construct their queries, there is a risk of retrieving inaccurate or irrelevant data, leading to skewed results or misinterpretations. To maintain data integrity:</p>
<p>a. Provide Guidance: Provide users with clear guidelines and tooltips to assist them in formulating accurate and relevant queries.</p>
<p>b. User Feedback: Implement user feedback mechanisms to collect insights on the usefulness and relevance of query results.</p>
<p><strong>User Experience and Usability:</strong></p>
<p>An overly complex or confusing user interface can deter users from utilizing the query-building feature to its full potential. To enhance user experience:</p>
<p>a. Intuitive Design: Design a user-friendly interface with clear labels and intuitive controls to help users navigate and construct queries effortlessly.</p>
<p>b. Query Previews: Provide a query preview feature, allowing users to see the results before executing the query.</p>
<p>c. Error Handling: Implement informative error messages that guide users when their queries contain errors or return no results.</p>
<p><strong>Compatibility with Data Sources:</strong></p>
<p>The queries built by users must be compatible with the underlying data sources. Different data sources may have varying query languages or capabilities. To ensure compatibility:</p>
<p>a. Abstraction Layer: Implement an abstraction layer that translates user-generated queries into the appropriate syntax for each data source.</p>
<p>b. Data Source Validation: Verify and validate user-generated queries against the capabilities of the specific data source.</p>
<h3 id="heading-conclusion">Conclusion</h3>
<p>The ability to build queries from user-controlled sources has brought immense value to modern software applications. However, developers must remain vigilant about the challenges that come with this feature. By prioritizing security, performance, data integrity, user experience, and compatibility, developers can overcome these challenges and create a robust and user-friendly query-building system.</p>
<p>Empowering users with control over their queries can lead to higher user satisfaction, increased engagement, and a deeper connection with the application. Striking the right balance between flexibility and control while addressing potential issues will pave the way for a successful and empowering user experience.</p>
]]></content:encoded></item><item><title><![CDATA[Understanding Server-Side Request Forgery (SSRF)]]></title><description><![CDATA[Introduction:
In today's interconnected world, web applications rely on various external services to provide dynamic content and functionality. However, this dependence on external resources can also create security vulnerabilities, one of which is S...]]></description><link>https://samirparhi.com/understanding-server-side-request-forgery-ssrf</link><guid isPermaLink="true">https://samirparhi.com/understanding-server-side-request-forgery-ssrf</guid><category><![CDATA[ssrf ]]></category><category><![CDATA[Open Source]]></category><category><![CDATA[Java]]></category><category><![CDATA[cybersecurity]]></category><category><![CDATA[CyberSec]]></category><dc:creator><![CDATA[Samir Ranjan Parhi]]></dc:creator><pubDate>Sat, 22 Jul 2023 09:09:41 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/stock/unsplash/40XgDxBfYXM/upload/9b7a2c0f78e8deb33b46f23aca98164d.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h3 id="heading-introduction">Introduction:</h3>
<p>In today's interconnected world, web applications rely on various external services to provide dynamic content and functionality. However, this dependence on external resources can also create security vulnerabilities, one of which is Server-Side Request Forgery (SSRF). SSRF is a type of attack where an attacker manipulates a web application to send unauthorized requests to internal or external resources. In this blog, we will delve into the concept of SSRF, its potential impact on your Java applications, and discuss strategies to mitigate this critical security risk.</p>
<h3 id="heading-what-is-server-side-request-forgery-ssrf">What is Server-Side Request Forgery (SSRF)?</h3>
<p>Server-Side Request Forgery is a web application vulnerability that enables attackers to make unauthorized requests from the server-side, bypassing the security controls implemented on the client-side. The attacker typically tricks the application into sending HTTP requests to internal systems, other applications, or even external services.</p>
<h3 id="heading-impact-of-ssrf">Impact of SSRF:</h3>
<p>The consequences of a successful SSRF attack can be severe. Some of the potential risks include:</p>
<ol>
<li><p><strong>Unauthorized access to sensitive data</strong>: An attacker might be able to retrieve sensitive information from internal resources like databases, storage systems, or other applications that should not be exposed publicly.</p>
</li>
<li><p><strong>Exploiting internal services:</strong> If the web application is hosted on a cloud infrastructure, an attacker can abuse SSRF to access internal metadata services or obtain temporary credentials, leading to further compromise of the cloud environment.</p>
</li>
<li><p><strong>Bypassing security controls:</strong> SSRF can be utilized to bypass firewall restrictions and access restricted resources, potentially causing significant security breaches.</p>
</li>
</ol>
<p><strong>Java Code Example:</strong></p>
<p>Let's take a look at a simple Java code snippet that showcases an SSRF-vulnerable function:</p>
<pre><code class="lang-java">javaCopy codeimport java.io.BufferedReader;
<span class="hljs-keyword">import</span> java.io.IOException;
<span class="hljs-keyword">import</span> java.io.InputStreamReader;
<span class="hljs-keyword">import</span> java.net.HttpURLConnection;
<span class="hljs-keyword">import</span> java.net.URL;

<span class="hljs-keyword">public</span> <span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">SSRFExample</span> </span>{

    <span class="hljs-function"><span class="hljs-keyword">public</span> <span class="hljs-keyword">static</span> <span class="hljs-keyword">void</span> <span class="hljs-title">main</span><span class="hljs-params">(String[] args)</span> </span>{
        String urlToFetch = args[<span class="hljs-number">0</span>]; <span class="hljs-comment">// URL provided by the user as input</span>
        fetchUrlContents(urlToFetch);
    }

    <span class="hljs-function"><span class="hljs-keyword">public</span> <span class="hljs-keyword">static</span> <span class="hljs-keyword">void</span> <span class="hljs-title">fetchUrlContents</span><span class="hljs-params">(String urlToFetch)</span> </span>{
        <span class="hljs-keyword">try</span> {
            URL url = <span class="hljs-keyword">new</span> URL(urlToFetch);
            HttpURLConnection connection = (HttpURLConnection) url.openConnection();
            connection.setRequestMethod(<span class="hljs-string">"GET"</span>);

            BufferedReader reader = <span class="hljs-keyword">new</span> BufferedReader(<span class="hljs-keyword">new</span> InputStreamReader(connection.getInputStream()));
            String line;
            <span class="hljs-keyword">while</span> ((line = reader.readLine()) != <span class="hljs-keyword">null</span>) {
                System.out.println(line);
            }
            reader.close();
            connection.disconnect();
        } <span class="hljs-keyword">catch</span> (IOException e) {
            System.err.println(<span class="hljs-string">"Error: "</span> + e.getMessage());
        }
    }
}
</code></pre>
<p>The above code is a basic Java program that takes a URL as input and fetches its contents using an HTTP GET request. However, this code is susceptible to SSRF attacks, as it does not validate or sanitize the input URL. An attacker could provide a malicious URL that targets internal resources, thereby initiating an unauthorized request.</p>
<h3 id="heading-securing-your-applications-against-ssrf">Securing Your Applications against SSRF:</h3>
<p>To protect your applications from SSRF attacks, consider implementing the following security measures:</p>
<ol>
<li><p><strong>Whitelisting:</strong> Maintain a list of approved URLs that your application is allowed to access. Validate user-provided URLs against this whitelist to ensure that only permitted resources can be accessed.</p>
</li>
<li><p><strong>Use Framework-level Protection</strong>: Modern web frameworks often offer built-in protections against SSRF attacks. For example, the Spring Framework provides mechanisms like URL validation through a whitelist of allowed URLs.</p>
</li>
<li><p><strong>Input Validation and Sanitization</strong>: Always validate and sanitize any input coming from users or external sources. Ensure that the input adheres to the expected format and restricts access to sensitive URLs.</p>
</li>
<li><p><strong>Network-level Controls:</strong> Use network-level controls such as firewalls and security groups to limit the communication between your application and internal systems.</p>
</li>
<li><p><strong>Disable or Restrict Access to Metadata Services:</strong> If your application is hosted on a cloud platform, disable or restrict access to metadata services to prevent attackers from obtaining sensitive information about the cloud environment.</p>
</li>
</ol>
<p>To fix the SSRF issue in the previous example, we need to validate the input URL to ensure it only points to allowed resources. We can implement a simple whitelist approach to restrict the URLs that our application is allowed to access. Here's the updated Java code with the SSRF issue fixed:</p>
<pre><code class="lang-java">javaCopy codeimport java.io.BufferedReader;
<span class="hljs-keyword">import</span> java.io.IOException;
<span class="hljs-keyword">import</span> java.io.InputStreamReader;
<span class="hljs-keyword">import</span> java.net.HttpURLConnection;
<span class="hljs-keyword">import</span> java.net.URL;

<span class="hljs-keyword">public</span> <span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">SecureSSRFExample</span> </span>{

    <span class="hljs-comment">// Whitelist of allowed URLs</span>
    <span class="hljs-keyword">private</span> <span class="hljs-keyword">static</span> <span class="hljs-keyword">final</span> String[] ALLOWED_URLS = {
        <span class="hljs-string">"https://api.example.com/data"</span>,
        <span class="hljs-string">"https://www.publicapi.com/info"</span>,
        <span class="hljs-comment">// Add more trusted URLs as needed</span>
    };

    <span class="hljs-function"><span class="hljs-keyword">public</span> <span class="hljs-keyword">static</span> <span class="hljs-keyword">void</span> <span class="hljs-title">main</span><span class="hljs-params">(String[] args)</span> </span>{
        String urlToFetch = args[<span class="hljs-number">0</span>]; <span class="hljs-comment">// URL provided by the user as input</span>
        fetchUrlContents(urlToFetch);
    }

    <span class="hljs-function"><span class="hljs-keyword">public</span> <span class="hljs-keyword">static</span> <span class="hljs-keyword">void</span> <span class="hljs-title">fetchUrlContents</span><span class="hljs-params">(String urlToFetch)</span> </span>{
        <span class="hljs-keyword">try</span> {
            <span class="hljs-comment">// Validate the input URL against the whitelist</span>
            <span class="hljs-keyword">if</span> (!isUrlAllowed(urlToFetch)) {
                System.err.println(<span class="hljs-string">"Error: The provided URL is not allowed."</span>);
                <span class="hljs-keyword">return</span>;
            }

            URL url = <span class="hljs-keyword">new</span> URL(urlToFetch);
            HttpURLConnection connection = (HttpURLConnection) url.openConnection();
            connection.setRequestMethod(<span class="hljs-string">"GET"</span>);

            BufferedReader reader = <span class="hljs-keyword">new</span> BufferedReader(<span class="hljs-keyword">new</span> InputStreamReader(connection.getInputStream()));
            String line;
            <span class="hljs-keyword">while</span> ((line = reader.readLine()) != <span class="hljs-keyword">null</span>) {
                System.out.println(line);
            }
            reader.close();
            connection.disconnect();
        } <span class="hljs-keyword">catch</span> (IOException e) {
            System.err.println(<span class="hljs-string">"Error: "</span> + e.getMessage());
        }
    }

    <span class="hljs-comment">// Function to check if the provided URL is allowed</span>
    <span class="hljs-function"><span class="hljs-keyword">private</span> <span class="hljs-keyword">static</span> <span class="hljs-keyword">boolean</span> <span class="hljs-title">isUrlAllowed</span><span class="hljs-params">(String url)</span> </span>{
        <span class="hljs-keyword">for</span> (String allowedUrl : ALLOWED_URLS) {
            <span class="hljs-keyword">if</span> (url.startsWith(allowedUrl)) {
                <span class="hljs-keyword">return</span> <span class="hljs-keyword">true</span>;
            }
        }
        <span class="hljs-keyword">return</span> <span class="hljs-keyword">false</span>;
    }
}
</code></pre>
<p>In this updated code, we introduced a <code>SecureSSRFExample</code> class. We defined a <code>ALLOWED_URLS</code> array, which contains a list of trusted URLs that our application is allowed to access. The <code>isUrlAllowed()</code> function checks whether the provided URL starts with any of the allowed URLs. If the URL is present in the whitelist, the request will proceed; otherwise, an error message will be displayed, and the request will not be executed.</p>
<p>By using this whitelisting approach, we ensure that the application can only make requests to specified, trusted resources, effectively mitigating the SSRF vulnerability. It's important to regularly review and update the whitelist to include new trusted URLs and remove any unnecessary entries. Additionally, consider implementing other security measures, such as input validation and using framework-level protections, to further enhance the security of your Java applications.</p>
<h3 id="heading-conclusion">Conclusion:</h3>
<p>Server-Side Request Forgery (SSRF) can pose a significant threat to your Java applications, potentially leading to unauthorized access, data leakage, and security breaches. As a responsible developer, it is crucial to be aware of this vulnerability and implement best practices to secure your applications. By validating and sanitizing user input, employing whitelisting, and utilizing framework-level protections, you can reduce the risk of SSRF attacks and safeguard your application and data. Stay vigilant, keep your systems up to date, and adhere to secure coding practices to stay one step ahead of potential attackers.</p>
]]></content:encoded></item><item><title><![CDATA[Part 1: Variable and DataTypes in Rust]]></title><description><![CDATA[Variables are the basic building blocks of a programming language. It holds data in the computer memory during runtime. The data that a variable hold can be different types. Like other languages, Rust has 2 kinds of high-level data types. Scalar and ...]]></description><link>https://samirparhi.com/part-1-variable-and-datatypes-in-rust</link><guid isPermaLink="true">https://samirparhi.com/part-1-variable-and-datatypes-in-rust</guid><category><![CDATA[Rust]]></category><category><![CDATA[rust lang]]></category><category><![CDATA[Open Source]]></category><category><![CDATA[Beginner Developers]]></category><dc:creator><![CDATA[Samir Ranjan Parhi]]></dc:creator><pubDate>Sat, 04 Feb 2023 08:02:58 GMT</pubDate><content:encoded><![CDATA[<p>Variables are the basic building blocks of a programming language. It holds data in the computer memory during runtime. The data that a variable hold can be different types. Like other languages, Rust has 2 kinds of high-level data types. <code>Scalar</code> and <code>Compound</code> . <code>Scalar</code> contains a single value whereas <code>Compound</code> holds multi-value data in the memory during run time. the default data types are explained in the figure below:</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1675492541361/64f606bc-3820-446f-b947-353e18a2b086.png" alt class="image--center mx-auto" /></p>
<p>Now if you mark in the figure we use <code>let</code> keyword to declare a variable and the value of the variable is on the right side of the <code>=</code> symbol.</p>
<blockquote>
<p>It is important to note that the variable in the rust is immutable (do not change the data once loaded) by default (why? please refer the part:0 of this series) However you can have the liberty to make it immutable by adding a <code>mut</code> keyword in front of any variable name. Example below</p>
</blockquote>
<pre><code class="lang-rust"><span class="hljs-keyword">let</span> x = <span class="hljs-number">10</span> ; <span class="hljs-comment">//this immutable </span>
<span class="hljs-keyword">let</span> x = <span class="hljs-number">11</span> ; <span class="hljs-comment">// while doing this you will get an error</span>
<span class="hljs-keyword">mut</span> <span class="hljs-keyword">let</span> x = <span class="hljs-number">10</span> ; <span class="hljs-comment">//this is mutable</span>
<span class="hljs-keyword">let</span> x = <span class="hljs-number">11</span> ; <span class="hljs-comment">// you are safe to do this action</span>
</code></pre>
<p>it is best practice to mention the data type of the variable while declaring. However, rust can automatically detect when you have <code>rust analyzer</code> installed on any of the popular IDE. To mention the data type below are the samples.</p>
<pre><code class="lang-rust"><span class="hljs-keyword">let</span> a: <span class="hljs-built_in">u32</span> = <span class="hljs-number">23</span>; <span class="hljs-comment">// a unsigned 32 bit integer</span>
<span class="hljs-keyword">let</span> b: <span class="hljs-built_in">f32</span> = <span class="hljs-number">2.3</span>; <span class="hljs-comment">// a floating point 32 integer</span>
<span class="hljs-keyword">let</span> c: <span class="hljs-built_in">bool</span> = <span class="hljs-literal">false</span>; <span class="hljs-comment">// a boolean type variable</span>
<span class="hljs-keyword">let</span> d: <span class="hljs-built_in">char</span> = <span class="hljs-string">'m'</span>; <span class="hljs-comment">// a char type variable</span>
<span class="hljs-keyword">let</span> e: (<span class="hljs-built_in">i32</span>, <span class="hljs-built_in">char</span>, <span class="hljs-built_in">f32</span>) = (<span class="hljs-number">23</span>, <span class="hljs-string">'m'</span>, <span class="hljs-number">2.3</span>); <span class="hljs-comment">// a tupple type</span>
<span class="hljs-keyword">let</span> f: [<span class="hljs-built_in">i32</span>; <span class="hljs-number">5</span>] = [<span class="hljs-number">6</span>, <span class="hljs-number">7</span>, <span class="hljs-number">8</span>, <span class="hljs-number">9</span>, <span class="hljs-number">10</span>]; <span class="hljs-comment">// an array type</span>
</code></pre>
<p>To know what all are the different types of integers and floats please refer <a target="_blank" href="https://doc.rust-lang.org/book/ch03-02-data-types.html#integer-types">here</a>.</p>
<p>to print anything to the output console rust used <code>println!()</code> macro. in side <code>println!()</code> macro to extract the value of a variable you have to enclose the variable with <code>{}</code>. the sample is given below:</p>
<pre><code class="lang-rust"><span class="hljs-function"><span class="hljs-keyword">fn</span> <span class="hljs-title">main</span></span>() {
    <span class="hljs-keyword">let</span> <span class="hljs-keyword">mut</span> a: <span class="hljs-built_in">i32</span> = <span class="hljs-number">7</span>; <span class="hljs-comment">// a mutable variable</span>
    <span class="hljs-built_in">println!</span>(<span class="hljs-string">"The value of a is: {a}"</span>); <span class="hljs-comment">//print 7</span>
    <span class="hljs-keyword">let</span> a = <span class="hljs-number">8</span>;
    <span class="hljs-built_in">println!</span>(<span class="hljs-string">"The value of y is: {a}"</span>); <span class="hljs-comment">//print 8</span>
}
</code></pre>
<p>let's know something more about Compound data types:</p>
<p><strong>Array operations:</strong></p>
<p>let's take an array as :</p>
<pre><code class="lang-rust"><span class="hljs-keyword">let</span> f: [<span class="hljs-built_in">i32</span>; <span class="hljs-number">5</span>] = [<span class="hljs-number">6</span>, <span class="hljs-number">7</span>, <span class="hljs-number">8</span>, <span class="hljs-number">9</span>, <span class="hljs-number">10</span>];<span class="hljs-comment">// i32 is the data types of the array and 5 is the length of the array.</span>
<span class="hljs-keyword">let</span> first = f[<span class="hljs-number">0</span>]; <span class="hljs-comment">// first holds First element of array </span>
<span class="hljs-keyword">let</span> five = f[<span class="hljs-number">4</span>]; <span class="hljs-comment">// holds 5th element of the array</span>
<span class="hljs-keyword">let</span> r = &amp;f[<span class="hljs-number">0</span>..<span class="hljs-number">3</span>]; <span class="hljs-comment">// r holds the element starting with 0th index till 2nd index. last index is always excluded.</span>
<span class="hljs-keyword">let</span> g: [<span class="hljs-built_in">i32</span>; <span class="hljs-number">0</span>] = [] <span class="hljs-comment">// an empty array.</span>
<span class="hljs-keyword">let</span> g: [<span class="hljs-built_in">i32</span>; <span class="hljs-number">5</span>] = [<span class="hljs-number">7</span>, <span class="hljs-number">5</span>] <span class="hljs-comment">// returns [7, 7, 7, 7, 7]</span>
</code></pre>
<p><strong>Tuple operations:</strong></p>
<p>let's take a tuple as:</p>
<pre><code class="lang-rust"><span class="hljs-keyword">let</span> f: (<span class="hljs-built_in">i32</span>, &amp;<span class="hljs-built_in">str</span>, <span class="hljs-built_in">f64</span>)= (<span class="hljs-number">7</span>, <span class="hljs-string">"samir"</span>, <span class="hljs-number">3.8</span>); <span class="hljs-comment">// a tuple</span>
<span class="hljs-keyword">let</span> <span class="hljs-keyword">mut</span> r = f.<span class="hljs-number">0</span>; <span class="hljs-comment">//r contains the 0th index value i,e 7</span>
<span class="hljs-keyword">let</span> r = f.<span class="hljs-number">2</span>; <span class="hljs-comment">// now r contains the 2nd index value i,e 3.8</span>
</code></pre>
<p>In this part, we learnt the overview and a few operations on array and tuple. this is very easy and if you have learnt any programming language earlier this might be familiar to you. but as I told this series is for the beginner and comes in handy during the initial days.</p>
<p>Thank you for hopping in and see you in the next part.</p>
]]></content:encoded></item><item><title><![CDATA[Part:0 - Few facts about Rust programming language]]></title><description><![CDATA[This is the very first write-up of our Rust journey. In this part, we will learn a few interesting facts about Rust programming language. This will give us an overview of how and what of Rust at a high level.
Every programming languages are special. ...]]></description><link>https://samirparhi.com/part0-few-facts-about-rust-programming-language</link><guid isPermaLink="true">https://samirparhi.com/part0-few-facts-about-rust-programming-language</guid><category><![CDATA[Rust]]></category><category><![CDATA[rust lang]]></category><category><![CDATA[fact]]></category><dc:creator><![CDATA[Samir Ranjan Parhi]]></dc:creator><pubDate>Mon, 16 Jan 2023 15:33:33 GMT</pubDate><content:encoded><![CDATA[<p>This is the very first write-up of our Rust journey. In this part, we will learn a few interesting facts about <code>Rust</code> programming language. This will give us an overview of how and what of <code>Rust</code> at a high level.</p>
<p>Every programming languages are special. Let's take an overview of very charming <code>Rust</code> .</p>
<ol>
<li><p>Like most programming languages, the rust logic execution starts from <code>main()</code> block.</p>
</li>
<li><p>Rust is a statically typed language, Which means you have to specify the data type ( int/float/String) of each variable. More about data types can be found <a target="_blank" href="https://doc.rust-lang.org/book/ch03-02-data-types.html">here</a></p>
</li>
<li><p>The variable/literals are immutable by default in rust. However, you can make the variable mutable by using <code>mut</code> keyword. Why the variable is immutable by default?</p>
<ul>
<li>This is to provide the developer with an easy way to debug a program. When you know the value is not changed it is easy to debug.</li>
<li>The second reason is let's say there are two expressions which are using the same value. if during execution the variable changes then, the expressions may not work as expected. So to make the program more robust the literals are mutable. You can get more info <a target="_blank" href="https://doc.rust-lang.org/book/ch03-01-variables-and-mutability.html">here</a>.</li>
</ul>
</li>
<li><p><code>Rust</code> is a compiled language. This means each project/ code produces an executable file like <code>.exe</code>, <code>.deb</code> etc. after compiling. The advantage is the code can run in any of the operating systems without a rust installation.</p>
</li>
<li><p>There are two kinds of string data types namely <code>&amp;str</code> : string slice and <code>String</code>.This is to provide memory safety for the rust program. we will learn more about these in the coming parts.</p>
</li>
<li><p>To prevent the memory leak in rust and make it more robust, <code>Rust</code> uses the concept called <strong>ownership .</strong> this is a very useful and interesting feature in <code>Rust</code>. This helps regulating variable scopes. When a variable goes out of scope rust deletes/ frees the value as well as the memory. More information <a target="_blank" href="https://doc.rust-lang.org/book/ch04-01-what-is-ownership.html#:~:text=Ownership%20is%20a%20set%20of,a%20computer's%20memory%20while%20running.">here</a></p>
</li>
<li><p>Rust Does not have the concept of a Garbage collector due to the above-said reason</p>
</li>
<li><p>Like other languages you can use external libraries/packages that are provided by rust itself (standard libraries) or 3rd parties. The packages/Libraries are called <strong>Crates</strong>.</p>
</li>
<li><p>Rust manages the Dependencies in a very well manner. The package manager is called <strong>Cargo.</strong> the interesting thing is that if you create a project with Cargo, it not only creates the boilerplate folder structure but it initialises the folder with <strong>Git</strong> automatically. So it natively supports Git.</p>
</li>
</ol>
<p>These are few facts i found may be intersting to know before starting to learn Rust. Please let me if you have found some interssting fact about rust. Do correct if something is wrong here :-)</p>
<p>See you in the part 1 😀 .</p>
]]></content:encoded></item><item><title><![CDATA[Why I was encouraged to learn Rust (Comparing Rust and Python)]]></title><description><![CDATA[It is been 8 years in my Job career as an infrastructure/DevSecOps engineer, I am much satisfied. But in the corner of my heart, I had the urge to learn programming so that I can relate my daily job to the developer program easily.
Everyone knows the...]]></description><link>https://samirparhi.com/why-i-was-encouraged-to-learn-rust-comparing-rust-and-python</link><guid isPermaLink="true">https://samirparhi.com/why-i-was-encouraged-to-learn-rust-comparing-rust-and-python</guid><category><![CDATA[Rust]]></category><category><![CDATA[Python]]></category><category><![CDATA[Programming Blogs]]></category><category><![CDATA[learning]]></category><dc:creator><![CDATA[Samir Ranjan Parhi]]></dc:creator><pubDate>Wed, 11 Jan 2023 05:50:35 GMT</pubDate><content:encoded><![CDATA[<p>It is been 8 years in my Job career as an infrastructure/DevSecOps engineer, I am much satisfied. But in the corner of my heart, I had the urge to learn programming so that I can relate my daily job to the developer program easily.</p>
<p>Everyone knows there are a lot of great programming languages and also suggested some. Finally, I was left with python and Rust. When I started comparing both the below fact sheet concluded that I should start investing my time in learning Rust.</p>
<p>The fact sheet:</p>
<table><tbody><tr><td><p><strong>Facts</strong></p></td><td><p><strong>Rust</strong></p></td><td><p><strong>Python</strong></p></td></tr><tr><td><p>Learning curve</p></td><td><p>High (for a complete beginner)</p></td><td><p>Easy to learn</p></td></tr><tr><td><p>Execution speed</p></td><td><p>High</p></td><td><p>Much lower</p></td></tr><tr><td><p>Memory Management</p></td><td><p>Exceptional (no need for garbage collector)</p></td><td><p>Lower than</p></td></tr><tr><td><p>syntax</p></td><td><p>Statically typed.</p></td><td><p>plain English</p></td></tr><tr><td><p>Creating System tools</p></td><td><p>Very much recommend</p></td><td><p>Not Recommended</p></td></tr><tr><td><p>Popular in Developer</p></td><td><p>#1</p></td><td><p>#3</p></td></tr><tr><td><p>Stability</p></td><td><p>High</p></td><td><p>low</p></td></tr><tr><td><p>Documentation</p></td><td><p>sufficient</p></td><td><p>Sufficient</p></td></tr><tr><td><p>Pre-existing module</p></td><td><p>less (Developing)</p></td><td><p>A lot (plug and play)</p></td></tr><tr><td><p>type</p></td><td><p>Low level</p></td><td><p>High level</p></td></tr></tbody></table>

<p>Out of all these comparisons, I loved the way Rust manage the Memory and the art behind the failsafe. I have heard of the pain of developers when it comes to the performance of the application and performing the right way to collect the garbage, it is no more in Rust. I was also fascinated to know how the most amazing tool like Kubernetes is programmed, So Rust was the right choice for me to take up. Though I know I will be starting programming from the scratch, and there will be a huge learning curve this year, I would try to learn as much as possible.</p>
<p>At the same time, I will be publishing my learning note as I progress with a self-assessment so that it would provide the reader with more insight.</p>
<p><em>Stay tuned in this series to learn along with me. Let's be closer to the system a bit more.</em></p>
<p>Note: The above opinions are solely my personal views</p>
]]></content:encoded></item><item><title><![CDATA[Shell script to Remove history from a git Branch]]></title><description><![CDATA[There are various instances where we decide to remove the history from a git repository. 
The most common use case : 
You find out there are some secret information like credential or the database string that is been exposed to git hub and also it is...]]></description><link>https://samirparhi.com/shell-script-to-remove-history-from-a-git-branch</link><guid isPermaLink="true">https://samirparhi.com/shell-script-to-remove-history-from-a-git-branch</guid><category><![CDATA[shell]]></category><category><![CDATA[shell script]]></category><category><![CDATA[GitHub]]></category><category><![CDATA[Gitcommands]]></category><category><![CDATA[Linux]]></category><dc:creator><![CDATA[Samir Ranjan Parhi]]></dc:creator><pubDate>Thu, 11 Aug 2022 13:21:26 GMT</pubDate><content:encoded><![CDATA[<p>There are various instances where we decide to remove the history from a git repository. </p>
<p><strong>The most common use case :</strong> </p>
<p>You find out there are some secret information like credential or the database string that is been exposed to git hub and also it is recorded in the history. at this moment you may searching to delete the history.</p>
<p>This shell script allows you to remove all the history of a given branch (please remember this shell script remove all the history of the branch), you can make use of this script which is combination of few git commands and has been clubbed to make this task easier for you.</p>
<p><strong>Shell script :</strong></p>
<pre><code><span class="hljs-meta">#!/bin/zsh</span>
<span class="hljs-built_in">echo</span> <span class="hljs-string">"Important !!! Make sure you are Checked out to the Branch in which you want to remove the history"</span>
<span class="hljs-built_in">echo</span> <span class="hljs-string">"your Repository URL: (usually looks like https://github.com/example.git) "</span>
<span class="hljs-built_in">read</span> gitURL
git <span class="hljs-built_in">clone</span> <span class="hljs-variable">$gitURL</span>
<span class="hljs-keyword">if</span> [ $? -eq 0 ]
<span class="hljs-keyword">then</span>
dir=$(basename <span class="hljs-variable">$gitURL</span> | cut -f1 -d<span class="hljs-string">"."</span>)
<span class="hljs-built_in">cd</span> <span class="hljs-variable">$dir</span>
<span class="hljs-built_in">echo</span> <span class="hljs-string">"From Which Branch you want to delete the History ? "</span>
<span class="hljs-built_in">read</span> BranchName
git checkout <span class="hljs-variable">$BranchName</span>
<span class="hljs-built_in">echo</span> <span class="hljs-string">"Enter your commit message here:"</span>
<span class="hljs-built_in">read</span> CommitMessage
git checkout --orphan new_br
git add -A
git commit -am <span class="hljs-string">"<span class="hljs-variable">$CommitMessage</span>"</span>
git branch -D <span class="hljs-variable">$BranchName</span>
git branch -m <span class="hljs-variable">$BranchName</span>
git push -f origin <span class="hljs-variable">$BranchName</span>
<span class="hljs-built_in">echo</span> <span class="hljs-string">"finished successfully "</span>
<span class="hljs-keyword">fi</span>
</code></pre><p><strong>Now let's understand few key words here: </strong></p>
<ul>
<li><p><code>basename $gitURL</code> : extract the last path value from a URL or a directory string. </p>
<p>Try out: <code>basename https://github.com/example.git</code> </p>
</li>
<li><p><strong> <code>cut -f1 -d"."</code>  </strong>: is used to extract the world before "." . </p>
<p>Try out: <code>echo "test.txt" | cut -f1 -d"."</code></p>
</li>
<li><p><code>git checkout --orphan &lt;branch name&gt;</code> : create a branch without any ancestor reference. that means it will be a independent branch (ref : <a target="_blank" href="git">https://git-scm.com/docs/git-checkout</a>)</p>
</li>
</ul>
<p>Thank you !</p>
]]></content:encoded></item><item><title><![CDATA[Imposing mandatory http(s) security headers in NGINX ingress in Kubernetes]]></title><description><![CDATA[Making an application up and running does not qualify as a full-fledged product. It is particularly important to have security measure in the Product. Now in the ever-increasing digital revolution, security flaws are really risk for an organisation a...]]></description><link>https://samirparhi.com/imposing-mandatory-https-security-headers-in-nginx-ingress-in-kubernetes</link><guid isPermaLink="true">https://samirparhi.com/imposing-mandatory-https-security-headers-in-nginx-ingress-in-kubernetes</guid><category><![CDATA[Kubernetes]]></category><category><![CDATA[https]]></category><category><![CDATA[Security]]></category><category><![CDATA[#ServiceMesh]]></category><category><![CDATA[nginx ingress]]></category><dc:creator><![CDATA[Samir Ranjan Parhi]]></dc:creator><pubDate>Sun, 24 Jul 2022 10:22:49 GMT</pubDate><content:encoded><![CDATA[<p>Making an application up and running does not qualify as a full-fledged product. It is particularly important to have security measure in the Product. Now in the ever-increasing digital revolution, security flaws are really risk for an organisation as-well as the users. Though we cannot eliminate all the risks, we can always try to address most of them and the important CVEs. Earlier days these security considerations (Security headers in this context) are handled by application itself and coded by the developer in the application code but in the micro-service world it is especially important for developers to focus more on business logic rather than all these auxiliary tasks to reduce <strong>time to market</strong> of the product. </p>
<p>The good news is, now DevOps team can handle few of these features with help of <strong>Kubernetes</strong>, I<strong>ingress Gateways</strong> and <strong>Service Meshes</strong>.  In this blog post we will focus on how to impose the mandatory security headers in Kubernetes NGINX ingress controller.</p>
<p>OWASP (Open Web Application Security Project) is a nonprofit foundation that works to improve the security of software, has recommended to below HTTP headers should be present by default.</p>
<p><strong>Important HTTP headers:</strong></p>
<ul>
<li><p><strong>Server</strong> - this is the first header which we must impose so the Server label should not be displayed in the browser </p>
<p><code>server: hide</code></p>
</li>
</ul>
<ul>
<li><p><strong>X-Frame-Options</strong> - to avoid clickjacking attacks, by ensuring that their content is not embedded into other sites</p>
<p><code>X-Frame-Options: DENY or SAMEORIGIN</code></p>
</li>
</ul>
<ul>
<li><p><strong>X-XSS-Protection</strong> - stops pages from loading when they detect reflected cross-site scripting (XSS) attacks.</p>
<p><code>X-XSS-Protection: 0 or 1</code></p>
</li>
</ul>
<ul>
<li><p><strong>Content-Type</strong> - Indicate the original media type of the resource (prior to any content encoding applied for sending).</p>
<p><code>Content-Type: text/html; charset=UTF-8</code></p>
</li>
</ul>
<ul>
<li><p><strong>X-Content-Type-Options</strong> - Avoid MIME type sniffing</p>
<p><code>X-Content-Type-Options: nosniff</code></p>
</li>
</ul>
<ul>
<li><p><strong>Strict-Transport-Security (HSTS)</strong> - Enforce browsers that it should only be accessed using HTTPS, instead of using HTTP.</p>
<p><code>Strict-Transport-Security: max-age=&lt; expire-time-in-sec&gt;; includeSubDomains; preload</code></p>
<p><code>Strict-Transport-Security: max-age=31536000; includeSubDomains; preload</code> </p>
</li>
</ul>
<ul>
<li><p><strong>Content-Security-Policy (CSP)</strong> - mitigate Cross-Site Scripting (XSS) and data injection attacks</p>
<p><code>Content-Security-Policy: default-src 'self' http://example.com</code></p>
</li>
</ul>
<ul>
<li><p><strong>Cross-Origin-Resource-Policy</strong> - tells the browser blocks no-cors cross-origin/cross-site requests to the given resource</p>
<p><code>Cross-Origin-Resource-Policy: same-site</code> </p>
</li>
</ul>
<p>Now as we understood the mandatory security headers to be imposed to our application, let's see how we can configure from NGINX ingress
add the annotation <code>nginx.ingress.kubernetes.io/configuration-snippet:</code>   in the ingress manifest file (ingress.yaml )</p>
<pre><code><span class="hljs-attr">apiVersion:</span> <span class="hljs-string">extensions/v1beta1</span>
<span class="hljs-attr">kind:</span> <span class="hljs-string">Ingress</span>
<span class="hljs-attr">namespace:</span> <span class="hljs-string">my-app</span>
<span class="hljs-attr">metadata:</span>
  <span class="hljs-attr">name:</span> <span class="hljs-string">app-ingress</span>
  <span class="hljs-attr">annotations:</span>
    <span class="hljs-attr">nginx.ingress.kubernetes.io/configuration-snippet:</span> <span class="hljs-string">|
      more_set_headers "server: hide";
      more_set_headers "Content-Type: text/html; charset=UTF-8";
      more_set_headers "X-Content-Type-Options: nosniff";
      more_set_headers "X-Frame-Options: DENY";
      more_set_headers "X-Xss-Protection: 0";
      more_set_headers "Strict-Transport-Security: max-age=31536000; includeSubDomains; preload";
      more_set_headers "Content-Security-Policy: default-src 'self' http://example.com";
      more_set_headers "Cross-Origin-Resource-Policy: same-site";
</span><span class="hljs-attr">spec:</span>
  <span class="hljs-attr">rules:</span>
  <span class="hljs-bullet">-</span> <span class="hljs-attr">http:</span>
      <span class="hljs-attr">paths:</span>
      <span class="hljs-bullet">-</span> <span class="hljs-attr">path:</span> <span class="hljs-string">/testpath</span>
        <span class="hljs-attr">pathType:</span> <span class="hljs-string">Prefix</span>
        <span class="hljs-attr">backend:</span>
          <span class="hljs-attr">service:</span>
            <span class="hljs-attr">name:</span> <span class="hljs-string">test</span>
            <span class="hljs-attr">port:</span>
              <span class="hljs-attr">number:</span> <span class="hljs-number">80</span>
</code></pre><p>There are also other interesting and useful <a target="_blank" href="https://kubernetes.github.io/ingress-nginx/user-guide/nginx-configuration/annotations/">annotation</a> which you can checkout and I am sure it will enable you to add more features to your application.</p>
<p><strong>Sources:</strong></p>
<p><a target="_blank" href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers">mdn Docs</a></p>
<p><a target="_blank" href="https://kubernetes.github.io/ingress-nginx/">NGINX Ingress controller</a></p>
<p><a target="_blank" href="https://cheatsheetseries.owasp.org/cheatsheets/HTTP_Headers_Cheat_Sheet.html">OWASP Docs</a></p>
<p>Hope this helps. Stay tuned for More!</p>
]]></content:encoded></item><item><title><![CDATA[Shell Script for Migrating Azure Container Registry (ACR)]]></title><description><![CDATA[When someone asks to migrate an ACR from one Azure subscription to another azure subscription, it feels like a tedious task. Because you must migrate Image repositories and all the image tags that are in those repositories.
Traditionally, you can use...]]></description><link>https://samirparhi.com/shell-script-for-migrating-azure-container-registry-acr</link><guid isPermaLink="true">https://samirparhi.com/shell-script-for-migrating-azure-container-registry-acr</guid><category><![CDATA[shell script]]></category><category><![CDATA[Azure]]></category><category><![CDATA[containers]]></category><category><![CDATA[Azure container registry]]></category><category><![CDATA[Linux]]></category><dc:creator><![CDATA[Samir Ranjan Parhi]]></dc:creator><pubDate>Tue, 12 Jul 2022 08:10:19 GMT</pubDate><content:encoded><![CDATA[<p>When someone asks to migrate an ACR from one Azure subscription to another azure subscription, it feels like a tedious task. Because you must migrate Image repositories and all the image tags that are in those repositories.</p>
<p>Traditionally, you can use <code>az acr</code> import command to achieve this. But when the number of repositories increases, it takes an exponentially high unproductive time. </p>
<p>I have recently gone through this situation and thought to automate this process. Below <code>z shell</code> script, I have come up, which may help you in those scenarios.</p>
<p><strong>Prerequisites to use this command: </strong></p>
<ol>
<li>Docker Desktop/ Docker binary is installed</li>
<li>AZ CLI is installed </li>
</ol>
<p><strong>Steps: </strong></p>
<ol>
<li>first create a new Azure Container Registry</li>
<li>login to the new repository using AZ CLI (<code>az acr</code> login command)</li>
<li>Keep the below information ready<ol>
<li>Name of your old repository</li>
<li>Username of the old repository</li>
<li>Password of the old repository</li>
</ol>
</li>
<li>Now Run the below shell script</li>
</ol>
<pre><code><span class="hljs-meta">#!/bin/zsh</span>
<span class="hljs-built_in">echo</span> <span class="hljs-string">"Enter the Source ACR Name: "</span>
<span class="hljs-built_in">read</span> SourceAcrName
<span class="hljs-built_in">echo</span> <span class="hljs-string">"Enter the Source ACR User Name: "</span>
<span class="hljs-built_in">read</span> SourceAcrUsrName
<span class="hljs-built_in">echo</span> <span class="hljs-string">"Enter the Source ACR Password: "</span>
<span class="hljs-built_in">read</span> -s SourceAcrpasswd
<span class="hljs-built_in">echo</span> <span class="hljs-string">"Enter the Destination ACR Name: "</span>
<span class="hljs-built_in">read</span> DestinationAcrName
Repos=$(az acr repository list --name <span class="hljs-variable">$SourceAcrName</span> --username=<span class="hljs-variable">$SourceAcrUsrName</span> --password=<span class="hljs-variable">$SourceAcrpasswd</span> | tr -d <span class="hljs-string">'[] "" ,'</span>| grep <span class="hljs-string">"\S"</span>)
<span class="hljs-built_in">echo</span> <span class="hljs-variable">$Repos</span> | <span class="hljs-keyword">while</span> <span class="hljs-built_in">read</span> RepoName
<span class="hljs-keyword">do</span>
Tags=$(az acr repository show-tags -n <span class="hljs-variable">$SourceAcrName</span> --repository <span class="hljs-variable">$line</span> --username=<span class="hljs-variable">$SourceAcrUsrName</span> --password=<span class="hljs-variable">$SourceAcrpasswd</span> | tr -d <span class="hljs-string">'[] "" ,'</span>| grep <span class="hljs-string">"\S"</span>)
<span class="hljs-built_in">echo</span> <span class="hljs-variable">$Tags</span> | <span class="hljs-keyword">while</span> <span class="hljs-built_in">read</span> TagName
<span class="hljs-keyword">do</span>
az acr import \
--name <span class="hljs-variable">$DestinationAcrName</span> \
--<span class="hljs-built_in">source</span> <span class="hljs-variable">$SourceAcrName</span>.azurecr.io/<span class="hljs-variable">$RepoName</span>:<span class="hljs-variable">$TagName</span> \
--image <span class="hljs-variable">$RepoName</span>:<span class="hljs-variable">$TagName</span> \
--username=<span class="hljs-variable">$SourceAcrName</span> \
--password=<span class="hljs-variable">$SourceAcrpasswd</span> \
--no-wait
<span class="hljs-keyword">done</span>
<span class="hljs-keyword">done</span>
</code></pre><blockquote>
<p>Note: in this Shell Script Source ACR Name is old repository name.  Source ACR Username is Username of the old repository. Source ACR Password is Password of the old repository. This is written for <code>zsh</code> shell, if you would like to use it for <code>bash</code> shell please change <code>#!/bin/zsh</code> to <code>#!/bin/bash</code>.</p>
</blockquote>
<p>Hope this helps. Let me know what you think in the comments below.</p>
]]></content:encoded></item></channel></rss>