我的目標是將對我的 App Engine 服務的訪問限制為我的家庭辦公室 IP。我已經為 App Engine 防火墻配置了我的 IPv4 和 IPv6 地址的允許規則,并將默認規則設定為拒絕。
這在使用分配給我的應用程式的唯一 appspot.com 地址瀏覽我的應用程式時有效。但是嘗試使用我為 App Engine 配置的自定義域訪問我的應用程式會導致 403。
我進一步驗證了這些規則在 appspot.com 域上按預期作業。不在我的允許串列中的任何內容都會按預期獲得 403。
這告訴我我的規則是“有效的”,但我找不到任何關于為什么這不會影響通過配置的自定義域訪問我的應用程式的參考。
注意:當默認規則設定為允許時,我的應用程式確實使用自定義域作業,所以我確信配置是正確的。
自定義域是否超出了 App Engine 防火墻的范圍?我希望暫時避免深入研究 VPC 配置。
防火墻規則
自定義域配置
編輯:在跟蹤日志時,日志將我的 IPv6 IP 地址顯示為請求 IP:
{
"entries": [
{
"insertId": "dlpqxpfa090t8",
"jsonPayload": {
"appLatencySeconds": "0.011",
"trace": "b7f63eb3d2fb4c52480253c224821a23",
"latencySeconds": "0.011"
},
"httpRequest": {
"requestMethod": "GET",
"requestUrl": "/users/kind/add",
"status": 200,
"responseSize": "4810",
"userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.5112.81 Safari/537.36",
"remoteIp": "2600:****:****:****:****:****:****:9936",
"referer": "https://f******s.e******t.com/users",
"latency": "0.011s",
"protocol": "HTTP/1.1"
},
"resource": {
"type": "gae_app",
"labels": {
"zone": "",
"project_id": "f*******s",
"version_id": "20220801t212517",
"module_id": "default"
}
},
"timestamp": "2022-08-09T22:11:33.869Z",
"labels": {
"appengine.googleapis.com/trace_id": "b*****************a23",
"appengine.googleapis.com/instance_name": "aef-default-2*********7-770v",
"compute.googleapis.com/resource_name": "0**********3",
"compute.googleapis.com/resource_id": "21*********29",
"compute.googleapis.com/zone": "********"
},
"logName": "projects/f********s/logs/appengine.googleapis.com/nginx.request",
"trace": "projects/f*********s/traces/b7f63eb3d2fb4c52480253c224821a23",
"receiveTimestamp": "2022-08-09T22:11:38.104875464Z"
}
]
}
編輯 2:正如評論中所建議的,我嘗試點擊帶有 curl 的 URL。結果如下:
Microsoft Windows [Version 10.0.22000.856]
(c) Microsoft Corporation. All rights reserved.
C:\Users\shawn>curl
curl: try 'curl --help' for more information
C:\Users\shawn>curl https://f*****s.e*******t.com/index
<html><head>
<meta http-equiv="content-type" content="text/html;charset=utf-8">
<title>403 Forbidden</title>
</head>
<body text=#000000 bgcolor=#ffffff>
<h1>Error: Forbidden</h1>
<h2>Access is forbidden.</h2>
<h2></h2>
<script defer src="https://static.cloudflareinsights.com/beacon.min.js/v652eace1692a40cfa3763df669d7439c1639079717194" integrity="sha512-Gi7xpJR8tSkrpF7aordPZQlW2DLtzUlZcumS8dMQjwDHEnw9I7ZLyiOj/6tZStRBGtGgN6ceN6cMH8z7etPGlw==" data-cf-beacon='{"rayId":"738c818088a17d62","version":"2022.6.0","r":1,"token":"c070c2d4c5ad48d18815371af21d9e80","si":100}' crossorigin="anonymous"></script>
</body></html>
C:\Users\shawn>
注意:我認為我認為 IPv6 是罪魁禍首,但我已經完全禁用了 IPv6,并且https://whatismyipaddress.com/表明我不再廣播 IPv6 地址。還是沒有骰子。
uj5u.com熱心網友回復:
Cloudflare 代理 CNAME 再次來襲。在 Cloudflare 中為指向 ghs.googlehosted.com 的 CNAME 關閉此功能大約 5 分鐘后解決了該問題。
轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/507752.html
標籤:Google Cloud Collective 谷歌应用引擎 谷歌云平台 防火墙 应用引擎灵活