Security-group or rule description missing

Briefly document the purpose of the group and its allow rules.

Description

Supply the group’s purpose in the required CloudFormation GroupDescription. Use the optional Description on each rule to explain why the service needs that access.

Potential impact

CloudFormation cannot create a group without its description. An undocumented rule makes it harder to decide whether to keep the permission.

Remediation

Use characters AWS accepts and match the descriptions to the group and its actual clients and services. Before editing an existing GroupDescription, check the change set for the group replacement and its impact.

Examples

Define myVPC separately. The first excerpt omits the required group description. The second identifies a public web service, while the configured source for TCP 80 is 0.0.0.0/0 in both excerpts.

Before

yaml
Resources:
  InstanceSecurityGroup:
    Type: AWS::EC2::SecurityGroup
    Properties:
      VpcId:
        Ref: myVPC
      SecurityGroupIngress:
        - IpProtocol: tcp
          FromPort: 80
          ToPort: 80
          CidrIp: 0.0.0.0/0

After

yaml
Resources:
  InstanceSecurityGroup:
    Type: AWS::EC2::SecurityGroup
    Properties:
      # Allow access to the public HTTP service
      GroupDescription: Public web servers
      VpcId:
        Ref: myVPC
      SecurityGroupIngress:
        - IpProtocol: tcp
          # Allow access to the public HTTP service
          Description: Public HTTP service
          FromPort: 80
          ToPort: 80
          CidrIp: 0.0.0.0/0

References