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

Ability to Test Azure Policy Definitions #297

Closed
lhasadreams opened this issue Sep 15, 2020 · 0 comments · Fixed by #301
Closed

Ability to Test Azure Policy Definitions #297

lhasadreams opened this issue Sep 15, 2020 · 0 comments · Fixed by #301
Assignees

Comments

@lhasadreams
Copy link

Detailed Description

Azure allows you to show the Policy Definitions on a subscription
Policy Definitions
I would like to be able to interrogate these from InSpec

Context

To check that the Policy Definitions for both built in and custom ones are set up correctly.
This allows InSpec to check that the Policy Definitions are not drifting and report them for remediation if they do.
I would like to check if the Policy is set to deny for example.
I have two customers that would like to make use of this resource (one potential and another in flight).

Possible Implementation

inspec>` describe azure_built_in_policy_definition(name: 'rg-owner-tag', built_in: false) do
inspec>   it {should exist}  
inspec> end  
add: true
Profile: inspec-shell
Version: (not specified)
  Azure Built In Policy Definition - api_version: 2019-09-01 latest: /subscriptions/1e0b427a-d58b-494e-ae4f-ee558463ebbf/providers/Microsoft.Authorization/policyDefinitions/rg-owner-tag
     ✔  is expected to exist
Test Summary: 1 successful, 0 failures, 0 skipped
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 a pull request may close this issue.

2 participants