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'
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.