For the complete documentation index, see llms.txt. This page is also available as Markdown.

Requesting Harbor access

How to request a just-in-time role on a Harbor project via P0

The Harbor integration is in beta. Functionality and configuration may change.

Request a just-in-time role on one Harbor project through P0, or system administrator on a Harbor instance. When your request is approved, P0 makes your Harbor user a direct member of the project with that role. When access ends, P0 puts back the lower direct role you had before, or removes your membership if you had none.

You need a Harbor user whose email is your P0 email, in an email domain your organization allows for Harbor. P0 never creates Harbor users. Sign in to Harbor once before you request access, so that Harbor creates your user.

Requesting from the P0 CLI

p0 request harbor project-role <instance-id> <project> <role>
Argument
Description

<instance-id>

The Harbor instance, by its ID in P0.

<project>

The project's name in Harbor.

<role>

The role you need. See Roles.

For example, to request Developer on the payments project of the instance prod:

p0 request harbor project-role prod payments developer --reason "Push the release image"

Requesting system administrator

Request Harbor's system administrator access on an instance with:

p0 request harbor system-admin <instance-id>

<instance-id> is the Harbor instance's ID in P0. In Slack, the same command works as a slash command. In the request form, select Harbor, then System administrator, and choose the Harbor instance. When P0 is installed on only one Harbor instance, the form selects it for you.

System administrator gives you full control of the instance: every project, user and robot account, and Harbor's own configuration. P0 finds your Harbor user by email, as for a project role. It refuses the request if you're a system administrator already, and you can have one open system administrator request per instance at a time. When your access ends, P0 clears your administrator flag.

Requesting from Slack or the P0 app

In Slack, the same command works as a slash command: /p0 request harbor project-role <instance-id> <project> <role>. To fill in a form instead, type /p0 request in Slack, or click Request Access on the Access Management page of the P0 app, then select Harbor and choose the Harbor instance, the Project and the Role. When P0 is installed on only one Harbor instance, the form selects it for you. The form lists an instance's projects once you've chosen the instance. An empty list can also mean that P0 won't serve you on that instance: your email's domain isn't allowed, or P0 can't find exactly one Harbor user with your email. Submit the request to see why, as in How P0 finds your Harbor user.

For every way to request access, see Requesting access.

Roles

You can request any of Harbor's five project roles. Each role includes everything the roles above it in this table allow:

Role
Request it as

Limited Guest

limitedGuest

Guest

guest

Developer

developer

Maintainer

maintainer

Project Admin

projectAdmin

The request form and access policies use the same names. For what each role allows, see Harbor's user permissions by role.

P0 refuses a request for a role you already hold directly on the project, or for a lower one. If you're a Maintainer, you can request Project Admin, but not Developer.

How P0 finds your Harbor user

P0 looks for the Harbor user whose email is your P0 email. Capitalization doesn't matter. The request fails before anyone is asked to approve it if:

  • Your email's domain isn't allowed. Your organization sets which email domains can receive Harbor access through P0.

  • You have no Harbor user. Harbor creates your user the first time you sign in.

  • Your Harbor email is different. With OIDC sign-in, Harbor stores your email the first time you sign in, and keeps it. If your email changed since, or your identity provider sent Harbor no email, P0 can't find you. A Harbor admin deletes your Harbor user, and you sign in again.

  • Two Harbor users share your email. A Harbor admin removes the duplicate.

P0 checks again when it grants the access. If your Harbor user was deleted or its email changed after you made the request, the grant fails, and you request again.

One request per project

Your Harbor user can have one open request per project on an instance at a time. Requests count whoever made them, so a request that someone else made for you counts too. P0 refuses a new request for a project while an earlier one is approved or active, or while P0 couldn't finish an earlier one's grant or revoke. If two requests for the same project are pending, the second one approved fails.

To change your role on a project, relinquish your request or wait for it to end, then request the new role.

When your access ends

When your access expires, or you or an approver end it early, P0 only ever lowers your direct role on the project:

  • If you had a lower direct role before the grant, P0 puts it back.

  • If you weren't a direct member before, P0 removes your membership.

If someone changes your direct role in Harbor during the grant, P0 still puts your earlier role back when that role is lower than the one you hold by then, and overwrites their change. If they lowered your role to your earlier role or below it, P0 leaves it as it is. P0 never raises a role when access ends. If you weren't a direct member before the grant, P0 removes your membership whatever role you hold by then.

P0 changes only your own membership of the project. A role you have through a group stays as it is, before, during and after the grant.

Harbor's audit log doesn't record project member changes. The record of what P0 granted you and when is your request history in P0.

If the project no longer exists when your access ends, there's nothing to remove, and the request ends normally.

Troubleshooting

Message
What to do

<email> has no Harbor user on <instance>. Log into Harbor at <url> once, then request again. If you've logged in before, ask a Harbor admin to check that your Harbor email is <email>.

Sign in to Harbor at the address in the message, then request again. If you've signed in before, see How P0 finds your Harbor user.

<email> isn't in an email domain this Harbor connector allows.

Your organization hasn't allowed your email's domain for Harbor access. Ask your P0 admin.

More than one Harbor user on <instance> has the email <email>. Ask a Harbor admin to remove the duplicate.

A Harbor admin removes or changes the duplicate user.

P0 can't find the project <project> on the Harbor instance <instance>.

Check the project's spelling, and that you named the right instance. If you see it when access is granted, the project was deleted after you requested it.

P0 is installed on more than one Harbor instance, so name the instance to request it on.

Name the instance in the request, as the first argument after the access type.

P0 isn't installed on a Harbor instance with the id or label <instance>.

Check the instance's ID. Your P0 admin can tell you the IDs of the installed instances.

This principal already has this access

You already hold the role you requested, or a higher one, as a direct member of the project. You don't need to request it.

P0 already manages your access to <project>. Revoke your previous request and try again.

You already have a request for this project. Relinquish it, or wait for it to end, then request again.

P0 couldn't finish your previous request for <project>. Ask an admin to fix it in Harbor and close that request in P0, then request again.

An earlier request for you on the project failed, and you still hold its role in Harbor. A Harbor admin sets your role on the project back to what it was. Then request again.

P0 couldn't finish removing your previous access to <project>. Ask an admin to fix it in Harbor and finish the revoke in P0, then request again.

An admin follows Error messages for admins for the earlier request's error, which usually ends with Retry revoke. Then request again.

The Harbor user for <email> on <instance> no longer exists, or its email changed. Request access again.

Your Harbor user changed after you made the request. Make a new request. P0 looks up your Harbor user by your email again.

For system administrator requests:

Message
What to do

This principal already has this access

You're a system administrator on the instance already. If the message adds that it's through your identity provider's Harbor admin group, P0 can't change that.

P0 already manages your system administrator access on the Harbor instance <instance>. Revoke your previous request and try again.

Relinquish your earlier request, or wait for it to end, then request again.

P0 couldn't finish removing your previous system administrator access on the Harbor instance <instance>. Ask an admin to fix it in Harbor and finish the revoke in P0, then request again.

An admin fixes the earlier request's error, as in The admin account, and clicks Retry revoke. Then request again.

For messages that ask for your P0 admin, see Error messages for admins.

Last updated