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

Add encryption at host flag to the arm template #311

Merged
merged 1 commit into from
Jul 6, 2023

Conversation

kamilpi
Copy link
Contributor

@kamilpi kamilpi commented Jun 30, 2023

This is an additional parameter already existing in the arm template. We have restricted policies on our infrastructure where we are not able to create the virtual machine without Encryption at host enabled.

I know that it could be a dedicated subscription for the build process but this is the organization and certification requirement.

@kamilpi kamilpi requested a review from a team as a code owner June 30, 2023 09:55
@hashicorp-cla
Copy link

hashicorp-cla commented Jun 30, 2023

CLA assistant check
All committers have signed the CLA.

@kamilpi kamilpi force-pushed the feature/encryption-at-host branch from 1ee0bdf to 7a2c87e Compare June 30, 2023 09:57
Copy link
Contributor

@JenGoldstrich JenGoldstrich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @kamilpi thank you for this contribution, I added a comment about trusted launch but can you also take a look at the unit tests failing in the GitHub Checks? They are failing because your changes mean we generate a different Arm VM template than these unit tests expect, you can find these templates in ./builder/azure/arm/template_factory_test.TestVirtualMachineDeployment*.json please let me know if you have any questions or need some help fixing these unit tests!

@@ -562,6 +562,8 @@ type Config struct {
LicenseType string `mapstructure:"license_type" required:"false"`
// Specifies if Secure Boot and Trusted Launch is enabled for the Virtual Machine.
SecureBootEnabled bool `mapstructure:"secure_boot_enabled" required:"false"`
// Specifies if Encryption at host is enabled for the Virtual Machine.
Copy link
Contributor

@JenGoldstrich JenGoldstrich Jun 30, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// Specifies if Encryption at host is enabled for the Virtual Machine.
// Specifies if Encryption at host is enabled for the Virtual Machine.
// Requires enabling encryption at host in the Subscription read more [here](https://learn.microsoft.com/en-us/azure/virtual-machines/disks-enable-host-based-encryption-portal?tabs=azure-powershell)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kamilpi do you mind taking in this change as well? Afterwards you need to run make generate to generate the docs site from the config, let me know if you have any trouble with this as I can just commit the change to your fork

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@kamilpi kamilpi force-pushed the feature/encryption-at-host branch from 7a2c87e to c73f089 Compare July 3, 2023 04:49
@kamilpi kamilpi force-pushed the feature/encryption-at-host branch from c73f089 to 3abb3a3 Compare July 4, 2023 04:10
@JenGoldstrich
Copy link
Contributor

Thanks for this contribution @kamilpi merging this now! We should have a release out containing this change in a few weeks

@JenGoldstrich JenGoldstrich merged commit 535ffeb into hashicorp:main Jul 6, 2023
@kamilpi kamilpi deleted the feature/encryption-at-host branch July 7, 2023 05:02
@oliverlabs
Copy link
Contributor

does this solve the Trusted Launch issue @JenGoldstrich ? :)

@mala3000
Copy link

This breaks the build process when the feature is not enabled in the Azure subscription and the packer variable is not set, while it worked perfectly fine on 1.4.3.
If the variable is not set in the packer config, it shouldn't try to set it in Azure, the same as it was in 1.4.3.

Details=[{"code":"BadRequest","message":"{\r\n "error": {\r\n "code": "InvalidParameter",\r\n "message": "The property 'securityProfile.encryptionAtHost' is not valid because the 'Microsoft.Compute/EncryptionAtHost' feature is not enabled for this subscription.",\r\n "target": "securityProfile.encryptionAtHost"\r\n }\r\n}"}]

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.

5 participants