I'm trying to understand the interaction between NGINX and a Hardware Security Module (HSM) during TLS offloading, particularly in relation to session key handling.
Here's my current understanding:
- In TLS offloading, the private key is securely stored in the HSM. NGINX has access to the certificate and public key.
- During the TLS handshake, when the client sends the encrypted pre-master secret, NGINX uses PKCS#11 to pass this to the HSM.
- The HSM decrypts the pre-master secret and returns it to NGINX.
- NGINX and the client both derive the session keys (master secret) using the pre-master secret and handshake parameters.
My question is about the actual application data exchange after the handshake:
- Does the HSM participate in encryption/decryption of the TLS session data? AWS CloudHSM article did not elaborate if HSM gets involve after the handshake process ends
- If yes, does that mean the HSM must store the session key (or perform symmetric crypto)?
- If not, then does NGINX handle symmetric encryption/decryption, and where does it store the session key?
- Is the communication between HSM and nginx server encrypted?
I’m aiming to clarify whether HSM’s involvement in the data encryption layer of the TLS session.