Skip to content

Commit

Permalink
Add host visibility to node
Browse files Browse the repository at this point in the history
  • Loading branch information
navin772 committed May 23, 2024
1 parent 771eb95 commit fa8271a
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/ci-test-ginkgo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: ci-test-ginkgo

on:
push:
branches: [main]
branches: [main, lfx-pretask]
paths:
- "KubeArmor/**"
- "tests/**"
Expand All @@ -11,7 +11,7 @@ on:
- "pkg/KubeArmorOperator/**"
- "deployments/helm/**"
pull_request:
branches: [main]
branches: [main, lfx-pretask]
paths:
- "KubeArmor/**"
- "tests/**"
Expand Down Expand Up @@ -52,6 +52,9 @@ jobs:
- name: Setup a Kubernetes environment
run: ./.github/workflows/install-k3s.sh

- name: Add KubeArmor host visibility
run: ./.github/workflows/host-visibility.sh

- name: Generate KubeArmor artifacts
run: |
GITHUB_SHA=$GITHUB_SHA ./KubeArmor/build/build_kubearmor.sh
Expand Down
13 changes: 13 additions & 0 deletions .github/workflows/host-visibility.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash

# Set the hostname
sudo hostnamectl set-hostname kubearmor-dev

# Edit the daemonset to add the -enableKubeArmorHostPolicy=true flag
kubectl edit daemonset $(kubectl get daemonset -n kubearmor -o name | grep kubearmor-) -n kubearmor <<EOF
/args:/a \
- -enableKubeArmorHostPolicy=true
EOF

# Apply annotations to the node
kubectl annotate node kubearmor-dev "kubearmor-visibility=process,file,network,capabilities"

0 comments on commit fa8271a

Please sign in to comment.