You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: modules/ROOT/pages/database-administration/aliases/manage-aliases-standard-databases.adoc
+43-8Lines changed: 43 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -379,18 +379,23 @@ SHOW ALIAS `northwind-2022` FOR DATABASE YIELD name, properties
379
379
[[alias-management-create-remote-database-alias]]
380
380
=== Create database aliases for remote databases
381
381
382
-
A database alias can target a remote database by providing an URL and the credentials of a user on the remote Neo4j DBMS.
382
+
A database alias can target a remote database by providing a URL and the credentials of a user on the remote Neo4j DBMS.
383
383
See xref:database-administration/aliases/remote-database-alias-configuration.adoc[] for the necessary configurations.
384
384
385
385
Since remote database aliases target databases that are not in this DBMS, they do not fetch the default Cypher version from their target like the local database aliases.
386
386
Instead, they are assigned the version given by xref:configuration/configuration-settings.adoc#config_db.query.default_language[`db.query.default_language`], which is set in the `neo4j.conf` file.
387
387
Alternatively, you can specify the version in the `CREATE ALIAS` or `ALTER ALIAS` commands.
388
388
See xref:database-administration/aliases/manage-aliases-standard-databases.adoc#set-default-language-for-remote-database-aliases[] and xref:database-administration/aliases/manage-aliases-standard-databases.adoc#alter-default-language-remote-database-alias[] for more information.
389
389
390
+
When creating a remote database alias, the credentials used to target to the remote DBMS need to be specified. This can be done by providing the credentials of a native user, or
391
+
by forwarding the OIDC credentials of the user logged in to the local DBMS.
392
+
393
+
To use the credentials of a native user on the remote DBMS, `USER` and `PASSWORD` need to be set when creating the alias.
394
+
390
395
.Query
391
396
[source, cypher]
392
397
----
393
-
CREATE ALIAS `remote-northwind` FOR DATABASE `northwind-graph-2020`
398
+
CREATE ALIAS `remote-northwind-stored-credentials` FOR DATABASE `northwind-graph-2020`
394
399
AT "neo4j+s://location:7687"
395
400
USER alice
396
401
PASSWORD 'example_secret'
@@ -401,20 +406,50 @@ To view the remote database alias details, use the `SHOW ALIASES FOR DATABASE` c
The `OIDC CREDENTIAL FORWARDING` clause is used to configure a remote database alias to use the logged-in user's OIDC credentials to authenticate to the remote DBMS.
424
+
425
+
.Query
426
+
[source, cypher]
427
+
----
428
+
CREATE ALIAS `remote-northwind-oidc-credential-forwarding` FOR DATABASE `northwind-graph-2020`
429
+
AT "neo4j+s://location:7687"
430
+
OIDC CREDENTIAL FORWARDING
431
+
----
432
+
433
+
Since the alias use the credentials of the logged-in user when targeting the remote DBMS, there are no stored credentials and user will be `NULL`.
434
+
435
+
.Query
436
+
[source, cypher]
437
+
----
438
+
SHOW ALIAS `remote-northwind-oidc-credential-forwarding`
You can also use `IF EXISTS` or `OR REPLACE` when creating remote database aliases.
419
454
It works the same way as described in the <<_use_if_exists_or_or_replace_when_creating_database_aliases, Use `IF EXISTS` or `OR REPLACE` when creating database aliases>> section.
420
455
Both check for any remote or local database aliases (with `IF NOT EXISTS` also checking for databases).
Copy file name to clipboardExpand all lines: modules/ROOT/pages/database-administration/aliases/remote-database-alias-configuration.adoc
+67-10Lines changed: 67 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,39 +14,41 @@ The following steps describe the setup required to define a remote database alia
14
14
They are also useful should there be any changes in the name of the databases or the location of standalone servers and cluster instances.
15
15
Additionally, you will also find information here on best practices and additional guidance on any changes in the configuration.
16
16
17
-
== Setup example
18
-
19
-
In this example, _Alice_ is an administrator and _Carol_ is a user who needs access to a database managed by _Bob_:
20
-
21
-
image::remote-alias-overview.svg[title="Overview of the required remote database alias setup", role="middle"]
22
-
23
17
A remote alias defines:
24
18
25
19
* Which user of the remote **DBMS B** is used.
26
20
* Where the remote database is located.
27
21
* How to connect to the remote database using driver settings.
28
22
23
+
When creating the remote database alias, it can either be configured to store the credentials of a single user on the remote **DBMS B**, or to pass on the bearer authentication token from the user who issues the query.
24
+
25
+
== Setup example with stored native credentials
26
+
27
+
In this example, _Alice_ is an administrator and _Carol_ is a user who needs access to a database managed by _Bob_:
28
+
29
+
image::remote-alias-overview.svg[title="Overview of the required remote database alias setup when using stored credentials", role="middle"]
30
+
31
+
29
32
[NOTE]
30
33
====
31
34
A remote database alias is only accessible to users with appropriate privileges.
32
35
In the example above, _Bob_ is the administrator responsible for deciding which databases (`Db1` or `Db2`) the remote aliases can write and/or read.
33
36
Meanwhile, _Alice_ is the administrator that assigns who has access to the privileges set by _Bob_.
34
37
In the example, _Alice_ will assign that access to _Carol_.
35
38
36
-
See lxref:authentication-authorization/dbms-administration.adoc[DBMS privileges] for more information.
39
+
See xref:authentication-authorization/dbms-administration.adoc[DBMS privileges] for more information.
37
40
====
38
41
39
42
_Carol_ can use her own regular credentials to access the remote database `Db1` in DBMS after _Alice_ assigns this privilege to her user profile.
40
43
This configuration will also allow _Carol_ to access `Db2` in **DBMS B**.
41
44
If the administrators decide this should not be the case, then _Bob_ must define the appropriate privileges (see xref:authentication-authorization/index.adoc[Authentication and authorization] for further information).
42
45
43
-
== Configure a remote DBMS (_Bob_)
46
+
=== Configure a remote DBMS (_Bob_)
44
47
45
48
In the suggested example, there are two administrators: _Alice_ and _Bob_.
46
49
_Bob_ is the administrator responsible for the setup of the remote DBMS, which includes the following steps:
47
50
48
51
. Create the user profile to share with _Alice_.
49
-
Currently, only user and password-based authentication (e.g. native authentication) are supported.
50
52
. Define the permissions for the user. If you don’t want this user to access `Db2`, here is where you set it.
51
53
. Securely transmit the credentials to _Alice_, setting up the link to database `Db1`.
52
54
It is recommended to create a custom role to track all users shared on a remote connection, so that they remain trackable.
@@ -79,7 +81,7 @@ server.bolt.tls_level=REQUIRED
79
81
----
80
82
81
83
[[remote-alias-config-DBMS_admin-A]]
82
-
== Configure a DBMS with a remote database alias (_Alice_)
84
+
=== Configure a DBMS with a remote database alias (_Alice_)
83
85
84
86
As _Alice_, you need to generate an encryption key.
85
87
In this case, the credentials of a user of **DBMS B** are reversibly encrypted and stored in the system database of **DBMS A**.
@@ -145,6 +147,61 @@ chmod 640 conf/neo4j.conf
145
147
bin/neo4j start --expand-commands
146
148
----
147
149
150
+
== Setup example with OIDC credential forwarding
151
+
152
+
In order to use OIDC credential forwarding, both *DBMS A* and *DBMS B* need to support the same OIDC identity provider, see the xref:authentication-authorization/sso-integration.adoc[SSO integration] on how to enable OIDC.
153
+
154
+
In this example, _Alice_ is an administrator and _Carol_ is a user who needs access to a database managed by _Bob_:
155
+
156
+
In the example above, _Carol_ logs in to *DBMS A* through an OIDC compliant identity provider by offering a token from the provider.
157
+
The token is used to set the username and determine the identity provider groups of the user.
158
+
_Alice_ is the admin of *DBMS A* and has set up SSO for the identity provider and configured the mapping of the identity provider groups to the Neo4j built-in roles and custom roles, such that _Carol_ can use the remote database alias to connect to the remote database `Db1`.
159
+
Additionally, _Bob_ needs to configure the *DBMS B* to support SSO with the same identity provider used by _Carol_ to log in to *DBMS A*. _Bob_ also needs to configure the mapping of the identity provider groups to the Neo4j built-in roles and custom roles such that the _Carol's_ identity provider groups gives the appropriate privileges to access `Db1` on the *DBMS B*.
160
+
161
+
162
+
[CAUTION]
163
+
====
164
+
While it is permitted to use different OIDC configurations across distinct DBMS instances (e.g., local vs. target), users must be aware of the resulting privilege disparity.
165
+
A user's effective permissions are not dictated by the identity provider groups alone, but by the mapping of those groups to the roles defined within each specific Neo4j DBMS, see xref:authentication-authorization/sso-integration.adoc#auth-sso-map-idp-roles[Map the identity provider groups to the Neo4j roles].
166
+
Crucially, if the OIDC configuration settings differ between the local DBMS and the target DBMS, the user will have different effective privileges on those systems.
167
+
This configuration independence can lead to privilege inconsistency (e.g., over-privileging or unexpected access denial).
168
+
====
169
+
170
+
=== Configure a remote DBMS (_Bob_)
171
+
172
+
173
+
In the suggested example, there are two administrators: _Alice_ and _Bob_.
174
+
_Bob_ is the administrator responsible for the setup of the remote DBMS, which includes the following steps:
175
+
176
+
. Set up SSO and support for the identity provider.
177
+
. Map the identity provider groups to the Neo4j roles. If you don’t want specific users to access `Db2`, here is where you set it.
178
+
179
+
Additionally, _Bob_ must do the required setup for the link:https://neo4j.com/docs/operations-manual/current/security/ssl-framework/[SSL framework] and check whether the database accepts a non-local connection if required.
0 commit comments