Service Extensions for Google Cloud App LB’s
Google Cloud Service Extensions add custom headers, security rules, logging and HTML rewrites to your Application Load Balancer using WebAssembly plugins.
If you run a website or app on Google Cloud and you’re using their Application Load Balancer to distribute traffic but wish you had a way to:
- Add or modify HTTP headers: Insert new headers for specific customers. Or re-write client headers on the way to the back end.
- Implement custom security rules: Add your own logic to block malicious requests or filter sensitive data.
- Perform custom logging: Log user-defined headers or other custom data into Cloud Logging or other tools.
- Rewrite HTML on the fly: Dynamically adjust your website content based on user location, device, etc
- Script Injection: Rewrite HTML for integration with Analytics or reCAPTCHA
Traditionally, you’d have to achieve this by setting up separate proxy servers or modifying your app. With Service Extensions, you can do all this directly within your Application Load Balancer.
How Service Extensions work:
- They are mini apps: Service Extensions are written in WebAssembly (Wasm), these are super fast, and secure.
- They run at the edge: This means they on the load balancer, reducing any potential impact to latency.
- They’re fully managed: Google Cloud takes care of all the hard parts.
Why would anyone use Service Extensions?
- Flexibility: Tailor your load balancer to your specific needs without complex workarounds.
- Performance: Improve response times by processing traffic at the edge.
- Security: Enhance your security posture with custom rules and logic.
- Efficiency: Reduce operational overhead by offloading tasks to the load balancer.
How to get started:
- Check the docs from Google, start with Service Extensions Overview then Plugins Overview and How to create a plugin finally some Code Samples
- Also definitely worth checking out WASM if you have not already at https://webassembly.org/
Service Extensions sit in the Cloud Load Balancing processing path.
Image to the left shows this.
Founder of Aviato Consulting and former Google Cloud Consulting Lead for APAC, specialising in enterprise cloud architecture, APRA CPS 234 and agentic AI.
Related Articles
Vendor Lock-in: We think its a myth.
Is vendor lock-in worth delaying cloud projects? Why open standards, data portability and hyperscaler competition cut the risk, and how to mitigate it.
The Aviato Cloud Consulting Blog
Welcome to the Aviato blog: insights, strategies and practical advice on cloud migration, optimisation and the cloud challenges facing your business.
Your gcloud login works. Your Python doesn’t. Here’s why.
Why gcloud auth login works in your terminal while Vertex AI fails in Python, and the four commands that fix Application Default Credentials (ADC).