question

UdayKiranReddyureddy-2664 avatar image
0 Votes"
UdayKiranReddyureddy-2664 asked IgorBeliakov-8180 answered

Azure policy is getting enabled automatically, how to remove that setting?

We have disabled the azure policy while creating the aks cluster.
But somehow, it is getting enabled after sometime.

How to check where this is being triggered and disable that setting.

133395-image.png


azure-kubernetes-serviceazure-policy
image.png (43.1 KiB)
· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@UdayKiranReddyureddy-2664 , Thank you for your question.

Can you please View change history in Azure Activity Logs for the AKS cluster? Under the JSON section, you can find the category field whose value should indicate category of the event like "Administrative", "Policy" etc. as illustrated below.
133711-category.png

If there is a policy that enforced the event, you shall find details of the policy under properties.policies in the JSON object, as shown below:
133682-policies.png

You shall also find in the JSON, claims.appid and other information on the entity that triggered the event under claims and caller. Example:
133683-appid.png

This might lead you to what is triggering the addition of the AKS Addon for Azure Policy.


0 Votes 0 ·
category.png (69.4 KiB)
policies.png (76.6 KiB)
appid.png (67.5 KiB)

During cluster creation itself, we got this in the activity log.
And the user it is showing as my user account.

Is this the relevant activity log?
What is the fix we need to apply then?

134345-image.png


0 Votes 0 ·
image.png (138.2 KiB)

1 Answer

IgorBeliakov-8180 avatar image
0 Votes"
IgorBeliakov-8180 answered

Most likely, Azure policy is enabled in Auto provisioning section of Microsoft Defender for Cloud.

Microsoft Defender for Cloud -> Environment Settings -> (pick relevant subscription) -> Auto provisioning -> Microsoft Defender for Containers components (preview) -> Azure Policy for Kubernetes add-on.

174929-image.png



image.png (388.9 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.