API protection

Learn how and why we protect APIs, and what steps you need to take so that we can configure protection for your needs.

What is an API?

An API, or Application Programming Interface, is a special interface that allows other programs to communicate with your resource. People communicate with websites and applications through a graphical interface: they press buttons on the screen, and the website or application responds. Programs do the same through a programmatic interface, or API: instead of pressing buttons, they send a request to the server and receive a response.

For example, a customer wants to find the price of a pair of trainers. They open an online store, select the product image, and see "Price: €120". A price comparison application also needs to know the price of the trainers. It does not open the website visually. Instead, it sends an API request:

GET /api/v1/products?name=Nike%20Air%20Max HTTP/1.1
Host: shop.example.com
Authorization: Bearer <unique token>

In response, it receives price data in JSON format.

The set of rules that programs use to create such requests to your website or application, together with the URLs to which they send requests, is called an API.

Why protect an API?

API attacks can overload services, cause data leaks, or lead to financial losses.

For example, a financial service may face credential stuffing and SMS bombing attacks:

  • Credential stuffing: bots use leaked username and password pairs to try to sign in to customer accounts. In five days, bots can make millions of attempts;

  • SMS bombing: when users sign in to or register in a financial service, they receive an SMS. Attackers can use the API to send many fake requests, causing the service to spend money on SMS messages that do not reach real customers.

Strictera blocks malicious requests, helps prevent unnecessary costs, and protects customers.

How do we protect an API?

We use a positive security model: everything is denied except what is explicitly allowed. We block all traffic except request types that you identify in advance as legitimate. This is more reliable than a negative model, where everything is allowed except what is prohibited, because it reduces the risk of missing a new attack type that is not covered by existing rules.

Here is a simple example. Your API should accept requests only from your mobile application and office network. These requests are included in the allowed traffic. All other requests are denied.

We create an individual protection profile that takes into account your resource characteristics and requirements. To do this, complete the questionnaire described below.

To configure API protection, complete these steps

1. Confirm that you need API protection

Our technical engineers will send you a questionnaire. One of its questions is about your API:

Do you need API protection? If so, please tell us whether the API is accessed by a mobile application or only by people using a browser.

In your answer, state that you need API protection and describe who or what should access the API.

We ask who accesses the API to determine whether it is private or public. This helps us create the right protection profile:

  • A public API is available to any client on the Internet, including any bot;

  • A private API is intended for a limited group of known clients, such as your application, partners, or office networks, with clear distinguishing characteristics.

2. Answer additional questions

We will send you additional questions so that we can configure protection for your needs. Questions for private and public APIs differ. Below, we explain why we ask each question and how to answer it.

For a private API

Question How we use this information How to answer Example answer

1. Trusted IP addresses or subnets

We will allow requests from these IP addresses without checks.

List the exact IP addresses or CIDR subnets.

192.168.10.0/24

2. Current versions of allowed applications and their distinguishing characteristics

We will create a profile of a legitimate client to filter emulators more reliably.

Use the following template: + OS / Application name / Distinguishing characteristics, such as versions, headers, paths, and tokens.

(iOS) (Current iOS application version) (headers: 'User-Agent':'MyApp_v1.01', 'Level':'User'; location: '/mobile/ios'; etc.)

(Android) (Current Android application version) (headers: 'User-Agent':'MyApp_v1.01', 'Level':'User'; location: '/mobile/android'; etc.)

3. Partner integrations

— Are requests from sources other than your application, such as partners, allowed? What distinguishes them?

We will allow partner requests without checks or apply rate limits.

List the partners, authentication methods, IP ranges, required headers, allowed endpoints, and other characteristics that distinguish partner requests. Specify rate limits.

Partner X—IP 203.0.113.50, API key authentication, access to /partner/*, up to 100 RPS.

4. Browser requests

— Do you allow requests to the private API from a browser?

If your API must not be accessed from a browser, we will block such requests. If it can, we will allow the requests that are acceptable to you.

Answer yes or no. If yes, describe the CORS policy, authentication mechanisms, header requirements, and allowed scenarios.

Yes, we allow them. Only requests from https://example.com are allowed, using GET or POST and JWT authentication in a cookie.

For a public API

Question How we use this information How to answer Example answer

1. Identifying sensitive endpoints

— Which API endpoints consume the most resources and can be considered resource-intensive?

— Which endpoints may be of interest to competitors because of the information they provide?

— Which endpoints are used for user authentication and registration?

— Are there other endpoints that need special attention for any reason?

We will focus strict checks and limits where potential damage is greatest. For example, sign-in and registration endpoints can be targeted by brute-force attacks or one-time code abuse; export and search endpoints can be targeted by scraping; calculations and calculators can involve expensive operations; and bulk sending endpoints can be used for email or SMS abuse.

List URL paths or patterns and briefly describe the risk for each one.

/api/v1/auth/*—sensitive data, high load; /api/v1/search—resource-intensive; /api/v1/export—bulk exports.

2. Request header requirements

— Which headers are required for all API users? + — Are there specific headers for particular operations or endpoints?

Required headers help formalize a correct request and filter basic bots.

List the minimum headers required for all requests and describe the requirements for specific operations.

Authorization: Bearer <token>, X-Client-Version, Content-Type: application/json

3. Load limits

— What level of activity from one user, IP address, or agent is unacceptable even when the request is correctly formed?

We will configure rate limits.

Provide limits per minute, hour, or day for key endpoints and the API overall.

/auth—no more than 10 requests per minute; /search—up to 100 requests per minute.

4. Existing load control measures

— Which rate limits are already in place?

This helps us determine an acceptable request threshold for you and block requests that exceed it.

List active policies and exceptions.

/auth—10 RPS per token; /search—60 RPM per IP address; exception: administrator accounts.

3. Route traffic to our servers

Route traffic to our servers, and we will begin traffic learning. It helps the system adapt to your traffic and clearly distinguish legitimate requests from suspicious ones.

The process is as follows:

  1. You route traffic to our servers, and we proxy it.

  2. With your approval, we enable a temporary protection profile to keep your resource protected during traffic learning. This profile uses ready-made signatures for most known applications to block suspicious requests and allow legitimate ones.

  3. We allowlist traffic that you asked to allowlist in the questionnaire.

  4. We begin traffic learning: collect traffic statistics, identify patterns, create signatures, configure rate limits, and prepare recommendations. If we need to discuss something with you, such as our recommendations, we will contact you.

  5. When traffic learning is complete, we create an individual protection profile.

How long does traffic learning take? It usually takes three business days. In some cases, it takes longer, for example, if actual traffic does not match the information in the questionnaire.

What is the result of traffic learning? We create an individual protection profile: a set of protection settings tailored to your resource. It takes into account all requirements from the questionnaire.

When might we contact you during traffic learning? When we have questions or suggestions for improving protection. For example, when:

  • Traffic spikes or anomalies are detected;

  • Header requirements should be made stricter;

  • Requests that appear legitimate but are not listed in the questionnaire are detected.

4. Confirm protection activation

When traffic learning is complete, an engineer will contact you to agree on activating the individual protection profile. Confirm the activation, and protection will start working according to all requirements in the questionnaire.

Manage the protection profile after activation

In the management console, you can configure the White list, Black list, and Geo restrictions. In Anti-bot mode, you can also create Custom rules.

For more complex settings, contact support. We will help.

Need help?

If you have questions, contact support.