Repository navigation
fix(docker): don't send docker credentials in the V3 apply_manifest request. - #1410
Merged
Merged
Conversation
|
|
CAPI records the full manifest YAML verbatim in the audit.app.apply_manifest event and does not redact docker.password. Including the password in the manifest therefore leaks it into the audit log. Docker credentials must be passed via POST /v3/packages (createPackage), not embedded in the manifest.
ZPascal
reviewed
Nov 21, 2026
- Rename stripDockerPasswords to stripDockerCredentials (strips both username and password since @Value.Check prohibits username without password) - Restore ApplicationManifestUtilsCommon.toDockerYaml to upstream state (password omission moved to V3-only path in DefaultApplications) - Update comment to reference credentials instead of password - Add two tests: round-trip and credential stripping
ZPascal
reviewed
Nov 23, 2026
Contributor
There was a problem hiding this comment.
Thanks for the update; moving the stripping into pushManifestV3 looks good to me. Clearing both username and password is also the right call, since the model doesn't allow a username without a password. A few things need to be adjusted before this can go in. You can find my findings as inline comments below.
PS: The PR title still talks about YAML serialization, which this change doesn't really touch anymore. You can change it to fix(docker): don't send docker credentials in the V3 apply_manifest request.
apply_manifest request.
3 of 4 tasks
ZPascal
added a commit
to ZPascal/cf-java-client
that referenced
this pull request
Nov 24, 2026
Follow-up to cloudfoundry#1410: - Add a DefaultApplicationsTest case for pushManifestV3 that checks the apply_manifest body has no docker credentials while the package request still gets them. - Move the stripDockerCredentials test to DefaultApplicationsTest and cover several apps, untouched apps and kept fields. - Only skip stripping when both username and password are missing. - Delete the temp manifest files written by ApplicationManifestUtilsV3Test.
ZPascal
added a commit
to ZPascal/cf-java-client
that referenced
this pull request
Nov 24, 2026
Follow-up to cloudfoundry#1410: - Add a DefaultApplicationsTest case for pushManifestV3 that checks the apply_manifest body has no docker credentials while the package request still gets them. - Move the stripDockerCredentials test to DefaultApplicationsTest and cover several apps, untouched apps and kept fields. - Only skip stripping when both username and password are missing. - Delete the temp manifest files written by ApplicationManifestUtilsV3Test.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
CAPI records the full manifest YAML verbatim in the
audit.app.apply_manifestevent and does not redactdocker.password. Including credentials in the manifest therefore leaks them into the audit log.This fix strips docker credentials from the manifest copy sent to
applyManifestinpushManifestV3, leavingApplicationManifestUtilsCommon.toDockerYamlunchanged so V2 manifest serialization is unaffected. Both username and password are stripped together — keeping username without password would violate the@Value.Checkinvariant onManifestV3Application.createPackagestill reads credentials from the originalrequest.getManifest(), so the Docker image pull continues to work:cloudFoundryClient.packages().create(...)DockerDatawith.username(...)and.password(...)POST /v3/packageswith{"data": {"image": "...", "username": "...", "password": "..."}}— CAPI redacts the password in the resultingaudit.app.package.createevent