|
1 | 1 | <# |
2 | 2 | .Synopsis |
3 | | - Ensures that all adminUsernames are expressions |
| 3 | + Ensures that all adminPasswords are expressions |
4 | 4 | .Description |
5 | | - Ensures that all properties within a template named adminUsername are expressions, not literal strings |
| 5 | + Ensures that all properties within a template named adminPassword are expressions, not literal strings |
6 | 6 | #> |
7 | 7 | param( |
8 | 8 | [Parameter(Mandatory = $true)] |
9 | 9 | [PSObject] |
10 | 10 | $TemplateObject |
11 | 11 | ) |
12 | 12 |
|
13 | | -# Find all references to an adminUserName |
| 13 | +# Find all references to an adminPassword |
14 | 14 | # Filtering the complete $TemplateObject directly fails with "The script failed due to call depth overflow." errors |
15 | 15 |
|
16 | 16 | if ("resources" -in $TemplateObject.PSobject.Properties.Name) { |
@@ -90,7 +90,7 @@ if ("variables" -in $TemplateObject.PSobject.Properties.Name) { |
90 | 90 | $LoginPasswordHasFunction = $trimmedAdminLoginPassword | ?<ARM_Template_Function> -Extract |
91 | 91 |
|
92 | 92 | # If we had a variable reference (not inside of another function) - then check it |
93 | | - # TODO this will not flag things like concat so we should add a blacklist here to ensure it's still not a static or deterministic username |
| 93 | + # TODO this will not flag things like concat so we should add a blacklist here to ensure it's still not a static or deterministic password |
94 | 94 | if ($LoginPasswordHasVariable -and $LoginPasswordHasFunction.FunctionName -eq 'variables') { |
95 | 95 | $variableValue = $TemplateObject.variables.($LoginPasswordHasVariable.VariableName) |
96 | 96 | $variableValueExpression = $variableValue | ?<ARM_Template_Expression> |
@@ -124,7 +124,7 @@ AdminLoginPassword references variable '$($LoginPasswordHasVariable.variableName |
124 | 124 | $LoginPasswordHasFunction = $trimmedAdminPassword | ?<ARM_Template_Function> -Extract |
125 | 125 |
|
126 | 126 | # If we had a variable reference (not inside of another function) - then check it |
127 | | - # TODO this will not flag things like concat so we should add a blacklist here to ensure it's still not a static or deterministic username |
| 127 | + # TODO this will not flag things like concat so we should add a blacklist here to ensure it's still not a static or deterministic password |
128 | 128 | if ($LoginPasswordHasVariable -and $LoginPasswordHasFunction.FunctionName -eq 'variables') { |
129 | 129 | $variableValue = $TemplateObject.variables.($LoginPasswordHasVariable.VariableName) |
130 | 130 | $variableValueExpression = $variableValue | ?<ARM_Template_Expression> |
|
0 commit comments