Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Petazzoni via buildroot <buildroot@buildroot.org>
To: Adam Duskett <adam.duskett@amarulasolutions.com>
Cc: buildroot@buildroot.org,
	Marcus Folkesson <marcus.folkesson@gmail.com>,
	Antoine Tenart <atenart@kernel.org>,
	Marek Belisko <marek.belisko@open-nandra.com>,
	Julien Olivain <ju.o@free.fr>,
	"Fiona Klute \(WIWA\)" <fiona.klute@gmx.de>
Subject: Re: [Buildroot] [PATCH 13/13] package/audit: bump version to 4.0.2
Date: Sat, 26 Oct 2024 18:18:08 +0200	[thread overview]
Message-ID: <20241026181808.4cae0be9@windsurf> (raw)
In-Reply-To: <20240916151206.947484-14-adam.duskett@amarulasolutions.com>

Hello Adam,

Cc Julien for runtime test, Cc Fiona for init script.

On Mon, 16 Sep 2024 17:12:06 +0200
Adam Duskett <adam.duskett@amarulasolutions.com> wrote:

> In addition, audit 4.x now provides two service files:
>  - audit-rules.service
>  - auditd.service, which depends on audit-rules.service
> 
> audit-rules.service is a one-shot service that runs augenrules --load.
> To keep audit compatible with sysvinit-based systems, create a new file,
> S02augenrules, and move S02auditd to S03auditd. This change keeps the basic
> format of the systemd provided service files for ease of maintance.

I don't follow you here. What do you mean by "keep audit compatible
with sysvinit-based systems" ?

Are you saying that to keep consistency/symmetry with the systemd unit
files, you introduce two separate init scripts, one for augenrules
--load, and one for starting the daemon itself?

> Other changes:
>  - The --without-python option is no longer present.
>  - There is no longer a --enable/--disable-systemd option.
>  - audit.rules are no longer autogenerated on startup. As such, the RedHat
>    rpm .spec logic is copied, and $(@D)/rules/10-base-config.rules is copied
>    to $(TARGET_DIR)/etc/audit/rules.d/audit.rules as part of the
>    POST_INSTALL_TARGET_HOOKS. If /etc/audit/rules.d/audit.rules does not exit

                                                                           ^^^ exists ?

>    on the target, auditd fails to run. This change is also a bonus for
>    read-only systems and the audit.rules file is guaranteed to be on the system.

                       ^^^ as ?

> Tested with qemu_x86_64_defconfig and running checking if audit is running
> properly.

Would be nice to have an audit test case in support/testing :-)

> diff --git a/package/audit/S02augenrules b/package/audit/S02augenrules
> new file mode 100644
> index 0000000000..70342a231c
> --- /dev/null
> +++ b/package/audit/S02augenrules
> @@ -0,0 +1,31 @@
> +#!/bin/sh
> +#
> +# audi       This starts and stops auditd

audi?

This scripts doesn't starts auditd.

> +#
> +# description: This starts the Linux Auditing System Daemon,
> +#              which collects security related events in a dedicated
> +#              audit log. If this daemon is turned off, audit events
> +#              will be sent to syslog.

Nope, this is not what this script does.

> +#
> +
> +DAEMON="augenrules"
> +
> +start(){
> +	printf "Starting %s: " "${DAEMON}"

We're not really starting a daemon here.

> +	# Run audit daemon executable

Nope, this is not what is happening.

> +	if /usr/sbin/"${DAEMON}" --load > /dev/null 2>&1; then
> +		echo "OK"
> +	else
> +		echo "FAIL"
> +	fi
> +}

This init script is kind of special, as it doesn't really start a
service, but does a one-shot action. Could you Cc: the next iteration
to Fiona so that she can review the proposal? Or maybe Fiona can even
review this first iteration.


> +	mkdir -p $(TARGET_DIR)/etc/audit/rules.d

This mkdir -p is useless if you add -D to the following $(INSTALL)
command.

> +	$(INSTALL) -m 0640 $(@D)/rules/10-base-config.rules \
> +		$(TARGET_DIR)/etc/audit/rules.d/audit.rules
> +endef
> +AUDIT_POST_INSTALL_TARGET_HOOKS += AUDIT_INSTALL_RULES

Thanks a lot!

Thomas
-- 
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

  reply	other threads:[~2024-10-26 16:18 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-16 15:11 [Buildroot] [PATCH 00/13] selinux-packages: bump to 3.7 Adam Duskett
2024-09-16 15:11 ` [Buildroot] [PATCH 01/13] package/libsepol: bump version " Adam Duskett
2024-09-16 15:11 ` [Buildroot] [PATCH 02/13] package/libsemanage: " Adam Duskett
2024-09-16 15:11 ` [Buildroot] [PATCH 03/13] package/libselinux: " Adam Duskett
2024-09-16 15:11 ` [Buildroot] [PATCH 04/13] package/policycoreutils: " Adam Duskett
2024-09-16 15:11 ` [Buildroot] [PATCH 05/13] package/checkpolicy: " Adam Duskett
2024-09-16 15:11 ` [Buildroot] [PATCH 06/13] package/restorecond: " Adam Duskett
2024-09-16 15:12 ` [Buildroot] [PATCH 07/13] package/semodule-utils: bump to version 3.7 Adam Duskett
2024-09-16 15:12 ` [Buildroot] [PATCH 08/13] package/selinux-python: " Adam Duskett
2024-09-16 15:12 ` [Buildroot] [PATCH 09/13] package/setools: bump version to 4.5.1 Adam Duskett
2024-09-16 15:12 ` [Buildroot] [PATCH 10/13] package/refpolicy: bump version to 2.20240226 Adam Duskett
2024-09-16 15:12 ` [Buildroot] [PATCH 11/13] package/polkit: bump version to 125 Adam Duskett
2024-11-02 22:03   ` Romain Naour via buildroot
2024-09-16 15:12 ` [Buildroot] [PATCH 12/13] package/audit/S02auditd: fix shellcheck and check-package warnings Adam Duskett
2024-10-26 16:09   ` Thomas Petazzoni via buildroot
2024-10-27 22:03     ` Fiona Klute via buildroot
2024-09-16 15:12 ` [Buildroot] [PATCH 13/13] package/audit: bump version to 4.0.2 Adam Duskett
2024-10-26 16:18   ` Thomas Petazzoni via buildroot [this message]
2024-10-27 10:06     ` Julien Olivain
2024-10-27 16:45     ` Fiona Klute via buildroot
2024-10-27 18:12       ` Thomas Petazzoni via buildroot
2024-10-26 16:08 ` [Buildroot] [PATCH 00/13] selinux-packages: bump to 3.7 Thomas Petazzoni via buildroot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20241026181808.4cae0be9@windsurf \
    --to=buildroot@buildroot.org \
    --cc=adam.duskett@amarulasolutions.com \
    --cc=atenart@kernel.org \
    --cc=fiona.klute@gmx.de \
    --cc=ju.o@free.fr \
    --cc=marcus.folkesson@gmail.com \
    --cc=marek.belisko@open-nandra.com \
    --cc=thomas.petazzoni@bootlin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox