-
Notifications
You must be signed in to change notification settings - Fork 94
Enable encryption at host for virtual machine scale sets and virtual machines #505
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
base: main
Are you sure you want to change the base?
Enable encryption at host for virtual machine scale sets and virtual machines #505
Conversation
…et and virtual machine.
| 3. Take a backup of these non-compliant resource types. | ||
| 4. Register 'Microsoft.Security' provider and enable Azure Defender plan for all non-compliant resource types for subscription. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
already this line removed
| # Command to execute: | ||
| Examples: | ||
| 1. Run below command to configure Azure Defender for subscription |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
azure defender ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed
| } | ||
|
|
||
| Write-Host $([Constants]::SingleDashLine) | ||
| $VirtualMachines = Get-AzVM -ResourceGroupName $ResourceGroupName |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the control logic, we are not considering all VM's, only VMSS and underlying VMs when the orchestration mode is flexible. BRS should be aligned with the control logic
| <########################################## | ||
| # Overview: | ||
| This script is used to Enable Encryption at Host for Virtual machine scale sets and Virtual machines. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
make the comment more illustrated like - and underlying Virtual Machines in flexible mode
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated comment
| # Safe Check: Current user needs to be either Contributor or Owner for the subscription | ||
| $currentLoginRoleAssignments = Get-AzRoleAssignment -SignInName $currentSub.Account.Id -Scope "/subscriptions/$($SubscriptionId)"; | ||
|
|
||
| if (($currentLoginRoleAssignments | Where { $_.RoleDefinitionName -eq "Owner" -or $_.RoleDefinitionName -eq 'Contributor' -or $_.RoleDefinitionName -eq "Security Admin" } | Measure-Object).Count -le 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
did you check for security admin role ? as this is role is not mentioned in the comments
Scripts/RemediationScripts/Remediate-EnableEncrytionAtHostForVMSS.ps1
Outdated
Show resolved
Hide resolved
Scripts/RemediationScripts/Remediate-EnableEncrytionAtHostForVMSS.ps1
Outdated
Show resolved
Hide resolved
| "InitCommand": "Enable-EncrytionAtHost", | ||
| "RollbackMetadata": { | ||
| "RollbackCommand": "Disable-EncrytionAtHost", | ||
| "Arguments": ["SubscriptionId", "Path"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why Path is needed here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's file path, where we backup the remediated resources list in .json file.
SO, when user want to rollback the operations, user need to give file Path as argument.
…mkar/remediation-enable-encryption-vm
This remediation script helps to enable encryption at host property for virtual machine scale sets and virtual machines on subscription. In case, after executing script, if you want to rollback the changes, you can rollback the earlier changes.