內容導向網頁應用程式後端的安全性
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
後端安全性 (又稱為伺服器端安全性) 是指用於保護網頁應用程式後端元件的做法,包括伺服器、伺服器端核心、資料庫和 API 端點,避免受到威脅和安全漏洞的影響。安全性是開發網頁應用程式時不可或缺的一環,因為安全性可確保私人客戶資料的可信度、完整性和可用性。
使用後端做為服務產品的優點之一,就是系統已為您完成大量威脅管理工作。但設定不正確的使用者權限等情況,可能使最安全的後端不安全。
開發內容導向網頁應用程式時,請務必善用程式設計技巧、設定和設定最佳做法、工具、基礎架構和服務,降低潛在威脅或風險。OWASP 十大企業提供目前和新興網頁應用程式安全性風險的總覽,以及如何在 Google Cloud 上降低這些風險。
網頁應用程式防火牆
網頁應用程式防火牆 (WAF,例如 Google Cloud Armor) 是一種安全性解決方案,用於保護網頁應用程式不受各種線上威脅,包括常見的網路安全漏洞和攻擊。做為外部要求和內部系統之間的一層,通常是直接整合在接收外部流量的負載平衡或端點。他們會根據安全性政策監控及分析傳入要求,這些政策可允許或拒絕流量,封鎖惡意要求和潛在威脅。網路應用程式防火牆通常會與其他安全措施搭配使用 (例如定期安全性測試、安全程式設計做法和網路安全性控管),為網頁應用程式建立完善的安全策略。許多雲端服務供應商都提供網路應用程式託管環境來整合網路應用程式防火牆服務。
進一步瞭解如何設定 Google Cloud Armor 以保護後端。
連入流量的 Proxy 層
連入 Proxy 層 (通常稱為反向 Proxy) 是一種網路安全性元件,位於用戶端要求與網路伺服器、應用程式或服務之間。它會代表伺服器後方的伺服器處理傳入要求,扮演中介角色。這項技術提供多項優點,包括安全性、負載平衡、快取和轉送。
代管 Proxy (或門面) 層是指外包給第三方供應商的網路基礎架構元件,或是負責監督機構的 Proxy 伺服器部署、維護和運作的代管服務。代管 Proxy 層可提高網路安全性、將效能最佳化,並提供其他網路功能。您可以利用代管 Proxy 層,卸載與網路元件相關的營運和管理責任,減輕內部 IT 團隊的負擔。這些服務通常可擴充,且可以根據特定的安全性或法規遵循需求進行自訂。
例如,針對可外部存取的 API,Apigee 是一個雲端原生 API 管理平台,可在流量到達後端前管理流量、隔離要求,以及強制執行安全政策。
服務最佳做法
請考慮應用程式所用服務的安全性最佳做法,並按照相關建議操作。舉例來說,如果是 Cloud Run,請務必驗證要求並保護雲端資源。如需 Cloud SQL 的最佳做法,請參閱設定、架構及管理資料的最佳做法。
Secret Manager 這類密鑰管理系統會處理安全的儲存空間、管理和存取應用程式密鑰 (例如 API 金鑰、憑證和加密編譯金鑰)。這些服務可以透過連接器連線至其他後端服務,讓後端系統能夠安全地存取您的密鑰。
如果您在後端使用其他 API、SDK 或服務,請另外研究並遵循最佳做法。舉例來說,如果您使用 Google 地圖平台服務,請遵循處理 API 金鑰及保護應用程式的建議最佳做法。
監控和快訊,包括記錄與稽核存取,也都是應考量的重要層面。
Google Cloud 安全性最佳做法針對安全的架構和應用程式設計提供了一般藍色的印花和總覽。Security Command Center 提供一套 Google Cloud 安全性和風險管理工具工具,其中包括可找出設定錯誤、安全漏洞和其他風險的自動化工具。
開發最佳做法
請遵循用於實作後端的架構和語言最佳做法。大部分熱門網路架構都發布了確實遵循的指南和最佳做法。
建議您在開發或建構管道時考慮使用自動化分析工具,以協助找出潛在問題。
OWASP Web Security Testing 指南 提供專為網頁應用程式設計的測試架構。
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-07-25 (世界標準時間)。
[null,null,["上次更新時間:2025-07-25 (世界標準時間)。"],[[["\u003cp\u003eBackend security focuses on safeguarding servers, databases, and APIs to protect sensitive data.\u003c/p\u003e\n"],["\u003cp\u003eUtilizing Web Application Firewalls (WAFs) and proxy layers enhances security by filtering malicious traffic and acting as intermediaries between clients and servers.\u003c/p\u003e\n"],["\u003cp\u003eImplementing service-specific security best practices, such as authentication and resource access control, is crucial for individual components of your backend infrastructure.\u003c/p\u003e\n"],["\u003cp\u003eEmploying a secret management system and adhering to development best practices, including secure coding and automated analysis, strengthens overall application security.\u003c/p\u003e\n"],["\u003cp\u003eContinuous monitoring, alerting, and leveraging security tools like Google Cloud's Security Command Center are essential for ongoing threat detection and mitigation.\u003c/p\u003e\n"]]],["Backend security involves safeguarding server-side components like servers, databases, and APIs. Key actions include implementing Web Application Firewalls (WAFs) like Google Cloud Armor, utilizing proxy layers for traffic management, and following service-specific security best practices. Secret management systems, such as Secret Manager, secure sensitive data. Monitoring, alerting, logging, auditing access, and development best practices, including the OWASP testing guide, are essential for risk mitigation.\n"],null,["# Security for content-driven web app backends\n\nBackend security, also known as server-side security, refers to the practices\nused to protect the backend components of a web application, including servers,\nserver-side core, database, and API endpoints from threats and vulnerabilities.\nSecurity is an essential aspect of web application development since it ensures\nconfidentiality, integrity, and availability of private customer data.\n\nOne of the advantages of using Backend as a Service products is that a lot of\nthe threat management work is being done for you. But even the most secure\nbackend can be made insecure by, for example, setting incorrect user\npermissions.\n\nWhen developing a content-driven web application, it is essential to utilize\nprogramming techniques, configuration and setup best practices, tooling,\ninfrastructure, and services to mitigate potential threats or risks. The [OWASP\nTop Ten](https://owasp.org/www-project-top-ten/) provides an\noverview of current and emerging web application security risks and [how they\ncan be mitigated on Google\nCloud](https://cloud.google.com/architecture/owasp-top-ten-mitigation).\n\nWeb Application Firewalls\n-------------------------\n\nA Web Application Firewall (WAF), such as [Google Cloud\nArmor](https://cloud.google.com/armor/docs/cloud-armor-overview), is a security\nsolution designed to protect web applications from a variety of online threats,\nincluding common web vulnerabilities and attacks. They act as a layer between\nexternal requests and your internal systems, often integrated directly at the\nload balancing or endpoint where external traffic is received. They monitor and\nanalyze incoming requests based on security policies that permit or deny\ntraffic, blocking malicious requests and potential threats. WAFs are often used\nwith other security measures, including regular security testing, secure coding\npractices, and network security controls, to create a comprehensive security\nstrategy for web applications. Many cloud providers offer WAF services that can\nbe integrated into web application hosting environments.\n\n[Learn more about setting up Google Cloud Armor to secure your\nbackend](https://cloud.google.com/armor/docs/how-to).\n\nProxy layer for incoming traffic\n--------------------------------\n\nAn incoming proxy layer, often referred to as a reverse proxy, is a network\nsecurity component that sits between client requests and web servers,\napplications, or services. It handles incoming requests on behalf of the servers\nbehind it, acting as an intermediary. It provides several benefits, including\nsecurity, load balancing, caching, and routing.\n\nManaged proxy (or facade) layers refer to a network infrastructure component\nthat is outsourced to a 3rd party provider or a managed service that oversees\nthe deployment, maintenance, and operation of proxy servers for an organization.\nManaged proxy layers enhance network security, optimize performance, and provide\nadditional networking functions. By utilizing managed proxy layers, you can\noffload the operational and administrative responsibilities associated with\nnetworking components, reducing the burden on in-house IT teams. These services\nare often scalable and can be customized to meet specific security or compliance\nrequirements.\n\nFor example, for an externally accessible API, [Apigee is a cloud-native API\nmanagement\nplatform](https://cloud.google.com/apigee/docs/api-platform/get-started/what-apigee)\nthat provides features to manage traffic, isolate requests, and enforce security\npolicies before traffic reaches the backend.\n\nService best practices\n----------------------\n\nConsider the security best practices for the services your application is using\nand follow its advice. For example, for Cloud Run make sure to [authenticate\nyour requests](https://cloud.google.com/run/docs/authenticating/overview) and\n[secure your cloud\nresources](https://cloud.google.com/run/docs/securing/managing-access). For\n[Cloud SQL follow the best\npractices](https://cloud.google.com/sql/docs/postgres/best-practices) for\nconfiguring, architecting and managing your data.\n\nA secret management system like [Secret\nManager](https://cloud.google.com/secret-manager/docs/overview) handles secure\nstorage, management and access to your application's secrets, such as API keys,\ncertificates and cryptographic keys. These services can be connected to your\nother backend services through connectors, allowing your backend systems to\naccess your secrets securely.\n\nIf you use any other APIs, SDKs or services in your backend, also research and\nfollow their best practices. For example, if you use a Google Maps Platform\nservice, follow the [recommended best practices for handling API keys and\nprotecting your\napplication](https://developers.google.com/maps/api-security-best-practices).\n\nMonitoring and alerting, including logging and auditing access are also\nimportant aspects to consider.\n\nThe [Google Cloud security best\npractices](https://cloud.google.com/security/best-practices) provide general\nblue prints and overviews over secure architecture and app designs. The\n[Security Command Center](https://cloud.google.com/security-command-center)\nincludes a suite of tools for security and risk management on Google Cloud,\nincluding automated tooling to identify misconfigurations, vulnerabilities and\nother risks.\n\nDevelopment best practices\n--------------------------\n\nFollow the best practices for the framework and language you use to implement\nthe backend. Most popular web frameworks have published guides and best\npractices to follow.\n\nConsider automated analysis tooling as part of your development or build\npipeline to help identify potential issues.\n\nThe [OWASP Web Security Testing\nGuide](https://owasp.org/www-project-web-security-testing-guide/)\nprovides a testing framework that is specifically targeted at web applications."]]