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_etc_common): Ignore writes by etckeeper under /etc/.git/ #23

Merged

Conversation

petterreinholdtsen
Copy link
Contributor

Every time etckeeper update the git history of the content in /etc/, it update files in /etc/.git/. This trigger a warning from falco about writes in /etc/ for every time the cron job or package update. This change tell the write_etc_common macro to ignore all writes under /etc/.git/ by a process whos great grandparent is etckeeper. The parent is 'git' and the grandparent is 50vcs-commit.

/kind bug
/kind design
/kind feature
/area rules

Signed-off-by: Petter Reinholdtsen pere@hungry.com

Setting WIP to get feedback on the approach, in case there is a better way to do this. I want to create a similar pull request for cups and /etc/cups/printers.conf, and want feedback on the best alternative.

@poiana
Copy link

poiana commented Feb 2, 2023

@petterreinholdtsen: The label(s) kind/bug, kind/design, kind/feature, area/rules cannot be applied, because the repository doesn't have them.

In response to this:

Every time etckeeper update the git history of the content in /etc/, it update files in /etc/.git/. This trigger a warning from falco about writes in /etc/ for every time the cron job or package update. This change tell the write_etc_common macro to ignore all writes under /etc/.git/ by a process whos great grandparent is etckeeper. The parent is 'git' and the grandparent is 50vcs-commit.

/kind bug
/kind design
/kind feature
/area rules

Signed-off-by: Petter Reinholdtsen pere@hungry.com

Setting WIP to get feedback on the approach, in case there is a better way to do this. I want to create a similar pull request for cups and /etc/cups/printers.conf, and want feedback on the best alternative.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@poiana
Copy link

poiana commented Feb 2, 2023

Welcome @petterreinholdtsen! It looks like this is your first PR to falcosecurity/rules 🎉

@leogr
Copy link
Member

leogr commented Mar 19, 2023

/kind design
/kind feature

@poiana poiana added the kind/feature New feature or request label Mar 19, 2023
@poiana
Copy link

poiana commented Mar 19, 2023

@leogr: The label(s) kind/design cannot be applied, because the repository doesn't have them.

In response to this:

/kind design
/kind feature

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@leogr
Copy link
Member

leogr commented Mar 19, 2023

/area rules

@darryk10
Copy link
Contributor

Hi @petterreinholdtsen, thanks for the contribution.
Checking the etckeeper official documetation https://wiki.archlinux.org/title/etckeeper, /etc/.git seems to be the default place for it and binding this with proc.name and proc.panme seems to be the better and safer option to remove such noise.
I'm not sure of adding another macro etckeeper_activities for this mentioned in your PR. The problem that I see is that if we start having a macro for each use case, the overall file would be soon full of macros but this is just my feedabck.

@leogr
Copy link
Member

leogr commented Apr 26, 2023

cc @LucaGuerra

@poiana
Copy link

poiana commented Jul 25, 2023

Issues go stale after 90d of inactivity.

Mark the issue as fresh with /remove-lifecycle stale.

Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Provide feedback via https://github.com/falcosecurity/community.

/lifecycle stale

@poiana
Copy link

poiana commented Aug 24, 2023

Stale issues rot after 30d of inactivity.

Mark the issue as fresh with /remove-lifecycle rotten.

Rotten issues close after an additional 30d of inactivity.

If this issue is safe to close now please do so with /close.

Provide feedback via https://github.com/falcosecurity/community.

/lifecycle rotten

@poiana
Copy link

poiana commented Sep 23, 2023

Rotten issues close after 30d of inactivity.

Reopen the issue with /reopen.

Mark the issue as fresh with /remove-lifecycle rotten.

Provide feedback via https://github.com/falcosecurity/community.
/close

@poiana poiana closed this Sep 23, 2023
@poiana
Copy link

poiana commented Sep 23, 2023

@poiana: Closed this PR.

In response to this:

Rotten issues close after 30d of inactivity.

Reopen the issue with /reopen.

Mark the issue as fresh with /remove-lifecycle rotten.

Provide feedback via https://github.com/falcosecurity/community.
/close

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@petterreinholdtsen
Copy link
Contributor Author

petterreinholdtsen commented Jan 16, 2024 via email

@leogr
Copy link
Member

leogr commented Jan 16, 2024

Hey @petterreinholdtsen

Sorry, we lost track of this. We are currently going to release Falco 0.37 in about 2 weeks, then we should have more cycles to look at this.

Meanwhile, let's reopen this
/remove-lifecycle rotten
/reopen

Also, I recommend you to take a look at the new rules maturity framework since I guess this PR needs to be updated to reflect the new way we ship rules.

I apologize again for this to have been taken so long.

cc @falcosecurity/rules-maintainers

@poiana
Copy link

poiana commented Jan 16, 2024

@leogr: Reopened this PR.

In response to this:

Hey @petterreinholdtsen

Sorry, we lost track of this. We are currently going to release Falco 0.37 in about 2 weeks, then we should have more cycles to look at this.

Meanwhile, let's reopen this
/remove-lifecycle rotten
/reopen

Also, I recommend you to take a look at the new rules maturity framework since I guess this PR needs to be updated to reflect the new way we ship rules.

I apologize again for this to have been taken so long.

cc @falcosecurity/rules-maintainers

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@poiana poiana reopened this Jan 16, 2024
Copy link

Rules files suggestions

falco-sandbox_rules.yaml

Comparing b22355a5a8178c7e66bd70a4de3c7c9d49b4088a with latest tag falco-sandbox-rules-2.0.0

Minor changes:

  • Macro etckeeper has been added
  • Macro etckeeper_activities has been added

Patch changes:

  • Rule Unexpected inbound connection source changed its output fields
  • Rule Read Shell Configuration File changed its output fields
  • Rule Update Package Repository changed its output fields
  • Rule Write below binary dir changed its output fields
  • Rule Write below monitored dir changed its output fields
  • Rule Write below etc changed its output fields
  • Rule Write below root changed its output fields
  • Rule Write below rpm database changed its output fields
  • Rule Modify binary dirs changed its output fields
  • Rule Mkdir binary dirs changed its output fields
  • Rule Launch Sensitive Mount Container changed its output fields
  • Rule Launch Disallowed Container changed its output fields
  • Rule Interpreted procs inbound network activity changed its output fields
  • Rule Interpreted procs outbound network activity changed its output fields
  • Rule Unexpected K8s NodePort Connection changed its output fields
  • Rule Create Hidden Files or Directories changed its output fields
  • Rule Detect outbound connections to common miner pool ports changed its output fields
  • Rule Container Drift Detected (chmod) changed its output fields
  • Rule Container Drift Detected (open+create) changed its output fields
  • Rule Unprivileged Delegation of Page Faults Handling to a Userspace Process changed its output fields
  • Rule Java Process Class File Download changed its output fields
  • Rule Modify Container Entrypoint changed its output fields
  • Rule BPF Program Not Profiled changed its output fields

Copy link

Rules files suggestions

falco-sandbox_rules.yaml

Comparing 7688c49fc4b5c3553a3515d32a291f0d5db57287 with latest tag falco-sandbox-rules-2.0.0

Minor changes:

  • Macro etckeeper has been added
  • Macro etckeeper_activities has been added

Patch changes:

  • Rule Unexpected inbound connection source changed its output fields
  • Rule Read Shell Configuration File changed its output fields
  • Rule Update Package Repository changed its output fields
  • Rule Write below binary dir changed its output fields
  • Rule Write below monitored dir changed its output fields
  • Rule Write below etc changed its output fields
  • Rule Write below root changed its output fields
  • Rule Write below rpm database changed its output fields
  • Rule Modify binary dirs changed its output fields
  • Rule Mkdir binary dirs changed its output fields
  • Rule Launch Sensitive Mount Container changed its output fields
  • Rule Launch Disallowed Container changed its output fields
  • Rule Interpreted procs inbound network activity changed its output fields
  • Rule Interpreted procs outbound network activity changed its output fields
  • Rule Unexpected K8s NodePort Connection changed its output fields
  • Rule Create Hidden Files or Directories changed its output fields
  • Rule Detect outbound connections to common miner pool ports changed its output fields
  • Rule Container Drift Detected (chmod) changed its output fields
  • Rule Container Drift Detected (open+create) changed its output fields
  • Rule Unprivileged Delegation of Page Faults Handling to a Userspace Process changed its output fields
  • Rule Java Process Class File Download changed its output fields
  • Rule Modify Container Entrypoint changed its output fields
  • Rule BPF Program Not Profiled changed its output fields

Every time etckeeper update the git history of the content in /etc/, it update
files in /etc/.git/ (nd /etc/.etckeeper).  This trigger a warning from falco about
writes in /etc/ for every time the cron job or package update.  This change tell
the write_etc_common macro to ignore all writes under /etc/.git/ by a
process whos anchestor is etckeeper and one of the scripts called by etckeeper
to do the /etc/.git updates.

/kind bug
/kind design
/kind feature
/area rules

Signed-off-by: Petter Reinholdtsen <pere@hungry.com>
Copy link

Rules files suggestions

falco-sandbox_rules.yaml

Comparing da372365b7777201d035c6d5ee3ab53298cd32d4 with latest tag falco-sandbox-rules-2.0.0

Minor changes:

  • Macro etckeeper has been added
  • Macro etckeeper_activities has been added

Patch changes:

  • Rule Unexpected inbound connection source changed its output fields
  • Rule Read Shell Configuration File changed its output fields
  • Rule Update Package Repository changed its output fields
  • Rule Write below binary dir changed its output fields
  • Rule Write below monitored dir changed its output fields
  • Rule Write below etc changed its output fields
  • Rule Write below root changed its output fields
  • Rule Write below rpm database changed its output fields
  • Rule Modify binary dirs changed its output fields
  • Rule Mkdir binary dirs changed its output fields
  • Rule Launch Sensitive Mount Container changed its output fields
  • Rule Launch Disallowed Container changed its output fields
  • Rule Interpreted procs inbound network activity changed its output fields
  • Rule Interpreted procs outbound network activity changed its output fields
  • Rule Unexpected K8s NodePort Connection changed its output fields
  • Rule Create Hidden Files or Directories changed its output fields
  • Rule Detect outbound connections to common miner pool ports changed its output fields
  • Rule Container Drift Detected (chmod) changed its output fields
  • Rule Container Drift Detected (open+create) changed its output fields
  • Rule Unprivileged Delegation of Page Faults Handling to a Userspace Process changed its output fields
  • Rule Java Process Class File Download changed its output fields
  • Rule Modify Container Entrypoint changed its output fields
  • Rule BPF Program Not Profiled changed its output fields

@leogr
Copy link
Member

leogr commented Jan 18, 2024

/area maturity-sandbox

@poiana poiana added the area/maturity-sandbox See the Rules Maturity Framework label Jan 18, 2024
@poiana
Copy link

poiana commented Apr 17, 2024

Issues go stale after 90d of inactivity.

Mark the issue as fresh with /remove-lifecycle stale.

Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Provide feedback via https://github.com/falcosecurity/community.

/lifecycle stale

@petterreinholdtsen
Copy link
Contributor Author

petterreinholdtsen commented Apr 17, 2024 via email

@incertum
Copy link
Contributor

@darryk10

@leogr
Copy link
Member

leogr commented Apr 23, 2024

It is unclear to me what you want me to do here. As far as I know, we are waiting for feedback from one of the developers, and it seem contra-productive to close the issue after the developers fail to respond for 90 days. -- Happy hacking Petter Reinholdtsen

Hey @petterreinholdtsen

I apologize again. The WIP status was misleading at least for me (I thought this was unfinished).

re: feedback

When can feedback from @LucaGuerra be expected? As far as I can tell from the default rules for falco still cause events every time etckeeper update /etc/.git/.

I will ping @LucaGuerra, in case he has lost track of this.

Thank you!

@LucaGuerra
Copy link
Contributor

I thought I already approved this. Apologies and thank you for your patience (a lot of it 😅).

@poiana
Copy link

poiana commented Apr 23, 2024

LGTM label has been added.

Git tree hash: 689a72b75b14584366df221197f473213e2c19dd

@poiana
Copy link

poiana commented Apr 23, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: LucaGuerra, petterreinholdtsen

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@LucaGuerra
Copy link
Contributor

As soon as the WIP is removed from the PR title it will be merged automatically.

@petterreinholdtsen petterreinholdtsen changed the title WIP: rule(write_etc_common): Ignore writes by etckeeper under /etc/.git/ rule(write_etc_common): Ignore writes by etckeeper under /etc/.git/ Apr 23, 2024
@poiana poiana merged commit e65f251 into falcosecurity:main Apr 23, 2024
6 checks passed
@petterreinholdtsen
Copy link
Contributor Author

petterreinholdtsen commented Apr 23, 2024 via email

@leogr leogr added this to the falco-0.38-rules milestone Apr 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants