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" |
Andrew Geissler | 9aee500 | 2022-03-30 16:27:02 +0000 | [diff] [blame] | 7 | LICENSE = "GPL-2.0-or-later & LGPL-2.0-or-later" |
William A. Kennington III | b95905d | 2021-06-02 12:40:56 -0700 | [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=2.8_maintenance;protocol=https \ |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 11 | 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 III | b95905d | 2021-06-02 12:40:56 -0700 | [diff] [blame] | 14 | file://auditd \ |
| 15 | file://auditd.service \ |
| 16 | file://audit-volatile.conf \ |
| 17 | " |
| 18 | |
| 19 | S = "${WORKDIR}/git" |
| 20 | SRCREV = "5fae55c1ad15b3cefe6890eba7311af163e9133c" |
| 21 | |
| 22 | inherit autotools python3native update-rc.d systemd |
| 23 | |
| 24 | UPDATERCPN = "auditd" |
| 25 | INITSCRIPT_NAME = "auditd" |
| 26 | INITSCRIPT_PARAMS = "defaults" |
| 27 | |
| 28 | SYSTEMD_PACKAGES = "auditd" |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 29 | SYSTEMD_SERVICE:auditd = "auditd.service" |
William A. Kennington III | b95905d | 2021-06-02 12:40:56 -0700 | [diff] [blame] | 30 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 31 | DEPENDS = "python3 tcp-wrappers libcap-ng linux-libc-headers swig-native" |
William A. Kennington III | b95905d | 2021-06-02 12:40:56 -0700 | [diff] [blame] | 32 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 33 | EXTRA_OECONF = "--without-prelude \ |
William A. Kennington III | b95905d | 2021-06-02 12:40:56 -0700 | [diff] [blame] | 34 | --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 Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 43 | --with-arm=yes \ |
| 44 | --with-aarch64=yes \ |
William A. Kennington III | b95905d | 2021-06-02 12:40:56 -0700 | [diff] [blame] | 45 | " |
William A. Kennington III | b95905d | 2021-06-02 12:40:56 -0700 | [diff] [blame] | 46 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 47 | EXTRA_OEMAKE = "PYLIBVER='python${PYTHON_BASEVERSION}' \ |
William A. Kennington III | b95905d | 2021-06-02 12:40:56 -0700 | [diff] [blame] | 48 | PYINC='${STAGING_INCDIR}/$(PYLIBVER)' \ |
| 49 | pyexecdir=${libdir}/python${PYTHON_BASEVERSION}/site-packages \ |
| 50 | STDINC='${STAGING_INCDIR}' \ |
| 51 | pkgconfigdir=${libdir}/pkgconfig \ |
| 52 | " |
| 53 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 54 | SUMMARY:audispd-plugins = "Plugins for the audit event dispatcher" |
| 55 | DESCRIPTION:audispd-plugins = "The audispd-plugins package provides plugins for the real-time \ |
William A. Kennington III | b95905d | 2021-06-02 12:40:56 -0700 | [diff] [blame] | 56 | interface to the audit system, audispd. These plugins can do things \ |
| 57 | like relay events to remote machines or analyze events for suspicious \ |
| 58 | behavior." |
| 59 | |
| 60 | PACKAGES =+ "audispd-plugins" |
| 61 | PACKAGES += "auditd ${PN}-python" |
| 62 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 63 | FILES:${PN} = "${sysconfdir}/libaudit.conf ${base_libdir}/libaudit.so.1* ${base_libdir}/libauparse.so.*" |
| 64 | FILES:auditd = "${bindir}/* ${base_sbindir}/* ${sysconfdir}/*" |
| 65 | FILES:audispd-plugins = "${sysconfdir}/audisp/audisp-remote.conf \ |
William A. Kennington III | b95905d | 2021-06-02 12:40:56 -0700 | [diff] [blame] | 66 | ${sysconfdir}/audisp/plugins.d/au-remote.conf \ |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 67 | ${base_sbindir}/audisp-remote ${localstatedir}/spool/audit \ |
William A. Kennington III | b95905d | 2021-06-02 12:40:56 -0700 | [diff] [blame] | 68 | " |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 69 | FILES:${PN}-dbg += "${libdir}/python${PYTHON_BASEVERSION}/*/.debug" |
| 70 | FILES:${PN}-python = "${libdir}/python${PYTHON_BASEVERSION}" |
William A. Kennington III | b95905d | 2021-06-02 12:40:56 -0700 | [diff] [blame] | 71 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 72 | CONFFILES:auditd = "${sysconfdir}/audit/audit.rules" |
| 73 | RDEPENDS:auditd = "bash" |
William A. Kennington III | b95905d | 2021-06-02 12:40:56 -0700 | [diff] [blame] | 74 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 75 | do_install:append() { |
William A. Kennington III | b95905d | 2021-06-02 12:40:56 -0700 | [diff] [blame] | 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 |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 89 | # 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 III | b95905d | 2021-06-02 12:40:56 -0700 | [diff] [blame] | 93 | install -d ${D}${sysconfdir}/tmpfiles.d/ |
| 94 | install -m 0644 ${WORKDIR}/audit-volatile.conf ${D}${sysconfdir}/tmpfiles.d/ |
| 95 | fi |
| 96 | |
William A. Kennington III | b95905d | 2021-06-02 12:40:56 -0700 | [diff] [blame] | 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 |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 106 | |
| 107 | # Create /var/spool/audit directory for audisp-remote |
| 108 | install -m 0700 -d ${D}${localstatedir}/spool/audit |
William A. Kennington III | b95905d | 2021-06-02 12:40:56 -0700 | [diff] [blame] | 109 | } |