Andrew Geissler | eff2747 | 2021-10-29 15:35:00 -0500 | [diff] [blame] | 1 | SUMMARY = "User space tools for kernel auditing" |
| 2 | DESCRIPTION = "The audit package contains the user space utilities for \ |
| 3 | storing and searching the audit records generated by the audit subsystem \ |
| 4 | in the Linux kernel." |
| 5 | HOMEPAGE = "http://people.redhat.com/sgrubb/audit/" |
| 6 | SECTION = "base" |
Andrew Geissler | 9aee500 | 2022-03-30 16:27:02 +0000 | [diff] [blame] | 7 | LICENSE = "GPL-2.0-or-later & LGPL-2.0-or-later" |
Andrew Geissler | eff2747 | 2021-10-29 15:35:00 -0500 | [diff] [blame] | 8 | LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f" |
| 9 | |
Andrew Geissler | 595f630 | 2022-01-24 19:11:47 +0000 | [diff] [blame] | 10 | SRC_URI = "git://github.com/linux-audit/${BPN}-userspace.git;branch=master;protocol=https \ |
Andrew Geissler | eff2747 | 2021-10-29 15:35:00 -0500 | [diff] [blame] | 11 | file://Fixed-swig-host-contamination-issue.patch \ |
| 12 | file://auditd \ |
| 13 | file://auditd.service \ |
| 14 | file://audit-volatile.conf \ |
| 15 | " |
| 16 | |
| 17 | S = "${WORKDIR}/git" |
| 18 | SRCREV = "b1b2728ccd83eeb0dffe29c01a5c97e14e6a0d8a" |
| 19 | |
| 20 | inherit autotools python3native update-rc.d systemd |
| 21 | |
| 22 | UPDATERCPN = "auditd" |
| 23 | INITSCRIPT_NAME = "auditd" |
| 24 | INITSCRIPT_PARAMS = "defaults" |
| 25 | |
| 26 | SYSTEMD_PACKAGES = "auditd" |
| 27 | SYSTEMD_SERVICE:auditd = "auditd.service" |
| 28 | |
| 29 | DEPENDS = "python3 tcp-wrappers libcap-ng linux-libc-headers swig-native" |
| 30 | |
| 31 | EXTRA_OECONF = " --with-libwrap \ |
| 32 | --enable-gssapi-krb5=no \ |
| 33 | --with-libcap-ng=yes \ |
| 34 | --with-python3=yes \ |
| 35 | --libdir=${base_libdir} \ |
| 36 | --sbindir=${base_sbindir} \ |
| 37 | --without-python \ |
| 38 | --without-golang \ |
| 39 | --disable-zos-remote \ |
| 40 | --with-arm=yes \ |
| 41 | --with-aarch64=yes \ |
| 42 | " |
| 43 | |
| 44 | EXTRA_OEMAKE = "PYLIBVER='python${PYTHON_BASEVERSION}' \ |
| 45 | PYINC='${STAGING_INCDIR}/$(PYLIBVER)' \ |
| 46 | pyexecdir=${libdir}/python${PYTHON_BASEVERSION}/site-packages \ |
| 47 | STDINC='${STAGING_INCDIR}' \ |
| 48 | pkgconfigdir=${libdir}/pkgconfig \ |
| 49 | " |
| 50 | |
| 51 | SUMMARY:audispd-plugins = "Plugins for the audit event dispatcher" |
| 52 | DESCRIPTION:audispd-plugins = "The audispd-plugins package provides plugins for the real-time \ |
| 53 | interface to the audit system, audispd. These plugins can do things \ |
| 54 | like relay events to remote machines or analyze events for suspicious \ |
| 55 | behavior." |
| 56 | |
| 57 | PACKAGES =+ "audispd-plugins" |
| 58 | PACKAGES += "auditd ${PN}-python" |
| 59 | |
| 60 | FILES:${PN} = "${sysconfdir}/libaudit.conf ${base_libdir}/libaudit.so.1* ${base_libdir}/libauparse.so.*" |
| 61 | FILES:auditd = "${bindir}/* ${base_sbindir}/* ${sysconfdir}/* ${datadir}/audit/*" |
| 62 | FILES:audispd-plugins = "${sysconfdir}/audit/audisp-remote.conf \ |
| 63 | ${sysconfdir}/audit/plugins.d/au-remote.conf \ |
| 64 | ${sysconfdir}/audit/plugins.d/syslog.conf \ |
| 65 | ${base_sbindir}/audisp-remote \ |
| 66 | ${base_sbindir}/audisp-syslog \ |
| 67 | ${localstatedir}/spool/audit \ |
| 68 | " |
| 69 | FILES:${PN}-dbg += "${libdir}/python${PYTHON_BASEVERSION}/*/.debug" |
| 70 | FILES:${PN}-python = "${libdir}/python${PYTHON_BASEVERSION}" |
| 71 | |
| 72 | CONFFILES:auditd = "${sysconfdir}/audit/audit.rules" |
| 73 | RDEPENDS:auditd = "bash" |
| 74 | |
| 75 | do_install:append() { |
| 76 | 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 |
| 89 | # install systemd unit files |
| 90 | install -d ${D}${systemd_unitdir}/system |
| 91 | install -m 0644 ${WORKDIR}/auditd.service ${D}${systemd_unitdir}/system |
| 92 | |
| 93 | install -d ${D}${sysconfdir}/tmpfiles.d/ |
| 94 | install -m 0644 ${WORKDIR}/audit-volatile.conf ${D}${sysconfdir}/tmpfiles.d/ |
| 95 | fi |
| 96 | |
| 97 | # 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 |
| 106 | |
| 107 | # Create /var/spool/audit directory for audisp-remote |
| 108 | install -m 0700 -d ${D}${localstatedir}/spool/audit |
| 109 | } |