Support for disabling policy enforcement for policy sets assignments #120
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview/Summary
Based on guidance from CAF - Adopting policy driven guardrails, we should allow for policy set assignments to have enforcement mode turned on (enabled/default) or off (disabled/DoNotEnforce).
This flexibility will allow departments to adopt policy guardrails with limited change in their environment through Policies until they are ready for automation.
Implementation adds a new
enforcementMode
parameter to each policy set assignment deployment. This parameter's default value isDefault
which translates to enabled. The possible values for this parameter areDefault
(means Enabled) orDoNotEnforce
(means Disabled).This change should be configurable per policy set assignment and affects built-in and custom policy sets.
This PR fixes/adds/changes/removes
Fixes #119
Breaking Changes
None
Testing Evidence
When enforcementMode = Default - Passed
When enfocementMode = DoNotEnforce - Passed
Custom Policy - Tags - the policy has Deny rules and policy set assignment enforcementMode = DoNotEnforce. Expect that the resource groups (RGs) can be created without the required tags. The policy will mark the RG as non-compliant, but will not block the creation of RGs.
RG created without any tags
Policy marks RG as non-compliant
As part of this Pull Request I have
main
branch