<?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[ProDT Consulting Service Pvt. Ltd. - Medium]]></title>
        <description><![CDATA[At ProDT, we use the insane potential of public cloud and agile practices for faster software delivery. We help software enterprises and startups transform into innovation engines through our cloud and DevOps services - Medium]]></description>
        <link>https://medium.com/opseco-technologies?source=rss----3742944c6ece---4</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>ProDT Consulting Service Pvt. Ltd. - Medium</title>
            <link>https://medium.com/opseco-technologies?source=rss----3742944c6ece---4</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 11:03:20 GMT</lastBuildDate>
        <atom:link href="https://medium.com/feed/opseco-technologies" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Deploying ELK on Amazon ECS]]></title>
            <link>https://medium.com/opseco-technologies/what-is-an-elasticsearch-cluster-dce98ed3edc0?source=rss----3742944c6ece---4</link>
            <guid isPermaLink="false">https://medium.com/p/dce98ed3edc0</guid>
            <category><![CDATA[elk]]></category>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[ec]]></category>
            <category><![CDATA[opseco]]></category>
            <dc:creator><![CDATA[Sumit Chauhan]]></dc:creator>
            <pubDate>Tue, 14 Jul 2020 11:28:06 GMT</pubDate>
            <atom:updated>2020-07-14T11:28:06.812Z</atom:updated>
            <content:encoded><![CDATA[<h3>What is an Elasticsearch cluster?</h3><p>An <strong>Elasticsearch cluster</strong> is a group of nodes that have the same <strong>cluster</strong>.name attribute. As nodes join or leave a <strong>cluster</strong>, the <strong>cluster</strong> automatically reorganizes itself to evenly distribute the data across the available nodes. If you are running a single instance of <strong>Elasticsearch</strong>, you have a <strong>cluster</strong> of one node and so on. To get better understanding of how cluster works its well documented <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-discovery.html">here</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5uQP2Btg7L3p6Ue8-7xMAg.png" /></figure><p>As shown in the above diagram to form a distributed structure like in image we will need master node and data node. To accomplish that we will create an <strong>Elasticsearch Cluster with 2 Master Node and 2 Data Node.</strong></p><p>We will start by creating Docker image for Master Node and Data Node.</p><p>Dockerfile:</p><pre>FROM elasticsearch:7.7.0<br>ENV REGION us-east-1<br>ADD elasticsearch.yml /usr/share/elasticsearch/config/<br>USER root<br>RUN chown 1000:0 config/elasticsearch.yml<br>RUN bin/elasticsearch-plugin install -b discovery-ec2 &amp;&amp; bin/elasticsearch-plugin install -b repository-s3<br>USER elasticsearch</pre><p>Master Node:</p><pre>cluster.name: &quot;ELKonECS&quot;<br>node.name: ${NodeName}<br>cluster.initial_master_nodes: master,master1,master2<br>discovery.seed_providers: ec2<br>network.host: 0.0.0.0<br>network.publish_host: _ec2_<br>transport.publish_host: _ec2_<br>transport.port: 9300<br>http.port: 9200<br>node.ingest: false<br>node.ml: false<br>node.data: false<br>discovery.ec2.endpoint: ec2.${REGION}.amazonaws.com<br>discovery.ec2.availability_zones:${REGION}a,${REGION}b<br>discovery.ec2.tag.elastic: &quot;node&quot;<br>discovery.ec2.tag.master: &quot;yes&quot;<br>cloud.node.auto_attributes: true<br>cluster.routing.allocation.awareness.attributes: aws_availability_zone<br>s3.client.default.endpoint: s3.${REGION}.amazonaws.com</pre><p>Data Node:</p><pre>cluster.name: &quot;ELKonECS&quot;<br>discovery.seed_providers: ec2<br>network.host: 0.0.0.0<br>network.publish_host: _ec2_<br>transport.publish_host: _ec2_<br>transport.port: 9300<br>http.port: 9200<br>discovery.ec2.endpoint: ec2.${REGION}.amazonaws.com<br>discovery.ec2.tag.elastic: &quot;node&quot;<br>cloud.node.auto_attributes: true<br>cluster.routing.allocation.awareness.attributes: aws_availability_zone<br>s3.client.default.endpoint: s3.${REGION}.amazonaws.com</pre><p>Building, Tagging docker images , so that we can push those images to your Amazon ECR repository.</p><p>Build Image:</p><pre>1. docker build . -t ${ACCOUNT_ID}.dkr.ecr.${REGION}.amazonaws.com/${REPO_NAME}:elastic-master<br>2. docker build . -t ${ACCOUNT_ID}.dkr.ecr.${REGION}.amazonaws.com/${REPO_NAME}:elastic-data</pre><p>Pushing Image to ECR: Run as <strong>root</strong></p><pre>aws ecr get-login --no-include-email --region ${YOUR_REGION} | bash<br>1.docker push ${ACCOUNT_ID}.dkr.ecr.${REGION}.amazonaws.com/${REPO_NAME}:elastic-master<br>2.docker push ${ACCOUNT_ID}.dkr.ecr.${REGION}.amazonaws.com/${REPO_NAME}:elastic-data</pre><h3>1. Cluster Creation on ECS:</h3><p>Logon to your amazon aws account and navigate to ECS.</p><ol><li>Create an Empty Cluster with Name “<strong>ELKonECS</strong>“.</li><li>To add instances to you empty cluster we will make use of <strong>AUTOSCALING .</strong></li></ol><h3>2. Adding Instances to ECS:</h3><p>Logon to your amazon aws account and navigate to EC2 → Auto Scaling.</p><ol><li>In auto scaling create a new launch Configuration according to your need and in User data use the following:</li></ol><pre>#!/bin/bash<br>yum update<br>echo &#39;ECS_CLUSTER=ELKonECS&#39; &gt; /etc/ecs/ecs.config<br>docker plugin install rexray/ebs --grant-all-permissions EBS_REGION=${YOUR_REGION}<br>sudo sysctl -w vm.max_map_count=262144<br>sudo sysctl -w fs.file-max=65536</pre><blockquote>For AMI make use of Amazon ECS-Optimized Amazon Linux 2 AMI for instance role go <a href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/instance_IAM_role.html">here</a> make sure to add tags to your instance otherwise they wont be able to communicate(follow master node).</blockquote><p>2. Create Autoscaling group using LaunchConfiguration.</p><p>After a while you will see 1 container instance in your ECS cluster. As we have to work with 2 Master Node and 2 Data Node, for this we require 4 instances, changes minimum and Desired count to 4. It will spin up 3 more instances for you. Now, the instance count in ECS cluster should be 4.</p><h3>3. Creating Task Definition:</h3><ol><li>Start by creating a new Task Definition for master select EC2 Launch type.</li><li>Port mappings: we need 9200 for external access and 9300 for intra-node communication.</li><li>Task Execution role: To give access to s3 buckets ec2 and other resources.</li><li>Environment Variables: Add ES_JAVA_OPTS as key and -Xms2g -Xmx2g as value, next REGION as key and us-west-2 (according to you) as value, most important NodeName as key and master as Value.</li><li>Ulimit: we must raise the limit, ElasticSearch will not start otherwise. Pick nofile, set both the Soft limit and Hard limit to 65536.</li><li>Volume:</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cF1e1cTkCqK2ETSEFCfrLQ.png" /></figure><p>7. Finally, add the volume to the container definition, as a mount point.</p><h3>4. Creating Task Definition for master1:</h3><p>Keep Everything same except Environment variables, in Environment variable we need to changes the <strong>NodeName value to master1</strong>.</p><h3>3. Creating a new Task Definition for Data Node:</h3><p>Keep Everything same except Environment variables, in <strong>Environment</strong> <strong>variable</strong> we need to remove the <strong>NodeName</strong> Key from data node and make changes to Heap Size according to use case and change <strong>volume</strong> name and update the mount point with new volume name.With the creation of Task Definition we are ready to create services.</p><h3>4. Creating Service:</h3><p>navigate to your cluster and you will find service tab.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/435/1*hiJ_u9SARW_xhAASUQzoxg.png" /></figure><ol><li>Steps for Master Node</li></ol><ul><li>select launch type as EC2</li><li>In task Definition, select your task definition</li><li>In service Name give and service name Like ELK-master</li><li>Number of task 1 for both master node</li><li>Load Balancer type select Application Load Balancer , if no load balancer listed then create a new Application Load Balancer, after creation of new ALB select elastic-master:9200:9200 and Add to load balancer, create a new listener with port 9200 HTTP . create a new target group. Go to EC2 → Load Balancer create a new listener for port 9200, and in default action use forward to and select your newly created target group.</li><li>create service.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/935/1*koHSX0sr5fTHjURar76uYQ.png" /></figure><p>2. Steps for Master1 Node</p><ul><li>use same step as above , in task definition make use of task definition which is for master1.</li></ul><p>3. Steps for Data Node</p><ul><li>use same step as above , in task definition make use of task definition which is for master1.</li><li>change number of tasks to 2. as we need 2 data node.</li></ul><p>Finally it should look something like this.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/971/1*vZ0gq5lKdpfBma6ku9TYcw.png" /><figcaption>services</figcaption></figure><blockquote>check whether targets are register to ALB.</blockquote><p>Finally we are done with Elasticsearch Setup Now we need to setup Kibana and Logstash.</p><h3>Kibana</h3><p>Learn more about kibana <a href="https://www.elastic.co/what-is/kibana">here</a>.</p><ol><li>Lets create a new task Definition for Kibana.</li></ol><ul><li>image: We will be using the default base image of kibana i.e kibana:7.7.0</li><li>Port mappings: expose 5601 on host and container, to launch new container on separate instance, in case if you have lots of free memory to run the container on single instance use 0 for host port. It will dynamically open a port on host.</li><li>Environment Variables: Add ELASTICSEARCH_HOSTS as key and make use of ALB DNS Name as value i.e ELASTICSEARCH_HOSTS <a href="http://alb-dns-name:9200/">http://ALB-DNS-Name:9200/</a></li><li>Volumes: we dont require volumes as kibana data are stored on elasticsearch data node.</li></ul><p>2. Lets create a new service using the Kibana task Definition:</p><p>Follow the same step as above change number of task to 2 to make it highly available, In Load Balancer just register a new target group with 5601 port and add new listener or forward traffic from port 80 to your kibana target.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/505/1*pStPVMR9fBLv3rfEhIuISA.png" /><figcaption>Kibana-Listener</figcaption></figure><p>Check whether targets are properly registered, if everything goes right then you may be able to access kibana dashboard using load balancer.</p><p>Now just go to your browser and type you ALB DNS Name (which you can get from Load balancer description) <a href="http://alb-dns-name:5601/">http://ALB-DNS-Name:5601/</a>.</p><h3>Logstash</h3><p><strong>Logstash</strong> is a light-weight, open-source, server-side data processing pipeline that allows you to collect data from a variety of sources, transform it on the fly, and send it to your desired destination. It is most often used as a data pipeline for Elasticsearch, an open-source analytics and search engine. If you want to learn more about logstash and its working its well documented <a href="https://www.elastic.co/logstash">here</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*SGTfhf9Y3NfKwsfg1rn4aQ.jpeg" /><figcaption>logstash-pipeline</figcaption></figure><p>Dockerfile</p><pre>FROM logstash:7.7.0<br>ADD  logstash.yml config/logstash.yml<br>ADD  logstash.conf pipeline/logstash.conf<br>USER root<br>RUN chown -R  1000:0 config/logstash.yml config/pipelines.yml  <br>USER logstash</pre><p>logstash.yml</p><pre>http.host: &quot;0.0.0.0&quot;<br>xpack.monitoring.enabled: false</pre><p>logstash.conf</p><pre>input {<br>beats {<br>    port =&gt; 5044<br>  }<br><br>s3 {<br>access_key_id =&gt; &quot;XXXXX-XXXXX&quot;<br>secret_access_key =&gt; &quot;XXXXX-XXXXX&quot;<br>bucket =&gt; &quot;XXXX&quot;<br>region =&gt; &quot;XXXX&quot;<br>}<br>}<br>output {<br>elasticsearch {<br>  hosts =&gt; [&quot;domain/alb:9200&quot;]<br>  index =&gt; &quot;s3-%{+YYYY.MM.dd}&quot;<br>}<br>}</pre><blockquote>Replace s3 credentials with your credentials.</blockquote><p>Following the step from elasticsearch to build image and then tagging the image and finally pushing the image to your ECR repository.</p><p><strong>Building Image</strong></p><pre>docker build . -t ${ACCOUNT_ID}.dkr.ecr.${REGION}.amazonaws.com/${REPO_NAME}:logstash</pre><p><strong>Pushing Image to ECR</strong></p><pre>aws ecr get-login --no-include-email --region ${YOUR_REGION} | bash<br>docker push ${ACCOUNT_ID}.dkr.ecr.${REGION}.amazonaws.com/${REPO_NAME}:logstash</pre><p>Now we are ready to Create Task Definition for logstash.After creating task definition for elasticsearch and kibana you may be familiar with the process. We will just change few things.</p><p><strong>Creating Task Defintion:</strong></p><ul><li><strong>Image</strong>: Use recently pushed image with tag logstash.</li><li><strong>Post Mapping</strong>: Expose 5044 for beats both on host and container.</li><li><strong>Environment Variables</strong>: LS_JAVA_OPTS as and -Xmx500m -Xms500m as value. Based upon the amount of data being transferred to elasticsearch you may want to increase it.</li></ul><p><strong>Creating Service:</strong></p><p>We will follow the same step for creating logstash service as well. In place of Load Balancer you have to make use of Classic Load Balancer as Logstash supports TCP traffic and not HTTP. Create a new classic load balancer and add 5044 as listener and use TCP protocol instead of HTTP.</p><p>Finally , we are done with ELK setup. After successful implementation of above you may verify that everything is working properly by opening Kibana on a browser and checking for s3 indices.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=dce98ed3edc0" width="1" height="1" alt=""><hr><p><a href="https://medium.com/opseco-technologies/what-is-an-elasticsearch-cluster-dce98ed3edc0">Deploying ELK on Amazon ECS</a> was originally published in <a href="https://medium.com/opseco-technologies">ProDT Consulting Service Pvt. Ltd.</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AWS Auto Scaling based on memory metrics]]></title>
            <link>https://medium.com/opseco-technologies/aws-auto-scaling-based-on-memory-metrics-6402b865dd7c?source=rss----3742944c6ece---4</link>
            <guid isPermaLink="false">https://medium.com/p/6402b865dd7c</guid>
            <category><![CDATA[autoscaling]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[windows-server]]></category>
            <category><![CDATA[cloudwatch]]></category>
            <category><![CDATA[custom-metrics]]></category>
            <dc:creator><![CDATA[Subhas Patil]]></dc:creator>
            <pubDate>Sat, 11 Jul 2020 05:37:36 GMT</pubDate>
            <atom:updated>2019-11-27T07:56:10.123Z</atom:updated>
            <content:encoded><![CDATA[<h3>AWS Auto Scaling based on memory metrics via CloudWatch</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/276/1*DSrZ4i9_0Kwx1f9tOshHxg.png" /></figure><p>We often come across situations where our application is more aggressive in terms of memory consumption and we want to scale our servers based on memory.</p><p>AWS offers the scaling policy but it is based on CPU utilization which is not relevant in a few cases. Here we are going to gather memory metrics from the servers launched under an Auto Scaling group into CloudWatch and then set an AWS scaling policy based on this.</p><p>We are following the process for Windows instance here but the core method remains the same for Linux instance as well.</p><blockquote><strong>Step 1: Create a file in the Parameter Store.</strong></blockquote><p><em>AWS</em> Systems Manager <em>Parameter Store</em> provides secure, hierarchical <em>storage</em> for configuration data management and secrets management. We are using the parameter store to keep our CloudWatch agent configuration file at a centralized location.</p><p>Go to <em>AWS System’s Manager -&gt; Shared Resources -&gt; Parameter Store</em> and create a file named “<strong>AmazonCloudWatch-windows</strong>” with the following content:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/8c86eaee39de2e4b1be4159d790bf5db/href">https://medium.com/media/8c86eaee39de2e4b1be4159d790bf5db/href</a></iframe><blockquote><strong>Step 2: Create an IAM role</strong></blockquote><p>By default, Systems Manager doesn’t have permission to perform actions on your instances. You must grant access by using an IAM instance profile.</p><p>Create an IAM role named “<strong>CW_Admin</strong>” with the following AWS policies:</p><pre>AmazonEC2RoleforSSM and CloudWatchAgentAdminPolicy</pre><blockquote><strong>Step 3: Create Auto Scaling</strong></blockquote><p>Create an auto-scaling group and launch a server with the “<strong>CW_Admin</strong>” role.</p><blockquote><strong>Step 4: Install SSM agent</strong></blockquote><p>AWS Systems Manager Agent (<strong>SSM Agent</strong>) is Amazon software that can be installed and configured on an Amazon EC2 instance, an on-premises server, or a virtual machine (VM). SSM Agent makes it possible for Systems Manager to update, manage, and configure these resources.</p><p>Login to the above-created server and install the SSM agent if it is not installed. SSM Agent is installed by default on all the new instances.</p><p>Follow the links to install the agents manually.</p><p><strong>Linux</strong>: <a href="https://docs.aws.amazon.com/systems-manager/latest/userguide/sysman-manual-agent-install.html">https://docs.aws.amazon.com/systems-manager/latest/userguide/sysman-manual-agent-install.html</a></p><p><strong>Windows</strong>: <a href="https://docs.aws.amazon.com/systems-manager/latest/userguide/sysman-install-ssm-win.html">https://docs.aws.amazon.com/systems-manager/latest/userguide/sysman-install-ssm-win.html</a></p><blockquote><strong>Step 5: Install CloudWatch agent via Run Command</strong></blockquote><p>You can install a cloudwatch agent manually or you can install via Amazon Run Command located in AWS System’s Manager.</p><p>Click Run Command and select “<strong>AWS-ConfigureAWSPackage</strong>”.</p><p>You will get a list of options which include:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/912/1*5B5H4P7ENLC00pzP1RG_yA.png" /></figure><p>Select the server manually in target section and click RUN.</p><blockquote><strong>Step 6: Configure Cloudwatch agent via Run Command</strong></blockquote><p>Next, we need to configure the agent to load the configuration file which we created on the Parameter Store. This makes the Cloudwatch Agent running on the server to export the Memory metrics to cloudwatch.</p><p>Click Run Command and select “<strong>AmazonCloudWatch-ManageAgent</strong>”.</p><p>Now the option contains:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/915/1*auOHadLRmnxP0LUMZgJzuA.png" /></figure><p>Select the server manually in target section and click RUN.</p><pre><strong>NOTE:</strong> Configuration Location is the important section where you will need to specify the name of Parameter Store file which we created in step 1.</pre><blockquote><strong>Step 7: Check Cloudwatch</strong></blockquote><p>Now you can see the Memory Metrics under <strong><em>Cloudwatch</em></strong><em> -&gt; </em><strong><em>Metrics</em></strong><em> -&gt; </em><strong><em>Custom</em></strong><em> </em><strong><em>Namespaces</em></strong><em> -&gt; </em><strong><em>Memory</em></strong><em> -&gt;</em><strong><em>AutoScalingGroupName, objectname</em></strong><em> -&gt; </em><strong><em>Auto Scaling Group Name</em></strong></p><blockquote><strong>Step 8: Launch Template</strong></blockquote><p>You need to create a new launch template again from this server and change the previously loaded launch template of the Auto Scaling group with the new one so that whenever the new server is launched under this Auto Scaling group then it contains all the configurations needed to push the memory metrics directly to the same cloudwatch path.</p><blockquote><strong>Step 9: Change Auto Scaling Policy</strong></blockquote><p>Create a cloudwatch alarm with this new custom memory metrics.</p><p>Now change the Auto Scaling Policy to include this alarm as a base point for adding or removing the servers under Auto Scaling.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/300/1*4N2Vdt78g4hAO7Cgpcwcfg.png" /></figure><p>Woohoo Congratulations, we have successfully created a custom memory metrics on CloudWatch.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6402b865dd7c" width="1" height="1" alt=""><hr><p><a href="https://medium.com/opseco-technologies/aws-auto-scaling-based-on-memory-metrics-6402b865dd7c">AWS Auto Scaling based on memory metrics</a> was originally published in <a href="https://medium.com/opseco-technologies">ProDT Consulting Service Pvt. Ltd.</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[DevSecOps: OWASP Dependency Checks in Jenkins]]></title>
            <link>https://medium.com/opseco-technologies/devsecops-owasp-dependency-checks-in-jenkins-b788127ec9ff?source=rss----3742944c6ece---4</link>
            <guid isPermaLink="false">https://medium.com/p/b788127ec9ff</guid>
            <category><![CDATA[cicd]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[opseco]]></category>
            <category><![CDATA[security]]></category>
            <category><![CDATA[jenkins]]></category>
            <dc:creator><![CDATA[Aniruddha Jawanjal]]></dc:creator>
            <pubDate>Tue, 07 Jul 2020 12:57:16 GMT</pubDate>
            <atom:updated>2020-07-07T12:35:51.897Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Adding Sec in DevSecOps</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/974/1*tyhOGZVyHr_BOxwtniV-Aw.png" /></figure><p>We use OWASP dependency check plugin in Jenkins To detect known vulnerabilities in a project’s dependencies. It does this by scanning the project to detect references to components that have been assigned CVE (Common Vulnerability and Exposure) entries, and to report these known vulnerabilities to the developers.</p><p>Adding the OWASP Dependency Check plugin to our pipeline is a simple first step to reduce the attack surface which is easy to implement, as it requires no server reconfigurations or additional servers in order to work. In its most basic form, it is simply to install the plugin and roll out.</p><p>To perform this check, we installed <a href="https://plugins.jenkins.io/dependency-check-jenkins-plugin"><strong><em>OWASP Dependency-Check</em></strong></a> plugin in Jenkins server.</p><p>After installation, the plugin needs some basic configuration in order to become operative. Go to <strong><em>Manage Jenkins &gt; Global Tool Configuration</em></strong></p><p>and scroll down to Dependency-Check and click <strong><em>Add Dependency-Check</em></strong>.</p><p>We can name the Dependency-Check installation anything we want, but if we add multiple installations, descriptive names help distinguish between them. To install the plugin, we can use our own installation files or use the default files hosted by Bintray.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LQl8OvjWd-Xlx1bS6IYS0w.png" /></figure><p>To start using the plugin, you need to edit the configuration of your project. First, we need to add the plugin as a build step. Go to <strong><em>{Your project name} &gt; Configure and add “Invoke Dependency-Check”</em></strong> to the build process.</p><p>Choose the installation that you created earlier. For now, you can leave the Arguments field blank.</p><p>For the plugin to be able to fail a build, we need to process the dependency-check results as a post-build action. <strong><em>Add “Publish Dependency-Check results” </em></strong>to the post-build process.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*beJgYNbHA-ewztSLt1Lbew.png" /></figure><p>After running your first build, you will get a new graph on the main project page. This graph will show you the number of findings that the plugin has discovered in the project and allows you to see trends over time.</p><p>We did not get any dependency issue yet, so we can’t see any changes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/982/1*U-cUpkaZI0NiQILijioSAA.png" /></figure><p>The results page is parsing the XML file that the plugin has generated during the build process. The raw xml version of the report is stored in the projects workspace and can be downloaded from there.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b788127ec9ff" width="1" height="1" alt=""><hr><p><a href="https://medium.com/opseco-technologies/devsecops-owasp-dependency-checks-in-jenkins-b788127ec9ff">DevSecOps: OWASP Dependency Checks in Jenkins</a> was originally published in <a href="https://medium.com/opseco-technologies">ProDT Consulting Service Pvt. Ltd.</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Assign Fixed IP to AWS API Gateway]]></title>
            <link>https://medium.com/opseco-technologies/assign-fixed-ip-to-aws-api-gateway-fb72507a2883?source=rss----3742944c6ece---4</link>
            <guid isPermaLink="false">https://medium.com/p/fb72507a2883</guid>
            <category><![CDATA[lambda]]></category>
            <category><![CDATA[nginx]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[api-gateway]]></category>
            <category><![CDATA[serverless-architecture]]></category>
            <dc:creator><![CDATA[Aniruddha Jawanjal]]></dc:creator>
            <pubDate>Mon, 29 Jun 2020 16:31:17 GMT</pubDate>
            <atom:updated>2019-10-09T14:02:49.600Z</atom:updated>
            <content:encoded><![CDATA[<h3>The interesting use case of assigning fixed IP to AWS API Gateway!!</h3><p>Can you assign a fixed IP to API Gateway?</p><p>Well... Sure, you can. You shouldn’t though.</p><p>But hey, the world is not perfect. And in this imperfect world, you still need to Whitelist Static IPs on the firewalls. These firewalls are stubborn enough to not to accept the CNAME or service endpoints of API Gateway 😔. These things still happen in the world of serverless applications!!</p><p>So, here we are — assigning a fixed IP to an API Gateway.</p><p>We have this typical serverless app that uses API Gateway, Lambda, DynamoDB. Normally, our request flow looks like this —</p><p><strong>User Request → Domain Name(Route53) → API Gateway (CNAME) → Lambda → DynamoDB</strong></p><p>If you’ve been worked with AWS even for a while, you will notice that AWS provides <a href="https://docs.aws.amazon.com/general/latest/gr/rande.html">service endpoints</a><strong> </strong>for its different services like RDS, Cloudfront, ELB, etc. and the IP for these services keeps changing. Now, we are hosting a telecom app that needs a fixed IP for inbound and outbound traffic. This is where things get complicated.</p><p>As our Lambda jobs are within Private Subnet, it’s naturally using NAT Gateway for outgoing traffic. As you know, NAT Gateway has fixed IP so we are good as long as outgoing traffic is considered.</p><p>For incoming traffic — we can have a simple reverse proxy. But the problem with that is, the number of requests can change from tens thousand to million on a daily basis. So, we came up with this —</p><p><strong>User Request → Domain Name(Route53) → EC2 (Nginx Reverse Proxy with Fixed IP) → API Gateway (CNAME) → Lambda → DynamoDB</strong></p><p>But the problem with this approach is — it’s Not scalable enough!!</p><p>So, we had to improvise. That’s where the Network LoadBalancer and Autoscaling helped us out. NLB was a no-brainer for below reasons</p><ul><li>Ability to handle volatile workloads and scale to millions of requests per second.</li><li>Support for static IP addresses for the load balancer</li></ul><p>With Autoscaling, We are mitigating future problems like</p><ul><li>No unnecessary cost for big EC2 instances</li><li>Reverse Proxy implementation will be scalable as requests increases</li></ul><p>Now, this is how our architecture looks:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*b1brfD4UDjkKme4y78wW2A.png" /><figcaption>NLB(Elastic IP)-EC2(Elastic IP — Nginx Reverse Proxy)-API_Gateway-Lambda</figcaption></figure><p>So, that’s about theory.</p><p>Let’s take a look at practical. Now I have an LB which accepts traffic over HTTPS and HTTP — which will forward traffic to Nginx over HTTP which in turn forwards the traffic to API Gateway which has HTTPS service endpoint.</p><p>For now, we will take a look at the configuration that we implemented for Nginx reverse proxy to API Gateway.</p><p>First, I needed to configure the SELinux for Nginx to allow Nginx network connections as I was using an RHEL Instance. If you’re using Ubuntu, you don’t need to worry about this.</p><blockquote>setsebool -P httpd_can_network_connect</blockquote><p>Now — that’s one issue solved. The next challenge was the dynamic IP of API Gateway. Nginx tends to resolve the IP when it starts, reloads or restarts. In case of IP change for API Gateway, that would cause us a bit of trouble. So, this is where <strong><em>resolver</em></strong> comes into the picture.</p><p>The resolver directive updates the IP of the upstream server when valid=time is expired.</p><p>As we have hosted the our server in AWS VPC, I had to execute this to get AWS Resolver IP</p><pre>[root@ip-xx-xx-xx-xxx ~]# grep nameserver /etc/resolv.conf | cut -d &quot; &quot; -f2 | sed &#39;s/\\./\\\\./g&#39; | sed &#39;s/\\\\//g&#39;<br>10.0.0.2</pre><p>The resulting IP ‘10.0.0.2’, used as a resolver in the Nginx Proxy Pass configuration. The Nginx configuration as below</p><pre>map $http_host $prefix {<br>        default &quot;&quot;;<br>    }</pre><pre>map $http_host $served_host {<br>        abc.xyz.com abcpqr.execute-api.us-east-1.amazonaws.com;<br>    }</pre><pre>server {<br>        listen       80 default_server;<br>        listen       [::]:80 default_server;<br>        server_name  abc.xyz.com;<br>        root         /usr/share/nginx/html;<br>        include /etc/nginx/default.d/*.conf;</pre><pre>if ($http_x_forwarded_proto = &#39;http&#39;){<br>     return 301 <a href="https://$host$request_uri/">https://$host$request_uri</a>;<br>     }</pre><pre>location /_proxy/healthcheck {<br>            return 200 &#39;{&quot;status&quot;: &quot;ok&quot;, &quot;message&quot;: &quot;proxy is in service&quot;, &quot;instance&quot;, &quot;i-3432523656d60q34a&quot;}&#39;;<br>            add_header Content-Type application/json;<br>        }</pre><pre>location / {<br>            resolver 10.0.0.2 valid=0s ipv6=off; #DNS IP <br>            proxy_pass <a href="https://$served_host$prefix$uri$is_args$args/">https://$served_host$prefix$uri$is_args$args</a>;<br>            proxy_set_header Host $proxy_host;<br>         proxy_set_header X-Real-IP $remote_addr;<br>            proxy_buffering off;<br>            client_max_body_size 0;<br>            proxy_read_timeout 600s;<br>            proxy_redirect off;<br>         proxy_ssl_server_name on;<br>            proxy_ssl_protocols TLSv1 TLSv1.1 TLSv1.2;<br>        }</pre><pre>}</pre><p>And restart the Nginx.</p><p>This is how my friends we attach the Elastic IP to an API Gateway.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fb72507a2883" width="1" height="1" alt=""><hr><p><a href="https://medium.com/opseco-technologies/assign-fixed-ip-to-aws-api-gateway-fb72507a2883">Assign Fixed IP to AWS API Gateway</a> was originally published in <a href="https://medium.com/opseco-technologies">ProDT Consulting Service Pvt. Ltd.</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Cloud Migration Case Study for scalable Travel Website]]></title>
            <link>https://medium.com/opseco-technologies/cloud-migration-case-study-for-scalable-travel-website-cd4bb243586f?source=rss----3742944c6ece---4</link>
            <guid isPermaLink="false">https://medium.com/p/cd4bb243586f</guid>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[cloud-migration]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[opseco]]></category>
            <category><![CDATA[aspnet]]></category>
            <dc:creator><![CDATA[Aniruddha Jawanjal]]></dc:creator>
            <pubDate>Mon, 29 Jun 2020 16:30:52 GMT</pubDate>
            <atom:updated>2020-05-20T10:36:21.844Z</atom:updated>
            <content:encoded><![CDATA[<p>Travelsouq had an on-prem infrastructure, consisting of 10 servers of varying age &amp; specification, split across different racks in a single datacenter. The setup was a mixed bag of issues related to performance, reliability and options for rapid recovery. A major architectural review was required. Various options were analysed including in-house replacement, hybrid solution across cloud and in house setup and private cloud deployment.</p><h3><strong>The Solution</strong></h3><p>After review of current &amp; longer term business requirements, a number of basic viable options were identified.</p><p>After considering a design review of those options, it came down to two specific options — either a hybrid solution with a mix of local and public cloud services, or a complete IaaS (Infrastructure as a Service) migration.</p><p>These two options were fully reviewed and costed. It quickly became clear that a full IaaS migration would manage to avoid a lot of design compromises associated with hybrid deployment. The decision was made to deploy an AWS Solution capable of handling the demands of thousands of users and unplanned requests sent by partners.</p><p>Every part of existing IT infrastructure was challenged to determine its business fit and value. Its lifecycle position and future return on investment.</p><h3><strong>The Benefits</strong></h3><p><strong>Agility</strong></p><p>Servers, storage, networking and overall compute capacity are constantly being refactored and adjusted to align tightly with the business needs during a phased project approach.</p><p><strong>Flexibility &amp; Saving Capital Expenditure</strong></p><p>In a traditional local infrastructure, the infrastructure would have taken months to procure and deploy; and the business needs would have had to be shoe-horned into what was purchased regardless of fit. During COVID-19 crisis, the travel industry was badly affected and the demand reduced. The infrastructure was scaled down by 60% without any manual intervention and saved OPex cost which is important for business during these times.</p><p><strong>Resilience</strong></p><p>Even during the time of global pandemic, Travelsouq is able to run business as usual, with rapid recovery of IT infrastructure and data in the cloud.</p><h3>TravelSouq Migration Implementation</h3><p>Travelsouq is a leading travel website in the Middle east with thousands of users using it per day. Our challenge was to create a scalable infrastructure that can handle changing demands and also reduce the time to release the new features.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*r7OU45zRPNWIrB3i" /></figure><h3><strong>Strategy</strong></h3><p><strong>Assess the present infrastructure</strong></p><p>To get a present demand for a website, we used monitoring metrics like memory, CPU, network usage and number requests over a 24 hours period on normal days. A typical pattern emerged with changing demand for services over the 24-hours span as most of the users were located in one geographical area.</p><p><strong>Create infrastructure architecture plan for cloud</strong></p><p>We needed an autoscaling based infrastructure to meet the unpredictable user patterns. Also, we needed to configure continuous integration and deployment, all round monitoring and alerting, implement the standard security patterns for any exploit attacks on a B2C website. We had to optimize the infrastructure to reduce latency for end users.</p><h3><strong>Implementation</strong></h3><p><strong>Processes &amp; Tools</strong></p><ul><li>Configuration Management as a code</li><li>Infrastructure as a code</li><li>Continuous integration and deployment</li><li>On-demand Scaling</li><li>Web Application Firewall</li><li>Code quality assessment</li><li>Code Vulnerability assessment</li><li>Caching and content delivery</li><li>User request logging</li><li>Application Error logging</li></ul><p><strong>Configuration Management</strong></p><p>We used configuration management systems to install and configure packages, webserver and application server configurations. This way, there were no surprises when the configuration changes were needed to be rolled out. These changes were tested in staging environments along with application code. Once validated, these changes were rolled out in production. This enabled us to avoid any surprises in production infrastructure.</p><p><strong>Infrastructure as a code</strong></p><p>In the cloud, everything can be described as an API call. Over the period, if we miss any infrastructure change to document, it becomes difficult to point out the change if not documented. We created an immutable infrastructure with IaaC tools. If required, we could spin up a replica setup in a matter of minutes. This helped us a great deal to spin up the same infrastructure in different geographies with minor changes.</p><p><strong>Continuous integration and deployment</strong></p><p>To reduce the time to push new features, we set up deployment pipelines that automated the process of sending data to staging as soon as new changes were made in a specific branch. This enabled developers and QA teams to have more confidence in the new implementation while saving precious time. With agile methodologies, we were able to provide the new changes on demand as per business requirements.</p><p><strong>On-demand Scaling</strong></p><p>We meet consistently changing demands, we implement auto scaling to meet the changing demands. With usage metric patterns over user requests on load balancers, or memory utilisation of processing servers which enabled us to meet unexpected spikes and also save the infrastructure cost when demands were low, without any manual intervention.</p><p><strong>Web Application Firewall</strong></p><p>A major challenge to any B2C websites are common web security flaws which are consistently exploited by hackers or bots like cross site scripting, SQL Injections etc. This can cause business data loss, data breach of trusted user data. We implemented automated webapp firewalls which cover custom designed rules and common web exploits and secure the website from any such attempts.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*44EsFkP0PVgbIViG" /></figure><p><strong>Code quality assessment</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FqIF3xpdqWioH2CKsOJP1g.png" /></figure><p>We added tools for continuous inspection of code quality in our deployment pipelines to perform automatic reviews with static analysis of code to detect bugs, code smells, and repeatability. Thus, preventing issues even before they occur and also increase code quality.</p><p><strong>Code Vulnerability assessment</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/998/0*AJKLRSzlKzXc7QsV" /></figure><p>OWASP issues can be exploited by hackers to expose internal implementations. We have implemented code vulnerability checks to prevent these issues as they occur. These can be solved by developers right there to improve quality of code.</p><p><strong>Caching and content delivery</strong></p><p>To serve the user base spanning over multiple geographical locations, it becomes necessary to enhance user experience with reduced latency. As most of the first time users will wait only for 5 seconds when loading your website.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*xlajGfVNGgmqehCd" /></figure><p>Also, we enabled detailed graphs to get insights about website performance and user interaction with our content delivery network systems.</p><p><strong>User request &amp; Application error logging</strong></p><p>We are using application access logging and user request logging to get insights to improve application performance and user experience. For eg., we used logging analysis tools to get specific error codes that can hamper the user experience. We used those error codes with application developers and solved those issues to provide streamlined experience for end users.</p><p><strong>Monitoring &amp; Alerting</strong></p><p>In today’s complex applications, we need detailed information about what’s happening in our infrastructure to assess and mitigate any unpleasant occurrences like downtime. That’s why we have an all round monitoring system in place which helps to get insights in present status, gets in-depth granular graphs and we can add custom plugins for application level monitoring. Also, we use a single dashboard to monitor different components — Cloud &amp; On-Prem with the same system.</p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*b31hiO4ynbDLRrXWEFF4aQ.png" /></figure><h3>Key Takeaways</h3><ul><li>Detailed analysis can help businesses identify the right cloud solution for their needs</li><li>Deploying software more frequently doesn’t have to mean reduced stability/reliability</li><li>Cloud capabilities can improve disaster recovery planning</li><li>When service costs are a concern, cloud’s flexibility may help</li><li>Improved stability and availability can be a big benefit of cloud migration</li><li>Business and user needs drive cloud needs</li></ul><p>We used our devops and cloud expertise to provide a scalable infrastructure solution to our clients. <a href="https://opseco.io/">Opseco Technologies</a> have proven processes and expertise in tools to achieve your cloud objectives.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cd4bb243586f" width="1" height="1" alt=""><hr><p><a href="https://medium.com/opseco-technologies/cloud-migration-case-study-for-scalable-travel-website-cd4bb243586f">Cloud Migration Case Study for scalable Travel Website</a> was originally published in <a href="https://medium.com/opseco-technologies">ProDT Consulting Service Pvt. Ltd.</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>