Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(metrics): Export RDS Certificate Authority attributes #38

Merged
merged 2 commits into from
Nov 24, 2023

Conversation

chtitux
Copy link
Contributor

@chtitux chtitux commented Nov 21, 2023

  • The CA identifier is exposed as ca_certificate_identifier attribute of the rds_instance_info metric
  • The Unix timestamp of the expiration date of the CA certificate is exposed in the rds_ca_certificate_valid_until gauge.

For the rds-ca-2019 RDS CA, values are:

rds_instance_info{aws_account_id="012345678901",aws_region="eu-west-1",ca_certificate_identifier="rds-ca-2019",dbidentifier="rds-1",...}
rds_ca_certificate_valid_until{aws_account_id="012345678901",aws_region="eu-west-1",dbidentifier="rds-1"} 1.72434653e+09

@chtitux chtitux added the enhancement New feature or request label Nov 21, 2023
@chtitux
Copy link
Contributor Author

chtitux commented Nov 21, 2023

#sre

README.md Outdated Show resolved Hide resolved
internal/app/rds/rds.go Outdated Show resolved Hide resolved
@chtitux chtitux force-pushed the monitor-certificate-authority branch from 420fadb to 80e0a53 Compare November 21, 2023 12:48
README.md Show resolved Hide resolved
…ate_identifier label) in rds_instance_info

The description of the possible values are documented on https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/UsingWithRDS.SSL.html
This metric exposes the Unix timestamp of the expiration date of the instance certificate.
This is different from the expiration of the root certificate of the chain, which may be in more than 10 years in the future.

According to AWS documentation on https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/UsingWithRDS.SSL-certificate-rotation.html ,
the certificate for instances that support certificate renewal without restart, such as RDS and Aurora, is renewed at half time.
For those instances, the certificates is issued for 12 months.

Hence, we should expect a new expiry timestamp every ~6 months, with a value not lower than now minus 6 months.
@chtitux chtitux force-pushed the monitor-certificate-authority branch from 80e0a53 to f729812 Compare November 21, 2023 13:42
@chtitux
Copy link
Contributor Author

chtitux commented Nov 21, 2023

PR updated to include 2 commits : 1 for each attribute.

Copy link

Code Coverage

Package Line Rate Health
github.com/qonto/prometheus-rds-exporter/internal/app/cloudwatch 88%
github.com/qonto/prometheus-rds-exporter/internal/app/ec2 88%
github.com/qonto/prometheus-rds-exporter/internal/app/rds 78%
github.com/qonto/prometheus-rds-exporter/internal/app/servicequotas 51%
github.com/qonto/prometheus-rds-exporter/internal/app/unit 100%
Summary 82% (516 / 633)

Minimum allowed line rate is 60%

@chtitux chtitux merged commit 8a6e65e into main Nov 24, 2023
8 checks passed
chtitux added a commit that referenced this pull request Dec 5, 2023
…ce_info metric in README description

This label has been introduced in #38 , but README.md has not been updated with this new label
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants