fix: Remove hardcoded VM admin password and improve credential security#138
Open
Rafi-Microsoft wants to merge 3 commits intomicrosoft:devfrom
Open
fix: Remove hardcoded VM admin password and improve credential security#138Rafi-Microsoft wants to merge 3 commits intomicrosoft:devfrom
Rafi-Microsoft wants to merge 3 commits intomicrosoft:devfrom
Conversation
- Remove hardcoded default password from vmAdminPassword parameter in main.bicepparam to prevent known credentials from being deployed unintentionally. The parameter now defaults to an empty string, requiring users to set VM_ADMIN_PASSWORD via azd env set. - Update deployment guide to remove guidance that encouraged committing VM credentials to source control. Replaced with security warning recommending azd env set, secrets manager, or pipeline secret variables. - Aligned with VM credential patterns used by other Microsoft solution accelerators (Content Generation, Code Modernization, DKM, Container Migration) which use pure environment variable substitution with no hardcoded password defaults. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Replace unsafe eval-based dynamic variable names with a declare -A associative array keyed by 'region:index'. This eliminates potential code-injection risks from eval and improves script maintainability. Addresses Copilot review comments on PR microsoft#131 (lines 191, 216, 226, 294 of scripts/quota_check.sh). Co-authored-by: Copilot <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.
Purpose
This pull request improves security practices for handling VM admin passwords in deployment and refactors how quota check results are tracked in the
scripts/quota_check.shscript. The most important changes are grouped below:Security and Deployment Documentation:
docs/deploymentguide.mdto emphasize that VM admin passwords should never be committed to source control. Guidance now recommends using environment variables or secret managers, and clarifies thatinfra/main.bicepparamintentionally provides no default password—deployment will prompt or fail if unset.vmAdminPasswordparameter ininfra/main.bicepparamto an empty string, removing the insecure default password.Quota Check Script Refactoring:
eval) for tracking quota check results with an associative arrayRESULTSfor safer and clearer result storage inscripts/quota_check.sh. [1] [2] [3] [4]Does this introduce a breaking change?