APIs are becoming increasingly crucial for modern technology interactions, serving as a bridge between applications and legacy infrastructure. However, this connectivity can also make APIs vulnerable to attacks. According to Akamai, a leading content delivery network vendor, web application attacks have seen a 167% increase from 2021 to 2022. Furthermore, industry analyst firm Gartner predicts that APIs will become the primary attack vector for web applications in 2023.
In order to safeguard APIs against attacks, one effective strategy is to implement a zero-trust framework. This approach assumes that both users and devices are untrustworthy by default and requires continuous authentication and authorization to verify their trustworthiness. Only minimal access is granted for a limited period of time. Here are four ways to utilize the zero-trust model in order to enhance the security of APIs.
The first step in implementing zero trust is to gain a comprehensive understanding of the existing attack surface. This involves discovering and inventorying all APIs in use, assessing them for potential risks and weaknesses, and performing any necessary remediation. Various API discovery tools can be utilized to identify and evaluate all APIs within the IT infrastructure, including those that are public-facing, internal, or connected to legacy applications. These tools can also help identify functioning APIs that may still be connected to decommissioned applications. Once the inventory and assessment phases are complete, it is important to determine the ongoing necessity of each API, assess their security measures, and implement any necessary security enhancements or decommission those that are no longer required.
The second step involves assessing the data access of APIs and implementing policy controls. It is essential to document and manage the data that APIs have access to. Cloud database management software can be utilized to gain insights into which data APIs are currently accessing. Access control mechanisms within the database can then be employed to tighten API data access rights or reassign them as needed. In addition, zero-trust policies should be created and implemented for APIs. These policies should outline which users and roles are authorized to access different types of data, along with the specific conditions and locations of such access. This ensures that only active and secure APIs are able to access authorized data within the infrastructure. It is also important to consider investigating or destroying any data accessed by decommissioned APIs to minimize potential risks.
The third step focuses on implementing authentication and authorization measures for APIs. Authentication and authorization play a crucial role in maintaining zero trust. Each API should be treated as a resource, requiring users and devices to authenticate and obtain authorization before being granted access. It is recommended to utilize granular zero-trust access policies, such as the principle of least privilege, to control API access. Various authentication standards, including OpenID and OAuth 2.0, can be implemented to ensure secure API traffic. Additionally, authentication methods such as API keys, HTTP authentication, and JSON web tokens should be considered based on the specific API and its use cases. The preferred authentication method may vary depending on the level of security required, as API keys are relatively less secure compared to OAuth or JSON web tokens.
The fourth and final step involves implementing API rate limiting to mitigate potential attacks, particularly Distributed Denial-of-Service (DDoS) attacks. API rate limiting restricts the number of API calls per minute or hour, automatically rejecting any calls exceeding the established limit. More advanced rate limiting techniques take into account factors such as the day, time, geolocation, or frequency of API usage. By implementing rate limiting measures, organizations can prevent API services from being overwhelmed by malicious attackers deploying large volumes of API calls. To further enhance API protection, additional best practices should be implemented, such as encrypting requests and responses, recording APIs in an API registry, and securely managing API keys.
In conclusion, as web application attacks continue to rise, securing APIs has become of paramount importance. By adopting a zero-trust framework and following the recommended steps, organizations can significantly enhance the security posture of their APIs. This proactive approach will help mitigate potential vulnerabilities and ensure the integrity and confidentiality of critical data and infrastructure.

