Deploy Anti AI Scraper Measures #15
Labels
No labels
Goal: Ops
Goal: Platform
Goal: Scale
Goal: User
Size
L
Size
M
Size
S
Type: Action
Type: Auto
Type: Infra
Type: Sec
Type: Tool
Who
Internal
Who
Public
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
opencommit/roadmap#15
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
1. What
The implementation of a multi-layered defensive perimeter around OpenCommit to identify, challenge, and mitigate unauthorized automated data extraction by AI-related crawlers (e.g., GPTBot, CCBot, AnthropicAI). This includes deploying technical controls at the application level (via
robots.txt), the network/proxy level (via User-Agent filtering or rate limiting), and, if required, an identity challenge layer (such as Anubis) to verify human-driven traffic.2. Why
To protect the intellectual property and privacy of the repositories hosted on this instance by preventing uncompensated use of source code in Large Language Model (LLM) training sets. Additionally, this initiative aims to reduce infrastructure resource consumption and "noise" caused by high-frequency automated requests, ensuring higher availability and performance for legitimate human users and authorized integrations.
3. Boundaries
robots.txtdirectives. (Robots.txt Traefik plugin?)4. Definition of Done
Is this an idea? Wish we were able to test it, maybe just with a simple setup before we use it within opencommit?
Recommended layout
Put Anubis between your public Ingress and Forgejo’s HTTP service:
Do not expose the Forgejo Service directly through an Ingress once Anubis is enabled. Your public hostname,
opencommit.eu, should route to Anubis instead.Anubis is an HTTP reverse proxy that presents a JavaScript proof-of-work challenge to traffic matching its bot policies, then proxies accepted requests upstream. It does not protect SSH Git access, so
git@…/ port 22 needs its own access and rate-limit policy. The project describes it as deliberately broad protection that may also affect legitimate crawlers. See Anubis.1. Inspect the current Forgejo Service
First identify the exact namespace, service name, and port that currently reaches Forgejo:
You need the HTTP Forgejo service name and port—not the SSH port. In the manifests below, replace:
<forgejo-namespace>with your namespace<forgejo-http-service>with the existing Forgejo HTTP Service name<forgejo-http-port>with the existing Service port<anubis-version>with a reviewed, pinned Anubis release versionAvoid
latest; pin a release and upgrade deliberately.2. Deploy Anubis
Save the following as
anubis.yamlafter replacing the placeholders:Apply it:
3. Point
opencommit.euat AnubisCreate or modify the Ingress for
opencommit.euso that its backend isanubis, not Forgejo.This is a standard K3s/Traefik-compatible Ingress using a pre-existing TLS secret:
Apply it:
If your TLS is currently managed by Traefik/cert-manager annotations rather than an existing secret, retain those existing annotations and TLS settings; change only the backend Service from Forgejo to
anubis.4. Keep Forgejo aware it is behind proxies
Your effective proxy chain will be:
Confirm these details in your Forgejo deployment/configuration:
ROOT_URLremainshttps://opencommit.eu/.ClusterIP; it should not also be public through another Ingress, LoadBalancer, or NodePort.The client IP is important: if Anubis only sees Traefik/pod IPs, users can get inconsistent challenges or share challenge state incorrectly.
5. Test before making it your only route
Run these checks after applying:
Also test in a normal browser:
Important Forgejo caveats
/v2/. An Anubis issue reports this route being challenged in at least one version, which breaks normal OCI tooling because it expects JSON, not an HTML challenge page. Treat/v2/as a route requiring explicit validation or a bypass policy. See Forgejo / OCI registry regression.Suggested rollout
opencommit.euIngress backend toanubis.The core configuration is just
BIND,TARGET, andSERVE_ROBOTS_TXT; those variables are used in a known Forgejo + Anubis deployment example, where Anubis proxies to Forgejo and the external reverse proxy forwards the real client IP. See this Forgejo integration example.This is definitely an idea. I had Anubis in my head. We could probably develop and test this setup on a local kind cluster?
I was also looking at: https://codeberg.org/gone/go-away
Not sure what Codeberg is using nowadays. I think they moved away from Anubis because it was deemed too inflexible. Maybe we should check their infra repo.