Risoluzione dei problemi relativi agli errori di runtime dei criteri di controllo degli accessi
Mantieni tutto organizzato con le raccolte
Salva e classifica i contenuti in base alle tue preferenze.
Stai visualizzando la documentazione di Apigee e Apigee hybrid.
Visualizza la documentazione di
Apigee Edge.
IPDeniedAccess
Codice di errore
accesscontrol.IPDeniedAccess
Corpo della risposta di errore
{
"fault": {
"faultstring": "Access Denied for client ip : client_IP",
"detail": {
"errorcode": "accesscontrol.IPDeniedAccess"
}
}
}
Esempio di messaggio di errore
{
"fault": {
"faultstring": "Access Denied for client ip : 104.132.196.83",
"detail": {
"errorcode": "accesscontrol.IPDeniedAccess"
}
}
}
Causa
Questo errore si verifica se l'indirizzo IP del client o qualsiasi indirizzo IP passato nell'ambito della richiesta dell'API corrisponde a uno o più indirizzi IP specificati nell'elemento <SourceAddress> all'interno dell'elemento <MatchRule> del criterio di controllo dell'accesso e l'attributo action dell'elemento <MatchRule> è impostato su DENY.
Ad esempio, supponiamo che <SourceAddress> sia definito come mostrato di seguito:
Se l'indirizzo IP riportato sopra corrisponde all'indirizzo IP del sistema client (indicato dalla variabile proxy.client.ip) o a uno degli indirizzi IP trasmessi nell'ambito della richiesta API, si verifica l'errore.
Diagnosi
Identifica gli indirizzi IP a cui è stato negato l'accesso per una richiesta API specifica. Puoi trovare queste informazioni nell'elemento faultstring della risposta all'errore.
Ad esempio, nel seguente faultstring, l'indirizzo IP è 104.132.196.83:
"faultstring": "Access Denied for client ip : 104.132.196.83"
Esamina tutte le norme di controllo dell'accesso nel proxy API non riuscito e determina la norma specifica in cui gli indirizzi IP specificati nell'elemento <SourceAddress> corrispondono agli indirizzi IP identificati in faultstring (passaggio 1 sopra).
Ad esempio, il seguente criterio definisce l'IP <SourceAddress> come 104.132.196.83,, che corrisponde a quanto indicato in faultstring:
Determina gli indirizzi IP da cui è stata effettuata la richiesta API. Questa operazione può essere eseguita in diversi modi:
Utilizzo di UI Trace
Acquisisci la traccia della richiesta API non riuscita.
Seleziona il criterio di controllo dell'accesso specifico che ha avuto esito negativo dal riquadro a destra.
Nel riquadro Dettagli fase, controlla il valore della variabile proxy.client.ip come mostrato nello screenshot seguente di una traccia di esempio.
Se proxy.client.ip non è elencato, controlla il valore delle intestazioni del messaggio X-Forwarded-For o True-Client-IP.
Utilizzare i report personalizzati
Puoi creare report personalizzati per determinare se è stato generato un codice di stato 403 durante l'esecuzione del criterio di controllo dell'accesso all'interno del proxy API e anche per determinare l'indirizzo IP del client. Questa operazione è particolarmente utile se il problema si è verificato in passato o se è intermittente e non riesci a acquisire la traccia nell'interfaccia utente.
Proxy, Codice di stato della risposta, IP client proxy e X-Forwarded-For-IP come dimensioni.
In questo modo dovresti riuscire a determinare l'indirizzo IP o gli indirizzi IP client trasmessi che hanno causato l'errore.
Se l'indirizzo IP del client (indicato dalla variabile proxy.client.ip) o qualsiasi indirizzo IP passato nell'ambito della richiesta API corrisponde agli indirizzi IP specificati nell'elemento <SourceAddress> all'interno dell'elemento <MatchRule> del criterio di controllo dell'accesso, dove l'attributo action è impostato su DENY, questa è la causa dell'errore.
Nell'esempio riportato sopra, il valore impostato nella variabile di riferimento proxy.client.ip (come mostrato nello screenshot della traccia sopra) corrisponde all'indirizzo IP definito nell'elemento <SourceAddress> del criterio di controllo dell'accesso, attivando così la risposta di errore:
"faultstring": "Access Denied for client ip : 104.132.196.83"
Risoluzione
Se il criterio di controllo dell'accesso ha lo scopo di negare l'accesso alle richieste API provenienti dagli indirizzi IP specifici elencati in faultstring, il messaggio di errore è previsto. In questo caso, non è richiesta alcuna azione aggiuntiva.
Tuttavia, se stabilisci che è possibile concedere agli indirizzi IP specifici l'accesso alle richieste API per il proxy API specifico, modifica il criterio di controllo dell'accesso per consentire l'accesso a questi indirizzi IP. In alternativa, puoi rimuovere il criterio di controllo dell'accesso dal proxy API se non vuoi negare l'accesso a nessun indirizzo IP.
Ecco un esempio che mostra come consentire l'accesso solo a un indirizzo IP specifico 104.132.196.83 e negarlo per gli altri:
[[["Facile da capire","easyToUnderstand","thumb-up"],["Il problema è stato risolto","solvedMyProblem","thumb-up"],["Altra","otherUp","thumb-up"]],[["Difficile da capire","hardToUnderstand","thumb-down"],["Informazioni o codice di esempio errati","incorrectInformationOrSampleCode","thumb-down"],["Mancano le informazioni o gli esempi di cui ho bisogno","missingTheInformationSamplesINeed","thumb-down"],["Problema di traduzione","translationIssue","thumb-down"],["Altra","otherDown","thumb-down"]],["Ultimo aggiornamento 2025-08-18 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"]]