Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Harden systemd services for freshclam and clamd #859
base: main
Are you sure you want to change the base?
Harden systemd services for freshclam and clamd #859
Changes from 5 commits
0bec1ce
661e7a2
68fc5e9
e69b611
7ef6ef3
bc62f25
a694172
3c28acd
9a9aefc
722d141
77a125b
246317f
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
I find that this fails if
/var/local/quarantine
does not exist.I created it and did
sudo chown clamav /var/local/quarantine
and then tried again. This time it failed with `Failed to execute /usr/bin/install: Permission denied", which seems similar to the failure I'm seeing with trying to start cthe clamd service.I'm at a loss as the ExecPaths in both service files look correct to me.
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.
Thanks, let me investigate.
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.
Can you give me more information about your setup so I can attempt to replicate the issue?
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.
I'm testing on an ubuntu 22.04 VM where I've installed
systemd
andlibsystemd-dev
before building clamav with these instructions and installing to the default prefix. Like:mkdir build && cd build && cmake .. && make -j12 && sudo make install
I had to set up:
/usr/local/etc/freshclam.conf
and/usr/local/etc/clamd.conf
with the basicssudo groupadd clamav && sudo useradd -g clamav -s /bin/false -c "Clam Antivirus" clamav
sudo mkdir /usr/local/share/clamav && sudo chown clamav /usr/local/share/clamav
sudo mkdir /var/log/clamav && sudo chown clamav /var/log/clamav
I think that's it. Then after reloading with
sudo systemctl daemon-reload
, I tried starting the various services.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.
You did a lot of work on this. I don't want to close/cancel this PR unless you've lost interest in solving the remaining issues.
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.
@micahsnyder Sorry, this completely slipped my mind. I'll work on this over the weekend. I already have a VM that I can test this in.
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.
To begin with, I tested the default installation on Debian 12. I found one issue where if
/usr/lib/x86_64-linux-gnu
had to be in theExecPaths
or clamav-daemon won't start. I also found/dev/null
in the list of open files by the daemon - preferably for writing. I don't know if/dev/null
and other char-files need to be in the read-only exception in the unit file.