To send telemetry from a thing
(say Sensor1) to AWS IoT Core endpoint, we need:
- AWS IoT Certificate Authority Public Certificate
- Certificate with appropriate policy and Sensor1 attached
- Private key of certificate from point 2
const deviceName = 'Sensor1'
// Create the thingShadow object with argument data
const device = awsIoT.device({
keyPath: 'private.pem.key',
certPath: 'certificate.pem.crt',
caPath: '/home/ec2-user/environment/root-CA.crt',
clientId: deviceName,
host: endpointFile.endpointAddress
});
I want to get a general understanding of how the security system utilizes the keyPath, certPath, caPath to establish a secure connection.
The certificates and private key are used to resolve three questions:
The certificates and private key are used to implement mutual TLS to resolve these questions. This allows the client to authenticate the AWS IoT server (question 1) as well as the server to authenticate the client (question 2). The certificates also enable a secure TLS communication channel between the client and server (problem 3)
For the client authenticating the AWS IoT server (from https://docs.aws.amazon.com/iot/latest/developerguide/server-authentication.html):
The client uses the certificate referenced by the
caPath
to validate the certificate that it receives from the server that it connects to.For the AWS IoT server to authenticate the client (from https://docs.aws.amazon.com/iot/latest/developerguide/x509-client-certs.html#x509-client-cert-basics):
The server authenticates the client by receiving the registered certificate referenced by
certPath
and by the client using the private key referenced bykeyPath
to sign a message that proves that the client holds the private key.