Skip to content

CP/DP split: Secure connection #3244

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

Conversation

sjberman
Copy link
Collaborator

@sjberman sjberman commented Mar 18, 2025

Problem: We want to ensure that the connection between the control plane and data plane is authenticated and secure.

Solution:

  1. Configure agent to send the kubernetes service token in the request. The control plane validates this token using the TokenReview API to ensure the agent is authenticated.
  2. Configure TLS certificates for both the control and data planes. By default, a Job will run when installing NGF that creates self-signed certificates in the nginx-gateway namespace. The server Secret is mounted to the control plane, and the control plane copies the client Secret when deploying nginx resources. This Secret is mounted to the agent.

The control plane will reset the agent connection if it detects that its own certs have changed.

For production environments, we'll recommend a user configures TLS using cert-manager instead, for better security and certificate rotation.

Testing:

  • Verified that self-signed certificates are mounted properly and connection succeeds.
  • Verified that using cert-manager also works instead of the self-signed certificates.
  • Verified that token and cert rotation results in a new connection being created.

Closes #2843

Checklist

Before creating a PR, run through this checklist and mark each as complete.

  • I have read the CONTRIBUTING doc
  • I have added tests that prove my fix is effective or that my feature works
  • I have checked that all unit tests pass after adding my changes
  • I have updated necessary documentation
  • I have rebased my branch onto main
  • I will ensure my PR is targeting the main branch and pulling from my branch from my own fork

Release notes

If this PR introduces a change that affects users and needs to be mentioned in the release notes,
please add a brief note that summarizes the change.


@sjberman sjberman requested a review from a team as a code owner March 18, 2025 22:10
@github-actions github-actions bot added documentation Improvements or additions to documentation dependencies Pull requests that update a dependency file chore Pull requests for routine tasks helm-chart Relates to helm chart labels Mar 18, 2025
@sjberman sjberman force-pushed the chore/secure-connection branch from 16d7f79 to 0568422 Compare March 18, 2025 22:13
Copy link
Contributor

@bjee19 bjee19 left a comment

Choose a reason for hiding this comment

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

lgtm!

Problem: We want to ensure that the connection between the control plane and data plane is authenticated and secure.

Solution:

1. Configure agent to send the kubernetes service token in the request. The control plane validates this token using the TokenReview API to ensure the agent is authenticated.
2. Configure TLS certificates for both the control and data planes. By default, a Job will run when installing NGF that creates self-signed certificates in the nginx-gateway namespace. The server Secret is mounted to the control plane, and the control plane copies the client Secret when deploying nginx resources. This Secret is mounted to the agent.

The control plane will reset the agent connection if it detects that its own certs have changed.

For production environments, we'll recommend a user configures TLS using cert-manager instead, for better security and certificate rotation.
@sjberman sjberman force-pushed the chore/secure-connection branch from 0568422 to 7033bb1 Compare March 24, 2025 14:54
Copy link
Contributor

@salonichf5 salonichf5 left a comment

Choose a reason for hiding this comment

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

🚀

@sjberman sjberman merged commit f2bc918 into nginx:change/control-data-plane-split Mar 24, 2025
24 of 25 checks passed
@sjberman sjberman deleted the chore/secure-connection branch March 24, 2025 16:51
@github-project-automation github-project-automation bot moved this from 🆕 New to ✅ Done in NGINX Gateway Fabric Mar 24, 2025
sjberman added a commit that referenced this pull request Apr 23, 2025
Problem: We want to ensure that the connection between the control plane and data plane is authenticated and secure.

Solution:

1. Configure agent to send the kubernetes service token in the request. The control plane validates this token using the TokenReview API to ensure the agent is authenticated.
2. Configure TLS certificates for both the control and data planes. By default, a Job will run when installing NGF that creates self-signed certificates in the nginx-gateway namespace. The server Secret is mounted to the control plane, and the control plane copies the client Secret when deploying nginx resources. This Secret is mounted to the agent.

The control plane will reset the agent connection if it detects that its own certs have changed.

For production environments, we'll recommend a user configures TLS using cert-manager instead, for better security and certificate rotation.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore Pull requests for routine tasks dependencies Pull requests that update a dependency file documentation Improvements or additions to documentation helm-chart Relates to helm chart
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants