Skip to content

Increase selinux coverage of the host system #2849

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 50 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
bb0af19
overlay profiles: Switch to hardened/selinux/systemd profiles
krnowak Apr 23, 2025
9b8a2e1
sec-policy/selinux-apache: Add from Gentoo
krnowak Apr 24, 2025
bbcbdb1
sec-policy/selinux-apm: Add from Gentoo
krnowak Apr 23, 2025
ae2cfc6
sec-policy/selinux-bind: Add from Gentoo
krnowak Apr 23, 2025
04956ff
sec-policy/selinux-brctl: Add from Gentoo
krnowak Apr 23, 2025
e13d417
sec-policy/selinux-cdrecord: Add from Gentoo
krnowak Apr 23, 2025
33c508f
sec-policy/selinux-chronyd: Add from Gentoo
krnowak Apr 23, 2025
836c877
sec-policy/selinux-dirmngr: Add from Gentoo
krnowak Apr 24, 2025
3a4ec73
sec-policy/selinux-dnsmasq: Add from Gentoo
krnowak Apr 23, 2025
cc210c8
sec-policy/selinux-docker: Add from Gentoo
krnowak Apr 23, 2025
52f006f
sec-policy/selinux-dracut: Add from Gentoo
krnowak Apr 23, 2025
be89a25
sec-policy/selinux-git: Add from Gentoo
krnowak Apr 23, 2025
5ccc073
sec-policy/selinux-gpg: Add from Gentoo
krnowak Apr 23, 2025
7f02baa
sec-policy/selinux-kdump: Add from Gentoo
krnowak Apr 23, 2025
8b527d9
sec-policy/selinux-kerberos: Add from Gentoo
krnowak Apr 23, 2025
97725df
sec-policy/selinux-ldap: Add from Gentoo
krnowak Apr 23, 2025
d7d22d9
sec-policy/selinux-loadkeys: Add from Gentoo
krnowak Apr 23, 2025
71c4ebe
sec-policy/selinux-logrotate: Add from Gentoo
krnowak Apr 23, 2025
a1ffdf5
sec-policy/selinux-makewhatis: Add from Gentoo
krnowak Apr 23, 2025
693bfb3
sec-policy/selinux-mandb: Add from Gentoo
krnowak Apr 23, 2025
ee4cde8
sec-policy/selinux-ntp: Add from Gentoo
krnowak Apr 23, 2025
8273a6f
sec-policy/selinux-pcscd: Add from Gentoo
krnowak Apr 23, 2025
b251b8d
sec-policy/selinux-podman: Add from Gentoo
krnowak Apr 23, 2025
3453273
sec-policy/selinux-qemu: Add from Gentoo
krnowak Apr 23, 2025
dd3b204
sec-policy/selinux-quota: Add from Gentoo
krnowak Apr 23, 2025
60b7aaa
sec-policy/selinux-rpc: Add from Gentoo
krnowak Apr 23, 2025
29b3019
sec-policy/selinux-rpcbind: Add from Gentoo
krnowak Apr 23, 2025
580100c
sec-policy/selinux-samba: Add from Gentoo
krnowak Apr 23, 2025
1b799a6
sec-policy/selinux-sasl: Add from Gentoo
krnowak Apr 23, 2025
d75b0b5
sec-policy/selinux-smartmon: Add from Gentoo
krnowak Apr 23, 2025
1b228a0
sec-policy/selinux-sudo: Add from Gentoo
krnowak Apr 23, 2025
8c3f0d6
sec-policy/selinux-tcsd: Add from Gentoo
krnowak Apr 23, 2025
f0bbe92
sec-policy/selinux-virt: Add from Gentoo
krnowak Apr 24, 2025
bd3d47c
sec-policy/selinux-wireguard: Add from Gentoo
krnowak Apr 23, 2025
e2b7d63
sec-policy/selinux-xfs: Add from Gentoo
krnowak Apr 23, 2025
f9c2595
sec-policy/selinux-zfs: Add from Gentoo
krnowak Apr 23, 2025
4800a85
overlay coreos/user-patches: Add symlinks for newly added policy pack…
krnowak Apr 23, 2025
8ddff72
.github: Add newly added policy packages to automation
krnowak Apr 23, 2025
387f1ab
overlay profiles: Clean up selinux enabling
krnowak Apr 23, 2025
c959c21
overlay profiles: Mask python and perl USE flags for generic images
krnowak Apr 24, 2025
e716d8a
overlay profiles: Drop enabling caps and audit USE flags for specific…
krnowak Apr 24, 2025
a9a54d1
overlay profiles: Disable caps for smartmontools
krnowak Apr 24, 2025
5e97a4d
overlay profiles: Allow python for sys-libs/libselinux
krnowak Apr 24, 2025
4797653
overlay coreos/config: Add Flatcar modifications for sys-libs/libsema…
krnowak Apr 25, 2025
37e6ae3
overlay sys-libs/libsemanage: Move to portage-stable
krnowak Apr 25, 2025
faa3941
sys-libs/libsemanage: Sync with Gentoo
krnowak Apr 25, 2025
fc9def5
.github: Add sys-libs/libsemanage to automation
krnowak Apr 25, 2025
feaa762
overlay sys-apps/policycoreutils: Move to portage-stable
krnowak Apr 29, 2025
769357e
sys-apps/policycoreutils: Sync with Gentoo
krnowak Apr 29, 2025
b2a06ed
.github: Add sys-apps/policycoreutils to automation
krnowak Apr 29, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions .github/workflows/portage-stable-packages-list
Original file line number Diff line number Diff line change
Expand Up @@ -555,13 +555,48 @@ scripts

sec-keys/openpgp-keys-gentoo-release

sec-policy/selinux-apache
sec-policy/selinux-apm
sec-policy/selinux-base
sec-policy/selinux-base-policy
sec-policy/selinux-bind
sec-policy/selinux-brctl
sec-policy/selinux-cdrecord
sec-policy/selinux-chronyd
sec-policy/selinux-container
sec-policy/selinux-dbus
sec-policy/selinux-dirmngr
sec-policy/selinux-dnsmasq
sec-policy/selinux-docker
sec-policy/selinux-dracut
sec-policy/selinux-git
sec-policy/selinux-gpg
sec-policy/selinux-kdump
sec-policy/selinux-kerberos
sec-policy/selinux-ldap
sec-policy/selinux-loadkeys
sec-policy/selinux-logrotate
sec-policy/selinux-makewhatis
sec-policy/selinux-mandb
sec-policy/selinux-ntp
sec-policy/selinux-pcscd
sec-policy/selinux-podman
sec-policy/selinux-policykit
sec-policy/selinux-qemu
sec-policy/selinux-quota
sec-policy/selinux-rpc
sec-policy/selinux-rpcbind
sec-policy/selinux-samba
sec-policy/selinux-sasl
sec-policy/selinux-smartmon
sec-policy/selinux-sssd
sec-policy/selinux-sudo
sec-policy/selinux-tcsd
sec-policy/selinux-unconfined
sec-policy/selinux-virt
sec-policy/selinux-wireguard
sec-policy/selinux-xfs
sec-policy/selinux-zfs

sys-apps/acl
sys-apps/attr
Expand Down Expand Up @@ -603,6 +638,7 @@ sys-apps/nvme-cli
sys-apps/pciutils
sys-apps/pcsc-lite
sys-apps/pkgcore
sys-apps/policycoreutils
sys-apps/portage
sys-apps/pv
sys-apps/sandbox
Expand Down Expand Up @@ -681,6 +717,7 @@ sys-libs/libcap-ng
sys-libs/libnvme
sys-libs/libseccomp
sys-libs/libselinux
sys-libs/libsemanage
sys-libs/libsepol
sys-libs/libunwind
sys-libs/liburing
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# A hack to modify semanage.conf before it gets copied by
# multilib_copy_sources.
if ! declare -pf flatcar_hacked_multilib_copy_sources >/dev/null 2>&1; then
eval "$(echo 'flatcar_hacked_multilib_copy_sources()'; declare -pf multilib_copy_sources | tail -n +2)"
fi
multilib_copy_sources() {
# Enable compression in semanage.conf
sed -i \
-e 's/^\(bzip-blocksize\)=0/\1=1/' \
"${S}/src/semanage.conf"
flatcar_hacked_multilib_copy_sources "${@}"
}
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
portage-stable:default/linux/amd64/23.0/no-multilib/hardened/systemd
portage-stable:default/linux/amd64/23.0/no-multilib/hardened/selinux/systemd
:coreos/base
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
portage-stable:default/linux/arm64/23.0/hardened
portage-stable:targets/systemd
portage-stable:default/linux/arm64/23.0/hardened/selinux/systemd
:coreos/base
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ dev-vcs/git -perl -iconv
app-admin/sudo -sendmail

# disable hybrid cgroup as we use the unified mode now
# use lzma which is the default on non-gentoo systems, enable selinux,
sys-apps/systemd -cgroup-hybrid curl idn lzma selinux tpm
# use lzma which is the default on non-gentoo systems,
sys-apps/systemd -cgroup-hybrid curl idn lzma tpm
net-libs/libmicrohttpd -ssl

# disable kernel config detection and module building
Expand Down Expand Up @@ -59,7 +59,7 @@ sys-libs/glibc nscd
dev-libs/cyrus-sasl kerberos -gdbm

# don't build manpages for sssd
sys-auth/sssd -python samba kerberos gssapi ssh selinux
sys-auth/sssd -python samba kerberos gssapi ssh

# enable logging command-line options in update_engine
dev-cpp/glog gflags
Expand All @@ -72,20 +72,7 @@ sys-fs/quota rpc
sys-apps/portage -xattr -rsync-verify

# Enable -M and -Z flags; -M is used by mayday
sys-process/lsof rpc selinux

# Enable SELinux for all targets
coreos-base/coreos selinux
sys-apps/dbus selinux

# Enable SELinux for coreutils
sys-apps/coreutils selinux

# Enable SELinux for tar
app-arch/tar selinux

# Enable SELinux for runc
app-containers/runc selinux
sys-process/lsof rpc

# enable regular expression processing in jq
app-misc/jq oniguruma
Expand Down Expand Up @@ -139,9 +126,6 @@ dev-libs/libpcre2 -pcre16 -pcre32 unicode
# smi and ssl, no clue.
net-analyzer/tcpdump -ssl -smi -samba

# selinux: to find files with a particular SElinux label
sys-apps/findutils selinux

# Flatcar defaults formerly defined in coreos-overlay ebuilds
app-containers/containerd btrfs device-mapper
app-containers/docker btrfs overlay seccomp
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@ python_single_target_python3_12
python_targets_python3_13
python_single_target_python3_13

# Unmask selinux so it can be enabled selectively in package.use
-selinux

# We don't care about i10n, takes too much space, pulls in too many
# extra dependencies.
nls
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,20 @@ app-editors/vim-core minimal
# Install our modifications and compatibility symlinks for ssh and ntp
#
# Install a SELinux policy directory symlink
coreos-base/misc-files audit ntp openssh policycoreutils
coreos-base/misc-files ntp openssh policycoreutils

dev-lang/python gdbm
dev-libs/dbus-glib tools
dev-libs/elfutils -utils
dev-libs/openssl pkcs11
dev-util/perf -perl -python
net-misc/dhcp -server
net-misc/ntp caps
sys-apps/smartmontools -daemon -update-drivedb -systemd
sys-apps/smartmontools -caps -daemon -update-drivedb -systemd
sys-block/parted device-mapper
sys-fs/lvm2 -readline thin lvm
sys-libs/ncurses minimal
sys-libs/pam audit

# enable journal gateway, bootctl and container features
sys-apps/systemd audit elfutils gnuefi http importd iptables
sys-apps/systemd elfutils gnuefi http importd iptables

# epoll is needed for systemd-journal-remote to work. coreos/bugs#919
net-libs/libmicrohttpd epoll
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,9 @@
# Only needed by Catalyst in the SDK, requires dev-lang/python-exec.
sys-apps/util-linux python
# Selinux profile force-enables USE=caps, but we don't need it for
# smartmontools - it is only relevant for smartd daemon, which we do
# not build.
sys-apps/smartmontools caps

# Allow python for sys-libs/libselinux - it is needed by portage with
# USE=selinux. For production images, we will filter these files out
# with an install mask.
sys-libs/libselinux -python
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,5 @@ INSTALL_MASK="${INSTALL_MASK}
/sbin/ebtables-save
/sbin/xfs_scrub_all
"

# TODO: Add libselinux python stuff to install mask here.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Disable anything that pulls those interpreters into generic images.
perl
python
Loading