<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Arafet Ben Kilani</title>
    <description>The latest articles on Forem by Arafet Ben Kilani (@arafetki).</description>
    <link>https://forem.com/arafetki</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1104541%2Fc7628f48-af4f-4106-91e9-9b8d9ade91c9.jpg</url>
      <title>Forem: Arafet Ben Kilani</title>
      <link>https://forem.com/arafetki</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/arafetki"/>
    <language>en</language>
    <item>
      <title>Understanding SDLC and How Security Plays Into it</title>
      <dc:creator>Arafet Ben Kilani</dc:creator>
      <pubDate>Tue, 20 Feb 2024 09:28:44 +0000</pubDate>
      <link>https://forem.com/arafetki/understanding-sdlc-and-how-security-plays-into-it-ek</link>
      <guid>https://forem.com/arafetki/understanding-sdlc-and-how-security-plays-into-it-ek</guid>
      <description>&lt;h2&gt;
  
  
  Table Of Contents
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;General Introduction&lt;/li&gt;
&lt;li&gt;Overview of SDLC&lt;/li&gt;
&lt;li&gt;
Diving Deeper Into Each Phase

&lt;ol&gt;
&lt;li&gt;Requirement Analysis&lt;/li&gt;
&lt;li&gt;Design&lt;/li&gt;
&lt;li&gt;Development&lt;/li&gt;
&lt;li&gt;Testing&lt;/li&gt;
&lt;li&gt;Operations&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;li&gt;The Importance of Security in SDLC&lt;/li&gt;
&lt;li&gt;Conclusion&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  General Introduction &lt;a&gt;&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;Welcome to the kickoff of my series titled "Secure Software/System Development Lifecycle" or SSDLC for short, where I will take you with me on a journey to explore what SSDLC is all about and why it's crucial for creating safe and robust software. &lt;/p&gt;

&lt;p&gt;In this first article, we'll focus on the fundamental pillars of SDLC and how security plays into it.&lt;/p&gt;

&lt;h4&gt;
  
  
  Let's get started!
&lt;/h4&gt;




&lt;h2&gt;
  
  
  Overview of SDLC &lt;a&gt;&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--vzGJsqd8--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://www.freecodecamp.org/news/content/images/2020/02/SDLC_-_Software_Development_Life_Cycle.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--vzGJsqd8--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://www.freecodecamp.org/news/content/images/2020/02/SDLC_-_Software_Development_Life_Cycle.jpg" alt="banner" width="800" height="804"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The SDLC consists of several distinct phases. There are some variations to this but generally we have the following five phases.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;em&gt;&lt;strong&gt;&lt;em&gt;Requirement Analysis&lt;/em&gt;&lt;/strong&gt;&lt;/em&gt; : This is where we gather all the requirements from the client as to what it is that they want to build.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;&lt;strong&gt;&lt;em&gt;Design&lt;/em&gt;&lt;/strong&gt;&lt;/em&gt; : This is where we pick different technology stacks to work with and make some architectural decisions.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;&lt;strong&gt;&lt;em&gt;Development / Implementation&lt;/em&gt;&lt;/strong&gt;&lt;/em&gt; : This is the fun phase where we actually write code.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;&lt;strong&gt;&lt;em&gt;Testing&lt;/em&gt;&lt;/strong&gt;&lt;/em&gt; : This is where we take the code and run some tests on it to make sure that it :

&lt;ul&gt;
&lt;li&gt;Works (obviously !)&lt;/li&gt;
&lt;li&gt;Secure (Very important!)&lt;/li&gt;
&lt;li&gt;Meets the client's requirements.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;&lt;strong&gt;&lt;em&gt;Operations / Evolution&lt;/em&gt;&lt;/strong&gt;&lt;/em&gt; : This is where we deploy the tested code to production environments and maintain it by going through the whole cycle again each time a bugfix or new feature is added.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Diving Deeper Into Each Phase &lt;a&gt;&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;Let's start by uncovering the details of the Requirement Analysis (RA) phase.&lt;/p&gt;

&lt;h3&gt;
  
  
  Requirement Analysis &lt;a&gt;&lt;/a&gt;
&lt;/h3&gt;

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

&lt;p&gt;In this phase, our job involves engaging in discussions with the client to understand their project requirements and determine what they aim to build. The process generally will go like this :&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Get a high-level overview of the requirements and goals&lt;/li&gt;
&lt;li&gt;Conduct requirement analysis to make sure you understand what those requirements are.&lt;/li&gt;
&lt;li&gt;Have an agreement with the client to make sure what they want is being captured.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;⚠️ Often, clients know what they want but do not know how.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Prioritization of requirements (Differentiate between the ones that the client wants vs the ones that are nice to have).&lt;/li&gt;
&lt;li&gt;Allocating resources ( budget, human resources) to make sure the work gets done.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Design &lt;a&gt;&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fi2ou7085hblpxecm8jfr.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fi2ou7085hblpxecm8jfr.jpg" alt="Image description" width="625" height="250"&gt;&lt;/a&gt;&lt;br&gt;
In this phase, the high-level system requirements previously gathered are translated into a detailed blueprint for the software solution.&lt;br&gt;
It typically involves the following parts:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;em&gt;Architectural Design&lt;/em&gt;&lt;/strong&gt; : includes system architecture, modules, and their relationships.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;em&gt;Data Design&lt;/em&gt;&lt;/strong&gt; : includes data model and database structure necessary for the application.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;em&gt;UI/UX&lt;/em&gt;&lt;/strong&gt; : Planning the user interface, including how users will interact with the system.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You'll want to make sure to document those design implementations to serve as a guide for the developers during the development phase.&lt;/p&gt;

&lt;h3&gt;
  
  
  Development &lt;a&gt;&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--NIq7_3jo--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn.vectorstock.com/i/preview-1x/08/82/software-developer-character-programmer-vector-26310882.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--NIq7_3jo--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn.vectorstock.com/i/preview-1x/08/82/software-developer-character-programmer-vector-26310882.jpg" alt="banner" width="625" height="250"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This is where the developers sit down and translate the detailed design documents into executable code that hopefully works!.&lt;/p&gt;

&lt;h3&gt;
  
  
  Testing &lt;a&gt;&lt;/a&gt;
&lt;/h3&gt;

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

&lt;p&gt;The primary goal of the testing phase is to identify and fix defects or bugs in the software to deliver a high-quality product.&lt;/p&gt;

&lt;p&gt;There are several ways of testing code.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;&lt;em&gt;Unit Testing&lt;/em&gt;&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This is the process of testing individual units of code, such as functions or classes to verify that each unit of the software performs as designed and to catch and fix any defects or errors early in the development cycle.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;&lt;em&gt;Integration Testing&lt;/em&gt;&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This is focused on verifying the interactions and communication between different components, modules of a software system to discover and pinpoint defects or issues that may emerge during the combination and interaction of various components.&lt;/p&gt;

&lt;p&gt;Integration Testing helps uncover errors such as incompatible interfaces, incorrect data transfers, communication failures and so on.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;&lt;em&gt;End-to-End Testing&lt;/em&gt;&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;End-to-end Testing verifies that the software works correctly from the beginning to the end of a particular user flow. It replicates expected user behavior and various usage scenarios to ensure that the software works as a whole. The goal of this form of software testing is to simulate and validate the user experience (UX) from start to finish. The key here is the UX since these tests are designed to catch any bug that any end user of the app could encounter beforehand.&lt;/p&gt;

&lt;p&gt;Another key point to note is that End-to-End Testing can be carried out either manually or automated using specialized testing frameworks and tools such as :&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.cypress.io/"&gt;Cypress&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.selenium.dev/"&gt;Selenium&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://playwright.dev/"&gt;Playwright&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;⚠️ It's important to highlight that there are specific tests dedicated to security, forming a pivotal aspect of the upcoming articles in this serie.&lt;/p&gt;

&lt;h3&gt;
  
  
  Operations / Evolution &lt;a&gt;&lt;/a&gt;
&lt;/h3&gt;

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

&lt;p&gt;Once the software has passed testing and is deemed ready for release it gets moved from the development/staging environment to the production environment where it will be used by end-users. Once that is done and the software is in active use, this phase focuses on maintaining and evolving the software to meet changing requirements, address issues, and enhance its functionality over time.&lt;/p&gt;

&lt;p&gt;Key activities during the operations/evolution phase include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;em&gt;Monitoring and Support&lt;/em&gt;&lt;/strong&gt; : This includes tracking performance, identifying potential issues, and providing support to end-users.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;em&gt;User Feedback&lt;/em&gt;&lt;/strong&gt; : This is essential for understanding how well the software meets user needs. This feedback can inform future updates and improvements.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;em&gt;Updates and Upgrades&lt;/em&gt;&lt;/strong&gt; : This could involve adding new features, improving existing ones, or incorporating security patches.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;To summarize, so far we've seen a comprehensive overview of the Software Development Life Cycle (SDLC), encompassing key phases such as Requirements Analysis, Design, Development, Testing and Operations.&lt;/p&gt;

&lt;p&gt;Now we are ready to move to the next chapter where we will delve into the critical aspect of security within the SDLC.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Importance of Security in SDLC &lt;a&gt;&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;Security in Software Development Life Cycle (SDLC) is crucial for creating robust, secure software applications.&lt;/p&gt;

&lt;p&gt;Here are some key reasons highlighting the importance of security in SDLC:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;&lt;em&gt;Cost-Efficiency&lt;/em&gt;&lt;/strong&gt; : This is the main motive behind identifying and addressing security issues early in the development process as fixing vulnerabilities during the design or coding phase is often less expensive than fixing them in production.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;em&gt;Risk Mitigation&lt;/em&gt;&lt;/strong&gt; : Identifying vulnerabilities and implementing security measures during development reduces the likelihood of security incidents and data breaches during the application's lifecycle.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;em&gt;Reputation Management&lt;/em&gt;&lt;/strong&gt; : Security breaches can significantly damage an organization's reputation. By prioritizing security in SDLC, companies demonstrate a commitment to protecting user data and building trust with customers, clients, and partners.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;To implement security in SDLC, we focus on incorporating existing security frameworks, standards, and practices such as OWASP,NIST and DevSecOps. &lt;/p&gt;

&lt;p&gt;Throughout this series, we will extensively explore these frameworks and intertwine their principles into our discussions.&lt;/p&gt;

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




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

&lt;p&gt;In conclusion, the SDLC provides a structured framework for planning, designing, developing, testing, deploying, and maintaining software. Embedding security practices at each phase is not only essential but also fundamental in ensuring the creation of robust, resilient, and secure software systems.&lt;/p&gt;

&lt;p&gt;Stay tuned for upcoming articles within this series as we delve deeper into SSDLC&lt;/p&gt;

</description>
      <category>software</category>
      <category>development</category>
      <category>security</category>
    </item>
    <item>
      <title>Gitops - Infra As Code Done Right</title>
      <dc:creator>Arafet Ben Kilani</dc:creator>
      <pubDate>Sat, 09 Sep 2023 17:07:05 +0000</pubDate>
      <link>https://forem.com/arafetki/gitops-infra-as-code-done-right-2ojg</link>
      <guid>https://forem.com/arafetki/gitops-infra-as-code-done-right-2ojg</guid>
      <description>&lt;h2&gt;
  
  
  Table Of Contents
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Introduction&lt;/li&gt;
&lt;li&gt;The Wrong Way of Doing IAC&lt;/li&gt;
&lt;li&gt;
Benefits of GitOps for IAC

&lt;ol&gt;
&lt;li&gt;Why Git ?&lt;/li&gt;
&lt;li&gt;Gitops Workflow Explained&lt;/li&gt;
&lt;li&gt;Automation and Deployment Processes &lt;/li&gt;
&lt;li&gt;Easy Rollback&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;li&gt;Conclusion&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Introduction &lt;a&gt;&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;In today's fast-paced tech world, efficiently handling infrastructure while maintaining stability and security can be a real challenge.&lt;br&gt;
But what if I told you there's a way to make this process smoother and more collaborative? &lt;br&gt;
GitOps a methodology that merges the power of version control, git workflows and automation with infra as code.&lt;br&gt;
In this article, I will try to uncover how GitOps can revolutionize the way you handle infrastructure  as a developer or operations professional.&lt;/p&gt;

&lt;h4&gt;
  
  
  Let's Get Started !
&lt;/h4&gt;




&lt;h2&gt;
  
  
  The Wrong Way of Doing IAC &lt;a&gt;&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgovdevsecopshub.com%2Fwp-content%2Fuploads%2F2021%2F02%2Fshutterstock_481946590.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgovdevsecopshub.com%2Fwp-content%2Fuploads%2F2021%2F02%2Fshutterstock_481946590.jpg" alt="banner"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Before we dive into gitops, we need to know the need behind it and why doing IAC in a way other than gitops is problematic!&lt;/p&gt;

&lt;p&gt;Picture this : instead of the tedious and error-prone manual setup of a Kubernetes cluster, you are harnessing the power of Infrastructure as Code (IAC) to define the deployment environment as code with Terraform, Ansible configurations, and Kubernetes manifests as your tools of choice for example.&lt;/p&gt;

&lt;p&gt;So you have a bunch of yaml files and other configuration files that describe your infrastructure, your plateform and it's configuration.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Bad Practice n°1&lt;/strong&gt; : &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Storing them on &lt;strong&gt;local machine&lt;/strong&gt; and not in a &lt;strong&gt;git&lt;/strong&gt; repo!&lt;/p&gt;

&lt;p&gt;-&amp;gt; No team collaboration and code reviews!&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Bad Practice n°2&lt;/strong&gt; : &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Storing the config files in a git repo where everyone on the team has access to it but no Review/Approval process!&lt;/p&gt;

&lt;p&gt;-&amp;gt; No pull/merge requests -&amp;gt; Commiting directly to main branch&lt;/p&gt;

&lt;p&gt;And by consequences no automated tests to test the code changes&lt;/p&gt;

&lt;p&gt;-&amp;gt; Break something in the infrastructure or the app environment making it instable.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Bad Practice n°3&lt;/strong&gt; : &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Updating the infrastructure and the app environment &lt;strong&gt;manually&lt;/strong&gt;!&lt;/p&gt;

&lt;p&gt;-&amp;gt; Everyone on the team has access to infrastructure to apply changes from their local machines making it hard to trace who executed what and when.&lt;/p&gt;

&lt;p&gt;-&amp;gt; Find mistakes only once applied.&lt;/p&gt;

&lt;p&gt;So as you see even though we are taking advantage of describing infrastructure as code which already has alot of benefits, our process is still mostly manual and inefficient. And that's where the &lt;strong&gt;gitops&lt;/strong&gt; concept comes into practice to &lt;strong&gt;treat Infrastructure As Code the same as Application Code&lt;/strong&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Benefits of GitOps for IAC &lt;a&gt;&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;Let's start first by discussing why Git ?&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Why Git ? &lt;a&gt;&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;First of all, Git provides robust version control capabilities, allowing you to track changes to your infrastructure code over time. This history is essential for collaboration and rollbacks.&lt;/p&gt;

&lt;p&gt;Developers and operations professionals are already familiar with it, making it a convenient choice.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Gitops Workflow Explained &lt;a&gt;&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimages.ctfassets.net%2Fo7xu9whrs0u9%2F1KC5aSZKkNOGzlBsdOyehv%2F3e283da396b0ce017d31a6b23211bf37%2Fgitops-workflow.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimages.ctfassets.net%2Fo7xu9whrs0u9%2F1KC5aSZKkNOGzlBsdOyehv%2F3e283da396b0ce017d31a6b23211bf37%2Fgitops-workflow.png" alt="workflow"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In a GitOps workflow, there is a dedicated Git repository for the Infrastructure as Code project, coupled with an associated DevOps pipeline. Let's break down the fundamental components of a typical GitOps workflow:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Establish a central Git repository that hold the Infrastructure as Code configuration files.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Create pull/merge requests to make changes and collaborate before pushing back to the main branch of the repository.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Trigger a CI pipeline to validate configuration files, and perform automated tests.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Review and approve the changes to ensure that the changes are well tested before being applied in an environment.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Trigger a CD pipeline for the continuous deployment of the infrastructure.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;=&amp;gt;&lt;/strong&gt; This approach will improve the quality of infrastructure and it's configuration where multiple people collaborate on the changes and things gets tested before applied.&lt;/p&gt;




&lt;h3&gt;
  
  
  3. Automation and Deployment Processes &lt;a&gt;&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;Now we said that once the changes are merged into the main branch, they will be automatically applied to the infrastructure through the CD pipeline.&lt;/p&gt;

&lt;p&gt;In gitops we have two ways to apply these changes : &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Pull Deployment&lt;/strong&gt;
 &lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fi.ibb.co%2FYp6ynVH%2FUntitled-design-1.png" alt="pull"&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In this model there is an agent installed in the deployment environment like k8s cluster that is actively pulling the changes from the git repository itself.&lt;/p&gt;

&lt;p&gt;The agent regulary monitors and compares desired state with actual state present in the environment where its running, if it sees that there is a difference it will pull and applies the changes to get the environment to the desired state defined in the repository.&lt;/p&gt;

&lt;p&gt;Mostly applicable in the context of Kubernetes and containerized environments.&lt;/p&gt;

&lt;p&gt;Popular Examples : &lt;a href="https://argo-cd.readthedocs.io/" rel="noopener noreferrer"&gt;Argocd&lt;/a&gt;, &lt;a href="https://fluxcd.io/" rel="noopener noreferrer"&gt;Fluxcd&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Push Deployment&lt;/strong&gt;
 &lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.unixarena.com%2Fwp-content%2Fuploads%2F2021%2F06%2FGitOps-Push-Deployment.jpg" alt="push"&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This is the traditional way that we know. &lt;br&gt;
In this model we explicitly define jobs in the application CI/CD pipeline that will execute commands to update the infrastructure or deploy the new application version to the deployment environment&lt;/p&gt;




&lt;h3&gt;
  
  
  4. Easy Rollback &lt;a&gt;&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fbertwagner.com%2Fwp-content%2Fuploads%2F2017%2F05%2F233da-1wccncrcdusku7im34r58lg.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fbertwagner.com%2Fwp-content%2Fuploads%2F2017%2F05%2F233da-1wccncrcdusku7im34r58lg.jpeg" alt="rollback"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now that we know that changes in the git repository are automatically synced with the deployment environment.&lt;br&gt;
We can easily leverage the power of git in tracking the history of changes to rollback to any previous state by simply using &lt;strong&gt;git revert&lt;/strong&gt;&lt;/p&gt;




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

&lt;p&gt;In conclusion, Gitops is a powerful approach that brings together  the principles of version control, git workflow and automation to make IAC or more generally xAC smoother, more stable and secure.&lt;/p&gt;

</description>
      <category>gitops</category>
      <category>git</category>
      <category>devops</category>
      <category>iac</category>
    </item>
    <item>
      <title>AWS Networking Fundamentals</title>
      <dc:creator>Arafet Ben Kilani</dc:creator>
      <pubDate>Tue, 04 Jul 2023 21:57:25 +0000</pubDate>
      <link>https://forem.com/arafetki/aws-networking-fundamentals-3b4g</link>
      <guid>https://forem.com/arafetki/aws-networking-fundamentals-3b4g</guid>
      <description>&lt;p&gt;&lt;strong&gt;&lt;em&gt;&lt;em&gt;Introduction&lt;/em&gt;&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Welcome to the world of AWS, In this article I will take you on a journey to explore the fundamentals of networking within  AWS. Whether you're preparing for the AWS Certified Solutions Architect exam or simply curious about how AWS manages networking,then this article will provide you with valuable insights.Throughout our journey we will touch upon essential topics such as Virtual Private Clouds (VPCs), subnets, security groups, internet gateways and so many more.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Let's Get Started !&lt;/em&gt;&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;&lt;em&gt;Virtual Private Cloud (VPC)&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

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

&lt;p&gt;Ever wondered how millions of cloud users worldwide can utilize the same hardware for their applications without encountering resource conflicts?&lt;/p&gt;

&lt;p&gt;Well the answer is vpc , essentially it's a &lt;strong&gt;private network&lt;/strong&gt; within the cloud that &lt;strong&gt;isolate&lt;/strong&gt; your cloud resources from other aws customers.&lt;/p&gt;

&lt;p&gt;It is a &lt;strong&gt;regional&lt;/strong&gt; service (Tied to a single region)&lt;/p&gt;

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

&lt;p&gt;By default, each region gonna have a default vpc initially created by aws but we can create up to 4 additional vpcs per region which total to 5 &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Subnets&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Subnets as their name suggests are logical partitions within a vpc created at the availability zone level which means a subnet can only exist within a single AZ.&lt;/p&gt;

&lt;p&gt;Can create up to 200 subnets per vpc.&lt;/p&gt;

&lt;p&gt;There are two type of subnets : &lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; - Public Subnet : resources that live here have access 
                   to the internet.

 - Private Subnet : resources that live here can't access 
                    the internet directly.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

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

&lt;p&gt;&lt;strong&gt;&lt;em&gt;IP Adressing&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Each vpc require a range/pool of private ip addresses called a cidr block, an example would look like this &lt;strong&gt;10.0.0.0/24&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The /24 part called suffix identifies the network part of the ip address, now without entering the details of how the ipv4 address scheme work the only thing we need to know is choosing the suffix depends on the size of infra we wanna build for example a /24 cidr block would provide us with 256 ip addresses, the first 5 addresses are reserved which leaves us with 251 ips or in other words can only have 251 running machines inside the vpc.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;If you want me to write an article explaining how ipv4 and CIDR blocks work tell me in the comments bellow&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In the meanwhile check this user guide provided by amazon on how to choose a cidr block for a vpc&lt;/p&gt;

&lt;p&gt;&lt;a href="https://docs.aws.amazon.com/vpc/latest/userguide/vpc-cidr-blocks.html"&gt;VPC CIDR blocks&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Each subnet in the vpc needs also a cidr block that is a subset of the vpc's cidr block.We can achieve this by taking the vpc cidr block and subnetting it even further using different techniques that are out of the scope for this article.&lt;/p&gt;

&lt;p&gt;There are 3 types of ip addresses in aws&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;  - Public : Identifies resources on the internet 
             Temporary (changes everytime we stop/start 
                        the instance).

  - Private : Identifies resources in the vpc and it's 
              permanent unless the instance is terminated

  - Elastic : A static public ip address (permanente).
              Created seperately and can be attached to 
              an ec2 instance.
              Aws only charge money when it's not in use.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Internet Gateway&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;It is a VPC component that allows communication between your VPC and the internet as simple as that.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Route Table&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A table that contains the different routes in/out a subnet.&lt;/p&gt;

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

&lt;p&gt;By default, aws creates a route table called main route table in every main vpc (default vpc /region) and associate it with all default subnets in the vpc (in every AZ aws creates a default subnet )&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffm1vfsx73l38wql0wwke.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffm1vfsx73l38wql0wwke.png" alt="diagram route table" width="800" height="364"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So to enable access to or from the internet for instances in a subnet in a VPC using an internet gateway, you must do the following : &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Create an internet gateway and attach it to your VPC.&lt;/li&gt;
&lt;li&gt;Add a route to your subnet's route table that directs 
internet-bound traffic to the internet gateway.&lt;/li&gt;
&lt;li&gt;Ensure that your network access control lists and security 
group rules allow the desired internet traffic (we will 
get to this later in the article when discussing security 
groups and Nacls )&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Overall, we will have something like this at the end&lt;/p&gt;

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

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Nat Gateways&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;What if you want to make some updates to an ec2 instance that lives in a private subnet ? how can you access the internet to pull the updates ?&lt;/p&gt;

&lt;p&gt;Well nat gateways is there for the rescue, it's a managed solution provided by aws that allows instances in a private subnet to connect to services outside your VPC such as the internet or other isolated vpcs.&lt;/p&gt;

&lt;p&gt;There are two types : &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Public&lt;/strong&gt; (default) : Instances in private subnets can &lt;br&gt;
connect to the internet, but cannot receive connections &lt;br&gt;
from it.&lt;br&gt;
Must be created in a public subnet &lt;br&gt;
Must associate an &lt;strong&gt;elastic IP&lt;/strong&gt; address with the NAT &lt;br&gt;
gateway at creation.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Private&lt;/strong&gt; : Instances in private subnets can connect to &lt;br&gt;
other VPCs or your on-premises network through it.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In most cases we use public Nat gateways.&lt;/p&gt;

&lt;p&gt;The only thing left to do is to update the route table associated with the private subnet to be able to direct internet-bound traffic to the Nat gateway.&lt;/p&gt;

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

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Security groups and Nacls&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;They are both firewalls&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Security groups&lt;/strong&gt; are &lt;strong&gt;stateful&lt;/strong&gt; and controls inbound/outbound traffic at the &lt;strong&gt;instance level&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;By default all outbound traffic is allowed and all inbound traffic is denied&lt;/p&gt;

&lt;p&gt;Stateful means that if a connection to/from the instance is made in one direction (Passed the firewall rule) then the reply in the other direction is automatically allowed.&lt;br&gt;
wich means requests have to pass the firewall rules only once.&lt;/p&gt;

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

&lt;p&gt;Example of an inbound rule &lt;/p&gt;

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

&lt;p&gt;Example of an outbound rule &lt;/p&gt;

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

&lt;p&gt;Some notes about security groups :&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Specific to a region and a vpc.&lt;/li&gt;
&lt;li&gt;Source and Destination can be a cidr or another security 
group&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Nacls&lt;/strong&gt; are &lt;strong&gt;stateless&lt;/strong&gt; and controls inbound/outbound traffic at the subnet level.&lt;/p&gt;

&lt;p&gt;By default it allows all traffic from anywhere.&lt;/p&gt;

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

&lt;p&gt;Example : Let's say we want to deny http traffic on port 80 &lt;/p&gt;

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

&lt;p&gt;Rules are evaluated by number (lowest number evaluated first)&lt;/p&gt;

&lt;p&gt;The default rule designated by (*) can't be deleted and it's always evaluated last and catches anything that didn't match prior rules.&lt;/p&gt;

&lt;p&gt;An advantage of Nacls over security groups is that they give us the ability to define deny rules which allows us to block a specific ip addresses from reaching resources on a specific subnet.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Bastion Hosts&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Now imagine that we want to ssh into an ec2 instance that lives in a private subnet to perform some configurations.&lt;/p&gt;

&lt;p&gt;Answer : Bastion hosts also called jump hosts.&lt;/p&gt;

&lt;p&gt;They are regular ec2 instances that live in a public subnet and we use them as a intermediary for ssh'ing into an instance within a private subnet.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Vpc Endpoints&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In simple words they allow instances in a vpc to reach 'Paas' services like S3 and Dynamodb through aws's private network instead of going through the internet.&lt;br&gt;
Can be used for additional layer of security.&lt;/p&gt;

&lt;p&gt;There are two type of endpoints : &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Gateway : Allows connections to S3 and DynamoDB only.&lt;/li&gt;
&lt;li&gt;Interface : Allow connections to all other aws services.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Services that are managed by aws like S3 , DynamoDB etc do not belong to a vpc.&lt;br&gt;
The only way for resources within our vpc to reach these services is through the internet or through vpc endpoints.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fn9mh98498qh97g0y20kg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fn9mh98498qh97g0y20kg.png" alt="vpc endpoint diagram" width="800" height="737"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Vpc Peering And Transit Gateways&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;So far we talked about how vpcs are isolated from each other which means there is no network reachability between them.&lt;/p&gt;

&lt;p&gt;How can we make two or more vpcs communicate with each other through aws's private network.&lt;/p&gt;

&lt;p&gt;We have two ways to do it :&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Vpc peering&lt;/strong&gt; : We create a peering connection that allow two vpcs to behave as a single network under the condition that these two vpcs cannot have overlapping cidr ranges.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;We can peer two vpcs within same account or accross multiple aws accounts&lt;/p&gt;

&lt;p&gt;Not transitive.&lt;/p&gt;

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

&lt;p&gt;We also have to update the routing tables in each vpc to allow traffic back and forth.&lt;/p&gt;

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

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Transit Gateway&lt;/strong&gt; : Allow us to connect two or more vpcs together and unlike vpc peering they are transitive.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;They also can peer other transit gateways.&lt;/p&gt;

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

&lt;p&gt;At the moment this is the only service that support multicast routing.&lt;/p&gt;

&lt;p&gt;Multicast : means delivering single stream of data to multiple recieving instances simultaneously.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Site-to-Site Vpn&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Suppose we want to connect a on-premise cloud to aws &lt;/p&gt;

&lt;p&gt;One option for doing this is through vpn &lt;/p&gt;

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

&lt;p&gt;On the customer side you'll need a customer gateway managed on-premise and on the Aws side you'll need a virtual private gateway.&lt;/p&gt;

&lt;p&gt;In the subnet route tables we need to enable route propagation and in the security groups of the ec2 instances we need to allow inbound icmp messages in order for this to work.&lt;/p&gt;

&lt;p&gt;Even though the traffic is encrypted it's still going through the public internet.&lt;/p&gt;

&lt;p&gt;So if we want maximum security then we can use direct connect.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Direct Connect&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This offers a dedicated physical connection (using optic fibers) from on-premise to aws.&lt;/p&gt;

&lt;p&gt;More expensive and takes longer to setup.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8jyieonzxw8p4xgq47aw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8jyieonzxw8p4xgq47aw.png" alt="direct connect diagram" width="800" height="281"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;&lt;em&gt;Conclusion&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In this article I tried to provide an overview of networking fundamentals in AWS. It is important to recognize that a comprehensive understanding of AWS networking requires a deeper exploration beyond the scope of a single article.&lt;br&gt;
As with any technical subject, hands-on experience and continuous learning are crucial.&lt;/p&gt;

&lt;p&gt;Alright that concludes our journey today thank you for your time&lt;br&gt;
If you have any questions don't hesitate to ask in the comment section.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Have a nice day !&lt;/strong&gt;&lt;/p&gt;

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

</description>
      <category>aws</category>
      <category>vpc</category>
      <category>networking</category>
      <category>cloud</category>
    </item>
    <item>
      <title>Podman : An Alternative To Docker ?</title>
      <dc:creator>Arafet Ben Kilani</dc:creator>
      <pubDate>Mon, 19 Jun 2023 21:48:17 +0000</pubDate>
      <link>https://forem.com/arafetki/podman-the-docker-alternative-or-fierce-competitor-4n3h</link>
      <guid>https://forem.com/arafetki/podman-the-docker-alternative-or-fierce-competitor-4n3h</guid>
      <description>&lt;p&gt;While docker has undoubtedly revolutionized the way we develop, deploy, and run applications, it's worth exploring what sets Podman (Pod Manager) apart and why you may want to start using it instead.&lt;br&gt;
In this article, we'll dive into the core features of podman assuming that everyone is already familiar with Docker.&lt;/p&gt;

&lt;p&gt;Let's Start!&lt;/p&gt;

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

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

&lt;p&gt;In simple words, Podman is an open-source container and pod manager.&lt;/p&gt;

&lt;p&gt;Similar to docker, it allows you to create, start, stop, and delete &lt;strong&gt;OCI&lt;/strong&gt; containers, as well as manage container images but also supports pods as part of its feature set wich means you can create and manage pods just like you would with Kubernetes.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;But wait OCI Containers ?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;OCI (Open Container Initiative) : is an industry-standard organization that aims to create set of rules (specifications and standards) that ensure containers work consistently across different platforms.&lt;/p&gt;

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

&lt;p&gt;&lt;strong&gt;So what does this mean ?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;It means that Podman's images/containers are fully compatible with docker's or any containerization technology that relies on an OCI compliant container runtime.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Great&lt;/strong&gt; so now we know that podman is fully compatible with docker but wait it's more interesting.&lt;/p&gt;

&lt;p&gt;Most docker users can simply alias Docker to Podman (alias docker=podman) without any problems.&lt;br&gt;
This means that all docker's commands stay the same with the exception of docker swarm.&lt;/p&gt;

&lt;p&gt;Your probably wondering what does Podman bring to the table.&lt;/p&gt;

&lt;p&gt;Let's dive deeper!&lt;/p&gt;

&lt;h2&gt;
  
  
  Architecture
&lt;/h2&gt;

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

&lt;p&gt;&lt;strong&gt;Can you spot the difference ?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Podman's architecture is &lt;strong&gt;daemonless&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Wow what is that and why are we trying to get rid of the good old docker daemon ?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Daemons are processes that run in the background of the system, they typically run continuously in the background, waiting for certain events or requests to occur.&lt;/p&gt;

&lt;p&gt;Back to containers, Think of the docker daemon as the intermediary communicating between the user and the container itself.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Problems ?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;There are few problems with using a daemon to manage containers : &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Single point of failure&lt;/strong&gt;&lt;br&gt;
Once the daemon crashes, all containers do.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Requires root privileges&lt;/strong&gt;&lt;br&gt;
This makes the docker daemon an ideal target for hackers who want to gain control of your containers and infiltrate the host system.&lt;/p&gt;

&lt;p&gt;Podman addresses the mentioned challenges by directly interacting with container registries, containers, and image storage without the need for a daemon hence the daemonless architecture.&lt;/p&gt;

&lt;p&gt;By going &lt;strong&gt;rootless&lt;/strong&gt; (not requiring root privileges), users can create, run, and manage containers without requiring processes with admin privileges reducing the security risks&lt;/p&gt;

&lt;p&gt;The &lt;strong&gt;buildah&lt;/strong&gt; utility takes the place of docker build as a container image building tool. Similarly, &lt;strong&gt;skopeo&lt;/strong&gt; replaces docker push and enables the movement of container images between registries. These tools provide efficient and direct interactions with the necessary components, &lt;strong&gt;eliminating&lt;/strong&gt; the need for a &lt;strong&gt;separate daemon&lt;/strong&gt; in the process.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Should I re-write every dockerfile and docker-compose file to be able to use podman with my existing projects ?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Answer&lt;/strong&gt; : Absolutley Not&lt;/p&gt;

&lt;p&gt;Podman aims to provide a familiar developer experience by offering compatibility with docker's containerfile syntax. &lt;br&gt;
Additionally, Podman introduces a similar tool called pod compose as an alternative to docker compose. &lt;br&gt;
Pod compose utilizes the same syntax allowing you to define and manage multi-container applications using the same approach or even using existing "docker-compose.yml" files.&lt;/p&gt;

&lt;p&gt;As for Docker desktop, Podman also comes with Podman desktop offering enhanced features that make it more powerful and streamlined. It offers compatibility with Docker and Kubernetes, amplifying its capabilities and delivering a smoother experience.&lt;/p&gt;

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

&lt;p&gt;You can find Podman's installation guide and documentation in their official website &lt;a href="https://podman.io/" rel="noopener noreferrer"&gt;podman.io&lt;/a&gt;&lt;/p&gt;

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

&lt;p&gt;Given Podman's daemonless architecture, comparable developer experience to Docker, and the fact that both are open-source projects with thriving communities, there are no significant advantages to sticking with Docker over Podman.&lt;/p&gt;

</description>
      <category>podman</category>
      <category>docker</category>
      <category>containers</category>
      <category>virtualization</category>
    </item>
  </channel>
</rss>
