-
Notifications
You must be signed in to change notification settings - Fork 38.8k
Fix systemd service file configuration directory setup #16556
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
Conversation
|
Looks similar to #15995 |
|
Added suggested improvements and fixes from #15995 |
|
tACK Since this has cropped up again IMHO either something like the fix in this PR should be merged or if not maybe we should at least add an extra step to the documentation informing users they MUST always explicitly set the ownership on the The
The problem is this sentence Which results in:
The fix is:
|
|
@sipsorcery 6c8b98b is potentially dangerous; see #15995 (comment) (quoted below for ease of reading).
I have since changed the PR to, rather than make the conf dir/file world-readable, make systemd set the group of the confdir to
As well as included the hardening from your PR (ProtectHome). |
ryanofsky
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
utACK 74f741d49c3763d082fc15fda7f342515faf4210. Looks good to me, but please rebase and drop the first commit (6c8b98b5bf8c3e6c797544b2c7f0a0fc5f5afda6). It's confusing to keep that commit when the change it makes is just reverted later by the third commit (eeb046abb8187da85e6e6f6570c06e9620595d5a).
The phrasing seemed to indicate that the options specified in ExecStart= could not be specified in the config file, necessitating their inclusion in the service file. However, the options in the config file simply get overridden by any specified in ExecStart=.
Rather than making the config dir world-readable, which potentially leaks RPC credentials, the group of the directory is changed to the one the service is executed as.
Further hardening; the service should be run with as many restrictions as possible without breaking it.
The bitcoin user needs read access to the configuration file, but write access is not needed. It is not considered best practice to make configuration directories and files owned by the services reading them.
74f741d to
f3b57f4
Compare
|
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. ConflictsNo conflicts as of last run. |
ryanofsky
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
utACK f3b57f4. Only change since last review is removing ConfigurationDirectoryMode churn in early commits
|
@sipsorcery @dongcarl Want to take another look here? |
|
tACK f3b57f4 (nothing changed since previous tACK). |
f3b57f4 Unrecommend making config file owned by bitcoin (setpill) 870d415 Set ProtectHome in systemd service file (setpill) 639a416 Chgrp config dir to bitcoin in systemd service (setpill) aded052 Improve clarity of systemd service file comments (setpill) Pull request description: Rationale: ran into a bug with the systemd service file, fixed it locally and figured I might as well contribute my fix. Also fixed some unrelated confusing phrasing in the comments of the same file, after discussion in IRC. ACKs for top commit: sipsorcery: tACK f3b57f4 (nothing changed since previous tACK). ryanofsky: utACK f3b57f4. Only change since last review is removing ConfigurationDirectoryMode churn in early commits Tree-SHA512: 2188345878925b9e8a5c2c3df8dfba443720e2252a164db54a8e1d8007846721497b2d98c56f1d9b60a9a9ed4fdb1156c7b02c699616b220a9b614671617d32a
… setup f3b57f4 Unrecommend making config file owned by bitcoin (setpill) 870d415 Set ProtectHome in systemd service file (setpill) 639a416 Chgrp config dir to bitcoin in systemd service (setpill) aded052 Improve clarity of systemd service file comments (setpill) Pull request description: Rationale: ran into a bug with the systemd service file, fixed it locally and figured I might as well contribute my fix. Also fixed some unrelated confusing phrasing in the comments of the same file, after discussion in IRC. ACKs for top commit: sipsorcery: tACK f3b57f4 (nothing changed since previous tACK). ryanofsky: utACK f3b57f4. Only change since last review is removing ConfigurationDirectoryMode churn in early commits Tree-SHA512: 2188345878925b9e8a5c2c3df8dfba443720e2252a164db54a8e1d8007846721497b2d98c56f1d9b60a9a9ed4fdb1156c7b02c699616b220a9b614671617d32a
|
FWIW, |
Rationale: ran into a bug with the systemd service file, fixed it locally and figured I might as well contribute my fix.
Also fixed some unrelated confusing phrasing in the comments of the same file, after discussion in IRC.