Bug 1011843
Summary: | RFE: restorecon secure mode | ||
---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | James Patterson <jamespatterson> |
Component: | policycoreutils | Assignee: | Daniel Walsh <dwalsh> |
Status: | CLOSED WONTFIX | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
Severity: | unspecified | Docs Contact: | |
Priority: | unspecified | ||
Version: | 19 | CC: | dwalsh, mgrepl |
Target Milestone: | --- | ||
Target Release: | --- | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Bug Fix | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2015-01-14 13:11:01 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
James Patterson
2013-09-25 08:47:55 UTC
Do you want to have a type like untrusted_t, which you can give to a file or directory, and then have restorecon ignore it? If you added that type to /etc/selinux/targeted/contexts/customizable_types, you would get mostly what you want. create a policy untrusted.te policy_module(untrusted,1.0) type untrusted_file_t; files_type(untrusted_file_t) Now compile the code # make -f /usr/share/selinux/devel/Makefile untrusted.pp # semodule -i untrusted.pp echo untrusted_t >> /etc/selinux/targeted/contexts/customizable_types # touch /etc/badfile # chcon -t untrusted_t /etc/badfile # restorecon -v /etc/badfile # ls -Z /etc/badfile Should work. restorecon -F /etc/badfile Will still change the label. No, I'd like to be able to run restorecon to update old labels to new ones, but without accidentally giving files with the wrong label the correct one. James how would restorecon no the difference unless a administrator told them? Because the policy would tell them. Say you have /opt/blah with label t_stuff and you update the policy to give files under that directory the new label t_blah. What would be good is if all the files under /opt/blah with the old t_stuff label got the new more-specific t_blah label - but without other files under /opt/blah accidentally getting the new label. Well that is what is supposed to happen, but based on regular expressions. The way we tell restorecon about labels is based on regular expressions, so we can change the labels on /opt/blah/.secret to one label versus the default label for all content under '/opt/blah(/.*)?' Really? So in this scenario, what will happen? /opt/blah/one stuff_t /opt/blah/evil httpd_sys_content_t New policy comes along, everything under /opt/blah(/.*)? should now be blah_t. restorecon -R /opt/blah What I expect to happen: /opt/blah/one blah_t /opt/blah/evil blah_t What I hope would happen: /opt/blah/one blah_t /opt/blah/evil httpd_sys_content_t Not sure how that could happen. Perhaps we should talk in IRC. This message is a notice that Fedora 19 is now at end of life. Fedora has stopped maintaining and issuing updates for Fedora 19. It is Fedora's policy to close all bug reports from releases that are no longer maintained. Approximately 4 (four) weeks from now this bug will be closed as EOL if it remains open with a Fedora 'version' of '19'. Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, simply change the 'version' to a later Fedora version. Thank you for reporting this issue and we are sorry that we were not able to fix it before Fedora 19 is end of life. If you would still like to see this bug fixed and are able to reproduce it against a later version of Fedora, you are encouraged change the 'version' to a later Fedora version prior this bug is closed as described in the policy above. Although we aim to fix as many bugs as possible during every release's lifetime, sometimes those efforts are overtaken by events. Often a more recent Fedora release includes newer upstream software that fixes bugs or makes them obsolete. |