Skip to content
Open
Changes from 3 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
58 changes: 58 additions & 0 deletions pkg-new/preflights/host-preflight.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,40 @@ spec:
if [ ! "$bin_dir_type_label" = "bin_t" ]; then
echo "bin_dir_type_label $bin_dir_type_label"
fi
- run:
collectorName: "ps-detect-antivirus-and-security-tools"
command: "sh"
args:
- -c
- |
pat='(clamav|sophos|esets_daemon|fsav|symantec|mfend|ds_agent|kav|bdagent|s1agent|falcon|illumio|xagt|wdavdaemon|mdatp)'
if command -v pgrep >/dev/null 2>&1; then
pgrep -fli "$pat" | awk '{ $1=""; sub(/^ /,""); print }'
else
# Fallback: list only command names (not full args)
ps -eo comm=
fi \
| awk -v pat="$pat" '
BEGIN { IGNORECASE=1 }
{
line=$0
while (match(line, pat)) {
print tolower(substr(line, RSTART, RLENGTH))
line=substr(line, RSTART+RLENGTH)
}
}
' \
| sort -u
- systemPackages:
collectorName: security-tools-packages
ubuntu:
- sdcss-kmod
- sdcss
- sdcss-scripts
rhel:
- sdcss-kmod
- sdcss
- sdcss-scripts
analyzers:
- cpu:
checkName: CPU
Expand Down Expand Up @@ -1307,3 +1341,27 @@ spec:
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 }}
- pass:
when: "false"
- textAnalyze:
checkName: "Detect Threat Management and Network Security Tools"
fileName: host-collectors/run-host/ps-detect-antivirus-and-security-tools.txt
regexGroups: '(?ms)(?P<Detected>.*)'
ignoreIfNoFiles: true
outcomes:
- pass:
when: "Detected == ''"
message: "No antivirus or network security tools detected."
- warn:
message: |-
The following antivirus or network security tools were detected:
{{ "{{" }} .Detected {{ "}}" }}

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.
Copy link
Member

Choose a reason for hiding this comment

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

@ajp-io should review the copy here.

- systemPackages:
Copy link
Member

Choose a reason for hiding this comment

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

I see the collector attempts to collect multiple system packages, would this analyzer exactly message look correct if the collector finds more than one?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah youre right, it looks like it would render that message for each tool it detects, I'll make a commit that should render it as a single message

checkName: "Detected Security Packages"
collectorName: security-tools-packages
outcomes:
- warn:
when: '{{ "{{" }} .IsInstalled {{ "}}" }}'
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.
Copy link
Member

Choose a reason for hiding this comment

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

@ajp-io should review the copy here.

- pass:
message: Package {{ "{{" }} .Name {{ "}}" }} is not installed
Loading