Skip to content
This repository was archived by the owner on May 1, 2025. It is now read-only.
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
3 changes: 2 additions & 1 deletion snooty.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ intersphinx = [ "https://www.mongodb.com/docs/atlas/objects.inv",

toc_landing_pages = ["/quickstart",
"/installation",
"/installation/verify",
"/reference",
"/connecting",
"/topologies",
Expand Down Expand Up @@ -53,4 +54,4 @@ targets = [
variant = "warning"
value = """\
MongoDB ``mongosync`` binaries are not supported or tested for use with non-genuine MongoDB deployments. While the tools may work on these deployments, compatibility is not guaranteed.
"""
"""
17 changes: 17 additions & 0 deletions source/includes/verification-gpg-results.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
If the key imports successfully, the command returns:

.. code-block:: sh
:copyable: false

gpg: key 3132835C1D925D5B: public key "MongoDB CLI Tools Release Signing Key <[email protected]>" imported
gpg: Total number processed: 1
gpg: imported: 1

If you have previously imported the key, the command returns:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[praise] thanks for considering this condition!


.. code-block:: sh
:copyable: false

gpg: key 3132835C1D925D5B: "MongoDB CLI Tools Release Signing Key <[email protected]>" not changed
gpg: Total number processed: 1
gpg: unchanged: 1
3 changes: 3 additions & 0 deletions source/includes/verify-signatures-before-you-begin.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
If you don't have ``mongosync`` installed, download the ``mongosync``
package from the `Download Center
<https://www.mongodb.com/try/download/relational-migrator?jmp=docs>`__.
4 changes: 4 additions & 0 deletions source/includes/verify-signatures-intro.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
The MongoDB release team digitally signs ``mongosync`` packages to
certify that the packages are a valid and unaltered MongoDB release.
Before you install ``mongosync``, you can use the digital signature to
validate the package.
1 change: 1 addition & 0 deletions source/installation.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,4 @@ These documents provide instructions to install {+c2c-full-product-name+}.

Linux </installation/install-on-linux>
macOS </installation/install-on-macos>
Verify Packages </installation/verify>
33 changes: 33 additions & 0 deletions source/installation/verify.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
.. _c2c-verify-signature:

======================================
Verify Integrity of mongosync Packages
======================================

.. contents:: On this page
:local:
:backlinks: none
:depth: 1
:class: singlecol

.. facet::
:name: genre
:values: tutorial

.. include:: /includes/verify-signatures-intro.rst

To learn how to verify ``mongosync`` packages, see the corresponding
page for your verification method:

- :ref:`c2c-verify-signatures-macos`

- :ref:`c2c-verify-signatures-gpg`

- :ref:`c2c-verify-signatures-rpm`

.. toctree::
:titlesonly:

macOS </installation/verify/macos>
Linux </installation/verify/gpg>
RHEL </installation/verify/rpm>
89 changes: 89 additions & 0 deletions source/installation/verify/gpg.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
.. _c2c-verify-signatures-gpg:

================================
Verify Packages with GPG (Linux)
================================

.. contents:: On this page
:local:
:backlinks: none
:depth: 1
:class: singlecol

.. facet::
:name: genre
:values: tutorial

.. include:: /includes/verify-signatures-intro.rst

This page describes how to use GPG to verify Linux packages.

Before you Begin
----------------

.. include:: /includes/verify-signatures-before-you-begin.rst

Steps
-----

.. procedure::
:style: normal

.. step:: Import the MongoDB Server Tools public key

.. code-block:: sh

curl https://pgp.mongodb.com/server-Tools.asc | gpg --import

.. include:: /includes/verification-gpg-results.rst

.. step:: Download the mongosync public signature

To download the ``mongosync`` public signature, run the following
command, replacing the placeholder values with your platform,
architecture, and ``mongosync`` version:

.. code-block:: sh

curl -LO https://s3.amazonaws.com/downloads.mongodb.org/tools/mongosync/mongosync-<platform>-<architecture>-<version>.tgz.sig

.. example::

The following URL contains the signature file for ``mongosync``
on Amazon Linux 2, version {+latest-version+}:

``https://s3.amazonaws.com/downloads.mongodb.org/tools/mongosync/mongosync-amazon2-x86_64-{+latest-version+}.tgz.sig``

.. step:: Verify the package

.. code-block:: sh

gpg --verify <path_to_signature_file> <path_to_mongosync_package>

If the package is signed by MongoDB, the command returns:

.. code-block:: sh
:copyable: false

gpg: Signature made Wed 19 Feb 2025 02:19:15 PM EST
gpg: using RSA key D4E45C292A5C94962F0D10E13132835C1D925D5B
gpg: Good signature from "MongoDB CLI Tools Release Signing Key <[email protected]>" [unknown]

If the package is signed but the signing key is not added to your
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[question] What would cause the signing key to not be added to the local trustdb? Is there a case where users import the MDB Server Tools public key and it gets imported elsewhere?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Marking a key as trusted is a manual action that the person running gpg needs to take. By default, no keys are trusted. How would someone decide whether to trust a particular key? Uh .... you're supposed to meet up with people in person and verify their credentials and have them hand you their key. Seriously!

This is one reason why gpg is not a good choice for this sort signature verification. Long-term, I'd love to see MongoDB move to a different key system that has a better story around trust and verification. The sistore project looks promising, as does GitHub Attestations.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahh gotcha! Wasn't super familiar with verification and whatnot, so this is helpful to know!

local ``trustdb``, the command returns:

.. code-block:: sh
:copyable: false

gpg: WARNING: This key is not certified with a trusted signature!
gpg: There is no indication that the signature belongs to the owner.

If the package is not properly signed, the command returns an
error message:

.. code-block:: sh
:copyable: false

gpg: Signature made Wed 19 Feb 2025 02:19:15 PM EST
gpg: using RSA key D4E45C292A5C94962F0D10E13132835C1D925D5B
gpg: BAD signature from "MongoDB CLI Tools Release Signing Key <[email protected]>" [unknown]
45 changes: 45 additions & 0 deletions source/installation/verify/macos.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
.. _c2c-verify-signatures-macos:

================================
Verify mongosync Binary on macOS
================================

.. contents:: On this page
:local:
:backlinks: none
:depth: 1
:class: singlecol

.. facet::
:name: genre
:values: tutorial

.. include:: /includes/verify-signatures-intro.rst

The ``mongosync`` ``.zip`` download for macOS is notarized. This page
describes how to use ``codesign`` to verify the integrity of the
unzipped ``mongosync`` binary.

Before you Begin
----------------

.. include:: /includes/verify-signatures-before-you-begin.rst

Steps
-----

To verify the ``mongosync`` binary, run:

.. code-block:: sh

codesign -dv --verbose=4 <path_to_binary>

If the binary is signed by MongoDB, the output includes the following
information:

.. code-block:: sh
:copyable: false

Authority=Developer ID Application: MongoDB, Inc. (4XWMY46275)
Authority=Developer ID Certification Authority
Authority=Apple Root CA
54 changes: 54 additions & 0 deletions source/installation/verify/rpm.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
.. _c2c-verify-signatures-rpm:

==========================
Verify RPM Packages (RHEL)
==========================

.. contents:: On this page
:local:
:backlinks: none
:depth: 1
:class: singlecol

.. facet::
:name: genre
:values: tutorial

.. include:: /includes/verify-signatures-intro.rst

This page describes how to verify ``.rpm`` packages on RHEL operating
systems.

Before you Begin
----------------

.. include:: /includes/verify-signatures-before-you-begin.rst

Steps
-----

.. procedure::
:style: normal

.. step:: Import the MongoDB Server Tools public key in gpg and rpm

.. code-block:: sh

curl https://pgp.mongodb.com/server-Tools.asc | gpg --import

rpm --import https://pgp.mongodb.com/server-Tools.asc

.. include:: /includes/verification-gpg-results.rst

.. step:: Verify the rpm file

.. code-block:: sh

rpm --checksig <path_to_mongosync_rpm_file>

If the file is signed, the command returns:

.. code-block:: sh
:copyable: false

<path_to_mongosync_rpm_file> digests signatures OK