Skip to content

Commit

Permalink
chkrootkit: Conditional ignoring of /dev/shm/FTL-(overTime|queries)
Browse files Browse the repository at this point in the history
  • Loading branch information
pyllyukko committed Feb 4, 2024
1 parent deb1ad0 commit 2ec527e
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 11 deletions.
17 changes: 6 additions & 11 deletions tasks/debian_packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -179,23 +179,18 @@
- debian
block:
# See https://github.com/pyllyukko/harden.yml/wiki/chkrootkit
- name: getent passwd
ansible.builtin.getent:
database: passwd
tags: check
- name: Create /etc/chkrootkit/chkrootkit.ignore
tags: configuration
ansible.builtin.copy:
ansible.builtin.template:
dest: "{{ chkrootkit_conf_dir }}/chkrootkit.ignore"
src: chkrootkit.ignore.j2
owner: root
group: root
mode: '0400'
content: |
^/usr/lib/debug/\.build-id$
^/usr/lib/libreoffice/share/\.registry$
^/usr/lib/jvm/\.java-1\.17\.0-openjdk-arm(64|hf)\.jinfo$
^/usr/lib/pypy/lib_pypy/ctypes_config_cache/\.empty$
^/usr/lib/python3/dist-packages/numpy/(core/include/numpy/\.doxyfile|f2py/tests/src/(f2cmap/\.f2py_f2cmap|assumed_shape/\.f2py_f2cmap))$
^/usr/lib/python3/dist-packages/matplotlib/tests/(tinypages/(_static/)?\.gitignore|baseline_images/\.keep)$
^/usr/lib/python3/dist-packages/matplotlib/backends/web_backend/\.(prettier(ignore|rc)|eslintrc\.js)$
^/usr/lib/ruby/gems/3\.1\.0/gems/typeprof-0\.21\.2/vscode/.(gitignore|vscode(ignore)?)$
^/usr/lib/ruby/vendor_ruby/rubygems/(optparse|ssl_certs|tsort)/\.document$
- name: Configure /etc/cron.daily/chkrootkit to use chkrootkit.ignore
tags: configuration
ansible.builtin.replace:
Expand Down
12 changes: 12 additions & 0 deletions templates/chkrootkit.ignore.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
^/usr/lib/debug/\.build-id$
^/usr/lib/libreoffice/share/\.registry$
^/usr/lib/jvm/\.java-1\.17\.0-openjdk-arm(64|hf)\.jinfo$
^/usr/lib/pypy/lib_pypy/ctypes_config_cache/\.empty$
^/usr/lib/python3/dist-packages/numpy/(core/include/numpy/\.doxyfile|f2py/tests/src/(f2cmap/\.f2py_f2cmap|assumed_shape/\.f2py_f2cmap))$
^/usr/lib/python3/dist-packages/matplotlib/tests/(tinypages/(_static/)?\.gitignore|baseline_images/\.keep)$
^/usr/lib/python3/dist-packages/matplotlib/backends/web_backend/\.(prettier(ignore|rc)|eslintrc\.js)$
^/usr/lib/ruby/gems/3\.1\.0/gems/typeprof-0\.21\.2/vscode/.(gitignore|vscode(ignore)?)$
^/usr/lib/ruby/vendor_ruby/rubygems/(optparse|ssl_certs|tsort)/\.document$
{% if getent_passwd.pihole is defined %}
^/dev/shm/FTL-(overTime|queries)$
{% endif %}

0 comments on commit 2ec527e

Please sign in to comment.