<?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 Ashani Fonseka on Medium]]></title>
        <description><![CDATA[Stories by Ashani Fonseka on Medium]]></description>
        <link>https://medium.com/@afashani?source=rss-1fa5b69db7fd------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*BTqXPh1jdkEA-9WdAKzp7Q.jpeg</url>
            <title>Stories by Ashani Fonseka on Medium</title>
            <link>https://medium.com/@afashani?source=rss-1fa5b69db7fd------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 07:19:40 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@afashani/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[Enterprise CI Pipeline Architecture: Running Jenkins in Docker with Agent-Based Builds]]></title>
            <link>https://afashani.medium.com/enterprise-ci-pipeline-architecture-running-jenkins-in-docker-with-agent-based-builds-a5955d8a8098?source=rss-1fa5b69db7fd------2</link>
            <guid isPermaLink="false">https://medium.com/p/a5955d8a8098</guid>
            <category><![CDATA[ci-cd-pipeline]]></category>
            <category><![CDATA[jenkins]]></category>
            <category><![CDATA[jenkinsfile]]></category>
            <category><![CDATA[devsecops]]></category>
            <category><![CDATA[docker]]></category>
            <dc:creator><![CDATA[Ashani Fonseka]]></dc:creator>
            <pubDate>Thu, 05 Feb 2026 06:12:26 GMT</pubDate>
            <atom:updated>2026-02-05T09:47:12.460Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uPAwz0Xml2zGilmSjXZFLg.jpeg" /></figure><p>In this article, I walk through setting up an <strong>enterprise-grade CI pipeline</strong> using <strong>Jenkins running inside Docker</strong>, integrated with GitHub and a Java/Maven application.<br>This setup mirrors real-world DevSecOps environments where Jenkins controllers are containerized and workloads are offloaded to agents.</p><h4>Prerequisites</h4><ul><li>Linux host</li><li>Docker installed</li><li>Java 17</li><li>Maven</li><li>Git &amp; GitHub access</li><li>SSH enabled on agent node</li></ul><h4>1. Pull Jenkins Docker Image</h4><pre>docker pull jenkins/jenkins:lts</pre><h4>2. Prepare Jenkins Persistent Storage</h4><pre>mkdir -p $HOME/jenkins_home<br>sudo chown -R 1000:1000 $HOME/jenkins_home<br>sudo chmod -R 700 $HOME/jenkins_home</pre><h4>3: Run Jenkins in Docker</h4><pre>docker run -d \<br>  --name jenkins \<br>  -p 9090:8080 \<br>  -p 50001:50000 \<br>  -v $HOME/jenkins_home:/var/jenkins_home \<br>  jenkins/jenkins:lts</pre><p>Jenkins UI → http://&lt;server-ip&gt;:9090</p><h4>4. Login to Jenkins</h4><pre>sudo cat jenkins_home/secrets/initialAdminPassword</pre><p>Paste the password into the UI and install github and ssh plugins.</p><h4>5. Jenkins Configuration</h4><p>Navigate to <strong>Manage Jenkins → Tools</strong></p><p><strong>JDK</strong></p><ul><li>Name: jdk</li><li>JAVA_HOME: /usr/lib/jvm/java-17-openjdk-amd64</li></ul><p><strong>Maven</strong></p><ul><li>Name: mvn</li><li>MAVEN_HOME: /usr/share/maven</li></ul><p><strong>Git</strong></p><ul><li>Name: git</li><li>Path to Git executable: /usr/bin/git</li></ul><p>Navigate to <strong>Manage Jenkins → System → Jenkins Location</strong></p><ul><li>Jenkins URL: &lt;your jenkins url&gt;</li><li>Path to Git executable: /usr/bin/git</li></ul><h4>6. Docker &amp; User Permissions</h4><p>Add Jenkins users to Docker group for build operations.</p><pre>sudo usermod -aG docker sec<br>sudo usermod -aG docker jenkins</pre><h4>6. Configure Java &amp; Maven on Agent</h4><pre>export JAVA_HOME=/usr/lib/jvm/java-17-openjdk-amd64<br>export MAVEN_HOME=/usr/share/maven<br>export PATH=$JAVA_HOME/bin:$MAVEN_HOME/bin:$PATH</pre><h4>7. Configure Jenkins Agent (SSH)</h4><pre>sudo useradd -m jenkins<br>sudo mkdir -p /home/jenkins/agent<br>sudo chown -R jenkins:jenkins /home/jenkins<br>sudo apt install openssh-server -y<br>sudo systemctl enable ssh<br>sudo systemctl start ssh</pre><h4>8. Create Jenkins Pipeline</h4><p><strong>Jenkins → New Item</strong></p><ul><li>Name: &lt;enter a valid name&gt;</li><li>Item type: Pipeline</li><li>Then save the item.</li><li>Configure <strong>→</strong> General</li><li>Select GitHub project and enter the project URL.</li><li>Pipeline type: <strong>Pipeline script from SCM</strong> → Git → GitHub repo URL</li><li>Script Path: Jenkinsfile</li></ul><pre>pipeline {<br>    agent { label &#39;linux&#39; }<br><br>    tools {<br>        jdk &#39;jdk&#39;<br>        maven &#39;mvn&#39;<br>    }<br><br>    stages {<br>        stage(&#39;Checkout&#39;) {<br>            steps {<br>              checkout scm<br>            }<br>        }<br><br>        stage(&#39;Build&#39;) {<br>            steps {<br>                dir(&#39;devsecops-demo&#39;){<br>                        sh &#39;mvn clean install&#39;<br>                }<br>            }<br>        }<br><br>        stage(&#39;Test&#39;) {<br>            steps {<br>                dir(&#39;devsecops-demo&#39;){<br>                sh &#39;mvn test&#39;<br>                    }<br>                }<br>        }<br>    }<br><br>    post {<br>        success {<br>            echo &quot;Build Successful&quot;<br>        }<br>        failure {<br>            echo &quot;Build Failed&quot;<br>        }<br>    }<br>}</pre><ul><li>Then save it.</li></ul><h4>9. Create Maven Application</h4><pre>mvn archetype:generate \<br>  -DarchetypeGroupId=org.apache.maven.archetypes \<br>  -DarchetypeArtifactId=maven-archetype-quickstart \<br>  -DarchetypeVersion=1.4 \<br>  -DgroupId=com.xfusioncorp \<br>  -DartifactId=devsecops-demo \ <br>  -Dpackage=com.xfusioncorp.demo \<br>  -DinteractiveMode=false</pre><h4>10. Push Code to GitHub</h4><pre>git add .<br>git commit -m &quot;Initial Maven app&quot;<br>git push origin main</pre><h4>11. Run &amp; Build</h4><p>You should see BUILD SUCCESS in the console output.</p><p>This project demonstrates how a modern enterprise CI pipeline is designed, not just assembled. By running Jenkins inside Docker, integrating it with GitHub, and offloading workloads to dedicated agents, we establish a scalable and production-ready foundation that reflects real-world DevSecOps environments.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a5955d8a8098" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Detecting Secrets and Misconfigurations in a CI/CD Pipeline]]></title>
            <link>https://afashani.medium.com/detecting-secrets-and-misconfigurations-in-a-ci-cd-pipeline-4b3bea59192c?source=rss-1fa5b69db7fd------2</link>
            <guid isPermaLink="false">https://medium.com/p/4b3bea59192c</guid>
            <category><![CDATA[devsecops]]></category>
            <category><![CDATA[devsecops-solutions]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[gitleaks]]></category>
            <dc:creator><![CDATA[Ashani Fonseka]]></dc:creator>
            <pubDate>Tue, 30 Dec 2025 09:49:12 GMT</pubDate>
            <atom:updated>2025-12-30T09:49:12.538Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WQ4w_MihzEmyNxbK11ZzMA.png" /></figure><p>Modern CI/CD pipelines move fast, but speed often comes at the cost of security. This blog explores how secrets and infrastructure misconfigurations can silently slip into production, and demonstrates a practical DevSecOps approach to detecting them early by integrating automated security checks directly into the CI/CD pipeline.</p><h4><strong>Why This Project Matters</strong></h4><p>Hardcoded secrets (API keys, passwords, license keys) and misconfigurations (like running containers as root) are high-risk. Detecting them early in CI/CD pipelines prevents leaks, privilege escalation, and compliance violations.</p><h4><strong>Project goal</strong></h4><p>Build a pipeline that:</p><ul><li>Detects <strong>hardcoded secrets</strong></li><li>Detects <strong>misconfigurations</strong></li><li>Fails builds <strong>before merge</strong></li></ul><h4><strong>Project Overview</strong></h4><p>Here is the pipeline flow:</p><pre>Code Push → Tests → SAST → Secret Scan → Config Scan → Results</pre><h4><strong>Tools Used</strong></h4><ul><li>Gitleaks → secrets detection</li><li>Trivy (config mode) → misconfiguration scanning</li><li>GitHub Actions</li><li>Pytest</li><li>Flake8</li><li>Docker</li></ul><h3><strong>Secret Detection</strong></h3><p>Started with a simple Python application and added a fake secret (on purpose).</p><pre># app.py<br><br>a = 15<br>b = 12<br><br>LICENSE_KEY =  “KHIksurnks8254380_hsdjcisd.JISDBRL”<br><br>res = a + b<br>print(res)</pre><p>Add Gitleaks to GitHub Actions.</p><pre># .github/workflows/security.yml<br>- name: Run Gitleaks<br>  uses: gitleaks/gitleaks-action@v2</pre><p>The pipeline failed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*D_x7Tf1ap1mjztkoqEXzBQ.png" /></figure><h4>Remediation</h4><p>The first step after detecting secrets is to <strong>fix the code</strong>. This is the essence of “shift-left security”, addressing issues as early as possible in the development lifecycle.</p><pre># app.py<br><br>import os<br><br>a = 15<br>b = 12<br><br>LICENSE_KEY = os.getenv(&quot;LICENSE_KEY&quot;)<br><br>res = a + b<br>print(res)</pre><p>By moving secrets to environment variables, we eliminate sensitive data from the codebase.</p><p>Create a .env file and include the license key and add it to .gitignore. Then push the code again and see the results.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*mynQ_QFiJx34DWRwY1dkMw.png" /></figure><h3>Misconfiguration detection</h3><p>Create Dockerfile.</p><pre># Dockerfile<br>FROM python:3.10<br>USER root</pre><p>The pipeline included a <strong>Trivy FS scan.</strong></p><pre># .github/workflows/security.yml<br><br>- name: Trivy Config Scan<br>  uses: aquasecurity/trivy-action@0.33.1<br>  with:<br>    scan-type: fs<br>    scan-ref: .<br>    scanners: misconfig,secret<br>    exit-code: 1</pre><p>Here’s the results.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*e0dmdFZ-IFoF_-ri6uWeDg.png" /></figure><h4>Remediation</h4><p>Switch from <strong>USER root</strong> to a non-root user.</p><pre># Dockerfile<br>FROM python:3.10<br>USER 1000:1000</pre><blockquote>Note: Trivy severity was limited to HIGH and CRITICAL to prevent workflow failure from LOW-severity findings such as the missing Docker HEALTHCHECK.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*LW09QNiJ2SAejiKV8d6_2Q.png" /></figure><h3>Final Outcome</h3><p>Through this project, the CI/CD pipeline was successfully enhanced to <strong>detect, block, and remediate security risks early in the development lifecycle</strong>. Secrets embedded in code were identified using <strong>Gitleaks</strong>, while container misconfigurations and filesystem-level issues were detected using <strong>Trivy</strong>. After applying proper remediation, externalizing secrets, fixing Docker misconfigurations, and tuning severity thresholds, the pipeline completed successfully with <strong>all security checks passing</strong>.</p><h3>Key Learnings</h3><ul><li>Secrets must never be hardcoded; environment variables and secret managers are the correct approach.</li><li>Gitleaks and Trivy solve different problems and are most effective when used together.</li><li>Security tools only work as intended when configured correctly (supported file types, scan modes, severity thresholds).</li><li>Not all findings should block deployments, severity-based enforcement is critical for developer velocity.</li><li>True DevSecOps is not about avoiding failures, but about detecting issues early and remediating them automatically.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4b3bea59192c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building a Simple DevSecOps Project: Securing a CI/CD Pipeline with Container Scanning]]></title>
            <link>https://afashani.medium.com/building-a-simple-devsecops-project-securing-a-ci-cd-pipeline-with-container-scanning-bca0512eee37?source=rss-1fa5b69db7fd------2</link>
            <guid isPermaLink="false">https://medium.com/p/bca0512eee37</guid>
            <dc:creator><![CDATA[Ashani Fonseka]]></dc:creator>
            <pubDate>Mon, 22 Dec 2025 10:05:29 GMT</pubDate>
            <atom:updated>2025-12-22T11:43:16.718Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MB-wGJeyRpgUW8ssQypr6w.png" /></figure><p>It became clear that understanding tools is not the same as understanding <strong>how security actually fits into a delivery pipeline</strong>. While tutorials often show scanners identifying vulnerabilities instantly, real-world systems are rarely that convenient.</p><p>This blog documents a simple, <strong>project-based DevSecOps journey </strong>in which a CI/CD pipeline was built and secured for a simple Python application, with a stronger focus on understanding <strong>how security validation actually works in practice</strong>.</p><h3>Project Goal</h3><p>The goal of this project was not to build a complex application, but to:</p><ul><li>Understand where security fits in CI/CD</li><li>Integrate automated security checks</li><li>Learn how container vulnerabilities are detected and remediated</li></ul><h3>Project Overview</h3><p>Here is the pipeline flow:</p><pre>Code Push → Tests → SAST → Docker Build → Trivy Scan → Results</pre><h3>Tools Used</h3><ul><li><strong>GitHub Actions</strong> — CI/CD orchestration</li><li><strong>Docker</strong> — Containerization</li><li><strong>Trivy</strong> — Container vulnerability scanning</li><li><strong>pytest</strong> — Unit testing</li><li><strong>flake8</strong> — Static code analysis (SAST)</li></ul><h3>Initial Setup</h3><p>Started with a simple Python application and created a Dockerfile using a modern base image.</p><pre># Dockerfile<br>FROM python:3.10-slim<br><br>WORKDIR /app<br>COPY requirements.txt .<br>RUN pip install -r requirements.txt<br>COPY app.py .<br><br>CMD [&quot;python&quot;, &quot;app.py&quot;]</pre><p>The pipeline ran successfully.</p><ul><li>Tests passed</li><li>SAST checks passed</li><li>Trivy scans completed <strong>with zero vulnerabilities</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iDG65qlPOsFCRs8qbq0Ztw.png" /></figure><blockquote>Key Learning #1: “No Vulnerabilities” Is Not a Failure</blockquote><h3>Validating Security Detection</h3><p>For a security project, it’s important to prove that detection works. So instead of forcing results, <strong>intentionally introduced controlled vulnerabilities</strong>.</p><h4>Changes Made</h4><ol><li>Used an older base image</li></ol><pre># Dockerfile<br>FROM python:3.8-slim<br><br>WORKDIR /app<br>COPY requirements.txt .<br>RUN pip install -r requirements.txt<br>COPY app.py .<br><br>CMD [&quot;python&quot;, &quot;app.py&quot;]</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/862/1*3FxT3Ok0hQeTPvYfgHKl3Q.png" /></figure><p>2. Added a vulnerable dependency</p><pre># requirements.txt<br>flake8<br>pytest<br>django==2.2</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AdLYAebztRgcX7kYuiHU7w.png" /></figure><p>3. Added a simple code lint for SAST failure</p><pre># app.py<br>def hello():<br>    return &quot;Hello DevSecOps!&quot;<br><br>if __name__ == &quot;__main__&quot;:<br>    print(hello())<br><br>def version():<br>    return &quot;v1.0&quot;<br><br>def greet(name):<br>    x=1<br>    return f&quot;Hello {name}, welcome to DevSecOps!&quot;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/662/1*bUDnaMy83f0L5kKQZf1Vmg.png" /></figure><blockquote>Key Learning #2: Not All Vulnerabilities Are Equal</blockquote><h3>Enforce a Security Gate</h3><p>To make this production-like, added a <strong>security gate</strong> to the pipeline. The CI build now,</p><ul><li><strong>Fails automatically</strong> if HIGH or CRITICAL vulnerabilities are detected</li><li>Prevents insecure images from moving forward in the pipeline</li></ul><pre># pipeline.yml <br>- name: Trivy Image Scan<br>        uses: aquasecurity/trivy-action@0.33.1<br>        with:<br>          image-ref: devsecops-simple<br>          severity: HIGH,CRITICAL<br>          exit-code: 1</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1007/1*J4uSvGbU3a8W8BG60ecJvw.png" /></figure><p>This transformed the project from a “scan demo” into a <strong>real DevSecOps control</strong>.</p><h3>Remidiation</h3><p>Security is not just about detection. It’s about <strong>reducing risk</strong>.</p><ol><li>Upgraded Django to a secure LTS version.</li></ol><pre># requirements.txt<br>flake8<br>pytest<br>django==4.2.27</pre><p>2. Replaced base image to a latest one.</p><pre># Dockerfile <br>FROM python:3.10-slim <br><br>WORKDIR /app<br>COPY requirements.txt .<br>RUN pip install -r requirements.txt<br>COPY app.py .<br><br>CMD [&quot;python&quot;, &quot;app.py&quot;]</pre><p>After rebuilding and re-scanning the image, Trivy reported no vulnerabilities.</p><h3>Final Outcome</h3><p>Through this project,you can learn how to</p><ul><li>Integrate security tools into CI/CD pipelines</li><li>Understand why scans sometimes return zero findings</li><li>Validate detection using controlled vulnerabilities</li><li>Remediate risks at both OS and application layers</li><li>Enforce security gates to prevent insecure builds</li></ul><p><strong>This</strong> <strong>is not about finding vulnerabilities. It’s about building systems that prevent them from reaching production</strong>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bca0512eee37" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Most Essential Tool in Application Development- APIs]]></title>
            <link>https://afashani.medium.com/the-most-essential-tool-in-application-development-apis-fa7e9dd94eed?source=rss-1fa5b69db7fd------2</link>
            <guid isPermaLink="false">https://medium.com/p/fa7e9dd94eed</guid>
            <category><![CDATA[tools]]></category>
            <category><![CDATA[application-programming]]></category>
            <category><![CDATA[what]]></category>
            <category><![CDATA[application-development]]></category>
            <category><![CDATA[api]]></category>
            <dc:creator><![CDATA[Ashani Fonseka]]></dc:creator>
            <pubDate>Mon, 30 Aug 2021 08:16:14 GMT</pubDate>
            <atom:updated>2021-08-30T08:16:14.770Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7fLK9rAPqW8-dKofjGEcDA.jpeg" /></figure><p>When you hang around developers, you might have heard the term API. What are those exactly? Why were they created? Why APIs exist and what are the benefits of APIs? Let’s go through a non-IT related and simple example to have a rough idea about an API.</p><p>Recall the way you deposit money in your bank account. There’s a certain procedure you have to follow inside the bank. You fill out a slip, hand over that with your NIC, passbook, and the amount of money you need to deposit to the relevant bank officer and you wait. You have no idea what’s happening behind the scenes once you handed over them. The system takes your inputs, go through its process and return your passbook to you. This is simply how an API works. The money depositing process in a bank is the system we want to communicate with and we can’t access the internals of that system. We can only communicate with the API layer which in this case is the relevant bank officer. This is known as an endpoint which just means that the bank officer is a point of contact for you to submit your inputs. With each endpoint, there is a protocol about which inputs are required and what result you’ll get in return. If you don’t supply the correct inputs, then your request will be rejected.</p><p>What is an API?</p><p>Technically, API stands for Application Programming Interface is an interface that defines interactions between multiple software applications or mixed hardware-software intermediaries. Simply it’s a set of protocols, procedures, and tools that allow interaction between two applications. It connects clients and servers by delivering a request of a client to the server and then relays a response back to the client. It is a way for different programs to work together in various ways.</p><p>Why APIs?</p><p>In the process of application development, APIs simplify programming by abstracting the underlying implementation and only exposing objects or actions the developers need. They can be used to get access to data from third parties. APIs hide complexity and perform tasks. Also, they can be used to extend functionalities and for security purposes to protect personal data. These features simplify system development, save time and money. As the APIs give the developers flexibility and speed the development process of software applications, they have become essential tools in developing a system. APIs allow different applications and services to exchange information.</p><p>Consider the weather app on your smartphone. We can search for the weather or temperature of any state in the world while we are staying at home. Google or Apple have not placed temperature sensors all over the world. These weather apps use the API of a third party to retrieve weather predictions. As an example, Apple is using The Weather Channel’s API. There are APIs to look up recipes, lyrics, information on barcodes, zip codes, available parking spaces, public holidays, and a lot more. Today, it’s hard to find a service that doesn’t include an API.</p><p>APIs can be used in many scenarios such as operating systems, libraries and frameworks, web-based systems, and database systems. APIs used in operating systems define how applications use the resources and services of OS. Every operating system has its own APIs, for instance, Linux API and Windows API. When an API describes the behavior of the system, libraries implement that behavior. The framework can be based on many libraries that implement different APIs whose behavior is built into the framework. Web APIs are the most common API use case. They can be accessed using the HTTP protocol and provide machine-readable data and functionality transfer between web-based systems which represent client-server architecture. The set of APIs which allow communication between an application and a database management system are Database APIs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*INyL8pK7ZuebCN9Np0D7bA.png" /></figure><p>There are three policies for releasing APIs. They are private, partner, and public. The APIs released under private release policies are for private internal use within the company. This type of APIs gives the company the most control over its APIs. The APIs released under partner release policies can be used by the company and its specific business partners who have signed an agreement with the published company. Software integration between two parties is a common use case for this type of APIs. Public APIs are available for any third-party developers, for instance, Microsoft Windows API, Apple’s Cocoa and Carbon APIs, etc. There are two types of public APIs as open and commercial. Open APIs can be used at no cost and without restrictive terms and conditions. When using commercial APIs, the developers need to pay subscription fees or choose APIs on a pay-as-you-go basis.</p><p>What is an API call?</p><p>The process which takes place when the user sent a request after setting up the API with the correct endpoints is called an API call. Whenever the user makes a call to a server using APIs counts as an API call.</p><p>API Protocols</p><p>The rules for API calls are defined by API protocols. There are four most common API architectures and protocols used in web APIs and also called web service APIs. They are, SOAP, XML-RPC, JSON-RPC, and REST.</p><p>SOAP or Simple Object Access Protocol uses XML as a format to transfer data and it defines the structure of the messages and methods of communication. XML-RPC, a Remote Procedural Call protocol also uses a specific XML format to transfer data compared to SOAP which uses a proprietary XML format. This protocol is simpler than SOAP and it uses minimum bandwidth. JSON-RPC is similar to XML-RPC but it uses JSON to transfer data. REST or Representational State Transfer is a very popular web API architecture that needs to have certain characteristics including client-server architecture, statelessness, cache ability, and layered system.</p><p>API or Application Programming Interface provides initial building blocks required when developing a program. Because of the benefits APIs supply, those have become a tool which the developers cannot work without as this is not concurred only for the software development but also for business collaboration.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fa7e9dd94eed" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What is the CIA Triad?]]></title>
            <link>https://afashani.medium.com/what-is-the-cia-triad-fcf655429114?source=rss-1fa5b69db7fd------2</link>
            <guid isPermaLink="false">https://medium.com/p/fcf655429114</guid>
            <dc:creator><![CDATA[Ashani Fonseka]]></dc:creator>
            <pubDate>Sat, 06 Feb 2021 20:47:59 GMT</pubDate>
            <atom:updated>2021-02-06T20:47:59.647Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*pY-q_x87Y8keS2646SuesA.png" /></figure><p>Have you heard the term “CIA Triad”? if you are interested in information security you may hear this term and you have to. This article will give a sound knowledge of CIA Triad and I hope this will be helpful for anyone interested in this part of the IT industry.</p><p>The CIA Triad is a security model that is designed to guide policies for information security within an organization to keep their sensitive data protected from unauthorized access and data theft. CIA stands for three different principles. They are <strong>Confidentiality</strong>, <strong>Integrity</strong>, and <strong>Availability</strong>. According to the NIST in USA Information Security is the protection of information systems from unauthorized activities to provide confidentiality, integrity, and availability.</p><h3><strong>Confidentiality</strong></h3><p>Simply it means privacy. The access to data and recourses must be restricted to only authorized parties. Confidentiality ensures data privacy by restricting access through authentication. There are some methods of ensuring confidentiality such as data encryption, username ID and password, two-factor authentication, access control lists and follows minimum exposure of sensitive information.</p><p>You may have noticed that there’s a label on the top of a conversation in WhatsApp.</p><blockquote>“Messages and calls are end-to-end encrypted. No one outside of this chat, not even WhatsApp, can read or listen to them.”</blockquote><p>What does this mean?</p><figure><img alt="WhatsApp end-to-end encryption" src="https://cdn-images-1.medium.com/max/624/1*_mDUc_65VO_s9dUO4qBOeA.png" /><figcaption>WhatsApp end-to-end encryption</figcaption></figure><p>The above figure describes what is happening. Only you and the receiver of your message are able to read your conversation. That means your privacy is ensured.</p><h3><strong>Integrity</strong></h3><p>Maintaining the accuracy, consistency, and trustworthiness of data during its entire life cycle is called integrity. The data must not be altered in transit and cannot be changed by unauthorized parties. That means if you send a message from your end, the receiver must receive the same message without any altering by unauthorized parties.</p><p>In here also there are some techniques used for data integrity verification. The common method is to use hash values. To prevent accidental changes by authorized users, Version control can be used and backups should be available to restore any corrupted data. The checksum method is used to verify the integrity of files or character strings after they’ve been transferred from one end to another over a network. The checksum is calculated with hash codes. Once data are converted into a hash value, the original data cannot be retrieved directly as hash functions are unique and use mathematical algorithms to transform data into hash values. And also hash values have a fixed length according to the type. Have a look at the below image.</p><figure><img alt="different hash values for “hello!” string calculated from hash calc" src="https://cdn-images-1.medium.com/max/624/1*WWAXmTRs8axmQ0hohbc3VA.png" /><figcaption>different hash values for “hello!” string</figcaption></figure><p>As you can see MD5, MD4, SHA1, PANAMA are some examples of hash functions.</p><h3><strong>Availability</strong></h3><p>The information and resources need to be available for the authorized parties. This includes maintaining devices, performing hardware repairs, keeping operating systems and software up to date, and creating backups. The organization’s continuity plans, disaster recovery, and redundancy are some best practices to be considered for availability.</p><p>This is the most critical point in information security. Because there is a possibility to be attacked on the network. Most of the time it will be a DoS (Denial of Service Attack) or DDoS attack (Distributed Denial of Service Attack). Therefore, the organizations need to have plans for a quick recovery against attacks and also natural disasters. Keeping load balancers, firewalls like security equipment are important in guard against downtime caused by that kind of attack.</p><figure><img alt="CIA Triad" src="https://cdn-images-1.medium.com/max/624/1*M1O_blruboYubisaN32izQ.png" /><figcaption>CIA Triad</figcaption></figure><p>CIA Triad is a guideline for information security for an organization. Confidentiality, Integrity, and Availability are the three main principles it consists of. CIA ensures your protection in Cyber World.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fcf655429114" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>