Replies: 1 comment 1 reply
-
@bedla The proxy cache project is designed to disallow pushes. Could you try the attach operation with a normal project instead? And please file an github feature request for it, and BTW describe the story why you need and how you use. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I found out that when I have proxy-project (eg Docker Hub proxy) I am unable to attach any files to artifacts.
Example command (simpler variant also works):
oras attach --artifact-type artifact/type --annotation-file annotations.json localhost/docker-proxy/bedla/sample-spring-boot:ivos-latest hi.txt:layer/media-type
.What I also found out is that when you click "Generate SBOM" in the Harbor UI, it attaches generated JSON without problems.
For example:
It is because of special handling of internal attach calls and denying calls from outside (REST API calls).
There is check in the source code https://github.com/goharbor/harbor/blob/v2.13.2/src/server/middleware/repoproxy/proxy.go#L309-L313
Check if we are at proxy-project and have internal call.
And then check if we have internal call to the API
isProxySession
:username
equalsharbor#proxy-cache-service
THEN access-allowedusername
prefix is"${robotPrefix}${projectName}+${scannerPrefix}"
THEN access-allowedrobot$docker-proxy+8OUcKtA8
8OUcKtA8
is random 8 chars string generated during installation of Harbor)+
is not valid char when creating robot account by hand in the UI)PR for this business logic is here #12404 .
I understand reasoning behind this validation, BUT it does not allow me to attach files to proxy-projects. Is it something that cannot be changed, for example to have some special permission or something like that?
Note: I am using Harbor v2.13.2
Thank you for explanation.
Ivos
Beta Was this translation helpful? Give feedback.
All reactions