How ni/meta-security works
Project type and purpose
• This is not a conventional client-server or web app, but an open-source Yocto Project layer called “meta-security.”
• Its purpose is to supply BitBake metadata (classes, bbappend patches, recipes, configuration) that hardens and secures Linux images built with the Yocto build system.
• It provides multiple sub-layers (meta-hardening, meta-integrity, meta-parsec, meta-tpm), dynamic-layer support (meta-perl, meta-python, networking-layer), and KAS build definitions for QEMU targets.
File structure
• Top–level directories:
• classes/ – custom BitBake classes (.bbclass) for security features
• conf/ – layer.conf, distro include files
• recipes-*/ – grouped by functionality (IDS, scanners, core images, kernel patches, etc.)
• dynamic-layers/ – optional meta-perl, meta-python, networking layer fragments
• meta-hardening/, meta-integrity/, meta-parsec/, meta-tpm/
– focused sub-layers, each with their own conf, classes, recipes, OEQA tests
• kas/ – KAS YAML definitions orchestrating multi-layer builds for various QEMU targets
• lib/oeqa – OEQA (integration) test cases for each security domain
• scripts/ – CI helper scripts
• wic/ – WIC kickstart templates for generating images with dm-verity, systemd-boot
• Patterns:
• “.bbappend” files modify core recipes (e.g. linux-yocto) when DISTRO_FEATURES includes “security”
• Classes encapsulate common hardening logic (e.g. aide-base.bbclass, dm-verity-img.bbclass)
• KAS files reference this layer plus its dependencies to drive reproducible containerized builds.
README for additional insights
• The layer must be added to BBLAYERS in bblayers.conf.
• A warning is emitted if DISTRO_FEATURES lacks “security.”
• Optional dynamic layers are activated by adding meta-oe, meta-perl, meta-python to BBLAYERS.
• Dependencies: openembedded-core, meta-openembedded/meta-oe, plus optional meta-perl/meta-python.
Detail
• “DISTRO_FEATURES:append = security” as a config toggle
• Warning/skip-sanity mechanism
• Call out KAS YAML as orchestrator definitions