SslPolicy

class aws_cdk.aws_elasticloadbalancingv2.SslPolicy(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)

Bases: Enum

Elastic Load Balancing provides the following security policies for Application Load Balancers.

We recommend the Recommended policy for general use. You can use the ForwardSecrecy policy if you require Forward Secrecy (FS).

You can use one of the TLS policies to meet compliance and security standards that require disabling certain TLS protocol versions, or to support legacy clients that require deprecated ciphers.

See:

https://docs.aws.amazon.com/elasticloadbalancing/latest/application/create-https-listener.html

ExampleMetadata:

infused

Example:

from aws_cdk.aws_certificatemanager import Certificate
from aws_cdk.aws_ec2 import InstanceType
from aws_cdk.aws_ecs import Cluster, ContainerImage
from aws_cdk.aws_elasticloadbalancingv2 import ApplicationProtocol, SslPolicy
from aws_cdk.aws_route53 import PublicHostedZone

vpc = ec2.Vpc(self, "Vpc", max_azs=1)
load_balanced_fargate_service = ecs_patterns.ApplicationMultipleTargetGroupsFargateService(self, "myService",
    cluster=ecs.Cluster(self, "EcsCluster", vpc=vpc),
    memory_limit_mi_b=256,
    task_image_options=ecsPatterns.ApplicationLoadBalancedTaskImageProps(
        image=ecs.ContainerImage.from_registry("amazon/amazon-ecs-sample")
    ),
    enable_execute_command=True,
    load_balancers=[ecsPatterns.ApplicationLoadBalancerProps(
        name="lb",
        idle_timeout=Duration.seconds(400),
        domain_name="api.example.com",
        domain_zone=PublicHostedZone(self, "HostedZone", zone_name="example.com"),
        listeners=[ecsPatterns.ApplicationListenerProps(
            name="listener",
            protocol=ApplicationProtocol.HTTPS,
            certificate=Certificate.from_certificate_arn(self, "Cert", "helloworld"),
            ssl_policy=SslPolicy.TLS12_EXT
        )
        ]
    ), ecsPatterns.ApplicationLoadBalancerProps(
        name="lb2",
        idle_timeout=Duration.seconds(120),
        domain_name="frontend.com",
        domain_zone=PublicHostedZone(self, "HostedZone", zone_name="frontend.com"),
        listeners=[ecsPatterns.ApplicationListenerProps(
            name="listener2",
            protocol=ApplicationProtocol.HTTPS,
            certificate=Certificate.from_certificate_arn(self, "Cert2", "helloworld"),
            ssl_policy=SslPolicy.TLS12_EXT
        )
        ]
    )
    ],
    target_groups=[ecsPatterns.ApplicationTargetProps(
        container_port=80,
        listener="listener"
    ), ecsPatterns.ApplicationTargetProps(
        container_port=90,
        path_pattern="a/b/c",
        priority=10,
        listener="listener"
    ), ecsPatterns.ApplicationTargetProps(
        container_port=443,
        listener="listener2"
    ), ecsPatterns.ApplicationTargetProps(
        container_port=80,
        path_pattern="a/b/c",
        priority=10,
        listener="listener2"
    )
    ]
)

Attributes

FIPS_TLS13_10

TLS1.0 through 1.3 with all ciphers.

FIPS_TLS13_11

TLS1.1 through 1.3 with all ciphers.

FIPS_TLS13_12

TLS 1.2 and 1.3 with ECDHE SHA/GCM ciphers, excluding SHA1 ciphers.

FIPS_TLS13_12_EXT0

TLS 1.2 and 1.3 with all ECDHE ciphers.

FIPS_TLS13_12_EXT1

TLS 1.2 and 1.3 with all AES and ECDHE ciphers excluding SHA1 ciphers.

FIPS_TLS13_12_EXT2

TLS 1.2 and 1.3 with all ciphers.

FIPS_TLS13_12_RES

TLS 1.2 and 1.3 with AES and ECDHE GCM/SHA ciphers.

FIPS_TLS13_13

TLS 1.3 only with AES 128 and 256 GCM SHA ciphers.

FORWARD_SECRECY

Forward secrecy ciphers only.

FORWARD_SECRECY_TLS11

Forward secrecy ciphers only with TLS1.1 and 1.2.

FORWARD_SECRECY_TLS12

Forward secrecy ciphers and TLS1.2 only.

FORWARD_SECRECY_TLS12_RES

Strong forward secrecy ciphers and TLS1.2 only.

FORWARD_SECRECY_TLS12_RES_GCM

Strong foward secrecy ciphers and TLV1.2 only (2020 edition). Same as FORWARD_SECRECY_TLS12_RES, but only supports GCM versions of the TLS ciphers.

LEGACY

Support for DES-CBC3-SHA.

Do not use this security policy unless you must support a legacy client that requires the DES-CBC3-SHA cipher, which is a weak cipher.

RECOMMENDED

The recommended policy for http listeners.

This is the default security policy for listeners created using the AWS CLI

RECOMMENDED_TLS

The recommended security policy for TLS listeners.

This is the default policy for listeners created using the AWS Management Console

TLS11

TLS1.1 and 1.2 with all ciphers.

TLS12

TLS1.2 only and no SHA ciphers.

TLS12_EXT

TLS1.2 only with all ciphers.

TLS13_10

TLS1.0 through 1.3 with all ciphers.

TLS13_11

TLS1.1 through 1.3 with all ciphers.

TLS13_13

TLS1.3 only.

TLS13_EXT1

TLS1.2 and 1.3 and no SHA ciphers.

TLS13_EXT2

TLS1.2 and 1.3 with all ciphers.

TLS13_RES

TLS1.2 and 1.3.