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

feat: mount procfs instead of using hostpid (#1688) #1833

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion KubeArmor/monitor/syscalls_arm64.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ const (
SocketConnect = 462
SocketAccept = 463

Capable = 464
Capable = 464
DropAlert = 0
)

Expand Down
16 changes: 15 additions & 1 deletion deployments/get/objects.go
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,11 @@ func GenerateDaemonSet(env, namespace string) *appsv1.DaemonSet {
MountPath: "/media/root/etc/os-release",
ReadOnly: true,
},
{
Name: "procfs-path", //BPF (read-only)
MountPath: "/proc",
ReadOnly: true,
},
Comment on lines +286 to +290
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We will need to mount it in a custom directory, maybe /host/proc and configure KubeArmor to consider the custom procfs path wherever it's using it.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@daemon1024 so i have to check if the env is k8s and if true i have to change "/proc" to "/host/proc" whereever the proc directory is used in the Kuberarmor

}

var volumes = []corev1.Volume{
Expand Down Expand Up @@ -328,6 +333,15 @@ func GenerateDaemonSet(env, namespace string) *appsv1.DaemonSet {
},
},
},
{
Name: "procfs-path",
VolumeSource: corev1.VolumeSource{
HostPath: &corev1.HostPathVolumeSource{
Path: "/proc",
Type: &hostPathDirectory,
},
},
},
}

if env == "gke" {
Expand Down Expand Up @@ -375,7 +389,7 @@ func GenerateDaemonSet(env, namespace string) *appsv1.DaemonSet {
Operator: "Exists",
},
},
HostPID: true,
HostPID: false,
HostNetwork: true,
RestartPolicy: "Always",
DNSPolicy: "ClusterFirstWithHostNet",
Expand Down
Loading