falco icon indicating copy to clipboard operation
falco copied to clipboard

cleanup(docker): avoid linking /lib/modules to /host/lib/modules at docker image creation time

Open FedeDP opened this issue 2 years ago • 1 comments

What type of PR is this?

/kind cleanup

Any specific area of the project related to this PR?

What this PR does / why we need it:

Avoid linking /lib/modules to /host/lib/modules at docker image creation time. Instead, do it in docker-entrypoint scripts, so that even users using different HOST_ROOT than "/host", will still have a working image.

Moreover, if HOST_ROOT is set, but "$HOST_ROOT/proc" is not present, soft link "/proc" to "HOST_ROOT/proc", to allow Falco to run. Otherwise, scap_procs would exit with error and kill the istance.

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

cleanup: allow users that use a different HOST_ROOT to still have a working falco-driver-loader driver compilation.

FedeDP avatar Sep 22 '22 15:09 FedeDP

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: FedeDP

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

poiana avatar Sep 22 '22 15:09 poiana

/milestone 0.34.0

jasondellaluce avatar Sep 27 '22 08:09 jasondellaluce

/milestone 0.34.0

FedeDP avatar Sep 27 '22 08:09 FedeDP

/hold until Falco 0.33 is released

jasondellaluce avatar Sep 27 '22 08:09 jasondellaluce

/unhold

FedeDP avatar Oct 25 '22 07:10 FedeDP

/assign

leogr avatar Nov 04 '22 16:11 leogr

/milestone 0.35.0

leogr avatar Jan 10 '23 11:01 leogr

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 avatar Apr 10 '23 13:04 poiana

/remove-lifecycle stale

FedeDP avatar Apr 10 '23 13:04 FedeDP

Since /lib/modules is only required to build the driver, why not put this logic inside falco-driver-loader? (or am I missing something?)

We can probably do this too; but since we already do some other stuff in the entrypoint, i assumed that was the best place actually

Although the /proc symlink makes sense in the case you mentioned, how can we generally ensure it matches the same namespace? (ie. mounting the wrong /proc might be worse than not mounting it at all).

That's a good point actually; i am not sure what we can do (aside from failing badly :D )

FedeDP avatar Apr 27 '23 09:04 FedeDP

Since /lib/modules is only required to build the driver, why not put this logic inside falco-driver-loader? (or am I missing something?)

We can probably do this too; but since we already do some other stuff in the entrypoint, i assumed that was the best place actually

I think there's no best practice here :angel: and I'm not yet sure putting it into falco-driver-loader is the best thing to do. I would like to manage this more consistently. @falcosecurity/falco-maintainers WDYT?

Although the /proc symlink makes sense in the case you mentioned, how can we generally ensure it matches the same namespace? (ie. mounting the wrong /proc might be worse than not mounting it at all).

That's a good point actually; i am not sure what we can do (aside from failing badly :D )

leogr avatar Apr 27 '23 10:04 leogr

I'll move this to 0.36 since we are still looking for a general consensus :D /milestone 0.36.0

FedeDP avatar May 03 '23 11:05 FedeDP

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 avatar Aug 01 '23 13:08 poiana

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 avatar Sep 30 '23 21:09 poiana

/close

FedeDP avatar Sep 30 '23 21:09 FedeDP

@FedeDP: Closed this PR.

In response to this:

/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.

poiana avatar Sep 30 '23 21:09 poiana