-
Notifications
You must be signed in to change notification settings - Fork 614
Description
cfn-lint version: cfn-lint 0.15.0
When creating a AWS::IAM::ManagedPolicy and using the Sid
statement, cfn-lint is not detecting an invalidly-formed Sid statement
Please provide as much information as possible:
- Template linting issues:
- Please provide a CloudFormation sample that generated the issue.
ManagedPolicyCodeSuiteKmsKey:
Type: AWS::IAM::ManagedPolicy
Condition: CreateCodePipelineRole
Properties:
PolicyDocument:
Version: '2012-10-17'
Statement:
- Sid: Allow use of KMS key in Operations Production Account
Effect: Allow
Resource: !Sub 'arn:aws:kms::123123123123:key/*'
Action:
- "kms:Encrypt"
- "kms:Decrypt"
- "kms:ReEncrypt*"
- "kms:GenerateDataKey*"
- "kms:DescribeKey"
- If present, please add links to the (official) documentation for clarification.
https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_grammar.html#policies-grammar-notes-strings
sid_string
Provides a way to include information about an individual statement. For IAM policies, basic alphanumeric characters (A-Z,a-z,0-9) are the only allowed characters in the Sid value. Other AWS services that support resource policies may have other requirements for the Sid value. For example, some services require this value to be unique within an AWS account, and some services allow additional characters such as spaces in the Sid value.
-
Validate if the issue still exists with the latest version of
cfn-lint
and/or the latest Spec files
I do not know how to install latest version, I just ranpip install
-
Feature request:
- My CloudFormation template fails to Create or Update because the Sid uses invalid characters, and cfn-lint does not detect that.
**NOTE: I have executed cfn-lint -u
and it downloaded updates, but the problem remains.
Below is the output from CloudFormation:
The following resource(s) failed to update: [ManagedPolicyCodeSuiteKmsKey].
--
| 11:20:11 UTC+1000 | UPDATE_FAILED | AWS::IAM::ManagedPolicy | ManagedPolicyCodeSuiteKmsKey | Statement IDs (SID) must be alpha-numeric. Check that your input satisfies the regular expression [0-9A-Za-z]* (Service: AmazonIdentityManagement; Status Code: 400; Error Code: MalformedPolicyDocument; Request ID: a632726a-42d2-11e9-8725-21992a944eb3)