← Policy catalog
</> ValidatingAdmissionPolicy · Apache-2.0

Provisions Unencrypted Linode Volumes

storageclass-encryption-linode

severityLow resourceStorageClasses productKubernetes bundles1

Volumes provisioned from this class are stored without LUKS encryption, so data sits in plaintext on the Linode block storage backend and is readable from a detached volume, a clone or the underlying host.

Rejects unless

object.provisioner != 'linodebs.csi.linode.com' ||
(has(object.parameters) && 'linodebs.csi.linode.com/luks-encrypted' in object.parameters &&
 object.parameters['linodebs.csi.linode.com/luks-encrypted'] == 'true')

Linode Block Storage StorageClasses must enable LUKS encryption (parameters."linodebs.csi.linode.com/luks-encrypted": "true").

Remediation

Set the linodebs.csi.linode.com/luks-encrypted parameter to true on linodebs.csi.linode.com StorageClasses and add the required node-stage secret parameters. Field: parameters['linodebs.csi.linode.com/luks-encrypted'].

Applies to

  • storageclasses · storage.k8s.io/v1 · CREATE, UPDATE

Manifest

apiVersion: admissionregistration.k8s.io/v1
kind: ValidatingAdmissionPolicy
metadata:
  name: storageclass-encryption-linode
  annotations:
    kubeapt.io/uuid: "525786c8-d1fa-4308-9d81-93dac98e1cc2"
    security.kubeapt.io/displayName: "Provisions Unencrypted Linode Volumes"
    security.kubeapt.io/description: "Volumes provisioned from this class are stored without LUKS encryption, so data sits in plaintext on the Linode block storage backend and is readable from a detached volume, a clone or the underlying host."
    security.kubeapt.io/resource: "StorageClasses"
    security.kubeapt.io/severity: "Low"
    security.kubeapt.io/remediation: "Set the linodebs.csi.linode.com/luks-encrypted parameter to true on linodebs.csi.linode.com StorageClasses and add the required node-stage secret parameters. Field: parameters['linodebs.csi.linode.com/luks-encrypted']."
    security.kubeapt.io/product: "Kubernetes"
spec:
  failurePolicy: Fail
  matchConstraints:
    resourceRules:
    - apiGroups:
      - storage.k8s.io
      apiVersions:
      - v1
      operations:
      - CREATE
      - UPDATE
      resources:
      - storageclasses
  validations:
  - expression: |
      object.provisioner != 'linodebs.csi.linode.com' ||
      (has(object.parameters) && 'linodebs.csi.linode.com/luks-encrypted' in object.parameters &&
       object.parameters['linodebs.csi.linode.com/luks-encrypted'] == 'true')
    message: |
      Linode Block Storage StorageClasses must enable LUKS encryption (parameters."linodebs.csi.linode.com/luks-encrypted": "true").

Save it as storageclass-encryption-linode.yaml — the commands below assume that name.

Validate with kubeapt

Check a workload against this one policy, before anything is installed on a cluster.

$ kubeapt validate -p ./storageclass-encryption-linode.yaml -r ./workload.yaml

Or without the file, from the published policy set — -r takes a directory too:

$ kubeapt policies download && kubeapt validate --policy-name storageclass-encryption-linode -r ./manifests

Or against every namespace in the cluster your kubeconfig points at:

$ kubeapt validate --policy-name storageclass-encryption-linode -A