Skip to content

Make it possible to run cron without a root#574

Merged
CyberDem0n merged 2 commits intomasterfrom
feature/cron-without-root
Apr 22, 2021
Merged

Make it possible to run cron without a root#574
CyberDem0n merged 2 commits intomasterfrom
feature/cron-without-root

Conversation

@CyberDem0n
Copy link
Copy Markdown
Contributor

  • Don't set suid bit on /usr/sbin/cron (even if it could be used there is no way to safely create the root cronjob, but it also means that the sys_nice capability which is set on chrt and renice could be used).
  • Use LD_PRELOAD trick for hooking seteuid() and initgroups() functions when starting cron deamon without a root.
  • Enhance scheduling (or not scheduling) the renice cronjob depending on the initial conditions (root, sys_nice, no-new-privileges).
  • Disable unwanted cronjobs (/etc/crontab, /etc/cron.{hourly,daily,...}), they produce "scary" logs when cron is running without a root.

Close: #562

Alexander Kukushkin added 2 commits March 31, 2021 10:59
* Don't set suid bit on /usr/sbin/cron (even if it could be used there
is no way to safely create the root cronjob, but it also means that
sys_nice capability which is set on chrt and renice could be used).
* Use LD_PRELOAD trick for hooking seteuid() and initgroups() functions
when starting cron deamon as non-root.
* Enchance scheduling (or not scheduling) the renice cronjob depending
on the initial conditions (root, sys_nice, no-new-privileges).
* Disable unwanted cronjobs (/etc/crontab, /etc/cron.{hourly,daily,...})

Close: #562
@Jan-M
Copy link
Copy Markdown
Member

Jan-M commented Apr 22, 2021

👍

1 similar comment
@CyberDem0n
Copy link
Copy Markdown
Contributor Author

👍

@CyberDem0n CyberDem0n merged commit c91248e into master Apr 22, 2021
@CyberDem0n CyberDem0n deleted the feature/cron-without-root branch April 22, 2021 13:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

seteuid: Operation not permitted but cluster is up and running fine with PG 1.6

2 participants