aws-samples/ecs-refarch-cloudformation

Wrong permission bits on cfn-init-created files

markuspeloquin opened this issue · 0 comments

The permission bits must be quoted. The problem is here:

When YAML parses that, it produces in terms of JSON:

{"mode": 256}

CloudFormation then turns that into the string '256'. Later, cfn-init parses that using, in Python, int(file['mode'], 8). cfn-init then happily sets the mode of that file to 256: writable by user=root, read-executable by group=root, read-writable by other. This problem became very clear to me when I tried to set the mode to 0444 (292), which isn't a valid octal.