-
Notifications
You must be signed in to change notification settings - Fork 83
Document immutable roles #2001
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Document immutable roles #2001
Changes from 1 commit
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
4120c22
Document immutable roles
renetapopova a7a4c14
Update modules/ROOT/pages/authentication-authorization/immutable-role…
renetapopova 21d25ea
Update modules/ROOT/pages/authentication-authorization/immutable-role…
renetapopova 918b89b
Update modules/ROOT/pages/authentication-authorization/immutable-role…
renetapopova 1a03007
Update modules/ROOT/pages/authentication-authorization/immutable-role…
renetapopova cfb1ce3
Update modules/ROOT/pages/authentication-authorization/immutable-role…
renetapopova cb59fab
Update modules/ROOT/pages/authentication-authorization/immutable-role…
renetapopova 0e52d6c
Update modules/ROOT/pages/authentication-authorization/immutable-role…
renetapopova 0c0ae41
Update modules/ROOT/pages/authentication-authorization/immutable-role…
renetapopova e0b2281
Update modules/ROOT/pages/authentication-authorization/immutable-role…
renetapopova 0319e66
Update modules/ROOT/pages/authentication-authorization/immutable-role…
renetapopova 937ef82
Update modules/ROOT/pages/authentication-authorization/immutable-role…
renetapopova 65b1730
Update modules/ROOT/pages/authentication-authorization/immutable-role…
renetapopova fa5a9fb
Update modules/ROOT/pages/authentication-authorization/immutable-role…
renetapopova a388fb0
Update modules/ROOT/pages/authentication-authorization/immutable-role…
renetapopova 387d33b
Update modules/ROOT/pages/authentication-authorization/immutable-role…
renetapopova ed5bf16
Update modules/ROOT/pages/authentication-authorization/immutable-role…
renetapopova a5c9f9a
Update modules/ROOT/pages/authentication-authorization/immutable-role…
renetapopova e376e6b
Update modules/ROOT/pages/authentication-authorization/manage-roles.adoc
renetapopova 4b4c27a
Update modules/ROOT/pages/authentication-authorization/manage-roles.adoc
renetapopova 9987ad9
Update modules/ROOT/pages/authentication-authorization/manage-roles.adoc
renetapopova b36391d
Update modules/ROOT/pages/index.adoc
renetapopova 3f1917b
Update modules/ROOT/pages/authentication-authorization/immutable-role…
renetapopova 83791ec
Update modules/ROOT/pages/authentication-authorization/immutable-role…
renetapopova 8d1f5d2
Update modules/ROOT/pages/authentication-authorization/immutable-role…
renetapopova 33cf739
Update modules/ROOT/pages/authentication-authorization/immutable-role…
renetapopova a581192
Update modules/ROOT/pages/authentication-authorization/immutable-role…
renetapopova File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
146 changes: 146 additions & 0 deletions
146
modules/ROOT/pages/authentication-authorization/immutable-roles-privileges.adoc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,146 @@ | ||
| [role=enterprise-edition not-on-aura] | ||
| [[immutable-roles-and-privileges]] | ||
| = Immutable roles and privileges | ||
| :description: This section explains how to use Cypher to manage immutable roles and privileges. | ||
|
|
||
| [NOTE] | ||
| ==== | ||
| Immutable roles are available starting with Neo4j 5.26. | ||
| ==== | ||
|
|
||
| Immutable privileges and roles are useful for restricting the actions of users who can themselves administer xref:authentication-authorization/dbms-administration.adoc#access-control-dbms-administration-role-management[roles] xref:authentication-authorization/dbms-administration.adoc#access-control-dbms-administration-privilege-management[privileges]. | ||
renetapopova marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
|
|
||
| [CAUTION] | ||
| ==== | ||
| Immutable privileges and roles should only be used in situations where changes are rare. | ||
| They are intentionally difficult to modify, so changes should be undertaken with caution (e.g., when the DBMS has been isolated by some other means and unauthorized access can be reliably prevented). | ||
| Typically, this type of modification should only be made once during the commissioning phase of a DBMS. | ||
| ==== | ||
|
|
||
| [[administer-immutable-roles-and-privileges]] | ||
| == Administer immutable roles and privileges | ||
|
|
||
| After the DBMS is safely isolated from external connections, follow these steps to administer immutable roles and privileges: | ||
|
|
||
| . Change the config setting xref:configuration/configuration-settings.adoc#config_dbms.security.auth_enabled[`dbms.security.auth_enabled`] to `false`. | ||
| . Restart the DBMS. | ||
| . Create or remove immutable privileges and roles in the same way as regular privileges and roles but with the addition of the `IMMUTABLE` keyword. | ||
| See <<immutable-roles-privileges-examples, Examples>>. | ||
| . Change the config setting xref:configuration/configuration-settings.adoc#config_dbms.security.auth_enabled[`dbms.security.auth_enabled`] back to `true`. | ||
| . Restart the DBMS. | ||
|
|
||
| Privileges and roles created in this way can now appear to all users as an immutable part of the DBMS. | ||
renetapopova marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| If you want to change or remove them, you must repeat the process of setting xref:configuration/configuration-settings.adoc#config_dbms.security.auth_enabled[`dbms.security.auth_enabled`] to `false`. | ||
|
|
||
| [[immutable-roles-privileges-examples]] | ||
| == Examples | ||
|
|
||
| The following examples demonstrate how to use Cypher to manage immutable roles and privileges. | ||
|
|
||
| === Restricting the actions of users who can manage privileges | ||
|
|
||
| To prevent all users, including the `admin` user, from performing *database management*, follow these steps: | ||
renetapopova marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| . Ensure that you have completed steps 1 an 2 from <<administer-immutable-roles-and-privileges>>. | ||
renetapopova marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| . Run the following command to deny the `IMMUTABLE DATABASE MANAGEMENT` privilege to the `PUBLIC` role: | ||
| + | ||
| [source, cypher, role=test-skip] | ||
| ---- | ||
| DENY IMMUTABLE DATABASE MANAGEMENT ON DBMS TO PUBLIC | ||
| ---- | ||
|
|
||
| . Verify that the `IMMUTABLE` keyword has been added to the privilege: | ||
| + | ||
| [source, cypher, role=noplay] | ||
| ---- | ||
| SHOW PRIVILEGES WHERE IMMUTABLE | ||
| ---- | ||
| + | ||
| .Result | ||
| [options="header,footer", width="100%", cols="1m,2m,1m,1m,1m,1m,1m"] | ||
| |=== | ||
| |access | ||
| |action | ||
| |resource | ||
| |graph | ||
| |segment | ||
| |role | ||
| |immutable | ||
|
|
||
| |"DENIED" | ||
| |"database_management" | ||
| |"database" | ||
| |"*" | ||
| |"database" | ||
| |"PUBLIC" | ||
| |true | ||
|
|
||
| 7+a|Rows: 2 | ||
| |=== | ||
| + | ||
| The result shows that all users are restricted from adding or removing privileges, including the `admin` user. | ||
| . Ensure you have completed steps 4 and 5 from <<administer-immutable-roles-and-privileges>>. | ||
|
|
||
| === Restricting the actions of users who can manage roles and privileges | ||
|
|
||
| If you want permanent privileges but with more control over which users they apply to, you need to use immutable roles with immutable privileges. | ||
| For example, you have a user called `alice` who has `ROLE MANAGEMENT` and `PRIVILEGE MANAGEMENT` privileges. | ||
| To prevent `alice` from dropping any databases and from being able to remove this restriction using their `ROLE MANAGEMENT` and `PRIVILEGE MANAGEMENT` privileges, follow these steps: | ||
renetapopova marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| . Ensure that you have completed steps 1 an 2 from <<administer-immutable-roles-and-privileges>>. | ||
renetapopova marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| . Create an immutable role to hold the immutable privileges: | ||
| + | ||
| [source, cypher, role=noplay] | ||
| ---- | ||
| CREATE IMMUTABLE ROLE restrictedAdmin | ||
renetapopova marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| ---- | ||
|
|
||
| . Immutably deny the `DROP DATABASE` privilege: | ||
renetapopova marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| + | ||
| [source, cypher, role=noplay] | ||
| ---- | ||
| DENY IMMUTABLE DROP DATABASE ON DBMS TO restrictedAdmin | ||
renetapopova marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| ---- | ||
|
|
||
| . Grant the restrictedAdmin role to `alice` to prevent her dropping databases: | ||
| + | ||
| [source, cypher, role=noplay] | ||
| ---- | ||
| GRANT restrictedAdmin TO alice | ||
| ---- | ||
| + | ||
renetapopova marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| . Ensure you have completed steps 4 and 5 from <<administer-immutable-roles-and-privileges>>. | ||
| + | ||
| Now, despite having `ROLE MANAGEMENT` and `PRIVILEGE MANAGEMENT` privileges, `alice` will not be able do any of the following: | ||
renetapopova marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| + | ||
| .Drop databases: | ||
| [source, cypher, role=noplay] | ||
| ---- | ||
| DROP DATABASE foo | ||
| ---- | ||
| + | ||
| .Remove the restrictedAdmin role from `alice` | ||
| [source, cypher, role=noplay] | ||
| ---- | ||
| REVOKE ROLE restrictedAdmin FROM alice | ||
| ---- | ||
| + | ||
| .Remove the `DROP DATABASE` privilege from the restrictedAdmin role | ||
renetapopova marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| [source, cypher, role=noplay] | ||
renetapopova marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| ---- | ||
| DROP ROLE restrictedAdmin | ||
renetapopova marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| ---- | ||
| + | ||
| .Remove `DENY DROP DATABASE` from the restrictedAdmin role | ||
| [source, cypher, role=noplay] | ||
| ---- | ||
| REVOKE DENY DROP DATABASE ON DBMS FROM restrictedAdmin | ||
| ---- | ||
renetapopova marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
renetapopova marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| [NOTE] | ||
| ==== | ||
| Only immutable privileges (e.g. `DENY IMMUTABLE DROP DATABASE` in the example above) can be assigned to immutable roles. | ||
renetapopova marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| This is to make sure that the role and all of its privileges is explicitly and completely immutable. | ||
renetapopova marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| ==== | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 0 additions & 46 deletions
46
modules/ROOT/pages/authentication-authorization/privileges-immutable.adoc
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.