-
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 13 commits
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
128 changes: 128 additions & 0 deletions
128
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,128 @@ | ||
| [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 are useful for restricting the actions of users who can themselves administer xref:authentication-authorization/dbms-administration.adoc#access-control-dbms-administration-privilege-management[privileges]. | ||
| Immutable roles are useful for providing _system roles_, which appear as permanent parts of the DBMS. | ||
renetapopova marked this conversation as resolved.
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 now appear as an immutable part of the DBMS. | ||
| 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 those with `PRIVILEGE MANAGEMENT` privileges) from performing *database management*, attach an immutable privilege to the `PUBLIC` role. | ||
| The `PUBLIC` role implicitly and irrevocably applies to all users. | ||
|
|
||
| . Ensure that you have completed steps 1 and 2 from <<administer-immutable-roles-and-privileges>>. | ||
| . 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>>. | ||
|
|
||
| === Creating permanent roles which cannot be changed | ||
renetapopova marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| You can use immutable roles to create permanent built-in system roles that cannot be modified even by users who have xref:authentication-authorization/dbms-administration.adoc#access-control-dbms-administration-role-management[`ROLE MANAGEMENT` privileges]. | ||
|
|
||
| For example, you want to create an `analyst` role that cannot be dropped, renamed, or have any of its privileges changed (even by users with the `ROLE MANAGEMENT` and `PRIVILEGE MANAGEMENT` privileges). | ||
|
|
||
|
|
||
| . Ensure that you have completed steps 1 and 2 from <<administer-immutable-roles-and-privileges>>. | ||
| . Create an immutable role to hold the immutable privileges: | ||
| + | ||
| [source, cypher, role=noplay] | ||
| ---- | ||
| CREATE IMMUTABLE ROLE analyst | ||
| ---- | ||
|
|
||
| . Immutably grant the `MATCH` privilege: | ||
| + | ||
| [source, cypher, role=noplay] | ||
| ---- | ||
| GRANT IMMUTABLE MATCH {*} ON GRAPH * ELEMENTS * TO analyst | ||
| ---- | ||
|
|
||
| . Ensure you have completed steps 4 and 5 from <<administer-immutable-roles-and-privileges>>. | ||
| + | ||
| Now, even users with `ROLE MANAGEMENT` and `PRIVILEGE MANAGEMENT` privileges will not be able do any of the following: | ||
| [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
61 changes: 0 additions & 61 deletions
61
modules/ROOT/pages/tutorial/tutorial-immutable-privileges.adoc
This file was deleted.
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.