Skip to content

Conversation

@Xe
Copy link
Contributor

@Xe Xe commented Jun 3, 2025

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.

  • Split valkey into a separate PR
  • Documentation about weight
  • Example rules with weight

Checklist:

  • Added a description of the changes to the [Unreleased] section of docs/docs/CHANGELOG.md
  • Added test cases to the relevant parts of the codebase
  • Ran integration tests npm run test:integration (unsupported on Windows, please use WSL)

@Xe Xe self-assigned this Jun 3, 2025
ogCacheConsiderHost = flag.Bool("og-cache-consider-host", false, "enable or disable the use of the host in the Open Graph tag cache")
extractResources = flag.String("extract-resources", "", "if set, extract the static resources to the specified folder")
webmasterEmail = flag.String("webmaster-email", "", "if set, displays webmaster's email on the reject page for appeals")
valkeyURL = flag.String("valkey-url", "", "Valkey URL for Anubis' state layer")

Check failure

Code scanning / check-spelling

Unrecognized Spelling Error

valkey is not a recognized word. (unrecognized-spelling)
ogCacheConsiderHost = flag.Bool("og-cache-consider-host", false, "enable or disable the use of the host in the Open Graph tag cache")
extractResources = flag.String("extract-resources", "", "if set, extract the static resources to the specified folder")
webmasterEmail = flag.String("webmaster-email", "", "if set, displays webmaster's email on the reject page for appeals")
valkeyURL = flag.String("valkey-url", "", "Valkey URL for Anubis' state layer")

Check failure

Code scanning / check-spelling

Unrecognized Spelling Error

valkey is not a recognized word. (unrecognized-spelling)
ogCacheConsiderHost = flag.Bool("og-cache-consider-host", false, "enable or disable the use of the host in the Open Graph tag cache")
extractResources = flag.String("extract-resources", "", "if set, extract the static resources to the specified folder")
webmasterEmail = flag.String("webmaster-email", "", "if set, displays webmaster's email on the reject page for appeals")
valkeyURL = flag.String("valkey-url", "", "Valkey URL for Anubis' state layer")

Check failure

Code scanning / check-spelling

Unrecognized Spelling Error

Valkey is not a recognized word. (unrecognized-spelling)
@@ -0,0 +1,86 @@
package valkey

Check failure

Code scanning / check-spelling

Unrecognized Spelling Error

valkey is not a recognized word. (unrecognized-spelling)
@@ -0,0 +1,86 @@
package valkey

Check failure

Code scanning / check-spelling

Check File Path Error

valkey is not a recognized word. (check-file-path)
}
}

func (prc *PassRateChecker) Hash() string {

Check failure

Code scanning / check-spelling

Unrecognized Spelling Error

prc is not a recognized word. (unrecognized-spelling)
}

func (prc *PassRateChecker) Hash() string {
return internal.SHA256sum(fmt.Sprintf("pass rate checker::%s", prc.header))

Check failure

Code scanning / check-spelling

Unrecognized Spelling Error

prc is not a recognized word. (unrecognized-spelling)
return internal.SHA256sum(fmt.Sprintf("pass rate checker::%s", prc.header))
}

func (prc *PassRateChecker) Check(r *http.Request) (bool, error) {

Check failure

Code scanning / check-spelling

Unrecognized Spelling Error

prc is not a recognized word. (unrecognized-spelling)
}

func (prc *PassRateChecker) Check(r *http.Request) (bool, error) {
data, err := prc.store.MultiGetInt(r.Context(), [][]string{

Check failure

Code scanning / check-spelling

Unrecognized Spelling Error

prc is not a recognized word. (unrecognized-spelling)

func (prc *PassRateChecker) Check(r *http.Request) (bool, error) {
data, err := prc.store.MultiGetInt(r.Context(), [][]string{
{"pass_rate", prc.header, r.Header.Get(prc.header), "pass"},

Check failure

Code scanning / check-spelling

Unrecognized Spelling Error

prc is not a recognized word. (unrecognized-spelling)
Xe added a commit that referenced this pull request Jun 6, 2025
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]>
@Xe Xe mentioned this pull request Jun 6, 2025
5 tasks
@Xe
Copy link
Contributor Author

Xe commented Jun 6, 2025

Superceded by #621 and #622

@Xe Xe closed this Jun 6, 2025
Xe added a commit that referenced this pull request Jun 9, 2025
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]>
Xe added a commit that referenced this pull request Jun 9, 2025
* 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]>
JasonLovesDoggo pushed a commit to JasonLovesDoggo/anubis that referenced this pull request Jun 17, 2025
* feat(lib): implement request weight

Replaces TecharoHQ#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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant