Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AVM Module Issue]: Key Vault Secret Reference for Domain Join Extension #4110

Open
1 task done
Rembrandtastic opened this issue Dec 30, 2024 · 6 comments
Open
1 task done
Assignees
Labels
Class: Resource Module 📦 This is a resource module Type: AVM 🅰️ ✌️ Ⓜ️ This is an AVM related issue Type: Security Bug 🔒 This is a security bug

Comments

@Rembrandtastic
Copy link

Check for previous/existing GitHub issues

  • I have checked for previous/existing GitHub issues

Issue Type?

Security Bug

Module Name

avm/res/compute/virtual-machine

(Optional) Module Version

No response

Description

Currently when trying to pass key vault secret references for the domain join extension into the Virtual Machine module I am given the error that this parameter is not using a secure decorator which is required for the getSecret function. This means I cannot use the domain join extension as my sensitive domain account needs to be referenced from a key vault.

Image

(Optional) Correlation Id

No response

@Rembrandtastic Rembrandtastic added Needs: Triage 🔍 Maintainers need to triage still Type: AVM 🅰️ ✌️ Ⓜ️ This is an AVM related issue labels Dec 30, 2024
@avm-team-linter avm-team-linter bot added the Class: Resource Module 📦 This is a resource module label Dec 30, 2024
Copy link

@Rembrandtastic, thanks for submitting this issue for the avm/res/compute/virtual-machine module!

Important

A member of the @Azure/avm-res-compute-virtualmachine-module-owners-bicep or @Azure/avm-res-compute-virtualmachine-module-contributors-bicep team will review it soon!

@AlexanderSehr
Copy link
Contributor

AlexanderSehr commented Dec 30, 2024

Hey @Rembrandtastic,
isn't the module expecting set password via the @secure extensionDomainJoinPassword parameter?

@description('Optional. Required if name is specified. Password of the user specified in user parameter.')
@secure()
param extensionDomainJoinPassword string = ''
@description('Optional. The configuration for the [Domain Join] extension. Must at least contain the ["enabled": true] property to be executed.')
@secure()
param extensionDomainJoinConfig object = {}

being used here:

module vm_domainJoinExtension 'extension/main.bicep' = if (contains(extensionDomainJoinConfig, 'enabled') && extensionDomainJoinConfig.enabled) {
name: '${uniqueString(deployment().name, location)}-VM-DomainJoin'
params: {
virtualMachineName: vm.name
name: 'DomainJoin'
location: location
publisher: 'Microsoft.Compute'
type: 'JsonADDomainExtension'
typeHandlerVersion: extensionDomainJoinConfig.?typeHandlerVersion ?? '1.3'
autoUpgradeMinorVersion: extensionDomainJoinConfig.?autoUpgradeMinorVersion ?? true
enableAutomaticUpgrade: extensionDomainJoinConfig.?enableAutomaticUpgrade ?? false
settings: extensionDomainJoinConfig.settings
supressFailures: extensionDomainJoinConfig.?supressFailures ?? false
tags: extensionDomainJoinConfig.?tags ?? tags
protectedSettings: {
Password: extensionDomainJoinPassword
}
}
dependsOn: [
vm_aadJoinExtension
]
}

@AlexanderSehr
Copy link
Contributor

AlexanderSehr commented Dec 30, 2024

I think part of the challenge is that there is no User-defined type for the extension - and to make matters worse also not example in the max tests as there is no domain we could 'test join' the deployed VM to.
Any ideas how we could maybe work around this limitation @rahalan?

At least a UDT 'should' be possible.

@microsoft-github-policy-service microsoft-github-policy-service bot added the Status: Response Overdue 🚩 When an issue/PR has not been responded to for X amount of days label Jan 3, 2025
@rahalan rahalan removed Needs: Triage 🔍 Maintainers need to triage still Status: Response Overdue 🚩 When an issue/PR has not been responded to for X amount of days labels Jan 5, 2025
@rahalan
Copy link
Contributor

rahalan commented Jan 5, 2025

@Rembrandtastic thanks, will look into it

@Rembrandtastic
Copy link
Author

I think part of the challenge is that there is no User-defined type for the extension - and to make matters worse also not example in the max tests as there is no domain we could 'test join' the deployed VM to. Any ideas how we could maybe work around this limitation @rahalan?

At least a UDT 'should' be possible.

Okay yeah I am a little new to AVM and did not think to go look at the actual module code to see the parameters. You are right though, UDT, or just an example usage in the documentation would probably help avoid this issue for AVM new comers like me.

Thanks!

@AlexanderSehr
Copy link
Contributor

I think part of the challenge is that there is no User-defined type for the extension - and to make matters worse also not example in the max tests as there is no domain we could 'test join' the deployed VM to. Any ideas how we could maybe work around this limitation @rahalan?
At least a UDT 'should' be possible.

Okay yeah I am a little new to AVM and did not think to go look at the actual module code to see the parameters. You are right though, UDT, or just an example usage in the documentation would probably help avoid this issue for AVM new comers like me.

Thanks!

Hey @Rembrandtastic,
going to the code certainly would be an option - but - the readme would've already provided some insights without needing you to screen the code :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Class: Resource Module 📦 This is a resource module Type: AVM 🅰️ ✌️ Ⓜ️ This is an AVM related issue Type: Security Bug 🔒 This is a security bug
Projects
Status: Needs: Triage
Development

No branches or pull requests

3 participants