Skip to content

[Feature] Support enforcementAction: warn in Azure Policy for Kubernetes (OPA Gatekeeper) #5745

@jaberchez

Description

@jaberchez

Summary

Azure Policy for Kubernetes currently does not support the Gatekeeper enforcementAction: warn mode. This creates a gap in policy rollout and developer experience, as there is no way to provide non-blocking, real-time feedback at admission time.


Problem Statement

Azure Policy for Kubernetes exposes limited enforcement behaviors:

  • effect: Deny → maps to enforcementAction: deny
  • effect: Audit → maps to enforcementAction: dryrun

However:

  • There is no equivalent for enforcementAction: warn
  • Developers do not receive admission-time feedback for policy violations unless enforcement is fully set to Deny

Even when manually setting:

spec:
 enforcementAction: warn

Impact

This limitation affects policy adoption and usability:

  • No ability to provide immediate feedback to users during kubectl apply
  • Violations are only visible through:
    • Constraint status
    • Azure Policy compliance dashboards
  • No intermediate stage between:
    • Silent audit (dryrun)
    • Hard enforcement (deny)
  • Increased risk when transitioning policies to enforcement due to lack of user awareness

Business Justification

  • Aligns Azure Policy capabilities with native Gatekeeper features
  • Improves developer experience with real-time feedback
  • Enables safer and more controlled policy adoption
  • Reduces operational risk when transitioning to enforcement

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions