Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat!: Rework bot detection rule with allow/deny configuration #1437

Merged
merged 19 commits into from
Sep 4, 2024

Conversation

blaine-arcjet
Copy link
Contributor

@blaine-arcjet blaine-arcjet commented Aug 28, 2024

This reworks the bot detection rule to be configured like the sensitive info rule, which is to say you can either allow or deny list of bots. I've also reworked the bot detection to look for almost 600 well-known bots.

Closes #39 - we've changed the configuration format and have validation on allow and deny.

Copy link

trunk-io bot commented Aug 28, 2024

😎 Merged successfully - details.

@blaine-arcjet blaine-arcjet marked this pull request as ready for review August 30, 2024 20:43
@blaine-arcjet blaine-arcjet requested a review from a team as a code owner August 30, 2024 20:43
arcjet/index.ts Outdated Show resolved Hide resolved
@blaine-arcjet blaine-arcjet requested review from davidmytton, e-moran and a team September 3, 2024 18:57
@blaine-arcjet
Copy link
Contributor Author

Should be ready to test. I've added an example explicitly for bots.

Copy link
Contributor

@davidmytton davidmytton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 🤖 🙅‍♂️

Copy link
Contributor

@e-moran e-moran left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! This is going to be a huge improvement from the current bot detection, just pointing out two small things that I noticed while looking through it.

arcjet/index.ts Show resolved Hide resolved
examples/express-bots/index.js Show resolved Hide resolved
@trunk-io trunk-io bot merged commit eef18e3 into main Sep 4, 2024
22 checks passed
@trunk-io trunk-io bot deleted the phated/bots-redux branch September 4, 2024 18:09
trunk-io bot pushed a commit that referenced this pull request Sep 5, 2024
Automatically generated with [Release Please](https://github.com/googleapis/release-please).
---


<details><summary>@arcjet/analyze: 1.0.0-alpha.24</summary>

## [1.0.0-alpha.24](https://github.com/arcjet/arcjet-js/compare/v1.0.0-alpha.23...@arcjet/analyze-v1.0.0-alpha.24) (2024-09-05)


### ⚠ BREAKING CHANGES

* Rework bot detection rule with allow/deny configuration ([#1437](#1437))

### 🚀 New Features

* Rework bot detection rule with allow/deny configuration ([#1437](#1437)) ([eef18e3](eef18e3))


### Dependencies

* The following workspace dependencies were updated
  * dependencies
    * @arcjet/protocol bumped from 1.0.0-alpha.23 to 1.0.0-alpha.24
  * devDependencies
    * @arcjet/eslint-config bumped from 1.0.0-alpha.23 to 1.0.0-alpha.24
    * @arcjet/rollup-config bumped from 1.0.0-alpha.23 to 1.0.0-alpha.24
    * @arcjet/tsconfig bumped from 1.0.0-alpha.23 to 1.0.0-alpha.24
</details>

<details><summary>@arcjet/body: 1.0.0-alpha.24</summary>

## [1.0.0-alpha.24](https://github.com/arcjet/arcjet-js/compare/v1.0.0-alpha.23...@arcjet/body-v1.0.0-alpha.24) (2024-09-05)


### 🧹 Miscellaneous Chores

* **@arcjet/body:** Synchronize arcjet-js versions


### Dependencies

* The following workspace dependencies were updated
  * devDependencies
    * @arcjet/eslint-config bumped from 1.0.0-alpha.23 to 1.0.0-alpha.24
    * @arcjet/rollup-config bumped from 1.0.0-alpha.23 to 1.0.0-alpha.24
    * @arcjet/tsconfig bumped from 1.0.0-alpha.23 to 1.0.0-alpha.24
</details>

<details><summary>@arcjet/bun: 1.0.0-alpha.24</summary>

## [1.0.0-alpha.24](https://github.com/arcjet/arcjet-js/compare/v1.0.0-alpha.23...@arcjet/bun-v1.0.0-alpha.24) (2024-09-05)


### 🧹 Miscellaneous Chores

* **@arcjet/bun:** Synchronize arcjet-js versions


### Dependencies

* The following workspace dependencies were updated
  * dependencies
    * @arcjet/env bumped from 1.0.0-alpha.23 to 1.0.0-alpha.24
    * @arcjet/headers bumped from 1.0.0-alpha.23 to 1.0.0-alpha.24
    * @arcjet/ip bumped from 1.0.0-alpha.23 to 1.0.0-alpha.24
    * @arcjet/logger bumped from 1.0.0-alpha.23 to 1.0.0-alpha.24
    * @arcjet/protocol bumped from 1.0.0-alpha.23 to 1.0.0-alpha.24
    * @arcjet/transport bumped from 1.0.0-alpha.23 to 1.0.0-alpha.24
    * arcjet bumped from 1.0.0-alpha.23 to 1.0.0-alpha.24
  * devDependencies
    * @arcjet/eslint-config bumped from 1.0.0-alpha.23 to 1.0.0-alpha.24
    * @arcjet/rollup-config bumped from 1.0.0-alpha.23 to 1.0.0-alpha.24
    * @arcjet/tsconfig bumped from 1.0.0-alpha.23 to 1.0.0-alpha.24
</details>

<details><summary>@arcjet/decorate: 1.0.0-alpha.24</summary>

## [1.0.0-alpha.24](https://github.com/arcjet/arcjet-js/compare/v1.0.0-alpha.23...@arcjet/decorate-v1.0.0-alpha.24) (2024-09-05)


### 🧹 Miscellaneous Chores

* **@arcjet/decorate:** Synchronize arcjet-js versions


### Dependencies

* The following workspace dependencies were updated
  * dependencies
    * @arcjet/protocol bumped from 1.0.0-alpha.23 to 1.0.0-alpha.24
    * @arcjet/sprintf bumped from 1.0.0-alpha.23 to 1.0.0-alpha.24
  * devDependencies
    * @arcjet/eslint-config bumped from 1.0.0-alpha.23 to 1.0.0-alpha.24
    * @arcjet/rollup-config bumped from 1.0.0-alpha.23 to 1.0.0-alpha.24
    * @arcjet/tsconfig bumped from 1.0.0-alpha.23 to 1.0.0-alpha.24
</details>

<details><summary>@arcjet/duration: 1.0.0-alpha.24</summary>

## [1.0.0-alpha.24](https://github.com/arcjet/arcjet-js/compare/v1.0.0-alpha.23...@arcjet/duration-v1.0.0-alpha.24) (2024-09-05)


### 🧹 Miscellaneous Chores

* **@arcjet/duration:** Synchronize arcjet-js versions


### Dependencies

* The following workspace dependencies were updated
  * devDependencies
    * @arcjet/eslint-config bumped from 1.0.0-alpha.23 to 1.0.0-alpha.24
    * @arcjet/rollup-config bumped from 1.0.0-alpha.23 to 1.0.0-alpha.24
    * @arcjet/tsconfig bumped from 1.0.0-alpha.23 to 1.0.0-alpha.24
</details>

<details><summary>@arcjet/env: 1.0.0-alpha.24</summary>

## [1.0.0-alpha.24](https://github.com/arcjet/arcjet-js/compare/v1.0.0-alpha.23...@arcjet/env-v1.0.0-alpha.24) (2024-09-05)


### 🧹 Miscellaneous Chores

* **@arcjet/env:** Synchronize arcjet-js versions


### Dependencies

* The following workspace dependencies were updated
  * devDependencies
    * @arcjet/eslint-config bumped from 1.0.0-alpha.23 to 1.0.0-alpha.24
    * @arcjet/rollup-config bumped from 1.0.0-alpha.23 to 1.0.0-alpha.24
    * @arcjet/tsconfig bumped from 1.0.0-alpha.23 to 1.0.0-alpha.24
</details>

<details><summary>@arcjet/eslint-config: 1.0.0-alpha.24</summary>

## [1.0.0-alpha.24](https://github.com/arcjet/arcjet-js/compare/v1.0.0-alpha.23...@arcjet/eslint-config-v1.0.0-alpha.24) (2024-09-05)


### 🧹 Miscellaneous Chores

* **@arcjet/eslint-config:** Synchronize arcjet-js versions
</details>

<details><summary>@arcjet/headers: 1.0.0-alpha.24</summary>

## [1.0.0-alpha.24](https://github.com/arcjet/arcjet-js/compare/v1.0.0-alpha.23...@arcjet/headers-v1.0.0-alpha.24) (2024-09-05)


### 🧹 Miscellaneous Chores

* **@arcjet/headers:** Synchronize arcjet-js versions


### Dependencies

* The following workspace dependencies were updated
  * devDependencies
    * @arcjet/eslint-config bumped from 1.0.0-alpha.23 to 1.0.0-alpha.24
    * @arcjet/rollup-config bumped from 1.0.0-alpha.23 to 1.0.0-alpha.24
    * @arcjet/tsconfig bumped from 1.0.0-alpha.23 to 1.0.0-alpha.24
</details>

<details><summary>@arcjet/ip: 1.0.0-alpha.24</summary>

## [1.0.0-alpha.24](https://github.com/arcjet/arcjet-js/compare/v1.0.0-alpha.23...@arcjet/ip-v1.0.0-alpha.24) (2024-09-05)


### 🧹 Miscellaneous Chores

* **@arcjet/ip:** Synchronize arcjet-js versions


### Dependencies

* The following workspace dependencies were updated
  * devDependencies
    * @arcjet/eslint-config bumped from 1.0.0-alpha.23 to 1.0.0-alpha.24
    * @arcjet/rollup-config bumped from 1.0.0-alpha.23 to 1.0.0-alpha.24
    * @arcjet/tsconfig bumped from 1.0.0-alpha.23 to 1.0.0-alpha.24
</details>

<details><summary>@arcjet/logger: 1.0.0-alpha.24</summary>

## [1.0.0-alpha.24](https://github.com/arcjet/arcjet-js/compare/v1.0.0-alpha.23...@arcjet/logger-v1.0.0-alpha.24) (2024-09-05)


### 🧹 Miscellaneous Chores

* **@arcjet/logger:** Synchronize arcjet-js versions


### Dependencies

* The following workspace dependencies were updated
  * dependencies
    * @arcjet/sprintf bumped from 1.0.0-alpha.23 to 1.0.0-alpha.24
  * devDependencies
    * @arcjet/eslint-config bumped from 1.0.0-alpha.23 to 1.0.0-alpha.24
    * @arcjet/rollup-config bumped from 1.0.0-alpha.23 to 1.0.0-alpha.24
    * @arcjet/tsconfig bumped from 1.0.0-alpha.23 to 1.0.0-alpha.24
</details>

<details><summary>@arcjet/next: 1.0.0-alpha.24</summary>

## [1.0.0-alpha.24](https://github.com/arcjet/arcjet-js/compare/v1.0.0-alpha.23...@arcjet/next-v1.0.0-alpha.24) (2024-09-05)


### 🧹 Miscellaneous Chores

* **@arcjet/next:** Synchronize arcjet-js versions


### Dependencies

* The following workspace dependencies were updated
  * dependencies
    * @arcjet/env bumped from 1.0.0-alpha.23 to 1.0.0-alpha.24
    * @arcjet/headers bumped from 1.0.0-alpha.23 to 1.0.0-alpha.24
    * @arcjet/ip bumped from 1.0.0-alpha.23 to 1.0.0-alpha.24
    * @arcjet/logger bumped from 1.0.0-alpha.23 to 1.0.0-alpha.24
    * @arcjet/protocol bumped from 1.0.0-alpha.23 to 1.0.0-alpha.24
    * @arcjet/transport bumped from 1.0.0-alpha.23 to 1.0.0-alpha.24
    * arcjet bumped from 1.0.0-alpha.23 to 1.0.0-alpha.24
  * devDependencies
    * @arcjet/eslint-config bumped from 1.0.0-alpha.23 to 1.0.0-alpha.24
    * @arcjet/rollup-config bumped from 1.0.0-alpha.23 to 1.0.0-alpha.24
    * @arcjet/tsconfig bumped from 1.0.0-alpha.23 to 1.0.0-alpha.24
</details>

<details><summary>@arcjet/node: 1.0.0-alpha.24</summary>

## [1.0.0-alpha.24](https://github.com/arcjet/arcjet-js/compare/v1.0.0-alpha.23...@arcjet/node-v1.0.0-alpha.24) (2024-09-05)


### 🧹 Miscellaneous Chores

* **@arcjet/node:** Synchronize arcjet-js versions


### Dependencies

* The following workspace dependencies were updated
  * dependencies
    * @arcjet/env bumped from 1.0.0-alpha.23 to 1.0.0-alpha.24
    * @arcjet/headers bumped from 1.0.0-alpha.23 to 1.0.0-alpha.24
    * @arcjet/ip bumped from 1.0.0-alpha.23 to 1.0.0-alpha.24
    * @arcjet/logger bumped from 1.0.0-alpha.23 to 1.0.0-alpha.24
    * @arcjet/protocol bumped from 1.0.0-alpha.23 to 1.0.0-alpha.24
    * @arcjet/transport bumped from 1.0.0-alpha.23 to 1.0.0-alpha.24
    * @arcjet/body bumped from 1.0.0-alpha.23 to 1.0.0-alpha.24
    * arcjet bumped from 1.0.0-alpha.23 to 1.0.0-alpha.24
  * devDependencies
    * @arcjet/eslint-config bumped from 1.0.0-alpha.23 to 1.0.0-alpha.24
    * @arcjet/rollup-config bumped from 1.0.0-alpha.23 to 1.0.0-alpha.24
    * @arcjet/tsconfig bumped from 1.0.0-alpha.23 to 1.0.0-alpha.24
</details>

<details><summary>@arcjet/protocol: 1.0.0-alpha.24</summary>

## [1.0.0-alpha.24](https://github.com/arcjet/arcjet-js/compare/v1.0.0-alpha.23...@arcjet/protocol-v1.0.0-alpha.24) (2024-09-05)


### ⚠ BREAKING CHANGES

* Rework bot detection rule with allow/deny configuration ([#1437](#1437))

### 🚀 New Features

* Rework bot detection rule with allow/deny configuration ([#1437](#1437)) ([eef18e3](eef18e3))


### Dependencies

* The following workspace dependencies were updated
  * devDependencies
    * @arcjet/eslint-config bumped from 1.0.0-alpha.23 to 1.0.0-alpha.24
    * @arcjet/rollup-config bumped from 1.0.0-alpha.23 to 1.0.0-alpha.24
    * @arcjet/tsconfig bumped from 1.0.0-alpha.23 to 1.0.0-alpha.24
</details>

<details><summary>@arcjet/redact: 1.0.0-alpha.24</summary>

## [1.0.0-alpha.24](https://github.com/arcjet/arcjet-js/compare/v1.0.0-alpha.23...@arcjet/redact-v1.0.0-alpha.24) (2024-09-05)


### 🧹 Miscellaneous Chores

* **@arcjet/redact:** Synchronize arcjet-js versions


### Dependencies

* The following workspace dependencies were updated
  * dependencies
    * @arcjet/redact-wasm bumped from 1.0.0-alpha.23 to 1.0.0-alpha.24
  * devDependencies
    * @arcjet/eslint-config bumped from 1.0.0-alpha.23 to 1.0.0-alpha.24
    * @arcjet/rollup-config bumped from 1.0.0-alpha.23 to 1.0.0-alpha.24
    * @arcjet/tsconfig bumped from 1.0.0-alpha.23 to 1.0.0-alpha.24
</details>

<details><summary>@arcjet/redact-wasm: 1.0.0-alpha.24</summary>

## [1.0.0-alpha.24](https://github.com/arcjet/arcjet-js/compare/v1.0.0-alpha.23...@arcjet/redact-wasm-v1.0.0-alpha.24) (2024-09-05)


### 🧹 Miscellaneous Chores

* **@arcjet/redact-wasm:** Synchronize arcjet-js versions


### Dependencies

* The following workspace dependencies were updated
  * devDependencies
    * @arcjet/eslint-config bumped from 1.0.0-alpha.23 to 1.0.0-alpha.24
    * @arcjet/rollup-config bumped from 1.0.0-alpha.23 to 1.0.0-alpha.24
    * @arcjet/tsconfig bumped from 1.0.0-alpha.23 to 1.0.0-alpha.24
</details>

<details><summary>@arcjet/rollup-config: 1.0.0-alpha.24</summary>

## [1.0.0-alpha.24](https://github.com/arcjet/arcjet-js/compare/v1.0.0-alpha.23...@arcjet/rollup-config-v1.0.0-alpha.24) (2024-09-05)


### 🧹 Miscellaneous Chores

* **@arcjet/rollup-config:** Synchronize arcjet-js versions


### Dependencies

* The following workspace dependencies were updated
  * devDependencies
    * @arcjet/eslint-config bumped from 1.0.0-alpha.23 to 1.0.0-alpha.24
    * @arcjet/tsconfig bumped from 1.0.0-alpha.23 to 1.0.0-alpha.24
</details>

<details><summary>@arcjet/runtime: 1.0.0-alpha.24</summary>

## [1.0.0-alpha.24](https://github.com/arcjet/arcjet-js/compare/v1.0.0-alpha.23...@arcjet/runtime-v1.0.0-alpha.24) (2024-09-05)


### 🧹 Miscellaneous Chores

* **@arcjet/runtime:** Synchronize arcjet-js versions


### Dependencies

* The following workspace dependencies were updated
  * devDependencies
    * @arcjet/eslint-config bumped from 1.0.0-alpha.23 to 1.0.0-alpha.24
    * @arcjet/rollup-config bumped from 1.0.0-alpha.23 to 1.0.0-alpha.24
    * @arcjet/tsconfig bumped from 1.0.0-alpha.23 to 1.0.0-alpha.24
</details>

<details><summary>@arcjet/sprintf: 1.0.0-alpha.24</summary>

## [1.0.0-alpha.24](https://github.com/arcjet/arcjet-js/compare/v1.0.0-alpha.23...@arcjet/sprintf-v1.0.0-alpha.24) (2024-09-05)


### 🧹 Miscellaneous Chores

* **@arcjet/sprintf:** Synchronize arcjet-js versions


### Dependencies

* The following workspace dependencies were updated
  * devDependencies
    * @arcjet/eslint-config bumped from 1.0.0-alpha.23 to 1.0.0-alpha.24
    * @arcjet/rollup-config bumped from 1.0.0-alpha.23 to 1.0.0-alpha.24
    * @arcjet/tsconfig bumped from 1.0.0-alpha.23 to 1.0.0-alpha.24
</details>

<details><summary>@arcjet/sveltekit: 1.0.0-alpha.24</summary>

## [1.0.0-alpha.24](https://github.com/arcjet/arcjet-js/compare/v1.0.0-alpha.23...@arcjet/sveltekit-v1.0.0-alpha.24) (2024-09-05)


### 🧹 Miscellaneous Chores

* **@arcjet/sveltekit:** Synchronize arcjet-js versions


### Dependencies

* The following workspace dependencies were updated
  * dependencies
    * @arcjet/env bumped from 1.0.0-alpha.23 to 1.0.0-alpha.24
    * @arcjet/headers bumped from 1.0.0-alpha.23 to 1.0.0-alpha.24
    * @arcjet/ip bumped from 1.0.0-alpha.23 to 1.0.0-alpha.24
    * @arcjet/logger bumped from 1.0.0-alpha.23 to 1.0.0-alpha.24
    * @arcjet/protocol bumped from 1.0.0-alpha.23 to 1.0.0-alpha.24
    * @arcjet/transport bumped from 1.0.0-alpha.23 to 1.0.0-alpha.24
    * arcjet bumped from 1.0.0-alpha.23 to 1.0.0-alpha.24
  * devDependencies
    * @arcjet/eslint-config bumped from 1.0.0-alpha.23 to 1.0.0-alpha.24
    * @arcjet/rollup-config bumped from 1.0.0-alpha.23 to 1.0.0-alpha.24
    * @arcjet/tsconfig bumped from 1.0.0-alpha.23 to 1.0.0-alpha.24
</details>

<details><summary>@arcjet/transport: 1.0.0-alpha.24</summary>

## [1.0.0-alpha.24](https://github.com/arcjet/arcjet-js/compare/v1.0.0-alpha.23...@arcjet/transport-v1.0.0-alpha.24) (2024-09-05)


### 🧹 Miscellaneous Chores

* **@arcjet/transport:** Synchronize arcjet-js versions


### Dependencies

* The following workspace dependencies were updated
  * devDependencies
    * @arcjet/eslint-config bumped from 1.0.0-alpha.23 to 1.0.0-alpha.24
    * @arcjet/rollup-config bumped from 1.0.0-alpha.23 to 1.0.0-alpha.24
    * @arcjet/tsconfig bumped from 1.0.0-alpha.23 to 1.0.0-alpha.24
</details>

<details><summary>@arcjet/tsconfig: 1.0.0-alpha.24</summary>

## [1.0.0-alpha.24](https://github.com/arcjet/arcjet-js/compare/v1.0.0-alpha.23...@arcjet/tsconfig-v1.0.0-alpha.24) (2024-09-05)


### 🧹 Miscellaneous Chores

* **@arcjet/tsconfig:** Synchronize arcjet-js versions
</details>

<details><summary>arcjet: 1.0.0-alpha.24</summary>

## [1.0.0-alpha.24](v1.0.0-alpha.23...arcjet-v1.0.0-alpha.24) (2024-09-05)


### ⚠ BREAKING CHANGES

* Rework bot detection rule with allow/deny configuration ([#1437](#1437))

### 🚀 New Features

* Rework bot detection rule with allow/deny configuration ([#1437](#1437)) ([eef18e3](eef18e3))


### Dependencies

* The following workspace dependencies were updated
  * dependencies
    * @arcjet/analyze bumped from 1.0.0-alpha.23 to 1.0.0-alpha.24
    * @arcjet/duration bumped from 1.0.0-alpha.23 to 1.0.0-alpha.24
    * @arcjet/headers bumped from 1.0.0-alpha.23 to 1.0.0-alpha.24
    * @arcjet/protocol bumped from 1.0.0-alpha.23 to 1.0.0-alpha.24
    * @arcjet/runtime bumped from 1.0.0-alpha.23 to 1.0.0-alpha.24
  * devDependencies
    * @arcjet/eslint-config bumped from 1.0.0-alpha.23 to 1.0.0-alpha.24
    * @arcjet/rollup-config bumped from 1.0.0-alpha.23 to 1.0.0-alpha.24
    * @arcjet/tsconfig bumped from 1.0.0-alpha.23 to 1.0.0-alpha.24
</details>

<details><summary>1.0.0-alpha.24</summary>

## [1.0.0-alpha.24](v1.0.0-alpha.23...v1.0.0-alpha.24) (2024-09-05)


### ⚠ BREAKING CHANGES

* Rework bot detection rule with allow/deny configuration ([#1437](#1437))

### 🚀 New Features

* Rework bot detection rule with allow/deny configuration ([#1437](#1437)) ([eef18e3](eef18e3))


### 🧹 Miscellaneous Chores

* **examples:** Correct some usage mistakes in sensitive info examples ([#1503](#1503)) ([1286280](1286280))
</details>

---
This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
@e-moran e-moran mentioned this pull request Oct 3, 2024
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.

TS SDK: Additional validation on detectBot options
3 participants