2008-03-28 15:45:19 +01:00
|
|
|
#
|
2011-02-21 14:53:49 +01:00
|
|
|
# spec file for package audit-secondary
|
2008-03-28 15:45:19 +01:00
|
|
|
#
|
2013-01-22 15:09:24 +01:00
|
|
|
# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany.
|
2008-03-28 15:45:19 +01:00
|
|
|
#
|
2008-08-06 01:41:00 +02:00
|
|
|
# All modifications and additions to the file contributed by third parties
|
|
|
|
# remain the property of their copyright owners, unless otherwise agreed
|
|
|
|
# upon. The license for this file, and modifications and additions to the
|
|
|
|
# file, is the same license as for the pristine package itself (unless the
|
|
|
|
# license for the pristine package is not an Open Source License, in which
|
|
|
|
# case the license is the MIT License). An "Open Source License" is a
|
|
|
|
# license that conforms to the Open Source Definition (Version 1.9)
|
|
|
|
# published by the Open Source Initiative.
|
|
|
|
|
2008-03-28 15:45:19 +01:00
|
|
|
# Please submit bugfixes or comments via http://bugs.opensuse.org/
|
|
|
|
#
|
|
|
|
|
2012-02-29 19:06:19 +01:00
|
|
|
|
2013-06-28 10:51:36 +02:00
|
|
|
# This package contains all audit functionality except for audit-libs.
|
|
|
|
# The seperation is required to minimize unnecessary build cycles.
|
|
|
|
|
|
|
|
%define _name audit
|
2008-03-28 15:45:19 +01:00
|
|
|
|
|
|
|
Name: audit-secondary
|
2012-02-29 19:06:19 +01:00
|
|
|
BuildRequires: gcc-c++
|
|
|
|
BuildRequires: openldap2-devel
|
|
|
|
BuildRequires: pkg-config
|
|
|
|
BuildRequires: python-devel
|
|
|
|
BuildRequires: swig
|
2013-06-28 10:51:36 +02:00
|
|
|
Summary: Secondary packages for audit
|
2012-02-29 19:06:19 +01:00
|
|
|
License: GPL-2.0+
|
2008-03-28 15:45:19 +01:00
|
|
|
Group: System/Monitoring
|
2013-12-03 23:28:29 +01:00
|
|
|
Version: 2.3.2
|
2012-02-29 19:06:19 +01:00
|
|
|
Release: 0
|
2008-03-28 15:45:19 +01:00
|
|
|
Url: http://people.redhat.com/sgrubb/audit/
|
2012-10-12 15:06:39 +02:00
|
|
|
Source0: http://people.redhat.com/sgrubb/audit/%{_name}-%{version}.tar.gz
|
2008-06-25 18:53:54 +02:00
|
|
|
Patch1: audit-plugins-path.patch
|
2013-06-28 10:51:36 +02:00
|
|
|
Patch2: audit-no-gss.patch
|
|
|
|
Patch3: audit-no_m4_dir.patch
|
2013-12-03 23:28:29 +01:00
|
|
|
Patch4: audit-allow-manual-stop.patch
|
2008-03-28 15:45:19 +01:00
|
|
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
2010-05-05 20:41:24 +02:00
|
|
|
BuildRequires: audit-devel = %{version}
|
2013-01-22 15:09:24 +01:00
|
|
|
BuildRequires: autoconf >= 2.12
|
2013-06-28 10:51:36 +02:00
|
|
|
BuildRequires: gcc-c++
|
|
|
|
BuildRequires: kernel-headers >= 2.6.30
|
2011-10-02 17:39:13 +02:00
|
|
|
BuildRequires: libtool
|
2013-06-28 10:51:36 +02:00
|
|
|
BuildRequires: systemd-rpm-macros
|
|
|
|
BuildRequires: tcpd-devel
|
2013-03-26 09:57:41 +01:00
|
|
|
BuildRequires: pkgconfig(libcap-ng)
|
2008-03-28 15:45:19 +01:00
|
|
|
|
|
|
|
%description
|
2013-06-28 10:51:36 +02:00
|
|
|
Secondary packages for system auditing.
|
|
|
|
|
|
|
|
%package -n audit
|
|
|
|
Summary: User Space Tools for 2.6 Kernel Auditing
|
|
|
|
License: LGPL-2.1+
|
|
|
|
Group: System/Monitoring
|
|
|
|
Requires: %{_name}-libs = %{version}
|
|
|
|
|
|
|
|
%description -n audit
|
|
|
|
The audit package contains the user space utilities for storing and
|
|
|
|
processing the audit records generated by the audit subsystem in the
|
|
|
|
Linux 2.6 kernel.
|
2008-03-28 15:45:19 +01:00
|
|
|
|
|
|
|
%package -n audit-libs-python
|
|
|
|
Summary: Python Bindings for libaudit
|
2012-02-29 19:06:19 +01:00
|
|
|
License: LGPL-2.1+
|
2008-03-28 15:45:19 +01:00
|
|
|
Group: System/Monitoring
|
2008-04-20 15:23:11 +02:00
|
|
|
%py_requires
|
2008-03-28 15:45:19 +01:00
|
|
|
|
|
|
|
%description -n audit-libs-python
|
|
|
|
The audit-libs-python package contains the bindings for using libaudit
|
|
|
|
by python.
|
|
|
|
|
|
|
|
%package -n audit-audispd-plugins
|
|
|
|
Summary: Default plugins for the audit dispatcher
|
2012-02-29 19:06:19 +01:00
|
|
|
License: GPL-2.0+
|
2008-03-28 15:45:19 +01:00
|
|
|
Group: System/Monitoring
|
|
|
|
Requires: openldap2
|
|
|
|
|
|
|
|
%description -n audit-audispd-plugins
|
|
|
|
The audit-audispd-plugins package contains plugin components for the
|
|
|
|
audit dispatcher (audispd).
|
|
|
|
|
|
|
|
%prep
|
|
|
|
# remove selinux policy
|
|
|
|
rm -rf audisp/plugins/zos-remote/policy
|
|
|
|
# we don't build prelude
|
|
|
|
rm -rf audisp/plugins/prelude
|
2010-05-05 20:41:24 +02:00
|
|
|
%setup -q -n %{_name}-%{version}
|
2008-06-25 18:53:54 +02:00
|
|
|
%patch1 -p1
|
2013-06-28 10:51:36 +02:00
|
|
|
%patch2 -p1
|
|
|
|
%patch3 -p1
|
|
|
|
%patch4 -p1
|
2008-03-28 15:45:19 +01:00
|
|
|
|
|
|
|
%build
|
|
|
|
autoreconf -fi
|
|
|
|
export CFLAGS="%{optflags} -fno-strict-aliasing"
|
|
|
|
export CXXFLAGS="$CFLAGS"
|
2013-06-28 10:51:36 +02:00
|
|
|
export LDFLAGS="-Wl,-z,relro,-z,now"
|
|
|
|
# no krb support (omit --enable-gssapi-krb5=yes), see audit-no-gss.patch
|
|
|
|
%configure --sbindir=/sbin --enable-systemd \
|
|
|
|
--libexecdir=%{_prefix}/lib/%{_name} \
|
|
|
|
--with-apparmor --with-libwrap --with-libcap-ng=yes \
|
2010-05-05 20:41:24 +02:00
|
|
|
--disable-static --with-pic
|
2010-07-30 12:34:44 +02:00
|
|
|
%{__make} %{?_smp_mflags}
|
2008-03-28 15:45:19 +01:00
|
|
|
|
|
|
|
%install
|
2013-12-03 23:28:29 +01:00
|
|
|
mkdir -p $RPM_BUILD_ROOT/{sbin,etc/{audispd/plugins.d,init.d}}
|
2013-06-28 10:51:36 +02:00
|
|
|
mkdir -p $RPM_BUILD_ROOT/usr/sbin
|
2008-03-28 15:45:19 +01:00
|
|
|
mkdir -p $RPM_BUILD_ROOT/%{_mandir}/{man5,man8}
|
2013-06-28 10:51:36 +02:00
|
|
|
make DESTDIR=$RPM_BUILD_ROOT install
|
|
|
|
|
|
|
|
mkdir -p $RPM_BUILD_ROOT/var/log/audit/
|
|
|
|
touch $RPM_BUILD_ROOT/var/log/audit/audit.log
|
|
|
|
mkdir -p $RPM_BUILD_ROOT/var/spool/audit/
|
|
|
|
# For ghost below, so that old location files will still be there when
|
|
|
|
# post copy runs
|
2013-12-03 23:28:29 +01:00
|
|
|
touch $RPM_BUILD_ROOT/etc/{auditd.conf,audit.rules} $RPM_BUILD_ROOT/etc/audit/auditd.conf
|
2013-06-28 10:51:36 +02:00
|
|
|
# On platforms with 32 & 64 bit libs, we need to coordinate the timestamp
|
|
|
|
touch -r ./audit.spec $RPM_BUILD_ROOT/etc/libaudit.conf
|
|
|
|
|
|
|
|
# delete redhat scripts, use ours
|
|
|
|
rm -rf $RPM_BUILD_ROOT/etc/sysconfig/auditd
|
|
|
|
rm -rf $RPM_BUILD_ROOT/etc/init.d/auditd
|
|
|
|
rm -rf $RPM_BUILD_ROOT/etc/rc.d/init.d
|
2013-12-03 23:28:29 +01:00
|
|
|
# delete redhat systemd legacy scripts, our systemd doesn't support the feature
|
|
|
|
# https://lists.fedoraproject.org/pipermail/devel/2012-June/169411.html
|
|
|
|
rm -rf $RPM_BUILD_ROOT/usr/lib/audit
|
2008-03-28 15:45:19 +01:00
|
|
|
# Clean up some unneeded library files
|
|
|
|
rm -f $RPM_BUILD_ROOT/%{_libdir}/python%{py_ver}/site-packages/_audit.a
|
|
|
|
rm -f $RPM_BUILD_ROOT/%{_libdir}/python%{py_ver}/site-packages/_audit.la
|
2008-09-29 17:28:30 +02:00
|
|
|
rm -f $RPM_BUILD_ROOT/%{_libdir}/python%{py_ver}/site-packages/_auparse.a
|
|
|
|
rm -f $RPM_BUILD_ROOT/%{_libdir}/python%{py_ver}/site-packages/_auparse.la
|
|
|
|
rm -f $RPM_BUILD_ROOT/%{_libdir}/python%{py_ver}/site-packages/auparse.a
|
|
|
|
rm -f $RPM_BUILD_ROOT/%{_libdir}/python%{py_ver}/site-packages/auparse.la
|
2008-03-28 15:45:19 +01:00
|
|
|
rm -f $RPM_BUILD_ROOT/%{_libdir}/python%{py_ver}/site-packages/auparse-1.0-py%{py_ver}.egg-info
|
2013-06-28 10:51:36 +02:00
|
|
|
# cleanup files handled by audit.spec
|
|
|
|
rm -rf $RPM_BUILD_ROOT/%{_includedir}
|
|
|
|
rm -f $RPM_BUILD_ROOT/%{_libdir}/lib{audit,auparse}.*
|
|
|
|
rm -f $RPM_BUILD_ROOT/etc/libaudit.conf
|
|
|
|
rm -f $RPM_BUILD_ROOT/%{_mandir}/man5/libaudit.conf.5
|
|
|
|
rm -rf $RPM_BUILD_ROOT/%{_mandir}/man3
|
2008-03-28 15:45:19 +01:00
|
|
|
# Cleanup plugins
|
|
|
|
# audispd-zos-remote uses ldap which is in /usr/lib so move to /usr/sbin
|
2008-06-25 18:53:54 +02:00
|
|
|
# audisp-remote shouldn't be in /sbin either, it's not 'essential'
|
|
|
|
mv $RPM_BUILD_ROOT/sbin/{audispd-zos-remote,audisp-remote} $RPM_BUILD_ROOT/usr/sbin
|
2013-06-28 10:51:36 +02:00
|
|
|
#USR-MERGE
|
2013-12-03 23:28:29 +01:00
|
|
|
for prog in auditctl auditd ausearch autrace audispd aureport augenrules; do
|
2013-06-28 10:51:36 +02:00
|
|
|
[ \! -f %{buildroot}/sbin/$prog ] || mv %{buildroot}/sbin/$prog %{buildroot}/usr/sbin/$prog
|
|
|
|
ln -s %{_prefix}/sbin/$prog %{buildroot}/sbin/$prog
|
|
|
|
done
|
|
|
|
#END-USR-MERGE
|
2013-10-03 13:03:22 +02:00
|
|
|
# rcauditd symlink
|
|
|
|
( cd $RPM_BUILD_ROOT/usr/sbin && ln -s service rcauditd )
|
2008-03-28 15:45:19 +01:00
|
|
|
|
2008-09-29 17:28:30 +02:00
|
|
|
%check
|
|
|
|
make check
|
|
|
|
|
2013-06-28 10:51:36 +02:00
|
|
|
%post -n audit
|
2013-12-03 23:28:29 +01:00
|
|
|
# Save existing audit files if any (from old locations)
|
2013-06-28 10:51:36 +02:00
|
|
|
if [ -f /etc/auditd.conf ]; then
|
|
|
|
mv /etc/audit/auditd.conf /etc/audit/auditd.conf.new
|
|
|
|
mv /etc/auditd.conf /etc/audit/auditd.conf
|
|
|
|
fi
|
|
|
|
if [ -f /etc/audit.rules ]; then
|
|
|
|
mv /etc/audit.rules /etc/audit/audit.rules
|
2013-12-04 08:41:29 +01:00
|
|
|
elif [ ! -f /etc/audit/audit.rules ]; then
|
2013-12-03 23:28:29 +01:00
|
|
|
cp /etc/audit/rules.d/audit.rules /etc/audit/audit.rules
|
2013-06-28 10:51:36 +02:00
|
|
|
fi
|
|
|
|
%service_add_post auditd.service
|
|
|
|
|
|
|
|
%pre -n audit
|
|
|
|
%service_add_pre auditd.service
|
|
|
|
|
|
|
|
%preun -n audit
|
|
|
|
%service_del_preun auditd.service
|
|
|
|
|
|
|
|
%postun -n audit
|
|
|
|
%service_del_postun auditd.service
|
|
|
|
|
|
|
|
%files -n audit
|
|
|
|
%defattr(-,root,root,-)
|
|
|
|
%doc README COPYING ChangeLog contrib/capp.rules contrib/nispom.rules contrib/lspp.rules contrib/stig.rules init.d/auditd.cron
|
|
|
|
%attr(644,root,root) %{_mandir}/man8/audispd.8.gz
|
|
|
|
%attr(644,root,root) %{_mandir}/man8/auditctl.8.gz
|
|
|
|
%attr(644,root,root) %{_mandir}/man8/auditd.8.gz
|
|
|
|
%attr(644,root,root) %{_mandir}/man8/aureport.8.gz
|
|
|
|
%attr(644,root,root) %{_mandir}/man8/ausearch.8.gz
|
|
|
|
%attr(644,root,root) %{_mandir}/man8/autrace.8.gz
|
|
|
|
%attr(644,root,root) %{_mandir}/man8/aulast.8.gz
|
|
|
|
%attr(644,root,root) %{_mandir}/man8/aulastlog.8.gz
|
|
|
|
%attr(644,root,root) %{_mandir}/man8/ausyscall.8.gz
|
|
|
|
%attr(644,root,root) %{_mandir}/man7/audit.rules.7.gz
|
|
|
|
%attr(644,root,root) %{_mandir}/man5/auditd.conf.5.gz
|
|
|
|
%attr(644,root,root) %{_mandir}/man5/audispd.conf.5.gz
|
|
|
|
%attr(644,root,root) %{_mandir}/man5/ausearch-expression.5.gz
|
|
|
|
%attr(644,root,root) %{_mandir}/man8/auvirt.8.gz
|
2013-12-03 23:28:29 +01:00
|
|
|
%attr(644,root,root) %{_mandir}/man8/augenrules.8.gz
|
|
|
|
/sbin/auditctl
|
2013-06-28 10:51:36 +02:00
|
|
|
%attr(750,root,root) /usr/sbin/auditctl
|
2013-12-03 23:28:29 +01:00
|
|
|
/sbin/auditd
|
2013-06-28 10:51:36 +02:00
|
|
|
%attr(750,root,root) /usr/sbin/auditd
|
2013-12-03 23:28:29 +01:00
|
|
|
/sbin/ausearch
|
2013-06-28 10:51:36 +02:00
|
|
|
%attr(755,root,root) /usr/sbin/ausearch
|
2013-12-03 23:28:29 +01:00
|
|
|
/sbin/autrace
|
2013-06-28 10:51:36 +02:00
|
|
|
%attr(750,root,root) /usr/sbin/autrace
|
2013-12-03 23:28:29 +01:00
|
|
|
/sbin/audispd
|
|
|
|
%attr(750,root,root) /usr/sbin/augenrules
|
|
|
|
/sbin/augenrules
|
2013-06-28 10:51:36 +02:00
|
|
|
%attr(750,root,root) /usr/sbin/audispd
|
|
|
|
%attr(755,root,root) /usr/bin/aulast
|
|
|
|
%attr(755,root,root) /usr/bin/aulastlog
|
|
|
|
%attr(755,root,root) /usr/bin/ausyscall
|
2013-12-03 23:28:29 +01:00
|
|
|
/sbin/aureport
|
2013-06-28 10:51:36 +02:00
|
|
|
%attr(755,root,root) /usr/sbin/aureport
|
|
|
|
%attr(755,root,root) /usr/bin/auvirt
|
|
|
|
%dir %attr(750,root,root) /etc/audit
|
|
|
|
%attr(750,root,root) %dir /etc/audisp
|
|
|
|
%attr(750,root,root) %dir /etc/audisp/plugins.d
|
|
|
|
%config(noreplace) %attr(640,root,root) /etc/audisp/plugins.d/af_unix.conf
|
|
|
|
%config(noreplace) %attr(640,root,root) /etc/audisp/plugins.d/syslog.conf
|
|
|
|
%ghost /etc/auditd.conf
|
|
|
|
%ghost /etc/audit.rules
|
2013-12-04 08:41:29 +01:00
|
|
|
%config(noreplace) %attr(640,root,root) /etc/audit/auditd.conf
|
2013-12-03 23:28:29 +01:00
|
|
|
%dir %attr(750,root,root) /etc/audit/rules.d
|
|
|
|
%config %attr(640,root,root) /etc/audit/rules.d/audit.rules
|
2013-06-28 10:51:36 +02:00
|
|
|
%config(noreplace) %attr(640,root,root) /etc/audisp/audispd.conf
|
|
|
|
%dir %attr(700,root,root) /var/log/audit
|
|
|
|
%ghost %config(noreplace) /var/log/audit/audit.log
|
|
|
|
%dir %attr(700,root,root) /var/spool/audit
|
|
|
|
%{_unitdir}/auditd.service
|
2013-10-03 13:03:22 +02:00
|
|
|
/usr/sbin/rcauditd
|
2013-06-28 10:51:36 +02:00
|
|
|
|
2008-03-28 15:45:19 +01:00
|
|
|
%files -n audit-libs-python
|
|
|
|
%defattr(-,root,root,-)
|
2008-06-25 18:53:54 +02:00
|
|
|
%attr(755,root,root) %{_libdir}/python%{py_ver}/site-packages/_audit.so
|
|
|
|
%attr(755,root,root) %{_libdir}/python%{py_ver}/site-packages/auparse.so
|
2008-03-28 15:45:19 +01:00
|
|
|
%{_libdir}/python%{py_ver}/site-packages/audit.py*
|
|
|
|
|
|
|
|
%files -n audit-audispd-plugins
|
|
|
|
%defattr(-,root,root,-)
|
|
|
|
%attr(644,root,root) %{_mandir}/man8/audispd-zos-remote.8.gz
|
|
|
|
%attr(644,root,root) %{_mandir}/man5/zos-remote.conf.5.gz
|
2013-06-28 10:51:36 +02:00
|
|
|
%attr(644,root,root) %{_mandir}/man5/audisp-remote.conf.5.gz
|
|
|
|
%attr(644,root,root) %{_mandir}/man8/audisp-remote.8.gz
|
2010-05-05 20:41:24 +02:00
|
|
|
%attr(750,root,root) %dir /etc/audisp
|
|
|
|
%attr(750,root,root) %dir /etc/audisp/plugins.d
|
2008-03-28 15:45:19 +01:00
|
|
|
%config(noreplace) %attr(640,root,root) /etc/audisp/plugins.d/audispd-zos-remote.conf
|
|
|
|
%config(noreplace) %attr(640,root,root) /etc/audisp/zos-remote.conf
|
2013-06-28 10:51:36 +02:00
|
|
|
%attr(750,root,root) /usr/sbin/audisp-remote
|
2008-03-28 15:45:19 +01:00
|
|
|
%attr(750,root,root) /usr/sbin/audispd-zos-remote
|
2008-06-25 18:53:54 +02:00
|
|
|
%config(noreplace) %attr(640,root,root) /etc/audisp/audisp-remote.conf
|
|
|
|
%config(noreplace) %attr(640,root,root) /etc/audisp/plugins.d/au-remote.conf
|
2008-03-28 15:45:19 +01:00
|
|
|
|
|
|
|
%changelog
|