question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

IAM ManagedPolicy PolicyDocument Character limit of 6144 should not include whitespaces

See original GitHub issue

cfn-lint version: (cfn-lint --version) 0.48.2

Description of issue. There is a 6,144 character limit on IAM managed policies but this does/should not include whitespaces (source). cfn-lint flagged a PolicyDocument of mine as too long, while Cloudformation successfully deploys it. This character limit check would be very helpful if it checked against the same 6,144 character limit that AWS does.

The PolicyDocument is defined in CFN in JSON. I can copy-and-paste this JSON into the AWS Policy Editor and it tells me there are only 4,189 characters in it. I can successfully deploy the CFN stack with this same policy. Counting whitespace, there are 9,849 characters so it seems highly likely that cfn-lint is counting whitespace when it should not be.

cfn-lint complaint: E3502 Role trust policy JSON text cannot be longer than 6144 characters

Please provide as much information as possible:

  • Template linting issues:
    • Please provide a CloudFormation sample that generated the issue.
    • If present, please add links to the (official) documentation for clarification.
    • Validate if the issue still exists with the latest version of cfn-lint and/or the latest Spec files
  • Feature request:
    • Please provide argumentation about the missing feature. Context is key!

Cfn-lint uses the CloudFormation Resource Specifications as the base to do validation. These files are included as part of the application version. Please update to the latest version of cfn-lint or update the spec files manually (cfn-lint -u)

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
kddejongcommented, Apr 13, 2021

Thanks for reporting this. I’ll take a look.

1reaction
kddejongcommented, Apr 15, 2021

yea, you two got it. I finally figured it out 😃 To make it worse we start adding characters to escape out the special characters so absolutely something we needed to get fixed.

Read more comments on GitHub >

github_iconTop Results From Across the Web

IAM and AWS STS quotas, name requirements, and character ...
IAM and STS character limits ; For managed policies. The size of each managed policy cannot exceed 6,144 characters. Note. IAM does not...
Read more >
IAM Policy Exceeding Max Length (6144 Characters) - Reddit
I've run into a strange request where I need to provision IAM policies with very granular permissions. As a result, the IAM policies...
Read more >
phzietsman/terraform-aws-policy-packer - GitHub
For managed policies, You can add up to 10 managed policies to an IAM user, role, or group. The size of each managed...
Read more >
ECS IAM limitations on entities and objects
The size of each managed policy cannot exceed 6,144 characters. NOTE: IAM does not count white space when calculating the size of a...
Read more >
phzietsman/policy-packer/aws - Terraform Registry
The size of each managed policy cannot exceed 6,144 characters. Note IAM does not count white space when calculating the size of a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found