Capability

CORS Policy Rule

Free API teams from browser CORS errors — manage preflight and response headers from a single rule.

TR7 CORS Policy Rule manages the CORS headers required for cross-origin API access at the ADC layer, without touching application code. The Origin allow-list, allowed methods, allowed headers, credentials behavior and preflight cache duration can all be defined within a single policy. This approach prevents frontend and API teams from writing separate CORS code for each service. The application produces the response; TR7 appends the CORS headers the browser expects as a central policy, responds appropriately to preflight requests and completes the required headers on the actual response side. The policy can be applied per vService, host, path or different traffic conditions. This means public APIs, admin APIs, partner APIs and internal APIs can operate with different CORS behavior on the same device. The result: TR7 removes CORS management from application framework settings and turns it into a central, auditable and reusable rule at the API security and application delivery layer.

5
Configurable CORS parameters: Origin, Methods, Headers, Credentials, Max-Age
2
Managed request types: OPTIONS preflight and actual response
1
Central rule — consistent CORS policy across all vServices and paths

When CORS is left to application code, every API becomes a separate browser compatibility problem.

Modern web applications typically access APIs running on different domains, subdomains or ports. The browser restricts this access through CORS policy. If an API does not return the correct Access-Control-Allow-* headers, the request is blocked by the browser even if it executes successfully on the server side. The result is a broken application for the user and a difficult-to-diagnose CORS error for the team.

In most organizations, this problem is distributed to application teams. Each service defines its Origin, Method, Header, Credentials and Max-Age behavior separately within its own framework settings. As the number of services grows, it becomes inevitable that the same CORS policy ends up written differently across different applications.

Incorrect CORS settings also create security risks. During development, wildcard Origins are opened as a quick fix, permissions that are too broad are granted together with credentials, or preflight behavior is left incomplete. When such settings reach production, the API surface is unnecessarily exposed.

The right approach is to manage CORS policy as a central response/request rule. The Origin allow-list, credentials, allowed methods, allowed headers and preflight cache should all be defined in one place and not scattered across application code.

TR7 CORS Policy Rule delivers this model: it makes preflight and actual response CORS headers manageable from a single action, at the vService or path level.

Our approach

TR7 CORS policy brings origin validation, preflight management, response headers and conditional application logic together under a single rule.

The Origin allow-list accepts only permitted sources

TR7 can compare the incoming Origin value against a defined allow-list. The list can contain fixed domains or more flexible regex-based matches.

Preflight requests are answered without adding load to the application

TR7 can generate the required CORS headers for OPTIONS preflight requests. This lets the application focus only on the real API request.

Actual response headers are completed to match browser expectations

Headers such as Access-Control-Allow-Origin, Allow-Methods, Allow-Headers, Allow-Credentials and Max-Age are added through the central policy. Browser compatibility becomes independent of application code.

Per-vService and per-path policies keep different APIs separate

Different API surfaces on the same device can operate with different CORS behavior. The public API can be broader, the partner API narrower and the internal API managed with its own allow-list.

Capabilities

CORS Policy Rule simplifies the API publishing process by providing preflight and actual response management from a single action.

A single rule manages preflight and actual response CORS headers together

The TR7 CORS action can handle both OPTIONS preflight requests and the real API response headers under the same policy. This prevents application teams from coding preflight and actual response behavior separately. The policy is defined once and applied to the relevant vService or path. Operations can manage CORS behavior centrally.

The Origin allow-list permits only trusted frontend sources

Permitted Origin values can be defined explicitly in the CORS policy. This list can consist of specific domains, subdomain patterns or regex-based matches. Access is granted to trusted frontend applications without being forced to use wildcards. Browser access is provided without unnecessarily exposing the API surface to unwanted sources.

Regex-supported origin matching simplifies multi-subdomain structures

Organizations frequently use subdomain structures based on customers, tenants or environments. Regex-based origin matching makes it possible to establish a controlled permission policy without writing out each subdomain individually. For example, tenant frontends under a specific domain tree can be accepted. This flexibility enables scalable CORS management without opening wildcards.

The credentials toggle enables cookie and auth header use in a controlled manner

Access-Control-Allow-Credentials behavior can be toggled centrally. This setting is critical for frontends that work with cookies or Authorization headers. When credentials are enabled, the Origin allow-list should be kept narrow. TR7 moves this behavior out of scattered application team settings and into a single policy point.

The allowed methods list restricts the API surface at the browser level

Methods such as GET, POST, PUT, PATCH, DELETE or OPTIONS can be defined within the policy. The browser accepts only the permitted methods during preflight. This clarifies which operation types the API exposes to the client side. Security and developer experience are managed from the same list.

The allowed headers list governs custom header usage

Authorization, Content-Type, X-Request-ID or custom application headers can be defined in the allow-list. The browser checks during a preflight request whether these headers can be used. Missing header permissions lead to frontend errors; overly broad header permissions create unnecessary surface exposure. TR7 manages this balance centrally.

Preflight max-age caching reduces browser request load

The Access-Control-Max-Age value controls how long the browser caches the preflight result. An appropriate max-age value reduces OPTIONS traffic for frequent API calls. A value that is too short creates unnecessary preflight overhead; one that is too long means policy changes may be reflected late. TR7 makes this setting configurable per service need.

Per-vService application provides a separate CORS standard for each API

Each vService can have its own CORS policy. The public API, partner API, admin API or internal API can operate with different origin and method lists. This model prevents a single global CORS setting from being applied too broadly across all APIs. The operator establishes security boundaries per service.

Per-path application enables different endpoint behavior within the same service

Different CORS policies can be applied to different paths within the same vService. For example, `/public/api` can operate with a broader origin list while `/admin/api` operates only with a specific management frontend. This separates the API surface at the endpoint level. There is no need to write complex CORS if-blocks in application code.

Conditional CORS behavior can be established with the traffic rules engine

The CORS action can be used as part of the traffic rules engine. CORS headers can be applied based on host, path, header, method or other conditions. This allows many different publishing models to be managed on a single device. CORS policy becomes a context-aware traffic rule rather than a static setting.

CORS standards are enforced without application framework dependency

When CORS behavior is distributed across application frameworks, each language and service requires different configuration logic. TR7 moves this behavior to the ADC layer, reducing application dependency. Application teams focus only on API business logic while the CORS standard is maintained centrally. Legacy and modern services can be published under the same policy model.

Audit and centralized change management reduce CORS risk

When CORS policy is changed within the central configuration, it can be included in audit and rollback processes. The questions of who opened which Origin, which method or which credentials behavior can be tracked. This is especially important during security reviews. Auditable CORS management replaces scattered application settings.

Operational depth

CORS Policy Rule is operated together with origin matching, credentials behavior, preflight response, max-age balance, path scope and audit visibility.

01

Origin matching

The incoming Origin value can be compared against an allow-list or regex rules. If there is no match, CORS headers may not be added, or a rejection behavior may be applied as required by the policy. Using an explicit list rather than a wildcard is recommended.

02

Credentials behavior

When credentials are active, identity information such as cookies and auth headers can be used in cross-origin requests. In this mode it is important that the Origin policy is narrow and well-defined. Credentials together with a wildcard Origin is not a safe assumption.

03

Preflight response

OPTIONS requests are sent by the browser to check method and header permissions. TR7 can centrally manage the preflight response by generating the required Allow-* headers. This reduces the burden on the backend service from unnecessary OPTIONS load.

04

Max-age balance

The preflight cache duration requires a balance between performance and policy freshness. A longer duration produces fewer OPTIONS requests, but CORS changes may be felt late due to browser caching. This value should be chosen carefully for critical APIs.

05

Path scope

CORS policy can be bound to specific path or host conditions. This allows different CORS behavior to be applied to different API surfaces within the same vService. Admin endpoints and public endpoints do not need to share the same permissions.

06

Audit record

CORS policy changes can be tracked within the central configuration and audit process. Changes to the Origin list or credentials behavior should be considered security-significant. The change history carries value for rollback and compliance purposes.

When to use it

Resolve frontend API CORS errors without touching application code

When a frontend application accesses an API on a different domain, the browser may receive a CORS error. Adding the correct Origin, method and header policy through TR7 resolves the issue centrally.

Regex origin policy for multi-tenant subdomain structures

In a SaaS environment, each tenant may run its own frontend on a dedicated subdomain. A regex-supported allow-list accepts the entire tenant domain tree in a controlled manner.

Narrow origin and header list for partner API access

Partner applications can access the API only with specific Origins and Authorization headers. The TR7 CORS rule defines these permissions centrally and closes unnecessary header and method surface.

Managing credentials behavior in cookie-based SSO flows

Cross-origin cookies may be required in SSO or federation flows. TR7 brings this behavior under control with the credentials toggle and a narrow Origin list.

Applying different CORS behavior to public and admin API paths

Within the same vService, the public endpoint can operate with a broader and the admin endpoint with a narrower CORS policy. This separation is applied through a traffic rule without writing it into application code.

Frequently asked questions

How does TR7 CORS rule manage preflight requests?
TR7 can generate the required Access-Control-Allow-Methods, Access-Control-Allow-Headers and Access-Control-Max-Age headers for OPTIONS preflight requests from the central CORS policy. This means the backend service is not burdened with preflight overhead — it focuses only on the real API request.
Does the Origin allow-list force the use of wildcards?
No. TR7 CORS policy supports defining permitted Origin values through an explicit list or regex rules. Trusted frontend sources can be granted access without needing to use wildcards, providing browser compatibility without unnecessarily exposing the API surface.
Is enabling credentials behavior safe?
When credentials are active, cookies and Authorization headers can be used in cross-origin requests. In this mode it is critical that the Origin allow-list is narrow and well-defined; using a wildcard Origin together with credentials is not a safe configuration. TR7 manages both settings together at a single central policy point.
Can different CORS policies be applied to different APIs on the same device?
Yes. CORS policy can be defined independently per vService or path. Public APIs, partner APIs, admin APIs and internal APIs can all operate on the same device with different Origin lists, different method permissions and different credentials behavior.
What should the Max-Age value be set to?
An appropriate Max-Age reduces OPTIONS traffic for frequent API calls, but a value that is too long may cause CORS policy changes to be reflected late due to browser caching. A shorter value is preferred for critical or frequently updated APIs. TR7 makes this parameter configurable per service need.
Is CORS policy tied to the application framework?
No. TR7 CORS Policy Rule operates at the ADC layer and is independent of the application language or framework. All APIs, including legacy services, can be published under the same central CORS policy. Application teams achieve CORS compliance without touching framework settings.

Remove CORS management from application code

Manage preflight, response headers, origin allow-list and credentials behavior from a single ADC rule. Let's walk through a live setup on your own services.