-
Notifications
You must be signed in to change notification settings - Fork 109
feat(access-control-service): add access-control-service to authorize the requests to /wsapi and Computing Unit endpoints
#3598
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
Conversation
# Conflicts: # core/computing-unit-managing-service/src/main/scala/edu/uci/ics/texera/service/resource/ComputingUnitManagingResource.scala
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
|
Can you also include the design diagram in the PR description? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please check those comments.
...ntrol-service/src/main/scala/edu/uci/ics/texera/service/resource/AccessControlResource.scala
Show resolved
Hide resolved
...ntrol-service/src/main/scala/edu/uci/ics/texera/service/resource/AccessControlResource.scala
Show resolved
Hide resolved
...ntrol-service/src/main/scala/edu/uci/ics/texera/service/resource/AccessControlResource.scala
Show resolved
Hide resolved
core/access-control-service/src/test/scala/edu/uci/ics/texera/AccessControlResourceSpec.scala
Show resolved
Hide resolved
deployment/k8s/texera-helmchart/templates/access-control-service-deployment.yaml
Show resolved
Hide resolved
|
This PR has 16 files. Can we divide it into smaller PRs? |
## Update This PR fixes formatting issues that introduce redundant file changes in the core [PR](#3598).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Access Control Service
This service is currently used only by envoy as authorization service. It act as a third party service to authorize any request sent to the computing unit to get socket connection through
/wsapi. It parses theuser-tokenfrom URL parameters and then check user access to the computing unit by checking the database and add the corresponding information to the following headers:If the service can not parse the token or fail for any reason, the access to computing unit is denied by envoy. If the authorization succeed, the user is directly connected to computing unit using
Upgradeon the firstHTTPhandshake request so the latency will not change.The new connection flow
HTTPrequest to connect to a specific Computing Unit.x-user-cu-access,x-user-id,x-user-name) into the request and sends an approval back to Envoy.If authorization fails at any point, Envoy immediately denies the connection request, and the user is prevented from accessing the Computing Unit. This new process provides enhanced security, a centralized authorization logic, and is designed to have no performance impact on the established WebSocket connection since the check is performed only on the initial handshake.
Summary of file changes
core/auth/src/main/scala/edu/uci/ics/texera/auth/util/ComputingUnitAccess.scalaREAD,WRITE,NONE) for a given Computing Unit.core/auth/src/main/scala/edu/uci/ics/texera/auth/util/HeaderField.scalax-user-cu-access,x-user-id, etc.) that are injected by the Access Control Service.core/amber/src/main/scala/edu/uci/ics/texera/web/ServletAwareConfigurator.scalaUserobject from them; otherwise, it falls back to the old method of parsing the JWT from URL parameters for single-node mode.core/amber/src/main/scala/edu/uci/ics/texera/web/SessionState.scalacore/amber/src/main/scala/edu/uci/ics/texera/web/resource/WorkflowWebsocketResource.scalaWRITEprivilege before allowing aWorkflowExecuteRequest.deployment/access-control-service.dockerfiledeployment/k8s/texera-helmchart/templates/access-control-service-deployment.yamldeployment/k8s/texera-helmchart/templates/access-control-service-service.yamldeployment/k8s/texera-helmchart/templates/envoy-config.yamlext_authz). It intercepts relevant requests, forwards them for an authorization check, and then passes the injected headers to the upstream service (AmberMaster).deployment/k8s/texera-helmchart/values.yamlcore/gui/src/app/workspace/component/menu/menu.component.ts&.htmlWRITEaccess to the selected Computing Unit, providing immediate visual feedback.core/build.sbtAccessControlServicemodule.core/config/src/main/scala/edu/uci/ics/amber/util/PathUtils.scala