All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Caleb Case" <ccase@tresys.com>
To: <jwcart2@tycho.nsa.gov>, "Stephen Smalley" <sds@tycho.nsa.gov>
Cc: <selinux@tycho.nsa.gov>, "Chad Sellers" <csellers@tresys.com>,
	"Karl MacMillan" <kmacmillan@tresys.com>,
	"Joshua Brindle" <jbrindle@tresys.com>
Subject: RE: [PATCH 13/13] semanage store migration script
Date: Fri, 8 Jan 2010 16:27:46 -0500	[thread overview]
Message-ID: <06A6610D4F464D4EBEAFBF2C5F86911E0184DDE5@exchange2.columbia.tresys.com> (raw)
In-Reply-To: <1262984376.2093.14.camel@localhost>

> -----Original Message-----
> From: James Carter [mailto:jwcart2@tycho.nsa.gov]
> Sent: Friday, January 08, 2010 4:00 PM
> To: Stephen Smalley
> Cc: Caleb Case; selinux@tycho.nsa.gov; Chad Sellers; Karl MacMillan;
> Joshua Brindle
> Subject: Re: [PATCH 13/13] semanage store migration script
> 
> On Fri, 2010-01-08 at 10:34 -0500, Stephen Smalley wrote:
> > On Wed, 2009-12-23 at 18:26 -0500, Caleb Case wrote:
> > > We created a migration script to ease the burden of transition
from
> the
> > > old libsemanage store layout to the new. The script will detect
all
> the
> > > stores in /etc/selinux using the old layout and convert them to
the
> new
> > > layout in /var/lib/selinux. It also allows you to specify the
default
> > > priority to use with -p and store to operate on with -s. After
> migration
> > > the script by default will leave the old store unchanged, but can
be
> > > told to remove the old modules directory with -c.
> > >
> > > Examples:
> > >
> > > # Migrate all stores to the new layout.
> > > migrate.py
> > >
> > > Migrating from /etc/selinux/targeted/modules/active to
> /var/lib/selinux/targeted/active
> > > Attempting to rebuild policy from /var/lib/selinux
> > >
> > > # Migrate only the targeted store.
> > > migrate.py -s targeted
> > >
> > > Migrating from /etc/selinux/targeted/modules/active to
> /var/lib/selinux/targeted/active
> > > Attempting to rebuild policy from /var/lib/selinux
> > >
> > > # Migrate all, but install to priority 150.
> > > migrate.py -p 150
> > >
> > > Migrating from /etc/selinux/targeted/modules/active to
> /var/lib/selinux/targeted/active
> > > Attempting to rebuild policy from /var/lib/selinux
> >
> > I tried the following:
> > semanage login -a -s user_u pi
> > cp -a /etc/selinux /etc/selinux.orig
> > install new userland
> > migrate.py
> > diff -ru /etc/selinux.orig /etc/selinux
> >
> > The seusers entry for "pi" was dropped from the final seusers file
in
> > the rebuilt policy.
> >
> 
> I saw the same thing.  I added a new login, but it does not show up
> after the migration with "semanage login -l" even though it is
> in /var/lib/selinux/targeted/active/seusers and seusers.final.
> 
> booleans, ports, file contexts, and permissive domains all show up
after
> the migration, but there are some other issues.
> 
> 
> 1)  For booleans I am getting this error:
> 
> # semanage boolean --on git_system_use_cifs
> Traceback (most recent call last):
>   File "/usr/sbin/semanage", line 460, in <module>
>     process_args(sys.argv[1:])
>   File "/usr/sbin/semanage", line 407, in process_args
>     raise ValueError(_("Invalid command") % " ".join(argv))
> TypeError: not all arguments converted during string formatting
> 
> 
> 
> 2)  Either the priority stuff doesn't work or I am doing something
> wrong.  Shouldn't either of the following not display any modules
since
> they are all at priority 100?
> 
> "semodule -p 900 -l" or "semodule -p 900; semodule -l"
> 
> Both display all modules.

The list command is not affected by the priority setting. Maybe it
should be? Currently the priority is defaulted to 400 in semodule, but
we could have it default to 0 and check in the -i/u/r cases for 0 and
set to 400 and then filter the modules in -l if priority != 0.

> 
> 
> 3)  I can't remove the permissive domain created before the migration
> because the default priority level is 400, but the script put
everything
> at priority 100 and I don't know how to change the priority for
> semanage.

semanage hasn't been updated yet to let you specify priorities.

> 
> # semanage permissive -d httpd_t
> libsemanage.semanage_direct_remove_key: Unable to remove module
> directory
/var/lib/selinux/targeted/tmp/modules/400/permissive_httpd_t.
> (No such file or directory).
> /usr/sbin/semanage: Could not remove permissive domain httpd_t (remove
> failed)
> 
> 
> Ports and file contexts addition and removal seems to work fine.
> 
> --
> James Carter <jwcart2@tycho.nsa.gov>
> National Security Agency
> 



--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to majordomo@tycho.nsa.gov with
the words "unsubscribe selinux" without quotes as the message.

  parent reply	other threads:[~2010-01-08 21:27 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-23 23:25 [PATCH 00/13] RFC libsemanage move to var, enable/disable module, and priority support Caleb Case
2009-12-23 23:25 ` [PATCH 01/13] libsemanage: fix typo in tests makefile -o -> -O Caleb Case
2009-12-23 23:25   ` [PATCH 02/13] semanage: move permissive module creation to /tmp Caleb Case
2009-12-23 23:25     ` [PATCH 03/13] libsemanage: move the module store to /var/lib/selinux Caleb Case
2009-12-23 23:25       ` [PATCH 04/13] libsemanage: split final files into /var/lib/selinux/tmp Caleb Case
2009-12-23 23:25         ` [PATCH 05/13] libsemanage: update unit tests for move to /var/lib/selinux Caleb Case
2009-12-23 23:25           ` [PATCH 06/13] libsemanage: add default priority to semanage_handle_t Caleb Case
2009-12-23 23:25             ` [PATCH 07/13] libsemanage: augment semanage_module_info_t and provide semanage_module_key_t Caleb Case
2009-12-23 23:25               ` [PATCH 08/13] libsemanage: get/set module info and enabled status Caleb Case
2009-12-23 23:25                 ` [PATCH 09/13] libsemanage: provide function to get new base module path Caleb Case
2009-12-23 23:25                   ` [PATCH 10/13] libsemanage: installing/upgrading/removing modules via info and key Caleb Case
2009-12-23 23:25                     ` [PATCH 11/13] libsemanage: new private api for unstable functions Caleb Case
2009-12-23 23:25                       ` [PATCH 12/13] semodule: add priority, enabled, and extended listing Caleb Case
2009-12-23 23:26                         ` [PATCH 13/13] semanage store migration script Caleb Case
2010-01-08 15:34                           ` Stephen Smalley
2010-01-08 20:59                             ` James Carter
2010-01-08 21:05                               ` Stephen Smalley
2010-01-08 21:27                               ` Caleb Case [this message]
2010-01-11 19:53                                 ` James Carter
2010-01-11 19:57                                   ` Joshua Brindle
2010-01-11 20:45                                     ` James Carter
2010-01-08 14:30         ` [PATCH 04/13] libsemanage: split final files into /var/lib/selinux/tmp Stephen Smalley
2010-01-08 15:07           ` James Carter
2010-01-08 15:28             ` Stephen Smalley
2010-01-08 18:25               ` Caleb Case
2010-01-08 20:19               ` Joshua Brindle
2010-01-08 20:25                 ` Stephen Smalley
2010-01-08 20:30                   ` Joshua Brindle
2010-01-08 20:51                     ` Joshua Brindle
2010-01-08 20:58                       ` Stephen Smalley
2010-01-08 21:02                         ` Joshua Brindle
2010-01-08 21:04                           ` Stephen Smalley
2010-01-08 21:12                           ` James Carter
2010-01-08 14:28       ` [PATCH 03/13] libsemanage: move the module store to /var/lib/selinux Stephen Smalley
2010-01-08 14:50         ` James Carter
2010-01-08 15:19           ` Stephen Smalley
2010-01-07 22:28 ` [PATCH 00/13] RFC libsemanage move to var, enable/disable module, and priority support Chad Sellers
2010-01-08 14:30   ` James Carter
2010-01-21 21:06     ` Chad Sellers

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=06A6610D4F464D4EBEAFBF2C5F86911E0184DDE5@exchange2.columbia.tresys.com \
    --to=ccase@tresys.com \
    --cc=csellers@tresys.com \
    --cc=jbrindle@tresys.com \
    --cc=jwcart2@tycho.nsa.gov \
    --cc=kmacmillan@tresys.com \
    --cc=sds@tycho.nsa.gov \
    --cc=selinux@tycho.nsa.gov \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.