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

securing KubeArmor pods and policies #1186

Open
5 of 16 tasks
nyrahul opened this issue Mar 26, 2023 · 6 comments · May be fixed by #1192
Open
5 of 16 tasks

securing KubeArmor pods and policies #1186

nyrahul opened this issue Mar 26, 2023 · 6 comments · May be fixed by #1192
Assignees
Labels
enhancement New feature or request

Comments

@nyrahul
Copy link
Contributor

nyrahul commented Mar 26, 2023

KubeArmor is a security engine and thus it is imperative that it follows all the security best practices. The aim is to ensure security of the KubeArmor itself. Much of the work towards following best security practices (such as not using privileged flag) is already followed. It is now time to notch up the security practices to next level. The proposition is as follows:

  • Use baseline level in enforce mode Pod Security Admission for KubeArmor namespace
  • Dogfooding
    • Protect AppArmor policies mount point to be accessible only by KubeArmor binary. Enforce a KubeArmor policy to ensure this.
    • Only allow access of service account token for kubearmor binary in the KubeArmor pod.
    • Use hardening policies for KubeArmor pod.
  • Remove use of cluster-admin role
  • Satisfy SLSA 3 requirements SLSA 3 compliance #1164
  • Ability to use signed policy YAMLs only
  • seccomp profile for kubearmor
  • selinux/apparmor ootb profile
  • Fix all critical vulnerabilities across all kubearmor-images.
  • TLS for all intra-kubearmor communication feat(gRPC): Implement m-TLS Support using self-signed certificate #1526
  • Reducing the kubearmor base image (can we try distroless kubearmor image?) [moved to UBI]
  • Remove unnecessary hostPaths from the manifests
  • Remove unnecessary capabilities from the manifests
  • attacker can disable kprobes, thus we won't get any future events
    Predefined hardening policy for checking any changes to /sys/kernel/debug/kprobes/enabled
@nyrahul nyrahul added the enhancement New feature or request label Mar 26, 2023
@Ankurk99
Copy link
Member

@daemon1024
Copy link
Member

  • How would KubeArmor daemonset attach a profile to itself?
    • Failed admission if annotation added and no profile found

Potential Solution

  • Snitch has the intelligence to load the default apparmor profile.

@DelusionalOptimist
Copy link
Member

For protecting KubeArmor with KubeArmor in BPF LSM, we need to:

  • How to differentiate between host process and containers with hostPid.

@daemon1024
Copy link
Member

  • Seccomp Loading
  • Try running all other KA Components with Seccomp RuntimeDefault

@daemon1024
Copy link
Member

  • Remove skipping kubearmor-app logic from KubeArmor.
  • Have snitch generate apparmor profile just for kubearmor daemonset with a privileged default profile
  • annotate kubearmor daemonset if snitch successful
  • verify if matchlabels works as expected with kubearmor pods as well

Edge Case

  • kubearmore-controller should not block daemonset deployment or try to admission control daemonset (it can do it for other kubearmor pods except snitch)
  • if operator does not exist, verify what happens when kubearmor tries to patch it's own daemonset
    • validate if kubearmor loads apparmor profile before patching

@dirsigler
Copy link

Regarding "Use baseline level in enforce mode Pod Security Admission for KubeArmor namespace", how about providing a Namespace manifest within the Helm chart which already provide the specific labels to set the Pod Security Standards on it.

This way users could for example deploy the Chart via Helm and use their own Namespace via --namespace --create-namespace or implement the provided namespace with all the features out of the box.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: No status
Status: In Progress
Development

Successfully merging a pull request may close this issue.

6 participants