Question
A company allows users to download its mobile app onto their phones. The app is MQTT based and connects to AWS IoT Core to subscribe to specific client-related topics.
Recently, the company discovered that some malicious attackers have been trying to get a Trojan horse onto legitimate mobile phones. The Trojan horse poses as the authentic application and uses a client ID with injected special characters to gain access to topics outside the client's privilege scope.
Which combination of actions should the company take to prevent this threat? (Choose two.)
- A. In the application, use an IoT thing name as the client ID to connect the device to AWS IoT Core. Correct
- B. In the application, add a client ID check. Disconnect from the server if any special character is detected.
- C. Apply an AWS IoT Core policy that allows "AWSIoTWirelessDataAccess" with the principal set to "client/${iot:Connection.Thing.ThingName}"
- D. Apply an AWS IoT Core policy to the device to allow "iot:Connect" with the resource set to "client/${iot:ClientId}".
- E. Apply an AWS IoT Core policy to the device to allow "iot:Connect" with the resource set to "client/${iot:Connection.Thing.ThingName}". Correct
Explanation
Option A is correct because when the app connects with its IoT thing name as the MQTT client ID, AWS IoT Core can tie the connection to the thing that is attached to the device's certificate. Option E is correct because the ${iot:Connection.Thing.ThingName} policy variable resolves to the thing attached to the authenticated certificate, so iot:Connect is allowed only when the client ID equals that thing name; a client ID with injected special characters no longer matches and the connection is refused. Option D is wrong because ${iot:ClientId} takes whatever client ID the client sends, so it does not stop a spoofed ID. Option B is a client-side check that a malicious app can simply leave out, and option C names a managed IAM policy rather than an IoT Core policy action and does not control iot:Connect.