feat: add SYSTEM_OWNER role (#6765)

* define roles and permissions

* support system user memberships

* don't limit system users

* cleanup permissions

* restrict memberships to aggregates

* default to SYSTEM_OWNER

* update unit tests

* test: system user token test (#6778)

* update unit tests

* refactor: make authz testable

* move session constants

* cleanup

* comment

* comment

* decode member type string to enum (#6780)

* decode member type string to enum

* handle all membership types

* decode enums where necessary

* decode member type in steps config

* update system api docs

* add technical advisory

* tweak docs a bit

* comment in comment

* lint

* extract token from Bearer header prefix

* review changes

* fix tests

* fix: add fix for activityhandler

* add isSystemUser

* remove IsSystemUser from activity info

* fix: add fix for activityhandler

---------

Co-authored-by: Stefan Benz <[email protected]>
This commit is contained in:
Elio Bischof
2023-10-25 15:10:45 +00:00
committed by GitHub
co-authored by Stefan Benz
parent c8b9b0ac75
commit 4980cd6a0c
34 changed files with 959 additions and 410 deletions
+63
View File
@@ -0,0 +1,63 @@
---
title: Technical Advisory 10007
---
## Date and Version
Version: Upcoming
Date: Upcoming
## Affected Users
This advisory applies to self-hosted ZITADEL installations with custom roles to permissions mappings in the *InternalAuthZ.RolePermissionMappings* configuration section.
## Description
In upcoming ZITADEL versions, RBAC also applies to [system users defined in the ZITADEL runtime configuration](/guides/integrate/access-zitadel-system-api#runtime-configuration).
This enables fine grained access control to the system API as well as other APIs for system users.
ZITADEL defines the new default roles *SYSTEM_OWNER* and *SYSTEM_OWNER_VIEWER*.
System users without any memberships defined in the configuration will be assigned the *SYSTEM_OWNER* role.
**Self-hosting users who define their own custom mapping at the *InternalAuthZ.RolePermissionMappings* configuration section**, have to define the *SYSTEM_OWNER* role in their configuration too to be able to access the system API with the default system user membership.
## Statement
This change is tracked in the following PR: [feat: add SYSTEM_OWNER role](https://github.com/zitadel/zitadel/pull/6765).
As soon as the release version is published, we will include the version here.
## Mitigation
If you have a custom role mapping configured, make sure you configure the new role *SYSTEM_OWNER* before migrating to upcoming ZITADEL versions.
As a reference, these are the default mappings:
```yaml
InternalAuthZ:
RolePermissionMappings:
- Role: "SYSTEM_OWNER"
Permissions:
- "system.instance.read"
- "system.instance.write"
- "system.instance.delete"
- "system.domain.read"
- "system.domain.write"
- "system.domain.delete"
- "system.debug.read"
- "system.debug.write"
- "system.debug.delete"
- "system.feature.write"
- "system.limits.write"
- "system.limits.delete"
- "system.quota.write"
- "system.quota.delete"
- "system.iam.member.read"
- Role: "SYSTEM_OWNER_VIEWER"
Permissions:
- "system.instance.read"
- "system.domain.read"
- "system.debug.read"
...
```
## Impact
If the system users don't have the correct memberships and roles which resolve to permissions, the system users lose access to the system API.
+12
View File
@@ -130,6 +130,18 @@ We understand that these advisories may include breaking changes, and we aim to
<td>2.39.0</td>
<td>Calendar week 41/42 2023</td>
</tr>
<tr>
<td>
<a href="./advisory/a10007">A-10006</a>
</td>
<td>Additional grant to cockroach database user</td>
<td>Breaking Behaviour Change</td>
<td>
Upcoming Versions require the SYSTEM_OWNER role to be available in the permission role mappings. Self-hosting ZITADEL users who define custom permission role mappings need to make sure their system users don't lose access to the system API.
</td>
<td>Upcoming</td>
<td>Upcoming</td>
</tr>
</table>
## Subscribe to our Mailing List