-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
OIDC provider thumbprints inconsistent and sometimes incorrect #2768
Comments
see #2732 |
Hi @bryantbiggs I don't think #2732 will resolve my issue. Please note that the CA fingerprint in my report is not consistent when I use I will create a PR to resolve #2732 since it will make my problem simpler to see (without the churn of the other fingerprints), but the real issue her is the CA fingerprint inconsistency. |
I don't believe the root CA will be changing - or rather, not changing that often. These are also not something that we can control here, thats up to EKS in terms of when they rotates certs |
I don't think the issue is the root CA is changing, I think the issue is that Terraform thinks it is changing. There seems to be some logic bug where the root CA thumbprint is not always included in the In the output that I provided with my report, you can see that the real CA thumbprint is "9e99a48a9960b14926bb7f3b02e22da2b0ab7280", yet intermittently Terraform does not include this in the As mentioned at the bottom of my report, the debug logs show the correct "9e99a..." thumbprint for the server, even though the thumbprint does not make its way into the |
I have been able to reproduce the same behavior by using the individual resources from the module, so this may be an issue with one of the components rather than this module itself. With the code below, I saw the correct thumbprints applied initially, but then the same incorrect thumbprints intermittently:
Note the missing "9e99a48a9960b14926bb7f3b02e22da2b0ab7280" root CA thumbprint.
|
After some more digging, it seems like the fingerprint churn is in fact caused by the corporate root CA that I mentioned. FindingsOur network has a Zscaler instance running which intercepts HTTPS traffic for inspection. It's then repackaged with the Zscaler root CA fingerprint, which the corporate machines are configured to trust. I ran the following command to continually monitor the certificate chain across multiple requests:
I found that intermittently the Zscaler certificate chain would be returned by this command, which I think is causing the issue with the fingerprints in my EKS cluster. When I manually generate the fingerprint of the Zscaler root CA, it comes out to "c2f78cf04b914dd263be010c902dab7c8b3d09c8", which was the problem fingerprint from my original report. Additionally, the Zscaler certificate chain contains 3 certificates, as opposed to the AWS chain which contains 4, hence the differences in the other certificates from the original bug report. Next stepsNow I know what is causing the problem, but I don't have a clear path to solving it. I'm not sure there is a way for the TLS provider to resolve the actual root CA consistently, since Zscaler is intercepting the traffic and messing with the certificates. I can manually configure the correct fingerprint for the OIDC provider, but the intermittent churn in the automatic module certificates will still occur. Would it be reasonable to add an option to the module to override the fingerprints completely? Any attempt to automatically resolve the certificates in my use case will result in churn at planning/applying time from what I can tell. |
I'm happy to put together a pull request if something like this would be acceptable: override_oidc_thumbprints = true
custom_oidc_thumbprints = [
"9e99a48a9960b14926bb7f3b02e22da2b0ab7280"
] Where the
This UX is my first thought, but there may be clearer approaches. |
I suppose since #2769 is merged, there is only 1 certificate to configure. That might make the wording of the configuration a bit easier. Something like this maybe? include_oidc_ca_thumbprint = false
custom_oidc_thumbprints = [
"9e99a48a9960b14926bb7f3b02e22da2b0ab7280"
] |
This issue has been automatically marked as stale because it has been open 30 days |
This is still an issue, #2778 is waiting for review and should resolve this. |
As a fellow ZScaler user with this exact issue I wold like to see #2778 merged also. |
This issue has been resolved in version 19.20.0 🎉 |
I'm still seeing this issue when running terraoform plan with the latest terraform-aws-eks module version : 19.20.0
(EKS platform version was automatically updated by EKS in the background a few days back)
module.eks.module.eks.aws_iam_openid_connect_provider.oidc_provider[0] will be updated in-place~ resource "aws_iam_openid_connect_provider" "oidc_provider" { I tried clearing .terraform modules but I still see the thumbprint list when running terraform plan I manually checked the thumbprint of the cluster and it looks to be the same value listed in the terraform plan output `$> printf '{"thumbprint": "%s"}\n' $THUMBPRINT {"thumbprint": "9E99A48A9960B14926BB7F3B02E22DA2B0AB7280"}
Am I missing something ? Is this an issue if I still go ahead an run : terraform apply ? |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
Description
When I use
terraform plan
thethumbprint_list
of the includedoidc_provider
changes regularly, even when run back-to-back with no code changes. Additionally, the correct root thumbprint is not always included..terraform
cache and am able to reproduce the issue with a fresh init/apply.Versions
Module version:
Terraform & provider version(s):
Reproduction Code
Steps to reproduce the behavior:
terraform init
terraform apply
terraform plan
(repeat until Terraform shows changes, usually happens within 2-3 attempts)Expected behavior
I also expect the root certificate for my region (9e99a48a9960b14926bb7f3b02e22da2b0ab7280) to be in the thumbprint list for the provider.
Actual behavior
terraform apply
created a provider with 3 certificates:The root certificate is missing here, and attempting to use a service account with this provider will fail unless "9e99a48a9960b14926bb7f3b02e22da2b0ab7280" is included.
After changing nothing, I ran
terraform plan
. The first time there were no necessary changes.The second time
terraform plan
was run, all of the certificates were changed, and the root certificate is now included:I did not apply this change by typing "no".
I ran
terraform plan
again, and the output is inconsistent again. This time thecluster_tls_certificate_sha1_fingerprint
value changed, as did the proposed changes to thethumbprint_list
.I have tried using the "c2f78cf04b914dd263be010c902dab7c8b3d09c8" certificate but the cluster service accounts don't work. When I manually retrieve the thumbprint for the server, I get "9e99a48a9960b14926bb7f3b02e22da2b0ab7280", which is the only one that works for my service accounts.
The planning behavior isn't consistent. Another time when I cleared out the cache and re-applied, the initial deployment used the correct root certificate and then later went back to the "c2f78..." one. The root certificate seems to flip-flop between "9e99a..." and "c2f78..." but the other certificates are inconsistent.
Additional context
I'm not sure if it's relevant, but I am in a corporate environment with a custom root CA. Given that there aren't other similar issues, I am suspicious that this is involved in the root cause, but I am not sure why that would be since the corporate certificate is consistent and doesn't cause problems for other applications.
I recorded
DEBUG
logs for this scenario, and according to the logs the "9e99a48a9960b14926bb7f3b02e22da2b0ab7280" certificate is still detected as the thumbprint for the server, even when it is not included in the finalthumbprint_list
which is weird and seems like a logic bug somewhere.The text was updated successfully, but these errors were encountered: