# mulesoft Mule Gateway - Full Documentation --- product: Mule Gateway --- # Anypoint Mule Gateway > For the full documentation index, see: https://docs.mulesoft.com/llms.txt Mule runtime engine includes an embedded Mule Gateway. Mule Gateway enables you to add a dedicated orchestration layer on top of your backend APIs and services to help you separate orchestration from implementation. You can leverage the governance capabilities of API Manager to apply, among other capabilities, throttling, security, caching, and logging to your APIs. For example, using Mule Gateway you can: - Apply a basic authentication policy on top of a Mule application. - Enrich an incoming or outgoing message. - Add any other complex capability to an API without having to write any code. If you want to apply policies and generate analytics info, you must use either: - An API defined in a Mule application. - A Mule application that proxies your existing backend implementation. For more information, see [Mule Gateway Overview](https://docs.mulesoft.com/mule-gateway/mule-gateway-capabilities-mule4). --- product: Mule Gateway --- # Anypoint Platform Gateways > For the full documentation index, see: https://docs.mulesoft.com/llms.txt An API gateway allows you to add a dedicated orchestration layer on top of your backend APIs and services to help you separate orchestration from implementation concerns. You can then leverage the governance capabilities of API Manager to apply, among other capabilities, throttling, security, caching, and logging to your APIs. Anypoint Platform offers three different runtime options for managing and securing your APIs. ## Omni Gateway Omni Gateway is an ultrafast API gateway designed to manage and secure APIs running anywhere. Built to seamlessly integrate with DevOps and CI/CD workflows, Omni Gateway delivers the performance required for the most demanding applications and microservices while providing enterprise security and manageability across any environment. For more information, see [Getting Started with Omni Gateway](https://docs.mulesoft.com/gateway/latest/gateway-getting-started). ## Anypoint Mule Gateway Mule runtime engine includes an embedded Mule Gateway. You can leverage the governance capabilities of API Manager to apply, among other capabilities, throttling, security, caching, and logging to your APIs. For example, using Mule Gateway you can: - Apply a basic authentication policy on top of a Mule application. - Enrich an incoming or outgoing message. - Add other complex capabilities to an API without writing code. If you want to apply policies and generate analytics info, you must use either: - An API defined in a Mule application. - A Mule application that proxies your existing backend implementation. For more information, see [Mule Gateway Overview](https://docs.mulesoft.com/mule-gateway/mule-gateway-capabilities-mule4). --- product: Mule Gateway --- # API Autodiscovery > For the full documentation index, see: https://docs.mulesoft.com/llms.txt Configuring autodiscovery allows a deployed Mule runtime engine (Mule) application to connect with API Manager to download and manage policies and to generate analytics data. Additionally, with autodiscovery, you can configure your Mule applications to act as their own API proxy. When autodiscovery is correctly configured in your Mule application, you can say that your application’s API is _tracked by_ (green dot) or _paired to_ API Manager. You can associate an API in a Mule setup with only one autodiscovery instance at a given time. > [!NOTE] The flow referenced for autodiscovery must use an > [HTTP Listener](https://docs.mulesoft.com/http-connector/1.10/http-listener-ref) component. Other connectors that use > HTTP as an underlying transport aren’t supported for policy enforcement. ## Prerequisites To [configure autodiscovery for your Mule application](https://docs.mulesoft.com/mule-gateway/mule-gateway-config-autodiscovery-mule4), ensure that: - The API exists in API Manager and is configured as either a basic endpoint, or a proxy endpoint. - The Mule application is configured to use Anypoint Platform credentials. The platform credentials give your application access to the API Configuration in API Manager. You must configure your platform credentials before starting Mule. - The autodiscovery element is configured in your Mule application. This XML element must point to the specific API in API manager which you want to pair to. ## Proxy Endpoint vs Basic Endpoint If you configured a proxy endpoint, your autogenerated proxy is already correctly configured with the autodiscovery element. Additionally, if you want to take advantage of the platform deployment capabilities, such as 1-Click deployment, the API Manager credentials are automatically set for you. ## See Also - [API Proxy](https://docs.mulesoft.com/api-manager/latest/api-proxy-landing-page) - [Configuring API Autodiscovery in a Mule 4 Application](https://docs.mulesoft.com/mule-gateway/mule-gateway-config-autodiscovery-mule4) - [Configuring Organization Credentials in Mule Runtime 4](https://docs.mulesoft.com/mule-gateway/mule-gateway-org-credentials-mule4) --- product: Mule Gateway keywords: api security, identification, correlation, api gateway, mule gateway, gateway, policy --- # API Security-Identification Header Policy > For the full documentation index, see: https://docs.mulesoft.com/llms.txt
Policy Name | API Security-Identification Header |
Summary | Adds API instance identifiers as response headers for external security platform correlation |
Category | Security |
First Mule version available | v4.12.0 |
Returned Status Codes | No return codes exist for this policy. |
Policy Name | Basic Authentication: LDAP |
Summary | Allows access based on the basic authorization mechanism, with user-password defined on LDAP |
Category | Security |
First Mule version available | v4.0.0 |
Returned Status Codes | 401 - Unauthorized or invalid client application credentials |
| Parameter | Description |
|---|---|
LDAP Server URL | The URL of your LDAP OR LDAPS server, including the port number. |
LDAP User DN | The name of the user or user group with access to traverse and list users of LDAP. |
LDAP User Password | The password for the user or user group. The password must be a secure value that, once specified, is not visible or retrievable. |
LDAP Search Base | The starting point for the search in the directory tree. |
LDAP Search Filter | The criteria for the filter for the Active Directory or the OpenLDAP model, as shown in the examples. |
| Field | Example Literal String Value | Example Secure Property Placeholder |
|---|---|---|
LDAP Server URL | ldap://174.19.33.17:389/ | ${ldap.server.url} |
LDAP Secure Server URL (SSL) | ldaps://my-company-ldap.cloudhub.io:1010/ | ${ldap.server.url} |
LDAP Server User DN | CN=Administrator,CN=Users,DC=my-company,DC=com | ${ldap.user.dn} |
LDAP User Password | somePassword | ${ldap.password} |
LDAP Search Base | CN=Users,DC=my-company,DC=com | ${ldap.search.base} |
LDAP Search Filter | (sAMAccountName={0}) | ${ldap.search.filter} |
| Field | Example Literal String Value | Example Secure Property Placeholder |
|---|---|---|
LDAP Server URL | ldap://174.19.33.17:389/ | ${ldap.server.url} |
LDAP Secure Server URL (SSL) | ldaps://my-company-ldap.cloudhub.io:1010/ | ${ldap.server.url} |
LDAP Server User DN | cn=Manager,dc=my-company,dc=com | ${ldap.user.dn} |
LDAP User Password | somePassword | ${ldap.password} |
LDAP Search Base | ou=people,dc=my-company,dc=com | ${ldap.search.base} |
LDAP Search Filter | (uid={0}) | ${ldap.search.filter} |
Policy Name | Basic Authentication: Simple |
Summary | Allows access based on the basic authorization mechanism, with a single user-password |
Category | Security |
First Mule version available | v4.0.0 |
Returned Status Codes | 400 - Unauthorized or invalid client application credentials in WSDL API using SOAP 1.2 |
401 - Unauthorized or invalid client application credentials in HTTP or RAML APIs | |
500 - Unauthorized or invalid client application credentials in WSDL API using SOAP 1.1 |
Policy Name | Client ID Enforcement |
Summary | Allows access only to authorized client applications |
Category | Compliance |
First Mule version available | v3.8.0 |
Returned Status Codes | 401 - Unauthorized or invalid client application credentials |
500 - Bad response from authorization server, or WSDL SOAP Fault error |
| Parameter | Description | Required |
|---|---|---|
Credentials origin | Specifies from where in the request to extract the values:
| Must choose from one of the options. |
Client ID Expression | The DataWeave 2.0 expression to use for obtaining the client ID from API requests. | Yes. |
Client Secret Expression | The DataWeave 2.0 expression to use for obtaining the client secret from API requests. | No. |
Method & Resource conditions: Apply configurations to all API methods & resources | Choose this option if you require the policy to be applied to all the methods and resources associated with the API. | Must choose from one of the options. |
Method & Resource conditions: Apply configurations to specific methods & resources | Choose this option if you require the policy to be applied to only specific methods and resources associated with the API. | Must choose from one of the options. |
Custom mode | Header 'WWW-Authenticate'='Client-ID-Enforcement' |
Basic Auth mode | Header 'WWW-Authenticate'='Basic realm="mule-realm" |
|
Because resource-level policies work in compatibility mode in Mule versions 4.2.x and 4.1.x, deploying these proxy versions is not recommended. If you deploy these proxy versions, you will be required to update the URI Template configurations before migrating to Mule 4.3.x. |
| 1 | Configure the apiId with the API ID that API Manager assigned to your API. |
| 2 | Set the flowRef element to point to the flow that you want to pair to the API in API Manager. The referenced flow must use an HTTP Listener component. Other connectors that use HTTP as an underlying transport aren’t supported for policy enforcement. |
Extension artifact ID | First Java 17-compatible version |
mule-client-id-enforcement-extension | 1.2.0 |
mule-cors-extension | 1.3.0 |
mule-event-authentication-extension | 1.1.0 |
mule-federation-extension | 1.4.0 |
mule-http-policy-transform-extension | 3.2.0 |
mule-http-proxy-extension | 1.2.0 |
mule-ip-filter-extension | 2.1.0 |
mule-json-threat-protection-extension | 1.2.0 |
mule-jwt-extension | 1.3.0 |
mule-rest-validator-extension | 2.3.0 |
mule-soap-fault | 2.1.0 |
mule-throttling-extension | 3.1.0 |
mule-tokenization-extension | 1.2.0 |
mule-wsdl-functions-extension | 1.2.0 |
mule-xml-threat-protection-extension | 1.2.0 |
Policy name | Cross-Origin Resource Sharing (CORS) |
Summary | Enables access to resources residing in external domains |
Category | Compliance |
First Mule version available | v4.1.1 |
Returned Status Codes | No return codes exist for this policy |
| Element | Description | Required? |
|---|---|---|
Public resource | Whether the CORS configuration is to be applied as a public resource (default) | Yes |
Default group | Whether the CORS configuration is to be applied only to specific resources (requires unselecting Public resource) | No |
Support credentials | Whether the policy supports credentials, such as cookies, authorization headers, and TLS client certificates | No |
| 1 | The definition of a policy starts with the http-policy:proxy element with a name argument. The http-policy:proxy element must contain http-policy:source or a http-policy:operation element. In this example, http-policy:source is used. |
| 2 | The http-policy:source block contains the actual instructions to execute, relative to the Mule flow the policy is configured to handle. The http-policy:source block can inject instructions before an HTTP Listener event fires at the start of a flow, and inject instructions after the flow completes. |
| 3 | Any Mule Event operation that is defined before the execute-next element will be executed before the start of a flow with an HTTP Listener. |
| 4 | The http-policy:execute-next element is required to continue the Mule Event processing. The http-policy:execute-next element can trigger other policies or the application flow. Any policy can stop the Mule Event processing chain by not executing http-policy:execute-next. |
| 5 | Mule Event operations defined after the http-policy:execute-next element will be executed after the flow completes. These Mule Event processors will be able to process the Mule Event returned from the flow. |
| 1 | One http-policy:proxy element is used for both types of policy blocks. Both source and operation blocks may be present. When both blocks are present, each block can share variables to keep state throughout the policy execution. |
| 2 | This policy block contains code to be executed after the flow’s HTTP Requester returns an HTTP response. If the flow does not contain an HTTP Requester element, then this block is never executed. |
| 1 | Unique ID within your organization of the policy. Required |
| 2 | User friendly name that is used for displaying the policy name in API Manager’s UI. Required |
| 3 | Deprecated property. Value should be set to ‘>=v1’ for now. Required |
| 4 | Java versions supported by the policy. Required for Java 17 runtime support. Without this field, the policy won’t appear in API Manager for Java 17 runtimes. Optional |
| 5 | Description of what the policy does. Also used in API Manager’s UI. Required |
| 6 | Category to which the policy belongs. Used to group and filter policies in API Manager’s UI, any String value is valid. Required |
| 7 | Value used by Edge to show metrics about different types of policy violations. Required |
| 8 | Deprecated property. Value should be set to ‘system’. Required |
| 9 | Whether resource level pointcuts should be enabled when applying the policy. Required |
| 10 | Deprecated property. Value should be set to ‘true’. Required |
| 11 | Whether policy requires information about an identity management that’s configured for the API’s Organization. Optional |
| 12 | Where the policy parameters are defined. Every parameter listed here will be rendered as an expected user input in API Manager’s UI. It expects an array of values. Required |
| 1 | Internal name of the parameter. Must be unique within the policy. |
| 2 | User friendly name of the parameter. Used for displaying in API Manager’s UI. |
| 3 | Description of the parameter. Also, used for displaying in API Manager’s UI. |
| 4 | Type of the parameter. |
| 5 | Default value for the parameter. |
| 6 | Whether is mandatory for the user to enter this value or not. |
| 7 | Whether this property should be masked when entering in API Manager’s UI. |
| 8 | Whether multiple values should be allowed for this parameter. |
| 1 | Minimum value allowed for the parameter. |
| 2 | Maximum value allowed for the parameter. |
| 1 | List of options for the user to choose. Each option has a name for displaying in the UI and an internal value used in the policy. |
Policy Name | Detokenization | ||
Summary | Returns a tokenized value to its original value. This policy is designed to work only for Anypoint Runtime Fabric deployments. | ||
Category | Security | ||
First Mule version available | v4.1.1 | ||
Returned Status Codes |
| ||
502 - Connection to the tokenization service is unavailable or not configured. |
| Element | Description | Required |
|---|---|---|
Direction | Whether the values to detokenize are extracted from the request or the response (default). | Yes |
Fail on unmatched expressions | If selected, requests fail when the expression and tokens do not match. | No |
Services | The tokenization services available for the current organization and environment. Select the service that you need from the list. Note that the formats available depend on the service that you choose. | Yes |
Expression | A selector expression to be used to extract the information that will be detokenized. For example: Only expressions using dots as field separators are allowed. While | No |
Format | Type of information that will be detokenized. Formats may vary depending on the selected service. Choose one format from the list. If you don’t see any formats in the list, verify that the tokenization service selected contains at least one format. | No |
Security level | Description |
| Gatekeeper does not apply any security. With this setting, the API might receive unwanted traffic during the period while the policies are being applied. |
| Gatekeeper security is set to its maximum level. When the Mule instance is restarted, the API is blocked with a |
| Gatekeeper security is set to intermediate level. When the Mule instance is restarted, the API is blocked with a |
Runtime version | Default security level |
4.0.0 | Strict |
4.1.0 and later | Flexible |
| 1 | Use the string parameter to encrypt a single value. |
| 2 | Set the tool to encrypt the value. |
| 3 | Use AES with CBC Mode. This is important because Mule uses this configuration to decrypt the value later. |
| 4 | And finally, specify the encryption key-value pair that you want to encrypt. |
| Property | Property Key | Description |
|---|---|---|
Client ID |
| Your Anypoint Platform client ID |
Client secret |
| Your Anypoint Platform client secret |
Proxy password |
| Password of the proxy configuration to connect to Anypoint Platform |
| All values are encrypted. |
| Only values that you marked as |
| Policy | Version |
|---|---|
Basic Authentication | 1.2.0 and later. |
Client ID Enforcement | 1.2.0 and later. |
Header Injection | 1.1.0 and later. |
IP Allowlist | 1.0.0 and later. |
IP Blocklist | 1.0.0 and later. |
JWT Validation | 1.1.0 and later. |
Open AM | 1.2.0 and later. |
Open ID | 1.2.0 and later. |
OAuth 2.0 | 1.2.0 and later. |
Ping Federate | 1.2.0 and later. |
| 1 | The password value in your policy is now considered sensitive. |
Policy name | Header Injection |
Summary | Adds headers to a request or a response |
Category | Transformation |
First Mule version available | v4.1.0 |
Returned Status Codes | |
500 - The configuration includes an expression that was not evaluated. |
| Parameter | Description |
|---|---|
Inbound Header Map | List of headers to be injected at the beginning of the message processing. |
Inbound Header Key | String or Dataweave expression to be used as header name at the beginning of the message. |
Inbound Header Value | String or Dataweave expression to be used as header value at the beginning of the message. |
Outbound Header Map | List of headers to be injected at the end of the message processing. |
Outbound Header Key | String or Dataweave expression to be used as header name at the end of the message processing. |
Outbound Header Value | String or Dataweave expression to be used as header value at the end of the message processing. |
Method & Resource conditions | The option to add configurations to only a select few or all methods and resources of the API |
Policy name | Header Removal |
Summary | Removes headers from a request or a response |
Category | Transformation |
Returned Status Codes | 500 - The configuration includes an expression that was not evaluated. |
| Parameter | Description |
|---|---|
Inbound Header Map | List of header names or regular expressions (comma separated) to be removed at the beginning of the message processing, for example, |
Outbound Header Map | List of header names or regular expressions (comma separated) to be removed at the end of the message processing, for example, |
Method & Resource conditions | The option to add configurations to only a select few or all methods and resources of the API |
Policy Name | HTTP caching |
Summary | Caches HTTP responses from an API implementation |
Category | Quality of Service |
First Mule version available | v4.1.0 |
Returned Status Codes | No return codes exist for this policy |
| Parameter | Description | Required? |
|---|---|---|
HTTP Caching Key | A DataWeave expression. Default value: | Yes |
Maximum Cache Entries | Specifies the maximum number of entries that can be stored in the cache at any given time. Default value: | Yes |
Entry Time To Live | Specifies the amount of time (in seconds) after which a single entry expires from the cache. Default value: | Yes |
Distributed | Configures the cache to be distributed among different nodes in a cluster. If you are using CloudHub, ensure that you enable Object Store v2 when deploying an application. Default value: | Yes |
Persistent Cache | Configures the cache to persist between different restarts of the Mule/Omni instance. If you are using CloudHub, ensure that you enable Object Store v2 when deploying an application. Default value: | Yes |
Follow HTTP Caching directives | Enables the use of Cache-Control header directives. Default value: | Yes |
Invalidation Header | Name of the header used to invalidate a single entry or the entire cache. | No |
Conditional Request Caching Expression | The DataWeave expression that is used to decide which requests are to be cached (caches the response only if the condition is true). Default value: | No |
Conditional Response Caching Expression | The DataWeave expression that is used to decide which responses are to be cached (caches the response only if the condition is true). Default value: | No |
| Policy | Summary |
|---|---|
Adds API instance identifiers as response headers for external security platform correlation | |
Allows access based on the basic authorization mechanism, with user-password defined on LDAP | |
Allows access based on the basic authorization mechanism, with a single user-password | |
Allows access only to authorized client applications | |
Enables access to resources residing in external domains | |
Adds headers to a request or a response | |
Removes headers from a request or a response | |
Caches HTTP responses from an API implementation | |
Allows a list or range of specified IP addresses to request access | |
Blocks a single IP address or a range of IP addresses from accessing an API endpoint | |
Protects against malicious JSON in API requests | |
Validates a JWT | |
Logs custom messages using information from incoming requests, responses from the backend, or information from other policies applied to the same API endpoint | |
OAuth 2.0 Access Token Enforcement Using Mule OAuth Provider | Allows access only to authorized client applications |
Allows access only to authorized client applications | |
Allows access only to authorized client applications | |
Allows access only to authorized client applications | |
Monitors access to an API by defining the maximum number of requests processed within a period of time | |
Monitors access to an API by defining the maximum number of requests processed within a timespan, based on SLAs | |
Regulates API traffic | |
Protects against malicious XML in API requests |
Policy Name | IP Allowlist |
Summary | Allows a list or range of specified IP addresses to request access |
Category | Security |
First Mule version available | v4.1.0 |
Returned Status Codes | 403 - IP is rejected |
| Parameter | Description |
|---|---|
IP expression | The DataWeave 2.0 expression to be used for extracting the IP address from this API request. |
Allowlist | The list of IP addresses allowed access to the API. You can define one IP or IP range at a time, as many times as required. For more information, see Specifying IP Addresses to Allowlist in Your Policy. |
Method & Resource conditions | The option to add configurations either to a select few or to all methods and resources of the API. |
Policy Name | IP Blocklist |
Summary | Blocks a single IP address or a range of IP addresses from accessing an API endpoint |
Category | Security |
First Mule version available | v4.1.0 |
Returned Status Codes | 403 - IP is rejected |
| Parameter | Description |
|---|---|
IP expression | The DataWeave 2.0 expression to be used for extracting the IP address from this API request. |
Blocklist | The list of IP addresses blocked from the API. You can define one IP or IP range at a time, as many times as required. For more information, see Specifying IP Addresses to Blocklist in the Policy. |
Method & Resource conditions | The option to add configurations either to a select few or to all methods and resources of the API. |
Policy Name | JSON Threat Protection |
Summary | Protects against malicious JSON in API requests |
Category | Security |
First Mule version available | v3.8.0 |
Returned Status Codes | 400 - Bad Request |
Field | Description | Default | Required |
Maximum Container Depth | Specifies the maximum nested depth. JSON allows you to nest the containers (object and array) in any order to any depth | -1 | false |
Maximum String Value Length | Specifies the maximum length of a string value | -1 | false |
Maximum Object Entry Name Length | Specifies the maximum string length of an object’s entry name | -1 | false |
Maximum Object Entry Count | Specifies the maximum number of entries in an object | -1 | false |
Maximum Array Element Count | Specifies the maximum number of elements in an array | -1 | false |
| Parameter | Value | Explanation |
|---|---|---|
Maximum Container Depth | 3 | The depth of the |
Maximum String Value Length | 28 | The length of |
Maximum Object Entry Name Length | 7 | The length of the |
Maximum Object Entry Count | 2 | The number of entries in each |
Maximum Array Element Count | 4 | The number of elements in the |
Policy name | JWT Validation | |||
Summary | Validates a JWT | |||
Category | Security | |||
First Mule version available | v4.1.0 | |||
Returned Status Codes | ||||
400 - Token was not provided in the request.
|
| Element | Description | Example |
|---|---|---|
JWT Origin | Specifies from where in the request the JWT will be extracted: * HTTP Bearer Authentication Header * Custom Expression If you set this field to | |
Token Expression | If you set the JWT Origin to |
|
JWT Signing Method | Specify the signing method expected in the incoming JWT. The policy rejects the token if the JWT has a different signing method. | RSA, HMAC, ES, None |
JWT Signing Key Length | Specify the length of the key (in the case of the HMAC algorithm) or the algorithm (in the case of RSA) used for the signing method. | 256, 384, 512 |
JWT Key Origin | Specifies where to obtain the key for the Signature validation. | |
JWT Key | This field appears if you selected Text as JWT Key Origin. | Enter a 32, 48, or 64 character string shared secret for HMAC, a 32 character string shared secret for ES, or the PEM Public Key without the header and footer for RSA. |
JWKS URL | This field appears if you selected the JWKS method as JWT Key Origin. | The URL to the JWKS server. |
JWKS Caching Time To Live | The amount of time, in minutes, that the JKWS is valid. When the JKWS expires, the policy retrieves it again. The devault value is 60 minutes. | This field input is the amount of time, in minutes, during which the policy considers the JWKS valid. |
JWKS Service connection timeout (milliseconds) | Sets the maximum time, in milliseconds, to wait for a response when authenticating the access token validation endpoint. | |
Skip Client ID Validation | If you check this field, the policy does not verify that the client ID extracted from the JWT matches a valid client application of the API. | |
Client ID Expression | If Skip Client Id Validation is not set, the client ID needs to be extracted from the token. | By default, the value will be extracted using the expression |
Validate Audience Claim | Indicates that the policy should check for the validity of the audience claim. You can set this "Mandatory" if you select Audience Claim Mandatory. | |
Validate Expiration Claim | Indicates that the policy should check for the validity of the expiration claim. You can set this claim as "Mandatory" by selecting Expiration Claim Mandatory. | |
Validate Not Before Claim | Indicates that the policy should check for the validity of the Not Before claim. You can set this claim as "Mandatory" by selecting Not Before Claim Mandatory | |
Validate Custom Claim | Enables the usage of custom validations in the policy. The JWT will be valid only if all DataWeave expressions are fulfilled. | The policy provides a claimSet variable that contains all the claims present in the incoming JWT. For example:
Note that all DataWeave expressions must return a boolean value or they will always fail. |
| Starting Point | Procedure |
|---|---|
No previous certificate |
|
PEM Certificate |
|
DER Certificate |
|
x5c field from JWKS |
|
Policy name | Message Logging |
Summary | Logs custom messages using information from incoming requests, responses from the backend, or information from other policies applied to the same API endpoint |
Category | Troubleshooting |
First Mule version available | v3.8.0 |
Returned Status Codes | No return codes exist for this policy |
| Parameter | Description | Required? |
|---|---|---|
Message | A DataWeave expression to use for extracting the message to be logged Note for Mule 4 Gateway: If the payload is used as part of the message log, do not configure the Listener as non-repeatable. | Required |
Conditional | A DataWeave Boolean expression used to specify whether a message is to be logged | Optional |
Category | A prefix in the log message that indicates the package and class where the log is executed. | Optional |
Level | Defines the level of message to log: INFO, WARN, ERROR, or DEBUG | Required |
Before Calling API | Set to cause your logging policy to log messages before the API endpoint is called, taking into account the order in which this policy is applied | Optional |
After Calling API | Set to cause your logging policy to log messages after the API endpoint is called, taking into account the order in which this policy is applied | Optional |
| 1 | Basic structure for defining a policy. {{{policyId}}} refers to a HandleBars variable. HandleBars is a templating framework that allows users to create more complex policies. |
| 2 | Source refers to inbound HTTP requests. The other option is to define logic for an outbound HTTP request. |
| 3 | Explicit element which indicates that the next policy or flow should be executed. Any element placed before it will be executed before jumping to the next, and any element placed after that will be executed after returning from the next. |
| Proxy | Version |
|---|---|
HTTP and HTTPS proxy | 2.1.0 |
REST Proxy | 2.2.1 and 3.2.1 |
WSDL Proxy | 2.2.1 and 3.1.1 |
| Policy | Definition | Implementation |
|---|---|---|
Basic Authentication: LDAP | 1.4.0 | 1.4.1 |
Basic Authentication: Simple | 1.3.1 | 1.4.1 |
Client ID Enforcement | 1.3.2 | 1.4.0 |
Cross-Origin Resource Sharing (CORS) | 1.3.1 | 1.4.1 |
Header Injection | 1.3.1 | 1.4.0 |
Header Removal | 1.1.1 | 1.2.0 |
HTTP Caching | 1.1.0 | 1.1.0 |
IP Allowlist | 1.1.1 | 1.2.0 |
IP Blocklist | 1.1.1 | 1.2.0 |
JSON Threat Protection | 1.2.0 | 1.2.3 |
JWT Validation | 1.4.0 | 1.4.1 |
Message Logging | 2.0.1 | 2.1.1 |
OAuth 2.0 Access Token Enforcement Using Mule OAuth Provider | 1.6.0 | 1.6.1 |
OpenAM OAuth 2.0 Token Enforcement | 1.6.0 | 1.6.1 |
OpenID Connect OAuth 2.0 Access Token Enforcement | 1.6.0 | 1.6.1 |
PingFederate OAuth 2.0 Token Enforcement | 1.6.0 | 1.6.1 |
Rate Limiting | 1.4.0 | 1.4.0 |
Rate Limiting: SLA-based | 1.3.0 | 1.3.0 |
Spike Control | 1.2.1 | 1.3.1 |
XML Threat Protection | 1.2.0 | 1.2.0 |
Policy Name | OAuth 2.0 Access Token Enforcement Using Mule OAuth Provider Policy |
Summary | Allows access only to authorized client applications |
Category | Security |
First Mule version available | v4.1.1 |
Returned Status Codes | 400 - Invalid token |
401 - Unauthorized access or error when connecting to the authorization server | |
403 - Forbidden, invalid client application credentials | |
500 - Bad response from authorization server, or WSDL SOAP fault error. |
| Element | Description | Example |
|---|---|---|
Scopes | Displays a space-separated list of supported scopes. |
|
Scope Validation Criteria | Determines if the token must contain all defined scopes or just one. The values are | If the ‘Contains all scopes’ value is selected, the tokens with the scopes |
Access Token validation endpoint url | The URL of the Access Token validation endpoint of the external OAuth 2 provider. | The link to a Mule provider hosted by the client: http://client-hostetd-mule-provider-url.cloudhub.io/validate. |
Validate TLS Certificate | Enables third-party authentication server TLS validation. | If selected, the communication with the token validation endpoint uses the TLS protocol. |
Expose Headers | In a proxy scenario, specifies whether headers must be exposed in the request to the backend. User properties returned by the federation server are prefixed with 'X-AGW-' and sent as headers to the backend. | See Leveraging Token Validation Endpoint Information for Mule Applications for more information about this element. |
Skip Client Id Validation | Skips the client application’s API contract validation. | If selected, Step 4 of the diagram in the How This Policy Works section is skipped. |
Authentication request timeout | Sets the maximum time, in milliseconds, to wait for a response when authenticating with the Access Token validation endpoint. |
|
Policy Name | OpenAM OAuth 2.0 Token Enforcement |
Summary | Allows access only to authorized client applications |
Category | Security |
First Mule version available | v3.8.0 |
Returned Status Codes | 400 - Invalid token |
401 - Unauthorized or Connection error when connecting to the authorization server | |
403 - Forbidden, invalid client application credentials | |
500 - Bad response from authorization server, or WSDL SOAP Fault error. |
Policy Name | OpenID Connect OAuth 2.0 Token Enforcement |
Summary | Allows access only to authorized client applications |
Category | Security |
First Mule version available | v4.1.1 |
Returned Status Codes | 400 - Invalid token |
401 - Unauthorized access or error when connecting to the authorization server | |
403 - Forbidden, invalid client application credentials | |
500 - Bad response from authorization server; or WSDL SOAP Fault error (Mule only). |
| Element | Description | Example |
|---|---|---|
Scopes | Displays a space-separated list of supported scopes. | READ, WRITE, READ and WRITE |
Scope Validation Criteria | Determines if the token must contain all defined scopes or just one. The values are Contains all scopes and Contains any scope. For Contains all scopes, the policy only accepts tokens with both the | |
Validate TLS Certificate (Mule only) | Enables third-party authentication server TLS validation. | If selected, the communication with the token validation endpoint uses the TLS protocol. |
Expose Headers | In a proxy scenario, specifies whether headers must be exposed in the request to the backend. User properties returned by the federation server are prefixed with 'X-AGW-' and sent as headers to the backend. | See Leveraging Token Validation Endpoint Information for Mule Applications for more information about this element. |
Skip Client Id Validation | Skips the client application’s API contract validation. | If selected, Step 4 of the diagram in the How This Policy Works section is skipped. |
Authentication request timeout | Sets the maximum time, in milliseconds, to wait for a response when authenticating with the Access Token validation endpoint. |
|
Policy Name | PingFederate OAuth 2.0 Token Enforcement |
Summary | Allows access only to authorized client applications |
Category | Security |
First Mule version available | v4.1.1 |
Returned Status Codes | 400 - Invalid token |
401 - Unauthorized access or error when connecting to the authorization server | |
403 - Forbidden, invalid client application credentials | |
500 - Bad response from authorization server, or WSDL SOAP fault error. |
| Element | Description | Example |
|---|---|---|
Scopes | Displays a space-separated list of supported scopes. |
|
Scope Validation Criteria | Determines whether the token must contain all defined scopes or just one. The values are | If the ‘Contains all scopes’ value is selected, the tokens with the scopes |
Validate TLS Certificate | Enables third-party authentication server TLS validation. | If selected, the communication with the token validation endpoint uses the TLS protocol. |
Expose Headers | In a proxy scenario, specifies whether headers must be exposed in the request to the backend. User properties returned by the federation server are prefixed with 'X-AGW-' and sent as headers to the backend. | See Leveraging Token Validation Endpoint Information for Mule Applications for more information about this element. |
Skip Client Id Validation | Skips the client application’s API contract validation. | If selected, Step 4 of the diagram in the How This Policy Works section is skipped. |
Authentication request timeout | Sets the maximum time, in milliseconds, to wait for a response when authenticating with the Access Token validation endpoint. |
|
| Category | Policy | Function |
|---|---|---|
Security | Basic Authentication - LDAP | Authenticates the LDAP credentials. |
Security | Basic Authentication - Simple | Authenticates a single user password. |
Security | IP Blocklist | Blocks a range of IP addresses. |
Security | IP Allowlist | Allows access from only a preapproved range of IP addresses. |
Security | JSON Threat Protection | Protects against a malicious JSON structure in API requests. |
Security | XML Threat Protection | Protects against malicious XML elements in API requests. |
Security | JWT | Validates a JWT token. |
Security | OAuth 2.0 Access Token Enforcement Using Mule OAuth Provider Policy | Enforces token access using the MuleSoft OAuth Provider policy. |
Security | OpenAM Access Token Enforcement | Restricts access to a protected resource using an Open AM authentication server. |
Security | PingFederate Access Token Enforcement | Restricts access to a protected resource using the PingFederate authentication server. |
Security | Tokenization | Transforms sensitive data into nonsensitive equivalent tokens. |
Security | Detokenization | Transforms a tokenized value back to the original data. |
Compliance | Client ID Enforcement | Allows access to client applications with a valid client credentials. |
Compliance | CORS | Enables calls executed in a web page to interact with resources from different domains. |
Transformation | Header Injection | Adds headers to the request or response message of a policy. |
Transformation | Header Removal | Removes headers from the request or response message of a policy. |
Quality of Service | HTTP Caching | Stores HTTP responses from an API implementation. |
Quality of Service | Rate Limiting | Enables imposing a limit on the number of requests that an API can accept within a specified time. |
Quality of Service | Rate Limiting, SLA-Based | Enables imposing an API request limit based on SLA tiers. |
Quality of Service | Spike Control | Controls API traffic. |
Troubleshooting | Message Logging | Logs a custom message when an API is invoked. |
| Plane | Host | Port |
|---|---|---|
US | anypoint.mulesoft.com | 443 |
US | runtime-manager.anypoint.mulesoft.com | 443 |
US | analytics-ingest.anypoint.mulesoft.com | 443 |
US | data-authenticator.anypoint.mulesoft.com | 443 |
US | exchange-files.anypoint.mulesoft.com | 443 |
US | exchange2-asset-manager-kprod.s3.amazonaws.com | 443 |
US-GOV | runtime-manager.gov.anypoint.mulesoft.com | 443 |
US-GOV | data-authenticator.gov.anypoint.mulesoft.com | 443 |
US-GOV | gov.anypoint.mulesoft.com | 443 |
US-GOV | exchange-files.gov.anypoint.mulesoft.com | 443 |
US-GOV | exchange2-asset-manager-kgprod.s3.us-gov-west-1.amazonaws.com | 443 |
EU | eu1.anypoint.mulesoft.com | 443 |
EU | runtime-manager.eu1.anypoint.mulesoft.com | 443 |
EU | analytics-ingest.eu1.anypoint.mulesoft.com | 443 |
EU | data-authenticator.eu1.anypoint.mulesoft.com | 443 |
EU | exchange-files.eu1.anypoint.mulesoft.com | 443 |
EU | exchange2-asset-manager-kprod-eu.s3.eu-central-1.amazonaws.com | 443 |
Policy name | Rate Limiting |
Summary | Monitors access to an API by defining the maximum number of requests processed within a period of time |
Category | Quality of Service |
First Mule version available | v4.1.0 |
Returned Status Codes | 400 - Quota exceeded by WSDL APIs that use SOAP v1.2 (Mule only). Requests are blocked until the current window completes its processing. |
429 - Quota exceeded, requests are blocked until the current window finishes | |
500 - Quota exceeded by WSDL APIs that use SOAP v1.1 (Mule only). Requests are blocked until the current window completes its processing. |
| Parameter | Description | Example |
|---|---|---|
Identifier | The selector key using a DataWeave or regular String |
|
Number of Reqs | The quota available per window | A positive number |
Time Period | The amount of time for which the quota is to be applied | A positive number |
Time Unit | The time in milliseconds, seconds, minutes, or hours | Minutes |
Distributed | When enabled, the quota is shared among all nodes running the API. For a Mule runtime engine target, the nodes share the quota only when the runtime runs in high-availability (HA) cluster mode. Otherwise, each node enforces the quota independently. | Checked or unchecked |
Expose Headers | The option that defines whether to expose the x-ratelimit headers as part of the response | checked or unchecked |
Policy name | Rate-limiting SLA |
Summary | Monitors access to an API by defining the maximum number of requests processed within a timespan, based on SLAs |
Category | Quality of Service |
First Mule version available | v4.1.0 |
Returned Status Codes | 400 - Invalid client credentials provided or quota exceeded by WSDL APIs that use SOAP v1.2 (Mule only) |
401 - Request blocked due to invalid client credentials (client ID or client secret) provided | |
429 - Quota exceeded; requests blocked until the current window finishes | |
500 - Invalid client credentials provided or quota exceeded by WSDL APIs that use SOAP v1.1 (Mule only) | |
503 - Service Unavailable (Mule only) |
| Parameter | Description | Example |
|---|---|---|
Client ID Expression | A DataWeave expression that resolves the Client Application’s ID for a Contract of the API | Only one rate-limiting algorithm is created per ID: |
Client Secret Expression | A DataWeave expression that resolves the Client application’s client secret for a contract of the API | This is an optional value. Example: |
Distributed | When enabled, the quota is shared among all nodes running the API. For a Mule runtime engine target, the nodes share the quota only when the runtime runs in high-availability (HA) cluster mode. Otherwise, each node enforces the quota independently. | Checked or unchecked |
Expose Headers | Defines whether to expose the x-ratelimit headers, as part of the response | Checked or unchecked |
Policy Name | Spike Control |
Summary | Regulates API traffic |
Category | Quality of Service |
First Mule version available | v4.1.0 |
Returned Status Codes | |
429 - The number of requests by HTTP APIs exceeded the configured limit. Request rejected after specified number of reattempts. | |
400 - The number of requests by WSDL APIs that use SOAP v1.2 exceeded the configured limit. Request rejected after specified number of reattempts (Mule only). | |
500 - The number of requests by WSDL APIs that use SOAP v1.1 exceeded the configured limit. Request rejected after specified number of reattempts (Mule only). |
| Element | Description | Required |
|---|---|---|
Number of Reqs | The number of requests allowed (in milliseconds) in the specified window | Yes |
Time Period | The number of milliseconds, within which a request must be processed | Yes |
Delay Time in Milliseconds | The amount of time for which each request is retained before retrying (in milliseconds) in case there is no quota remaining | Yes |
Delay Attempts | The number of times a request is retried before it is rejected | Yes |
Queuing Limit | The number of requests that can be queued at the any given time | No |
Expose Headers | Enable it only for internal APIs, allows the policy to return information about the algorithm behavior in the X-RateLimit headers | No |
Method & Resource conditions | The option to add configurations to only a select few or all methods and resources of the API | Yes |
Policy name | Tokenization | ||||
Summary | Transforms sensitive data into a nonsensitive equivalent, named token | ||||
Category | Security | ||||
First Mule version available | v4.1.1 | ||||
Returned Status Codes |
| ||||
502 - Connection to the tokenization service is unavailable or not configured. |
| Element | Description | Required |
|---|---|---|
Direction | Whether the values to tokenize are extracted from the request or the response (default). | Yes |
Fail on unmatched expressions | If selected, requests fail when the expression and tokens do not match. | No |
Services | The tokenization services available for the current organization and environment. Select the service that you need from the list. Note that the formats available depend on the service that you choose. | Yes |
Expression | A selector expression that extracts the information to be tokenized. For example: Only expressions using dots as field separators are allowed. While | No. |
Format | Type of information to be tokenized. Formats vary depending on the selected service. If you do not see any formats in the list, verify that the tokenization service that you selected contains at least one. | No |
Policy Name | XML Threat Protection |
Summary | Protects against malicious XML in API requests |
Category | Security |
First Mule version available | v3.8.0 |
Returned Status Codes | 400 - Bad Request |
Field | Description | Default | Required |
Maximum Node Depth | Specifies the maximum node depth of an XML document. | -1 | false |
Maximum Attribute Count Per Element | Specifies the maximum number of attributes in an element. Note that attributes used for defining namespaces are not counted. | -1 | false |
Maximum Child Count | Specifies the maximum number of children of an element in the XML document. | -1 | false |
Maximum Text Length | Specifies the maximum length (in characters) of text nodes in the XML document. | -1 | false |
Maximum Attribute Length | Specifies the maximum length (in characters) of an attribute in the XML document. | -1 | false |
Maximum Comment Length | Specifies the maximum number of comment characters in the XML document. | -1 | false |