Skip to content

Commit

Permalink
Analyser to check if SELinux is exabled
Browse files Browse the repository at this point in the history
  • Loading branch information
banjoh committed Sep 29, 2023
1 parent 361a530 commit d568bb5
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions host/default.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,9 @@ spec:
collectorName: "sysctl"
command: "sysctl"
args: ["-a"]
- copy:
collectorName: selinux-config
path: /etc/selinux/config
# Systemctl service statuses for CRI, Kubelet, and Firewall
- run:
collectorName: "systemctl-firewalld-status"
Expand Down Expand Up @@ -739,3 +742,15 @@ spec:
- pass:
when: "true"
message: "'localhost' resolves to 127.0.0.1 ip address"
- textAnalyze:
checkName: Check if SELinux is enabled
fileName: host-collectors/selinux-config/config
regex: 'SELINUX=enforcing'
ignoreIfNoFiles: true
outcomes:
- fail:
when: "true"
message: "SELinux is enabled when it should be disabled for kubernetes to work properly"
- pass:
when: "false"
message: "SELinux is disabled as expected"

0 comments on commit d568bb5

Please sign in to comment.