Home > Back-end >  Restricting Sagemaker studio jupyterkenel app sudo access for user
Restricting Sagemaker studio jupyterkenel app sudo access for user

Time:07-12

Is it possible to restrict sudo access for users in the jupyterserver kernel app when running sagemaker studio? or is it easier to just configure the vpc to prevent outbound traffice?

CodePudding user response:

Configuring VPC to restrict outbound traffic is quite easy. You can start from here. There are lot of AWS Official blogs/samples written on this topic but you can start with these: Securing Amazon SageMaker Studio connectivity using a private VPC Amazon SageMaker Studio in a private VPC with NAT Gateway and Network Firewall

on the topic of sudo access, Studio uses run-as POSIX user/group to manage the JupyterServer app and KernelGateWay app. The JupyterServer app user is run as sagemaker-user, which has sudo permission to enable installation of yum packages, whereas the KernelGateway app user is run as root and can perform pip/conda installs, but neither can access the host instance. Apart from the default run-as user, the user inside the container is mapped to a non-privileged user ID range on the notebook instances. This is to ensure that the user can’t escalate privileges to come out of the container and perform any restricted operations in the EC2 instance.

In addition, SageMaker adds specific route rules to block requests to Amazon EFS and the instance metadata service (IMDS) from the container, and users can’t change these rules. All the inter-network traffic in Studio is TLS 1.2 encrypted, barring some intra-node traffic like communication between nodes in a distributed training or processing job and communication between a service control plane and training instances. Check out this blog to understand better on How Studio runs

  • Related