Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(DOCSP-32647): Added X509 procedure. #1415

Merged
merged 4 commits into from
Nov 7, 2023
Merged

Conversation

corryroot
Copy link
Contributor

@corryroot corryroot commented Oct 24, 2023

@mircea-cosbuc and @nammn, I added the steps to enable X.509 authentication.

JIRA

All Submissions:

  • Have you opened an Issue before filing this PR?
  • Have you signed our CLA?
  • Have you checked to ensure there aren't other open Pull Requests for the same update/change?
  • Put closes #XXXX in your comment to auto-close the issue that your PR fixes (if such).

```

1. To deploy the MongoDB Community Kubernetes Operator, copy and paste
the following command and replaces the `<namespace>` variable with the
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
the following command and replaces the `<namespace>` variable with the
the following command and replace the `<namespace>` variable with the

Copy link
Collaborator

Choose a reason for hiding this comment

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

why do we have this command 2 times here?


**Note:**

- For the `spec.security.tls.certificateKeySecretRef.name` parameter,
Copy link
Collaborator

Choose a reason for hiding this comment

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

You can also instead link to this doc explaining the structure and more:

certificateKeySecretRef:
description: CertificateKeySecret is a reference to a Secret
containing a private key and certificate to use for TLS.
The key and cert are expected to be PEM encoded and available
at "tls.key" and "tls.crt". This is the same format used
for the standard "kubernetes.io/tls" Secret type, but no
specific type is required. Alternatively, an entry tls.pem,
containing the concatenation of cert and key, can be provided.
If all of tls.pem, tls.crt and tls.key are present, the
tls.pem one needs to be equal to the concatenation of tls.crt
and tls.key

its a certificate that the server not generates but uses I think


**Example:**

```
Copy link
Collaborator

Choose a reason for hiding this comment

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

do we have an example we ccan link to instead? otherwise we will have 2 places to keep them up 2 date

@corryroot corryroot requested a review from nammn November 3, 2023 15:15
Copy link
Member

@mircea-cosbuc mircea-cosbuc left a comment

Choose a reason for hiding this comment

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

LGTM with one clarifying comment.

Operator with X.509 Authentication enabled for the MongoDB Agent and
client. To learn more, see [Install the Operator using Helm](https://github.com/mongodb/mongodb-kubernetes-operator/blob/master/docs/install-upgrade.md#install-the-operator-using-helm).

1. To deploy the MongoDB Community Kubernetes Operator, copy and paste
Copy link
Member

Choose a reason for hiding this comment

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

Since this command does a bit more than install the operator, I think it's worth mentioning here that this will deploy a sample resource with X509 enabled for both client and agent authentication and that it will also create a sample X509 user and the certificate the user can use to authenticate.

Copy link
Contributor

@sarahsimpers sarahsimpers left a comment

Choose a reason for hiding this comment

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

LGTM with a few small typo fixes

client.

1. To install the MongoDB Community Kubernetes Operator, see
[Install the Operator using kubectl](https://github.com/mongodb/mongodb-kubernetes-operator/blob/master/docs/install-upgrade.md#install-the-operator-using-kubectl)
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
[Install the Operator using kubectl](https://github.com/mongodb/mongodb-kubernetes-operator/blob/master/docs/install-upgrade.md#install-the-operator-using-kubectl)
[Install the Operator using kubectl](https://github.com/mongodb/mongodb-kubernetes-operator/blob/master/docs/install-upgrade.md#install-the-operator-using-kubectl).

[Install the Operator using kubectl](https://github.com/mongodb/mongodb-kubernetes-operator/blob/master/docs/install-upgrade.md#install-the-operator-using-kubectl)

1. To create a CA, ConfigMap, secrets, issuer, and certificate, see
[Enable External Access to a MongoDB Deployment](https://github.com/mongodb/mongodb-kubernetes-operator/blob/master/docs/external_access.md)
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
[Enable External Access to a MongoDB Deployment](https://github.com/mongodb/mongodb-kubernetes-operator/blob/master/docs/external_access.md)
[Enable External Access to a MongoDB Deployment](https://github.com/mongodb/mongodb-kubernetes-operator/blob/master/docs/external_access.md).

- For the `spec.security.tls.certificateKeySecretRef.name` parameter,
specify a reference to the secret that contains the private key and
certificate to use for TLS. The operator expects the PEM encoded key
and certidicate available at "tls.key" and "tls.crt". Use the same
Copy link
Contributor

Choose a reason for hiding this comment

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

Fix: typo

Suggested change
and certidicate available at "tls.key" and "tls.crt". Use the same
and certificate available at "tls.key" and "tls.crt". Use the same

```

1. Create a YAML file for the client certificate. For an example, see
[cert-x509.yaml](https://github.com/mongodb/mongodb-kubernetes-operator/blob/master/config/samples/external_access/certy_x509.yaml).
Copy link
Contributor

Choose a reason for hiding this comment

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

Fix: typo

Suggested change
[cert-x509.yaml](https://github.com/mongodb/mongodb-kubernetes-operator/blob/master/config/samples/external_access/certy_x509.yaml).
[cert-x509.yaml](https://github.com/mongodb/mongodb-kubernetes-operator/blob/master/config/samples/external_access/cert_x509.yaml).

Copy link
Member

@mircea-cosbuc mircea-cosbuc left a comment

Choose a reason for hiding this comment

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

LGTM

@corryroot corryroot enabled auto-merge (squash) November 7, 2023 13:49
@corryroot corryroot merged commit b5aae56 into mongodb:master Nov 7, 2023
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants