Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Alexis Lothoré via buildroot" <buildroot@buildroot.org>
To: "Thomas Petazzoni" <thomas.petazzoni@bootlin.com>
Cc: <tim.hammer@nav-timing.safrangroup.com>,
	<nicolas.carrier@nav-timing.safrangroup.com>,
	<buildroot@buildroot.org>
Subject: Re: [Buildroot] [PATCH 4/4] package/compliance-as-code: add new package
Date: Wed, 30 Jul 2025 20:09:11 +0200	[thread overview]
Message-ID: <DBPLAFAMQCJW.9Q3OD0DZX1BS@bootlin.com> (raw)
In-Reply-To: <20250730191834.6bc7f097@windsurf>

On Wed Jul 30, 2025 at 7:18 PM CEST, Thomas Petazzoni via buildroot wrote:
> Hello Alexis,
>
> Thanks for this patch (again!). Some comments below.
>
> On Wed, 30 Jul 2025 14:47:16 +0200
> Alexis Lothoré <alexis.lothore@bootlin.com> wrote:
>
>> Introduce the Compliance As Code package. This project provides data
>> files consumed by the openscap tool to evaluate a host compliance in
>> regard with security policies. The package depends on both host-openscap
>> (needed at build time to process the input files into usable files) and
>> openscap (needed on the target, will use the generated files to evaluate
>> the system configuration)
>> 
>> The project is based on cmake, but it also exposes a wrapper script
>> (build_product). The package uses the cmake build system, but exposes a
>> few Kconfig options to replicate some of the build_product options:
>> - BR2_PACKAGE_COMPLIANCE_AS_CODE_DATASTREAM_ONLY: replicates the -d
>>   option, building only the datastream files instead of all the files
>> - BR2_PACKAGE_COMPLIANCE_AS_CODE_PRODUCTS: allow selecting the
>>   product(s) for which we want to generate policies files.
>> 
>> The default install target provided by the project expects a full build,
>> and so it will try to generate all the files for all the products when
>> executed (which cancels the benefit of being able to select only a
>> single or a few products), so the package defines a custom install
>> command.
>
> Very nice commit message. Perhaps too nice as it makes me think: what
> about a support/testing/ test case for this package?

Thanks for the pointer, I was not aware of those integrated tests. I'll
take a look at it and add some (without knowing yet the full scope of this
framework, I guess it would be nice to get at least a matrix of tests on
the different Kconfig options added for this package)

[...]

>> +COMPLIANCE_AS_CODE_DEPENDENCIES = \
>> +	host-python3 \
>> +	host-openscap \
>> +	openscap \
>> +	host-python-jinja2 \
>> +	host-python-pyyaml \
>> +	host-libxslt \
>> +	host-libxml2
>
> I assume you verified all those host dependencies are actually needed?

Yes. For all the packages added in this series, I started by performing a
native build in a minimal container, to distinguish the mandatory
dependencies from the optional ones. So this list really reflects the
minimal set of needed deps.

>> +
>> +COMPLIANCE_AS_CODE_CONF_ENV = OPENSCAP_ROOT_DIR=$(HOST_DIR)
>> +COMPLIANCE_AS_CODE_SUPPORTS_IN_SOURCE_BUILD = NO
>> +COMPLIANCE_AS_CODE_MAKE_OPTS = \
>> +	$(foreach p,\
>> +	$(call qstrip,$(BR2_PACKAGE_COMPLIANCE_AS_CODE_PRODUCTS)),\
>> +	$(if $(BR2_PACKAGE_COMPLIANCE_AS_CODE_DATASTREAM_ONLY), generate-ssg-$(p)-ds.xml, $(p)))
>
> How does that work when
> BR2_PACKAGE_COMPLIANCE_AS_CODE_DATASTREAM_ONLY=y and
> BR2_PACKAGE_COMPLIANCE_AS_CODE_PRODUCTS is empty? This will lead to
> COMPLIANCE_AS_CODE_MAKE_OPTS being empty, so I don't see how the build
> can differentiate BR2_PACKAGE_COMPLIANCE_AS_CODE_DATASTREAM_ONLY=y vs.
> BR2_PACKAGE_COMPLIANCE_AS_CODE_DATASTREAM_ONLY disabled.

Ah, good catch ! I accidentally got rid of a block here when reworking this
part. That should rather be:

ifeq($(BR2_PACKAGE_COMPLIANCE_AS_CODE_DATASTREAM_ONLY),y)
COMPLIANCE_AS_CODE_MAKE_OPTS = -d
endif

COMPLIANCE_AS_CODE_MAKE_OPTS += \
	$(foreach p,\
	$(call qstrip,$(BR2_PACKAGE_COMPLIANCE_AS_CODE_PRODUCTS)),\
	$(if $(BR2_PACKAGE_COMPLIANCE_AS_CODE_DATASTREAM_ONLY), generate-ssg-$(p)-ds.xml, $(p)))

(and so, += instead of = when evaluating the products string)

Alexis

-- 
Alexis Lothoré, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

  reply	other threads:[~2025-07-30 18:09 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-30 12:47 [Buildroot] [PATCH 0/4] package/compliance-as-code: introduce new package Alexis Lothoré via buildroot
2025-07-30 12:47 ` [Buildroot] [PATCH 1/4] package/libxmlsec1: Add libxmlsec1 used by openSCAP Alexis Lothoré via buildroot
2025-07-30 16:53   ` Thomas Petazzoni via buildroot
2025-07-30 17:18     ` Alexis Lothoré via buildroot
2025-07-30 12:47 ` [Buildroot] [PATCH 2/4] package/libcurl: Reapply "libcurl: add host variant" Alexis Lothoré via buildroot
2025-07-30 16:55   ` Thomas Petazzoni via buildroot
2025-07-30 12:47 ` [Buildroot] [PATCH 3/4] package/openscap: add openscap package Alexis Lothoré via buildroot
2025-07-30 17:02   ` Thomas Petazzoni via buildroot
2025-07-31 12:34     ` Alexis Lothoré via buildroot
2025-07-31 12:48       ` Thomas Petazzoni via buildroot
2025-07-31 13:14         ` Alexis Lothoré via buildroot
2025-07-31 14:39           ` Thomas Petazzoni via buildroot
2025-07-30 12:47 ` [Buildroot] [PATCH 4/4] package/compliance-as-code: add new package Alexis Lothoré via buildroot
2025-07-30 17:18   ` Thomas Petazzoni via buildroot
2025-07-30 18:09     ` Alexis Lothoré via buildroot [this message]
2025-07-30 19:29       ` 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=DBPLAFAMQCJW.9Q3OD0DZX1BS@bootlin.com \
    --to=buildroot@buildroot.org \
    --cc=alexis.lothore@bootlin.com \
    --cc=nicolas.carrier@nav-timing.safrangroup.com \
    --cc=thomas.petazzoni@bootlin.com \
    --cc=tim.hammer@nav-timing.safrangroup.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