Prevent ACR refresh token exposure in EXECVE audit logs#4675
Open
Prevent ACR refresh token exposure in EXECVE audit logs#4675
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the VMSS bootstrapping image-pull flow to avoid exposing ACR credentials in process arguments by switching from az acr login to token-based login and podman login --password-stdin.
Changes:
- Replace
az acr login --name <registry>withaz acr login --expose-token+podman login --password-stdininpull_container_images(). - Derive ACR registry hostname from
ACRRESOURCEIDfor use withpodman login.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
s-fairchild
reviewed
Mar 10, 2026
s-fairchild
reviewed
Mar 10, 2026
fff96c9 to
bd9f985
Compare
bd9f985 to
0c59144
Compare
a068f9c to
467e224
Compare
tsatam
approved these changes
Mar 20, 2026
|
Please rebase pull request. |
d002497 to
461999c
Compare
tsatam
approved these changes
Mar 25, 2026
Member
|
/azp run ci |
|
Azure Pipelines successfully started running 1 pipeline(s). |
mociarain
approved these changes
Mar 30, 2026
f8f3644 to
b0d747a
Compare
b0d747a to
8ba5cfc
Compare
8ba5cfc to
f0cca0b
Compare
Collaborator
|
/azp run ci |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
Please rebase pull request. |
f0cca0b to
461999c
Compare
…e acr login secret Reference: https://portal.microsofticm.com/imp/v5/incidents/details/752908291/summary Add unset xtrace while configuring tls certificates * To be extra safe and ensure no certificate details are logged via shell tracing. Add shell check comments, Update function descriptions * Add shellcheck comments for warnings that can be safely ignored. * Improve function readability by formatting them all in the same style. Address shellcheck warnings in bootstrap scripts * Several warnings were unaddressed. Some of them were disabled as they can be safely ignored. * Others were refactored as the warnings were legitimate.
461999c to
f6bbea4
Compare
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.
Which issue this PR addresses:
Replace az acr login --name with az acr login --expose-token + podman login --password-stdin in pull_container_images() to prevent the ACR refresh token from appearing as a command-line argument in auditd EXECVE records.
https://issues.redhat.com/browse/ARO-24815
why we need it:
During RP/Gateway VMSS bootstrap,
pull_container_images()callsaz acr login --name $registry. The Azure CLI internally spawns adocker login --password $tokensubprocess, which exposes the ACR refresh token as a plaintext command-line argument. This is captured byauditd EXECVEsyscall logging.podman --password-stdinshould be used rather thanaz acr logto prevent the secret variable from being shown in shell output.What is PR does
Tip
Files that directly fix ARO-24815 are (to assist reviewing changes):
pkg/deploy/generator/scripts/rpVMSS.shpkg/deploy/generator/scripts/util-common.shxtraceshell option while working with sensitive information. Variables containing sensitive information are written to output whenxtraceis set.podmanshellcheckwarningsGeneral improvements to improve readability
Test plan for issue:
Deploying to INT to
Successfully deployed in pipelines:
aroimage pull is attempted. It tries to pull an image based on the tag, which apparently is no longer created.