How to use this chapter
| # | Mode | What it shows |
|---|---|---|
| 1 | Request path | Eight hops from the shopper to the database and back to the VM. Step with "Next hop" |
| 2 | Return path | The answer travelling back, where stateful firewalls, caches and logs do their part |
| 3 | Break it | Seven real misconfigurations from earlier chapters: where the request fails, what the shopper sees, and the log line that gives it away |
The walk
hop 1 of 8 · Find www.kade.lk
What happens
www.kade.lk. Cloudflare is authoritative, and the record is orange, so the answer is a Cloudflare address, not Kadé's load balancer.Decided by
Packet
Recorded in
Who sees which address
The same request has four different "clients", depending on who is looking. Most "wrong IP in the logs" confusion comes from mixing these up:
| # | Who is looking | Sees the client as | Real shopper's IP is in | Chapter |
|---|---|---|---|---|
| 1 | Cloudflare | 203.0.113.99, the shopper | The connection itself | 13 |
| 2 | Google's front end, Cloud Armor | 104.23.211.40, a Cloudflare edge | CF-Connecting-IP | 13 |
| 3 | kade-media's VM (TCP) | 35.191.8.20, Google's front end | CF-Connecting-IP, or X-Forwarded-For counted from the right | 12.1 |
| 4 | Cloud SQL, Cloud Storage | 10.10.1.31, the VM | Nowhere: they serve the VM, not the shopper | 9 |
Every layer that protected this request
Nine separate controls touched this one photo request. Each one covers a gap the others leave:
| # | Control | Stops | Chapter |
|---|---|---|---|
| 1 | Cloudflare WAF and DDoS | Attacks and floods, before they reach Google | 13 |
| 2 | Full (strict) TLS on both legs | Anyone reading or changing traffic between Cloudflare and Google | 13 |
| 3 | Cloud Armor origin lock | Anyone going around Cloudflare to the load balancer | 13 |
| 4 | Cloud Armor WAF rules | Attacks that got past Cloudflare | 12.1 |
| 5 | No external IP on any VM | Anyone reaching kade-media without the load balancer | 3, 12.2 |
| 6 | Firewall by service account | Anything but Google's front ends reaching port 8080 | 5.1 |
| 7 | Cloud SQL: private IP, encrypted only | The database being reachable or readable from outside | 9 |
| 8 | Private Google Access, IAM on the bucket | The VM needing the internet, or any key file, to read photos | 9 |
| 9 | Org policies and folder firewall policy | Someone undoing items 5 to 7 with a console click | 17 |
Self-check
Six questions about this path. Each answer links back to the chapter that explains it:
1.Google's front end sees the client as 104.23.211.40. What is that address?
2.Every photo request fails with 502 and the LB log says failed_to_pick_backend. What do you check first?
3.Why does kade-media need no firewall rule to receive Cloud SQL's replies?
4.kade-media has no external IP. How does it read from Cloud Storage?
5.A visitor gets ERR_TOO_MANY_REDIRECTS. Which setting do you check?
6.Which log shows that the load balancer, not the app, produced an error?
0 of 0 right · 6 left