Confused Deputy, External ID and Presigned URLs: Cross-Account Access on AWS
When another party acts on your behalf, you need conditions that prove who it is acting for. These notes cover the confused deputy problem and the controls AWS documents for it, plus how a presigned URL inherits the permissions and lifetime of whoever created it.
Key points (5)
IAM · Role trust and External ID
The ExternalId in a role's trust policy prevents the confused deputy problem with third parties. The third party generates and controls it (unique per customer), not you: that is why you receive it from them instead of inventing it.
When you grant access to a service principal (e.g. cloudtrail.amazonaws.com), use aws:SourceArn or aws:SourceAccount in the resource policy. Without that condition, another account that knows the bucket name could write to it.
IAM + Organizations · RCPs against confused deputy
A resource control policy (RCP) can enforce confused deputy controls centrally with aws:SourceOrgID and aws:SourceOrgPaths, without editing every resource policy. A matching Allow is still needed in the resource policy.
A presigned URL uses the credentials and permissions of whoever generated it and works as a bearer token. If it was created with temporary credentials (role, STS), it expires when they expire, even if the URL has a later expiration.
A presigned URL lasts from 1 minute to 12 hours from the console, and up to 7 days with the CLI/SDK using IAM user credentials and SigV4. You can restrict it with the s3:signatureAge condition or by limiting the network path (aws:SourceIp, aws:SourceVpce).