Managing Policies for Packages and Projects

Introduction

Admins can create new policies with rules that can block or allow packages (and versions) based on the version number and (in the future) other arbitrary metadata like package version licenses, authors, and so on.

The reason we have created this feature is because organizations need to be able to block certain packages and/or versions for legal, compliance, security, or internal compliance reasons and this is one way we help address that need. Package policies enhance both the package server and Julia instances because they change both whether the server will allow a package to be downloaded and also how Julia itself resolves package versions.

Although only admins can create and edit policies, any member of a project can choose the policies for it.

Creating and Editing Policies

To create a policy, go to the Policies page in the Admin section at the bottom of the left menu bar and click 'Policies'.

admin

Click on New Policy button to create a new policy.

new policy

This will show the policy editor where you can name the policy and choose which packages or versions to allow or block.

details

After you choose a package, you can choose whether to allow or block that package and optionally enter a range of versions to allow or block.

create policy

Once you have chosen all of the packages to allow or block, click ”Create” to create the policy. In this example, I have choose to block CSV pakages.

test

After a policy is created, you can click “Edit” on the policy to make changes using the policy editor above that you use to create policies.

Managing Project Policies

Each project can have a set of policies. When project code runs, it uses the project’s local “view” of the JuliaHub instance’s registries which contain only the package versions that are allowed by the project’s policies.

To set the policies for a project, view the project and click the “Manage” button, then select “Manage Policies”.

Manage Policy

Clicking this brings up the “Manage Policies” view, which shows the project’s policies. You can change them by clicking “+ Select policies” to show the policy selector.

Select Policy

Once you are done adding and/or removing policies, click ‘Save’.

Save

You will see the successful message of the updated policy.

Updated Policy

You will be able to check or edit your policy now.