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

correct rule conditions to support syscall variants #1250

Merged
merged 3 commits into from
Jun 10, 2020

Commits on Jun 4, 2020

  1. rule(macro bin_dir_mkdir): correct condition to catch mkdirat case

    Since the dir's path is found:
    -  in `evt.arg[1]` for `mkdir`
    -  but in `evt.arg[2]` for `mkdirat`
    switch to `evt.arg.path` to catch both.
    That ensures `Mkdir binary dirs` works properly.
    
    Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
    leogr committed Jun 4, 2020
    Configuration menu
    Copy the full SHA
    a300892 View commit details
    Browse the repository at this point in the history
  2. rule(macro bin_dir_rename): correct condition to catch all variants

    Since `evt.arg[1]` does not work for all syscalls, switch to:
     - `evt.arg.path` for `rmdir` and `unlink` (used by `remove` macro)
     - `evt.arg.name` for `unlinkat` (used by `remove` macro)
     - `evt.arg.oldpath/newpath` for `rename` and `renameat` (used by `rename` macro)
    
    That ensures `Modify binary dirs` works properly.
    
    Note that we cannot yet use `renameat2` (not supported by sinsp, see draios/sysdig#1603 )
    
    Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
    leogr committed Jun 4, 2020
    Configuration menu
    Copy the full SHA
    564b9d1 View commit details
    Browse the repository at this point in the history
  3. rule(Create files below dev): correct condition to catch openat

    Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
    leogr committed Jun 4, 2020
    Configuration menu
    Copy the full SHA
    156521c View commit details
    Browse the repository at this point in the history