Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions models/hospital/access-control-old.adoc
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
[role=enterprise-edition]
[[auth-access-control]]
= Fine-grained access control
:description: Describes an example that illustrates various aspects of security and fine-grained access control.
:description: Describes an example that illustrates various aspects of security and fine-grained access control.

When creating a database, administrators may want to establish which users have the ability to access certain information.

As described in xref:authentication-authorization/built-in-roles/auth-built-in-roles[Built-in roles], Neo4j already offers preset roles configured to specific permissions (i.e. read, edit, or write).
As described in xref:authentication-authorization/built-in-roles.adoc[Built-in roles], Neo4j already offers preset roles configured to specific permissions (i.e. read, edit, or write).
While these built-in roles cover many common daily scenarios, it is also possible to create custom roles for specific needs.

This page contains an example that illustrates various aspects of security and fine-grained access control.
Expand Down Expand Up @@ -35,7 +35,7 @@ They can be described using the properties:
* `description`

`(:Disease)`::
Known illnesses mapped in a catalog found in the database.
Known illnesses mapped in a catalog found in the database.
They can be described using the properties:
+
* `name`
Expand Down Expand Up @@ -85,7 +85,7 @@ This allows users to be created entirely within the database security model, a s
For more information, see link:/docs/cypher-manual/{neo4j-version}/access-control/[Cypher Manual -> Access control].

The following examples show two different approaches to using Neo4j security features to support the _healthcare_ database application.
The first approach uses xref:authentication-authorization/built-in-roles/auth-built-in-roles[Built-in roles], whereas the second uses more advanced resources with fine-grained privileges for <<auth-access-control-using-privileges, sub-graph access control>>.
The first approach uses xref:authentication-authorization/built-in-roles.adoc[Built-in roles], whereas the second uses more advanced resources with fine-grained privileges for <<auth-access-control-using-privileges, sub-graph access control>>.

In this example, consider five users of the _healthcare_ database:

Expand Down Expand Up @@ -128,13 +128,13 @@ Neo4j comes with built-in roles that cover a number of common needs:
* `architect` - Has all the capabilities of the publisher as well as the ability to manage indexes and constraints.
* `admin` - Can perform architect actions as well as manage databases, users, roles, and privileges.

Consider Charlie from the example of users.
Consider Charlie from the example of users.
As a researcher, they do not need write access to the database, so they are assigned the `reader` role.

On the other hand, Alice (the doctor), Daniel (the nurse), and Bob (the receptionist) all need to update the database with new patient information, but do not need to expand the schema with new labels, relationship types, property names or indexes.
On the other hand, Alice (the doctor), Daniel (the nurse), and Bob (the receptionist) all need to update the database with new patient information, but do not need to expand the schema with new labels, relationship types, property names or indexes.
For this reason, they are all assigned the `editor` role.

Tina, the IT administrator who installs and manages the database, needs to be assigned the `admin` role.
Tina, the IT administrator who installs and manages the database, needs to be assigned the `admin` role.

Here is how to grant roles to the users:

Expand Down Expand Up @@ -183,11 +183,11 @@ Has the permission to save _diagnoses_ to the database, but not expand the schem
Receptionist::
Should be able to read and write all patient data, but not be able to see the symptoms, diseases, or diagnoses.
Researcher::
Should be able to perform statistical analysis of all data, except patients’ personal information, to which they should have restricted access.
Should be able to perform statistical analysis of all data, except patients’ personal information, to which they should have restricted access.
To illustrate two different ways of setting up the same effective privileges, two roles are created for comparison.
Nurse::
Should be able to perform all tasks that both the doctor and the receptionist can do.
Granting both roles (doctor and receptionist) to the nurse does not work as expected.
Granting both roles (doctor and receptionist) to the nurse does not work as expected.
This is explained in the section dedicated to the creation of the `nurse` role.
Junior nurse::
While the senior nurse is able to save diagnoses just as a doctor can, some (junior) nurses might not be allowed to do that.
Expand Down Expand Up @@ -709,7 +709,7 @@ RETURN n.name, n.ssn, n.address, n.dateOfBirth;

[[detach-delete-restricted-user]]

With the `receptionist` role, Bob can delete any new patient nodes they have just created, but they are not able to delete patients that have already received diagnoses since those are connected to parts of the graph that Bob cannot see.
With the `receptionist` role, Bob can delete any new patient nodes they have just created, but they are not able to delete patients that have already received diagnoses since those are connected to parts of the graph that Bob cannot see.
Here is a demonstration of both scenarios:

[source, cypher]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -827,7 +827,7 @@ These include the rights to perform the following classes of tasks:

* Manage xref:authentication-authorization/database-administration.adoc[database privileges] to control the rights to perform actions on specific databases:
** Manage access to a database and the right to start and stop a database.
** Manage link:{neo4j-docs-base-uri}/cypher-manual/{page-version}/indexes-for-search-performance/[indexes] and link:{neo4j-docs-base-uri}/cypher-manual/{page-version}/constraints/[constraints].
** Manage link:{neo4j-docs-base-uri}/cypher-manual/5/indexes-for-search-performance/[indexes] and link:{neo4j-docs-base-uri}/cypher-manual/5/constraints/[constraints].
** Allow the creation of labels, relationship types, or property names.
** Manage transactions.
* Manage xref:authentication-authorization/dbms-administration.adoc[DBMS privileges] to control the rights to perform actions on the entire system:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ CREATE ROLE deniedConfigurationViewer IF NOT EXISTS;

All DBMS privileges are relevant system-wide.
Like user management, they do not belong to one specific database or graph.
For more details on the differences between graphs, databases, and the DBMS, refer to link:{neo4j-docs-base-uri}/cypher-manual/{page-version}/introduction/cypher_neo4j/[Cypher Manual -> Cypher and Neo4j].
For more details on the differences between graphs, databases, and the DBMS, refer to link:{neo4j-docs-base-uri}/cypher-manual/5/introduction/cypher_neo4j/[Cypher Manual -> Cypher and Neo4j].

image::privileges_grant_and_deny_syntax_dbms_privileges.svg[title="Syntax of GRANT and DENY DBMS Privileges"]

Expand Down Expand Up @@ -2067,7 +2067,7 @@ In this case, `+*+` means 0 or more characters, and `?` matches exactly one char

[NOTE]
====
The name-globbing is subject to the link:{neo4j-docs-base-uri}/cypher-manual/{page-version}/syntax/naming/[Cypher Manual -> Naming rules and recommendations], with the exception that it may include dots, stars, and question marks without the need for escaping using backticks.
The name-globbing is subject to the link:{neo4j-docs-base-uri}/cypher-manual/5/syntax/naming/[Cypher Manual -> Naming rules and recommendations], with the exception that it may include dots, stars, and question marks without the need for escaping using backticks.

Each part of the name-globbing separated by dots may be individually quoted.
For example, `++mine.`procedureWith%`++` is allowed, but not `++mine.procedure`With%`++`.
Expand Down
4 changes: 2 additions & 2 deletions modules/ROOT/pages/authentication-authorization/index.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ For more information, see xref:authentication-authorization/password-and-user-re
When triggered, Neo4j logs an error containing a timestamp and the message `failed to log in: too many failed attempts` in the _security.log_.
====
+
For the relevant Cypher commands, see xref:authentication-authorization/manage-users.adoc#access-control-user-syntax[Manage users syntax], xref:authentication-authorization/manage-roles.adoc#access-control-role-syntax[Manage roles syntax], and xref:authentication-authorization/manage-privileges.adoc#access-control-privileges-syntax[Manage privileges syntax].
For the relevant Cypher commands, see xref:authentication-authorization/manage-users.adoc#access-control-user-syntax[Manage users syntax], xref:authentication-authorization/manage-roles.adoc#access-control-role-syntax[Manage roles syntax], and xref:authentication-authorization/manage-privileges.adoc[Manage privileges syntax].
Various scenarios that illustrate the use of the native auth provider are available in xref:tutorial/access-control.adoc[].

*User auth providers*::
Expand All @@ -48,7 +48,7 @@ The configuration steps are described in xref:authentication-authorization/sso-i
*Custom-built plugin auth providers*::
A plugin option for building custom integrations.
It is recommended that this option is used as part of a custom delivery as negotiated with link:https://neo4j.com/professional-services/[Neo4j Professional Services].
For more information, see link:{neo4j-docs-base-uri}/java-reference/{page-version}/extending-neo4j/security-plugins#extending-neo4j-security-plugins[Java Reference -> Authentication and authorization plugins].
For more information, see link:{neo4j-docs-base-uri}/java-reference/{page-version}/extending-neo4j/security-plugins[Java Reference -> Authentication and authorization plugins].

*Kerberos authentication and single sign-on*::
In addition to LDAP, native, and custom providers, Neo4j supports Kerberos for authentication and single sign-on.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ this LDAP group will fail authentication, even if their credentials are correct.
|===

All settings are defined at server startup time in the default configuration file _xref:configuration/neo4j-conf.adoc[neo4j.conf]_ or can be modified at
runtime using xref:procedures.adoc#procedure_dbms_setconfigvalue[`dbms.setConfigValue()`].
runtime using xref:procedures.adoc#procedure_dbms_setConfigValue[`dbms.setConfigValue()`].


[[auth-ldap-configure-provider]]
Expand Down Expand Up @@ -471,7 +471,7 @@ SET AUTH 'ldap' { SET ID 'cn=alice,ou=sales,dc=example,dc=com' }
You can verify that your LDAP configuration is correct, and that the LDAP server responds, by using the LDAP command-line tool `ldapsearch`.

The `ldapsearch` command accepts the LDAP configuration setting values as input and verifies both the authentication (using the `simple` mechanism) and authorization of a user.
See the https://docs.ldap.com/ldap-sdk/docs/tool-usages/ldapsearch.html[ldapsearch official documentation^] for more advanced usage and how to use SASL authentication mechanisms.
See the link:https://docs.ldap.com/ldap-sdk/docs/tool-usages/ldapsearch.html[ldapsearch official documentation] for more advanced usage and how to use SASL authentication mechanisms.

. Verify the authentication and authorization of a user.
For example, `john`.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@ The known limitations and implications of Neo4j's role-based access control secu
[[access-control-limitations-indexes]]
== Security and indexes

As described in link:{neo4j-docs-base-uri}/cypher-manual/{page-version}/indexes-for-search-performance/[Cypher Manual -> Indexes for search performance], Neo4j {neo4j-version} supports the creation and use of indexes to improve the performance of Cypher queries.
As described in link:{neo4j-docs-base-uri}/cypher-manual/5/indexes-for-search-performance/[Cypher Manual -> Indexes for search performance], Neo4j {neo4j-version} supports the creation and use of indexes to improve the performance of Cypher queries.

Note that the Neo4j security model impacts the results of queries, regardless if the indexes are used or not.
When using non full-text Neo4j indexes, a Cypher query will always return the same results it would have if no index existed.
This means that, if the security model causes fewer results to be returned due to restricted read access in xref:authentication-authorization/manage-privileges.adoc[Graph and sub-graph access control],
the index will also return the same fewer results.

However, this rule is not fully obeyed by link:{neo4j-docs-base-uri}/cypher-manual/{page-version}/indexes-for-full-text-search[Cypher Manual -> Indexes for full-text search].
However, this rule is not fully obeyed by link:{neo4j-docs-base-uri}/cypher-manual/5/indexes-for-full-text-search[Cypher Manual -> Indexes for full-text search].
These specific indexes are backed by _Lucene_ internally.
It is therefore not possible to know for certain whether a security violation has affected each specific entry returned from the index.
In face of this, Neo4j will return zero results from full-text indexes in case it is determined that any result might be violating the security privileges active for that query.
Expand All @@ -51,7 +51,7 @@ CREATE FULLTEXT INDEX userNames FOR (n:User|Person) ON EACH [n.name, n.surname];
[NOTE]
====
Full-text indexes support multiple labels.
See link:{neo4j-docs-base-uri}/cypher-manual/{page-version}/indexes-for-full-text-search/[Cypher Manual -> Indexes for full-text search] for more details on creating and using full-text indexes.
See link:{neo4j-docs-base-uri}/cypher-manual/5/indexes-for-full-text-search/[Cypher Manual -> Indexes for full-text search] for more details on creating and using full-text indexes.
====

After creating these indexes, it would appear that the latter two indexes accomplish the same thing.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ _This feature is available from Neo4j 5.13._
This section explains how to use Cypher to manage load privileges.
All load privileges apply to the whole system.
Like DBMS privileges, they do not belong to one specific database or graph.
For more details on the differences between graphs, databases, and the DBMS, refer to link:{neo4j-docs-base-uri}/cypher-manual/{page-version}/introduction/cypher_neo4j/[Cypher Manual -> Cypher and Neo4j].
For more details on the differences between graphs, databases, and the DBMS, refer to link:{neo4j-docs-base-uri}/cypher-manual/5/introduction/cypher_neo4j/[Cypher Manual -> Cypher and Neo4j].

image::privileges_grant_and_deny_syntax_load_privileges.svg[width="800", title="Syntax of GRANT and DENY load Privileges"]

// TODO: add image later when there is more than one LOAD privilege
//image::privileges_hierarchy_load.svg[title="Load privileges hierarchy"]

The load privileges apply to the Cypher link:{neo4j-docs-base-uri}/cypher-manual/{page-version}/clauses/load-csv/[`LOAD CSV` clause], deciding whether or not the data can be loaded from the given source.
The load privileges apply to the Cypher link:{neo4j-docs-base-uri}/cypher-manual/5/clauses/load-csv/[`LOAD CSV` clause], deciding whether or not the data can be loaded from the given source.

== Load privileges syntax

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ The elevated privileges only apply within the procedure or user-defined function
--
The steps below assume that the procedure or user-defined function is already developed and installed.

Please refer to link:{neo4j-docs-base-uri}/java-reference/{page-version}/extending-neo4j#extending-neo4j[Java Reference -> Extending Neo4j] for a description of creating and using user-defined procedures and functions.
Please refer to link:{neo4j-docs-base-uri}/java-reference/{page-version}/extending-neo4j/[Java Reference -> Extending Neo4j] for a description of creating and using user-defined procedures and functions.
--


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -637,7 +637,7 @@ RETURN user AS adminUser
[[access-control-list-user-auth-providers]]
== Listing user auth providers

To inspect users' xref:authentication-authorization/auth-providers.adoc#access-control-list-user-auth-providers[auth providers], use `SHOW USERS WITH AUTH`.
To inspect available user auth providers, use `SHOW USERS WITH AUTH`.
The command produces a row per user per auth provider and yields the following two columns in addition to those output by `SHOW USERS`:

[options="header", width="100%", cols="1a,4,1m,^.^,^.^"]
Expand Down Expand Up @@ -746,6 +746,8 @@ WHERE provider = 'oidc1'

======

For more information about auth providers, see xref:authentication-authorization/auth-providers.adoc[User auth providers].

[[access-control-create-users]]
== Creating users

Expand Down
Loading