Skip to content
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

Add policy for auditing Storage Accounts having configured firewall r… #481

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

kimsyversen
Copy link
Contributor

It is often possible to add your ip address to the firewall on storage accounts but it is easy to forget to remove the ip address after the work is done. The result can be 100+ firewall openings over many years. Furthermore, it can be hard to easily audit and follow up and that is what this policy aim to support.

@aschabus
Copy link
Collaborator

@kimsyversen I think that the condition starting in line 45 isn't correct.
It should iterate over the parameter array one by one.
https://learn.microsoft.com/en-us/azure/governance/policy/how-to/author-policies-for-arrays

Can you please fix this?

@kimsyversen
Copy link
Contributor Author

Thanks for the feedback @aschabus. I have updated the policy to use "not": { "anyOf": [...] } to iterate array.

@neiichango
Copy link
Collaborator

@kimsyversen, the AnyOf, references the amount of conditions inside the anyof section, instead of the array values.

when working with array aliases, the recommendation is to use the Count operator. You can reference to the following official documentations:
https://learn.microsoft.com/en-us/azure/governance/policy/how-to/author-policies-for-arrays
https://learn.microsoft.com/en-us/azure/governance/policy/samples/pattern-count-operator
https://learn.microsoft.com/en-us/azure/governance/policy/concepts/definition-structure-policy-rule#count

Can you please redesign the policy so that it follows the recommended structure?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants