Admission Control OPA for private GKE cluster

Admission Control OPA for private GKE cluster

773
Created On 02/10/22 18:37 PM - Last Modified 09/29/25 18:42 PM


Symptom


All the deployments were failing after the applying OPA admission control from Prisma Console.

Environment


  • Private GKE cluster, All versions
  • Prisma Cloud Compute SaaS and Self-hosted version above 21.04


Cause


Defender not able to reach the cluster due to missing firewall rule.

Resolution


  1. Check the port number used by defender in the cluster using this command 
    kubectl describe svc defender -n twistlock

    image.png
  2. Go to GKE account,
    VPC Network >> Firewall
  3. Find the correct entry, which has your cluster name 
    <<Cluster-name-master>

    image.png
  4. After selecting the correct entry from Firewall list, click on that entry and click editimage.png
  5. After clicking on edit, scroll down to ports and protocol section and add the correct port in tcp column Take the port number from step 1 (for e.g. 9998)image.png
  6. Please save the settings.
  7. After saving the settings, deploy the OPA admission control (validating webhook) in the private GKE cluster.
  8. Deploy a privileged pod using this config for testing 
    apiVersion: v1
    kind: Pod
    metadata:
      name: nginx
      labels:
        app: nginx
    spec:
      containers:
      - name: nginx
        image: nginx
        ports:
        - containerPort: 80
        securityContext:
          privileged: true
  9. Please log into Prisma console and check
    Compute>>Events>>Admission Audit

    You should receive an Admission Audit for the specific private cluster  image.png


Additional Information


Please refer this document for Open Policy Agent - 
https://docs.paloaltonetworks.com/prisma/prisma-cloud/prisma-cloud-admin-compute/access_control/open_policy_agent.html


Actions
  • Print
  • Copy Link

    https://knowledgebase.paloaltonetworks.com/KCSArticleDetail?id=kA14u0000004NBVCA2&lang=en_US&refURL=http%3A%2F%2Fknowledgebase.paloaltonetworks.com%2FKCSArticleDetail

Choose Language