Skip to content

Commit 2b8d9e7

Browse files
authored
DOCSP-23785 auth writeblock (#69) (#76)
* 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 93d693a commit 2b8d9e7

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
@@ -28,6 +28,11 @@ Authentication
2828

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

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

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
@@ -21,11 +21,45 @@ Starts the synchronization between a source and destination cluster.
2121
Requirements
2222
------------
2323

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

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

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

0 commit comments

Comments
 (0)