blob: 347c855063e8937ec222d562711a30fc2e42b187 [file] [log] [blame]
William A. Kennington IIIb95905d2021-06-02 12:40:56 -07001SUMMARY = "User space tools for kernel auditing"
2DESCRIPTION = "The audit package contains the user space utilities for \
3storing and searching the audit records generated by the audit subsystem \
4in the Linux kernel."
5HOMEPAGE = "http://people.redhat.com/sgrubb/audit/"
6SECTION = "base"
Andrew Geissler9aee5002022-03-30 16:27:02 +00007LICENSE = "GPL-2.0-or-later & LGPL-2.0-or-later"
William A. Kennington IIIb95905d2021-06-02 12:40:56 -07008LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f"
9
Andrew Geissler595f6302022-01-24 19:11:47 +000010SRC_URI = "git://github.com/linux-audit/${BPN}-userspace.git;branch=2.8_maintenance;protocol=https \
Patrick Williams213cb262021-08-07 19:21:33 -050011 file://0001-Add-substitue-functions-for-strndupa-rawmemchr.patch \
12 file://0002-Fixed-swig-host-contamination-issue.patch \
13 file://0003-Header-definitions-need-to-be-external-when-building.patch \
William A. Kennington IIIb95905d2021-06-02 12:40:56 -070014 file://auditd \
15 file://auditd.service \
16 file://audit-volatile.conf \
17"
18
19S = "${WORKDIR}/git"
20SRCREV = "5fae55c1ad15b3cefe6890eba7311af163e9133c"
21
22inherit autotools python3native update-rc.d systemd
23
24UPDATERCPN = "auditd"
25INITSCRIPT_NAME = "auditd"
26INITSCRIPT_PARAMS = "defaults"
27
28SYSTEMD_PACKAGES = "auditd"
Patrick Williams213cb262021-08-07 19:21:33 -050029SYSTEMD_SERVICE:auditd = "auditd.service"
William A. Kennington IIIb95905d2021-06-02 12:40:56 -070030
Patrick Williams213cb262021-08-07 19:21:33 -050031DEPENDS = "python3 tcp-wrappers libcap-ng linux-libc-headers swig-native"
William A. Kennington IIIb95905d2021-06-02 12:40:56 -070032
Patrick Williams213cb262021-08-07 19:21:33 -050033EXTRA_OECONF = "--without-prelude \
William A. Kennington IIIb95905d2021-06-02 12:40:56 -070034 --with-libwrap \
35 --enable-gssapi-krb5=no \
36 --with-libcap-ng=yes \
37 --with-python3=yes \
38 --libdir=${base_libdir} \
39 --sbindir=${base_sbindir} \
40 --without-python \
41 --without-golang \
42 --disable-zos-remote \
Patrick Williams213cb262021-08-07 19:21:33 -050043 --with-arm=yes \
44 --with-aarch64=yes \
William A. Kennington IIIb95905d2021-06-02 12:40:56 -070045 "
William A. Kennington IIIb95905d2021-06-02 12:40:56 -070046
Patrick Williams213cb262021-08-07 19:21:33 -050047EXTRA_OEMAKE = "PYLIBVER='python${PYTHON_BASEVERSION}' \
William A. Kennington IIIb95905d2021-06-02 12:40:56 -070048 PYINC='${STAGING_INCDIR}/$(PYLIBVER)' \
49 pyexecdir=${libdir}/python${PYTHON_BASEVERSION}/site-packages \
50 STDINC='${STAGING_INCDIR}' \
51 pkgconfigdir=${libdir}/pkgconfig \
52 "
53
Patrick Williams213cb262021-08-07 19:21:33 -050054SUMMARY:audispd-plugins = "Plugins for the audit event dispatcher"
55DESCRIPTION:audispd-plugins = "The audispd-plugins package provides plugins for the real-time \
William A. Kennington IIIb95905d2021-06-02 12:40:56 -070056interface to the audit system, audispd. These plugins can do things \
57like relay events to remote machines or analyze events for suspicious \
58behavior."
59
60PACKAGES =+ "audispd-plugins"
61PACKAGES += "auditd ${PN}-python"
62
Patrick Williams213cb262021-08-07 19:21:33 -050063FILES:${PN} = "${sysconfdir}/libaudit.conf ${base_libdir}/libaudit.so.1* ${base_libdir}/libauparse.so.*"
64FILES:auditd = "${bindir}/* ${base_sbindir}/* ${sysconfdir}/*"
65FILES:audispd-plugins = "${sysconfdir}/audisp/audisp-remote.conf \
William A. Kennington IIIb95905d2021-06-02 12:40:56 -070066 ${sysconfdir}/audisp/plugins.d/au-remote.conf \
Patrick Williams213cb262021-08-07 19:21:33 -050067 ${base_sbindir}/audisp-remote ${localstatedir}/spool/audit \
William A. Kennington IIIb95905d2021-06-02 12:40:56 -070068 "
Patrick Williams213cb262021-08-07 19:21:33 -050069FILES:${PN}-dbg += "${libdir}/python${PYTHON_BASEVERSION}/*/.debug"
70FILES:${PN}-python = "${libdir}/python${PYTHON_BASEVERSION}"
William A. Kennington IIIb95905d2021-06-02 12:40:56 -070071
Patrick Williams213cb262021-08-07 19:21:33 -050072CONFFILES:auditd = "${sysconfdir}/audit/audit.rules"
73RDEPENDS:auditd = "bash"
William A. Kennington IIIb95905d2021-06-02 12:40:56 -070074
Patrick Williams213cb262021-08-07 19:21:33 -050075do_install:append() {
William A. Kennington IIIb95905d2021-06-02 12:40:56 -070076 rm -f ${D}/${libdir}/python${PYTHON_BASEVERSION}/site-packages/*.a
77 rm -f ${D}/${libdir}/python${PYTHON_BASEVERSION}/site-packages/*.la
78
79 # reuse auditd config
80 [ ! -e ${D}/etc/default ] && mkdir ${D}/etc/default
81 mv ${D}/etc/sysconfig/auditd ${D}/etc/default
82 rmdir ${D}/etc/sysconfig/
83
84 # replace init.d
85 install -D -m 0755 ${WORKDIR}/auditd ${D}/etc/init.d/auditd
86 rm -rf ${D}/etc/rc.d
87
88 if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
Patrick Williams213cb262021-08-07 19:21:33 -050089 # install systemd unit files
90 install -d ${D}${systemd_unitdir}/system
91 install -m 0644 ${WORKDIR}/auditd.service ${D}${systemd_unitdir}/system
92
William A. Kennington IIIb95905d2021-06-02 12:40:56 -070093 install -d ${D}${sysconfdir}/tmpfiles.d/
94 install -m 0644 ${WORKDIR}/audit-volatile.conf ${D}${sysconfdir}/tmpfiles.d/
95 fi
96
William A. Kennington IIIb95905d2021-06-02 12:40:56 -070097 # audit-2.5 doesn't install any rules by default, so we do that here
98 mkdir -p ${D}/etc/audit ${D}/etc/audit/rules.d
99 cp ${S}/rules/10-base-config.rules ${D}/etc/audit/rules.d/audit.rules
100
101 chmod 750 ${D}/etc/audit ${D}/etc/audit/rules.d
102 chmod 640 ${D}/etc/audit/auditd.conf ${D}/etc/audit/rules.d/audit.rules
103
104 # Based on the audit.spec "Copy default rules into place on new installation"
105 cp ${D}/etc/audit/rules.d/audit.rules ${D}/etc/audit/audit.rules
Patrick Williams213cb262021-08-07 19:21:33 -0500106
107 # Create /var/spool/audit directory for audisp-remote
108 install -m 0700 -d ${D}${localstatedir}/spool/audit
William A. Kennington IIIb95905d2021-06-02 12:40:56 -0700109}