Skip to content

prototype for sm manage permissions#19613

Draft
maxkpower wants to merge 3 commits intomainfrom
SM-prototype-for-manage-permissions
Draft

prototype for sm manage permissions#19613
maxkpower wants to merge 3 commits intomainfrom
SM-prototype-for-manage-permissions

Conversation

@maxkpower
Copy link
Copy Markdown
Contributor

@maxkpower maxkpower commented Mar 17, 2026

Overview

Prototype for adding a Manage permission to Secrets Manager access policies, enabling a dedicated tier for administering who can access projects and secrets separate from Read/Write data access.

client-demo.mp4

Prototype explanation

This prototype introduces a new can manage permission fo Secrets Manager

Manage  →  Write  →  Read
Permission Read secrets/configs Create/edit/delete View & change access policies
Read
Write
Manage

Manage without Write, or Write without Read, is not possible — enforced by database constraints.


What manage enables

Manage exclusively governs who can view and modify access policies on a resource. It does not affect what the holder can do to the resource itself, that remains governed by Write.

On a Project

Action Permission
Read secrets Read
Create / edit / delete secrets Write
View or modify people and machine account access policies Manage

On a Secret

Action Permission
Read the secret value Read
Edit or delete the secret Write
View or modify access policies Manage

On a Machine Account

Action Permission
View the machine account, access tokens, and events Read
Edit settings, delete, create/revoke access tokens Write
View which people or projects have access Write
Modify which people have access Manage
Modify which projects are granted access Manage on the machine account and each target project

Restrictions on Machine Accounts

Granting Manage

Users with Manage can freely grant or adjust Manage on any resource they control. Machine accounts face additional restrictions:

  • Projects — Only the machine account that created the project can grant Manage to others on that project. A machine account given Manage (but not the creator) can use the permission but cannot grant it to anyone else. Additionally, the creator can only grant Manage to itself on machine account access policies — not to other machine accounts.

    Rationale: prevents a machine account from using a granted Manage permission to further delegate control it was never intended to have. Manage delegation is anchored to the machine account that established the project, keeping the privilege chain auditable and explicit.

  • Secrets — Secrets have no creator of their own. The system uses the creator of the secret's parent project and applies the same rule.

Hard Limits

  • Machine accounts cannot modify people access policies on other machine accounts under any circumstances.

    Rationale: if a machine account were compromised, it should not be able to grant human users access to other machine accounts, which could then be used to pivot further. Keeping humans in control of human-to-machine-account access ensures a person is always in the authorization chain.

  • Machine accounts cannot call the secret access policy write endpoint — only users can modify secret-level access policies.

    Rationale: secret access policies determine who can read sensitive values. Restricting writes to human callers ensures that a compromised machine account cannot silently expand its own access or the access of other machine accounts to secrets.


Lockout protection

If a project has at least one person (user or group) with Manage, replacing the people policies in a way that removes all human Manage grants is blocked with a 400 Bad Request. This ensures a human can always recover control of the project.


Existing permissions after migration

  • User and group policies with Write = true → backfilled to Manage = true
  • Machine account policies → remain at Manage = false regardless of Write value

Existing human administrators keep their ability to manage access policies. Machine accounts must be explicitly granted Manage by a user or the creator machine account.

Access policy event logs

Events are emitted whenever access policies are created, removed, or have their permissions changed. No event is emitted for a no-op (e.g. replacing a policy with identical Read/Write/Manage values).


Secret access events

Fired when a secret's access policies are modified via PUT /secrets/{secretId}/access-policies.

Event Code Trigger
Secret_UserAccessGranted 2106 A user is added to the secret's access policies
Secret_UserAccessRevoked 2107 A user is removed from the secret's access policies
Secret_UserAccessUpdated 2108 A user's Read/Write/Manage permissions on the secret change
Secret_GroupAccessGranted 2109 A group is added to the secret's access policies
Secret_GroupAccessRevoked 2110 A group is removed from the secret's access policies
Secret_GroupAccessUpdated 2111 A group's Read/Write/Manage permissions on the secret change
Secret_ServiceAccountAccessGranted 2112 A machine account is added to the secret's access policies
Secret_ServiceAccountAccessRevoked 2113 A machine account is removed from the secret's access policies
Secret_ServiceAccountAccessUpdated 2114 A machine account's Read/Write/Manage permissions on the secret change

Project access events

Fired when a project's people or machine account access policies are modified. These events are also emitted when changes are made from the machine account side (granted policies) — the same event types are used in both cases.

Event Code Trigger
Project_UserAccessGranted 2204 A user is added to the project's access policies
Project_UserAccessRevoked 2205 A user is removed from the project's access policies
Project_UserAccessUpdated 2206 A user's Read/Write/Manage permissions on the project change
Project_GroupAccessGranted 2207 A group is added to the project's access policies
Project_GroupAccessRevoked 2208 A group is removed from the project's access policies
Project_GroupAccessUpdated 2209 A group's Read/Write/Manage permissions on the project change
Project_ServiceAccountAccessGranted 2210 A machine account is granted access to the project
Project_ServiceAccountAccessRevoked 2211 A machine account's access to the project is removed
Project_ServiceAccountAccessUpdated 2212 A machine account's Read/Write/Manage permissions on the project change

Machine account access events

Fired when a machine account's people access policies are modified via PUT /service-accounts/{id}/access-policies/people.

The Added/Removed events below pre-date this feature. The PermissionUpdated events (2306–2307) are new and fire only when an existing policy's permissions change — they do not fire when a policy is added or removed.

Event Code Trigger
ServiceAccount_UserAdded A user is added to the machine account's access policies
ServiceAccount_UserRemoved A user is removed from the machine account's access policies
ServiceAccount_UserPermissionUpdated 2306 An existing user's Read/Write/Manage permissions on the machine account change
ServiceAccount_GroupAdded A group is added to the machine account's access policies
ServiceAccount_GroupRemoved A group is removed from the machine account's access policies
ServiceAccount_GroupPermissionUpdated 2307 An existing group's Read/Write/Manage permissions on the machine account change

Related Draft PRs

This prototype is depending on the following draft PRs:

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 17, 2026

Logo
Checkmarx One – Scan Summary & Details1aade874-af48-4fa2-8dbc-0185905d7b51


New Issues (3) Checkmarx found the following issues in this Pull Request
# Severity Issue Source File / Package Checkmarx Insight
1 HIGH CVE-2026-27148 Npm-storybook-9.1.17
detailsRecommended version: 9.1.19
Description: Storybook is a frontend workshop for building user interface components and pages in isolation. Prior to versions 7.6.23, 8.x prior to 8.6.17, 9.x ...
Attack Vector: NETWORK
Attack Complexity: LOW
Vulnerable Package
2 HIGH CVE-2026-27970 Npm-@angular/core-20.3.16
detailsRecommended version: 20.3.18
Description: Angular is a development platform for building mobile and desktop web applications using TypeScript, JavaScript, and other languages. Versions prio...
Attack Vector: NETWORK
Attack Complexity: LOW
Vulnerable Package
3 MEDIUM Use_of_Broken_or_Risky_Cryptographic_Algorithm /libs/node/src/services/node-crypto-function.service.ts: 304
detailsIn toNodeCryptoAesMode, the application protects sensitive data using a cryptographic algorithm, "aes-256-ecb", that is considered weak or even t...
Attack Vector

Fixed Issues (1) Great job! The following issues were fixed in this Pull Request
Severity Issue Source File / Package
MEDIUM HttpOnly_Cookie_Flag_Not_Set /libs/common/src/platform/services/server-communication-config/default-server-communication-config.service.ts: 67

@sonarqubecloud
Copy link
Copy Markdown

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.

2 participants