Getting Security Testing Ready for the API-First
Total Page:16
File Type:pdf, Size:1020Kb
Same Same, But Different: Getting security testing ready for the API-first era How to prevent data breaches by proactively identifying API business logic vulnerabilities. July 2021 Table of Contents PAGE 3 Key Takeaways PAGES 4 – 7 The Importance of API Security Testing PAGES 8 – 13 Common Approaches to Application Security Testing Approach #1: Static Security Testing Approach #2: Dynamic Security Testing Approach #3: Penetration Testing PAGES 14 – 15 It’s Time for a Business Logic API Security Testing Approach PAGE 16 About Imvision The dawn of a new approach: Business Logic API Security Testing 2 Key Takeaways • APIs are growing in popularity but many organizations don’t even know the extent of their APIs and vulnerabilities. • API vulnerabilities often take longer to remediate than traditional application vulnerabilities, so identifying them early is important. • Hackers can easily probe available APIs for known and unknown weaknesses. • API security testing can be very valuable, but often falls through the cracks. • Common testing approaches, black-box and white-box testing, don’t really suit APIs well. Pentesting can be a good fit, but it’s very costly and lengthy. • Since there’s no user interface, having knowledge of the app’s internal workings can help you efficiently create functional tests for the business logic. • It’s essential to place APIs front and center in your security controls, towards adopting a Full Lifecycle API Security model. • Ideally, combining aspects of all these types of API security testing would create a grey-box solution that compensates for the weaknesses of each of these individual approaches. • Such a business logic approach would intelligently examine results of other test types and can adapt to apply improved tests, either automatically or manually. The dawn of a new approach: Business Logic API Security Testing 3 The Importance of API Security Testing While APIs have been around since the early 2000s, today, they are everywhere. APIs are now expected and demanded throughout the industry, and their use is still growing. And no wonder: APIs work like magic to interconnect disparate apps and devices, driving business synergies and efficiencies like never before. Figure 1: Growth in API use driven by cloud, IoT, and other open standards (Source: Informatica.com) In a 2021 survey, 73% of enterprises reported that they have more than 50 APIs, and this number is constantly growing. The dawn of a new approach: Business Logic API Security Testing 4 From a business strategy perspective, APIs give you unprecedented power to share back-end data and functionality with customers, business partners, and other stakeholders. And their usefulness continues to expand, thanks to the estimated 80 billion IoT devices that will be in use by 2025. Figure 2. Business goals driving API adoption (Source: “Gartner’s API Strategy Maturity Model”, 21 October 2019) When looking at these figures on the growing importance of APIs, the most important takeaway is for businesses today: APIs are no longer solely a developer component hidden deep in the stack. They have become a key business enabler, if not the core of a business itself when it comes to API monetization. But like any software component, APIs are bound to have security flaws. And if they’re not tested rigorously from a security standpoint, they also offer a huge array of new attack surfaces and expose you to unprecedented risk. It’s important to remember that APIs are more than just connectors; they shift your application’s functionality, often in unpredictable ways. For instance, they move much of the processing logic from the backend to the frontend, which comes with a lot more vulnerabilities and factors beyond your control, such as HTTP requests becoming far more complicated since they involve more parameters when you’re dealing with APIs. The dawn of a new approach: Business Logic API Security Testing 5 While API vulnerabilities become exploitable when deployed in production, they can still be discovered in a staging environment. The staging environment is essential because it lets your team perform a few essential pre-production steps: • Conduct QA and performance testing • Perform vulnerability testing and risk assessment • Handle integration testing to ensure all components (services, databases, and other dependencies) function as designed Waiting until production to discover API vulnerabilities can result in expensive delays on the road to production. In the past year, have you slowed down deployment to production (or considered to) due to API security concerns? Figure 3: 60% of organizations have had to slow deployment to deal with API security testing concerns This is the reason many companies are working to shift-left security and implement a DevSecOps approach. Shifting left has a number of proven benefits, as it can: • Lower costs with earlier detection • Reduce the Mean Time to Remediate • Ensure deployment to production without delays Many organizations are already convinced of the value of shifting-left security in general. By building testing into the software development lifecycle (SDLC), they ensure it is performed continuously throughout development to prevent bottlenecks near the end. Yet API security testing is often left out of the DevSecOps big picture. This is unfortunate, given that API vulnerabilities often take longer to remediate than traditional application vulnerabilities. In a recent Imvision survey, 63% of respondents reported that it takes longer to remediate API vulnerabilities; even responses of “about the same time” are not the best thing since there are more APIs, thus more vulnerabilities. The dawn of a new approach: Business Logic API Security Testing 6 And that number is likely to increase drastically with modern applications’ rapid adoption of and dependence on APIs. Compared to traditional application vulnerabilities, with API vulnerabilities your average time to remediation is: Figure 4: API vulnerabilities take much longer to remediate than traditional application vulnerabilities The industry is beginning to wake up to the importance of API security, as many organizations are also aware of the increase in API-based attacks and fear they are at risk: Do you feel your organization is at risk of suffering an API attack in the next 12–18 months? Figure 5: Over 70% of organizations believe they are at risk for an API attack in the near future Yet, the statistics reveal that many organizations struggle with understanding where to begin. While more than half of enterprise security leaders rate API security testing as one of their top-3 priorities to protect their APIs, just under half say they don’t yet have an API security testing solution fully integrated into their development pipeline. This ebook will walk you through what you need to know about API security testing. We’ll explore the pros and cons of the most common approaches before looking at a new method that combines the best of both worlds to save you time and money while maturing toward a Full Lifecycle API Security approach. The dawn of a new approach: Business Logic API Security Testing 7 Common Approaches to Application Security Testing How can you tell if a security test is effective? In general, test effectiveness is measured using various code coverage metrics to determine the percentage of the code, the number of statements, or the number of functions that have been tested. But these metrics don’t always include APIs or account for the complexities that they introduce into the testing setup. Because of some of the unique weaknesses APIs may introduce, they demand a greater level of coverage than traditional apps, as even an obscure and unintended pathway may be exploited; this is opposed to a traditional UI-based approach, which only allows for certain prescreened input. What this means, in short, is that many of the strengths of APIs - the reason the industry has rushed to adopt them - are also their greatest weaknesses from a security perspective, as shown in the following table. Strength = API Security Weakness APIs are designed to be flexible, The type of bugs that lead to attack vectors are at the business logic reusable and expandable. or business process level and are therefore challenging to identify during staging. APIs are designed to connect and Every API is unique and proprietary. As such, its software bugs and integrate multiple vendors and sources. vulnerabilities are unique and “unknown.” APIs let third parties customize their The types of requests the API will handle are unknown at the time of requests according to their needs staging and it’s hard for the test team to anticipate all possibilities. Table 1: Comparison table demonstrating how API strengths translate into inherent security weaknesses The dawn of a new approach: Business Logic API Security Testing 8 Hackers are fully aware of the potential for APIs to open up vulnerabilities in your app. Beyond traditional web application vulnerabilities, there are many more ways in which an API may be vulnerable. That’s why they have developed many different techniques to try to crack your app through its API. For instance, APIs are often attacked by legitimate, authenticated users that exploit the API using seemingly legitimate calls but with the intent to manipulate. The range of potential vulnerabilities within APIs creates a great need for rigorous and thorough testing approaches. Yet traditionally, one problem with API security testing has been that it’s usually handled separately from regular security testing. While unit and integration testing is taken care of during development, API testing is often handled as a separate task by QA. This sometimes means that API security testing can either fall through the cracks or be undertaken without sufficient awareness of the real risks involved. To ensure a comprehensive approach, we should first consider the most common approaches to application security testing.