<?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 Shivansh Sharma on Medium]]></title>
        <description><![CDATA[Stories by Shivansh Sharma on Medium]]></description>
        <link>https://medium.com/@shivansh.sharma_8340?source=rss-a3f3fe120552------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*2YLBsSv6r89M_g6L</url>
            <title>Stories by Shivansh Sharma on Medium</title>
            <link>https://medium.com/@shivansh.sharma_8340?source=rss-a3f3fe120552------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 04:52:53 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@shivansh.sharma_8340/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[DevSecOps Definition, Best Practices and Tools]]></title>
            <link>https://medium.com/@shivansh.sharma_8340/devsecops-definition-best-practices-and-tools-50e08d948700?source=rss-a3f3fe120552------2</link>
            <guid isPermaLink="false">https://medium.com/p/50e08d948700</guid>
            <dc:creator><![CDATA[Shivansh Sharma]]></dc:creator>
            <pubDate>Tue, 21 May 2024 06:11:32 GMT</pubDate>
            <atom:updated>2024-05-21T06:11:32.843Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/950/1*HSn9Te-_9CL_Go8BDAXbSA.png" /></figure><p>Software security is improving. It’s just not improving fast enough, according to <a href="https://www.synopsys.com/software-integrity/resources/analyst-reports/state-of-devsecops.html?cmp=pr-sig&amp;utm_medium=referral">“Global State of DevSecOps 2023,”</a> a report based on a survey of 1,000 information technology professionals.</p><p>That’s significant, because software isn’t just <a href="https://www.wsj.com/articles/SB10001424053111903480904576512250915629460">eating the world,</a> as Mosaic creator and Netscape cofounder Marc Andreessen famously declared more than a decade ago. It’s running the world — energy, finance, communication, entertainment, recreation, healthcare, education, utilities, transportation, appliances, home security, agriculture, and more.</p><p>You might assume, given that reality, that the so-called software development life cycle (SDLC) would have evolved to the point where both quality and security are built in. That’s the expectation for everything else we depend on — nobody wants a house or car with locks that are easy to pick.</p><p>Don’t assume. The drive to embed security into the development and operations of software, otherwise known as DevSecOps, is progressing, but still isn’t mainstream. The survey, by the Synopsys Cybersecurity Research Center (CyRC), and Censuswide, an international market research consultancy, found that while “DevSecOps has gained significant traction in every organization involved with software development… [and] is now clearly seen as a business-critical practice and a risk management concern… security and development teams have found themselves at odds when trying to introduce security into their processes.” (Disclosure: I write for Synopsys)</p><p>Examples of DevSecOps best practices include:</p><p>• Automating security processes and integrating them into the DevOps pipeline</p><p>• Implementing security scanning tools to detect vulnerabilities</p><p>• Using container security solutions to secure containers</p><p>• Implementing Continuous Integration/Continuous Delivery (CI/CD)</p><p>• Setting up security policies and enforcing them throughout the organization</p><p>• Using software composition analysis to identify open source components</p><p>• Adopting secure coding practices</p><p>What are the principles of DevSecOps?</p><p>1. Automate All the Things: Automation is the cornerstone of successful DevSecOps. Automating routine tasks and processes helps to speed up the delivery process while enabling teams to focus on the more complex aspects of the development lifecycle.</p><p>2. Shift Security Left: Shifting security left is the process of integrating security practices earlier in the development process. This helps to reduce the risks associated with the production environment.</p><p>3. Continuous Integration and Continuous Delivery: Continuous integration (CI) and continuous delivery (CD) are important for DevSecOps. CI and CD ensure that code is tested, reviewed, and deployed quickly and consistently.</p><p>4. Collaboration and Communication: Collaboration and communication are key to successful DevSecOps. It’s important for teams to be able to share ideas, discuss challenges, and work together in order to ensure that security is properly implemented.</p><p>5. Measure and Monitor: Measuring and monitoring are essential for DevSecOps. Teams should measure and monitor their systems, processes, and performance in order to identify potential security issues and address them quickly.</p><p>What is the culture of DevSecOps?</p><p>The culture of DevSecOps is one that emphasizes collaboration and integration among development, security, and operations teams. It is rooted in the idea that security should not be an afterthought, and instead should be considered from the earliest stages of a project. It is a culture of shared responsibility, where all teams work together to ensure that security is properly addressed across all stages of the software development life cycle. At the core of DevSecOps is a focus on automation and continuous integration, which will ensure that security measures are implemented quickly and consistently.</p><p>What problems does DevSecOps solve?</p><p>1. Increased Security: DevSecOps provides organizations with a more secure software development process by incorporating security into every stage of the development process. This ensures that any security issues are identified and addressed much earlier in the development cycle, reducing the potential for costly security incidents.</p><p>2. Improved Efficiency: DevSecOps enables organizations to streamline their development processes by automating tasks and eliminating manual steps, resulting in faster and more reliable delivery of software.</p><p>3. Improved Collaboration: DevSecOps encourages collaboration between development and security teams, allowing developers and security professionals to work together to identify and address security issues. This leads to improved communication and collaboration, resulting in a more secure development process.</p><p>4. Increased Visibility: DevSecOps makes it easier to track and monitor security issues throughout the software development process. This provides organizations with greater visibility into the security of their applications and helps them identify potential risks much earlier in the development cycle.</p><p>Finally, there are a number of DevSecOps tools available to organizations looking to implement DevSecOps. These tools can help organizations automate the process of development, testing, deployment and maintenance of applications, while ensuring that security and compliance requirements are met.</p><p>Examples of DevSecOps tools include:</p><p>• Security scanning tools to detect vulnerabilities</p><p>• Container security solutions to secure containers</p><p>• CI/CD tools to streamline the development process</p><p>• Software composition analysis tools to identify open source components</p><p>• Secure coding tools to ensure code quality</p><p>• Security policy management tools to ensure that policies are enforced</p><h3><strong>What is DevSecOps methodology?</strong></h3><p>DevSecOps is a methodology that combines the principles of development (Dev), security (Sec), and operations (Ops) to create an integrated, automated process for delivering software with higher quality, speed, and reliability. It seeks to bridge the gap between development, security, and operations teams, by integrating the practices of each discipline into the software development process. DevSecOps aims to ensure that the development process is secure, efficient, and reliable. This is accomplished by establishing a culture of collaboration, automation, and continuous improvement across the organization. Additionally, DevSecOps emphasizes the importance of security, compliance, and resilience throughout the entire software development life cycle.</p><h3>Sand in the gears</h3><p>While there are multiple reasons for that conflict, they all boil down to a perception, sometimes justified, that has existed for decades — security testing slows down developers, on which the primary pressure is for speed.</p><p>Why that perception? According to the report, the conflict is “often a consequence of bringing legacy application security testing (AST) into the SDLC. Common complaints include AST tools’ complexity and high learning curves, slow performance, and ‘noisy’ results causing DevOps ‘friction’ — that is, anything in the software creation process that prevents developers from easily and quickly building code.”</p><p>But it doesn’t have to be that way. There are now proven ways to mitigate that conflict and build security into software at the speed of development. One major key is to replace those legacy AST tools that amount to sand in the gears of the SDLC and replace them with more automated tools.</p><p>Steven Zimmerman, DevOps security solutions manager with the Synopsys Software Integrity Group, noted in a recent interview that legacy tools don’t work as well in the modern SDLC. “Now we’ve got new software components, containers, infrastructure-as-code, templates, serverless functions, all of which present new attack vectors for cybercriminals,” he said. “So now we need to layer on the tests that help identify security risks within those.”</p><p>Automated tools still need human programming and supervision, but just as is the case on any modern factory floor, they can work much more tirelessly and accurately than any human.</p><p>The survey report cited eight advantages of automated testing.</p><ul><li>Consistency: Every build and deployment gets consistent security checks, unlike manual testing where procedures and coverage could vary.</li><li>Scalability: Automated tests can keep up with the growth in software complexity, unlike manual testing.</li><li>Continuous integration/continuous deployment: In a development environment with rapid and frequent code changes, automated tools can keep up and prevent defective code from reaching production.</li><li>Continuous improvement: Automated testing gives feedback to the humans in charge that helps them improve security practices.</li><li>Documentation: It’s easier to track and audit security measures and compliance.</li><li>Less human error: Automated testing tools don’t get tired, sick, or careless. They follow predefined scripts.</li><li>Time and cost savings: It costs more in time and money to fix security defects late in development or production. Automated testing minimizes that.</li><li>Improved developer experience: Automated tools offer proactive, integrated, and educational solutions to security concerns, making software development more secure and efficient.</li></ul><p>With those benefits available, what has been the impact on DevSecOps? According to the survey, they’re mixed. You could separate them into the good, the bad, and the AI.</p><h3>The good</h3><p>A clear sign of progress is that organizations are increasingly aware that modern automated tools can eliminate much of the frustration created by legacy testing tools. More than a third of respondents said the use of automated tools was key to their security program’s success. And more than 70% said automated scanning of code is a useful security measure, with 34% calling it “very useful.”</p><p>Another encouraging sign is the growing use of <a href="https://www.synopsys.com/glossary/what-is-application-security-orchestration-and-correlation.html?cmp=pr-sig&amp;utm_medium=referral">application security orchestration and correlation</a> (ASOC), now more commonly referred to as <a href="https://www.synopsys.com/glossary/what-is-application-security-posture-management.html?cmp=pr-sig&amp;utm_medium=referral">application security posture management</a> (ASPM).</p><p>According to the survey, “ASPM solutions continuously manage application risks through the detection, correlation, and prioritization of security issues from development to deployment.” Put another way, they help development teams do the right test at the right time, using “policy-as-code” to set priorities based on an organization’s business needs.</p><p>That’s good for both speed and the budget.</p><p>And that has led to an overwhelming majority (91%) saying they “incorporate some measure of DevSecOps activities into their software development pipelines.”</p><p>More evidence of progress is that a solid two-thirds of respondents ranked their security initiatives at Level 3 or higher on a scale of 5. That means they are training all DevSecOps team members in security best practices, delivering secure code through rigorous design and testing, and can detect and remediate vulnerabilities quickly if any get through.</p><p>Finally, nearly 70% said an assessment tool like the <a href="https://www.bsimm.com/download.html?intcmp=sig-blog-bsimm13%3Fcmp%3Dpr-sig&amp;utm_medium=referral">Building Security in Maturity Model</a> (BSIMM) was helpful in measuring their security programs. The annual BSIMM report, now in its 13th iteration, documents how more than 120 anonymized organizations in eight industry sectors are improving their software security. The BSIMM doesn’t dictate exactly what organizations should do — it just documents what their industry peers are doing, including what works and what doesn’t.</p><h3>The bad</h3><p>The flip side of results showing that two-thirds of organizations are at Level 3 in DevSecOps maturity is that a third still aren’t. There are multiple reasons for that including, as noted previously, legacy testing tools that don’t align with an organization’s business needs. For an SDLC to function effectively, developers need to know what defects are critical, so they don’t waste time fixing those that are trivial.</p><p>Another factor cited by respondents is a shortage of cybersecurity talent. The latest estimates are that there are 3.5 million unfilled cybersecurity jobs around the world.</p><p>A third is the time it takes to patch critical vulnerabilities in deployed applications. According to the survey, 28% said it can take up to three weeks, and another 20% said it can take up to a month. That doesn’t come close to mitigating threats from those vulnerabilities, since more than half of them are exploited within a week of exposure.</p><p>In summary, as the survey report noted, “fragmented results from security tools, overloaded teams, and slow vulnerability resolution represent fundamental challenges to successful DevSecOps.”</p><h3>And the AI</h3><p>The release of OpenAI’s ChatGPT a year ago made the promise and peril of artificial intelligence (AI) the hottest cybersecurity topic of 2023. AI almost immediately started having an impact on software development — the survey found that 52.5% of respondents are actively using AI tools, and another 36.5% are open to using it.</p><p>They expect it to improve the efficiency and accuracy of their security measures and reduce manual review of security testing. But they also expect AI to “increase the complexity and technical requirements of software security.”</p><p>The perils of AI go well beyond that, however. As has been extensively reported, this is a technology that is not yet mature. Using it to write code can make the process much faster but also risky.</p><p>Last year, GitHub, Microsoft, and OpenAI were the targets of a <a href="https://storage.courtlistener.com/recap/gov.uscourts.cand.403220/gov.uscourts.cand.403220.1.0.pdf">lawsuit</a> involving GitHub Copilot, an AI tool that offers developers autocomplete suggestions as they code. According to the complaint, Copilot suggested code without noting that it required attribution, copyright notice, or adherence to the original licensing terms, making it an example of “a brave new world of software piracy.”</p><p>AI chatbots are also known for “hallucinations” — false responses served up with the same confidence as correct ones. That means an attacker could create a software package with the same name as a hallucinatory package and fill it with malware.</p><p>And according to the report, “That threat isn’t theoretical; it’s real and happening right now.”</p><p>***</p><p>All of which leads to what the report terms “lessons learned.” Based on the responses from cybersecurity practitioners, the ways to make DevSecOps an asset rather than a hurdle include</p><ul><li>Create cross-functional teams. Nearly a third of respondents reported that “a collaborative group from development, security, and operations was an important factor in a security program’s success.” Zimmerman noted that because of the dev, sec, and ops roles in the SDLC, “we have to make sure each team knows when there’s risks, and then when those risks have been resolved.”</li><li>Combine manual and automated testing. According to the report, “As important as automated testing is for consistency, scalability, and time and cost-savings, the human factor adds a layer of insight and adaptability essential for identifying complex and subtle security issues.” The BSIMM report has noted that more than 88% of participating organizations use external penetration testers to supplement their security activities because those ethical hackers can uncover defects that internal testing tools might have missed.</li><li>Use tools that work. If testing tools don’t serve the priorities and needs of an organization, it should get better ones rather than have its developers ignore the lousy ones. It’s also important to know that no one tool does it all. DevSecOps requires a full application security testing toolset that includes <a href="https://www.synopsys.com/software-integrity/security-testing/static-analysis-sast.html?cmp=pr-sig&amp;utm_medium=referral">static</a>, <a href="https://www.synopsys.com/software-integrity/security-testing/dast.html?cmp=pr-sig&amp;utm_medium=referral">dynamic</a>, and <a href="https://www.synopsys.com/software-integrity/security-testing/interactive-application-security-testing.html?cmp=pr-sig&amp;utm_medium=referral">interactive</a> security testing along with <a href="https://www.synopsys.com/software-integrity/security-testing/software-composition-analysis.html?cmp=pr-sig&amp;utm_medium=referral">software composition analysis</a>, which helps find any known vulnerabilities and potential licensing conflicts in open source software components.</li><li>Set priorities. Developers can’t fix every vulnerability in code, nor should they. Some defects are trivial, especially if they are in software that will never be on the public internet. So, as the report puts it, “organizations need to prioritize their efforts based on <a href="https://nvd.nist.gov/vuln-metrics/cvss">Common Vulnerability Scoring System</a> (CVSS) scores and <a href="https://cve.mitre.org/">Common Weakness Enumeration</a>(CWE) information. CVSS scores are an industry standard for assessing the severity of a vulnerability while a CWE tells developers which weakness could be exploited if an exploit is available.</li><li>Consider an ASPM tool. As noted earlier, an <a href="https://www.synopsys.com/glossary/what-is-application-security-posture-management.html?cmp=pr-sig&amp;utm_medium=referral">application security posture management</a> tool can be configured to reflect the risk priorities of each individual organization. As the report puts it, “By correlating and grouping data from different tools analyzing specific applications and vulnerabilities, ASPM can deliver a comprehensive view of the application’s overall security stance.”</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=50e08d948700" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Unleashing the Power of Terraform: A Comprehensive Guide]]></title>
            <link>https://medium.com/@shivansh.sharma_8340/unleashing-the-power-of-terraform-a-comprehensive-guide-6c8c432dd53f?source=rss-a3f3fe120552------2</link>
            <guid isPermaLink="false">https://medium.com/p/6c8c432dd53f</guid>
            <dc:creator><![CDATA[Shivansh Sharma]]></dc:creator>
            <pubDate>Thu, 04 Apr 2024 04:39:03 GMT</pubDate>
            <atom:updated>2024-04-04T04:39:03.908Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/647/1*PZjF7BEI3c0NTve3ognp-w.png" /></figure><h3>What is Terraform?</h3><p>Terraform is an infrastructure as code tool that lets you build, change, and version cloud and on-prem resources safely and efficiently.</p><p>HashiCorp Terraform is an infrastructure as code tool that lets you define both cloud and on-prem resources in human-readable configuration files that you can version, reuse, and share. You can then use a consistent workflow to provision and manage all of your infrastructure throughout its lifecycle. Terraform can manage low-level components like compute, storage, and networking resources, as well as high-level components like DNS entries and SaaS features.</p><h3>How does Terraform work?</h3><p>Terraform creates and manages resources on cloud platforms and other services through their application programming interfaces (APIs). Providers enable Terraform to work with virtually any platform or service with an accessible API.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/650/1*0-R5Q2hewGFYE4CKVxfiVQ.png" /></figure><p>HashiCorp and the Terraform community have already written thousands of providers to manage many different types of resources and services. You can find all publicly available providers on the <a href="https://registry.terraform.io/">Terraform Registry</a>, including Amazon Web Services (AWS), Azure, Google Cloud Platform (GCP), Kubernetes, Helm, GitHub, Splunk, DataDog, and many more.</p><p>The core Terraform workflow consists of three stages:</p><ul><li><strong>Write:</strong> You define resources, which may be across multiple cloud providers and services. For example, you might create a configuration to deploy an application on virtual machines in a Virtual Private Cloud (VPC) network with security groups and a load balancer.</li><li><strong>Plan:</strong> Terraform creates an execution plan describing the infrastructure it will create, update, or destroy based on the existing infrastructure and your configuration.</li><li><strong>Apply:</strong> On approval, Terraform performs the proposed operations in the correct order, respecting any resource dependencies. For example, if you update the properties of a VPC and change the number of virtual machines in that VPC, Terraform will recreate the VPC before scaling the virtual machines.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/625/1*h5Rn7342lPne8Tpfm45VgA.png" /></figure><h3>Key Features and Benefits</h3><ol><li>Infrastructure as Code (IaC): Terraform treats infrastructure as code, enabling versioning, code reuse, and collaboration through familiar development practices such as Git repositories and continuous integration/continuous deployment (CI/CD) pipelines.</li><li>Multi-Cloud Support: Terraform supports multiple cloud providers, including AWS, Azure, Google Cloud Platform, and more. This allows users to manage heterogeneous cloud environments seamlessly, avoiding vendor lock-in and enabling multi-cloud strategies.</li><li>Resource Graph: Terraform builds a dependency graph of infrastructure resources, enabling it to determine the order in which resources should be provisioned or updated. This ensures that changes are applied in a safe and efficient manner, with minimal downtime.</li><li>Immutable Infrastructure: Terraform promotes the concept of immutable infrastructure, where infrastructure components are treated as disposable and replaced rather than modified in place. This approach enhances reliability, scalability, and security by minimizing configuration drift and ensuring consistency across environments.</li><li>Modularity and Reusability: Terraform configurations are modular and composable, allowing users to define reusable modules for common infrastructure patterns. This promotes code reuse, simplifies maintenance, and accelerates development by abstracting complexity and promoting best practices.</li></ol><h3>Practical Applications</h3><ol><li>Infrastructure Provisioning: Terraform excels at provisioning infrastructure resources such as virtual machines, networks, databases, and storage. Whether you’re setting up a development environment, deploying a web application, or scaling a production workload, Terraform provides a unified workflow for infrastructure provisioning across cloud providers.</li><li>Continuous Integration and Deployment (CI/CD): Terraform integrates seamlessly with CI/CD pipelines, enabling automated infrastructure deployment as part of the software delivery process. By codifying infrastructure changes and automating deployment workflows, organizations can achieve greater agility, consistency, and reliability in their software delivery lifecycle.</li><li>Infrastructure Orchestration: Terraform enables infrastructure orchestration by defining complex relationships and dependencies between resources. Whether you’re building a distributed system, configuring a Kubernetes cluster, or implementing a microservices architecture, Terraform provides the tools to orchestrate infrastructure at scale.</li><li>Compliance as Code: Terraform can be used to enforce compliance policies and security best practices through codified infrastructure configurations. By defining security groups, access controls, and encryption settings as code, organizations can ensure that their infrastructure meets regulatory requirements and security standards.</li></ol><h3>About the Terraform Language</h3><p>The main purpose of the Terraform language is declaring <a href="https://developer.hashicorp.com/terraform/language/resources">resources</a>, which represent infrastructure objects. All other language features exist only to make the definition of resources more flexible and convenient.</p><p>A <em>Terraform configuration</em> is a complete document in the Terraform language that tells Terraform how to manage a given collection of infrastructure. A configuration can consist of multiple files and directories.</p><p>The syntax of the Terraform language consists of only a few basic elements:</p><p>The main purpose of the Terraform language is declaring <a href="https://developer.hashicorp.com/terraform/language/resources">resources</a>, which represent infrastructure objects. All other language features exist only to make the definition of resources more flexible and convenient.</p><p>A <em>Terraform configuration</em> is a complete document in the Terraform language that tells Terraform how to manage a given collection of infrastructure. A configuration can consist of multiple files and directories.</p><p>The syntax of the Terraform language consists of only a few basic elements:</p><pre>resource &quot;aws_vpc&quot; &quot;main&quot; {<br> cidr_block = var.base_cidr_block<br>}<br>&lt;BLOCK TYPE&gt; &quot;&lt;BLOCK LABEL&gt;&quot; &quot;&lt;BLOCK LABEL&gt;&quot; {<br> # Block body<br> &lt;IDENTIFIER&gt; = &lt;EXPRESSION&gt; # Argument<br>}<br></pre><ul><li><em>Blocks</em> are containers for other content and usually represent the configuration of some kind of object, like a resource. Blocks have a <em>block type,</em> can have zero or more <em>labels,</em> and have a <em>body</em> that contains any number of arguments and nested blocks. Most of Terraform’s features are controlled by top-level blocks in a configuration file.</li><li><em>Arguments</em> assign a value to a name. They appear within blocks.</li><li><em>Expressions</em> represent a value, either literally or by referencing and combining other values. They appear as values for arguments, or within other expressions.</li></ul><p>The Terraform language is declarative, describing an intended goal rather than the steps to reach that goal. The ordering of blocks and the files they are organized into are generally not significant; Terraform only considers implicit and explicit relationships between resources when determining an order of operations.</p><h3>Example</h3><p>The following example describes a simple network topology for Amazon Web Services, just to give a sense of the overall structure and syntax of the Terraform language. Similar configurations can be created for other virtual network services, using resource types defined by other providers, and a practical network configuration will often contain additional elements not shown here.</p><pre>terraform {<br>  required_providers {<br>    aws = {<br>      source  = &quot;hashicorp/aws&quot;<br>      version = &quot;~&gt; 1.0.4&quot;<br>    }<br>  }<br>}<br><br>variable &quot;aws_region&quot; {}<br><br>variable &quot;base_cidr_block&quot; {<br>  description = &quot;A /16 CIDR range definition, such as 10.1.0.0/16, that the VPC will use&quot;<br>  default = &quot;10.1.0.0/16&quot;<br>}<br><br>variable &quot;availability_zones&quot; {<br>  description = &quot;A list of availability zones in which to create subnets&quot;<br>  type = list(string)<br>}<br><br>provider &quot;aws&quot; {<br>  region = var.aws_region<br>}<br><br>resource &quot;aws_vpc&quot; &quot;main&quot; {<br>  # Referencing the base_cidr_block variable allows the network address<br>  # to be changed without modifying the configuration.<br>  cidr_block = var.base_cidr_block<br>}<br><br>resource &quot;aws_subnet&quot; &quot;az&quot; {<br>  # Create one subnet for each given availability zone.<br>  count = length(var.availability_zones)<br><br>  # For each subnet, use one of the specified availability zones.<br>  availability_zone = var.availability_zones[count.index]<br><br>  # By referencing the aws_vpc.main object, Terraform knows that the subnet<br>  # must be created only after the VPC is created.<br>  vpc_id = aws_vpc.main.id<br><br>  # Built-in functions and operators can be used for simple transformations of<br>  # values, such as computing a subnet address. Here we create a /20 prefix for<br>  # each subnet, using consecutive addresses for each availability zone,<br>  # such as 10.1.16.0/20 .<br>  cidr_block = cidrsubnet(aws_vpc.main.cidr_block, 4, count.index+1)<br>}</pre><h3><strong>Conclusion</strong></h3><p><em>Terraform represents a paradigm shift in the way infrastructure is managed and provisioned, offering a powerful combination of simplicity, flexibility, and scalability. By treating infrastructure as code, Terraform enables organizations to automate and streamline their infrastructure operations, reducing manual overhead, minimizing errors, and accelerating time-to-market. Whether you’re a seasoned DevOps engineer or a novice developer, Terraform provides the tools and workflows to take your infrastructure to the next level. So why wait? Dive into the world of Terraform and unlock the full potential of infrastructure as code.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6c8c432dd53f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Understanding the Jenkins Architecture]]></title>
            <link>https://medium.com/@shivansh.sharma_8340/understanding-the-jenkins-architecture-e1c7b2a294d7?source=rss-a3f3fe120552------2</link>
            <guid isPermaLink="false">https://medium.com/p/e1c7b2a294d7</guid>
            <dc:creator><![CDATA[Shivansh Sharma]]></dc:creator>
            <pubDate>Wed, 20 Mar 2024 16:28:02 GMT</pubDate>
            <atom:updated>2024-03-20T16:48:04.968Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1012/0*LFY9ENLgDPSC-kzz.png" /></figure><h3>What is Jenkins?</h3><p>Before diving into its architecture, let’s briefly recap what Jenkins is and what it’s used for. Jenkins is a CI/CD tool primarily used by software development teams to automate various aspects of the software delivery process. It allows developers to integrate changes to a project in a shared repository continuously, triggering automated builds and tests. This automation significantly reduces the time and effort required to identify and fix bugs, ultimately leading to faster and more reliable software delivery.</p><h3>Why Jenkins?</h3><p>Jenkins is one of the <a href="https://www.simplilearn.com/tutorials/devops-tutorial/devops-tools">top DevOps tools</a> because it is free, open-source and modular, and can integrate with pretty much every other DevOps tool out there. There are over a thousand plugins that you can use to extend Jenkins’ capabilities and make it more user-specific. All of these plugins and extensions are developed in <a href="https://www.simplilearn.com/best-java-programs-article">Java.</a> This means that Jenkins can also be installed on any operating system that runs on Java.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*aXCeGTY2oVNOT1xW.png" /></figure><h3>Jenkins History</h3><p>Kohsuke Kawaguchi first developed <a href="https://en.wikipedia.org/wiki/Jenkins_(software)">Hudson</a> in 2004 while working at Sun Microsystems. When Oracle acquired Sun Microsystems in 2010, there was a dispute between Oracle and the Hudson community with respect to the infrastructure used. There was a call for votes to change the project name from Hudson to Jenkins, which was overwhelmingly approved by the Hudson community on January 29, 2011, thereby creating the first “Jenkins” project.</p><h3>Jenkins Architecture</h3><p>Here’s how Jenkins elements are put together and interact:</p><ul><li>Developers commit changes to the source code, found in the repository.</li><li>The Jenkins CI server checks the repository at regular intervals and pulls any newly available code.</li><li>The Build Server builds the code into an executable file. In case the build fails, feedback is sent to the developers.</li><li>Jenkins deploys the build application to the test server. If the test fails, the developers are alerted.</li><li>If the code is error-free, the tested application is deployed on the production server.</li></ul><p>The files can contain different code and be very large, requiring multiple builds. However, a single Jenkins server cannot handle multiple files and builds simultaneously; for that, a distributed Jenkins architecture is necessary.</p><p>Now you can understand the Master-Slave architecture in this What is Jenkins article.</p><h3>Jenkins Master-Slave Architecture</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/786/0*XV0ZMAaP88HnZeZf.jpg" /></figure><h4>1. Master-Slave Architecture:</h4><p>At the heart of Jenkins architecture lies the master-slave setup. The Jenkins master serves as the central control point, responsible for scheduling build jobs, monitoring nodes (slaves), and distributing tasks to them. On the other hand, slave nodes are responsible for executing the build jobs assigned by the master. This distributed architecture allows for scalability and efficient resource utilization.</p><h4>2. Jenkins Master:</h4><ul><li>Core Functionality: The Jenkins master coordinates the entire build process. It manages the web-based GUI for configuring jobs, plugins, and users.</li><li>Job Execution: Upon receiving a request to build a project, the master identifies an appropriate slave node and delegates the task.</li><li>Plugins: Jenkins master can be extended with numerous plugins, enabling integration with various tools and technologies.</li><li>Persistence: It stores configuration details, build histories, and other critical data.</li></ul><h4>3. Jenkins Slave Nodes:</h4><ul><li>Job Execution: Slave nodes are responsible for executing build jobs assigned by the master.</li><li>Platform Diversity: Multiple slave nodes can be configured with different operating systems and environments, allowing for parallel and platform-specific builds.</li><li>Scalability: Jenkins allows scaling by adding or removing slave nodes based on workload demands.</li><li>Security: Slave nodes are typically configured to only accept connections from the Jenkins master, ensuring secure communication.</li></ul><h4>4. Executors:</h4><p>Executors represent the execution runtime for Jenkins jobs. Each slave node can have multiple executors, allowing concurrent execution of multiple jobs on the same node.</p><h4>5. Build Jobs:</h4><p>Build jobs are the core units of work in Jenkins. They define the tasks to be performed, such as compiling code, running tests, and deploying artifacts. Jobs can be configured with various parameters, triggers, and build steps.</p><h4>6. Plugins:</h4><p>Plugins extend Jenkins functionality, enabling integration with version control systems, build tools, testing frameworks, deployment platforms, and more. They allow users to customize and automate their CI/CD pipelines according to their specific requirements.</p><h3>What are the Jenkins Features?</h3><p>Jenkins offers many attractive features for developers:</p><p>Jenkins is a powerful open-source automation server with a rich set of features that enable continuous integration (CI) and continuous delivery (CD) practices. Below are some of the key features that make Jenkins indispensable for automating software development pipelines:</p><h3>1. Continuous Integration (CI):</h3><ul><li>Automated Builds: Jenkins automates the process of building software projects from source code repositories, eliminating manual intervention and reducing the risk of errors.</li><li>Source Control Integration: Jenkins seamlessly integrates with various version control systems such as Git, Subversion, Mercurial, and CVS, enabling automatic triggering of builds upon code commits.</li><li>Parallel Execution: Jenkins supports parallel execution of build jobs across multiple nodes, allowing faster feedback cycles and efficient resource utilization.</li><li>Scheduled Builds: Users can schedule builds at regular intervals or specific times, ensuring continuous integration even in the absence of code changes.</li></ul><h3>2. Continuous Delivery and Deployment (CD):</h3><ul><li>Automated Testing: Jenkins facilitates the integration of automated testing frameworks such as JUnit, Selenium, and Cucumber, enabling comprehensive testing of applications as part of the CI/CD pipeline.</li><li>Artifact Management: Jenkins manages and archives build artifacts, such as compiled binaries, documentation, and test reports, ensuring traceability and reproducibility of builds.</li><li>Deployment Automation: Jenkins integrates with deployment tools and platforms such as Docker, Kubernetes, AWS, and Azure, allowing seamless deployment of applications to various environments, including development, staging, and production.</li><li>Rollback Support: Jenkins enables rollback mechanisms, allowing teams to revert to previous versions of applications in case of deployment failures or issues.</li></ul><h3>3. Extensibility and Customization:</h3><ul><li>Plugin Ecosystem: Jenkins boasts a vast ecosystem of plugins that extend its functionality to integrate with a wide range of tools and technologies. Plugins cover areas such as source control, build tools, testing frameworks, deployment platforms, and notification systems.</li><li>Scripting Support: Jenkins pipelines, defined as code, allow users to define complex build and deployment workflows using Groovy-based scripting syntax. This enables flexibility and customization to meet specific project requirements.</li><li>APIs and Integrations: Jenkins provides RESTful APIs and webhooks for integration with external systems, enabling automation and orchestration of CI/CD processes within larger ecosystems.</li></ul><h3>4. Distributed Architecture:</h3><ul><li>Master-Slave Setup: Jenkins supports a master-slave architecture, allowing distributed execution of build jobs across multiple nodes. This architecture enhances scalability, improves performance, and facilitates parallel execution of builds on different environments.</li><li>Cloud Integration: Jenkins seamlessly integrates with cloud platforms such as AWS, Azure, and Google Cloud, enabling dynamic provisioning of build agents and resources based on demand.</li></ul><h3>5. Monitoring and Reporting:</h3><ul><li>Build Status Monitoring: Jenkins provides real-time visibility into the status of build jobs, including success, failure, and in-progress builds, through its web-based dashboard.</li><li>Comprehensive Reports: Jenkins generates comprehensive reports on build outcomes, test results, code coverage, and trends over time, aiding in performance analysis and continuous improvement.</li><li>Custom Dashboards: Users can create custom dashboards and views in Jenkins to monitor specific projects, teams, or pipelines, providing tailored insights into the CI/CD process.</li></ul><h3>6. Security and Access Control:</h3><ul><li>Role-Based Access Control (RBAC): Jenkins supports RBAC mechanisms, allowing administrators to define granular access control policies based on user roles and permissions.</li><li>Credentials Management: Jenkins provides secure storage and management of credentials, enabling integration with external systems and ensuring sensitive information such as API tokens and passwords are handled securely.</li><li>Audit Trails: Jenkins logs all user actions and system events, facilitating audit trails and compliance with regulatory requirements.</li></ul><h3>How Jenkins Master and Slave Architecture works?</h3><p>Now let us look at an example in which we use Jenkins for testing in different environments like Ubuntu, MAC, Windows, etc.</p><p>The diagram below represents the same:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*-kkGh2jZzl-bsJRq.png" /></figure><p>The above image represents the following functions:</p><ul><li>Jenkins checks the Git repository at periodic intervals for any changes made in the source code.</li><li>Each builds requires a different testing environment which is not possible for a single Jenkins server. In order to perform testing in different environments, Jenkins uses various Slaves as shown in the diagram.</li><li>Jenkins Master requests these Slaves to perform testing and to generate test reports.</li></ul><h3>How to setup Jenkins Master and Slaves?</h3><ol><li>Go to the Manage Jenkins section and scroll down to the section of Manage Nodes.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/267/0*IbYCPTB1jPD-9UI-.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/528/0*ZqlRysriypVLd9DO.png" /></figure><p>2. Click on New Node</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/699/1*SP7eDrZqa-O8zHUDKTQdBQ.png" /></figure><p><strong>3. </strong>Give a name for the node, choose the Permanent Agent option, and click on Ok.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*UciL3oX-LyMCmyGO.png" /></figure><p><strong>4. </strong>Enter the details of the node slave machine. Here <strong>no. of executors</strong> in nothing but no. of jobs that this slave can run parallelly. Here we have kept it to 2. The<strong> Labels</strong> for which the name is entered as “Slave1” is what can be used to configure jobs to use this slave machine. Select <strong>Usage</strong> to Use this node as much as possible. For the l<strong>aunch method,</strong> we select the option of “Launch agent by connecting it to the master”. If this option is not visible then go to J<strong>enkins home page -&gt; Manage Jenkins -&gt; Configure Global Security</strong>. Here in the Agents section <strong>click on Random</strong> and Save it. Now you will find the required option. Enter<strong> Custom WorkDir path</strong> as the workspace of your slave node. In <strong>Availability</strong> select “Keep this agent online as much as possible”.Click on <strong>Save</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*gSnPMLxsvofqqFgs.png" /></figure><p>Once you complete the above steps, the new node machine will initially be in an offline state but will come online if all the settings in the previous screen were entered correctly. One can at any time make the node slave machine offline if required.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/692/1*bGdcA_HjqEg_AT16cP1RIg.png" /></figure><p>5. Now since your slave is up and running, let’s execute a job on the slave. For that, I already have an existing job and I will run this job on this slave. Open this job and click on configure. Now here in the General section, click on “Restrict where this project can be run”. Here in Label Expression, enter the name of the slave and save it. Now click on Build now and see the output of this job. Everything is correct you will see the output as Success.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*9G90yU2yuEt1OFZ6.png" /></figure><h3>Conclusion:</h3><p><em>Jenkins is a versatile automation server that offers a wide array of features to support continuous integration, continuous delivery, and DevOps practices. Its extensibility, flexibility, and robustness make it the preferred choice for automating software development pipelines across diverse industries and use cases. By leveraging Jenkins features, teams can accelerate software delivery, improve code quality, and foster collaboration within their development processes.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e1c7b2a294d7" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>