-
-
Notifications
You must be signed in to change notification settings - Fork 148
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BREAKING: Selinux permissive type #183
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we should introduce this change to 1.0 - we don't have native types in it and thus no expirience how it will behave out there. the predecessor fryman/selinux 4mio downloads on puppet forge. I really like to introduce this in the next major version - so people already using have the clear visibility about the change.
mk_resource_methods | ||
|
||
def self.instances | ||
# currently this doesn't distinguish between built-in permissive types of which there are |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is because semange permissive just builds a custom selinux module and loads is if you set one type permissive. if you remove it it removes the custom module - which it can't when the domain is defined permissive in the system policy.
This whole semange tool has lots of what I would call bugs or inconsitencies. :-/
manifests/permissive.pp
Outdated
@@ -10,7 +10,8 @@ | |||
# } | |||
# | |||
define selinux::permissive ( | |||
$context, | |||
String $context, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the param should default to $title
if we're at it changing.
what about naming it seltype
as in the other renewed types? I think this would be consistent.
@@ -19,10 +20,7 @@ | |||
Selinux::Permissive[$title] -> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removing would need to happen before removing modules because one can not remove a module which has it set to permissive with semanage permissive.
added backwards-incomptabile flag because the data types are not puppet3 non-future parser compatible - and that is how most users use puppet3. |
Something is weird with those tests I think. I see now that it's running the context I added, but for some reason only the last bit, eg.
or does that mean it does run them all but only prints out the last? |
I see now that it's running the context I added, but for some reason
only the last bit, eg.
|on redhat-6-x86_64 ensure selinux_permissive oddjob_mkhomedir_t is
present should contain Selinux::Permissive[mycontextp] that comes
before Anchor[selinux::end] ensure oddjob_mkhomedir_t is absent should
contain Selinux::Permissive[mycontextp] that comes before
Anchor[selinux::module pre] |
|no actually this should print results of all tests. i get the same
result on my computer. strange.
|
|
Am 17.01.2017 um 20:52 schrieb Jarkko Oranen:
Something is weird with those tests I think.
I see now that it's running the context I added, but for some reason
only the last bit, eg.
|on redhat-6-x86_64 ensure selinux_permissive oddjob_mkhomedir_t is
present should contain Selinux::Permissive[mycontextp] that comes
before Anchor[selinux::end] ensure oddjob_mkhomedir_t is absent should
contain Selinux::Permissive[mycontextp] that comes before
Anchor[selinux::module pre] |
I suspect that selinux__permissive is now the type and the defined type
and this could confuse rspec-puppet?
|
I suspect it has something to do with all the should expressions being inside one do block. |
I suspect it has something to do with all the should expressions being
inside one do block.
your right. running with dedicated `it {}` works.
|
my local rspec runs didn't give me those errors. Hm. It's probably not kosher to reuse the let'd provider like that, but I'm not sure how to best fix it. |
dd2069f
to
b9130c3
Compare
I wonder what's causing the rspec test to fail. They work on my local machine. Maybe it's the ruby version? Hmh |
b9130c3
to
8c40a6b
Compare
Rebased and added some acceptance tests that pass on CentOS 6 at least. Still not sure if travis rspec will pass, though. Warning: the acceptance tests are super slow because any operation with semanage seems to take ~20-30 seconds. They take about 6-7 minutes for the selinux::permissive spec |
c55c66e
to
740e0ec
Compare
nil is the bane of my existence. It's not really fun to debug these test failures given that I only seem to be able to reproduce them via travis... |
You could try to run the travis container locally: https://docs.travis-ci.com/user/common-build-problems/#Troubleshooting-Locally-in-a-Docker-Image
Imho travis uses ubuntu as distro.
|
tried to run with centos 5.11 :) of course it failed. altough metadata.json states centos5 support i suspect at least selinux::module and selinux::permissive do not work at all. but this isn't related to this change.
or
|
added issue to remove centos 5 support: #190 |
127fc16
to
8094b16
Compare
I fixed the beaker tests, I think. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
successfully ran acceptance tests on centos 6, centos 7, fedora 24 and fedora 25.
Selinux permissive type
Selinux permissive type
This is a rather simple provider which should fix #165.
This provider is even backwards-compatible, I think, if adding Puppet 4 types doesn't count.
There's a small corner case documented in the README where it's non-idempotent, but I didn't think it was worth complicating the parsing logic to fix.