Skip to content

Commit

Permalink
Make dev-proxy use Trusted Launch
Browse files Browse the repository at this point in the history
  • Loading branch information
nwnt committed May 29, 2024
1 parent 6a973ea commit 2ec5499
Show file tree
Hide file tree
Showing 58 changed files with 52,484 additions and 3 deletions.
3 changes: 3 additions & 0 deletions pkg/deploy/assets/env-development.json
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,9 @@
}
]
},
"securityProfile": {
"securityType": "TrustedLaunch"
},
"extensionProfile": {
"extensions": [
{
Expand Down
9 changes: 6 additions & 3 deletions pkg/deploy/generator/resources_dev.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"fmt"
"strings"

mgmtcompute "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2020-06-01/compute"
mgmtcompute "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2021-12-01/compute"
mgmtkeyvault "github.com/Azure/azure-sdk-for-go/services/keyvault/mgmt/2019-09-01/keyvault"
mgmtnetwork "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-08-01/network"
"github.com/Azure/go-autorest/autorest/to"
Expand Down Expand Up @@ -140,6 +140,9 @@ func (g *generator) devProxyVMSS() *arm.Resource {
},
},
},
SecurityProfile: &mgmtcompute.SecurityProfile{
SecurityType: mgmtcompute.SecurityTypesTrustedLaunch,
},
StorageProfile: &mgmtcompute.VirtualMachineScaleSetStorageProfile{
ImageReference: &mgmtcompute.ImageReference{
Publisher: to.StringPtr("MicrosoftCBLMariner"),
Expand Down Expand Up @@ -386,7 +389,7 @@ func (g *generator) devDiskEncryptionKey() *arm.Resource {
func (g *generator) devDiskEncryptionSet() *arm.Resource {
diskEncryptionSet := &mgmtcompute.DiskEncryptionSet{
EncryptionSetProperties: &mgmtcompute.EncryptionSetProperties{
ActiveKey: &mgmtcompute.KeyVaultAndKeyReference{
ActiveKey: &mgmtcompute.KeyForDiskEncryptionSet{
KeyURL: to.StringPtr(fmt.Sprintf("[reference(resourceId('Microsoft.KeyVault/vaults/keys', %s, %s), '%s', 'Full').properties.keyUriWithVersion]", sharedKeyVaultName, sharedDiskEncryptionKeyName, azureclient.APIVersion("Microsoft.KeyVault"))),
SourceVault: &mgmtcompute.SourceVault{
ID: to.StringPtr(fmt.Sprintf("[resourceId('Microsoft.KeyVault/vaults', %s)]", sharedKeyVaultName)),
Expand All @@ -397,7 +400,7 @@ func (g *generator) devDiskEncryptionSet() *arm.Resource {
Name: to.StringPtr(fmt.Sprintf("[%s]", sharedDiskEncryptionSetName)),
Type: to.StringPtr("Microsoft.Compute/diskEncryptionSets"),
Location: to.StringPtr("[resourceGroup().location]"),
Identity: &mgmtcompute.EncryptionSetIdentity{Type: mgmtcompute.SystemAssigned},
Identity: &mgmtcompute.EncryptionSetIdentity{Type: mgmtcompute.DiskEncryptionSetIdentityType(mgmtcompute.ResourceIdentityTypeSystemAssigned)},
}

return &arm.Resource{
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 2ec5499

Please sign in to comment.