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

Kubernetes warns about hostPath volume type. #13

Open
ChristianAmmer opened this issue Apr 24, 2024 · 0 comments
Open

Kubernetes warns about hostPath volume type. #13

ChristianAmmer opened this issue Apr 24, 2024 · 0 comments

Comments

@ChristianAmmer
Copy link

ChristianAmmer commented Apr 24, 2024

The deployment files for installing the lacework agent on Kubernetes contain hostPath volume mounts. From the lacework-k8s.yaml file:

        volumeMounts:
          - name: sys
            mountPath: /sys
      volumes:
        - name: sys
          hostPath:
              path: /sys

This leads to the problem that container tools deployed into the lacework container will not work properly because they expect that the cgroup root is at /sys/fs/cgroup/. For example, the container's memory limit should be available via /sys/fs/cgroup/memory/memory.limit_in_bytes (e.g. as documented for Docker in Specify hard limits on memory). But with the sys mount, the container has the node view instead. This means /sys/fs/cgroup/memory/memory.limit_in_bytes is the limit of the node, not the container.

Additionally, the Kubernetes documentation recommends not using hostPath volume types as they introduce a security risk:

Warning:
Using the hostPath volume type presents many security risks. If you can avoid using a hostPath volume, you should. For example, define a local PersistentVolume, and use that instead.

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

No branches or pull requests

1 participant