<?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" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Rinchhen Thing on Medium]]></title>
        <description><![CDATA[Stories by Rinchhen Thing on Medium]]></description>
        <link>https://medium.com/@thingrinchhen?source=rss-eeacbe42bd6c------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*pj46PUGRU7gVDK_9</url>
            <title>Stories by Rinchhen Thing on Medium</title>
            <link>https://medium.com/@thingrinchhen?source=rss-eeacbe42bd6c------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 17 Nov 2026 02:05:05 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@thingrinchhen/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Pasal: A DevOps project with a FastAPI backend (part 1)]]></title>
            <link>https://medium.com/@thingrinchhen/pasal-a-devops-project-with-a-fastapi-backend-part-1-8ce49e003c3c?source=rss-eeacbe42bd6c------2</link>
            <guid isPermaLink="false">https://medium.com/p/8ce49e003c3c</guid>
            <category><![CDATA[personal-project]]></category>
            <category><![CDATA[fastapi]]></category>
            <category><![CDATA[docker]]></category>
            <dc:creator><![CDATA[Rinchhen Thing]]></dc:creator>
            <pubDate>Sat, 29 Aug 2026 12:56:07 GMT</pubDate>
            <atom:updated>2026-08-29T12:56:07.255Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cKUfa3eLAepA3iiI5dGVig.png" /></figure><p>For the past two months, I have been working on a personal project entirely to practice and demonstrate my DevOps skills and increase my chances of getting hired.</p><p>The project uses a FastAPI (Python) backend with plain HTML, CSS, and JS as the preferred framework and language. Pasal is a web app that is designed for sellers and buyers over the internet to buy and sell products, without a definitive payment method.</p><p>The first stage of the project involved designing the backend and the structure of the project. The data flow of the system or the project was decided to be as given below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/656/1*oj5nvirVHQVqn7zznSUrng.png" /><figcaption><a href="https://drive.google.com/file/d/1MxvxxkI9pZkkRK77CYKWH_7Ezr4NEDrT/view?usp=sharing">Data Flow diagram </a>of the project.</figcaption></figure><p>After the Data flow of the project was decided, an ERD (Entity Relationship Diagram) was developed to define the tables in the Postgres database, which is given below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*m69kvM2TyHJuDcLW3hFRog.png" /><figcaption><a href="https://drive.google.com/file/d/1MxvxxkI9pZkkRK77CYKWH_7Ezr4NEDrT/view?usp=sharing">ERD</a> of the project</figcaption></figure><p>After the MVP of the project was finished, no further development, or let&#39;s say the coding part of the system, was decided to be over. After this phase, the DevOps part of the project was initiated and continued.</p><h4>Chapter 1: Docker</h4><p>Right after the completion of the MVP, of the project, the first thing that was initiated was Dockerization of the project.</p><p>As a DevOps engineer, Docker is considered to be a fundamental knowledge. Dockerization of the project helped me revise the topics while also practicing my skills in writing the YAML files and using the commands.</p><p>Below is the structure of the folder that was entirely dedicated to Docker.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LCb9mQIMArhFQVzA6Z4Mkg.png" /><figcaption>Folder structure of the docker</figcaption></figure><p>In the initial phase of the dockerization process, the backend and frontend were decided to be the first containers.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/629/1*yYr6FtloBV2_nUj3YvS8YA.png" /><figcaption>frontend’s docker file</figcaption></figure><p>The frontend’s Dockerfile was made very simple, with an Nginx container that copies the static files and the Nginx configuration files. In the file, “EXPOSE 80”, doesn’t actually exposes the port, but rather tells docker engine that the containerized application expects to listen on port 80.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/778/1*DRptty9-lz2lqP4wgKiiXw.png" /><figcaption>backend’s dockerfile</figcaption></figure><p>The backend’s Dockerfile, however, does more work than the frontend. First, we are making a container with Python installed, then deciding the working directory to be /app, then copying the requirements, and running the command to install the requirements. After copying the project files, we tell Docker to expect that the app is going to listen on port 8000 and hence running the command “uvicorn app.main:app — host 0.0.0.0 — port 8000” to run the backend.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yDi1b30ukDvP9cp_P8s-Cg.png" /></figure><p>The frontend calls the APIs with the API_BASE constant defined in the JS file.</p><pre>services:<br>  backend:<br>    image: pasal-backend:dev<br>    build:<br>      context: ..<br>      dockerfile: docker/backend.Dockerfile<br><br>    container_name: pasal-backend<br><br>    restart: unless-stopped<br><br>    ports:<br>      - &quot;8000:8000&quot;<br><br>    env_file:<br>      - ../.env.docker<br><br>    depends_on:<br>      - postgres<br>      - redis<br>    networks:<br>      - pasal-network<br><br>    healthcheck:<br>      test:<br>        [<br>          &quot;CMD&quot;,<br>          &quot;python&quot;,<br>          &quot;-c&quot;,<br>          &quot;import urllib.request; urllib.request.urlopen(&#39;http://localhost:8000/health&#39;)&quot;,<br>        ]<br>      interval: 30s<br>      timeout: 10s<br>      retries: 3<br>      start_period: 20s<br><br>  frontend:<br>    image: pasal-frontend:dev<br>    build:<br>      context: ..<br>      dockerfile: docker/frontend.Dockerfile<br><br>    container_name: pasal-frontend<br><br>    restart: unless-stopped<br><br>    ports:<br>      - &quot;3000:80&quot;<br>    networks:<br>      - pasal-network<br>  <br>  monitor:<br>    image: pasal-monitor:dev<br>    build:<br>      context: ..<br>      dockerfile: docker/monitor.Dockerfile<br><br>    container_name: pasal-monitor<br><br>    restart: unless-stopped<br><br>    ports:<br>      - &quot;9000:9000&quot;<br>    <br>    volumes:<br>      - /var/run/docker.sock:/var/run/docker.sock<br><br>    networks:<br>      - pasal-network<br><br>    healthcheck:<br>      test:<br>        [<br>          &quot;CMD&quot;,<br>          &quot;python&quot;,<br>          &quot;-c&quot;,<br>          &quot;import urllib.request; urllib.request.urlopen(&#39;http://localhost:9000/health&#39;)&quot;,<br>        ]<br>      interval: 30s<br>      timeout: 10s<br>      retries: 3<br>      start_period: 10s<br><br><br>  postgres:<br>    image: postgres:17<br>    container_name: pasal-postgres<br><br>    restart: unless-stopped<br><br>    environment:<br>      POSTGRES_DB: pasal_db<br>      POSTGRES_USER: postgres<br>      POSTGRES_PASSWORD: postgres<br><br>    ports:<br>      - &quot;5436:5432&quot;<br><br>    volumes:<br>      - postgres_data:/var/lib/postgresql/data<br>    networks:<br>      - pasal-network<br><br>    healthcheck:<br>      test: [&quot;CMD-SHELL&quot;, &quot;pg_isready -U postgres&quot;]<br>      interval: 30s<br>      timeout: 10s<br>      retries: 5<br><br>  redis:<br>    image: redis:7<br>    container_name: pasal-redis<br><br>    restart: unless-stopped<br><br>    command: redis-server --appendonly yes<br><br>    ports:<br>      - &quot;6379:6379&quot;<br><br>    volumes:<br>      - redis_data:/data<br>    networks:<br>      - pasal-network<br><br>    healthcheck:<br>      test: [&quot;CMD&quot;, &quot;redis-cli&quot;, &quot;ping&quot;]<br>      interval: 30s<br>      timeout: 10s<br>      retries: 3<br><br>networks:<br>  pasal-network:<br>    driver: bridge<br><br>volumes:<br>  postgres_data:<br>  redis_data:</pre><p>The docker-compose.yml file was then introduced to bring all the individual containers together and make the entire application stack easier to manage.</p><p>The Compose file defines five services: the <strong>backend, frontend, monitor, PostgreSQL, and Redis</strong>. Instead of having to manually create and run each container, Docker Compose allows all of them to be started and managed together.</p><p>The backend is exposed on port8000, while the frontend is exposed on port 3000. Since the frontend uses Nginx, it listens on port 80 inside the container, which is mapped to port 3000 on the host using 3000:80. This is an important distinction because EXPOSE 80 in the Dockerfile itself does not publish the port; the actual host-to-container mapping is defined here in the Compose file.</p><p>PostgreSQL and Redis are also included as separate services. PostgreSQL is used as the primary database, while Redis is used for caching and other fast in-memory operations. Both services use Docker volumes so that their data is not lost when the containers are recreated.</p><p>One of the useful parts of this configuration is the custom Docker network:</p><pre>pasal-network</pre><p>All the services are connected to this network, allowing them to communicate with each other using their service names. For example, from the backend container, PostgreSQL can be reached using postgres:5432 and Redis using redis:6379. This is different from usinglocalhost, because localhost inside a container refers to that particular container itself.</p><p>Health checks were also added to the backend, monitor, PostgreSQL, and Redis services. These checks allow Docker to periodically verify whether the services are actually responding rather than simply assuming that a running container means a healthy application.</p><p>The depends_on configuration was also used for the backend to indicate that PostgreSQL and Redis are required services. Finally, restart: unless-stopped was added to the containers so that Docker can automatically restart them if they unexpectedly stop.</p><p>With this setup, the application could now be started with a single command:</p><pre>docker compose up -d</pre><p>At this point, the Pasal application was no longer just a collection of locally running applications. The backend, frontend, database, cache, and monitoring service were packaged into separate containers and connected through a reproducible Docker environment.</p><p>This completed the initial Dockerization stage and provided the foundation for the next part of the project: moving from simply running containers to managing and deploying them as a proper DevOps workload.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8ce49e003c3c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[K8s Architecture]]></title>
            <link>https://medium.com/@thingrinchhen/k8s-architecture-89ea07905198?source=rss-eeacbe42bd6c------2</link>
            <guid isPermaLink="false">https://medium.com/p/89ea07905198</guid>
            <category><![CDATA[kubernetes-architecture]]></category>
            <dc:creator><![CDATA[Rinchhen Thing]]></dc:creator>
            <pubDate>Thu, 27 Aug 2026 05:37:10 GMT</pubDate>
            <atom:updated>2026-08-27T05:37:10.948Z</atom:updated>
            <content:encoded><![CDATA[<p>We can divide Kubernetes architecture into two main parts: the <strong>Control Plane</strong> (Master Node), which makes decisions, and the <strong>Worker Nodes, </strong>which do the heavy lifting.</p><p>For instance, let&#39;s think of a Kubernetes Cluster as a massive automated taxi dispatch company:</p><ol><li><strong>The Control Plane (Master Node)</strong> is the corporate headquarters, which includes the office managers, the database trackers, and the dispatchers who decide which driver gets which passenger. They never pick up passengers themselves.</li><li><strong>The Worker Nodes </strong>are the actual taxi drivers out on the road. They carry the passengers (our application containers) and follow instructions from headquarters.</li></ol><h4>What is a Cluster?</h4><p>A cluster, or a K8s cluster, is a distributed system of nodes (physical or virtual machines) that work together to run containerized applications. It serves as the foundational unit of deployment, providing the infrastructure to automate the deployment, scaling, and management of these applications across multiple hosts.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ya1_a4Ik37sk_W6r" /><figcaption>Kubernetes Cluster</figcaption></figure><h4><strong>The Control Plane / Master Node (The Cluster Brain)</strong></h4><p>The Control Plane is responsible for maintaining the desired state of our cluster. It is made up of four core components:</p><p><strong>a. API Server (kube-apiserver): </strong>It is the front door to the K8s cluster. Every single action, from typing a ‘kubectl’ command, an automated GitOps tool like ArgoCD deploying code, or internal worker nodes reporting status, must go through the API server.</p><p>We can think of it as the gatekeeper or the receptionist. Nobody walks into the headquarters or makes changes without talking to the receptionist first. The ID (Athentication/Authorization) is verified, and the request is logged.</p><p><strong>b. Etcd (The Cluster Memory): </strong>It is a distributed, consistent, key-value store that holds the complete configuration data and state of the entire cluster at any given microsecond.</p><p>It is like a master office ledger/logbook. If it&#39;s not written in ‘etcd’, it doesn’t exist in the cluster. If a node goes down, etcd is where the record of its failure lives.</p><p><strong>c. Scheduler (kube-scheduler): </strong>It is the component that watches for newly created Pods that have no assigned Node, and selects the best physical machine for them to run on.</p><p>We can think of it as the “smart dispatch coordinator”. When a new order comes in, the scheduler looks at all available drivers, checks who has enough space (CPU/RAM capacity), checks if any drivers are barred from entering a certain zone (Taints/Tolerations), and assigns the job.</p><p><strong>d. Controller Manager (kube-controller-manager): </strong>It is the component that runs continuous background watch loops (reconciliation loops). It compares the actual current state of the cluster against our desired state specified in our YAML files.</p><p>We can think of it as the quality control manager. For example, the Deployment Controller continuously counts our running taxis. If our YAML file says “maintain 3 taxis” and it notices only 2 running because one crashed, it immediately requests the API server to spin up a 3rd one to fix the deficit.</p><h4>The Worker Nodes (The Execution Layer)</h4><p>Worker nodes sit on actual physical servers or cloud virtual machines (like AWS EC2 instances). Each worker node runs three critical elements:</p><p><strong>a. Kubelet: </strong>It is an agent that runs on each node in the cluster. It ensures that the containers described in the Pod specs sent by the Control Plane are actually running and healthy.</p><p>It can be thought of as the “on-site foreman” at the node station. The Kubelet takes orders from the API server (headquarters), communicates with the local container engine to boot up the containers, and reports back: “Boss, the containers are up and running smoothly.”</p><p><strong>b. Kube-Proxy: </strong>It is a network proxy that runs on each node, reflecting the services defined in the API. It manages network routing rules on the host to allow network communication to our pods from inside or outside the cluster.</p><p>It can be seen as the local traffic cop and router at each station. It ensures that when a packet of data comes looking for a specific Service IP address, it gets forwarded correctly to the right container process on that machine, often by updating the host’s ‘iptables’ or IPVS rules.</p><p><strong>c. Container Runtime: </strong>It is the underlying software responsible for pulling container images from registries and running the containers.</p><p>While historically Docker was the go-to default, modern production K8s setups use lightweight, standardized Container Runtime Interface (CRI) engines like containerd or CRI-O.</p><h4>What happens when we run “kubectl apply -f deployment.yaml”</h4><ol><li><strong>We</strong> send the YAML file using kubectl. The <strong>API Server</strong> receives it, authenticates our user, and writes the desired blueprint straight into <strong>etcd</strong>.</li><li>The <strong>Controller Manager</strong> notices a new Deployment entry in etcd. It realizes 0 pods are running but your file demands 3. It creates 3 unassigned Pod objects in the system.</li><li>The <strong>Scheduler</strong> detects these unassigned Pods. It calculates which Worker Nodes have enough CPU/RAM, picks Node-A, and attaches Node-A’s name to the Pod definitions.</li><li>The <strong>Kubelet</strong> running on Node-A watches the API Server. It detects: <em>“Hey, headquarters just assigned a new Pod to me!”</em></li><li>Node-A’s <strong>Kubelet</strong> instructs its local <strong>Container Runtime</strong> (containerd) to pull the container image and spin it up. It then reports success back to the API Server.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/1*6H44t-UDditEAtro3sz8Qw.png" /><figcaption>Architecture Component of Kubernetes</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=89ea07905198" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Introduction to Kubernetes]]></title>
            <link>https://medium.com/@thingrinchhen/introduction-to-kubernetes-05e9e7fd6903?source=rss-eeacbe42bd6c------2</link>
            <guid isPermaLink="false">https://medium.com/p/05e9e7fd6903</guid>
            <category><![CDATA[kubernetes]]></category>
            <dc:creator><![CDATA[Rinchhen Thing]]></dc:creator>
            <pubDate>Thu, 27 Aug 2026 04:31:33 GMT</pubDate>
            <atom:updated>2026-08-27T04:31:33.037Z</atom:updated>
            <content:encoded><![CDATA[<p>Kubernetes, also known as K8s, is an open-source container orchestration platform originally developed by Google and released in 2014. It is now maintained by the Cloud Native Computing Foundation (CNCF) and serves as the standard for managing containerized applications at scale across hybrid, public, and private cloud environments.</p><p>Kubernetes is like an automated manager for our software applications that are packed inside small standardized units called <strong>Pods.</strong> It runs on a “cluster” system where a smart <strong>Control Plane</strong> acts as the headquarters that handles traffic, schedules tasks, and manages overall system health, while a group of <strong>Worker Nodes </strong>acts as the actual machines doing the heavy lifting by running our apps.</p><p>Kubernetes automatically keeps our applications running exactly how we want them. If an app crashes, it replaces it instantly (self-healing); if too many users visit, it distributes the traffic evenly across multiple copies (load balancing); and instead of requiring manual step-by-step instructions, it constantly monitors the system to make sure the live setup always matches the blueprint we provided (declarative configuration).</p><h3><strong>What is container orchestration?</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/536/1*X3xDrG6QKIQH89Paa2zsuA.png" /><figcaption>Container Orchestration</figcaption></figure><p>Container Orchestration is the automated process of deploying, managing, scaling, and coordinating containerized applications across distributed systems. While containerization is packing the applications with their dependencies for portability, orchestration handles the operational complexity of managing hundreds or thousands of containers in a microservices architecture.</p><p>Orchestration tools automate critical lifecycle tasks including:</p><ul><li>Deployment and Scheduling: Automatically placing containers on optimal hosts based on resource availability.</li><li>Scaling: Dynamically adding or removing container instances to handle fluctuating workloads.</li><li>Self-Healing: Detecting failures and restarting or replacing containers to ensure high availability.</li><li>Networking and Load Balancing: Managing inter-service communication and distributing traffic across healthy instances.</li></ul><h3>K8s Components</h3><h4>Nodes and Pods (The Compute Layer)</h4><p>a. <strong>Pod: </strong>A pod is the smallest and most deployable object in Kubernetes. A pod represents a single instance of a running process in our cluster and wraps one or more tightly coupled containers (like a Docker container).</p><p>A pod can be seen as a delivery truck that has our main cargo box (our application container) and occasionally a smaller box like a helper tool or logger (a sidecar container), and moves things around as a single unit.</p><p><strong>b. Node: </strong>A node is a physical or virtual machine where Pods are scheduled to run. A single Node can host multiple Pods, and Kubernetes handles scheduling them automatically based on available resources.</p><p>So if a pod’s a truck, then a Node is a highway machine/parking grid or warehouse floor that provides the actual ground, space, and fuel (CPU and RAM) for those trucks to sit and operate.</p><h4>Services and Ingress (The Networking Layer)</h4><p><strong>a. Service: </strong>A Service is an abstract way to expose an application running on a set of Pods as a network service. It provides a single, permanent IP address or DNS name that routes traffic to a shifting group of underlying Pods.</p><p>A service can be thought of as a permanent business phone number. Pods are fragile and die frequently, and every time a new Pod is created, it gets a brand-new internal IP address. Instead of updating clients with a new phone number every time an employee changes, clients just dial the main office number (the Service), which forwards the call to whoever is at the desk.</p><p><strong>b. Ingress: </strong>Ingress is an API object that manages external access to the services in a cluster, typically HTTP/HTTPS. It provides routing rules, SSL termination, and name-based virtual hosting.</p><p>If Service is an internal phone extension, then Ingress is the receptionist/front gate security at the building entrance. It looks at incoming traffic from the outside world (e.g., <a href="http://api.example.com/v1">api.example.com/v1</a>) and decides which internal department (Service) to route it to.</p><h4>ConfigMaps and Secrets (The Configuration Layer)</h4><p><strong>a. ConfigMap: </strong>A ConfigMap is an API object used to store non-confidential configuration data in key-value pairs. It allows us to decouple environment-specific configurations from our container images.</p><p>ConfigMap can be thought of as an external configuration text file. Instead of hardcoding a database URL or log level inside our code, we hand it to the Pod as an environment variable or a mounted file right when it starts.</p><p><strong>b. Secret: </strong>It is similar to ConfigMap, but <strong>Secret </strong>is specifically designed to hold sensitive data like passwords, OAuth tokens, and SSH keys. Secrets are stored securely (Base64 encoded or encrypted at rest) to prevent accidental exposure.</p><h4>Volumes (The Storage Layer)</h4><p>A volume is a directory accessible to the containers in a Pod that allows data to persist beyond the lifecycle of an individual container.</p><p>It is like an external hard drive plugged into the delivery truck. If the truck breaks down and gets replaced by a new one, we unplug the hard drive from the broken truck and plug it right into the new one, keeping all the data intact.</p><h4>Deployments and StatefulSets (The Management Layer)</h4><p><strong>a. Deployment: </strong>It is an API object that manages stateless Pods. We define a desired state (e.g., “I want 3 replicas of my web app running”), and the Deployment controller continuously works to maintain that state, handling scaling and rolling updates automatically.</p><p>Deployment is like a cloning machine manager for your delivery trucks. It doesn’t care about the specific identity of any individual truck; if one breaks, it instantly clones a brand-new identical copy from the blueprint.</p><p><strong>b. StatefulSet: </strong>An API object used to manage stateful applications. It manages the deployment and scaling of a set of Pods, providing guarantees about the unique ordering and specific identity of each Pod.</p><p>Instead of interchangeable clones, think of a StatefulSet as a sports team lineup. Each player has a specific jersey number (e.g., mysql-0, mysql-1), an assigned role (Master database vs. Read Replica), and their own designated locker (Persistent Volume) that nobody else can touch.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=05e9e7fd6903" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Docker Fundamentals]]></title>
            <link>https://medium.com/@thingrinchhen/docker-fundamentals-a9990ce8590c?source=rss-eeacbe42bd6c------2</link>
            <guid isPermaLink="false">https://medium.com/p/a9990ce8590c</guid>
            <dc:creator><![CDATA[Rinchhen Thing]]></dc:creator>
            <pubDate>Wed, 19 Aug 2026 17:10:58 GMT</pubDate>
            <atom:updated>2026-08-19T17:10:58.393Z</atom:updated>
            <content:encoded><![CDATA[<h3>Introduction to Docker</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/458/0*iyM62WUOtieqPKcP" /><figcaption>Docker</figcaption></figure><h3>What is a container?</h3><p>While we revise the concepts of the DevOps learning journey, let’s first review what a container is. Containers and containerization are revolutionary technologies that have essentially solved the issue of projects and products getting stuck in the “It works on my computer” phase during deployment.</p><p>Containers are lightweight, standalone, and executable software packages that encapsulate an application’s code, runtime, system tools, libraries, and configuration files into a single unit. By utilizing <strong>OS-level</strong> virtualization (which is different than a hardware virtualization), containers share the host <strong>OS’s </strong>kernel, which eliminates the need for a full guest OS image and significantly reduces resource overhead.</p><p>Now the question to be asked after this statement, “containers utilize OS-Level virtualization, rather than hardware virtualization”, is the difference between containers and virtual machines.</p><h3>Containers Vs Virtual Machines (VM)</h3><p>Containers leverage OS-Level virtualization (where the containers share the kernel of the host). They are lightweight, have minimal overhead, and take minimal time to start up. They are highly portable (so much that professionals call it “write once, run anywhere”), and they have process-level isolation. Popular tools used for containerization are Docker, containerd, Kubernetes.</p><h3>Docker Containers</h3><p>A Docker container is a standardized, runnable instance of a Docker image, providing a loosely isolated environment that packages an application with all its necessary dependencies, such as code, runtime, system tools, libraries, and settings. Unlike virtual machines that virtualize hardware and require a full operating system, containers virtualize the operating system, sharing the host machine’s kernel while keeping processes isolated in user space. This architecture makes containers lightweight (typically tens of MBs), fast to boot (milliseconds), and highly portable, ensuring applications run consistently across different computing environments, from development laptops to production servers.</p><h3>Where do containers live?</h3><p>Containers are <strong>portable, </strong>meaning they can be moved and run on any system. For the portability trait, containers need a place to stay so they can be moved around. Hence, a container repository can be introduced.</p><p>A container repository is a collection of related container images that provide different versions (tags) of a specific application or service. It serves as the storage location where developers can push and pull these images for setup and deployment, often organized by project or service within a larger registry.</p><p>A container registry is the collection of repositories. While companies host their own private registries and repositories, public registries like Docker Hub, Azure Container Registry, and Amazon ECR are the most popular ones used in the industry.</p><p>For a practical view of using the Docker registry (Docker hub):</p><p>Clone the GitHub repository using the following command:</p><p><strong>git clone </strong><a href="https://github.com/dockersamples/helloworld-demo-node"><strong>https://github.com/dockersamples/helloworld-demo-node</strong></a></p><p>Navigate into the newly created directory.</p><p><strong>cd helloworld-demo-node</strong></p><p>Run the following command to build a Docker image, swapping out YOUR_DOCKER_USERNAME with your username.</p><p><strong>docker build -t YOUR_DOCKER_USERNAME/docker-quickstart .</strong></p><p>Run the following command to list the newly created Docker image:</p><p><strong>docker images</strong></p><p>You will see output like the following:</p><blockquote>REPOSITORY TAG IMAGE ID CREATED SIZE</blockquote><blockquote>YOUR_DOCKER_USERNAME/docker-quickstart latest 476de364f70e 2 minutes ago 170MB</blockquote><p>Start a container to test the image by running the following command (swap out the username with your own username):</p><p><strong>docker run -d -p 8080:8080 YOUR_DOCKER_USERNAME/docker-quickstart</strong></p><p>You can verify if the container is working by visiting <a href="http://localhost:8080/">http://localhost:8080</a> with your browser.</p><p>Use the <a href="https://docs.docker.com/reference/cli/docker/image/tag/">docker tag</a> command to tag the Docker image. Docker tags allow you to label and version your images.</p><p><strong>docker tag YOUR_DOCKER_USERNAME/docker-quickstart YOUR_DOCKER_USERNAME/docker-quickstart:1.0</strong></p><p>Finally, it’s time to push the newly built image to your Docker Hub repository by using the <a href="https://docs.docker.com/reference/cli/docker/image/push/">docker push</a> command</p><p><strong>docker push YOUR_DOCKER_USERNAME/docker-quickstart:1.0</strong></p><p>Open <a href="https://hub.docker.com/">Docker Hub</a> and navigate to your repository. Navigate to the Tags section and see your newly pushed image.</p><h3>Container: Technically</h3><p>A container is made of layers of stacked images, with a lightweight <strong>Linux Base Image. </strong>The base image is supposed to be small, as Docker is supposed to be lightweight, so Alpine is used most of the time.</p><h3>What is a Docker Image?</h3><p>Docker image is a lightweight, standalone, and executable software package that contains everything needed to run an application, including code, runtime, system tools, and settings. It acts like a read-only template or blueprint composed of stacked layers, providing a consistent environment that ensures applications run uniformly across different computing environments. Also, images are created from a Dockerfile and are stored in registries like Docker Hub.</p><h3>What is Docker Compose?</h3><p>Docker Compose is a tool for defining and running multi-container Docker applications on a single host. It allows users to configure their entire application stack including services, networks, and volumes in a single YAML config file (typically compose.yaml, or docker-compose.yml)</p><h3>How to write Docker compose?</h3><ol><li><strong>Step 1: Define the config version</strong></li></ol><p>version: ‘3.8’</p><p><strong>2. Step 2: Open the services block</strong></p><p>This is like creating a main dictionary or a big list where all the independent container applications will live</p><p>Add the ‘services’ keyword, indented at the root level</p><p>Services:</p><p><strong>3. Step 3: Define the first service</strong></p><p>Create first application inside that list, for now we will add MongoDB</p><p>Services:</p><p>Mongodb:</p><p><strong>4. Step 4: Configure the Database Properties</strong></p><p>Now, we add the properties for our mongodb service. Think of these like setting configuration variables inside an object:</p><p><strong>a. Specify the image blueprint:</strong> Tell Docker what software to download.</p><p><strong>b. Assign a fixed container name:</strong> Give it a clean name for tracking.</p><p><strong>c. Open the network ports:</strong> Map host port 27017 to internal container port 27017.</p><p><strong>d. Set environment configurations:</strong> Define the root admin credentials using variables.</p><pre>version: &#39;3.8&#39;<br>services:<br>mongodb:<br>image: mongo:latest<br>container_name: my_mongodb_container<br>ports:<br>- &quot;27017:27017&quot;<br>environment:<br>- MONGO_INITDB_ROOT_USERNAME=admin<br>- MONGO_INITDB_ROOT_PASSWORD=secretpassword</pre><p><strong>5. Step 5: Define second service and define configurations</strong></p><p>Just like the database, define the properties for this web interface:</p><p><strong>a. Specify its image:</strong> Use mongo-express:latest.</p><p><strong>b. Open its network ports:</strong> Map host port 8081 so you can visit it in a browser.</p><p><strong>i. Connect it to the database:</strong> Use environment variables to pass the passwords and point ME_CONFIG_MONGODB_SERVER to the name of your first service (mongodb).</p><p><strong>ii. Enforce a startup order:</strong> Add depends_on to ensure the database starts before the web UI tries to connect to it.</p><pre>mongo-express:<br>image: mongo-express:latest<br>container_name: my_express_container<br>ports:<br>- &quot;8081:8081&quot;<br>environment:<br>- ME_CONFIG_MONGODB_ADMINUSERNAME=admin<br>- ME_CONFIG_MONGODB_ADMINPASSWORD=secretpassword<br>- ME_CONFIG_MONGODB_SERVER=mongodb<br>depends_on:<br>- mongodb</pre><p>volumes:</p><p>mongo-data:</p><p>driver: local</p><p><strong>g. Step 8: Mount the Storage Volume to Your Service</strong></p><p>Finally, go back up to your mongodb configuration and link that global volume disk to the internal folder where MongoDB saves its files (/data/db).</p><p>Your completed, finalized code looks like this:</p><p>YAML</p><p>version: ‘3.8’</p><p>services:</p><p>mongodb:</p><p>image: mongo:latest</p><p>container_name: my_mongodb_container</p><p>ports:</p><p>- “27017:27017”</p><p>environment:</p><p>- MONGO_INITDB_ROOT_USERNAME=admin</p><p>- MONGO_INITDB_ROOT_PASSWORD=secretpassword</p><p>volumes:</p><p>- mongo-data:/data/db</p><p>mongo-express:</p><p>image: mongo-express:latest</p><p>container_name: my_express_container</p><p>ports:</p><p>- “8081:8081”</p><p>environment:</p><p>- ME_CONFIG_MONGODB_ADMINUSERNAME=admin</p><p>- ME_CONFIG_MONGODB_ADMINPASSWORD=secretpassword</p><p>- ME_CONFIG_MONGODB_SERVER=mongodb</p><p>depends_on:</p><p>- mongodb</p><p>volumes:</p><p>mongo-data:</p><p>driver: local</p><h3>Common Components of a Docker Compose File</h3><p>This document provides a clean, clear reference explaining the most common blocks and keywords used to build a docker-compose.yml file.</p><p>1. <strong>version</strong></p><ul><li><strong>What it is:</strong> The configuration syntax version.</li><li><strong>Explanation:</strong> It tells the Docker Compose engine which rulebook to use to read the file. If you use features from a newer version of Docker, you must declare a version (like ‘3.8’) that supports them.</li></ul><p>2. <strong>services</strong></p><ul><li><strong>What it is:</strong> The container dictionary block.</li><li><strong>Explanation:</strong> This is the master list where you declare all your individual application components. Every item indented immediately under services: will spin up as an independent, isolated container.</li></ul><p>3. <strong>image</strong></p><ul><li><strong>What it is:</strong> The software blueprint download link.</li><li><strong>Explanation:</strong> Tells Docker exactly which pre-built template to fetch from Docker Hub (e.g., postgres:latest, node:18, nginx:alpine). Without this, Docker doesn’t know what software should run inside the container.</li></ul><p>4. <strong>build</strong></p><ul><li><strong>What it is:</strong> The local custom build instruction.</li><li><strong>Explanation:</strong> Instead of downloading a ready-made image from Docker Hub, build points to a local folder containing a custom Dockerfile. Docker will compile your local code into a fresh image right before running it.</li></ul><p>5. <strong>ports</strong></p><ul><li><strong>What it is:</strong> The local network bridge lanes.</li><li><strong>Explanation:</strong> By default, a container is locked away from your computer’s network. This setting bridges a port on your host machine to a port inside the container using the syntax “HOST_PORT:CONTAINER_PORT”. Opening “3000:3000” allows you to view your containerized app by typing localhost:3000 into your actual web browser.</li></ul><p>6. <strong>environment</strong></p><ul><li><strong>What it is:</strong> The container configuration variables.</li><li><strong>Explanation:</strong> This passes standard key-value configuration variables into the container’s shell environment. It acts exactly like setting configuration properties in code, allowing you to pass passwords, connection strings, or profile settings (like DB_PASSWORD=secret) safely.</li></ul><p>7. <strong>volumes</strong></p><ul><li><strong>What it is:</strong> The permanent external storage connection.</li><li><strong>Explanation:</strong> By default, containers are temporary; if they crash or stop, any files written inside them vanish forever. Volumes act like external hard drives. They map a secure path on your computer’s hard drive to a folder inside the container so your data (like database logs or user uploads) stays completely safe.</li></ul><p>8. <strong>Networks</strong></p><ul><li><strong>What it is:</strong> Isolated communication channels.</li><li><strong>Explanation:</strong> This lets you create separate, distinct virtual networks. You can put your web app and database on a private backend network, keeping your database completely hidden from the outside world while allowing the backend services to talk to each other safely.</li></ul><p>9. <strong>depends_on</strong></p><ul><li><strong>What it is:</strong> The startup order manager.</li><li><strong>Explanation:</strong> Docker Compose naturally tries to launch all of your containers at the exact same millisecond. If your web backend tries to connect to a database that hasn’t finished booting up, the backend will crash. depends_on creates a strict sequence, telling Compose: <em>“Do not launch the backend app until the database container is active.”</em></li></ul><p>10. <strong>command</strong></p><ul><li><strong>What it is:</strong> The startup script override.</li><li><strong>Explanation:</strong> Every Docker image comes with a default startup task it runs automatically. The command block lets you overwrite that action with a custom execution statement (for example, switching a Node app from npm start to a development watcher like nodemon server.js).</li></ul><p>11. <strong>restart</strong></p><ul><li><strong>What it is:</strong> The crash recovery policy.</li><li><strong>Explanation:</strong> Defines what Docker should do if a container fails or if your computer reboots. Setting restart: always or restart: unless-stopped forces Docker to automatically boot the container back up if it unexpectedly crashes during production.</li></ul><h3>What is a Dockerfile?</h3><p>Dockerfile is a plain text file that contains a step-by-step set of instructions for building a Docker container image. It acts as a blueprint or recipe, telling Docker exactly how to package the application, its environment, and all its dependencies into a single, portable image.</p><h3>How to write a Dockerfile?</h3><p>Step 1: Create the File</p><p>In the root directory of your project folder, create a plain text file named exactly:</p><p>```text</p><p>Dockerfile</p><p>```</p><p>Note: The file has no extension (do not name it `Dockerfile.txt`). The “D” must be capitalized.</p><p>Step 2: Define the Base OS/Runtime (`FROM`)</p><p>Every container needs an operating system or language runtime to stand on. This must always be the first instruction in the Dockerfile.</p><p>```dockerfile</p><p>FROM node:18-alpine</p><p>```</p><p>What it means:</p><p>This downloads a lightweight Alpine Linux image with Node.js version 18 pre-installed. If you were building a Python application, you might use:</p><p>```dockerfile</p><p>FROM python:3.10-slim</p><p>```</p><p>Step 3: Set the Working Directory (`WORKDIR`)</p><p>By default, Docker starts in the root directory of the container. It is best practice to create a dedicated folder for your application.</p><p>```dockerfile</p><p>WORKDIR /app</p><p>```</p><p>What it means:</p><p>This creates the `/app` directory (if it does not already exist) and sets it as the current working directory. All subsequent instructions are executed inside this directory.</p><p>Step 4: Copy Dependency Files (`COPY`)</p><p>Before installing dependencies, copy the package tracking files into the container.</p><p>```dockerfile</p><p>COPY package*.json ./</p><p>```</p><p>What it means:</p><p>This copies `package.json` and `package-lock.json` into the current working directory inside the container.</p><p>Pro Tip:</p><p>Copying dependency files before application code allows Docker to cache dependency installation layers, making future builds faster.</p><p>Step 5: Install Dependencies (`RUN`)</p><p>Install all packages required by the application.</p><p>```dockerfile</p><p>RUN npm install</p><p>```</p><p>What it means:</p><p>The `RUN` instruction executes commands during the image build process. Docker runs `npm install` and downloads all dependencies listed in `package.json`.</p><p>Step 6: Copy the Rest of the Application Source Code (`COPY`)</p><p>After dependencies are installed, copy the remainder of the application files.</p><p>```dockerfile</p><p>COPY . .</p><p>```</p><p>What it means:</p><p>The first dot (`.`) refers to the current directory on your computer. The second dot (`.`) refers to the current working directory inside the container (`/app`).</p><p>Step 7: Document the Port Number (`EXPOSE`)</p><p>If the application acts as a web server, document the port it listens on.</p><p>```dockerfile</p><p>EXPOSE 3000</p><p>```</p><p>What it means:</p><p>This informs Docker and other developers that the application expects incoming traffic on port 3000.</p><p>Note:</p><p>`EXPOSE` does not publish the port. Port publishing is done when running the container.</p><p>Step 8: Set the Execution Command (`CMD`)</p><p>The `CMD` instruction defines the command that runs when the container starts.</p><p>```dockerfile</p><p>CMD [“npm”, “start”]</p><p>```</p><p>What it means:</p><p>When the container starts, Docker executes:</p><p>```bash</p><p>npm start</p><p>```</p><p>This launches the application and keeps the container running.</p><p>A Dockerfile should generally contain only one active `CMD` instruction because only the last `CMD` will be used.</p><p>Completed Dockerfile:</p><p>```dockerfile</p><p>FROM node:18-alpine</p><p>WORKDIR /app</p><p>COPY package*.json ./</p><p>RUN npm install</p><p>COPY . .</p><p>EXPOSE 3000</p><p>CMD [“npm”, “start”]</p><p>```</p><p>How to use it:</p><p>Build the image:</p><p>```bash</p><p>docker build -t my-web-app .</p><p>```</p><p>Run the container:</p><p>```bash</p><p>docker run -p 3000:3000 my-web-app</p><p>```</p><p>The application can then be accessed at:</p><p>```text</p><p><a href="http://localhost:3000/">http://localhost:3000</a></p><p>```</p><h3>Docker Networking</h3><p>Docker containers, by default, come with isolation, or we can say that containers come with isolated environments. But isolation among containers means they don’t talk to each other; for example, the backend needs to talk to the database, but isolated containers of each of those entities do not communicate by default.</p><p>Here, ‘Docker Networking’ comes in handy. Docker networking provides the virtual infrastructure required for the containers to talk to each other.</p><p>Docker networking has 5 native drivers required for communication amongst the containers:</p><p><strong>a. Bridge network (Default companion)</strong></p><p>The bridge network is like a private virtual WiFi-router running inside the host machine.</p><p><strong>How it works:</strong> When we start the Docker engine, a default virtual interface called ‘bridge’ or ‘docker0’ is created. Every container that we launch without specifying a network gets a private internal IP address (like 172.17.0.x) hooked up to this router.</p><p><strong>Default Vs. User-defined bridge network:</strong> On a default bridge network, the containers can only refer to each other via IP addresses. But on a user-defined network, Docker enables a<strong>utomatic</strong> <strong>service</strong> <strong>discovery, </strong>where the containers can seamlessly talk to one another using just their container ‘ — name’ properties.</p><p><strong>Best used for: </strong>Standard multi-container setups on a single host machine.</p><p><strong>b. Host Network (Speed Demon)</strong></p><p>The host network drops all network isolation between the container and the Docker host.</p><ul><li><strong>How it works:</strong> The container sits directly on your host machine’s network stack. If a container runs an application on port 8080, it claims port 8080 right on your actual server’s IP address immediately. No port mapping (-p) is required because the container’s ports are natively exposed.</li><li><strong>Pros &amp; Cons:</strong> It delivers maximum network performance with zero routing overhead. However, it introduces security risks and port-binding conflicts, meaning you cannot run two containers on port 8080 simultaneously.</li><li><strong>Best used for:</strong> High-performance services or handling massive volumes of traffic where network latency must be zero.</li></ul><p><strong>c. None Network (Digital Bunker)</strong></p><p>The none network provides total network isolation for highly sandboxed operations.</p><ul><li><strong>How it works:</strong> The container gets its own network namespace, but it has no network interface cards (NICs) attached, no IP address, and no routing tables except for a local loopback (127.0.0.1). It cannot talk to the outside world, and the outside world cannot talk to it.</li><li><strong>Best used for:</strong> Running batch processing scripts, generating secure keys, parsing local data files, or executing untrusted code in a highly secure sandbox.</li></ul><p><strong>d. Overlay Network (Multi-Host Bridge)</strong></p><p>The overlay network creates a distributed network across multiple distinct physical or virtual machines.</p><ul><li><strong>How it works:</strong> If Container A lives on Server 1 and Container B lives on Server 2, an overlay network masks the physical gap by encapsulating the traffic traveling over the host machines. It builds a unified local-like network across different servers.</li><li><strong>Best used for:</strong> Orchestration tools like Docker Swarm or multi-host clustered microservices.</li></ul><p><strong>e. Macvlan Network (Virtual Identity)</strong></p><p>The macvlan network makes a container appear as a physical machine on your actual local network.</p><ul><li><strong>How it works:</strong> It bypasses the Docker host’s routing altogether and assigns a unique physical MAC address to the container. Your physical router or corporate switch treats the container as an independent computer plugged into the network and provisions it with an actual local IP address (e.g., 192.168.1.55).</li><li><strong>Best used for:</strong> Legacy enterprise applications transitioning into containers that strictly require direct physical IP addresses instead of port mappings.</li></ul><h3>Practical Quick-Reference for Notes (CLI Commands)</h3><ol><li><strong>List all available networks on your system</strong></li></ol><p>$docker network ls</p><ol><li><strong>Create a custom user-defined bridge network (Highly recommended for projects!)</strong></li></ol><p>$docker network create — driver bridge my_isolated_net</p><ol><li><strong>Connect a container to your network at launch</strong></li></ol><p>$docker run -d — name web_api — network my_isolated_net my-api-image</p><ol><li><strong>Connect an already RUNNING container to a network dynamically</strong></li></ol><p>$docker network connect my_isolated_net existing_db_container</p><ol><li><strong>Inspect a network to view its subnet mask, gateway, and connected containers</strong></li></ol><p>$docker network inspect my_isolated_net</p><ol><li><strong>Disconnect a container or remove a network safely</strong></li></ol><p>$docker network disconnect my_isolated_net existing_db_container</p><p>$docker network rm my_isolated_net</p><h3>Docker Volumes</h3><p>By default, all files created inside a container are stored on a temporary, writable container layer. When that container is deleted, its writable layer is wiped out completely, taking your database logs or uploaded user images with it.</p><p>To solve this, Docker provides ways to store data persistently on the host machine’s hard drive, decoupled from the container’s lifecycle.</p><h3>Named Volumes (The Managed Safe)</h3><p>Named volumes are explicitly named storage spaces completely managed by Docker on the host machine’s filesystem.</p><ul><li><strong>How it works:</strong> When you create a named volume, Docker isolates a dedicated directory inside a specific host directory (usually /var/lib/docker/volumes/ on Linux). Non-Docker processes on your host system shouldn’t touch this directory. When a container mounts this volume, it maps its internal folder directly to this managed directory.</li><li><strong>Key Feature:</strong> If you mount a named volume into a container folder that already contains files, those existing files are automatically copied <em>up</em> into your new volume upon initial creation.</li><li><strong>Best used for:</strong> Production databases (like MySQL or Postgres), application logs, or stateful production data where you want Docker to safely manage backups, migrations, and storage locations.</li></ul><h3>Bind Mounts (The Open Bridge)</h3><p>Bind mounts map a specific, exact path from your host machine’s filesystem directly into a path inside the container.</p><ul><li><strong>How it works:</strong> Unlike volumes, bind mounts point to any arbitrary directory on your laptop or server — such as your actual desktop project folder ~/Projects/my-node-app. The file or directory is referenced by its absolute path on the host machine.</li><li><strong>Key Feature:</strong> Bind mounts can overwrite container directory content. If you mount an empty local host directory into a container folder that already has files, those container files will instantly disappear from view inside the container while mounted.</li><li><strong>Best used for:</strong> Local development environments. You can mount your source code directory into the container, and every time you save a file on your local IDE (like VS Code), the running container detects the change instantly without needing a full image rebuild.</li></ul><h3>Anonymous Volumes (The Temporary Locker)</h3><p>Anonymous volumes are volumes created without an explicit name assigned to them.</p><ul><li><strong>How it works:</strong> When a container is run with an anonymous volume target, Docker generates a long, randomized alphanumeric ID (hash string) to track it. Like named volumes, they are stored securely inside Docker’s internal host storage directory.</li><li><strong>Key Feature:</strong> They are designed for automatic cleanup. If you run a container with the — rm flag, its associated anonymous volumes are deleted automatically when the container stops. If you do not pass — rm, the storage directory persists but is difficult to track down because it lacks a friendly name.</li><li><strong>Best used for:</strong> Storing temporary application states, caching heavily written build folders (like node_modules or target directories) to prevent them from being accidentally overwritten by a host bind mount.</li></ul><h3>Volume Management (The System Admin Checklist)</h3><p>This collection of commands is crucial for maintaining storage health and preparing for practical technical scenarios.</p><p><strong>How it works:</strong> Docker provides a dedicated subset of commands under docker volume to create, inspect, audit, and wipe storage components across your host architecture.</p><p><strong>Key Commands for your notes:</strong></p><ul><li>docker volume create my_db_data — Manually provisions a named volume.</li><li>docker volume ls — Lists every active named and anonymous volume on the host.</li><li>docker volume inspect my_db_data — Returns JSON metadata showing the exact physical path where the data lives on your host disk.</li><li>docker volume rm my_db_data — Deletes a specific volume (fails if any container is still attached to it).</li><li>docker volume prune — Deletes all unused anonymous and named volumes to instantly recover wasted disk space.</li><li><strong>Best used for:</strong> Performing server cleanups, creating database backup entry points, and debugging data persistence issues during deployments.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a9990ce8590c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Risk Scoring (CVSS)]]></title>
            <link>https://medium.com/@thingrinchhen/risk-scoring-cvss-17f44e453d62?source=rss-eeacbe42bd6c------2</link>
            <guid isPermaLink="false">https://medium.com/p/17f44e453d62</guid>
            <category><![CDATA[cvss-calculator]]></category>
            <dc:creator><![CDATA[Rinchhen Thing]]></dc:creator>
            <pubDate>Tue, 19 May 2026 05:19:53 GMT</pubDate>
            <atom:updated>2026-05-19T05:19:53.448Z</atom:updated>
            <content:encoded><![CDATA[<p>Many organizations face numerous cyber threats, which range from stolen passwords to critical software vulnerabilities. But not each vulnerability carries the same level of danger or threat. Security professionals must determine which to prioritize for mitigation and which to monitor over time.</p><p>Here, let&#39;s explore how cybersecurity professionals measure risk using CVSS, how credentials-based attacks work, and defensive strategies organizations use to protect systems and sensitive data. It also examines secure password hashing methods like bcrypt and Argon2id, which help strengthen authentication security.</p><h3><strong>What is CVSS?</strong></h3><p>Common Vulnerability Security System (CVSS) is a standardized, Open framework maintained by the Forum of Incident Response and Security Teams (FIRST). This framework is used to evaluate and communicate the severity of security vulnerabilities.</p><p>CVSS score ranges from 0.0 to 10.0, which can be categorized as:<br>a. 0.0 = None</p><p>b. 0.1–3.9 = Low</p><p>c. 4.0–6.9 = Medium</p><p>d. 7.0–8.9 = High</p><p>e. 9.0–10 = Critical</p><p>For example, A remote code execution vulnerability that requires no authentication and affects internet-facing servers may receive a CVSS score of 9.8 (Critical).</p><h3>Base, Temporal, and Environmental Metrics</h3><p>CVSS scoring is calculated using three metric groups: Base Metrics, Temporal Metrics, and Environmental Metrics.</p><h4>Base Metrics</h4><p>Base metrics are core components used to determine how severe the vulnerability is. They focus on vulnerability’s characteristics, regardless if it has been exploited or mitigated.</p><p>These metrics include:</p><p><strong>a. Attack Vector</strong></p><p>This metric determines the score based on how the attacker can access the system, ranging from physical access to connecting to the system.</p><p>Attack Vector has 4 different values that can be assigned to it: Network, Adjacent, Local, and Physical.</p><p><strong>b. Attack Complexity</strong></p><p>This metric determines the score based on how difficult it is to exploit the vulnerability. This metric simply determines the score based on the exploitability of the vulnerability.</p><p>It has two different values: Low and High. Low complexity will generate the highest score.</p><p><strong>c. Privilege Required</strong></p><p>This metric determines the score based on the privileges the attacker needed to have <strong>before </strong>exploiting the vulnerability.</p><p>It has three values: None, Low, and High. None has access to any settings or files on the system. Low is the basic user capabilities. High administrative privileges are needed.</p><p><strong>d. User Interaction</strong></p><p>This metric determines the score based on whether the user has to be engaged or not. For example, on a phishing website, the victim must click a malicious link or download a harmful file before the attacker can exploit the system. Vulnerabilities that require user interaction generally receive a lower severity score than attacks that can be executed automatically without user involvement.</p><p>It has two values: None and Required.</p><p><strong>e. Scope</strong></p><p>This metric determines the score based on how severe or dangerous the vulnerability is and how much impact it can cause to the affected system or data. In simple terms, it checks how far the damage can spread after the vulnerability is exploited. For example, if a vulnerability in an application only affects that application, then the impact is considered limited. However, if exploiting that same application also allows the attacker to gain access to the operating system, database, or other connected systems, then the impact becomes much more serious because the attack crosses security boundaries.</p><p>It has two values: Unchanged and Changed.</p><p><strong>f. Confidentiality, Integrity, and Availability</strong></p><p>Confidentiality determines the score based on the potential for unauthorized access to sensitive information. Integrity determines the score based on the potential for unauthorized modification, data breach, or deletion of data. Availability determines the score based on the potential for denial of access to authorized users. This could be the denial of access to a service or processor cycles.</p><p>All these metrics have three values: High, Low, None. And in all these metrics, “High” is the most severe.</p><h4>Temporal Metrics</h4><p>Temporal metrics evaluate the changing nature of vulnerabilities over time. They assess a vulnerability’s current exploitability and availability of remediating controls.</p><h4>Environmental Metrics</h4><p>Environmental metrics allow organizations to adjust the base CVSS score based on their specific security needs and modifications of “Base Metrics”.</p><p>Temporal and Environmental metrics are generally scored by the administrative team, rather than ethical hackers.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=17f44e453d62" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Foundations of Ethical Hacking]]></title>
            <link>https://medium.com/@thingrinchhen/foundations-of-ethical-hacking-5b71271d3eeb?source=rss-eeacbe42bd6c------2</link>
            <guid isPermaLink="false">https://medium.com/p/5b71271d3eeb</guid>
            <dc:creator><![CDATA[Rinchhen Thing]]></dc:creator>
            <pubDate>Sun, 10 May 2026 01:53:21 GMT</pubDate>
            <atom:updated>2026-05-10T01:53:21.239Z</atom:updated>
            <content:encoded><![CDATA[<p>The authorized practice of testing computer systems, networks and applications to identify security vulnerabilities before threat actors act on them, and exploit, is Ethical Hacking. <strong>Almost</strong> all the tools and techniques used by ethical hackers are similar to those used by the cyber criminals, but they operate legally with permission from the organization and aim to improve the security by finding weakness, testing defenses and helping organizations strengthen the security of their digital infrastructure.</p><p>Compared to penetration testing, ethical hacking is a broader concept, hence, it is also known as the “Umbrella Discipline” or “Umbrella Concept”. It involves continuously assessing and improving an organization’s overall security posture, while penetration testing usually focuses on a specific system, application or network within a defined time frame to identify and exploit vulnerabilities.</p><p>Ethical hacking depends on a very important foundation called “authorization”. As, ethical hacking uses the same techniques and tools as the threat actors, performing security tests without permission can be considered illegal and may lead to serious legal consequences. Authorization provides ethical hackers with official approval from the system owner to asses the security of systems, networks or applications within a clearly defined scope. It establishes boundaries, rules of engagement, and responsibilities, ensuring that testing activities are conducted safely, ethically and without disrupting business operations.</p><p>Ethical hacking is built upon three major ethical pillars:</p><p><strong>a. Permission</strong></p><p>Ethical hackers must obtain explicit permission from the owner of the target system, network, or application before conducting any security assessment. This permission defines the scope, limitations, and rules of engagement for the testing process.</p><p><strong>b. Legality</strong></p><p>All ethical hacking activities must comply with laws, regulations, and organizational policies. Unauthorized access to systems, even with good intentions, can be considered illegal and may result in legal consequences.</p><p><strong>c. Intent</strong></p><p>The primary purpose of ethical hacking is to improve cybersecurity by identifying and fixing vulnerabilities before malicious attackers can exploit them. Ethical hackers act with the intention of protecting systems, data, and users rather than causing damage or personal gain.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5b71271d3eeb" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Penetration Testing: A Theoretical Approach]]></title>
            <link>https://medium.com/@thingrinchhen/penetration-testing-a-theoretical-approach-c2094edf79ff?source=rss-eeacbe42bd6c------2</link>
            <guid isPermaLink="false">https://medium.com/p/c2094edf79ff</guid>
            <dc:creator><![CDATA[Rinchhen Thing]]></dc:creator>
            <pubDate>Sat, 14 Mar 2026 16:24:05 GMT</pubDate>
            <atom:updated>2026-03-14T16:24:05.022Z</atom:updated>
            <content:encoded><![CDATA[<p>Penetration testing refers to the security exercise that attempts to find and exploit vulnerabilities within a system. This is a simulated attack, performed under proper supervision, and by certified professionals, which is performed to identify weak spots in a system and its defense mechanisms that are exploitable. Rather than waiting for a breach to occur and reveal the vulnerabilities, organizations prefer a proactive simulation of real-world cyberattacks, and understand how one can break in and harden their system accordingly. Penetration testing is generally performed by ethical hackers. (sisainfosec)</p><p>Penetration testing methodologies are generally categorized into three categories:</p><h3>Black box Testing</h3><p>In a Black-box testing, the attack simulation doesn’t require the tester to have any prior knowledge of the system (like the source code, system architecture, or anything relevant to the developer of the system). The test typically begins with the tester having limited information, like a website URL , and performs reconnaissance to gather information relevant to the testing. If any weaknesses are found, the tester attempts to exploit them, and tries to escalate privileges to see how deep one can penetrate into the system. After the exploitation, the vulnerabilities are documented along with the exploitation report. Testers rely on techniques like fuzzing , password attacks, state transition testing, etc. during Black-box testing. This method of penetration testing is generally valued more, due to its provision of realistic and unbiased view of the vulnerable system towards external threats. But, this method is not as comprehensive as other methods of the tests, as testers are unknown, towards the source code or the system architecture. (Brown)</p><h3>Gray box Testing</h3><p>Gray box testing is a combined testing method of both Black box and White box testing. In this method, the tester has limited knowledge of the system like, use-level access, credentials, or partial information about the application’s architecture, but not the full access to the source code. This allows testers to simulate a realistic attack scenario while also using some internal insights to uncover vulnerabilities that might be missed in Black box tests. This test is considered as a balanced and practical approach as it is more efficient and cost-effective than full white box testing, while it still gives a deeper analysis than Black box test. This method is useful for complex applications, APIs and systems with multiple integrated components. The process typically involves identifying key system components, planning targeted tests, monitoring system responses to crafted inputs, documenting vulnerabilities, and working with development teams to fix and retest issues. (King)</p><h3>White box Testing</h3><p>White box testing requires the tester to have full access to and knowledge of the system and its structure, including source code, and logic. As testers can directly examine the code, this approach allows them to identify security vulnerabilities, bugs, and logic flaws, early in the software development phase. This method typically involves techniques like unit tests, static code analysis, mutation testing and coverage testing, to analyze how data flows through the application and how different parts of the code behave. These tests are often performed by developers or security testers. These tests can also be integrated into CI/CD as an approach to DevSecOps. While this method is best among all three methods, this method of penetration testing is more time-consuming, and expensive. (Tal)</p><p>Penetration testing follows a structured process designed to safely simulate cyberattacks and uncover vulnerabilities before real attackers can exploit them. A simple breakdown of the process is listed below.</p><h3>Planning and Scoping</h3><p>This phase of penetration testing is the initial and most critical phase, which defines the objectives, boundaries and rules of the security assessment. This phase requires client organization and tester to collaborate to determine the purpose of the test, the systems or applications to be tested, the testing methods, and the legal permissions required to perform the assessment. The scope specifies the assets like servers, networks, web applications, or APIs (included or excluded), and the planning establishes timelines, communication procedures, and risk management strategies. This phase also involves identifying potential constraints, defining success criteria, and ensuring compliance with organizational policies and legal regulations. Proper planning and scoping help prevent unintended disruptions to business operations, protect sensitive systems from accidental damage, and ensure that the penetration test is conducted in a controlled, ethical, and effective manner.</p><ol><li>Framework : Although a framework is not exactly a tool, defining one is an important part of the planning and scoping phase of penetration testing. A framework helps penetration testers decide the methodology and approach they will follow during the assessment. Using well-known frameworks such as PTES (Penetration Testing Execution Standard), NIST SP 800–115, or the OWASP Testing Guide helps ensure that the testing follows industry best practices. These frameworks provide clear guidelines for defining objectives, setting the scope, and planning the different stages of the penetration test. This makes the testing process more organized, consistent, and effective.</li><li>Legal agreement document : A legal agreement document, often called a Rules of Engagement (RoE) or authorization letter, is also an important part of the planning and scoping phase. Even though it is not a technical tool, it helps clearly define the boundaries and permissions of the penetration test. This document usually states which systems will be tested, the testing timeframe, the allowed techniques, and any limitations the testers must follow. It also provides official permission for penetration testers to perform simulated attacks on the organization’s systems. Having this agreement helps protect both the organization and the testers from legal issues or misunderstandings during the later stages of the penetration test.</li></ol><h3>Reconnaissance</h3><p>Reconnaissance is the phase of penetration testing where testers gather information about the target system, network, or organization to understand its infrastructure, technologies, and possible entry points before attempting any exploits. This includes passive reconnaissance , which includes collection of data without directly interacting with the target using public sources like websites, search engines, or social media (also known as (Open source Intelligence) OSINT ), and active reconnaissance , which involves directly probing the target to identify open ports, services, and configurations. Tools like Nmap, Recon-ng, Maltego, Shodan, and the Metasploit Framework are commonly used in this phase. Reconnaissance is crucial because the information gathered helps testers identify potential vulnerabilities and plan the most effective approach for the later stages of penetration testing. (“Reconnaissance In Penetration Testing — Everything You Need To Know”)</p><p>Maltego CE is an OSINT and data mining tool that visualizes relationships between people, organizations, domains, and other entities. It collects information from multiple sources and presents it as interconnected graphs, making hidden connections easier to analyze. Security researchers use it to map digital footprints and uncover links that may not be obvious through manual investigation. Its customizability allows targeted investigations tailored to specific security objectives.</p><p>Google remains one of the most effective tools for manual reconnaissance. Penetration testers use advanced search techniques to uncover publicly available information about organizations, employees, and systems. Google searches can reveal leaked documents, exposed directories, login pages, and other sensitive data. Manual recon with search engines complements automated tools by uncovering details that automated scanners may overlook.</p><p>Shodan is a search engine for discovering internet-connected devices and exposed services. It provides real-time intelligence about servers, IoT devices, routers, and industrial systems. Security professionals use Shodan to identify vulnerable devices and misconfigurations that may expose sensitive network data. Its ability to integrate with tools like Nmap and Metasploit enhances its utility for comprehensive reconnaissance.</p><p>Spiderfoot is an automated reconnaissance tool that queries over 100 public data sources to gather intelligence on IP addresses, domains, emails, and usernames. It can integrate with vulnerability scanners to expand its analysis. By enabling different modules based on the information needed, testers can map an organization’s digital footprint efficiently. Spiderfoot is widely used in offensive security operations to identify potential attack vectors.</p><p>Aquatone and Datasploit are OSINT tools used for reconnaissance and intelligence gathering. Aquatone focuses on identifying active web services and capturing screenshots, while Datasploit aggregates data from domains, emails, phone numbers, and usernames into consolidated reports. Together, these tools provide security researchers with a detailed view of the target’s digital presence, helping to plan further testing.</p><p>Nmap is a widely used network scanning tool that identifies live hosts, open ports, running services, and operating systems on a network. Its service fingerprinting capability can detect specific software versions, and it can also analyze firewall rules and network filters. Penetration testers rely on Nmap to map networks, gather intelligence, and prepare for exploitation phases of testing.</p><h3>Scanning and Enumeration</h3><p>Enumeration and scanning are critical steps in penetration testing that help identify vulnerabilities within a network or system before attackers can exploit them. Enumeration involves gathering detailed information such as usernames, machine names, network resources, and services, using techniques like analyzing email IDs, default passwords, SNMP queries, Active Directory brute forcing, and DNS zone transfers. Scanning, particularly port scanning, allows testers to discover active services, open ports, and system configurations using methods like ARP scans, TCP SYN scans, FIN scans, and UDP scanning, often automated with tools like Nmap, Angry IP Scanner, UnicornScan, and AutoScan. Fingerprinting complements these processes by identifying operating systems and software versions through active or passive analysis, enabling testers to target vulnerabilities more precisely. Together, these methods form the foundation for vulnerability assessment and mapping, helping organizations proactively secure their infrastructure and reduce the risk of data breaches. (Shakeel)</p><p>Nmap is one of the most widely used open‑source tools for network discovery and security auditing. It helps penetration testers identify live hosts, open ports, running services, and operating systems on a target network. Nmap supports various scanning techniques such as TCP SYN scans, UDP scans, version detection, and OS fingerprinting. It is commonly used during the scanning phase to map the network and detect potential vulnerabilities.</p><p>Wireshark is a powerful packet analyzer used to capture and analyze network traffic in real time. During passive reconnaissance, security professionals use it to monitor packets and identify hosts, protocols, and potential vulnerabilities in the network. It provides detailed information about packet contents, making it useful for troubleshooting and security analysis. Wireshark is widely used for deep packet inspection and network forensics.</p><p>Netcat is a versatile networking tool often called the “Swiss Army knife” of networking. It can read and write data across network connections using TCP or UDP protocols. Penetration testers commonly use Netcat for banner grabbing to identify service versions running on open ports. It is also useful for debugging network services and creating simple connections between systems.</p><p>OpenVAS is an open‑source vulnerability scanning platform used to detect security weaknesses in systems and networks. It performs automated scans to identify outdated software, misconfigurations, and known vulnerabilities. Security teams use OpenVAS during the vulnerability assessment stage of penetration testing. The tool generates detailed reports that help administrators prioritize and fix security issues.</p><p>Nikto is an open‑source web server scanning tool that detects vulnerabilities, outdated software, and dangerous files on web servers. It checks for common misconfigurations and security issues that attackers might exploit. Penetration testers use Nikto to perform quick assessments of web server security. The tool provides detailed results that help identify potential risks in web applications.</p><p>(dti-techs.gitbook)</p><h3>Exploitation</h3><p>Exploitation is a critical phase of penetration testing in which the tester attempts to use discovered vulnerabilities to gain unauthorized access to a system, network, or application. The purpose of exploitation is not to damage the system but to demonstrate how an attacker could take advantage of security weaknesses and what impact it could have on the organization. During this phase, penetration testers may perform attacks such as SQL injection, cross‑site scripting (XSS), brute‑force password attacks, buffer overflow, or privilege escalation to access sensitive data or gain system control. The results help organizations understand the seriousness of their vulnerabilities and allow security teams to implement proper fixes and strengthen their security defenses. (“Exploitation in Penetration Testing”)</p><p>Metasploit Framework is one of the most widely used tools in the exploitation phase of penetration testing. It provides a large collection of exploits, payloads, and modules that help security testers take advantage of vulnerabilities in systems, networks, and applications. Penetration testers use it to simulate real cyberattacks, gain access to target systems, and evaluate the effectiveness of security controls.</p><p>SQLmap is an automated tool designed to detect and exploit SQL injection vulnerabilities in web applications. It can extract database information such as tables, user credentials, and stored data from vulnerable systems. Security professionals use SQLmap during web application penetration testing to demonstrate how attackers could gain unauthorized access to sensitive information.</p><p>Hydra is a fast and powerful password‑cracking tool used to perform brute‑force attacks against login services. It supports many protocols such as SSH, FTP, HTTP, and RDP, allowing testers to check whether systems use weak passwords. By attempting multiple password combinations quickly, Hydra helps identify authentication weaknesses in target systems.</p><p>Burp Suite is a popular tool used to identify and exploit vulnerabilities in web applications. It acts as a proxy between the browser and the web server, allowing testers to intercept and modify requests and responses. Penetration testers use it to perform attacks such as SQL injection, cross‑site scripting (XSS), and session manipulation to evaluate web application security.</p><h3>Post-Exploitation</h3><p>Post‑exploitation is the phjse in penetration testing that happens after the tester gains initial access to a system. In this phase, the tester tries to understand the actual impact of the attack by checking how an attacker could maintain access, increase their privileges, move to other systems in the network, and access sensitive data. The main goal is to see how far an attacker could go inside the system and what important resources could be affected. During this stage, testers may create persistent access, collect credentials, access shared files or databases, and analyze internal systems. The results help organizations understand the security risks and provide recommendations to improve their security and prevent future attacks. (Khan)</p><p>Here are a few tools used in post‑exploitation , each written as one point with a short paragraph :</p><h3>Reporting and Analysis</h3><p>A penetration test, or pen test, is a vital cybersecurity exercise that helps organizations identify vulnerabilities in their networks, applications, and security controls. However, its true value comes from analyzing the report to understand findings and take action. Penetration test reports typically include an executive summary, scope, methodology, findings with risk ratings, and remediation recommendations. By reviewing these sections, organizations can prioritize critical vulnerabilities, assign responsibilities to IT, development, and security teams, implement fixes such as patching systems, strengthening authentication, and updating network rules, and conduct follow-up testing to confirm remediation. Incorporating insights from penetration tests into an ongoing security strategy-including regular testing, continuous monitoring, and employee awareness-ensures organizations proactively reduce risks, strengthen defenses, and maintain resilience against evolving cyber threats. (mainnerve)</p><p>Penetration testing is an important practice that helps organizations find and fix security vulnerabilities before attackers can exploit them. By simulating real-world cyberattacks in a controlled and ethical way, penetration tests give insights into a system’s defenses and reveal weaknesses that might not be noticed through normal development or standard security checks. Using different testing approaches-Black box, Gray box, and White box-lets organizations evaluate their systems from different angles, balancing realism, depth, and cost. Following the structured phases of penetration testing, from planning and reconnaissance to exploitation, post-exploitation, and reporting, ensures that vulnerabilities are not only found but also carefully analyzed and addressed. Overall, including penetration testing in a cybersecurity strategy helps strengthen defenses, guides effective remediation, and protects the integrity, confidentiality, and availability of critical systems and data.</p><p><em>Originally published at </em><a href="https://thingmanrt.blogspot.com/2026/03/penetration-testing-theoretical-approach.html"><em>https://thingmanrt.blogspot.com</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c2094edf79ff" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>