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

fix(scripts): make /usr writable #2398

Merged
merged 2 commits into from
Feb 2, 2023
Merged

Conversation

therealbobo
Copy link
Contributor

Signed-off-by: Roberto Scolaro roberto.scolaro21@gmail.com

What type of PR is this?

Uncomment one (or more) /kind <> lines:

/kind bug

/kind cleanup

/kind design

/kind documentation

/kind failing-test

/kind feature

/kind release

Any specific area of the project related to this PR?

Uncomment one (or more) /area <> lines:

/area build

/area engine

/area tests

/area proposals

/area CI

What this PR does / why we need it:

ProtectSystem directive makes /usr directory read-only. By the way falcoctl needs write permission.

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

NONE

@@ -13,7 +13,6 @@ RestartSec=15s
Restart=on-failure
PrivateTmp=true
NoNewPrivileges=yes
ProtectSystem=true
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we try ReadWritePaths instead?

Copy link
Contributor

Choose a reason for hiding this comment

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

It looks like ReadWritePaths was introduced in systemd 231: https://github.com/systemd/systemd/blob/main/NEWS#L9059

I think we should use ReadWriteDirectories that is kept for backward compatibility:

The old names of these settings remain
available for compatibility.

Copy link
Contributor

Choose a reason for hiding this comment

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

In falco-kmod.service too!

@FedeDP
Copy link
Contributor

FedeDP commented Feb 2, 2023

/milestone 0.34.0

@poiana poiana added this to the 0.34.0 milestone Feb 2, 2023
Signed-off-by: Roberto Scolaro <roberto.scolaro21@gmail.com>
Signed-off-by: Roberto Scolaro <roberto.scolaro21@gmail.com>
@@ -19,7 +19,7 @@ NoNewPrivileges=yes
ProtectHome=read-only
ProtectSystem=full
ProtectKernelTunables=true
ReadWritePaths=/sys/module/falco
ReadWriteDirectories=/sys/module/falco
Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks!
@Andreagit97 we will need a quick test of the falco-kmod service after this change (from packages built by this pr ci)
This should work with super old versions of systemd as well (it was not working before 231).

Copy link
Contributor

@FedeDP FedeDP left a comment

Choose a reason for hiding this comment

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

Tested using CI packages. It works fine!
/approve

@poiana
Copy link
Contributor

poiana commented Feb 2, 2023

LGTM label has been added.

Git tree hash: c9ba6465ca4efea9721fa5012dc3ec7e9004f1c7

@poiana poiana added the approved label Feb 2, 2023
@poiana
Copy link
Contributor

poiana commented Feb 2, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: FedeDP, leogr, therealbobo

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 poiana merged commit 3cba495 into falcosecurity:master Feb 2, 2023
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.

4 participants