2019-10-07 12:46:26 +00:00
|
|
|
%global selinuxtype targeted
|
|
|
|
%global moduletype contrib
|
2020-06-24 15:18:23 +00:00
|
|
|
%define semodule_version 0.3
|
2019-10-07 12:46:26 +00:00
|
|
|
|
2018-02-16 18:58:12 +00:00
|
|
|
Summary: Application Whitelisting Daemon
|
|
|
|
Name: fapolicyd
|
2020-05-25 13:16:14 +00:00
|
|
|
Version: 1.0
|
2020-06-24 15:18:23 +00:00
|
|
|
Release: 3%{?dist}
|
2018-02-16 18:58:12 +00:00
|
|
|
License: GPLv3+
|
|
|
|
URL: http://people.redhat.com/sgrubb/fapolicyd
|
|
|
|
Source0: https://people.redhat.com/sgrubb/fapolicyd/%{name}-%{version}.tar.gz
|
2019-10-07 12:46:26 +00:00
|
|
|
Source1: https://github.com/linux-application-whitelisting/%{name}-selinux/releases/download/v%{semodule_version}/%{name}-selinux-%{semodule_version}.tar.gz
|
2020-05-25 13:16:14 +00:00
|
|
|
BuildRequires: gcc
|
2018-02-16 18:58:12 +00:00
|
|
|
BuildRequires: kernel-headers
|
2019-03-11 11:07:44 +00:00
|
|
|
BuildRequires: autoconf automake make gcc libtool
|
2020-02-24 13:20:04 +00:00
|
|
|
BuildRequires: systemd-devel libgcrypt-devel rpm-devel file-devel file
|
2018-06-07 13:01:29 +00:00
|
|
|
BuildRequires: libcap-ng-devel libseccomp-devel lmdb-devel
|
2019-03-11 11:07:44 +00:00
|
|
|
BuildRequires: python3-devel
|
2019-11-05 13:34:48 +00:00
|
|
|
Recommends: %{name}-selinux
|
2018-02-16 18:58:12 +00:00
|
|
|
Requires(pre): shadow-utils
|
|
|
|
Requires(post): systemd-units
|
|
|
|
Requires(preun): systemd-units
|
|
|
|
Requires(postun): systemd-units
|
|
|
|
|
2020-06-24 15:18:23 +00:00
|
|
|
Patch1: fapolicyd-cli-args.patch
|
|
|
|
Patch2: fapolicyd-magic-override.patch
|
|
|
|
Patch3: fapolicyd-magic-override2.patch
|
|
|
|
Patch4: fapolicyd-man-page.patch
|
|
|
|
Patch5: fapolicyd-trust.patch
|
|
|
|
Patch6: fapolicyd-cli-empty-db.patch
|
|
|
|
Patch7: fapolicyd-cli-big-buffer.patch
|
|
|
|
Patch8: fapolicyd-get-line.patch
|
2019-03-13 23:09:43 +00:00
|
|
|
|
2018-02-16 18:58:12 +00:00
|
|
|
%description
|
|
|
|
Fapolicyd (File Access Policy Daemon) implements application whitelisting
|
|
|
|
to decide file access rights. Applications that are known via a reputation
|
|
|
|
source are allowed access while unknown applications are not. The daemon
|
|
|
|
makes use of the kernel's fanotify interface to determine file access rights.
|
|
|
|
|
2019-10-07 12:46:26 +00:00
|
|
|
%package selinux
|
|
|
|
Summary: Fapolicyd selinux
|
|
|
|
Group: Applications/System
|
|
|
|
Requires: %{name} = %{version}-%{release}
|
|
|
|
BuildRequires: selinux-policy
|
|
|
|
BuildRequires: selinux-policy-devel
|
|
|
|
BuildArch: noarch
|
|
|
|
%{?selinux_requires}
|
|
|
|
|
|
|
|
%description selinux
|
|
|
|
The %{name}-selinux package contains selinux policy for the %{name} daemon.
|
|
|
|
|
2018-02-16 18:58:12 +00:00
|
|
|
%prep
|
2019-08-30 11:05:25 +00:00
|
|
|
|
2018-02-16 18:58:12 +00:00
|
|
|
%setup -q
|
|
|
|
|
2019-10-07 12:46:26 +00:00
|
|
|
# selinux
|
|
|
|
%setup -q -D -T -a 1
|
|
|
|
|
2020-06-24 15:18:23 +00:00
|
|
|
%patch1 -p1 -b .cli-args
|
|
|
|
%patch2 -p1 -b .magic-override
|
|
|
|
%patch3 -p1 -b .magic-override2
|
|
|
|
%patch4 -p1 -b .man-page
|
|
|
|
%patch5 -p1 -b .trust
|
|
|
|
%patch6 -p1 -b .cli-empty-db
|
|
|
|
%patch7 -p1 -b .cli-big-buffer
|
|
|
|
%patch8 -p1 -b .get-line
|
|
|
|
|
2020-05-25 13:16:14 +00:00
|
|
|
sed -i "s/%python2_path%/`readlink -f %{__python2} | sed 's/\//\\\\\//g'`/g" init/%{name}.rules.*
|
|
|
|
sed -i "s/%python3_path%/`readlink -f %{__python3} | sed 's/\//\\\\\//g'`/g" init/%{name}.rules.*
|
|
|
|
sed -i "s/%ld_so_path%/`find /usr/lib64/ -type f -name 'ld-2\.*.so' | sed 's/\//\\\\\//g'`/g" init/%{name}.rules.*
|
2020-01-31 07:43:48 +00:00
|
|
|
|
2018-02-16 18:58:12 +00:00
|
|
|
%build
|
2020-01-31 07:43:48 +00:00
|
|
|
|
2019-03-11 11:07:44 +00:00
|
|
|
./autogen.sh
|
2020-01-31 07:43:48 +00:00
|
|
|
|
|
|
|
%configure \
|
|
|
|
--with-audit \
|
|
|
|
--with-rpm \
|
|
|
|
--disable-shared
|
|
|
|
|
|
|
|
|
2018-02-16 18:58:12 +00:00
|
|
|
make CFLAGS="%{optflags}" %{?_smp_mflags}
|
|
|
|
|
2019-10-07 12:46:26 +00:00
|
|
|
# selinux
|
|
|
|
pushd %{name}-selinux-%{semodule_version}
|
|
|
|
make
|
|
|
|
popd
|
|
|
|
|
|
|
|
# selinux
|
|
|
|
%pre selinux
|
|
|
|
%selinux_relabel_pre -s %{selinuxtype}
|
|
|
|
|
2018-02-16 18:58:12 +00:00
|
|
|
%install
|
|
|
|
make DESTDIR="%{buildroot}" INSTALL='install -p' install
|
2019-03-11 11:07:44 +00:00
|
|
|
mkdir -p %{buildroot}/%{python3_sitelib}/dnf-plugins/
|
|
|
|
install -p -m 644 dnf/%{name}-dnf-plugin.py %{buildroot}/%{python3_sitelib}/dnf-plugins/
|
2019-03-13 23:09:43 +00:00
|
|
|
install -p -m 644 -D init/%{name}-tmpfiles.conf %{buildroot}/%{_tmpfilesdir}/%{name}.conf
|
2020-05-25 13:16:14 +00:00
|
|
|
install -p -m 644 init/%{name}.rules.known-libs %{buildroot}/%{_sysconfdir}/%{name}/%{name}.rules
|
2018-06-07 13:01:29 +00:00
|
|
|
mkdir -p %{buildroot}/%{_localstatedir}/lib/%{name}
|
2019-03-13 23:09:43 +00:00
|
|
|
mkdir -p %{buildroot}/run/%{name}
|
2018-02-16 18:58:12 +00:00
|
|
|
|
2019-10-07 12:46:26 +00:00
|
|
|
# selinux
|
|
|
|
install -d %{buildroot}%{_datadir}/selinux/packages/%{selinuxtype}
|
|
|
|
install -m 0644 %{name}-selinux-%{semodule_version}/%{name}.pp.bz2 %{buildroot}%{_datadir}/selinux/packages/%{selinuxtype}
|
|
|
|
install -d -p %{buildroot}%{_datadir}/selinux/devel/include/%{moduletype}
|
|
|
|
install -p -m 644 %{name}-selinux-%{semodule_version}/%{name}.if %{buildroot}%{_datadir}/selinux/devel/include/%{moduletype}/ipp-%{name}.if
|
|
|
|
|
2020-01-31 07:43:48 +00:00
|
|
|
#cleanup
|
|
|
|
find %{buildroot} \( -name '*.la' -o -name '*.a' \) -exec rm -f {} ';'
|
2019-10-07 12:46:26 +00:00
|
|
|
|
2018-02-16 18:58:12 +00:00
|
|
|
%pre
|
2019-03-13 23:09:43 +00:00
|
|
|
getent passwd %{name} >/dev/null || useradd -r -M -d %{_localstatedir}/lib/%{name} -s /sbin/nologin -c "Application Whitelisting Daemon" %{name}
|
2018-02-16 18:58:12 +00:00
|
|
|
|
|
|
|
%post
|
2019-03-11 11:07:44 +00:00
|
|
|
%systemd_post %{name}.service
|
2018-02-16 18:58:12 +00:00
|
|
|
|
|
|
|
%preun
|
2019-03-11 11:07:44 +00:00
|
|
|
%systemd_preun %{name}.service
|
2018-02-16 18:58:12 +00:00
|
|
|
|
|
|
|
%postun
|
2019-03-11 11:07:44 +00:00
|
|
|
%systemd_postun_with_restart %{name}.service
|
2018-02-16 18:58:12 +00:00
|
|
|
|
|
|
|
%files
|
2019-03-11 11:07:44 +00:00
|
|
|
%doc README.md
|
2018-02-16 18:58:12 +00:00
|
|
|
%{!?_licensedir:%global license %%doc}
|
|
|
|
%license COPYING
|
2020-05-25 13:16:14 +00:00
|
|
|
%attr(755,root,%{name}) %dir %{_datadir}/%{name}
|
|
|
|
%attr(644,root,%{name}) %{_datadir}/%{name}/%{name}.rules.*
|
2019-03-11 11:07:44 +00:00
|
|
|
%attr(750,root,%{name}) %dir %{_sysconfdir}/%{name}
|
|
|
|
%config(noreplace) %attr(644,root,%{name}) %{_sysconfdir}/%{name}/%{name}.conf
|
2020-01-31 07:43:48 +00:00
|
|
|
%config(noreplace) %attr(644,root,%{name}) %{_sysconfdir}/%{name}/%{name}.trust
|
2020-05-25 13:16:14 +00:00
|
|
|
%config(noreplace) %attr(644,root,%{name}) %{_sysconfdir}/%{name}/%{name}.rules
|
2019-03-11 11:07:44 +00:00
|
|
|
%attr(644,root,root) %{_unitdir}/%{name}.service
|
2019-03-13 23:09:43 +00:00
|
|
|
%attr(644,root,root) %{_tmpfilesdir}/%{name}.conf
|
2019-03-11 11:07:44 +00:00
|
|
|
%attr(755,root,root) %{_sbindir}/%{name}
|
|
|
|
%attr(755,root,root) %{_sbindir}/%{name}-cli
|
2018-02-16 18:58:12 +00:00
|
|
|
%attr(644,root,root) %{_mandir}/man8/*
|
|
|
|
%attr(644,root,root) %{_mandir}/man5/*
|
2019-10-07 11:40:06 +00:00
|
|
|
%attr(644,root,root) %{_mandir}/man1/*
|
2020-02-24 13:20:04 +00:00
|
|
|
%attr(644,root,root) %{_datadir}/%{name}/*
|
2019-03-11 11:07:44 +00:00
|
|
|
%ghost %{_localstatedir}/log/%{name}-access.log
|
|
|
|
%attr(770,root,%{name}) %dir %{_localstatedir}/lib/%{name}
|
2019-03-13 23:09:43 +00:00
|
|
|
%attr(770,root,%{name}) %dir /run/%{name}
|
2020-02-24 13:20:04 +00:00
|
|
|
%ghost /run/%{name}/%{name}.fifo
|
2018-06-07 13:01:29 +00:00
|
|
|
%ghost %{_localstatedir}/lib/%{name}/data.mdb
|
|
|
|
%ghost %{_localstatedir}/lib/%{name}/lock.mdb
|
2019-03-11 11:07:44 +00:00
|
|
|
%{python3_sitelib}/dnf-plugins/%{name}-dnf-plugin.py
|
|
|
|
%{python3_sitelib}/dnf-plugins/__pycache__/%{name}-dnf-plugin.*.pyc
|
2018-02-16 18:58:12 +00:00
|
|
|
|
2019-10-07 12:46:26 +00:00
|
|
|
|
|
|
|
%files selinux
|
|
|
|
%{_datadir}/selinux/packages/%{selinuxtype}/%{name}.pp.bz2
|
|
|
|
%ghost %{_sharedstatedir}/selinux/%{selinuxtype}/active/modules/200/%{name}
|
|
|
|
%{_datadir}/selinux/devel/include/%{moduletype}/ipp-%{name}.if
|
|
|
|
|
|
|
|
%post selinux
|
|
|
|
%selinux_modules_install -s %{selinuxtype} %{_datadir}/selinux/packages/%{selinuxtype}/%{name}.pp.bz2
|
|
|
|
|
|
|
|
%postun selinux
|
|
|
|
if [ $1 -eq 0 ]; then
|
|
|
|
%selinux_modules_uninstall -s %{selinuxtype} %{name}
|
|
|
|
fi
|
|
|
|
|
|
|
|
%posttrans selinux
|
|
|
|
%selinux_relabel_post -s %{selinuxtype}
|
|
|
|
|
|
|
|
|
2018-02-16 18:58:12 +00:00
|
|
|
%changelog
|
2020-06-24 15:18:23 +00:00
|
|
|
* Wed Jun 24 2020 Radovan Sroka <rsroka@redhat.com> - 1.0-3
|
|
|
|
- backported few cosmetic small patches from upstream master
|
|
|
|
- rebase selinux tarbal to v0.3
|
|
|
|
- file context pattern for /run/fapolicyd.pid is missing
|
|
|
|
Resolves: rhbz#1834674
|
|
|
|
|
2020-05-26 00:45:14 +00:00
|
|
|
* Tue May 26 2020 Miro Hrončok <mhroncok@redhat.com> - 1.0-2
|
|
|
|
- Rebuilt for Python 3.9
|
|
|
|
|
2020-05-25 13:16:14 +00:00
|
|
|
* Mon May 25 2020 Radovan Sroka <rsroka@redhat.com> - 1.0-1
|
|
|
|
- rebase fapolicyd to 1.0
|
|
|
|
- allowed sys_ptrace for user namespace
|
|
|
|
|
2020-03-23 17:57:05 +00:00
|
|
|
* Mon Mar 23 2020 Radovan Sroka <rsroka@redhat.com> - 0.9.4-1
|
|
|
|
- rebase fapolicyd to 0.9.4
|
|
|
|
- polished the pattern detection engine
|
|
|
|
- rpm backend now drops most of the files in /usr/share/ to dramatically reduce
|
|
|
|
memory consumption and improve startup speed
|
|
|
|
- the commandline utility can now delete the lmdb trust database and manage
|
|
|
|
the file trust source
|
|
|
|
|
2020-02-24 13:20:04 +00:00
|
|
|
* Mon Feb 24 2020 Radovan Sroka <rsroka@redhat.com> - 0.9.3-1
|
|
|
|
- rebase fapolicyd to 0.9.3
|
|
|
|
- dramatically improved startup time
|
|
|
|
- fapolicyd-cli has picked up --list and --ftype commands to help debug/write policy
|
|
|
|
- file type identification has been improved
|
|
|
|
- trust database statistics have been added to the reports
|
|
|
|
|
2020-02-04 08:45:21 +00:00
|
|
|
* Tue Feb 04 2020 Radovan Sroka <rsroka@redhat.com> - 0.9.2-2
|
|
|
|
- Label all fifo_file as fapolicyd_var_run_t in /var/run.
|
|
|
|
- Allow fapolicyd_t domain to create fifo files labeled as
|
|
|
|
fapolicyd_var_run_t
|
|
|
|
|
2020-01-31 07:43:48 +00:00
|
|
|
* Fri Jan 31 2020 Radovan Sroka <rsroka@redhat.com> - 0.9.2-1
|
|
|
|
- rebase fapolicyd to 0.9.2
|
|
|
|
- allows watched mount points to be specified by file system types
|
|
|
|
- ELF file detection was improved
|
|
|
|
- the rules have been rewritten to express the policy based on subject
|
|
|
|
object trust for better performance and reliability
|
|
|
|
- exceptions for dracut and ansible were added to the rules to avoid problems
|
|
|
|
under normal system use
|
|
|
|
- adds an admin defined trust database (fapolicyd.trust)
|
|
|
|
- setting boost, queue, user, and group on the daemon
|
|
|
|
command line are deprecated
|
|
|
|
|
2020-01-28 18:06:28 +00:00
|
|
|
* Tue Jan 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.9-4
|
|
|
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
|
|
|
|
|
2019-11-05 13:34:48 +00:00
|
|
|
* Tue Nov 05 2019 Marek Tamaskovic <mtamasko@redhat.com> - 0.9-3
|
|
|
|
- Updated fapolicyd-selinux subpackage to v0.2
|
|
|
|
Selinux subpackage is recommended for fapolicyd.
|
|
|
|
|
2019-10-07 12:46:26 +00:00
|
|
|
* Mon Oct 07 2019 Radovan Sroka <rsroka@redhat.com> - 0.9-2
|
|
|
|
- Added fapolicyd-selinux subpackage
|
|
|
|
|
2019-10-07 11:40:06 +00:00
|
|
|
* Mon Oct 07 2019 Radovan Sroka <rsroka@redhat.com> - 0.9-1
|
|
|
|
- rebase to v0.9
|
|
|
|
|
2019-10-03 11:53:07 +00:00
|
|
|
* Thu Oct 03 2019 Miro Hrončok <mhroncok@redhat.com> - 0.8.10-2
|
|
|
|
- Rebuilt for Python 3.8.0rc1 (#1748018)
|
|
|
|
|
2019-08-30 11:05:25 +00:00
|
|
|
* Wed Aug 28 2019 Radovan Sroka <rsroka@redhat.com> - 0.8.10-1
|
|
|
|
- rebase to 0.8.10
|
|
|
|
- generate python paths dynamically
|
|
|
|
|
2019-08-19 08:13:42 +00:00
|
|
|
* Mon Aug 19 2019 Miro Hrončok <mhroncok@redhat.com> - 0.8.9-5
|
|
|
|
- Rebuilt for Python 3.8
|
|
|
|
|
2019-07-25 00:11:34 +00:00
|
|
|
* Thu Jul 25 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.8.9-4
|
|
|
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
|
|
|
|
|
2019-06-10 22:13:18 +00:00
|
|
|
* Mon Jun 10 22:13:18 CET 2019 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 0.8.9-3
|
|
|
|
- Rebuild for RPM 4.15
|
|
|
|
|
2019-06-10 15:42:01 +00:00
|
|
|
* Mon Jun 10 15:42:01 CET 2019 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 0.8.9-2
|
|
|
|
- Rebuild for RPM 4.15
|
|
|
|
|
2019-05-06 10:25:23 +00:00
|
|
|
* Mon May 06 2019 Radovan Sroka <rsroka@redhat.com> - 0.8.9-1
|
|
|
|
- New upstream release
|
|
|
|
|
2019-03-13 23:09:43 +00:00
|
|
|
* Wed Mar 13 2019 Radovan Sroka <rsroka@redhat.com> - 0.8.8-2
|
|
|
|
- backport some patches to resolve dac_override for fapolicyd
|
|
|
|
|
2019-03-11 11:07:44 +00:00
|
|
|
* Mon Mar 11 2019 Radovan Sroka <rsroka@redhat.com> - 0.8.8-1
|
|
|
|
- New upstream release
|
|
|
|
- Added new DNF plugin that can update the trust database when rpms are installed
|
|
|
|
- Added support for FAN_OPEN_EXEC_PERM
|
|
|
|
|
2019-01-31 19:20:00 +00:00
|
|
|
* Thu Jan 31 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.8.7-3
|
|
|
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
|
|
|
|
|
2019-03-11 11:07:44 +00:00
|
|
|
|
2018-10-03 22:24:56 +00:00
|
|
|
* Wed Oct 03 2018 Steve Grubb <sgrubb@redhat.com> 0.8.7-1
|
|
|
|
- New upstream bugfix release
|
|
|
|
|
2018-07-13 00:19:30 +00:00
|
|
|
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.8.6-2
|
|
|
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
|
|
|
|
|
2018-06-07 13:01:29 +00:00
|
|
|
* Thu Jun 07 2018 Steve Grubb <sgrubb@redhat.com> 0.8.6-1
|
|
|
|
- New upstream feature release
|
|
|
|
|
2018-06-07 13:23:30 +00:00
|
|
|
* Fri May 18 2018 Steve Grubb <sgrubb@redhat.com> 0.8.5-2
|
2018-05-17 13:28:52 +00:00
|
|
|
- Add dist tag (#1579362)
|
|
|
|
|
2018-02-16 18:58:12 +00:00
|
|
|
* Fri Feb 16 2018 Steve Grubb <sgrubb@redhat.com> 0.8.5-1
|
|
|
|
- New release
|