Table: aws_acm_certificate - Query AWS Certificate Manager certificates using SQL
The AWS Certificate Manager (ACM) is a service that lets you easily provision, manage, and deploy public and private Secure Sockets Layer/Transport Layer Security (SSL/TLS) certificates for use with AWS services and your internal connected resources. SSL/TLS certificates are used to secure network communications and establish the identity of websites over the Internet as well as resources on private networks. AWS Certificate Manager removes the time-consuming manual process of purchasing, uploading, and renewing SSL/TLS certificates.
Table Usage Guide
The aws_acm_certificate
table in Steampipe provides you with information about certificates within AWS Certificate Manager (ACM). This table allows you, as a DevOps engineer, to query certificate-specific details, including domain name, status, issuer, and expiration data. You can utilize this table to gather insights on certificates, such as certificate status, verification of issuer, and more. The schema outlines the various attributes of the ACM certificate for you, including the certificate ARN, creation date, domain name, and associated tags.
Examples
Basic info
Analyze the settings to understand the status and usage of your AWS Certificate Manager (ACM) certificates. This can help identify any issues with certificates, such as failure reasons, and see which domains they're associated with, aiding in efficient resource management and troubleshooting.
select certificate_arn, domain_name, failure_reason, in_use_by, status, key_algorithmfrom aws_acm_certificate;
select certificate_arn, domain_name, failure_reason, in_use_by, status, key_algorithmfrom aws_acm_certificate;
List of expired certificates
Identify instances where your AWS certificates have expired. This allows you to maintain security by promptly replacing or renewing these certificates.
select certificate_arn, domain_name, statusfrom aws_acm_certificatewhere status = 'EXPIRED';
select certificate_arn, domain_name, statusfrom aws_acm_certificatewhere status = 'EXPIRED';
List certificates for which transparency logging is disabled
Discover the segments with disabled transparency logging in certificate settings to enhance security and compliance efforts. This allows for proactive mitigation of potential risks associated with non-transparent logging.
select certificate_arn, domain_name, statusfrom aws_acm_certificatewhere certificate_transparency_logging_preference <> 'ENABLED';
select certificate_arn, domain_name, statusfrom aws_acm_certificatewhere certificate_transparency_logging_preference != 'ENABLED';
List certificates without application tag key
Identify the certificates that are missing an application tag key. This can help in pinpointing areas where tagging conventions may not have been followed, aiding in better resource management.
select certificate_arn, tagsfrom aws_acm_certificatewhere not tags :: JSONB ? 'application';
select certificate_arn, tagsfrom aws_acm_certificatewhere json_extract(tags, '$.application') is null;
Query examples
- acm_certificate_1_year_count
- acm_certificate_24_hours_count
- acm_certificate_30_90_days_count
- acm_certificate_30_days_count
- acm_certificate_90_365_days_count
- acm_certificate_by_account
- acm_certificate_by_age
- acm_certificate_by_region
- acm_certificate_by_type
- acm_certificate_by_validity
- acm_certificate_count
- acm_certificate_domain_validation_options
- acm_certificate_in_use_by
- acm_certificate_input
- acm_certificate_invalid
- acm_certificate_key_algorithm
- acm_certificate_key_usage
- acm_certificate_overview
- acm_certificate_renewal_eligibility_ineligible
- acm_certificate_revoked_count
- acm_certificate_tags
- acm_certificate_transparency_logging_disabled
- acm_certificate_validity
- acm_certificates_for_ec2_application_load_balancer
- acm_certificates_for_ec2_classic_load_balancer
- acm_certificates_for_ec2_gateway_load_balancer
- acm_certificates_for_ec2_network_load_balancer
- cloudfront_distributions_for_acm_certificate
- ec2_application_load_balancers_for_acm_certificate
- ec2_classic_load_balancers_for_acm_certificate
- ec2_network_load_balancers_for_acm_certificate
Control examples
- ACM certificates should not expire within 30 days
- All Controls > ACM > ACM certificates should have transparency logging enabled
- All Controls > ACM > ACM certificates should not use wildcard certificates
- All Controls > ACM > Ensure that ACM certificates are not in failed state
- All Controls > ACM > Ensure that ACM certificates are not in pending validation state
- All Controls > ACM > Ensure that all the expired ACM certificates are removed
- All Controls > ACM > RSA certificates managed by ACM should use a key length of at least 2,048 bits
- All Controls > ELB > ELB application load balancers secured listener certificate should not expire within next 30 days
- All Controls > ELB > ELB application load balancers secured listener certificate should not expire within next 7 days
- AWS Foundational Security Best Practices > ACM > 1 Imported ACM certificates should be renewed after a specified time period
- AWS Foundational Security Best Practices > ACM > 2 RSA certificates managed by ACM should use a key length of at least 2,048 bits
Schema for aws_acm_certificate
Name | Type | Operators | Description |
---|---|---|---|
_ctx | jsonb | Steampipe context in JSON form. | |
account_id | text | =, !=, ~~, ~~*, !~~, !~~* | The AWS Account ID in which the resource is located. |
akas | jsonb | Array of globally unique identifier strings (also known as) for the resource. | |
certificate | text | The ACM-issued certificate corresponding to the ARN specified as input | |
certificate_arn | text | = | Amazon Resource Name (ARN) of the certificate. This is of the form: arn:aws:acm:region:123456789012:certificate/12345678-1234-1234-1234-123456789012 |
certificate_chain | text | The ACM-issued certificate corresponding to the ARN specified as input | |
certificate_transparency_logging_preference | text | Indicates whether to opt in to or out of certificate transparency logging. Certificates that are not logged typically generate a browser error. Transparency makes it possible for you to detect SSL/TLS certificates that have been mistakenly or maliciously issued for your domain. | |
created_at | timestamp with time zone | The time at which the certificate was requested. This value exists only when the certificate type is AMAZON_ISSUED | |
domain_name | text | Fully qualified domain name (FQDN), such as www.example.com or example.com, for the certificate | |
domain_validation_options | jsonb | Contains information about the initial validation of each domain name that occurs as a result of the RequestCertificate request. This field exists only when the certificate type is AMAZON_ISSUED | |
extended_key_usages | jsonb | Specify one or more ExtendedKeyUsage extension values. | |
failure_reason | text | The reason the certificate request failed. This value exists only when the certificate status is FAILED | |
imported_at | timestamp with time zone | The name of the certificate authority that issued and signed the certificate | |
in_use_by | jsonb | A list of ARNs for the AWS resources that are using the certificate | |
issued_at | timestamp with time zone | A list of ARNs for the AWS resources that are using the certificate. A certificate can be used by multiple AWS resources | |
issuer | text | The name of the certificate authority that issued and signed the certificate | |
key_algorithm | text | = | The algorithm that was used to generate the public-private key pair |
not_after | timestamp with time zone | The time after which the certificate is not valid | |
not_before | timestamp with time zone | The time before which the certificate is not valid | |
partition | text | The AWS partition in which the resource is located (aws, aws-cn, or aws-us-gov). | |
region | text | The AWS Region in which the resource is located. | |
renewal_eligibility | text | Specifies whether the certificate is eligible for renewal. | |
revocation_reason | text | The reason the certificate was revoked. This value exists only when the certificate status is REVOKED | |
revoked_at | timestamp with time zone | The time at which the certificate was revoked. This value exists only when the certificate status is REVOKED | |
serial | text | The serial number of the certificate | |
signature_algorithm | text | The algorithm that was used to sign the certificate | |
sp_connection_name | text | =, !=, ~~, ~~*, !~~, !~~* | Steampipe connection name. |
sp_ctx | jsonb | Steampipe context in JSON form. | |
status | text | = | The status of the certificate |
subject | text | The name of the entity that is associated with the public key contained in the certificate | |
subject_alternative_names | jsonb | One or more domain names (subject alternative names) included in the certificate. This list contains the domain names that are bound to the public key that is contained in the certificate. The subject alternative names include the canonical domain name (CN) of the certificate and additional domain names that can be used to connect to the website | |
tags | jsonb | A map of tags for the resource. | |
tags_src | jsonb | A list of tags associated with certificate | |
title | text | Title of the resource. | |
type | text | The source of the certificate. For certificates provided by ACM, this value is AMAZON_ISSUED. |
Export
This table is available as a standalone Exporter CLI. Steampipe exporters are stand-alone binaries that allow you to extract data using Steampipe plugins without a database.
You can download the tarball for your platform from the Releases page, but it is simplest to install them with the steampipe_export_installer.sh
script:
/bin/sh -c "$(curl -fsSL https://steampipe.io/install/export.sh)" -- aws
You can pass the configuration to the command with the --config
argument:
steampipe_export_aws --config '<your_config>' aws_acm_certificate