WEBVTT

00:00.000 --> 00:00.520
All right.

00:00.520 --> 00:02.460
Welcome, everyone, to our next talk.

00:02.460 --> 00:05.900
I'd like to welcome Barton Rhodes on securing your Kubeflow clusters.

00:05.900 --> 00:08.160
Everybody, please give him a round of applause.

00:12.000 --> 00:12.900
Thank you.

00:14.100 --> 00:14.760
So, yeah.

00:14.760 --> 00:23.740
I'll talk to you a bit about Kubeflow and Kubernetes and how to get it set up in a way that is not going to compromise your data.

00:24.420 --> 00:26.540
So, first of all, what is Kubeflow?

00:26.880 --> 00:35.400
Kubeflow is a set of open source components that are running on Kubernetes and are designed for end-to-end deployments of your machine learning models.

00:35.400 --> 00:41.720
So, you may have seen this quote or heard it on a recent podcast.

00:41.900 --> 00:43.700
It's a quote by Ian Coldwater.

00:43.800 --> 00:50.280
She said that containers are only as secure as their runtimes and their orchestration frameworks and their kernels and their operating systems and everything else.

00:50.720 --> 01:02.260
So, this is not a talk about Kubernetes security, per se, or container security, and we have excellent venues and talks at cons right now where you can go and learn about these things.

01:02.640 --> 01:31.180
What I wanted to do, rather than go into detail on that, is to introduce you to Kubeflow, let you know that it exists, and help you get started with it in a way that will give you some secure defaults and will allow you to prevent data exfiltration and help you to understand a little bit about the security model of Kubeflow and point you at resources that you can use to learn more about the underlying stack.

01:31.760 --> 01:35.660
So , this may not be new to most of you.

01:35.660 --> 01:41.740
I think originally I saw this chart in the paper called the Hidden Technical Debt Machine Learning.

01:41.740 --> 01:53.900
So, the actual machine learning code, the training code that you use to run your model is only a small portion of most of the things that go into making a successful deployment of a machine learning project.

01:55.320 --> 02:05.860
In many cases, the hard part begins once you have illustrated the value of the project, once you've shown that it works on your test data set, and you are asked to integrate it.

02:05.860 --> 02:11.460
And this is not a skill set that a lot of people coming from statistics or data science are equipped with.

02:11.460 --> 02:27.780
Obviously, people in this room are a slightly different mix from a typical data science environment, but that's effectively the goal of the project is to find open source components, existing cloud native technologies for every step of the way in deploying the model,

02:27.780 --> 02:39.180
starting with data pre-processing in a consistent manner to training your model to actually tuning your hyperparameters, keeping track of your experiments and metadata associated with actual model training.

02:39.340 --> 02:47.340
So, it's also a nice way of making data scientists comfortable with a number of Kubernetes concepts.

02:47.340 --> 03:00.880
Arguably, Kubernetes is not the right level of abstraction for a lot of us to understand the data science people and analysts understand the infrastructure that we consume.

03:01.180 --> 03:02.880
Typically, we just want to have compute.

03:02.880 --> 03:07.120
We want to be able to run our models within a certain amount of time.

03:07.120 --> 03:11.560
We want to be able to migrate our workloads between different deployment environments.

03:11.740 --> 03:20.000
And we want to do it in a manner that's familiar to us and using the tools that are commonly used by us every day.

03:20.300 --> 03:22.160
And so, that's the why of it.

03:22.940 --> 03:26.260
So, Kubeflow, like I said, reuses open source components.

03:26.260 --> 03:35.640
And it is designed to give you a sane defaults and integration pieces for every likely aspect of what you use.

03:35.640 --> 03:54.400
And so, here's an example of one of the possible deployment scenarios where, as a data scientist, you may start in Jupyter Notebook, which is a natural environment for a lot of data scientists, and then have the same workload that you run for training and prediction in the cloud.

03:54.400 --> 04:02.120
And including a managed service like AI Platform and run it on premise and basically anywhere Kubernetes runs.

04:02.120 --> 04:03.720
So, that's the goal.

04:05.340 --> 04:09.280
In order to accomplish this goal, it's a very young project.

04:09.280 --> 04:19.800
And so, my background coming into it is I am deploying this in a healthcare setting where you may have considerations of cost, considerations of data locality.

04:20.660 --> 04:27.360
You need to have sort of building blocks that are stackable by data scientists.

04:27.360 --> 04:31.640
And so, these building blocks is a project, subproject of Kubeflow called Faring.

04:32.520 --> 04:40.920
So, to introduce you to this, I would like to sort of point you to a series of blog posts by Netflix.

04:40.920 --> 04:56.440
And sort of it's trying to bring the Netflix model of notebook deployments to an open source project where a lot of not just data exploration, but, you know, model training or model inferencing happens inside of notebook.

04:56.440 --> 04:59.900
But also, the data engineering tasks and tasks that are repeatable.

05:00.040 --> 05:03.160
And there's lyrical paper mill that Faring integrates.

05:03.160 --> 05:06.480
So, Faring allows you to ask a question.

05:06.480 --> 05:13.840
How much of the actual workflow can we make reproducible directly from the Jupyter notebook?

05:13.840 --> 05:25.520
And so, this may sound crazy, but if you think about, you know, typical workloads that you encounter in large projects, the actual execution of your IPython kernel and things like that is a minor part of that.

05:25.520 --> 05:29.380
So, computationally, that's not a hard constraint.

05:29.380 --> 05:32.040
And Faring is a project that allows you to do that.

05:32.040 --> 05:42.840
So, to illustrate the benefits of Faring SDK, which is a Python SDK, you can see the current approach to deployments that are local.

05:42.840 --> 05:46.200
So, you may work in your preferred environment, not necessarily notebook.

05:46.200 --> 05:49.900
You know, Faring is equally usable from your favorite ID.

05:50.940 --> 06:04.080
You then would have to adapt it to some deployment surface, like it's a platform or actual managed service of some kind or your own API endpoint that you build.

06:04.080 --> 06:12.100
And then the way to deploy it in Kubeflow right now is through consuming the TF job type deployments.

06:12.100 --> 06:22.760
And so, that's a lot of modification and refactoring in every step where your target deployment and your local deployment differ introduces potential for bugs to creep in.

06:22.900 --> 06:34.080
So, with Faring, you can have a fairly simple way of migrating your workloads by abstracting away the backend and the deployment procedure for your model.

06:34.080 --> 06:40.600
So, that's one of the ways that Kubeflow allows you to benefit from coderies.

06:40.600 --> 06:48.360
And you can transition the environments pretty seamlessly by just swapping out whichever Kubeflow config that you have.

06:48.360 --> 06:51.560
So, you could target the cluster that's isolated.

06:52.200 --> 06:56.000
Healthcare cluster that has spatial data, you can target GKE.

06:56.000 --> 07:05.980
And so, pretty much any scenario where you would have Kubernetes can be easily addressed, including local environments.

07:05.980 --> 07:17.100
So, if you're used to developing locally with a minikube, if you're exposed to that, you don't have to change a lot of the templates that you work with in the cloud to be able to execute it.

07:18.240 --> 07:20.640
So, here's where it gets into security.

07:20.640 --> 07:23.200
So, like, all of these niceties are nice to have.

07:23.200 --> 07:32.900
But, you know, it's very, very important that we understand the security model and different permissions and exposure that you get by using these services.

07:32.900 --> 07:50.440
So, once again, my goal is to inform you as to where we are today and give you an idea as to what is affected by permissions that you have and sort of put it in front of you and let you examine it and, you know, understand the different approaches.

07:50.440 --> 07:57.720
So, as a part of the Jupyter Notebook service that comes into Kubeflow, you get access to a variety of resources.

07:57.760 --> 08:08.100
So, you can schedule pods, create deployment services, including training jobs and inference jobs in PyTorch, TensorFlow, and other frameworks are being added all the time.

08:08.100 --> 08:12.360
So, you can create this directly from your notebook.

08:12.360 --> 08:20.060
And you can once again have that as a repeatable step in your MLOps workload.

08:20.620 --> 08:23.460
That's the blog post that actually goes into it.

08:23.460 --> 08:43.080
So, the end result of this is to be able to, instead of making every deployment a one-off deployment where, you know, majority of data science projects actually end up not realizing their investment, you want to be able to have something that's automated and repeatable.

08:43.080 --> 08:45.800
So, that's the Netflix model that fairing enables.

08:46.360 --> 08:51.400
So, you can find the fairing SDK on GitHub.

08:51.680 --> 09:01.460
And the scenarios in which you use it is through consumption by the notebook and some sort of environment where you can use Python.

09:01.460 --> 09:07.300
So, you can imagine an airflow trigger.

09:07.300 --> 09:12.200
It can be any variety of different scenarios where the workflow needs to be automated.

09:12.300 --> 09:20.560
However, you get to a point where, you know, you want to be able to have a more defined workflow.

09:20.560 --> 09:21.920
Let's say you have deployed it.

09:21.920 --> 09:23.020
You've exposed your endpoint.

09:23.020 --> 09:36.200
So, typically, the end result of the fairing workflow is some sort of an endpoint where you have the ability to pass it on to your UI team, for instance, to build a simple UI around it.

09:36.420 --> 09:39.900
Or you have some other downstream service consuming it.

09:39.900 --> 09:43.100
So, that's as far as fairing gets you.

09:43.100 --> 09:45.560
And you can get that from the notebook or from a repeatable process.

09:45.560 --> 10:00.980
But what if you have a complex end-to-end process that requires a lot of many different steps that fail and you want to isolate each of those steps and control the security permission model on each individual part of the DAG.

10:00.980 --> 10:03.620
So, that's where Kubeflow Pipelines comes in.

10:04.160 --> 10:10.400
So, Pipelines is a different component I wanted to introduce you to before we jump into what you can do to make these deployments secure.

10:10.540 --> 10:13.880
It's a UI for managing experiments, jobs, and runs.

10:13.880 --> 10:25.040
So, it's also an SDK that effectively allows you to break down your entire end-to-end workflow into a number of containerized operations.

10:25.820 --> 10:39.720
So, instead of thinking in terms of an entire function that does a number of different things, from data preprocessing to outlier removal to training and then tuning, you can imagine your scenario.

10:39.720 --> 10:44.320
You isolate each component of that workflow into its own component.

10:44.320 --> 10:52.500
And you have the Docker image or something that captures the requirements of your model in one place.

10:52.500 --> 10:57.180
And you then can add things like monitoring to it.

10:57.180 --> 11:03.100
And all you have to do is to follow a number of standard interfaces that are defined in the container ops spec.

11:03.540 --> 11:08.800
So, the benefit of that is to be able to not only

11:12.040 --> 11:25.640
get performance out of your models by addressing bottlenecks, but you can also freeze a version of your model in time by looking at the exact image that was used to run at any given step of the model.

11:25.640 --> 11:34.040
So, if your goal is reproducibility, which I think it should be, you can get back to exact versions of containers that were used to run your model.

11:34.260 --> 11:35.100
So,

11:38.640 --> 11:40.660
visualization of the DAG might look like this.

11:40.660 --> 11:45.400
So, that's an example of the XGBoost run that you can find in the docs.

11:45.400 --> 11:54.180
So, as you can see, the operations here are not limited to just the ML tasks, like, you know, training and transformation of the data.

11:54.180 --> 11:55.720
But things like creating clusters.

11:55.720 --> 12:03.380
And if you go a few slides back, we can find that we have access to pods, deployment services, and jobs.

12:03.380 --> 12:13.280
So, you can not only do the modeling, but everything required for it in terms of infrastructure and service requirements that are needed.

12:13.280 --> 12:17.840
And then introduce monitoring and outputs in intermediate steps.

12:17.840 --> 12:26.560
So, one of the things you could do is visualize the HTML output of the Jupyter notebook that gives you some reference metrics for how well your model is doing.

12:26.560 --> 12:29.780
Or visualize a confusion matrix or an ROC curve.

12:29.780 --> 12:33.900
Something that will give you a way of visually debugging it.

12:33.900 --> 12:36.940
Which is one more place where the notebooks sort of make an appearance.

12:36.940 --> 12:46.920
You can take the same fairy notebooks that you use for analysis and integrate them into these intermediate steps as a form of, like, debugging intermediate steps.

12:47.680 --> 12:54.240
This is a diagram of what happens behind the scenes as far as allowing it to happen.

12:54.240 --> 13:03.760
So, if you actually look at the way pipelines are implemented, they're Argo workflows with a very thin sort of layer that makes it adaptable to Kubeflow pipelines.

13:03.760 --> 13:15.700
But if you are familiar with Argo, everything that Argo normally gets you, which is event driven workloads, isolation of individual steps, and you get with it.

13:15.700 --> 13:21.620
And so, in the recent version, you actually have the metadata store.

13:21.620 --> 13:25.480
So, every run of a Kubeflow pipeline is versioned.

13:25.480 --> 13:35.280
And the information about it is stored into a metadata database, which is a MySQL database with a JSON schema that allows you to track artifacts .

13:35.280 --> 13:38.900
The artifacts are pipelines or individual container operations in the pipeline.

13:39.620 --> 13:48.900
Once again, it's a lot of opportunity to mess up and expose some part of the architecture to the outside world.

13:48.900 --> 13:56.020
So, it's imperative that we talk more about how we isolate that.

13:57.960 --> 14:04.740
And as you can see, the entire architecture is quite complex.

14:04.740 --> 14:10.260
So, this talks a little bit about the domain specific language that Kubeflow pipelines gives you.

14:10.260 --> 14:13.620
So, you have container ops, pipeline parameters, components.

14:14.200 --> 14:23.880
There are a number of standard components that come with prebuilt containers and images that allow you to run simple Python functions that don't require a lot of dependencies.

14:24.260 --> 14:28.660
There are operations that allow you to handle volumes.

14:28.660 --> 14:38.420
So, you can actually create a data store that's needed for your storage of intermediate artifacts, like weights on your model or some debugging outputs.

14:38.700 --> 14:38.800
And

14:41.840 --> 14:46.960
this is an example of a specification, like a lot of things in Granny's world, you define it using YAML.

14:46.960 --> 14:53.700
So, as long as you are consistent in what inputs, outputs each individual step takes.

14:53.700 --> 15:11.040
So, you can attach an image to it and you can actually run a train command that or any other sort of entry point that will take arguments and allow you to execute a specific workload in a specific manner with a number of arguments that will power it.

15:11.180 --> 15:12.620
What does it get us?

15:12.960 --> 15:17.600
Take a step back from the concrete detail over there.

15:17.600 --> 15:33.720
It gets us a standard reusable component structure that allows us to take our work and be able to take it with us or generalize it to problems that we might encounter down the line.

15:33.720 --> 15:49.620
So, instead of learning a specific stack at one of the big four, we can actually go ahead and build in a manner that is shareable and is available to be executed anywhere.

15:49.620 --> 15:53.360
So, as a Google project, it initially had more contributors from Google.

15:53.600 --> 15:58.160
It recently passed the point where a majority of contributors actually come from the community.

15:58.360 --> 16:04.640
David Aronchik, the person who started as a PM of the project with Google, is now at Microsoft and bringing it to Azure.

16:04.640 --> 16:11.600
So, it's got broad support by the community and it's a community -driven project.

16:12.460 --> 16:21.660
In the future, you can imagine individual pieces of your pipelines becoming shared with others in a reusable manner.

16:21.660 --> 16:25.020
So, that's it about Kubeflow.

16:25.140 --> 16:26.900
I just wanted to give you a brief introduction.

16:26.900 --> 16:28.020
There's a lot more to it.

16:28.020 --> 16:37.420
And that's just scratching the surface by looking at these two components that get you from notebook interface to something that's event-driven and triggerable and reusable.

16:37.420 --> 16:44.100
So, I want to talk about benefits of this approach and how we think about security in Kubeflow.

16:44.100 --> 16:51.400
So, principle of least privilege, I think, is a benefit not just for this project, but Kubernetes in general.

16:51.400 --> 17:00.440
And then it's a good argument for running things in containers in the first place instead of having one service account with access to everything in your infrastructure.

17:00.440 --> 17:05.800
You can isolate your workloads by specific tasks that they're needed to perform.

17:06.060 --> 17:13.300
So, in this case, you can think about a container operation that needs to read data from a Google Cloud Storage bucket.

17:13.980 --> 17:22.240
The service accounts, the secrets that you expose to that container do not need to have anything beyond that.

17:22.240 --> 17:31.140
And if there is a vulnerability in some component of that container or if the container gets compromised, you don't lose access to the entire infrastructure.

17:31.140 --> 17:34.520
So, once again, to inform you what is happening now.

17:34.520 --> 17:40.400
And for context, a lot of this is still not like GA or it's not 1.0 version.

17:40.400 --> 17:43.140
So, the latest stable version is 0.6.

17:44.300 --> 17:49.720
Security tends to take a backseat when rapid development is a goal.

17:49.720 --> 17:53.120
And so, right now is the time to start thinking about how can we improve this?

17:53.120 --> 18:07.220
And so, my goal is to, by informing you, let you get to the GitHub, play with the code, see what you can do, see how you can break and hopefully open some issues and pull requests to help us do better.

18:07.760 --> 18:16.880
So, from that perspective, I will introduce you to the three service accounts and permissions that are currently deployed with them.

18:16.880 --> 18:27.580
So, we have... and a lot of this maps into the on-premise deployment, but of necessity, Google Cloud Platform has been more of a stable target for Kubeflow as of now.

18:27.580 --> 18:41.860
So, if you're dealing in the on-premise environment, I think things like IAM roles I'll be describing now, they're more specific to Google Cloud Platform and won't translate as easily to your on-premise role-based authentication.

18:42.360 --> 18:50.040
So, one service account is admin and it's used to actually deploy and configure the cluster.

18:50.060 --> 19:00.200
So, you can find the KFCTL script that is going to use the admin service account to perform most of the deployments.

19:00.200 --> 19:05.920
User is what most data scientists will encounter in their day-to-day.

19:05.920 --> 19:15.200
So, that allows you to use and consume GCP resources and interact with GCP resources from your container operations or fairing if you're using a Jupyter notebook.

19:15.360 --> 19:25.700
And we have the logging account as well, which uses VM, which is called VM and it's used to take audit logs and send them to Stackdriver.

19:25.700 --> 19:32.600
So, as far as concrete roles for the account, and all of these can be adjusted, by the way.

19:32.600 --> 19:37.360
So, this is taken directly from a Cloud Deployment Manager template that you can find in the repository.

19:38.260 --> 19:45.240
The admin service account has source admin, which is allowing you to push the application to Cloud Repository.

19:45.740 --> 19:51.720
It has the management account, which allows you to control the endpoints and the host names of those endpoints.

19:52.500 --> 20:05.120
Network admin is used to enable identity-aware proxy, which allows you to use your Google account to authenticate against different resources and consume them, as well as health checks.

20:05.120 --> 20:06.620
So, that's the admin account.

20:06.620 --> 20:14.180
If you wanted to change these, you would add things to the template, but that would be specific to your organization's security policy.

20:14.860 --> 20:25.460
The user service account allows you to do things like build custom things in Container Builder.

20:25.460 --> 20:35.260
That's important if you want to run your application in the context where you don't have access to GCR, Google Container Registry.

20:35.260 --> 20:48.240
And so, the builder allows you to actually package it up as a coherent sort of end-to-end application and deploy it potentially in an air-gapped environment, which could be a concern for security.

20:49.140 --> 20:53.820
You can have a viewer role for actually viewing the resources of the builds.

20:53.820 --> 20:56.080
And then, this is just an example.

20:56.080 --> 20:57.340
Your services may vary.

20:57.340 --> 20:59.880
So, for instance, you want to add Dataproc or something.

20:59.880 --> 21:12.300
This is not currently captured here, but this is a minimal set of permissions for interacting with Cloud Storage buckets, BigQuery, Dataflow, all of which will probably help you with data.

21:13.760 --> 21:18.480
And then, of course, the monitoring account, Log Writer, Metric Writer, and Object Viewer.

21:18.480 --> 21:24.000
So, these are the roles that you can review and decide whether they're appropriate or not.

21:24.000 --> 21:27.020
One of the things that hasn't been mentioned in the earlier slide is an IAP account.

21:27.020 --> 21:34.600
So, this actually goes to your user account that authenticates against Identity-Aware Proxy.

21:34.600 --> 21:41.140
So, you have to be able to have an Object Viewer role on that as a part of the implementation.

21:42.120 --> 21:46.560
And then, VM Service Account, like I said, has Log Writer and all that.

21:46.560 --> 21:46.880
So, okay.

21:46.880 --> 21:53.980
So, that's based on Kubeflow's built-in roles right now.

21:55.440 --> 22:02.440
The way that it relates to role-based authentication in Kubernetes is it complements it.

22:02.440 --> 22:08.040
So, when you are trying to define that, IAM can only get you so far.

22:08.040 --> 22:17.480
And it's probably better for metadata and access to other objects that are accessible through IAM and controlled through IAM roles.

22:17.480 --> 22:31.560
If you wanted to actually interact with Kubernetes permissions themselves, you could create other objects like cluster roles and cluster bindings that will help you control the management of your resources using the Kubernetes model.

22:31.560 --> 22:37.460
So, once again, I point you to resources towards the end where this can be addressed in more detail.

22:39.500 --> 22:44.120
So, this is a brief description of how that works.

22:45.080 --> 22:54.500
And just to clarify, one thing is that at point six, we now have per user namespace isolation.

22:54.500 --> 23:04.440
So, if you start with a new project and you add your own user, all of your pods, notebook services, endpoints that you deploy will be contained to that namespace.

23:04.440 --> 23:10.440
And so, other data scientists or other teams may not necessarily have access to your namespace.

23:10.440 --> 23:13.900
That buys you multi-tenancy and things like that.

23:13.900 --> 23:25.940
So, it's important to, for instance, if you are in a context where certain projects require a separate set of NDAs or have some PII that should not be accessible outside of your particular analysis.

23:28.400 --> 23:28.840
Okay.

23:28.840 --> 23:32.380
So, the gist of this talk is actually quite simple.

23:32.380 --> 23:36.500
There are two main things you can do as a data scientist when deploying this.

23:36.500 --> 23:40.880
My goal is for you to go back to your place of employment and try this.

23:40.880 --> 23:48.560
And when you try it, I don't want you to add cryptocurrency miners to your company's infrastructure.

23:48.560 --> 23:52.780
So, a few simple precautions can help you avoid that.

23:52.780 --> 23:57.640
So, the main one, honestly, is the VPC service control idea.

23:57.640 --> 24:12.620
So, what that allows you to do is to restrict access to certain API endpoints that will be consumed by your application to only the services and pods that come from within your Kubeflow deployment.

24:12.740 --> 24:14.620
VPC service control model.

24:16.900 --> 24:26.720
Gives you the secure perimeter within which only the clients that are authorized can have private access to resources, create them, copy them.

24:26.720 --> 24:33.040
And so, to be clear, this only applies to the content within those resources, not the metadata about those resources.

24:33.040 --> 24:36.460
If you wanted to manage the metadata, you would have to fall back on the IAM models.

24:36.460 --> 24:54.680
So, if you're trying to copy things from Google Cloud Storage or do things in BigQuery, if you want to make sure that your team in a different geographic locale will not have the same access, you just use VPC service controls to isolate them.

24:55.160 --> 25:02.880
So, these are some of the benefits that allow you to... that I could go into more detail on if there are any questions.

25:02.880 --> 25:11.400
But effectively, it's configurable using standard credentials.

25:11.860 --> 25:15.660
You have ability to restrict it by service.

25:16.040 --> 25:18.780
And here's an example of how you would do that.

25:18.780 --> 25:21.420
Of course, all of these environment variables actually have to be set.

25:22.140 --> 25:33.120
But this is the command line approach in which case you enable the resource manager API and the other prerequisite steps.

25:33.840 --> 25:37.460
There are similar ways of defining a secure perimeter in the UI in GCP.

25:37.460 --> 25:41.080
Once again, this would be different on your actual on-premise deployment.

25:41.080 --> 25:51.680
But you could say that your application should only be able to access PubSub or Storage API and should not be able to access Bigtable or other services within the perimeter.

25:51.680 --> 25:57.420
And you can restrict it to specific projects which in GCP land have come with their own set of isolations.

25:57.420 --> 26:06.680
So, when you're setting it up and trying to justify it to your boss, just make sure to say that you will not have issues with some high security service.

26:06.680 --> 26:09.780
Let's say BigQuery has all of your critical data.

26:10.920 --> 26:26.960
Another thing you can do, and I recommend doing this especially if you're exposing any resources that have a load balancer in front of them, restrict it by authorized networks by using a specific IP range that you'll be heading them from.

26:26.960 --> 26:33.640
So, it's something that can save you from unfortunate outcomes.

26:33.840 --> 26:38.980
Here's another command line example of what you saw earlier in the UI.

26:38.980 --> 26:41.800
So, in this case, you once again define a secure perimeter.

26:41.800 --> 26:49.000
But that's something that you can automate for creation of new projects either with Cloud Deployment Manager Terraform or other tool like that.

26:49.280 --> 26:51.700
Don't make it a guesswork every time.

26:52.320 --> 27:03.500
And try to you know, fall back on good practices and discuss with your team and understand like what is within your security budget.

27:03.500 --> 27:06.700
So, effectively, we have different APIs here.

27:06.700 --> 27:09.960
In this case, we're enabling BigQuery container registry and storage.

27:09.960 --> 27:12.920
But you know, your use case may vary.

27:12.920 --> 27:19.620
And so, I added some diagrams in case you wanted to see practically what this gives you.

27:19.620 --> 27:33.300
So, once you have a certain service perimeter that allows within which you run Kubeflow, you will not have to worry about unauthorized access from outside world or other clients that will consume it in ways that you didn't intend.

27:33.320 --> 27:35.240
This is the case for cloud.

27:35.240 --> 27:40.520
The on-premise situation a little bit more complicated, especially with GKE on-prem and Anthos.

27:41.400 --> 27:45.540
You know, you can have these things a bit more configured.

27:45.540 --> 27:49.100
But once again, this has been mostly GCP focused.

27:49.100 --> 28:00.220
In this case, you can extend your VPC perimeter into a on-premise network by using some sort of a VPN gateway that could come with its own subnet.

28:00.220 --> 28:08.060
And by defining strict firewall rules for how different VPCs talk to each other, you can prevent that from happening.

28:08.060 --> 28:15.480
Honestly, if you get to this point, you should probably work with your own operations as DLC teams.

28:15.480 --> 28:25.540
But as a one-off experiment, I recommend just running on GCP and configuring very basic service perimeter like so.

28:26.600 --> 28:28.120
One last step.

28:28.120 --> 28:36.640
I think it may seem obvious, but one of the most common ways GCP accounts get compromised is service account leakage.

28:36.640 --> 28:41.100
It's either somebody commits to GitHub or, like, that can happen.

28:41.220 --> 28:48.780
Especially for newer data analysts, data scientists, a lot of the tutorials advise you to add everything in your directory to get committed.

28:48.780 --> 28:51.860
So that's how a lot of that stuff happens.

28:51.860 --> 28:53.060
It's a true story.

28:54.060 --> 29:01.760
Luckily, Kubernetes allows you to store credentials in a secure manner that can be accessed from a variety of places in Kubeflow infrastructure.

29:01.760 --> 29:05.040
And I wanted to show you how to go through that really briefly.

29:05.040 --> 29:08.980
So you can add a secret by using standard secret creation interface.

29:08.980 --> 29:13.360
Secret can be a service account, JSON, environment variable that you set.

29:13.440 --> 29:19.500
I recommend using secrets for anything JSON or even the passwords that you want to consume later.

29:20.480 --> 29:36.640
You can spread the credentials to your entire infrastructure by using Google application credentials, which is your environment variable that stores your service account files and that every pod that will start with a certain service account within your cluster will have access to those resources.

29:36.640 --> 29:39.360
Let's say there is something every pod has to hit.

29:41.160 --> 29:45.700
Once again, per namespace, so you don't have to worry about leaking to your colleagues.

29:46.260 --> 29:54.220
You can authenticate from the pod directly by picking it up from a secret store and mounting a GCP secret as a volume.

29:54.440 --> 30:01.100
Once again, this environment variable is how your SDK will know what to authenticate with.

30:01.540 --> 30:03.680
You can access secrets from a pipeline.

30:03.680 --> 30:10.260
So if you remember the components earlier, it's part of the DSL to be able to include a specific secret into your pipeline.

30:10.260 --> 30:16.160
So think of this as a critical step.

30:16.160 --> 30:35.200
So it may be very tempting to add your secret to your Docker image if you're on a deadline, but if you just follow these simple procedures and you add secrets by using the DSL directly, you're preventing unnecessary harm from leaking your service accounts to your registry.

30:36.220 --> 30:40.900
Lastly, I had a little bit of material on the .6 edition, which just happened.

30:40.900 --> 30:45.700
What migration from .5 was the replacement of Ambassador Proxy with the Istio gateway.

30:45.700 --> 31:01.960
And at this point, it may not be as relevant to a day-to-day use by data scientists, but Istio comes with a number of very nice ways of controlling flow of data and security between different services in your cluster.

31:01.960 --> 31:14.860
And so you get a lot of things for free, like AuthC, authentication, authorization, and things like fault injections, which allow you to test your model.

31:14.860 --> 31:21.060
And so I'll wrap up real quick, but I wanted to point you to some resources and references.

31:21.060 --> 31:22.260
So Kubeflow.org is great.

31:22.260 --> 31:25.640
There are private clusters, description over there.

31:25.640 --> 31:33.980
And a lot of this material came from Kubeflow documentation, and as well as the blog post by Arikto, which did a really good write-up on authentication.

31:33.980 --> 31:37.080
Please join our Slack, start contributing.

31:37.080 --> 31:42.540
We need security people to look at this before it hits 1.0 so that we don't have nasty surprises down the line.

31:42.980 --> 31:43.660
And thank you.

31:43.660 --> 31:47.620
You can find me on Twitter, Keybase, GitHub, or feel free to email me directly.

