-
Notifications
You must be signed in to change notification settings - Fork 773
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
Improve reporting when assigning a secure value to an insecure target or vice versa #16665
base: main
Are you sure you want to change the base?
Conversation
Test this change out locally with the following install scripts (Action run 13952431314) VSCode
Azure CLI
|
@@ -52,7 +52,9 @@ resource aks 'Microsoft.ContainerService/managedClusters@2020-03-01' = { | |||
} | |||
servicePrincipalProfile: { | |||
clientId: servicePrincipalClientId | |||
//@[22:46) [BCP417 (Info)] The supplied value has been marked as secure but is being assigned to a target that is not expecting sensitive data. (bicep https://aka.ms/bicep/core-diagnostics#BCP417) |servicePrincipalClientId| | |||
secret: servicePrincipalClientSecret |
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 are a couple of cases where I expected the RP to mark something as sensitive in the Swagger, but they didn't. Besides this target, the other big surprises were resourceInput<'Microsoft.Compute/virtualMachines@2019-12-01'>.properties.osProfile.adminPassword
(annotated as a regular string) and resourceInput<'Microsoft.KeyVault/vaults/secrets@2019-09-01'>.properties.value
(ditto). I didn't check all API versions for those.
Dotnet Test Results 56 files - 61 56 suites - 61 28m 23s ⏱️ - 22m 8s For more details on these failures, see this check. Results for commit 2afb14a. ± Comparison against base commit 180a858. This pull request removes 3787 and adds 595 tests. Note that renamed tests count towards both.
♻️ This comment has been updated with latest results. |
@@ -125,8 +125,11 @@ param additionalMetadata string | |||
@maxLength(24) | |||
@allowed([ | |||
'one' | |||
//@[02:007) [BCP418 (Warning)] The assignment target is expecting sensitive data but has been provided a non-sensitive value. Consider supplying the value as a secure parameter instead to prevent unauthorized disclosure to users who can view the template (via the portal, the CLI, or in source code). (bicep https://aka.ms/bicep/core-diagnostics#BCP418) |'one'| |
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.
I'm not sure about this one. Using @allowed([])
and @secure()
together seems like a niche use case (the value is a secret, but I will hardcode which values are acceptable in the template), and I couldn't figure out if it's better to warn here because the elements in the @allowed()
array aren't protected in any way or drop the warning because the elements in the @allowed()
array aren't protected in any way and users presumably know that.
… (wrt flag composition).
Resolves #16252
Microsoft Reviewers: Open in CodeFlow