William A. Kennington III | b95905d | 2021-06-02 12:40:56 -0700 | [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" |
| 7 | LICENSE = "GPLv2+ & LGPLv2+" |
| 8 | LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f" |
| 9 | |
| 10 | SRC_URI = "git://github.com/linux-audit/${BPN}-userspace.git;branch=2.8_maintenance \ |
| 11 | file://Add-substitue-functions-for-strndupa-rawmemchr.patch \ |
| 12 | file://Fixed-swig-host-contamination-issue.patch \ |
| 13 | file://auditd \ |
| 14 | file://auditd.service \ |
| 15 | file://audit-volatile.conf \ |
| 16 | " |
| 17 | |
| 18 | S = "${WORKDIR}/git" |
| 19 | SRCREV = "5fae55c1ad15b3cefe6890eba7311af163e9133c" |
| 20 | |
| 21 | inherit autotools python3native update-rc.d systemd |
| 22 | |
| 23 | UPDATERCPN = "auditd" |
| 24 | INITSCRIPT_NAME = "auditd" |
| 25 | INITSCRIPT_PARAMS = "defaults" |
| 26 | |
| 27 | SYSTEMD_PACKAGES = "auditd" |
| 28 | SYSTEMD_SERVICE_auditd = "auditd.service" |
| 29 | |
| 30 | DEPENDS += "python3 tcp-wrappers libcap-ng linux-libc-headers swig-native" |
| 31 | |
| 32 | EXTRA_OECONF += "--without-prelude \ |
| 33 | --with-libwrap \ |
| 34 | --enable-gssapi-krb5=no \ |
| 35 | --with-libcap-ng=yes \ |
| 36 | --with-python3=yes \ |
| 37 | --libdir=${base_libdir} \ |
| 38 | --sbindir=${base_sbindir} \ |
| 39 | --without-python \ |
| 40 | --without-golang \ |
| 41 | --disable-zos-remote \ |
| 42 | " |
| 43 | EXTRA_OECONF_append_arm = " --with-arm=yes" |
| 44 | EXTRA_OECONF_append_aarch64 = " --with-aarch64=yes" |
| 45 | |
| 46 | EXTRA_OEMAKE += "PYLIBVER='python${PYTHON_BASEVERSION}' \ |
| 47 | PYINC='${STAGING_INCDIR}/$(PYLIBVER)' \ |
| 48 | pyexecdir=${libdir}/python${PYTHON_BASEVERSION}/site-packages \ |
| 49 | STDINC='${STAGING_INCDIR}' \ |
| 50 | pkgconfigdir=${libdir}/pkgconfig \ |
| 51 | " |
| 52 | |
| 53 | SUMMARY_audispd-plugins = "Plugins for the audit event dispatcher" |
| 54 | DESCRIPTION_audispd-plugins = "The audispd-plugins package provides plugins for the real-time \ |
| 55 | interface to the audit system, audispd. These plugins can do things \ |
| 56 | like relay events to remote machines or analyze events for suspicious \ |
| 57 | behavior." |
| 58 | |
| 59 | PACKAGES =+ "audispd-plugins" |
| 60 | PACKAGES += "auditd ${PN}-python" |
| 61 | |
| 62 | FILES_${PN} = "${sysconfdir}/libaudit.conf ${base_libdir}/libaudit.so.1* ${base_libdir}/libauparse.so.*" |
| 63 | FILES_auditd += "${bindir}/* ${base_sbindir}/* ${sysconfdir}/*" |
| 64 | FILES_audispd-plugins += "${sysconfdir}/audisp/audisp-remote.conf \ |
| 65 | ${sysconfdir}/audisp/plugins.d/au-remote.conf \ |
| 66 | ${sbindir}/audisp-remote ${localstatedir}/spool/audit \ |
| 67 | " |
| 68 | FILES_${PN}-dbg += "${libdir}/python${PYTHON_BASEVERSION}/*/.debug" |
| 69 | FILES_${PN}-python = "${libdir}/python${PYTHON_BASEVERSION}" |
| 70 | |
| 71 | CONFFILES_auditd += "${sysconfdir}/audit/audit.rules" |
| 72 | RDEPENDS_auditd += "bash" |
| 73 | |
| 74 | do_install_append() { |
| 75 | rm -f ${D}/${libdir}/python${PYTHON_BASEVERSION}/site-packages/*.a |
| 76 | rm -f ${D}/${libdir}/python${PYTHON_BASEVERSION}/site-packages/*.la |
| 77 | |
| 78 | # reuse auditd config |
| 79 | [ ! -e ${D}/etc/default ] && mkdir ${D}/etc/default |
| 80 | mv ${D}/etc/sysconfig/auditd ${D}/etc/default |
| 81 | rmdir ${D}/etc/sysconfig/ |
| 82 | |
| 83 | # replace init.d |
| 84 | install -D -m 0755 ${WORKDIR}/auditd ${D}/etc/init.d/auditd |
| 85 | rm -rf ${D}/etc/rc.d |
| 86 | |
| 87 | if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then |
| 88 | install -d ${D}${sysconfdir}/tmpfiles.d/ |
| 89 | install -m 0644 ${WORKDIR}/audit-volatile.conf ${D}${sysconfdir}/tmpfiles.d/ |
| 90 | fi |
| 91 | |
| 92 | # install systemd unit files |
| 93 | install -d ${D}${systemd_unitdir}/system |
| 94 | install -m 0644 ${WORKDIR}/auditd.service ${D}${systemd_unitdir}/system |
| 95 | |
| 96 | # audit-2.5 doesn't install any rules by default, so we do that here |
| 97 | mkdir -p ${D}/etc/audit ${D}/etc/audit/rules.d |
| 98 | cp ${S}/rules/10-base-config.rules ${D}/etc/audit/rules.d/audit.rules |
| 99 | |
| 100 | chmod 750 ${D}/etc/audit ${D}/etc/audit/rules.d |
| 101 | chmod 640 ${D}/etc/audit/auditd.conf ${D}/etc/audit/rules.d/audit.rules |
| 102 | |
| 103 | # Based on the audit.spec "Copy default rules into place on new installation" |
| 104 | cp ${D}/etc/audit/rules.d/audit.rules ${D}/etc/audit/audit.rules |
| 105 | } |