Skip to content
  • Stephen Smalley's avatar
    0d08d472
    Remove -unconfineddomain from neverallow rules. · 0d08d472
    Stephen Smalley authored
    
    
    With the sepolicy-analyze neverallow checking, attribute
    expansion is performed against the device policy and therefore
    we do not want our neverallow rules to exempt domains from
    consideration based on an attribute (e.g. -unconfineddomain).
    Otherwise, device policy could pass the neverallow check just
    by adding more domains to unconfineddomain.  We could of course
    add a CTS test to check the list of unconfineddomains against
    a whitelist, but it seems desirable regardless to narrow these
    neverallow rules to only the specific domains required.
    
    There are three such neverallow rules in current policy: one
    on creating unlabeled files, one on accessing /dev/hw_random, and
    one on accessing a character device without a specific type.  The
    only domain in unconfineddomain that appears to have a legitimate
    need for any of these permissions is the init domain.  Replace
    -unconfineddomain with -init in these neverallow rules, exclude these
    permissions from unconfineddomain, and add these permissions to init if
    not already explicitly allowed.  auditallow accesses by init to files
    and character devices left in the generic device type so we can monitor
    what is being left there, although it is not necessarily a problem unless
    the file or device should be accessible to others.
    
    Change-Id: If6ee1b1a337c834971c6eb21dada5810608babcf
    Signed-off-by: default avatarStephen Smalley <sds@tycho.nsa.gov>
    0d08d472
    Remove -unconfineddomain from neverallow rules.
    Stephen Smalley authored
    
    
    With the sepolicy-analyze neverallow checking, attribute
    expansion is performed against the device policy and therefore
    we do not want our neverallow rules to exempt domains from
    consideration based on an attribute (e.g. -unconfineddomain).
    Otherwise, device policy could pass the neverallow check just
    by adding more domains to unconfineddomain.  We could of course
    add a CTS test to check the list of unconfineddomains against
    a whitelist, but it seems desirable regardless to narrow these
    neverallow rules to only the specific domains required.
    
    There are three such neverallow rules in current policy: one
    on creating unlabeled files, one on accessing /dev/hw_random, and
    one on accessing a character device without a specific type.  The
    only domain in unconfineddomain that appears to have a legitimate
    need for any of these permissions is the init domain.  Replace
    -unconfineddomain with -init in these neverallow rules, exclude these
    permissions from unconfineddomain, and add these permissions to init if
    not already explicitly allowed.  auditallow accesses by init to files
    and character devices left in the generic device type so we can monitor
    what is being left there, although it is not necessarily a problem unless
    the file or device should be accessible to others.
    
    Change-Id: If6ee1b1a337c834971c6eb21dada5810608babcf
    Signed-off-by: default avatarStephen Smalley <sds@tycho.nsa.gov>
Loading