Skip to content
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

Selinux port ensure => absent do not work with port_range #323

Open
myMarck opened this issue Jul 1, 2020 · 2 comments
Open

Selinux port ensure => absent do not work with port_range #323

myMarck opened this issue Jul 1, 2020 · 2 comments

Comments

@myMarck
Copy link

myMarck commented Jul 1, 2020

Affected Puppet, Ruby, OS and module versions/distributions

  • Puppet: 5.5.x
  • Ruby:
  • Distribution: CentOS
  • Module version: 3.2.0

How to reproduce (e.g Puppet code you use)

This example is based on mongo

semanage port -l | grep mongo
mongod_port_t tcp 27017-27019, 28017-28019

selinux::port { 'mongo_port [27017,27019]':
ensure => 'absent',
seltype => 'mongod_port_t',
protocol => 'tcp',
port_range => [27017,27019],
}

What are you seeing

Nothing happens

What behaviour did you expect instead

semanage port -l | grep mongo
mongod_port_t tcp 28017-28019

Output log

This is from debug log
Debug: /Stage[main]/Selinux::Config/before: before to Selinux::Port[mongo_port [27017,27019]]
Debug: /Stage[main]/My_mongodb::Install/Selinux::Port[mongo_port [27017,27019]]/before: before to Anchor[selinux::module pre]

Any additional information you'd like to impart

@oranenj
Copy link
Contributor

oranenj commented May 18, 2021

@myMarck are those port definitions local modifications using a previous Puppet manifest or in the system policy? The SELinux module can't remove system definitions, only local customizations.

@oranenj
Copy link
Contributor

oranenj commented May 18, 2021

If you want to change the port definitions, you can add a definition that assigns the ports to some other SELinux type

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants