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

Breaking change caused by new ingress-nginx custom header annotation #111

Closed
cterence opened this issue Aug 29, 2024 · 7 comments · Fixed by #112
Closed

Breaking change caused by new ingress-nginx custom header annotation #111

cterence opened this issue Aug 29, 2024 · 7 comments · Fixed by #112

Comments

@cterence
Copy link

#106 changed the way to add custom headers, but it was not correctly implemented as my ingress-nginx was responding 503 errors after the chart update.

The change is broken in two ways:

  • No namespace prefix before the configmap name in nginx.ingress.kubernetes.io/custom-headers: {{ $ingress.customHeadersConfigMap }} : ingress-nginx therefore tries to find the configmap in its own namespace, which is not where vaultwarden is deployed in my cluster
  • Applying the previous fix caused an error in ingress-nginx: error reading Ingress annotation" err="location denied, reason: header Request-Id is not allowed, defined allowed headers inside global-allowed-response-headers []".

The first problem is a quick fix in the helm templates (nginx.ingress.kubernetes.io/custom-headers: {{ .Release.Namespace }}/{{ $ingress.customHeadersConfigMap }}) but the second is not trivial as it's a breaking change which requires users of this chart to modify their ingress-nginx configuration to support this new feature.

I would recommend reverting this change and releasing a new major version for this chart if the intention is to use this new method for passing custom headers.

@guerzon
Copy link
Owner

guerzon commented Aug 30, 2024

Thanks for submitting the issue @cterence. Perhaps this is also the issue that @RealKelsar encounters.

I actually found the note on global-allowed-response-headers but I let it go after not being able to replicate an issue in my lab environments. My bad!

Having said that, I prefer not to revert the change since it also served as risk avoidance on a CVE which could impact multi-tenant clusters. Instead, I would prefer to add a documentation/warning about the controller-level requirement and make this values configuration (and the corresponding ConfigMap optional).

@RealKelsar
Copy link

Yes, those two changes make it work for me again. Sorry, simply had no time yet to investigate.

@cterence
Copy link
Author

Hello @guerzon,your proposed solution sounds good to me, thank you!

@RealKelsar
Copy link

Sorry, but that makes it worse.

Without configmap it does not work at all.

With the new format of the customHeadersConfigMap: the ingress gets the wrong Annotation, instead of the configMap Name it gets the content, which does not work.

The Default should be the configMap with the Req-ID and the default used for the Ingress should be

$vaultwardenNamespace/customHeadersConfigMap

I like the possibility to add more Headers easily thou.

@guerzon
Copy link
Owner

guerzon commented Aug 30, 2024

Sorry, but that makes it worse.

Without configmap it does not work at all.

With the new format of the customHeadersConfigMap: the ingress gets the wrong Annotation, instead of the configMap Name it gets the content, which does not work.

The Default should be the configMap with the Req-ID and the default used for the Ingress should be

$vaultwardenNamespace/customHeadersConfigMap

I like the possibility to add more Headers easily thou.

Hi @RealKelsar, are you able to test my change in #113? Hope this should be enough

@RealKelsar
Copy link

RealKelsar commented Aug 30, 2024

#113 seems to work and I learned how to pull a PR with Argo :)

Somewhere on my list is Helm chart writing...

@guerzon
Copy link
Owner

guerzon commented Aug 30, 2024

Thanks, I have merged #113.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants
@RealKelsar @cterence @guerzon and others