No description
Find a file
Xe Iaso 865d513e35
feat(checker): add CEL for matching complicated expressions (#421)
* feat(lib/policy): add support for CEL checkers

This adds the ability for administrators to use Common Expression
Language[0] (CEL) for more advanced check logic than Anubis previously
offered.

These can be as simple as:

```yaml
- name: allow-api-routes
  action: ALLOW
  expression:
    and:
    - '!(method == "HEAD" || method == "GET")'
    - path.startsWith("/api/")
```

or get as complicated as:

```yaml
- name: allow-git-clients
  action: ALLOW
  expression:
    and:
    - userAgent.startsWith("git/") || userAgent.contains("libgit") || userAgent.startsWith("go-git") || userAgent.startsWith("JGit/") || userAgent.startsWith("JGit-")
    - >
      "Git-Protocol" in headers && headers["Git-Protocol"] == "version=2"
```

Internally these are compiled and evaluated with cel-go[1]. This also
leaves room for extensibility should that be desired in the future. This
will intersect with #338 and eventually intersect with TLS fingerprints
as in #337.

[0]: https://cel.dev/
[1]: https://github.com/google/cel-go

Signed-off-by: Xe Iaso <me@xeiaso.net>

* feat(data/apps): add API route allow rule for non-HEAD/GET

Signed-off-by: Xe Iaso <me@xeiaso.net>

* docs: document expression syntax

Signed-off-by: Xe Iaso <me@xeiaso.net>

* fix: fixes in review

Signed-off-by: Xe Iaso <me@xeiaso.net>

---------

Signed-off-by: Xe Iaso <me@xeiaso.net>
2025-05-03 14:26:54 -04:00
.github fix(yeetfile): copy all docs, data files, and botPolicies.yaml (#419) 2025-05-02 08:43:19 -04:00
.vscode feat(checker): add CEL for matching complicated expressions (#421) 2025-05-03 14:26:54 -04:00
cmd fix(cmd/anubis): print "Rule error IDs" in JSON (#408) 2025-05-02 18:05:41 +00:00
data feat(checker): add CEL for matching complicated expressions (#421) 2025-05-03 14:26:54 -04:00
decaymap Add periodic cleanup job for DecayMap (#8) (#158) 2025-03-29 23:24:06 -04:00
docs feat(checker): add CEL for matching complicated expressions (#421) 2025-05-03 14:26:54 -04:00
internal feat(og): Foward host header (#370) 2025-04-29 08:20:04 -04:00
lib feat(checker): add CEL for matching complicated expressions (#421) 2025-05-03 14:26:54 -04:00
run Create Anubis FreeBSD rc.d script (#274) 2025-04-15 12:05:13 +00:00
test docs: add caddy docs (#423) 2025-05-02 19:15:05 +00:00
var initial import from /x/ monorepo 2025-03-17 19:33:07 -04:00
web fix(web): Avoid timestamping main.mjs.gz (#412) 2025-05-01 19:52:50 +00:00
xess deduplicate css rules by using media query to set variables (#420) 2025-05-02 14:17:27 -04:00
.air.toml feat: Add Open Graph tag support (#195) 2025-04-06 20:02:12 -04:00
.gitattributes Debug tool for benchmarking proof-of-work algorithms (#155) 2025-03-29 23:38:12 -04:00
.gitignore docs: fix edit me links and configuration subcategory (#238) 2025-04-07 17:28:29 -04:00
.ko.yaml Try using ko to build images 2025-03-19 09:10:29 -04:00
anubis.go feat: make authorization cookie default expiration time customizable (#389) 2025-05-01 10:05:33 +00:00
Brewfile all: do not commit generated JS/CSS to source control (#148) 2025-03-28 14:55:25 -04:00
go.mod feat(checker): add CEL for matching complicated expressions (#421) 2025-05-03 14:26:54 -04:00
go.sum feat(checker): add CEL for matching complicated expressions (#421) 2025-05-03 14:26:54 -04:00
LICENSE initial import from /x/ monorepo 2025-03-17 19:33:07 -04:00
Makefile dev: Improvements to build scripts (#232) 2025-04-11 22:00:48 -04:00
package-lock.json build(deps-dev): bump esbuild from 0.25.2 to 0.25.3 in the npm group (#388) 2025-04-27 22:01:37 -04:00
package.json Version 1.17.1: Asahi sas Brutus: Echo 1 2025-05-01 13:24:37 -04:00
README.md README: Fix broken link to policy definition docs. (#380) 2025-04-27 13:33:41 +00:00
VERSION Version 1.17.1: Asahi sas Brutus: Echo 1 2025-05-01 13:24:37 -04:00
yeetfile.js feat(checker): add CEL for matching complicated expressions (#421) 2025-05-03 14:26:54 -04:00

Anubis

A smiling chibi dark-skinned anthro jackal with brown hair and tall ears looking victorious with a thumbs-up

enbyware GitHub Issues or Pull Requests by label GitHub go.mod Go version language count repo size

Sponsors

Anubis is brought to you by sponsors and donors like:

Distrust

Overview

Anubis weighs the soul of your connection using a proof-of-work challenge in order to protect upstream resources from scraper bots.

This program is designed to help protect the small internet from the endless storm of requests that flood in from AI companies. Anubis is as lightweight as possible to ensure that everyone can afford to protect the communities closest to them.

Anubis is a bit of a nuclear response. This will result in your website being blocked from smaller scrapers and may inhibit "good bots" like the Internet Archive. You can configure bot policy definitions to explicitly allowlist them and we are working on a curated set of "known good" bots to allow for a compromise between discoverability and uptime.

In most cases, you should not need this and can probably get by using Cloudflare to protect a given origin. However, for circumstances where you can't or won't use Cloudflare, Anubis is there for you.

If you want to try this out, connect to anubis.techaro.lol.

Support

If you run into any issues running Anubis, please open an issue. Please include all the information I would need to diagnose your issue.

For live chat, please join the Patreon and ask in the Patron discord in the channel #anubis.

Star History

Star History Chart

Packaging Status

Packaging status

Contributors

Made with contrib.rocks.