Skip to content

Commit

Permalink
rule (Write below monitored dir): Clean up and use glob matching.
Browse files Browse the repository at this point in the history
Signed-off-by: Shane Lawrence <[email protected]>
  • Loading branch information
shane-lawrence authored and poiana committed Mar 12, 2021
1 parent 34bbe29 commit 2f0e09b
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions rules/falco_rules.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -806,15 +806,10 @@
# the following rule and lists.

- list: monitored_directories
items: [/boot, /lib, /lib64, /usr/lib, /usr/local/lib, /usr/local/sbin, /usr/local/bin, /root/.ssh, /etc/cardserver]
items: [/boot, /lib, /lib64, /usr/lib, /usr/local/lib, /usr/local/sbin, /usr/local/bin, /root/.ssh]

# Until https://github.com/draios/sysdig/pull/1153, which fixes
# https://github.com/draios/sysdig/issues/1152, is widely available,
# we can't use glob operators to match pathnames. Until then, we do a
# looser check to match ssh directories.
# When fixed, we will use "fd.name glob '/home/*/.ssh/*'"
- macro: user_ssh_directory
condition: (fd.name startswith '/home' and fd.name contains '.ssh')
condition: (fd.name glob '/home/*/.ssh/*')

- macro: mkinitramfs_writing_boot
condition: (proc.pname in (mkinitramfs, update-initramf) and fd.directory=/boot)
Expand Down

0 comments on commit 2f0e09b

Please sign in to comment.