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

Validate objects with Azure policy conditions #181

Open
BernieWhite opened this issue Nov 30, 2019 · 4 comments
Open

Validate objects with Azure policy conditions #181

BernieWhite opened this issue Nov 30, 2019 · 4 comments
Assignees
Labels
enhancement New feature or request feature: policy-as-rules Issues that related to exporting policy as rules. lifecycle: experimental long-term Long term milestones that will be released over multiple releases.

Comments

@BernieWhite
Copy link
Collaborator

BernieWhite commented Nov 30, 2019

PSRule can validate objects with custom PowerShell, YAML or JSON rules.

PSRule for Azure should be able to validate resources based on Azure Policies.

Migrated from microsoft/PSRule#43

@ArmaanMcleod
Copy link
Contributor

@BernieWhite I can probably help with this one. Should be able to use the JSON format from PSRule to make this easier to do.

@BernieWhite
Copy link
Collaborator Author

@ArmaanMcleod I've had quite a bit of time to think about this one. I think for the most part we should provide a way to export Azure Policy assignments and linked definitions into JSON based rules. I say assignments because there may be parameters like many of the built-in policies support. Customers would set these to different values based on their environment.

Maybe use the built-in "Allowed locations" policy as a sample case.

@ArmaanMcleod
Copy link
Contributor

ArmaanMcleod commented Dec 16, 2021

@BernieWhite Would we export Azure Policies with a cmdlet like Export-AzRulePolicyAssignmentData? I'd assume this could handle builtin and custom policies, and flags to filter by management groups/subscriptions(resource group as well for assignments). Also would make sense to export the full linked defintions along with the assignments to JSON based rules, and support pre and post validation.

Let me know what you think. Might need to figure out how we want to design this cmdlet.

@BernieWhite
Copy link
Collaborator Author

@ArmaanMcleod Yes. I was thinking:

  • Default to the current subscription scope or provide the specific scope that you want to export.
  • Export policy assignments and referenced policy definitions. I don't think we care or want to collect any additional policy definitions that are not assigned.
  • Visit the policy assignment bundle, and emit JSON rules.

@ArmaanMcleod ArmaanMcleod self-assigned this Dec 16, 2021
@BernieWhite BernieWhite mentioned this issue Jul 6, 2022
4 tasks
@BernieWhite BernieWhite added ms-hack-2022 Issues related to Microsoft Global Hackathon 2022 and removed ms-hack-2022 Issues related to Microsoft Global Hackathon 2022 labels Sep 16, 2022
@BernieWhite BernieWhite self-assigned this Sep 16, 2022
@BernieWhite BernieWhite added the feature: policy-as-rules Issues that related to exporting policy as rules. label Sep 29, 2022
@BernieWhite BernieWhite added the long-term Long term milestones that will be released over multiple releases. label Mar 3, 2024
@BernieWhite BernieWhite mentioned this issue Mar 4, 2024
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request feature: policy-as-rules Issues that related to exporting policy as rules. lifecycle: experimental long-term Long term milestones that will be released over multiple releases.
Projects
None yet
Development

No branches or pull requests

2 participants