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

isHttpsAvailable isn't reliable #1883

Closed
willthames opened this issue Nov 29, 2019 · 2 comments · Fixed by #3836
Closed

isHttpsAvailable isn't reliable #1883

willthames opened this issue Nov 29, 2019 · 2 comments · Fixed by #3836

Comments

@willthames
Copy link

Doing a GET on https://$KUBERNETES_MASTER/ to decide whether isHttpsAvailable is problematic

  • Most roles without full cluster permissions are unable to GET / - whereas all authenticated users are in the system:discovery group which could call GET /api for example
$ curl k -H "Authorization: Bearer $KUBERNETES_TOKEN" https://$KUBERNETES_SERVICE_HOST:$KUBERNETES_SERVICE_PORT/
{
  "kind": "Status",
  "apiVersion": "v1",
  "metadata": {
    
  },
  "status": "Failure",
  "message": "forbidden: User \"system:serviceaccount:default:default\" cannot get path \"/\"",
  "reason": "Forbidden",
  "details": {
    
  },
  "code": 403
}
$ curl k -H "Authorization: Bearer $KUBERNETES_TOKEN" https://$KUBERNETES_SERVICE_HOST:$KUBERNETES_SERVICE_PORT/api
{
  "kind": "APIVersions",
  "versions": [
    "v1"
  ],
  "serverAddressByClientCIDRs": [
    {
      "clientCIDR": "0.0.0.0/0",
      "serverAddress": "ip-10-0-167-167.ap-southeast-2.compute.internal:443"
    }
  ]
}
  • There is no distinction made between an unauthorized response (log an error and bomb out) and being unable to talk HTTPS to an HTTP server
@stale
Copy link

stale bot commented Feb 27, 2020

This issue has been automatically marked as stale because it has not had any activity since 90 days. It will be closed if no further activity occurs within 7 days. Thank you for your contributions!

@manusa
Copy link
Member

manusa commented Aug 25, 2020

Should consider 403 status too as a valid option. Probably even any status code (except 5**) should be considered since the SSL handshake was successful.

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

Successfully merging a pull request may close this issue.

2 participants