-
Notifications
You must be signed in to change notification settings - Fork 774
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
linter rule: outputs-should-not-contain-secrets #4716
Conversation
6738541
to
a5ed28c
Compare
c77bce8
to
af627c4
Compare
src/Bicep.Core/Analyzers/Linter/Rules/OutputsShouldNotContainSecretsRule.cs
Outdated
Show resolved
Hide resolved
src/Bicep.Core/Analyzers/Linter/Rules/OutputsShouldNotContainSecretsRule.cs
Show resolved
Hide resolved
src/Bicep.Core/Analyzers/Linter/Rules/OutputsShouldNotContainSecretsRule.cs
Outdated
Show resolved
Hide resolved
This needs discussion - currently we have no mechanism in Bicep to return secure outputs from modules. It feels like we ought to prioritize #2163, otherwise it'll be difficult to practically action any fix for this linter rule without significant restructuring of the deployment and additional verbosity. |
I'm all for prioritizing #2163, but until that is done, I think this is an important linter check. You are right that refactoring this is not a quick change, but it is an important one. |
I had asked Brian:
his answer:
|
108d61b
to
2bcfcf4
Compare
@ucheNkadiCode Added you as reviewer. The new strings are here: https://github.com/Azure/bicep/pull/4716/files#diff-79c99ca30f6a204d8d88d4804da49247990c9ddeb32282ad424763d739ee0ec3. You can also see the proposed documentation above, but there will be a separate review for that. Example errors: |
@ucheNkadiCode Ready for string review |
src/Bicep.Core.IntegrationTests/Scenarios/ResourceListFunctionTests.cs
Outdated
Show resolved
Hide resolved
This looks good! Thanks for changing the "don't" statements to should not |
src/Bicep.Core/Analyzers/Linter/Rules/OutputsShouldNotContainSecretsRule.cs
Outdated
Show resolved
Hide resolved
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.
Parity with TTK: https://docs.microsoft.com/en-us/azure/azure-resource-manager/templates/template-test-cases#outputs-cant-include-secrets
Fixes #3973
Proposed documentation
Outputs should not contain secrets
Code: outputs-should-not-contain-secrets
Description: Don't include any values in an output that could potentially expose secrets. For example, secure parameters of type secureString or secureObject, or list* functions such as listKeys.
The output from a template is stored in the deployment history, so a malicious user could find that information.
The following example fails because it includes a secure parameter in an output value.
The following example fails because it uses a list* member function in an output.
The following example fails because it uses a list* function in an output.
The following example fails because the output name contains 'password', indicating that it may contains a secret