Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Is there any way to block the non domain calls using cloud armor on external load balancer?

Is there any way to block the non-domain calls using cloud armor on an external load balancer?
I have tried request.headers['host'].lower() != "mycompany.com' but still there are calls coming 

I am looking for something like

request.URL.lower() != 'mycompany.com'

2 1 859
1 REPLY 1

Hi @anilmoregfs ,

The correct YAML should look like this :

- versionedExpr:
version: 1
expr:
- not:
expr:
- equals:
exprValues:
- destinationIp: "::/0"
ipPort: 80
ports:
- 80
protocol: TCP
matchers:
- stringMatch:
config:
expectMatch: false
expr: "mycompany.com"
negateMatch: true
regexMatch: false
textName: "request.headers['host'].lower()"

 Use the expr field to define custom expressions for matching requests.