<?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 xinacod on Medium]]></title>
        <description><![CDATA[Stories by xinacod on Medium]]></description>
        <link>https://medium.com/@xenacod?source=rss-1bfc7fac37a4------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*rdaPYomZLzSPNNf7x7IUZg.png</url>
            <title>Stories by xinacod on Medium</title>
            <link>https://medium.com/@xenacod?source=rss-1bfc7fac37a4------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 01 Dec 2026 23:20:23 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@xenacod/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[Facebook Declares War on… Linux?! Social Media Giant Flags Open-Source as “Cybersecurity Threat”]]></title>
            <link>https://medium.com/@xenacod/facebook-declares-war-on-linux-social-media-giant-flags-open-source-as-cybersecurity-threat-55060ae9aa4f?source=rss-1bfc7fac37a4------2</link>
            <guid isPermaLink="false">https://medium.com/p/55060ae9aa4f</guid>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[facebook]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[ai]]></category>
            <dc:creator><![CDATA[xinacod]]></dc:creator>
            <pubDate>Wed, 29 Jan 2025 09:30:44 GMT</pubDate>
            <atom:updated>2025-01-29T09:30:44.019Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/895/1*Qg5LtqZ8IkGQE3mr1qPwVw.png" /></figure><p><strong>Are you a Linux user? Prepare for Facebook’s latest bizarre move: they’re labeling open-source operating systems as a “cybersecurity threat,” and the results are chaotic.</strong></p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2F2Hn3djsWvnY%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D2Hn3djsWvnY&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2F2Hn3djsWvnY%2Fhqdefault.jpg&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/953bf14d3fbf482977474bb4baa12e3a/href">https://medium.com/media/953bf14d3fbf482977474bb4baa12e3a/href</a></iframe><p>In a move that has the tech world scratching its head, <strong>Facebook appears to have blacklisted all things Linux.</strong> Yes, you read that right. According to reports, the social media behemoth is flagging posts that mention Linux, related websites, and discussion groups, even going so far as to lock or limit accounts of users sharing such content.</p><p><strong>DistroWatch: Ground Zero of the Ban</strong></p><p>DistroWatch, a major hub for Linux news and discussions, was one of the first to notice the ban, stating: “Facebook’s internal policy makers decided that Linux is malware and labeled groups associated with Linux as being ‘cybersecurity threats.’” The site further claims that on January 19th, they were barred from posting any blurb about their website, distrowatch.com, on Facebook, citing vague Community Standards violations.</p><p><strong>Lockdowns and Silent Treatment: Users Revolt</strong></p><p>It’s not just DistroWatch facing the ban hammer. Users are reporting that <strong>their Facebook accounts have been locked or limited</strong> after sharing posts discussing Linux topics. This has sparked outrage in the tech community, which is questioning Facebook’s motives and its understanding of the very infrastructure it relies on.</p><p><strong>The Irony Is Real</strong></p><p>The irony is truly thick. <strong>Facebook, a company whose entire infrastructure runs largely on Linux, is labeling Linux users as a cybersecurity risk?</strong> As DistroWatch aptly points out, “Facebook runs much of its infrastructure on Linux and often posts job ads looking for Linux developers.” It’s like a car company suddenly declaring that cars are dangerous.</p><p><strong>Facebook’s Track Record: A History of “Mistakes”</strong></p><p>Of course, this isn’t Facebook’s first misstep. Some have called the platform complicit in everything from election interference to fueling genocide, and it recently decided to get rid of its fact-checking team. Now, they’re adding “illogically banning Linux” to the list.</p><p><strong>Is this a Mistake? Or a Calculated Move?</strong></p><p>While some are hoping this is a temporary blunder caused by an overzealous algorithm (perhaps an AI gone rogue?), the fact that a Facebook representative told DistroWatch that “Linux topics would remain on the cybersecurity filter” indicates this might be a more calculated move.</p><p><strong>Join the Discussion!</strong></p><p>Have you experienced this bizarre censorship? What do you think is happening? Share your comments below and let your voice be heard. <strong>Is Facebook’s latest move a sign of incompetence, or something more sinister?</strong> Is this another example of a tech giant out of touch with its user base?</p><p><strong>Share this article and let’s expose this ridiculous ban!</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=55060ae9aa4f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building AI-Powered Applications on AWS: A Practical Guide (Part 2)]]></title>
            <link>https://blog.devops.dev/building-ai-powered-applications-on-aws-a-practical-guide-part-2-68ae7e346e78?source=rss-1bfc7fac37a4------2</link>
            <guid isPermaLink="false">https://medium.com/p/68ae7e346e78</guid>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[life]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[xinacod]]></dc:creator>
            <pubDate>Sun, 26 Jan 2025 20:17:31 GMT</pubDate>
            <atom:updated>2025-02-06T18:06:43.230Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xgi87miXy2q9lE3_TM7vOw.png" /></figure><blockquote><strong>Introduction:</strong></blockquote><p>In Part 1, we laid the groundwork by exploring Amazon SageMaker and Amazon Rekognition. We trained a model and analyzed images. In Part 2, we will delve into more advanced use cases, and deploy our model using SageMaker and integrate our AI model with our application.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2F6cg5ERPQ2v8%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D6cg5ERPQ2v8&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2F6cg5ERPQ2v8%2Fhqdefault.jpg&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/fac52ffde6f57dfcc14872f9c1f80ef1/href">https://medium.com/media/fac52ffde6f57dfcc14872f9c1f80ef1/href</a></iframe><blockquote><strong>Deploying a Trained Model with Amazon SageMaker</strong></blockquote><p>Now that we have trained a model, we can deploy it as a real-time inference endpoint using SageMaker. This allows other applications to make requests to our model to get predictions.</p><blockquote><strong>Deploying the Model to a SageMaker Endpoint:</strong></blockquote><ul><li><strong>Uploading the model to S3:</strong> You’ll need to store the saved model file from part 1 (iris_model.pkl) in s3.</li></ul><blockquote><strong>Creating a Model:</strong></blockquote><ul><li>Go to the SageMaker console, select “Models” and then “Create model.”</li><li>Provide a model name, select the S3 location of the saved model.</li><li>Specify the appropriate inference container (e.g., a pre-built scikit-learn container).</li><li>Define the execution role that provides SageMaker the required permissions.</li></ul><blockquote><strong>Creating an Endpoint Configuration:</strong></blockquote><ul><li>Under Endpoints, create a new endpoint configuration by providing the name of endpoint config and setting the instance type for your endpoint instance.</li></ul><blockquote><strong>Creating the Endpoint:</strong></blockquote><ul><li>Finally, create an endpoint by choosing your endpoint configuration to deploy your model.</li><li><strong>Real time Inference via boto3</strong> The following code can be used to call the endpoint that you just deployed:</li></ul><pre>#Example python code to call SageMaker endpoint<br>import boto3<br>import json<br>import pandas as pd<br><br>def invoke_endpoint(endpoint_name, data):<br>    runtime_client = boto3.client(&#39;runtime.sagemaker&#39;)<br>    <br>    try:<br>        payload = data.to_json(orient=&#39;split&#39;, index=False).encode(&#39;utf-8&#39;)<br>        response = runtime_client.invoke_endpoint(<br>            EndpointName=endpoint_name,<br>            ContentType=&#39;application/json&#39;,<br>            Body=payload<br>        )<br>        result = json.loads(response[&#39;Body&#39;].read().decode())<br>        return result<br>    except Exception as e:<br>       print(f&quot;ERROR: {e}&quot;)<br>       return None<br><br>if __name__ == &#39;__main__&#39;:<br>    ENDPOINT_NAME = &quot;your-sagemaker-endpoint-name&quot; # replace with your endpoint name<br>    data_input = pd.DataFrame({<br>        &#39;sepal_length&#39;: [5.1, 7.9],<br>        &#39;sepal_width&#39;:  [3.5, 3.8],<br>        &#39;petal_length&#39;: [1.4, 6.4],<br>        &#39;petal_width&#39;:  [0.2, 2.0]<br>    })<br><br>    result = invoke_endpoint(ENDPOINT_NAME, data_input)<br>    if result:<br>      print(f&quot;Predictions are: {result}&quot;)</pre><p><strong>Key Points</strong></p><ul><li>The deployed endpoint is used for real-time inference.</li><li>We can test our endpoint with sample test data in pandas dataframe format.</li><li>The result of inference will be sent back as a JSON payload.</li></ul><p><strong>2. Integrating AI into a Simple Web Application</strong></p><ul><li><strong>Using Flask/Django for the backend:</strong> create a web server with flask/django to expose an API.</li><li><strong>Connecting with SageMaker:</strong> Within the API endpoint, write the necessary code to connect to the SageMaker endpoint we just created, to perform model inference.</li><li><strong>Front end for interacting with your application:</strong> create a basic front end html page, that calls the API endpoint of the python server.</li></ul><p><strong>Key Points</strong></p><ul><li>This step demonstrates a basic end to end implementation for connecting AI model with an application.</li><li>The web application needs to have the appropriate IAM permissions to connect to SageMaker endpoint.</li></ul><p><strong>3. Custom Model Building</strong></p><p>We can also leverage SageMaker to build our own custom deep learning models using frameworks such as pytorch, tensorflow, etc., then deploy it as above.</p><p><strong>Summary:</strong></p><p>In Part 2, we’ve learned how to deploy a machine learning model using SageMaker, and integrate with a very basic web server, and make real-time inference. We also briefly covered building and deploying custom deep learning models. This gives you a solid understanding of building and deploying AI based solutions using AWS.</p><blockquote><strong>Next Steps</strong></blockquote><ul><li>Explore various other model deployment techniques on AWS.</li><li>Deep dive into various deep learning frameworks, and utilize SageMaker to create complex AI models.</li><li>Explore various services for scaling and managing AI models.</li></ul><blockquote><strong>Note:</strong></blockquote><ul><li>Remember to replace placeholder values (e.g., region names, S3 bucket URLs, endpoint names, and model names) with your actual values.</li><li>Ensure that your AWS credentials are properly configured before running the code.</li><li>The SageMaker endpoint and other services need an IAM role with appropriate permissions.</li><li>This example demonstrates some advanced usage and requires some proficiency with AWS services and machine learning concepts to be used effectively.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=68ae7e346e78" width="1" height="1" alt=""><hr><p><a href="https://blog.devops.dev/building-ai-powered-applications-on-aws-a-practical-guide-part-2-68ae7e346e78">Building AI-Powered Applications on AWS: A Practical Guide (Part 2)</a> was originally published in <a href="https://blog.devops.dev/">DevOps.dev</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building AI-Powered Applications on AWS: A Practical Guide (Part 1)]]></title>
            <link>https://blog.devops.dev/building-ai-powered-applications-on-aws-a-practical-guide-part-1-f265ebac1471?source=rss-1bfc7fac37a4------2</link>
            <guid isPermaLink="false">https://medium.com/p/f265ebac1471</guid>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[coding]]></category>
            <dc:creator><![CDATA[xinacod]]></dc:creator>
            <pubDate>Tue, 21 Jan 2025 10:45:49 GMT</pubDate>
            <atom:updated>2025-01-24T19:45:14.442Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SiEp3F-NMB_0HgvZEI7AuA.png" /></figure><p><strong>Introduction:</strong></p><p>Welcome to a fascinating exploration of Artificial Intelligence on AWS! In this two-part series, we’ll dive into the world of integrating AWS’s robust infrastructure with cutting-edge AI and Machine Learning services. In Part 1, we will build the foundation for creating AI applications by introducing key AWS AI services like Amazon SageMaker and Amazon Rekognition. We will explore how to set up the necessary infrastructure and resources to develop and deploy your own AI-powered applications. If you are someone interested in leveraging cloud capabilities to enhance your application with intelligent features, then you are in the right place. Let’s embark on this exciting journey and unlock the power of AI on AWS!</p><p><strong>Introduction to Amazon SageMaker: Your AI Development Hub</strong></p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FQv_Tr_BCFCQ%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DQv_Tr_BCFCQ&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FQv_Tr_BCFCQ%2Fhqdefault.jpg&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/1535811270b7fd2403a543a6f8b934ed/href">https://medium.com/media/1535811270b7fd2403a543a6f8b934ed/href</a></iframe><p>Amazon SageMaker is a fully managed service that provides tools and infrastructure to build, train, and deploy machine learning models. It simplifies the complex process of machine learning, allowing you to focus on building intelligent applications.</p><blockquote><strong>Setting up SageMaker Studio:</strong></blockquote><ul><li><strong>What is SageMaker Studio?</strong> SageMaker Studio provides a web-based Integrated Development Environment (IDE) for ML tasks.</li><li><strong>Getting Started:</strong> Log in to the AWS Management Console and navigate to SageMaker. Create a SageMaker Studio Domain using the Quick start option.</li></ul><blockquote><strong>Creating a SageMaker Notebook:</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*T0g-YV1r7zYaxcdwiUxGAg.png" /></figure><blockquote><strong>Launch SageMaker Studio.</strong></blockquote><ul><li>Create a new Jupyter notebook instance to write python code within this IDE.</li><li>Choose an appropriate instance type to support your machine learning work.</li><li>Install and import python libraries as required by your project, such as <em>boto3, pandas, scikit-learn, matplotlib.</em></li></ul><blockquote><strong>Basic Example: Training a Simple Classification Model</strong></blockquote><p>Let’s use a basic example to showcase the use of SageMaker. We’ll use a classic dataset (like the Iris dataset) to train a simple classification model using scikit-learn, within SageMaker Notebook instance.</p><pre># Example Python Code within SageMaker Notebook<br><br>import pandas as pd<br>from sklearn.model_selection import train_test_split<br>from sklearn.linear_model import LogisticRegression<br>from sklearn.metrics import accuracy_score<br>import joblib<br><br><br># Load the Iris dataset<br>iris = pd.read_csv(&quot;https://raw.githubusercontent.com/mwaskom/seaborn-data/master/iris.csv&quot;)<br>print(iris.head())<br><br># Convert species to numerical values<br>iris[&#39;species&#39;] = pd.factorize(iris[&#39;species&#39;])[0]<br>X = iris.drop(&#39;species&#39;, axis=1)<br>y = iris[&#39;species&#39;]<br><br># Split data into training and testing sets<br>X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.3, random_state=42)<br><br># Train a simple Logistic Regression model<br>model = LogisticRegression(max_iter=1000)<br>model.fit(X_train, y_train)<br><br># Evaluate the model<br>y_pred = model.predict(X_test)<br>accuracy = accuracy_score(y_test, y_pred)<br>print(f&quot;Model Accuracy: {accuracy}&quot;)<br><br># Save the trained model<br>joblib.dump(model, &#39;iris_model.pkl&#39;)<br><br>print(&quot;Model saved successfully to iris_model.pkl&quot;)</pre><blockquote><strong>Key Points</strong></blockquote><ul><li>We used a standard dataset and a classification algorithm within the SageMaker environment, to demonstrate the ease of use.</li><li>The model is trained within the Notebook, and saved to the local notebook storage.</li><li>We’ll build upon this in Part 2 to deploy it to an actual inference endpoint.</li></ul><blockquote><strong>2. Exploring Amazon Rekognition: AI-Powered Image and Video Analysis</strong></blockquote><p>Amazon Rekognition is a service that offers pre-trained AI capabilities for image and video analysis. We’ll use this service to demonstrate how to integrate image recognition capabilities into an application, without developing custom models.</p><blockquote><strong>Image Analysis Example:</strong></blockquote><ul><li><strong>Setting up IAM permissions:</strong> Ensure that your application/user has required IAM permissions to interact with Rekognition.</li><li><strong>Uploading the image to s3:</strong> Images must first be stored in an accessible S3 bucket.</li><li><strong>Using boto3 to analyze an image:</strong> The following code demonstrates how to analyze an image using Rekognition.</li></ul><pre>#Example Python Code to Analyze Images with Rekognition<br>import boto3<br><br>def analyze_image(bucket, image_name):<br>    rekognition_client = boto3.client(&#39;rekognition&#39;)<br><br>    try:<br>        response = rekognition_client.detect_labels(<br>            Image={<br>                &#39;S3Object&#39;: {<br>                    &#39;Bucket&#39;: bucket,<br>                    &#39;Name&#39;: image_name<br>                 }<br>             },<br>             MinConfidence = 90 # set a high confidence<br>        )<br><br>        print(&quot;Detected labels:&quot;)<br>        for label in response[&#39;Labels&#39;]:<br>            print(f&quot; - {label[&#39;Name&#39;]} (Confidence: {label[&#39;Confidence&#39;]:.2f}%)&quot;)<br><br>        return response<br>    except Exception as e:<br>        print(f&quot;ERROR: {e}&quot;)<br>        return None<br><br>if __name__ == &#39;__main__&#39;:<br>    # Replace with your bucket and image file<br>    BUCKET_NAME = &quot;your-s3-bucket-name&quot; # replace this with s3 bucket name.<br>    IMAGE_NAME = &quot;image1.jpg&quot; # replace with your image file in s3<br><br>    response_data = analyze_image(BUCKET_NAME,IMAGE_NAME)<br>    if response_data:<br>       print(&quot;Successfully analysed image.&quot;)</pre><blockquote><strong>Key Points</strong></blockquote><ul><li>The image must be present in s3 bucket before Rekognition can read it.</li><li>IAM permissions are required for boto3 to interact with s3 bucket as well as Rekognition service API.</li><li>Rekognition is used for its ease of use to provide ready-made AI API calls for image analysis.</li></ul><blockquote><strong>Summary</strong><br>In Part 1, we’ve set the foundation by setting up a SageMaker Studio environment, training and saving a basic model, as well as performing simple image analysis using Rekognition. This establishes the baseline for the next part of this series.</blockquote><blockquote><strong>Next Steps</strong></blockquote><ul><li>Experiment with the different features of SageMaker Notebooks and familiarize with training various types of machine learning models.</li><li>Explore other AWS AI services such as Amazon Comprehend, Transcribe, Translate for Natural language processing, Speech to text, Language Translation respectively.</li><li>Try to analyze your own set of images and videos using Rekognition service.</li></ul><p>WATCH OUT FOR PART 2!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f265ebac1471" width="1" height="1" alt=""><hr><p><a href="https://blog.devops.dev/building-ai-powered-applications-on-aws-a-practical-guide-part-1-f265ebac1471">Building AI-Powered Applications on AWS: A Practical Guide (Part 1)</a> was originally published in <a href="https://blog.devops.dev/">DevOps.dev</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Mastering AWS Automation with Python and CloudFormation: Hands-On Guide (Part 2)]]></title>
            <link>https://blog.devops.dev/mastering-aws-automation-with-python-and-cloudformation-hands-on-guide-part-2-ff6b244f9e6a?source=rss-1bfc7fac37a4------2</link>
            <guid isPermaLink="false">https://medium.com/p/ff6b244f9e6a</guid>
            <category><![CDATA[aws-lambda]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[articles]]></category>
            <category><![CDATA[viral]]></category>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[xinacod]]></dc:creator>
            <pubDate>Sat, 18 Jan 2025 10:36:38 GMT</pubDate>
            <atom:updated>2025-01-19T17:12:24.248Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*4F1E0zlkyPzJddg8R6Dhuw.jpeg" /></figure><p><strong>Introduction:</strong></p><p>Welcome back to our journey into AWS automation! In Part 1, we explored the fundamentals of automating EC2 instance creation using Python and the boto3 library, and we laid the groundwork for Infrastructure as Code (IaC) using AWS CloudFormation. We created a simple EC2 instance with both Python and CloudFormation. Now, we’ll take our skills to the next level by exploring more advanced techniques and use cases. We’ll dive into nested stacks, custom resources, and how to integrate Python scripts into your CloudFormation workflows. Get ready to enhance your automation capabilities and build more complex and robust infrastructure.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FwPLlyubWIME%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DwPLlyubWIME&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FwPLlyubWIME%2Fhqdefault.jpg&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/67087b4ae73c3a560e5b4ea07dec734a/href">https://medium.com/media/67087b4ae73c3a560e5b4ea07dec734a/href</a></iframe><p><strong>Nested Stacks: Modularizing Your Infrastructure</strong></p><p>As your infrastructure grows in complexity, managing everything in a single CloudFormation template becomes challenging. Nested stacks allow you to break down your infrastructure into smaller, manageable, and reusable components. This improves code readability, promotes modularity, and simplifies updates.</p><p>Let’s create a nested stack for a basic security group. First, we’ll create security_group.yml:</p><pre># security_group.yml<br>AWSTemplateFormatVersion: &#39;2010-09-09&#39;<br>Description: Creates a security group with a specific inbound rule<br><br>Parameters:<br>    VpcId:<br>      Type: AWS::EC2::VPC::Id<br>      Description: The VPC to create the security group in<br>    InboundPort:<br>      Type: Number<br>      Description: Port number for inbound access<br>      Default: 22<br><br>Resources:<br>    MySecurityGroup:<br>        Type: AWS::EC2::SecurityGroup<br>        Properties:<br>            GroupDescription: Security group with ssh access<br>            VpcId: !Ref VpcId<br>            SecurityGroupIngress:<br>                - IpProtocol: tcp<br>                  FromPort: !Ref InboundPort<br>                  ToPort: !Ref InboundPort<br>                  CidrIp: 0.0.0.0/0<br>Outputs:<br>    SecurityGroupId:<br>        Value: !Ref MySecurityGroup<br>        Description: The ID of the security group</pre><p>Now, let’s create main_stack.yml to call the nested stack and use this for our EC2 instance:</p><pre># main_stack.yml<br>AWSTemplateFormatVersion: &#39;2010-09-09&#39;<br>Description: Creates an EC2 Instance using nested stack for security group.<br><br>Parameters:<br>  InstanceType:<br>    Type: String<br>    Description: EC2 instance type<br>    Default: t2.micro<br>  AmiID:<br>    Type: String<br>    Description: Ami ID of desired Operating System image<br>    Default: ami-0c55b8a434eb807e8<br>  VpcId:<br>      Type: AWS::EC2::VPC::Id<br>      Description: The VPC to create the security group in<br><br>Resources:<br>  SecurityGroupStack:<br>    Type: AWS::CloudFormation::Stack<br>    Properties:<br>      TemplateURL:  #replace this with the url to security_group.yml in an accessible S3 bucket<br>         #example : https://your-bucket-name.s3.amazonaws.com/security_group.yml<br>      Parameters:<br>         VpcId: !Ref VpcId<br>         InboundPort: 22 #override the default inbound port using parameter for this nested stack<br>  EC2Instance:<br>      Type: &#39;AWS::EC2::Instance&#39;<br>      Properties:<br>          ImageId: !Ref AmiID<br>          InstanceType: !Ref InstanceType<br>          SecurityGroupIds:<br>            - !GetAtt SecurityGroupStack.Outputs.SecurityGroupId<br>          Tags:<br>             - Key: Name<br>               Value: NestedStackLaunchedInstance<br>Outputs:<br>  InstancePublicIp:<br>    Description: &quot;Public Ip address for EC2&quot;<br>    Value: !GetAtt EC2Instance.PublicIp<br>  InstanceId:<br>    Description: &quot;Instance id&quot;<br>    Value: !Ref EC2Instance</pre><p><strong>Python Code for Deploying the Main Stack:</strong></p><pre>import boto3<br>import time<br><br>def load_template(filename):<br>    with open(filename, &#39;r&#39;) as file_data:<br>        return file_data.read()<br><br>def deploy_nested_stack(stack_name, vpc_id):<br>    try:<br>        cfn_resource = boto3.resource(&quot;cloudformation&quot;, region_name=&#39;us-west-2&#39;)<br>        new_stack = cfn_resource.create_stack(<br>            StackName=stack_name,<br>            TemplateBody=load_template(&#39;main_stack.yml&#39;),<br>            Parameters=[<br>               {&#39;ParameterKey&#39;: &#39;VpcId&#39;, &#39;ParameterValue&#39;: vpc_id},<br>            ],<br>            Capabilities=[&#39;CAPABILITY_NAMED_IAM&#39;]<br>        )<br><br>        print(f&quot;stack {stack_name} has been created, wait for completion...&quot;)<br>        new_stack.wait_until_exists()<br><br>        stack_output_obj = new_stack.outputs<br>        instance_public_ip = &#39;&#39;<br>        instance_id = &#39;&#39;<br>        for item in stack_output_obj:<br>            if item[&quot;OutputKey&quot;] == &quot;InstancePublicIp&quot;:<br>                instance_public_ip = item[&#39;OutputValue&#39;]<br>            if item[&quot;OutputKey&quot;] == &quot;InstanceId&quot;:<br>                instance_id = item[&#39;OutputValue&#39;]<br>        return (instance_id, instance_public_ip)<br>    except Exception as e:<br>        print(&quot;ERROR:&quot; + str(e))<br><br><br>if __name__ == &quot;__main__&quot;:<br>   STACK_NAME = &quot;my-nested-stack&quot;<br>   # Replace with your actual VPC id (ensure that this VPC exists)<br>   VPC_ID = &quot;vpc-xxxxxxxxxxxxxxxxx&quot; # Replace this with your VPC ID<br><br>   instance_id, instance_public_ip = deploy_nested_stack(STACK_NAME, VPC_ID)<br><br>   print(&quot;==============================================&quot;)<br>   print(f&quot;Successfully launched stack: {STACK_NAME} with:&quot;)<br>   print(f&quot;\tInstanceId: {instance_id}&quot;)<br>   print(f&quot;\tPublicIp Address: {instance_public_ip}&quot;)</pre><p><strong>Key points:</strong></p><ul><li>The TemplateURL in main_stack.yml must point to an accessible S3 location of the security_group.yml file.</li><li>We’re passing the VPC ID (VpcId) to both main stack and the security group stack.</li><li>We use the !GetAtt function to access the SecurityGroupId from the output of the nested stack.</li></ul><p><strong>2. Custom Resources: Extending CloudFormation Capabilities</strong></p><p>Sometimes, CloudFormation doesn’t natively support specific actions or resources. Custom Resources allow you to run custom code when a stack is created, updated, or deleted. They are backed by AWS Lambda or AWS Step Functions.</p><p>Let’s create a simple custom resource using Python Lambda function, this will add a tag to an existing ec2 instance by id, for example after we launch it through a stack.</p><p><strong>Python Lambda Code (tag_ec2.py):</strong></p><pre>import boto3<br>import json<br>import cfnresponse<br><br>def lambda_handler(event, context):<br>  print(f&quot;event data: {json.dumps(event)}&quot;)<br>  ec2 = boto3.resource(&#39;ec2&#39;)<br>  try:<br>    ec2_instance_id = event[&#39;ResourceProperties&#39;][&#39;InstanceId&#39;]<br>    tag_key = event[&#39;ResourceProperties&#39;][&#39;TagKey&#39;]<br>    tag_value = event[&#39;ResourceProperties&#39;][&#39;TagValue&#39;]<br><br>    instance = ec2.Instance(ec2_instance_id)<br><br>    if event[&#39;RequestType&#39;] == &#39;Create&#39; or event[&#39;RequestType&#39;] == &#39;Update&#39;:<br>        instance.create_tags(Tags=[{&#39;Key&#39;: tag_key, &#39;Value&#39;: tag_value}])<br>    elif event[&#39;RequestType&#39;] == &#39;Delete&#39;:<br>       instance.delete_tags(Tags=[{&#39;Key&#39;: tag_key}])<br>    print(f&quot;successfully handled event {event[&#39;RequestType&#39;]} to instance {ec2_instance_id}&quot;)<br>    cfnresponse.send(event, context, cfnresponse.SUCCESS, {}, ec2_instance_id)<br>  except Exception as e:<br>    print(f&quot;FAILED with ERROR: {e}&quot;)<br>    cfnresponse.send(event,context,cfnresponse.FAILED,{},ec2_instance_id)</pre><p><strong>CloudFormation Template (using custom resource):</strong></p><pre># custom_resource_stack.yml<br>AWSTemplateFormatVersion: &#39;2010-09-09&#39;<br>Description: Launch a server and add a tag using Lambda custom resource<br><br>Parameters:<br>  InstanceType:<br>      Type: String<br>      Default: t2.micro<br>  AmiID:<br>      Type: String<br>      Default: ami-0c55b8a434eb807e8<br>  VpcId:<br>      Type: AWS::EC2::VPC::Id<br>      Description: The VPC to create the security group in<br>  LambdaArn:<br>      Type: String<br>      Description: Arn of the Lambda function for tagging<br><br>Resources:<br>  EC2Instance:<br>    Type: &#39;AWS::EC2::Instance&#39;<br>    Properties:<br>      ImageId: !Ref AmiID<br>      InstanceType: !Ref InstanceType<br>      Tags:<br>       - Key: Name<br>         Value: CustomResourceLaunchedInstance<br>  TagInstance:<br>      Type: &#39;Custom::TagEC2Instance&#39;<br>      Properties:<br>        ServiceToken: !Ref LambdaArn<br>        InstanceId: !Ref EC2Instance<br>        TagKey: Environment<br>        TagValue: Test<br><br>Outputs:<br>  InstancePublicIp:<br>    Description: &quot;Public Ip address for EC2&quot;<br>    Value: !GetAtt EC2Instance.PublicIp<br>  InstanceId:<br>    Description: &quot;Instance id&quot;<br>    Value: !Ref EC2Instance</pre><p><strong>Python Code for Deploying Custom Resource Stack:</strong></p><pre>import boto3<br>import time<br>def load_template(filename):<br>    with open(filename, &#39;r&#39;) as file_data:<br>        return file_data.read()<br>def deploy_custom_stack(stack_name, lambda_arn, vpc_id):<br>    try:<br>        cfn_resource = boto3.resource(&quot;cloudformation&quot;, region_name=&#39;us-west-2&#39;)<br>        new_stack = cfn_resource.create_stack(<br>            StackName=stack_name,<br>            TemplateBody=load_template(&#39;custom_resource_stack.yml&#39;),<br>             Parameters=[<br>                 {&#39;ParameterKey&#39;: &#39;LambdaArn&#39;, &#39;ParameterValue&#39;: lambda_arn},<br>                 {&#39;ParameterKey&#39;: &#39;VpcId&#39;, &#39;ParameterValue&#39;: vpc_id},<br>             ],<br>            Capabilities=[&#39;CAPABILITY_NAMED_IAM&#39;]<br>        )<br><br>        print(f&quot;stack {stack_name} has been created, wait for completion...&quot;)<br>        new_stack.wait_until_exists()<br><br>        stack_output_obj = new_stack.outputs<br>        instance_public_ip = &#39;&#39;<br>        instance_id = &#39;&#39;<br>        for item in stack_output_obj:<br>            if item[&quot;OutputKey&quot;] == &quot;InstancePublicIp&quot;:<br>                instance_public_ip = item[&#39;OutputValue&#39;]<br>            if item[&quot;OutputKey&quot;] == &quot;InstanceId&quot;:<br>                instance_id = item[&#39;OutputValue&#39;]<br>        return (instance_id, instance_public_ip)<br><br>    except Exception as e:<br>        print(&quot;ERROR:&quot; + str(e))<br>if __name__ == &quot;__main__&quot;:<br>   STACK_NAME = &quot;my-custom-resource-stack&quot;<br>   LAMBDA_ARN = &quot;arn:aws:lambda:us-west-2:XXXXXXXXXXXXX:function:TagEC2Function&quot; #Replace this with your correct Lambda Function ARN. Ensure this lambda role also has access to EC2 Tagging service API permissions.<br>   # Replace with your actual VPC id (ensure that this VPC exists)<br>   VPC_ID = &quot;vpc-xxxxxxxxxxxxxxxxx&quot; # Replace this with your VPC ID<br>   instance_id, instance_public_ip = deploy_custom_stack(STACK_NAME, LAMBDA_ARN,VPC_ID)<br>   print(&quot;==============================================&quot;)<br>   print(f&quot;Successfully launched stack: {STACK_NAME} with:&quot;)<br>   print(f&quot;\tInstanceId: {instance_id}&quot;)<br>   print(f&quot;\tPublicIp Address: {instance_public_ip}&quot;)</pre><p><strong>Key Points:</strong></p><ul><li>The Lambda function (tag_ec2.py) will get deployed to an AWS account and it will need permissions to EC2 services for tag related API.</li><li>The ServiceToken in the custom resource points to the Lambda function’s ARN.</li><li>The Poperties within the custom resource are passed to the Lambda function as part of the event object.</li><li>The Lambda must send a response back to CloudFormation using cfnresponse.</li></ul><p><strong>3. Integrating Python Scripts into CloudFormation</strong></p><p>Instead of directly writing complex logic within CloudFormation templates, you can orchestrate tasks using Python scripts. You can use CloudFormation Custom Resources to execute Python scripts to dynamically adjust settings during the stack creation or update. This helps to encapsulate business logic into python code, rather then a stack.</p><p><strong>Example:</strong></p><p>We will use our Lambda for custom resources to trigger python lambda call, this also can call code stored in s3 or github, or using other infrastructure services or api services.</p><p><strong>Summary</strong></p><p>In Part 2, we’ve significantly advanced our automation capabilities by introducing nested stacks and custom resources. Now you can create modular, reusable, and expandable CloudFormation templates and incorporate Python scripts to enhance the flexibility and power of your deployments. You’ve got the power to build robust and automated AWS solutions.</p><p><strong>Next Steps</strong></p><ul><li>Experiment with more complex custom resources and nested stack scenarios.</li><li>Explore other CloudFormation features, such as conditions, mappings, and transforms.</li><li>Look into integrating other AWS services with CloudFormation for more comprehensive workflows.</li></ul><p>Stay tuned for future parts where we’ll explore more advanced topics.</p><p><strong>Note:</strong></p><ul><li>Remember to replace placeholder values (e.g., region names, AMI IDs, S3 bucket URLs, VPC IDs, and Lambda ARNs) with your actual values.</li><li>Ensure that your AWS credentials are properly configured before running the code.</li><li>The Lambda function needs an IAM role with appropriate permissions for tagging EC2 instances.</li><li>This example demonstrates an advanced usage and requires some proficiency with CloudFormation and AWS services such as Lambda to be used effectively.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ff6b244f9e6a" width="1" height="1" alt=""><hr><p><a href="https://blog.devops.dev/mastering-aws-automation-with-python-and-cloudformation-hands-on-guide-part-2-ff6b244f9e6a">Mastering AWS Automation with Python and CloudFormation: Hands-On Guide (Part 2)</a> was originally published in <a href="https://blog.devops.dev/">DevOps.dev</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Mastering AWS Automation with Python and CloudFormation: Hands-On Guide (Part 1)]]></title>
            <link>https://blog.devops.dev/mastering-aws-automation-with-python-and-cloudformation-hands-on-guide-part-1-f55a87e704a9?source=rss-1bfc7fac37a4------2</link>
            <guid isPermaLink="false">https://medium.com/p/f55a87e704a9</guid>
            <category><![CDATA[aws-lambda]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[aws-ec2]]></category>
            <dc:creator><![CDATA[xinacod]]></dc:creator>
            <pubDate>Thu, 16 Jan 2025 19:29:11 GMT</pubDate>
            <atom:updated>2025-01-17T16:33:05.479Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cgOne7svwHSPF4-4Nu8fOg.png" /></figure><p><strong>Introduction:</strong></p><p><a href="https://youtu.be/IDt1pYA5ygc?si=G7Owx-P5UwdX14H1">https://youtu.be/IDt1pYA5ygc?si=G7Owx-P5UwdX14H</a></p><p>In today’s cloud-first world, automation isn’t just a convenience — it’s a necessity. Efficient management of AWS resources is paramount, and manual interventions can quickly become a bottleneck. Python, with the boto3 library, is a powerhouse for streamlining your AWS infrastructure. This article offers a hands-on look at common AWS automation scenarios, from instance creation to CI/CD pipelines, all with code you can directly use. We’ll focus on practical implementations and clarity, making it easy to understand even for those relatively new to cloud automation.</p><p><strong>Automated EC2 Instance Creation</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/744/1*uJFWf3NwVx7N7-xaUljTmQ.png" /></figure><p>Manually spinning up virtual servers (EC2 instances) can be time-consuming. Let’s automate it. We can start EC2 machines using parameters including ami-id, security groups, tags, and even user startup script data all declared at runtime, these are important parameters in automating reproducible cloud servers using EC2 services</p><p>Here’s the basic automation code in Python to handle creating a server.</p><pre> import boto3<br>    import time<br><br>    ec2 = boto3.resource(&#39;ec2&#39;, region_name=&#39;us-west-2&#39;)  # Choose your AWS region<br>    ec2_client = boto3.client(&#39;ec2&#39;, region_name=&#39;us-west-2&#39;)<br><br>    def create_ec2_instance():<br>        try:<br>           # Choose appropriate settings for ami, instance type, etc.<br>           instances = ec2.create_instances(<br>                ImageId=&#39;ami-0c55b8a434eb807e8&#39;, # Amazon Linux 2023<br>                InstanceType=&#39;t2.micro&#39;, # instance type should correspond with region and have no running instances on the same type with your credentials for EC2 free tier eligibilty<br>                MinCount=1,<br>                MaxCount=1,<br>                TagSpecifications=[<br>                 {<br>                  &#39;ResourceType&#39;: &#39;instance&#39;,<br>                   &#39;Tags&#39;: [<br>                     {&#39;Key&#39;:&#39;Name&#39;, &#39;Value&#39;:&#39;My_Automated_Instance&#39;}<br>                      ]<br>                  }<br>                  ],<br><br>           )<br>        <br>           instance = instances[0]<br>           print(&quot;Instance is starting.  Please wait until fully launched&quot;)<br>        <br>           instance.wait_until_running()<br>           instance.load()  # refresh to update with instance details.<br><br>           instance_public_ip = instance.public_ip_address<br>           print(f&quot;Instance IP Address: {instance_public_ip}&quot;)<br>        <br>           # Optionally tag instance (can also add security groups/more to above create instances method).<br>           return instance.id<br><br><br>        except Exception as e:<br>             print(&quot;ERROR:&quot; + str(e))<br><br>    if __name__ == &quot;__main__&quot;:<br>      instance_id = create_ec2_instance()<br><br>      if instance_id:<br><br>         print(&quot;New EC2 instance has id: &quot; + instance_id)</pre><p>This script does a few important things, such as loading credentials in environment, connecting to AWS API EC2 endpoint, launching server by defining the OS image and settings with minimum and maximum amount parameters set and some tag specification so it is identifiable via a simple identifier for all operations related to that server launched, using polling from a client call we wait for launch completion and update with refresh of our data so information like the Public IP of server and others is ready for printing by the user if they desire. The full implementation uses error handlers that will display error messages if API returns error response values, which can be beneficial when debugging API connection issues during automation scripts or credential related problems that are difficult to resolve manually if not verbose log outputs during development steps.</p><p><strong>Key takeaways:</strong></p><ul><li>The boto3.resource(‘ec2’, region_name=’your-region’) call gets the interface to call operations on. Remember to put in an valid value where your resource must launch into in AWS Region value string for all method call related resource launches.</li><li>ec2.create_instances launches an instance using parameters, also other resources like elastic load balancer or others could be defined in here at server launch.</li><li>The instance.wait_until_running() method shows how easy polling for long tasks such as asynchronous calls can be with use of API endpoint resources to manage state for an automation flow</li><li>Tags can specify useful labels during operation for both identification for humans reading this or use it for identification of launched resources or access management of other operations related to same tagged resource set during development, production lifecycle settings</li></ul><p><strong>Infrastructure as Code with AWS CloudFormation</strong></p><p>Infrastructure as Code (IaC) is an industry-standard practice that involves creating repeatable environments programmatically. CloudFormation helps do this using templated yaml / json documents with parameters defined and mapped. With this we will automate deployments.</p><ul><li>Firstly we declare a template file simple_ec2.yml, with an identifier for what the infrastructure should become, also containing parameters like Ami id for operating system and ec2 settings, this gives repeatability between AWS server deployments</li></ul><pre>AWSTemplateFormatVersion: &#39;2010-09-09&#39;<br>Description: Create a simple EC2 Instance<br><br>Parameters:<br> InstanceType:<br>   Type: String<br>   Description: EC2 instance type<br>   Default: t2.micro<br> AmiID:<br>   Type: String<br>   Description: Ami ID of desired Operating System image<br>   Default: ami-0c55b8a434eb807e8  <br><br>Resources:<br>   EC2Instance:<br>     Type: &#39;AWS::EC2::Instance&#39;<br>     Properties:<br>       ImageId: !Ref AmiID<br>       InstanceType: !Ref InstanceType<br>       Tags:<br>        - Key: Name<br>          Value: CloudFormationLaunchedInstance<br>Outputs:<br>  InstancePublicIp:<br>    Description: &quot;Public Ip address for EC2&quot;<br>    Value: !GetAtt EC2Instance.PublicIp<br>  InstanceId:<br>      Description: &quot;Instance id&quot;<br>      Value: !Ref EC2Instance</pre><p>This describes what resources will become active as part of launching, where values may be configured programatically in this yml code with user specified resource parameters, using the parameters we can deploy a stack with this template in following manner:</p><pre>    import boto3<br>    import json<br>    import time<br><br>    # Load our template here using a basic open<br>    def load_template():<br>       with open(&quot;simple_ec2.yml&quot;) as file_data:<br>         return file_data.read()<br><br>    def deploy_cloudformation_stack(stack_name):<br>       try:<br>         # Create a Cloudformation connection resource<br>         cfn_resource = boto3.resource(&quot;cloudformation&quot;, region_name=&#39;us-west-2&#39;)<br>         #Create stack call with specified name using template we parsed before and specify desired resource.  Additional capabilities options may also need to be specified depending on your stack contents.<br>         new_stack = cfn_resource.create_stack(<br>             StackName = stack_name,<br>              TemplateBody=load_template(),<br>             Parameters = [<br>                  {&#39;ParameterKey&#39;: &#39;InstanceType&#39;, &#39;ParameterValue&#39;: &#39;t2.micro&#39;}, #override the InstanceType Default defined by our yml in this line, which defaults to `t2.micro` if not declared explicitly, this is declared for example sake<br>             ],<br>                Capabilities = [&quot;CAPABILITY_NAMED_IAM&quot;] # optional permission flag for enabling use of IAM during resource creation calls such as stack creations or role grants<br>             )<br><br>         print(f&quot;stack {stack_name} has been created, wait for completion... &quot;)<br>         # Use polling for update completion with Resource call. Client must be used in order to get more polling flexibility.<br>         new_stack.wait_until_exists()<br><br>         stack_output_obj = new_stack.outputs<br>         instance_public_ip = &#39;&#39;<br>         instance_id = &#39;&#39;<br>         #Parse the data and search for the output publicip to print later in output section.<br>         for item in stack_output_obj:<br>            if item[&quot;OutputKey&quot;] == &quot;InstancePublicIp&quot;:<br>              instance_public_ip = item[&#39;OutputValue&#39;]<br>            if item[&quot;OutputKey&quot;] == &quot;InstanceId&quot;:<br>              instance_id = item[&#39;OutputValue&#39;]<br><br>         return (instance_id,instance_public_ip)<br>       except Exception as e:<br>             print(&quot;ERROR:&quot; + str(e))<br>    if __name__ == &quot;__main__&quot;:<br>        STACK_NAME = &quot;my-automation-stack&quot; # change for name for different launches, this stack will override a previous existing stack using the same name, use unique identifiers<br>        instance_id,instance_public_ip = deploy_cloudformation_stack(STACK_NAME)<br>        print(&quot;==============================================&quot;)<br>        print(f&quot;Successfully launched stack: {STACK_NAME} with:&quot;)<br>        print(f&quot;\tInstanceId: {instance_id}&quot;)<br>        print(f&quot;\tPublicIp Address: {instance_public_ip}&quot;)</pre><p>This code is composed of a loading helper for the simple_ec2.yml, and deployer that maps that yml configuration by calling a resource connection from AWS, setting parameters based off an input config or defaults within file parameters that start a stack execution based of these settings defined, while polling the service to know when operations on resources are complete, if these were completed then output information from this launched yaml template for all the settings are returned. Error messages are included via try catch handlers for easier troubleshooting. The Stack can contain not only server (like ec2) instances but many other settings, serverless services such as database, containers etc with its flexible yaml config, all as resource declarations</p><p><strong>Key takeaways:</strong></p><ul><li>The connection is based of boto3.resource(“cloudformation”, region_name=”your-region”)</li><li>We read yml files locally with parameter specified by strings using basic loading method.</li><li>We can launch the file through methods to read string / yaml with corresponding keys or mappings such as output parameters, we filter through this in the script using loop for debug and validation of public_ip values based of cloud service. We will have more information given by output object</li><li>wait_until_exists() to wait for complete resource state (this also covers long time calls for other methods besides instance launching)</li></ul><p>WATCH OUT FOR PART 2 !!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f55a87e704a9" width="1" height="1" alt=""><hr><p><a href="https://blog.devops.dev/mastering-aws-automation-with-python-and-cloudformation-hands-on-guide-part-1-f55a87e704a9">Mastering AWS Automation with Python and CloudFormation: Hands-On Guide (Part 1)</a> was originally published in <a href="https://blog.devops.dev/">DevOps.dev</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AWS SECURITY AUDIT]]></title>
            <link>https://medium.com/@xenacod/aws-security-audit-7c2e19b9a7f3?source=rss-1bfc7fac37a4------2</link>
            <guid isPermaLink="false">https://medium.com/p/7c2e19b9a7f3</guid>
            <category><![CDATA[devops-practice]]></category>
            <category><![CDATA[auditing]]></category>
            <category><![CDATA[hacking-for-defense]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[aws]]></category>
            <dc:creator><![CDATA[xinacod]]></dc:creator>
            <pubDate>Thu, 07 Nov 2024 12:20:39 GMT</pubDate>
            <atom:updated>2024-11-07T12:20:39.166Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*2xeHFwijNy7h3f40.png" /></figure><p><strong>Network Security Simplified: Auditing with </strong><strong>ss on AWS Linux</strong></p><p><strong>Introduction</strong></p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FphY8Q7Woxsw%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DphY8Q7Woxsw&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FphY8Q7Woxsw%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/4045f92fcd2005686f9a240542e47170/href">https://medium.com/media/4045f92fcd2005686f9a240542e47170/href</a></iframe><p>In today’s digital landscape, securing network communication is vital. Even the smallest oversight can provide opportunities for exploitation. One lesser-known yet powerful way to audit your Linux network activity is with the command ss, a successor to the once-popular netstat. By periodically auditing the active network connections and listening ports on your Linux system, you can catch suspicious activity and prevent potential attacks. This article walks through using ss on a Kali Linux system, with step-by-step instructions to help you interpret socket statistics with ease. So, grab your detective hat—let’s dive in!</p><h3>Getting Started with ss and Network Sockets</h3><p>First, what exactly is a network socket? Think of a socket as an endpoint in a network connection, with each socket associated with an IP address, a communication protocol, and a port number. Sockets enable communication between processes on a network and are categorized based on the protocol they use — TCP, UDP, or RAW.</p><p>Traditionally, netstat was the go-to tool for this kind of auditing on Linux. However, netstat is now obsolete, replaced by the more modern and versatile ss command, which provides detailed socket statistics on both IPv4 and IPv6. (Don’t worry, netstat fans—netstat is still available for Mac users!)</p><h3>Setting Up Your Lab Environment: Welcome to Kali Linux</h3><p>To follow along, we’ll use Kali Linux, a Debian-derived Linux distribution designed for security professionals.</p><ol><li><strong>Accessing the Kali VM</strong>: Start your Kali Linux virtual machine in Hyper-V Manager. Connect to it, and log in with the default credentials (username root, password toor).</li><li><strong>Opening the Terminal</strong>: Once logged in, open a terminal. You should see the command prompt, which confirms that you’re logged in as root.</li></ol><h3>Using ss to View Basic Socket Statistics</h3><p>Our first task is to use ss to get an overview of the system&#39;s active sockets.</p><ul><li>In your terminal, type [your output might be different]</li></ul><pre>ss -s</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/837/1*yx4C22h906OLEAXgamaZXA.png" /></figure><ul><li>This command provides a summary of socket statistics, giving you a snapshot of current network activity. The output categorizes sockets by protocol type and usage. Here are the main sections you’ll see:</li><li><strong>Total</strong>: Displays the number of active connections.</li><li><strong>Transport Table</strong>: Provides a breakdown of protocol types, including INET (internet protocol sockets) and their subtypes: RAW, UDP, and TCP.</li></ul><h3>Interpreting Socket Statistics</h3><p>In this initial output, you’ll see the total number of active streams on the system, including more than just network sockets. This can include Unix stream sockets, used for communication between processes on the same host. If you see a high number of open sockets, the attack surface of the host may be larger than ideal, especially if many sockets are exposed to the internet.</p><p>To expand the list of sockets and include specific details about network communication, we’ll explore a more comprehensive command shortly.</p><h3>Simulating Network Traffic</h3><p>Let’s generate some real network activity! Open Firefox in Kali by typing:</p><pre>firefox &amp;</pre><p>Next, navigate to a website hosted on a local network by entering the following URL in Firefox:</p><pre>http://192.168.0.101</pre><p>When you load this site, your Kali machine initiates new connections.</p><h3>Observing Changes in Socket Statistics</h3><p>In your terminal, re-run the previous command to see updated statistics:</p><pre>ss -s</pre><p>Notice any changes? You should see additional connections in the TCP section since the website you just accessed uses HTTP, which operates over TCP on port 80. This section gives insight into active connections and any closed ones. It’s especially useful to identify open and listening sockets, which increase the attack surface.</p><h3>Detailed Auditing with ss</h3><p>To delve deeper, let’s display all TCP and UDP sockets with information about their associated processes.</p><p>Type the following command:</p><pre>ss -tuap</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NADOdMAgvf-AErvOpo-vCQ.png" /></figure><p>In this command:</p><ul><li>-t displays TCP sockets</li><li>-u displays UDP sockets</li><li>-a displays both listening and non-listening sockets</li><li>-p shows the process associated with each socket</li></ul><p>The output reveals details such as:</p><ul><li><strong>ESTAB</strong>: Indicates established connections between your Kali Linux host and other machines.</li><li><strong>Port of Peer</strong>: Shows the remote port, which will be 80 for the HTTP traffic to the website.</li></ul><p><strong>Pro tip</strong>: If you don’t see connections in the output, try refreshing the web page or opening another site to stimulate network traffic.</p><h3>Investigating RAW Sockets for Suspicious Activity</h3><p>RAW sockets are worth examining closely, as they allow low-level access to the network stack. Typically, these are used by the operating system itself or applications requiring privileged network access. In Linux, NetworkManager often uses RAW sockets, so seeing it here is expected.</p><p>To view RAW sockets, use:</p><pre>ss -wap</pre><p>Here, -w displays RAW sockets. With this information, you can identify processes using RAW sockets—critical if you’re hunting for unusual activity.</p><h3>Practical Security Applications of ss Auditing</h3><p>Now that we’ve covered the technical aspects, let’s consider the practical applications of socket auditing for security. Using ss is crucial in scenarios like:</p><ul><li><strong>Intrusion Detection</strong>: Unexpected open ports or high numbers of connections can indicate a compromised system.</li><li><strong>Service Monitoring</strong>: Ensures critical services are operating on the expected ports.</li><li><strong>Attack Surface Management</strong>: Monitoring for any unnecessary services listening on open ports can help reduce exposure.</li></ul><p><strong>Example Scenario</strong>: Imagine auditing a web server and noticing an unfamiliar socket listening on an unusual port, say 8088, alongside the expected HTTP and HTTPS ports (80 and 443). Investigating further might reveal that a new application is listening on 8088, which could signify unauthorized software or malware.</p><h3>Summary: Auditing with ss</h3><p>In this guide, you’ve used ss to audit and interpret socket activity on a Linux system. Here’s a quick recap of the commands:</p><ul><li>ss -s: Provides a summary of all sockets.</li><li>ss -tuap: Shows TCP and UDP sockets with associated processes.</li><li>ss -wap: Displays RAW sockets for low-level auditing.</li></ul><p>Using ss regularly will give you insights into your system’s network activity, helping you detect anomalies before they become security risks. So next time you’re on a Linux machine, put on your detective hat and dive into the network traffic with ss. Safe auditing!</p><p>With the techniques above, you’re ready to audit sockets on Linux and defend against potential security threats. Keep your knowledge fresh, stay vigilant, and keep your systems secure!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7c2e19b9a7f3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Achieving Ultimate Software Security: A Guide to OWASP SAMM Maturity Models]]></title>
            <link>https://medium.com/@xenacod/achieving-ultimate-software-security-a-guide-to-owasp-samm-maturity-models-ebb67c5993c2?source=rss-1bfc7fac37a4------2</link>
            <guid isPermaLink="false">https://medium.com/p/ebb67c5993c2</guid>
            <category><![CDATA[devsecops]]></category>
            <category><![CDATA[vulnerability]]></category>
            <category><![CDATA[maturity-model]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[software-security]]></category>
            <dc:creator><![CDATA[xinacod]]></dc:creator>
            <pubDate>Tue, 31 Jan 2023 19:03:54 GMT</pubDate>
            <atom:updated>2023-01-31T19:03:54.883Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/371/1*8-p15r4eO-xGK3KFDtGYXQ.png" /></figure><p>When it comes to software security, there is no one-size-fits-all solution. Every organization has its own unique security requirements and needs to follow a customized approach when it comes to safeguarding its systems, applications, and data. This is where the OWASP Software Assurance Maturity Model (OWASP SAMM) comes in.</p><p>In this guide, we will discuss all the basics of OWASP SAMM Maturity Models and how you can use them to enhance the security of your software.</p><h3>Introduction to OWASP SAMM Maturity Models</h3><p>OWASP SAMM is a framework for managing and improving the security of the software development lifecycle (SDLC). It provides a structured approach to assessing and improving the security of software applications and systems.</p><p>The framework is divided into five stages, or maturity levels, which represent different levels of security maturity. Each stage provides detailed guidance on the best practices and processes that should be employed to achieve security goals.</p><p>The goal of OWASP SAMM is to help organizations build secure software systems, applications, and products. It provides guidance on security best practices, processes, and activities that should be followed throughout the software development life cycle.</p><h3>The Benefits of OWASP SAMM Maturity Models</h3><p>There are many benefits to using the OWASP SAMM Maturity Models. These include:</p><ul><li>Improved security: The framework provides comprehensive guidance on security best practices, processes, and activities. This helps organizations create secure software systems, applications, and products.</li><li>Increased productivity: The framework helps organizations streamline their security process and reduce the amount of time and resources required for security activities.</li><li>Reduced risk: The framework helps organizations identify and address security vulnerabilities early on, reducing the chances of serious security breaches.</li><li>Improved compliance: The framework helps organizations meet compliance requirements, such as those set by the Payment Card Industry Data Security Standard (PCI DSS).</li></ul><h3>Understanding the Different Levels of OWASP SAMM Maturity</h3><p>The OWASP SAMM framework is divided into five levels, or stages, of maturity. These levels represent different levels of security maturity.</p><p>The first level, or stage, is Level 1: Initial. This stage is the starting point for organizations that are just starting to implement security. It focuses on establishing the foundation for security by setting up a security process and identifying the key security risks.</p><p>The second level, or stage, is Level 2: Repeatable. This stage focuses on establishing a repeatable security process and ensuring that security is integrated into the organization’s development process.</p><p>The third level, or stage, is Level 3: Defined. This stage focuses on developing a more formal security process and implementing security controls.</p><p>The fourth level, or stage, is Level 4: Managed. This stage focuses on monitoring and measuring the security process and implementing changes to improve its effectiveness.</p><p>The fifth and final level, or stage, is Level 5: Optimized. This stage focuses on continuously improving the security process and ensuring that it is as effective as possible.</p><h3>How to Implement OWASP SAMM Maturity Models in Your Software Development</h3><p>When implementing the OWASP SAMM Maturity Models, it is important to keep in mind the different stages of maturity. Each stage requires its own specific set of processes and activities.</p><p>At the initial stage, it is important to set up a security process and identify the key security risks. This can be done by conducting a security risk assessment and creating a security policy.</p><p>At the repeatable stage, it is important to ensure that security is integrated into the organization’s development process. This can be done by incorporating security into the requirements gathering process and establishing processes for code review and testing.</p><p>At the defined stage, it is important to develop a more formal security process and implement security controls. This can be done by creating a security architecture and implementing security controls, such as access control and encryption.</p><p>At the managed stage, it is important to monitor and measure the security process and implement changes to improve its effectiveness. This can be done by creating metrics to measure the effectiveness of the security process, conducting regular security reviews, and implementing automated tools to monitor security.</p><p>At the optimized stage, it is important to continuously improve the security process and ensure that it is as effective as possible. This can be done by conducting security audits and reviews, implementing automated tools to detect security issues, and creating a culture of security within the organization.</p><h3>Adopting OWASP SAMM Maturity Models in Your Business</h3><p>Adopting the OWASP SAMM Maturity Models in your business is not just about implementing the framework. It is also about creating a culture of security within the organization.</p><p>Organizations need to ensure that everyone in the organization is aware of the security risks and the importance of security. They should create a security policy and ensure that everyone in the organization understands and follows it.</p><p>Organizations should also ensure that security is integrated into all aspects of the development process. This includes conducting security reviews, implementing security controls, and ensuring that everyone in the organization is aware of their security responsibilities.</p><p>Organizations should also establish processes for monitoring and measuring the security process. This includes creating metrics to measure the effectiveness of the security process and conducting regular security reviews.</p><p>Finally, organizations should create a culture of security within the organization. This includes creating a security-focused environment, encouraging security awareness, and promoting a culture of security.</p><h3>What is the Difference Between OWASP SAMM and Other Software Security Frameworks?</h3><p>The OWASP SAMM Maturity Models is not the only software security framework available. There are other frameworks, such as the Open Web Application Security Project (OWASP) Top 10, the Microsoft Security Development Lifecycle (SDL), and the Security Objectives for Software Development (SOSD).</p><p>The main difference between OWASP SAMM and these other frameworks is that OWASP SAMM is focused on helping organizations manage and improve the security of the software development lifecycle (SDLC). It provides guidance on security best practices and processes that should be followed throughout the software development life cycle.</p><p>On the other hand, the other frameworks are focused on identifying and addressing security vulnerabilities. For example, the OWASP Top 10 is a list of the most common security vulnerabilities, while the Microsoft SDL is a framework for identifying and addressing security risks throughout the software development life cycle.</p><h3>Tips for Using OWASP SAMM Maturity Models</h3><p>When implementing the OWASP SAMM Maturity Models, there are a few tips to keep in mind:</p><ul><li>Start with the basics: Start by creating a security process and identifying the key security risks. This will help you understand the different stages of maturity and create a foundation for security.</li><li>Establish processes: Establish processes for security activities, such as code review and testing. This will help ensure that security is integrated into the organization’s development process.</li><li>Monitor and measure: Monitor and measure the security process and implement changes to improve its effectiveness. This will help you ensure that the security process is as effective as possible.</li><li>Create a culture of security: Create a culture of security within the organization by creating a security-focused environment and promoting security awareness.</li></ul><h3>Common Challenges of Implementing OWASP SAMM Maturity Models</h3><p>Implementing the OWASP SAMM Maturity Models can be challenging. Here are some of the common challenges organizations face when implementing the framework:</p><ul><li>Limited resources: Organizations may not have the resources to dedicate to security activities, such as security reviews and testing.</li><li>Lack of understanding: Organizations may not understand the different stages of maturity or the security best practices and processes that should be followed.</li><li>Complexity: The framework can be complex, and organizations may not have the expertise to understand and implement the framework.</li><li>Time constraints: Organizations may not have the time to dedicate to implementing the framework, especially if the organization is already dealing with other security issues.</li></ul><h3>Resources for Learning About OWASP SAMM Maturity Models</h3><p>If you’re looking to learn more about the OWASP SAMM Maturity Models, here are some helpful resources:</p><ul><li>OWASP SAMM website: The OWASP SAMM website is the official source of information about the framework. It provides detailed guidance on the different stages of maturity, the best practices and processes that should be followed, and the security controls that should be implemented.</li><li>OWASP SAMM Guide: The OWASP SAMM Guide is an in-depth guide to the framework. It provides detailed information on the different stages of maturity and how to implement the framework.</li><li>OWASP SAMM Training: The OWASP SAMM Training is a comprehensive training program that provides an overview of the framework and how to implement it.</li><li>OWASP SAMM Forum: The OWASP SAMM Forum is a discussion forum for security professionals. It provides a platform for discussing the framework and exchanging ideas and best practices.</li></ul><h3>Conclusion</h3><p>The OWASP Software Assurance Maturity Model (OWASP SAMM) is a framework for managing and improving the security of the software development lifecycle (SDLC). It provides a structured approach to assessing and improving the security of software applications and systems.</p><p>By following the OWASP SAMM Maturity Models, organizations can improve the security of their software systems, applications, and products. The framework provides guidance on security best practices, processes, and activities that should be followed throughout the software development life cycle.</p><p>Organizations should also create a culture of security within the organization. This includes creating a security-focused environment, encouraging security awareness, and promoting a culture of security.</p><p>If you’re looking to learn more about the OWASP SAMM Maturity Models, there are many helpful resources available, such as the OWASP SAMM website, the OWASP SAMM Guide, the OWASP SAMM Training, and the OWASP SAMM Forum.</p><p>By following the OWASP SAMM Maturity Models, organizations can improve the security of their software systems, applications, and products. With the right guidance and resources, organizations can achieve ultimate software security.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ebb67c5993c2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building DevOps pipelines with open source tools.]]></title>
            <link>https://blog.devops.dev/building-devops-pipelines-with-open-source-tools-92e6daf62dd0?source=rss-1bfc7fac37a4------2</link>
            <guid isPermaLink="false">https://medium.com/p/92e6daf62dd0</guid>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[devops-tool]]></category>
            <category><![CDATA[devsecops-solutions]]></category>
            <category><![CDATA[devsecops-tool]]></category>
            <category><![CDATA[devsecops]]></category>
            <dc:creator><![CDATA[xinacod]]></dc:creator>
            <pubDate>Wed, 06 Jul 2022 09:58:03 GMT</pubDate>
            <atom:updated>2022-07-18T12:10:22.582Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1022/1*rfPeOCgww-XXFdIhzk1gcw.png" /></figure><blockquote>DevOps has emerged as the go-to solution for improving delayed, compartmentalized, or otherwise problematic software development processes. But if you’re unfamiliar with DevOps and unsure of where to start, that doesn’t really mean anything. This article defines a DevOps pipeline and provides a five-step procedure for building one. Despite the fact that this course is not exhaustive, it should nevertheless provide you with a solid basis from which to build. First, though, a summary.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/904/1*QJsju5Ia3n9jgov-tb2v6Q.png" /></figure><h3>A brief introduction to DevOps and the CI/CD pipeline</h3><p>While having the right software tools is not the only thing you need to achieve a DevOps environment, some tools are necessary. A key one is continuous integration and continuous deployment (CI/CD). This pipeline is where the environments have different stages (e.g., DEV, INT, TST, QA, UAT, STG, PROD), manual things are automated, and developers can achieve high-quality code, flexibility, and numerous deployments.</p><p>This article describes a five-step approach to creating a DevOps pipeline, like the one in the following diagram, using open source tools.</p><p>Read <a href="https://www.redhat.com/architect/devops-cicd">https://www.redhat.com/architect/devops-cicd</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/675/1*kfJqTNmXQ4vJhoUI25ANJQ.png" /><figcaption>Complete CI/CD workflow</figcaption></figure><p>Now, without further ado, let’s begin.</p><p>Initial step: CI/CD framework</p><p>You must have a CI/CD tool initially. The DevOps movement was popularized by Jenkins, an open source, Java-based CI/CD tool that runs under the MIT License and has now taken over as the industry standard.</p><p>What then is Jenkins? Think of it as a magic global remote control that can coordinate and communicate with a vast array of services and equipment. A CI/CD tool like Jenkins is useless on its own, but when it connects to other tools and services, it gains power.</p><p>One of the numerous open source CI/CD tools you may use to create a DevOps pipeline is Jenkins.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/903/1*82-4xEfjYL_ADnhRVs7J1A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/870/1*3IkP-ZnPJaHw6K1ppLPsKA.png" /></figure><p>You have a CI/CD tool running in your localhost, but there is not much you can do at the moment. Let’s follow the next step of DevOps journey.</p><h4><strong>Source control management in step two</strong></h4><p>Integrating your CI/CD technology with a source control management (SCM) tool is the best and most straightforward approach to demonstrate that it can work its magic. Why is source control necessary? Let’s say you’re creating an application. Whether you use Java, Python, C++, Go, Ruby, JavaScript, or any of the other billion programming languages available, whenever you create an application, you are programming. The source codes you create for programs are referred to as such. Everything should definitely start off in your local directory, especially if you’re working alone. However, as the project grows and more people are brought in to work with you, you must find a solution to prevent merge conflicts while efficiently distributing code changes. Additionally, you require a method for restoring an earlier version because creating backups and copying and pasting get tiresome. You desire something better, as do your teammates.</p><p>Here, SCM almost becomes a requirement. A SCM tool assists by versioning your code, storing it in repositories, and coordinating between team members.Although there are many SCM tools out there, Git is the standard and rightly so. I highly recommend using Git, but there are other open source options if you prefer.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/1*-xRcclC700Dm-cMJiS4ysQ.png" /></figure><p>Here’s what the DevOps pipeline looks like with the addition of SCM.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/675/1*v7_mBDGPnGPOb9T6fTEC5g.png" /></figure><p>The CI/CD tool can automate the tasks of checking in and checking out source code and collaborating across members. Not bad? But how can you make this into a working application so billions of people can use and appreciate it?</p><h3>Step 3: Build automation tool</h3><p>Excellent! You can check out the code and commit your changes to the source control, and you can invite your friends to collaborate on the source control development. But you haven’t yet built an application. To make it a web application, it has to be compiled and put into a deployable package format or run as an executable. (Note that an interpreted programming language like JavaScript or PHP doesn’t need to be compiled.)</p><p>Enter the build automation tool. No matter which build tool you decide to use, all build automation tools have a shared goal: to build the source code into some desired format and to automate the task of cleaning, compiling, testing, and deploying to a certain location. The build tools will differ depending on your programming language, but here are some common open source options to consider.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/894/1*StyNAnINylOJJizNFRFADw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/675/1*lq2YKKHvD9fC92hvau9I3g.png" /></figure><p>Everything is good, right? But where can you deploy it?</p><h3>Step 4: Web application server</h3><p>So far, you have a packaged file that might be executable or deployable. For any application to be truly useful, it has to provide some kind of a service or an interface, but you need a vessel to host your application.</p><p>For a web application, a web application server is that vessel. An application server offers an environment where the programming logic inside the deployable package can be detected, render the interface, and offer the web services by opening sockets to the outside world. You need an HTTP server as well as some other environment (like a virtual machine) to install your application server. For now, let’s assume you will learn about this along the way (although I will discuss containers below).</p><p>There are a number of open source web application servers available.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/929/1*ItvE_KNLxf8bjYjFIUv7fA.png" /></figure><p>Although it’s possible to stop here and integrate further on your own, code quality is an important thing for an application developer to be concerned about.</p><h3>Step 5: Code testing coverage</h3><p>Implementing code test pieces can be another cumbersome requirement, but developers need to catch any errors in an application early on and improve the code quality to ensure end users are satisfied. Luckily, there are many open source tools available to test your code and suggest ways to improve its quality. Even better, most CI/CD tools can plug into these tools and automate the process.</p><p>There are two parts to code testing: <em>code testing frameworks</em> that help write and run the tests, and <em>code quality suggestion tools</em> that help improve code quality.</p><h3>Code test frameworks</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/902/1*VpZQNhXrsYn_ahRLEO_hqw.png" /></figure><p>Due to the fact that C++ and C# are proprietary programming languages, the majority of the tools and frameworks described above were built in Java, Python, and JavaScript (although GCC is open source).</p><p>Your DevOps pipeline should now resemble the DevOps pipeline diagram displayed at the beginning of this lesson since you have integrated code testing coverage tools.</p><h4>Containers for optional steps</h4><p>You can host your application server on a physical machine or a server, as I already explained, but containers are a popular option.</p><p>How do containers work? A VM requires an enormous operating system footprint, which overwhelms the scale of the program, but a container just requires a small number of libraries and configurations to run the application. Although a container provides a lightweight option for hosting an application, including an application server, there are undoubtedly still significant uses for virtual machines.</p><p>Despite the fact that there are alternative container choices, Docker and Kubernetes are the most widely used.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/889/1*cyEnSvlG3NkZKSzEE8FnXA.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=92e6daf62dd0" width="1" height="1" alt=""><hr><p><a href="https://blog.devops.dev/building-devops-pipelines-with-open-source-tools-92e6daf62dd0">Building DevOps pipelines with open source tools.</a> was originally published in <a href="https://blog.devops.dev/">DevOps.dev</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>