Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Description of problem:
-E, --extract Extract customizable commands, for use within a
transaction
If the extract option is used in a transaction then the security range is lost.
Version-Release number of selected component (if applicable):
policycoreutils-2.5-8.el7.x86_64
policycoreutils-python-2.5-8.el7.x86_64
How reproducible:
* always
Steps to Reproduce:
# seinfo --nodecon
Nodecon: 0
# semanage node -l
# semanage node -E
# semanage node -a -M 255.255.255.0 -p ipv4 -t node_t -r s0-s0:c0.c1 192.168.0.123
# seinfo --nodecon
Nodecon: 1
nodecon 192.168.0.123 255.255.255.0 system_u:object_r:node_t:s0 - s0:c0.c1
# semanage node -l
IP Address Netmask Protocol Context
192.168.0.123 255.255.255.0 ipv4 system_u:object_r:node_t:s0-s0:c0,c1
# semanage node -E
node -a -M 255.255.255.0 -p ipv4 -t node_t 192.168.0.123
#
Expected results:
* the security range is also printed
My guess is that all semanage sub-commands which support -E, --extract options suffer from this issue:
# semanage fcontext -l -C
# semanage fcontext -a -t tmp_t -r s0:c0.c1 /pokus
# semanage fcontext -l -C
SELinux fcontext type Context
/pokus all files system_u:object_r:tmp_t:s0:c0.c1
# semanage export
boolean -D
login -D
interface -D
user -D
port -D
node -D
fcontext -D
module -D
fcontext -a -f a -t tmp_t '/pokus'
# semanage fcontext -E
fcontext -a -f a -t tmp_t '/pokus'
#
The export sub-command of semanage does not print the MLS/MCS security range either.
Because the export option for user and login sub-command prints MLS/MCS security range:
# semanage user -E
user -a -L s0 -r s0 -R 'user_r' user_u
user -a -L s0 -r s0 -R 'xguest_r' xguest_u
# semanage login -E
login -a -s unconfined_u -r 's0-s0:c0.c1023' __default__
login -a -s guest_u -r 's0' guest-user
login -a -s staff_u -r 's0-s0:c0.c1023' staff-user
login -a -s user_u -r 's0' user-user
login -a -s xguest_u -r 's0' xguest
login -a -s xguest_u -r 's0' xguest-user
#
it would be great if the export option also printed MLS/MCS range in case of other sub-commands. Otherwise the export/import mechanism looses information.
# grep semanage /usr/libexec/selinux/selinux-policy-migrate-local-changes.sh
if [ -x /usr/sbin/semanage ]; then
/usr/sbin/semanage export | /usr/sbin/semanage import
#
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.
For information on the advisory, and where to find the updated
files, follow the link below.
If the solution does not work for you, open a new bug report.
https://access.redhat.com/errata/RHBA-2019:2160
Description of problem: -E, --extract Extract customizable commands, for use within a transaction If the extract option is used in a transaction then the security range is lost. Version-Release number of selected component (if applicable): policycoreutils-2.5-8.el7.x86_64 policycoreutils-python-2.5-8.el7.x86_64 How reproducible: * always Steps to Reproduce: # seinfo --nodecon Nodecon: 0 # semanage node -l # semanage node -E # semanage node -a -M 255.255.255.0 -p ipv4 -t node_t -r s0-s0:c0.c1 192.168.0.123 # seinfo --nodecon Nodecon: 1 nodecon 192.168.0.123 255.255.255.0 system_u:object_r:node_t:s0 - s0:c0.c1 # semanage node -l IP Address Netmask Protocol Context 192.168.0.123 255.255.255.0 ipv4 system_u:object_r:node_t:s0-s0:c0,c1 # semanage node -E node -a -M 255.255.255.0 -p ipv4 -t node_t 192.168.0.123 # Expected results: * the security range is also printed