aws-samples / aws-samples/aws-iot-connected-printer

Provisioning template grants iot:* on resource * to every provisioned device

Open
#5 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
10
Forks
2
PR merge metrics
No merged PRs in 30d

Description

Every provisioned printer gets a policy allowing Connect/Subscribe/Publish/Receive on ALL resources. A compromised printer can subscribe to all other printers' job topics (intercept print jobs containing card designs with cardholder names), publish fake telemetry for other devices, or impersonate any device.

Fix: Use IoT policy variables:

{
"Statement": [
{ "Effect": "Allow", "Action": "iot:Connect", "Resource": "arn:aws:iot:REGION:ACCOUNT:client/Printer_${iot:Connection.Thing.ThingName}" },
{ "Effect": "Allow", "Action": "iot:Publish", "Resource": ["arn:aws:iot:REGION:ACCOUNT:topic/printer_status/${iot:Connection.Thing.ThingName}", "arn:aws:iot:REGION:ACCOUNT:topic/job_status/${iot:Connection.Thing.ThingName}/*"] },
{ "Effect": "Allow", "Action": "iot:Subscribe", "Resource": "arn:aws:iot:REGION:ACCOUNT:topicfilter/print_jobs/${iot:Connection.Thing.ThingName}" },
{ "Effect": "Allow", "Action": "iot:Receive", "Resource": "arn:aws:iot:REGION:ACCOUNT:topic/print_jobs/${iot:Connection.Thing.ThingName}" }
]
}

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.