Skip to content
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

Bug fixes pr 2.x #2322

Merged
merged 14 commits into from
Feb 19, 2025
Merged
Show file tree
Hide file tree
Changes from all 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
1 change: 1 addition & 0 deletions roles/debian/rkhunter/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ rkhunter:
allow_ssh_root_user: "{{ sshd.PermitRootLogin | default('prohibit-password') }}"
disable_tests: "suspscan hidden_procs deleted_files packet_cap_apps apps os_specific"
os_package_manager: "NONE" # PKGMGR=NONE is default for Debian, set it to what you need.
portpathwhitelist: []
scriptwhitelist:
- /bin/egrep
- /bin/fgrep
Expand Down
10 changes: 8 additions & 2 deletions roles/debian/rkhunter/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,29 @@
path: "{{ item }}"
register: _rkhunter_existing_scripts_to_whitelist
loop: "{{ rkhunter.scriptwhitelist }}"
when: rkhunter.scriptwhitelist | length > 0

- name: Filter existing scripts
set_fact:
existing_scripts: "{{ existing_scripts | default([]) + [item.item] }}"
when: item.stat.exists
when:
- item.stat.exists
- _rkhunter_existing_scripts_to_whitelist is defined
loop: "{{ _rkhunter_existing_scripts_to_whitelist.results }}"

- name: Check paths for portpath existence
ansible.builtin.stat:
path: "{{ item.split(':')[0] }}"
register: _rkhunter_existing_portpaths_to_whitelist
loop: "{{ rkhunter.portpathwhitelist }}"
when: rkhunter.portpathwhitelist | length > 0

- name: Filter existing portpath
set_fact:
existing_portpaths: "{{ existing_portpaths | default([]) + [item.item] }}"
when: item.stat.exists
when:
- item.stat.exists
- _rkhunter_existing_portpaths_to_whitelist is defined
loop: "{{ _rkhunter_existing_portpaths_to_whitelist.results }}"

- name: Copy rkhunter configuration.
Expand Down
Loading