-
Notifications
You must be signed in to change notification settings - Fork 197
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
Support Service Account Keys defined in ImagePullSecrets #857
Comments
How is this issue different from #279 ? In the current implementation Starboard reads imagePullSecrets to get username and password that are eventually passed to Trivy as For GCE, ECR, and other managed registries more work as to be done. |
I guess that purpose of the issue is the same, just that the description of the issue seemed that there was a working method, but there was support documentation needed. And this issue is not specifically tied to GCR, but to other registries that are also using the same scheme for authentication. |
I see what you mean now. The title of this issue confused me. So basically we're talking about a bug in parsing passwords from imagePullSecrets that may contain the colon ( |
I tested with trivy (0.21.2) binary that it works:
|
We got it working with the following ImagePullSecret setup:
So the issue is actually that starboard doesn't support username:password, but expects the username:password to be within auth. So I guess this can be closed, though it would be nice to support username:password aswell w/o auth. And maybe add documentation that SA KEY's can be used with this kind of ImagePullSecret. Our ImagePullSecret currently has both options:
|
Interesting. We've discovered the same limitation this week and reported in #855 . To confirm my understanding, will #855 solve your problem? /cc @deven0t |
Resolves: #855 Resolves: #857 Signed-off-by: Daniel Pacak <[email protected]>
Hey @jnauska, The gcr-registry secret's content looks like this:
Any suggestions? |
Remove the |
Hey @jnauska,
I added the username & password as a test, with the secret shared above I still get the same errors. |
I think you need to double encode that, so like:
|
Hello @jnauska,
The scan job secrets have the following content (when testing option 3): Note: The image pull secret contains |
@jnauska & @danielpacak, |
Hello @jessequinn, |
The following looks like HOW it should work. Basically someone would need to update the plugin to place an empty username and add a new ENV VAR GOOGLE_APPLICATION_CREDENTIALS. I may try to make a PR for this. I tested the docker example given in that PR. It works. |
ok. i have played with the code. Actually i think the problem could be fixed quite easily.
now the Decode() method using SplitN rather than Split removes the issue:
I tried testing this through Kind as per the contribution guidelines; however, modifications to the config.go DO NOT APPEAR TO APPLY to the docker images built. Any idea? @danielpacak Added a PR for the SplitN #1126 |
What steps did you take and what happened:
We're using Google Artifact Registry to host our containers.
We have configured the access according to the Google Documentation: https://cloud.google.com/artifact-registry/docs/access-control
So we're using Service Account keys in our ImagePullSecrets. ImagePullSecrets would look like this (SA_KEY is encoded):
Decoded SA_KEY would look like
When Vulnerability Scan tries to Pull the image for scanning it gives out error:
"error":"reading .dockerconfigjson field of \"APPLICATION_NAME/image-pull-secrets\" secret: expected username and password concatenated with a colon (:)","stacktrace":"sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func2.2\n\t/home/runner/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:227"}
starboard/pkg/docker/config.go
Lines 26 to 36 in 8944e54
Is splitting the string with
:
and giving out errors iflen(split) != 2
. As the SA_KEY has multiple:
included in the string, it gives out the error and breaks ImagePullWhat did you expect to happen:
To be able to use Service Account keys in ImagePullSecrets.
Anything else you would like to add:
[Miscellaneous information that will assist in solving the issue.]
Environment:
starboard version
): 0.13.1 (starboard-operator)kubectl version
): v1.20.10-gke.1600The text was updated successfully, but these errors were encountered: