Skip to content

add ability to use json authfile for private registry login #4123

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

Open
crispysipper opened this issue Mar 21, 2025 · 1 comment
Open

add ability to use json authfile for private registry login #4123

crispysipper opened this issue Mar 21, 2025 · 1 comment
Labels
enhancement New feature or request

Comments

@crispysipper
Copy link

Description

in many CI/CD environments, it would make it much easier on developers and devops folks if we could leverage a typical docker config json file to authenticate to private registry with the cosign cli. This would also streamline any requirement to authenticate to more than one private registry in the same pipeline by defining the credentials in a single file and prevent having to automate the following scenario with some nasty vars:

cosign login -u username -p password registry1.com
cosign login -u username -p password registry2.com
cosign login -u username -p password registry3.com

I am proposing something like this as an example:

cosign clean --authfile $HOME/.docker/config.json -f registry1.com/busybox@sha256oiewjoqiewjgeqoigjeqoigjeroqipgjeroigjqeiopgjqepoiqj

however the solution would need to be available for all cosign processes that require authentication to a target private registry so cosign attest, cosign sign, cosign clean, etc etc

@crispysipper crispysipper added the enhancement New feature or request label Mar 21, 2025
@crispysipper
Copy link
Author

crispysipper commented Mar 21, 2025

as a caveat I do realize that cosign can leverage a file at $HOME/.docker/config.json for an initial login

however that doesn't cover the enhancement request, as even if the $HOME/.docker/config.json exists, an explicit login command is still necessary, in which the end user still needs to specify the target registry and username despite that data already existing in the config.json file

the enhancement would allow for running cosign processes against a private registry by leveraging an authfile (thus preventing the need for an additional preceding login command or copying down contents to a file)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant