feat(policy/expressions): add userAgent.isBrowserLike method

Signed-off-by: Xe Iaso <me@xeiaso.net>
This commit is contained in:
Xe Iaso
2025-04-28 16:15:05 -04:00
parent b43df36f7d
commit 3fb8fa2009
4 changed files with 39 additions and 12 deletions

View File

@@ -5,12 +5,4 @@
all:
- '"X-Http-Version" in headers'
- headers["X-Http-Version"] == "HTTP/1.1"
- >-
( userAgent.contains("Mozilla")
|| userAgent.contains("Opera")
|| userAgent.contains("Safari")
|| userAgent.contains("Edge")
|| userAgent.contains("Gecko")
|| userAgent.contains("Windows")
|| userAgent.contains("Linux")
)
- userAgent.isBrowserLike()

View File

@@ -1,5 +1,4 @@
# Generic catchall rule
- name: generic-browser
user_agent_regex: >-
Mozilla|Opera
expression: userAgent.isBrowserLike()
action: CHALLENGE