-
Notifications
You must be signed in to change notification settings - Fork 90
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Harbor OIDC Admin Group Permission Problem #328
Comments
hi, |
Yeah, sure. Via Curl, I get the same error: Maybe I did a mistake by authentication? I used the CLI Secret from my user profile in harbor for the terraform harbor api and put the CLI Secret also in the the "Authorize" field in the swagger API Page. But I don´t know what secret I should use else for the authentication here. |
I think the CLI secret don't allow such API call. |
hmm @Tim-herbie, did you try it with the admin user, to crosscheck the situation? Normally, If your user is in the admin group, then the user should have the same permissions as the build in admin user. |
@Vad1mo Yeah, so far as I could. The way I can test it is not exactly the same Like I described above, I used the username and the cli secret from the oidc admin user in the swagger api. Here it does not worked. When I test it with the local admin user, I don´t get a cli secret. So I used the username and password from the admin user. That worked, I got a valid response here. |
if you want to use your OIDC user I think you need to get an access token from your OIDC provider. |
I create a robot account with terraform with the same parametes like in your linked example. resource "harbor_robot_account" "system" {
name = "admin"
description = "system level robot account"
level = "system"
secret = "myReallysecretPassword1!"
permissions {
access {
action = "create"
resource = "project"
}
kind = "system"
namespace = "/"
}
} Here is also the GET response via API: But when I change the harbor terraform provider credentials to |
indeed, I just try it, with :
it looks like the full api is not accessible with robot accounts : goharbor/harbor#8723 I think you currently have 2 solutions : use the admin local account or generate an access token from your OIDC provider |
@flbla I do not understand how the OIDC token should help in that case? Isn't the CLI secret of a OIDC user not validated against defined permissions within harbor? |
because, as far as I understand, the cli secret, doesn't allow all actions in the Harbor API (no matter if you are admin) valid endpoints furthermore, with the |
We will. Thanks for the clarification. |
Describe the bug
I am trying to migrate the configuration for the existing harbor enviroment to terraform. By this, I found out, that the defined OIDC Admin Group has not the same permissions like the local admin user by using terraform.
With my OIDC User which is in the Admin Group, I can create anything in the harbor application (GUI). I can also use
terraform import
for projects, that is working.But I can´t e.q. use
terraform import
to import retention policies.There I get the following error:
To Reproduce
Steps to reproduce the behavior
Expected behavior
Additional context
Add any other context about the problem here.
Provider Version: 3.8.4
Terraform Version: 1.4.3-dev
Harbor Version: v2.8.0-89ef156d
The text was updated successfully, but these errors were encountered: