Cloud Security
Published in

Cloud Security

Conditions and Mappings in CloudFormation Templates

ACM.32 Preventing the Confused Deputy Attack in Batch Job Roles

Remove the ARN parameter.Add a batch job type parameter.The batch job type parameter can only have two values: batch or iam.If the value passed in is batch, our role name will have a batch prefix and only batch job administrator will be allowed to assume the role.If the value passed in is iam, our role name will start with an iam prefix and only the iam administrator will be allowed to assume the role.
!If [IAMJob, '*IAM administrator ARN*', '*Batch Administrator ARN*']
!If [IAMJob, '*IAM administrator ARN*', !If [BATCHJob, '*Batch administrator ARN*','ERROR']
!FindInMap [BatchJobRoleMap, !Ref ${batchjobtype}, rolename]
An error occurred (ValidationError) when calling the CreateChangeSet operation: Template format error: Every Mappings attribute must be a String or a List.
./deploy.sh POC batch
./deploy.sh POC iam
jobs/iam/DeployBatchJobCredentials/deploy.sh
./test.sh
Medium: Teri Radichel or Email List: Teri Radichel
Twitter: @teriradichel or @2ndSightLab
Requests services via LinkedIn: Teri Radichel or IANS Research

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Teri Radichel

Cloud Security Training and Penetration Testing | GSE, GSEC, GCIH, GCIA, GCPM, GCCC, GREM, GPEN, GXPN | AWS Hero | Infragard | IANS Faculty | 2ndSightLab.com