cdklabs.cdk-validator-cfnguard 0.0.60
@cdklabs/cdk-validator-cfnguard
License: Apache-2.0
Requires Python: ~=3.8

# CDK CFN Guard Validator Plugin

<!--BEGIN STABILITY BANNER-->---


![cdk-constructs: Experimental](https://img.shields.io/badge/cdk--constructs-experimental-important.svg?style=for-the-badge)

> The APIs of higher level constructs in this module are experimental and under active development.
> They are subject to non-backward compatible changes or removal in any future version. These are
> not subject to the [Semantic Versioning](https://semver.org/) model and breaking changes will be
> announced in the release notes. This means that while you may use them, you may need to update
> your source code when upgrading to a newer version of this package.

---
<!--END STABILITY BANNER-->

## Installing

### TypeScript/JavaScript

```bash
npm install @cdklabs/cdk-validator-cfnguard
```

### Python

```bash
pip install cdklabs.cdk-validator-cfnguard
```

### Java

```xml
// add this to your pom.xml
<dependency>
    <groupId>io.github.cdklabs</groupId>
    <artifactId>cdk-validator-cfnguard</artifactId>
    <version>0.0.0</version> // replace with version
</dependency>
```

### .NET

```bash
dotnet add package Cdklabs.CdkValidatorCfnGuard --version X.X.X
```

## Usage

To use this plugin in your CDK application add it to the CDK App.

```python
App(
    policy_validation_beta1=[
        CfnGuardValidator()
    ]
)
```

By default the `CfnGuardValidator` plugin comes with the [Control Tower
proactive
controls](https://docs.aws.amazon.com/controltower/latest/userguide/proactive-controls.html)
enabled. In order to disable these rules you can use the
`controlTowerRulesEnabled: false` property.

```python
CfnGuardValidator(
    control_tower_rules_enabled=False
)
```

It is also possible to disable individual rules.

```python
CfnGuardValidator(
    disabled_rules=["ct-s3-pr-1"
    ]
)
```

### Additional rules

To provide additional rules to the plugin, provide a list of local
file or directory paths.

```python
CfnGuardValidator(
    rules=["path/to/local-rules-directory", "path/to/s3/local-rules/my-rule.guard"
    ]
)
```

If the path provided is a directory then the directory must only
contain guard rule files, and all rules within the directory will be used.

## Using the bundled Control Tower proactive controls in CDK

The bundled Control Tower proactive controls use CloudFormation Guard
policies that are also used in managed controls from the Control Tower
service. You can use these CDK bundled controls without having a Control
Tower environment in AWS, but there are many benefits to using the two together.

When you enable Control Tower proactive controls in your Control Tower environment,
the controls can stop the deployment of non-compliant resources deployed via
CloudFormation. For more information about managed proactive controls and how they work,
see the [Control Tower documentation](https://docs.aws.amazon.com/controltower/latest/userguide/proactive-controls.html).

These CDK bundled controls and managed Control Tower proactive controls are best used together.
In this scenario you can configure this validation plugin with the same proactive controls that
are active in your Control Tower cloud environment. You can then quickly gain confidence
that your CDK application will pass the Control Tower controls by running cdk synth locally
or in a pipeline as described above.

Regardless of whether you or your organization use Control Tower, however, you should
understand the following things about these bundled controls when run locally using this plugin:

1. These CloudFormation guard policies accept a limited subset of CloudFormation syntax
   for the properties they evaluate. For instance, a property called EncryptionEnabled may
   pass if it is specified with the literal value true, but it may fail if it is specified with
   a reference to a CloudFormation stack parameter instead. Similarly, if a rule checks for a string
   value, it may fail for Fn::Join objects. If you discover that a rule can be bypassed with a
   particular configuration of a resource, please file an issue.
2. Some rules may check references to other resources, but this reference checking is limited.
   For instance, a rule may require that an access logging bucket is specified for each S3 bucket.
   In this case, the rule can check whether you have passed a reference to a bucket in the same
   template, but it cannot verify that a hardcoded bucket name like "examplebucket" actually refers
   to a real bucket or a bucket you own.

You can add a layer of security protection by enabling the same proactive controls in your Control Tower
cloud environment. There are different considerations for using these controls since they operate in a
different way. For more information, see the [Control Tower proactive controls documentation](https://docs.aws.amazon.com/controltower/latest/userguide/proactive-controls.html).

If you do not yet have a Control Tower environment, see [What is AWS Control Tower?](https://docs.aws.amazon.com/controltower/latest/userguide/what-is-control-tower.html).

### Bundled Control Tower Rules

| ID                                                                                                                                                     | Name                                                                                                                                                                                     | Evaluated Resource Types                                                                            |
| ------------------------------------------------------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- |
| [CT.ACM.PR.1](https://docs.aws.amazon.com/controltower/latest/userguide/acm-rules.html#ct-acm-pr-1-description)                                        | Require an AWS Private CA certificate to have a single domain name                                                                                                                       | `AWS::CertificateManager::Certificate`<br/>                                                         |
| [CT.APIGATEWAY.PR.1](https://docs.aws.amazon.com/controltower/latest/userguide/api-gateway-rules.html#ct-apigateway-pr-1-description)                  | Require an Amazon API Gateway REST and WebSocket API to have logging activated                                                                                                           | `AWS::ApiGateway::Stage`<br/>                                                                       |
| [CT.APIGATEWAY.PR.2](https://docs.aws.amazon.com/controltower/latest/userguide/api-gateway-rules.html#ct-apigateway-pr-2-description)                  | Require an Amazon API Gateway REST API stage to have AWS X-Ray tracing activated                                                                                                         | `AWS::ApiGateway::Stage`<br/>                                                                       |
| [CT.APIGATEWAY.PR.3](https://docs.aws.amazon.com/controltower/latest/userguide/api-gateway-rules.html#ct-apigateway-pr-3-description)                  | Require that an Amazon API Gateway REST API stage has encryption at rest configured for cache data                                                                                       | `AWS::ApiGateway::Stage`<br/>                                                                       |
| [CT.APIGATEWAY.PR.4](https://docs.aws.amazon.com/controltower/latest/userguide/api-gateway-rules.html#ct-apigateway-pr-4-description)                  | Require an Amazon API Gateway V2 stage to have access logging activated                                                                                                                  | `AWS::ApiGatewayV2::Stage`<br/>                                                                     |
| [CT.APIGATEWAY.PR.5](https://docs.aws.amazon.com/controltower/latest/userguide/api-gateway-rules.html#ct-apigateway-pr-5-description)                  | Require Amazon API Gateway V2 Websocket and HTTP routes to specify an authorization type                                                                                                 | `AWS::ApiGatewayV2::Route`<br/>`AWS::ApiGatewayV2::ApiGatewayManagedOverrides`<br/>                 |
| [CT.APIGATEWAY.PR.6](https://docs.aws.amazon.com/controltower/latest/userguide/api-gateway-rules.html#ct-apigateway-pr-6-description)                  | Require an Amazon API Gateway REST domain to use a security policy that specifies a minimum TLS protocol version of TLSv1.2                                                              | `AWS::ApiGateway::DomainName`<br/>                                                                  |
| [CT.APPSYNC.PR.1](https://docs.aws.amazon.com/controltower/latest/userguide/appsync-rules.html#ct-appsync-pr-1-description)                            | Require an AWS AppSync GraphQL API to have logging enabled                                                                                                                               | `AWS::AppSync::GraphQLApi`<br/>                                                                     |
| [CT.APPSYNC.PR.2](https://docs.aws.amazon.com/controltower/latest/userguide/appsync-rules.html#ct-appsync-pr-2-description)                            | Require an AWS AppSync GraphQL API to be configured with private visibility                                                                                                              | `AWS::AppSync::GraphQLApi`<br/>                                                                     |
| [CT.APPSYNC.PR.3](https://docs.aws.amazon.com/controltower/latest/userguide/appsync-rules.html#ct-appsync-pr-3-description)                            | Require that an AWS AppSync GraphQL API is not authenticated with API keys                                                                                                               | `AWS::AppSync::GraphQLApi`<br/>                                                                     |
| [CT.APPSYNC.PR.4](https://docs.aws.amazon.com/controltower/latest/userguide/appsync-rules.html#ct-appsync-pr-4-description)                            | Require an AWS AppSync GraphQL API cache to have encryption in transit enabled.                                                                                                          | `AWS::AppSync::ApiCache`<br/>                                                                       |
| [CT.APPSYNC.PR.5](https://docs.aws.amazon.com/controltower/latest/userguide/appsync-rules.html#ct-appsync-pr-5-description)                            | Require an AWS AppSync GraphQL API cache to have encryption at rest enabled.                                                                                                             | `AWS::AppSync::ApiCache`<br/>                                                                       |
| [CT.ATHENA.PR.1](https://docs.aws.amazon.com/controltower/latest/userguide/athena-rules.html#ct-athena-pr-1-description)                               | Require an Amazon Athena workgroup to encrypt Athena query results at rest                                                                                                               | `AWS::Athena::WorkGroup`<br/>                                                                       |
| [CT.ATHENA.PR.2](https://docs.aws.amazon.com/controltower/latest/userguide/athena-rules.html#ct-athena-pr-2-description)                               | Require an Amazon Athena workgroup to encrypt Athena query results at rest with an AWS Key Management Service (KMS) key                                                                  | `AWS::Athena::WorkGroup`<br/>                                                                       |
| [CT.AUTOSCALING.PR.1](https://docs.aws.amazon.com/controltower/latest/userguide/ec2-auto-scaling-rules.html#ct-autoscaling-pr-1-description)           | Require an Amazon EC2 Auto Scaling group to have multiple Availability Zones                                                                                                             | `AWS::AutoScaling::AutoScalingGroup`<br/>                                                           |
| [CT.AUTOSCALING.PR.2](https://docs.aws.amazon.com/controltower/latest/userguide/ec2-auto-scaling-rules.html#ct-autoscaling-pr-2-description)           | Require an Amazon EC2 Auto Scaling group launch configuration to configure Amazon EC2 instances for IMDSv2                                                                               | `AWS::AutoScaling::LaunchConfiguration`<br/>                                                        |
| [CT.AUTOSCALING.PR.3](https://docs.aws.amazon.com/controltower/latest/userguide/ec2-auto-scaling-rules.html#ct-autoscaling-pr-3-description)           | Require an Amazon EC2 Auto Scaling launch configuration to have a single-hop metadata response limit                                                                                     | `AWS::AutoScaling::LaunchConfiguration`<br/>                                                        |
| [CT.AUTOSCALING.PR.4](https://docs.aws.amazon.com/controltower/latest/userguide/ec2-auto-scaling-rules.html#ct-autoscaling-pr-4-description)           | Require an Amazon EC2 Auto Scaling group associated with an AWS Elastic Load Balancer (ELB) to have ELB health checks activated                                                          | `AWS::AutoScaling::AutoScalingGroup`<br/>                                                           |
| [CT.AUTOSCALING.PR.5](https://docs.aws.amazon.com/controltower/latest/userguide/ec2-auto-scaling-rules.html#ct-autoscaling-pr-5-description)           | Require that an Amazon EC2 Auto Scaling group launch configuration does not have Amazon EC2 instances with public IP addresses                                                           | `AWS::AutoScaling::LaunchConfiguration`<br/>                                                        |
| [CT.AUTOSCALING.PR.6](https://docs.aws.amazon.com/controltower/latest/userguide/ec2-auto-scaling-rules.html#ct-autoscaling-pr-6-description)           | Require any Amazon EC2 Auto Scaling groups to use multiple instance types                                                                                                                | `AWS::AutoScaling::AutoScalingGroup`<br/>                                                           |
| [CT.AUTOSCALING.PR.8](https://docs.aws.amazon.com/controltower/latest/userguide/ec2-auto-scaling-rules.html#ct-autoscaling-pr-8-description)           | Require an Amazon EC2 Auto Scaling group to have EC2 launch templates configured                                                                                                         | `AWS::AutoScaling::AutoScalingGroup`<br/>                                                           |
| [CT.AUTOSCALING.PR.9](https://docs.aws.amazon.com/controltower/latest/userguide/ec2-auto-scaling-rules.html#ct-autoscaling-pr-9-description)           | Require an Amazon EBS volume configured through an Amazon EC2 Auto Scaling launch configuration to encrypt data at rest                                                                  | `AWS::AutoScaling::LaunchConfiguration`<br/>                                                        |
| [CT.AUTOSCALING.PR.10](https://docs.aws.amazon.com/controltower/latest/userguide/ec2-auto-scaling-rules.html#ct-autoscaling-pr-10-description)         | Require an Amazon EC2 Auto Scaling group to use only AWS Nitro instance types when overriding a launch template                                                                          | `AWS::AutoScaling::AutoScalingGroup`<br/>                                                           |
| [CT.AUTOSCALING.PR.11](https://docs.aws.amazon.com/controltower/latest/userguide/ec2-auto-scaling-rules.html#ct-autoscaling-pr-11-description)         | Require only AWS Nitro instance types that support network traffic encryption between instances to be added to an Amazon EC2 Auto Scaling group, when overriding a launch template       | `AWS::AutoScaling::AutoScalingGroup`<br/>                                                           |
| [CT.CLOUDFRONT.PR.1](https://docs.aws.amazon.com/controltower/latest/userguide/cloudfront-rules.html#ct-cloudfront-pr-1-description)                   | Require an Amazon CloudFront distribution to have a default root object configured                                                                                                       | `AWS::CloudFront::Distribution`<br/>                                                                |
| [CT.CLOUDFRONT.PR.3](https://docs.aws.amazon.com/controltower/latest/userguide/cloudfront-rules.html#ct-cloudfront-pr-3-description)                   | Require an Amazon CloudFront distribution to have encryption in transit configured                                                                                                       | `AWS::CloudFront::Distribution`<br/>                                                                |
| [CT.CLOUDFRONT.PR.4](https://docs.aws.amazon.com/controltower/latest/userguide/cloudfront-rules.html#ct-cloudfront-pr-4-description)                   | Require an Amazon CloudFront distribution to have origin failover configured                                                                                                             | `AWS::CloudFront::Distribution`<br/>                                                                |
| [CT.CLOUDFRONT.PR.5](https://docs.aws.amazon.com/controltower/latest/userguide/cloudfront-rules.html#ct-cloudfront-pr-5-description)                   | Require any Amazon CloudFront distribution to have logging enabled                                                                                                                       | `AWS::CloudFront::Distribution`<br/>                                                                |
| [CT.CLOUDFRONT.PR.6](https://docs.aws.amazon.com/controltower/latest/userguide/cloudfront-rules.html#ct-cloudfront-pr-6-description)                   | Require an Amazon CloudFront distribution to use custom SSL/TLS certificates                                                                                                             | `AWS::CloudFront::Distribution`<br/>                                                                |
| [CT.CLOUDFRONT.PR.7](https://docs.aws.amazon.com/controltower/latest/userguide/cloudfront-rules.html#ct-cloudfront-pr-7-description)                   | Require an Amazon CloudFront distribution to use SNI to serve HTTPS requests                                                                                                             | `AWS::CloudFront::Distribution`<br/>                                                                |
| [CT.CLOUDFRONT.PR.8](https://docs.aws.amazon.com/controltower/latest/userguide/cloudfront-rules.html#ct-cloudfront-pr-8-description)                   | Require an Amazon CloudFront distribution to encrypt traffic to custom origins                                                                                                           | `AWS::CloudFront::Distribution`<br/>                                                                |
| [CT.CLOUDFRONT.PR.9](https://docs.aws.amazon.com/controltower/latest/userguide/cloudfront-rules.html#ct-cloudfront-pr-9-description)                   | Require an Amazon CloudFront distribution to have a security policy of TLSv1.2 as a minimum                                                                                              | `AWS::CloudFront::Distribution`<br/>                                                                |
| [CT.CLOUDFRONT.PR.10](https://docs.aws.amazon.com/controltower/latest/userguide/cloudfront-rules.html#ct-cloudfront-pr-10-description)                 | Require any Amazon CloudFront distributions with Amazon S3 backed origins to have origin access control configured                                                                       | `AWS::CloudFront::Distribution`<br/>                                                                |
| [CT.CLOUDFRONT.PR.11](https://docs.aws.amazon.com/controltower/latest/userguide/cloudfront-rules.html#ct-cloudfront-pr-11-description)                 | Require an Amazon CloudFront distribution to use updated SSL protocols between edge locations and custom origins                                                                         | `AWS::CloudFront::Distribution`<br/>                                                                |
| [CT.CLOUDTRAIL.PR.1](https://docs.aws.amazon.com/controltower/latest/userguide/cloudtrail-rules.html#ct-cloudtrail-pr-1-description)                   | Require an AWS CloudTrail trail to have encryption at rest activated                                                                                                                     | `AWS::CloudTrail::Trail`<br/>                                                                       |
| [CT.CLOUDTRAIL.PR.2](https://docs.aws.amazon.com/controltower/latest/userguide/cloudtrail-rules.html#ct-cloudtrail-pr-2-description)                   | Require an AWS CloudTrail trail to have log file validation activated                                                                                                                    | `AWS::CloudTrail::Trail`<br/>                                                                       |
| [CT.CLOUDTRAIL.PR.3](https://docs.aws.amazon.com/controltower/latest/userguide/cloudtrail-rules.html#ct-cloudtrail-pr-3-description)                   | Require an AWS CloudTrail trail to have an Amazon CloudWatch log group configuration                                                                                                     | `AWS::CloudTrail::Trail`<br/>                                                                       |
| [CT.CLOUDTRAIL.PR.4](https://docs.aws.amazon.com/controltower/latest/userguide/cloudtrail-rules.html#ct-cloudtrail-pr-4-description)                   | Require an AWS CloudTrail Lake event data store to enable encryption at rest with an AWS KMS key                                                                                         | `AWS::CloudTrail::EventDataStore`<br/>                                                              |
| [CT.CLOUDWATCH.PR.1](https://docs.aws.amazon.com/controltower/latest/userguide/cloudwatch-rules.html#ct-cloudwatch-pr-1-description)                   | Require an Amazon CloudWatch alarm to have an action configured for the alarm state                                                                                                      | `AWS::CloudWatch::Alarm`<br/>                                                                       |
| [CT.CLOUDWATCH.PR.2](https://docs.aws.amazon.com/controltower/latest/userguide/cloudwatch-rules.html#ct-cloudwatch-pr-2-description)                   | Require an Amazon CloudWatch log group to be retained for at least one year                                                                                                              | `AWS::Logs::LogGroup`<br/>                                                                          |
| [CT.CLOUDWATCH.PR.3](https://docs.aws.amazon.com/controltower/latest/userguide/cloudwatch-rules.html#ct-cloudwatch-pr-3-description)                   | Require an Amazon CloudWatch log group to be encrypted at rest with an AWS KMS key                                                                                                       | `AWS::Logs::LogGroup`<br/>                                                                          |
| [CT.CLOUDWATCH.PR.4](https://docs.aws.amazon.com/controltower/latest/userguide/cloudwatch-rules.html#ct-cloudwatch-pr-4-description)                   | Require an Amazon CloudWatch alarm to have actions activated                                                                                                                             | `AWS::CloudWatch::Alarm`<br/>                                                                       |
| [CT.CODEBUILD.PR.1](https://docs.aws.amazon.com/controltower/latest/userguide/codebuild-rules.html#ct-codebuild-pr-1-description)                      | Require OAuth on GitHub or Bitbucket source repository URLs for AWS CodeBuild projects                                                                                                   | `AWS::CodeBuild::Project`<br/>                                                                      |
| [CT.CODEBUILD.PR.2](https://docs.aws.amazon.com/controltower/latest/userguide/codebuild-rules.html#ct-codebuild-pr-2-description)                      | Require any AWS CodeBuild project environment variable to encrypt credentials in environment variables                                                                                   | `AWS::CodeBuild::Project`<br/>                                                                      |
| [CT.CODEBUILD.PR.3](https://docs.aws.amazon.com/controltower/latest/userguide/codebuild-rules.html#ct-codebuild-pr-3-description)                      | Require any AWS CodeBuild project environment to have logging configured                                                                                                                 | `AWS::CodeBuild::Project`<br/>                                                                      |
| [CT.CODEBUILD.PR.4](https://docs.aws.amazon.com/controltower/latest/userguide/codebuild-rules.html#ct-codebuild-pr-4-description)                      | Require any AWS CodeBuild project to deactivate privileged mode when running                                                                                                             | `AWS::CodeBuild::Project`<br/>                                                                      |
| [CT.CODEBUILD.PR.5](https://docs.aws.amazon.com/controltower/latest/userguide/codebuild-rules.html#ct-codebuild-pr-5-description)                      | Require encryption on all AWS CodeBuild project artifacts                                                                                                                                | `AWS::CodeBuild::Project`<br/>                                                                      |
| [CT.CODEBUILD.PR.6](https://docs.aws.amazon.com/controltower/latest/userguide/codebuild-rules.html#ct-codebuild-pr-6-description)                      | Require encryption on all Amazon S3 logs for AWS CodeBuild projects                                                                                                                      | `AWS::CodeBuild::Project`<br/>                                                                      |
| [CT.DAX.PR.1](https://docs.aws.amazon.com/controltower/latest/userguide/dax-rules.html#ct-dax-pr-1-description)                                        | Require encryption at rest for all Amazon DynamoDB Accelerator (DAX) clusters                                                                                                            | `AWS::DAX::Cluster`<br/>                                                                            |
| [CT.DAX.PR.2](https://docs.aws.amazon.com/controltower/latest/userguide/dax-rules.html#ct-dax-pr-2-description)                                        | Require an Amazon DAX cluster to deploy nodes to at least three Availability Zones                                                                                                       | `AWS::DAX::Cluster`<br/>                                                                            |
| [CT.DAX.PR.3](https://docs.aws.amazon.com/controltower/latest/userguide/dax-rules.html#ct-dax-pr-3-description)                                        | Require an Amazon DAX cluster to encrypt data in transit with Transport Layer Security (TLS)                                                                                             | `AWS::DAX::Cluster`<br/>                                                                            |
| [CT.DMS.PR.1](https://docs.aws.amazon.com/controltower/latest/userguide/dms-rules.html#ct-dms-pr-1-description)                                        | Require that a public AWS DMS replication instance is not public                                                                                                                         | `AWS::DMS::ReplicationInstance`<br/>                                                                |
| [CT.DMS.PR.2](https://docs.aws.amazon.com/controltower/latest/userguide/dms-rules.html#ct-dms-pr-2-description)                                        | Require an AWS Database Migration Service (DMS) Endpoint to encrypt connections for source and target endpoints                                                                          | `AWS::DMS::Endpoint`<br/>                                                                           |
| [CT.DOCUMENTDB.PR.1](https://docs.aws.amazon.com/controltower/latest/userguide/documentdb-rules.html#ct-documentdb-pr-1-description)                   | Require an Amazon DocumentDB cluster to be encrypted at rest                                                                                                                             | `AWS::DocDB::DBCluster`<br/>                                                                        |
| [CT.DOCUMENTDB.PR.2](https://docs.aws.amazon.com/controltower/latest/userguide/documentdb-rules.html#ct-documentdb-pr-2-description)                   | Require an Amazon DocumentDB cluster to have a backup retention period greater than or equal to seven days                                                                               | `AWS::DocDB::DBCluster`<br/>                                                                        |
| [CT.DYNAMODB.PR.1](https://docs.aws.amazon.com/controltower/latest/userguide/dynamodb-rules.html#ct-dynamodb-pr-1-description)                         | Require that point-in-time recovery for an Amazon DynamoDB table is activated                                                                                                            | `AWS::DynamoDB::Table`<br/>                                                                         |
| [CT.DYNAMODB.PR.2](https://docs.aws.amazon.com/controltower/latest/userguide/dynamodb-rules.html#ct-dynamodb-pr-2-description)                         | Require an Amazon DynamoDB table to be encrypted at rest using an AWS KMS key                                                                                                            | `AWS::DynamoDB::Table`<br/>                                                                         |
| [CT.EC2.PR.1](https://docs.aws.amazon.com/controltower/latest/userguide/ec2-rules.html#ct-ec2-pr-1-description)                                        | Require an Amazon EC2 launch template to have IMDSv2 configured                                                                                                                          | `AWS::EC2::LaunchTemplate`<br/>                                                                     |
| [CT.EC2.PR.2](https://docs.aws.amazon.com/controltower/latest/userguide/ec2-rules.html#ct-ec2-pr-2-description)                                        | Require that Amazon EC2 launch templates restrict the token hop limit to a maximum of one                                                                                                | `AWS::EC2::LaunchTemplate`<br/>                                                                     |
| [CT.EC2.PR.3](https://docs.aws.amazon.com/controltower/latest/userguide/ec2-rules.html#ct-ec2-pr-3-description)                                        | Require that any Amazon EC2 security group rule does not use the source IP range 0.0.0.0/0 or ::/0 for ports other than 80 and 443                                                       | `AWS::EC2::SecurityGroup`<br/>`AWS::EC2::SecurityGroupIngress`<br/>                                 |
| [CT.EC2.PR.4](https://docs.aws.amazon.com/controltower/latest/userguide/ec2-rules.html#ct-ec2-pr-4-description)                                        | Require that any Amazon EC2 security group rule does not use the source IP range 0.0.0.0/0 or ::/0 for specific high-risk ports                                                          | `AWS::EC2::SecurityGroup`<br/>`AWS::EC2::SecurityGroupIngress`<br/>                                 |
| [CT.EC2.PR.5](https://docs.aws.amazon.com/controltower/latest/userguide/ec2-rules.html#ct-ec2-pr-5-description)                                        | Require any Amazon EC2 network ACL to prevent ingress from 0.0.0.0/0 to port 22 or port 3389                                                                                             | `AWS::EC2::NetworkAclEntry`<br/>                                                                    |
| [CT.EC2.PR.6](https://docs.aws.amazon.com/controltower/latest/userguide/ec2-rules.html#ct-ec2-pr-6-description)                                        | Require that Amazon EC2 transit gateways refuse automatic Amazon VPC attachment requests                                                                                                 | `AWS::EC2::TransitGateway`<br/>                                                                     |
| [CT.EC2.PR.7](https://docs.aws.amazon.com/controltower/latest/userguide/ec2-rules.html#ct-ec2-pr-7-description)                                        | Require an Amazon EBS volume resource to be encrypted at rest when defined by means of the AWS::EC2::Instance BlockDeviceMappings property or AWS::EC2::Volume resource type             | `AWS::EC2::Instance`<br/>`AWS::EC2::Volume`<br/>                                                    |
| [CT.EC2.PR.8](https://docs.aws.amazon.com/controltower/latest/userguide/ec2-rules.html#ct-ec2-pr-8-description)                                        | Require an Amazon EC2 instance to set AssociatePublicIpAddress to false on a new network interface created by means of the NetworkInterfaces property in the AWS::EC2::Instance resource | `AWS::EC2::Instance`<br/>                                                                           |
| [CT.EC2.PR.9](https://docs.aws.amazon.com/controltower/latest/userguide/ec2-rules.html#ct-ec2-pr-9-description)                                        | Require any Amazon EC2 launch template not to auto-assign public IP addresses to network interfaces                                                                                      | `AWS::EC2::LaunchTemplate`<br/>                                                                     |
| [CT.EC2.PR.10](https://docs.aws.amazon.com/controltower/latest/userguide/ec2-rules.html#ct-ec2-pr-10-description)                                      | Require Amazon EC2 launch templates to have Amazon CloudWatch detailed monitoring activated                                                                                              | `AWS::EC2::LaunchTemplate`<br/>                                                                     |
| [CT.EC2.PR.11](https://docs.aws.amazon.com/controltower/latest/userguide/ec2-rules.html#ct-ec2-pr-11-description)                                      | Require that an Amazon EC2 subnet does not automatically assign public IP addresses                                                                                                      | `AWS::EC2::Subnet`<br/>                                                                             |
| [CT.EC2.PR.12](https://docs.aws.amazon.com/controltower/latest/userguide/ec2-rules.html#ct-ec2-pr-12-description)                                      | Require an Amazon EC2 instance to specify at most one network interface by means of the NetworkInterfaces property in the AWS::EC2::Instance resource                                    | `AWS::EC2::Instance`<br/>                                                                           |
| [CT.EC2.PR.13](https://docs.aws.amazon.com/controltower/latest/userguide/ec2-rules.html#ct-ec2-pr-13-description)                                      | Require an Amazon EC2 instance to have detailed monitoring enabled                                                                                                                       | `AWS::EC2::Instance`<br/>                                                                           |
| [CT.EC2.PR.14](https://docs.aws.amazon.com/controltower/latest/userguide/ec2-rules.html#ct-ec2-pr-14-description)                                      | Require an Amazon EBS volume configured through an Amazon EC2 launch template to encrypt data at rest                                                                                    | `AWS::EC2::LaunchTemplate`<br/>                                                                     |
| [CT.EC2.PR.15](https://docs.aws.amazon.com/controltower/latest/userguide/ec2-rules.html#ct-ec2-pr-15-description)                                      | Require an Amazon EC2 instance to use an AWS Nitro instance type when creating from the 'AWS::EC2::LaunchTemplate' resource type                                                         | `AWS::EC2::LaunchTemplate`<br/>                                                                     |
| [CT.EC2.PR.16](https://docs.aws.amazon.com/controltower/latest/userguide/ec2-rules.html#ct-ec2-pr-16-description)                                      | Require an Amazon EC2 instance to use an AWS Nitro instance type when created using the 'AWS::EC2::Instance' resource type                                                               | `AWS::EC2::Instance`<br/>                                                                           |
| [CT.EC2.PR.17](https://docs.aws.amazon.com/controltower/latest/userguide/ec2-rules.html#ct-ec2-pr-17-description)                                      | Require an Amazon EC2 dedicated host to use an AWS Nitro instance type                                                                                                                   | `AWS::EC2::Host`<br/>                                                                               |
| [CT.EC2.PR.18](https://docs.aws.amazon.com/controltower/latest/userguide/ec2-rules.html#ct-ec2-pr-18-description)                                      | Require an Amazon EC2 fleet to override only those launch templates with AWS Nitro instance types                                                                                        | `AWS::EC2::EC2Fleet`<br/>                                                                           |
| [CT.EC2.PR.19](https://docs.aws.amazon.com/controltower/latest/userguide/ec2-rules.html#ct-ec2-pr-19-description)                                      | Require an EC2 instance to use an AWS Nitro instance type that supports encryption in-transit between instances when created using the AWS::EC2::Instance resource type                  | `AWS::EC2::Instance`<br/>                                                                           |
| [CT.EC2.PR.20](https://docs.aws.amazon.com/controltower/latest/userguide/ec2-rules.html#ct-ec2-pr-20-description)                                      | Require an Amazon EC2 fleet to override only those launch templates with AWS Nitro instance types that support encryption in transit bet