Problem deploying Defender for Containers to Arc-enabled OpenShift Kubernetes cluster

Andrew Mackintosh 0 Reputation points
2025-04-09T01:08:54.0733333+00:00

After onboarding our on-prem OpenShift cluster to Azure Arc, I am having problems with deploying the Defender for Containers extension into the cluster.

I have successfully onboarded our non-production environment, but when attempting to recreate the deployment for the production cluster, I have the publisher pods stuck in a CrashLoopBackoffState.

The logs from the pods indicate the following error:

time="2025-04-09T01:08:38Z" level=info msg="Successfully registered a new certificate" componentName=Publisher
time="2025-04-09T01:08:38Z" level=warning msg="Failed to write certificate to file, error: open /var/microsoft/microsoft-defender-for-cloud/oms.crt: permission denied" componentName=Publisher
panic: Error encountered during client initialization open /var/microsoft/microsoft-defender-for-cloud/oms.crt: permission denied

I have checked on the host (where the volume mount is) and the directory /var/microsoft/microsoft-defender-for-cloud is owned by root and has no contents. The pod is deployed as a privileged container, so should be able to write as root to this path.

Does anybody have any suggestions as to the cause of the issue?

Azure Arc
Azure Arc
A Microsoft cloud service that enables deployment of Azure services across hybrid and multicloud environments.
504 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Alex Burlachenko 4,550 Reputation points
    2025-04-10T11:57:46.2733333+00:00

    Hi Andrew,

    Thank you for reaching out and sharing your question on the Q&A portal. I appreciate the detailed explanation of the issue you're facing with deploying Defender for Containers on your Arc-enabled OpenShift cluster.

    From the error message you provided, it seems the Publisher pod is unable to write the certificate file due to a permission issue, even though the pod is running in privileged mode. This could be related to the directory permissions or a security context constraint (SCC) in OpenShift that might be restricting the pod’s access despite its privileged status.

    Here are a few of my things you could check:

    • Ensure the directory /var/microsoft/microsoft-defender-for-cloud exists on the host and has the correct permissions (e.g., chmod 777 temporarily for testing).

    Verify if OpenShift’s SCC (Security Context Constraints) for the pod’s service account allows the necessary permissions. You might need to adjust the SCC or assign a more permissive one.

    Check if there are any admission controllers or policies in your production cluster that might be enforcing stricter rules compared to your non-production environment.

    For further guidance, you might find these Microsoft articles helpful:

    Deploy Defender for Containers on Kubernetes clusters

    Troubleshooting Azure Arc-enabled Kubernetes

    Let me know if you need further assistance or if you’ve already tried these steps. I’d be happy to help you dig deeper into the issue.

    Best regards,
    Alex

    P.S. If my answer helps you, please Accept my answer.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.