go1.22.11 (released 2025-01-16) includes security fixes to the crypto/x509 and net/http packages, as well as bug fixes to the runtime. See the Go 1.22.11 milestone on our issue tracker for details. - https://github.com/golang/go/issues?q=milestone%3AGo1.22.11+label%3ACherryPickApproved - full diff: https://github.com/golang/go/compare/go1.22.10...go1.22.11 Hello gophers, We have just released Go versions 1.23.5 and 1.22.11, minor point releases. These minor releases include 2 security fixes following the security policy: - crypto/x509: usage of IPv6 zone IDs can bypass URI name constraints A certificate with a URI which has a IPv6 address with a zone ID may incorrectly satisfy a URI name constraint that applies to the certificate chain. Certificates containing URIs are not permitted in the web PKI, so this only affects users of private PKIs which make use of URIs. Thanks to Juho Forsén of Mattermost for reporting this issue. This is CVE-2024-45341 and Go issue https://go.dev/issue/71156. - net/http: sensitive headers incorrectly sent after cross-domain redirect The HTTP client drops sensitive headers after following a cross-domain redirect. For example, a request to a.com/ containing an Authorization header which is redirected to b.com/ will not send that header to b.com. In the event that the client received a subsequent same-domain redirect, however, the sensitive headers would be restored. For example, a chain of redirects from a.com/, to b.com/1, and finally to b.com/2 would incorrectly send the Authorization header to b.com/2. Thanks to Kyle Seely for reporting this issue. This is CVE-2024-45336 and Go issue https://go.dev/issue/70530. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Introduction
docker-credential-helpers is a suite of programs to use native stores to keep Docker credentials safe.
Installation
Go to the Releases page and download the binary that works better for you. Put that binary in your $PATH, so Docker can find it.
Building
You can build the credential helpers using Docker:
# install emulators
$ docker run --privileged --rm tonistiigi/binfmt --install all
# create builder
$ docker buildx create --use
# build credential helpers from remote repository and output to ./bin/build
$ docker buildx bake "https://github.com/docker/docker-credential-helpers.git"
# or from local source
$ git clone https://github.com/docker/docker-credential-helpers.git
$ cd docker-credential-helpers
$ docker buildx bake
Or if the toolchain is already installed on your machine:
1 - Download the source.
$ git clone https://github.com/docker/docker-credential-helpers.git
$ cd docker-credential-helpers
2 - Use make to build the program you want. That will leave an executable in the bin directory inside the repository.
$ make osxkeychain
3 - Put that binary in your $PATH, so Docker can find it.
$ cp bin/build/docker-credential-osxkeychain /usr/local/bin/
Usage
With the Docker Engine
Set the credsStore option in your ~/.docker/config.json file with the suffix of the program you want to use. For instance, set it to osxkeychain if you want to use docker-credential-osxkeychain.
{
"credsStore": "osxkeychain"
}
With other command line applications
The sub-package client includes functions to call external programs from your own command line applications.
There are three things you need to know if you need to interact with a helper:
- The name of the program to execute, for instance
docker-credential-osxkeychain. - The server address to identify the credentials, for instance
https://example.com. - The username and secret to store, when you want to store credentials.
You can see examples of each function in the client documentation.
Available programs
- osxkeychain: Provides a helper to use the OS X keychain as credentials store.
- secretservice: Provides a helper to use the D-Bus secret service as credentials store.
- wincred: Provides a helper to use Windows credentials manager as store.
- pass: Provides a helper to use
passas credentials store.
Note
pass needs to be configured for docker-credential-pass to work properly.
It must be initialized with a gpg2 key ID. Make sure your GPG key exists is in gpg2 keyring as pass uses gpg2 instead of the regular gpg.
Development
A credential helper can be any program that can read values from the standard input. We use the first argument in the command line to differentiate the kind of command to execute. There are four valid values:
store: Adds credentials to the keychain. The payload in the standard input is a JSON document withServerURL,UsernameandSecret.get: Retrieves credentials from the keychain. The payload in the standard input is the raw value for theServerURL.erase: Removes credentials from the keychain. The payload in the standard input is the raw value for theServerURL.list: Lists stored credentials. There is no standard input payload.
This repository also includes libraries to implement new credentials programs in Go. Adding a new helper program is pretty easy. You can see how the OS X keychain helper works in the osxkeychain directory.
- Implement the interface
credentials.HelperinYOUR_PACKAGE/ - Create a main program in
YOUR_PACKAGE/cmd/. - Add make tasks to build your program and run tests.
License
MIT. See LICENSE for more information.