Skip to content

Commit

Permalink
fix(rules): make chmod rules enabled by default
Browse files Browse the repository at this point in the history
Signed-off-by: Lorenzo Fontana <lo@linux.com>
  • Loading branch information
fntlnz committed Aug 16, 2019
1 parent 3ea98b0 commit e229cec
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions rules/falco_rules.yaml
Expand Up @@ -73,7 +73,7 @@
condition: evt.type in (symlink, symlinkat) and evt.dir=<

- macro: chmod
condition: evt.type in (chmod, fchmod, fchmodat)
condition: (evt.type in (chmod, fchmod, fchmodat) and evt.dir=<)

# File categories
- macro: bin_dir
Expand Down Expand Up @@ -2412,14 +2412,17 @@
tag: [process, mitre_defense_evation]

- macro: consider_all_chmods
condition: (never_true)
condition: (always_true)

- list: user_known_chmod_applications
items: []

- rule: Set Setuid or Setgid bit
desc: >
When the setuid or setgid bits are set for an application,
this means that the application will run with the privileges of the owning user or group respectively.
Detect setuid or setgid bits set via chmod
condition: consider_all_chmods and chmod and (evt.arg.mode contains "S_ISUID" or evt.arg.mode contains "S_ISGID")
condition: consider_all_chmods and chmod and (evt.arg.mode contains "S_ISUID" or evt.arg.mode contains "S_ISGID") and not proc.cmdline in (user_known_chmod_applications)
output: >
Setuid or setgid bit is set via chmod (fd=%evt.arg.fd filename=%evt.arg.filename mode=%evt.arg.mode user=%user.name
command=%proc.cmdline container_id=%container.id container_name=%container.name image=%container.image.repository:%container.image.tag)
Expand Down

0 comments on commit e229cec

Please sign in to comment.