mirror of
https://github.com/falcosecurity/falco.git
synced 2025-06-30 08:32:12 +00:00
fix(rules): modification of a file should trigger as if it was opened or created
Signed-off-by: Lorenzo Fontana <lo@linux.com>
This commit is contained in:
parent
f05d18a847
commit
39b51562ed
@ -908,12 +908,15 @@
|
|||||||
- macro: access_repositories
|
- macro: access_repositories
|
||||||
condition: (fd.filename in (repository_files) or fd.directory in (repository_directories))
|
condition: (fd.filename in (repository_files) or fd.directory in (repository_directories))
|
||||||
|
|
||||||
|
- macro: modify_repositories
|
||||||
|
condition: (evt.arg.newpath pmatch (repository_directories))
|
||||||
|
|
||||||
- rule: Update Package Repository
|
- rule: Update Package Repository
|
||||||
desc: Detect package repositories get updated
|
desc: Detect package repositories get updated
|
||||||
condition: >
|
condition: >
|
||||||
open_write and access_repositories and not package_mgmt_procs
|
((open_write and access_repositories) or (modify and modify_repositories)) and not package_mgmt_procs
|
||||||
output: >
|
output: >
|
||||||
Repository files get updated (user=%user.name command=%proc.cmdline file=%fd.name container_id=%container.id image=%container.image.repository)
|
Repository files get updated (user=%user.name command=%proc.cmdline file=%fd.name newpath=%evt.arg.newpath container_id=%container.id image=%container.image.repository)
|
||||||
priority:
|
priority:
|
||||||
NOTICE
|
NOTICE
|
||||||
tags: [filesystem, mitre_persistence]
|
tags: [filesystem, mitre_persistence]
|
||||||
@ -2440,12 +2443,14 @@
|
|||||||
- rule: Create Hidden Files or Directories
|
- rule: Create Hidden Files or Directories
|
||||||
desc: Detect hidden files or directories created
|
desc: Detect hidden files or directories created
|
||||||
condition: >
|
condition: >
|
||||||
((mkdir and consider_hidden_file_creation and evt.arg.path contains "/.") or
|
(consider_hidden_file_creation and (
|
||||||
(open_write and consider_hidden_file_creation and evt.arg.flags contains "O_CREAT" and
|
(modify and evt.arg.newpath contains "/.") or
|
||||||
fd.name contains "/." and not fd.name pmatch (exclude_hidden_directories)))
|
(mkdir and evt.arg.path contains "/.") or
|
||||||
|
(open_write and evt.arg.flags contains "O_CREAT" and fd.name contains "/." and not fd.name pmatch (exclude_hidden_directories)))
|
||||||
|
)
|
||||||
output: >
|
output: >
|
||||||
Hidden file or directory created (user=%user.name command=%proc.cmdline
|
Hidden file or directory created (user=%user.name command=%proc.cmdline
|
||||||
file=%fd.name container_id=%container.id container_name=%container.name image=%container.image.repository:%container.image.tag)
|
file=%fd.name newpath=%evt.arg.newpath container_id=%container.id container_name=%container.name image=%container.image.repository:%container.image.tag)
|
||||||
priority:
|
priority:
|
||||||
NOTICE
|
NOTICE
|
||||||
tag: [file, mitre_persistence]
|
tag: [file, mitre_persistence]
|
||||||
|
Loading…
Reference in New Issue
Block a user