Solución de problemas de errores de entorno de ejecución de la política AccessControl
Organiza tus páginas con colecciones
Guarda y categoriza el contenido según tus preferencias.
Estás viendo la documentación de Apigee y Apigee Hybrid.
Consulta la documentación de Apigee Edge.
IPDeniedAccess
Código de error
accesscontrol.IPDeniedAccess
Cuerpo de la respuesta del error
{
"fault": {
"faultstring": "Access Denied for client ip : client_IP",
"detail": {
"errorcode": "accesscontrol.IPDeniedAccess"
}
}
}
Ejemplo de mensaje de error
{
"fault": {
"faultstring": "Access Denied for client ip : 104.132.196.83",
"detail": {
"errorcode": "accesscontrol.IPDeniedAccess"
}
}
}
Causa
Este error se produce si la dirección IP del cliente o cualquier dirección IP pasada como parte de la solicitud de la API coincide con cualquier dirección IP especificada en el elemento <SourceAddress> dentro del elemento <MatchRule> de la Política de control de acceso. El atributo action del elemento <MatchRule> se establece en DENY.
Por ejemplo, supongamos que se define <SourceAddress> de la siguiente manera:
Si la dirección IP anterior coincide con la dirección IP del sistema cliente (indicado por la variable proxy.client.ip) o en cualquiera de las direcciones IP pasadas como parte de la solicitud a la API, se producirá el error.
Diagnóstico
Identifica las direcciones IP de acceso denegado a una solicitud a la API específica. Puedes encontrar esta información en el elemento faultstring de la respuesta de error.
Por ejemplo, en el siguiente campo faultstring, la dirección IP es 104.132.196.83:
"faultstring": "Access Denied for client ip : 104.132.196.83"
Examina todas las políticas de control de acceso del proxy de API con errores y determina la política específica en la que las direcciones IP especificadas en el elemento <SourceAddress> coinciden con las direcciones IP identificadas en faultstring (paso 1 anterior).
Por ejemplo, la siguiente política define la IP <SourceAddress> como 104.132.196.83, que coincide con lo que se encuentra en la faultstring:
Determina las direcciones IP desde las que se realizó la solicitud a la API. Esto se puede hacer de varias maneras:
Usa el seguimiento de la IU
Captura el seguimiento de la solicitud a la API con errores.
Selecciona la política de control de acceso específica que falló en el panel derecho.
En el panel Detalles de la fase, verifica el valor de la variable proxy.client.ip, como se muestra en la siguiente captura de pantalla de un seguimiento de muestra.
Si proxy.client.ip no está en la lista, verifica el valor de los encabezados de mensajes X-Forwarded-For o True-Client-IP.
Usa informes personalizados
Puede crear informes personalizados para determinar si se emitió un código de estado 403 durante la ejecución de la política de Control de acceso en el proxy de API y, además, determinar la dirección IP del cliente. Esto es particularmente útil si el problema ocurrió en el pasado o si el problema es intermitente y no puedes capturar el seguimiento en la IU.
Consulta Crea y administra informes personalizados a fin de obtener información para crear informes personalizados. En el informe personalizado, selecciona lo siguiente:
Suma de tráfico como métrica, y
Proxy, Código de estado de respuesta, IP de cliente de proxy y X-Forwarded-For-IP como dimensiones.
Esto debería ayudarte a determinar la dirección IP de cliente o las direcciones IP que generaron el error.
Si la dirección IP del cliente (indicada por la variable proxy.client.ip ), o cualquier dirección IP que se pasa como parte de la solicitud a la API, coincide con las direcciones IP especificadas en el <SourceAddress> dentro del elemento <MatchRule> de la política de control de acceso, en la cual el atributo action se establece en DENY, significa que esa es la causa del error.
En el ejemplo anterior, el valor establecido en la variable de referencia proxy.client.ip (como se ve en la captura de pantalla anterior) coincide con la dirección IP definida en el elemento <SourceAddress> de la política de control de acceso, lo que activa la respuesta de error:
"faultstring": "Access Denied for client ip : 104.132.196.83"
Solución
Si la política de control de acceso está destinada a denegar el acceso a las solicitudes a la API provenientes de las direcciones IP específicas enumeradas en faultstring, se esperará el mensaje de error. En este caso, no es necesario que realices ninguna acción adicional.
Sin embargo, si determinas que las direcciones IP específicas pueden recibir acceso a las solicitudes a la API para el proxy de API específico, modifica la política de control de acceso a fin de permitir el acceso a esas direcciones IP. Como alternativa, puede quitar la política de control de acceso del proxy de API si no deseas denegar el acceso a ninguna dirección IP.
A continuación, puedes ver un ejemplo de cómo permitir el acceso solo a una dirección IP específica 104.132.196.83 y denegar el acceso para el resto:
[[["Fácil de comprender","easyToUnderstand","thumb-up"],["Resolvió mi problema","solvedMyProblem","thumb-up"],["Otro","otherUp","thumb-up"]],[["Difícil de entender","hardToUnderstand","thumb-down"],["Información o código de muestra incorrectos","incorrectInformationOrSampleCode","thumb-down"],["Faltan la información o los ejemplos que necesito","missingTheInformationSamplesINeed","thumb-down"],["Problema de traducción","translationIssue","thumb-down"],["Otro","otherDown","thumb-down"]],["Última actualización: 2025-09-04 (UTC)"],[[["\u003cp\u003eThis documentation pertains to the \u003ccode\u003eaccesscontrol.IPDeniedAccess\u003c/code\u003e error in Apigee and Apigee hybrid, which occurs when a client IP is denied access by an Access Control Policy.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eaccesscontrol.IPDeniedAccess\u003c/code\u003e error is triggered when the client's IP address, or an IP passed in the request, matches an IP in the \u003ccode\u003e<SourceAddress>\u003c/code\u003e element within the \u003ccode\u003e<MatchRule>\u003c/code\u003e of an Access Control Policy with the \u003ccode\u003eaction\u003c/code\u003e attribute set to \u003ccode\u003eDENY\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eTo diagnose the issue, identify the denied IP address from the \u003ccode\u003efaultstring\u003c/code\u003e in the error response, and locate the corresponding Access Control Policy where the IP is listed in the \u003ccode\u003e<SourceAddress>\u003c/code\u003e element.\u003c/p\u003e\n"],["\u003cp\u003eThe source IP address can be determined by examining the \u003ccode\u003eproxy.client.ip\u003c/code\u003e variable in a UI Trace or by creating a custom report that includes Proxy, Response Status Code, Proxy Client IP, and X-Forwarded-For-IP as dimensions.\u003c/p\u003e\n"],["\u003cp\u003eResolving this error involves either confirming the intended denial of access or modifying the Access Control Policy to allow the specific IP address by changing the \u003ccode\u003eaction\u003c/code\u003e to \u003ccode\u003eALLOW\u003c/code\u003e or removing the Access Control Policy altogether.\u003c/p\u003e\n"]]],[],null,["# AccessControl policy runtime error troubleshooting\n\n*You're viewing **Apigee** and **Apigee hybrid** documentation.\nView [Apigee Edge](https://docs.apigee.com/api-platform/troubleshoot/policies/runtime/access-control-runtime-errors) documentation.*\n| **Note:** Was this troubleshooting playbook helpful? Please let us know by clicking [Send Feedback]().\n\nIPDeniedAccess\n--------------\n\n### Error code\n\n accesscontrol.IPDeniedAccess\n\n### Error response body\n\n```scdoc\n{\n \"fault\": {\n \"faultstring\": \"Access Denied for client ip : client_IP\",\n \"detail\": {\n \"errorcode\": \"accesscontrol.IPDeniedAccess\"\n }\n }\n}\n```\n\n### Example error message\n\n {\n \"fault\": {\n \"faultstring\": \"Access Denied for client ip : 104.132.196.83\",\n \"detail\": {\n \"errorcode\": \"accesscontrol.IPDeniedAccess\"\n }\n }\n }\n\n### Cause\n\nThis error occurs if the client IP address, or any IP address passed as part of the API request, matches any IP address(es) specified in the `\u003cSourceAddress\u003e` element within the `\u003cMatchRule\u003e` element of the Access Control Policy, and the `action` attribute of the `\u003cMatchRule\u003e` element is set to `DENY`.\n\nFor example, let's say the `\u003cSourceAddress\u003e` is defined as shown below: \n\n \u003cSourceAddress mask=\"32\"\u003e104.132.196.83\u003c/SourceAddress\u003e\n\nIf the above IP address matches the IP address of the client system (indicated by the variable `proxy.client.ip`), or any of the IP addresses passed as part of the API request, the error will occur.\n\n### Diagnosis\n\n1. Identify the IP address(es) denied access for a specific API request. You can find this information in the `faultstring` element of the error response.\n\n For example, in the following `faultstring`, the IP address is `104.132.196.83:` \n\n \"faultstring\": \"Access Denied for client ip : 104.132.196.83\"\n\n2. Examine all the Access Control policies in the failed API Proxy and determine the specific policy where the IP address(es) specified in the `\u003cSourceAddress\u003e` element matches the IP address(es) identified in the `faultstring` (Step 1 above).\n\n For example, the following policy defines the `\u003cSourceAddress\u003e` IP as `104.132.196.83,` which matches what is in the `faultstring`: \n\n \u003c?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?\u003e\n \u003cAccessControl async=\"false\" continueOnError=\"false\" enabled=\"true\" name=\"Access-Control\"\u003e\n \u003cDisplayName\u003eAccess-Control\u003c/DisplayName\u003e\n \u003cProperties/\u003e\n \u003cIPRules noRuleMatchAction=\"ALLOW\"\u003e\n \u003cMatchRule action=\"DENY\"\u003e\n \u003cSourceAddress mask=\"32\"\u003e104.132.196.83\u003c/SourceAddress\u003e\n \u003c/MatchRule\u003e\n \u003c/IPRules\u003e\n \u003c/AccessControl\u003e\n\n3. Determine the IP address(es) from which the API request was made. This can be done in multiple ways:\n\n 1. Using UI Trace\n\n 1. Capture the trace for the failing API request.\n 2. Select the specific Access Control Policy that has failed from the right hand panel.\n 3. In the **Phase Details** pane, check the value of the variable `proxy.client.ip` as shown in the following screenshot of a sample trace.\n\n 4. If the `proxy.client.ip` is not listed, then check the value of the\n X-Forwarded-For or True-Client-IP message headers.\n\n 2. Using Custom Reports\n\n You can create Custom Reports to determine whether a 403 status code was thrown during the execution of the Access Control policy within the API proxy and also determine the client IP address. This is particularly useful if the issue has occurred in the past or if the issue is intermittent and you are unable to capture the trace in UI.\n\n Refer to [Creating and managing custom reports](/apigee/docs/api-platform/analytics/create-custom-reports) to understand how to create custom reports. In the custom report, choose:\n 1. **Sum of Traffic** as a Metric, and\n\n 2. **Proxy** , **Response Status Code** , **Proxy Client IP** , and **X-Forwarded-For-IP** as Dimensions.\n\n This should help you to determine the client IP or IP addresses passed that led to the error.\n4. If the client IP address (indicated by the variable `proxy.client.ip`), or any IP address passed as part of the API request, matches the IP address(es) specified in the `\u003cSourceAddress\u003e` element within the `\u003cMatchRule\u003e` element of Access Control Policy, where the `action` attribute is set to `DENY`, then that is the cause of the error.\n\n In the example shown above, the value set in the reference variable `proxy.client.ip` (as seen in the screenshot of the trace above) matches the IP address defined in the `\u003cSourceAddress\u003e` element of the Access Control policy, thus triggering the error response: \n\n \"faultstring\": \"Access Denied for client ip : 104.132.196.83\"\n\n### Resolution\n\nIf the Access Control policy is intended to deny access to API requests coming from the specific IP address(es) listed in the `faultstring`, then the error message is expected. In this case, there is no additional action is required.\n\nHowever, if you determine that the specific IP address(es) can be given access to the API requests for the specific API Proxy, then modify the Access Control Policy to allow access to those IP address(es). Alternatively, you can remove the Access Control Policy from the API Proxy if you don't want to deny access to any IP address(es).\n\nHere is an example that shows how to allow access to a specific IP Address `104.132.196.83` only and deny access for the rest: \n\n \u003cAccessControl name=\"ACL\"\u003e\n \u003cIPRules noRuleMatchAction = \"DENY\"\u003e\n \u003cMatchRule action = \"ALLOW\"\u003e\n \u003cSourceAddress mask=\"32\"\u003e104.132.196.83\u003c/SourceAddress\u003e\n \u003c/MatchRule\u003e\n \u003c/IPRules\u003e\n \u003c/AccessControl\u003e"]]