Commit Graph
12 Commits
Author SHA1 Message Date
Xe IasoandGitHub bf5d66222c chore: set up commitlint, husky, and prettier (#1451)
* chore: add prettier configuration

Signed-off-by: Xe Iaso <[email protected]>

* format: run prettier tree-wide

Signed-off-by: Xe Iaso <[email protected]>

* chore(prettier): ignore intentionally ungrammatical files

Signed-off-by: Xe Iaso <[email protected]>

* ci: add PR title lint rule

Signed-off-by: Xe Iaso <[email protected]>

* ci: add DCO check

Signed-off-by: Xe Iaso <[email protected]>

* chore: add commitlint and husky

Signed-off-by: Xe Iaso <[email protected]>

* chore: add CONTRIBUTING guidelines

Signed-off-by: Xe Iaso <[email protected]>

* chore: set SKIP_INTEGRATION in precommit tests

Signed-off-by: Xe Iaso <[email protected]>

* chore: update spelling

Signed-off-by: Xe Iaso <[email protected]>

* ci(dco): remove reopened trigger

Signed-off-by: Xe Iaso <[email protected]>

* chore: remove dead file

Signed-off-by: Xe Iaso <[email protected]>

* chore(prettier): don't format nginx includes

Signed-off-by: Xe Iaso <[email protected]>

---------

Signed-off-by: Xe Iaso <[email protected]>
2026-02-15 08:19:12 -05:00
Timon de GrootandGitHub 57c0b2b22c Add IP mapped Perplexity user agents (#1393)
Perplexity has some proper documentation available for their crawlers,
with published IP addresses: https://docs.perplexity.ai/guides/bots.

Signed-off-by: Timon de Groot <[email protected]>
2026-01-15 19:57:31 -05:00
00fa939acf Implement FCrDNS and other DNS features (#1308)
* Implement FCrDNS and other DNS features

* Redesign DNS cache and methods

* Fix DNS cache

* Rename regexSafe arg

* Alter verifyFCrDNS(addr) behaviour

* Remove unused dnsCache field from Server struct

* Upd expressions docs

* Update docs/docs/CHANGELOG.md

Signed-off-by: Xe Iaso <[email protected]>

* refactor(dns): simplify FCrDNS logging

* docs: clarify verifyFCrDNS behavior

Add a note to the documentation for `verifyFCrDNS` to clarify that it returns true when no PTR records are found for the given IP address.

* fix(dns): Improve FCrDNS error handling and tests

The `VerifyFCrDNS` function previously ignored errors returned from reverse DNS lookups. This could lead to incorrect passes when a DNS failure (other than a simple 'not found') occurred. This change ensures that any error from a reverse lookup will cause the FCrDNS check to fail.

The test suite for FCrDNS has been updated to reflect this change. The mock DNS lookups now simulate both 'not found' errors and other generic DNS errors. The test cases have been updated to ensure that the function behaves correctly in both scenarios, resolving a situation where two test cases were effectively duplicates.

* docs: Update FCrDNS documentation and spelling

Corrected a typo in the `verifyFCrDNS` function documentation.

Additionally, updated the spelling exception list to include new terms and remove redundant entries.

* chore: update spelling

Signed-off-by: Xe Iaso <[email protected]>

---------

Signed-off-by: Xe Iaso <[email protected]>
Co-authored-by: Xe Iaso <[email protected]>
2025-11-26 22:24:45 -05:00
Josh DeprezandGitHub 316905bf1d Add Renovate to Docker clients (#1267)
Renovate-bot looks at the container APIs directly to learn about new image versions and digests. The [default User-Agent](https://docs.renovatebot.com/self-hosted-configuration/#useragent) is `Renovate/${renovateVersion} (https://github.com/renovatebot/renovate)`
2025-11-12 03:22:00 +00:00
Xe IasoandGitHub c7e4cd1032 fix(data/docker-client): allow some more OCI clients through (#1258)
* fix(data/docker-client): allow some more OCI clients through

Signed-off-by: Xe Iaso <[email protected]>

* Update metadata

check-spelling run (pull_request) for Xe/more-docker-client-programs

Signed-off-by: check-spelling-bot <[email protected]>
on-behalf-of: @check-spelling <[email protected]>

* fix(data/docker-client): add containerd

Signed-off-by: Xe Iaso <[email protected]>

---------

Signed-off-by: Xe Iaso <[email protected]>
Signed-off-by: check-spelling-bot <[email protected]>
2025-11-08 17:50:56 +00:00
Xe IasoandGitHub b5ead0a68c fix(data): add ruleset to explicitly allow Docker / OCI clients (#1253)
* fix(data): add ruleset to explicitly allow Docker / OCI clients

Fixes #1252

This is technically a regression as these clients used to work in Anubis
v1.22.0, however it is allowable to make this opt-in as most websites do not
expect to be serving Docker / OCI registry client traffic.

Signed-off-by: Xe Iaso <[email protected]>

* Update metadata

check-spelling run (pull_request) for Xe/gh-1252/docker-registry-client-fix

Signed-off-by: check-spelling-bot <[email protected]>
on-behalf-of: @check-spelling <[email protected]>

* test(docker-registry): export the right envvars

Signed-off-by: Xe Iaso <[email protected]>

* ci: add simdjson dependency for homebrew node

Signed-off-by: Xe Iaso <[email protected]>

* ci: install go/node without homebrew

Signed-off-by: Xe Iaso <[email protected]>

* test: use right github commit variable

Signed-off-by: Xe Iaso <[email protected]>

* ci: remove simdjson dependency

Signed-off-by: Xe Iaso <[email protected]>

* ci: install ko with an action

Signed-off-by: Xe Iaso <[email protected]>

* docs: add OCI registry caveat docs

Signed-off-by: Xe Iaso <[email protected]>

---------

Signed-off-by: Xe Iaso <[email protected]>
Signed-off-by: check-spelling-bot <[email protected]>
2025-11-08 00:17:25 +00:00
Xe IasoandGitHub 9c47c180d0 fix(default-config): make the default config far less paranoid (#1179)
* test: add httpdebug tool

Signed-off-by: Xe Iaso <[email protected]>

* fix(data/clients/git): more strictly match the git client

Signed-off-by: Xe Iaso <[email protected]>

* fix(default-config): make the default config far less paranoid

This uses a variety of heuristics to make sure that clients that claim
to be browsers are more likely to behave like browsers. Most of these
are based on the results of a lot of reverse engineering and data
collection from honeypot servers.

Signed-off-by: Xe Iaso <[email protected]>

* docs: update CHANGELOG

Signed-off-by: Xe Iaso <[email protected]>

---------

Signed-off-by: Xe Iaso <[email protected]>
Signed-off-by: Xe Iaso <[email protected]>
2025-10-11 08:48:12 -04:00
Xe IasoandGitHub c638653172 feat(lib): implement request weight (#621)
* feat(lib): implement request weight

Replaces #608

This is a big one and will be what makes Anubis a generic web
application firewall. This introduces the WEIGH option, allowing
administrators to have facets of request metadata add or remove
"weight", or the level of suspicion. This really makes Anubis weigh
the soul of requests.

Signed-off-by: Xe Iaso <[email protected]>

* fix(lib): maintain legacy challenge behavior

Signed-off-by: Xe Iaso <[email protected]>

* fix(lib): make weight have dedicated checkers for the hashes

Signed-off-by: Xe Iaso <[email protected]>

* feat(data): convert some rules over to weight points

Signed-off-by: Xe Iaso <[email protected]>

* docs: document request weight

Signed-off-by: Xe Iaso <[email protected]>

* fix(CHANGELOG): spelling error

Signed-off-by: Xe Iaso <[email protected]>

* chore: spelling

Signed-off-by: Xe Iaso <[email protected]>

* docs: fix links to challenge information

Signed-off-by: Xe Iaso <[email protected]>

* docs(policies): fix formatting

Signed-off-by: Xe Iaso <[email protected]>

* fix(config): make default weight adjustment 5

Signed-off-by: Xe Iaso <[email protected]>

---------

Signed-off-by: Xe Iaso <[email protected]>
2025-06-09 15:25:04 -04:00
de7dbfe6d6 Split up AI filtering files (#592)
* Split up AI filtering files

Create aggressive/moderate/permissive policies to allow administrators to choose their AI/LLM stance.

Aggressive policy matches existing default in Anubis.

Removes `Google-Extended` flag from `ai-robots-txt.yaml` as it doesn't exist in requests.

Rename `ai-robots-txt.yaml` to `ai-catchall.yaml` as the file is no longer a copy of the source repo/file.

* chore: spelling

* chore: fix embeds

* chore: fix data includes

* chore: fix file name typo

* chore: Ignore READMEs in configs

* chore(lib/policy/config): go tool goimports -w

Signed-off-by: Xe Iaso <[email protected]>

---------

Signed-off-by: Xe Iaso <[email protected]>
Co-authored-by: Xe Iaso <[email protected]>
2025-06-01 20:21:18 +00:00
Corry HainesandGitHub 0d9ebebff6 Opt-in policies for OpenAI and MistralAI bots (#590)
* Define OpenAI bot ALLOW policies

Allows OpenAI bots to be allowlisted at the choice of the Anubis administrator. None are enabled by default.

* Define MistralAI bot ALLOW policy

* chore: spelling
2025-05-31 16:48:57 -04:00
Xe IasoandGitHub cd8a7eb2e2 feat(data): add x-firefox-ai default challenge rule (#580)
Signed-off-by: Xe Iaso <[email protected]>
2025-05-28 21:08:39 +00:00
Xe IasoandGitHub 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 <[email protected]>

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

Signed-off-by: Xe Iaso <[email protected]>

* docs: document expression syntax

Signed-off-by: Xe Iaso <[email protected]>

* fix: fixes in review

Signed-off-by: Xe Iaso <[email protected]>

---------

Signed-off-by: Xe Iaso <[email protected]>
2025-05-03 14:26:54 -04:00