<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Ashok Chakravarthi Nagarajan</title>
    <description>The latest articles on DEV Community by Ashok Chakravarthi Nagarajan (@ashokchakravarthi).</description>
    <link>https://dev.to/ashokchakravarthi</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F516691%2F449329c3-5e7a-4b89-8460-6cd8df8c938b.jpeg</url>
      <title>DEV Community: Ashok Chakravarthi Nagarajan</title>
      <link>https://dev.to/ashokchakravarthi</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/ashokchakravarthi"/>
    <language>en</language>
    <item>
      <title>Birth of Worker Microservice from Monolithic code</title>
      <dc:creator>Ashok Chakravarthi Nagarajan</dc:creator>
      <pubDate>Fri, 20 Nov 2020 09:36:48 +0000</pubDate>
      <link>https://dev.to/ashokchakravarthi/birth-of-worker-microservice-from-monolithic-code-6</link>
      <guid>https://dev.to/ashokchakravarthi/birth-of-worker-microservice-from-monolithic-code-6</guid>
      <description>&lt;p&gt;This story is all about the creation of TWO Microservices that were extracted from the Monolithic System.&lt;/p&gt;

&lt;p&gt;Domain: Online Bill Payment / Financial&lt;/p&gt;

&lt;p&gt;Tech Spec: Java, Spring Boot, PostgreSql, Redis, Kafka, Azure&lt;/p&gt;

&lt;p&gt;Whenever there is a repetitive work happening in any System, the idea of modularization should be implemented. The same thing happened in the project that I have been working on. I proposed this idea to my team with POC and felt heard, when the team and my boss appreciated my idea.&lt;/p&gt;

&lt;p&gt;Happily took my first step for this little milestone. There are many places in the monolithic system project calling the External Broker Service for the below needs:&lt;/p&gt;

&lt;p&gt;To fetch Bill details&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Company details that the bills were paid for.&lt;/li&gt;
&lt;li&gt;Paying the Bill through Integrated service.&lt;/li&gt;
&lt;li&gt;Confirming the Bill Payment.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Also there are other microservices that are calling these apis from many places directly to the Broker Service. I created the Worker/External Utility service that receives Internal http calls from these local services and makes External https calls to External Broker Service.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--H8tqDU08--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/d0wpx62h0o29ljj1w0a3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--H8tqDU08--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/d0wpx62h0o29ljj1w0a3.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Later at a point of time, the entire logic is of Worker Microservice consumption is developed as Jar file and added as a Dependency for all required Monolithic and other microservices. The microservice is now busy with serving the Centralized Traffic of 75% utilization every hour.&lt;br&gt;
The secondary microservice that I mentioned earlier was a Mocking Microservice for other consumer Services in development &amp;amp; UAT setups.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Unearthing Security issues in web apps Part-2</title>
      <dc:creator>Ashok Chakravarthi Nagarajan</dc:creator>
      <pubDate>Fri, 20 Nov 2020 09:35:48 +0000</pubDate>
      <link>https://dev.to/ashokchakravarthi/unearthing-security-issues-in-web-apps-part-2-5eph</link>
      <guid>https://dev.to/ashokchakravarthi/unearthing-security-issues-in-web-apps-part-2-5eph</guid>
      <description>&lt;p&gt;Secret way for Unprivileged user to see all Corporate Card transactions through a vulnerable api.&lt;br&gt;
OWASP Category: IDOR (&lt;a href="https://portswigger.net/web-security/access-control/idor"&gt;https://portswigger.net/web-security/access-control/idor&lt;/a&gt;)&lt;br&gt;
There is a famous Expense reporting app for Corporates and Enterprises. It had an api&lt;br&gt;
&lt;a href="https://expense.company.com/api/v1/banks"&gt;https://expense.company.com/api/v1/banks&lt;/a&gt;&lt;br&gt;
that gives the list of banks associated to the particular organization. It also had a parameter called entity which was the gateway to the vulnerability that I found.&lt;/p&gt;

&lt;p&gt;The typical value of the entity parameter was bank. I checked the same api with the param value card. It worked!! I successfully retried the list of card ids related to the Corporate account. Still one more way to complete the hack. We haven’t seen the list of transactions for the unprivileged the user like me.&lt;/p&gt;

&lt;p&gt;I completely scanned the application for the particular api. With tired less analysis and hardwork I finally found the api.&lt;br&gt;
&lt;a href="https://expense.company.com/api/v1/transactions?account_id=%7Bcard_id%7D"&gt;https://expense.company.com/api/v1/transactions?account_id={card_id}&lt;/a&gt;&lt;br&gt;
It gives me the list of corporate expenses that I was not supposed to view. That left the Company transactions exposed to simple staff user. Hard work paid off in form of bounty.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--1m8HNy2R--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/ueill2fycxvwgi0eq473.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--1m8HNy2R--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/ueill2fycxvwgi0eq473.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Thanks for reading. Happy Hacking!!&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Unearthing Security issues in web apps Part-1</title>
      <dc:creator>Ashok Chakravarthi Nagarajan</dc:creator>
      <pubDate>Fri, 20 Nov 2020 07:35:07 +0000</pubDate>
      <link>https://dev.to/ashokchakravarthi/unearthing-security-issues-in-web-apps-part-1-37d1</link>
      <guid>https://dev.to/ashokchakravarthi/unearthing-security-issues-in-web-apps-part-1-37d1</guid>
      <description>&lt;p&gt;Security is the most important area which many application developer’s and its management never invest on.&lt;br&gt;
Here is my story how did I find security issues effortlessly and got awarded with huge bounty.&lt;br&gt;
Jazz Cinemas-Avengers-EndGame IMAX&lt;br&gt;
Jazz Cinemas are the biggest Cinema Theatre Company in India. Where I was able to purchase 3 thousand Rupees worth movie tickets, cold beverages and snacks for me and my friends for just One Rupee. Yes you heard it right.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--cMwLhC4K--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/bwphkbrbp06daudh4xlu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--cMwLhC4K--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/bwphkbrbp06daudh4xlu.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The hacking technique was simple. I just intercepted the movie ticket cart Purchase call with the help of BurpSuite Community Edition app and modified the amount with Just one rupee for the movie Avengers-EndGame IMAX.&lt;br&gt;
Tada!! The Purchase was successful. I was not sure if there will be a manual check at the Theatre, but there is none. Myself with my friends were able to go to the movie theatre with the hack produced ticket and even at the interval time we received our beverages and snacks.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--7tUnDffb--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/x7dolhl7cx3iomeuwi01.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--7tUnDffb--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/x7dolhl7cx3iomeuwi01.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;They didn’t find anything suspicious or the manual check even after 10 days of the Incident. Of-course what to expect from a corporate and the vulnerable IT team. But its time to be honest with the victims. I mailed them the vulnerability details and acknowledged the issue. Felt Proud!&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Cloud Service Performance Improvement</title>
      <dc:creator>Ashok Chakravarthi Nagarajan</dc:creator>
      <pubDate>Fri, 20 Nov 2020 07:33:43 +0000</pubDate>
      <link>https://dev.to/ashokchakravarthi/cloud-service-performance-improvement-na6</link>
      <guid>https://dev.to/ashokchakravarthi/cloud-service-performance-improvement-na6</guid>
      <description>&lt;p&gt;I have successfully completed more than dozens of Performance improvement operations in my apps hosted in Cloud. The recent encounter was very important one and I have set a significant milestone improvement.&lt;br&gt;
Tech Spec: Java, Spring Boot, MySql, Redis, Kafka, AWS.&lt;br&gt;
Let me jump into the details of what I have accomplished and how.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--XroaISr_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/gcarlac4lgvyhp78vaup.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--XroaISr_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/gcarlac4lgvyhp78vaup.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The Great Issue:&lt;br&gt;
Customers in an entire Data Center started facing slowness occasionally. The slowness issue started piling up over a period of time. In one fine day, all of a sudden we received lots of reports from customers.&lt;br&gt;
Solution:&lt;br&gt;
Phase #1: (Quick &amp;amp; Immediate Solution)&lt;br&gt;
To the rescue I volunteered the operation to lead and work in field. Application server logs are just fine, except some locks timeout logged here and there. I came up with the idea of increasing the lock time bit more, with below configuration.&lt;br&gt;
innodb_lock_wait_timeout=500&lt;br&gt;
which was 5 seconds of waiting time for the lock to release and acquire it.&lt;br&gt;
Good News!! The issues was temporarily solved. I knew it was not the permanent or Optimized solution. I started digging where is the real issue lies in code. In the Purchase Order (Module A) module flow, we have an option to create payments from bulk PO (Module A). The action dries up the MySql Thread Pool high by repeatedly calling DB read operations for the same Process Order (Module B) resources.&lt;br&gt;
With patience and Step by Step debugging I was able to find and reproduce the issue and I had planned for the fix. Caching to the Rescue.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--0aYsm_4m--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/xudbtex25fohp1hqvn64.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--0aYsm_4m--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/xudbtex25fohp1hqvn64.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Phase #2:&lt;br&gt;
With the help of simple HashMap to maintain the Process order (Module B) id and its associated objects. I was able to drastically reduce the unnecessary DB hits depends on the number of objects selected in bulk operation.&lt;br&gt;
Guess What!! I saved the day. That’s what I thought when I realized the local cache didn’t fully solved the issue, when the users’ of an org distributed and pursuing the operation. Thankfully I was able to identify the issue before shipping the solution to Production by implementing the solution with Redis.&lt;br&gt;
Phase #3: (Final Solution)&lt;br&gt;
Extracted the Purchase Order (Module A) and Process Order (Module B) handling code from the Monolithic Financial Application System to a separate Micro-Service.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--nlJZ-C5R--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/mi1pnkdqdcckd4o1d5lf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--nlJZ-C5R--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/mi1pnkdqdcckd4o1d5lf.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Have done end-to-end configuration from DB, Distributed Caching, AWS instance, BitBucket Code repo for the new PO (Module A &amp;amp; B)microservice.&lt;br&gt;
Hurray! Its up and live. Tiny ideas, hard-work and well planned execution yields more than 70% of time Saving in Latency.&lt;br&gt;
Results:&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--45JmzTGp--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/d846sgjk4iv0luu9mu1v.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--45JmzTGp--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/d846sgjk4iv0luu9mu1v.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Happy Coding!!&lt;br&gt;
— Ashok Chakravarthi&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
