Skip to content
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 DNF config in RPM post-install script #527

Merged
merged 1 commit into from
Nov 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions package-managers/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@ endif
install-dnf5: install-rpm
install -D -m 0644 qubes-post-update.actions \
$(DESTDIR)$(SYSCONFDIR)/dnf/libdnf5-plugins/actions.d/qubes-post-update.actions
install -D -m 0644 dnf-harden.conf \
$(DESTDIR)$(SYSCONFDIR)/dnf/libdnf5.conf.d/10-qubes.conf

install-yum: install-rpm
install -d $(DESTDIR)$(LIBDIR)/yum-plugins
Expand Down
3 changes: 3 additions & 0 deletions package-managers/dnf-harden.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[main]
deltarpm=0
zchunk=0
8 changes: 8 additions & 0 deletions rpm_spec/core-agent.spec.in
Original file line number Diff line number Diff line change
Expand Up @@ -582,6 +582,13 @@ if [ -L /usr/local ]; then
mount /usr/local || :
fi

%if 0%{?fedora} < 41
if [ ! -f /etc/qubes-dnf-hardened ]; then
dnf config-manager --setopt=zchunk=0 --setopt=deltarpm=0 --save &&
touch /etc/qubes-dnf-hardened
fi
%endif

# workaround for Fedora's systemd package bug
# https://bugzilla.redhat.com/1559286
if [ -d /var/lib/private ]; then
Expand Down Expand Up @@ -963,6 +970,7 @@ rm -f %{name}-%{version}
%config(noreplace) /etc/yum.repos.d/qubes-r4.repo
%if 0%{?fedora} >= 41
/etc/dnf/libdnf5-plugins/actions.d/qubes-post-update.actions
/etc/dnf/libdnf5.conf.d/10-qubes.conf
%else
%if 0%{?rhel} == 7
/etc/yum/pluginconf.d/yum-qubes-hooks.conf
Expand Down