-
Notifications
You must be signed in to change notification settings - Fork 340
Description
Problem Statement
This issue tracks specific design questions about Service Accounts.
What type of REST requests are intended for extensions?
How does the Security Plugin interact with REST requests?
What is the current method of signifying things?
Action items decided on this issue:
- How can an admin grant and revoke extension permissions?
- How is an extension prevented from elevating its own permissions?
- How does DLS/FLS work for extensions?
$\textcolor{orange}{\textsf{How can an admin grant and revoke service account permissions?}}$
There are a couple options for handling how an administrator can grant or revoke extension permissions.
- The first option for managing how an administrator can modify extension permissions is preventing an administrator from making any changes after installation. When an extension is installed, the administrator is expected to grant it privileges based on its configuration file. For instance an extension may specify it requires read access on installation. An administrator would approve this request as part of the installation process. Presumably the extension will have requested all the permissions it requires during installation. As a result, it is not clear why an administrator would later need to modify the granted permissions.
| Pros | Cons |
|---|---|
| Easiest to implement | May restrict extension configuration |
| Simple rule makes for clear user experience | Incompatible with optional permissions (unless granted on installation) |
| Solves the issue of an extension elevating its own permissions (they cannot be changed) |
-
$\textcolor{lime}{\textsf{Administrators change permissions using the internal user api}}$ The second option is for an administrator to need to use an API to configure permissions in a similar manner to how they would configure user permissions. This option allows an administrator to grant privileges after an extension is installed. The API could use the existing format for modifying user privileges but specify the extension's service account in place of an internal user's name.
| Pros | Cons |
|---|---|
| More configurable | Requires writing an API |
| Familiar experience for administrators | Does not answer why permissions would need to be changed |
$\textcolor{orange}{\textsf{How is an extension prevented from elevating its own permissions?}}$
The two main options for preventing an extension from elevating its own permissions are:
- By making it impossible for an extension's permissions to be changed after installation, an extension is implicitly prevented from elevating its own permissions. If there is no method of changing an extension's permissions after it is installed, the extension will have no mechanism of escalating its own permissions. Even if the extension were granted administrative privileges, there simply would be no method for changing the permissions. This option makes the most sense if the first option of the previous question is also chosen.
| Pros | Cons |
|---|---|
| Easiest to implement | Requires choosing previous option 1 |
| No loop holes | Not clear or lack of access == enforcement |
-
$\textcolor{lime}{\textsf{Service account cannot have permission granting privileges}}$ The alternative approach to preventing an extension from elevating its own permissions is to make the permission grant privileges un-assignable to any service account. This option would require parsing permission grants to extensions and removing any batch grants or individual grants that would provide an extension permission grant privileges. The upside of this option is that it does not prevent an extension from having its permissions modified after installation. An extension could still have its permissions changes but if no extension is ever able to change permissions itself, there will not be a concern that an extension could elevate its own privileges.
| Pros | Cons |
|---|---|
| Allows for changing permissions after installation | Requires parsing & resolving permission assignments |
| More configurable | How to prove a request is not coming from an extension? |
$\textcolor{orange}{\textsf{How does DLS/FLS work for extensions?}}$
There are two main options for handling DLS/FLS for extensions.
- The first option for handling DLS/FLS is to OR all filters. Normally, DLS/FLS is handled by ORing all of the patterns and then resolving each of them in turn. Employing an approach where the originating user's filters, and the extension's filters were combined and resolved in a similar way may be the most traditional resolution strategy. For instance if the user had patterns
A, Band the extension had patternsC, D, then the final request would be treated as if the extension had patternsA, B, C, D.
| Pros | Cons |
|---|---|
| Easy to implement | Information leak into the extension |
| Matches traditional DLS/FLS resolution | Results could have data the user does not have permission to see |
-
$\textcolor{violet}{\textsf{AND filters recursively}}$ The second option for handling DLS/FLS resolution is for the patterns to be AND'd. This option would first apply the pattern of the extension to the query. This would prevent the extension from accessing any information it was not originally allowed to see. After applying the extension's filters, the request would be resolved to the extension level. At that point, the user's filters would be applied to the current result. This would act as an AND operation that would take the intersection of the filters between the extension and the user.
| Pros | Cons |
|---|---|
| More intuitive results for the user | Fewer results since each filter could have aspects excluded |
| Prevents data leak | Not aligned with traditional DLS/FLS resolution |
-
$\textcolor{lime}{\textsf{Service account will support DLS/FLS but scopes/policies will not}}$ Support DLS/FLS for user accounts and on-behalf-of tokens acting as those users. Likewise, we will support DLS/FLS for service accounts and auth tokens representing them when an extension makes an independent action. We won't be P0 supporting filters on the scope of an extensions permissions. Meaning there will be no way to restrict the access of an extension across all use cases. You cannot say an extension can READ for all use cases can't just not this one index. This is the scenario that is complicated to resolve and is going to be left for a later date.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status