Solução de problemas de erros de ambiente de execução da política do AccessControl
Mantenha tudo organizado com as coleções
Salve e categorize o conteúdo com base nas suas preferências.
Esta é a documentação da Apigee e da Apigee híbrida.
Confira a documentação da Apigee Edge.
IPDeniedAccess
Código do erro
accesscontrol.IPDeniedAccess
Corpo da resposta de erro
{
"fault": {
"faultstring": "Access Denied for client ip : client_IP",
"detail": {
"errorcode": "accesscontrol.IPDeniedAccess"
}
}
}
Exemplo de mensagem de erro
{
"fault": {
"faultstring": "Access Denied for client ip : 104.132.196.83",
"detail": {
"errorcode": "accesscontrol.IPDeniedAccess"
}
}
}
Causa
Esse erro ocorre se o endereço IP do cliente ou qualquer endereço IP transmitido como parte da solicitação da API corresponder a qualquer endereço IP especificado no elemento <SourceAddress> dentro do elemento <MatchRule> da política de controle de acesso e o atributo action do elemento <MatchRule> está definido como DENY.
Por exemplo, digamos que o <SourceAddress> seja definido conforme mostrado abaixo:
Se o endereço IP acima corresponder ao endereço IP do sistema cliente (indicado pela variável proxy.client.ip) ou qualquer um dos endereços IP passados como parte da solicitação de API, ocorrerá um erro.
Diagnóstico
Identifique os endereços IP que tiveram o acesso negado para uma solicitação de API específica. Você encontra essas informações no elemento faultstring da resposta de erro.
Por exemplo, no faultstring seguinte, o endereço IP é 104.132.196.83:
"faultstring": "Access Denied for client ip : 104.132.196.83"
Examine todas as políticas de controle de acesso no proxy de API com falha e determine a política específica em que os endereços IP especificados no elemento <SourceAddress> correspondem aos endereços IP identificados em faultstring (Etapa 1 acima).
Por exemplo, a política a seguir define o IP <SourceAddress> como 104.132.196.83,, que corresponde ao que está em faultstring:
Determine os endereços IP de onde a solicitação da API foi feita. Isso pode ser feito de várias maneiras:
Como usar o IU Trace
Capture o trace para a solicitação de API com falha.
Selecione a política de controle de acesso específica que falhou no painel à direita.
No painel Detalhes da fase, verifique o valor da variável proxy.client.ip conforme mostrado na captura de tela a seguir de um trace de amostra.
Se proxy.client.ip não estiver listado, verifique o valor dos cabeçalhos de mensagem X-Forwarded-For ou True-Client-IP.
Como usar os relatórios personalizados
É possível criar relatórios personalizados para determinar se um código de status 403 foi gerado durante a execução da política de controle de acesso no proxy de API e também determinar o endereço IP do cliente. Isso é especialmente útil se o problema tiver ocorrido no passado ou se o problema é intermitente e você não consegue capturar o rastro na IU.
Consulte este link para noções básicas sobre como criar e gerenciar relatórios personalizados. No relatório personalizado, escolha:
Soma do tráfego como uma métrica e
Proxy, Código de status de resposta, IP do proxy do cliente e X-Forwarded-For-IP como dimensões.
Isso ajuda a determinar os endereços IP do cliente ou os endereços IP que levaram ao erro.
Se o endereço IP do cliente (indicado pela variável proxy.client.ip) ou qualquer endereço IP passado como parte da solicitação da API correspondem aos endereços IP especificados no elemento <SourceAddress> dentro do elemento <MatchRule> da Política de controle de acesso, em que o atributo action foi definido como DENY, um erro será gerado.
No exemplo mostrado acima, o valor definido na variável de referência proxy.client.ip (como visto na captura de tela do trace acima) corresponde ao endereço IP definido no elemento <SourceAddress> da política de controle de acesso. Dessa forma, ele aciona a resposta de erro:
"faultstring": "Access Denied for client ip : 104.132.196.83"
Resolução
Se a política de controle de acesso destina-se a negar acesso à solicitação de APIs proveniente dos endereços IP específicos listados em faultstring, então a mensagem de erro é esperada. Nesse caso, não é necessária nenhuma outra ação.
No entanto, se você determinar que o(s) endereço(s) IP(s) específico pode receber acesso às solicitações de API do proxy específico da API, modifique a política de controle de acesso para permitir o acesso a esses endereços IP. Como alternativa, você pode remover a Política de controle de acesso do proxy da API, se não quiser negar o acesso aos endereços IP.
Veja um exemplo que mostra como permitir o acesso a um determinado endereço IP específico 104.132.196.83 e negar o acesso para o restante:
[[["Fácil de entender","easyToUnderstand","thumb-up"],["Meu problema foi resolvido","solvedMyProblem","thumb-up"],["Outro","otherUp","thumb-up"]],[["Difícil de entender","hardToUnderstand","thumb-down"],["Informações incorretas ou exemplo de código","incorrectInformationOrSampleCode","thumb-down"],["Não contém as informações/amostras de que eu preciso","missingTheInformationSamplesINeed","thumb-down"],["Problema na tradução","translationIssue","thumb-down"],["Outro","otherDown","thumb-down"]],["Última atualização 2025-08-07 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,["*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\nError code \n\n accesscontrol.IPDeniedAccess\n\nError 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\nExample 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\nCause\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\nDiagnosis\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\nResolution\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"]]