
It’s an expanding cloud landscape, and application programming interfaces (APIs) have become a connecting force in modern cloud infrastructure, with SaaS applications using these conduits to send and receive information between tools, apps, and IoT devices — and to ensure that data is shared where necessary.
However, the rise of API usage requires increasing diligence to ensure their security. This article will examine the core best practices of API security, including why many organizations should consider a dedicated API security solution.
What are APIs, and Why Do They Matter?
APIs ensure that enterprises can connect best-of-breed point solutions together into a unified technology stack by enabling different software systems, applications, or services to communicate and share data seamlessly. APIs provide standardized methods for requesting and exchanging data, letting disparate tools work together.
They’re immensely valuable in cloud computing, enabling the orchestration of services across diverse environments and multiple providers. They offer flexibility in building cloud-native applications, improving efficiency, and enabling policy enforcement across cloud services.
Additionally, APIs facilitate scalability, security, and real-time management of resources, making them crucial for a modern, agile enterprise.

Types of APIs
That need for flexibility and scalability has meant a proliferation of APIs in cloud architectures today. As cloud computing and microservices advance, smaller, independent services replace monolithic applications. However, each will require its own APIs to communicate. This service-oriented architecture increases the number of APIs as every microservice communicates with others via APIs. Add external services, from payment gateways to analytics tools or CRMs, and multiple APIs of different types have become commonplace.
APIs add complexity beyond their type. It’s also worth noting that other factors add to their complexity, from a lack of visibility to misconfigurations, excessive data exposure, inconsistent access control, third-party risks, and complex dependencies.
In addition, individual security concerns stem from different API types.
Private APIs
Private APIs are not meant for consumption outside the enterprise. These are typically created within engineering teams to connect custom systems or applications used internally. Because they’re inaccessible from the broader internet, these APIs are often the easiest to secure with cloud security tools and network gateways. Their primary security challenge is access control and authentication since they’re designed for internal use with restricted access.
Public APIs
As the name indicates, a “public” API provides broad access to certain features or data of a service, application, or platform. They’re accessible to external developers, third-party applications, and the general public. These APIs tend to be used to extend the functionality of a product or service, with third-party developers building applications or integrations on top of them. These APIs create the biggest security risk because of their public availability. Key challenges include rate limiting and throttling (which control the number of API requests a client can make within a specific time frame), data exposure, input validation and injection attacks, and encryption.
Partner APIs
These APIs are similar to public APIs, but the difference lies in access. Partner APIs are only made available to specific partner organizations, like customers, affiliates, or collaborators, to control access to different data or services. Permission is often managed with some form of authentication. The native integrations from SaaS applications fall into this category. Their more pressing security challenges include trust and authentication, granular access control, compliance and data protection, and monitoring and auditing.
Third-Party APIs
Third-party APIs are valuable because of the functionality they deliver. Developers use these to save time in development and incorporate specific capabilities or data quickly. Yet they come with an inherent lack of control over the external service, and organizations using these services must trust the security of their providers — but also mitigate security risks like data privacy and compliance, API reliability and availability, access control, and security monitoring and auditing.
Common API Protocols and Their Security Challenges
Each of the above types of APIs can operate on any of the standard communication protocols, adding another layer to their basic security requirements of access controls, encryption, monitoring, and validation mechanisms to mitigate vulnerabilities. The four most common are:
- REST
- SOAP
- RPC
- GraphQL

REST API Security Considerations
The Representational State Transfer (REST or RESTful) protocol is the most common, with 85% of APIs using this protocol. It’s lightweight and stateless (it doesn’t store user sessions), making it ideal for web and mobile applications, where speed and ease of use are key. It’s also easy to create, relying on standard, widely known HTTP protocol and easy-to-read data formats like XML and JSON. The simplicity of REST APIs makes them accessible but leaves them prone to misconfigurations. Securing REST APIs means:
- Consistent monitoring
- Strong authentication
- Encryption
- Proactive threat detection
SOAP API Security Considerations
Simple Object Access Protocol (SOAP) APIs have stricter standards than REST APIs, and are typically used where reliability, transaction security, and strict communication standards are crucial. It operates with more rigid protocols than REST, often in scenarios that require formal contracts between services, like financial and healthcare services and government data exchanges.
With SOAP APIs, security considerations include its built-in WS-Security, which adds layers for message integrity and confidentiality. That means that:
- SOAP messages can be encrypted and signed, ensuring unaltered data in transit.
- SOAP includes strong authentication mechanisms, like Security Assertion Markup Language (SAML), which adds a layer of trust between parties.
- SOAP can store data, maintaining state across operations. That makes it more useful for complex transactions and critical to keep secure. SOAP’s complexity can make it more difficult to implement than REST.
Remote Procedure Call (RPC) Security Concerns
RPC allows applications to execute procedures or methods on another system over a network. It’s used where direct, low-level communication is required, such as internal services or systems management. RPC is powerful but risky because of its direct nature, allowing fast, efficient communication between systems.
This protocol comes with its own security concerns, including:
- Direct access to services: RPC allows direct calls to execute functions remotely.
- Authentication and access control: To ensure only authenticated users can invoke remote methods.
- Input validation: While a concern for all APIs, RPCs are particularly vulnerable to infection attacks because they deal directly with function execution.
GraphQL Security Considerations
GraphQL is a more modern API protocol designed for efficiency and flexibility, allowing clients to specify the data they need from a service and reducing over-fetching and under-fetching issues common with REST APIs. It’s widely adopted for front-end applications where flexibility in data querying is a priority.
GraphQL empowers non-developers to write and understand data queries, but because of that power, it is often limited in scope. Security tools can reduce GraphQL APIs to their single HTTP endpoint without looking at queries individually.
Specific security concerns with this type of API include:
- Fine-grained access control: Since clients can query exactly what they need, organizations must implement fine-grained authorization to ensure users can only access what they’re permitted to. Field-level authorization is crucial to securing GraphQL APIs.
- Query complexity and Denial of Service (DoS) attacks: From excessively complex or nested queries.
- Authentication: GraphQL APIs can expose multiple data sources in a single session.
API Security Best Practices
As APIs proliferate, they present an expanded attack surface, making API security an indispensable component of an organization’s security strategy. Yet, the different types of APIs and their diverse protocols make a monolithic “API Security Strategy” a myth. Instead, multiple approaches are required to safeguard sensitive data, maintain compliance, and mitigate risks.
However, there are some foundational best practices to be aware of in API security.
Create and Maintain an API inventory
Without an accurate inventory, shadow APIs or undocumented endpoints may remain vulnerable to exploitation. Tools that dynamically catalog and map APIs in real time help security teams maintain a clear understanding of their API landscape, identifying risks like internet exposure, data sensitivity, and documentation drift, thus mitigating security threats proactively.

Identify API Risks & Vulnerabilities
Effectively securing APIs requires continuous identification and management of risks. Leveraging real-time monitoring tools, teams can assess vulnerabilities like insecure internet communication, outdated components, and API drift, where documentation and implementation fall out of sync. Detecting these issues early helps ensure APIs stay aligned with security standards throughout their lifecycle.

Use Encryption
Encrypting API traffic is a critical step in securing all types of APIs. Encrypting data both at rest and in transit means sensitive data remains unreadable to attackers, limiting the impact of any intercepted or extracted data. Using automated tools to detect and encrypt API communications helps organizations stay compliant with standards like GDPR and HIPAA, too.

Implement Strong Authentication and Authorization
API requests must be authenticated using modern protocols like OAuth or JWT, which work to securely transmit information or login without sharing credentials across the internet. It’s easier to ensure that robust authentication and authorization are protecting APIs by integrating runtime insights to verify identities and enforce granular access policies, ensuring the right permissions are enforced at every endpoint.

Use Rate Limits and Throttling
To protect APIs from being overwhelmed with excessive requests, implement rate limits and throttling. Controlling the frequency of API requests prevents abuse like Denial-of-Service (DoS) attacks or accidental overconsumption of resources by legitimate users. With rate limits and throttling, APIs remain responsive and secure under high loads.

Modern Challenges in API Security
The widespread use of APIs has made them attractive targets for cyber attacks, and has meant that organizations need to do more to secure their APIs than institute a static strategy and step aside. Achieving effective API security means monitoring emerging threats, implementing proactive defenses, and adapting to sophisticated attacks.
A few of the modern challenges facing API security processes include:
- The evolving nature of visibility into organization APIs: Much like internet-accessible assets, APIs can often function without full knowledge of the IT or security team, as business leaders can implement new services off the radar of security teams or across silos. Knowing which APIs are making requests within the corporate architecture is paramount.
- Understanding normal API traffic patterns in depth and at scale: APIs should function the same way each time, connected to the same two systems and communicating back and forth. But that’s not always the case. Understanding the normal traffic patterns of an API can help security teams better recognize when an attack may be in progress or not. Behavioral monitoring and analysis are key, but this can be challenging as the scope and sheer number of APIs grows.
- Staying a step ahead of dependencies: APIs might be developed using specific open-source projects or even be open-source themselves. Understanding any dependencies the API may or may not have can keep the security team aware of any possible risks, but achieving this at scale can tax even the best-resourced teams.
- Tracking identity and resource permissions: The modern challenge of API management goes beyond the access control on most teams’ radar. API sprawl, microservices, and hybrid cloud environments all add complexity that requires enforcing fine-grained permissions consistently. The complexity can result in over-permissioned APIs that open attack surfaces for lateral movement and data breaches.
There are multiple challenges in securing APIs today. Shadow APIs, API sprawl, and complex dependencies may all introduce vulnerabilities. First, organizations need a clear understanding of their APIs and how they communicate, and only then can they engage effectively to secure those APIs and keep scaling operations in the modern cloud.
Why Is API Security Important?
APIs are a fundamental building block of the modern digital landscape. Enterprise applications connect with each other using APIs to share data bidirectionally and ensure employees can perform their day-to-day jobs. Consumer applications use APIs to query data in backend systems, ensuring they deliver quick results at the moment they’re needed.
Because APIs provide a backend framework for a majority of cloud-native applications, like mobile apps, web apps, and SaaS products, securing them against attacks is vital. In fact, most internet traffic (71%) in 2023 was API calls. The typical enterprise site saw about 1.5 billion API calls in the same period.
The precipitous rise in API calls makes these connection points highly attractive for threat actors. Moreover, because APIs often expose application logic, resources, and sensitive data — including personally identifiable information (PII) – attackers have started to pay attention. Threat actors are now attacking APIs in higher and higher volumes.
API Security Risks: The OWASP Top 10
The Open Worldwide Application Security Project (OWASP) developed a list of the top 10 API security risks. Reviewing this list of common failures in APIs is a vital first step toward ensuring strong API security. The top 10 risks include:
- Broken object-level authorization: APIs often expose endpoints that handle object identifiers. This creates a wide attack surface of object-level access control issues, which can be resolved with object-level authorization checks in every function that accesses a data source using identification from the user.
- Broken authentication: Authentication mechanisms can be implemented incorrectly, which allows attackers to compromise tokens or exploit implementation flaws to assume other users’ identities temporarily or permanently.
- Broken object-property-level authorization: This category merges two older security risks – API3:2019 Excessive Data Exposure and API6:2019 – Mass Assignment – and focuses on the root cause: the lack of or improper authorization validation at the object property level. This leads to information exposure or manipulation by unauthorized parties.
- Unrestricted resource consumption: Satisfying API requests requires resources like network bandwidth, CPU, memory, and storage. Resources like emails, SMS, phone calls, and biometrics are available by service providers via integrations and paid for per request. Overloading the API with requests can lead to denial of service or higher operational costs.
- Broken function-level authorization: Complex policies for access control with multiple hierarchies, groups, and roles with an unclear distinction between administrative and regular functions tend to lead to authorization flaws. When attackers exploit these issues, they can access other users’ resources and/or administrative functions.
- Unrestricted access to sensitive business flows: This risk refers to APIs that expose a business flow, like buying a ticket without compensating for how the functionality could harm the business if automated and used excessively.
- Server-side request forgery (SSRF): Server-side request forgery (SSRF) flaws can happen when an API retrieves a remote resource without validating the user-supplied URI. This enables attackers to trick the application into sending a crafted request to an unexpected destination, regardless of whether it’s protected by a VPN or firewall.
- Security misconfiguration: APIs and the systems supporting them typically contain complex configurations meant to make the APIs more customizable. Software and DevOps engineers can easily miss these configurations or not follow security best practices when it comes to configuration, which opens the door to attacks.
- Improper inventory management: APIs often expose more endpoints than traditional web applications, making proper documentation vital. An updated inventory of hosts and deployed API versions is also critical to mitigate issues such as deprecated API versions and exposed debug endpoints.
- Unsafe consumption of APIs: Developers will often trust data received from third-party APIs more than user input and so tend to adopt weaker security standards. Attackers may go after integrated third-party services instead of trying to compromise the target API directly as a result.
Secure APIs with Upwind
The Upwind platform is purpose-built to secure all applications running in the cloud. Its runtime API security offering provides key protection for all APIs in real-time, protecting critical functions from external cyberattacks and configuration issues alike.
With Upwind, customers can:
- Discover & Catalog APIs – Discover and catalog APIs regardless of configuration or type, including HTTP, RESTful, GraphQL, SOAP, and more. Upwind provides insight with rich context around resources and endpoints, including internet exposure, ingress communication, drift detection, and sensitive data flows. Upwind also enables security teams to track and monitor API requests over time and view response codes.
- Scan & Test for API Vulnerabilities – Upwind empowers customers to focus on the most critical API vulnerabilities with a rigorous testing methodology to identify and address vulnerabilities for a proactive security stance. Upwind also features continuous automated scans for ongoing vulnerability assessments, reducing manual effort and ensuring real-time protection.
- Detect & Stop API Threats – Upwind continuously monitors API traffic for potential threats, including behavioral analysis to identify anomalous patterns. Upwind also integrates with automation workflows to provide a streamlined response to API threats.
To learn more about Upwind’s API security solution and advice on best practices, schedule a demo.
FAQ
What is an API for dummies?
An Application Programming Interface (API) is a set of rules that lets 2 different software programs communicate with each other. APIs can send and request information, allowing users to achieve the desired end result without needing to manually request, process, and format data themselves. APIs:
- Serve as middlemen for software. They get data from point A to point B, translating between systems. Like the tunnel between an airplane and its gate, an API saves users from complicated legwork and bridges 2 disconnected systems.
- Come with predefined rules. They follow rules and formats so systems understand how to send and receive data.
- Simple for users. They enable users to conduct business easily, providing features such as live-action shots of their next ride on its way, without requiring a visit to a GPS data site and manual data download.
- Faster for builders. By connecting to multiple sources via API, developers can add functionality to their own apps without having to build every feature from scratch. Want a payment processor? Map? Chat? APIs can help.
What is basic API authentication?
API authentication is a way to verify a user’s identity before granting access to data or services via an API. The easiest form of authentication is a username and password, which are sent with each API request to confirm authorization. Here’s how it works:
- The user or application sends a username and password along with a new request.
- Credentials are included in the request.
- Credentials are encoded but encryption is required for true protection.
- Basic authentication is vulnerable to attacks if credentials are intercepted. As a safeguard, authentication is often combined with https and API keys.
- More secure authentication exists. Some options are OAuth and API tokens.
How safe is an API?
An API’s safety depends on how it’s designed and used. APIs can be highly secured, but they can also be common attack targets. To be truly secure, an API needs strong authentication, encryption, protection, and monitoring. Consider the following:
- APIs can be vulnerable points, since they can expose sensitive data.
- Authentication matters. Secure APIs use methods like OAuth, API keys, or JSON Web Tokens (JWT).
- Rate limiting and throttling help. Setting limits on how often APIs can be called prevents Distributed Denial-of-Service (DDoS) attacks.
- Safety testing is also key. Teams can conduct penetration testing and audits to find vulnerabilities.
- Monitoring and logging help detect threats so they can be thwarted early. APIs should track access logs and suspicious activity to detect anomalous behavior and respond faster, so when attacks happen, damage is limited.
How do I know if an API is secure?
To determine if a team’s effort has made an API connection truly secure, verify the presence of key security measures, such as authentication, encryption, and monitoring. The most secure APIs follow best practices. A secure API is one with:
- Authentication: Require API keys, OAuth, or JWT tokens.
- Encrypted data: Use https, not http, to encrypt data in transit.
- Rate limiting and throttling: Prevent excessive requests that could allow denial-of-service attacks.
- Proper error handling: Don’t expose sensitive information in error messages.
- Solid security standards: Use industry standards, like OWASP API security and conduct regular audits.
What are API security terms?
Common terms around APIs describe key protections, threats, and technologies that teams can use to keep APIs safe. The basics include:
- Authentication: Verifying the identity of a user or system trying to access the API via API keys, OAuth, or JWT.
- Authorization: Controlling what authenticated users or systems can do within the API, for example, using role-based access control.
- Encryption: Securing data in transit (via HTTPS) and at rest in order to thwart unauthorized access attempts.
- Rate Limiting: Restricting how many API requests a user or system can make in a given period to prevent abuse. Rate limiting means APIs can’t be called constantly, and data can’t be instant and continuous. At the same time, the slight delay allows for greater security.
- Throttling: Slowing down API request rates when limits are reached so systems maintain stability.
- API Gateway: A security layer that manages authentication, rate limiting, and request filtering.
- CORS (Cross-Origin Resource Sharing): A security feature built into browsers that controls which external websites (origins) can access an API. Without CORS, browsers block cross-origin requests.
- OAuth: A secure authentication method that allows third-party applications to access user data without exposing passwords. Users log in and share information via one app without giving away their credentials to another.
- JWT (JSON Web Token): A digitally signed token format used for authentication and data exchange. Tokens can be intercepted, but allow for no session storage on servers, and can be encrypted.
- API Key: A unique identifier that acts as a password to authenticate API requests. API keys are sent with each request as a basic authentication method. API keys are less secure than OAuth or JWT.
- Man-in-the-Middle (MitM) Attack: A security threat where attackers intercept API traffic as it moves between a user and an API server. The attack may go unnoticed if the API response looks normal.
- OWASP API Security Top 10: A list of the most critical API security risks published by OWASP. They’re common, frequently exploited vulnerabilities that evolve with the changing threat landscape.
- Logging & Monitoring: Tracking API usage and detecting suspicious activity to identify potential security threats. It’s more important than in traditional applications since APIs are the conduits to data and services. Unlike internal applications, API data can be exposed publicly, making near real-time monitoring crucial.
- HMAC (Hash-Based Message Authentication Code): A security method that adds an extra layer of security to APIs. It cryptographically signs API requests to prevent tampering, and recipients then recompute the HMAC using the same secret key. HMAC both protects APIs and verifies the integrity of the request, so it’s resistant to being altered.
- mTLS (Mutual Transport Layer Security): A security mechanism where both the client and the API server authenticate one another using TLS certificates. It’s used in high-security environments, for financial transactions, or with internal microservices communication.
What is the difference between API security and application security?
API security secures communication between applications. It’s focused on endpoints, authentication, and data in transit. It handles threats like unauthorized access, data breaches, injection attacks, and API abuse, such as broken object-level authorization. It uses OAuth, JWT, mTLS, rate limiting, API gateways, logging, and monitoring.
Application security encompasses all aspects of an application. While similar issues, such as user authentication, are essential, they’re not all that is. Application security also covers security for an app’s frontend, backend, databases, and code vulnerabilities. It uses firewalls, secure coding, vulnerability scanning, penetration testing, and web application firewalls (WAFs).
API security is a part of broader app security.
How do you do API security testing?
API security testing can involve a mix of methods and manual checks. Here’s what to do:
- Map API endpoints, identifying all private and public endpoints.
- Attempt unauthorized access using expired or invalid OAuth or JWT tokens.
- Send rapid API requests to test for DoS protection.
- Perform injection attacks with SQL injection, XSS, and command injection with payloads.
- Check responses for sensitive data, like PII or API keys.
- Monitor logs and alerts for anomalies.
- Use security tools. Open-source options, like OWASP Zap can help with fuzzing and penetration testing.
What is the purpose of an API key?
API keys are unique identifiers used to authenticate requests. They control who can access an API. Their key uses are authentication, authorization control, rate limiting enforcement, usage tracking, and adding a security layer to help protect APIs.
API keys provide basic security. However, they’re often used in conjunction with OAuth or HMAC. That’s because they can be hardcoded in frontend code, mobile apps, or public repositories. API keys also have no expiration and lack more granular permissions. When API keys are intercepted, they can be used indefinitely with no added verification needed.
Can I secure an API without authentication?
Yes. Public APIs are often secured without authentication. Some ways to make it happen include:
- Rate limiting and throttling, which prevent abuse by restricting excessive requests.
- IP whitelisting, which allows access only from trusted IP addresses.
- CORS (Cross-Origin Resource Sharing) restrictions can limit access to approved domains.
- API gateway with traffic filtering and blocking malicious requests.
- Data masking and response filtering ensure that only the necessary data is returned.
- Monitoring and logging to ensure teams can detect unusual traffic patterns.
What is the API security lifecycle?
The API security lifecycle encompasses the protection of an API from design to deprecation, ensuring protection against threats throughout its lifecycle. There are 5 stages to keep in mind.
- Design and development, governed by secure coding practices, authentication, and authorization.
- Testing and validation, including penetration testing, fuzzing, and input validation, to identify vulnerabilities.
- Deployment and protection, enforcing policies like rate limiting, encryption (HTTPS), and API gateways.
- Monitoring and threat detection, tracking logs and anomalies, and spotting abuse patterns, often with SIEM tools.
- Versioning and patching, udpdating regularly.
What are the 5 methods of API?
There are http methods used to define how clients interact with resources on a server. The most common methods are:
- GET: retrieves data from the server
- POST: Creates a new resource, like a new user, on the server
- PUT: Updates an entire resource, replacing data
- PATCH: Updates part of a resource, changing specific fields only
- DELETE: Removes a resource from the server
The methods define how an API handles data retrieval, modification, and deletion. Most REST APIs follow these 5 methods, but not all APIs implement all of them. Some may only support GET (read-only APIs), while others may restrict the ability to DELETE. While every API has its own data models and authentication rules, the ways these methods are implemented follow common patterns, since most frameworks provide built-in functions to standardize API development..