Skip to content

Commit 7e0483d

Browse files
mungitoperritojeff-allen-mongo
authored andcommitted
DOCSP-16018 install guide for online audit
1 parent 293425d commit 7e0483d

11 files changed

+172
-31
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
Starting in MongoDB 5.0, audit configurations for :binary:`~bin.mongod`
2+
and :binary:`~bin.mongos` nodes can be configured at runtime. A group
3+
of these nodes can take part in a distributed audit configuration.
4+
5+
To include a node in a distributed audit configuration, update the
6+
node's configuration file as follows and restart the server.
7+
8+
.. list-table::
9+
:header-rows: 1
10+
11+
* - Parameter
12+
- Value
13+
* - :setting:`auditLog.runtimeConfiguration`
14+
- ``true``
15+
* - :setting:`auditLog.filter`
16+
- Unset
17+
* - :parameter:`auditAuthorizationSuccess`
18+
- Unset
19+
20+
The server logs an error and fails to start if:
21+
22+
- ``runtimeConfiguration`` is ``true`` and
23+
- either :setting:`auditLog.filter` or :parameter:`auditAuthorizationSuccess` is set.
24+
25+
To modify audit filters and the :parameter:`auditAuthorizationSuccess` parameter at
26+
runtime, see :dbcommand:`setAuditConfig`.
27+

source/includes/steps-5.0-downgrade-mongod.yaml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,21 @@ content: |
2626
:binary:`~bin.mongod` completes all pending operations,
2727
flushes all data to data files, and closes all data files.
2828
---
29+
title: "Update configuration files."
30+
level: 4
31+
ref: 5.0-downgrade-configuration-files
32+
content: |
33+
34+
Disable any configurable |newversion| features by updating the
35+
:binary:`~bin.mongod` instance's configuration file before
36+
restarting.
37+
---
2938
title: "Restart with the latest |oldversion| ``mongod`` instance."
3039
level: 4
3140
ref: 5.0-downgrade-restart-instance
3241
content: |
3342
3443
Replace the |newversion| binary with the downloaded |oldversion|
3544
:binary:`~bin.mongod` binary and restart.
36-
45+
3746
...

source/release-notes/5.0-compatibility.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -483,7 +483,8 @@ features include:
483483
- Creation of :ref:`time series collections
484484
<manual-timeseries-collection>` requires fCV set to 5.0+.
485485

486-
- Configuring Runtime Audit Filter Management requires fCV set to 5.0+.
486+
- :ref:`Configuring Runtime Audit Filter Management
487+
<configure-audit-filters-at-runtime>` requires fCV set to 5.0+.
487488

488489
- Usage of ``.`` and ``$`` in field names requires fCV set to 5.0+.
489490

source/release-notes/5.0-downgrade-replica-set.txt

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -151,9 +151,33 @@ Time-series Collections
151151
<manual-timeseries-collection>`.
152152

153153
Runtime Audit Filter Management
154-
Disable runtime audit filter management by setting the
155-
``auditLog.runtimeConfiguration`` configuration file setting to
156-
``false``.
154+
155+
- Reset the defaults on the :term:`primary` server in the group with
156+
``db.admin.runCommand``. The primary should be the last
157+
configuration server in the group to be updated.
158+
159+
.. code-block:: javascript
160+
161+
db.admin.runCommand(
162+
{
163+
setAuditConfig: 1,
164+
filter: {},
165+
auditAuthorizationSuccess: false
166+
}
167+
)
168+
169+
The configuration document can also be removed after downgrade:
170+
171+
.. code-block:: javascript
172+
173+
config.settings.remove({_id: 'audit'});
174+
175+
- Disable Runtime Audit Filter Management on each node by setting
176+
``auditLog.runtimeConfiguration`` to ``false`` in the node's
177+
configuration file.
178+
179+
- Update the audit filters for this instance in the local
180+
configuration file.
157181

158182
.. |binary| replace:: any replica set member
159183

source/release-notes/5.0-downgrade-sharded-cluster.txt

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -179,9 +179,12 @@ Time-series Collections
179179
<manual-timeseries-collection>`.
180180

181181
Runtime Audit Filter Management
182-
Disable runtime audit filter management by setting the
183-
``auditLog.runtimeConfiguration`` configuration file setting to
184-
``false``.
182+
- Disable Runtime Audit Filter Management by setting
183+
``auditLog.runtimeConfiguration`` to ``false`` in the node's
184+
configuration file.
185+
186+
- Update the audit filters for this :binary:`~bin.mongod` or
187+
:binary:`~bin.mongos` instance in the local configuration file.
185188

186189
7. Remove |newversion| Features
187190
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

source/release-notes/5.0-downgrade-standalone.txt

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,12 @@ Time-series Collections
107107
<manual-timeseries-collection>`.
108108

109109
Runtime Audit Filter Management
110-
Disable runtime audit filter management by setting the
111-
``auditLog.runtimeConfiguration`` configuration file setting to
112-
``false``.
110+
- Disable Runtime Audit Filter Management by setting
111+
``auditLog.runtimeConfiguration`` to ``false`` in the node's
112+
configuration file.
113+
114+
- Update the audit filters for this instance in the local
115+
configuration file.
113116

114117
.. |binary| replace:: the :binary:`~bin.mongod` instance
115118

@@ -132,3 +135,4 @@ Procedure
132135
prerequisites have been completed.
133136

134137
.. include:: /includes/steps/5.0-downgrade-mongod.rst
138+

source/release-notes/5.0-upgrade-replica-set.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ All Members Version
3535
All replica set members must be running version |oldversion|. To
3636
upgrade a replica set from an |olderseries| and earlier, *first*
3737
:doc:`upgrade all members of the replica set to the latest
38-
4.2-series release </release-notes/4.2-upgrade-replica-set>`, and
38+
5.0-series release </release-notes/5.0-upgrade-replica-set>`, and
3939
then follow the procedure to upgrade from MongoDB |oldversion| to
4040
|newversion|.
4141

source/release-notes/5.0.txt

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,11 @@ See :ref:`lookup-uncorrelated-subquery`.
242242
Auditing
243243
--------
244244

245-
MongDB 5.0 adds the ability to configure auditing filters at runtime.
245+
Runtime Audit Filter Configuration
246+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
247+
248+
MongoDB 5.0 adds the ability to :ref:`configure auditing filters
249+
<configure-audit-filters-at-runtime>` at runtime.
246250

247251
.. list-table::
248252
:header-rows: 1
@@ -262,6 +266,9 @@ MongDB 5.0 adds the ability to configure auditing filters at runtime.
262266
- Sets new audit configurations for :binary:`~bin.mongod` and
263267
:binary:`~bin.mongos` instances at runtime.
264268

269+
General Auditing Updates
270+
~~~~~~~~~~~~~~~~~~~~~~~~
271+
265272
Starting in MongoDB 5.0:
266273

267274
- :ref:`System event auditing <audit-message-format>` has:

source/tutorial/configure-audit-filters.txt

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -39,18 +39,7 @@ configured to allow
3939
Filter Configuration at Runtime
4040
-------------------------------
4141

42-
Starting in MongDB 5.0, a :binary:`~bin.mongod` or
43-
:binary:`~bin.mongos` instance can be part of a distributed audit
44-
configuration. Audit filters on these nodes can be configured at
45-
runtime using the :dbcommand:`setAuditConfig` command. A node will be
46-
included in the distributed audit configuration if:
47-
48-
- :setting:`auditLog.runtimeConfiguration` is ``true``,
49-
- :setting:`auditLog.filter` is not set, and
50-
- :parameter:`auditAuthorizationSuccess` is not set
51-
52-
When ``runtimeConfiguration`` is ``true``, the server will log an error
53-
and fail to start if either one of the other variables is set.
42+
.. include:: /includes/fact-enable-runtime-audit-configuration.rst
5443

5544
.. _configure-audit-filters-at-startup:
5645

source/tutorial/configure-auditing.txt

Lines changed: 74 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -228,16 +228,87 @@ You may also specify these options in the :doc:`configuration file
228228
format: BSON
229229
path: data/db/auditLog.bson
230230

231-
To view the contents of the file, pass the file to the MongoDB utility
232-
:binary:`~bin.bsondump`. For example, the following converts the audit log
233-
into a human-readable form and output to the terminal:
231+
The following example converts the audit log into readable form using
232+
:binary:`~bin.bsondump` and outputs the result:
234233

235234
.. code-block:: bash
236235

237236
bsondump data/db/auditLog.bson
238237

238+
.. _runtime-audit-configuration:
239+
240+
Runtime Audit Filter Management
241+
-------------------------------
242+
243+
Starting in MongoDB 5.0, audit filters can be configured at runtime.
244+
Runtime Audit Filter Management provides three benefits compared to
245+
audit filter configurations that are specified in a local
246+
:binary:`~bin.mongod` or :binary:`~bin.mongos` configuration file:
247+
248+
- :ref:`rafm-separation`
249+
- :ref:`rafm-configurability`
250+
- :ref:`rafm-consistency`
251+
252+
.. _rafm-separation:
253+
254+
Separation of Concerns
255+
~~~~~~~~~~~~~~~~~~~~~~
256+
257+
Prior to MongoDB 5.0, anyone auditing a MongoDB :binary:`~bin.mongod`
258+
or :binary:`~bin.mongos` instance had to have write access to the host
259+
server's file system in order to update audit filters. Runtime Audit
260+
Filter Management improves security by separating audit access from
261+
administrative access.
262+
263+
Using Runtime Audit Filter Management instead of editing configuration
264+
files directly means:
265+
266+
- File system access is not required so an auditor does not need access
267+
to the :binary:`~bin.mongod` or :binary:`~bin.mongos` host server.
268+
269+
- There is no direct access to the :binary:`~bin.mongod` or
270+
:binary:`~bin.mongos` instance's configuration file.
271+
272+
- Runtime Audit Filter Management only exposes :ref:`audit filters
273+
<audit-filter>` and the :parameter:`auditAuthorizationSuccess`
274+
parameter.
275+
276+
.. _rafm-configurability:
277+
278+
Runtime Configurability
279+
~~~~~~~~~~~~~~~~~~~~~~~
280+
281+
Starting in MongoDB 5.0, when Runtime Audit Filter Management is
282+
enabled, auditing can be reconfigured at runtime without restarting the
283+
:binary:`~bin.mongod` or :binary:`~bin.mongos` instance. A statically
284+
configured instance has to be restarted to update its audit settings.
285+
286+
Audit filter modifications made at runtime persist when an instance is
287+
shutdown and restarted.
288+
289+
.. _rafm-consistency:
290+
291+
Consistency
292+
~~~~~~~~~~~
293+
294+
Within a cluster, if all participating :binary:`~bin.mongod` and
295+
:binary:`~bin.mongos` nodes are configured to use Runtime Audit Filter
296+
Management, then every node will use the same audit filters. In
297+
contrast, if each node has its own locally configured audit filters,
298+
there is no guarantee of audit filter consistency across nodes.
299+
300+
.. _rafm-enable:
301+
302+
Enable Runtime Audit Filter Management
303+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
304+
305+
.. include:: /includes/fact-enable-runtime-audit-configuration.rst
306+
239307
.. seealso::
240308

241309
- :doc:`/tutorial/configure-audit-filters`
242310
- :doc:`/core/auditing`
243311
- :doc:`/reference/audit-message`
312+
- :dbcommand:`setAuditConfig`
313+
- :dbcommand:`getAuditConfig`
314+

source/tutorial/upgrade-revision.txt

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,8 @@ Follow this upgrade procedure:
9696
#. Upgrade sharded clusters, as described in
9797
:ref:`upgrade-sharded-cluster`.
9898

99-
#. Upgrade any standalone instances. See :ref:`upgrade-mongodb-instance`.
99+
#. Upgrade any standalone instances. See
100+
:ref:`upgrade-mongodb-instance`.
100101

101102
#. Upgrade any replica sets that are not part of a sharded cluster, as
102103
described in :ref:`upgrade-replica-set`.
@@ -106,8 +107,8 @@ Follow this upgrade procedure:
106107
Upgrade a MongoDB Instance
107108
--------------------------
108109

109-
To upgrade a :binary:`~bin.mongod` or :binary:`~bin.mongos` instance, use one
110-
of the following approaches:
110+
To upgrade a :binary:`~bin.mongod` or :binary:`~bin.mongos` instance,
111+
use one of these approaches:
111112

112113
- Upgrade the instance using the operating system's package management
113114
tool and the official MongoDB packages. This is the preferred
@@ -116,6 +117,9 @@ of the following approaches:
116117
- Upgrade the instance by replacing the existing binaries with new
117118
binaries. See :ref:`upgrade-replace-binaries`.
118119

120+
- Make any required configuration file changes before restarting the
121+
instance.
122+
119123
.. _upgrade-replace-binaries:
120124

121125
Replace the Existing Binaries
@@ -140,6 +144,8 @@ replacing the existing binaries:
140144

141145
#. Replace the existing MongoDB binaries with the downloaded binaries.
142146

147+
#. Make any required configuration file changes.
148+
143149
#. Restart the instance.
144150

145151
.. _`MongoDB Download Page`: https://www.mongodb.com/try/download/community?tck=docs_server

0 commit comments

Comments
 (0)