Download Red Hat Enterprise Linux 7 SELinux User`s and Administrator`s Guide
Transcript
Chapt er 1 9 . Squid Caching Proxy An SELinux denial message similar to the following is logged: localhost setroubleshoot: SELinux is preventing the squid (squid_t) from binding to port 10000. For complete SELinux messages. run sealert -l 97136444-4497-4fff-a7a7-c4d8442db982 6. For SELinux to allow sq ui d to listen on port 10000, as used in this example, the following command is required: ~]# semanag e po rt -a -t sq ui d _po rt_t -p tcp 10 0 0 0 7. Start sq ui d again and have it listen on the new port: ~]# systemctl start sq ui d . servi ce 8. Now that SELinux has been configured to allow Squid to listen on a non-standard port (TCP 10000 in this example), it starts successfully on this port. 19.2. T ypes Type Enforcement is the main permission control used in SELinux targeted policy. All files and processes are labeled with a type: types define a domain for processes and a type for files. SELinux policy rules define how types access each other, whether it be a domain accessing a type, or a domain accessing another domain. Access is only allowed if a specific SELinux policy rule exists that allows it. The following types are used with Squid. D ifferent types allow you to configure flexible access: httpd _sq ui d _scri pt_exec_t This type is used for utilities such as cachemg r. cg i , which provides a variety of statistics about Squid and its configuration. sq ui d _cache_t Use this type for data that is cached by Squid, as defined by the cache_d i r directive in /etc/sq ui d /sq ui d . co nf. By default, files created in or copied into the /var/cache/sq ui d / and /var/spo o l /sq ui d / directories are labeled with the sq ui d _cache_t type. Files for the squidGuard URL redirector plug-in for sq ui d created in or copied to the /var/sq ui d G uard / directory are also labeled with the sq ui d _cache_t type. Squid is only able to use files and directories that are labeled with this type for its cached data. sq ui d _co nf_t This type is used for the directories and files that Squid uses for its configuration. Existing files, or those created in or copied to the /etc/sq ui d / and /usr/share/sq ui d / directories are labeled with this type, including error messages and icons. sq ui d _exec_t This type is used for the sq ui d binary, /usr/sbi n/sq ui d . sq ui d _l o g _t 14 3