CanCanCan
CheatSheetSeries
Our great sponsors
CanCanCan | CheatSheetSeries | |
---|---|---|
19 | 49 | |
5,508 | 26,480 | |
0.6% | 1.9% | |
2.2 | 9.1 | |
17 days ago | 10 days ago | |
Ruby | Python | |
MIT License | Creative Commons Attribution Share Alike 4.0 |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
CanCanCan
-
A guide to Auth & Access Control in web apps 🔐
https://github.com/CanCanCommunity/cancancan (Ruby on Rails ABAC) Same like casl.js, but for Ruby on Rails! Casl.js was actually inspired and modeled by cancancan.
-
Authentication, Roles, and Authorization... oh my.
For authorization, I'm going back and forth with Pundit and CanCanCan
-
Feature flags in Rails: How to roll out and manage your features like a pro
This code mounts the Flipper UI at the /flipper endpoint in your application. The RoleConstraint class is used to restrict access to the UI to users who have the manage role. You can customize this constraint to suit your specific needs. In this case, we're using the CanCanCan gem to gate specific routes to admin users. If you haven't worked with CanCanCan before, ignore the RoleConstraint portion.
-
How would you store roles with up to 64 permissions?
Would you do : 1. a roles table with the name of the role and 64 booleans? 2. A roles table with one JSON field? (using rails json data type) 3. A roles table and a permissions table, similar do what is suggested in the cancancan developpers guide:
-
Protect your GraphQL data with resource_policy
Expressing authorization rules can be a bit challenging with the use of other authorization gems, such as pundit or cancancan. The resource_policy gem provides a more concise and expressive policy definition that uses a simple block-based syntax that makes it easy to understand and write authorization rules for each attribute.
- Top 5 Ruby on Rails Gems
-
Permissions (access control) in web apps
https://github.com/CanCanCommunity/cancancan (Ruby on Rails ABAC) Same like casl.js, but for Ruby on Rails! Casl.js was actually inspired and modeled by cancancan.
-
Web-app security risks demonstrated
In production code you would most likely use a library for access control, such as CanCanCan
-
YAGNI exceptions
PS If you do mobile / web work (or something else with "detached" UI), I find that declarative access control rules are far superior to imperative ones, because they can be serialized and shipped over the wire. For example, backend running cancancan can be easily send the same rules to casl on the frontend, while if you used something like pundit to secure your backend, you either end up re-implementing it in the frontend, or sending ton of "canEdit" flags with every record.
-
Best practice for displaying info to different user roles?
You can use a gem like cancancan (https://github.com/CanCanCommunity/cancancan )to manage authorization, and its helpers to show stuff based on what a user can do
CheatSheetSeries
-
Next.js: consequence of AppRouter on your CSP
Cross Site Scripting Prevention Cheat Sheet from OWASP Cheat Sheet Series
-
A guide to Auth & Access Control in web apps 🔐
OWasp cheat sheet on how to do ACL in Web App.
- Ask HN: Best Practices Guides You're Aware Of
-
Advice For Securing Backend Code
I recommend reading OWASP cheat sheets , especially these:
- What are some senior level learning resources you recommend for improving as a backend engineer?
-
OWASP Attacks spreadsheet?
If it's anywhere it's probably in here, https://cheatsheetseries.owasp.org/
- How do you all SECURE your Apps?
-
What is the easiest and most secure way to implement security in a NestJS application?
Im noob but i read somewhere that if u just follow this https://cheatsheetseries.owasp.org/ Your website is secured
-
OWASP Needs to Evolve
Fixed: https://github.com/OWASP/CheatSheetSeries/issues/1089#issuec...
-
When to implement a back end for a web application?
The most helpful "convention" for building a web application is the OWASP CheatSheet Series that focuses on security best practices.
What are some alternatives?
Pundit - Minimal authorization through OO design and pure Ruby classes
WhatWeb - Next generation web scanner
rolify - Role management library with resource scoping
dirsearch - Web path scanner
Action Policy - Authorization framework for Ruby/Rails applications
webpack - A bundler for javascript and friends. Packs many modules into a few bundled assets. Code Splitting allows for loading parts of the application on demand. Through "loaders", modules can be CommonJs, AMD, ES6 modules, CSS, Images, JSON, Coffeescript, LESS, ... and your custom stuff.
Authority
big-list-of-naughty-strings - The Big List of Naughty Strings is a list of strings which have a high probability of causing issues when used as user-input data.
Declarative Authorization - An unmaintained authorization plugin for Rails. Please fork to support current versions of Rails
docker-socket-proxy - Proxy over your Docker socket to restrict which requests it accepts
AccessGranted - Multi-role and whitelist based authorization gem for Rails (and not only Rails!)
django-mfa2 - A Django app that handles MFA, it supports TOTP, U2F, FIDO2 U2F (Webauthn), Email Token and Trusted Devices