Skip to content

Commit 39b6d9f

Browse files
NoaheCampbellajp-iosgalsaleh
authored
Shows which security tools are detected in host support bundle spec (#2890)
* shows which security tools are detected in host preflight * Apply suggestion from @ajp-io * addressed bugbot concerns * Update host-support-bundle.tmpl.yaml * Update cmd/installer/goods/support/host-support-bundle.tmpl.yaml Co-authored-by: Salah Al Saleh <[email protected]> --------- Co-authored-by: Alex Parker <[email protected]> Co-authored-by: Salah Al Saleh <[email protected]>
1 parent c816b7e commit 39b6d9f

File tree

1 file changed

+30
-6
lines changed

1 file changed

+30
-6
lines changed

cmd/installer/goods/support/host-support-bundle.tmpl.yaml

Lines changed: 30 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,28 @@ spec:
394394
- run:
395395
collectorName: "ps-detect-antivirus-and-security-tools"
396396
command: "sh"
397-
args: [-c, "ps -ef | grep -E 'clamav|sophos|esets_daemon|fsav|symantec|mfend|ds_agent|kav|bdagent|s1agent|falcon|illumio|xagt|wdavdaemon|mdatp' | grep -v grep"]
397+
args:
398+
- -c
399+
- |
400+
pat='(clamav|sophos|esets_daemon|fsav|symantec|mfend|ds_agent|kav|bdagent|s1agent|falcon|illumio|xagt|wdavdaemon|mdatp)'
401+
402+
if command -v pgrep >/dev/null 2>&1; then
403+
pgrep -afi "$pat"
404+
else
405+
ps -eo args=
406+
fi \
407+
| awk -v pat="$pat" '
408+
BEGIN { IGNORECASE=1 }
409+
/(awk|grep|pgrep|ps|sh -c)/ { next }
410+
{
411+
line=$0
412+
while (match(line, pat)) {
413+
print tolower(substr(line, RSTART, RLENGTH))
414+
line=substr(line, RSTART+RLENGTH)
415+
}
416+
}
417+
' \
418+
| sort -u
398419
- systemPackages:
399420
collectorName: security-tools-packages
400421
ubuntu:
@@ -726,15 +747,18 @@ spec:
726747
- textAnalyze:
727748
checkName: "Detect Threat Management and Network Security Tools"
728749
fileName: host-collectors/run-host/ps-detect-antivirus-and-security-tools.txt
729-
regex: '\b(clamav|sophos|esets_daemon|fsav|symantec|mfend|ds_agent|kav|bdagent|s1agent|falcon|illumio|xagt|wdavdaemon|mdatp)\b'
750+
regexGroups: '(?ms)(?P<Detected>.*)'
730751
ignoreIfNoFiles: true
731752
outcomes:
732-
- fail:
733-
when: "true"
734-
message: "Antivirus or network security tools detected. These tools are known to interfere with Kubernetes operation in various ways. If problems persist, disable these tools, or consult with your organization's system administrator to ensure that exceptions are made for Kubernetes operation."
735753
- pass:
736-
when: "false"
754+
when: "Detected == ''"
737755
message: "No antivirus or network security tools detected."
756+
- fail:
757+
message: |-
758+
The following antivirus or network security tools were detected:
759+
{{ "{{" }} .Detected {{ "}}" }}
760+
761+
These types of tools have been known to interfere with Kubernetes operation in various ways. If an installation problem persists, 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.
738762
- systemPackages:
739763
checkName: "Detected Security Packages"
740764
collectorName: security-tools-packages

0 commit comments

Comments
 (0)