Web Risk 是一項全新的企業安全產品,可讓用戶端應用程式根據 Google 持續更新的不安全網頁資源清單來檢查網址。不安全的網頁資源包括社交工程網站 (例如網路釣魚和詐欺網站),以及託管惡意軟體或垃圾軟體的網站。這份清單中的所有網址都會被視為不安全。Google 致力於提供最準確且最新的不安全網路資源資訊。不過,Google 無法保證資訊完整無誤,因為有些危險網站可能無法辨識,有些安全網站也可能遭到誤判。
如要判斷網址是否在任何清單中,用戶端可以使用 Lookup API 或 Update API。
Lookup API
Lookup API 可讓用戶端應用程式將網址傳送至 Web Risk 伺服器,檢查網址狀態。這個 API 簡單易用,因為可避免 Update API 的複雜性。
優點
簡單的網址檢查:您傳送含有實際網址的 HTTP GET 要求,伺服器會傳回網址狀態 (安全或不安全)。
缺點
隱私權:網址不會經過雜湊處理,因此伺服器會知道您查詢的網址。
回應時間:伺服器會處理每項查詢要求。我們無法保證查詢的回應時間。
如果您不太擔心查詢網址的隱私權,且可以容忍網路要求造成的延遲,建議使用 Lookup API,因為這個 API 較容易使用。
Update API
Update API 可讓用戶端應用程式下載經雜湊處理的不安全清單,並儲存在本機資料庫中,然後在本機檢查。只有在本機資料庫中發現相符資料時,用戶端才需要傳送要求至 Web Risk 伺服器,以驗證該網址是否列於不安全清單中。這個 API 的實作方式比 Lookup API 複雜,但大多數情況下都能進行本機查詢,因此速度較快。
[[["容易理解","easyToUnderstand","thumb-up"],["確實解決了我的問題","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["難以理解","hardToUnderstand","thumb-down"],["資訊或程式碼範例有誤","incorrectInformationOrSampleCode","thumb-down"],["缺少我需要的資訊/範例","missingTheInformationSamplesINeed","thumb-down"],["翻譯問題","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["上次更新時間:2025-09-04 (世界標準時間)。"],[],[],null,["# Overview of Web Risk\n====================\n\nWeb Risk is a new enterprise security product that lets your client\napplications check URLs against Google's\nconstantly updated lists of unsafe web resources. Examples of unsafe web\nresources are social engineering sites, like phishing and deceptive sites, and\nsites that host malware or unwanted software. Any URL found on this list is\nconsidered unsafe. Google works to provide the most accurate and up-to-date\ninformation about unsafe web resources. However, Google cannot guarantee that\nits information is comprehensive and error-free: some risky sites may not be\nidentified, and some safe sites may be classified in error.\n\nTo determine if a URL is on any of the lists, clients\ncan use either the Lookup API or the Update API .\n| **Note:** The information returned by the Web Risk must not be redistributed.\n\nLookup API\n----------\n\nThe Lookup API lets your client applications send URLs to the\nWeb Risk server to check their status. This API is simple and easy\nto use, because it avoids the complexities of the Update API.\n\n### Advantages\n\n- **Simple URL checks**: You send an HTTP GET request with the actual URL, and the server responds with the state of the URL (safe or unsafe).\n\n### Drawbacks\n\n- **Privacy**: URLs aren't hashed, so the server knows which URLs you look up.\n- **Response time**: Every lookup request is processed by the server. We don't provide guarantees on lookup response time.\n\nIf you aren't too concerned about the privacy of the queried URLs, and you can\ntolerate the latency induced by a network request, consider using the Lookup API\nbecause it's easier to use.\n\nUpdate API\n----------\n\nThe Update API lets your client applications download and store hashed versions of the\nunsafe lists in a local database, and check them locally. Only if a\nmatch is found in the local database does the client need to send a request to\nthe Web Risk servers to verify whether the URL is included on the unsafe\nlists. This API is more complex to implement than the Lookup API, but enables local\nlookups in most cases so it's faster.\n\n### Advantages\n\n- **Privacy**: You exchange data with the server infrequently (only after a local hash prefix match) and using hashed URLs, so the server never knows the actual URLs queried by the clients.\n- **Response time**: You maintain a local database that contains copies of the Web Risk lists; they do not need to query the server every time they want to check a URL.\n\n### Drawbacks\n\n- **Implementation**: You need to set up a local database and then download, and periodically update, the local copies of the Web Risk lists (stored as variable-length SHA256 hashes).\n- **Complex URL checks**: You need to know how to canonicalize URLs, create suffix/prefix expressions, and compute SHA256 hashes for comparison with the local copies of the Web Risk lists and the Web Risk lists stored on the server.\n\nIf you are concerned about the privacy of the queried URLs or the latency\ninduced by a network request, use the Update API.\n\nWhat's next\n-----------\n\n- Learn how to [set up Web Risk](/web-risk/docs/quickstart)."]]