Skip to content

fix: Remove hardcoded VM admin password and improve credential security#138

Open
Rafi-Microsoft wants to merge 3 commits intomicrosoft:devfrom
Rafi-Microsoft:fix/vm-credential-security
Open

fix: Remove hardcoded VM admin password and improve credential security#138
Rafi-Microsoft wants to merge 3 commits intomicrosoft:devfrom
Rafi-Microsoft:fix/vm-credential-security

Conversation

@Rafi-Microsoft
Copy link
Copy Markdown
Contributor

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.sh script. The most important changes are grouped below:

Security and Deployment Documentation:

  • Updated docs/deploymentguide.md to emphasize that VM admin passwords should never be committed to source control. Guidance now recommends using environment variables or secret managers, and clarifies that infra/main.bicepparam intentionally provides no default password—deployment will prompt or fail if unset.
  • Changed the default value for the vmAdminPassword parameter in infra/main.bicepparam to an empty string, removing the insecure default password.

Quota Check Script Refactoring:

  • Replaced the use of dynamic variable names (with eval) for tracking quota check results with an associative array RESULTS for safer and clearer result storage in scripts/quota_check.sh. [1] [2] [3] [4]

Does this introduce a breaking change?

  • Yes
  • No

Rafi-Microsoft and others added 2 commits April 17, 2026 18:00
- 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant