Skip to content

Commit

Permalink
Merge pull request #197 from nam-jaehyun/master
Browse files Browse the repository at this point in the history
minor updates
  • Loading branch information
nam-jaehyun authored Jul 9, 2021
2 parents f4fba7c + 5c7ec4c commit 12fca1f
Show file tree
Hide file tree
Showing 11 changed files with 24 additions and 9 deletions.
5 changes: 5 additions & 0 deletions KubeArmor/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ run-per-pod: $(CURDIR)/kubearmor
cd $(CURDIR); sudo rm -f /tmp/kubearmor.log
cd $(CURDIR); sudo -E ./kubearmor -logPath=/tmp/kubearmor.log -enableEnforcerPerPod

.PHONY: run-with-host
run-per-pod: $(CURDIR)/kubearmor
cd $(CURDIR); sudo rm -f /tmp/kubearmor.log
cd $(CURDIR); sudo -E ./kubearmor -logPath=/tmp/kubearmor.log -enableHostPolicy

.PHONY: test
test:
cd $(CURDIR)/feeder; go mod tidy
Expand Down
1 change: 1 addition & 0 deletions KubeArmor/enforcer/appArmorEnforcer.go
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,7 @@ func (ae *AppArmorEnforcer) CreateAppArmorHostProfile() error {
"\n" +
" /usr/bin/runc Ux,\n" + // docker
" /usr/sbin/runc Ux,\n" + // containerd
" /snap/microk8s/2262/bin/runc Ux,\n" + // microk8s
" /snap/microk8s/2264/bin/runc Ux,\n" + // microk8s
"\n" +
" ## == POLICY START == ##\n" +
Expand Down
1 change: 1 addition & 0 deletions KubeArmor/enforcer/appArmorHostProfile.go
Original file line number Diff line number Diff line change
Expand Up @@ -1839,6 +1839,7 @@ func GenerateHostProfileHead() string {
"\n" +
" /usr/bin/runc Ux,\n" + // docker
" /usr/sbin/runc Ux,\n" + // containerd
" /snap/microk8s/2262/bin/runc Ux,\n" + // microk8s
" /snap/microk8s/2264/bin/runc Ux,\n" + // microk8s
"\n" +
" ## == POLICY START == ##\n"
Expand Down
6 changes: 6 additions & 0 deletions contribution/self-managed-k8s/k8s/activate_br_netfilter.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash

# activate br_netfilter
sudo modprobe br_netfilter
sudo bash -c "echo '1' > /proc/sys/net/bridge/bridge-nf-call-iptables"
sudo bash -c "echo 'net.bridge.bridge-nf-call-iptables=1' >> /etc/sysctl.conf"
4 changes: 0 additions & 4 deletions contribution/self-managed-k8s/k8s/initialize_kubernetes.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,6 @@ fi
# turn off swap
sudo swapoff -a

# enable ip forwarding
sudo bash -c "echo '1' > /proc/sys/net/ipv4/ip_forward"
sudo bash -c "echo 'net.ipv4.ip_forward=1' >> /etc/sysctl.conf"

# activate br_netfilter
sudo modprobe br_netfilter
sudo bash -c "echo '1' > /proc/sys/net/bridge/bridge-nf-call-iptables"
Expand Down
6 changes: 6 additions & 0 deletions contribution/self-managed-k8s/k8s/install_kubernetes.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,9 @@ sudo apt-get install -y apparmor apparmor-utils auditd

# enable auditd
sudo systemctl enable auditd && sudo systemctl start auditd

# enable ip forwarding
if [ $(cat /proc/sys/net/ipv4/ip_forward) == 0 ]; then
sudo bash -c "echo '1' > /proc/sys/net/ipv4/ip_forward"
sudo bash -c "echo 'net.ipv4.ip_forward=1' >> /etc/sysctl.conf"
fi
2 changes: 1 addition & 1 deletion deployments/GKE/kubearmor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ spec:
imagePullPolicy: Always
securityContext:
privileged: true
args: ["-gRPC=32767", "-logPath=/tmp/kubearmor.log", "-enableEnforcerPerPod", "-enableHostPolicy"]
args: ["-gRPC=32767", "-logPath=/tmp/kubearmor.log", "-enableEnforcerPerPod"]
ports:
- containerPort: 32767
volumeMounts:
Expand Down
2 changes: 1 addition & 1 deletion deployments/docker/kubearmor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ spec:
imagePullPolicy: Always
securityContext:
privileged: true
args: ["-gRPC=32767", "-logPath=/tmp/kubearmor.log", "-enableHostPolicy"]
args: ["-gRPC=32767", "-logPath=/tmp/kubearmor.log"]
ports:
- containerPort: 32767
volumeMounts:
Expand Down
2 changes: 1 addition & 1 deletion deployments/generic/kubearmor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ spec:
imagePullPolicy: Always
securityContext:
privileged: true
args: ["-gRPC=32767", "-logPath=/tmp/kubearmor.log", "-enableHostPolicy"]
args: ["-gRPC=32767", "-logPath=/tmp/kubearmor.log"]
ports:
- containerPort: 32767
volumeMounts:
Expand Down
2 changes: 1 addition & 1 deletion deployments/microk8s/kubearmor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ spec:
imagePullPolicy: Always
securityContext:
privileged: true
args: ["-gRPC=32767", "-logPath=/tmp/kubearmor.log", "-enableHostPolicy"]
args: ["-gRPC=32767", "-logPath=/tmp/kubearmor.log"]
ports:
- containerPort: 32767
volumeMounts:
Expand Down
2 changes: 1 addition & 1 deletion helm/templates/kubearmor-daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ spec:
imagePullPolicy: Always
securityContext:
privileged: true
args: ["-gRPC=32767", "-logPath=/tmp/kubearmor.log", "-enableHostPolicy"]
args: ["-gRPC=32767", "-logPath=/tmp/kubearmor.log"]
env:
- name: CLUSTER_NAME
value: {{ .Values.general.clusterName | quote }}
Expand Down

0 comments on commit 12fca1f

Please # to comment.