Open lawliet89 opened 4 years ago
Hello,
Can you confirm that the issue didn't occur again after you swapped back to built-in CA ?
Thanks,
Marius.
@mariusehr1 Yes I can confirm that.
I'm not likely to switch back to Vault CA because the friction and potential for issues seem to be too high for my liking.
Ok , good to know.
I am experiencing the same issue at the moment, im switching back to built-in , hopping for a change.
Just out of curiosity : are you using consul in production ? and if so , for how long as it been working?
Thanks Marius
Overview of the Issue
I recently converted Connect CA to use Vault from the internal CA. I am using TLS with Auto Encrypt turned on. The cluster is running on Kubernetes with the official Consul Helm chart. That is, the agents are using the certificates issued by Consul Connect.
I noticed immediately that the certificates issued to agents were crossed signed in a particularly confusing manner (as a human to grok). However, it seemed like most tools were able to validate the certificates fine.
Two weeks later, when the cross signed intermediate certificate expired, I notice that the agents were still serving the expired intermediate certificates. This led to tools that depended on Consul API
< 1.4.0
to fail to validate the certificate chain, with issues like https://github.com/hashicorp/consul-esm/issues/84This morning, I noticed that all my workloads that depended on Consul agents were crashing.
For posterity, this was posted on 2020-09-14 2350 UTC
Here's what I found:
Vault CA expires some time on 2020-09-14
Consul rotated the Vault root CA some time on 2020-09-04.
It did not update the new CA in the
/v1/connect/ca/roots
endpoint! The output below was obtained at about 2020-09-04 2130 UTC.All my workloads were seeing the old CA and could not validate the new certificate signed by the new CA.
Example Certificate issued by the new Vault CA
``` -----BEGIN CERTIFICATE----- MIICujCCAmCgAwIBAgIUGxGEkMbtHG46/f7jANEZGcvLNt8wCgYIKoZIzj0EAwIwLzEtMCsGA1UEAxMkcHJpLTFsMHNvNW4udmF1bHQuY2EuY2E0MWJmNGQuY29uc3VsMB4XDTIwMDkxNDIxNDUxMloXDTIwMDkxNzIxNDU0MlowQDE+MDwGA1UEAxM1Z2tlc3RhZ2luZ2NvcmVjb3JlZTI3YmM1NTFmNnZrOWEuYWdudC5kdW1teS50ci5jb25zdWwwWTATBgcqhkjOPQIBBggqhkjOPQMBBwNCAATN8SCaBCUr06xW5vfC0LwHWs+hemjFVGMC2tGEbjKGRVaq5aHN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owLzEtMCsGA1UEAxMkcHJpLTFsMHNvNW4udmF1bHQuY2EuY2E0MWJmNGQuY29uc3VsMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEb1EVEBEq54AY6kqWRV4K0dyDUdz5hpZDkTBeKjm572go2/TbHxSsyO7XXkNatQulP9HDKsT+ssPqCfgnLj1wsqOByzCByDAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUmCbYHWTDSkd7EZ9DjfimaaPYaA4wHwYDVR0jBBgwFoAU4J398T8zt+T2pBTzMuVyEaMqV8kwZQYDVR0RBF4wXIIkcHJpLTFsMHNvNW4udmF1bHQuY2EuY2E0MWJmNGQuY29uc3VshjRzcGlmZmU6Ly9jYTQxYmY0ZC0wMWYzLTM0MjEtNDJiNi0wNDc2N2E0M2FkNjYuY29uc3VsMAoGCCqGSM49BAMCA0gAMEUCIQCyywIOd03fP9iTAHF5qDGO7zvbsNO+EnTJ2F0yVyxFhgIgEEZDVPf+bFfuDZ2LfYpADze7GLB2EXbfMyklB4s6iI4= -----END CERTIFICATE----- ```I have since migrated back to Connect internal CA and the certificates look fine now. The information requested and gathered below might not be useful. I did not have time to stop and collect information while everything was on fire.
Reproduction Steps
Steps to reproduce this issue, eg:
/v1/connect/ca/roots
Consul info for both Client and Server
Client info
``` agent: check_monitors = 0 check_ttls = 1 checks = 1 services = 1 build: prerelease = revision = a9322b9c version = 1.8.3 consul: acl = disabled known_servers = 5 server = false runtime: arch = amd64 cpu_count = 4 goroutines = 162 max_procs = 4 os = linux version = go1.14.7 serf_lan: coordinate_resets = 0 encrypted = true event_queue = 0 event_time = 237 failed = 0 health_score = 0 intent_queue = 0 left = 1 member_time = 112943 members = 20 query_queue = 0 query_time = 2 ```Server info
``` agent: check_monitors = 0 check_ttls = 0 checks = 0 services = 0 build: prerelease = revision = a9322b9c version = 1.8.3 consul: acl = disabled bootstrap = false known_datacenters = 1 leader = false leader_addr = 172.19.7.22:8300 server = true raft: applied_index = 207189814 commit_index = 207189814 fsm_pending = 0 last_contact = 78.699669ms last_log_index = 207189814 last_log_term = 1292 last_snapshot_index = 207177581 last_snapshot_term = 1284 latest_configuration = [{Suffrage:Voter ID:20c563f8-1f25-df37-f33a-4fc3691f1542 Address:172.19.7.22:8300} {Suffrage:Voter ID:a1c5efa1-bfe1-370d-d698-43ac7d6f3601 Address:172.19.11.7:8300} {Suffrage:Voter ID:cdc55cb7-d517-15f1-d960-29933fb18568 Address:172.19.4.69:8300} {Suffrage:Voter ID:fe7364e2-1c64-0b3c-b99c-2b6c06b85048 Address:172.19.0.9:8300} {Suffrage:Voter ID:c316f35f-65e5-4007-4f34-7398456c0da9 Address:172.19.9.100:8300}] latest_configuration_index = 0 num_peers = 4 protocol_version = 3 protocol_version_max = 3 protocol_version_min = 0 snapshot_version_max = 1 snapshot_version_min = 0 state = Follower term = 1292 runtime: arch = amd64 cpu_count = 4 goroutines = 244 max_procs = 4 os = linux version = go1.14.7 serf_lan: coordinate_resets = 0 encrypted = true event_queue = 0 event_time = 237 failed = 0 health_score = 0 intent_queue = 0 left = 1 member_time = 112947 members = 20 query_queue = 0 query_time = 2 serf_wan: coordinate_resets = 0 encrypted = true event_queue = 0 event_time = 1 failed = 0 health_score = 0 intent_queue = 0 left = 0 member_time = 2239 members = 5 query_queue = 0 query_time = 1 ```Operating system and Environment details