Skip to content

Commit c87e469

Browse files
committed
Update host-preflight.yaml
1 parent 7eda700 commit c87e469

File tree

1 file changed

+59
-0
lines changed

1 file changed

+59
-0
lines changed

pkg-new/preflights/host-preflight.yaml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,41 @@ spec:
220220
if [ ! "$bin_dir_type_label" = "bin_t" ]; then
221221
echo "bin_dir_type_label $bin_dir_type_label"
222222
fi
223+
- run:
224+
collectorName: "ps-detect-antivirus-and-security-tools"
225+
command: "sh"
226+
args:
227+
- -c
228+
- |
229+
pat='(clamav|sophos|esets_daemon|fsav|symantec|mfend|ds_agent|kav|bdagent|s1agent|falcon|illumio|xagt|wdavdaemon|mdatp)'
230+
231+
if command -v pgrep >/dev/null 2>&1; then
232+
pgrep -afi "$pat"
233+
else
234+
ps -eo args=
235+
fi \
236+
| awk -v pat="$pat" '
237+
BEGIN { IGNORECASE=1 }
238+
/(awk|grep|pgrep|ps|sh -c)/ { next }
239+
{
240+
line=$0
241+
while (match(line, pat)) {
242+
print tolower(substr(line, RSTART, RLENGTH))
243+
line=substr(line, RSTART+RLENGTH)
244+
}
245+
}
246+
' \
247+
| sort -u
248+
- systemPackages:
249+
collectorName: security-tools-packages
250+
ubuntu:
251+
- sdcss-kmod
252+
- sdcss
253+
- sdcss-scripts
254+
rhel:
255+
- sdcss-kmod
256+
- sdcss
257+
- sdcss-scripts
223258
analyzers:
224259
- cpu:
225260
checkName: CPU
@@ -1307,3 +1342,27 @@ spec:
13071342
The selinux type context label for the embedded cluster binary directory are incorrect. Try running: sudo semanage fcontext -a -t bin_t "{{ .DataDir }}/bin(/.*)?" && sudo restorecon -RvF {{ .DataDir }}
13081343
- pass:
13091344
when: "false"
1345+
- textAnalyze:
1346+
checkName: "Detect Threat Management and Network Security Tools"
1347+
fileName: host-collectors/run-host/ps-detect-antivirus-and-security-tools.txt
1348+
regexGroups: '(?ms)(?P<Detected>.*)'
1349+
ignoreIfNoFiles: true
1350+
outcomes:
1351+
- pass:
1352+
when: "Detected == ''"
1353+
message: "No antivirus or network security tools detected."
1354+
- warn:
1355+
message: |-
1356+
The following antivirus or network security tools were detected:
1357+
{{ "{{" }} .Detected {{ "}}" }}
1358+
1359+
These types of tools have been known to interfere with Kubernetes operation in various ways. If you experience an installation problem, you may need to disable these tools temporarily as part of the troubleshooting process to identify if any system administrator exceptions may be required to maintain necessary internal Kubernetes operations.
1360+
- systemPackages:
1361+
checkName: "Detected Security Packages"
1362+
collectorName: security-tools-packages
1363+
outcomes:
1364+
- warn:
1365+
when: '{{ "{{" }} .IsInstalled {{ "}}" }}'
1366+
message: Package {{ "{{" }} .Name {{ "}}" }} is installed. This tool can interfere with kubernetes operation. Ensure the tool is either disabled or configured to not interfere with kubernetes operation.
1367+
- pass:
1368+
message: Package {{ "{{" }} .Name {{ "}}" }} is not installed

0 commit comments

Comments
 (0)