Commit Graph

34 Commits

Author SHA1 Message Date
Levi Shafter
0d24af9381 openssh: use config snippet instead of file
Config snippets should be used over file overrides since targeted
changes may be required in multiple recipes.

Since the oe-core sshd_config file now includes
/etc/ssh/sshd_config.d/*.conf, the meta-selinux configuration snippet
does not require the following:

* ChallengeResponseAutnetication: Replaced by
  KbdInteractiveAuthentication and set to "no" by default

* Override default of no subsystems: This is already present

* Compression, ClientAliveInterval, and ClientAliveCountMax: No changes
  required due to identical requirements of meta-selinux

Testing process:

* Pulled modified meta-selinux layer into Poky and included openssh

* Built core-image-sato and ran via qemu

* Verified /etc/ssh was as expected with an ssh_config.d directory with
  the new selinux config snippet inside

* Verified system was including selinux config modification by running
  sshd -T

Suggested-by: Clayton Casciato <majortomtosourcecontrol@gmail.com>
Signed-off-by: Levi Shafter <lshafter@21sw.us>
Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
2025-09-18 10:22:56 +08:00
Mingli Yu
61a64b0640 iproute2: move PACKAGECONFIG to oe-core
Move PACKAGECONFIG setting to oe-core [1] to conform to yocto compliance.

[1] https://git.openembedded.org/openembedded-core/commit/?id=067ce90494bc370fc7a271c6a036c414358f0f38

Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
Signed-off-by: Joe MacDonald <joe@deserted.net>
2022-12-14 20:31:45 -05:00
Yi Zhao
000d0719ad bind: remove volatile file
This file is not needed anymore as bind daemon will create them by
itself.

Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
Signed-off-by: Joe MacDonald <joe@deserted.net>
2021-11-22 12:23:16 -05:00
Yi Zhao
31325005e4 classes: drop redundant classes
There are some redundant classes: enable-selinux.bbclass,
with-selinux.bbclass, meson-enable-selinux.bbclass,
meson-selinux.bbclass, enable-audit.bbclass, with-audit.bbclass.
These classes only add PACKAGEOCNFIG[selinux]/[audit] to recipes. But
currently most recipes have added PACKAGECONFIG[selinux]/[audit] in
their bb files. We don't need these anymore. Only keep
enable-selinux.class and enable-audit.class to append
PACKAGECONFIG[selinux]/[audit] for recipes.

Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
Signed-off-by: Joe MacDonald <joe@deserted.net>
2021-08-29 21:34:22 -04:00
Yi Zhao
654201e25d meta-selinux: convert to new override syntax
This is the result of automated script conversion:
poky/scripts/contrib/convert-overrides.py meta-selinux

Converting the metadata to use ":" as the override character instead of "_".

Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
Signed-off-by: Joe MacDonald <joe@deserted.net>
2021-08-04 16:18:39 -04:00
Chen Qi
affabe52d9 dhcp: remove bbappend file
dhcp has been removed, thus removing its bbappend file.

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Joe MacDonald <joe@deserted.net>
2020-09-18 18:44:05 -04:00
Yi Zhao
9352f8604c bind: install volatiles file with correct name
Install volatiles file as 04_bind rather than volatiles.04_bind.

Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
Signed-off-by: Joe MacDonald <joe_macdonald@mentor.com>
2020-04-07 09:28:04 -04:00
Yi Zhao
00374b5317 openssh: update sshd_config
Update sshd_config based on openssh 7.9p1. Drop the deprecated option
UsePrivilegeSeparation

Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
Signed-off-by: Joe MacDonald <joe@deserted.net>
2019-04-14 17:07:16 -04:00
Kai Kang
58a5d64397 iproute2: remove workaround for selinux
After upgrade to 4.14.1, iproute2 changes it way to create configure output
file config.mk which is also renamed from 'Config'. With RSS, the workaround
for iproute2 is not needed any more.

Signed-off-by: Kai Kang <kai.kang@windriver.com>
Signed-off-by: Joe MacDonald <joe_macdonald@mentor.com>
2018-05-08 10:30:56 -04:00
Mark Hatle
4fefe83c32 Refactor to conform to YP Compat requirements
Change the references to check for the distribution flag of 'selinux' being
set before taking any action within the bbappends.  This prevents the
signature from being modified.

Also remove PR changes, as they are no longer allowed.

Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
2017-09-14 08:29:01 -05:00
Wenlin Kang
f1f08609fc openssh: set ChallengeResponseAuthentication to no
The patch fixes the login fails for ssh -o Batchmode=yes when passwords is
empty and without authorized_keys file even if set "PermitEmptyPasswords yes"
in sshd_config file.

Signed-off-by: Wenlin Kang <wenlin.kang@windriver.com>
Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com>
Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
2017-09-08 13:11:51 -05:00
Kai Kang
02602ac9c1 iproute2: make packageconfig selinux work
iproute2 calls command pkg-config to check whether libselinux exists
then enable or disable selinux support. That makes packageconfig doesn't
work.

The packageconfig selinux is set by checking whether distro feature
selinux exists in with-selinux.bbclass. Modify the configure result file
with same criteria.

Signed-off-by: Kai Kang <kai.kang@windriver.com>
Signed-off-by: Joe MacDonald <joe_macdonald@mentor.com>
2016-11-01 09:20:37 -04:00
Wenzong Fan
7351dfc00d dhcp: sync init-server with oe-core
oe-core commit:

  a162416119ec9deee9fef53455d1281abe573681
  dhcpd: create dhcpd user for dhcp dameon

Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com>
Signed-off-by: Joe MacDonald <joe_macdonald@mentor.com>
2016-09-22 11:34:07 -04:00
Shrikant Bobade
7cc59002c9 iproute2: fix qa warning by using with-selinux
WARNING: iproute2-4.6.0-r0 do_package_qa: QA Issue: iproute2-ss rdepends on
libselinux, but it isn't a build dependency, missing libselinux in DEPENDS
or PACKAGECONFIG? [build-deps]

Signed-off-by: Shrikant Bobade <shrikant_bobade@mentor.com>
Signed-off-by: Joe MacDonald <joe_macdonald@mentor.com>
2016-06-16 10:33:18 -04:00
Philip Tricca
704f6c75e1 dhcp: Use wildcard for version number.
Signed-off-by: Philip Tricca <flihp@twobit.us>
Signed-off-by: Joe MacDonald <joe_macdonald@mentor.com>
2015-02-10 13:41:57 -05:00
Roy.Li
a529386dc3 dhcp: remove the unrecognised without-selinux configuration warning
dhcp 4.3 has no selinux related configuration options, but it needs the
correct initscript when SELinux is enabled, so inherit selinux, not
inherit with-selinux

Signed-off-by: Roy.Li <rongqing.li@windriver.com>
Signed-off-by: Joe MacDonald <joe_macdonald@mentor.com>
2014-09-24 10:23:28 -04:00
Wenzong Fan
da44a14831 dhcp/init-server: restorecon for dhcpd*.leases
dhcp-server fails to start with avc denied error:

  avc: denied { read } for pid=571 comm="dhcpd" \
  name="dhcpd.leases" dev="hda" ino=63911 \
  scontext=system_u:system_r:dhcpd_t:s0-s15:c0.c1023 \
  tcontext=system_u:object_r:dhcp_state_t:s0 tclass=file

The type for dhcpd.leases is not correct, just fix it before dhcp-
server started.

Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com>
Signed-off-by: Xin Ouyang <xin.ouyang@windriver.com>
2014-06-23 11:50:00 +08:00
Wenzong Fan
f210f90cc8 dhcp: make a copy of init-server
Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com>
Signed-off-by: Xin Ouyang <xin.ouyang@windriver.com>
2014-06-23 11:49:21 +08:00
Xin Ouyang
eccc186716 openssh: Use wildcard for version number in bbappend.
Signed-off-by: Xin Ouyang <xin.ouyang@windriver.com>
2014-05-16 18:01:05 +08:00
Xin Ouyang
d90a05c3a8 bind: Use wildcard for version number in bbappend.
Signed-off-by: Xin Ouyang <xin.ouyang@windriver.com>
2014-05-16 17:58:18 +08:00
Philip Tricca
2d518b02a6 openssh: rename bbappend from 6.2p2 to 6.4p1
Signed-off-by: Philip Tricca <flihp@twobit.us>
Signed-off-by: Joe MacDonald <joe@deserted.net>
2013-12-04 10:16:52 -05:00
Xin Ouyang
c1dc285800 always force to restore file contexts in initscripts
In policycoreutils-2.13+, restorecon changes its default behaviour,
and does not restore context if the file' type is correct, even its
mcs/mls level is incorrect.
We should force it always to restore file contexts in initscripts to
avoid issues.

Signed-off-by: Xin Ouyang <Xin.Ouyang@windriver.com>
Signed-off-by: Joe MacDonald <joe@deserted.net>
2013-10-02 13:24:44 -04:00
Joe Slater
823a1f0f85 openssh: add PACKAGECONFIG data regarding audit
Define audit related parameters, but do not enable
audit support by default.

Signed-off-by: Joe Slater <jslater@windriver.com>
Signed-off-by: Joe MacDonald <joe@deserted.net>
2013-09-27 13:51:02 -04:00
Xin Ouyang
43e39c497a openssh: uprev to 6.2p2 to fit oe-core
Signed-off-by: Xin Ouyang <Xin.Ouyang@windriver.com>
2013-06-17 18:01:37 +08:00
Xin Ouyang
18def6ff21 openssh: uprev to 6.2p1 to fit oe-core
Signed-off-by: Xin Ouyang <Xin.Ouyang@windriver.com>
2013-05-13 10:06:00 +08:00
Xin Ouyang
93c595256f openssl: remove bbappend since oe-core merged
oe-core has used "-Wa,--noexecstack" in CFLAG not only for native
now, so the bbappend should be removed.

http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/meta/recipes-connectivity/openssl/openssl.inc?id=4fb837687dd68363f25fbfc15207dd05d1369661

Signed-off-by: Xin Ouyang <Xin.Ouyang@windriver.com>
2013-04-16 10:19:57 +08:00
Xin Ouyang
90cfe5774b shadow/openssh: use pam_selinux only if target_selinux enabled
We add pam conf files for login/sshd to use pam_selinux module. When
selinux is not in DISTRO_FEATURES, pam-plugin-selinux would not be
built, this will cause runtime errors to not allow users to login in
on the console or ssh.
Use @target_selinux() to enable these pam conf files conditionally.

Signed-off-by: Xin Ouyang <Xin.Ouyang@windriver.com>
2013-04-15 10:42:58 +08:00
Xin Ouyang
11d62e4a07 bind: restore rndc.key security context
rndc.key would be labeled with wrong named_zone_t inherited from
/etc/bind while creating, so restorecon on it.

Signed-off-by: Xin Ouyang <Xin.Ouyang@windriver.com>
2013-03-02 14:26:34 +08:00
Xin Ouyang
0c2d3c680b bind: use volatiles to create /var subdirs.
Signed-off-by: Xin Ouyang <Xin.Ouyang@windriver.com>
2013-02-27 15:15:49 +08:00
Xin Ouyang
e558dba5db packages: uprev bbappends to fit oe-core
Signed-off-by: Xin Ouyang <Xin.Ouyang@windriver.com>
2013-02-22 18:13:27 +08:00
Xin Ouyang
d95d951a0e packages: inherit with-selinux
Signed-off-by: Xin Ouyang <Xin.Ouyang@windriver.com>
2013-01-05 14:00:24 +08:00
Xin Ouyang
7b8bc16b38 openssl: disable execstack in CFLAG
"-Wa,--noexecstack" will mark objects as requiring executable stack,
this is a dangerous CFLAG and would cause security issues.

So disable it as most distros did.

Signed-off-by: Xin Ouyang <Xin.Ouyang@windriver.com>
2012-10-18 11:07:45 +08:00
Xin Ouyang
9a9acff6c7 openssh: enable pam and selinux.
sshd_config file from oe-core to set "UsePAM yes".
sshd file (pam config for sshd) from oe-core to add pam_selinux module.

Signed-off-by: Xin Ouyang <Xin.Ouyang@windriver.com>
2012-10-18 11:07:44 +08:00
Xin Ouyang
639660a288 openssh: Build with selinux support.
Signed-off-by: Xin Ouyang <Xin.Ouyang@windriver.com>
2012-06-15 17:59:43 +08:00