Skip to content

Commit

Permalink
Merge pull request #3600 from Azure/nwnt/trusted-launch-devproxy
Browse files Browse the repository at this point in the history
Make dev-proxy use Trusted Launch
  • Loading branch information
mociarain authored Jul 12, 2024
2 parents 3cd8bc5 + 6b30e87 commit 367a479
Show file tree
Hide file tree
Showing 62 changed files with 52,490 additions and 9 deletions.
2 changes: 1 addition & 1 deletion pkg/deploy/assets/cluster-development-predeploy.json
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@
"type": "Microsoft.Compute/diskEncryptionSets",
"location": "[resourceGroup().location]",
"condition": "[parameters('ci')]",
"apiVersion": "2020-12-01",
"apiVersion": "2021-12-01",
"dependsOn": [
"[resourceId('Microsoft.KeyVault/vaults/keys', parameters('kvName'), concat(resourceGroup().name, '-disk-encryption-key'))]"
]
Expand Down
7 changes: 5 additions & 2 deletions pkg/deploy/assets/env-development.json
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@
"name": "[concat(resourceGroup().name, '-disk-encryption-set')]",
"type": "Microsoft.Compute/diskEncryptionSets",
"location": "[resourceGroup().location]",
"apiVersion": "2020-12-01",
"apiVersion": "2021-12-01",
"dependsOn": [
"[resourceId('Microsoft.KeyVault/vaults/keys', concat(take(resourceGroup().name,10), '-dev-sharedKV'), concat(resourceGroup().name, '-disk-encryption-key'))]"
]
Expand Down Expand Up @@ -353,6 +353,9 @@
}
]
},
"securityProfile": {
"securityType": "TrustedLaunch"
},
"extensionProfile": {
"extensions": [
{
Expand Down Expand Up @@ -417,7 +420,7 @@
"tags": {
"azsecpack": "nonprod"
},
"apiVersion": "2020-12-01",
"apiVersion": "2021-12-01",
"dependsOn": [
"[resourceId('Microsoft.Network/loadBalancers', 'dev-lb-internal')]"
]
Expand Down
2 changes: 1 addition & 1 deletion pkg/deploy/assets/gateway-production.json
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@
"type": "Microsoft.Compute/virtualMachineScaleSets",
"location": "[resourceGroup().location]",
"tags": {},
"apiVersion": "2020-12-01",
"apiVersion": "2021-12-01",
"dependsOn": [
"[resourceId('Microsoft.Network/loadBalancers', 'gateway-lb-internal')]"
]
Expand Down
2 changes: 1 addition & 1 deletion pkg/deploy/assets/rp-production.json
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,7 @@
"type": "Microsoft.Compute/virtualMachineScaleSets",
"location": "[resourceGroup().location]",
"tags": {},
"apiVersion": "2020-12-01",
"apiVersion": "2021-12-01",
"dependsOn": [
"[resourceId('Microsoft.Authorization/roleAssignments', guid(resourceGroup().id, parameters('rpServicePrincipalId'), 'RP / Reader'))]",
"[resourceId('Microsoft.Network/loadBalancers', 'rp-lb')]"
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 @@ -143,6 +143,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 @@ -390,7 +393,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 @@ -401,7 +404,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.DiskEncryptionSetIdentityTypeSystemAssigned},
}

return &arm.Resource{
Expand Down
2 changes: 1 addition & 1 deletion pkg/util/azureclient/apiversions.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ var apiVersions = map[string]string{
"microsoft.authorization": "2018-09-01-preview",
"microsoft.authorization/denyassignments": "2018-07-01-preview",
"microsoft.authorization/roledefinitions": "2018-01-01-preview",
"microsoft.compute": "2020-12-01",
"microsoft.compute": "2021-12-01",
"microsoft.compute/diskencryptionsets": "2021-04-01",
"microsoft.compute/disks": "2019-03-01",
"microsoft.compute/galleries": "2022-03-03",
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 367a479

Please sign in to comment.