{"id":150,"date":"2020-08-28T23:30:59","date_gmt":"2020-08-28T20:30:59","guid":{"rendered":"https:\/\/fierceonlinevideo.com\/?p=150"},"modified":"2020-08-28T23:30:59","modified_gmt":"2020-08-28T20:30:59","slug":"everything-you-need-to-know-about-api-security","status":"publish","type":"post","link":"https:\/\/fierceonlinevideo.com\/security\/everything-you-need-to-know-about-api-security\/","title":{"rendered":"Everything you need to know about API security"},"content":{"rendered":"
Estimated reading time: <\/span>4<\/span> minutes<\/span><\/span>An application programming interface (API) is a way for applications to communicate with each other. It provides a way for developers to build software applications while allowing data to be extracted and shared in an easily accessible way.<\/p>\n

APIs can be used to facilitate cyber attacks because APIs are widely used to convert sensitive information. Vulnerabilities such as weak authentication, lack of encryption, logical flaws, and insecure endpoints make the API vulnerable to attacks.<\/p>\n

Some of the major attacks that usually occur due to a lack of security during the implementation of APIs are:<\/p>\n

Man in the middle (MITM)<\/strong><\/p>\n

In order to obtain sensitive information, an intruder intercepts traffic between communicating parties by forwarding and intercepting communications involving API exchanges.<\/p>\n

API injections (XSS and SQLi)<\/strong><\/p>\n

In a snooping attack, malware is added to vulnerable software to host an attack, such as cross-site scripting (XSS) and SQL injection (SQLi).<\/p>\n

An author can inject a malicious script into a vulnerable API, that is, one that is unable to perform proper filter input and exit (FIEO) to launch an XSS attack on end-user browsers. In addition, malicious code is added to the API message, for example, commands that delete objects, records from the database.<\/p>\n

Distributed Denial of Service (DDoS)<\/strong><\/p>\n

In a distributed denial of service (DDoS) attack, multiple systems are flooded with the bandwidth of a targeted system, usually web servers. A DDoS attack against an API attempts to overload its memory and capacity by filling it with simultaneous connections or sending \/ requesting large amounts of information to each request. The DDoS attack on the FCC website in early 2017 used commercial cloud services to provide a huge number of API requests to the commenting system. This consumed the available machine resources and supplanted the commentators, which eventually caused the website to crash.<\/p>\n

DNS capture<\/strong><\/p>\n

Domain name server (DNS) hijacking, also known as DNS redirection, is a type of attack in which DNS queries are unexpectedly redirected to malicious sites.<\/p>\n

One example of DNS hijacking is when you are on the Internet and the website you want to access redirects you to a malicious site full of unwanted pop-ups and advertisements. The primary motive is to generate income.<\/p>\n

DNS capture can also be used for phishing. In phishing, victims are targeted and attackers try to trick them into revealing sensitive information, such as their payment information. The most common way we see phishing is to send an email as bait that directs users to a website that appears to be a legitimate payment processing site and steals their information from there.<\/p>\n

<\/h3>\n

How can we secure our Quick Heal API<\/strong><\/h3>\n

HTTPS over HTTP<\/strong><\/p>\n

TLS (Transport Layer Security) is a standard that keeps your Internet connection private and verifies that data sent between two systems is encrypted and unmodified. A site is said to be TLS-protected if the URL starts with “HTTPS” (Hyper Text Transfer Protocol Secure).<\/p>\n

TLS in API-based interaction is essential. Transport layer encryption is one of the must-protect APIs. In the absence of TLS, the risk of Man-In-The-Middle attacks is still very high. We use both TLSs in our APIs, especially when published with APIs. We definitely use HTTPS over HTTP.<\/p>\n

Authentication<\/strong><\/p>\n

To determine the identity of the end user (caller) in the API, basic authentication can be implemented using the TLS protocol. However, OAuth 2 and OpenID Connect are more secure options.<\/p>\n

Never reveal information about URLs<\/strong><\/p>\n

Never reveal sensitive or vulnerable information in URLs<\/p>\n

Confirmation of input parameters<\/strong><\/p>\n

Confirm the request parameters in the first step before it reaches the actual service processing business logic. We will put strong revisions and reject the request immediately if the verification fails.<\/p>\n

Encryption<\/strong><\/p>\n

The use of strong encryption for sensitive and private data while converting through APIs is highly recommended. We use a strong and light encryption algorithm – AES256<\/p>\n

AES256<\/strong><\/p>\n

The Advanced Encryption Standard (AES) is the first and only publicly available encryption approved by the U.S. National Security Agency (NSA) to protect classified information.<\/p>\n

To date, very few attacks have been reported against 256 AES applications. Most of them were side channel attacks (the attack was done to execute the secret code in the system and not in the cryptography itself). It is believed that the design and strength of the key length protects the AES algorithm and the 256-bit key length is ideal for top secret information. No one wants to compromise on security, and AES-256 is one of the most secure encryption methods on the market today.<\/p>\n

Key exchange algorithms<\/strong><\/p>\n

Use strong key exchange algorithms to exchange authentication or encryption keys. This should be accepted due to hard coded or static secrecy.<\/p>\n

In secret key exchange, we use the strongest public key exchange method called Diffie Hellman Secured key-exchange.<\/p>\n

Diffie Hellman Secure Key Exchange:<\/strong><\/p>\n

The Diffie-Hellman key exchange is complicated. It uses very large numbers and a lot of math. The Diffie-Hellman key exchange is based on one-way functions as the basis for security. These calculations are simple and one-way, but very difficult to calculate in the opposite way.<\/p>\n

Some of Diffie-Hellman’s benefits:<\/strong><\/p>\n

    \n
  • The sender and recipient do not need to know each other in advance<\/li>\n
  • Once the keys have been exchanged, data transfer can be performed securely over an unsecured channel<\/li>\n
  • Sharing a secret key is secure<\/li>\n<\/ul>\n

    Identity based authentication<\/strong><\/p>\n

    The advantage of token-based authentication is that it eliminates the possibility of weak credentials. ID is a highly protected information, which is used to transmit sensitive data between the two sides in a compact and independent manner. Logins are often used to validate authentication processes, whether it is a website or an application.<\/p>\n

    We use JWT Token-based communication, which consists of:<\/strong><\/p>\n

      \n
    • A header that specifies the type of ID and algorithm used<\/li>\n
    • A payload that contains user information and other metadata<\/li>\n
    • Signature to verify the identity of the sender and the authenticity of the message<\/li>\n<\/ul>\n

      URLs<\/strong><\/p>\n

      URLs do not reveal any sensitive information because we avoid using query parameters and do not reveal any information through URLs.<\/p>\n

      Confirmation of input parameters<\/strong><\/p>\n

      We have a strong validation of the input parameters at an early stage before implementing the business logic, and we reject any possible erroneous requests.<\/p>\n

      Safety vs. performance<\/strong><\/p>\n

      Performance is a feature and safety is essential nowadays, so it is very important to achieve both without compromising on each other. To meet these safety requirements, a light implementation strategy can be chosen with high safety measures.<\/p>\n

      Author: Prafulla Prakash Ranadive<\/em><\/p>\n

      \n

      Do you have anything to add to this story? share it<\/h4>\n<\/section>\n<\/div>\n","protected":false},"excerpt":{"rendered":"

      Estimated reading time: 4 minutesAn application programming interface (API) is a way for applications to communicate with each other. It provides a way for developers to build software applications while allowing data to be extracted and shared in an easily accessible way. APIs can be used to facilitate cyber attacks because APIs are widely used […]<\/p>\n","protected":false},"author":2,"featured_media":151,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"wds_primary_category":6,"footnotes":""},"categories":[6],"tags":[],"_links":{"self":[{"href":"https:\/\/fierceonlinevideo.com\/wp-json\/wp\/v2\/posts\/150"}],"collection":[{"href":"https:\/\/fierceonlinevideo.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fierceonlinevideo.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fierceonlinevideo.com\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/fierceonlinevideo.com\/wp-json\/wp\/v2\/comments?post=150"}],"version-history":[{"count":0,"href":"https:\/\/fierceonlinevideo.com\/wp-json\/wp\/v2\/posts\/150\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/fierceonlinevideo.com\/wp-json\/wp\/v2\/media\/151"}],"wp:attachment":[{"href":"https:\/\/fierceonlinevideo.com\/wp-json\/wp\/v2\/media?parent=150"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fierceonlinevideo.com\/wp-json\/wp\/v2\/categories?post=150"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fierceonlinevideo.com\/wp-json\/wp\/v2\/tags?post=150"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}