PSRule.Rules.Azure icon indicating copy to clipboard operation
PSRule.Rules.Azure copied to clipboard

Issue 1479: Check that usernames are not literals

Open ms-sambell opened this issue 3 years ago • 1 comments
trafficstars

PR Summary

Adding code to verify if the resource type: Microsoft.Resources/deployments contains a property for adminUsername and what it's type is.

Fixes #1479

PR Checklist

  • [ ] PR has a meaningful title
  • [ ] Summarized changes
  • [ ] Change is not breaking
  • [ ] This PR is ready to merge and is not Work in Progress
  • Rule changes
    • [ ] Unit tests created/ updated
    • [ ] Rule documentation created/ updated
    • [ ] Link to a filed issue
    • [ ] Change log has been updated with change under unreleased section
  • Other code changes
    • [ ] Unit tests created/ updated
    • [ ] Link to a filed issue
    • [ ] Change log has been updated with change under unreleased section

ms-sambell avatar Jun 21 '22 11:06 ms-sambell

@BernieWhite @ArmaanMcleod

Hey gents, I got a little stuck when trying to write this. For the previous rules I had some examples to cheat off. I'm not quite sure how to use PsRule specific assertion methods to verify the properties of a value assigned to a property.

Any tips / feedback / examples would be great.

ms-sambell avatar Jun 21 '22 11:06 ms-sambell

@BernieWhite @ArmaanMcleod - hey team, can I please get a review

ms-sambell avatar Aug 23 '22 21:08 ms-sambell