8000
Skip to content

feat(permissions): folder rbac - #7762

Merged
adilsitos merged 65 commits into
mainfrom
feat/adilsitos/eng-5532
Aug 28, 2026
Merged

feat(permissions): folder rbac#7762
adilsitos merged 65 commits into
mainfrom
feat/adilsitos/eng-5532

Conversation

@adilsitos
@adilsitos adilsitos commented Aug 21, 2026
Copy link
Copy Markdown
Contributor

Context

This introduces a new permission into the system, the RBAC for folders. More info on the design doc.

Screenshots

image image image

Steps to verify the change

There are several scenarios, so my recommendation is to create a folder with: secrets, dynamic secrets, rotations, imports and (if you want) honey tokens. Use an account which is project admin and another account that you can keep changing their permissions, so it is easier to validate how the permissions are being evaluated.

Scenario 1: The user has folder RBAC permission in two different folders

  • expected: the permissions from one folder don't modify the permissions of another folder

Scenario 2: Check the cache is working correctly

  • To do this it is recommended to enable the debug mode on knex, so you sure the cache is happening correctly (you can add DEBUG=knex:query on the .env)
  • expected: if the marker is still up (15 seconds) the cache should responde directly. If the marker is not valid, we need to just compute the fingerprint

Scenario 3: Delete folders with RBAC as a member user

  • Define your test user to have the role member
  • Define permissions to a folder to a specific user (it can be any user)
  • expected: the member user can remove the folder

Scenario 4: Move folders with RBAC as a member user

  • Define your test user to have the role member
  • Define permissions to a folder to a specific user (it can be any user)
  • expected: the member user can move the folder

Scenario 5: Project admins don't show on the rbac sheet

  • expected: when opening the RBAC sheet, make sure that project admins (identities or users) don't appear there.

Scenario 6: Check all the defined permissions defined

  • Keep changing the permission using the project admin to validate that the targeted user is getting the desired permissions (this is the most exhaustive one)

Scenario 7: define a temporary full access.

  • try to define a user with full access role using temporary permissions
  • expected: fail. A user with temporary full access can create definitive permissions for himself. This would be a vulnerability

Scenario 8: user has folder RBAC permission and become project admin

  • expected: the folder RBAC permissions are not evaluated, he can see everything that a project admin can

Type

  • Fix
  • Feature
  • Improvement
  • Breaking
  • Docs
  • Chore

Checklist

  • Title follows the conventional commit format: type(scope): short description (scope is optional, e.g., fix: prevent crash on sync or fix(api): handle null response).
  • Tested locally
  • Updated docs (if needed)
  • Updated CLAUDE.md files (if needed)
  • Read the contributing guide

@linear
linear Bot commented Aug 21, 2026
Copy link
Copy Markdown

ENG-5532

@infisical-review-police
Copy link
Copy Markdown

💬 Discussion in Slack: #pr-review-infisical-7762-feat-permissions-folder-rbac

Posted by Review Police — reviews, comments, new commits, and CI failures will stream into this channel.

@gitguardian
gitguardian Bot commented Aug 21, 2026
Copy link
Copy Markdown

⚠️ GitGuardian has uncovered 2 secrets following the scan of your pull request.

Please consider investigating the findings and remediating the incidents. Failure to do so may lead to compromising the associated services or software components.

🔎 Detected hardcoded secrets in your pull request
GitGuardian id GitGuardian status Secret Commit Filename
9387832 Triggered Generic Password e1776a6 backend/scripts/dev-folder-rbac.ts View secret
35864000 Triggered Generic High Entropy Secret 86b3337 backend/e2e-test/routes/v1/oauth-token-exchange.spec.ts View secret
🛠 Guidelines to remediate hardcoded secrets
  1. Understand the implications of revoking this secret by investigating where it is used in your code.
  2. Replace and store your secrets safely. Learn here the best practices.
  3. Revoke and rotate these secrets.
  4. If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.

To avoid such incidents in the future consider


🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.

@greptile-apps
greptile-apps Bot commented Aug 21, 2026
Copy link
Copy Markdown
Contributor

Greptile Summary

This PR introduces folder-level RBAC for Secret Manager, allowing permanent or temporary access tiers to replace an actor’s base permissions at an exact folder path.

  • Adds folder-scoped privilege persistence, migrations, permission-rule construction, fingerprint caching, and cache invalidation across folder and membership mutations.
  • Adds user and identity APIs for granting, updating, listing, and revoking folder access, including safeguards for project administrators and temporary full access.
  • Applies folder permissions across secrets, dynamic secrets, rotations, imports, reminders, approvals, and folder move/delete operations.
  • Adds management interfaces in the Secret Manager overview and project member/identity detail pages.
  • Adds extensive unit and end-to-end coverage for access tiers, cache behavior, groups, temporary access, folder operations, and legacy additional privileges.

Confidence Score: 5/5

The PR appears safe to merge because no blocking failure remains within the available follow-up review scope.

No blocking failure remains.

Important Files Changed

Filename Overview
backend/src/ee/services/permission/permission-service.ts Integrates folder-scoped grants into project permission construction and adds version-fingerprint caching for resolved folder privileges.
backend/src/ee/services/permission/permission-fns.ts Builds exact-path deny-and-allow replacement rules and computes normalized folder privilege fingerprints.
backend/src/ee/services/permission/folder-roles.ts Defines the folder access tiers and their explicit Secret Manager permission sets.
backend/src/services/folder-permission/folder-permission-service.ts Implements validated folder grant CRUD with administrator eligibility and temporary full-access protections.
backend/src/services/folder-permission/folder-permission-dal.ts Adds persistence and roster queries for user- and identity-scoped folder privileges.
backend/src/server/routes/v1/project-membership-router.ts Exposes folder-access management and roster endpoints for project users.
backend/src/server/routes/v1/identity-project-membership-router.ts Exposes equivalent folder-access management and roster endpoints for project identities.
backend/src/services/secret-folder/secret-folder-service.ts Connects folder lifecycle operations to folder-permission cache invalidation.
backend/src/db/migrations/20260817120000_folder-scoped-additional-privileges.ts Extends additional privileges with folder scope and role data needed by folder RBAC.
frontend/src/pages/secret-manager/OverviewPage/components/FolderAccessSheet/FolderAccessSheet.tsx Adds the Secret Manager folder-access roster and management workflow.
frontend/src/pages/project/components/FolderAccessSection/FolderAccessSection.tsx Adds folder-access visibility and editing to project member and identity details.
backend/e2e-test/routes/v2/secret-folder-rbac.spec.ts Exercises folder-tier authorization across Secret Manager resources and folder operations.

Reviews (2): Last reviewed commit: "fix lint" | Re-trigger Greptile

Comment thread backend/src/services/folder-permission/folder-permission-service.ts Outdated
Comment thread backend/src/services/secret-folder/secret-folder-service.ts Outdated
@veria-ai
veria-ai Bot commented Aug 21, 2026
Copy link
Copy Markdown
Contributor

PR overview

All previously flagged issues have been addressed. No open security concerns remain on this pull request.

Security review

No open security issues remain on this pull request.

Fixed/addressed: 9 · PR risk: 0/10

@github-actions
github-actions Bot commented Aug 21, 2026
Copy link
Copy Markdown
Contributor

API changes

The breaking changes reported earlier are resolved as of 5972855.

@akhilmhdh akhilmhdh left a comment
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

One small confusion in folder permission. Let's catch up on that.

Comment thread backend/src/ee/services/permission/permission-service.ts Outdated
Comment thread backend/src/server/routes/v1/identity-project-membership-router.ts Outdated
Comment thread backend/src/services/folder-permission/folder-permission-dal.ts Outdated
Comment thread backend/src/services/folder-permission/folder-permission-service.ts
Comment thread backend/src/services/folder-permission/folder-permission-service.ts
Comment thread backend/src/services/membership-group/membership-group-service.ts Outdated
Comment thread backend/src/ee/services/permission/permission-fns.ts Outdated
Comment thread backend/src/ee/services/permission/permission-fns.ts Outdated
@adilsitos
adilsitos merged commit 3ee155b into main Aug 28, 2026
20 checks passed
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.

3 participants

0