Project Based Authorization¶
Pre-requisites¶
- Ensure PostgreSQL has been installed. 
- Ensure Authentication is enabled. 
- Ensure Open Policy Agent authorization is enabled, along with project-based auth. 
Policies Setup¶
This demo assumes the existence of two users in your OIDC provider: alice and bob.
- Both - aliceand- bobbelong to the- data-scientistgroup.
- From the role grants, they both get read-write access to all namespaces and the - defaultproject.
In addition:
- alicehas read-write access to the- irisand- incomeprojects.
- bobhas read-only access to the- incomeproject.
These permissions are reflected in the following seldon-deploy-policies ConfigMap:
apiVersion: v1
kind: ConfigMap
metadata:
  name: seldon-deploy-policies
  namespace: seldon-system
data:
  data: |-
    {
      "role_grants": {
        "data-scientist": [
          {
            "action": "read",
            "resource": "namespace/*"
          },
          {
            "action": "write",
            "resource": "namespace/*"
          },
          {
            "action": "read",
            "resource": "project/default"
          },
          {
            "action": "write",
            "resource": "project/default"
          }
        ]
      },
      "user_grants": {
        "alice": [
          {
            "action": "read",
            "resource": "project/iris"
          },
          {
            "action": "write",
            "resource": "project/iris"
          },
          {
            "action": "read",
            "resource": "project/income"
          },
          {
            "action": "write",
            "resource": "project/income"
          }
        ],
        "bob": [
          {
            "action": "read",
            "resource": "project/income"
          }
        ]
      }
    }
Confirm Policies Are Working¶
- Log in as - alice.
- Go to the - Model Catalogpage and create the following models (see Model Catalog demo for detailed instructions):- Name - URI - Project - Artifact type - 1 - Iris - gs://seldon-models/v1.18.2/sklearn/iris - default - SciKit Learn - 2 - Iris - gs://seldon-models/v1.18.2/sklearn/iris - iris - SciKit Learn - 3 - Income - gs://seldon-models/sklearn/income/model-0.23.2 - income - SciKit Learn - Your Model Catalog page should look similar to the following now:  
- Create a deployment from each of these models using the - Deployfunctionality from the Model Catalog. The deployment names could be:- iris-default
- iris-iris
- income
 - Your - Overviewpage should look similar to the following now: 
- Log out from the - aliceprofile and log in as- bob.
- Confirm you only see the deployments in the - defaultand- incomeprojects, but not the- irisproject. 
- Confirm you only see the models in the - defaultand- incomeprojects in the Model Catalog, but not the- irisone. 
- Confirm that you cannot delete or modify the - incomemodel in the Model Catalog, since- bobhas only- readpermissions on the- incomeproject. 
- Confirm that you cannot delete or modify the - incomeSeldon Deployment in the- Overviewpage.