Closed sv3ndk closed 10 months ago
Hello,
IoT connection policy variables are not supported. You may use IoT certificate policy variables or specify the exact/wildcard name. https://docs.aws.amazon.com/iot/latest/developerguide/cert-policy-variables.html
Also see previous answers here: https://repost.aws/questions/QUOvz_sVB1RjOUlJRclfXrOw/secure-iot-policy-for-shadowmanager-shadow-actions#ANAdZ-7t5FRv6mtmync5Egnw.
Thanks for the quick update and the links.
Ok, see, that's quite a pity, once my things are in the wild, I'd rather restrict at maximum their ability to update anything else than their own data (I can't imagine anybody would want otherwise in prod?).
I'll try to find a solution that works for me based on the pointers you sent me.
Thanks again
Describe the bug I apologize, this is probably more my own misunderstanding than a bug, although I can't figure out why my setup fails.
When my python component is updating or deleting a named shadow via IPC and when using an IoT policy containing thing policy variables for the
iot:UpdateThingShadow
action, the shadow manager is forbidden to synchronize up to AWS.When replacing the thing policy variable with a hardcoded thing name, the shadow manager works successfully.
The python component has been otherwise working successfully on multiple instances for a while though, it's already using IPC to interract with AWS and we already use one single IoT policy for all IoT thing, using thing policy variable, for example when publishing to MQTT via IPC:
To Reproduce
deploy a python app with the shadow manager and appropriate component permissions. The shadow manager is configured as follow:
let the python app use IPC
UpdateThingShadowRequest
to send some update toPOC_MY_SHADOW_1
monitor Greegrass logs
Expected behavior
Shadow update should be propagated to AWS
Actual behavior
Future
is successfulEnvironment
Additional context
When replacing
${iot:Connection.Thing.ThingName}
with one hard-coded thing name, the shadow manager succeeds in synchronizing its state to AWS, but of course that would force me to create one IoT policy per IoT thing, which is quickly unpractical.I'm sure I'm doing something wrong in my config, could you help me spot where? Thanks a lot in advance!