-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
PKGS-7370: debsums cron check does not examine /etc/crontab or /var/spool/cron/crontabs/root #1567
Comments
I think when you start straying from the package-maintained defaults, you're getting into special, one-off use cases that general utilities like Lynis won't be able to detect. Right now, the cron job check looks for a file called Incidentally, managing cron jobs in |
I can understand your point and challenge, but I want to execute debsums to a specific time.
All these files, which Lynis is looking for, do exist.
But I disabled them via /etc/default/debsums.
As I mentioned above. I want to control the exact timing of when debsums is executed. This can be configured in /var/spool/cron/crontabs/*, /etc/crontab, or /etc/cron.{daily,monthly,weekly}/. It might be useful to respect the never flag and then use grep on these paths while ensuring that debsums is not commented out. I believe this could get just one example of many, especially if Lynis cross-checks the execution of such tools. In light of this, I’d suggest re-evaluating your strategy.
Is that your personal opinion, or is it an official recommendation? I will consider your suggestion. But in that case, your check could use a grep over these well known cron paths. Or is there a recommendation for a filename under these path which will be considered by Lynis. |
Fair enough, but you have to remember that with each customization, your system becomes unique from everyone else, which makes accurate detection that much harder.
That is what is tripping up Lynis. It explicitly looks for a value of "daily", "weekly", or "monthly", since that is the standard way of enabling the debsums cron job. Specifying "never" disables it, as far as Lynis can detect.
I am guessing this means you are making a call to the What do your custom cron job calls look like in those files?
Whether there is an official recommendation or not, I don't know, but the general rule of thumb is that for services that support the .d-style config snippets, you create your snippets in that .d directory and avoid changing the package-provided file. That will help reduce conflicts if you upgrade the package and upstream has made changes that conflict with your changes. The exception would be when you cannot override a setting with a config snippet. In the case of I also personally avoid cron jobs tied to specific user's crontab (even the root user) for server-level functionality like this. The file at Just to clarify, I'm not a maintainer for Lynis. I am just a regular user that has made a small contribution or two. |
I agree, but the timing of cron jobs should not be decided by the package maintainer. The execution times for jobs under /etc/cron.{daily,monthly,weekly}/, which are defined in /etc/crontab should not be globally fixed by the package. Users should have the flexibility to configure these schedules as needed.
Yes, if it's feasible to manage everything independently. However, on a multi-user system, users would be constrained by the permissions set for the cron directories in /etc, or by the decisions of the root administrator.
Thank you for the clarification. In that case, I would suggest a Lynis maintainer weigh in on this topic, as otherwise, it could turn into unnecessary detail. I keep my simple suggestion: On Ubuntu 24.04, please grep through /etc/crontab, /etc/cron.d, and /var/spool/cron/crontabs/root for the execution of debsums when /etc/default/debsums is set to CRON_CHECK=never. Background: System administrators often need to adjust cron job schedules to balance server load, backups, or security scans, especially in a server farm. This can be done by modifying /etc/crontab as needed. Lynis shouldn't enforce the package's default timing for running debsums. If someone is managing debsums, they likely understand the implications and should have the flexibility to adjust the system according to their needs, regardless of whether or not they modify basic system files. |
Describe the bug
The current check for existing cronjobs only examines those delivered with the package. However, I manage my own cronjobs through /etc/crontab, /var/spool/cron/crontabs/root, or /etc/cron.d/. Could be related to #1275.
Version
Expected behavior
I suggest that the check be updated to include these custom cronjob files for a more comprehensive assessment.
Output
Additional context
Thank you for your work on Lynis!
The text was updated successfully, but these errors were encountered: