voxpupuli / puppet-puppetboard

Puppet module to install and manage puppetboard
https://forge.puppet.com/puppet/puppetboard
Apache License 2.0
53 stars 166 forks source link

Wrong SELinux type for wsgi.py, settings.py #365

Open op-ct opened 2 years ago

op-ct commented 2 years ago

Affected Puppet, Ruby, OS and module versions/distributions

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

  package{'python38':
    provider    => dnfmodule,
    ensure      => present,
    enable_only => true,
  }
  ->
  class { 'puppetboard':
    python_version      => '3.8',
    offline_mode        => true,
    manage_virtualenv   => true,
    manage_selinux      => true,
    default_environment => '*',
    puppetdb_host       => '127.0.0.1',
    puppetdb_port       => 8138,
  }

  class { 'apache':
    default_vhost => false,
  }

  class { 'puppetboard::apache::vhost':
    vhost_name => $puppetboard_server,
    port       => 80,
  }

What are you seeing

When SELinux is enforcing and manage_selinux => true:

Manually running chcon -t httpd_sys_script_exec_t /srv/puppetboard/puppetboard/settings.py /srv/puppetboard/puppetboard/wsgi.py fixes the issue until Puppet runs again.

What behaviour did you expect instead

The puppetboard module's classes should set all required SELinux contexts when manage_selinux => true

Output log

image

Any additional information you'd like to impart

I don't know if the httpd_sys_script_exec_t context is universal; perhaps there should be some way to specify the SELinux context for these files.