arcjet / arcjet-js

Arcjet JS SDKs. Rate limiting, bot protection, email verification & attack defense for Node.js, Next.js, Bun & SvelteKit.
https://arcjet.com
Apache License 2.0
173 stars 3 forks source link

Added example Next.js app with Permit.io for dynamic Arcjet rules #1067

Open bendechrai opened 6 days ago

bendechrai commented 6 days ago

Here's the code to go with the blog post. README still needs a "how it works" section which I'll fill out when I get to the airport.

trunk-io[bot] commented 6 days ago

Merging to main in this repository is managed by Trunk.

socket-security[bot] commented 6 days ago

🚨 Potential security issues detected. Learn more about Socket for GitHub ↗︎

To accept the risk, merge this PR and you will not be notified again.

Alert Package NoteSourceCI
Unstable ownership npm/permitio@2.5.1 🚫

Ignoring: npm/axios@0.27.2, npm/follow-redirects@1.15.6, npm/micromatch@4.0.7, npm/real-require@0.2.0, npm/require-in-the-middle@5.2.0, npm/string.prototype.includes@2.0.0

View full report↗︎

Next steps

What is unstable ownership?

A new collaborator has begun publishing package versions. Package stability and security risk may be elevated.

Try to reduce the amount of authors you depend on to reduce the risk to malicious actors gaining access to your supply chain. Packages should remove inactive collaborators with publishing rights from packages on npm.

Take a deeper look at the dependency

Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support [AT] socket [DOT] dev.

Remove the package

If you happen to install a dependency that Socket reports as Known Malware you should immediately remove it and select a different dependency. For other alert types, you may may wish to investigate alternative packages or consider if there are other ways to mitigate the specific risk posed by the dependency.

Mark a package as acceptable risk

To ignore an alert, reply with a comment starting with @SocketSecurity ignore followed by a space separated list of ecosystem/package-name@version specifiers. e.g. @SocketSecurity ignore npm/foo@1.0.0 or ignore all packages with @SocketSecurity ignore-all

  • @SocketSecurity ignore npm/permitio@2.5.1
socket-security[bot] commented 5 days ago

New dependencies detected. Learn more about Socket for GitHub ↗︎

Package New capabilities Transitives Size Publisher
npm/@types/node@20.14.9 None 0 2.09 MB types
npm/eslint-config-next@14.2.3 unsafe Transitive: environment, filesystem, shell +24 8.17 MB vercel-release-bot
npm/next@14.2.3 environment, filesystem, network, shell, unsafe +11 1.2 GB vercel-release-bot
npm/permitio@2.5.1 environment Transitive: eval, filesystem, network, unsafe +39 31.1 MB elimoshkovich

View full report↗︎

bendechrai commented 5 days ago

@blaine-arcjet - hopefully that's all good. I note that Socket Security is unhappy about a few more things, and I'm assuming they're all Permit dependencies. I've asked Gabriel about the unstable ownership aspect, but as this is example code, are we good to go?

blaine-arcjet commented 5 days ago

@bendechrai I'm less concerned about permit's unstable ownership and more concerned by the 232 dependencies they have: https://socket.dev/npm/package/permitio/dependencies/2.5.1

I'm reviewing the other Socket warnings now.

blaine-arcjet commented 5 days ago

@SocketSecurity ignore npm/axios@0.27.2 @SocketSecurity ignore npm/require-in-the-middle@5.2.0 @SocketSecurity ignore npm/real-require@0.2.0 @SocketSecurity ignore npm/string.prototype.includes@2.0.0 @SocketSecurity ignore npm/follow-redirects@1.15.6 @SocketSecurity ignore npm/micromatch@4.0.7

blaine-arcjet commented 5 days ago

There's something else weird going on with permit. In the v2.5.1 tag, the package.json version is 2.4.0 so I'm pretty sure this can't be the same code that is published

blaine-arcjet commented 5 days ago

@bendechrai this will also need to be added to the CI and dependabot files before we can merge