Skip to content

Instantly share code, notes, and snippets.

@mstemm
Created November 22, 2016 17:50
Show Gist options
  • Save mstemm/abd3d875fe94314496f220a38e02983f to your computer and use it in GitHub Desktop.
Save mstemm/abd3d875fe94314496f220a38e02983f to your computer and use it in GitHub Desktop.
- macro: bin_dir
condition: fd.directory in (/bin, /sbin, /usr/bin, /usr/sbin)
- macro: open_write
condition: (evt.type=open or evt.type=openat) and evt.is_open_write=true and fd.typechar='f'
- macro: package_mgmt_binaries
items: [dpkg, dpkg-preconfigu, rpm, rpmkey, yum, frontend]
- rule: Write below binary dir
desc: an attempt to write to any file below a set of binary directories
condition: bin_dir and evt.dir = < and open_write and not proc.name in (package_mgmt_binaries)
output: "File below a known binary directory opened for writing (user=%user.name command=%proc.cmdline file=%fd.name)"
priority: WARNING
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment