How to make a query in AWS Config to find TLS version for Loadbalancer

0

Hi,

I writed this query in AWS config to find the minimumProtocolVersion for my Cloudfront distribution with https :

SELECT
  accountId,
  resourceId,
  configuration.distributionConfig.comment,
  configuration.distributionConfig.viewerCertificate.minimumProtocolVersion,
  relationships
WHERE
  resourceType = 'AWS::CloudFront::Distribution'

How can I do the same with my Loadbalancer ?

I have found nothing about minimumProtocolVersion for Loadbalancer in https://github.com/awslabs/aws-config-resource-schema/blob/master/config/properties/resource-types/AWS::ElasticLoadBalancingV2::LoadBalancer.properties.json

What is the solution ?

Thx

Best regards

Benoit

2개 답변
0
수락된 답변

Using Config you cannot get the Listener attributes you need to do this query. There is an Issue logged to ask for that, that has not had response for 2 years in the GitHub Repository.

Given that you can't use config to do it, here is another way to get the informaion. Using the AWS CLI and PowerShell the following script will get you the list of listeners associated with a load balancer and the SslPolicy they used.

$loadbalancers = ((aws elbv2 describe-load-balancers) | ConvertFrom-Json).LoadBalancers
$SslList = @()
foreach ($loadbalancer in $loadbalancers) {
    $listeners = ((aws elbv2 describe-listeners --load-balancer-arn $loadbalancer.LoadBalancerArn) | ConvertFrom-Json).Listeners
    foreach ($listener in $listeners) {
        $SslList += $listener | Select-Object LoadBalancerArn, ListenerArn, SslPolicy
    }
}
$SslList | ConvertTo-Json
profile picture
답변함 일 년 전
0

Thx for your answer. I wrote the same kind of script with Python. It's a shame that AWS doesn't support listeners attributes.

Best regards

Benoit

답변함 일 년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠