-
Couldn't load subscription status.
- Fork 8
Add complimentary preflight for Security Tools detection #3015
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
NoaheCampbell
wants to merge
7
commits into
main
Choose a base branch
from
preflight-security-tool-detection
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 4 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
c87e469
Update host-preflight.yaml
NoaheCampbell 75cb524
Update host-preflight.yaml
NoaheCampbell fd02758
addressed older bugbot concerns and reverted templating to standard
NoaheCampbell c06a4a2
Security tool detection prints as single message
NoaheCampbell 140c365
removed \n and %b combination for tool detection
NoaheCampbell 02b7722
removed \n characters
NoaheCampbell c81ee1c
Update host-preflight.yaml
NoaheCampbell File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -220,6 +220,58 @@ 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 | ||
| - run: | ||
| collectorName: security-tools-installed | ||
| command: sh | ||
| args: | ||
| - -c | ||
| - | | ||
| pkgs="sdcss-kmod sdcss sdcss-scripts" | ||
| installed="" | ||
| if command -v dpkg >/dev/null 2>&1; then | ||
| for p in $pkgs; do | ||
| dpkg -l "$p" >/dev/null 2>&1 && installed="$installed$p\n" | ||
cursor[bot] marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| done | ||
| elif command -v rpm >/dev/null 2>&1; then | ||
| for p in $pkgs; do | ||
| rpm -q "$p" >/dev/null 2>&1 && installed="$installed$p\n" | ||
| done | ||
| fi | ||
| printf "%b" "$installed" | sed '/^$/d' | ||
| analyzers: | ||
| - cpu: | ||
| checkName: CPU | ||
|
|
@@ -1307,3 +1359,33 @@ 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. | ||
|
||
| - textAnalyze: | ||
| checkName: "Detected Security Packages" | ||
| fileName: host-collectors/run-host/security-tools-installed.txt | ||
| regexGroups: '(?ms)(?P<Installed>.*)' | ||
| ignoreIfNoFiles: true | ||
| outcomes: | ||
| - pass: | ||
| when: "Installed == ''" | ||
| message: "No security packages detected." | ||
| - warn: | ||
| message: |- | ||
| The following security packages were detected: | ||
| {{ "{{" }} .Installed {{ "}}" }} | ||
|
|
||
| These packages can interfere with Kubernetes operation. Ensure they are disabled or configured to not interfere with required Kubernetes traffic and processes. | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.