Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Kyverno policy engine addon : Approach #2 #455

Draft
wants to merge 35 commits into
base: main
Choose a base branch
from

Conversation

scrungus
Copy link
Collaborator

No description provided.

@scrungus scrungus requested a review from mkjpryor as a code owner November 20, 2024 19:19
@scrungus scrungus marked this pull request as draft November 20, 2024 19:19
@scrungus
Copy link
Collaborator Author

{{- if .Values.kyvernoPolicies.enabled }}
---
apiVersion: addons.stackhpc.com/v1alpha1
kind: Manifests
metadata:
  name: {{ include "cluster-addons.componentName" (list . "kyverno") }}-pod-security-rules
  labels: {{ include "cluster-addons.componentLabels" (list . "kyverno") | nindent 4 }}
  annotations:
    # Tell Argo to ignore the non-controller owner references for this object
    argocd.argoproj.io/sync-options: "ControllerReferencesOnly=true"
spec:
  clusterName: {{ include "cluster-addons.clusterName" . }}
  bootstrap: true
  targetNamespace: {{ .Values.kyverno.release.namespace }}
  releaseName: kyverno
  manifestSources:
    # Apply Restricted Pod Security Standard
    # NOTE(tylerchristie): Any new system namespaces will need to be added to the 
    # exclude filter of the ruleset.
    - template: |
        apiVersion: kyverno.io/v1
        kind: ClusterPolicy
        metadata:
          name: podsecurity-subrule-restricted
          annotations:
            policies.kyverno.io/title: Restricted Pod Security Standards
            policies.kyverno.io/category: Pod Security, EKS Best Practices
            policies.kyverno.io/severity: medium
            kyverno.io/kyverno-version: {{ .Values.kyverno.chart.version }}
            policies.kyverno.io/minversion: 1.8.0
            kyverno.io/kubernetes-version: "{{ .Values.kubernetesVersion }}"
            policies.kyverno.io/subject: Pod
            policies.kyverno.io/description: >-
              The restricted profile of the Pod Security Standards, which is inclusive of
              the baseline profile, is a collection of all the most common configurations
              that can be taken to secure Pods. Beginning with Kyverno 1.8, an entire profile
              may be assigned to the cluster through a single rule. This policy configures the
              restricted profile through the latest version of the Pod Security Standards cluster wide.      
        spec:
          background: true
          validationFailureAction: Audit
          rules:
          - name: restricted
            match:
              any:
              - resources:
                  kinds:
                  - Pod
            validate:
              podSecurity:
                level: restricted
                version: latest
{{- end }}

pod security rules. when these are applied, the cluster doesn't come up. after investigating with devstack it seems like the kyverno pods will come up, and then immediately get uninstalled by helm. needs further investigation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant