Conversation
…et syncs and secret rotations - Backend: add connectionId to SecretSync/SecretRotation subject types and condition schemas - Backend: pass connectionId in all secret-sync and secret-rotation-v2 permission checks - Frontend: add Connection ID condition option for Secret Syncs and Secret Rotation in role permissions - Docs: document connectionId condition for secret-syncs and secret-rotation in project-permissions.mdx - Add unit tests for schema validation and CASL can() with connectionId condition Co-authored-by: Cursor <cursoragent@cursor.com>
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
Greptile OverviewGreptile SummaryThis PR adds Key Changes:
Critical Issue Found:
Positive Notes:
Confidence Score: 2/5
Important Files Changed
|
Additional Comments (2)
Example attack: A user with zero |
|
@greptile review again plz! |
Additional Comments (1)
The permission checks use the OLD Attack scenario:
Fix required: if (params.connectionId && params.connectionId !== connectionId) {
// Check permission against NEW connectionId
ForbiddenError.from(permission).throwUnlessCan(
ProjectPermissionSecretSyncActions.Edit,
secretSync.environment?.slug && secretSync.folder?.path
? subject(ProjectPermissionSub.SecretSyncs, {
environment: secretSync.environment.slug,
secretPath: secretSync.folder.path,
connectionId: params.connectionId
})
: ProjectPermissionSub.SecretSyncs
);
}Note: Secret rotation correctly prevents this by excluding |
backend/src/ee/services/secret-rotation-v2/secret-rotation-v2-service.ts
Show resolved
Hide resolved
frontend/src/pages/project/RoleDetailsBySlugPage/components/GeneralPermissionConditions.tsx
Outdated
Show resolved
Hide resolved
frontend/src/pages/project/RoleDetailsBySlugPage/components/GeneralPermissionConditions.tsx
Outdated
Show resolved
Hide resolved
frontend/src/pages/project/RoleDetailsBySlugPage/components/SecretSyncPermissionConditions.tsx
Outdated
Show resolved
Hide resolved
scott-ray-wilson
left a comment
There was a problem hiding this comment.
last thing, always want to check connection id
backend/src/ee/services/secret-rotation-v2/secret-rotation-v2-service.ts
Outdated
Show resolved
Hide resolved
...nd/src/pages/secret-manager/SecretSyncDetailsByIDPage/components/SecretSyncSourceSection.tsx
Outdated
Show resolved
Hide resolved
…lint in detail components Co-authored-by: Cursor <cursoragent@cursor.com>
scott-ray-wilson
left a comment
There was a problem hiding this comment.
LGTM, tested rotations and syncs granularly
… sync components Co-authored-by: Cursor <cursoragent@cursor.com>
scott-ray-wilson
left a comment
There was a problem hiding this comment.
LGTM, I granularly tested sync and rotation permissions
Add app connection Id permission condition to secret syncs and rotations
Linear: PLATFRM-175
Context
Admins can now restrict access to secret syncs and rotations based on their app connection. This allows hiding sensitive syncs/rotations that use org-level app connections from sub-users.
Changes:
connectionIdcondition tosecret-syncsandsecret-rotationpermission schemasconnectionIdin services$GLOBoperator support toSecretRotationConditionSchemaenvironment field for consistencyconnectionIdcondition for both subjectsBefore: Users with Read on
secret-syncssaw all syncs in the project.After: Users only see syncs/rotations they have permission for based on
environment,secretPath, andconnectionIdconditions.Screenshots
Steps to verify the change
Test: connectionId-based filtering
conn-1, Sync B withconn-2)secret-syncsonly whenconnectionId = conn-1(or use permission inversion to denyconn-2)Regression test
secret-syncsto a userType
Checklist
type(scope): short description(scope is optional, e.g.fix: prevent crash on syncorfix(api): handle null response).