Repository navigation
[Containerapp] Secure Docker executable resolution - #10465
Open
Greedygre (Greedygre) wants to merge 2 commits into
Open
Greedygre (Greedygre) wants to merge 2 commits into
Greedygre (Greedygre) wants to merge 2 commits into
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Greedygre (Greedygre)
requested review from
Zunli Hu (Juliehzl) and
Hong Wang (howang-ms)
as code owners
October 13, 2026 10:09
microsoft-github-policy-service
Bot
requested review from
ZelinWang (wangzelin007) and
Yong Zhang (yonzhan)
October 13, 2026 10:11
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
ACR retry cleanup does not fully restore command state when overridden keys were initially absent.
1 open finding
What changed in this PR
Secures Docker invocation by resolving and validating an absolute executable path.
Changes:
- Adds trusted Docker path resolution for build and patch flows.
- Pins Docker for ACR login retries and restores temporary state.
- Adds unit tests and release notes.
| File | Description |
|---|---|
HISTORY.rst |
Documents Docker path hardening. |
test_utils.py |
Tests path resolution and push behavior. |
test_containerapp_patch_unit.py |
Tests patch Docker invocation. |
custom.py |
Uses resolved Docker path for patches. |
_utils.py |
Resolves and validates Docker paths. |
_up_utils.py |
Uses the path for pushes and ACR retries. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+568
to
+569
| for k, v in old_command_kwargs.items(): | ||
| self.cmd.command_kwargs[k] = v |
|
Hi Greedygre (@Greedygre), |
Collaborator
|
containerapp |
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
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.

🤖 PR Validation — ️✔️ All clear
This checklist is used to make sure that common guidelines for a pull request are followed.
Related command
az containerapp up --source <path> --registry-server <registry>.azurecr.ioaz containerapp patch list|apply|interactiveOn Windows, launching Docker by a bare executable name can select an untrusted
docker.exefrom the current working directory. This change uses Azure CLI Core'sget_safe_executable_path("docker")helper and passes its absolute result to every local Docker subprocess used by the buildpack and patch flows.The ACR login retry receives the same resolved path through
DOCKER_COMMAND. Its temporary environment andcommand_kwargschanges are restored exactly, including removing keys that were originally absent.This PR depends on the Azure CLI Core release containing Azure/azure-cli#34212. The Containerapp minimum Core version remains unchanged for now and must be updated to that released version before this PR is merged.
Validation:
devcommit5f64a805d8: passed, 36 tests.TestSafeExecutablePath: passed, 5 tests.py_compile, andgit diff --check: passed.python scripts/ci/test_index.py -q: passed, 9 tests with 2 skipped.General Guidelines
azdev style <YOUR_EXT>locally? (pip install azdevrequired)azdevenvironment is not configured. Equivalent pylint and flake8 checks passed against the Coredevsource.python scripts/ci/test_index.py -qlocally? (pip install azdevrequired)For new extensions:
containerappis an existing extension.About Extension Publish
There is a pipeline to automatically build, upload and publish extension wheels.
Once your pull request is merged into main branch, a new pull request will be created to update
src/index.jsonautomatically.You only need to update the version information in file setup.py and historical information in file HISTORY.rst in your PR but do not modify
src/index.json.This PR intentionally does not change the extension version or
src/index.json.