Skip to content

Commit 04a1eed

Browse files
authored
DOCSP-23785 auth writeblock (#69)
* DOCSP-23785 Blocks roles include into an admonition * DOCSP-23785 authaction links * DOCSP-23785 Adds roles to prem to prem connections * DOCSP-23785 Adds roles to prem to prem connections * DOCSP-23785 changes link for on-prem to Server Docs * DOCSP-23785 Fixes include * DOCSP-23785 Updates include * DOCSP-23785 Fixes per Joe * DOCSP-23785 Fixes per Joe * DOCSP-23785 Fixes per Joe * DOCSP-23785 Updates per Ali * DOCSP-23785 Updates per Ali * DOCSP-23785 Updates per Ali * DOCSP-23785 Updates per Ali
1 parent c0f74ff commit 04a1eed

File tree

5 files changed

+79
-13
lines changed

5 files changed

+79
-13
lines changed

source/connecting/onprem-to-onprem.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,11 @@ Authentication
2929

3030
.. include:: /includes/fact-onprem-auth
3131

32+
Roles
33+
-----
34+
35+
.. include:: /includes/fact-onprem-roles
36+
3237
Behavior
3338
--------
3439

source/includes/fact-atlas-roles.rst

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
1-
The user specified in the connection string must have the
1+
The user specified in the connection string must have, at a minimum, the
22
:atlasrole:`atlasAdmin` role.
33

4-
To use ``mongosync`` in the :ref:`reverse direction <c2c-api-reverse>`,
5-
you must `create a custom role
6-
</atlas/reference/api/custom-roles-create-a-role/>`__ that grants the
7-
following ActionTypes:
4+
.. note::
85

9-
- setUserWriteBlockMode
10-
- bypassWriteBlockingMode
11-
12-
The ``setUserWriteBlockMode`` and ``bypassWriteBlockingMode``
13-
ActionTypes are available starting in MongoDB 6.0. To create the custom
14-
roles, all clusters in a project must be on MongoDB 6.0 or higher.
6+
To use ``mongosync`` in the :ref:`reverse direction <c2c-api-reverse>`,
7+
you must :atlas:`create a custum role
8+
</reference/api/custom-roles-create-a-role>` that grants the
9+
following ActionTypes:
10+
11+
- :authaction:`setUserWriteBlockMode`
12+
- :authaction:`bypassWriteBlockingMode`
13+
14+
The ``setUserWriteBlockMode`` and ``bypassWriteBlockingMode``
15+
ActionTypes are available starting in MongoDB 6.0. To create the custom
16+
roles, all clusters in a project must be on MongoDB 6.0 or higher.
1517

source/includes/fact-onprem-roles.rst

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
2+
The user specified in the connection string must have, at a minimum, the
3+
:authrole:`readAnyDatabase`, :authrole:`clusterMonitor`, and
4+
:authrole:`backup` roles.
5+
6+
.. note::
7+
8+
To use ``mongosync`` in the :ref:`reverse direction <c2c-api-reverse>`,
9+
you must create a custom role (using the :dbcommand:`createRole` command)
10+
that grants the following ActionTypes:
11+
12+
- :authaction:`setUserWriteBlockMode`
13+
- :authaction:`bypassWriteBlockingMode`
14+
15+
The ``setUserWriteBlockMode`` and ``bypassWriteBlockingMode``
16+
ActionTypes are available starting in MongoDB 6.0. To create the custom
17+
roles, all clusters in a project must be on MongoDB 6.0 or higher.
Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
11
To set ``enableUserWriteBlocking``, the ``mongosync`` user must have a
2-
role that includes the ``setUserWriteBlockMode`` and
3-
``bypassWriteBlockingMode`` ActionTypes.
2+
role that includes the :authaction:`setUserWriteBlockMode` and
3+
:authaction:`bypassWriteBlockingMode` ActionTypes.
4+
5+
.. note::
6+
7+
When using ``enableUserWriteBlocking``, writes are only blocked for users
8+
that do not have the :authaction:`bypassWriteBlockingMode` ActionType. Users
9+
who have this ActionType are able to perform writes.
10+
11+

source/reference/api/start.txt

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,45 @@ Starts the synchronization between a source and destination cluster.
2222
Requirements
2323
------------
2424

25+
State
26+
~~~~~
27+
2528
To use the ``start`` endpoint, ``mongosync`` must be in the ``IDLE``
2629
state.
2730

31+
User Write Blocking
32+
~~~~~~~~~~~~~~~~~~~
33+
2834
.. include:: /includes/fact-write-blocking-requirement.rst
35+
36+
To set a custom role for the ``mongosync`` user:
37+
38+
#. To create a custom role, use the :dbcommand:`createRole` command:
39+
40+
.. code-block:: javascript
41+
42+
db.adminCommand( {
43+
createRole: "reverseSync",
44+
privileges: [ {
45+
resource: { db: "", collection: "" },
46+
actions: [ "setUserWriteBlockMode", "bypassWriteBlockingMode" ]
47+
} ],
48+
roles: []
49+
} )
2950

51+
#. To grant the custom role to the ``mongosync`` user, use the :dbcommand:`grantRolesToUser` command:
52+
53+
.. code-block:: javascript
54+
55+
db.adminCommand( {
56+
grantRolesToUser: "mongosync-user",
57+
roles: [ { role: "reverseSync", db: "admin" } ]
58+
} )
59+
60+
Ensure that you use this configured ``mongosync`` user in the connection
61+
strings for the :setting:`cluster0` or :setting:`cluster1` settings when
62+
you start ``mongosync``.
63+
3064
Request
3165
-------
3266

0 commit comments

Comments
 (0)