Hello,I'm installing osTicket for the first time and I got issues with SELinux on CentOS 7.The server is running with nginx as the web server and postfix as the mail server.I've got a lot of issues with contexts and "permission denied" erros when pipe.php come to action, basically the context of the file pipe.php can't be tagged to postfix and nginx (php-fpm) at the same time:#!!!! The file '/usr/local/www/osticket/api/pipe.php' is mislabeled on your system.  #!!!! Fix with $ restorecon -R -v /usr/local/www/osticket/api/pipe.phpallow postfix_local_t admin_home_t open;I got errors like this:Mar 19 19 honorhold postfix/local: 900472041790: to=<osticket@mydomain.tld>, relay=local, delay=0.13, delays=0.06/0.02/0/0.05, dsn=2.0.0, status=sent (delivered to command: /usr/bin/php)Mar 19 19 honorhold postfix/local: warning: unable to create lock file /usr/local/www/osticket/api/pipe.php.lock: Permission deniedAnd:type=AVC msg=audit(1521499956.982): avc:  denied  { read } for  pid=1556 comm="php" name="pipe.php" dev="xvda3" ino=17151282 scontext=system_u tcontext=unconfined_u tclass=fileMar 19 19 honorhold postfix/local: E0C232041790: to=<osticket@mydomain.tld>, relay=local, delay=0.07, delays=0.01/0.02/0/0.05, dsn=5.3.0, status=bounced (Command died with status 1: "/usr/bin/php -q /usr/local/www/osticket/api/pipe.php". Command output: Could not open input file: /usr/local/www/osticket/api/pipe.php )After giving up on the issue I've put SELinux on permissive mode for postfix_local_t and httpd_t. It "solved the issue".But this isn't the right way to solve this. Any ideia?

I would think that you would want to read the SELinux documentation and craft a rule to allow what you need allowed.  Or see if there is a help forum for SELinux to ask there hoe to write a rule.

I can use audit2allow to fix this. But I was thinking if wasn't an available information from the osTicket team.Thanks,V.

Sorry I've never used SELinux so I dont know how to craft rules.  At some point I should probably learn just for when people like you ask how. :)

Write a Reply...