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

Added security to the API server #1677

Merged
merged 14 commits into from
Nov 30, 2023

Conversation

blublinsky
Copy link
Contributor

@blublinsky blublinsky commented Nov 22, 2023

Why are these changes needed?

Right now API server access is completely opened. This defines the approach to secure API server and provides a very simple implementation.

Securing API server endpoint

Related issue number

Closes #1376

Checks

  • [ x] I've made sure the tests are passing.
  • Testing Strategy
    • [ x] Unit tests
    • [ x] Manual tests
    • This PR is not tested :(

@blublinsky
Copy link
Contributor Author

@astefanutti , @z103cb , please take a look

cc: @kevin85421 , @architkulkarni

apiserver/SecuringImplementation.md Outdated Show resolved Hide resolved
apiserver/cmd/proxy/proxy.go Outdated Show resolved Hide resolved
apiserver/deploy/base/apiserver_secure.yaml Outdated Show resolved Hide resolved
helm-chart/kuberay-apiserver/values.yaml Outdated Show resolved Hide resolved
helm-chart/kuberay-apiserver/values.yaml Outdated Show resolved Hide resolved
apiserver/Dockerfile_proxy Outdated Show resolved Hide resolved
apiserver/Dockerfile Outdated Show resolved Hide resolved
Copy link
Contributor

@z103cb z103cb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe that we should be covering the newly added code with some unit tests.

@blublinsky
Copy link
Contributor Author

blublinsky commented Nov 27, 2023

I believe that we should be covering the newly added code with some unit tests.

These are available in this project https://github.com/blublinsky/auth-reverse-proxy

@blublinsky
Copy link
Contributor Author

@tedhtchang can you take a look

Copy link
Contributor

@tedhtchang tedhtchang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@blublinsky The instruction worked w/ some changes. In addition, is it possible to have helm optionally deployed the sidecar with --set security.enable=true ?

apiserver/SecuringImplementation.md Outdated Show resolved Hide resolved
apiserver/SecuringImplementation.md Show resolved Hide resolved
helm-chart/kuberay-apiserver/values.yaml Outdated Show resolved Hide resolved
@blublinsky
Copy link
Contributor Author

@kevin85421 I think its ready for you

Copy link
Contributor

@astefanutti astefanutti left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM overall, once we find an appropriate place to land the reverse proxy parts (in the security directory and the associated workflows) instead to have them in-tree.

@kevin85421 we'd like to have your advice / guidance where you think this could be maintained. Could this be in a dedicated repository in the ray-project organisation? I could also propose we create a ray-contrib organisation, if the former is not an option, to hosts incubating or extension projects.

@kevin85421
Copy link
Member

@kevin85421 we'd like to have your advice / guidance where you think this could be maintained. Could this be in a dedicated repository in the ray-project organisation? I could also propose we create a ray-contrib organisation, if the former is not an option, to hosts incubating or extension projects.

cc @architkulkarni do you have any suggestions?

@architkulkarni
Copy link
Contributor

I don't have any special insight here but I can check with the Ray maintainers. What's the main advantage of having the security directory in a separate repository? Sorry if I missed some of the previous discussion around this.

@blublinsky
Copy link
Contributor Author

blublinsky commented Nov 28, 2023

@kevin85421 @architkulkarni The reason for the question is that security directory contains a very simple implementation, that is easily breakable and as such should never be used in production. The point of PR is to show how the security fits in the overall API server implementation. So provided implementation is really for people to experiment with and then roll out their own implementation. We discussed that on one hand we wanted to give people something to try security with but wanted to make sure that they understand, that this is a very simple "toy" example.

@architkulkarni
Copy link
Contributor

Gotcha! That makes sense, but couldn't we convey that by putting it in an experimental/ folder and adding a prominent warning in a code comment or readme?

@blublinsky
Copy link
Contributor Author

This will work for me. We were looking for your suggestion on the matter

@astefanutti
Copy link
Contributor

@kevin85421 @architkulkarni @blublinsky besides the maturity level of this reverse-proxy component, it's also that it's completely independent from KubeRay. Even if it would become mature enough (which is not the goal as @blublinsky stressed), it would still be as if a project like oauth2-proxy would be pull in-tree into KubeRay.

That being said, that was more to raise awareness so you guys can decide, and if you don't have any objections to having it in-tree, moving that component into an experimental folder sounds like a good compromise as @architkulkarni suggested, and this can still be revisited in the future anyway.

@z103cb
Copy link
Contributor

z103cb commented Nov 29, 2023

@kevin85421 @architkulkarni @blublinsky besides the maturity level of this reverse-proxy component, it's also that it's completely independent from KubeRay. Even if it would become mature enough (which is not the goal as @blublinsky stressed), it would still be as if a project like oauth2-proxy would be pull in-tree into KubeRay.

That being said, that was more to raise awareness so you guys can decide, and if you don't have any objections to having it in-tree, moving that component into an experimental folder sounds like a good compromise as @architkulkarni suggested, and this can still be revisited in the future anyway.

I agree with @astefanutti's comments. Using the experimental folder name is slightly better than using the security folder name. I will be fine with your decision @architkulkarni and @kevin85421.

@blublinsky
Copy link
Contributor Author

@kevin85421 @architkulkarni, please let me know final decision and I will update the PR, which is otherwise ready to merge

@architkulkarni
Copy link
Contributor

Thanks for the clarification! We're okay with keeping it in tree, so let's go with the experimental folder for now. Once that's done, we can merge the PR.

@blublinsky
Copy link
Contributor Author

@kevin85421 @architkulkarni, you can merge it now

Copy link
Contributor

@architkulkarni architkulkarni left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stamp

@architkulkarni architkulkarni merged commit bc90674 into ray-project:master Nov 30, 2023
25 checks passed
@blublinsky blublinsky deleted the apiserver-security branch November 30, 2023 19:31
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 this pull request may close these issues.

[Apiserver] Kuberay apiserver security
6 participants