diff options
| -rw-r--r-- | meta-oe/recipes-security/audit/audit/0001-Fixed-swig-host-contamination-issue.patch | 16 | ||||
| -rw-r--r-- | meta-oe/recipes-security/audit/audit/0001-Replace-__attribute_malloc__-with-__attribute__-__ma.patch (renamed from meta-oe/recipes-security/audit/audit/0002-Replace-__attribute_malloc__-with-__attribute__-__ma.patch) | 24 | ||||
| -rw-r--r-- | meta-oe/recipes-security/audit/audit/0002-Add-attribute-declarations.patch | 35 | ||||
| -rw-r--r-- | meta-oe/recipes-security/audit/audit/auditd.service | 28 | ||||
| -rw-r--r-- | meta-oe/recipes-security/audit/audit_3.1.2.bb | 116 | ||||
| -rw-r--r-- | meta-oe/recipes-security/audit/audit_4.0.bb | 103 |
6 files changed, 165 insertions, 157 deletions
diff --git a/meta-oe/recipes-security/audit/audit/0001-Fixed-swig-host-contamination-issue.patch b/meta-oe/recipes-security/audit/audit/0001-Fixed-swig-host-contamination-issue.patch index 5f2ecc1417..f2755d5c08 100644 --- a/meta-oe/recipes-security/audit/audit/0001-Fixed-swig-host-contamination-issue.patch +++ b/meta-oe/recipes-security/audit/audit/0001-Fixed-swig-host-contamination-issue.patch | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | From 9a32d42dfc6713fd0085dd4563a934afc30ec097 Mon Sep 17 00:00:00 2001 | 1 | From 5cdc667aeb7a014cdc1f8c7df8f8080408773dbe Mon Sep 17 00:00:00 2001 |
| 2 | From: Li xin <lixin.fnst@cn.fujitsu.com> | 2 | From: Li xin <lixin.fnst@cn.fujitsu.com> |
| 3 | Date: Sun, 19 Jul 2015 02:42:58 +0900 | 3 | Date: Sun, 19 Jul 2015 02:42:58 +0900 |
| 4 | Subject: [PATCH] Fixed swig host contamination issue | 4 | Subject: [PATCH] Fixed swig host contamination issue |
| @@ -19,7 +19,7 @@ Signed-off-by: Yi Zhao <yi.zhao@windriver.com> | |||
| 19 | 2 files changed, 3 insertions(+), 2 deletions(-) | 19 | 2 files changed, 3 insertions(+), 2 deletions(-) |
| 20 | 20 | ||
| 21 | diff --git a/bindings/swig/python3/Makefile.am b/bindings/swig/python3/Makefile.am | 21 | diff --git a/bindings/swig/python3/Makefile.am b/bindings/swig/python3/Makefile.am |
| 22 | index 6131e80d..2fb7207b 100644 | 22 | index c2c6def4..bcc2836c 100644 |
| 23 | --- a/bindings/swig/python3/Makefile.am | 23 | --- a/bindings/swig/python3/Makefile.am |
| 24 | +++ b/bindings/swig/python3/Makefile.am | 24 | +++ b/bindings/swig/python3/Makefile.am |
| 25 | @@ -23,6 +23,7 @@ | 25 | @@ -23,6 +23,7 @@ |
| @@ -28,9 +28,9 @@ index 6131e80d..2fb7207b 100644 | |||
| 28 | AM_CPPFLAGS = -I. -I$(top_builddir) -I${top_srcdir}/lib $(PYTHON3_INCLUDES) | 28 | AM_CPPFLAGS = -I. -I$(top_builddir) -I${top_srcdir}/lib $(PYTHON3_INCLUDES) |
| 29 | +STDINC ?= /usr/include | 29 | +STDINC ?= /usr/include |
| 30 | LIBS = $(top_builddir)/lib/libaudit.la | 30 | LIBS = $(top_builddir)/lib/libaudit.la |
| 31 | SWIG_FLAGS = -python -py3 -modern | 31 | SWIG_FLAGS = -python |
| 32 | SWIG_INCLUDES = -I. -I$(top_builddir) -I${top_srcdir}/lib $(PYTHON3_INCLUDES) | 32 | SWIG_INCLUDES = -I. -I$(top_builddir) -I${top_srcdir}/lib $(PYTHON3_INCLUDES) |
| 33 | @@ -37,7 +38,7 @@ _audit_la_DEPENDENCIES =${top_srcdir}/lib/libaudit.h ${top_builddir}/lib/libaudi | 33 | @@ -37,7 +38,7 @@ _audit_la_DEPENDENCIES =${top_srcdir}/lib/audit_logging.h ${top_builddir}/lib/li |
| 34 | _audit_la_LIBADD = ${top_builddir}/lib/libaudit.la | 34 | _audit_la_LIBADD = ${top_builddir}/lib/libaudit.la |
| 35 | nodist__audit_la_SOURCES = audit_wrap.c | 35 | nodist__audit_la_SOURCES = audit_wrap.c |
| 36 | audit.py audit_wrap.c: ${srcdir}/../src/auditswig.i | 36 | audit.py audit_wrap.c: ${srcdir}/../src/auditswig.i |
| @@ -40,18 +40,18 @@ index 6131e80d..2fb7207b 100644 | |||
| 40 | CLEANFILES = audit.py* audit_wrap.c *~ | 40 | CLEANFILES = audit.py* audit_wrap.c *~ |
| 41 | 41 | ||
| 42 | diff --git a/bindings/swig/src/auditswig.i b/bindings/swig/src/auditswig.i | 42 | diff --git a/bindings/swig/src/auditswig.i b/bindings/swig/src/auditswig.i |
| 43 | index 9a2c5661..6cbb7295 100644 | 43 | index 6b267844..5a4e442f 100644 |
| 44 | --- a/bindings/swig/src/auditswig.i | 44 | --- a/bindings/swig/src/auditswig.i |
| 45 | +++ b/bindings/swig/src/auditswig.i | 45 | +++ b/bindings/swig/src/auditswig.i |
| 46 | @@ -43,7 +43,7 @@ typedef unsigned uid_t; | 46 | @@ -50,7 +50,7 @@ typedef unsigned uid_t; |
| 47 | * generating setters against them: https://github.com/swig/swig/issues/1699 | ||
| 48 | */ | 47 | */ |
| 49 | %ignore audit_rule_data::buf; | 48 | %ignore audit_rule_data::buf; |
| 49 | |||
| 50 | -%include "/usr/include/linux/audit.h" | 50 | -%include "/usr/include/linux/audit.h" |
| 51 | +%include "../lib/audit.h" | 51 | +%include "../lib/audit.h" |
| 52 | #define __extension__ /*nothing*/ | 52 | #define __extension__ /*nothing*/ |
| 53 | %include <stdint.i> | 53 | %include <stdint.i> |
| 54 | %include "../lib/libaudit.h" | 54 | %include "../lib/audit-records.h" |
| 55 | -- | 55 | -- |
| 56 | 2.25.1 | 56 | 2.25.1 |
| 57 | 57 | ||
diff --git a/meta-oe/recipes-security/audit/audit/0002-Replace-__attribute_malloc__-with-__attribute__-__ma.patch b/meta-oe/recipes-security/audit/audit/0001-Replace-__attribute_malloc__-with-__attribute__-__ma.patch index 7f0af74a8c..b1f324f22d 100644 --- a/meta-oe/recipes-security/audit/audit/0002-Replace-__attribute_malloc__-with-__attribute__-__ma.patch +++ b/meta-oe/recipes-security/audit/audit/0001-Replace-__attribute_malloc__-with-__attribute__-__ma.patch | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | From 679cb57fa93984fed345dd3890cdbcbaa24e8518 Mon Sep 17 00:00:00 2001 | 1 | From 88c9b2c5cebebf13f90890baebbadc60d9fe8d16 Mon Sep 17 00:00:00 2001 |
| 2 | From: Khem Raj <raj.khem@gmail.com> | 2 | From: Khem Raj <raj.khem@gmail.com> |
| 3 | Date: Tue, 9 Aug 2022 23:57:03 -0700 | 3 | Date: Tue, 9 Aug 2022 23:57:03 -0700 |
| 4 | Subject: [PATCH] Replace __attribute_malloc__ with __attribute__((__malloc__)) | 4 | Subject: [PATCH] Replace __attribute_malloc__ with __attribute__((__malloc__)) |
| @@ -14,14 +14,28 @@ Upstream-Status: Pending | |||
| 14 | 14 | ||
| 15 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | 15 | Signed-off-by: Khem Raj <raj.khem@gmail.com> |
| 16 | --- | 16 | --- |
| 17 | auparse/auparse.h | 2 +- | 17 | audisp/plugins/remote/queue.h | 2 +- |
| 18 | 1 file changed, 1 insertion(+), 1 deletion(-) | 18 | auparse/auparse.h | 2 +- |
| 19 | 2 files changed, 2 insertions(+), 2 deletions(-) | ||
| 19 | 20 | ||
| 21 | diff --git a/audisp/plugins/remote/queue.h b/audisp/plugins/remote/queue.h | ||
| 22 | index 36b70d04..031507dc 100644 | ||
| 23 | --- a/audisp/plugins/remote/queue.h | ||
| 24 | +++ b/audisp/plugins/remote/queue.h | ||
| 25 | @@ -53,7 +53,7 @@ void q_close(struct queue *q); | ||
| 26 | * On error, return NULL and set errno. */ | ||
| 27 | struct queue *q_open(int q_flags, const char *path, size_t num_entries, | ||
| 28 | size_t entry_size) | ||
| 29 | - __attribute_malloc__ __attr_dealloc (q_close, 1) __wur; | ||
| 30 | + __attribute__((__malloc__)) __attr_dealloc (q_close, 1) __wur; | ||
| 31 | |||
| 32 | /* Add DATA to tail of Q. Return 0 on success, -1 on error and set errno. */ | ||
| 33 | int q_append(struct queue *q, const char *data); | ||
| 20 | diff --git a/auparse/auparse.h b/auparse/auparse.h | 34 | diff --git a/auparse/auparse.h b/auparse/auparse.h |
| 21 | index 5cb7402e..39156eff 100644 | 35 | index c27f1ff9..87c52965 100644 |
| 22 | --- a/auparse/auparse.h | 36 | --- a/auparse/auparse.h |
| 23 | +++ b/auparse/auparse.h | 37 | +++ b/auparse/auparse.h |
| 24 | @@ -54,7 +54,7 @@ typedef void (*auparse_callback_ptr)(auparse_state_t *au, | 38 | @@ -55,7 +55,7 @@ typedef void (*auparse_callback_ptr)(auparse_state_t *au, |
| 25 | void auparse_destroy(auparse_state_t *au); | 39 | void auparse_destroy(auparse_state_t *au); |
| 26 | void auparse_destroy_ext(auparse_state_t *au, auparse_destroy_what_t what); | 40 | void auparse_destroy_ext(auparse_state_t *au, auparse_destroy_what_t what); |
| 27 | auparse_state_t *auparse_init(ausource_t source, const void *b) | 41 | auparse_state_t *auparse_init(ausource_t source, const void *b) |
diff --git a/meta-oe/recipes-security/audit/audit/0002-Add-attribute-declarations.patch b/meta-oe/recipes-security/audit/audit/0002-Add-attribute-declarations.patch new file mode 100644 index 0000000000..349142580a --- /dev/null +++ b/meta-oe/recipes-security/audit/audit/0002-Add-attribute-declarations.patch | |||
| @@ -0,0 +1,35 @@ | |||
| 1 | From 64cb48e1e5137b8a389c7528e611617a98389bc7 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Steve Grubb <ausearch.1@gmail.com> | ||
| 3 | Date: Thu, 25 Jan 2024 15:14:51 -0500 | ||
| 4 | Subject: [PATCH] Add attribute declarations | ||
| 5 | |||
| 6 | Upstream-Status: Backport | ||
| 7 | [https://github.com/linux-audit/audit-userspace/commit/64cb48e1e5137b8a389c7528e611617a98389bc7] | ||
| 8 | |||
| 9 | Signed-off-by: Yi Zhao <yi.zhao@windriver.com> | ||
| 10 | --- | ||
| 11 | audisp/plugins/remote/queue.h | 3 ++- | ||
| 12 | 1 file changed, 2 insertions(+), 1 deletion(-) | ||
| 13 | |||
| 14 | diff --git a/audisp/plugins/remote/queue.h b/audisp/plugins/remote/queue.h | ||
| 15 | index 36b70d04..2c70e839 100644 | ||
| 16 | --- a/audisp/plugins/remote/queue.h | ||
| 17 | +++ b/audisp/plugins/remote/queue.h | ||
| 18 | @@ -1,5 +1,5 @@ | ||
| 19 | /* queue.h -- a queue abstraction | ||
| 20 | - * Copyright 2009, 2011 Red Hat Inc., Durham, North Carolina. | ||
| 21 | + * Copyright 2009, 2011 Red Hat Inc. | ||
| 22 | * All Rights Reserved. | ||
| 23 | * | ||
| 24 | * This library is free software; you can redistribute it and/or | ||
| 25 | @@ -25,6 +25,7 @@ | ||
| 26 | #define QUEUE_HEADER | ||
| 27 | |||
| 28 | #include <sys/types.h> | ||
| 29 | +#include "common.h" // attribute decls | ||
| 30 | |||
| 31 | struct queue; | ||
| 32 | |||
| 33 | -- | ||
| 34 | 2.25.1 | ||
| 35 | |||
diff --git a/meta-oe/recipes-security/audit/audit/auditd.service b/meta-oe/recipes-security/audit/audit/auditd.service deleted file mode 100644 index 06c63f0e5e..0000000000 --- a/meta-oe/recipes-security/audit/audit/auditd.service +++ /dev/null | |||
| @@ -1,28 +0,0 @@ | |||
| 1 | [Unit] | ||
| 2 | Description=Security Auditing Service | ||
| 3 | DefaultDependencies=no | ||
| 4 | After=local-fs.target systemd-tmpfiles-setup.service | ||
| 5 | Before=sysinit.target shutdown.target | ||
| 6 | Conflicts=shutdown.target | ||
| 7 | ConditionKernelCommandLine=!audit=0 | ||
| 8 | |||
| 9 | [Service] | ||
| 10 | Type=forking | ||
| 11 | PIDFile=/run/auditd.pid | ||
| 12 | ExecStart=/sbin/auditd | ||
| 13 | ## To use augenrules, uncomment the next line and comment/delete the auditctl line. | ||
| 14 | ## NOTE: augenrules expect any rules to be added to /etc/audit/rules.d/ | ||
| 15 | #ExecStartPost=-/sbin/augenrules --load | ||
| 16 | ExecStartPost=-/sbin/auditctl -R /etc/audit/audit.rules | ||
| 17 | # By default we don't clear the rules on exit. | ||
| 18 | # To enable this, uncomment the next line. | ||
| 19 | #ExecStopPost=/sbin/auditctl -R /etc/audit/audit-stop.rules | ||
| 20 | |||
| 21 | ### Security Settings ### | ||
| 22 | MemoryDenyWriteExecute=true | ||
| 23 | LockPersonality=true | ||
| 24 | ProtectControlGroups=true | ||
| 25 | ProtectKernelModules=true | ||
| 26 | |||
| 27 | [Install] | ||
| 28 | WantedBy=multi-user.target | ||
diff --git a/meta-oe/recipes-security/audit/audit_3.1.2.bb b/meta-oe/recipes-security/audit/audit_3.1.2.bb deleted file mode 100644 index 7136ed6a4c..0000000000 --- a/meta-oe/recipes-security/audit/audit_3.1.2.bb +++ /dev/null | |||
| @@ -1,116 +0,0 @@ | |||
| 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 = "GPL-2.0-or-later & LGPL-2.0-or-later" | ||
| 8 | LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f" | ||
| 9 | |||
| 10 | SRC_URI = "git://github.com/linux-audit/${BPN}-userspace.git;branch=master;protocol=https \ | ||
| 11 | file://0001-Fixed-swig-host-contamination-issue.patch \ | ||
| 12 | file://0002-Replace-__attribute_malloc__-with-__attribute__-__ma.patch \ | ||
| 13 | file://auditd \ | ||
| 14 | file://auditd.service \ | ||
| 15 | file://audit-volatile.conf \ | ||
| 16 | " | ||
| 17 | |||
| 18 | S = "${WORKDIR}/git" | ||
| 19 | SRCREV = "572eb7d4fe926e7c1c52166d08e78af54877cbc5" | ||
| 20 | |||
| 21 | inherit autotools python3targetconfig 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 python3-setuptools-native" | ||
| 31 | |||
| 32 | EXTRA_OECONF = " --with-libwrap \ | ||
| 33 | --enable-gssapi-krb5=no \ | ||
| 34 | --with-libcap-ng=yes \ | ||
| 35 | --with-python3=yes \ | ||
| 36 | --libdir=${base_libdir} \ | ||
| 37 | --sbindir=${base_sbindir} \ | ||
| 38 | --without-python \ | ||
| 39 | --without-golang \ | ||
| 40 | --disable-zos-remote \ | ||
| 41 | --with-arm=yes \ | ||
| 42 | --with-aarch64=yes \ | ||
| 43 | " | ||
| 44 | |||
| 45 | EXTRA_OEMAKE = "PYLIBVER='python${PYTHON_BASEVERSION}' \ | ||
| 46 | PYINC='${STAGING_INCDIR}/$(PYLIBVER)' \ | ||
| 47 | pyexecdir=${libdir}/python${PYTHON_BASEVERSION}/site-packages \ | ||
| 48 | STDINC='${STAGING_INCDIR}' \ | ||
| 49 | pkgconfigdir=${libdir}/pkgconfig \ | ||
| 50 | " | ||
| 51 | |||
| 52 | SUMMARY:audispd-plugins = "Plugins for the audit event dispatcher" | ||
| 53 | DESCRIPTION:audispd-plugins = "The audispd-plugins package provides plugins for the real-time \ | ||
| 54 | interface to the audit system, audispd. These plugins can do things \ | ||
| 55 | like relay events to remote machines or analyze events for suspicious \ | ||
| 56 | behavior." | ||
| 57 | |||
| 58 | PACKAGES =+ "audispd-plugins" | ||
| 59 | PACKAGES += "auditd ${PN}-python" | ||
| 60 | |||
| 61 | FILES:${PN} = "${sysconfdir}/libaudit.conf ${base_libdir}/libaudit.so.1* ${base_libdir}/libauparse.so.*" | ||
| 62 | FILES:auditd = "${bindir}/* ${base_sbindir}/* ${sysconfdir}/* ${datadir}/audit/*" | ||
| 63 | FILES:audispd-plugins = "${sysconfdir}/audit/audisp-remote.conf \ | ||
| 64 | ${sysconfdir}/audit/plugins.d/au-remote.conf \ | ||
| 65 | ${sysconfdir}/audit/plugins.d/syslog.conf \ | ||
| 66 | ${base_sbindir}/audisp-remote \ | ||
| 67 | ${base_sbindir}/audisp-syslog \ | ||
| 68 | ${localstatedir}/spool/audit \ | ||
| 69 | " | ||
| 70 | FILES:${PN}-dbg += "${libdir}/python${PYTHON_BASEVERSION}/*/.debug" | ||
| 71 | FILES:${PN}-python = "${libdir}/python${PYTHON_BASEVERSION}" | ||
| 72 | |||
| 73 | CONFFILES:auditd = "${sysconfdir}/audit/audit.rules" | ||
| 74 | |||
| 75 | do_configure:prepend() { | ||
| 76 | sed -e 's|buf\[];|buf[0];|g' ${STAGING_INCDIR}/linux/audit.h > ${S}/lib/audit.h | ||
| 77 | sed -i -e 's|#include <linux/audit.h>|#include "audit.h"|g' ${S}/lib/libaudit.h | ||
| 78 | } | ||
| 79 | |||
| 80 | do_install:append() { | ||
| 81 | sed -i -e 's|#include "audit.h"|#include <linux/audit.h>|g' ${D}${includedir}/libaudit.h | ||
| 82 | |||
| 83 | rm -f ${D}/${libdir}/python${PYTHON_BASEVERSION}/site-packages/*.a | ||
| 84 | rm -f ${D}/${libdir}/python${PYTHON_BASEVERSION}/site-packages/*.la | ||
| 85 | |||
| 86 | # reuse auditd config | ||
| 87 | [ ! -e ${D}/etc/default ] && mkdir ${D}/etc/default | ||
| 88 | mv ${D}/etc/sysconfig/auditd ${D}/etc/default | ||
| 89 | rmdir ${D}/etc/sysconfig/ | ||
| 90 | |||
| 91 | # replace init.d | ||
| 92 | install -D -m 0755 ${WORKDIR}/auditd ${D}/etc/init.d/auditd | ||
| 93 | rm -rf ${D}/etc/rc.d | ||
| 94 | |||
| 95 | if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then | ||
| 96 | # install systemd unit files | ||
| 97 | install -d ${D}${systemd_unitdir}/system | ||
| 98 | install -m 0644 ${WORKDIR}/auditd.service ${D}${systemd_unitdir}/system | ||
| 99 | |||
| 100 | install -d ${D}${sysconfdir}/tmpfiles.d/ | ||
| 101 | install -m 0644 ${WORKDIR}/audit-volatile.conf ${D}${sysconfdir}/tmpfiles.d/ | ||
| 102 | fi | ||
| 103 | |||
| 104 | # audit-2.5 doesn't install any rules by default, so we do that here | ||
| 105 | mkdir -p ${D}/etc/audit ${D}/etc/audit/rules.d | ||
| 106 | cp ${S}/rules/10-base-config.rules ${D}/etc/audit/rules.d/audit.rules | ||
| 107 | |||
| 108 | chmod 750 ${D}/etc/audit ${D}/etc/audit/rules.d | ||
| 109 | chmod 640 ${D}/etc/audit/auditd.conf ${D}/etc/audit/rules.d/audit.rules | ||
| 110 | |||
| 111 | # Based on the audit.spec "Copy default rules into place on new installation" | ||
| 112 | cp ${D}/etc/audit/rules.d/audit.rules ${D}/etc/audit/audit.rules | ||
| 113 | |||
| 114 | # Create /var/spool/audit directory for audisp-remote | ||
| 115 | install -m 0700 -d ${D}${localstatedir}/spool/audit | ||
| 116 | } | ||
diff --git a/meta-oe/recipes-security/audit/audit_4.0.bb b/meta-oe/recipes-security/audit/audit_4.0.bb new file mode 100644 index 0000000000..c8ab0d880d --- /dev/null +++ b/meta-oe/recipes-security/audit/audit_4.0.bb | |||
| @@ -0,0 +1,103 @@ | |||
| 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 = "GPL-2.0-or-later & LGPL-2.0-or-later" | ||
| 8 | LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f" | ||
| 9 | |||
| 10 | SRC_URI = "git://github.com/linux-audit/${BPN}-userspace.git;branch=master;protocol=https \ | ||
| 11 | file://0001-Fixed-swig-host-contamination-issue.patch \ | ||
| 12 | file://0002-Add-attribute-declarations.patch \ | ||
| 13 | file://auditd \ | ||
| 14 | file://audit-volatile.conf \ | ||
| 15 | " | ||
| 16 | |||
| 17 | SRC_URI:append:libc-musl = " file://0001-Replace-__attribute_malloc__-with-__attribute__-__ma.patch" | ||
| 18 | |||
| 19 | S = "${WORKDIR}/git" | ||
| 20 | SRCREV = "ae7d2830391c1115cebff6340ef3130b1b03ce45" | ||
| 21 | |||
| 22 | inherit autotools python3targetconfig update-rc.d systemd | ||
| 23 | |||
| 24 | UPDATERCPN = "auditd" | ||
| 25 | INITSCRIPT_NAME = "auditd" | ||
| 26 | INITSCRIPT_PARAMS = "defaults" | ||
| 27 | |||
| 28 | SYSTEMD_PACKAGES = "auditd" | ||
| 29 | SYSTEMD_SERVICE:auditd = "auditd.service audit-rules.service" | ||
| 30 | |||
| 31 | DEPENDS = "python3 tcp-wrappers libcap-ng linux-libc-headers swig-native python3-setuptools-native coreutils-native" | ||
| 32 | |||
| 33 | EXTRA_OECONF = " \ | ||
| 34 | --with-libwrap \ | ||
| 35 | --with-libcap-ng \ | ||
| 36 | --with-python3 \ | ||
| 37 | --with-arm \ | ||
| 38 | --with-aarch64 \ | ||
| 39 | --without-golang \ | ||
| 40 | --disable-gssapi-krb5 \ | ||
| 41 | --disable-zos-remote \ | ||
| 42 | --sbindir=${base_sbindir} \ | ||
| 43 | " | ||
| 44 | |||
| 45 | EXTRA_OEMAKE = " \ | ||
| 46 | PYTHON=python3 \ | ||
| 47 | pythondir=${libdir}/python${PYTHON_BASEVERSION}/site-packages \ | ||
| 48 | pyexecdir=${libdir}/python${PYTHON_BASEVERSION}/site-packages \ | ||
| 49 | STDINC='${STAGING_INCDIR}' \ | ||
| 50 | " | ||
| 51 | |||
| 52 | SUMMARY:audispd-plugins = "Plugins for the audit event dispatcher" | ||
| 53 | DESCRIPTION:audispd-plugins = "The audispd-plugins package provides plugins for the real-time \ | ||
| 54 | interface to the audit system, audispd. These plugins can do things \ | ||
| 55 | like relay events to remote machines or analyze events for suspicious \ | ||
| 56 | behavior." | ||
| 57 | |||
| 58 | PACKAGES =+ "audispd-plugins" | ||
| 59 | PACKAGES += "auditd ${PN}-python" | ||
| 60 | |||
| 61 | FILES:${PN} = "${sysconfdir}/libaudit.conf ${libdir}/libau*.so.*" | ||
| 62 | FILES:auditd = "${bindir}/* ${base_sbindir}/* ${sysconfdir}/* ${datadir}/audit-rules/* ${libexecdir}/*" | ||
| 63 | FILES:audispd-plugins = "${sysconfdir}/audit/audisp-remote.conf \ | ||
| 64 | ${sysconfdir}/audit/plugins.d/au-remote.conf \ | ||
| 65 | ${sysconfdir}/audit/plugins.d/syslog.conf \ | ||
| 66 | ${base_sbindir}/audisp-remote \ | ||
| 67 | ${base_sbindir}/audisp-syslog \ | ||
| 68 | ${localstatedir}/spool/audit \ | ||
| 69 | " | ||
| 70 | FILES:${PN}-dbg += "${libdir}/python${PYTHON_BASEVERSION}/*/.debug" | ||
| 71 | FILES:${PN}-python = "${libdir}/python${PYTHON_BASEVERSION}" | ||
| 72 | |||
| 73 | CONFFILES:auditd = "${sysconfdir}/audit/audit.rules" | ||
| 74 | |||
| 75 | do_configure:prepend() { | ||
| 76 | sed -e 's|buf\[];|buf[0];|g' ${STAGING_INCDIR}/linux/audit.h > ${S}/lib/audit.h | ||
| 77 | sed -i -e 's|#include <linux/audit.h>|#include "audit.h"|g' ${S}/lib/libaudit.h | ||
| 78 | } | ||
| 79 | |||
| 80 | do_install:append() { | ||
| 81 | sed -i -e 's|#include "audit.h"|#include <linux/audit.h>|g' ${D}${includedir}/libaudit.h | ||
| 82 | |||
| 83 | # Install default rules | ||
| 84 | install -d -m 750 ${D}/etc/audit | ||
| 85 | install -d -m 750 ${D}/etc/audit/rules.d | ||
| 86 | |||
| 87 | install -m 0640 ${S}/rules/10-base-config.rules ${D}/etc/audit/rules.d/audit.rules | ||
| 88 | |||
| 89 | # Based on the audit.spec "Copy default rules into place on new installation" | ||
| 90 | install -m 0640 ${D}/etc/audit/rules.d/audit.rules ${D}/etc/audit/audit.rules | ||
| 91 | |||
| 92 | if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then | ||
| 93 | install -D -m 0644 ${WORKDIR}/audit-volatile.conf ${D}${sysconfdir}/tmpfiles.d/audit.conf | ||
| 94 | fi | ||
| 95 | |||
| 96 | if ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then | ||
| 97 | install -D -m 0755 ${WORKDIR}/auditd ${D}/etc/init.d/auditd | ||
| 98 | rm -rf ${D}${libdir}/systemd | ||
| 99 | fi | ||
| 100 | |||
| 101 | # Create /var/spool/audit directory for audisp-remote | ||
| 102 | install -d -m 0700 ${D}${localstatedir}/spool/audit | ||
| 103 | } | ||
