<?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 Usma Khan on Medium]]></title>
        <description><![CDATA[Stories by Usma Khan on Medium]]></description>
        <link>https://medium.com/@usmakhan?source=rss-81b9122d2a33------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*4dTiw-DdHZBBxbRvwoXKGQ.jpeg</url>
            <title>Stories by Usma Khan on Medium</title>
            <link>https://medium.com/@usmakhan?source=rss-81b9122d2a33------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 23 Nov 2026 18:41:50 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@usmakhan/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[API Security 101:  Protecting Your Endpoints from Common Threats ]]></title>
            <link>https://medium.com/@usmakhan/api-security-101-protecting-your-endpoints-from-common-threats-0d9b9ec32ef6?source=rss-81b9122d2a33------2</link>
            <guid isPermaLink="false">https://medium.com/p/0d9b9ec32ef6</guid>
            <category><![CDATA[api-testing-automation]]></category>
            <category><![CDATA[api]]></category>
            <category><![CDATA[api-testing]]></category>
            <category><![CDATA[api-security]]></category>
            <category><![CDATA[api-gateway]]></category>
            <dc:creator><![CDATA[Usma Khan]]></dc:creator>
            <pubDate>Thu, 19 Sep 2024 16:36:32 GMT</pubDate>
            <atom:updated>2024-09-19T16:36:32.630Z</atom:updated>
            <content:encoded><![CDATA[<h4>Discover the essentials of securing your APIs against the most common and dangerous attacks.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*p0PvglfyhbW4dOHGjdGepQ.png" /></figure><p>APIs have enabled the advancement of digital ecosystems in the present Digital Information Age.</p><p>APIs are at the forefront of enhancing usability whether on applications, or making services inter-operate. Balanced technologies come with their set of limitations.</p><p>The accessibility and therefore the liability of APIs are a primary factor for unscrupulous individuals. If API management policies and practices are not adopted, the doors leading to the ‘treasures’ are wide open for anyone.</p><p>This article covers the basic principles of API security and narrows in on ways to secure your endpoints against frequent attacks.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FTXsiq3uD3Ug%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DTXsiq3uD3Ug&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FTXsiq3uD3Ug%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/63134e5e9fe7ccf28ec472ee4773befd/href">https://medium.com/media/63134e5e9fe7ccf28ec472ee4773befd/href</a></iframe><h3>Appreciating the Risks 🎯</h3><p>There are APIs and there are places where every defender dreads to venture. API is the weakest link within the IT infrastructure that has been exploited in some cases leading to compromised data and loss of services to organizations.</p><p>Look at companies like facebook and google. Both have had brutal meetings with API security challenges and tall ends. Be it you are a developer, an architect, or a security guru, learning the API security phd is not only nice to have; it is mandatory.</p><h3>Communication Rules on API Exposure 🛑</h3><p>Prior to looking into security guidelines, there is a need to address the average list of threats that APIs are likely to encounter. Let’s start with the very basic or the most known or the most popular type of threat which is known as the Injection Attack.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4bpwZrtVrZa6xZ-KGRRhrg.png" /></figure><p>Injection is understood sufficiently as a technique that bears clearly defined dangers. Injection attacks such as SQL injection or command injection are also referred to as the hitting injection and are considered attacks on the operating system.</p><p>Due to long usage of Internetwork and exposure towards malicious actors, every API is bound to be dangerous. Once some intrusion has taken place, the invader will generally try to retrieve as much information as possible that is in the application.</p><h4>Broken Authentication 🔓</h4><p>One of the main ways to authenticate users in APIs is using tokens. When these tokens are poorly designed or easily guessed, it becomes easy for an attacker to take over a user session and retrieve data that is not meant for them.</p><h4>Excessive Data Exposure 📤</h4><p>There are instances where APIs have been known to expose unnecessary and incidental information, or even sensitive information, which should not be the case in practice. Such weaknesses can be exploited by attackers to obtain data that is not supposed to be available to the public.</p><h4>Lack of Rate Limiting 🚫</h4><p>APIs are additionally protected against Denial of Service attacks by enforcing rate limits or thresholds to the number of requests from a given IP address.</p><p>Attackers do not need to worry if there are any other forms of this online service as all they can do is bombard your API with requests and bring your server down, thus resulting in a denial of service.</p><h4>Security Misconfiguration 🛠️</h4><p>APIs can be misconfigured when necessary endpoints or debugging modes are left open when Deployed or activated. Such misconfiguration presents attackers with the opportunity to carry out attacks on the system and gain access to sensitive information.</p><h3>Protecting Your APIs: Best Practices 🛡️</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3Xc13e0IP6NXZqD3BaDhJw.png" /></figure><h4>Use Strong Authentication and Authorization 💪</h4><p>Both auth processes can be seen as two sides of the same coin. Authentication determines the identity of a user while the authorization section provides the specific actions a user is permitted to execute. Here’s how to get it right:</p><ul><li>Implement OAuth 2.0: From OAuth 2.0, documentation on Security Best Practices, we find that most online services use this protocol to protect their APIs. Avoid abusing any stolen tokens and let them expire by issuing tokens with limited lifetimes and scopes.</li><li>Implement JSON Web Tokens (JWT): JWT are an authentication technique for APIs which requires less database intervention. Always ensure that the tokens have been signed and the signature verified before permitting access.</li><li>Do not depend on API keys alone: API keys are the lowest in the authentication hierarchy and this means that they can be compromised easily. It is best to use them in combination with OAuth.</li></ul><h3>Validate All Inputs 🧪</h3><ul><li>Do not trust user input. Always validate and filter input data before passing it into your application. This eliminates injection techniques and allows only clean data into your system.</li><li>Parameterize Your Queries: Do not let SQL injections come your way by flexible parameterized queries. This makes the appropriate action by preserving the primary input as information, not programming.</li><li>Limit Input Data: Request strictly the information required in your API calls. Restrict data types, data length, data formats in order to limit the exposure.</li></ul><h3>Implement Rate Limiting and Throttling ⏱️</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GS7N8cf5ryX83KynmW44hw.png" /></figure><p>The rate limitation techniques restrict how many API requests a particular client can send and in what time span. This is very important in avoiding excess requests and DDoS attacks.</p><ol><li>Set Usage Quota: It is advisable to have limits on how many requests a client can make. For example, for one API key, set a limit of 1000 requests per day.</li><li>Use a Gateway: Using a API gateway will enable you to set the aforementioned restrictions on a per API and tenant level without a significant amount of additional development work.</li></ol><h3>Encrypt Data in Transit and at Rest 🛡️</h3><p>Irrespective of the situation, data has to be secured in transit as well as in rest. Department of Justice SOVA Standards recommends use of cryptography for the security of unauthorized access.</p><p>Use HTTPS: Make sure that there are no plain http connections and always https only connections to prevent the dangers from passive eavesdroppers. This prevents anyone from intercepting or altering information transferred back and forth between the client and server.</p><p>Encrypt Sensitive Data: Ensure that sensitive data such as passwords and tokens are always stored in strong encryption formulas-(for instance-the AES-256).</p><h3>Monitor and Log API Activity 📈</h3><p>Sometimes it’s useful to log and monitor usages of the API while in other instances it is to detect abuse which explains the intent of the API.</p><p><strong>Implement Logging</strong>: Whenever an API request is made be it with a success or without success a log of the request should be maintained. This data is useful in identifying specific domains where possible attacks are concentrated.</p><p><strong>Set Up Alerts</strong>: Monitoring tools can help set and threshold on conditions and then triggers an alert for conditions which otherwise look unusual in volume, for example the number of try login attempts which appears to be abnormally high.</p><h3>Secure Your API Endpoints with CORS 🌐</h3><p>CORS, or Cross-Origin Resource Sharing, protects Endpoints on applications in a different Domain by controlling Endpoints in the browser- based application programing interfaces.</p><p><strong>Implement CORS Policies</strong>: There are some domains that are considered trusted domains therefore your API will be exposed to those domains only. Restict your Cors policy on where to make the requests from as well as the methods which can and cannot be used.</p><h3>Employ API Gateways for Added Security.</h3><p>Providing an extra layer of protection, API gateways provide a barrier which acts as the gate between the client and the services over the Internet.</p><p>Use an API Gateway: Gateways are loved since they can assist in the execution of various management tasks such as policy management, security, and usage analytics, therefore, they form a fundamental aspect of any API security framework.</p><p>Enable WAF (Web Application Firewall): A WAF can find and stop malicious requests before they reach your API.</p><h4>Version Your APIs and Deprecate Old Endpoints.</h4><p>By implementing API versioning you are able to make changes on your APIs while keeping the existing populations of clients intact. Old endpoints should be deprecated to minimize attack vectors.</p><ol><li>Use Semantic Versioning: Manage and document versions for example: v1, v2, release, etc. This juice the update process as well as assist in updating the users’ notifications with those changes.</li><li>Deprecate and Remove: When making an API update, make it a point to deprecate the older versions and remove them later to mitigate the chances of exposing the API to security vulnerabilities.</li></ol><h4>Controversial Take: Over-Reliance on Third Party Tools.</h4><p>A third-party tool such as an API gateway or a WAF may improve security but should not substitute basic security by design principles. A few developers make it or break it with WAFs or API gateways that it makes them irresponsible in secure API creation. Do not be that developer. Tools are the last mustard, not the panacea savior.</p><h3>Actionable Steps You Can Take Today ✅</h3><p>Audit For Logical Flaws Of Structural Components: First, examine the APIs you are already using for vulnerabilities. Evaluate the damage for certain at-risk endpoints and resolve it.</p><ul><li>Update Your Authentication: You are not using OAuth 2.0 or JWTs? That should be on a priority list to be fully implemented.</li><li>Implement Rate Limit: Rate limits should be applied to APIs so that they are not misused.</li><li>Monitor Traffic: Ensure that tools for logging and monitoring are implemented in order to manage API traffic.</li></ul><h3>Final Thoughts 🧠</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yymTTM3xaZVYbvCh18zTkg.png" /></figure><p>API protection cannot be achieved exhaustively. It is a continuous spiral as the level of threats improves.</p><p>The practices described here, if followed, can help you lower the chances of an attack remarkably. An API that is well protected is also protected on its usability trust of the users and clients.</p><p>Got thoughts or questions? 💬 Drop a comment below! Let’s have a conversation about how you are preventing unauthorized access to your APIs or if there are any problems you have.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0d9b9ec32ef6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Master API Security with Postman: A Step-by-Step Guide ✨]]></title>
            <link>https://medium.com/@usmakhan/master-api-security-with-postman-a-step-by-step-guide-a1d909a17cb0?source=rss-81b9122d2a33------2</link>
            <guid isPermaLink="false">https://medium.com/p/a1d909a17cb0</guid>
            <category><![CDATA[api]]></category>
            <category><![CDATA[newman]]></category>
            <category><![CDATA[postman-collections]]></category>
            <category><![CDATA[postman]]></category>
            <category><![CDATA[api-development]]></category>
            <dc:creator><![CDATA[Usma Khan]]></dc:creator>
            <pubDate>Tue, 17 Sep 2024 16:59:14 GMT</pubDate>
            <atom:updated>2024-09-17T16:59:14.722Z</atom:updated>
            <content:encoded><![CDATA[<h4>Master API Security with Postman: A Step-by-Step Guide 🔒✨</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CpM1sANpsZduDDAunV3bHg.png" /></figure><p>API security is an aspect that is often shortcut by many developers since the emphasis tends to be on the functionality. They inquire, “Does the API work?” without also making the follow-up, “Is the API secure?”</p><p>💥 Postman is where this created confusion can be prevented. This is not only used to test APIs; this is a very strong security testing tool that will help to reveal some lurking threats before the threat actors do.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FiSDjDweiiaU%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DiSDjDweiiaU&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FiSDjDweiiaU%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/6a37058300efeb65b5b37d583e3847eb/href">https://medium.com/media/6a37058300efeb65b5b37d583e3847eb/href</a></iframe><h3>Why is it Important to Secure Your APIs 🛡️</h3><p>In this world where everything wants to be connected, APIs play a pivotal role in the conversation between different services.</p><p>Were an API not properly secured, it would be an invite to bad actors. Recent studies have shown that almost 84% of all online traffic comprises API traffic, and that’s a huge target.</p><p>Hackers are aware of this and are always active seeking insecure APIs.</p><p>Do you want it to be reached that your API is the next security breach that no report can prevent?</p><p>😱 Probably not. So, let’s get to it using Postman tower, security testing everything around APIs in the process.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*164txjs3dpGhycsky6jgUQ.png" /></figure><h4>Step 1: Setting Up Your API in Postman 🛠️</h4><p>Before engaging in security-related activities, it is important to have your API in Postman. This step is quite simple:Create a new request in Postman by selecting New &gt; HTTP Request.</p><p>In this section, enter the API endpoint that you would like to test. For example, type ‘<a href="https://api.example.com/user">https://api.example.com/user</a>’.</p><p>Select one of the methods to be used for the request (GET, POST, PUT, DELETE, etc.).</p><p>Keep the request in a collection for quick access later on.</p><p>Postman users who’ve never been through this process before will probably find this process quite confusing.</p><p>But believe me, once you get over that initial frustration you will, as I did, wonder how you wore it out just testing APIs without Postman. 💡</p><h4>Step 2: Authentication Issues Testing 🔑</h4><p>A common API problem is weak authentication. Testing this aspect involves:</p><p>Do an API request without authentication: Remove any normalization techniques, no API keys, no API tokens, no credentials and see if the API still responds.</p><p>If the API replies returning some data, that is a bad warning sign. 🚩 It means API access has been granted even without the proper authorization policies in place.</p><p>Program attacks in the high-level Postman tool. Attacks that employ automated tools that integrate with web APIs will focus on attempting multiple login attempts with the various allowed permutations of the passwords on every login request to check whether rate limiting or account lockout has been implemented.</p><blockquote>Value Adding Tip: Using the Pre-Request Script tab in Postman, automate the brute-force attack which allows for the entire password changing process to be processed in one request. Design a repetitive sequence that alters the API password in every request made to the server and analyzes the response received from the server.</blockquote><p>// Example Pre-request Script for Brute Force</p><p>for ( let i=0; i&lt;10 ; i++ ){</p><p>pm.environment.set(‘password’, ‘password’ + i) ;</p><p>Copy</p><p>}</p><h4>Step 3: SQL Assessment 🕵️‍♂️</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OkKmK3gmgxFJUKHakrxbNg.png" /></figure><p>Working with databases has a risk of exposing an API through SQL injection. Using Postman can assist in orchestrating such attacks:</p><p>One stores silicone hoping and one wishes that the API will work out. To do this, some SQL code is injected in the request body. For example: Enter ‘ OR ‘1’= ‘1’ — — in any query parameter.</p><p>When the API does not send out due data but sends out error messages, especially those that reveal database data, this is an opportunity for you to write a few lines of SQL and test out your newfound power.</p><blockquote>Contrarian View: Absurdly there are users who would state that SQL injections are outdated because of the emergence of ORM frameworks and prepared statements.</blockquote><p>It is not erroneous to say that most frameworks in the contemporary world provide some level of defense mechanisms.</p><p>For that reason it is extremely foolish and dangerous to test with no tools, although this is somewhat better than looking for testing only tools in the first place — i.e just assuming that it is fine to test your house lockdown if you have a lock in place. Do not rest. Even test! 🔐</p><h4>Step 4: Arms with Proper Information France and Data Exposure</h4><p>One of the most common reasons for data exposure is the excessive exposure given to the APIs. In order to simulate this:</p><p>Add requests from different user roles for example admin and regular user and test whether any sensitive data can be accessed by non-privileged roles.</p><p>Check whether any information pertaining to, for example, passwords, keys, or tokens were included in the APIs’ responses.</p><p>SIn case you think that the issue of Accidental Data Exposure is overstated then you would be wrong: 65% of companies had a case where their data was unintentionally exposed due to insecure APIs. Make sure you’re not part of that percentage.</p><blockquote>Pro Tip: Create Postman environment variables to accommodate different credentials of various roles during testing. It will ease the testing exercise.</blockquote><h4>Step 5: Fuzz Testing with Postman 🤯</h4><p>Such tests incorporate sending nonsensical data to your API to search for bugs or sensitive areas. So in Postman:</p><p>Create new request.</p><p>In the request body or parameters, input random data e.g. a lot of special characters or make long strings.</p><p>Look how API processes such data.</p><p>If the API fails and stops working or behaves unexpected, it could be a very clear indication that the API can be susceptible to other advanced intrusions.</p><h4>Step 6: Rate Limiting and Throttling 🚦</h4><p>Such measures are justified when it is critical to protect against misuse by limiting the number of actions availed to a user within a specified time limit. Here’s how you can test it:</p><p>Keep On Sending as much requests as possible to the API via Postman’s Collection Runner or via programming.</p><p>Check whether API begins refusing any requests after a set number of requests have been made. If that is not the case, cursing abuse of your API is a request collision resulting in a DoS attack (Denial of Service attack).</p><blockquote>Tip: For more complex test cases, it is possible to run scripts to the command line and run a simulated performance test using Newman as if multiple clients are accessing the API.</blockquote><h3>Postman Scripting for Advanced Security Testing 🧙‍♂️</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pAHWRPny6BB41Rpu3_uQJQ.png" /></figure><p>With Postman, users can also write scripts in the Pre- request Script and Tests tabs, which allows writing JavaScript scripts. This capability is useful also for security testing:</p><ul><li>Token issuance: In case of APIs where tokens are required, cover the process of obtaining the token in the Pre-request Script.</li><li>Request modification: Modify data in the request body to effectively send different requests.</li></ul><p>// Example Script to Modify Request Payload Dynamically</p><p>pm.request.body.raw = JSON.stringify({</p><p>“username”: “admin”,</p><p>“password”: “‘ OR ‘1’=’1&#39;”</p><p>});</p><h3>Conclusion 🎯</h3><p>However, API security testing is not a ‘point-in-time’ process. This is because API Security is an effort that will be an ongoing initiative which requires the right tools along with diligence.</p><p>With all the in-built features offered by Postman, you will be able to conduct pre-emptive strikes against threats and vulnerabilities before they are exploited by attackers.</p><p>There is a place for every functional requirement in Postman; whether it is testing the authentication mechanism or performing functional and negative tests with the API to reproduce scenarios of attacks, Postman has it all.</p><p>How recent were your attempts to identify insecurities in the APIs you developed? Feel free to leave comments with your answers! What difficulties did you encounter? Let’s talk about it! 💬</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a1d909a17cb0" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>