Prevent ACR refresh token exposure in EXECVE audit logs#4675
Prevent ACR refresh token exposure in EXECVE audit logs#4675
Conversation
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.
fff96c9 to
bd9f985
Compare
bd9f985 to
0c59144
Compare
a068f9c to
467e224
Compare
|
The new xtrace helpers can abort bootstrap under ARO-RP/pkg/deploy/generator/scripts/util-common.sh Lines 54 to 71 in 467e224 |
|
@copilot please review |
467e224 to
865dc1d
Compare
@swiencki This is true. I've tested locally with a short script sourcing Anyways I've pushed an update that returns 0 if the conditional test for |
|
@copilot please review |
865dc1d to
3fd4684
Compare
|
Please rebase pull request. |
3fd4684 to
d002497
Compare
|
Please rebase pull request. |
…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.
d002497 to
461999c
Compare
|
/azp run ci |
|
Azure Pipelines successfully started running 1 pipeline(s). |
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.