keylime/keylime.spec

420 lines
12 KiB
RPMSpec
Raw Normal View History

2019-12-13 16:30:21 +00:00
%global srcname keylime
Name: keylime
2022-06-07 02:00:13 +00:00
Version: 6.4.1
2022-02-15 03:19:03 +00:00
Release: 1%{?dist}
2019-12-13 16:30:21 +00:00
Summary: Open source TPM software for Bootstrapping and Maintaining Trust
BuildArch: noarch
URL: https://github.com/keylime/keylime
Source0: https://github.com/keylime/keylime/archive/refs/tags/v%{version}.tar.gz
2019-12-13 16:30:21 +00:00
# Main program: BSD
# Icons: MIT
2020-07-17 10:20:44 +00:00
License: ASL 2.0 and MIT
2019-12-13 16:30:21 +00:00
BuildRequires: git-core
2019-12-13 16:30:21 +00:00
BuildRequires: swig
BuildRequires: openssl-devel
BuildRequires: python3-devel
2021-01-23 14:10:32 +00:00
BuildRequires: python3-dbus
BuildRequires: python3-setuptools
2019-12-13 16:30:21 +00:00
BuildRequires: systemd-rpm-macros
Requires: python3-%{srcname} = %{version}-%{release}
Requires: %{srcname}-base = %{version}-%{release}
Requires: %{srcname}-verifier = %{version}-%{release}
Requires: %{srcname}-registrar = %{version}-%{release}
Requires: %{srcname}-tenant = %{version}-%{release}
Requires: %{srcname}-webapp = %{version}-%{release}
Requires: %{srcname}-tools = %{version}-%{release}
# Agent.
Requires: keylime-agent
Suggests: python3-%{srcname}-agent
# Conflicts with the monolithic versions of the package, before the split.
Conflicts: keylime < 6.3.0-3
%{?python_enable_dependency_generator}
%description
Keylime is a TPM based highly scalable remote boot attestation
and runtime integrity measurement solution.
%package base
Summary: The base package contains the default configuration
License: MIT
# Conflicts with the monolithic versions of the package, before the split.
Conflicts: keylime < 6.3.0-3
Requires(pre): shadow-utils
Requires: efivar-libs
2019-12-13 16:30:21 +00:00
Requires: procps-ng
Requires: tpm2-tss
Requires: tpm2-tools
%description base
The base package contains the Keylime default configuration
%package -n python3-%{srcname}
Summary: The Python Keylime module
License: MIT
# Conflicts with the monolithic versions of the package, before the split.
Conflicts: keylime < 6.3.0-3
Requires: %{srcname}-base = %{version}-%{release}
%{?python_provide:%python_provide python3-%{srcname}}
%description -n python3-%{srcname}
The python3-keylime module implements the functionality used
by Keylime components.
%package verifier
Summary: The Python Keylime Verifier component
License: MIT
# Conflicts with the monolithic versions of the package, before the split.
Conflicts: keylime < 6.3.0-3
Requires: %{srcname}-base = %{version}-%{release}
Requires: python3-%{srcname} = %{version}-%{release}
Requires: python3-tornado
Requires: python3-sqlalchemy
Requires: python3-alembic
Requires: python3-cryptography
Requires: python3-pyyaml
Requires: python3-packaging
Requires: python3-requests
Requires: python3-zmq
Requires: python3-gnupg
2022-05-04 17:28:12 +00:00
Requires: python3-lark-parser
%description verifier
The Keylime Verifier continuously verifies the integrity state
of the machine that the agent is running on.
%package registrar
Summary: The Keylime Registrar component
License: MIT
# Conflicts with the monolithic versions of the package, before the split.
Conflicts: keylime < 6.3.0-3
Requires: %{srcname}-base = %{version}-%{release}
Requires: python3-%{srcname} = %{version}-%{release}
Requires: python3-tornado
Requires: python3-sqlalchemy
2021-01-23 14:10:32 +00:00
Requires: python3-alembic
Requires: python3-cryptography
Requires: python3-pyyaml
Requires: python3-packaging
Requires: python3-requests
Requires: python3-zmq
2021-03-25 14:37:26 +00:00
Requires: python3-gnupg
2022-05-04 17:28:12 +00:00
Requires: python3-lark-parser
%description registrar
The Keylime Registrar is a database of all agents registered
with Keylime and hosts the public keys of the TPM vendors.
%package -n python3-%{srcname}-agent
Summary: The Python Keylime Agent
License: MIT
# Conflicts with the monolithic versions of the package, before the split.
Conflicts: keylime < 6.3.0-3
Requires: %{srcname}-base = %{version}-%{release}
Requires: python3-%{srcname} = %{version}-%{release}
# Virtual Provides to support swapping between Python and Rust implementation.
Provides: keylime-agent
Conflicts: keylime-agent
Requires: python3-psutil
Requires: python3-tornado
Requires: python3-cryptography
2019-12-13 16:30:21 +00:00
Requires: python3-pyyaml
Requires: python3-packaging
Requires: python3-requests
Requires: python3-zmq
Requires: python3-gnupg
2022-05-04 17:28:12 +00:00
Requires: python3-lark-parser
%description -n python3-%{srcname}-agent
The Keylime Agent is deployed to the remote machine that is to be
measured or provisioned with secrets stored within an encrypted
payload released once trust is established.
%package tenant
Summary: The Python Keylime Tenant
License: MIT
# Conflicts with the monolithic versions of the package, before the split.
Conflicts: keylime < 6.3.0-3
Requires: %{srcname}-base = %{version}-%{release}
Requires: python3-%{srcname} = %{version}-%{release}
%description tenant
The Keylime Tenant can be used to provision a Keylime Agent.
%package webapp
Summary: The Python Keylime WebApp GUI
License: MIT
# Conflicts with the monolithic versions of the package, before the split.
Conflicts: keylime < 6.3.0-3
Requires: %{srcname}-base = %{version}-%{release}
Requires: python3-%{srcname} = %{version}-%{release}
Requires: python3-tornado
2019-12-13 16:30:21 +00:00
Requires: python3-cryptography
Requires: python3-pyyaml
Requires: python3-packaging
Requires: python3-requests
Requires: python3-zmq
Requires: python3-gnupg
# Conflicts with the monolithic versions of the package, before the split.
Conflicts: keylime < 6.3.0-3
%description webapp
The Keylime WebApp GUI interface can be used to provision a Keylime Agent.
%package tools
Summary: Keylime tools
License: MIT
# Conflicts with the monolithic versions of the package, before the split.
Conflicts: keylime < 6.3.0-3
Requires: %{srcname}-base = %{version}-%{release}
Requires: python3-%{srcname} = %{version}-%{release}
2019-12-13 16:30:21 +00:00
Requires: python3-tornado
Requires: python3-cryptography
Requires: python3-pyyaml
Requires: python3-packaging
2019-12-13 16:30:21 +00:00
Requires: python3-requests
Requires: python3-zmq
Requires: python3-gnupg
2019-12-13 16:30:21 +00:00
%description tools
The keylime tools package includes tools like the IMA emulator.
2019-12-13 16:30:21 +00:00
%prep
%autosetup -S git -n %{srcname}-%{version}
2019-12-13 16:30:21 +00:00
%build
%py3_build
%install
%py3_install
mkdir -p %{buildroot}/%{_sharedstatedir}/%{srcname}
mkdir -p --mode=0700 %{buildroot}/%{_rundir}/%{srcname}
mkdir -p --mode=0700 %{buildroot}/%{_localstatedir}/log/%{srcname}
2019-12-13 16:30:21 +00:00
2022-04-06 22:05:45 +00:00
# Setting up the agent to use keylime user/group.
sed -e 's/^run_as.*/run_as = %{srcname}:%{srcname}/g' -i %{srcname}.conf
2022-02-15 03:19:03 +00:00
install -Dpm 600 %{srcname}.conf \
2019-12-13 16:30:21 +00:00
%{buildroot}%{_sysconfdir}/%{srcname}.conf
2022-02-15 03:19:03 +00:00
install -Dpm 644 ./services/%{srcname}_agent.service \
2019-12-13 16:30:21 +00:00
%{buildroot}%{_unitdir}/%{srcname}_agent.service
2022-04-06 22:05:45 +00:00
install -Dpm 644 ./services/%{srcname}_agent_secure.mount \
%{buildroot}%{_unitdir}/%{srcname}_agent_secure.mount
2022-02-15 03:19:03 +00:00
install -Dpm 644 ./services/%{srcname}_verifier.service \
2019-12-13 16:30:21 +00:00
%{buildroot}%{_unitdir}/%{srcname}_verifier.service
2022-02-15 03:19:03 +00:00
install -Dpm 644 ./services/%{srcname}_registrar.service \
2019-12-13 16:30:21 +00:00
%{buildroot}%{_unitdir}/%{srcname}_registrar.service
2020-02-06 15:43:50 +00:00
cp -r ./tpm_cert_store %{buildroot}%{_sharedstatedir}/keylime/
%pre base
getent group %{srcname} >/dev/null || groupadd -r %{srcname} &>/dev/null
getent passwd %{srcname} >/dev/null || \
useradd -r -g %{srcname} -d %{_localstatedir}/lib/%{srcname} -s /usr/sbin/nologin \
-c "Keylime agent unprivileged user" %{srcname} &>/dev/null
# Add keylime user to tss group.
if getent group tss >/dev/null && ! groups %{srcname} | grep -q "\btss\b"; then
usermod -a -G tss %{srcname} &>/dev/null
fi
2022-04-06 22:05:45 +00:00
exit 0
%posttrans base
[ -f %{_sysconfdir}/%{srcname}.conf ] && \
2022-05-04 17:28:12 +00:00
chmod 600 %{_sysconfdir}/%{srcname}.conf && \
chown %{srcname} %{_sysconfdir}/%{srcname}.conf
[ -d %{_sharedstatedir}/%{srcname} ] && \
chown -R %{srcname} %{_sharedstatedir}/%{srcname}/
[ -d %{_localstatedir}/log/%{srcname} ] && \
chown -R %{srcname} %{_localstatedir}/log/%{srcname}/
exit 0
2019-12-13 16:30:21 +00:00
%post verifier
%systemd_post %{srcname}_verifier.service
2019-12-13 16:30:21 +00:00
%post registrar
%systemd_post %{srcname}_registrar.service
2019-12-13 16:30:21 +00:00
%post -n python3-%{srcname}-agent
%systemd_post %{srcname}_agent.service
%preun verifier
%systemd_preun %{srcname}_verifier.service
%preun registrar
%systemd_preun %{srcname}_registrar.service
%preun -n python3-%{srcname}-agent
%systemd_preun %{srcname}_agent.service
%postun verifier
%systemd_postun_with_restart %{srcname}_verifier.service
%postun registrar
%systemd_postun_with_restart %{srcname}_registrar.service
%postun -n python3-%{srcname}-agent
%systemd_postun_with_restart %{srcname}_agent.service
%files verifier
%license LICENSE
2019-12-13 16:30:21 +00:00
%{_bindir}/%{srcname}_verifier
%{_bindir}/%{srcname}_ca
%{_bindir}/%{srcname}_migrations_apply
%{_unitdir}/keylime_verifier.service
%files registrar
%license LICENSE
2019-12-13 16:30:21 +00:00
%{_bindir}/%{srcname}_registrar
%{_unitdir}/keylime_registrar.service
%files -n python3-%{srcname}-agent
%license LICENSE
2019-12-13 16:30:21 +00:00
%{_bindir}/%{srcname}_agent
2022-04-06 22:05:45 +00:00
%{_unitdir}/%{srcname}_agent.service
%{_unitdir}/%{srcname}_agent_secure.mount
%{_bindir}/%{srcname}_ima_emulator
%files tenant
%license LICENSE
2019-12-13 16:30:21 +00:00
%{_bindir}/%{srcname}_tenant
%files webapp
%license LICENSE
%{_bindir}/%{srcname}_webapp
%files -n python3-%{srcname}
%license LICENSE
%{python3_sitelib}/%{srcname}-*.egg-info/
%{python3_sitelib}/%{srcname}
%files tools
%license LICENSE
2019-12-13 16:30:21 +00:00
%{_bindir}/%{srcname}_userdata_encrypt
%files base
%license LICENSE keylime/static/icons/ICON-LICENSE
%doc README.md
%config(noreplace) %attr(600,%{srcname},%{srcname}) %{_sysconfdir}/%{srcname}.conf
%attr(700,%{srcname},%{srcname}) %dir %{_rundir}/%{srcname}
%attr(700,%{srcname},%{srcname}) %dir %{_localstatedir}/log/%{srcname}
%attr(700,%{srcname},%{srcname}) %{_sharedstatedir}/%{srcname}
%files
%license LICENSE
2019-12-13 16:30:21 +00:00
%changelog
2022-06-07 02:00:13 +00:00
* Mon Jun 06 2022 Sergio Correia <scorreia@redhat.com> - 6.4.1-1
- Updating for Keylime release v6.4.1
2022-05-04 17:28:12 +00:00
* Wed May 04 2022 Sergio Correia <scorreia@redhat.com> - 6.4.0-1
- Updating for Keylime release v6.4.0
2022-04-06 22:05:45 +00:00
* Wed Apr 06 2022 Sergio Correia <scorreia@redhat.com> - 6.3.2-1
- Updating for Keylime release v6.3.2
2022-02-15 03:19:03 +00:00
* Mon Feb 14 2022 Sergio Correia <scorreia@redhat.com> - 6.3.1-1
- Updating for Keylime release v6.3.1
* Tue Feb 08 2022 Sergio Correia <scorreia@redhat.com> - 6.0.3-4
- Add Conflicts clauses for the subpackages
* Mon Feb 07 2022 Sergio Correia <scorreia@redhat.com> - 6.3.0-3
- Split keylime into subpackages
Related: rhbz#2045874 - Keylime subpackaging and agent alternatives
2022-01-27 17:28:36 +00:00
* Thu Jan 27 2022 Sergio Correia <scorreia@redhat.com> - 6.3.0-2
- Fix permissions of config file
2022-01-27 16:47:55 +00:00
* Thu Jan 27 2022 Sergio Correia <scorreia@redhat.com> - 6.3.0-1
- Updating for Keylime release v6.3.0
* Thu Jan 20 2022 Fedora Release Engineering <releng@fedoraproject.org> - 6.1.0-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
* Thu Jul 22 2021 Fedora Release Engineering <releng@fedoraproject.org> - 6.1.0-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
2021-06-04 18:08:07 +00:00
* Fri Jun 04 2021 Python Maint <python-maint@redhat.com> - 6.1.0-3
- Rebuilt for Python 3.10
2021-03-25 14:37:26 +00:00
* Thu Mar 25 2021 Luke Hinds <lhinds@redhat.com> 6.0.1-1
- Updating for Keylime release v6.1.0
2021-03-03 09:19:41 +00:00
* Wed Mar 03 2021 Luke Hinds <lhinds@redhat.com> 6.0.1-1
- Updating for Keylime release v6.0.1
* Tue Mar 02 2021 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 6.0.0-2
- Rebuilt for updated systemd-rpm-macros
See https://pagure.io/fesco/issue/2583.
2021-02-24 15:25:47 +00:00
* Wed Feb 24 2021 Luke Hinds <lhinds@redhat.com> 6.0.0-1
- Updating for Keylime release v6.0.0
2021-02-02 13:48:50 +00:00
* Tue Feb 02 2021 Luke Hinds <lhinds@redhat.com> 5.8.1-1
- Updating for Keylime release v5.8.1
* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 5.8.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
2021-01-23 14:10:32 +00:00
* Sat Jan 23 2021 Luke Hinds <lhinds@redhat.com> 5.8.0-1
- Updating for Keylime release v5.8.0
2020-07-17 10:20:44 +00:00
* Fri Jul 17 2020 Luke Hinds <lhinds@redhat.com> 5.7.2-1
- Updating for Keylime release v5.7.2
* Tue May 26 2020 Miro Hrončok <mhroncok@redhat.com> - 5.6.2-2
- Rebuilt for Python 3.9
2020-05-01 11:37:20 +00:00
* Fri May 01 2020 Luke Hinds <lhinds@redhat.com> 5.6.2-1
- Updating for Keylime release v5.6.2
2020-02-06 15:43:50 +00:00
* Thu Feb 06 2020 Luke Hinds <lhinds@redhat.com> 5.5.0-1
- Updating for Keylime release v5.5.0
* Wed Jan 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 5.4.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
2019-12-13 16:30:21 +00:00
* Thu Dec 12 2019 Luke Hinds <lhinds@redhat.com> 5.4.1-1
Initial Packaging