Skip to content

Commit 29e0694

Browse files
authored
Update CGV secrets handling in configuration guide
Clarify requirements for CGV with and without AKV, including examples for secret handling in ARM templates.
1 parent bf24032 commit 29e0694

1 file changed

Lines changed: 68 additions & 35 deletions

File tree

articles/operator-service-manager/configuration-guide.md

Lines changed: 68 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -94,12 +94,14 @@ This example shows the rendered CGV resource created after the CGV deployment co
9494
## CGS with secrets
9595
Other than separating secrets into a unique CGS, no special requirements exist for CGS secret support.
9696

97-
## CGV with secrets
98-
Consider the following Azure Resource Manager (ARM) template requirements when creating a CGV to properly obscure secret values throughout the entire CGV resource lifecycle.
97+
## CGV with secrets without AKV
98+
Where AKV is not being useed, consider the following CGV Azure Resource Manager (ARM) template requirements to properly obscure secret values throughout CGV resource lifecycle.
99+
100+
* Define a object paramerter `secretCgvContent` with `"type": "secureObject"` to contain all secrets.
101+
* Before a CGV is deployed, this configuration obscures the display of secrets as template parameters.
102+
103+
This example shows how to define a object paremter `secretCgvContent` to contain all secrets.
99104

100-
* Use `"type": "secureObject"` in the template for type of the `secretCgvContent` parameter
101-
* This configuration obscures the CGV play of the secrets as template parameters.
102-
103105
```json
104106
"parameters": {
105107
"secretCgvContent": {
@@ -109,10 +111,12 @@ Consider the following Azure Resource Manager (ARM) template requirements when c
109111
```
110112

111113
> [!NOTE]
112-
> * Do not hydrate `secretCgvContent` using the loadJsonContent() function in bicep as this will expose the data using insecure variables.
114+
> * Do not hydrate `secretCgvContent` using the bicep loadJsonContent() function as it forces the use of insecure variables.
113115
114-
* Use `configurationType: 'Secret'` and `"secretDeploymentValues": "[string(parameters('secretCgvContent'))]"` in the template under CGV resource properties.
115-
* Once a CGV is deployed, this configuration prevents displaying the secret data via most Azure methods.
116+
* Under CGV resource properties use `configurationType: 'Secret'` and `"secretConfigurationValue": "[string(parameters('secretCgvContent'))]"`.
117+
* Once a CGV is deployed, this configuration prevents displaying the secret data via most Azure user interfaces.
118+
119+
This example shows how to pass all secrets in the object `secretCgvContent` to the new CGV.
116120

117121
```json
118122
{
@@ -124,23 +128,64 @@ Consider the following Azure Resource Manager (ARM) template requirements when c
124128
}
125129
```
126130

131+
## CGV with secrets with AKV
132+
Where AKV is being useed, consider the following CGV Azure Resource Manager (ARM) template requirements to properly obscure secret values throughout CGV resource lifecycle.
133+
134+
* Define a string `parameter` for each secret and one object `variable` to collect all secret values.
135+
* The object variable contains only a reference to the parameter string and exposes no secrets.
136+
137+
This example shows how to define a paremter `secretPassword` contained within the object variable `secretVal.configurationValue`.
138+
139+
```json
140+
"parameters": {
141+
"secretPassword": {
142+
"type": "string"
143+
}
144+
}
145+
"variables": {
146+
"configurationValue": {
147+
"secretValues": {
148+
"elastic_passwd": "secretPassword"
149+
}
150+
}
151+
}
152+
```
153+
127154
* Use a template reference to Azure Key Vault (AKV) in place of the plain-text secret.
128-
* This configuration obscures the display of the secrets as template variables.
155+
* Before the CGV is deployed, this configuration obscures the display of the secrets as template variables.
129156

130-
This example shows how to include an AKV reference to a secret named `secretName` in an ARM template.
157+
This example shows how to hydrate the secret `secretPassword` using Azure Key Vault secret and key.
131158

132159
```json
133-
"password": {
160+
"secretPassword": {
134161
"reference": {
135162
"keyVault": {
136163
"id": "/subscriptions/xxx/resourceGroups/yyy/providers/Microsoft.KeyVault/vaults/zz"
137164
},
138-
"secretName": "passwd"
165+
"secretPassword": "<akv-secret-key>"
166+
}
167+
}
168+
```
169+
170+
* Under CGV resource properties use `configurationType: 'Secret'` and `"secretConfigurationValue": "string(secretVal.configurationValue)"`.
171+
* Once a CGV is deployed, this configuration prevents displaying the secret data via most Azure user interfaces.
172+
173+
This example shows how to pass all secrets in the object `secretVal.configurationValue` to the new CGV.
174+
175+
```json
176+
{
177+
"resources": [ {
178+
"type": "Microsoft.HybridNetwork/configurationGroupValues",
179+
"properties": {
180+
"configurationType": "Secret"
181+
"secretConfigurationValue": "string(secretVal.configurationValue)"
139182
}
183+
}
184+
]
140185
```
141186

142187
## NF with secrets
143-
Consider the following Azure Resource Manager (ARM) template requirements when creating a NF to properly obscure secret values throughout the entire NF resource lifecycle.
188+
Consider the following Azure Resource Manager (ARM) template requirements when creating a network function to properly obscure secret values throughout network function resource lifecycle.
144189

145190
* Use `"type": "secureObject"` in the template for type of the `secretValues` and `config` parameter
146191
* This configuration obscures the display of the secrets as template parameters.
@@ -149,7 +194,7 @@ Consider the following Azure Resource Manager (ARM) template requirements when c
149194
"parameters": {
150195
"siteSpecificValues": {
151196
"type": "object"
152-
},
197+
},
153198
"secretValues": {
154199
"type": "secureObject"
155200
},
@@ -163,35 +208,23 @@ Consider the following Azure Resource Manager (ARM) template requirements when c
163208
}
164209
```
165210

166-
* Use `configurationType: 'Secret'` and `"secretDeploymentValues": "[string(parameters('secretCgvContent'))]"` in the template under CGV resource properties.
167-
* Once a CGV is deployed, this configuration prevents displaying the secret data via most Azure methods.
168-
169-
```json
170-
"properties": {
171-
"configurationType": "Secret",
172-
"secretDeploymentValues": "[string(parameters('config'))]"
173-
}
174-
```
175-
176211
> [!NOTE]
177-
> * Do not hydrate `secretCgvContent` using the loadJsonContent() function in bicep as this will expose the data using insecure variables.
212+
> * Do not hydrate `secretCgvContent` using the bicep loadJsonContent() function as it forces the use of insecure variables.
178213

179-
* Use `configurationType: 'Secret'` and `"secretDeploymentValues": "[string(parameters('secretCgvContent'))]"` in the template under CGV resource properties.
180-
* Once a CGV is deployed, this configuration prevents displaying the secret data via most Azure methods.
214+
* Under networkFunctions resource properties use `configurationType: 'Secret'` and `"secretDeploymentValues": "[string(parameters('config'))]"`.
215+
* Once a network function is deployed, this configuration prevents displayed the secret data via most Azure user interfaces.
181216

182217
```json
183-
{
184-
"type": "Microsoft.HybridNetwork/configurationGroupValues",
185-
"properties": {
186-
"configurationType": "Secret"
187-
"secretDeploymentValues": "[string(parameters('secretCgvContent'))]"
218+
"resources": [
219+
{
220+
"type": "Microsoft.HybridNetwork/networkFunctions",
221+
"configurationType": "Secret",
222+
"secretDeploymentValues": "[string(variables('config'))]",
188223
}
189-
}
224+
]
190225
```
191226

192-
193227
> [!NOTE]
194-
> * ARM templates only support Azure Key Vault for secret reference substitution.
195228
> * Consider restricting access to the role based access control (RBAC) scope `Microsoft.Resources/deployments/exportTemplate/action` to only admin roles.
196229

197230
## Overview of JSON Schema

0 commit comments

Comments
 (0)