การรักษาความปลอดภัยสำหรับแบ็กเอนด์เว็บแอปที่ขับเคลื่อนด้วยเนื้อหา
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
ความปลอดภัยแบ็กเอนด์หรือที่เรียกว่าการรักษาความปลอดภัยฝั่งเซิร์ฟเวอร์หมายถึงแนวทางปฏิบัติที่ใช้ปกป้องคอมโพเนนต์แบ็กเอนด์ของเว็บแอปพลิเคชัน ซึ่งรวมถึงเซิร์ฟเวอร์ เซิร์ฟเวอร์หลัก ฐานข้อมูล และปลายทาง API ฝั่งเซิร์ฟเวอร์จากภัยคุกคามและช่องโหว่
ความปลอดภัยเป็นส่วนสำคัญของการพัฒนาเว็บแอปพลิเคชันเนื่องจากช่วยรับประกันความน่าเชื่อถือ ความสมบูรณ์ และความพร้อมใช้งานของข้อมูลส่วนตัวของลูกค้า
ข้อดีอย่างหนึ่งของการใช้แบ็กเอนด์เป็นผลิตภัณฑ์บริการคือมีการจัดการภัยคุกคามมากมายให้คุณ แต่แม้แต่แบ็กเอนด์ที่ปลอดภัยที่สุดก็อาจไม่ปลอดภัยได้ เช่น การตั้งค่าสิทธิ์ของผู้ใช้ที่ไม่ถูกต้อง
เมื่อพัฒนาเว็บแอปพลิเคชันที่ขับเคลื่อนด้วยเนื้อหา คุณจำเป็นต้องใช้เทคนิค การกำหนดค่า และการตั้งค่าแนวทางปฏิบัติที่ดีที่สุด เครื่องมือ โครงสร้างพื้นฐาน และบริการเพื่อลดภัยคุกคามหรือความเสี่ยงที่อาจเกิดขึ้น OWASP 10 อันดับสูงสุด แสดงภาพรวมเกี่ยวกับความเสี่ยงด้านความปลอดภัยของเว็บแอปพลิเคชันในปัจจุบันและที่กำลังเกิดขึ้น รวมถึงวิธีลดความเสี่ยงเหล่านั้นบน Google Cloud
ไฟร์วอลล์สำหรับเว็บแอปพลิเคชัน
ไฟร์วอลล์สำหรับเว็บแอปพลิเคชัน (WAF) เช่น Google Cloud Armor เป็นโซลูชันด้านความปลอดภัยที่ออกแบบมาเพื่อปกป้องเว็บแอปพลิเคชันจากภัยคุกคามออนไลน์ต่างๆ รวมถึงช่องโหว่และการโจมตีเว็บทั่วไป โดยทำหน้าที่เป็นชั้นระหว่างคำขอภายนอกกับระบบภายใน โดยมักจะผสานรวมโดยตรงที่การจัดสรรภาระงานหรือปลายทางที่รับการรับส่งข้อมูลภายนอก โดยจะตรวจสอบและวิเคราะห์คำขอขาเข้าตามนโยบายความปลอดภัยที่อนุญาตหรือปฏิเสธการรับส่งข้อมูล บล็อกคำขอที่เป็นอันตรายและภัยคุกคามที่อาจเกิดขึ้น WAF มักใช้ร่วมกับมาตรการรักษาความปลอดภัยอื่นๆ เช่น การทดสอบความปลอดภัยทั่วไป การเขียนโค้ดที่ปลอดภัย และการควบคุมความปลอดภัยของเครือข่าย เพื่อสร้างกลยุทธ์การรักษาความปลอดภัยที่ครอบคลุมสำหรับเว็บแอปพลิเคชัน ผู้ให้บริการคลาวด์หลายรายเสนอบริการ WAF ที่สามารถ
ผสานรวมกับสภาพแวดล้อมการโฮสต์เว็บแอปพลิเคชันได้
ดูข้อมูลเพิ่มเติมเกี่ยวกับการตั้งค่า Google Cloud Armor เพื่อรักษาความปลอดภัยให้แบ็กเอนด์
เลเยอร์พร็อกซีสำหรับการรับส่งข้อมูลขาเข้า
เลเยอร์พร็อกซีขาเข้าซึ่งมักเรียกว่าพร็อกซีแบบย้อนกลับ เป็นคอมโพเนนต์ด้านความปลอดภัยของเครือข่ายที่อยู่ระหว่างคำขอของไคลเอ็นต์กับเว็บเซิร์ฟเวอร์ แอปพลิเคชัน หรือบริการ โดยจะจัดการคำขอขาเข้าในนามของเซิร์ฟเวอร์เบื้องหลัง โดยทำหน้าที่เป็นสื่อกลาง เครื่องมือนี้มีประโยชน์หลายประการ ได้แก่ การรักษาความปลอดภัย
การจัดสรรภาระงาน การแคช และการกำหนดเส้นทาง
เลเยอร์ของพร็อกซีที่มีการจัดการ (หรือส่วนหน้า) คือคอมโพเนนต์โครงสร้างพื้นฐานของเครือข่ายที่ว่าจ้างผู้ให้บริการบุคคลที่สามหรือบริการที่มีการจัดการซึ่งดูแลการติดตั้งใช้งาน การบำรุงรักษา และการดำเนินการของพร็อกซีเซิร์ฟเวอร์สำหรับองค์กร
เลเยอร์พร็อกซีที่มีการจัดการช่วยเพิ่มความปลอดภัยของเครือข่าย เพิ่มประสิทธิภาพการทำงาน และมีฟังก์ชันเครือข่ายเพิ่มเติม การใช้เลเยอร์พร็อกซีที่มีการจัดการจะช่วยลดภาระในการปฏิบัติงานและหน้าที่ในการดูแลระบบที่เกี่ยวข้องกับองค์ประกอบด้านเครือข่าย ซึ่งช่วยลดภาระให้กับทีมไอทีภายในองค์กรได้ บริการเหล่านี้มักรองรับการปรับขนาดและสามารถปรับแต่งให้เป็นไปตามข้อกำหนดด้านการรักษาความปลอดภัยหรือการปฏิบัติตามข้อกำหนดที่เจาะจง
เช่น สำหรับ API ที่เข้าถึงได้จากภายนอก Apigee คือแพลตฟอร์มการจัดการ API ที่ดำเนินการบนระบบคลาวด์ซึ่งมีฟีเจอร์ในการจัดการการรับส่งข้อมูล แยกคำขอ และบังคับใช้นโยบายความปลอดภัยก่อนที่การรับส่งข้อมูลจะไปถึงแบ็กเอนด์
แนวทางปฏิบัติแนะนำสำหรับบริการ
พิจารณาแนวทางปฏิบัติแนะนำด้านความปลอดภัยสำหรับบริการที่แอปพลิเคชันใช้อยู่และทำตามคำแนะนำ ตัวอย่างเช่น สำหรับ Cloud Run คุณต้องตรวจสอบสิทธิ์คำขอและรักษาความปลอดภัยของทรัพยากรระบบคลาวด์ สำหรับ Cloud SQL ให้ทำตามแนวทางปฏิบัติแนะนำในการกำหนดค่า ออกแบบ และจัดการข้อมูลของคุณ
ระบบจัดการข้อมูลลับ เช่น Secret Manager จะจัดการพื้นที่เก็บข้อมูล การจัดการ และการเข้าถึงข้อมูลลับของแอปพลิเคชัน เช่น คีย์ API, ใบรับรอง และคีย์การเข้ารหัส บริการเหล่านี้สามารถเชื่อมต่อกับบริการแบ็กเอนด์อื่นๆ ผ่านเครื่องมือเชื่อมต่อ ซึ่งจะช่วยให้ระบบแบ็กเอนด์เข้าถึงข้อมูลลับของคุณได้อย่างปลอดภัย
หากคุณใช้ API, SDK หรือบริการอื่นๆ ในแบ็กเอนด์ด้วย ให้ค้นคว้าและปฏิบัติตามแนวทางปฏิบัติแนะนำของ API นั้นๆ ด้วย เช่น หากคุณใช้บริการ Google Maps Platform ให้ทำตามแนวทางปฏิบัติแนะนำในการจัดการคีย์ API และการปกป้องแอปพลิเคชัน
การติดตามและแจ้งเตือน รวมถึงการเข้าถึง
การบันทึกและการตรวจสอบก็เป็นสิ่งสำคัญที่ควรพิจารณาเช่นกัน
แนวทางปฏิบัติแนะนำด้านความปลอดภัยของ Google Cloud แสดงพิมพ์เขียวและภาพรวมโดยทั่วไปแทนสถาปัตยกรรมที่ปลอดภัยและการออกแบบแอป ศูนย์บัญชาการการรักษาความปลอดภัยมีชุดเครื่องมือสำหรับการรักษาความปลอดภัยและการจัดการความเสี่ยงบน Google Cloud รวมถึงเครื่องมืออัตโนมัติที่จะระบุการกำหนดค่าที่ไม่ถูกต้อง ช่องโหว่ และความเสี่ยงอื่นๆ
แนวทางปฏิบัติแนะนำในการพัฒนา
ทำตามแนวทางปฏิบัติแนะนำสำหรับเฟรมเวิร์กและภาษาที่คุณใช้ในการติดตั้งใช้งานแบ็กเอนด์ เว็บเฟรมเวิร์กยอดนิยมส่วนใหญ่จะมีคำแนะนำและแนวทางปฏิบัติ
ที่ดีที่สุดที่ควรปฏิบัติตาม
ลองใช้เครื่องมือวิเคราะห์อัตโนมัติเป็นส่วนหนึ่งของการพัฒนา หรือสร้างไปป์ไลน์เพื่อช่วยระบุปัญหาที่อาจเกิดขึ้น
คู่มือการทดสอบความปลอดภัยของเว็บ OWASP ระบุกรอบการทดสอบที่กำหนดเป้าหมายไปยังเว็บแอปพลิเคชันโดยเฉพาะ
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-07-25 UTC
[null,null,["อัปเดตล่าสุด 2025-07-25 UTC"],[[["\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."]]