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

rule(Write below etc): whitelist automount writing under /etc/mtab #957

Merged
merged 1 commit into from
Dec 5, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions rules/falco_rules.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1153,6 +1153,9 @@
- macro: etcd_manager_updating_dns
condition: (container and proc.name=etcd-manager and fd.name=/etc/hosts)

- macro: automount_using_mtab
condition: (proc.pname = automount and fd.name startswith /etc/mtab)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
condition: (proc.pname = automount and fd.name startswith /etc/mtab)
condition: (proc.pname=automount and fd.name=/etc/mtab)

WDYT?

Copy link
Member

@leodido leodido Dec 5, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After having spent some hours with Nicolas on this we decided to merge PR as is.

He used startswith because he had automount daemon writing to /etc/mtab.[something] file (which to me seems something happening when the /etc/mtab file cannot be written because it's locked, maybe some other process writing to it?).

In the next days he's going to observe again the original event in order to understand whether it is better to use equal or startswith here.


# Add conditions to this macro (probably in a separate file,
# overwriting this macro) to allow for specific combinations of
# programs writing below specific directories below
Expand Down Expand Up @@ -1269,6 +1272,7 @@
and not jboss_in_container_writing_passwd
and not etcd_manager_updating_dns
and not user_known_write_below_etc_activities
and not automount_using_mtab

- rule: Write below etc
desc: an attempt to write to any file below /etc
Expand Down