-
Notifications
You must be signed in to change notification settings - Fork 37
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
Add Makefile targets to automate Yara installations from source #181
Conversation
sudo add-apt-repository -n -y "deb http://security.ubuntu.com/ubuntu mantic-security main restricted universe multiverse" | ||
|
||
sudo apt update && sudo apt install libyara-dev -y | ||
make build-yara |
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.
This looks to be as fast or faster than running the four add-apt-repository
commands followed by sudo apt update && sudo apt install libyara-dev -y
; this also provides an opportunity to use a static version of Yara while ensuring that the build/installation steps are valid.
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 believe in the inspiration for this change - to make users lives easier.
However, I also feel like managing and modifying system configuration falls outside of the scope of what I'd like to see bincapz do - no matter how well intended it is.
I would never have expected a build rule to prompt for sudo - it honestly scared me a little bit, not knowing what it's doing:
make build-yara
[sudo] password for t:
Having reviewed the code, I gave it my password after checking it once more, but it still wasn't a great user experience, as I knew I had all my dependencies (fulfilled by LinuxBrew)...
make build-yara
Note: This system is image (rpm-ostree) based.
note: automatic updates (stage) are enabled
Pulling manifest: ostree-image-signed:docker://ghcr.io/ublue-os/bluefin:latest
Importing: ostree-image-signed:docker://ghcr.io/ublue-os/bluefin:latest (digest: sha256:1c211f0bf13c0fc4dc2585cc6d074d2b233e2d228c240e16f0ab758350f25169)
ostree chunk layers already present: 58
ostree chunk layers needed: 7 (362.2 MB)
custom layers needed: 2 (964.5 MB)
<two minutes later>
Staging deployment... done
<two minutes later>
Run "systemctl reboot" to start a reboot
Note: This system is image (rpm-ostree) based.
error: "gcc" is already provided by: gcc-14.0.1-0.15.fc40.x86_64. Use --allow-inactive to explicitly require it.
make: *** [Makefile:76: yara-reqs] Error 1
Even if the make UX was improved, I feel like this is more of a maintenance burden than I would feel comfortable with maintaining.
Once you need a "sudo"/"su" rule in a Makefile, it's a good time to consider whether it's the right tool for the job.
I really hate turning down contributions, but I don't think this one is right for the bincapz project at this time. Sorry :(
Totally fair -- the steps are at least documented now and this did help with investigating #63 so it wasn't a complete waste! |
The
README
mentions that Yara can be installed from source but it would be nicer if there was automation to handle those steps.This PR adds two Makefile targets (required packages; actual building and installing, respectively) to automatically build Yara from source for a known version (
4.3.2
but we can make this4.5.0
if that's preferred).I tested this on all of the platforms mentioned in the updated
README
(except for macOS which was done natively). Additionally, this should close #63 due to the installation of OpenSSL dev packages where appropriate.Example using Wolfi: