You’ve probably heard of the Internet of Things (IoT); all those everyday objects that incorporate computing functions. For example, the IoT allows you to connect your phone to your refrigerator. This way, you can know exactly what to buy at the supermarket for that impromptu dinner that night. Perhaps you’re part of a DevOps team, using microservices and containers to build and deploy legacy and cloud-native applications quickly and iteratively. APIs are one of the most common methods of communication between microservices and containers, as are systems and applications. But have you considered some of the key aspects of API security?

DreamFactory Hosted Trial Signup

Generate a full-featured,documented, and secure REST API in minutes.

Sign up for our free 14 day hosted trial to learn how.

Why is API security important?

Companies use APIs to connect services and transfer data. The most significant data leaks are due to faulty, vulnerable, or hacked APIs, as these can reveal sensitive medical, financial, and personal data to the general public. That said, not all data is created equal and does not require the same level of protection. Your API security strategy should depend on the type of data being transferred.  

If your API connects to a third-party application, you need to consider how that application redistributes information to the Internet. To use the example above, you may not care if someone finds out what’s in your refrigerator, but you’d be more concerned if they could use the same API to locate you. 

What is REST API security and SOAP API security?

Web API security is about data transfer via APIs connected to the Internet. For access delegation, there is an open standard called OAuth (Open Authorization). It allows users to grant third parties access to web resources without having to share their passwords. OAuth is the standard protocol that allows you to share, for example, a dog video on social networks by simply pressing the “Share” button.

REST APIs are based on HTTP and support Transport Layer Security (TLS) encryption. The TLS standard keeps an Internet connection private and ensures that data exchanged between two systems (a server and a server, or a server and a client) is encrypted and unmodifiable. In other words, if a hacker tries to steal your credit card information from an online shopping site, he will not be able to read or modify it. When a website is TLS-protected, its URL begins with “HTTPS” (HyperText Transfer Protocol Secure). 

REST APIs also use the JSON (JavaScript Object Notation) file format, which facilitates data transfer via web browsers. By using the HTTP protocol and JSON format, REST APIs do not need to store data or recreate packets, making them faster than SOAP APIs.

SOAP APIs, on the other hand, use built-in protocols known as WS Security (Web Services Security). These protocols define a set of rules that allow for added privacy and authentication. SOAP APIs support the standards established by the two largest international standards bodies: OASIS (Organization for the Advancement of Structured Information Standards) and W3C (World Wide Web Consortium). They combine XML encryption, XML signatures, and SAML tokens to verify authentication and authorization. SOAP APIs are generally recognized for their more comprehensive security measures, but they require a higher level of management. For this reason, they are particularly well-suited for companies that deal with sensitive data.

What are the most common best practices for API security?

You probably don’t hide your savings under your mattress. Most people put their money in a safe place (a bank) and use various methods to authorize and authenticate their payments. API security works on the same principle. You need a trusted environment that enforces authentication and authorization policies.

Here’s a list of the most common ways to strengthen your API security:

  • Use tokens: set up verified identities, then control access to services and resources with their assigned tokens.  
  • Use encryption and signatures: Encrypt your data using a protocol, such as TLS (see above). Require signatures to ensure that only authorized users decrypt and modify your data.
  • Identify vulnerabilities: keep your operating system, network, drivers, and API components up to date. Examine how all of these elements interact to identify vulnerabilities that could be used to break into your APIs. Use packet analyzers to detect security issues and spot data leaks.
  • Use quotas and query limiting: Set quotas on how often your API can be called and track its usage in the history. An increase in the number of calls may indicate that the API is being abused. It may also be a programming error, such as an infinite loop that keeps calling the API. Set up request throttling rules to protect your APIs from traffic spikes and denial-of-service attacks.
  • Use an API gateway: API gateways govern API traffic. With a good gateway, you can authenticate traffic as well as monitor and analyze API usage
DreamFactory Hosted Trial Signup

Generate a full-featured,documented, and secure REST API in minutes.

Sign up for our free 14 day hosted trial to learn how.

Getting Started With DreamFactory

Handwriting code for database APIs can be a complex, time consuming, and expensive process. It also exposes businesses to a number of risks including consistency, quality, and developer effort. DreamFactory is a REST API generation tool for a number of databases. It gives you the ability to generate secure and fully documented APIs in a matter of minutes. Ready to get started?  Sign up for a 14-day free trial and start creating your APIs today.

Related reading:

How to Secure REST APIs: API Keys Vs. OAuth