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

Consul Health Check: security-spiffe-token-provider 400 Bad Request #4531

Closed
bnevis-i opened this issue Apr 26, 2023 · 4 comments · Fixed by #4536
Closed

Consul Health Check: security-spiffe-token-provider 400 Bad Request #4531

bnevis-i opened this issue Apr 26, 2023 · 4 comments · Fixed by #4536
Labels
bug Something isn't working
Milestone

Comments

@bnevis-i
Copy link
Collaborator

🐞 Bug Report

Affected Services [REQUIRED]

security-spiffe-token-provider

Is this a regression?

No

Description and Minimal Reproduction [REQUIRED]

Health check for security-spiffe-token-provider is failing because in order to do SPIFFE authentication, the web service must use HTTPS. Should find an alternative way to implement the health check so that it doesn't erroneously fail, or omit it altogether. It will likely not be possible to make Consul into a SPIFFE client.

🔥 Exception or Error


HTTP GET http://edgex-security-spiffe-token-provider:59841/api/v3/ping: 400 Bad Request Output: Client sent an HTTP request to an HTTPS server.

🌍 Your Environment

Deployment Environment: Docker

EdgeX Version [REQUIRED]: minnesota dev (likely present in earlier releases as well)

Anything else relevant?

@bnevis-i bnevis-i added the bug Something isn't working label Apr 26, 2023
@lenny-goodell lenny-goodell added this to the Minnesota milestone Apr 26, 2023
@lenny-goodell
Copy link
Member

We previously removed Protocol from the Service configuration.

We could put it back and default to HTTP (if not set) by bootstrap when registering with Consul if not set. This service could set it to HTTPS and used by bootstrap when it registers the service with Consul.

@bnevis-i
Copy link
Collaborator Author

bnevis-i commented Apr 26, 2023

We previously removed Protocol from the Service configuration.

We could put it back and default to HTTP (if not set) by bootstrap when registering with Consul if not set. This service could set it to HTTPS and used by bootstrap when it registers the service with Consul.

It still won't be able to work even if HTTPS was available because it won't pass the authentication check. A TCP port check is probably the best we can do, as HTTPS requires a spiffe client certificate.

@lenny-goodell
Copy link
Member

It still won't be able to work even if HTTPS was available because it won't pass the authentication check.

I thought that you disabled authentication check for the ping endpoints.

@bnevis-i
Copy link
Collaborator Author

bnevis-i commented Apr 27, 2023

It still won't be able to work even if HTTPS was available because it won't pass the authentication check.

I thought that you disabled authentication check for the ping endpoints.

I did, but it is blocked at the TLS level :-(

One possible workaround is to run two HTTP servers -- one to serve the healthcheck, the other that is the actual TLS service.

bnevis-i added a commit that referenced this issue Apr 27, 2023
go-mod-bootstrap only allows registration of HTTP healtchecks with consul, which will not work for this service, as it requires clients have a client TLS certificate.  In any case, registration is not required for proper functioning of the service

Closes #4531

Signed-off-by: Bryon Nevis <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants