From 94d70025dd93234ec9b3173f859c2bdf9be446db Mon Sep 17 00:00:00 2001 From: Lindsey Moore Date: Fri, 28 Mar 2025 16:19:07 -0400 Subject: [PATCH 1/3] DOCSP-48592 Security Landing Page --- source/code-snippets/security/sample-app.js | 24 +++++++++++++++++++++ source/security.txt | 9 ++++++-- source/security/authentication/scram.txt | 8 +++++-- 3 files changed, 37 insertions(+), 4 deletions(-) create mode 100644 source/code-snippets/security/sample-app.js diff --git a/source/code-snippets/security/sample-app.js b/source/code-snippets/security/sample-app.js new file mode 100644 index 000000000..7dcc43781 --- /dev/null +++ b/source/code-snippets/security/sample-app.js @@ -0,0 +1,24 @@ +const { MongoClient } = require("mongodb"); + +// Replace the uri string with your connection string +const uri = ""; + +const client = new MongoClient(uri); + +async function run() { +try { + // start example code here + + // end example code here + + await client.connect(); + + // Ping the server to verify that the connection is successful + await client.db('admin').command({ ping: 1 }); + console.log("Connected successfully"); + +} finally { + await client.close(); +} +} +run().catch(console.dir); diff --git a/source/security.txt b/source/security.txt index ec4c2872c..c8c01149a 100644 --- a/source/security.txt +++ b/source/security.txt @@ -30,5 +30,10 @@ Security Overview -------- -MongoDB supports multiple mechanisms that you can use to authenticate your application. -This page contains code examples that show each of these mechanisms. \ No newline at end of file +Learn how to set up security and authentication for your application +in the following sections: + +- :ref:`Authentication ` +- :ref:`In-Use Encryption ` +- :ref:`TLS Security Protocol ` +- :ref:`SOCKS Proxy ` diff --git a/source/security/authentication/scram.txt b/source/security/authentication/scram.txt index d11fed75b..979374e6d 100644 --- a/source/security/authentication/scram.txt +++ b/source/security/authentication/scram.txt @@ -86,6 +86,8 @@ To learn more about the SCRAM version that MongoDB supports, see the :manual:`SCRAM ` section of the {+mdb-server+} manual. +.. _node-scram-sha-256: + SCRAM-SHA-256 ------------- @@ -109,8 +111,10 @@ following sample code. .. literalinclude:: /code-snippets/authentication/sha256.js :language: javascript -``SCRAM-SHA-1`` ---------------- +.. _node-scram-sha-1: + +SCRAM-SHA-1 +----------- .. note:: ``SCRAM-SHA-1`` is the default authentication method for MongoDB versions From a02eddb21402006a19651d35d078e0c430483525 Mon Sep 17 00:00:00 2001 From: Lindsey Moore Date: Fri, 28 Mar 2025 16:20:59 -0400 Subject: [PATCH 2/3] remove sample app --- source/code-snippets/security/sample-app.js | 24 --------------------- 1 file changed, 24 deletions(-) delete mode 100644 source/code-snippets/security/sample-app.js diff --git a/source/code-snippets/security/sample-app.js b/source/code-snippets/security/sample-app.js deleted file mode 100644 index 7dcc43781..000000000 --- a/source/code-snippets/security/sample-app.js +++ /dev/null @@ -1,24 +0,0 @@ -const { MongoClient } = require("mongodb"); - -// Replace the uri string with your connection string -const uri = ""; - -const client = new MongoClient(uri); - -async function run() { -try { - // start example code here - - // end example code here - - await client.connect(); - - // Ping the server to verify that the connection is successful - await client.db('admin').command({ ping: 1 }); - console.log("Connected successfully"); - -} finally { - await client.close(); -} -} -run().catch(console.dir); From 21256862620ed7433332f6c99653e882ffbf7cd0 Mon Sep 17 00:00:00 2001 From: Lindsey Moore Date: Fri, 28 Mar 2025 17:07:58 -0400 Subject: [PATCH 3/3] change title --- source/security.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source/security.txt b/source/security.txt index c8c01149a..ccd9ffa2b 100644 --- a/source/security.txt +++ b/source/security.txt @@ -1,8 +1,8 @@ .. _node-security: -========= -Security -========= +================ +Secure Your Data +================ .. contents:: On this page :local: