Azure / PSRule.Rules.Azure

Rules to validate Azure resources and infrastructure as code (IaC) using PSRule.
https://azure.github.io/PSRule.Rules.Azure/
MIT License
389 stars 84 forks source link

Added Azure.VM.PublicIPAttached #3012

Closed BenjaminEngeset closed 1 month ago

BenjaminEngeset commented 1 month ago

PR Summary

Fixes #11

PR Checklist

BenjaminEngeset commented 1 month ago

Hi, @BernieWhite. Ready for review.

I created it in the Azure.VM.* division, because I felt it made more sense, as it will be more understandable for customers I think.

Plan is also to create one for virtual machine scale sets, under Azure.VMSS.*.

Should we add a configuration option for this one? I'm wondering, because as we don't have a good way of identifying if the NIC is used by a virtual machine. The rule will emit false negatives for not customer-managed virtual machines.

Let me know what you think about "everything".

BernieWhite commented 1 month ago

Hi, @BernieWhite. Ready for review.

I created it in the Azure.VM.* division, because I felt it made more sense, as it will be more understandable for customers I think.

Plan is also to create one for virtual machine scale sets, under Azure.VMSS.*.

Should we add a configuration option for this one? I'm wondering, because as we don't have a good way of identifying if the NIC is used by a virtual machine. The rule will emit false negatives for not customer-managed virtual machines.

Let me know what you think about "everything".

I think a configuration option is not currently required. NIC is used by private endpoints but that doesn't require a public IP. There isn't any other case that comes to mind where a public IP + NIC would be deployed on purpose.

BenjaminEngeset commented 1 month ago

Thanks for the great feedback, @BernieWhite. It all made sense, and I’ve made the adjustments accordingly.

The VMSS rule will be in a separate PR.