Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview:
The purpose of this document is to outline the design and implementation details for integrating Transport Layer Security (TLS) into the client-go and service-go components of our application. TLS integration aims to enhance the security of communication between the client and server components by encrypting data in transit and authenticating the identities of both parties.
Background:
Currently, the client-go component communicates with the service-go component using gRPC framework. The communication protocol is based on HTTP/2, which provides efficient multiplexed streams over a single TCP connection. gRPC allows the client to invoke remote procedures on the server as if they were local function calls, enabling seamless communication between distributed components.
Communication between client-go and service-go occurs over HTTP connections, using a JWT implementation. While that has some authentication mechanisms, it does not encrypt the data or protect against network-level attacks. While this setup is suitable for local development and testing, it poses significant security risks in production environments.
Design Goals:
Ensure secure communication between client and server components.
Protect sensitive data transmitted over the network.
Authenticate both client and server identities to prevent unauthorized access.
Implement TLS in a scalable and maintainable manner.
TLS Integration Approach:
Development: Both client and server authenticate each other using X.509 certificates using self-signing certs.
CA-Signed Certificates for Production: Obtain CA-signed certificates from a trusted Certificate Authority for production deployment, such as https://letsencrypt.org/
Certificate Management:
For development environments, we could generate self-signed certificates using OpenSSL.
Distribute certificates to client and server components securely. Implement periodic rotation of certificates to enhance security. Ideally, this process could be automated and renewed every 90 days before the current ones expire.
Risk Assessment and Mitigation:
Potential risks associated with TLS integration are misconfiguration or certificate management issues.
To mitigate this, we could test and automate cert rotation.
Includes commits:
added cert generation script
added dev certs