Application Integration

What is API Security? What you need to know

APIs and security

APIs are the building blocks of extraordinary digital experiences, but if you’re not properly managing them, they can also be a security risk. It seems like every day, you hear about improperly-exposed APIs and major security leaks.

Healthcare data breaches hit an all-time high in 2021, and Gartner predicted that API hacks would become the most common form of cyberattacks in 2022. Mobile phones now generate more traffic than desktops, and that means people are using apps daily around the world – providing a larger surface area for potential attacks and security risks.

Approach API security from multiple fronts

If you are building APIs – and you should be – you need API best practices to be successful. To open up your APIs to a larger ecosystem and develop partnerships, it’s time to gear up for the battle of possible breaches.

So, what is API security?  To protect your APIs, you need to secure and operationalize new and existing APIs by implementing a defense-in-depth strategy, regardless of development or deployment. Take a layered approach to make sure that your APIs are secure from end to end.

Here are some considerations on API security best practices, what API security is important to prioritize, and how to choose the right API security tools.

Authenticate, please

One measure that is almost always needed early in the transaction flow is to authenticate. User authentication discovers the identity of the end user from a token or process flow, often alongside API key/secret validation to identify an application and device registration to identify a particular user-app-device combination.

User authentication often depends on integration with an internal or external identity store, which will vary based on the potential audience for your application, whether employees, B2B partners, or consumers. Authentication tokens themselves must then be secured to protect them from compromise or re-use.

Authorization

From there, you can authorize whether the user gets access to the API operations being called, and the data being returned. Authorization should be done at multiple levels of granularity, validating the access rights for both the user and application to a particular API, operation, and HTTP method.

The data being retrieved must also match the access rights of the authenticated user at both an object level (a patient can only get their own records) and at a field level (a customer shouldn’t see internal notes on their account). Axway Catalyst Erik Wilde shares a real-life example of how data vulnerabilities can come about in his discussion of API security best practices.

Traffic management

Managing the volume and rate at which transactions come into your applications can protect against denial-of-service attacks and other issues that would impact server performance or availability and degrade the end user experience.

Rate limits should be implemented to protect against specific clients or users, as well as globally to cover the overall traffic allowed across all clients. Individual APIs or operations may need custom rate limits to account for specific business impact, ability to scale, or infrastructure/resource costs.

Threat protection

It doesn’t always take a large volume of traffic to impact the security or availability of an API. It’s also important to protect against malicious messages that can leverage vulnerabilities to extract data, crash a server, or otherwise compromise the integrity of the application. Examples include SQL injection, code injection, and cross-site scripting attacks.

Some of these can be protected against with blacklists or filters that get updated after novel attacks are discovered, but this type of negative security model remains vulnerable to new and unexpected exploits.

A positive security model carefully defines the expected transaction structure, content, and volume, and rejects anything that doesn’t comply with that expectation. Leveraging schema validation, network whitelists, and other positive security methods in addition to more reactive approaches makes for a more comprehensive security posture.

In conjunction with careful traffic management, you can also protect against dictionary attacks and other brute force approaches that leverage otherwise valid requests.

Privacy and integrity

It is absolutely critical to make sure that transactions are flowing from end-to-end, device-to-server, without being intercepted or tampered with. Privacy must be ensured by protocol-level encryption throughout, and some use cases will require additional message- or field-level encryption.

Digital signatures can be leveraged for messages, fields, or authentication/authorization tokens to ensure that all parties involved in the transaction are legitimate and that transactions haven’t been modified to accomplish malicious goals.

API Gateway: Why you need it

While all these capabilities are important for securing your APIs, how you implement them is just as important. They rely on complex, ever-changing standards and specifications that are difficult to get exactly right, and they need to be quickly scalable across all your APIs.

These security policies should be configured, not coded, leveraging a specialized solution that conforms to the specifications but simplifies the developer experience.

An API Gateway offers just that: point and click policy authoring deployed to a robust, scalable enforcement point. It’s flexible enough to address your most sophisticated use cases, while removing the risk that an improperly coded security standard will introduce a vulnerability to your application.

As standards change or new vulnerabilities are discovered, you can rely on proven experts to keep the solution up-to-date and to align the gateway infrastructure/policy deployment with your modern development and deployment practices.

Threat analytics

Even with all these security mechanisms in place, it’s still difficult to protect an application if end-user credentials or devices are compromised, or if there is an internal threat.

In these circumstances, threat analytics can be a valuable addition to the stack, leveraging long-running patterns to identify anomalies in traffic volumes or schedules, user/role behavior, or multi-API call chains that might represent malicious activity. Threat analytics solutions identify these anomalies for additional research and potential mitigations, and they integrate cleanly with API gateway infrastructure.

Zero Trust

A zero-trust posture starts with the assumption that a breach has potentially already happened and that all requests can be hostile, and then leverages the above processes and tools to ensure that data and application assets are still protected. It grants “least access” privileges by default, with additional access granted only for specific need, to specific users/applications/devices, and constantly verified.

Authentication, authorization, and other security policies must be rigorous, context-based, and continually monitored. More than just an API security tool, an API gateway can be a key component in adopting a zero-trust model for your business.

As Erik Wilde says, security requires a combination of technology and processes.

A secure API management platform goes beyond the basics

Why is API management important? A comprehensive API security posture involves more than just securing the interfaces and provisioning access. It also includes managing the lifecycle of all your APIs and other application assets, to ensure you have visibility and control over your entire digital portfolio.

The Amplify API Management Platform discovers APIs deployed on and managed by many diverse API platforms, including cloud gateways from AWS and Azure; it also discovers unmanaged APIs from code repositories and other registries.

The Amplify Platform aggregates different asset types – REST, SOAP, GraphQL, gRPC, and events – in a unified catalog, and empowers providers to manage the API lifecycle and provide a rich consumer experience. With the Amplify Platform, you gain true insights into your digital assets around compliance, subscription, usage, performance, and more; additional governance can then be applied in the API Gateway to complete the picture.

An API management platform does more than just secure your APIs or enforce security policies. You can manage the entire API Lifecycle, maximize reuse, drive API consumption, increase organizational efficiencies, and monetize your assets. You can even use APIs to build a greener company or contribute to a fairer banking system. It’s time to start delivering secure business outcomes with your APIs.

Discover our checklist on 10 ways to stay ahead of rapidly evolving security threats.