Skip to content

Commit 0b1fa78

Browse files
committed
Second round of MW feedback
1 parent 64784d7 commit 0b1fa78

File tree

2 files changed

+60
-46
lines changed

2 files changed

+60
-46
lines changed

source/security/auth-mechanisms/aws-iam.txt

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ AWS authentication process:
4545
The client and server use different usernames. The client uses the AWS access key ID,
4646
but the server uses the ARN of the IAM user or role corresponding to the access key ID.
4747

48-
AWS credentials are include the following components:
48+
AWS credentials include the following components:
4949

5050
- Access key ID
5151
- Secret access key
@@ -65,12 +65,12 @@ uses all three components.
6565

6666
Temporary credentials are used with:
6767

68-
- STS `Assume Role <https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use_switch-role-api.html>`_
68+
- STS `Assume Role <https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use_switch-role-api.html>`__
6969
requests.
70-
- `EC2 instance roles <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/iam-roles-for-amazon-ec2.html>`_.
71-
- `ECS task roles <https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-iam-roles.html>`_.
72-
- `AWS Lambda environment <https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html>`_.
73-
- `IAM roles for service accounts <https://docs.aws.amazon.com/eks/latest/userguide/iam-roles-for-service-accounts.html>`_.
70+
- `EC2 instance roles <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/iam-roles-for-amazon-ec2.html>`__.
71+
- `ECS task roles <https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-iam-roles.html>`__.
72+
- `AWS Lambda environment <https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html>`__.
73+
- `IAM roles for service accounts <https://docs.aws.amazon.com/eks/latest/userguide/iam-roles-for-service-accounts.html>`__.
7474

7575
Code Placeholders
7676
~~~~~~~~~~~~~~~~~
@@ -119,7 +119,7 @@ see the corresponding syntax:
119119

120120
.. note::
121121

122-
If you provide credentiasl in a URI, you must percent-encode them.
122+
If you provide credentials in a URI, you must percent-encode them.
123123

124124
Providing Temporary Credentials
125125
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -211,21 +211,21 @@ the specified order:
211211

212212
.. important::
213213

214-
A credentials source must provide a complete
215-
set of credentials. For example, if your application uses the ``AWS_ACCESS_KEY_ID``
216-
and ``AWS_SECRET_ACCESS_KEY`` environment variables, the driver raises an error if only
217-
one of these variables has a value.
214+
A credentials source must provide a complete
215+
set of credentials. For example, if your application uses the ``AWS_ACCESS_KEY_ID``
216+
and ``AWS_SECRET_ACCESS_KEY`` environment variables, the driver raises an error if only
217+
one of these variables has a value.
218218

219219
.. note::
220220

221-
If an application runs in an ECS container on an EC2 instance and
222-
the container is allowed access to the instance metadata,
223-
the driver attempts to retrieve AWS credentials from the EC2 instance metadata endpoint.
224-
If the driver retrieves credentials in this way, your application can authenticate as the IAM
225-
role assigned to the EC2 instance.
221+
If an application runs in an ECS container on an EC2 instance and
222+
the container is allowed access to the instance metadata,
223+
the driver attempts to retrieve AWS credentials from the EC2 instance metadata endpoint.
224+
If the driver retrieves credentials in this way, your application can authenticate as the IAM
225+
role assigned to the EC2 instance.
226226

227-
To learn how to prevent containers from accessing EC2 instance metadata,
228-
see the `AWS documentation <https://aws.amazon.com/premiumsupport/knowledge-center/ecs-container-ec2-metadata>`__.
227+
To learn how to prevent containers from accessing EC2 instance metadata,
228+
see the `AWS documentation <https://aws.amazon.com/premiumsupport/knowledge-center/ecs-container-ec2-metadata>`__.
229229

230230
API Documentation
231231
-----------------

source/security/auth-mechanisms/kerberos.txt

Lines changed: 42 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -42,49 +42,63 @@ To use the code examples on this page, replace these placeholders with your own
4242
Using GSSAPI Authentication in Your Application
4343
-----------------------------------------------
4444

45-
To configure the MongoDB server to use Kerberos, see the
46-
:manual:`server Kerberos documentation
45+
To configure {+mdb-server+} to use Kerberos, see the
46+
:manual:`{+mdb-server+} Kerberos documentation
4747
</tutorial/control-access-to-mongodb-with-kerberos-authentication/>`.
4848

49-
To use the Kerberos authentication mechanism with the Ruby MongoDB driver,
49+
To use the Kerberos authentication mechanism with the {+driver-short+},
5050
you must install and load the `mongo_kerberos <https://rubygems.org/gems/mongo_kerberos>`__
5151
library. To do so, add the following lines to your ``Gemfile``:
5252

5353
.. code-block:: ruby
5454

55-
gem 'mongo', '~> 2'
56-
gem 'mongo_kerberos', '~> 2'
55+
gem 'mongo', '~> 2'
56+
gem 'mongo_kerberos', '~> 2'
5757

5858
Then, add the following lines to your application code:
5959

6060
.. code-block:: ruby
6161

62-
require 'mongo'
63-
require 'mongo_kerberos'
64-
65-
If using Kerberos authentication with **MRI**, you must establish a Kerberos
66-
session to the driver. This session is used by the driver to prove the user's identity to
67-
the server. You must ensure that the host system is
68-
configured for Kerberos authentication. To learn more about configuring the host system
69-
to use Kerberos, see the `Kerberos documentation
70-
<https://web.mit.edu/kerberos/krb5-latest/doc/admin/install_clients.html>`__
71-
or your operating system documentation for details. Use the `kinit utility
72-
<https://web.mit.edu/kerberos/krb5-latest/doc/user/user_commands/kinit.html>`__
62+
require 'mongo'
63+
require 'mongo_kerberos'
64+
65+
.. note::
66+
67+
When using Kerberos authentication, you must specify the fully qualified domain name
68+
(FQDN) of the host.
69+
70+
The following sections describe how to use Kerberos authentication with Ruby MRI and
71+
JRuby.
72+
73+
Using Kerberos Authentication with Ruby MRI
74+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
75+
76+
If you're using Kerberos authentication with **Ruby MRI**, you must perform the following
77+
steps:
78+
79+
- Establish a Kerberos session on the driver. The driver uses this session to prove the user's identity to
80+
the server.
81+
82+
- You must ensure that the host system is
83+
configured for Kerberos authentication. To learn more about configuring the host system
84+
to use Kerberos, see the `Kerberos documentation <https://web.mit.edu/kerberos/krb5-latest/doc/admin/install_clients.html>`__
85+
or your operating system documentation for details.
86+
87+
Use the `kinit utility <https://web.mit.edu/kerberos/krb5-latest/doc/user/user_commands/kinit.html>`__
7388
to establish a Kerberos session.
7489

75-
If using Kerberos authentication with **JRuby**, you can externally establish the Kerberos
76-
session to the driver using the process described above for MRI. Alternatively, you can directly
77-
provide the password to the driver by using client configuration. You can also provide the
90+
Using Kerberos Authentication with JRuby
91+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
92+
93+
If you're using Kerberos authentication with **JRuby**, you can externally establish the Kerberos
94+
session to the driver by using the process described above for MRI. You can also provide the
7895
path to a keytab file by storing the configuration in the ``java.security.auth.login.config`` system property.
79-
If using JRuby, you must configure the Java Runtime Environment to use Kerberos. To learn more, see the
80-
`MongoDB Java Driver Kerberos documentation
81-
<https://mongodb.github.io/mongo-java-driver/4.0/driver/tutorials/authentication/#gssapi>`_
96+
You must also configure the Java Runtime Environment to use Kerberos. To learn more, see the
97+
:driver:`MongoDB Java Driver Kerberos documentation </java/sync/current/fundamentals/enterprise-auth/#kerberos--gssapi->`
8298
for more information.
8399

84-
.. note::
85-
86-
Per the server Kerberos documentation, you must specify the FQDN of the host
87-
running MongoDB when using Kerberos authentication.
100+
Kerberos Authentication Example
101+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
88102

89103
Select the :guilabel:`Connection String` or :guilabel:`Client Options` tab to
90104
see the corresponding syntax for connecting to MongoDB with Kerberos authentication:
@@ -111,8 +125,8 @@ see the corresponding syntax for connecting to MongoDB with Kerberos authenticat
111125

112126
.. note::
113127

114-
If you use a connection string to connect to MongoDB, ensure that you to percent-encode any
115-
special characters that appear in the username.
128+
If you use a connection string to connect to MongoDB, ensure that you percent-encode any
129+
special characters that appear in the username.
116130

117131
API Documentation
118132
-----------------

0 commit comments

Comments
 (0)