VULN_CHECK_I913V6 /i ~gdZddlZddlZddlZddlZddlZdddddZdgd gd d gd gd gdgdZdgZejdeje ejjdej ZdaddZdadadZdadZdadZdadZdZdZdZGddZGddZy) )ManPage HTMLManPages gen_domainsN)amavis_tclamd_t clamscan_t freshclam_t) rgmanager_t corosync_t aisexec_t pacemaker_tqemu_tphpfpm_t) antivirus_t cluster_tsvirt_thttpd_tsambaapachevirtlibvirtbindsmartmonraid)smbdhttpdvirtdnamedfsdaemonmdadmz/varz%y-%m-%dSOURCE_DATE_EPOCHctrtSddl}ia |jjj t j |}|jdD]k}|jdD]U}|jd}|dk(s|dk(r|dk(rd}|dk(rd}|jd D]}|jt|<Wm tS#t$rYtSwxYw) Nrlayermodulenameuser unconfined unprivuserunconfinedusersummary) modules_dictxml.etree.ElementTreeetree ElementTree fromstringsepolicy policy_xmlfindallgettextIOError)pathxmltreelmr%bs 5/usr/lib/python3.12/site-packages/sepolicy/manpage.pygen_modules_dictr=/s L yy$$//0C0CD0IJg&AYYx(uuV}6>T\%9<'!D++'D9-A)*L&.)'     sB7C C#"C#ctrtr ttfSgaiag}tjtj}|D]<}|j |dd|vs|dt|dj dd<>|D],}|dvstj |jdd.tjttfS)Nr%range_r)system_uroot unconfined_u_u) users users_ranger0infoUSERappendsplitreplacesort)allusers allusers_infodus r<get_all_users_inforRKs k!! EKHMM(--0M & " a<34W:K& ,Q/ 0  8 8 LL4, - JJL + czts0ttjtjddatS)N entry_typetypes)all_entrypointsnextr0rH ATTRIBUTErSr<get_entrypointsr[cs, x}}X-?-?NOPWX rScRtrtSgatjD]'}d}|dd}|tvrtj|)tjD]+}|ddtvs|dk(rtj|dd-tj tS)NFsystem_r)domainsr0get_all_domainsrJ get_all_rolesrM)rPfounddomainroles r<rrlsG  % % '3B W  v(&&( 9 4:#5 tCRy!)  LLN NrSctrtStjtj}ia|D]} |dt|d<tS#gt|d<Y+xYw)N attributesr%)rVr0rHTYPE) all_typesrecs r< _gen_typesrjs_   hmm,I E $!$\!2E#f+  L $!#E#f+ s AAc\dj|dt| jdS)N r@)joinlenrK)ftrims r< prettyprintrqs( 88AkD zN((- ..rSc"tjtjg}tjD]W}g}|D]@}|j ddd|k(s|j |j ddBt |||<Y|S)N/r)dictfromkeysstring ascii_lettersrKrJsorted) manpage_listalphabet_manpagesitempjs r<get_alphabet_manpagesrs f&:&:B?  ! !Awws|B"a' AGGCL,- &d|! " rSc ddlm}|d|z\}}|dk(r:t |dt |d}|j ||jyy#t$r ddlm}Y_wxYw)Nr)getstatusoutputz)/usr/bin/groff -man -Thtml %s 2>/dev/nullzhas been createdw)commandsr ImportError subprocessprintopenwriteclose) html_manpagemanpagerrcoutputfds r<convert_manpage_to_htmlrsl/,!!Lw!VWJB Qw l./ , $    /./sAA('A(c.eZdZdZdZdZdZdZdZy)rzF Generate a HTML Manpages on an given SELinux domains ct||_t||_||_|dz|_|j|_|j y)Nrs)r manpage_rolesmanpage_domains os_versionold_pathnew_path _HTMLManPages__gen_html_manpages)selfrrr6rs r<__init__zHTMLManPages.__init__sE2=A4_E$s       "rScd|j|j|jyN)_write_html_manpage _gen_index_gen_cssrs r<__gen_html_manpagesz HTMLManPages.__gen_html_manpagess!   "  rSc Ltjj|jstj|j|j j D]Q}t|s|D]>}t|j|jdddzdz|j|z@S|jj D]Q}t|s|D]>}t|j|jdddzdz|j|z@Sy)N_selinuxrz.html) osr6isdirrmkdirrvaluesrnrrsplitrr)rrcrPrdrs r<rz HTMLManPages._write_html_manpagesww}}T]]+ HHT]] #**113F6{A+T]]QXXjRS=TUV=W-WZa-adhdqdqtuduv 4 &&--/D4yA+T]]QXXjRS=TUV=W-WZa-adhdqdqtuduv0rSc |jdz}t|d}|jd|jz|jD]3}t |j|s|jd|d|d5|jdd}|jD][}t |j|s|d z }|j|D])}|j d d d }|d |d|d|d|d z }+]|jd|z|jD]3}t |j|s|jd|d|d5|jdd}|jD][}t |j|s|d z }|j|D])}|j d d d }|d |d|d|d|d z }+]|jd|z|jtd|zy)Nz index.htmlrz SELinux man pages

SELinux man pages for %s


SELinux roles

z zz
rEz

rrrzz9_selinux(8) - Security Enhanced Linux Policy for the z SELinux user zH%s


SELinux domains

z_domain>z z_domain> %s has been created) rrrrrrnrrrr) rhtmlrletter rolename_bodyrrolenamedomainname_body domainnames r<rzHTMLManPages._gen_indexs?}}|+ $_   oo  ((F4%%f-."F,-)    ((F4%%f-.& ++F3A xx A6q9H!\bdlnvx@&AAM4)  ! ! "**F4''/0 &+   **F4''/05(--f5A!"*a!8!;J#ekmwyCEO(PPO6+      #d*+rSc|jdz}t|d}|jd|jt d|zy)Nz style.cssraQ html, body { background-color: #fcfcfc; font-family: arial, sans-serif; font-size: 110%; color: #333; } h1, h2, h3, h4, h5, h5 { color: #2d7c0b; font-family: arial, sans-serif; margin-top: 25px; } a { color: #336699; text-decoration: none; } a:visited { color: #4488bb; } a:hover, a:focus, a:active { color: #07488A; text-decoration: none; } a.func { color: red; text-decoration: none; } a.file { color: red; text-decoration: none; } pre.code { background-color: #f4f0f4; // font-family: monospace, courier; font-size: 110%; margin-left: 0px; margin-right: 60px; padding-top: 5px; padding-bottom: 5px; padding-left: 8px; padding-right: 8px; border: 1px solid #AADDAA; } .url { font-family: serif; font-style: italic; color: #440064; } r)rrrrr)r style_cssrs r<rzHTMLManPages._gen_csssGMMK/ )S ! 77 r   #i/0rSN) __name__ __module__ __qualname____doc__rrrrrrZrSr<rrs## wE,N=1rSrceZdZdZdZddgZgZgZd'dZdZ dZ dZ d Z d Z d Zd Zd ZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZ dZ!dZ"d Z#d!Z$d"Z%d#Z&d$Z'd%Z(d&Z)y)(rzK Generate a Manpage on an SELinux domain in the specified path NDisabledEnabledc||_||_||_tjd|_t |_tj|_ tj|_ tj|_ tj|_tj |_t%d|_t%d|_tj*|_tj.|_t3|_|jr|jdz|_n&|jt9j:z|_tj<|j6|_tAjB|d||_"|jr|jdz|_#n|jdz|_#tjH|jF|_%tjL|\|_'|_(|jNdz|_)|jU|d |jNd |_+tY|jVd |_-|jNd z|j"vrB|j]|jrg|j^ja|jVnA|jr%|jbja|jV|je|jZjgthjkD]1}||jNk(sth|D]}|jm|3y) Nrr file_contextsT)exist_okz policy.xml#/usr/share/selinux/devel/policy.xml_trs _selinux.8r_r)7r source_filesrBr0 gen_port_dictportrecsrr_r` all_domainsget_all_attributesall_attributes get_all_bools all_boolsget_all_port_typesall_port_typesra all_rolesrR all_usersall_users_rangeget_all_file_typesall_file_typesget_all_role_allows role_allowsrjrVfcpathselinuxselinux_file_context_path get_fcdictfcdictrmakedirsr6xmlpath gen_bool_dict booleans_dictgen_short_namer short_nametype _gen_bools man_page_pathrr_ManPage__gen_user_man_pagerrJr_ManPage__gen_man_pager equiv_dictkeys_ManPage__gen_man_page_link)rrr6rBrrkaliass r<rzManPage.__init__cs~ (  ..03 "} #335&99;!//1&99;!//1+-a013A6&99;#779\   ))o5DK))g&G&G&IIDK))$++6  D4(   99|3DL99'LLDL%33DLLA+3+B+B:+N(OOd*  26Ht))3/ ??T !T^^ 3  $ $ &yy""))$*<*<=yy$$++D,>,>?    !  "ADOO#']E,,U3+#rScg|_g|_|jg}|jtvr>t|jD](}|dz|j vs|j |dz*|D]D}tj|\}}|xj|z c_|xj|z c_F|jj|jjy)Nr) bools domainboolsrrrrrJr0 get_boolsrM)rrVtrrs r<rzManPage._gen_boolss   ??j (0t8t///LLT*1A!)!3!3A!6 K JJ% J    +   rSc|jSr)rrs r<get_man_page_pathzManPage.get_man_page_paths!!!rSc^|jdz|_|jst|j|_ |j|j|_|j|j vrttjtj|jd|_ |j|j|j|j!|j#|j%|j'|j)n |j+|j%|j-|j/|j1|j3y#d|jz|_YRxYw)Nrz %s user rolerf)rrdr+r=rdescrrXr0rHrgrrf _user_header_user_attribute _can_sudo_xwindows_login_network _booleans _home_exec _transitions _role_header _port_types _mcs_types_writes_footerrs r<__gen_user_man_pagezManPage.__gen_user_man_pages+OOd*   0 >D  9))$//:DI ??dnn ,"8==#LMl[DO      " NN   " MMO NN  OO          NN     - 9&8DIs FF,c|jd|d}t|jd|dd|_|jjd|jz|jj t |y)Nrsrrz.so man8/%s_selinux.8)r6rrrrrr)rrr6s r<__gen_man_page_linkzManPage.__gen_man_page_linksU$(IIu5DIIu=sC  -?@   d rScg|_i|_g|_|j|jD]} t|rE|j }|j }t|D]}|j|||_||_ttjtjd|zd|j|<|j|j|j|j!|j#|j%|j'|j)|j+|j-|j/y#t$rYQwxYw)Nz%srf) anon_listrfptypes _get_ptypestypealias_typesrr_typealias_gen_manKeyErrorrXr0rHrg_header _entrypoints_process_typesrr_nsswitch_domainrr _file_context_public_contentr)r domain_typerrrs r<__gen_man_pagezManPage.__gen_man_pages;  ;;K ";/B%)%7%7M,[9//2: DG)6D&,0 hmmdVaMa0b+cdp+qDOOK ('             sAE77 FFc|jD]T}|j|js|j|js:|jj |Vyr)r startswithrrrrJ)rros r<rzManPage._get_ptypessC!!A||DOO, T__0M ""1%"rSc|jd|ddd|_g|_d|_t |jd|_|j |dd|j|j jy)Nrsr]rrEr) r6rportsbooltextrr _typealiasrr)rrs r<rzManPage._typealias_gen_mansc26))QsVD  t))3/ #2   rSc|jjd|tdz|jjd||jdz|jjdd|jizy)Nz\.TH "%(typealias)s_selinux" "8" "%(date)s" "%(typealias)s" "SELinux Policy %(typealias)s") typealiasdatez .SH "NAME" %(typealias)s_selinux \- Security Enhanced Linux Policy for the %(typealias)s processes .SH "DESCRIPTION" %(typealias)s_t SELinux domain type is now associated with %(domainname)s domain type (%(domainname)s_t). )rrzC Please see .B %(domainname)s_selinux man page for more details. r)rrman_dater)rrs r<rzManPage._typealiasst  t )8<= >   4??; < =   T__% & 'rSc|jjd|jtdz|jjdd|jizy)Nz_.TH "%(domainname)s_selinux" "8" "%(date)s" "%(domainname)s" "SELinux Policy %(domainname)s")rra .SH "NAME" %(domainname)s_selinux \- Security Enhanced Linux Policy for the %(domainname)s processes .SH "DESCRIPTION" Security-Enhanced Linux secures the %(domainname)s processes via flexible mandatory access control. The %(domainname)s processes execute with the %(domainname)s_t SELinux type. You can check if you have these processes running by executing the \fBps\fP command with the \fB\-Z\fP qualifier. For example: .B ps -eZ | grep %(domainname)s_t r)rrrrrs r<rzManPage._headersP  w'+IJ K  T__% & 'rSc|j|ddj|j|dddz}|ddk(r|dd}|S)Nrrrt.)rlowerrr;rs r<_format_boolean_desczManPage._format_boolean_desc's\!!!$Q'*002T5G5G5J15Mab5QQ 8s?9D rSc <d}|j|jzD]}\}}|jdr*||jvr|jj |A||j vrP|d|j |d|d|j|d|d z }|S)NrE anon_write .PP If you want to , you must turn on the z boolean. z" by default. .EX .B setsebool -P z 1 .EE )rrendswithrrJrr  enabled_str)rrr;enableds r<_gen_bool_textzManPage._gen_bool_text-s**TZZ7JAwzz,'AT^^,C%%a(D...   #Q(8(8(A1FF 8rSc|j|_|jdk7r\|jjd|jd|jd|jj|jyy)NrEzN .SH BOOLEANS SELinux policy is customizable based on least access required. zg policy is extremely flexible and has several booleans that allow you to manipulate the policy and run z% with the tightest access possible. )r(rrrrrs r<rzManPage._booleans@s]++- ==B  GGMM  ) * GGMM$-- ( rSc g}ddg}d}|jjD]%}d|j|vs|j|'t|rR|jj d|D]2}|d|j |ddj|d |d |d z }4|jj |y) Nauthlogin_nsswitch_use_ldapkerberos_enabledrEnsswitch_domainz .SH NSSWITCH DOMAIN r#z for the , r$ boolean. .EX .B setsebool -P  1 .EE )rfrrJrnrrr rm)rnsswitch_typesnsswitch_booleansnsswitchbooltextrr;s r<r zManPage._nsswitch_domainLs:] ^ _A GGMM D&t9 - '!DGGMM 4y12#45'rSc <g}g}|jD]S}|j|js|j|||jvs?||j|dz}Ut |dk(ry|j i}|D]o}d}|D]+}|j|s||j|d}n|r8tD]/}|j|s|jds'g||dd<oqg} |D]%} t || dkDs| j| '|jjdd|jizt | dkDr`|jjd | D]@}|jjd |j||jd d d zB|jjd|j|ddz|jjdd|jiz|j |D]}|jjd|dtj|d||jvsGd} t |j|ddkDshd} |jjd| d|j|dd|j|dddD] } |jjd| z"|jjdy)NregexrFTz(/.*)?ia .SH FILE CONTEXTS SELinux requires files to have an extended attribute to define the file type. .PP You can see the context of a file using the \fB\-Z\fP option to \fBls\bP .PP Policy governs the access confined processes have to these files. SELinux %(domainname)s policy is very flexible allowing users to setup their %(domainname)s processes in as secure a method as possible. .PP rz .PP .B EQUIVALENCE DIRECTORIES a .PP %(domainname)s policy stores data with multiple different file context types under the %(equiv)s directory. If you would like to store the data in a different directory you can use the semanage command to create an equivalence mapping. If you wanted to store this data under the /srv directory you would execute the following command: .PP .B semanage fcontext -a -e %(equiv)s /srv/%(alt)s .br .B restorecon -R -v /srv/%(alt)s .PP rsrt)requivalta .PP .B STANDARD FILE CONTEXT SELinux defines the file context types for the %(domainname)s, if you wanted to store files with these types in a different paths, you need to execute the semanage command to specify alternate labeling and then use restorecon to put the labels on disk. .B semanage fcontext -a -t %(type)s '/srv/%(domainname)s/content(/.*)?' .br .B restorecon -R -v /srv/my%(domainname)s_content Note: SELinux often uses regular expressions to specify labels that match multiple files. )rrz= .I The following file types are defined for %(domainname)s: z .EX .PP .B z .EE - r9rErsz .br .TP 5 Pathz: z, %sa .PP Note: File context can be temporarily modified with the chcon command. If you want to permanently change the file context you need to use the .B semanage fcontext command. This will modify the SELinux labeling database. You will need to use .B restorecon to apply the labels. )rrrrJrrnrM equiv_dirsr%rrrKr0get_description) rflistmpathsromdirsmprbmder@r:pluralxs r<r zManPage._file_contexts$$A||DOO, Q ##dkk!nW&==F % v;!   BE==$"I$$R( E  #A}}Q'BKK,A)+b"g$A58}q  Q  T__% & ' u:> GGMM  __qb9IJKL  __eAh7 8 9  T__%& '  A GGMM ( " "1 %' (DKKt{{1~g./!3 FGGMM Q(+ #-. "[[^G4QR8 fqj19).   rScd}|jD]\}||jk(r|j|jr|d|zz }|j|jdzsU|d|zz }^|jj |y)NrEz, %s_selinux(8)r@)r_rrrrr)rretrPs r< _see_alsozManPage._see_alsos{ADOO#||DOO,(1,,||DOOc12(1,,   crSc ht|jdkDr|jjdd|jiz|jD]`}|j |ddj |j |dddz}|jjd|d|d|d byy) Nra, .SH SHARING FILES If you want to share files with multiple domains (Apache, FTP, rsync, Samba), you can set a file context of public_content_t and public_content_rw_t. These context allow any of the above domains to read the content. If you want a particular domain to write to the public_content_rw_t domain, you must set the appropriate boolean. .TP Allow %(domainname)s servers to read the /var/%(domainname)s directory by adding the public_content_t file type to the directory and by restoring the file type. .PP .B semanage fcontext -a -t public_content_t "/var/%(domainname)s(/.*)?" .br .B restorecon -F -R -v /var/%(domainname)s .pp .TP Allow %(domainname)s servers to read and write /var/%(domainname)s/incoming by adding the public_content_rw_t type to the directory and by restoring the file type. You also need to turn on the %(domainname)s_anon_write boolean. .PP .B semanage fcontext -a -t public_content_rw_t "/var/%(domainname)s/incoming(/.*)?" .br .B restorecon -F -R -v /var/%(domainname)s/incoming .br .B setsebool -P %(domainname)s_anon_write 1 rrrr#r$r/r0)rnrrrrrrrs r<r zManPage._public_contents t~~  " GGMM(T__%)& '*^^))!,Q/288:T=O=OPQ=RST=UVWVX=YY  Q$- #rSc|jjdt|jdkDr|jjd|jdk7r|jjd|jjd|j z|jdk7r|jjd|j y)Na# .SH "COMMANDS" .B semanage fcontext can also be used to manipulate default file context mappings. .PP .B semanage permissive can also be used to manipulate whether or not a process type is permissive. .PP .B semanage module can also be used to enable/disable/install/remove policy modules. rzF .B semanage port can also be used to manipulate the port definitions rEzA .B semanage boolean can also be used to manipulate the booleans z .PP .B system-config-selinux is a GUI tool available to customize SELinux policy settings. .SH AUTHOR This manual page was auto-generated using .B "sepolicy manpage". .SH "SEE ALSO" selinux(8), %s(8), semanage(8), restorecon(8), chcon(1), sepolicy(8)z, setsebool(8))rrrnrrrrOrs r<rzManPage._footerAs    tzz?Q  GGMM  ==B  GGMM   HLP?? \ ] ==B  GGMM* + rSc|||jdfvry|jdr|D]}||j|vsyy)NrcFrT)rr%rV)rcheckrfas r< _valid_writezManPage._valid_writeksE TYY) ) >>$  5))  rSc tfdtjDcgc]}|d }}t|dk(ryjj dt|dkDrddj |z}nd|dz}jj d jd |d jd d |vr,|jd jj dg}|D]&}|jvs|j|dz }(jj ddj |zycc}w)NcN|djk(xr|ddk(xrd|dvS)Nsourceclassfile entrypointpermlistr)yrs r<z&ManPage._entrypoints..us5 hK499 $ _7v)= _,RST^R_B_ _rStargetrz .SH "ENTRYPOINTS" rz\fB%s\fP file typesr.z\fB%s\fP file typez The z'_t SELinux type can be entered via the z(. The default entrypoint paths for the z_t domain are the following: bin_tz] All executables with the default executable label, usually stored in /usr/bin and /usr/sbin.r?z %s) filterr0get_all_allow_rulesrnrrrmrremover)rrL entrypointsentrypoints_strpathsr[s` r<r zManPage._entrypointstsJ,24`  ( ( *-  - qq{-  { q     { a 5 +8NNO4{1~EO    : ; k !   w ' GGMM` a%JT[[(Z099&   % ? s E c ttjtjd}|j |dvry|j jdd|jizy#t$rYywxYw)Nmcs_constrained_typerVa .SH "MCS Constrained" The SELinux process type %(type)s_t is an MCS (Multi Category Security) constrained type. Sometimes this separation is referred to as sVirt. These types are usually used for securing multi-tenant environments, such as virtualization, containers or separation of users. The tools used to launch MCS types, pick out a different MCS label for each process group. For example one process might be launched with %(type)s_t:s0:c1,c2, and another process launched with %(type)s_t:s0:c3,c4. The SELinux kernel only allows these processes can only write to content with a matching MCS label, or a MCS Label of s0. A process running with the MCS level of s0:c1,c2 is not allowed to write to content with the MCS label of s0:c3,c4 r) rXr0rHrY StopIterationrrrr)rris r<rzManPage._mcs_typessw #' h6H6HJ`(a#b  9909 9    t   !    s-A,, A87A8c2jg ttfdtjddz ttfdtj }|t |dk(ryg}ddg}|D]4}j|d|s|d|vs!|j|d6t |dk(ryjjdjjd jz|jd |vrd g}|D]d}jjd |z|jvs0j|d D] }jjd |z"fy#YRxYw)Nc(|djk(S)Nr%r]rLrs r<r_z!ManPage._writes..sai499.DrSrrfch|dvxr)tddgj|dxr|ddk(S)NrXrrr\rYrZ)setissubset)rLsrc_lists r<r_z!ManPage._writes..sF hK8 # ! ! " + +AjM : ! gJ&  !rS proc_type sysctl_typer`z .SH "MANAGED FILES" z The SELinux process type %s_t can manage files labeled with the following file types. The paths listed are the default paths for these file types. Note the processes UID still need to have DAC permissions. file_typez .br .B %s r?z %s .br )rlistrbr0get_all_types_inforcrnrUrJrrrrMr)rr\ all_writesrfr|ror6rqs` @r<rzManPage._writessII;  V$DhFaFaFcdefghiuv vH !  ( ( * ,-  s8}1  !=1 A  8j9X;j0%%ak2 z?a        oo   * $%JA GGMM  DKK KKN73DGGMM# #  4?  s 3FFcf|j|jvr|j|jSy)Ns0)rrrs r<_get_users_rangezManPage._get_users_ranges, ??d22 2''8 8rScp|jjdd|jiz|jjd|j|j|j dzd|j vr:d|j vr+|jjdd|jizyyy)Nzd.TH "%(type)s_selinux" "8" "%(type)s" "mgrepl@redhat.com" "%(type)s SELinux Policy documentation"ra .SH "NAME" %(user)s_u \- \fB%(desc)s\fP - Security Enhanced Linux Policy .SH DESCRIPTION \fB%(user)s_u\fP is an SELinux User defined in the SELinux policy. SELinux users have default roles, \fB%(user)s_r\fP. The default role has a default type, \fB%(user)s_t\fP, associated with it. The SELinux user will usually login to a system with a context that looks like: .B %(user)s_u:%(user)s_r:%(user)s_t:%(range)s Linux users are automatically assigned an SELinux users at login. Login programs use the SELinux User to assign initial context to the user's shell. SELinux policy uses the context to control the user's access. By default all users are assigned to the SELinux user via the \fB__default__\fP flag On Targeted policy systems the \fB__default__\fP user is assigned to the \fBunconfined_u\fP SELinux user. You can list all Linux User to SELinux user mapping using: .B semanage login -l If you wanted to change the default user mapping to use the %(user)s_u user, you would execute: .B semanage login -m -s %(user)s_u __default__ )rr&r?login_userdomainz If you want to map the one Linux user (joe) to the SELinux user %(user)s, you would execute: .B $ semanage login -a -s %(user)s_u joe r&)rrrrrzrfrrs r<rzManPage._user_headers  |12 3  >yy$//D|j |j d d }t |dkDs|jjd |jz|D]<}||D]2\}}|jjd d j|z4>3y)Nr)networkz .SH NETWORK r6 name_bindz .TP The SELinux user z&_u is able to listen on the following z ports. z .B %s r:r7 name_connectzJ .TP The SELinux user %s_u is able to connect to the following tcp ports. ) r0rrrget_network_connectrrnrrm)rrnetportdictr;rrs r<rzManPage._network_s9$   "C22499c;OH8}q   "A$,QK5 ' hhuo'%0" 22499e^TH8}q   "A$,QK5 ' hhuo'%0"%"rSc6ttfdtj}jj d|)jj dj zyjj dj zy)Nc|djk(xr<|ddk(xr2|ddk(xr(tgdjt|dS)NrXr`user_home_typerYrZ)ioctlreadgetattrexecuteexecute_no_transrr\)rrorprms r<r_z$ManPage._home_exec..}sg hK499 $ r hK+ + r gJ&  r S T ] ]^abcdnbo^p q rrSz .SH HOME_EXEC z; The SELinux user %s_u is able execute home content files. z? The SELinux user %s_u is not able execute home content files. )rurbr0rcrrr)rr\s` r<rzManPage._home_exec|s r  ( ( * ,-      GGMM oo  GGMM oo rScX|jjdd|jizy)Na .SH TRANSITIONS Three things can happen when %(type)s attempts to execute a program. \fB1.\fP SELinux Policy can deny %(type)s from executing the program. .TP \fB2.\fP SELinux Policy can allow %(type)s to execute the program in the current user type. Execute the following to see the types that the SELinux user %(type)s can execute without transitioning: .B sesearch -A -s %(type)s -c file -p execute_no_trans .TP \fB3.\fP SELinux can allow %(type)s to execute the program and transition to a new type. Execute the following to see the types that the SELinux user %(type)s can execute and transition: .B $ sesearch -A -s %(type)s -c process -p transition r)rrrrs r<rzManPage._transitionss*  .tyy/ rSc |jjdd|jiz|jjd|j|jdzg}|jD]2}|jdz|j|vs"|j |4t |dkDrRd}t |dkDrAd }|jjd d j|d |d |jdyyy)Nzd.TH "%(user)s_selinux" "8" "%(user)s" "mgrepl@redhat.com" "%(user)s SELinux Policy documentation"r&a[ .SH "NAME" %(user)s_r \- \fB%(desc)s\fP - Security Enhanced Linux Policy .SH DESCRIPTION SELinux supports Roles Based Access Control (RBAC), some Linux roles are login roles, while other roles need to be transition into. .I Note: Examples in this man page will use the .B staff_u SELinux user. Non login roles are usually used for administrative tasks. For example, tasks that require root privileges. Roles control which types a user can run processes with. Roles often have default types assigned to them. The default type for the %(user)s_r role is %(user)s_t. The .B newrole program to transition directly to this role. .B newrole -r %(user)s_r -t %(user)s_t .B sudo is the preferred method to do transition from one role to another. You setup sudo to transition to %(user)s_r by adding a similar line to the /etc/sudoers file. USERNAME ALL=(ALL) ROLE=%(user)s_r TYPE=%(user)s_t COMMAND .br sudo will run COMMAND as staff_u:%(user)s_r:%(user)s_t:LEVEL When using a non login role, you need to setup SELinux so that your SELinux user can reach %(user)s_r role. Execute the following to see all of the assigned SELinux roles: .B semanage user -l You need to add %(user)s_r to the staff_u user. You could setup the staff_u user to be able to use the %(user)s_r role with a command like: .B $ semanage user -m -R 'staff_r system_r %(user)s_r' staff_u )rr&rrrErrBz SELinux policy also controls which roles can transition to a different role. You can list these rules using the following command. .B search --role_allow SELinux policy allows the r.z rolez can transition to the z _r role. )rrrrrrJrnrm)rtrolesr|rKs r<rzManPage._role_headers  |12 3  )Ryy$//2S)3) 4T!!A%)9)9!)<< a " v;?F6{Q  yy&$// 3 4 rS)z/tmprsFF)*rrrrr+r&rrrrrrrrrrrrr r(rr r rr rOr rrUr rrrzrrrrrrrrrrZrSr<rrYsLy)KOM54n "">@& '&'$ & )(0'2)5VjX  D(T!F !. ` +!Z'R&  :(4@4rSr)r)__all__rwrr0rtimerrrCstrftimegmtimeintenvironr3rr+r=rFrGrRrWr[r_rrVrjrqrrrrrZrSr<rs0 5  C E   i8* ?R^d]et~sLRKST X 4==[T[[ BJJNN.  <=&? @ 0  , ,  /  e1e1PQ4Q4rS