From cd8a7eb2e20b8b13557bced3e392861ca1163c94 Mon Sep 17 00:00:00 2001 From: Xe Iaso Date: Wed, 28 May 2025 17:08:39 -0400 Subject: [PATCH] feat(data): add x-firefox-ai default challenge rule (#580) Signed-off-by: Xe Iaso --- data/botPolicies.yaml | 2 ++ data/clients/x-firefox-ai.yaml | 4 ++++ docs/docs/CHANGELOG.md | 1 + 3 files changed, 7 insertions(+) create mode 100644 data/clients/x-firefox-ai.yaml diff --git a/data/botPolicies.yaml b/data/botPolicies.yaml index 1736147..e054fbc 100644 --- a/data/botPolicies.yaml +++ b/data/botPolicies.yaml @@ -30,6 +30,8 @@ bots: # - Marginalia # - Mojeek - import: (data)/crawlers/_allow-good.yaml + # Challenge Firefox AI previews + - import: (data)/clients/x-firefox-ai.yaml # Allow common "keeping the internet working" routes (well-known, favicon, robots.txt) - import: (data)/common/keep-internet-working.yaml diff --git a/data/clients/x-firefox-ai.yaml b/data/clients/x-firefox-ai.yaml new file mode 100644 index 0000000..3a1e3b7 --- /dev/null +++ b/data/clients/x-firefox-ai.yaml @@ -0,0 +1,4 @@ +# https://connect.mozilla.org/t5/firefox-labs/try-out-link-previews-in-firefox-labs-138-and-share-your/td-p/92012 +- name: x-firefox-ai + action: CHALLENGE + expression: '"X-Firefox-Ai" in headers' diff --git a/docs/docs/CHANGELOG.md b/docs/docs/CHANGELOG.md index b33d876..1cf82ad 100644 --- a/docs/docs/CHANGELOG.md +++ b/docs/docs/CHANGELOG.md @@ -20,6 +20,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Add `--target-insecure-skip-verify` flag/envvar to allow Anubis to hit a self-signed HTTPS backend - Minor adjustments to FreeBSD rc.d script to allow for more flexible configuration. - Added Podman and Docker support for running Playwright tests +- Add a default rule to throw challenges when a request with the `X-Firefox-Ai` header is set. - Updated the nonce value in the challenge JWT cookie to be a string instead of a number - Rename cookies in response to user feedback - Ensure cookie renaming is consistent across configuration options