Go to file
Yi Zhao 37ede3a5fe refpolicy: update to latest git rev
* 2102055d4 devices: Change dev_rw_uhid() to use a policy pattern
* 1cbe455a5 device: Move dev_rw_uhid definition
* 7a33b4bc8 Sepolicy changes for bluez to access uhid
* c6dd4087d selinuxutil: make policykit optional
* 10feb47e5 newrole: allow newrole to search faillock runtime directory
* bf34d3e5e sysnetwork: fixes for dhcpcd
* 4663e613f Adding Sepolicy rules to allow bluetoothctl and dbus-daemon
            to access unix stream sockets
* 27602a932 various: various fixes
* 63d50bbaa container, crio, kubernetes: minor fixes
* 11e729e27 container, podman: various fixes
* ef5954a0e systemd: allow systemd-sysctl to search tmpfs
* 472e0442e container: allow containers to getcap
* 7876e5151 container: allow system container engines to mmap runtime
            files
* d917092a8 matrixd: add tunable for binding to all unreserved ports
* 3dba91dd4 bootloader: allow systemd-boot to manage EFI binaries
* ddf395d5d asterisk: allow binding to all unreserved UDP ports
* 3bad3696b postgres: add a standalone execmem tunable
* ef28f7879 userdom: allow users to read user home dir symlinks
* 03711caea dovecot: allow dovecot-auth to read SASL keytab
* cd781e783 fail2ban: allow reading net sysctls
* ddc6ac493 init: allow systemd to use sshd pidfds
* b9c457d80 files context for merged-usr profile on gentoo
* 5040dd3b6 Need map perm for cockpit 300.4
* 2ef9838db tests.yml: Add sechecker testing
* c62bd5c6c cockpit: Change $1_cockpit_tmpfs_t to a tmpfs file type
* 1c694125b certbot: Drop execmem
* 349411d55 xen: Drop xend/xm stack
* 2a261f916 Allow systemd to pass down sig mask
* 2577feb83 cups: Remove PTAL
* 5b02b44e5 xen: Revoke kernel module loading permissions
* 1c20c002c minissdpd: Revoke kernel module loading permissions
* 5671390e2 docker: Fix dockerc typo in container_engine_executable_file
* e1bc4830d cron: Use raw entrypoint rule for system_cronjob_t
* 0f71792c8 uml: Remove excessive access from user domains on
            uml_exec_t
* 511223e2d Set the type on /etc/machine-info to net_conf_t so
            hostnamectl can manipulate it (CRUD)
* 72fc1b2a3 fix: minor correction in MCS_CATS range comment
* cbf56c8ae systemd: allow notify client to stat socket

Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
Signed-off-by: Joe MacDonald <joe.macdonald@siemens.com>
2024-07-23 12:51:05 -04:00
classes selinux-image.bbclass: refactor bbclass 2023-10-12 10:14:19 -04:00
conf layer.conf: update for the scarthgap release series 2024-03-20 07:32:53 -04:00
dynamic-layers/networking-layer/recipes-daemons/iscsi-initiator-utils python2: drop bbappend 2021-08-29 21:34:22 -04:00
recipes-connectivity iproute2: move PACKAGECONFIG to oe-core 2022-12-14 20:31:45 -05:00
recipes-core busybox: Fix wrapper creation 2024-03-28 10:01:42 -04:00
recipes-devtools/rpm rpm: remove PACKAGECONFIG[selinux] 2024-02-27 12:30:20 -05:00
recipes-extended psmisc: move PACKAGECONFIG to oe-core 2022-12-14 20:31:45 -05:00
recipes-graphics classes: drop redundant classes 2021-08-29 21:34:22 -04:00
recipes-kernel linux-yocto: drop CONFIG_SECURITY_SELINUX_DISABLE 2023-09-05 14:36:06 -04:00
recipes-security refpolicy: update to latest git rev 2024-07-23 12:51:05 -04:00
recipes-support classes: drop redundant classes 2021-08-29 21:34:22 -04:00
.gitignore gitignore: add it 2023-03-27 09:34:01 -04:00
MAINTAINERS MAINTAINERS: fix description of section entries 2024-06-26 11:09:53 -04:00
README README: update 2023-10-12 10:14:19 -04:00
SELinux-FAQ SELinux-FAQ: remove references to poky-selinux distro 2022-11-07 14:19:08 -05:00

meta-selinux
============

This layer's purpose is enabling SE Linux support.

The majority of this layers work is accomplished in bbappend files, used to
enable SE Linux support in existing recipes.

A new recipes-security was added.  The purpose of this category is to add
software specific to system security.

Please see the MAINTAINERS file for information on contacting the maintainers
of this layer, as well as instructions for submitting patches.


Dependencies
------------

This layer depends on the openembedded-core metadata and the meta-python and
meta-oe layers from the meta-openembedded repository.


Maintenance
-----------
Please see the MAINTAINERS file for information on contacting the maintainers
of this layer, as well as instructions for submitting patches.


Building the meta-selinux layer
-------------------------------
In order to add selinux support to the poky build this layer should be added
to your projects bblayers.conf file.

By default the selinux components are disabled.  This conforms to the
Yocto Project compatible guideline that indicate that simply including a
layer should not change the system behavior.

In order to use the components in this layer you must add the 'selinux' to the
DISTRO_FEATURES.  In addition to selinux, you should be sure that acl, xattr and
pam are also present.
e.g. DISTRO_FEATURES:append = " acl xattr pam selinux"

You must also specify a preferred provider for the virtual/refpolicy.  The
included policies with this layer are simply reference policies and will need
to be tailored for your environment.  
* Enable the refpolicy-mls:
e.g. PREFERRED_PROVIDER_virtual/refpolicy ?= "refpolicy-mls"


Using different versions of refpolicy
-------------------------------------
To prepare selinux enabled images using different ver. of refpolicy,
we can choose supported releases of refpolicy
refer to available versions under recipes-security/refpolicy

We can use the refpolicy directly from git repository instead of release tarballs.
By default refpolicy from git builds head commit of master branch, we can update
SRCREV for refpolicy and refpolicy-contrib as appropriate at refpolicy_git.inc
to check refpolicy as per required commits.

* enable the preferred refpolicy-minimum:
PREFERRED_VERSION_refpolicy-minimum = "2.20151208"
PREFERRED_VERSION_refpolicy = "2.20151208"


Using different init manager
----------------------------
By default selinux enabled images coming up with "sysvinit" as init manager,
we can use "systemd" as an init manager using below changes to local.conf

* enable systemd as init manager changes to local.conf
DISTRO_FEATURES:remove = " sysvinit"
DISTRO_FEATURES:append = " systemd"
VIRTUAL-RUNTIME_init_manager = "systemd"
DISTRO_FEATURES_BACKFILL_CONSIDERED = ""


Enable labeling on first boot
----------------------------
By default, the system will label selinux contexts during build. To enable
labeling on first boot. Set FIRST_BOOT_RELABEL to 1 in local.conf:

FIRST_BOOT_RELABEL = "1"


Starting up the system
----------------------
Most likely the reference policy selected will not just work "out of the box".

As always, if you update the reference policy to better work with OpenEmbedded
or Poky configurations, please submit the changes back to the project.

When using 'core-image-selinux', the system will boot and automatically setup
the policy by running the "fixfiles -f -F relabel" for you.  This is
implemented via the 'selinux-autorelabel' recipe.

The 'core-image-selinux-minimal' does not automatically relabel the system.
So you must boot using the parameters "selinux=1 enforcing=0", and then
manually perform the setup.  Running 'fixfiles -f -F relabel' is available
in this configuration.

After logging in you can verify selinux is present using:

$ sestatus

Output should include:
SELinux status:                 enabled
...
Current mode:                   enforcing
...

The above indicates that selinux is currently running, and if you are running
in an enforcing mode or not.


License
-------

All metadata is MIT licensed unless otherwise stated. Source code included
in tree for individual recipes is under the LICENSE stated in each recipe
(.bb file) unless otherwise stated.

This README document is Copyright (C) 2012 Wind River Systems, Inc.