Forked from mateobur/Docker_scan_ValidatingWebhookConfiguration.yaml
Created
March 15, 2020 05:50
-
-
Save acumenix/8e64bdd655317c6489eb34eb24f6de0c to your computer and use it in GitHub Desktop.
Docker Scan Anchore ValidatingWebhookConfiguration
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Anchore engine policy validator is now installed. | |
Create a validating webhook resources to start enforcement: | |
KUBE_CA=$(kubectl config view --minify=true --flatten -o json | jq '.clusters[0].cluster."certificate-authority-data"' -r) | |
cat > validating-webook.yaml <<EOF | |
apiVersion: admissionregistration.k8s.io/v1beta1 | |
kind: ValidatingWebhookConfiguration | |
metadata: | |
name: analysis-anchore-policy-validator.admission.anchore.io | |
webhooks: | |
- name: analysis-anchore-policy-validator.admission.anchore.io | |
clientConfig: | |
service: | |
namespace: default | |
name: kubernetes | |
path: /apis/admission.anchore.io/v1beta1/imagechecks | |
caBundle: $KUBE_CA | |
rules: | |
- operations: | |
- CREATE | |
apiGroups: | |
- "" | |
apiVersions: | |
- "*" | |
resources: | |
- pods | |
failurePolicy: Fail | |
EOF | |
kubectl apply -f validating-webook.yaml |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment