web/html/docs/selinux-user-guide/f11/nl-NL/pdf Security-Enhanced_Linux.pdf, NONE, 1.1
by Eric Christensen
Author: sparks
Update of /cvs/fedora/web/html/docs/selinux-user-guide/f11/nl-NL/pdf
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv7790
Added Files:
Security-Enhanced_Linux.pdf
Log Message:
Adding nl-NL pdf.
--- NEW FILE Security-Enhanced_Linux.pdf ---
%PDF-1.4
%ª«¬
4 0 obj
<<
/Title (Security-Enhanced Linux - Gebruikers gids)
/Author (Logo)
/Creator (DocBook XSL Stylesheets with Apache FOP)
/Producer (Apache FOP Version SVN branches/fop-0_95)
/CreationDate (D:20090625110325+10'00')
>>
endobj
5 0 obj
<<
/N 3
/Length 10 0 R
/Filter /FlateDecode
>>
stream
xígPÙOwOÌC!A¢$ç$šÀF&dqVI ¢®.AVQÅ((`@wE@YWeôÇÞª{ëÞº?oÝù~~êíSõõé>UýT
óq!gŠ%¯d°ã
Óù+žÂÁBüÆBùÆ;¿Îñ÷uXá2
T&ÐFÀX[àÜ7ð!`#àXø ä] pTZÐ
b å@»¡Bšªê &è'ètº
A¡ húú#0 ŠÃ
°¬³a;Øö7À1p
çÁûà
ž>wÀá[ð,_Â@QFt6âx#¡H4ÂG¶#H9RŽ"ÝH?r sÈEC1Qº(K+*
ýÁ00,ÆÇdc01mK!Ì$fÅÊ`u°VXol6
ÄÂ^Äc§°ïqDÎçÅñp¹žr\3®7Æ-áÅñêxŒ7ß/Æ7à»ñwðSø%E°"øâ »VÂUÂ8á
HT!}qÄÄ
âiâuâñJÒ&9ÂHé€}€€K€€7d2YlK%§÷ÈWÈOÉïÅhbzbnb\±bÕbbÃb¯(x:ŲE)§¥Ü¡ÌãÅ5ÄÄ#Ä·W_ IJxK$II4KÜ¡b©T'*G=FœB€!4UCÛMk ]¥MÑ1tÝO/€ÿH€ÏKR%%%·HVK^0ÃÈ(fa2>J)HÙIEIíjZ¶.nþ(ÃqIÙ/Ó)óD%«-ë#){Döªì]ÎR#W wFî<,¯-ï+-L~@~AAQÁE!Y¡RáÂ"CÑV1^±L±GqVŠd§TŠtQéSiÇLdV0ûóÊòÊ®ÊéÊuÊÊK*,
3 ËÝÀÚ°eò7^ØDÙ±él8:<(Œ9üSwD}ÄB€[dMä<ÇsókË-ãÎFYEFMG[EFÏÄXŵ-s«{ï_¿àp"a91(±- tGå%ðú6+nÞ²y(Y'9?Ybr0eïÁoL
R7€v¥ÑW~ÌééߥOdXgTgŒÏÌ<»EboËÀVí{·Ng9gÏFes²{ssvåLl³ÛV·Ú¹œwêŒS;]vÜEØ°ëv®AniîÛÝA»»óòvæM~çò]KŸX>?låÚïQßÇ}?žwõÞÊœ_
ž7
Ë?qnþ`øCÅËû¢÷
)ÁðJF÷Ûì?Y*QU:yÀë@G³¬ ìíÁMo×"J?$šð¬èªT«,©üT[5Rm_ÝV#_³·fñ0÷ððÛ#µ
µ
µÆ}PçR×Q¯Q_~s,ãØóÀþãìãM²
OðNNúìk2kjjo.n[Ò[fO
ºû£ã]ºum¶ÂÓàtúé?
ÿ4zÆãLïYöÙÖÕ®i§µt@[;æ;c;]!]CçÜÏõv[v·ÿ¢÷ËóÊç«/H^(î!ôäõ,_̺žp)ùÒÜåËœz_ Ÿr¿Ï§oðªÇÕëׯ]é·ë¿xÝêúù7ÎÝdßìŒez«cÀd ý¶ÉíöAÓÁ;fwºîßíZ3Ô3l3|ùãœk÷ÝîßY;240ú`,lLðû`æaâÃ×2-=Þ9/x"þ€ü©üÓú_µ~m
.L8N<ó{öx3ùò·Ôß>Må='?/Vn19?ë<{÷ÅúS/_.Íåÿ.ñ{Í+ÍW?ÿaûÇÀ|ðüÔkþëå?ÞÈŒ9ñÖømïº
§ïÞ--ŒyòûCÿÇ ÓK°*>k}îþâñe|9iyYä"¹ÈD. r\@ä"¹ÈD. rü»À׳Bñ1
@e
endstream
endobj
6 0 obj
[/ICCBased 5 0 R]
endobj
7 0 obj
<<
/Type /Metadata
/Subtype /XML
/Length 11 0 R
/Filter /FlateDecode
>>
stream
xSÁÓ0Œ÷+¬pD"ÅJ³-
C»¬6ÕÂ
¥öÛÆjjÛQÓþ>_X'M»¥» ž=ûÍ<óü«ŠÊÙ,ZÂJȱ÷ëÇO >öŸæd^]C!>í5dûÛ¯YÌœ«t0HÚlª
Ø5RÚœ«%PW·×ØKæôn2í!î4ö
k+ñv»
¶Ã@éã8Æ$ÂQä;ovÒæ/Í«£ÂÓ¢²BÉ^³PUë²áC Öà0±ZnŸTµ{gÔ
[B«µ°;ÿ,rÉ£u|ôºkÐ7 >q::Ó[¥ÓZ©®wŒèº<·Ð¿8ï}U4"$öÉ[?-Â!F¯CB Ipª?Iá÷Ì£:KV DÀÔ»cø<× ·éœ³Ú
Á_Üõ xÍ@§ïÜ7)
ûb>ž_¶<-;v€[PÝmâ# º;Ó
endstream
endobj
10 0 obj
2419
endobj
11 0 obj
476
endobj
12 0 obj
<< /Length 13 0 R /Filter /FlateDecode >>
stream
xåK%Çq
÷ý+îFKòý
ùl»`XZ×bX€JNÁFµX])øYÛõ%æë-Pzj9AWcº KG
Å
»Ê.ÅNÔwßÍð®\ÌmxŒ
\Êýt÷És2œÍêcQnur+1È»£¹ªQÅpè5¶¶"#X¢¹²X°Ð:$â.fž5çÊv9Ž\bAó-€íö°MYOâW× æ6ÎY|ø·Çfc&DÛ
_} ×l£|×±ùÒByhGíö¥byÌ·`Öµ³L)=eÊKÃÀf=åÉü,µI8®WÒŠq1xøq@vàÝü)%ø1íwNÃzW"ž³L~ª^.È?Þ¥%"¯KlÄé«_-Œ_yãKÑþ)2y%JLQ%u$)ºwáPåK³b±0s
ÐÀ5Zl>®ÀH%âàÔáÌÐÈ€Þ ¬Ë²ÌÈ\5ílÜ0]<ÂQÒ26¹¶Ž y%¶œð."+©œonxè<Ë€Õzè"5OµJrm¥t!RN~Å"ZcE
£ Ì©}G6çNò§xms^IäËtÍ;Í·X?#ò.S°âkØFµDPµDIšÛJ3²Û70WªÆŒ«y¥Õý÷³ÈÌÁì
YÖ
ÅÂ=åuµÉ?AÞ¹bÚ$æ§n{,§|æQ)DREÕÁ DÅTDCêu$òVãD(@*0ÔÞw$îGÜÁÐo9Ž;£*€GnλÓÐó=áò9>>0<KÝ@ý#(tá2ŒDQ+T2qyÝ{ÌkK+0l^0ÝaAöÖVWÌÎ7Ö2VÚWóιB±£Ç`á»Ì~¢
CU{"A1ŽóFš`Ÿ=ÓñÏPŽûš¬ŸV²FèàèÕHÑÐÙÕoÁHD_¶æ€z?&J*ÐÅ÷e%öOë=)y×ì]%Ì.D¹ê}k{íf
%ý\óm÷f
?¢ÞÇýØ:ªÖe®ê+²Ö[V
K[U}¥sh{UOQ}
Gµ¢w0jmÞZœþð,Q
4W.µek§ÌIPZV4jTî€àmDázËت»(ÖMhcN;_[Võ$ëAºŒÊÈLlé²÷Q:xÎÃYúB/œÒQBæPbgÚM÷
â%Bx:þ2IJa:ªýœnðf³ {<Ø€cÆJRMqã©5ÞWvrðôiÓ8\š& º¬Ž"«}3¶îj^iõÄCÿý,Ø-fvÛ§rÄ¢Ë!43É&Ÿbºkím\ÆäÈʡ墲dÉ«mö$aC©¡DDê*ÃðÄÔ2*áG¶
ÌÛãLöiŸ£yM-:à"
Ô!»0TÓëMM¢"Â`Ÿíý,lŸ»Ÿ33ÔvÄsÇÛš@]<¯7]5C¶`ÆÄÌl8e¥¬ëŠ¶sìbßÆÌQÜWâèÊ6
G趮×:X'Ôð
¢qJy0sF;#vO×V'îÈF¿l¬)
íÑ¥Lêšj7ë
>ËGl#©ÚÊR¬y?¢düÖÊ°
§ Œ(ºQ
?ÔJéUiœtê
ͺPøbÓÝ`Dnÿî ªîBgzîÞ|WìyÅØ|~#¯1ÂðÝ.ÓNÚ1Š#UÝSƲ5P»ÆÐÚ|ÎÈj+67óJkó9Û·¶F:VKl£|d%4$³dEVûfl(õkT4¯Žyâÿ~€9WÖèxæ°3mØ°« aÙAÀät¡ëž(\iÏQÁ!°h@àNOk|[Oôºè#žÇùžª©#š%ÌtÑB³Ô°#ÅpS6ÝÑðÓ,æÈÉC[øšJÚÑÛÕuÔêÍæ7Ö>wܯÀYâ¶
Tì²9^6Ó&äº#:Ò7ìyÅÖwŠÎ3ÔÂEöÖn5TT©zî{«s¢cS.ï£$uá¯'ëJ2÷žŽïnÓG¶Ëÿ
#¹;'\Ý|ÈjjÄž³×ÿ>ÓèhõŽ«Ë¶¢ö'i.erÝ.?EU3öŒa°¹zî`j*©n'X-ðRѵõ+Á·$Ô|4^3Å Þê-0õ Ð ²d.¢b
VçÔÚzÍ=ëÙPUC_²DÝ°5Xv¢É8ól@/§»HâH¹µHeÎÄnkHrÉ$ÏE« =ÎGz©Fõ¹<Š¢û )d.NœlÕëåîãÐ$jÖØ>RÆ-¡SÌæÌqé¥nܧ;ŠòµmåÄ40çÞÅAO)HÉÂ}År!lÄ-u]wY·¥&ÉvkÙWŒ×%ÜÙùé©e?1ª°3.ùPJeTx
Î
BtÒa_1lèÉx8£ÂÍ:æ$-ÞÎmê¬n&ÅigÊVDzp$òîÎ(Ž ô®£<3èFÏfOŸVäRC±lka»<ßÉùâ?³³ä0£ÑBM'öõüùkðâkÇQóHŒQuPuÄGêüiŠ }ÉTЀxÚî+,g/øªð· /AOHv:#inNüºÀª÷e«GwJøæÛéÝ7qÞÑ?]ÍçñÔúŠ€®öÛŠPPØŽûš€÷è §ÑIÜÙl"tôBx¹µ0éDœ¡{Ìe%RºÑdS/òfß?ÑKºuç«nÕÞm¥Yí»Åú6ßÌ~hâì;HOöùðýÁ«%»¢BzémÜÓdêðäöù8È£H°³Âhj'Ü õæ€döSdYhM«GÉ(.ZÞÄ
Õ¯ùd©ªÛ¶Â YE*ÍÅöXùš=ÈD<!ÖÔµ®A3!£Ÿ!Ÿ³Î>Êãq]5:¶2œ] úoÒ£v{iYfñùqëIFÃi7;·£È0{|3ZRõ.^+¢ùºÞÏ šŽŸbÏKÈÀàý>£à|Ùl
±£ŒAŒ·Çh;åZ+
_x¿aÏWÌéQð>£Ó7k )ö
V:°Pô楜VÔÐH)FÙY¯ÅwÚ¢>[XrMŽö«íõTÏ
ÉA÷5ݪ§{2cî@yÙ¥ßòÝ#úŒ²®c¿7J³ÝE8wÄí|
`]Wë|'ø~ÄÐÕ¥mä¯-±Z±V®èn=X -]éÝ6Þ[ç;aH*Aóæw[)ê±ÂVûWûV5qGÏŸš[,Û}¬ãj=_ºUÜÔLwWŠGJUŸ5ÃÄ}°@ŒÜkjNºvŒÓFD"IDWÇ»5ÛštpŒÊóhHŽozEdŠ®Ú+ýÈŽT
©Ëg»F¡/± « Kêd÷±6=
êVë@rdi1ék±€_1Ú!²ŽQ¯Ëv²¥7ä»ZÌ£é6!¬ÈØ®#_ìÑ:hŒw»*ãNv»dMw£Â¯£n»[¿£Å^..c¥ûNžÏgê3ë-ÉÑУX³<8Â99J»Ë¶!§€Åñ:ÃÙvE#{·é>EÈ!Ýè80®Ýt
õ(±k±>uÄý|·n@¥¹rÞÑQ&}Hú`ÁÖéõ(ãšLòb|ãâ
ì^ýëÚñ,êz[®ü×êžyjº¹
2£ {ŸÅ èÖÍ.
MMDÄüŸÁ/²}F7$ú
Yy0¶<ðDÒËtºcuï߶ gÓßVÛ©&€ÑÛ~õŸp7Û¢7OÊ~£È
ÇBUbEÕ3îœÒôà
dÛm
ìò©Ä7!vK
w>ŽÓŸ[©uåBUþk)ré\kôÎ"ÚJêgp63fÿœÍ;VØ~;ŸìüîÏxýNwÿHqêì»A(Ù^>õ_OÌöóÓX¿|úõøPÖëçÝø±oX¿ØïX÷Ou]zA/y}P(qt]ôýô
îûóÙwó¢ÁãݹPºY@ùK¹éº B}©¶,@
~ú÷ý¹Ÿì®Ÿ~.ô°»Yš'cÕBNïeð:Ö}³ù/"yëœ'ôõÉ
ædÕuâp~£læO¿Ÿ~c¯2П0ËþÁô7cûHÚ-ÖçÓzY¹Õë·Èß>ý?©Éj[
endstream
endobj
8 0 obj
<<
/Resources 3 0 R
/Type /Page
/MediaBox [0 0 595 842]
/BleedBox [0 0 595 842]
/TrimBox [0 0 595 842]
/Parent 1 0 R
/Contents 12 0 R
>>
endobj
13 0 obj
4545
endobj
15 0 obj
<< /Type /Annot
/Subtype /Link
/Rect [ 356.22 665.72095 470.22 673.72095 ]
/C [ 0 0 0 ]
/Border [ 0 0 0 ]
/A << /URI (mailto:mmcallis@redhat.com)
/S /URI >>
/H /I
>>
endobj
17 0 obj
<< /Type /Annot
/Subtype /Link
/Rect [ 356.22 652.72095 458.22 660.72095 ]
/C [ 0 0 0 ]
/Border [ 0 0 0 ]
/A << /URI (mailto:dwalsh@redhat.com)
/S /URI >>
/H /I
>>
endobj
18 0 obj
<< /Type /Annot
/Subtype /Link
/Rect [ 356.22 639.72095 458.22 647.72095 ]
/C [ 0 0 0 ]
/Border [ 0 0 0 ]
/A << /URI (mailto:domg472@gmail.com)
/S /URI >>
/H /I
>>
endobj
19 0 obj
<< /Type /Annot
/Subtype /Link
/Rect [ 356.22 626.72095 482.22 634.72095 ]
/C [ 0 0 0 ]
/Border [ 0 0 0 ]
/A << /URI (mailto:eparis@parisplace.org)
/S /URI >>
/H /I
>>
endobj
20 0 obj
<< /Type /Annot
/Subtype /Link
/Rect [ 356.22 613.72095 464.22 621.72095 ]
/C [ 0 0 0 ]
/Border [ 0 0 0 ]
/A << /URI (mailto:jmorris@redhat.com)
/S /URI >>
/H /I
>>
endobj
21 0 obj
<< /Type /Annot
/Subtype /Link
/Rect [ 356.22 600.72095 464.22 608.72095 ]
/C [ 0 0 0 ]
/Border [ 0 0 0 ]
/A << /URI (mailto:sradvan@redhat.com)
/S /URI >>
/H /I
>>
endobj
22 0 obj
<< /Type /Annot
/Subtype /Link
/Rect [ 53.858 535.391 219.95801 544.74097 ]
/C [ 0 0 0 ]
/Border [ 0 0 0 ]
/A << /URI (http://www.opencontent.org/openpub/)
/S /URI >>
/H /I
>>
endobj
23 0 obj
<< /Type /Annot
/Subtype /Link
/Rect [ 133.278 404.391 312.11798 413.741 ]
/C [ 0 0 0 ]
/Border [ 0 0 0 ]
/A << /URI (http://fedoraproject.org/wiki/Legal/Export)
/S /URI >>
/H /I
>>
endobj
24 0 obj
[...10184 lines suppressed...]
0000571645 00000 n
0000419363 00000 n
0000419508 00000 n
0000571729 00000 n
0000419654 00000 n
0000419800 00000 n
0000571815 00000 n
0000419948 00000 n
0000420094 00000 n
0000571899 00000 n
0000420240 00000 n
0000420386 00000 n
0000571985 00000 n
0000420534 00000 n
0000420680 00000 n
0000420826 00000 n
0000420970 00000 n
0000421114 00000 n
0000421258 00000 n
0000421402 00000 n
0000421546 00000 n
0000572071 00000 n
0000421692 00000 n
0000421835 00000 n
0000572157 00000 n
0000421981 00000 n
0000422124 00000 n
0000572241 00000 n
0000422266 00000 n
0000422409 00000 n
0000572327 00000 n
0000422553 00000 n
0000422696 00000 n
0000422840 00000 n
0000431867 00000 n
0000432219 00000 n
0000431889 00000 n
0000432389 00000 n
0000572413 00000 n
0000572497 00000 n
0000432410 00000 n
0000572550 00000 n
0000432510 00000 n
0000432615 00000 n
0000432757 00000 n
0000432896 00000 n
0000433002 00000 n
0000433120 00000 n
0000433225 00000 n
0000433336 00000 n
0000433504 00000 n
0000433582 00000 n
0000433737 00000 n
0000433856 00000 n
0000433964 00000 n
0000434081 00000 n
0000434199 00000 n
0000434360 00000 n
0000434459 00000 n
0000434586 00000 n
0000434699 00000 n
0000434861 00000 n
0000434961 00000 n
0000435078 00000 n
0000435193 00000 n
0000435358 00000 n
0000435457 00000 n
0000435585 00000 n
0000435712 00000 n
0000435880 00000 n
0000435981 00000 n
0000436082 00000 n
0000436192 00000 n
0000436338 00000 n
0000436441 00000 n
0000436558 00000 n
0000436667 00000 n
0000436840 00000 n
0000436955 00000 n
0000437082 00000 n
0000437207 00000 n
0000437381 00000 n
0000437487 00000 n
0000437617 00000 n
0000437759 00000 n
0000437885 00000 n
0000438008 00000 n
0000438166 00000 n
0000438391 00000 n
0000438522 00000 n
0000438670 00000 n
0000438798 00000 n
0000438912 00000 n
0000439077 00000 n
0000439196 00000 n
0000439334 00000 n
0000439482 00000 n
0000439613 00000 n
0000439729 00000 n
0000439862 00000 n
0000440019 00000 n
0000440143 00000 n
0000440315 00000 n
0000572635 00000 n
0000440459 00000 n
0000440555 00000 n
0000440684 00000 n
0000440821 00000 n
0000440965 00000 n
0000441062 00000 n
0000441202 00000 n
0000441330 00000 n
0000572721 00000 n
0000441489 00000 n
0000572807 00000 n
0000441601 00000 n
0000441723 00000 n
0000441865 00000 n
0000441987 00000 n
0000442106 00000 n
0000442219 00000 n
0000442383 00000 n
0000442477 00000 n
0000442574 00000 n
0000442678 00000 n
0000442943 00000 n
0000455703 00000 n
0000455803 00000 n
0000455973 00000 n
0000456488 00000 n
0000457093 00000 n
0000457366 00000 n
0000466572 00000 n
0000466670 00000 n
0000466846 00000 n
0000467247 00000 n
0000467726 00000 n
0000467836 00000 n
0000468104 00000 n
0000485064 00000 n
0000485162 00000 n
0000485335 00000 n
0000485937 00000 n
0000486624 00000 n
0000486893 00000 n
0000500515 00000 n
0000500615 00000 n
0000500787 00000 n
0000501240 00000 n
0000501788 00000 n
0000501899 00000 n
0000502169 00000 n
0000522760 00000 n
0000522873 00000 n
0000523046 00000 n
0000523637 00000 n
0000524322 00000 n
0000524595 00000 n
0000542828 00000 n
0000542931 00000 n
0000543103 00000 n
0000543628 00000 n
0000544254 00000 n
0000544330 00000 n
0000544599 00000 n
0000561035 00000 n
0000561143 00000 n
0000561313 00000 n
0000561857 00000 n
0000562501 00000 n
0000562524 00000 n
0000562544 00000 n
0000562565 00000 n
0000562587 00000 n
0000562607 00000 n
0000562628 00000 n
0000562651 00000 n
0000562671 00000 n
0000562692 00000 n
0000562715 00000 n
0000562735 00000 n
0000562756 00000 n
0000562779 00000 n
0000562799 00000 n
0000562820 00000 n
0000562843 00000 n
0000562863 00000 n
0000562884 00000 n
0000562907 00000 n
0000562927 00000 n
trailer
<<
/Size 885
/Root 2 0 R
/Info 4 0 R
/ID [<CE9C16AEA393D88737468DA902D08FCF> <CE9C16AEA393D88737468DA902D08FCF>]
>>
startxref
572893
%%EOF
14 years, 10 months
web/html/docs/selinux-user-guide/f11/nl-NL/html-single/images icon.svg, NONE, 1.1 sealert_gui.png, NONE, 1.1 setroubleshoot_denial.png, NONE, 1.1 xguest.png, NONE, 1.1
by Eric Christensen
Author: sparks
Update of /cvs/fedora/web/html/docs/selinux-user-guide/f11/nl-NL/html-single/images
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv7054/images
Added Files:
icon.svg sealert_gui.png setroubleshoot_denial.png xguest.png
Log Message:
Adding images.
--- NEW FILE icon.svg ---
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:ns="http://ns.adobe.com/AdobeSVGViewerExtensions/3/"
xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://web.resource.org/cc/"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
version="1.0"
width="32"
height="32"
id="svg3017"
sodipodi:version="0.32"
inkscape:version="0.44+devel"
sodipodi:docname="book.svg"
sodipodi:docbase="/home/andy/Desktop">
<metadata
id="metadata489">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
</cc:Work>
</rdf:RDF>
</metadata>
<sodipodi:namedview
inkscape:window-height="480"
inkscape:window-width="858"
inkscape:pageshadow="0"
inkscape:pageopacity="0.0"
guidetolerance="10.0"
gridtolerance="10.0"
objecttolerance="10.0"
borderopacity="1.0"
bordercolor="#666666"
pagecolor="#ffffff"
id="base"
inkscape:zoom="1"
inkscape:cx="16"
inkscape:cy="15.944056"
inkscape:window-x="0"
inkscape:window-y="33"
inkscape:current-layer="svg3017" />
<defs
id="defs3019">
<linearGradient
id="linearGradient2381">
<stop
style="stop-color:white;stop-opacity:1"
offset="0"
id="stop2383" />
<stop
style="stop-color:white;stop-opacity:0"
offset="1"
id="stop2385" />
</linearGradient>
<linearGradient
x1="415.73831"
y1="11.854"
x2="418.13361"
y2="18.8104"
id="XMLID_1758_"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(0.8362,0.5206,-1.1904,0.992,147.62,-30.9374)">
<stop
style="stop-color:#ccc;stop-opacity:1"
offset="0"
id="stop3903" />
<stop
style="stop-color:#f2f2f2;stop-opacity:1"
offset="1"
id="stop3905" />
<a:midPointStop
style="stop-color:#CCCCCC"
offset="0" />
<a:midPointStop
style="stop-color:#CCCCCC"
offset="0.5" />
<a:midPointStop
style="stop-color:#F2F2F2"
offset="1" />
</linearGradient>
<linearGradient
x1="500.70749"
y1="-13.2441"
x2="513.46442"
y2="-2.1547"
id="XMLID_1757_"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(0.6868,0.4269,-0.9821,0.821,111.6149,-5.7901)">
<stop
style="stop-color:#5387ba;stop-opacity:1"
offset="0"
id="stop3890" />
<stop
style="stop-color:#96bad6;stop-opacity:1"
offset="1"
id="stop3892" />
<a:midPointStop
style="stop-color:#5387BA"
offset="0" />
<a:midPointStop
style="stop-color:#5387BA"
offset="0.5" />
<a:midPointStop
style="stop-color:#96BAD6"
offset="1" />
</linearGradient>
<clipPath
id="XMLID_1755_">
<use
id="use3874"
x="0"
y="0"
width="744.09448"
height="600"
xlink:href="#XMLID_343_" />
</clipPath>
<linearGradient
x1="505.62939"
y1="-14.9526"
x2="527.49402"
y2="-0.7536"
id="XMLID_1756_"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(0.6868,0.4269,-0.9821,0.821,111.6149,-5.7901)">
<stop
style="stop-color:#b4daea;stop-opacity:1"
offset="0"
id="stop3877" />
<stop
style="stop-color:#b4daea;stop-opacity:1"
offset="0.51120001"
id="stop3879" />
<stop
style="stop-color:#5387ba;stop-opacity:1"
offset="0.64609998"
id="stop3881" />
<stop
style="stop-color:#16336e;stop-opacity:1"
offset="1"
id="stop3883" />
<a:midPointStop
style="stop-color:#B4DAEA"
offset="0" />
<a:midPointStop
style="stop-color:#B4DAEA"
offset="0.5" />
<a:midPointStop
style="stop-color:#B4DAEA"
offset="0.5112" />
<a:midPointStop
style="stop-color:#B4DAEA"
offset="0.5" />
<a:midPointStop
style="stop-color:#5387BA"
offset="0.6461" />
<a:midPointStop
style="stop-color:#5387BA"
offset="0.5" />
<a:midPointStop
style="stop-color:#16336E"
offset="1" />
</linearGradient>
<linearGradient
x1="471.0806"
y1="201.07761"
x2="481.91711"
y2="210.4977"
id="XMLID_1754_"
gradientUnits="userSpaceOnUse">
<stop
style="stop-color:#6498c1;stop-opacity:1"
offset="0.005618"
id="stop3863" />
<stop
style="stop-color:#79a9cc;stop-opacity:1"
offset="0.2332"
id="stop3865" />
<stop
style="stop-color:#a4cde2;stop-opacity:1"
offset="0.74049997"
id="stop3867" />
<stop
style="stop-color:#b4daea;stop-opacity:1"
offset="1"
id="stop3869" />
<a:midPointStop
style="stop-color:#6498C1"
offset="5.618000e-003" />
<a:midPointStop
style="stop-color:#6498C1"
[...3537 lines suppressed...]
style="stop-color:#B4DAEA"
offset="0" />
<a:midPointStop
style="stop-color:#B4DAEA"
offset="0.5" />
<a:midPointStop
style="stop-color:#B4DAEA"
offset="0.5112" />
<a:midPointStop
style="stop-color:#B4DAEA"
offset="0.5" />
<a:midPointStop
style="stop-color:#5387BA"
offset="0.6461" />
<a:midPointStop
style="stop-color:#5387BA"
offset="0.5" />
<a:midPointStop
style="stop-color:#16336E"
offset="1" />
</linearGradient>
<linearGradient
x1="506.09909"
y1="-11.5137"
x2="527.99609"
y2="2.7063999"
id="linearGradient17882"
xlink:href="#XMLID_1752_"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(0.6868,0.4269,-0.9821,0.821,111.6149,-5.7901)" />
<defs
id="defs3826">
<polygon
points="463.52,216.14 480.56,220.24 481.36,219.5 483.03,202.04 469.05,196.69 468.24,197.45 463.52,216.14 "
id="XMLID_338_" />
</defs>
<linearGradient
x1="468.2915"
y1="204.7612"
x2="479.39871"
y2="214.4166"
id="linearGradient17357"
gradientUnits="userSpaceOnUse">
<stop
style="stop-color:#5387ba;stop-opacity:1"
offset="0"
id="stop17359" />
<stop
style="stop-color:#96bad6;stop-opacity:1"
offset="1"
id="stop17361" />
<a:midPointStop
style="stop-color:#5387BA"
offset="0" />
<a:midPointStop
style="stop-color:#5387BA"
offset="0.5" />
<a:midPointStop
style="stop-color:#96BAD6"
offset="1" />
</linearGradient>
<clipPath
id="clipPath17364">
<use
id="use17366"
x="0"
y="0"
width="744.09448"
height="600"
xlink:href="#XMLID_338_" />
</clipPath>
<linearGradient
x1="506.09909"
y1="-11.5137"
x2="527.99609"
y2="2.7063999"
id="linearGradient17368"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(0.6868,0.4269,-0.9821,0.821,111.6149,-5.7901)">
<stop
style="stop-color:#b4daea;stop-opacity:1"
offset="0"
id="stop17370" />
<stop
style="stop-color:#b4daea;stop-opacity:1"
offset="0.51120001"
id="stop17372" />
<stop
style="stop-color:#5387ba;stop-opacity:1"
offset="0.64609998"
id="stop17374" />
<stop
style="stop-color:#16336e;stop-opacity:1"
offset="1"
id="stop17376" />
<a:midPointStop
style="stop-color:#B4DAEA"
offset="0" />
<a:midPointStop
style="stop-color:#B4DAEA"
offset="0.5" />
<a:midPointStop
style="stop-color:#B4DAEA"
offset="0.5112" />
<a:midPointStop
style="stop-color:#B4DAEA"
offset="0.5" />
<a:midPointStop
style="stop-color:#5387BA"
offset="0.6461" />
<a:midPointStop
style="stop-color:#5387BA"
offset="0.5" />
<a:midPointStop
style="stop-color:#16336E"
offset="1" />
</linearGradient>
<linearGradient
x1="296.4996"
y1="188.81061"
x2="317.32471"
y2="209.69398"
id="linearGradient2387"
xlink:href="#linearGradient2381"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(0.90776,0,0,0.90776,24.35648,49.24131)" />
<linearGradient
x1="296.4996"
y1="188.81061"
x2="317.32471"
y2="209.69398"
id="linearGradient5105"
xlink:href="#linearGradient2381"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(0.90776,0,0,0.90776,24.35648,49.24131)" />
<linearGradient
x1="296.4996"
y1="188.81061"
x2="317.32471"
y2="209.69398"
id="linearGradient5145"
xlink:href="#linearGradient2381"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(0.90776,0,0,0.90776,24.35648,49.24131)" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient2381"
id="linearGradient2371"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(0.90776,0,0,0.90776,24.35648,49.24131)"
x1="296.4996"
y1="188.81061"
x2="317.32471"
y2="209.69398" />
</defs>
<g
transform="matrix(0.437808,-0.437808,0.437808,0.437808,-220.8237,43.55311)"
id="g5089">
<path
d="M 8.4382985,-6.28125 C 7.8309069,-6.28125 4.125,-0.33238729 4.125,1.96875 L 4.125,28.6875 C 4.125,29.533884 4.7068159,29.8125 5.28125,29.8125 L 30.84375,29.8125 C 31.476092,29.8125 31.968751,29.319842 31.96875,28.6875 L 31.96875,23.46875 L 32.25,23.46875 C 32.74684,23.46875 33.156249,23.059339 33.15625,22.5625 L 33.15625,-5.375 C 33.15625,-5.8718398 32.74684,-6.28125 32.25,-6.28125 L 8.4382985,-6.28125 z "
transform="translate(282.8327,227.1903)"
style="fill:#5c5c4f;stroke:black;stroke-width:3.23021388;stroke-miterlimit:4;stroke-dasharray:none"
id="path5091" />
<rect
width="27.85074"
height="29.369793"
rx="1.1414107"
ry="1.1414107"
x="286.96509"
y="227.63805"
style="fill:#032c87"
id="rect5093" />
<path
d="M 288.43262,225.43675 L 313.67442,225.43675 L 313.67442,254.80655 L 287.29827,254.83069 L 288.43262,225.43675 z "
style="fill:white"
id="rect5095" />
<path
d="M 302.44536,251.73726 C 303.83227,259.59643 301.75225,263.02091 301.75225,263.02091 C 303.99609,261.41329 305.71651,259.54397 306.65747,257.28491 C 307.62455,259.47755 308.49041,261.71357 310.9319,263.27432 C 310.9319,263.27432 309.33686,256.07392 309.22047,251.73726 L 302.44536,251.73726 z "
style="fill:#a70000;fill-opacity:1;stroke-width:2"
id="path5097" />
<rect
width="25.241802"
height="29.736675"
rx="0.89682275"
ry="0.89682275"
x="290.73544"
y="220.92249"
style="fill:#809cc9"
id="rect5099" />
<path
d="M 576.47347,725.93939 L 582.84431,726.35441 L 583.25121,755.8725 C 581.35919,754.55465 576.39694,752.1117 574.98889,754.19149 L 574.98889,727.42397 C 574.98889,726.60151 575.65101,725.93939 576.47347,725.93939 z "
transform="matrix(0.499065,-0.866565,0,1,0,0)"
style="fill:#4573b3;fill-opacity:1"
id="rect5101" />
<path
d="M 293.2599,221.89363 L 313.99908,221.89363 C 314.45009,221.89363 314.81318,222.25673 314.81318,222.70774 C 315.02865,229.0361 295.44494,244.47124 292.44579,240.30491 L 292.44579,222.70774 C 292.44579,222.25673 292.80889,221.89363 293.2599,221.89363 z "
style="opacity:0.65536726;fill:url(#linearGradient2371);fill-opacity:1"
id="path5103" />
</g>
</svg>
14 years, 10 months
web/html/docs/selinux-user-guide/f11/nl-NL/html-single index.html, NONE, 1.1
by Eric Christensen
Author: sparks
Update of /cvs/fedora/web/html/docs/selinux-user-guide/f11/nl-NL/html-single
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv4594
Added Files:
index.html
Log Message:
Adding nl-NL single-html.
--- NEW FILE index.html ---
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Security-Enhanced Linux</title><link rel="stylesheet" href="./Common_Content/css/default.css" type="text/css"/><meta name="generator" content="publican"/><meta name="package" content=""/><meta name="description" content="Dieze gids behandelt het beheer en gebruik van Security-Enhanced Linux."/></head><body class=""><div class="book" lang="nl-NL"><div class="titlepage"><div><div class="producttitle"><span class="productname">Fedora</span> <span class="productnumber">11</span></div><div><h1 id="d0e1" class="title">Security-Enhanced Linux</h1></div><div><h2 class="subtitle">Gebruikers gids</h2></div><p class="edition">Uitgave 1.3</p><div><h3 class="corpauthor">
<span class="inlinemediaobject"><object data="Common_Content/images/title_logo.svg" type="image/svg+xml"> Logo</object></span>
</h3></div><div><div class="authorgroup"><div class="author"><h3 class="author"><span class="firstname">Murray</span> <span class="surname">McAllister</span></h3><div class="affiliation"><span class="orgname">Red Hat</span> <span class="orgdiv">Engineering Content Services</span></div><code class="email"><a class="email" href="mailto:mmcallis@redhat.com">mmcallis(a)redhat.com</a></code></div><div class="author"><h3 class="author"><span class="firstname">Daniel</span> <span class="surname">Walsh</span></h3><div class="affiliation"><span class="orgname">Red Hat</span> <span class="orgdiv">Security Engineering</span></div><code class="email"><a class="email" href="mailto:dwalsh@redhat.com">dwalsh(a)redhat.com</a></code></div><div class="author"><h3 class="author"><span class="firstname">Dominick</span> <span class="surname">Grift</span></h3><span class="contrib">Technische editor voor de Inleiding, SELinux Context, Gerichte tactiek, Werken met SELinux, Gebruikers beperken, en Fou
tzoeken hoofdstukken.</span> <div class="affiliation"><span class="orgname"/> <span class="orgdiv"/></div><code class="email"><a class="email" href="mailto:domg472@gmail.com">domg472(a)gmail.com</a></code></div><div class="author"><h3 class="author"><span class="firstname">Eric</span> <span class="surname">Paris</span></h3><span class="contrib">Technische editor voor de Bestandssystemen aankoppelen en Raw Audit Messages paragrafen.</span> <div class="affiliation"><span class="orgname">Red Hat</span> <span class="orgdiv">Security Engineering</span></div><code class="email"><a class="email" href="mailto:eparis@parisplace.org">eparis(a)parisplace.org</a></code></div><div class="author"><h3 class="author"><span class="firstname">James</span> <span class="surname">Morris</span></h3><span class="contrib">Technische editor voor de Inleiding en Gerichte tactiek hoofdstukken.</span> <div class="affiliation"><span class="orgname">Red Hat</span> <span class="orgdiv">Security Engineering
</span></div><code class="email"><a class="email" href="mailto:jmorris@redhat.com">jmorris(a)redhat.com</a></code></div><div class="author"><h3 class="author"><span class="firstname">Scott</span> <span class="surname">Radvan</span></h3><div class="affiliation"><span class="orgname">Red Hat</span> <span class="orgdiv">Engineering Content Services</span></div><code class="email"><a class="email" href="mailto:sradvan@redhat.com">sradvan(a)redhat.com</a></code></div></div></div><div><p class="copyright">Copyright © 2009 Red Hat, Inc.</p></div><hr/><div><div id="d0e35" class="legalnotice"><h1 class="legalnotice">Bericht</h1><div class="para">
Copyright <span class="trademark"/>© 2009 Red Hat, Inc. This material may only be distributed subject to the terms and conditions set forth in the Open Publication License, V1.0, (the latest version is presently available at <a href="http://www.opencontent.org/openpub/">http://www.opencontent.org/openpub/</a>).
</div><div class="para">
Fedora and the Fedora Infinity Design logo are trademarks or registered trademarks of Red Hat, Inc., in the U.S. and other countries.
</div><div class="para">
Red Hat and the Red Hat "Shadow Man" logo are registered trademarks of Red Hat Inc. in the United States and other countries.
</div><div class="para">
All other trademarks and copyrights referred to are the property of their respective owners.
</div><div class="para">
Documentation, as with software itself, may be subject to export control. Read about Fedora Project export controls at <a href="http://fedoraproject.org/wiki/Legal/Export">http://fedoraproject.org/wiki/Legal/Export</a>.
</div></div></div><div><div class="abstract"><h6>Samenvatting</h6><div class="para">Dieze gids behandelt het beheer en gebruik van Security-Enhanced <span class="trademark">Linux</span>®.</div></div></div></div><hr/></div><div class="toc"><dl><dt><span class="preface"><a href="#pref-Security-Enhanced_Linux-Preface">Voorwoord</a></span></dt><dd><dl><dt><span class="section"><a href="#d0e158">1. Document Conventie</a></span></dt><dd><dl><dt><span class="section"><a href="#d0e168">1.1. Typografische Conventies</a></span></dt><dt><span class="section"><a href="#d0e387">1.2. Pull-quote Conventies</a></span></dt><dt><span class="section"><a href="#d0e406">1.3. Noten en waarschuwingen</a></span></dt></dl></dd><dt><span class="section"><a href="#d0e426">2. We hebben terugkoppeling nodig!</a></span></dt></dl></dd><dt><span class="chapter"><a href="#chap-Security-Enhanced_Linux-Trademark_Information">1. Handelsmerk informatie</a></span></dt><dd><dl><dt><span class="section"><a href="
#chap-Security-Enhanced_Linux-Trademark_Information-Source_Code">1.1. Source Code</a></span></dt></dl></dd><dt><span class="chapter"><a href="#chap-Security-Enhanced_Linux-Introduction">2. Inleiding</a></span></dt><dd><dl><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Introduction-Benefits_of_running_SELinux">2.1. Voordelen van het draaien van SELinux</a></span></dt><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Introduction-Examples">2.2. Voorbeelden</a></span></dt><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Introduction-SELinux_Architecture">2.3. SELinux architectuur</a></span></dt><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Introduction-SELinux_on_Other_Operating_Systems">2.4. SELinux in andere operating systemen</a></span></dt></dl></dd><dt><span class="chapter"><a href="#chap-Security-Enhanced_Linux-SELinux_Contexts">3. SELinux context</a></span></dt><dd><dl><dt><span class="section"><a href="
#sect-Security-Enhanced_Linux-SELinux_Contexts-Domain_Transitions">3.1. Domein overgangen</a></span></dt><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-SELinux_Contexts-SELinux_Contexts_for_Processes">3.2. SELinux context voor processen</a></span></dt><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-SELinux_Contexts-SELinux_Contexts_for_Users">3.3. SELinux context voor gebruikers</a></span></dt></dl></dd><dt><span class="chapter"><a href="#chap-Security-Enhanced_Linux-Targeted_Policy">4. Gerichte tactiek</a></span></dt><dd><dl><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Targeted_Policy-Confined_Processes">4.1. Beperkte processen</a></span></dt><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Targeted_Policy-Unconfined_Processes">4.2. Onbeperkte processen</a></span></dt><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Targeted_Policy-Confined_and_Unconfined_Users">4.3. Beperkte en onbeperkt
e gebruikers</a></span></dt></dl></dd><dt><span class="chapter"><a href="#chap-Security-Enhanced_Linux-Working_with_SELinux">5. Werken met SELinux</a></span></dt><dd><dl><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Working_with_SELinux-SELinux_Packages">5.1. SELinux pakketten</a></span></dt><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Working_with_SELinux-Which_Log_File_is_Used">5.2. Welk log bestand wordt gebruikt</a></span></dt><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Working_with_SELinux-Main_Configuration_File">5.3. Het hoofd configuratie bestand</a></span></dt><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Working_with_SELinux-Enabling_and_Disabling_SELinux">5.4. SELinux aanzetten en uitzetten</a></span></dt><dd><dl><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Enabling_and_Disabling_SELinux-Enabling_SELinux">5.4.1. SELinux aanzetten</a></span></dt><dt><span class="secti
on"><a href="#sect-Security-Enhanced_Linux-Enabling_and_Disabling_SELinux-Disabling_SELinux">5.4.2. SELinux uitzetten</a></span></dt></dl></dd><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Working_with_SELinux-SELinux_Modes">5.5. SELinux modes</a></span></dt><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Working_with_SELinux-Booleans">5.6. Booleans</a></span></dt><dd><dl><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Booleans-Listing_Booleans">5.6.1. Booleans laten zien</a></span></dt><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Booleans-Configuring_Booleans">5.6.2. Booleans instellen</a></span></dt><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Booleans-Booleans_for_NFS_and_CIFS">5.6.3. Booleans voor NFS en CIFS</a></span></dt></dl></dd><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Working_with_SELinux-SELinux_Contexts_Labeling_Files">5.7. SELinux context - Bestan
den labelen</a></span></dt><dd><dl><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-SELinux_Contexts_Labeling_Files-Temporary_Changes_chcon">5.7.1. Tijdelijke veranderingen: chcon</a></span></dt><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-SELinux_Contexts_Labeling_Files-Persistent_Changes_semanage_fcontext">5.7.2. Permanente veranderingen: semanage fcontext</a></span></dt></dl></dd><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Working_with_SELinux-The_file_t_and_default_t_Types">5.8. De file_t en default_t types</a></span></dt><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Working_with_SELinux-Mounting_File_Systems">5.9. Het aankoppelen van bestandssystemen</a></span></dt><dd><dl><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Mounting_File_Systems-Context_Mounts">5.9.1. Context aankoppelingen</a></span></dt><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Mounting_File
_Systems-Changing_the_Default_Context">5.9.2. De standaard context veranderen</a></span></dt><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Mounting_File_Systems-Mounting_an_NFS_File_System">5.9.3. Het aankoppelen van een NFS bestandssysteem</a></span></dt><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Mounting_File_Systems-Multiple_NFS_Mounts">5.9.4. Meerdere NFS aankoppelingen</a></span></dt><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Mounting_File_Systems-Making_Context_Mounts_Persistent">5.9.5. Maak de context aankoppelingen blijvend</a></span></dt></dl></dd><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Working_with_SELinux-Maintaining_SELinux_Labels_">5.10. Het onderhouden van SELinux labels </a></span></dt><dd><dl><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Maintaining_SELinux_Labels_-Copying_Files_and_Directories">5.10.1. Bestanden en mappen kopiëren</a></span></dt><dt><s
pan class="section"><a href="#sect-Security-Enhanced_Linux-Maintaining_SELinux_Labels_-Moving_Files_and_Directories">5.10.2. Bestanden en mappen verplaatsen</a></span></dt><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Maintaining_SELinux_Labels_-Checking_the_Default_SELinux_Context">5.10.3. Het controleren van de standaard SELinux context</a></span></dt><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Maintaining_SELinux_Labels_-Archiving_Files_with_tar">5.10.4. Bestanden archiveren met tar</a></span></dt><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Maintaining_SELinux_Labels_-Archiving_Files_with_star">5.10.5. Bestanden archiveren met star</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="#chap-Security-Enhanced_Linux-Confining_Users">6. Gebruikers beperken</a></span></dt><dd><dl><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Confining_Users-Linux_and_SELinux_User_Mappings">6.1. Lin
ix en SELinux gebruiker afbeelding</a></span></dt><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Confining_Users-Confining_New_Linux_Users_useradd">6.2. Nieuwe Linux gebruikers beperken: useradd</a></span></dt><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Confining_Users-Confining_Existing_Linux_Users_semanage_login">6.3. Bestaande Linux gebruikers beperken: semanage login</a></span></dt><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Confining_Users-Changing_the_Default_Mapping">6.4. De standaard afbeelbing veranderen</a></span></dt><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Confining_Users-xguest_Kiosk_Mode">6.5. xguest: kiosk modus</a></span></dt><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Confining_Users-Booleans_for_Users_Executing_Applications">6.6. Booleans voor gebruikers die toepassingen uitvoeren</a></span></dt></dl></dd><dt><span class="chapter"><a href="#chap-Security
-Enhanced_Linux-Troubleshooting">7. Foutzoeken</a></span></dt><dd><dl><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Troubleshooting-What_Happens_when_Access_is_Denied">7.1. Wat gebeurt er als toegang wordt geweigerd</a></span></dt><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Troubleshooting-Top_Three_Causes_of_Problems">7.2. De top drie oorzaken van problemen</a></span></dt><dd><dl><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Top_Three_Causes_of_Problems-Labeling_Problems">7.2.1. Labelings problemen</a></span></dt><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Top_Three_Causes_of_Problems-How_are_Confined_Services_Running">7.2.2. Hoe draaien beperkte services?</a></span></dt><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Top_Three_Causes_of_Problems-Evolving_Rules_and_Broken_Applications">7.2.3. Het ontwikkelen van regels en gebrekkige toepassingen</a></span></dt></dl></dd><dt><spa
n class="section"><a href="#sect-Security-Enhanced_Linux-Troubleshooting-Fixing_Problems">7.3. Problemen herstellen</a></span></dt><dd><dl><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Fixing_Problems-Linux_Permissions">7.3.1. Linux rechten</a></span></dt><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Fixing_Problems-Possible_Causes_of_Silent_Denials">7.3.2. Mogelijke oorzaken van stille weigeringen</a></span></dt><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Fixing_Problems-Manual_Pages_for_Services">7.3.3. Manual pagina's voor services</a></span></dt><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Fixing_Problems-Permissive_Domains">7.3.4. Toelatende domeinen</a></span></dt><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Fixing_Problems-Searching_For_and_Viewing_Denials">7.3.5. Zoeken naar en het bekijken van weigeringen</a></span></dt><dt><span class="section"><a href="#sect-Security
-Enhanced_Linux-Fixing_Problems-Raw_Audit_Messages">7.3.6. Ruwe audit boodschappen</a></span></dt><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Fixing_Problems-sealert_Messages">7.3.7. sealert boodschappen</a></span></dt><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Fixing_Problems-Allowing_Access_audit2allow">7.3.8. Toegang toestaan: audit2allow</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="#chap-Security-Enhanced_Linux-Further_Information">8. Verdere informatie</a></span></dt><dd><dl><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Further_Information-Contributors">8.1. Contributors</a></span></dt><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Further_Information-Other_Resources">8.2. Other Resources</a></span></dt></dl></dd><dt><span class="appendix"><a href="#appe-Security-Enhanced_Linux-Revision_History">A. Revision History</a></span></dt></dl></div><div class="preface" lang=
"nl-NL"><div class="titlepage"><div><div><h1 id="pref-Security-Enhanced_Linux-Preface" class="title">Voorwoord</h1></div></div></div><div class="para">
De Fedora 11 SELinux gebruikers gids is voor mensen met minimale of geen ervaring met SELinux. Hoewel systeembeheer ervaring niet noodzakelijk is, is de inhoud van deze gids geschreven voor systeembeheer taken. Deze gids biedt een inleiding voor fundamentele concepten en practische toepassingen van SELinux. Na lezing van deze gids moet je een redelijk begrip hebben van SELinux.
</div><div class="para">
Dank je voor iedereen die aanmoediging, hulp en testen aanbood - het wordt zeer gewaardeerd. Met een speciale dank aan:
</div><div class="itemizedlist"><ul><li><div class="para">
Dominick Grift, Stephen Smalley, en Russell Coker voor hun bijdrages, hulp, en geduld.
</div></li><li><div class="para">
Karsten Wade voor zijn hulp, het toevoegen van een component voor deze gids aan <a href="https://bugzilla.redhat.com/"> Red Hat Bugzilla</a>, en voor het uitzoeken van web onderdak op <a href="http://docs.fedoraproject.org/">http://docs.fedoraproject.org/</a>.
</div></li><li><div class="para">
Het <a href="http://fedoraproject.org/wiki/Infrastructure">Fedora Infrastructure Team</a> voor het geven van onderdak.
</div></li><li><div class="para">
Jens-Ulrik Petersen voor het zorgen dat Red Hat Brisbane up-to-date Fedora spiegels heeft.
</div></li></ul></div><div class="section" lang="nl-NL"><div class="titlepage"><div><div><h2 class="title" id="d0e158">1. Document Conventie</h2></div></div></div><div class="para">
Dit handboek hanteert verscheidene conventies om bepaalde woorden of zinsdelen te benadrukken en aandacht te vestigen op specifieke delen van informatie.
</div><div class="para">
In PDF en papieren edities gebruikt dit handboek <a href="https://fedorahosted.org/liberation-fonts/">Liberation Fonts set</a> lettertypen. Het Liberation lettertype wordt ook gebruikt in HTML-edities indien dit lettertype op uw computer geïnstalleerd is. Indien dat niet het geval is, worden alternatieve, gelijkwaardige lettertypen gebruikt. Noot: bij Red Hat Enterprise Linux 5 en later wordt de Liberation Font set standaard meegeleverd.
</div><div class="section" lang="nl-NL"><div class="titlepage"><div><div><h3 class="title" id="d0e168">1.1. Typografische Conventies</h3></div></div></div><div class="para">
Vier typografische conventies worden gebruikt om aandacht te vestigen op specifieke woorden en zinsdelen. Deze conventies -en de omstandigheden waaronder zij gebruikt worden- luiden als volgt:
</div><div class="para">
<code class="literal">Mono-spaced Bold</code>
</div><div class="para">
Wordt gebruikt om systeem input, waaronder shell commando's, bestandsnamen en paden aan te geven. Wordt ook gebruikt bij toetsaanduiding of toetsencombinaties. Voorbeeld:
</div><div class="blockquote"><blockquote class="blockquote"><div class="para">
Om de inhoud van het bestand <code class="filename">mijn_onwijsgoed_verkopende_boek</code> in uw huidige directory te zien, voert u het commando <code class="command">cat mijn_onwijsgoed_verkopende_boek</code> in bij de shell-prompt en drukt u op <span class="keycap"><strong>Enter</strong></span> om het commando uit te laten voeren.
</div></blockquote></div><div class="para">
Bovenstaande bevat een bestandsnaam, een shell-commando en een toetsaanduiding, alle getoond in Mono-spaced Bold en alle te onderscheiden dankzij hun context.
</div><div class="para">
Toetsencombinaties kunnen worden onderscheiden van toetsaanduiding door het plusteken dat elk deel van een toetsencombinatie aan elkaar verbind. Voorbeeld:
</div><div class="blockquote"><blockquote class="blockquote"><div class="para">
Druk op <span class="keycap"><strong>Enter</strong></span> om het commando te laten uitvoeren.
</div><div class="para">
Druk op <span class="keycap"><strong>Ctrl</strong></span>+<span class="keycap"><strong>Alt</strong></span>+<span class="keycap"><strong>F1</strong></span> om naar de eerste virtuele terminal over te schakelen. Druk op <span class="keycap"><strong>Ctrl</strong></span>+<span class="keycap"><strong>Alt</strong></span>+<span class="keycap"><strong>F7</strong></span> om terug te keren naar uw X-Windows sessie.
</div></blockquote></div><div class="para">
De eerste zin benadrukt de bepaalde toets die moet worden ingedrukt. De tweede benadrukt twee reeksen van drie toetsen, waarbij de toetsen van elke reeks tegelijk moet worden ingedrukt.
</div><div class="para">
Indien broncode wordt besproken, worden klassennamen, functies, variabele namen en resultaten die in een paragraaf worden genoemd, weergegeven als hier boven afgedrukt, namelijk in <code class="literal">Mono-spaced Bold</code>. Voorbeeld:
</div><div class="blockquote"><blockquote class="blockquote"><div class="para">
Onder bestandsgerelateerde klassen vallen <code class="classname">filesystem</code> voor bestandsystemen, <code class="classname">file</code> voor bestanden, en <code class="classname">dir</code> voor directories. Elke klasse heeft haar eigen set van permissies.
</div></blockquote></div><div class="para">
<span class="application"><strong>Proportional Bold</strong></span>
</div><div class="para">
Wordt gebruikt om woorden of zinsdelen op een systeem aan te duiden, waaronder applicatie namen, dialoogtekst-boxen, gelabelde toetsen, checkbox en radiobutton labels, menutitels en submenutitels. Voorbeeld:
</div><div class="blockquote"><blockquote class="blockquote"><div class="para">
Kies <span class="guimenu"><strong>Systeem > Voorkeuren > Muis</strong></span> uit de hoofdmenubalk om <span class="application"><strong>Muis Voorkeuren</strong></span> te openen. In de <span class="guilabel"><strong>Knoppen</strong></span> tab, klik de <span class="guilabel"><strong>Linkshandige muis</strong></span> checkbox aan en klik <span class="guibutton"><strong>Sluiten</strong></span> om de primaire muisknop van links naar rechts te wisselen (waardoor de muis beter geschikt is geworden voor linkshandig gebruik).
</div><div class="para">
Om een speciaal teken in een <span class="application"><strong>gedit</strong></span> bestand op te nemen, kiest u <span class="guimenu"><strong>Toepassingen > Hulpmiddelen > Tekentabel</strong></span> uit de hoofdmenubalk. Vervolgens kiest u <span class="guimenu"><strong>Zoeken > Find…</strong></span> uit de <span class="application"><strong>Tekentabel</strong></span> menubalk, typ de naam van het teken in het <span class="guilabel"><strong>Zoek</strong></span> veld en klik <span class="guibutton"><strong>Volgende</strong></span>. Het teken dat u zoekt zal worden gemarkeerd in de <span class="guilabel"><strong>Tekentafel</strong></span>. Dubbel-klik op dit teken om het in de <span class="guilabel"><strong>Te kopiëren tekst</strong></span> veld op te nemen en klik dan de <span class="guibutton"><strong>Kopiëren</strong></span> knop. Keer terug naar uw document en kies <span class="guimenu"><strong>Bewerken > Plakken</strong></span> uit de <span class="appli
cation"><strong>gedit</strong></span> menubalk.
</div></blockquote></div><div class="para">
De bovenstaande tekst bevat applicatienamen, systeemwijde menunamen en onderdelen, applicatie specifieke menunamen, en knoppen en tekst van een GUI-interface, alle vertoond in Proportional Bold en alle te onderscheiden dankzij hun context.
</div><div class="para">
Merk het <span class="guimenu"><strong>></strong></span>-teken op, gebruikt om aan te geven dat door een menu en sub-menu wordt gelopen. Dit voorkomt het gebruik van de nogal omslachtige 'Selecteer <span class="guimenuitem"><strong>Muis</strong></span> van het <span class="guimenu"><strong>Voorkeuren</strong></span> sub-menu in het <span class="guimenu"><strong>Systeem</strong></span> menu uit de hoofdmenubalk'-omschrijvingen.
</div><div class="para">
<code class="command"> <em class="replaceable"><code>Mono-spaced Bold Italic</code></em> </code> of <span class="application"><strong> <em class="replaceable"><code>Proportional Bold Italic</code></em> </strong></span>
</div><div class="para">
Mono-spaced Bold of Proportional Bold behandelt indien cursief gedrukt altijd vervangbare of wisselende teksten. Cursief wijst op niet letterlijke tekst of toont tekst dat wisselt naar omstandigheden. Voorbeeld:
</div><div class="blockquote"><blockquote class="blockquote"><div class="para">
Om verbinding te maken met een andere computer met behulp van ssh, typt u <code class="command">ssh <em class="replaceable"><code>gebruikersnaam</code></em>@<em class="replaceable"><code>domein.naam</code></em> </code> bij een shell prompt.
</div><div class="para">
Het <code class="command">mount -o remount <em class="replaceable"><code>file-system</code></em> </code> commando mount opnieuw het genoemde bestandsysteem. Om bijvoorbeeld het <code class="filename">/home</code> bestandsysteem opnieuw te mounten, gebruikt men het <code class="command">mount -o remount /home</code> commando.
</div><div class="para">
Om de versie van een huidig geïnstalleerd pakket te zien, gebruikt u het <code class="command">rpm -q <em class="replaceable"><code>package</code></em> </code> commando. Dit zal het volgende resultaat opleveren: <code class="command"> <em class="replaceable"><code>package-version-release</code></em> </code>.
</div></blockquote></div><div class="para">
Let op de woorden in bold italics in bovenstaande tekst — username, domain.name, file-system, package, version en release. Elk woord is een [plaatshouder], hetzij voor tekst dat u invult indien u een commando typt, hetzij voor tekst die door het systeem wordt getoond.
</div><div class="para">
Buiten het standaard gebruik bij het presenteren van een titel van een werk, wordt cursief ingezet om het eerste gebruik van een nieuwe en belangrijke term te benadrukken. Voorbeeld:
</div><div class="blockquote"><blockquote class="blockquote"><div class="para">
Wanneer de Apache HTTP Server verzoeken accepteert, zet het childprocessen of threads ter afhandeling in. Deze groep van childprocessen of threads staan bekend als een <em class="firstterm">server-pool</em>. Onder Apache HTTP Server 2.0 is de verantwoordelijkheid voor het creëren en onderhouden van deze server-pools toegewezen aan een groep modules genaamd <em class="firstterm">Multi-Processing Modules</em> (<em class="firstterm">MPMs</em>). Anders dan bij de andere modules kan slechts één module van de MPM groep door de Apache HTTP Server geladen zijn.
</div></blockquote></div></div><div class="section" lang="nl-NL"><div class="titlepage"><div><div><h3 class="title" id="d0e387">1.2. Pull-quote Conventies</h3></div></div></div><div class="para">
Twee, normaal gesproken uit meerdere regels bestaande, datatypes worden visueel van de omringende tekst gescheiden.
</div><div class="para">
Tekst gezonden naar een terminal wordt getoond in <code class="computeroutput">Mono-spaced Roman</code> en als volgt gepresenteerd:
</div><pre class="screen">books Desktop documentation drafts mss photos stuff svn
books_tests Desktop1 downloads images notes scripts svgs
</pre><div class="para">
Opsommingen van broncode worden ook vertoond in <code class="computeroutput">Mono-spaced Roman</code> maar worden alsvolgt gepresenteerd en benadrukt:
</div><pre class="programlisting">package org.jboss.book.jca.ex1;
import javax.naming.InitialContext;
public class ExClient
{
public static void main(String args[])
throws Exception
{
InitialContext iniCtx = new InitialContext();
Object ref = iniCtx.lookup("EchoBean");
EchoHome home = (EchoHome) ref;
Echo echo = home.create();
System.out.println("Created Echo");
System.out.println("Echo.echo('Hello') = " + echo.echo("Hello"));
}
}
</pre></div><div class="section" lang="nl-NL"><div class="titlepage"><div><div><h3 class="title" id="d0e406">1.3. Noten en waarschuwingen</h3></div></div></div><div class="para">
Tenslotte gebruiken we drie visuele stijlen om aandacht te vestigen op informatie die anders misschien over het hoofd zou worden gezien.
</div><div class="note"><h2>Noot</h2><div class="para">
A Note is a tip or shortcut or alternative approach to the task at hand. Ignoring a note should have no negative consequences, but you might miss out on a trick that makes your life easier.
</div></div><div class="important"><h2>Belangrijk</h2><div class="para">
Important boxes detail things that are easily missed: configuration changes that only apply to the current session, or services that need restarting before an update will apply. Ignoring Important boxes won't cause data loss but may cause irritation and frustration.
</div></div><div class="warning"><h2>Waarschuwing</h2><div class="para">
Een waarschuwing dient niet genegeerd te worden. Waarschuwingen negeren zal ongetwijfeld leiden tot data- en haarverlies.
</div></div></div></div><div class="section" lang="nl-NL"><div class="titlepage"><div><div><h2 class="title" id="d0e426">2. We hebben terugkoppeling nodig!</h2></div></div></div><a id="d0e429" class="indexterm"/><div class="para">
Indien u een typografische fout in deze handleiding vindt, of u weet een manier om deze handleiding te verbeteren, zouden wij dat graag van u horen! Meldt u alstublieft fouten in de uitgave <span class="application"><strong>Fedora Documentation</strong></span> via Bugzilla: <a href="http://bugzilla.redhat.com/bugzilla/">http://bugzilla.redhat.com/bugzilla/</a>.
</div><div class="para">
Indien u fouten meldt, vergeet dan alstublieft niet het kenmerk: <em class="citetitle">selinux-user-guide</em> te vermelden.
</div><div class="para">
Indien u suggesties hebt om de documentatie te verbeteren, probeer dan zo duidelijk mogelijk deze suggesties te omschrijven. Indien u fouten hebt ontdekt, vermeldt dan alstublieft het sectienummer en wat omringende tekst, opdat we de fout makkelijker kunnen vinden.
</div></div></div><div class="chapter" lang="nl-NL"><div class="titlepage"><div><div><h2 class="title" id="chap-Security-Enhanced_Linux-Trademark_Information">Hoofdstuk 1. Handelsmerk informatie</h2></div></div></div><div class="toc"><dl><dt><span class="section"><a href="#chap-Security-Enhanced_Linux-Trademark_Information-Source_Code">1.1. Source Code</a></span></dt></dl></div><div class="para">
<span class="trademark">Linux</span>® is het geregistreerde handeslmerk van Linus Torvalds in de V.S. en andere landen.
</div><div class="para">
UNIX is een geregistreerd handelsmerk van The Open Group.
</div><div class="para">
Type Enforcement is een handelsmerk van Secure Computing, LLC, een volledige dochtermaatschappij van McAfee, Inc, geregistreert in de V.S. en andere landen. McAfee noch Secure Computing, LLC, hebben toestemming gegeven voor het gebruik van of referentie naar dit handelsmerk door de auteur buiten deze gids.
</div><div class="para">
Apache is het handelsmerk van The Apache Software Foundation.
</div><div class="para">
MySQL is een handelsmerk of geregistreerd handelsmerk van MySQL AB in de V.S. en andere landen.
</div><div class="section" lang="nl-NL"><div class="titlepage"><div><div><h2 class="title" id="chap-Security-Enhanced_Linux-Trademark_Information-Source_Code">1.1. Source Code</h2></div></div></div><div class="para">
The XML source for this guide is available at <a href="http://svn.fedorahosted.org/svn/selinuxguide/">http://svn.fedorahosted.org/svn/selinuxguide/</a>
</div></div></div><div class="chapter" lang="nl-NL"><div class="titlepage"><div><div><h2 class="title" id="chap-Security-Enhanced_Linux-Introduction">Hoofdstuk 2. Inleiding</h2></div></div></div><div class="toc"><dl><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Introduction-Benefits_of_running_SELinux">2.1. Voordelen van het draaien van SELinux</a></span></dt><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Introduction-Examples">2.2. Voorbeelden</a></span></dt><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Introduction-SELinux_Architecture">2.3. SELinux architectuur</a></span></dt><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Introduction-SELinux_on_Other_Operating_Systems">2.4. SELinux in andere operating systemen</a></span></dt></dl></div><div class="para">
Bestanden, zoals mappen en apparaten, worden objecten genoemd. Processen, zoals een gebruiker die een commando draait of de <span class="trademark">Mozilla</span>®<span class="trademark"> Firefox</span>® toepassing worden subjecten genoemd. De meeste operating systemen gebruiken een Discretionary Access Control (DAC) (toegangscontrole naar goeddunken) systeem dat controleert hoe subjecten omgaan met objecten en hoe subjecten omgaan met elkaar. In operating systemen die DAC gebruiken, controleren gebruikers de toegangsrechten van bestanden (objecten) waarvan zij eigenaar zijn. Bijvoorbeeld, in <span class="trademark">Linux</span>® operating systemen, kunnen gebruikers hun persoonlijke mappen leesbaar voor de wereld maken, en kunnen zij gebruikers en processen (subjects) toegang geven tot potentieel gevoelige informatie.
</div><div class="para">
DAC mechanismes zijn fundamenteel onvoldoende voor een sterke systeem beveiliging. DAC toegangsbeslissingen zijn alleen gebaseerd op gebruikers identiteit en eigendom, en negeren andere informatie die relevant is voor beveiliging, zoals de rol van de gebruiker, de functie en betrouwbaarheid van het programma, en de gevoeligheid en integriteit van de data. Elke gebruiker heeft volledige vrijheid over zijn bestanden, wat het onmogelijk maakt om een systeem-brede beveiligings tactiek af te dwingen. Verder erft elk programma dat door een gebruiker gedraaid wordt alle toegangsrechten die aan die gebruiker gegeven zijn en kan het toegang tot de bestanden van de gebruiker veranderen, dus wordt er geen bescherming geboden tegen kwaadwillige software. Veel systeem voorzieningen en bevoorrechte programma's moeten draaien met grof-korrelige voorrechten die hun vereiste ver overschrijden, zodat een mankement in elk van deze programma's benut kan worden om complete systeem toegang te kr
ijgen.<sup>[<a id="d0e488" href="#ftn.d0e488" class="footnote">1</a>]</sup>
</div><div class="para">
Het volgende is een voorbeeld van rechten gebruikt in Linux operating systemen die niet mogelijk zijn in Security-Enhanced Linux (SELinux). De rechten in deze voorbeelden kunnen verschillen van jouw systeem. Gebruik het <code class="command">ls -l</code> commando om de bestandsrechten te zien:
</div><pre class="screen">$ ls -l file1
-rwxrw-r-- 1 user1 group1 0 2009-04-30 15:42 file1
</pre><div class="para">
De eerste drie rechten bits, <code class="computeroutput">rwx</code>, controleren de toegang die de Linux <code class="computeroutput">user1</code> gebruiker (in dit geval de eigenaar) heeft voor <code class="filename">file1</code>. De volgende drie rechten bits, <code class="computeroutput">rw-</code>, controleren de toegang die de Linux <code class="computeroutput">group1</code> groep heeft voor <code class="filename">file1</code>. De laatste drie rechten bits, <code class="computeroutput">r--</code>, controleren de toegang die alle anderen hebben voor <code class="filename">file1</code>, wat alle gebruikers en processen omvat.
</div><div class="para">
Security-Enhanced Linux (SELinux) voegt Mandatory Access Control (MAC) (verplichte toegangs controle) toe aan de Linux kernel, en is standaard aangezet in Fedora. Een MAC architectuur voor algemene doeleinden heeft de mogelijkheid nodig om een door beheerders opgestelde beveiligings tactiek af te dwingen voor alle processen en bestanden op het systeem, waarbij beslissingen gebaseerd worden op labels die een verscheidenheid aan informatie bevatten die voor beveiling relevant is. Als dit correct geimplementeerd is, staat dit een systeem toe zich afdoende te verdedigen en biedt kritische ondersteuning voor beschermning tegen het knoeien met, of het omheen gaan van, beveiligde toepassingen. MAC biedt een sterke scheiding aan voor toepassingen wat het veilig uitvoeren van onbetrouwbare toepassingen toestaat. Zijn mogelijkheid om de rechten van draaiende processen te beperken, beperkt de reikwijdte van potentiele schade die het resultaat kan zijn van de uitbuiting van kwetsbaarhe
den in toepassingen en systeem voorzieningen. MAC staat toe dat informatie beschermd wordt tegen legitieme gebruikers met beperkte toestemming en ook tegen gemachtigde gebruikers die onbedoeld kwaadwillige toepassingen uitvoeren.<sup>[<a id="d0e530" href="#ftn.d0e530" class="footnote">2</a>]</sup>
</div><div class="para">
Het volgende is een voorbeeld van de labels die beveilings-relevantie informatie bevatten die worden gebruikt voor processen, Linux gebruikers, en bestanden in Linux operating systemen die SELinux draaien. Deze informatie wordt de SELinux context genoemd, en kan getoond worden met gebruik van het <code class="command">ls -Z</code> commando:
</div><pre class="screen">$ ls -Z file1
-rwxrw-r-- user1 group1 unconfined_u:object_r:user_home_t:s0 file1
</pre><div class="para">
In dit voorbeeld, biedt SELinux een gebruiker (<code class="computeroutput">unconfined_u</code>), een rol (<code class="computeroutput">object_r</code>), een type (<code class="computeroutput">user_home_t</code>), en een niveau (<code class="computeroutput">s0</code>) aan. Deze informatie wordt gebruikt om toegangscontrole beslissingen te maken. Met DAC kan de toegang alleen maar gecontroleerd worden op basis van de gebruiker en groep ID's. De SELinux tactiekregels worden gecontroleerd na de DAC regels. SELinux tactiekregels worden niet gebruikt als DAC reeds toegang weigert.
</div><div class="formalpara"><h5 class="formalpara" id="form-Security-Enhanced_Linux-Introduction-Linux_and_SELinux_Users">Linux en SELinux gebruikers</h5>
Op Linux operating systemen die SELinux draaien, zijn er zowel Linux gebruikers als SELinux gebruikers. SELinux gebruikers zijn onderdeel van de SELinux tactiek. Linux gebruikers zijn afgebeeld op SELinux gebruikers. Om verwarring te vermijden, gebruikt deze gids "Linux gebruiker" en "SELinux gebruiker" om tussen deze twee verschil te maken.
</div><div class="section" lang="nl-NL"><div class="titlepage"><div><div><h2 class="title" id="sect-Security-Enhanced_Linux-Introduction-Benefits_of_running_SELinux">2.1. Voordelen van het draaien van SELinux</h2></div></div></div><div class="itemizedlist"><ul><li><div class="para">
Alle processen en bestanden zijn gelabeld met een type. Een type definieert het domein voor processen en een type voor bestanden. Processen zijn van elkaar gescheiden door ze ieder in hun eigen domein te draaien, en SELinux tactiekregels bepalen hoe processen omgaan met bestanden, en ook hoe processen omgaan met elkaar. Toegang is alleen toegestaan als er een SELinux tactiekregel bestaat die dat specifiek toestaat.
</div></li><li><div class="para">
Fijn-korrelige toegangs controle. Door verder te gaan dan de traditionele <span class="trademark">UNIX</span>® rechten die gecontroleerd worden door het oordeel van de gebruiker en gebaseerd zijn op Linux gebruiker en groep ID's, zijn SELinux toegangs beslissingen gebaseerd op alle beschikbare informatie, zoals een SELinux gebruiker, rol, type en, optioneel, een niveau.
</div></li><li><div class="para">
SELinux tactiek is gedefinieerd op beheersniveau, wordt systeem-breed afgedwongen, en wordt niet ingesteld door het oordeel van de gebruiker.
</div></li><li><div class="para">
Verminderde gevoeligheid voor rechten escalatie aanvallen. Een voorbeeld: omdat processen in domeinen draaien, en daarom van elkaar gescheiden zijn, en SELinux tactiek regels bepalen hoe processen toegang hebben tot bestanden en andere processen; als dan een proces gecompromitteerd wordt, heeft de aanvaller alleen toegang tot de normale functie van dat proces, en tot bestanden waarvoor het proces ingesteld is om toegang tot te hebben. Bijvoorbeeld, als de Apache HTTP server gecompromitteerd is, kan een aanvaller dat proces niet gebruiken om bestanden te lezen in persoonlijke mappen, behalve als een specifieke SELinux tactiekregel was toegevoegd of ingesteld die deze toegang toestaat.
</div></li><li><div class="para">
SELinux kan gebruikt worden om data vertrouwelijkheid en integriteit af te dwingen, en ook om processen te beschermen voor niet vertrouwde input.
</div></li></ul></div><div class="para">
SELinux is niet:
</div><div class="itemizedlist"><ul><li><div class="para">
antivirus software.
</div></li><li><div class="para">
een vervanging voor wachtwoorden, firewall, of andere beveiligings systemen.
</div></li><li><div class="para">
een alles inbegrepen beveiligings oplossing.
</div></li></ul></div><div class="para">
SELinux is ontworpen om bestaande beveiligings oplossingen te versterken, niet om ze te vervangen. Zelfs als je SELinux draait, ga dan door met het opvolgen van goede beveilings praktijken, zoals de software up-to-date houden, moeilijk te raden wachtwoorden te gebruiken, firewall, enzovoort
</div></div><div class="section" lang="nl-NL"><div class="titlepage"><div><div><h2 class="title" id="sect-Security-Enhanced_Linux-Introduction-Examples">2.2. Voorbeelden</h2></div></div></div><div class="para">
De volgende voorbeelden laten zien hoe SELinux de beveiliging verbetert:
</div><div class="itemizedlist"><ul><li><div class="para">
de standaard actie is weigeren. Als er geen SELinux tactiek regel bestaat om toegang toe te staan, zoals voor een proces om een bestand te openen, wordt toegang geweigerd.
</div></li><li><div class="para">
SELinux kan Linux gebruikers beperken. Er bestaan een aantal beperkte SELinux gebruikers. Linux gebruikers kunnen afgebeeld worden op SELinux gebruikers om voordeel te hebben van beperkte SELinux gebruikers. Bijvoorbeeld, een Linux gebruiker afbeelden op de SELinux user_u gebruiker, resulteert in een Linux gebruiker die niet in staat is om instellen van user ID (setuid) toepassingen te draaien (tenzij anders geconfigureerd), zoals <code class="command">sudo</code> en <code class="command">su</code>, zowel als ze te verhinderen om bestanden en toepassingen in hun persoonlijke map uit te voeren - als dat ingesteld is, dit belet gebruikers om verdachte bestanden vanuit hun persoonlijke mappen op te starten.
</div></li><li><div class="para">
proces scheiding. Processen draaien in hun eigen domein, wat processen verhindert om toegang te krijgen tot bestanden die door andere processen gebruikt worden, en ook voorkomen dat processen toegang krijgen tot andere processen. Bijvoorbeeld, als SELinux gedraaid wordt, tenzij anders ingesteld, kan een aanvaller een Samba server niet compromitteren, en dan die Samba server gebruiken om te lezen en te schrijven naar bestanden in gebruik van andere processen, zoals een database gebruikt door <span class="trademark">MySQL</span>®.
</div></li><li><div class="para">
helpt de schade te beperken veroorzaakt door configuratie vergissingen. <a href="http://en.wikipedia.org/wiki/Domain_Name_System">Domain Name System (DNS)</a> servers kunnen een kopie maken van elkaars informatie. Dit staat bekend als zone transfer. Aanvallers kunnen zone transfer gebruiken om DNS servers te vernieuwen met verkeerde informatie. Als je de <a href="https://www.isc.org/software/bind">Berkeley Internet Name Domain (BIND)</a> DNS server in Fedora 11 draait, zelfs als een beheerder vergeet te beperken welke server een zone transfer kan uitvoeren, zal de standaard SELinux tactiek voorkomen dat zone bestanden <sup>[<a id="d0e632" href="#ftn.d0e632" class="footnote">3</a>]</sup> vernieuwd worden door zone transfers, het BIND <code class="systemitem">named</code> daemon, en andere processen.
</div></li><li><div class="para">
refereer naar het <a href="http://www.redhatmagazine.com/"><span class="trademark">Red Hat</span>® Magazine</a> artikel, <a href="http://www.redhatmagazine.com/2008/02/26/risk-report-three-years-of-red-h...">Risk report: Three years of Red Hat Enterprise Linux 4</a><sup>[<a id="d0e649" href="#ftn.d0e649" class="footnote">4</a>]</sup>, voor uitbuitingen die beperkt werden dankzij de standaard SELinux doel tactiek in <span class="trademark">Red Hat</span>® Enterprise <span class="trademark">Linux</span>® 4.
</div></li><li><div class="para">
refereer naar het <a href="http://www.linuxworld.com">LinuxWorld.com</a> artikel, <a href="http://www.linuxworld.com/news/2008/022408-selinux.html?page=1">A seatbelt for server software: SELinux blocks real-world exploits</a><sup>[<a id="d0e669" href="#ftn.d0e669" class="footnote">5</a>]</sup>, voor achtergrond informatie over SELinux, en informatie over verscheidene uitbuitingen die SELinux heeft voorkomen.
</div></li><li><div class="para">
refereer naar James Morris's <a href="http://james-morris.livejournal.com/25421.html">SELinux mitigates remote root vulnerability in OpenPegasus</a> blog post, voor informatie over een uitbuiting in <a href="http://www.openpegasus.org/">OpenPegasus</a> die was verlicht door SELinux zoals geleverd met Red Hat Enterprise Linux 4 en 5.
</div></li></ul></div><div class="para">
De <a href="http://www.tresys.com/">Tresys Technology</a> website heeft een <a href="http://www.tresys.com/innovation.php">SELinux Mitigation News</a> sectie (aan de rechter kant) die recente uitbuitingen laat zien die verlicht of verhinderd zijn door SELinux.
</div></div><div class="section" lang="nl-NL"><div class="titlepage"><div><div><h2 class="title" id="sect-Security-Enhanced_Linux-Introduction-SELinux_Architecture">2.3. SELinux architectuur</h2></div></div></div><div class="para">
SELinux is een beveiligingsmodule die ingebouwd is in de Linux kernel. SELinux wordt bestuurt door laadbare tactiekregels. Als toegang plaats vindt die relevant is voor de beveiliging, zoals wanneer een proces probeert een bestand te openen, wordt de operatie onderschept in de kernel door SELinux. Als een SELinux tactiek regel de operatie toestaat, gaat het verder, anders wordt de operatie geblokkeerd en ontvangt het proces een fout.
</div><div class="para">
SELinux beslissingen, zoals het toestaan of tegenhouden van toegang, worden opgeslagen. Deze opslag staat bekend als de Access Vector Cache (AVC). Het opslaan van beslissingen vermindert hoe vaak SELinux tactiekregels geraadpleegd moeten worden, wat de prestaties verbetert. SELinux tactiekregels hebben geen effect als DAC regels toegang als eerste weigeren.
</div></div><div class="section" lang="nl-NL"><div class="titlepage"><div><div><h2 class="title" id="sect-Security-Enhanced_Linux-Introduction-SELinux_on_Other_Operating_Systems">2.4. SELinux in andere operating systemen</h2></div></div></div><div class="para">
Refereer naar de volgende verwijzingen voor informatie over SELinux draaiende in operating systemen:
</div><div class="itemizedlist"><ul><li><div class="para">
Hardened Gentoo: <a href="http://www.gentoo.org/proj/en/hardened/selinux/selinux-handbook.xml">http://www.gentoo.org/proj/en/hardened/selinux/selinux-handbook.xml</a>.
</div></li><li><div class="para">
Debian: <a href="http://wiki.debian.org/SELinux">http://wiki.debian.org/SELinux</a>.
</div></li><li><div class="para">
Ubuntu: <a href="https://wiki.ubuntu.com/SELinux">https://wiki.ubuntu.com/SELinux</a> en <a href="https://help.ubuntu.com/community/SELinux">https://help.ubuntu.com/community/SELinux</a>.
</div></li><li><div class="para">
Red Hat Enterprise Linux: <a href="http://www.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/5.2/html/Deploy...">Red Hat Enterprise Linux Deployment Guide</a> en <a href="http://www.redhat.com/docs/manuals/enterprise/RHEL-4-Manual/selinux-guide/">Red Hat Enterprise Linux 4 SELinux Guide</a>.
</div></li><li><div class="para">
Fedora: <a href="http://fedoraproject.org/wiki/SELinux">http://fedoraproject.org/wiki/SELinux</a> en de <a href="http://docs.fedoraproject.org/selinux-faq-fc5/">Fedora Core 5 SELinux FAQ</a>.
</div></li></ul></div></div><div class="footnotes"><br/><hr width="100" align="left"/><div class="footnote"><p><sup>[<a id="ftn.d0e488" href="#d0e488" class="para">1</a>] </sup>
"Integrating Flexible Support for Security Policies into the Linux Operating System", door Peter Loscocco en Stephen Smalley. Dit artikel was oorspronkelijk gemaakt voor de National Security Agency en is dus in het publieke domein. Refereer naar het <a href="http://www.nsa.gov/research/_files/selinux/papers/freenix01/index.shtml">originele artikel</a> voor details en het document zoals het eerst is vrijgegeven. Alle aanpassingen en veranderingen zijn gedaan door Murray McAllister.
</p></div><div class="footnote"><p><sup>[<a id="ftn.d0e530" href="#d0e530" class="para">2</a>] </sup>
"Meeting Critical Security Objectives with Security-Enhanced Linux", door Peter Loscocco en Stephen Smalley. Dit artikel was oorspronkelijk gemaakt voor de National Security Agency en is dus in het publieke domein. Refereer naar het <a href="http://www.nsa.gov/research/_files/selinux/papers/ottawa01/index.shtml">originele artikel</a> voor details en het document zoals het eerst was vrijgegeven. Alle aanpassingen en veranderingen zijn gemaakt door Murray McAllister.
</p></div><div class="footnote"><p><sup>[<a id="ftn.d0e632" href="#d0e632" class="para">3</a>] </sup>
Tekst bestanden die informatie bevatten, zoals hostnaam naar IP adres omzetting, die gebruikt wordt door DNS servers.
</p></div><div class="footnote"><p><sup>[<a id="ftn.d0e649" href="#d0e649" class="para">4</a>] </sup>
Cox, Mark. "Risk report: Three years of Red Hat Enterprise Linux 4". Published 26 February 2008. Accessed 28 August 2008: <a href="http://www.redhatmagazine.com/2008/02/26/risk-report-three-years-of-red-h...">http://www.redhatmagazine.com/2008/02/26/risk-report-three-years-of-red-h...</a>.
</p></div><div class="footnote"><p><sup>[<a id="ftn.d0e669" href="#d0e669" class="para">5</a>] </sup>
Marti, Don. "A seatbelt for server software: SELinux blocks real-world exploits". Published 24 February 2008. Accessed 28 August 2008: <a href="http://www.linuxworld.com/news/2008/022408-selinux.html?page=1">http://www.linuxworld.com/news/2008/022408-selinux.html?page=1</a>.
</p></div></div></div><div class="chapter" lang="nl-NL"><div class="titlepage"><div><div><h2 class="title" id="chap-Security-Enhanced_Linux-SELinux_Contexts">Hoofdstuk 3. SELinux context</h2></div></div></div><div class="toc"><dl><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-SELinux_Contexts-Domain_Transitions">3.1. Domein overgangen</a></span></dt><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-SELinux_Contexts-SELinux_Contexts_for_Processes">3.2. SELinux context voor processen</a></span></dt><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-SELinux_Contexts-SELinux_Contexts_for_Users">3.3. SELinux context voor gebruikers</a></span></dt></dl></div><div class="para">
Processen en bestanden worden gelabeld met een SELinux context die extra informatie bevat, zoals een SELinux gebruiker, rol, type, en, optioneel, een niveau. Als SELinux gedraaid wordt, wordt al deze informatie gebruikt om toegangs contole beslissingen te maken. In Fedora 11, biedt SELinux een combinatie van Role-Based Access Contol (RBAC) (toegangscontrole gebaseerd op rol), <span class="trademark">Type Enforcement</span>® (TE) (type afdwinging), en, optioneel, Multi-Level Security (MLS) (multi-niveau beveiliging)
</div><div class="para">
Het volgende is een voorbeeld SELinux context. SELinux context wordt gebruikt voor processen, Linux gebruikers, en bestanden in Linux operating systemen die SELinux draaien. Gebruik het <code class="command">ls -Z</code> commando om de SELinux context van bestanden en mappen te zien:
</div><pre class="screen">$ ls -Z file1
-rwxrw-r-- user1 group1 unconfined_u:object_r:user_home_t:s0 file1
</pre><div class="para">
SELinux context volgt de <span class="emphasis"><em>SELinux gebruiker:rol:type:niveau</em></span> syntax:
</div><div class="variablelist"><dl><dt><span class="term"><span class="emphasis"><em>SELinux gebruiker</em></span></span></dt><dd><div class="para">
De SELinux gebruiker identiteit is een identiteit die bekend is aan de tactiek en die gemachtigd is voor een specifieke verzameling van rollen, en voor een specifieke MLS reeks. Iedere Linux gebruiker wordt afgebeeld op een SELinux gebruiker via SELinux tactiek. Dit staat Linux gebruikers toe om de beperkingen van SELinux gebruiker te erven. De afgebeelde SELinux identiteit wordt gebruikt in de SELinux context voor processen in die sessie, om te beperken welke rollen en niveau's ze kunnen betreden. Voer het <code class="command">semanage login -l</code> commando uit als Linux root gebruiker om een lijst van afbeeldingen te zien tussen SELinux en Linux gebruikersaccounts:
</div><pre class="screen"># /usr/sbin/semanage login -l
Login Name SELinux User MLS/MCS Range
__default__ unconfined_u s0-s0:c0.c1023
root unconfined_u s0-s0:c0.c1023
system_u system_u s0-s0:c0.c1023
</pre><div class="para">
De output kan verschillen van systeem tot systeem. De <code class="computeroutput">Login Name</code> kolom laat de Linux gebruikers zien, en de <code class="computeroutput">SELinux User</code> kolom laat zien op welke SELinux gebruiker de Linux gebruiker is afgebeeld. Voor processen beperkt de SELinux gebruiker welke rollen en niveau's bereikbaar zijn. De laatste kolom, <code class="computeroutput">MLS/MCS Range</code>, is het niveau gebruikt door Multi-Level Security (MLS) en Multi-Category Security (MCS) (multi-categorie beveiliging). Niveau's worden later kort besproken.
</div></dd><dt><span class="term"><span class="emphasis"><em>rol</em></span></span></dt><dd><div class="para">
Onderdeel van SELinux is het Role-Based Access Control (RBAC) beveiligings model. De rol is een kenmerk van RBAC. SELinux gebruikers zijn gemachtigd voor rollen, en rollen zijn gemachtigd voor domeinen. De rol dient als een bemiddelaar tussen domeinen en SELinux gebruikers. De rollen die betreed kunnen worden bepalen welke domeinen betreed kunnen worden - uiteindelijk controleert dit tot welke object types toegang kan worden verkregen. Dit helpt de kwetsbaarheid te verminderen voor rechten escalatie aanvallen.
</div></dd><dt><span class="term"><span class="emphasis"><em>type</em></span></span></dt><dd><div class="para">
Het type is een kenmerk van Type Enforcement. Het type definieert een domein voor processen, en een type voor bestanden. SELinux tactiekregels bepalen hoe types toegang hebben tot elkaar, of het nu een domein is die toegang heeft tot een type, of een domein die toegang heeft tot een ander domein. Toegang is alleen toegestaan als er een specifieke SELinux tactiekregel bestaat die dit toestaat.
</div></dd><dt><span class="term"><span class="emphasis"><em>niveau</em></span></span></dt><dd><div class="para">
Het niveau is een kenmerk van MLS en Multi-Category Security (MCS). Een MLS reeks is een paar van niveau's, geschreven als <span class="emphasis"><em>laagniveau-hoogniveau</em></span> als de niveau's verschillend zijn, of <span class="emphasis"><em>laagniveau</em></span> als de niveau's identiek zijn (<code class="computeroutput">s0-s0</code> is hetzelfde als <code class="computeroutput">s0</code>). Elk niveau is een gevoeligheid-categorie paar, met categorie optioneel. Als er categorieën zijn, wordt het niveau geschreven als <span class="emphasis"><em>gevoeligheid:categorie-set</em></span>. Als er geen categorieën zijn, wordt het geschreven als <span class="emphasis"><em>gevoeligheid</em></span>.
</div><div class="para">
Als de categorie set een opeenvolgende reeks is, kan het afgekort worden. Bijvoorbeeld, <code class="computeroutput">c0.c3</code> is hetzelfde als <code class="computeroutput">c0,c1,c2,c3</code>. Het <code class="filename">/etc/selinux/targeted/setrans.conf</code> bestand beeldt niveau's (<code class="computeroutput">s0:c0</code>) af op een voor mensen leesbare vorm (<code class="computeroutput">CompanyConfidential</code>). Bewerk <code class="filename">setrans.conf</code> niet met een tekstverwerker: gebruik <code class="command">semanage</code> om veranderingen te maken. Refereer naar de <span class="citerefentry"><span class="refentrytitle">semanage</span>(8)</span> manual pagina voor meer informatie. De gerichte tactiek in Fedora 11 dwingt MCS af, en in MCS is een gevoeligheid, <code class="computeroutput">s0</code>. MCS in Fedora 11 ondersteunt 1024 verschillende categorieën: <code class="computeroutput">c0</code> tot en met <code class="computeroutput">c1023</code
>. <code class="computeroutput">s0-s0:c0.c1023</code> is gevoeligheid <code class="computeroutput">s0</code> en gemachtigd voor alle categorieën.
</div><div class="para">
MLS dwingt het <a href="http://en.wikipedia.org/wiki/Bell-LaPadula_model">Bell-LaPadula Mandatory Access Model</a> af, en wordt gebruikt in Labeled Security Protection Profile (LSPP) omgevingen. Om MLS beperkingen te gebruiken, installeer je het <span class="package">selinux-policy-mls</span> pakket, en je stelt MLS in om de standaard SELinux tactiek te zijn. De MLS tactiek die onderdeel van Fedora is laat veel programma domeinen weg die geen onderdeel waren van de geevalueerde configuratie, en daarom is MLS niet bruikbaar op een bureau werkstation (geen ondersteuning voor het X Windows systeem); echter een MLS tactiek kan gemaakt worden van de <a href="http://oss.tresys.com/projects/refpolicy">upstream SELinux Referentie Tactiek</a> die alle programma domeinen bevat.
</div></dd></dl></div><div class="section" lang="nl-NL"><div class="titlepage"><div><div><h2 class="title" id="sect-Security-Enhanced_Linux-SELinux_Contexts-Domain_Transitions">3.1. Domein overgangen</h2></div></div></div><div class="para">
Een proces in een domein gaat over naar een ander domein door het uitvoeren van een toepassing die het <code class="computeroutput">entrypoint</code> type heeft voor het nieuwe domein. De <code class="computeroutput">entrypoint</code> toestemming wordt gebruikt in SELinux tactiek, en controleert welke toepassingen gebruikt kunnen worden om een domein in te gaan. Het volgende voorbeeld laat een domein overgang zien:
</div><div class="orderedlist"><ol><li><div class="para">
Een gebruiker wil zijn wachtwoord veranderen. Om zijn wachtwoord te veranderen, gebruikt hij de <code class="command">passwd</code> toepassing. Het <code class="filename">/usr/bin/passwd</code> uitvoerbare programma is gelabeld met het <code class="computeroutput">passwd_exec_t</code> type:
</div><pre class="screen">$ ls -Z /usr/bin/passwd
-rwsr-xr-x root root system_u:object_r:passwd_exec_t:s0 /usr/bin/passwd
</pre><div class="para">
De <span class="application"><strong>passwd</strong></span> toepassing heeft toegang tot <code class="filename">/etc/shadow</code>, welke gelabeld is met het <code class="computeroutput">shadow_t</code> type:
</div><pre class="screen">$ ls -Z /etc/shadow
-r-------- root root system_u:object_r:shadow_t:s0 /etc/shadow
</pre></li><li><div class="para">
Een SELinux tactiekregel zegt dat het aan processen die in het <code class="computeroutput">passwd_t</code> domein draaien toegestaan wordt om te lezen en schrijven naar bestanden gelabeld met het <code class="computeroutput">shadow_t</code> type. Het <code class="computeroutput">shadow_t</code> type wordt alleen toegepast bij bestanden die nodig zijn voor een verandering van wachtwoord. Dit omvat <code class="filename">/etc/gshadow</code>, <code class="filename">/etc/shadow</code>, en hun backup bestanden.
</div></li><li><div class="para">
Een SELinux tactiekregel zegt dat het <code class="computeroutput">passwd_t</code> domein <code class="computeroutput">entrypoint</code> toestemming heeft voor het <code class="computeroutput">passwd_exec_t</code> type.
</div></li><li><div class="para">
Als een gebruiker de <code class="command">/usr/bin/passwd</code> toepassing uitvoert, zal het shell proces van de gebruiker overgaan naar het <code class="computeroutput">passwd_t</code> domein. Met SELinux, omdat de standaard actie weigeren is, en er een regel bestaat die toestaat (onder andere) dat toepassingen die draaien in het <code class="computeroutput">passwd_t</code> domein toegang hebben tot bestanden gelabeld met het <code class="computeroutput">shadow_t</code> type, is het de <span class="application"><strong>passwd</strong></span> toepassing toegestaan om toegang te hebben tot <code class="filename">/etc/shadow</code>, en dus om het wachtwoord van de gebruiker te vernieuwen.
</div></li></ol></div><div class="para">
Dit voorbeeld is niet volledig,en wordt gebruikt als een basis voorbeeld om domein overgangen uit te leggen. Hoewel er in werkelijkheid een regel is die subjects, die in het <code class="computeroutput">passwd_t</code> domein draaien, toestaan om toegang te hebben tot objecten met het <code class="computeroutput">shadow_t</code> bestandslabel type, moet er voldaan worden aan andere SELinux tactiekregels voordat het subject kan overgaan naar een nieuw domein. In dit voorbeeld, verzekert Type Enforcement dat:
</div><div class="itemizedlist"><ul><li><div class="para">
het <code class="computeroutput">passwd_t</code> domein kan alleen betreden worden door het uitvoeren van een toepassing gelabeld met het <code class="computeroutput">passwd_exec_t</code> type; kan alleen uitgevoerd worden met gemachtigde gedeelde bibliotheken, zoals het <code class="computeroutput">lib_t</code> type; en kan niet uitgevoerd worden enig andere toepassing.
</div></li><li><div class="para">
alleen gemachtigde domeinen, zoals <code class="computeroutput">passwd_t</code>, kunnen naar bestanden schrijven met het <code class="computeroutput">shadow_t</code> type. Zelfs als andere processen draaien met root gebruiker rechten, kunnen deze processen niet schrijven naar bestanden gelabeld met het <code class="computeroutput">shadow_t</code> type, omdat deze niet draaien in het <code class="computeroutput">passwd_t</code> domein.
</div></li><li><div class="para">
alleen gemachtigde domeinen kunnen overgaan naar het <code class="computeroutput">passwd_t</code> domein. Bijvoorbeeld, het <code class="systemitem">sendmail</code> proces draaiend in het <code class="computeroutput">sendmail_t</code> domein heeft geen geldige reden om <code class="command">passwd</code> uit te voeren; daarom kan het nooit overgaan naar het <code class="computeroutput">passwd_t</code> domein.
</div></li><li><div class="para">
processen die draaien in het <code class="computeroutput">passwd_t</code> domein kunnen alleen lezen en schrijven naar gemachtigde types, zoals bestanden gelabeld met <code class="computeroutput">etc_t</code> of <code class="computeroutput">shadow_t</code> types. Dit verhindert de <span class="application"><strong>passwd</strong></span> toepassing om misleid te worden om willekeurige bestanden te lezen of te schrijven.
</div></li></ul></div></div><div class="section" lang="nl-NL"><div class="titlepage"><div><div><h2 class="title" id="sect-Security-Enhanced_Linux-SELinux_Contexts-SELinux_Contexts_for_Processes">3.2. SELinux context voor processen</h2></div></div></div><div class="para">
Gebruikt het <code class="command">ps -eZ</code> commando om de SELinux context voor processen te bekijken. Bijvoorbeeld:
</div><div class="orderedlist"><ol><li><div class="para">
Open een terminal, zoals <span class="guimenu"><strong>Toepassingen</strong></span> → <span class="guisubmenu"><strong>Systeemgereedschappen</strong></span> → <span class="guimenuitem"><strong>Terminal</strong></span>.
</div></li><li><div class="para">
Voer het <code class="command">/usr/bin/passwd</code> commando uit. Vul geen nieuw wachtwoord in.
</div></li><li><div class="para">
Open een nieuwe tab, of een andere terminal, en voer het <code class="command">ps -eZ | grep passwd</code> commando uit. De output lijkt op het volgende:
</div><pre class="screen">unconfined_u:unconfined_r:passwd_t:s0-s0:c0.c1023 13212 pts/1 00:00:00 passwd
</pre></li><li><div class="para">
Druk op <strong class="userinput"><code>Ctrl+C</code></strong> in de eerste tab om de <span class="application"><strong>passwd</strong></span> toepassing te stoppen.
</div></li></ol></div><div class="para">
Als in dit voorbeeld de <code class="filename">/usr/bin/passwd</code> toepassing (gelabeld met het <code class="computeroutput">passwd_exec_t</code> type) wordt uitgevoerd, gaat het shell proces van de gebruiker over naar het <code class="computeroutput">passwd_t</code> domein. Denk eraan: het type definieert een domein voor een proces, en een type voor bestanden.
</div><div class="para">
Gebruik het <code class="command">ps -eZ</code> commando om de SELinux context voor draaiende processen te zien. Het volgende is een beperkt voorbeeld van de output, en kan op jouw systeem anders zijn:
</div><pre class="screen">system_u:system_r:setroubleshootd_t:s0 1866 ? 00:00:08 setroubleshootd
system_u:system_r:dhcpc_t:s0 1869 ? 00:00:00 dhclient
system_u:system_r:sshd_t:s0-s0:c0.c1023 1882 ? 00:00:00 sshd
system_u:system_r:gpm_t:s0 1964 ? 00:00:00 gpm
system_u:system_r:crond_t:s0-s0:c0.c1023 1973 ? 00:00:00 crond
system_u:system_r:kerneloops_t:s0 1983 ? 00:00:05 kerneloops
system_u:system_r:crond_t:s0-s0:c0.c1023 1991 ? 00:00:00 atd
</pre><div class="para">
De <code class="computeroutput">system_r</code> rol wordt gebruikt voor systeem processen, zoals daemons. Type Enforcement afzondert dan elk domein.
</div></div><div class="section" lang="nl-NL"><div class="titlepage"><div><div><h2 class="title" id="sect-Security-Enhanced_Linux-SELinux_Contexts-SELinux_Contexts_for_Users">3.3. SELinux context voor gebruikers</h2></div></div></div><div class="para">
Gebruik het <code class="command">id -Z</code> commando om de SELinux context te zien die verbonden is met jouw Linux gebruiker:
</div><pre class="screen">unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023
</pre><div class="para">
In Fedora 11 draaien Linux gebruikers standaard als unconfined (onbeperkt). Deze SELinux context laat zien dat de Linux gebruiker is afgebeeld op de SELinux <code class="computeroutput">unconfined_u</code> gebruiker, draait in de <code class="computeroutput">unconfined_r</code> rol, en draait in het <code class="computeroutput">unconfined_t</code> domein. <code class="computeroutput">s0-s0</code> is een MLS reeks, die in dit geval hetzelfde is als <code class="computeroutput">s0</code>. De categorieën waar naar de gebruiker toegang heeft zijn gedefinieerd door <code class="computeroutput">c0.c1023</code>, wat betekent alle categorieën (<code class="computeroutput">c0</code> tot en met <code class="computeroutput">c1023</code>).
</div></div></div><div class="chapter" lang="nl-NL"><div class="titlepage"><div><div><h2 class="title" id="chap-Security-Enhanced_Linux-Targeted_Policy">Hoofdstuk 4. Gerichte tactiek</h2></div></div></div><div class="toc"><dl><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Targeted_Policy-Confined_Processes">4.1. Beperkte processen</a></span></dt><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Targeted_Policy-Unconfined_Processes">4.2. Onbeperkte processen</a></span></dt><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Targeted_Policy-Confined_and_Unconfined_Users">4.3. Beperkte en onbeperkte gebruikers</a></span></dt></dl></div><div class="para">
Gerichte tactiek is de standaard SELinux tactiek die gebruikt wordt in Fedora 11. Bij een gerichte tactiek draaien processen waarop gericht wordt in een beperkt domein, en draaien processen waar niet op gericht wordt in een onbeperkt domein. Bijvoorbeeld, standaard draaien ingelogde gebruikers in het <code class="computeroutput">unconfined_t</code> domein, en systeem processen opgestart door init draaien in het <code class="computeroutput">initrc_t</code> domein - deze beide domeinen zijn onbeperkt.
</div><div class="para">
Unconfined domains (as well as confined domains) are subject to executable and writeable memory checks. By default, subjects running in an unconfined domain can not allocate writeable memory and execute it. This reduces vulnerability to <a href="http://en.wikipedia.org/wiki/Buffer_overflow">buffer overflow attacks</a>. These memory checks are disabled by setting Booleans, which allow the SELinux policy to be modified at runtime. Boolean configuration is discussed later.
</div><div class="section" lang="nl-NL"><div class="titlepage"><div><div><h2 class="title" id="sect-Security-Enhanced_Linux-Targeted_Policy-Confined_Processes">4.1. Beperkte processen</h2></div></div></div><div class="para">
Bijna iedere service die luistert op een netwerk is beperkt in Fedora 11. Bovendien zijn de meeste processen beperkt die gedraaid worden als de Linux root gebruiker en taken uitvoeren voor gebruikers, zoals de <span class="application"><strong>passwd</strong></span> toepassing. Als een proces beperkt is, draait het in zijn eigen domein, zoals het <code class="systemitem">httpd</code> proces draait in het <code class="computeroutput">httpd_t</code> domein. Als een beperkt proces in gevaar wordt gebracht door een aanvaller zal, afhankelijk van de SELinux tactiek instellingen, de toegang van de aanvaller naar hulpbronnen, en de mogelijke schade die aangericht kan worden, beperkt zijn.
</div><div class="para">
Het volgende voorbeeld laat zien hoe SELinux voorkomt dat de Apache HTTP server (<code class="systemitem">httpd</code>) leest van bestanden die niet correct gelabeld zijn, zoals bestanden bedoelt voor gebruik met Samba. Dit is een voorbeeld, en moet niet gebruikt worden in een productieomgeving. Het neemt aan dat de <span class="package">httpd</span>, <span class="package">wget</span>, <span class="package">setroubleshoot-server</span>, en <span class="package">audit</span> pakketten geinstalleerd zijn, dat de SELinux gerichte tactiek wordt gebruikt, en dat SELinux draait in de afdwingende (enforcing) modus.
</div><div class="orderedlist"><ol><li><div class="para">
Voer het <code class="command">sestatus</code> commando uit om te bevestigen dat SELinux is aangezet, het draait in de afdwingende modus, en dat de gerichte tactiek wordt gebruikt:
</div><pre class="screen">$ /usr/sbin/sestatus
SELinux status: enabled
SELinuxfs mount: /selinux
Current mode: enforcing
Mode from config file: enforcing
Policy version: 23
Policy from config file: targeted
</pre><div class="para">
<code class="computeroutput">SELinux status: enabled</code> is returned when SELinux is enabled. <code class="computeroutput">Current mode: enforcing</code> is returned when SELinux is running in enforcing mode. <code class="computeroutput">Policy from config file: targeted</code> is returned when the SELinux targeted policy is used.
</div></li><li><div class="para">
Als de Linux root gebruiker draai je het <code class="command">touch /var/www/html/testfile</code> commando om een bestand aan te maken.
</div></li><li><div class="para">
Draai het <code class="command">ls -Z /var/www/html/testfile</code> commando om de SELinux context te bekijken:
</div><pre class="screen">-rw-r--r-- root root unconfined_u:object_r:httpd_sys_content_t:s0 /var/www/html/testfile
</pre><div class="para">
Standaard draaien Linux gebruikers onbeperkt in Fedora 11, daarom is het <code class="filename">testfile</code> bestand gelabeld met de SELinux <code class="computeroutput">unconfined_u</code> gebruiker. RBAC wordt gebruikt voor processen, niet voor bestanden. Rollen hebben geen betekenis voor bestanden - de <code class="computeroutput">object_r</code> rol is een algemene rol gebruikt voor bestanden (op blijvende opslag en netwerkbestandsystemen). In de <code class="filename">/proc/</code> map, kunnen bestanden die gerelateerd zijn aan processen de <code class="computeroutput">system_r</code> rol gebruiken.<sup>[<a id="d0e1236" href="#ftn.d0e1236" class="footnote">6</a>]</sup> Het <code class="computeroutput">httpd_sys_content_t</code> type staat het <code class="systemitem">httpd</code> proces toe om toegang te krijgen tot dit bestand.
</div></li><li><div class="para">
Als de Linux root gebruiker, draai je het <code class="command">service httpd start</code> commando om het <code class="systemitem">httpd</code> proces te starten. Als <code class="systemitem">httpd</code> met succes opstart verschijnt de volgende output:
</div><pre class="screen"># /sbin/service httpd start
Starting httpd: [ OK ]
</pre></li><li><div class="para">
Ga naar een map waar je Linux gebruiker schrijfrechten heeft, en draai het <code class="command">wget http://localhost/testfile</code> commando. Behalve als er veranderingen in de standaard instelling gemaakt zijn zal dit commando slagen:
</div><pre class="screen">--2009-05-06 23:00:01-- http://localhost/testfile
Resolving localhost... 127.0.0.1
Connecting to localhost|127.0.0.1|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 0 [text/plain]
Saving to: `testfile'
[ <=> ] 0 --.-K/s in 0s
2009-05-06 23:00:01 (0.00 B/s) - `testfile' saved [0/0]
</pre></li><li><div class="para">
Het <code class="command">chcon</code> commando herlabelt bestanden; zulke label veranderingen zullen echter niet blijven bestaan als het bestandssysteem opnieuw gelabeld wordt. Voor permanente veranderingen die een herlabeling van het bestandssysteem zullen overleven, gebruik je het <code class="command">semanage</code> commando, dat later besproken wordt. Als de Linux root gebruiker draai je het volgende commando om het type te veranderen naar een type dat door Samba gebruikt wordt:
</div><div class="para">
<code class="command">chcon -t samba_share_t /var/www/html/testfile</code>
</div><div class="para">
Draai het <code class="command">ls -Z /var/www/html/testfile</code> commando om de veranderingen te bekijken:
</div><pre class="screen">-rw-r--r-- root root unconfined_u:object_r:samba_share_t:s0 /var/www/html/testfile
</pre></li><li><div class="para">
Merk op: de huidige DAC rechten staan het <code class="systemitem">httpd</code> proces toegang toe tot<code class="filename">testfile</code>. Ga naar een map waar je Linux gebruiker schrijfrechten heeft, en voer het <code class="command">wget http://localhost/testfile</code> commando uit. Behalve als er veranderingen in de standaard instelling gemaakt zijn zal dit commando falen:
</div><pre class="screen">--2009-05-06 23:00:54-- http://localhost/testfile
Resolving localhost... 127.0.0.1
Connecting to localhost|127.0.0.1|:80... connected.
HTTP request sent, awaiting response... 403 Forbidden
2009-05-06 23:00:54 ERROR 403: Forbidden.
</pre></li><li><div class="para">
Als de Linux root gebruiker draai je het <code class="command">rm -i /var/www/html/testfile</code> commando om <code class="filename">testfile</code> te verwijderen.
</div></li><li><div class="para">
Als het voor jou niet nodig is dat <code class="systemitem">httpd</code> draait, voer je als de Linux root gebruiker het <code class="command">service httpd stop</code> commando uit om <code class="systemitem">httpd</code> te stoppen:
</div><pre class="screen"># /sbin/service httpd stop
Stopping httpd: [ OK ]
</pre></li></ol></div><div class="para">
Dit voorbeeld laat de extra beveiliging zien die toegevoegd is door SELinux. Hoewel DAC regels het <code class="systemitem">httpd</code> proces toegang toestaan tot <code class="filename">testfile</code> in stap 7, zal SELinux toegang weigeren omdat het bestand gelabeld was met een type waarnaar het <code class="systemitem">httpd</code> proces geen toegang heeft. Na stap 7 wordt een fout weggeschreven naar <code class="filename">/var/log/messages</code> die lijkt op het volgende:
</div><pre class="screen">May 6 23:00:54 localhost setroubleshoot: SELinux is preventing httpd (httpd_t) "getattr"
to /var/www/html/testfile (samba_share_t). For complete SELinux messages.
run sealert -l c05911d3-e680-4e42-8e36-fe2ab9f8e654
</pre><div class="para">
Eerdere log bestanden kunnen een <code class="filename">/var/log/messages.<em class="replaceable"><code>YYYYMMDD</code></em></code> formaat gebruiken. Als <span class="application"><strong>syslog-ng</strong></span> draait, kunnen eerdere log bestanden een <code class="filename">/var/log/messages.<em class="replaceable"><code>X</code></em></code> formaat gebruiken. Als de <code class="systemitem">setroubleshootd</code> en <code class="systemitem">auditd</code> processen draaien, worden fouten naar <code class="filename">/var/log/audit/audit.log</code> weggeschreven likend op het volgende:
</div><pre class="screen">type=AVC msg=audit(1220706212.937:70): avc: denied { getattr } for pid=1904 comm="httpd" path="/var/www/html/testfile" dev=sda5 ino=247576 scontext=unconfined_u:system_r:httpd_t:s0 tcontext=unconfined_u:object_r:samba_share_t:s0 tclass=file
type=SYSCALL msg=audit(1220706212.937:70): arch=40000003 syscall=196 success=no exit=-13 a0=b9e21da0 a1=bf9581dc a2=555ff4 a3=2008171 items=0 ppid=1902 pid=1904 auid=500 uid=48 gid=48 euid=48 suid=48 fsuid=48 egid=48 sgid=48 fsgid=48 tty=(none) ses=1 comm="httpd" exe="/usr/sbin/httpd" subj=unconfined_u:system_r:httpd_t:s0 key=(null)
</pre><div class="para">
Er wordt ook een fout weggeschreven naar <code class="filename">/var/log/httpd/error_log</code> lijkend op het volgende:
</div><pre class="screen">[Wed May 06 23:00:54 2009] [error] [client <em class="replaceable"><code>127.0.0.1</code></em>] (13)Permission denied: access to /testfile denied
</pre><div class="note"><h2>Opmerking</h2><div class="para">
In Fedora 11 worden de <span class="package">setroubleshoot-server</span> en <span class="package">audit</span> pakketten standaard geinstalleerd. Deze pakketten bevatten respectievelijk de <code class="systemitem">setroubleshootd</code> en <code class="systemitem">auditd</code> daemons. Deze daemons draaien standaard. Het stoppen van een van deze daemons verandert waar de SELinux weigeringen weggeschreven worden. Refereer naar <a class="xref" href="#sect-Security-Enhanced_Linux-Working_with_SELinux-Which_Log_File_is_Used" title="5.2. Welk log bestand wordt gebruikt">Paragraaf 5.2, “Welk log bestand wordt gebruikt”</a> voor meer informatie.
</div></div></div><div class="section" lang="nl-NL"><div class="titlepage"><div><div><h2 class="title" id="sect-Security-Enhanced_Linux-Targeted_Policy-Unconfined_Processes">4.2. Onbeperkte processen</h2></div></div></div><div class="para">
Onbeperkte processen draaien in onbeperkte domeien, bijvoorbeeld, init programma's draaien in het onbeperkte <code class="computeroutput">initrc_t</code> domein, onbeperkte kernel processen draaien in het <code class="computeroutput">kernel_t</code> domein, en onbeperkte Linux gebruikers draaien in het <code class="computeroutput">unconfined_t</code> domein. Voor onbeperkte processen worden SELinux tactiekregels toegepast, maar de bestaande tactiekregels staan processen die in onbeperkte domeinen draaien bijna alle toegang toe. Processen die draaien in onbeperkte domeinen vallen terug op het gebruik van alleen de DAC regels. Als een onbeperkt proces in gevaar wordt gebracht, verhindert SELinux een aanvaller niet om toegang te krijgen tot systeemhulpbronnen en data, maar de DAC regels worden natuurlijk nog gebruikt. SELinux is een beveiligingsverbetering boven op DAC regels - het vervangt deze niet.
</div><div class="para">
Het volgende voorbeeld laat zien hoe de Apache HTTP Server (<code class="systemitem">httpd</code>) als het onbeperkt draait toegang kan krijgen tot data die bedoeld is voor gebruik met Samba. Merk op: in Fedora 11 draait het <code class="systemitem">httpd</code> proces standaard in het beperkte <code class="computeroutput">httpd_t</code> domein. Dit is een voorbeeld en moet niet in een productieomgeving gebruikt worden. Het neemt aan dat de <span class="package">httpd</span>, <span class="package">wget</span>, <span class="package">setroubleshoot-server</span>, en <span class="package">audit</span> pakketten geinstalleerd zijn, dat de SELinux gerichte tactiek gebruikt wordt, en dat SELinux in de afdwingende modus is:
</div><div class="orderedlist"><ol><li><div class="para">
Voer het <code class="command">sestatus</code> commando uit om te bevestigen dat SELinux is aangezet, het draait in de afdwingende modus, en dat de gerichte tactiek wordt gebruikt:
</div><pre class="screen">$ /usr/sbin/sestatus
SELinux status: enabled
SELinuxfs mount: /selinux
Current mode: enforcing
Mode from config file: enforcing
Policy version: 23
Policy from config file: targeted
</pre><div class="para">
<code class="computeroutput">SELinux status: enabled</code> is returned when SELinux is enabled. <code class="computeroutput">Current mode: enforcing</code> is returned when SELinux is running in enforcing mode. <code class="computeroutput">Policy from config file: targeted</code> is returned when the SELinux targeted policy is used.
</div></li><li><div class="para">
Als de Linux root gebruikerm voer je het <code class="command">touch /var/www/html/test2file</code> commando uit om een bestand te maken.
</div></li><li><div class="para">
Voer het <code class="command">ls -Z /var/www/html/test2file</code> commando uit om de SELinux context te zien:
</div><pre class="screen">-rw-r--r-- root root unconfined_u:object_r:httpd_sys_content_t:s0 /var/www/html/test2file
</pre><div class="para">
Standaard draaien Linux gebruikers onbeperkt in Fedora 11, daarom is het <code class="filename">test2file</code> bestand gelabeld met de SELinux <code class="computeroutput">unconfined_u</code> gebruiker. RBAC wordt gebruikt voor processen, niet voor bestanden. Rollen hebben geen betekenis voor bestanden - de <code class="computeroutput">object_r</code> rol is een algemene rol gebruikt voor bestanden (op blijvende opslag en netwerkbestandssystemen). In de <code class="filename">/proc/</code> map, kunnen bestanden die gerelateerd zijn aan processen de <code class="computeroutput">system_r</code> rol gebruiken.<sup>[<a id="d0e1486" href="#ftn.d0e1486" class="footnote">7</a>]</sup> Het <code class="computeroutput">httpd_sys_content_t</code> type staat het <code class="systemitem">httpd</code> proces toe om toegang te krijgen tot dit bestand.
</div></li><li><div class="para">
Het <code class="command">chcon</code> commando herlabelt bestanden; zulke label veranderingen zullen echter niet blijven bestaan als het bestandssysteem opnieuw gelabeld wordt. Voor permanente veranderingen die een herlabeling van het bestandssysteem zullen overleven, gebruik je het <code class="command">semanage</code> commando, dat later besproken wordt. Als de Linux root gebruiker draai je het volgende commando om het type te veranderen naar een type dat door Samba gebruikt wordt:
</div><div class="para">
<code class="command">chcon -t samba_share_t /var/www/html/test2file</code>
</div><div class="para">
Voer het <code class="command">ls -Z /var/www/html/test2file</code> commando uit om de veranderingen te bekijken:
</div><pre class="screen">-rw-r--r-- root root unconfined_u:object_r:samba_share_t:s0 /var/www/html/test2file
</pre></li><li><div class="para">
Voer het <code class="command">service httpd status</code> commando uit om te bevestigen dat het <code class="systemitem">httpd</code> proces niet draait:
</div><pre class="screen">$ /sbin/service httpd status
httpd is stopped
</pre><div class="para">
Als de output anders is, voer je het <code class="command">service httpd stop</code> commando uit als de Linux root gebruiker om het <code class="systemitem">httpd</code> proces te stoppen:
</div><pre class="screen"># /sbin/service httpd stop
Stopping httpd: [ OK ]
</pre></li><li><div class="para">
Om het <code class="systemitem">httpd</code> proces onbeperkt te laten draaien, voer je het volgende commando uit als de Linux root gebruiker om het type van <code class="filename">/usr/sbin/httpd</code> te veranderen naar een type dat niet overgaat naar een beperkt domein:
</div><div class="para">
<code class="command">chcon -t unconfined_exec_t /usr/sbin/httpd</code>
</div></li><li><div class="para">
Voer het <code class="command">ls -Z /usr/sbin/httpd</code> commando uit om te bevestigen dat <code class="filename">/usr/sbin/httpd</code> is gelabeld met het <code class="computeroutput">unconfined_exec_t</code> type:
</div><pre class="screen">-rwxr-xr-x root root system_u:object_r:unconfined_exec_t /usr/sbin/httpd
</pre></li><li><div class="para">
Als de Linux root gebruiker, draai je het <code class="command">service httpd start</code> commando om het <code class="systemitem">httpd</code> proces te starten. Als <code class="systemitem">httpd</code> met succes opstart verschijnt de volgende output:
</div><pre class="screen"># /sbin/service httpd start
Starting httpd: [ OK ]
</pre></li><li><div class="para">
Voer het <code class="command">ps -eZ | grep httpd</code> commando uit om <code class="systemitem">httpd</code> te zien draaien in het <code class="computeroutput">unconfined_t</code> domein:
</div><pre class="screen">$ ps -eZ | grep httpd
unconfined_u:system_r:unconfined_t <em class="replaceable"><code>7721</code></em> ? 00:00:00 httpd
unconfined_u:system_r:unconfined_t <em class="replaceable"><code>7723</code></em> ? 00:00:00 httpd
unconfined_u:system_r:unconfined_t <em class="replaceable"><code>7724</code></em> ? 00:00:00 httpd
unconfined_u:system_r:unconfined_t <em class="replaceable"><code>7725</code></em> ? 00:00:00 httpd
unconfined_u:system_r:unconfined_t <em class="replaceable"><code>7726</code></em> ? 00:00:00 httpd
unconfined_u:system_r:unconfined_t <em class="replaceable"><code>7727</code></em> ? 00:00:00 httpd
unconfined_u:system_r:unconfined_t <em class="replaceable"><code>7728</code></em> ? 00:00:00 httpd
unconfined_u:system_r:unconfined_t <em class="replaceable"><code>7729</code></em> ? 00:00:00 httpd
unconfined_u:system_r:unconfined_t <em class="replaceable"><code>7730</code></em> ? 00:00:00 httpd
</pre></li><li><div class="para">
Ga naar een map waar jouw Linux gebruiker schrijfrechten heeft, en voer het <code class="command">wget http://localhost/test2file</code> commando uit. Behalve als er veranderingen in de standaard instelling gemaakt zijn, zal dit commando slagen:
</div><pre class="screen">--2009-05-07 01:41:10-- http://localhost/test2file
Resolving localhost... 127.0.0.1
Connecting to localhost|127.0.0.1|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 0 [text/plain]
Saving to: `test2file.1'
[ <=> ]--.-K/s in 0s
2009-05-07 01:41:10 (0.00 B/s) - `test2file.1' saved [0/0]
</pre><div class="para">
Hoewel het <code class="systemitem">httpd</code> proces geen toegang heeft tot bestanden gelabeld met het <code class="computeroutput">samba_share_t</code> type, draait <code class="systemitem">httpd</code> in het onbeperkte <code class="computeroutput">unconfined_t</code> domein, en valt terug op het gebruiken van DAC regels, en dus zal het <code class="command">wget</code> commando slagen. Als <code class="systemitem">httpd</code> in het beperkte <code class="computeroutput">httpd_t</code> domein had gedraaid, dan zou het <code class="command">wget</code> commando gefaald hebben.
</div></li><li><div class="para">
Het <code class="command">restorecon</code> commando herlaadt de standaard SELinux context voor bestanden. Als de Linux root gebruiker voet je het <code class="command">restorecon -v /usr/sbin/httpd</code> commando uit om de standaard SELinux context voor <code class="filename">/usr/sbin/httpd</code> te herladen:
</div><pre class="screen"># /sbin/restorecon -v /usr/sbin/httpd
restorecon reset /usr/sbin/httpd context system_u:object_r:unconfined_notrans_exec_t:s0->system_u:object_r:httpd_exec_t:s0
</pre><div class="para">
Voer het <code class="command">ls -Z /usr/sbin/httpd</code> commando uit om te bevestigen dat <code class="filename">/usr/sbin/httpd</code> is gelabeld met het <code class="computeroutput">httpd_exec_t</code> type:
</div><pre class="screen">$ ls -Z /usr/sbin/httpd
-rwxr-xr-x root root system_u:object_r:httpd_exec_t /usr/sbin/httpd
</pre></li><li><div class="para">
Als de Linux root gebruiker voer je het <code class="command">/sbin/service httpd restart</code> commando uit om <code class="systemitem">httpd</code> opnieuw te starten. Na het herstarten, voer je het <code class="command">ps -eZ | grep httpd</code> commando uit om te bevestigen dat <code class="systemitem">httpd</code> in het beperkte <code class="computeroutput">httpd_t</code> domein draait:
</div><pre class="screen"># /sbin/service httpd restart
Stopping httpd: [ OK ]
Starting httpd: [ OK ]
# ps -eZ | grep httpd
unconfined_u:system_r:httpd_t 8880 ? 00:00:00 httpd
unconfined_u:system_r:httpd_t 8882 ? 00:00:00 httpd
unconfined_u:system_r:httpd_t 8883 ? 00:00:00 httpd
unconfined_u:system_r:httpd_t 8884 ? 00:00:00 httpd
unconfined_u:system_r:httpd_t 8885 ? 00:00:00 httpd
unconfined_u:system_r:httpd_t 8886 ? 00:00:00 httpd
unconfined_u:system_r:httpd_t 8887 ? 00:00:00 httpd
unconfined_u:system_r:httpd_t 8888 ? 00:00:00 httpd
unconfined_u:system_r:httpd_t 8889 ? 00:00:00 httpd
</pre></li><li><div class="para">
Als de Linux root gebruiker voer je het <code class="command">rm -i /var/www/html/test2file</code> commando uit om <code class="filename">test2file</code> te verwijderen.
</div></li><li><div class="para">
Als het voor jou niet nodig is dat <code class="systemitem">httpd</code> draait, voer je als de Linux root gebruiker het <code class="command">service httpd stop</code> commando uit om <code class="systemitem">httpd</code> te stoppen:
</div><pre class="screen"># /sbin/service httpd stop
Stopping httpd: [ OK ]
</pre></li></ol></div><div class="para">
De voorbeelden in deze paragrafen laten zien hoe data kan worden beschermd voor een in gevaar gebracht beperkt proces (beschermd door SELinux), en ook hoe data beter bereikbaar is voor een aanvaller vanuit een in gevaar gebracht onbeperkt proces (niet beschermd door SELinux).
</div></div><div class="section" lang="nl-NL"><div class="titlepage"><div><div><h2 class="title" id="sect-Security-Enhanced_Linux-Targeted_Policy-Confined_and_Unconfined_Users">4.3. Beperkte en onbeperkte gebruikers</h2></div></div></div><div class="para">
Elke Linux gebruiker wordt afgebeeld op een SELinux gebruiker met SELinux tactiek. Dit staat Linux gebruikers toe om de beperkingen voor SELinux gebruikers te erven. Deze Linux gebruiker afbeelding kan bekeken worden door het uitvoeren van het <code class="command">semanage login -l</code> commando als de Linux root gebruiker:
</div><pre class="screen"># /usr/sbin/semanage login -l
Login Name SELinux User MLS/MCS Range
__default__ unconfined_u s0-s0:c0.c1023
root unconfined_u s0-s0:c0.c1023
system_u system_u s0-s0:c0.c1023
</pre><div class="para">
In Fedora 11 worden Linux gebruikers standaard afgebeeld op de <code class="computeroutput">__default__</code> login ( welke is afgebeeld op de SELinux <code class="computeroutput">unconfined_u</code> gebruiker). Het volgende definieert de standaard afbeelding:
</div><pre class="screen">__default__ unconfined_u s0-s0:c0.c1023
</pre><div class="para">
Het volgende voorbeeld laat het toevoegen van een nieuwe Linux gebruiker zien, en het afbeelden van die Linux gebruiker op de SELinux <code class="computeroutput">unconfined_u</code> gebruiker. Het neemt aan dat de Linux root gebruiker onbeperkt draait, wat standaard het geval is in Fedora 11:
</div><div class="orderedlist"><ol><li><div class="para">
Als de Linux root gebruiker voer je het <code class="command">/usr/sbin/useradd newuser</code> commando uit om een nieuwe Linux gebruiker aan te maken met de naam newuser.
</div></li><li><div class="para">
As the Linux root user, run the <code class="command">passwd newuser</code> command to assign a password to the Linux newuser user:
</div><pre class="screen"># passwd newuser
Changing password for user newuser.
New UNIX password: <em class="replaceable"><code>Enter a password</code></em>
Retype new UNIX password: <em class="replaceable"><code>Enter the same password again</code></em>
passwd: all authentication tokens updated successfully.
</pre></li><li><div class="para">
Log uit van je huidige sessie, en login als de Linux newuser gebruiker. Als je inlogt, beeldt pam_selinux de Linux gebruiker af op een SELinux gebruiker (in dit geval, unconfined_u), en stelt de daaruit volgende SELinux context in. De shell van de Lunix gebruiker wordt opgestart met deze context. Voer het <code class="command">id -Z</code> commando uit om de context van een Linux gebruiker te bekijken:
</div><pre class="screen">[newuser@localhost ~]$ id -Z
unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023
</pre></li><li><div class="para">
Log uit van de sessie van de Linux newuser, en log in met je eigen account. Als je de Linux newuser gebruiker niet wilt, voer je het <code class="command">/usr/sbin/userdel -r newuser</code> commando uit als de Linux root gebruiker om het te verwijderen, te samen met de persoonlijke map van de Linux newuser.
</div></li></ol></div><div class="para">
Beperkte en onbeperkte Linux gebruikers zijn onderworpen aan uitvoerbaarheids en naar-geheugen-schrijven controles, en zijn ook beperkt door MCS (en MLS, als de MLS tactiek wordt gebruikt). Als onbeperkte Linux gebruikers een toepassing uitvoeren waarvan SELinux tactiek definieert dat het kan overgaan van het <code class="computeroutput">unconfined_t</code> domein naar zijn eigen beperkt domein, zullen onbeperkte Linux gebruikers nog steeds vallen onder de beperkingen van dat beperkte domein. Het beveilings voordeel hiervan is dat, zelfs als een Linux gebruiker onbeperkt draait, de toepassing beperkt blijft, en dat daardoor de uitbuiting van een fout in de toepassing beperkt kan worden door de tactiek. Merk op: dit beschermt het systeem niet voor de gebruiker. In plaats daarvan worden de gebruiker en het systeem beschermd tegen mogelijke schade veroorzaakt door een fout in de toepassing.
</div><div class="para">
De volgende beperkte SELinux gebruikers zijn beschikbaar in Fedora 11:
</div><div class="table" id="tabl-Security-Enhanced_Linux-Confined_and_Unconfined_Users-SELinux_User_Capabilities"><div class="table-contents"><table summary="SELinux gebruiker eigenschappen" border="1"><colgroup><col/><col/><col/><col/><col/><col/></colgroup><thead><tr><th>
Gebruiker
</th><th>
Domein
</th><th>
X Window systeem
</th><th>
su en sudo
</th><th>
Uitvoeren in persoonlijke map en /tmp/
</th><th>
Netwerken
</th></tr></thead><tbody><tr><td>
guest_u
</td><td>
guest_t
</td><td align="center">
nee
</td><td align="center">
nee
</td><td align="center">
optioneel
</td><td align="center">
nee
</td></tr><tr><td>
xguest_u
</td><td>
xguest_t
</td><td align="center">
ja
</td><td align="center">
nee
</td><td align="center">
optioneel
</td><td align="center">
alleen <span class="application"><strong>Firefox</strong></span>
</td></tr><tr><td>
user_u
</td><td>
user_t
</td><td align="center">
ja
</td><td align="center">
nee
</td><td align="center">
optioneel
</td><td align="center">
ja
</td></tr><tr><td>
staff_u
</td><td>
staff_t
</td><td align="center">
ja
</td><td align="center">
alleen <code class="command">sudo</code>
</td><td align="center">
optioneel
</td><td align="center">
ja
</td></tr></tbody></table></div><h6>Tabel 4.1. SELinux gebruiker eigenschappen</h6></div><br class="table-break"/><div class="itemizedlist"><ul><li><div class="para">
Linux gebruikers in de <code class="computeroutput">guest_t</code>, <code class="computeroutput">xguest_t</code>, en <code class="computeroutput">user_t</code> domeinen kunnen alleen set user ID (setuid) toepassingen draaien als SELinux tactiek dat toestaat (zoals <code class="command">passwd</code>). Ze kunnen de <code class="command">su</code> en <code class="command">/usr/bin/sudo</code> setuid toepassingen niet draaien, en kunnen daarom deze toepassingen niet gebruiken om de Linux root gebruiker te worden.
</div></li><li><div class="para">
Linux gebruikers in het <code class="computeroutput">guest_t</code> domein hebben geen netwerk toegang, en kunnen alleen inloggen met een terminal (inclusief <code class="systemitem">ssh</code>; ze kunnen inloggen met <code class="systemitem">ssh</code>, maar kunnen <code class="systemitem">ssh</code> niet gebruiken om te verbinden met andere systemen).
</div></li><li><div class="para">
De enigste netwerk toegang die Linux gebruikers in het <code class="computeroutput">xguest_t</code> domein hebben is om met <span class="application"><strong>Firefox</strong></span> te verbinden met web pagina's.
</div></li><li><div class="para">
Linux gebruikers in de <code class="computeroutput">xguest_t</code>, <code class="computeroutput">user_t</code> en <code class="computeroutput">staff_t</code> domeinen kunnen inloggen met het X Window systeem en een terminal.
</div></li><li><div class="para">
Standaard hebben Linux gebruikers in het <code class="computeroutput">staff_t</code> domein geen rechten om toepassingen met <code class="command">/usr/bin/sudo</code> uit te voeren. Deze rechten moeten ingesteld worden door een beheerder.
</div></li></ul></div><div class="para">
Standaard kunnen Linux gebruikers in de <code class="computeroutput">guest_t</code> en <code class="computeroutput">xguest_t</code> domeinen geen toepassingen in hun persoonlijke mappen of <code class="filename">/tmp/</code> uitvoeren, wat hun tegenhoudt om toepassingen op te starten (welke de rechten van de gebruiker erven) in mappen waartoe ze schrijftoegang hebben. Dit helpt om foutieve of kwaadwillige toepassingen te verhinderen om bestanden waarvan ze eigenaar zijn te veranderen.
</div><div class="para">
Standaard kunnen Linux gebruikers in de <code class="computeroutput">user_t</code> en <code class="computeroutput">staff_t</code> domeinen toepassingen in hun persoonlijke mappen en <code class="filename">/tmp/</code> uitvoeren. Refereer naar <a class="xref" href="#sect-Security-Enhanced_Linux-Confining_Users-Booleans_for_Users_Executing_Applications" title="6.6. Booleans voor gebruikers die toepassingen uitvoeren">Paragraaf 6.6, “Booleans voor gebruikers die toepassingen uitvoeren”</a> voor informatie over het toestaan en tegenhouden van gebruikers om toepassingen in hun persoonlijke mappen en <code class="filename">/tmp/</code> uit te voeren.
</div></div><div class="footnotes"><br/><hr width="100" align="left"/><div class="footnote"><p><sup>[<a id="ftn.d0e1236" href="#d0e1236" class="para">6</a>] </sup>
Als andere tactieken gebruikt worden, zoals MLS, kunnen andere rollen gebruikt worden, bijvoorbeeld, <code class="computeroutput">secadm_r</code>.
</p></div><div class="footnote"><p><sup>[<a id="ftn.d0e1486" href="#d0e1486" class="para">7</a>] </sup>
Als andere tactieken gebruikt worden, zoals MLS, kunnen andere rollen gebruikt worden, bijvoorbeeld, <code class="computeroutput">secadm_r</code>.
</p></div></div></div><div class="chapter" lang="nl-NL"><div class="titlepage"><div><div><h2 class="title" id="chap-Security-Enhanced_Linux-Working_with_SELinux">Hoofdstuk 5. Werken met SELinux</h2></div></div></div><div class="toc"><dl><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Working_with_SELinux-SELinux_Packages">5.1. SELinux pakketten</a></span></dt><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Working_with_SELinux-Which_Log_File_is_Used">5.2. Welk log bestand wordt gebruikt</a></span></dt><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Working_with_SELinux-Main_Configuration_File">5.3. Het hoofd configuratie bestand</a></span></dt><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Working_with_SELinux-Enabling_and_Disabling_SELinux">5.4. SELinux aanzetten en uitzetten</a></span></dt><dd><dl><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Enabling_and_Disabling_SELinux-Enabling_
SELinux">5.4.1. SELinux aanzetten</a></span></dt><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Enabling_and_Disabling_SELinux-Disabling_SELinux">5.4.2. SELinux uitzetten</a></span></dt></dl></dd><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Working_with_SELinux-SELinux_Modes">5.5. SELinux modes</a></span></dt><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Working_with_SELinux-Booleans">5.6. Booleans</a></span></dt><dd><dl><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Booleans-Listing_Booleans">5.6.1. Booleans laten zien</a></span></dt><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Booleans-Configuring_Booleans">5.6.2. Booleans instellen</a></span></dt><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Booleans-Booleans_for_NFS_and_CIFS">5.6.3. Booleans voor NFS en CIFS</a></span></dt></dl></dd><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Working_with
_SELinux-SELinux_Contexts_Labeling_Files">5.7. SELinux context - Bestanden labelen</a></span></dt><dd><dl><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-SELinux_Contexts_Labeling_Files-Temporary_Changes_chcon">5.7.1. Tijdelijke veranderingen: chcon</a></span></dt><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-SELinux_Contexts_Labeling_Files-Persistent_Changes_semanage_fcontext">5.7.2. Permanente veranderingen: semanage fcontext</a></span></dt></dl></dd><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Working_with_SELinux-The_file_t_and_default_t_Types">5.8. De file_t en default_t types</a></span></dt><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Working_with_SELinux-Mounting_File_Systems">5.9. Het aankoppelen van bestandssystemen</a></span></dt><dd><dl><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Mounting_File_Systems-Context_Mounts">5.9.1. Context aankoppelingen</a></span></dt><dt><sp
an class="section"><a href="#sect-Security-Enhanced_Linux-Mounting_File_Systems-Changing_the_Default_Context">5.9.2. De standaard context veranderen</a></span></dt><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Mounting_File_Systems-Mounting_an_NFS_File_System">5.9.3. Het aankoppelen van een NFS bestandssysteem</a></span></dt><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Mounting_File_Systems-Multiple_NFS_Mounts">5.9.4. Meerdere NFS aankoppelingen</a></span></dt><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Mounting_File_Systems-Making_Context_Mounts_Persistent">5.9.5. Maak de context aankoppelingen blijvend</a></span></dt></dl></dd><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Working_with_SELinux-Maintaining_SELinux_Labels_">5.10. Het onderhouden van SELinux labels </a></span></dt><dd><dl><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Maintaining_SELinux_Labels_-Copying_Files_and_D
irectories">5.10.1. Bestanden en mappen kopiëren</a></span></dt><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Maintaining_SELinux_Labels_-Moving_Files_and_Directories">5.10.2. Bestanden en mappen verplaatsen</a></span></dt><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Maintaining_SELinux_Labels_-Checking_the_Default_SELinux_Context">5.10.3. Het controleren van de standaard SELinux context</a></span></dt><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Maintaining_SELinux_Labels_-Archiving_Files_with_tar">5.10.4. Bestanden archiveren met tar</a></span></dt><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Maintaining_SELinux_Labels_-Archiving_Files_with_star">5.10.5. Bestanden archiveren met star</a></span></dt></dl></dd></dl></div><div class="para">
De volgende paragrafen geven een kort overzicht van de belangrijkste SELinux pakketten in Fedora 11; het installeren en vernieuwen van pakketten; welke log bestanden gebruikt worden; het belangrijkste SELinux configuratie bestand; SELinux aanzetten en uitzetten, SELinux modes; het instellen van Booleans; het tijdelijk en blijvend veranderen van bestand en map labels; het voorbij gaan aan bestandssysteem labels met het <code class="command">mount</code> commando; het aankoppelen van NFS bestandssystemen; en hoe je SELinux context behoudt bij het kopiëren en archiveren van bestanden en mappen.
</div><div class="section" lang="nl-NL"><div class="titlepage"><div><div><h2 class="title" id="sect-Security-Enhanced_Linux-Working_with_SELinux-SELinux_Packages">5.1. SELinux pakketten</h2></div></div></div><div class="para">
In Fedora 11 worden de SELinux pakketten standaard geinstalleerd, behalve als ze handmatig uitgezonderd worden tijdens de installatie. Standaard wordt de SELinux gerichte tactiek gebruikt, en draait SELinux in de afdwingende modus. Het volgende is een korte beschrijving van de belangrijkste SELinux pakketten:
</div><div class="para">
<span class="package">policycoreutils</span>: biedt gereedschappen zoals <code class="command">semanage</code>, <code class="command">restorecon</code>, <code class="command">audit2allow</code>, <code class="command">semodule</code>, <code class="command">load_policy</code>, en <code class="command">setsebool</code>, voor het uitvoeren en beheren van SELinux.
</div><div class="para">
<span class="package">policycoreutils-gui</span>: biedt <code class="command">system-config-selinux</code>, een grafisch gereedschap voor het beheren van SELinux.
</div><div class="para">
<span class="package">selinux-policy</span>: biedt de SELinux Referentie Tactiek. De SELinux Referentie Tactiek is een complete SELinux tactiek, en wordt gebruikt als de basis voor andere tactieken, zoals de SELinux gerichte tactiek. Refereer naar de Tresys Technology <a href="http://oss.tresys.com/projects/refpolicy">SELinux Reference Policy</a> voor verdere informatie. Het <span class="package">selinux-policy-devel</span> pakket levelt ontwikkelgereedschappen, zoals <code class="command">/usr/share/selinux/devel/policygentool</code> en <code class="command">/usr/share/selinux/devel/policyhelp</code>, en ook voorbeeld tactiek bestanden. Dit pakket is opgegaan in het <span class="package">selinux-policy</span> pakket.
</div><div class="para">
<span class="package">selinux-policy-<em class="replaceable"><code>policy</code></em></span>: levert SELinux tactieken. Voor gerichte tactiek, installeer je <span class="package">selinux-policy-targeted</span>. Voor MLS, installeer je <span class="package">selinux-policy-mls</span>. In Fedora 8 is de strikte tactiek opgegaan in de gerichte tactiek, wat toestaat dat beperkte en onbeperkte gebruikers tegelijk kunnen bestaan op hetzelfde systeem.
</div><div class="para">
<span class="package">setroubleshoot-server</span>: vertaalt weigeringsboodschappen, die gemaakt worden als toegang geweigerd wordt door SELinux, in gedetaileerde beschrijvingen die bekeken kunnen worden met <code class="command">sealert</code> (welke door dit pakket geleverd wordt).
</div><div class="para">
<span class="package">setools</span>, <span class="package">setools-gui</span>, en <span class="package">setools-console</span>: deze pakketten leveren de <a href="http://oss.tresys.com/projects/setools">Tresys Technology SETools distributie</a>, een aantal gereedschappen en bibliotheken voor het analiseren en ondervragen van tactiek, controle log waarnemen en rapporteren, en bestandscontext beheer <sup>[<a id="d0e2067" href="#ftn.d0e2067" class="footnote">8</a>]</sup>. Het <span class="package">setools</span> pakket is een meta-pakket voor SETools. Het <span class="package">setools-gui</span> pakket levert de <code class="command">apol</code>, <code class="command">seaudit</code>, en <code class="command">sediffx</code> gereedschappen. Het <span class="package">setools-console</span> pakket levert de <code class="command">seaudit-report</code>, <code class="command">sechecker</code>, <code class="command">sediff</code>, <code class="command">seinfo</code>, <code class="co
mmand">sesearch</code>, <code class="command">findcon</code>, <code class="command">replcon</code>, en <code class="command">indexcon</code> commadoregel gereedschappen. Refereer naar de <a href="http://oss.tresys.com/projects/setools">Tresys Technology SETools</a> pagina voor meer informatie over deze gereedschappen.
</div><div class="para">
<span class="package">libselinux-utils</span>: levert de <code class="command">avcstat</code>, <code class="command">getenforce</code>, <code class="command">getsebool</code>, <code class="command">matchpathcon</code>, <code class="command">selinuxconlist</code>, <code class="command">selinuxdefcon</code>, <code class="command">selinuxenabled</code>, <code class="command">setenforce</code>, en <code class="command">togglesebool</code> gereedschappen.
</div><div class="para">
<span class="package">mcstrans</span>: vertaalt niveau's, zoals <code class="computeroutput">s0-s0:c0.c1023</code>, naar een eenvoudiger te lezen vorm, zoals <code class="computeroutput">SystemLow-SystemHigh</code>. Dit pakket is standaard niet geinstalleerd.
</div><div class="para">
Om pakketten in Fedora 11 te installeren, draai je als de Linux root gebruiker het <code class="command">yum install <em class="replaceable"><code>pakket-naam</code></em></code> commando. Bijvoorbeeld, om het <span class="package">mcstrans</span> pakket te installeren, voer je het <code class="command">yum install mcstrans</code> commando uit. Om alle geinstalleerde pakketten in Fedora 11 te vernieuwen, voer je het <code class="command">yum update</code> commando uit.
</div><div class="para">
Refereer naar <a href="http://docs.fedoraproject.org/yum/en/">Managing Software with yum</a><sup>[<a id="d0e2179" href="#ftn.d0e2179" class="footnote">9</a>]</sup> voor meer informatie over het gebruik van <code class="command">yum</code> om pakketten te beheren.
</div><div class="note"><h2>Opmerking</h2><div class="para">
In vorige versies van Fedora is het <span class="package">selinux-policy-devel</span> pakket nodig voor het maken van een locale tactiek module met <code class="command">audit2allow -M</code>.
</div></div></div><div class="section" lang="nl-NL"><div class="titlepage"><div><div><h2 class="title" id="sect-Security-Enhanced_Linux-Working_with_SELinux-Which_Log_File_is_Used">5.2. Welk log bestand wordt gebruikt</h2></div></div></div><div class="para">
In Fedora 11 worden de <span class="package">setroubleshoot-server</span> en <span class="package">audit</span> pakketten geinstalleerd als ze niet verwijderd zijn van de standaard software selectie. Deze pakketten bevatten respectievelijk de <code class="systemitem">setroubleshootd</code> en <code class="systemitem">auditd</code> daemons. Deze daemons draaien standaard.
</div><div class="para">
SELinux weigeringsboodschappen, zoals de volgende worden standaard naar <code class="filename">/var/log/audit/audit.log</code> geschreven:
</div><pre class="screen">type=AVC msg=audit(1223024155.684:49): avc: denied { getattr } for pid=2000 comm="httpd" path="/var/www/html/file1" dev=dm-0 ino=399185 scontext=unconfined_u:system_r:httpd_t:s0 tcontext=system_u:object_r:samba_share_t:s0 tclass=file
</pre><div class="para">
Als <code class="systemitem">setroubleshootd</code> draait, wat standaard het geval is, worden weigeringsboodschappen van <code class="filename">/var/log/audit/audit.log</code> ook vertaald naar een eenvoudiger te lezen vorm en naar <code class="filename">/var/log/messages</code> gestuurd:
</div><pre class="screen">May 7 18:55:56 localhost setroubleshoot: SELinux is preventing httpd (httpd_t) "getattr" to /var/www/html/file1 (samba_share_t). For complete SELinux messages. run sealert -l de7e30d6-5488-466d-a606-92c9f40d316d
</pre><div class="para">
Weigeringsboodschappen worden naar verscheidene locaties gestuurd, afhankelijk van welke daemons draaien:
</div><div class="segmentedlist"><table border="0"><thead><tr class="segtitle"><th>Daemon</th><th>Log Location</th></tr></thead><tbody><tr class="seglistitem"><td class="seg">auditd on</td><td class="seg"><code class="filename">/var/log/audit/audit.log</code></td></tr><tr class="seglistitem"><td class="seg">auditd off; rsyslogd on</td><td class="seg"><code class="filename">/var/log/messages</code></td></tr><tr class="seglistitem"><td class="seg">setroubleshootd, rsyslogd, and auditd on</td><td class="seg"><code class="filename">/var/log/audit/audit.log</code>. Easier-to-read denial messages also sent to <code class="filename">/var/log/messages</code></td></tr></tbody></table></div><div class="formalpara"><h5 class="formalpara" id="form-Security-Enhanced_Linux-Which_Log_File_is_Used-Starting_Daemons_Automatically">Daemons automatisch opstarten</h5>
Om de <code class="systemitem">auditd</code>, <code class="systemitem">rsyslogd</code>, en <code class="systemitem">setroubleshootd</code> daemons in te stellen om automatisch op te starten bij het opstarten van het systeem, voer je de volgende commando's uit als de Linux root gebruiker:
</div><pre class="screen">/sbin/chkconfig --levels 2345 auditd on
</pre><pre class="screen">/sbin/chkconfig --levels 2345 rsyslog on
</pre><pre class="screen">/sbin/chkconfig --levels 345 setroubleshoot on
</pre><div class="para">
Gebruik het <code class="command">service <em class="replaceable"><code>service-naam</code></em> status</code> commando om te controleren of deze services draaien, bijvoorbeeld:
</div><pre class="screen">$ /sbin/service auditd status
auditd (pid <em class="replaceable"><code>1318</code></em>) is running...
</pre><div class="para">
Als de hierboven genoemde services niet draaien (<code class="computeroutput"><em class="replaceable"><code>service-naam</code></em> is stopped</code>), voer je het <code class="command">service <em class="replaceable"><code>service-naam</code></em> start</code> commando uit als de Liinux root gebruiker om ze te starten. Bijvoorbeeld:
</div><pre class="screen"># /sbin/service setroubleshoot start
Starting setroubleshootd: [ OK ]
</pre></div><div class="section" lang="nl-NL"><div class="titlepage"><div><div><h2 class="title" id="sect-Security-Enhanced_Linux-Working_with_SELinux-Main_Configuration_File">5.3. Het hoofd configuratie bestand</h2></div></div></div><div class="para">
Het <code class="filename">/etc/selinux/config</code> bestand is het hoofd SELinux configuratie bestand. Het controleert de SELinux modus en de te gebruiken SELinux tactiek:
</div><pre class="screen"># This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - No SELinux policy is loaded.
SELINUX=enforcing
# SELINUXTYPE= can take one of these two values:
# targeted - Targeted processes are protected,
# mls - Multi Level Security protection.
SELINUXTYPE=targeted
</pre><div class="variablelist"><dl><dt><span class="term"><code class="computeroutput">SELINUX=enforcing (afdwingend)</code></span></dt><dd><div class="para">
De <code class="option">SELINUX</code> optie stelt de modus in waarin SELinux draait. SELinux heeft drie modes: enforcing (afdwingend), permissive (toelatend), en disabled (uitgezet). Als de afdwingende modus gebruikt wordt, wordt de SELinux tactiek afgedwongen, en SELinux verbiedt toegang gebaseerd op SELinux tactiekregels. Weigeringsboodschappen worden gelogd. Als de toelatende modus gebruikt wordt, wordt de SELinux tactiek niet afgedwongen. SELinux verbiedt geen toegang, maar weigeringen voor acties die geweigerd zouden zijn als SELinux in de afdwingende modus zou zijn, worden gelogd. In de uitgezette modus, is SELinux uitgezet (de SELinux module wordt niet registreerd bij de Linux kernel), en alleen DAC regels worden gebruikt.
</div></dd><dt><span class="term"><code class="computeroutput">SELINUXTYPE=targeted (gericht)</code></span></dt><dd><div class="para">
De <code class="option">SELINUXTYPE</code> optie stelt de te gebruiken SELinux tactiek in. Gerichte tactiek is de standaard tactiek. Verander deze optie alleen als je de MLS tactiek wilt gebruiken. Om de MLS tactiek te gebruiken, installeer je het <span class="package">selinux-policy-mls</span> pakket, je configureert <code class="option">SELINUXTYPE=mls</code> in <code class="filename">/etc/selinux/config</code>; en je start je systeem opnieuw op.
</div></dd></dl></div><div class="important"><h2>Belangrijk</h2><div class="para">
Als systemen draaien in de toelatende of uitgezette modes, hebben gebruikers toestemming om bestanden verkeerd te labelen. Ook worden bestanden aangemaakt terwijl SELinux uitgezet is niet gelabeld. Dit veroorzaakt problemen als daarna de modus naar afdwingend wordt veranderd. Om te voorkomen dat verkeerd gelabelde of niet gelabelde bestanden problemen veroorzaken, worden bestandssystemen automatisch geherlabeld als de modus verandert van uitgezet naar de toelatende of afdwingende modus.
</div></div></div><div class="section" lang="nl-NL"><div class="titlepage"><div><div><h2 class="title" id="sect-Security-Enhanced_Linux-Working_with_SELinux-Enabling_and_Disabling_SELinux">5.4. SELinux aanzetten en uitzetten</h2></div></div></div><div class="para">
Gebruik de <code class="command">/usr/sbin/getenforce</code> of <code class="command">/usr/sbin/sestatus</code> commando's om de status van SELinux te controleren. Het <code class="command">getenforce</code> commando geeft <code class="computeroutput">Enforcing</code>, <code class="computeroutput">Permissive</code>, of <code class="computeroutput">Disabled</code> terug. Het <code class="command">getenforce</code> geeft <code class="computeroutput">Enforcing</code> terug als SELinux is aangezet (SELinux tactiekregels zijn afgedwongen):
</div><pre class="screen">$ /usr/sbin/getenforce
Enforcing
</pre><div class="para">
Het <code class="command">getenforce</code> commando geeft <code class="computeroutput">Permissive</code> terug als SELinux is aangezet, maar SELinux tactiekregels worden niet afgedwongen, en alleen DAC regels worden gebruikt. Het <code class="command">getenforce</code> commando geeft <code class="computeroutput">Disabled</code> terug als SELinux is uitgezet.
</div><div class="para">
Het <code class="command">sestatus</code> commando geeft de SELinux status en de gebruikte SELinux tactiek terug:
</div><pre class="screen">$ /usr/sbin/sestatus
SELinux status: enabled
SELinuxfs mount: /selinux
Current mode: enforcing
Mode from config file: enforcing
Policy version: 23
Policy from config file: targeted
</pre><div class="para">
<code class="computeroutput">SELinux status: enabled</code> is returned when SELinux is enabled. <code class="computeroutput">Current mode: enforcing</code> is returned when SELinux is running in enforcing mode. <code class="computeroutput">Policy from config file: targeted</code> is returned when the SELinux targeted policy is used.
</div><div class="section" lang="nl-NL"><div class="titlepage"><div><div><h3 class="title" id="sect-Security-Enhanced_Linux-Enabling_and_Disabling_SELinux-Enabling_SELinux">5.4.1. SELinux aanzetten</h3></div></div></div><div class="para">
Op systemen waar SELinux is uitgezet, is de <code class="computeroutput">SELINUX=disabled</code> optie ingesteld in <code class="filename">/etc/selinux/config</code>:
</div><pre class="screen"># This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - No SELinux policy is loaded.
SELINUX=disabled
# SELINUXTYPE= can take one of these two values:
# targeted - Targeted processes are protected,
# mls - Multi Level Security protection.
SELINUXTYPE=targeted
</pre><div class="para">
Dus het <code class="command">getenforce</code> commando geeft <code class="computeroutput">Disabled</code> terug:
</div><pre class="screen">$ /usr/sbin/getenforce
Disabled
</pre><div class="para">
Om SELinux aan te zetten:
</div><div class="orderedlist"><ol><li><div class="para">
Gebruik de <code class="command">rpm -qa | grep selinux</code>, <code class="command">rpm -q policycoreutils</code>, en <code class="command">rpm -qa | grep setroubleshoot</code> commando's om te bevestigen dat de SELinux pakketten geinstalleerd zijn. Deze gids neemt aan dat de volgende pakketten geinstalleerd zijn: <span class="package">selinux-policy-targeted</span>, <span class="package">selinux-policy</span>, <span class="package">libselinux</span>, <span class="package">libselinux-python</span>, <span class="package">libselinux-utils</span>, <span class="package">policycoreutils</span>, <span class="package">setroubleshoot</span>, <span class="package">setroubleshoot-server</span> en <span class="package">setroubleshoot-plugins</span>. Als deze pakketten niet geinstalleerd zijn, installeer je ze als de Linux root gebruiker met het <code class="command">yum install <em class="replaceable"><code>pakket-naam</code></em></code> commando. De volgende pakketten zijn opti
oneel: <span class="package">policycoreutils-gui</span>, <span class="package">setroubleshoot</span>, <span class="package">selinux-policy-devel</span>, en <span class="package">mcstrans</span>.
</div><div class="para">
Na het installeren van het <span class="package">setroubleshoot-server</span> pakket, gebruik je het <code class="command">/sbin/chkconfig --list setroubleshoot</code> commando om te bevestigen dat <code class="systemitem">setroubleshootd</code> opstart als het systeem draait in runlevel<sup>[<a id="d0e2507" href="#ftn.d0e2507" class="footnote">10</a>]</sup> 3, 4, en 5:
</div><pre class="screen">$ /sbin/chkconfig --list setroubleshoot
setroubleshoot 0:off 1:off 2:off 3:on 4:on 5:on 6:off
</pre><div class="para">
Als de output anders is, voer je als de Linux root gebruiker het <code class="command">/sbin/chkconfig --levels 345 setroubleshoot on</code> commando uit. Hierdoor start <code class="systemitem">setroubleshootd</code> automatisch op als het systeem in runlevel 3, 4, en 5 draait.
</div></li><li><div class="para">
Voordat SELinux wordt aangezet, moet elk bestand in het bestandssysteem gelabeld worden met een SELinux context. Voordat dit gebeurt, kunnen beperkte domeinen toegang geweigerd worden, wat je systeem ervan weerhoudt om correct op te starten. Om dit te voorkomen, configureer je <code class="computeroutput">SELINUX=permissive</code> in <code class="filename">/etc/selinux/config</code>:
</div><pre class="screen"># This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - No SELinux policy is loaded.
SELINUX=permissive
# SELINUXTYPE= can take one of these two values:
# targeted - Targeted processes are protected,
# mls - Multi Level Security protection.
SELINUXTYPE=targeted
</pre></li><li><div class="para">
Als de Linux root gebruiker voer je het <code class="command">reboot</code> commando uit om het systeem opnieuw op te starten. Tijdens de volgende start worden de bestandssystemen gelabeld. Het label proces labelt alle bestanden met een SELinux context:
</div><pre class="screen">*** Warning -- SELinux targeted policy relabel is required.
*** Relabeling could take a very long time, depending on file
*** system size and speed of hard drives.
****
</pre><div class="para">
Elke <code class="computeroutput">*</code> karakter in de onderste regel representeerd 1000 bestanden die gelabeld zijn. In het bovenstaande voorbeeld, representeren vier <code class="computeroutput">*</code> karakters 4000 bestanden die gelabeld zijn. De tijd die het duurt om alle bestanden te labelen hangt af van het aantal bestanden op het systeem, en de snelheid van de harde schijf stations. Op moderne systemen kan dit proces 10 minuten duren.
</div></li><li><div class="para">
In de toelatende modus, wordt SELinux tactiek niet afgedwongen, maar weigeringen worden nog steeds gelogd voor acties die geweigerd zouden zijn als het systeem in de afdwingende modus zou draaien. Voordat je verandert naar de afdwingende modus, voer je als de Linux root gebruiker het <code class="command">grep "SELinux is preventing" /var/log/messages</code> commando uit om te bevestigen dat SELinux geen acties heeft geweigerd tijdens het laatste opstarten. Als SELinux geen acties heeft geweigerd tijdens het laatste opstarten, geeft dit commando geen output terug. Refereer naar <a class="xref" href="#chap-Security-Enhanced_Linux-Troubleshooting" title="Hoofdstuk 7. Foutzoeken">Hoofdstuk 7, <i>Foutzoeken</i></a> voor foutzoek informatie als SELinux toegang heeft geweigerd tijdens het opstarten.
</div></li><li><div class="para">
Als er geen weigeringsboodschappen in <code class="filename">/var/log/messages</code> waren, configureer je <code class="computeroutput">SELINUX=enforcing</code> in <code class="filename">/etc/selinux/config</code>:
</div><pre class="screen"># This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - No SELinux policy is loaded.
SELINUX=enforcing
# SELINUXTYPE= can take one of these two values:
# targeted - Targeted processes are protected,
# mls - Multi Level Security protection.
SELINUXTYPE=targeted
</pre></li><li><div class="para">
Start je systeem opnieuw op. Na het opstarten, bevestig je dat het <code class="command">getenforce</code> commando <code class="computeroutput">Enforcing</code> terug geeft:
</div><pre class="screen">$ /usr/sbin/getenforce
Enforcing
</pre></li><li><div class="para">
Als de Linux root gebruiker voer je het <code class="command">/usr/sbin/semanage login -l</code> commando uit op de afbeelding tussen SELinux en Linux gebruikers te bekijken. De output moet als volgt zijn:
</div><pre class="screen">Login Name SELinux User MLS/MCS Range
__default__ unconfined_u s0-s0:c0.c1023
root unconfined_u s0-s0:c0.c1023
system_u system_u s0-s0:c0.c1023
</pre></li></ol></div><div class="para">
Als dit niet het geval is, voer je als de Linux root gebruiker de volgende commando's uit om de gebruikersafbeeldingen te herstellen. Het is veilig om de <code class="computeroutput">SELinux-user<em class="replaceable"><code> gebruikersnaam</code></em> is already defined</code> waarschuwingen te negeren als ze voorkomen, waarin <em class="replaceable"><code>gebruikersnaam</code></em> <code class="computeroutput">unconfined_u</code>, <code class="computeroutput">guest_u</code>, of <code class="computeroutput">xguest_u</code> kan zijn:
</div><div class="orderedlist"><ol><li><div class="para">
<pre class="screen">/usr/sbin/semanage user -a -S targeted -P user -R "unconfined_r system_r" -r s0-s0:c0.c1023 unconfined_u
</pre>
</div></li><li><div class="para">
<pre class="screen">/usr/sbin/semanage login -m -S targeted -s "unconfined_u" -r s0-s0:c0.c1023 __default__
</pre>
</div></li><li><div class="para">
<pre class="screen">/usr/sbin/semanage login -m -S targeted -s "unconfined_u" -r s0-s0:c0.c1023 root
</pre>
</div></li><li><div class="para">
<pre class="screen">/usr/sbin/semanage user -a -S targeted -P user -R guest_r guest_u
</pre>
</div></li><li><div class="para">
<pre class="screen">/usr/sbin/semanage user -a -S targeted -P user -R xguest_r xguest_u
</pre>
</div></li></ol></div><div class="important"><h2>Belangrijk</h2><div class="para">
Als systemen draaien in de toelatende of uitgezette modes, hebben gebruikers toestemming om bestanden verkeerd te labelen. Ook worden bestanden aangemaakt terwijl SELinux uitgezet is niet gelabeld. Dit veroorzaakt problemen als daarna de modus naar afdwingend wordt veranderd. Om te voorkomen dat verkeerd gelabelde of niet gelabelde bestanden problemen veroorzaken, worden bestandssystemen automatisch geherlabeld als de modus verandert van uitgezet naar de toelatende of afdwingende modus.
</div></div></div><div class="section" lang="nl-NL"><div class="titlepage"><div><div><h3 class="title" id="sect-Security-Enhanced_Linux-Enabling_and_Disabling_SELinux-Disabling_SELinux">5.4.2. SELinux uitzetten</h3></div></div></div><div class="para">
Om SELinux uit te zetten, configureer je <code class="option">SELINUX=disabled</code> in <code class="filename">/etc/selinux/config</code>:
</div><pre class="screen"># This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - No SELinux policy is loaded.
SELINUX=disabled
# SELINUXTYPE= can take one of these two values:
# targeted - Targeted processes are protected,
# mls - Multi Level Security protection.
SELINUXTYPE=targeted
</pre><div class="para">
Start je systeem opnieuw op. Na het opstarten bevestig je dat het <code class="command">getenforce</code> commando <code class="computeroutput">Disabled</code> terug geeft:
</div><pre class="screen">$ /usr/sbin/getenforce
Disabled
</pre></div></div><div class="section" lang="nl-NL"><div class="titlepage"><div><div><h2 class="title" id="sect-Security-Enhanced_Linux-Working_with_SELinux-SELinux_Modes">5.5. SELinux modes</h2></div></div></div><div class="para">
SELinux heeft drie modes:
</div><div class="itemizedlist"><ul><li><div class="para">
Afdwingend: SELinux tactiek wordt afgedwongen. SELinux verbiedt toegang gebaseerd op SELinux tactiekreges.
</div></li><li><div class="para">
Toestaand: SELinux tactiek wordt niet afgedwongen. SELinux verbiedt geen toegang, maar weigeringen worden gelogd voor acties die verboden zouden zijn als de afdwingende modus actief zou zijn.
</div></li><li><div class="para">
Uitgezet: SELinux is uitgezet. Alleen DAC regels worden gebruikt.
</div></li></ul></div><div class="para">
Gebruik het <code class="command">/usr/sbin/setenforce</code> commando om te veranderen tussen afdwingende en toelatende mode. Veranderingen gemaakt met <code class="command">/usr/sbin/setenforce</code> zijn niet blijvend na een heropstarten van het systeem. Om naar de afdwingende modus te veranderen, voer je als de Linux root gebruiker het <code class="command">/usr/sbin/setenforce 1</code> commando uit. Om naar de toelatende modus te veranderen, voer je het <code class="command">/usr/sbin/setenforce 0</code> commando uit. Gebruik het <code class="command">/usr/sbin/getenforce</code> commando om de huidige SELinux modus te bekijken.
</div><div class="para">
Blijvende modus veranderingen worden behandeld in <a class="xref" href="#sect-Security-Enhanced_Linux-Working_with_SELinux-Enabling_and_Disabling_SELinux" title="5.4. SELinux aanzetten en uitzetten">Paragraaf 5.4, “SELinux aanzetten en uitzetten”</a>.
</div></div><div class="section" lang="nl-NL"><div class="titlepage"><div><div><h2 class="title" id="sect-Security-Enhanced_Linux-Working_with_SELinux-Booleans">5.6. Booleans</h2></div></div></div><div class="para">
Booleans staan toe dat onderdelen van SELinux tactiek veranderd worden tijdens het draaien, zonder dat enige kennis nodig is over het schrijven van SELinux tactiek. Dit staat toe om veranderingen te maken, zoals het toestaan van services toegang tot NFS bestandssystemen, zonder het herladen of hercompileren van SELinux tactiek.
</div><div class="section" lang="nl-NL"><div class="titlepage"><div><div><h3 class="title" id="sect-Security-Enhanced_Linux-Booleans-Listing_Booleans">5.6.1. Booleans laten zien</h3></div></div></div><div class="para">
Voor een lijst van Booleans, een uitleg over wat ze zijn, en of ze aan of uit zijn, voer je het <code class="command">semanage boolean -l</code> commando uit als de Linux root gebruiker. Het volgende voorbeeld laat niet alle Booleans zien:
</div><pre class="screen"># /usr/sbin/semanage boolean -l
SELinux boolean Description
ftp_home_dir -> off Allow ftp to read and write files in the user home directories
xen_use_nfs -> off Allow xen to manage nfs files
xguest_connect_network -> on Allow xguest to configure Network Manager
</pre><div class="para">
De <code class="computeroutput">SELinux boolean</code> kolom laat de lijst van Boolean namen zien. De <code class="computeroutput">Description</code> kolom laat zien of de Booleans aan of uit zijn, en wat ze doen.
</div><div class="para">
In het volgende voorbeeld, is de <code class="computeroutput">ftp_home_dir</code> Boolean uit, dit belet de FTP daemon (<code class="systemitem">vsftpd</code>) om bestanden in de persoonlijke mappen van de gebruiker te lezen of te schrijven:
</div><pre class="screen">ftp_home_dir -> off Allow ftp to read and write files in the user home directories
</pre><div class="para">
Het <code class="command">getsebool -a</code> commando laat een lijst zien van de Booleans, of ze nu aan of uit zijn, maar geeft geen beschrijving van elke Boolean. Het volgende voorbeeld laat niet alle Booleans zien:
</div><pre class="screen">$ /usr/sbin/getsebool -a
allow_console_login --> off
allow_cvs_read_shadow --> off
allow_daemons_dump_core --> on
</pre><div class="para">
Voer het <code class="command">getsebool <em class="replaceable"><code>boolean-naam</code></em></code> commando uit om alleen de status van de <em class="replaceable"><code>boolean-naam</code></em> Boolean te laten zien:
</div><pre class="screen">$ /usr/sbin/getsebool allow_console_login
allow_console_login --> off
</pre><div class="para">
Gebruik een met spaties gescheiden lijst om meerdere Booleans te laten zien:
</div><pre class="screen">$ getsebool allow_console_login allow_cvs_read_shadow allow_daemons_dump_core
allow_console_login --> off
allow_cvs_read_shadow --> off
allow_daemons_dump_core --> on
</pre></div><div class="section" lang="nl-NL"><div class="titlepage"><div><div><h3 class="title" id="sect-Security-Enhanced_Linux-Booleans-Configuring_Booleans">5.6.2. Booleans instellen</h3></div></div></div><div class="para">
Het <code class="command">setsebool <em class="replaceable"><code>boolean-naam</code></em> <em class="replaceable"><code>x</code></em></code> commando zet Booleans aan of uit, waarin <em class="replaceable"><code>boolean-naam</code></em> de naam van een Boolean is, en <em class="replaceable"><code>x</code></em> of <code class="option">on</code> is om de Boolean aan te zetten, of <code class="option">off</code> is om hem uit te zetten.
</div><div class="para">
Het volgende voorbeeld laat het instellen van de <code class="computeroutput">httpd_can_network_connect_db</code> Boolean zien:
</div><div class="orderedlist"><ol><li><div class="para">
Standaard is de <code class="computeroutput">httpd_can_network_connect_db</code> Boolean uit, wat Apache HTTP scripts en modules belet om te verbinden met database servers:
</div><pre class="screen">$ /usr/sbin/getsebool httpd_can_network_connect_db
httpd_can_network_connect_db --> off
</pre></li><li><div class="para">
Om Apache HTTP server scripts en modules tijdelijk toe te staan om te verbinden met database servers, voer je het <code class="command">setsebool httpd_can_network_connect_db on</code> commando uit als de Linux root gebruiker.
</div></li><li><div class="para">
Gebruik het <code class="command">getsebool httpd_can_network_connect_db</code> commando om te bevestigen dat de Boolean aangezet is:
</div><pre class="screen">$ /usr/sbin/getsebool httpd_can_network_connect_db
httpd_can_network_connect_db --> on
</pre><div class="para">
Dit staat Apache HTTP server scripts en modules toe om te verbinden met de datadase server.
</div></li><li><div class="para">
Deze verandering is niet blijvend na een systeem herstart. Om de veranderingen blijvend te maken na het herstarten van het systeem, voer je het <code class="command">setsebool -P <em class="replaceable"><code>boolean-naam</code></em> on</code> commando uit als de Linux root gebruiker:
</div><pre class="screen"># /usr/sbin/setsebool -P httpd_can_network_connect_db on
</pre></li><li><div class="para">
Om tijdelijk terug te gaan naar het standaard gedrag, voer je als de Linux root gebruiker het <code class="command">setsebool httpd_can_network_connect_db off</code> commando uit. Voor veranderingen die blijvend zijn na het herstarten, voer je het <code class="command">setsebool -P httpd_can_network_connect_db off</code> commando uit.
</div></li></ol></div></div><div class="section" lang="nl-NL"><div class="titlepage"><div><div><h3 class="title" id="sect-Security-Enhanced_Linux-Booleans-Booleans_for_NFS_and_CIFS">5.6.3. Booleans voor NFS en CIFS</h3></div></div></div><div class="para">
Standaard zijn NFS aankoppelingen op de client zijde gelabeld met een standaard context gedefinieerd door tactiek voor NFS bestandssystemen. In algemene tactieken gebruikt deze standaard context het <code class="computeroutput">nfs_t</code> type. En ook zijn standaard Samba delingen aangekoppeld op de client zijde gelabeld met een standaard context gedefinieerd door tactiek. In algemene tactieken gebruikt deze standaard context het <code class="computeroutput">cifs_t</code> type.
</div><div class="para">
Afhankelijk van de tactiek instelling, kunnen services niet in staat zijn om bestanden gelabeld met de <code class="computeroutput">nfs_t</code> of <code class="computeroutput">cifs_t</code> types te lezen. Dit kan bestandssystemen die met deze types gelabeld zijn beletten om aangekoppeld te worden en daarna gelezen of geexporteerd te worden door andere services. Booleans kunnen aan of uit gezet worden om te bepalen welke services toestemming hebben om toegang te krijgen tot de <code class="computeroutput">nfs_t</code> ene<code class="computeroutput">cifs_t</code> types.
</div><div class="para">
De <code class="command">setsebool</code> en <code class="command">semanage</code> commando's moeten uitgevoerd worden als de Linux root gebruiker. Het <code class="command">setsebool -P</code> commando maakt blijvende veranderingen. Gebruik de <code class="option">-P</code> optie niet als je niet wilt dat veranderingen blijvend zijn na het opnieuw opstarten van het systeem:
</div><div class="formalpara"><h5 class="formalpara" id="form-Security-Enhanced_Linux-Booleans_for_NFS_and_CIFS-Apache_HTTP_Server">Apache HTTP server</h5>
Om toegang toe te staan voor NFS bestandssystemen (bestanden gelabeld met het <code class="computeroutput">nfs_t</code> type):
</div><div class="para">
<code class="command">/usr/sbin/setsebool -P httpd_use_nfs on</code>
</div><div class="para">
Om toegang toe te staan tot Samba bestandsystemen (bestanden gelabeld met het <code class="computeroutput">cifs_t</code> type):
</div><div class="para">
<code class="command">/usr/sbin/setsebool -P httpd_use_cifs on</code>
</div><div class="formalpara"><h5 class="formalpara" id="form-Security-Enhanced_Linux-Booleans_for_NFS_and_CIFS-Samba">Samba</h5>
Om NFS bestandssystemen te exporteren:
</div><div class="para">
<code class="command">/usr/sbin/setsebool -P samba_share_nfs on</code>
</div><div class="formalpara"><h5 class="formalpara" id="form-Security-Enhanced_Linux-Booleans_for_NFS_and_CIFS-FTP_vsftpd">FTP (<code class="systemitem">vsftpd</code>)</h5>
Om toegang toe te staan tot NFS bestandssystemen:
</div><div class="para">
<code class="command">/usr/sbin/setsebool -P allow_ftpd_use_nfs on</code>
</div><div class="para">
Om toegang toe te staan tot Samba bestandssystemen:
</div><div class="para">
<code class="command">/usr/sbin/setsebool -P allow_ftpd_use_cifs on</code>
</div><div class="formalpara"><h5 class="formalpara" id="form-Security-Enhanced_Linux-Booleans_for_NFS_and_CIFS-Other_Services">Andere services</h5>
Voor een lijst van aan NFS gerelateerde Booleans voor andere services:
</div><div class="para">
<code class="command">/usr/sbin/semanage boolean -l | grep nfs</code>
</div><div class="para">
Voor een lijst van aan Samba gerelateerde Booleans voor andere services:
</div><div class="para">
<code class="command">/usr/sbin/semanage boolean -l | grep cifs</code>
</div><div class="note"><h2>Opmerking</h2><div class="para">
Deze Booleans bestaan in SELinux tactiek zoals verstuurd met Fedora 11. Ze kunnen misschien niet bestaan in tactiek verstuurd met andere versies van Fedora of andere operating systemen.
</div></div></div></div><div class="section" lang="nl-NL"><div class="titlepage"><div><div><h2 class="title" id="sect-Security-Enhanced_Linux-Working_with_SELinux-SELinux_Contexts_Labeling_Files">5.7. SELinux context - Bestanden labelen</h2></div></div></div><div class="para">
Op systemen die SELinux draaien, zijn alle processen en bestanden gelabeld met een label die informatie bevat die relevant is voor de beveiliging. Deze informatie wordt de SELinux context genoemd. Voor bestanden kan deze bekeken worden met het <code class="command">ls -Z</code> commando:
</div><pre class="screen">$ ls -Z file1
-rw-rw-r-- user1 group1 unconfined_u:object_r:user_home_t:s0 file1
</pre><div class="para">
In dit voorbeeld biedt SELinux een gebruiker (<code class="computeroutput">unconfined_u</code>), een rol (<code class="computeroutput">object_r</code>), een type (<code class="computeroutput">user_home_t</code>), en een niveau (<code class="computeroutput">s0</code>). Deze informatie wordt gebruikt om toegangscontrole beslissingen te maken. Op DAC systemen wordt toegang gecontroleerd op basis van Linux gebruiker en groep ID's. SELinux tactiekregels worden toegepast na de DAC regels. SELinux tactiekregels worden niet gebruikt als DAC regels als eerste toegang weigeren.
</div><div class="para">
Er zijn meerdere commando's voor het beheren van de SELinux context voor bestanden, zoals <code class="command">chcon</code>, <code class="command">semanage fcontext</code>, en <code class="command">restorecon</code>.
</div><div class="section" lang="nl-NL"><div class="titlepage"><div><div><h3 class="title" id="sect-Security-Enhanced_Linux-SELinux_Contexts_Labeling_Files-Temporary_Changes_chcon">5.7.1. Tijdelijke veranderingen: chcon</h3></div></div></div><div class="para">
Het <code class="command">chcon</code> commando verandert de SELinux context voor bestanden. Deze veranderingen overleven het herlabelen van een bestandssysteem niet, en ook het <code class="command">/sbin/restorecon</code> commando niet. SELinux tactiek controleert welke gebruikers in staat zijn om de SELinux context voor elk bestand te veranderen. Als <code class="command">chcon</code> gebruikt wordt, kunnen gebruikers alle of een deel van de SELinux context veranderen. Een foutief bestands type is een vaak voorkomende fout als SELinux toegang weigert.
</div><div class="formalpara"><h5 class="formalpara" id="form-Security-Enhanced_Linux-Temporary_Changes_chcon-Quick_Reference">Korte referentie</h5>
<div class="itemizedlist"><ul><li><div class="para">
Voer het <code class="command">chcon -t <em class="replaceable"><code>type</code></em> <em class="replaceable"><code>bestandsnaam</code></em></code> commando uit om het bestandstype te veranderen, waarin <em class="replaceable"><code>type</code></em> een type is, zoals <code class="computeroutput">httpd_sys_content_t</code>, en <em class="replaceable"><code>bestandsnaam</code></em> een bestand of een map is.
</div></li><li><div class="para">
Voer het <code class="command">chcon -R -t <em class="replaceable"><code>type</code></em> <em class="replaceable"><code>mapnaam</code></em></code> commando uit om het type van een map en zijn inhoud te veranderen, waarin <em class="replaceable"><code>type</code></em> een type is, zoals <code class="computeroutput">httpd_sys_content_t</code>, en <em class="replaceable"><code>mapnaam</code></em> een mapnaam is.
</div></li></ul></div>
</div><div class="formalpara"><h5 class="formalpara" id="form-Security-Enhanced_Linux-Temporary_Changes_chcon-Changing_a_Files_or_Directorys_Type">Het veranderen van het type van een bestand of map</h5>
Het volgende voorbeeld laat het veranderen van het type zien, alle andere attributen van de SELinux context blijven onveranderd:
</div><div class="orderedlist"><ol><li><div class="para">
Voer het <code class="command">cd</code> commando uit zonder argumenten om naar je persoonlijke map te gaan.
</div></li><li><div class="para">
Voer het <code class="command">touch file1</code> commando uit om een nieuw bestand aan te maken. Gebruik het <code class="command">ls -Z file1</code> commando om de SELinux context voor <code class="filename">file1</code> te zien:
</div><pre class="screen">$ ls -Z file1
-rw-rw-r-- user1 group1 unconfined_u:object_r:user_home_t:s0 file1
</pre><div class="para">
In dit voorbeeld bevat de SELinux context voor <code class="filename">file1</code> de SELinux <code class="computeroutput">unconfined_u</code> gebruiker, de <code class="computeroutput">object_r</code> rol, het <code class="computeroutput">user_home_t</code> type, en het <code class="computeroutput">s0</code> niveau. Voor een beschrijving van ieder onderdeel van de SELinux context, refereer je naar <a class="xref" href="#chap-Security-Enhanced_Linux-SELinux_Contexts" title="Hoofdstuk 3. SELinux context">Hoofdstuk 3, <i>SELinux context</i></a>.
</div></li><li><div class="para">
Voer het <code class="command">chcon -t samba_share_t file1</code> commando uit om het type te veranderen naar <code class="computeroutput">samba_share_t</code>. De <code class="option">-t</code> optie verandert alleen het type. Bekijk de verandering met <code class="command">ls -Z file1</code>:
</div><pre class="screen">$ ls -Z file1
-rw-rw-r-- user1 group1 unconfined_u:object_r:samba_share_t:s0 file1
</pre></li><li><div class="para">
Gebruik het <code class="command">/sbin/restorecon -v file1</code> commando om de SELinux context voor het <code class="filename">file1</code> bestand te herstellen. Gebruik de <code class="option">-v</code> optie om te zien wat er verandert:
</div><pre class="screen">$ /sbin/restorecon -v file1
restorecon reset file1 context unconfined_u:object_r:samba_share_t:s0->system_u:object_r:user_home_t:s0
</pre><div class="para">
In dit voorbeeld wordt het vorige type, <code class="computeroutput">samba_share_t</code>, hersteld naar het juiste <code class="computeroutput">user_home_t</code> type. Als gerichte tactiek gebruikt wordt (de standaard SELinux tactiek in Fedora 11), leest het <code class="command">/sbin/restorecon</code> commando de bestanden in de <code class="filename">/etc/selinux/targeted/contexts/files/</code> map om te zien welke SELinux context bestanden moeten hebben.
</div></li></ol></div><div class="para">
Het voorbeeld in deze paragraaf werkt hetzelfde voor mappen, bijvoorbeeld, als <code class="filename">file1</code> een map was.
</div><div class="formalpara"><h5 class="formalpara" id="form-Security-Enhanced_Linux-Temporary_Changes_chcon-Changing_a_Directory_and_its_Contents_Types">Een map en zijn context types veranderen</h5>
Het volgende voorbeeld laat het aanmaken van een nieuwe map zien, en het veranderen van het bestandstype van de map (te samen met zijn inhoud) naar een type dat gebruikt wordt voor de Apache HTTP server. De instelling in dit voorbeeld wordt gebruikt als je wilt dat de Apache HTTP server een ander document root gebruikt (in plaats van <code class="filename">/var/www/html/</code>):
</div><div class="orderedlist"><ol><li><div class="para">
Als de Linux root gebruiker voer je het <code class="command">mkdir /web</code> commando uit om een nieuwe map aan te maken, en daarna het <code class="command">touch /web/file{1,2,3}</code> commando om 3 lege bestanden aan te maken (<code class="filename">file1</code>, <code class="filename">file2</code>, en <code class="filename">file3</code>). De <code class="filename">/web/</code> map en zijn bestanden zijn gelabeld met het <code class="computeroutput">default_t</code> type:
</div><pre class="screen"># ls -dZ /web
drwxr-xr-x root root unconfined_u:object_r:default_t:s0 /web
# ls -lZ /web
-rw-r--r-- root root unconfined_u:object_r:default_t:s0 file1
-rw-r--r-- root root unconfined_u:object_r:default_t:s0 file2
-rw-r--r-- root root unconfined_u:object_r:default_t:s0 file3
</pre></li><li><div class="para">
Als de Linux root gebruiker voer je het <code class="command">chcon -R -t httpd_sys_content_t /web/</code> commando uit om het type van de <code class="filename">/web/</code> map (en zijn inhoud) te veranderen naar <code class="computeroutput">httpd_sys_content_t</code>:
</div><pre class="screen"># chcon -R -t httpd_sys_content_t /web/
# ls -dZ /web/
drwxr-xr-x root root unconfined_u:object_r:httpd_sys_content_t:s0 /web/
# ls -lZ /web/
-rw-r--r-- root root unconfined_u:object_r:httpd_sys_content_t:s0 file1
-rw-r--r-- root root unconfined_u:object_r:httpd_sys_content_t:s0 file2
-rw-r--r-- root root unconfined_u:object_r:httpd_sys_content_t:s0 file3
</pre></li><li><div class="para">
Als de Linux root gebruiker voer je het <code class="command">/sbin/restorecon -R -v /web/</code> commando uit om de standaard SELinux context te herstellen:
</div><pre class="screen"># /sbin/restorecon -R -v /web/
restorecon reset /web context unconfined_u:object_r:httpd_sys_content_t:s0->system_u:object_r:default_t:s0
restorecon reset /web/file2 context unconfined_u:object_r:httpd_sys_content_t:s0->system_u:object_r:default_t:s0
restorecon reset /web/file3 context unconfined_u:object_r:httpd_sys_content_t:s0->system_u:object_r:default_t:s0
restorecon reset /web/file1 context unconfined_u:object_r:httpd_sys_content_t:s0->system_u:object_r:default_t:s0
</pre></li></ol></div><div class="para">
Refereer naar de <span class="citerefentry"><span class="refentrytitle">chcon</span>(1)</span> manual pagina voor verdere informatie over <code class="command">chcon</code>.
</div><div class="note"><h2>Opmerking</h2><div class="para">
Type Enforcement is de belangrijkste toestemmingscontrole gebruikt in SELinux gerichte tactiek. Voor het grootste deel kunnen SELinux gebruikers en rollen genegeerd worden.
</div></div></div><div class="section" lang="nl-NL"><div class="titlepage"><div><div><h3 class="title" id="sect-Security-Enhanced_Linux-SELinux_Contexts_Labeling_Files-Persistent_Changes_semanage_fcontext">5.7.2. Permanente veranderingen: semanage fcontext</h3></div></div></div><div class="para">
Het <code class="command">/usr/sbin/semanage fcontext</code> commando verandert de SELinux context voor bestanden. Als de gerichte tactiek gebruikt wordt, worden veranderingen die met dit commando gemaakt zijn toegevoegd aan het <code class="filename">/etc/selinux/targeted/contexts/files/file_contexts</code> bestand als de veranderingen gemaakt zijn voor bestanden die bestaan in <code class="filename">file_contexts</code>, of worden toegevoegd aan <code class="filename">file_contexts.local</code> voor nieuwe bestanden en mappen, zoals het aan maken van een <code class="filename">/web/</code> map. <code class="command">setfiles</code>, welke gebruikt wordt als een bestandssysteem geherlabeld wordt, en <code class="command">/sbin/restorecon</code>, welke de standaard SELinux context herstelt, lezen deze bestanden. Dit betekent dat veranderingen gemaakt door <code class="command">/usr/sbin/semanage fcontext</code> blijvend zijn, zelfs als het bestandssysteem opnieuw gelabeld
wordt. SELinux tactiek controleert of gebruikers in staat zijn de SELinux context van een bepaald bestand kunnen veranderen.
</div><div class="formalpara"><h5 class="formalpara" id="form-Security-Enhanced_Linux-Persistent_Changes_semanage_fcontext-Quick_Reference">Korte referentie</h5>
Om SELinux context veranderingen te maken die het opnieuw labelen van een bestandssysteem overleven:
</div><div class="orderedlist"><ol><li><div class="para">
Voer het <code class="command">/usr/sbin/semanage fcontext -a <em class="replaceable"><code>opties</code></em> <em class="replaceable"><code>bestandsnaam</code></em>|<em class="replaceable"><code>mapnaam</code></em></code> commando uit, waarbij je er aan moet denken om voor een bestand of map het volledige pad te gebruiken.
</div></li><li><div class="para">
Voer het <code class="command">/sbin/restorecon -v <em class="replaceable"><code>bestandsnaam</code></em>|<em class="replaceable"><code>mapnaam</code></em></code> commando uit om de context veranderingen toe te passen.
</div></li></ol></div><div class="formalpara"><h5 class="formalpara" id="form-Security-Enhanced_Linux-Persistent_Changes_semanage_fcontext-Changing_a_Files_Type">Het veranderen van een bestandstype</h5>
Het volgende voorbeeld laat het veranderen van een bestandstype zien, waarbij geen andere attributen van de SELinux context veranderen:
</div><div class="orderedlist"><ol><li><div class="para">
Als de Linux root gebruiker, voer je het <code class="command">touch /etc/file1</code> commando uit om een nieuw bestand aan te maken. Standaard worden nieuw aangemaakte bestanden in de <code class="filename">/etc/</code> gelabeld met het <code class="computeroutput">etc_t</code> type:
</div><pre class="screen"># ls -Z /etc/file1
-rw-r--r-- root root unconfined_u:object_r:etc_t:s0 /etc/file1
</pre></li><li><div class="para">
Als de Linux root gebruiker voer je het <code class="command">/usr/sbin/semanage fcontext -a -t samba_share_t /etc/file1</code> commando uit om het type van <code class="filename">file1</code> te veranderen naar <code class="computeroutput">samba_share_t</code>. De <code class="option">-a</code> optie voegt een nieuwe optekening toe, en de <code class="option">-t</code> optie definieert een type (<code class="computeroutput">samba_share_t</code>). Merk op: het uitvoeren van dit commando verandert niet direct het type - <code class="filename">file1</code> is nog steeds gelabeld met het <code class="computeroutput">etc_t</code> type:
</div><pre class="screen"># /usr/sbin/semanage fcontext -a -t samba_share_t /etc/file1
# ls -Z /etc/file1
-rw-r--r-- root root unconfined_u:object_r:etc_t:s0 /etc/file1
</pre><div class="para">
Het <code class="command">/usr/sbin/semanage fcontext -a -t samba_share_t /etc/file1</code> commando voegt de volgende regel toe aan <code class="filename">/etc/selinux/targeted/contexts/files/file_contexts.local</code>:
</div><pre class="screen">/etc/file1 unconfined_u:object_r:samba_share_t:s0
</pre></li><li><div class="para">
Als de Linux root gebruiker voer je het <code class="command">/sbin/restorecon -v /etc/file1</code> commando uit om het type te veranderen. Omdat het <code class="command">semanage</code> commando een regel aan <code class="filename">file.contexts.local</code> heeft toegevoegd voor <code class="filename">/etc/file1</code>, verandert het <code class="command">/sbin/restorecon</code> commando het type naar <code class="computeroutput">samba_share_t</code>:
</div><pre class="screen"># /sbin/restorecon -v /etc/file1
restorecon reset /etc/file1 context unconfined_u:object_r:etc_t:s0->system_u:object_r:samba_share_t:s0
</pre></li><li><div class="para">
Als de Linux root gebruiker voer je het <code class="command">rm -i /etc/file1</code> commando uit om <code class="filename">file1</code> te verwijderen.
</div></li><li><div class="para">
Als de Linux root gebruiker voer je het <code class="command">/usr/sbin/semanage fcontext -d /etc/file1</code> commando uit om de context toegevoegd voor <code class="filename">/etc/file1</code> te verwijderen. Als de context verwijderd is, zal het uitvoeren van <code class="command">restorecon</code> het type veranderen naar <code class="computeroutput">etc_t</code>, in plaats van <code class="computeroutput">samba_share_t</code>.
</div></li></ol></div><div class="formalpara"><h5 class="formalpara" id="form-Security-Enhanced_Linux-Persistent_Changes_semanage_fcontext-Changing_a_Directorys_Type">Het veranderen van het type van een map</h5>
Het volgende voorbeeld laat het aanmaken van een nieuwe map zien en het veranderen van het bestandstype van die map naar een type dat gebruikt wordt door de Apache HTTP server:
</div><div class="orderedlist"><ol><li><div class="para">
Als de Linux root gebruiker voer je het <code class="command">mkdir /web</code> commando uit om een nieuwe map aan te maken. Deze map is gelabeld met het <code class="computeroutput">default_t</code> type:
</div><pre class="screen"># ls -dZ /web
drwxr-xr-x root root unconfined_u:object_r:default_t:s0 /web
</pre><div class="para">
De <code class="command">ls</code> <code class="option">-d</code> optie laat <code class="command">ls</code> informatie tonen over een map, in plaats van zijn inhoud, en de <code class="option">-Z</code> optie laat <code class="command">ls</code> de SELinux context tonen (in dit voorbeeld, <code class="computeroutput">unconfined_u:object_r:default_t:s0</code>).
</div></li><li><div class="para">
Als de Linux root gebruiker voer je het <code class="command">/usr/sbin/semanage fcontext -a -t httpd_sys_content_t /web</code> commando uit om het type van <code class="filename">/web/</code> te veranderen naar <code class="computeroutput">httpd_sys_content_t</code>. De <code class="option">-a</code> optie voegt een nieuwe aantekening toe, en de <code class="option">-t</code> optie definieert een type (<code class="computeroutput">httpd_sys_content_t</code>). Merk op: het uitvoeren van dit commando verandert niet direct het type - <code class="filename">/web/</code> is nog steeds gelabeld met het <code class="computeroutput">default_t</code> type:
</div><pre class="screen"># /usr/sbin/semanage fcontext -a -t httpd_sys_content_t /web
# ls -dZ /web
drwxr-xr-x root root unconfined_u:object_r:default_t:s0 /web
</pre><div class="para">
Het <code class="command">/usr/sbin/semanage fcontext -a -t httpd_sys_content_t /web</code> commmando voegt de volgende regel toe aan <code class="command">/etc/selinux/targeted/contexts/files/file_contexts.local</code>:
</div><pre class="screen">/web unconfined_u:object_r:httpd_sys_content_t:s0
</pre></li><li><div class="para">
Als de Linux root gebruiker voer je het <code class="command">/sbin/restorecon -v /web</code> commando uit om het type te veranderen. Omdat het <code class="command">semanage</code> commando een regel aan <code class="filename">file.contexts.local</code> heeft toegevoegd voor <code class="filename">/web</code>, verandert het <code class="command">/sbin/restorecon</code> commando het type naar <code class="computeroutput">httpd_sys_content_t</code>:
</div><pre class="screen"># /sbin/restorecon -v /web
restorecon reset /web context unconfined_u:object_r:default_t:s0->system_u:object_r:httpd_sys_content_t:s0
</pre><div class="para">
Standaard erven nieuw aangemaakte bestanden en mappen het SELinux type van hun ouders map. Als dit voorbeeld gebruikt wordt, en voordat de SELinx context toegevoegd voor <code class="filename">/web/</code> is verwijderd, zijn bestanden en mappen aangemaakt in de <code class="filename">/web/</code> map gelabeld met het <code class="computeroutput">httpd_sys_content_t</code> type.
</div></li><li><div class="para">
Als de Linux root gebruiker voer je het <code class="command">/usr/sbin/semanage fcontext -d /web</code> commando uit om de toegevoegde context voor <code class="filename">/web/</code> te verwijderen.
</div></li><li><div class="para">
Als de Linux root gebruiker voer je het <code class="command">/sbin/restorecon -v /web</code> commando uit om de standaard SELinux context te herstellen.
</div></li></ol></div><div class="formalpara"><h5 class="formalpara" id="form-Security-Enhanced_Linux-Persistent_Changes_semanage_fcontext-Changing_a_Directory_and_its_Contents_Types">Een map en zijn context types veranderen</h5>
Het volgende voorbeeld laat het aanmaken van een nieuwe map zien, en het veranderen van het bestandstype van de map (te samen met zijn inhoud) naar een type dat gebruikt wordt door de Apache HTTP server. De instelling in dit voorbeeld wordt gebruikt als je wilt dat de Apache HTTP server een andere document root gaat gebruiken (in plaats van <code class="filename">/var/www/html/</code>):
</div><div class="orderedlist"><ol><li><div class="para">
Als de Linux root gebruiker voer je het <code class="command">mkdir /web</code> commando uit om een nieuwe map aan te maken, en daarna het <code class="command">touch /web/file{1,2,3}</code> commando om 3 lege bestanden aan te maken (<code class="filename">file1</code>, <code class="filename">file2</code>, en <code class="filename">file3</code>). De <code class="filename">/web/</code> map en zijn bestanden zijn gelabeld met het <code class="computeroutput">default_t</code> type:
</div><pre class="screen"># ls -dZ /web
drwxr-xr-x root root unconfined_u:object_r:default_t:s0 /web
# ls -lZ /web
-rw-r--r-- root root unconfined_u:object_r:default_t:s0 file1
-rw-r--r-- root root unconfined_u:object_r:default_t:s0 file2
-rw-r--r-- root root unconfined_u:object_r:default_t:s0 file3
</pre></li><li><div class="para">
Als de Linux root gebruiker voer je het <code class="command">/usr/sbin/semanage fcontext -a -t httpd_sys_content_t "/web(/.*)?"</code> commando uit om het type van de <code class="filename">/web/</code>, en de bestanden hierin, te veranderen naar <code class="computeroutput">httpd_sys_content_t</code>. De <code class="option">-a</code> optie voegt een nieuwe aantekening toe, en de <code class="option">-t</code> optie definieert een type (httpd_sys_content_t). De <code class="computeroutput">"/web(/.*)?"</code> reguliere expressie laat het <code class="command">semanage</code> commando veranderingen maken naar de <code class="filename">/web/</code> map, en naar de bestanden daar in. Merk op: het uitvoeren van dit commando verandert niet direct het type - <code class="filename">/web/</code> en de bestanden hierin zijn nog steeds gelabeld met het <code class="computeroutput">default_t</code> type:
</div><pre class="screen"># ls -dZ /web
drwxr-xr-x root root unconfined_u:object_r:default_t:s0 /web
# ls -lZ /web
-rw-r--r-- root root unconfined_u:object_r:default_t:s0 file1
-rw-r--r-- root root unconfined_u:object_r:default_t:s0 file2
-rw-r--r-- root root unconfined_u:object_r:default_t:s0 file3
</pre><div class="para">
Het <code class="command">/usr/sbin/semanage fcontext -a -t httpd_sys_content_t "/web(/.*)?"</code> commando voegt de volgende regel toe aan <code class="filename">/etc/selinux/targeted/contexts/files/file_contexts.local</code>:
</div><pre class="screen">/web(/.*)? system_u:object_r:httpd_sys_content_t:s0
</pre></li><li><div class="para">
Als de Linux root gebruiker voer je het <code class="command">/sbin/restorecon -R -v /web</code> commando uit om het type van de <code class="filename">/web/</code> map, en alle bestanden hierin, te veranderen. De <code class="option">-R</code> optie staat voor recursief, wat betekent dat alle bestanden en mappen onder de <code class="filename">/web/</code> map gelabeld worden met het <code class="computeroutput">httpd_sys_content_t</code> type. Omdat het <code class="command">semanage</code> commando een regel toevoegde aan <code class="filename">file.contexts.local</code> voor <code class="computeroutput">/web(/.*)?</code>, verandert het <code class="command">/sbin/restorecon</code> commando de types naar <code class="computeroutput">httpd_sys_content_t</code>:
</div><pre class="screen"># /sbin/restorecon -R -v /web
restorecon reset /web context unconfined_u:object_r:default_t:s0->system_u:object_r:httpd_sys_content_t:s0
restorecon reset /web/file2 context unconfined_u:object_r:default_t:s0->system_u:object_r:httpd_sys_content_t:s0
restorecon reset /web/file3 context unconfined_u:object_r:default_t:s0->system_u:object_r:httpd_sys_content_t:s0
restorecon reset /web/file1 context unconfined_u:object_r:default_t:s0->system_u:object_r:httpd_sys_content_t:s0
</pre><div class="para">
Standaard erven nieuw aangemaakte bestanden en mappen het SELinux type van hun ouders. In dit voorbeeld, zullen bestanden en mappen aangemaakt in de <code class="filename">/web/</code> map gelabeld worden met het <code class="computeroutput">httpd_sys_content_t</code> type.
</div></li><li><div class="para">
Als de Linux root gebruiker voer je het <code class="command">/usr/sbin/semanage fcontext -d "/web(/.*)?"</code> commando uit om de context toegevoegd voor <code class="computeroutput">"/web(/.*)?"</code> te verwijderen.
</div></li><li><div class="para">
Als de Linux root gebruiker voer je het <code class="command">/sbin/restorecon -R -v /web</code> om de standaard SELinux context te herstellen.
</div></li></ol></div><div class="formalpara"><h5 class="formalpara" id="form-Security-Enhanced_Linux-Persistent_Changes_semanage_fcontext-Deleting_an_added_Context">Een toegevoegde context verwijderen</h5>
Het volgende voorbeeld laat het toevoegen en verwijderen van een SELinux context zien:
</div><div class="orderedlist"><ol><li><div class="para">
Als de Linux root gebruiker voer je het <code class="command">/usr/sbin/semanage fcontext -a -t httpd_sys_content_t /test</code> commando uit. De <code class="filename">/test/</code> map hoeft niet te bestaan. Dit commando voegt de volgende context toe aan <code class="filename">/etc/selinux/targeted/contexts/files/file_contexts.local</code>:
</div><pre class="screen">/test system_u:object_r:httpd_sys_content_t:s0
</pre></li><li><div class="para">
Om de context te verwijderen, voer je als de Linux root gebruiker het <code class="command">/usr/sbin/semanage fcontext -d <em class="replaceable"><code>bestandsnaam</code></em>|<em class="replaceable"><code>mapnaam</code></em></code> commando uit, waarin <em class="replaceable"><code>bestandsnaam</code></em>|<em class="replaceable"><code>mapnaam</code></em> het eerste onderdeel is in <code class="filename">file_contexts.local</code>. Het volgende is een voorbeeld van een context in <code class="filename">file_contexts.local</code>:
</div><pre class="screen">/test system_u:object_r:httpd_sys_content_t:s0
</pre><div class="para">
Waarin het eerste onderdeel <code class="computeroutput">/test</code> is. Om te voorkomen dat de <code class="filename">/test/</code> map gelabeld wordt met <code class="computeroutput">httpd_sys_content_t</code> na het draaien van <code class="command">/sbin/restorecon</code>, of na een bestandssysteem herlabeling, voer je het volgende commando uit als de Linux root gebruiker om de context van <code class="filename">file_contexts.local</code> te verwijderen:
</div><div class="para">
<code class="command">/usr/sbin/semanage fcontext -d /test</code>
</div></li></ol></div><div class="para">
Als de context onderdeel is van een reguliere expressie, bijvoorbeeld, <code class="computeroutput">/web(/.*)?</code>, gebruik je aanhalingstekens om de reguliere expressie:
</div><div class="para">
<code class="command">/usr/sbin/semanage fcontext -d "/web(/.*)?"</code>
</div><div class="para">
Refereer naar de <span class="citerefentry"><span class="refentrytitle">semanage</span>(8)</span> manual pagina voor verdere informatie over <code class="command">/usr/sbin/semanage</code>.
</div><div class="important"><h2>Belangrijk</h2><div class="para">
Als de SELinux context veranderd wordt met <code class="command">/usr/sbin/semanage fcontext -a</code>, gebruik dan het volledige pad naar het bestand of de map om te voorkomen dat bestanden verkeerd worden gelabeld na een systeem herlabeling, of nadat het <code class="command">/sbin/restorecon</code> commando is uitgevoerd.
</div></div></div></div><div class="section" lang="nl-NL"><div class="titlepage"><div><div><h2 class="title" id="sect-Security-Enhanced_Linux-Working_with_SELinux-The_file_t_and_default_t_Types">5.8. De file_t en default_t types</h2></div></div></div><div class="para">
Als op bestandsystemen die uitgebreide attributen ondersteunen een bestand op de schijf wordt benaderd die geen SELinux context heeft, dan wordt dit bestand behandeld alsof het een standaard context heeft zoals gedefinieerd door SELinux tactiek. In gewone tactieken gebruikt deze standaard context het <code class="computeroutput">file_t</code> type. Dit moet het enigste gebruik zijn van dit type, zodat bestanden zonder context op een schijf onderscheiden kunnen worden in de tactiek, en in het algemeen onbereikbaar worden gehouden voor beperkte domeinen. Het <code class="computeroutput">file_t</code> type moet niet bestaan op correct gelabelde bestandssystemen, omdat alle bestanden op een systeem dat SELinux draait en SELinux context moeten hebben, en het <code class="computeroutput">file_t</code> type wordt nooit gebruikt in bestandscontext configuratie<sup>[<a id="d0e3752" href="#ftn.d0e3752" class="footnote">11</a>]</sup>.
</div><div class="para">
Het <code class="computeroutput">default_t</code> type wordt gebruikt voor bestanden die niet passen bij elk ander patroon in de bestandscontext configuratie, zodat zulke bestanden onderscheiden kunnen worden van bestanden op schijf die geen context hebben, en ze worden in het algemeen onbereikbaar gehouden voor beperkte domeinen. Als je een nieuwe top-niveau map aanmaakt, zoals <code class="filename">/mijnmap/</code>, zal deze misschien gelabeld worden met het <code class="computeroutput">default_t</code> type. Als services toegang nodig hebben naar zo'n map, vernieuw dan de bestandscontext voor deze loocatie. Refereer naar <a class="xref" href="#sect-Security-Enhanced_Linux-SELinux_Contexts_Labeling_Files-Persistent_Changes_semanage_fcontext" title="5.7.2. Permanente veranderingen: semanage fcontext">Paragraaf 5.7.2, “Permanente veranderingen: semanage fcontext”</a> voor details over het toevoegen van een context aan de bestandscontext configuratie.
</div></div><div class="section" lang="nl-NL"><div class="titlepage"><div><div><h2 class="title" id="sect-Security-Enhanced_Linux-Working_with_SELinux-Mounting_File_Systems">5.9. Het aankoppelen van bestandssystemen</h2></div></div></div><div class="para">
Als een bestandssysteem dat uitgebreide attributen ondersteund wordt aangekoppeld, wordt standaard de beveiligingscontext voor ieder bestand verkregen van de <span class="emphasis"><em>security.selinux</em></span> uitgebreide attribuut van het bestand. Bestanden in bestandssystemen die uitgebreide attributen niet ondersteunen krijgen een enkele, standaard beveiliging van de tactiek configuratie, gebaseerd op het bestandssysteem type.
</div><div class="para">
Gebruik het <code class="command">mount -o context</code> commando om bestaande uitgebreide attributen ter zijde te schuiven, of om een andere, standaard context op te geven voor bestandssystemen die geen uitgebreide attributen ondersteunen. Dit is nuttig als je niet vertrouwt dat een bestandssysteem de juiste attriburen levert, bijvoorbeeld, verwijderbare media gebruikt in meerdere systemen. Het <code class="command">mount -o context</code> commando kan ook gebruikt worden om labeling te ondersteunen voor bestandssystemen die geen uitgebreide attributen ondersteunen, zoals de File Allocation Table (FAT) of NFS bestandssystemen. De context opgegeven met de <code class="option">context</code> optie wordt niet naar schijf geschreven, de originele context blijft bewaard, en kan gezien worden door aan te koppelen zonder een <code class="option">context</code> optie (als het bestandssysteem om te beginnen uitgebreide attributen heeft).
</div><div class="para">
Voor meer informatie over bestandssysteem labeling, refereer je naar het artikel van James Morris over "Filesystem Labeling in SELinux": <a href="http://www.linuxjournal.com/article/7426">http://www.linuxjournal.com/article/7426</a>.
</div><div class="section" lang="nl-NL"><div class="titlepage"><div><div><h3 class="title" id="sect-Security-Enhanced_Linux-Mounting_File_Systems-Context_Mounts">5.9.1. Context aankoppelingen</h3></div></div></div><div class="para">
Om een bestandssysteem met een gespecificeerde context aan te koppelen, waarbij voorbij gegaan wordt aan bestaande context als die er is, of om een andere, standaard context op te geven voor een bestandssysteem dat geen uitgebreide attributen ondersteund, gebruik je als de Linux root gebruiker het <code class="command">mount -o context=<em class="replaceable"><code>SELinux_user:role:type:level</code></em></code> commando om het gewenste bestandssysteem aan te koppelen. Context veranderingen worden niet naar schijf geschreven. Standaard worden NFS aankoppelingen op de client zijde gelabeld met een standaard context gedefinieerd door tactiek voor NFS bestandssystemen. In algemene tactieken gebruikt deze standaard context het <code class="computeroutput">nfs_t</code> type. Zonder extra aankoppel opties, kan dit het delen van NFS bestandssytemen via andere services beletten, zoals de Apache HTTP server. Het volgende voorbeeld koppelt een NFS bestandssysteem zodanig aan dat he
t gedeeld kan worden via de Apache HTTP server:
</div><div class="para">
<pre class="screen"># mount server:/export /local/mount/point -o\
context="system_u:object_r:httpd_sys_content_t:s0"
</pre>
</div><div class="para">
Nieuw aangemaakte bestanden en mappen in dit bestandssysteem lijken de SELinux context te hebben opgegeven met de <code class="option">-o context</code> optie; omdat echter de context veranderingen niet naar schijf geschreven worden in deze situaties, wordt de context opgegeven met de <code class="option">context</code> optie alleen vastgehouden als de <code class="option">context</code> optie wordr gebruikt bij de volgende aankoppeling, en als dezelfde context wordt opgegeven.
</div><div class="para">
Type Enforcement is de belangrijkste rechten controle die gebruikt wordt in de SELinux gerichte tactiek. Voor het grootste deel kunnen SELinux gebruikers en rollen genegeerd worden, dus als je de SELinux context terzijde schuift met de <code class="option">-o context</code> optie, gebruik dan de SELinux <code class="computeroutput">system_u</code> gebruiker en de <code class="computeroutput">object_r</code> rol, en concentreer je op het type. Als je de MLS tactiek of multi-categorie beveiliging niet gebruikt, gebruik je het <code class="computeroutput">s0</code> niveau.
</div><div class="note"><h2>Opmerking</h2><div class="para">
Als een bestandssysteem wordt aangekoppeld met een <code class="option">context</code> optie, zijn context veranderingen (door gebruikers en processen) verboden. Bijvoorbeeld, het uitvoeren van <code class="command">chcon</code> op een bestandssysteem aangekoppeld met een <code class="option">context</code> optie resulteert in een <code class="computeroutput">Operation not supported</code> fout.
</div></div></div><div class="section" lang="nl-NL"><div class="titlepage"><div><div><h3 class="title" id="sect-Security-Enhanced_Linux-Mounting_File_Systems-Changing_the_Default_Context">5.9.2. De standaard context veranderen</h3></div></div></div><div class="para">
Zoals vermeldt in <a class="xref" href="#sect-Security-Enhanced_Linux-Working_with_SELinux-The_file_t_and_default_t_Types" title="5.8. De file_t en default_t types">Paragraaf 5.8, “De file_t en default_t types”</a>, worden benaderde bestanden, die geen SELinux context op schijf hebben, in bestandssystemen die uitgebreide attributen ondersteunen, behandeld alsof het een standaard context heeft zoals gedefinieerd door SELinux tactiek. In algemene tactieken gebruikt deze standaard context het <code class="computeroutput">file_t</code> type. Als het wenselijk is om een andere standaard context te gebruiken, koppel dan het bestandssysteem aan met de <code class="option">defcontext</code> optie.
</div><div class="para">
Het volgende voorbeeld koppelt een nieuw aangemaakt bestandssysteem (op <code class="filename">/dev/sda2</code>) aan naar de nieuw aangemaakte <code class="filename">/test/</code> map. Het veronderstelt dat er geen regels zijn in <code class="filename">/etc/selinux/targeted/contexts/files/</code> die een context definieren voor de <code class="filename">/test/</code> map:
</div><pre class="screen"># mount /dev/sda2 /test/ -o defcontext="system_u:object_r:samba_share_t:s0"
</pre><div class="para">
In dit voorbeeld:
</div><div class="itemizedlist"><ul><li><div class="para">
de <code class="option">defcontext</code> optie definieert dat <code class="computeroutput">system_u:object_r:samba_share_t:s0</code> "de standaard beveiligingscontext voor niet gelabelde bestanden"<sup>[<a id="d0e3903" href="#ftn.d0e3903" class="footnote">12</a>]</sup> is.
</div></li><li><div class="para">
als het aangekoppeld is, wordt de root map (<code class="filename">/test/</code>) van het bestandssysteem behandeld alsof het is gelabeld met de context opgegeven door <code class="option">defcontext</code> (dit label wordt niet op schijf bewaard). Dit heeft gevolgen voor het labelen van bestanden die in <code class="filename">/test/</code> aangemaakt worden: nieuwe bestanden erven het <code class="computeroutput">samba_share_t</code> type en deze labels worden op schijf bewaard.
</div></li><li><div class="para">
bestanden aangemaakt in <code class="filename">/test/</code> terwijl het bestandssysteem was aangekoppeld met een <code class="option">defcontext</code> optie houden hun labels vast.
</div></li></ul></div></div><div class="section" lang="nl-NL"><div class="titlepage"><div><div><h3 class="title" id="sect-Security-Enhanced_Linux-Mounting_File_Systems-Mounting_an_NFS_File_System">5.9.3. Het aankoppelen van een NFS bestandssysteem</h3></div></div></div><div class="para">
Standaard worden NFS aankoppelingen op de client zijde gelabeld met een standaard context gedefinieerd door tactiek voor NFS bestandssystemen. In algemene tactieken gebruikt deze standaard context het <code class="computeroutput">nfs_t</code> type. Alfhankelijk van de tactiek instelling, zullen services, zoals de Apache HTTP server en MySQL, misschien niet in staat zijn om bestanden te lezen die gelabeld zijn met het <code class="computeroutput">nfs_t</code> type. Dit kan verhinderen dat bestandssystemen die met dit type gelabeld zijn aangekoppeld worden en daarna gelezen of geexporteerd door andere services.
</div><div class="para">
Als je een NFS bestandssysteem wilt aankoppelen en dat bestandssysteem wilt lezen of exporteren met een andere service, gebruik je de <code class="option">context</code> optie tijdens het aankoppelen om het <code class="computeroutput">nfs_t</code> type terzijde te schuiven. Gebruik de volgende context optie om NFS bestandssystemen aan te koppelen zodat ze gedeeld kunnen worden via de Apache HTTP server:
</div><pre class="screen">mount server:/export /local/mount/point -o\
context="system_u:object_r:httpd_sys_content_t:s0"
</pre><div class="para">
Omdat voor deze situaties context veranderingen niet naar schijf worden geschreven, wordt de context opgegeven met de <code class="option">context</code> optie alleen behouden als de <code class="option">context</code> optie wordt gebruikt tijdens de volgende aankoppeling, en als dezelfde context wordt opgegeven.
</div><div class="para">
Als een alternatief voor het aankoppelen van bestandssystemen met <code class="option">context</code> opties, kunnen Booleans aangezet worden om services toe te staan om toegang te hebben tot bestandssystemen gelabeld met het <code class="computeroutput">nfs_t</code> type. Refereer naar <a class="xref" href="#sect-Security-Enhanced_Linux-Booleans-Booleans_for_NFS_and_CIFS" title="5.6.3. Booleans voor NFS en CIFS">Paragraaf 5.6.3, “Booleans voor NFS en CIFS”</a> voor instructies over het instellen van Booleans om services toegang te geven tot het <code class="computeroutput">nfs_t</code> type.
</div></div><div class="section" lang="nl-NL"><div class="titlepage"><div><div><h3 class="title" id="sect-Security-Enhanced_Linux-Mounting_File_Systems-Multiple_NFS_Mounts">5.9.4. Meerdere NFS aankoppelingen</h3></div></div></div><div class="para">
Als hetzelfde NFS bestandssysteem meerdere keren aangekoppeld wordt, en je probeert bij iedere aankoppeling de SELinux context terzijde te schuiven met een andere context, heeft dat als resultaat dat opvolgende aankoppel commando's zullen mislukken. In het volgende voorbeeld heeft de NFS server een enkele export, <code class="filename">/export</code>, welke twee submappen heeft, <code class="filename">web/</code> en <code class="filename">database/</code>. De volgende commando's proberen twee aankoppelingen te maken van een enkele NFS export, en proberen iedere keer de context terzijde te schuiven:
</div><pre class="screen"># mount server:/export/web /local/web -o\
context="system_u:object_r:httpd_sys_content_t:s0"
# mount server:/export/database /local/database -o\
context="system_u:object_r:mysqld_db_t:s0"
</pre><div class="para">
Het tweede aankoppel commando mislukt, en de volgende boodschap wordt naar <code class="filename">/var/log/messages</code> geschreven:
</div><pre class="screen">kernel: SELinux: mount invalid. Same superblock, different security settings for (dev 0:15, type nfs)
</pre><div class="para">
Om meerdere aankoppelingen te maken naar een enkele NFS export, waarbij iedere aankoppeling een andere context heeft, gebruik je de <code class="option">-o nosharecache,context</code> opties. Het volgende voorbeeld koppelt meerdere aankoppelingen voor een enkele NFS export, met een andere context voor iedere aankoppeling (wat een enkele service toestaat om toegang tot iedere te hebben):
</div><pre class="screen"># mount server:/export/web /local/web -o\
nosharecache,context="system_u:object_r:httpd_sys_content_t:s0"
# mount server:/export/database /local/database -o\
nosharecache,context="system_u:object_r:mysqld_db_t:s0"
</pre><div class="para">
In dit voorbeeld wordt <code class="computeroutput">server:/export/web</code> locaal aangekoppeld naar <code class="filename">/local/web/</code>, waarbij alle bestanden gelabeld worden met het <code class="computeroutput">httpd_sys_content_t</code> type, wat Apache HTTP server toegang toestaat. <code class="computeroutput">server:/export/database</code> wordt locaal aangekoppeld naar <code class="filename">/local/database</code>, waarbij alle bestanden gelabeld worden met het <code class="computeroutput">mysqld_db_t</code> type, wat MySQL toegang toestaat. Deze veranderingen worden niet naar schijf geschreven.
</div><div class="important"><h2>Belangrijk</h2><div class="para">
De <code class="option">nosharecache</code> opties laten je dezelfde submap van een export meerdere keren aankoppelen met verschillende contexten (bijvoorbeeld, het meerdere keren aankoppelen van <code class="filename">/export/web</code>). Koppel dezelfde submap van een export niet meerdere keren aan met verschillende contexten, omdat dit een overlappende aankoppeling maakt, waarbij bestanden bereikbaar zijn met twee verschillende contexten.
</div></div></div><div class="section" lang="nl-NL"><div class="titlepage"><div><div><h3 class="title" id="sect-Security-Enhanced_Linux-Mounting_File_Systems-Making_Context_Mounts_Persistent">5.9.5. Maak de context aankoppelingen blijvend</h3></div></div></div><div class="para">
Om de context aankoppelingen blijven te maken voor opnieuw aankoppelen en opnieuw opstarten, voeg je regels toe voor de bestandssystemen in <code class="filename">/etc/fstab</code> of een automounter map, en gebruik de gewenste context als een aankoppel optie. Het volgende voorbeeld voegt een regel toe aan <code class="filename">/etc/fstab</code> voor een NFS context aankoppeling:
</div><pre class="screen">server:/export /local/mount/ nfs context="system_u:object_r:httpd_sys_content_t:s0" 0 0
</pre><div class="para">
Refereer naar <a href="http://www.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/5.2/html/Deploy...">Red Hat Enterprise Linux 5 Deployment Guide, Section 19.2. "NFS Client Configuration"</a> voor informatie over het aankoppelen van NFS bestandssystemen.
</div></div></div><div class="section" lang="nl-NL"><div class="titlepage"><div><div><h2 class="title" id="sect-Security-Enhanced_Linux-Working_with_SELinux-Maintaining_SELinux_Labels_">5.10. Het onderhouden van SELinux labels </h2></div></div></div><div class="para">
Deze paragrafen behandelen wat er gebeurt met SELinux context tijdens het kopiëren, verplaatsen, en archiveren van bestanden en mappen. Ze leggen ook uit hoe je de context kunt behouden tijdens het kopiëren en archiveren.
</div><div class="section" lang="nl-NL"><div class="titlepage"><div><div><h3 class="title" id="sect-Security-Enhanced_Linux-Maintaining_SELinux_Labels_-Copying_Files_and_Directories">5.10.1. Bestanden en mappen kopiëren</h3></div></div></div><div class="para">
Als een bestand of map wordt gekopieerd, wordt een nieuw bestand of map aangemaakt als het nog niet bestaat. De context van dat nieuwe bestand of map is gebaseerd op standaard labelingregels, en niet de context van het originele bestand of map (behalve als er opties zijn gebruikt om de originele context te behouden). Bijvoorbeeld, bestanden aangemaakt in de persoonlijke mappen van de gebruiker worden gelabeld met het <code class="computeroutput">user_home_t</code> type:
</div><pre class="screen">$ touch file1
$ ls -Z file1
-rw-rw-r-- user1 group1 unconfined_u:object_r:user_home_t:s0 file1
</pre><div class="para">
Als zo'n bestand gekopieerd wordt naar een andere map, zoals <code class="filename">/etc/</code>, wordt het nieuwe bestand aangemaakt overeenkomstig de standaard labelingsregels voor de <code class="filename">/etc/</code> map. Een bestand kopiëren (zonder extra opties) hoeft de originele context niet te behouden:
</div><pre class="screen">$ ls -Z file1
-rw-rw-r-- user1 group1 unconfined_u:object_r:user_home_t:s0 file1
# cp file1 /etc/
$ ls -Z /etc/file1
-rw-r--r-- root root unconfined_u:object_r:etc_t:s0 /etc/file1
</pre><div class="para">
Als <code class="filename">file1</code> gekopieerd wordt naar <code class="filename">/etc/</code>, en als <code class="filename">/etc/file1</code> niet bestaat, wordt <code class="filename">/etc/file1</code> aangemaakt als een nieuw bestand. Zoals in het voorbeeld hierboven is getoond, wordt <code class="filename">/etc/file1</code> gelabeld met het <code class="computeroutput">etc_t</code> type, overeenkomstig de standaard labelingsregels.
</div><div class="para">
Als een bestand wordt gekopieerd over een bestaand bestand, wordt de context van het bestaande bestand gehandhaafd, behalve als de gebruiker <code class="command">cp</code> opties op heeft gegeven om de context van het originele bestand te behouden, zoals <code class="option">--preserve=context</code>. SELinux tactiek kan beletten dat contexten behouden blijven tijdens het kopiëren.
</div><div class="formalpara"><h5 class="formalpara" id="form-Security-Enhanced_Linux-Copying_Files_and_Directories-Copying_Without_Preserving_SELinux_Contexts">Kopiëren zonder behoud van SELinux context</h5>
Als een bestand gekopieerd wordt met het <code class="command">cp</code> commando, en er worden geen opties meegegeven, wordt het type geerfd van de doel, ouders map:
</div><pre class="screen">$ touch file1
$ ls -Z file1
-rw-rw-r-- user1 group1 unconfined_u:object_r:user_home_t:s0 file1
$ ls -dZ /var/www/html/
drwxr-xr-x root root system_u:object_r:httpd_sys_content_t:s0 /var/www/html/
# cp file1 /var/www/html/
$ ls -Z /var/www/html/file1
-rw-r--r-- root root unconfined_u:object_r:httpd_sys_content_t:s0 /var/www/html/file1
</pre><div class="para">
In dit voorbeeld, wordt <code class="filename">file1</code> aangemaakt in de persoonlijke map van de gebruiker, en wordt gelabeld met het <code class="computeroutput">user_home_t</code> type. De <code class="filename">/var/www/html/</code> map is gelabeld met het <code class="computeroutput">httpd_sys_content_t</code> type, zoals getoond met het <code class="command">ls -dZ /var/www/html/</code> commando. Als <code class="filename">file1</code> wordt gekopieerd naar <code class="filename">/var/www/html/</code>, erft het het <code class="computeroutput">httpd_sys_content_t</code> type, zoals het <code class="command">ls -Z /var/www/html/file1</code> commando laat zien.
</div><div class="formalpara"><h5 class="formalpara" id="form-Security-Enhanced_Linux-Copying_Files_and_Directories-Preserving_SELinux_Contexts_When_Copying">De SELinux context behouden tijdens het kopiëren</h5>
Gebruik het <code class="command">cp --preserve=context</code> commando om de context te behouden tijdens het kopiëren:
</div><pre class="screen">$ touch file1
$ ls -Z file1
-rw-rw-r-- user1 group1 unconfined_u:object_r:user_home_t:s0 file1
$ ls -dZ /var/www/html/
drwxr-xr-x root root system_u:object_r:httpd_sys_content_t:s0 /var/www/html/
# cp --preserve=context file1 /var/www/html/
$ ls -Z /var/www/html/file1
-rw-r--r-- root root unconfined_u:object_r:user_home_t:s0 /var/www/html/file1
</pre><div class="para">
In dit voorbeeld, wordt <code class="filename">file1</code> aangemaakt in de persoonlijke map van de gebruiker, en wordt gelabeld met het <code class="computeroutput">user_home_t</code> type. De <code class="filename">/var/www/html/</code> map is gelabeld met het <code class="computeroutput">httpd_sys_content_t</code> type, zoals het <code class="command">ls -dZ /var/www/html/</code> coomado laat zien. Het gebruik van de <code class="option">--preserve=context</code> optie behoudt de SELinux context tijdens het kopiëren. Zoals het <code class="command">ls -Z /var/www/html/file1</code> commando laat zien is het <code class="computeroutput">user_home_t</code> type van <code class="filename">file1</code> behouden toen het bestand gekopieerd werd naar <code class="filename">/var/www/html/</code>.
</div><div class="formalpara"><h5 class="formalpara" id="form-Security-Enhanced_Linux-Copying_Files_and_Directories-Copying_and_Changing_the_Context">Kopiëren en de context veranderen</h5>
Gebruik het <code class="command">cp -Z</code> commando om de context van de doel kopie te veranderen. Het volgende voorbeeld is uitgevoerd in de persoonlijke map van de gebruiker:
</div><pre class="screen">$ touch file1
$ cp -Z system_u:object_r:samba_share_t:s0 file1 file2
$ ls -Z file1 file2
-rw-rw-r-- user1 group1 unconfined_u:object_r:user_home_t:s0 file1
-rw-rw-r-- user1 group1 system_u:object_r:samba_share_t:s0 file2
$ rm file1 file2
</pre><div class="para">
In dit voorbeeld, wordt de context gedefinieerd met de <code class="option">-Z</code> optie. Zonder de <code class="option">-Z</code> optie, zou <code class="filename">file2</code> gelabeld zijn met de <code class="computeroutput">unconfined_u:object_r:user_home_t</code> context.
</div><div class="formalpara"><h5 class="formalpara" id="form-Security-Enhanced_Linux-Copying_Files_and_Directories-Copying_a_File_Over_an_Existing_File">Kopiëren over een bestaand bestand</h5>
Als een bestand gekopieerd wordt over een bestaand bestand, wordt de context van het bestaande bestand behouden (behalve als een optie gebruikt wordt om de context te behouden). Bijvoorbeeld:
</div><pre class="screen"># touch /etc/file1
# ls -Z /etc/file1
-rw-r--r-- root root unconfined_u:object_r:etc_t:s0 /etc/file1
# touch /tmp/file2
# ls -Z /tmp/file2
-rw-r--r-- root root unconfined_u:object_r:user_tmp_t:s0 /tmp/file2
# cp /tmp/file2 /etc/file1
# ls -Z /etc/file1
-rw-r--r-- root root unconfined_u:object_r:etc_t:s0 /etc/file1
</pre><div class="para">
In dit voorbeeld worden twee bestanden aangemaakt: <code class="filename">/etc/file1</code>, gelabeld met het <code class="computeroutput">etc_t</code> type, en <code class="filename">/tmp/file2</code>, gelabeld met het <code class="computeroutput">user_tmp_t</code> type. Het <code class="command">cp /tmp/file2 /etc/file1</code> commando overschrijft <code class="filename">file1</code> met <code class="filename">file2</code>. Na het kopiëren, laat het <code class="command">ls -Z /etc/file1</code> zien dat <code class="filename">file1</code> gelabeld is met het <code class="computeroutput">etc_t</code> type, niet het <code class="computeroutput">user_tmp_t</code> type van <code class="filename">/tmp/file2</code> welke <code class="filename">/etc/file1</code> heeft vervangen.
</div><div class="important"><h2>Belangrijk</h2><div class="para">
Kopieer bestanden en mappen, inplaats van ze te verplaatsen. Dit helpt om er zeker van te zijn dat ze gelabeld zijn met de juiste SELinux context. Foutieve SELinux contexten kunnen voorkomen dat processen toegang hebben tot zulke bestanden en mappen.
</div></div></div><div class="section" lang="nl-NL"><div class="titlepage"><div><div><h3 class="title" id="sect-Security-Enhanced_Linux-Maintaining_SELinux_Labels_-Moving_Files_and_Directories">5.10.2. Bestanden en mappen verplaatsen</h3></div></div></div><div class="para">
Bestanden en mappen behouden hun huidige SELinux context als ze verplaats worden. In veel gevallen is dit niet juist voor de locatie waarheen ze verplaatst zijn. Het volgende voorbeeld laat het verplaatsen van een bestand van de persoonlijke map van een gebruiker zien naar <code class="filename">/var/www/html/</code>, welke gebruikt wordt door de Apache HTTP server. Omdat het bestand is verplaatst, erft het niet de juiste SELinux context:
</div><div class="orderedlist"><ol><li><div class="para">
Voer het <code class="command">cd</code> commando uit zonder argumenten om naar je persoonlijke map te gaan. Als je daar bent, voer je het <code class="command">touch file1</code> commando uit om een bestand aan te maken. Dit bestand is gelabeld met het <code class="computeroutput">user_home_t</code> type:
</div><pre class="screen">$ ls -Z file1
-rw-rw-r-- user1 group1 unconfined_u:object_r:user_home_t:s0 file1
</pre></li><li><div class="para">
Voer het <code class="command">ls -dZ /var/www/html/</code> commando uit om de SELinux context van de <code class="filename">/var/www/html/</code> map te zien:
</div><pre class="screen">$ ls -dZ /var/www/html/
drwxr-xr-x root root system_u:object_r:httpd_sys_content_t:s0 /var/www/html/
</pre><div class="para">
Standaard wordt de <code class="filename">/var/www/html/</code> map gelabeld met het <code class="computeroutput">httpd_sys_content_t</code> type. Bestanden en mappen aangemaakt in de <code class="filename">/var/www/html/</code> map erven dit type, en dus zijn ze ermee gelabeld.
</div></li><li><div class="para">
Als de Linux root gebruiker voer je het <code class="command">mv file1 /var/www/html/</code> commando uit om <code class="filename">file1</code> te verplaatsen naar de <code class="filename">/var/www/html/</code> map. Omdat het bestand is verplaatst behoudt het zijn huidige <code class="computeroutput">user_home_t</code> type:
</div><pre class="screen"># mv file1 /var/www/html/
# ls -Z /var/www/html/file1
-rw-rw-r-- user1 group1 unconfined_u:object_r:user_home_t:s0 /var/www/html/file1
</pre></li></ol></div><div class="para">
Standaard kan de Apache HTTP server geen bestanden lezen die gelabeld zijn met het <code class="computeroutput">user_home_t</code> type. Als alle bestanden die een web pagina vormen gelabeld zijn met het <code class="computeroutput">user_home_t</code> type, of een ander type dat de Apache HTTP server niet kan lezen, wordt toegang geweigerd als je probeert ze te benaderen met Firefox of op tekst gebaseerde webbrowsers.
</div><div class="important"><h2>Belangrijk</h2><div class="para">
Het verplaatsen van bestanden en mappen met het <code class="command">mv</code> commando kan een verkeerde SELinux context tot gevolg hebben, en processen, zoals de Apache HTTP server en Samba, beletten om toegang te krijgen tot die bestanden en mappen.
</div></div></div><div class="section" lang="nl-NL"><div class="titlepage"><div><div><h3 class="title" id="sect-Security-Enhanced_Linux-Maintaining_SELinux_Labels_-Checking_the_Default_SELinux_Context">5.10.3. Het controleren van de standaard SELinux context</h3></div></div></div><div class="para">
Gebruik het <code class="command">/usr/sbin/matchpathcon</code> commando om te controleren of bestanden en mappen de juiste SELinux context hebben. Van de <span class="citerefentry"><span class="refentrytitle">matchpathcon</span>(8)</span> manual pagina: "<code class="command">matchpathcon</code> ondervraagt de systeem tactiek en levert de standaard beveiligings context behorend bij het bestandspad."<sup>[<a id="d0e4354" href="#ftn.d0e4354" class="footnote">13</a>]</sup>. Het volgende voorbeeld laat het gebruik van het <code class="command">/usr/sbin/matchpathcon</code> commando zien om te bevestigen dat bestanden in de <code class="filename">/var/www/html/</code> map correct gelabeld zijn:
</div><div class="orderedlist"><ol><li><div class="para">
Als de Linux root gebruiker, voer je het <code class="command">touch /var/www/html/file{1,2,3}</code> commando uit om drie bestanden (<code class="filename">file1</code>, <code class="filename">file2</code>, en <code class="filename">file3</code>) aan te maken. Deze bestanden erven het <code class="computeroutput">httpd_sys_content_t</code> type van de <code class="filename">/var/www/html/</code> map:
</div><pre class="screen"># touch /var/www/html/file{1,2,3}
# ls -Z /var/www/html/
-rw-r--r-- root root unconfined_u:object_r:httpd_sys_content_t:s0 file1
-rw-r--r-- root root unconfined_u:object_r:httpd_sys_content_t:s0 file2
-rw-r--r-- root root unconfined_u:object_r:httpd_sys_content_t:s0 file3
</pre></li><li><div class="para">
Als de Linux root gebruiker, voer je het <code class="command">chcon -t samba_share_t /var/www/html/file1</code> commando uit om het type van <code class="filename">file1</code> te veranderen naar <code class="computeroutput">samba_share_t</code>. Merk op: de Apache HTTP server kan geen bestanden of mappen lezen die gelabeld zijn met het <code class="computeroutput">samba_share_t</code> type.
</div></li><li><div class="para">
Het <code class="command">/usr/sbin/matchpathcon</code> <code class="option">-V</code> optie vergelijkt de huidige SELinux contect met de juiste, standaard context in SELinux tactiek. Voer het <code class="command">/usr/sbin/matchpathcon -V /var/www/html/*</code> commando uit om alle bestanden in de <code class="filename">/var/www/html/</code> map te controleren:
</div><pre class="screen">$ /usr/sbin/matchpathcon -V /var/www/html/*
/var/www/html/file1 has context unconfined_u:object_r:samba_share_t:s0, should be system_u:object_r:httpd_sys_content_t:s0
/var/www/html/file2 verified.
/var/www/html/file3 verified.
</pre></li></ol></div><div class="para">
De volgende output van het <code class="command">/usr/sbin/matchpathcon</code> commando legt uit dat <code class="filename">file1</code> is gelabeld met het <code class="computeroutput">samba_share_t</code> type, maar het zou gelabeld moeten zijn met het <code class="computeroutput">httpd_sys_content_t</code> type:
</div><pre class="screen">/var/www/html/file1 has context unconfined_u:object_r:samba_share_t:s0, should be system_u:object_r:httpd_sys_content_t:s0
</pre><div class="para">
Om het label probleem op te lossen, en de Apache HTTP server toegang te geven tot <code class="filename">file1</code>, voer je als de Linux root gebruiker het <code class="command">/sbin/restorecon -v /var/www/html/file1</code> commando uit:
</div><pre class="screen"># /sbin/restorecon -v /var/www/html/file1
restorecon reset /var/www/html/file1 context unconfined_u:object_r:samba_share_t:s0->system_u:object_r:httpd_sys_content_t:s0
</pre></div><div class="section" lang="nl-NL"><div class="titlepage"><div><div><h3 class="title" id="sect-Security-Enhanced_Linux-Maintaining_SELinux_Labels_-Archiving_Files_with_tar">5.10.4. Bestanden archiveren met tar</h3></div></div></div><div class="para">
<code class="command">tar</code> behoudt standaard geen uitgebreide attributen. Omdat SELinux context bewaard wordt in uitgebreide attributen, kan de context verloren raken als bestanden gearchiveerd worden. Gebruik <code class="command">tar --selinux</code> om archieven te maken die de context behouden. Als een Tar archief bestanden zonder uitgebreide attributen bevat, of je wilt dat de uitgebreide attributen overeenkomen met de systeemstandaard, voer het archiveren dan uit met <code class="command">/sbin/restorecon</code>:
</div><pre class="screen">$ tar -xvf <em class="replaceable"><code>archive.tar</code></em> | /sbin/restorecon -f -
</pre><div class="para">
Merk op: afhankelijk van de map kan het nodig zijn dat je de Linux root gebruiker bent om het <code class="command">/sbin/restorecon</code> commando uit te voeren.
</div><div class="para">
Het volgende voorbeeld laat het maken van een Tar archief zien dat de SELinux context behoudt:
</div><div class="orderedlist"><ol><li><div class="para">
Als de Linux root gebruiker, voer je het <code class="command">touch /var/www/html/file{1,2,3}</code> commando uit om drie bestanden (<code class="filename">file1</code>, <code class="filename">file2</code>, en <code class="filename">file3</code>) aan te maken. Deze bestanden erven het <code class="computeroutput">httpd_sys_content_t</code> type van de <code class="filename">/var/www/html/</code> map:
</div><pre class="screen"># touch /var/www/html/file{1,2,3}
# ls -Z /var/www/html/
-rw-r--r-- root root unconfined_u:object_r:httpd_sys_content_t:s0 file1
-rw-r--r-- root root unconfined_u:object_r:httpd_sys_content_t:s0 file2
-rw-r--r-- root root unconfined_u:object_r:httpd_sys_content_t:s0 file3
</pre></li><li><div class="para">
Voer het <code class="command">cd /var/www/html/</code> commando uit om naar de <code class="filename">/var/www/html/</code> map te gaan. Als je in die map bent, voer je als de Linux root gebruiker het <code class="command">tar --selinux -cf test.tar file{1,2,3}</code> uit om een Tar archief met de naam <code class="filename">test.tar</code> te maken.
</div></li><li><div class="para">
Als de Linux root gebruiker voer je het <code class="command">mkdir /test</code> commando uit om een nieuwe map aan te maken, en daarna voer je het <code class="command">chmod 777 /test/</code> commando uit om alle gebruikers volledige toegang tot de <code class="filename">/test/</code> map te geven.
</div></li><li><div class="para">
Voer het <code class="command">cp /var/www/html/test.tar /test/</code> commando uit om het <code class="filename">test.tar</code> bestand naar de <code class="filename">/test/</code> map te kopiëren.
</div></li><li><div class="para">
Voer het <code class="command">cd /test/</code> comando uit om naar de <code class="filename">/test/</code> map te gaan. Als je in die map bent, voer je het <code class="command">tar -xvf test.tar</code> commando uit om het Tar archief uit te pakken.
</div></li><li><div class="para">
Voer het <code class="command">ls -lZ /test/</code> commando uit om de SELinux context te bekijken. Het <code class="computeroutput">httpd_sys_content_t</code> type is behouden gebleven, in plaats van veranderd te zijn naar <code class="computeroutput">default_t</code>, wat gebeurt zou zijn als de <code class="option">--selinux</code> optie niet gebruikt was:
</div><pre class="screen">$ ls -lZ /test/
-rw-r--r-- user1 group1 unconfined_u:object_r:httpd_sys_content_t:s0 file1
-rw-r--r-- user1 group1 unconfined_u:object_r:httpd_sys_content_t:s0 file2
-rw-r--r-- user1 group1 unconfined_u:object_r:httpd_sys_content_t:s0 file3
-rw-r--r-- user1 group1 unconfined_u:object_r:default_t:s0 test.tar
</pre></li><li><div class="para">
Als de <code class="filename">/test/</code> map niet langer nodig is, voer je als de Linux root gebruiker het <code class="command"> rm -ri /test/</code> commando uit om het te verwijderen te samen met de bestanden er in.
</div></li></ol></div><div class="para">
Refereer naar de <span class="citerefentry"><span class="refentrytitle">tar</span>(1)</span> manual pagina voor meer informatie over <code class="command">tar</code>, zoals de <code class="option">--xattrs</code> optie die alle uitgebreide attributen behoudt.
</div></div><div class="section" lang="nl-NL"><div class="titlepage"><div><div><h3 class="title" id="sect-Security-Enhanced_Linux-Maintaining_SELinux_Labels_-Archiving_Files_with_star">5.10.5. Bestanden archiveren met star</h3></div></div></div><div class="para">
<code class="command">star</code> behoudt standaard geen uitgebreide attributen. Omdat SELinux context bewaard wordt in uitgebreide attributen, kan de context verloren gaan als de bestanden gearchiveerd worden. Gebruik <code class="command">star -xattr -H=exustar</code> om archieven te maken die context behouden. Het <span class="package">star</span> pakket is standaard niet geinstalleerd. Om <code class="command">star</code> te installeren, voer je als de Linux root gebruiker het <code class="command">yum install star</code> commando uit.
</div><div class="para">
Het volgende voorbeeld laat het maken van een Star archief zien dat de SELinux context behoudt:
</div><div class="orderedlist"><ol><li><div class="para">
Als de Linux root gebruiker, voer je het <code class="command">touch /var/www/html/file{1,2,3}</code> commando uit om drie bestanden (<code class="filename">file1</code>, <code class="filename">file2</code>, en <code class="filename">file3</code>) aan te maken. Deze bestanden erven het <code class="computeroutput">httpd_sys_content_t</code> type van de <code class="filename">/var/www/html/</code> map:
</div><pre class="screen"># touch /var/www/html/file{1,2,3}
# ls -Z /var/www/html/
-rw-r--r-- root root unconfined_u:object_r:httpd_sys_content_t:s0 file1
-rw-r--r-- root root unconfined_u:object_r:httpd_sys_content_t:s0 file2
-rw-r--r-- root root unconfined_u:object_r:httpd_sys_content_t:s0 file3
</pre></li><li><div class="para">
Voer het <code class="command">cd /var/www/html/</code> commando uit om naar de <code class="filename">/var/www/html/</code> map te gaan. Als je in die map bent, voer je als de Linux root gebruiker het <code class="command">star -xattr -H=exustar -c -f=test.star file{1,2,3}</code> commando uit om een Star archief met de naam <code class="filename">test.star</code> te maken:
</div><pre class="screen"># star -xattr -H=exustar -c -f=test.star file{1,2,3}
star: 1 blocks + 0 bytes (total of 10240 bytes = 10.00k).
</pre></li><li><div class="para">
Als de Linux root gebruiker voer je het <code class="command">mkdir /test</code> commando uit om een nieuwe map aan te maken, en daarna voer je het <code class="command">chmod 777 /test/</code> commando uit om alle gebruikers volledige toegang tot de <code class="filename">/test/</code> map te geven.
</div></li><li><div class="para">
Voer het <code class="command">cp /var/www/html/test.star /test/</code> commando uit om het <code class="filename">test.star</code> bestand te kopiëren naar de <code class="filename">/test/</code> map.
</div></li><li><div class="para">
Voer het <code class="command">cd /test/</code> commando uit om naar de <code class="filename">/test/</code> map te gaan. Als je in die map bent, voer je het <code class="command">star -x -f=test.star</code> commando uit om het Star archief uit te pakken:
</div><pre class="screen">$ star -x -f=test.star
star: 1 blocks + 0 bytes (total of 10240 bytes = 10.00k).
</pre></li><li><div class="para">
Voer het <code class="command">ls -lZ /test/</code> commando uit om de SELinux context te bekijken. Het <code class="computeroutput">httpd_sys_content_t</code> type is behouden gebleven, in plaats van veranderd te zijn naar <code class="computeroutput">default_t</code>, wat gebeurt zou zijn als de <code class="option">--selinux</code> optie niet gebruikt was:
</div><pre class="screen">$ ls -lZ /test/
-rw-r--r-- user1 group1 unconfined_u:object_r:httpd_sys_content_t:s0 file1
-rw-r--r-- user1 group1 unconfined_u:object_r:httpd_sys_content_t:s0 file2
-rw-r--r-- user1 group1 unconfined_u:object_r:httpd_sys_content_t:s0 file3
-rw-r--r-- user1 group1 unconfined_u:object_r:default_t:s0 test.star
</pre></li><li><div class="para">
Als de <code class="filename">/test/</code> map niet langer nodig is, voer je als de Linux root gebruiker het <code class="command"> rm -ri /test/</code> commando uit om het te verwijderen te samen met de bestanden er in.
</div></li><li><div class="para">
Als <code class="command">star</code> niet langer nodig is, voer je als de Linux root gebruiker het <code class="command">yum remove star</code> commando uit om het pakket te verwijderen.
</div></li></ol></div><div class="para">
Refereer naar de <span class="citerefentry"><span class="refentrytitle">star</span>(1)</span> manual pagina voor meer informatie over <code class="command">star</code>.
</div></div></div><div class="footnotes"><br/><hr width="100" align="left"/><div class="footnote"><p><sup>[<a id="ftn.d0e2067" href="#d0e2067" class="para">8</a>] </sup>
Brindle, Joshua. "Re: blurb for fedora setools packages" Email aan Murray McAllister. 1 November 2008. Elke bewerking en verandering in deze versie is gedaan door Murray McAllister.
</p></div><div class="footnote"><p><sup>[<a id="ftn.d0e2179" href="#d0e2179" class="para">9</a>] </sup>
Managing Software with yum, geschreven door Stuart Ellis, bewerkt door Paul W. Frields, Rodrigo Menezes, en Hugo Cisneiros.
</p></div><div class="footnote"><p><sup>[<a id="ftn.d0e2507" href="#d0e2507" class="para">10</a>] </sup>
Refereer naar <a href="http://en.wikipedia.org/wiki/Runlevel">http://en.wikipedia.org/wiki/Runlevel</a> voor informatie over runlevels.
</p></div><div class="footnote"><p><sup>[<a id="ftn.d0e3752" href="#d0e3752" class="para">11</a>] </sup>
Bestanden in <code class="filename">/etc/selinux/targeted/contexts/files/</code> definieren context voor bestanden en mappen. Bestanden in deze map worden gelezen door <code class="command">restorecon</code> en <code class="command">setfiles</code> om bestanden en mappen te herstellen naar hun standaard context.
</p></div><div class="footnote"><p><sup>[<a id="ftn.d0e3903" href="#d0e3903" class="para">12</a>] </sup>
Morris, James. "Filesystem Labeling in SELinux". Published 1 October 2004. Accessed 14 October 2008: <a href="http://www.linuxjournal.com/article/7426">http://www.linuxjournal.com/article/7426</a>.
</p></div><div class="footnote"><p><sup>[<a id="ftn.d0e4354" href="#d0e4354" class="para">13</a>] </sup>
De <span class="citerefentry"><span class="refentrytitle">matchpathcon</span>(8)</span> manual pagina, zoals verstuurd met het <span class="package">libselinux-utils</span> pakket Fedora, is geschreven door Daniel Walsh. Alle bewerkingen of veranderingen in deze versie zijn gemaakt door Murray McAllister.
</p></div></div></div><div class="chapter" lang="nl-NL"><div class="titlepage"><div><div><h2 class="title" id="chap-Security-Enhanced_Linux-Confining_Users">Hoofdstuk 6. Gebruikers beperken</h2></div></div></div><div class="toc"><dl><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Confining_Users-Linux_and_SELinux_User_Mappings">6.1. Linix en SELinux gebruiker afbeelding</a></span></dt><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Confining_Users-Confining_New_Linux_Users_useradd">6.2. Nieuwe Linux gebruikers beperken: useradd</a></span></dt><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Confining_Users-Confining_Existing_Linux_Users_semanage_login">6.3. Bestaande Linux gebruikers beperken: semanage login</a></span></dt><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Confining_Users-Changing_the_Default_Mapping">6.4. De standaard afbeelbing veranderen</a></span></dt><dt><span class="section"><a href="#s
ect-Security-Enhanced_Linux-Confining_Users-xguest_Kiosk_Mode">6.5. xguest: kiosk modus</a></span></dt><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Confining_Users-Booleans_for_Users_Executing_Applications">6.6. Booleans voor gebruikers die toepassingen uitvoeren</a></span></dt></dl></div><div class="para">
Een aantal beperkte SELinux gebruikers zijn beschikbaar in Fedora 11. Elke Linux gebruiker wordt afgebeeld op een SELinux gebruiker met SELinux tactiek, wat Linux gebruikers de beperkingen van SELinux gebruikers laat erven, bijvoorbeeld (afhankelijk van de gebruiker), het niet in staat zijn om: het X Window systeem te draaien, het netwerk te gebruiken, setuid toepassingen draaien (tenzij SELinux tactiek dit toestaat), of de <code class="command">su</code> en <code class="command">sudo</code> commando's uit te voeren om de Linux root gebruiker te worden. Dit helpt om het systeem te beschermen tegen de gebruiker. Refereer naar <a class="xref" href="#sect-Security-Enhanced_Linux-Targeted_Policy-Confined_and_Unconfined_Users" title="4.3. Beperkte en onbeperkte gebruikers">Paragraaf 4.3, “Beperkte en onbeperkte gebruikers”</a> voor meer informatie over beperkte gebruikers in Fedora 11.
</div><div class="section" lang="nl-NL"><div class="titlepage"><div><div><h2 class="title" id="sect-Security-Enhanced_Linux-Confining_Users-Linux_and_SELinux_User_Mappings">6.1. Linix en SELinux gebruiker afbeelding</h2></div></div></div><div class="para">
Als de Linux root gebruiker, voer je het <code class="command">semanage login -l</code> commando uit om de afbeelding van Linux gebruikers op SELinux gebruikers te zien:
</div><pre class="screen"># /usr/sbin/semanage login -l
Login Name SELinux User MLS/MCS Range
__default__ unconfined_u s0-s0:c0.c1023
root unconfined_u s0-s0:c0.c1023
system_u system_u s0-s0:c0.c1023
</pre><div class="para">
In Fedora 11 worden Linux gebruikers standaard afgebeeld op de SELinux <code class="computeroutput">__default__</code> (welke is afgebeeld op de SELinux <code class="computeroutput">unconfined_u</code> gebruiker). Als een Linux gebruiker wordt aangemaakt met het <code class="command">useradd</code> commando, worden ze afgebeeld op de SELinux <code class="computeroutput">unconfined_u</code> gebruiker indien er geen opties zijn opgegeven. Het volgende definieert de standaard afbeelding:
</div><pre class="screen">__default__ unconfined_u s0-s0:c0.c1023
</pre></div><div class="section" lang="nl-NL"><div class="titlepage"><div><div><h2 class="title" id="sect-Security-Enhanced_Linux-Confining_Users-Confining_New_Linux_Users_useradd">6.2. Nieuwe Linux gebruikers beperken: useradd</h2></div></div></div><div class="para">
Linux gebruikers die afgebeeld zijn op de SELinux <code class="computeroutput">unconfined_u</code> gebruiker draaien in het <code class="computeroutput">unconfined_t</code> domein. Dit kan getoond worden door het uitvoeren van het <code class="command">id -Z</code> commando terwijl je ingelogd bent als een Linux gebruiker afgebeeld op <code class="computeroutput">unconfined_u</code>:
</div><pre class="screen">$ id -Z
unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023
</pre><div class="para">
Als Linux gebruikers in het <code class="computeroutput">unconfined_t</code> domein draaien, worden SELinux tactiekregels toegepast, maar er bestaan tactiekregels die Linux gebruikers die in het <code class="computeroutput">unconfined_t</code> domein draaien bijna alle toegang toestaan. Als onbeperkte Linux gebruikers een toepassing uitvoeren waarvan de SELinux tactiek definieert dat het kan overgaan van het <code class="computeroutput">unconfined_t</code> domein naar zijn eigen beperkte domein, zijn onbeperkte Linux gebruikers nog steeds onderworpen aan de beperkingen van het beperkte domein. Het beveiligings voordeel hiervan is dat, zelfs als een Linux gebruiker onbeperkt draait, de toepassing beperkt blijft, en dat daardoor de uitbuiting van een fout in de toepassing beperkt kan worden door tactiek. Merk op: dit beschermt het systeem niet tegen de gebruiker. In plaats daarvan worden de gebruiker en het systeem beschermd tegen mogelijke schade veroorzaakt door een fout i
n de toepassing.
</div><div class="para">
Als Linux gebruikers aangemaakt worden met <code class="command">useradd</code>, gebruik je de <code class="option">-Z</code> optie om op te geven op welke SELinux gebruiker ze afgebeeld worden. Het volgende voorbeeld maakt een nieuwe Linux gebruiker aan, useruuser, en beeldt die gebruiker af op de SELinux <code class="computeroutput">user_u</code> gebruiker. Linux gebruikers afgebeeld op de SELinux <code class="computeroutput">user_u</code> gebruiker draaien in het <code class="computeroutput">user_t</code> domein. In dit domein zijn Linux gebruikers niet in staat om setuid toepassingen te draaien tenzij SELinux tactiek dit toestaat (zoals <code class="command">passwd</code>), en kunnen ze <code class="command">su</code> of <code class="command">sudo</code> niet uitvoeren, wat hen tegenhoudt om met deze commando's de Linux root gebruiker te worden.
</div><div class="orderedlist"><ol><li><div class="para">
Als de Linux root gebruiker voer je het <code class="command">/usr/sbin/useradd -Z user_u useruuser</code> commando uit om een nieuwe Linux gebruiker (useruuser) aan te maken die afgebeeld wordt op de SELinux <code class="computeroutput">user_u</code> gebruiker.
</div></li><li><div class="para">
Als de Linux root gebruiker voer je het <code class="command">semanage login -l</code> commando uit om de afbeelding van de Linux <code class="computeroutput">useruuser</code> gebruiker op <code class="computeroutput">user_u</code> te zien:
</div><pre class="screen"># /usr/sbin/semanage login -l
Login Name SELinux User MLS/MCS Range
__default__ unconfined_u s0-s0:c0.c1023
root unconfined_u s0-s0:c0.c1023
system_u system_u s0-s0:c0.c1023
useruuser user_u s0
</pre></li><li><div class="para">
Als de Linix root gebruiker voer je het <code class="command">passwd useruuser</code> commando uit om een wachtwoord toe te kennen aan de Linux useruuser gebruiker:
</div><pre class="screen"># passwd useruuser
Changing password for user useruuser.
New UNIX password: <em class="replaceable"><code>Enter a password</code></em>
Retype new UNIX password: <em class="replaceable"><code>Enter the same password again</code></em>
passwd: all authentication tokens updated successfully.
</pre></li><li><div class="para">
Log uit van de huidige sessie, en log in als de Linux useruuser gebruiker. Als je inlogt, beeldt pam_selinux de Linux gebruiker af op een SELinux gebruiker (in dit geval, <code class="computeroutput">user_u</code>), en stelt de bijbehorende SELinux context in. De shell van de Linux gebruiker wordt dan opgestart met deze context. Voer het <code class="command">id -Z</code> commando uit om de context van een Linux gebruiker te bekijken:
</div><pre class="screen">[useruuser@localhost ~]$ id -Z
user_u:user_r:user_t:s0
</pre></li><li><div class="para">
Log uit van de sessie van de Linux useruuuser, en log weer in met je account. Als je de Linux useruuser niet wilt houden, voer je het <code class="command">/usr/sbin/userdel -r useruuser</code> commando uit als de Linux root gebruiker om het te verwijderen te samen met zijn persoonlijke map.
</div></li></ol></div></div><div class="section" lang="nl-NL"><div class="titlepage"><div><div><h2 class="title" id="sect-Security-Enhanced_Linux-Confining_Users-Confining_Existing_Linux_Users_semanage_login">6.3. Bestaande Linux gebruikers beperken: semanage login</h2></div></div></div><div class="para">
Als een Linux gebruiker is afgebeeld op de SELinux <code class="computeroutput">unconfined_u</code> gebruiker (het standaard gedrag), en je wilt de SELinux gebruiker waarop ze afgebeeld zijn veranderen, gebruik je het <code class="command">semanage login</code> commando. Het volgende voorbeeld maakt een nieuwe Linux gebruiker aan met de naam newuser, en beeldt dan die Linux gebruiker af op de SELinux <code class="computeroutput">user_u</code> gebruiker:
</div><div class="orderedlist"><ol><li><div class="para">
Als de Linux root gebruiker voer je het <code class="command">/usr/sbin/useradd newuser</code> commando uit om een nieuwe Linux gebruiker (newuser) aan te maken. Omdat deze gebruiker de standaard afbeelding gebruikt, verschijnt deze niet in de de <code class="command">/usr/sbin/semanage login -l</code> output:
</div><pre class="screen"># /usr/sbin/semanage login -l
Login Name SELinux User MLS/MCS Range
__default__ unconfined_u s0-s0:c0.c1023
root unconfined_u s0-s0:c0.c1023
system_u system_u s0-s0:c0.c1023
</pre></li><li><div class="para">
Om de Linux newuser gebruiker af te beelden op de SELinux <code class="computeroutput">user_u</code> gebruiker, voer je het volgende commando uit als de Linux root gebruiker:
</div><div class="para">
<code class="command">/usr/sbin/semanage login -a -s user_u newuser</code>
</div><div class="para">
De <code class="option">-a</code> optie voegt een nieuwe aantekening toe, en de <code class="option">-s</code> optie specificeert de SELinux gebruiker waarop de Linux gebruiker afgebeeld wordt. Het laatse argument, <code class="computeroutput">newuser</code>, is de Linux gebruiker die je wilt afbeelden op de opgegeven SELinux gebruiker.
</div></li><li><div class="para">
Om de afbeelding van de Linux newuser gebruiker op <code class="computeroutput">user_u</code> te bekijken, voer je het <code class="command">semanage login -l</code> commando uit als de Linux root gebruiker:
</div><pre class="screen"># /usr/sbin/semanage login -l
Login Name SELinux User MLS/MCS Range
__default__ unconfined_u s0-s0:c0.c1023
newuser user_u s0
root unconfined_u s0-s0:c0.c1023
system_u system_u s0-s0:c0.c1023
</pre></li><li><div class="para">
As the Linux root user, run the <code class="command">passwd newuser</code> command to assign a password to the Linux newuser user:
</div><pre class="screen"># passwd newuser
Changing password for user newuser.
New UNIX password: <em class="replaceable"><code>Enter a password</code></em>
Retype new UNIX password: <em class="replaceable"><code>Enter the same password again</code></em>
passwd: all authentication tokens updated successfully.
</pre></li><li><div class="para">
Log uit van je huidige sessie, en log in als de Linux newuser gebruiker. Voer het <code class="command">id -Z</code> commando uit om de SELinux context van newuser te bekijken:
</div><pre class="screen">[newuser@rlocalhost ~]$ id -Z
user_u:user_r:user_t:s0
</pre></li><li><div class="para">
Log uit van de sessie van de Linux newuser, en log weer in met je account. Als je de Linux newuser gebruiker niet wilt behouden, voer je het <code class="command">userdel -r newuser</code> commando uit als de Linux root gebruiker om het te verwijderen, te samen met zijn persoonlijke map. Ook de afbeelding van de Linux newuser gebruiker op <code class="computeroutput">user_u</code> wordt verwijderd:
</div><pre class="screen"># /usr/sbin/userdel -r newuser
# /usr/sbin/semanage login -l
Login Name SELinux User MLS/MCS Range
__default__ unconfined_u s0-s0:c0.c1023
root unconfined_u s0-s0:c0.c1023
system_u system_u s0-s0:c0.c1023
</pre></li></ol></div></div><div class="section" lang="nl-NL"><div class="titlepage"><div><div><h2 class="title" id="sect-Security-Enhanced_Linux-Confining_Users-Changing_the_Default_Mapping">6.4. De standaard afbeelbing veranderen</h2></div></div></div><div class="para">
Standaard worden in Fedora 11 Linux gebruikers afgebeeld op de SELinux <code class="computeroutput">__default__</code> login (welke afgebeeld wordt op de SELinux <code class="computeroutput">unconfined_u</code> gebruiker). Als je nieuwe Linux gebruikers, en Linux gebruikers die niet specifiek afgebeeld zijn op een SELinux gebruiker, standaard wilt instellen om beperkt te zijn, verander je de standaard afbeelding met het <code class="command">semanage login</code> commando.
</div><div class="para">
Bijvoorbeeld, voer het volgende commando uit als de Linux root gebruiker om de standaard afbeelding te veranderen van <code class="computeroutput">unconfined_u</code> naar <code class="computeroutput">user_u</code>:
</div><div class="para">
<code class="command">/usr/sbin/semanage login -m -S targeted -s "user_u" -r s0 __default__</code>
</div><div class="para">
Voer het <code class="command">semanage login -l</code> commando uit als de Linux root gebruiker om te bevestigen dat de <code class="computeroutput">__default__</code> login is afgebeeld op <code class="computeroutput">user_u</code>:
</div><pre class="screen"># /usr/sbin/semanage login -l
Login Name SELinux User MLS/MCS Range
__default__ user_u s0
root unconfined_u s0-s0:c0.c1023
system_u system_u s0-s0:c0.c1023
</pre><div class="para">
Als een nieuwe Linux gebruiker wordt aangemaakt en er wordt geen SELinux gebruiker opgegeven, of als een bestaande Linux gebruiker inlogt en niet overeenkomt met een specifieke regel in de <code class="command">semanage login -l</code> output, worden ze afgebeeld op <code class="computeroutput">user_u</code>, via de <code class="computeroutput">__default__</code> login.
</div><div class="para">
Om weer terug te gaan naar het standaard gedrag, voer je het volgende commando uit als de Linux root gebruiker om de <code class="computeroutput">__default__</code> login af te beelden op de SELinux <code class="computeroutput">unconfined_u</code> gebruiker:
</div><div class="para">
<pre class="screen">/usr/sbin/semanage login -m -S targeted -s "unconfined_u" -r\
s0-s0:c0.c1023 __default__
</pre>
</div></div><div class="section" lang="nl-NL"><div class="titlepage"><div><div><h2 class="title" id="sect-Security-Enhanced_Linux-Confining_Users-xguest_Kiosk_Mode">6.5. xguest: kiosk modus</h2></div></div></div><div class="para">
Het <span class="package">xguest</span> pakket biedt een kiosk gebruikers accont aan. Dit account wordt gebruikt om machines te beveiligen waar mensen naar toe gaan en gebruiken, zoals in bibliotheken, banken, vliegvelden, informatie kiosken, en koffie shops. Het kiosk gebruikers account is zwaar vergrendeld: in wezen staat het gebruikers alleen toe om in te loggen en <span class="application"><strong>Firefox</strong></span> te gebruiken om Internet websites te bekijken. Elke verandering die gemaakt wordt onder dit account, zoals bestanden aanmaken of instellingen veranderen, gaan verloren zodra je uitlogt.
</div><div class="para">
Het kiosk account instellen:
</div><div class="orderedlist"><ol><li><div class="para">
Als de Linux root gebruiker voer je het <code class="command">yum install xguest</code> commando uit om het <span class="package">xguest</span> pakket te installeren. Installeer ook de benodigde afhankelijkheden.
</div></li><li><div class="para">
Om toe te staan dat het kiosk account gebruikt wordt door verschillende mensen, wordt het account niet beschermd met een wachtwoord, en daarom kan het account alleen maar beschermd worden als SELinux in de afdwingende modus draait. Voordat je inlogt met dit account, gebruik je het <code class="command">getenforce</code> commando om er zeker van te zijn dat SELinux in de afdwingende modus draait:
</div><pre class="screen">$ /usr/sbin/getenforce
Enforcing
</pre><div class="para">
Als dat niet het geval is, refereer je naar <a class="xref" href="#sect-Security-Enhanced_Linux-Working_with_SELinux-SELinux_Modes" title="5.5. SELinux modes">Paragraaf 5.5, “SELinux modes”</a> voor informatie over het veranderen van de modus naar afdwingend. Het is niet mogelijk om met dit account in te loggen als SELinux in de toelatende modus is of uitstaat.
</div></li><li><div class="para">
Je kunt alleen inloggen met dit account in de GNOME Display Manager (GDM). Zodra het <span class="package">xguest</span> pakket geinstalleerd is, wordt een <code class="computeroutput">Guest</code> account toegevoegd aan GDM. Om in te loggen klik je op het <code class="computeroutput">Guest</code> account:
</div><div class="mediaobject"><img src="./images/xguest.png"/></div></li></ol></div></div><div class="section" lang="nl-NL"><div class="titlepage"><div><div><h2 class="title" id="sect-Security-Enhanced_Linux-Confining_Users-Booleans_for_Users_Executing_Applications">6.6. Booleans voor gebruikers die toepassingen uitvoeren</h2></div></div></div><div class="para">
Het niet toestaan aan Linux gebruikers om toepassingen (welke de rechten van de gebruiker erven) uit te voeren in hun persoonlijke mappen en <code class="filename">/tmp/</code>, waarnaar ze schrijfrechten hebben, helpt om te voorkomen van foutieve of kwaadwillige toepassingen bestanden veranderen waarvan de gebruiker eigenaar is. In Fedora 11 kunnen Linux gebruikers in de <code class="computeroutput">guest_t</code> en <code class="computeroutput">xguest_t</code> domeinen standaard geen toepassingen in hun persoonlijke mappen of in <code class="filename">/tmp/</code>; Linux gebruikers in de <code class="computeroutput">user_t</code> en <code class="computeroutput">staff_t</code> domeinen kunnen dit echter wel.
</div><div class="para">
Booleans zijn beschikbaar om dit gedrag te veranderen, en deze worden ingesteld met het <code class="command">setsebool</code> commando. Het <code class="command">setsebool</code> commando moet uitgevoerd worden als de Linux root gebruiker. Het <code class="command">setsebool -P</code> commando maakt de veranderingen blijvend. Geruik de <code class="option">-P</code> optie niet als je niet wilt dat veranderingen blijvend zijn na een nieuwe systeem opstart:
</div><div class="formalpara"><h5 class="formalpara" id="form-Security-Enhanced_Linux-Booleans_for_Users_Executing_Applications-guest_t">guest_t</h5>
Om Linux gebruikers in het <code class="computeroutput">guest_t</code> domein <span class="emphasis"><em>toe te staan</em></span> toepassingen uit te voeren in hun persoonlijke mappen en <code class="filename">/tmp/</code>:
</div><div class="para">
<code class="command">/usr/sbin/setsebool -P allow_guest_exec_content on</code>
</div><div class="formalpara"><h5 class="formalpara" id="form-Security-Enhanced_Linux-Booleans_for_Users_Executing_Applications-xguest_t">xguest_t</h5>
Om Linux gebruikers in het <code class="computeroutput">xguest_t</code> domein <span class="emphasis"><em>toe te staan</em></span> om toepassingen uit te voeren in hun persoonlijke mappen en <code class="filename">/tmp/</code>:
</div><div class="para">
<code class="command">/usr/sbin/setsebool -P allow_xguest_exec_content on</code>
</div><div class="formalpara"><h5 class="formalpara" id="form-Security-Enhanced_Linux-Booleans_for_Users_Executing_Applications-user_t">user_t</h5>
Om Linux gebruikers in het <code class="computeroutput">user_t</code> domein te <span class="emphasis"><em>beletten</em></span> om toepassingen uit te voeren in hun persoonlijke mappen en <code class="filename">/tmp/</code>:
</div><div class="para">
<code class="command">/usr/sbin/setsebool -P allow_user_exec_content off</code>
</div><div class="formalpara"><h5 class="formalpara" id="form-Security-Enhanced_Linux-Booleans_for_Users_Executing_Applications-staff_t">staff_t</h5>
Om Linux gebruikers in het <code class="computeroutput">staff_t</code> domein te <span class="emphasis"><em>beletten</em></span> toepassingen uit te voeren in hun persoonlijke mappen en <code class="filename">/tmp/</code>:
</div><div class="para">
<code class="command">/usr/sbin/setsebool -P allow_staff_exec_content off</code>
</div></div></div><div class="chapter" lang="nl-NL"><div class="titlepage"><div><div><h2 class="title" id="chap-Security-Enhanced_Linux-Troubleshooting">Hoofdstuk 7. Foutzoeken</h2></div></div></div><div class="toc"><dl><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Troubleshooting-What_Happens_when_Access_is_Denied">7.1. Wat gebeurt er als toegang wordt geweigerd</a></span></dt><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Troubleshooting-Top_Three_Causes_of_Problems">7.2. De top drie oorzaken van problemen</a></span></dt><dd><dl><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Top_Three_Causes_of_Problems-Labeling_Problems">7.2.1. Labelings problemen</a></span></dt><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Top_Three_Causes_of_Problems-How_are_Confined_Services_Running">7.2.2. Hoe draaien beperkte services?</a></span></dt><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Top_Three_Ca
uses_of_Problems-Evolving_Rules_and_Broken_Applications">7.2.3. Het ontwikkelen van regels en gebrekkige toepassingen</a></span></dt></dl></dd><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Troubleshooting-Fixing_Problems">7.3. Problemen herstellen</a></span></dt><dd><dl><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Fixing_Problems-Linux_Permissions">7.3.1. Linux rechten</a></span></dt><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Fixing_Problems-Possible_Causes_of_Silent_Denials">7.3.2. Mogelijke oorzaken van stille weigeringen</a></span></dt><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Fixing_Problems-Manual_Pages_for_Services">7.3.3. Manual pagina's voor services</a></span></dt><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Fixing_Problems-Permissive_Domains">7.3.4. Toelatende domeinen</a></span></dt><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Fixing_Problems
-Searching_For_and_Viewing_Denials">7.3.5. Zoeken naar en het bekijken van weigeringen</a></span></dt><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Fixing_Problems-Raw_Audit_Messages">7.3.6. Ruwe audit boodschappen</a></span></dt><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Fixing_Problems-sealert_Messages">7.3.7. sealert boodschappen</a></span></dt><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Fixing_Problems-Allowing_Access_audit2allow">7.3.8. Toegang toestaan: audit2allow</a></span></dt></dl></dd></dl></div><div class="para">
Het volgende hoofdstuk beschrijft wat er gebeurt als SELinux toegang weigert; de top drie oorzaken van problemen; waar informatie te vinden over correcte labels; SELinux weigeringen onderzoeken; en het maken aangepaste tactiekregels met <code class="command">audit2allow</code>.
</div><div class="section" lang="nl-NL"><div class="titlepage"><div><div><h2 class="title" id="sect-Security-Enhanced_Linux-Troubleshooting-What_Happens_when_Access_is_Denied">7.1. Wat gebeurt er als toegang wordt geweigerd</h2></div></div></div><div class="para">
SELinux beslissingen, zoals het toestaan of weigeren van toegang, worden bewaard. Deze opslag staat bekend als de Access Vector Cache (AVC). Weigeringsboodschappen worden gelogd als SELinux toegang weigert. Deze weigeringen staan ook bekend als "AVC denials", en worden gelogd op een andere plaats, afhankelijk van welke daemons draaien:
</div><div class="segmentedlist"><table border="0"><thead><tr class="segtitle"><th>Daemon</th><th>Log Location</th></tr></thead><tbody><tr class="seglistitem"><td class="seg">auditd on</td><td class="seg"><code class="filename">/var/log/audit/audit.log</code></td></tr><tr class="seglistitem"><td class="seg">auditd off; rsyslogd on</td><td class="seg"><code class="filename">/var/log/messages</code></td></tr><tr class="seglistitem"><td class="seg">setroubleshootd, rsyslogd, and auditd on</td><td class="seg"><code class="filename">/var/log/audit/audit.log</code>. Easier-to-read denial messages also sent to <code class="filename">/var/log/messages</code></td></tr></tbody></table></div><div class="para">
Als je het X Window systeem draait, en de <span class="package">setroubleshoot</span> en <span class="package">setroubleshoot-server</span> zijn geinstalleerd, en de <code class="systemitem">setroubleshootd</code> en <code class="systemitem">auditd</code> daemons draaien, dan worden een gele ster en een waarschuwing getoond als toegang wordt geweigerd door SELinux:
</div><div class="mediaobject"><img src="./images/setroubleshoot_denial.png"/></div><div class="para">
Klikken op de ster presenteert een gedetaileerde analyse over waarom SELinux de toegang weigerde, en een mogelijke oplossing voor het toestaan van toegang. Als je hetX Window systeem niet draait, is het minder duidelijk wanneer toegang is geweigerd door SELinux. Bijvoorbeel, gebruikers die jouw website bezoeken kunnen een fout krijgen die lijkt op het volgende:
</div><pre class="screen">Forbidden
You don't have permission to access <em class="replaceable"><code>file name</code></em> on this server
</pre><div class="para">
Voor deze situaties, als DAC regels (standaard L:innux rechten) toegang toestaan, controleer dan <code class="filename">/var/log/messages</code> en <code class="filename">/var/log/audit/audit.log</code> voor respectievelijk <code class="computeroutput">"SELinux is preventing"</code> en <code class="computeroutput">"denied"</code> fouten. Dit kan gedaan worden met het uitvoeren van de volgende commando's als de Linux root gebruiker:
</div><div class="para">
<code class="command">grep "SELinux is preventing" /var/log/messages</code>
</div><div class="para">
<code class="command">grep "denied" /var/log/audit/audit.log</code>
</div></div><div class="section" lang="nl-NL"><div class="titlepage"><div><div><h2 class="title" id="sect-Security-Enhanced_Linux-Troubleshooting-Top_Three_Causes_of_Problems">7.2. De top drie oorzaken van problemen</h2></div></div></div><div class="para">
De volgende paragrafen beschrijven de top drie oorzaken van problemen: labelings problemen, het instellen van Booleans en poorten voor services, en het ontwikkelen van SELinux regels.
</div><div class="section" lang="nl-NL"><div class="titlepage"><div><div><h3 class="title" id="sect-Security-Enhanced_Linux-Top_Three_Causes_of_Problems-Labeling_Problems">7.2.1. Labelings problemen</h3></div></div></div><div class="para">
Op systemen die SELinux draaien worden alle processen en bestanden gelabeld met een label dat beveiligings relevante informatie bevat. Deze informatie wordt de SELinux context genoemd. Als deze labels verkeerd zijn, kan toegang geweigerd worden. Als een toepassing niet juist is gelabeld, kan het proces dat het voortbrengt een verkeerde label hebben, wat mogelijk veroorzaakt dat SELinux toegang weigert, en het proces is in staat om verkeerd gelabelde bestanden te maken.
</div><div class="para">
Een veel voorkomende oorzaak van labelings problemen is het gebruiken van een niet-standaard map voor een sevice. Bijvoorbeeld, in plaats van het gebruiken van <code class="filename">/var/www/html/</code> voor een website, wil een beheerder <code class="filename">/srv/myweb/</code> gebruiken. In Fedora 11 is de <code class="filename">/srv/</code> map gelabeld met het <code class="computeroutput">var_t</code> type. Bestanden en mappen aangemaakt in <code class="filename">/srv/</code> erven dit type. Ook kunnen nieuw aangemaakte top-niveau mappen (zoals <code class="filename">/myserver/</code>) gelabeld zijn met het <code class="computeroutput">default_t</code> type. SELinux belet de Apache HTTP server (<code class="systemitem">httpd</code>) toegang tot beide deze types. Om toegang toe te staan, moet SELinux weten dat de bestanden in <code class="filename">/srv/myweb/</code> toegankelijk moeten zijn voor <code class="systemitem">httpd</code>:
</div><pre class="screen"># /usr/sbin/semanage fcontext -a -t httpd_sys_content_t \
"/srv/myweb(/.*)?"
</pre><div class="para">
Dit <code class="command">semanage</code> commando voegt de context voor de <code class="filename">/srv/myweb/</code> map (en alle bestanden en mappen er in) toe aan de SELinux bestandscontext configuratie<sup>[<a id="d0e5351" href="#ftn.d0e5351" class="footnote">14</a>]</sup>. Het <code class="command">semanage</code> commando verandert de context niet. Als de Linux root gebruiker voer je het <code class="command">restorecon</code> commando uit om de veranderingen toe te passen:
</div><pre class="screen"># /sbin/restorecon -R -v /srv/myweb
</pre><div class="para">
Refereer naar <a class="xref" href="#sect-Security-Enhanced_Linux-SELinux_Contexts_Labeling_Files-Persistent_Changes_semanage_fcontext" title="5.7.2. Permanente veranderingen: semanage fcontext">Paragraaf 5.7.2, “Permanente veranderingen: semanage fcontext”</a> voor meer informatie over het toevoegen van context aan de bestandscontext configuratie.
</div><div class="section" lang="nl-NL"><div class="titlepage"><div><div><h4 class="title" id="sect-Security-Enhanced_Linux-Labeling_Problems-What_is_the_Correct_Context">7.2.1.1. Wat is de juiste context?</h4></div></div></div><div class="para">
Het <code class="command">matchpathcon</code> commando controleert de context van een bestandspad en vergelijkt het met het standaard label voor dat pad. Het volgende voorbeeld laat het gebruik van <code class="command">matchpathcon</code> zien voor een map die verkeerd gelabelde bestanden bevat:
</div><pre class="screen">$ /usr/sbin/matchpathcon -V /var/www/html/*
/var/www/html/index.html has context unconfined_u:object_r:user_home_t:s0, should be system_u:object_r:httpd_sys_content_t:s0
/var/www/html/page1.html has context unconfined_u:object_r:user_home_t:s0, should be system_u:object_r:httpd_sys_content_t:s0
</pre><div class="para">
In dit voorbeeld zijn de <code class="filename">index.html</code> en <code class="filename">page1.html</code> bestanden gelabeld met het <code class="computeroutput">user_home_t</code> type. Dit type wordt gebruikt voor bestanden in persoonlijke mapen van gebruikers. Het gebruik van het <code class="command">mv</code> commando om bestanden te verplaatsen vanuit je persoonlijke map kan als gevolg hebben dat de bestanden gelabeld zijn met het <code class="computeroutput">user_home_t</code> type. Dit type moet niet bestaan buiten persoonlijke mappen. Gebruik het <code class="command">restorecon</code> commando om het correcte type van zulke bestanden te herstellen:
</div><pre class="screen"># /sbin/restorecon -v /var/www/html/index.html
restorecon reset /var/www/html/index.html context unconfined_u:object_r:user_home_t:s0->system_u:object_r:httpd_sys_content_t:s0
</pre><div class="para">
Om de constext voor alle bestanden in een map te herstellen, gebruik je de <code class="option">-R</code> optie:
</div><pre class="screen"># /sbin/restorecon -R -v /var/www/html/
restorecon reset /var/www/html/page1.html context unconfined_u:object_r:samba_share_t:s0->system_u:object_r:httpd_sys_content_t:s0
restorecon reset /var/www/html/index.html context unconfined_u:object_r:samba_share_t:s0->system_u:object_r:httpd_sys_content_t:s0
</pre><div class="para">
Refereer naar <a class="xref" href="#sect-Security-Enhanced_Linux-Maintaining_SELinux_Labels_-Checking_the_Default_SELinux_Context" title="5.10.3. Het controleren van de standaard SELinux context">Paragraaf 5.10.3, “Het controleren van de standaard SELinux context”</a> voor een uigebreider voorbeeld van <code class="command">matchpathcon</code>.
</div></div></div><div class="section" lang="nl-NL"><div class="titlepage"><div><div><h3 class="title" id="sect-Security-Enhanced_Linux-Top_Three_Causes_of_Problems-How_are_Confined_Services_Running">7.2.2. Hoe draaien beperkte services?</h3></div></div></div><div class="para">
Services kunnen op verschillende manieren gedraaid worden. Om hier rekening mee te houden moet je SELinux laten weten hoe je services draait. Dit kan bereikt worden met Booleans die toestaan dat onderdelen van SELinux tactiek veranderd worden tijdens het draaien, zonder enige kennis van het schrijven van SELinux tactiekregels. Dit staat veranderingen toe, zoals het toestaan aan services van toegang tot NFS bestandssystemen, zonder het herladen of hercompileren van SELinux tactiek. Ook vereisen services die draaien op niet-standaard poorten dat de tactiek configuratie vernieuwd wordt met het <code class="command">semanage</code> commando.
</div><div class="para">
Bijvoorbeeld, om de Apache HTTP server toe te staan te communiceren met MySQL, zet je de <code class="computeroutput">httpd_can_network_connect_db</code> Boolean aan:
</div><pre class="screen"># /usr/sbin/setsebool -P httpd_can_network_connect_db on
</pre><div class="para">
Als toegang geweigerd wordt voor een bepaalde service, gebruik je de <code class="command">getsebool</code> en <code class="command">grep</code> commando's om te zien of er Booleans beschikbaar zijn die toegang toestaan. Bijvoorbeeld, gebruik het <code class="command">getsebool -a | grep ftp</code> commando om te zoeken naar Booleans gerelateerd met FTP:
</div><pre class="screen">$ /usr/sbin/getsebool -a | grep ftp
allow_ftpd_anon_write --> off
allow_ftpd_full_access --> off
allow_ftpd_use_cifs --> off
allow_ftpd_use_nfs --> off
ftp_home_dir --> off
httpd_enable_ftp_server --> off
tftp_anon_write --> off
</pre><div class="para">
Voor een lijst met Booleans en te zien of ze aan of uit zijn, voer je het <code class="command">/usr/sbin/getsebool -a</code> commando uit. Voor een lijst met Booleans, en uitleg over wat ieder is, en of ze aan of uit zijn, voer je het <code class="command">/usr/sbin/semanage boolean -l</code> commando uit als de Linux root gebruiker. Refereer naar <a class="xref" href="#sect-Security-Enhanced_Linux-Working_with_SELinux-Booleans" title="5.6. Booleans">Paragraaf 5.6, “Booleans”</a> voor informatie over het tonen en instellen van Booleans.
</div><div class="formalpara"><h5 class="formalpara" id="form-Security-Enhanced_Linux-How_are_Confined_Services_Running-Port_Numbers">Poort nummers</h5>
Afhankelijk van de tactiek instelling, is het aan services toegestaan om alleen maar op bepaalde poort nummers te draaien. Het proberen om de poort te veranderen waarop een service draait zonder het veranderen van tactiek kan als resultaat hebben dat de service niet start. Bijvoorbeeld, voer het <code class="command">semanage port -l | grep http</code> commando uit als de Linux root gebruiker om een lijst te zien van de aan <code class="systemitem">http</code> gerelateerde poorten:
</div><pre class="screen"># /usr/sbin/semanage port -l | grep http
http_cache_port_t tcp 3128, 8080, 8118
http_cache_port_t udp 3130
http_port_t tcp 80, 443, 488, 8008, 8009, 8443
pegasus_http_port_t tcp 5988
pegasus_https_port_t tcp 5989
</pre><div class="para">
Het <code class="computeroutput">http_port_t</code> poort type definieert de poorten waarnaar de Apache HTTP server kan luisteren, welke in dit geval zijn, de TCP poorten 80, 443, 488, 8008, 8009, en 8443. Als een beheerder <code class="filename">httpd.conf</code> zodanig instelt dat <code class="systemitem">httpd</code> luistert op poort 9876 (<code class="option">Listen 9876</code>), maar tactiek is niet vernieuwd om dit te weten, zal het <code class="command">service httpd start</code> commando falen:
</div><pre class="screen"># /sbin/service httpd start
Starting httpd: (13)Permission denied: make_sock: could not bind to address [::]:9876
(13)Permission denied: make_sock: could not bind to address 0.0.0.0:9876
no listening sockets available, shutting down
Unable to open logs
[FAILED]
</pre><div class="para">
Een SELinux weigering lijkend op de volgende wordt gelogd naar <code class="filename">/var/log/audit/audit.log</code>:
</div><pre class="screen">type=AVC msg=audit(1225948455.061:294): avc: denied { name_bind } for pid=4997 comm="httpd" src=9876 scontext=unconfined_u:system_r:httpd_t:s0 tcontext=system_u:object_r:port_t:s0 tclass=tcp_socket
</pre><div class="para">
Om <code class="systemitem">httpd</code> toe te staan te luisteren op een poort dat niet getoond wordt voor het <code class="computeroutput">http_port_t</code> poort type, voer je het <code class="command">semanage port</code> commando uit om een poort toe te voegen aan de tactiek configuratie<sup>[<a id="d0e5513" href="#ftn.d0e5513" class="footnote">15</a>]</sup>:
</div><pre class="screen"># /usr/sbin/semanage port -a -t http_port_t -p tcp 9876
</pre><div class="para">
De <code class="option">-a</code> optie voegt een nieuwe aantekening toe, de <code class="option">-t</code> optie definieert een type, en de <code class="option">-p</code> option definieert een protocol. Het laatste argument is het poortnummer dat toegevoegd moet worden.
</div></div><div class="section" lang="nl-NL"><div class="titlepage"><div><div><h3 class="title" id="sect-Security-Enhanced_Linux-Top_Three_Causes_of_Problems-Evolving_Rules_and_Broken_Applications">7.2.3. Het ontwikkelen van regels en gebrekkige toepassingen</h3></div></div></div><div class="para">
Toepassingen kunnen gebreken hebben, wat veroorzaakt dat SELinux toegang weigert. Ook zijn SELinux regels in ontwikkeling - SELinux heeft misschien een applicatie niet op een bepaalde manier zien werken, en kan mogelijk toegang weigeren, zelfs als de toepassing werkt zoals verwacht. Bijvoorbeeld, als een nieuwe versie van PostgreSQL wordt vrijgegeven, kan deze acties uitvoeren die de huidige tactiek nog nooit heeft gezien, wat een toegangsweigering veroorzaakt, zelfs al zou de toegang toegestaan moeten worden.
</div><div class="para">
Voor deze situaties, als toegang is geweigerd, gebruik je <code class="command">audit2allow</code> om een aangepaste tactiek module te maken om toegang toe te staan. Refereer naar <a class="xref" href="#sect-Security-Enhanced_Linux-Fixing_Problems-Allowing_Access_audit2allow" title="7.3.8. Toegang toestaan: audit2allow">Paragraaf 7.3.8, “Toegang toestaan: audit2allow”</a> voor informatie over het gebruik van <code class="command">audit2allow</code>.
</div></div></div><div class="section" lang="nl-NL"><div class="titlepage"><div><div><h2 class="title" id="sect-Security-Enhanced_Linux-Troubleshooting-Fixing_Problems">7.3. Problemen herstellen</h2></div></div></div><div class="para">
De volgende paragrafen helpen met foutzoek zaken. Ze behandelen: het controleren van Linux rechten, welke toegepast worden voor de SELinux regels; mogelijke oorzaken voor toegangsweigering door SELinux, waarvan geen details gelogd zijn; manual pagina's voor services, welke informatie bevatten over labeling en Booleans; toestemmende domeinen, om een proces toe te staan toestemmend te draaien, in plaats van het hele systeem; hoe te zoeken naar weigeringsbooschappen en hoe ze te bekijken; het analyseren van weigeringen; en het maken van aangepaste tactiek modules met <code class="command">audit2allow</code>.
</div><div class="section" lang="nl-NL"><div class="titlepage"><div><div><h3 class="title" id="sect-Security-Enhanced_Linux-Fixing_Problems-Linux_Permissions">7.3.1. Linux rechten</h3></div></div></div><div class="para">
Als toegang geweigerd wordt, controleer dan de standaard Linux rechten. Zoals genoemd in <a class="xref" href="#chap-Security-Enhanced_Linux-Introduction" title="Hoofdstuk 2. Inleiding">Hoofdstuk 2, <i>Inleiding</i></a>, gebruiken de meeste operating systemen een Discretionary Access Control (DAC) (toegangscontrole naar goeddunken) systeem om toegang te controleren, welke gebruikers toestaat de rechten te controleren van bestanden waarvan ze eigenaar zijn. SELinux tactiekregels worden gecontroleerd na de DAC regels. SELinux tactiekregels worden niet gebruikt als de DAC regels als eerste toegang weigeren.
</div><div class="para">
Als toegang wordt geweigerd en er zijn geen SELinux weigeringen gelogd, gebruik je het <code class="command">ls -l</code> commando om de standaard Linux rechten te zien:
</div><pre class="screen">$ ls -l /var/www/html/index.html
-rw-r----- 1 root root 0 2009-05-07 11:06 index.html
</pre><div class="para">
In dit voorbeeld zijn de root gebruiker en groep eigenaar van <code class="filename">index.html</code>. De root gebruiker heeft lees en schrijf rechten (<code class="computeroutput">-rw</code>), en leden van de root groep hebben lees rechten (<code class="computeroutput">-r-</code>). Alle anderen hebben geen toegang (<code class="computeroutput">---</code>). Standaard laten zulke rechten niet toe dat <code class="systemitem">httpd</code> dit bestand leest. Om dit op te lossen, gebruik je het <code class="command">chown</code> commando om de eigenaar en de groep te veranderen. Dit commando moet uitgevoerd worden als de Linux root gebruiker:
</div><pre class="screen"># chown apache:apache /var/www/html/index.html
</pre><div class="para">
Dit neemt de standaard configuratie aan, waarin <code class="systemitem">httpd</code> draait als de Linux apache gebruiker. Als je <code class="systemitem">httpd</code> draait met een andere gebruiker, vervang je <code class="computeroutput">apache:apache</code> met die gebruiker.
</div><div class="para">
Refereer naar de <a href="http://fedoraproject.org/wiki/Docs/Drafts/AdministrationGuide/Permissions">Fedora Documentation Project "Permissions"</a> concept voor informatie over het beheren van Linux rechten.
</div></div><div class="section" lang="nl-NL"><div class="titlepage"><div><div><h3 class="title" id="sect-Security-Enhanced_Linux-Fixing_Problems-Possible_Causes_of_Silent_Denials">7.3.2. Mogelijke oorzaken van stille weigeringen</h3></div></div></div><div class="para">
In bepaalde situaties worden AVC weigeringen misschien niet gelogd als SELinux toegang weigert. Toepassingen en systeembibliotheek functies onderzoeken vaak voor meer toegang dan nodig is voor het uitvoeren van hun taak. Om zo weinig mogelijk rechten te onderhouden, zonder de log te vullen met AVC weigeringen voor onschuldig onderzoeken door toepassingen, kan de tactiek AVC weigeringen stil houden zonder een recht toe te staan door het gebruiken van <code class="computeroutput">dontaudit</code> regels. Deze regels komen veel voor in standaard tactiek. Het nadeel van <code class="computeroutput">dontaudit</code> is dat, hoewel SELinux toegang weigert, weigeringsboodschappen niet worden gelogd, wat het foutzoeken moeilijk maakt.
</div><div class="para">
Om tijdelijk <code class="computeroutput">dontaudit</code> regels uit te zetten, zodat alle weigeringen gelogd worden, voer je het volgende commando uit als de Linux root gebruiker:
</div><div class="para">
<code class="command">/usr/sbin/semodule -DB</code>
</div><div class="para">
De <code class="option">-D</code> zet <code class="computeroutput">dontaudit</code> regels uit; de <code class="option">-B</code> optie bouwt de tactiek opnieuw op. Na het uitvoeren van <code class="command">semodule -DB</code>, probeer je de toepassing opnieuw die toestemmigs problemen vertoonde, en kijk of er nu SELinux weigeringen — relevant voor de toepassing — zijn gelogd. Wees voorzichtig met het beslissen welke weigeringen toegestaan moeten worden, omdat sommige genegeerd moeten worden en afgehandeld met <code class="computeroutput">dontaudit</code> regels. In geval van twijfel, of als je hulp zoekt, neem dan contact op met andere SELinux gebruikers en ontwikkelaars op een SELinux lijst, zoals <a href="http://www.redhat.com/mailman/listinfo/fedora-selinux-list">fedora-selinux-list</a>.
</div><div class="para">
Om de tactiek opnieuw te bouwen en <code class="computeroutput">dontaudit</code> regels weer aan te zetten, voer je het volgende commando uit als de Linux root gebruiker:
</div><div class="para">
<code class="command">/usr/sbin/semodule -B</code>
</div><div class="para">
Dit brengt de tactiek terug naar zijn originele toestand. Voor een volledige lijst van <code class="computeroutput">dontaudit</code> regels, voer je het <code class="command">sesearch --dontaudit</code> commando uit. Versmal het zoeken met gebruik van de <code class="option">-s <em class="replaceable"><code>domein</code></em></code> optie en het <code class="command">grep</code> commando. Bijvoorbeeld:
</div><pre class="screen">$ sesearch --dontaudit -s smbd_t | grep squid
WARNING: This policy contained disabled aliases; they have been removed.
dontaudit smbd_t squid_port_t : tcp_socket name_bind ;
dontaudit smbd_t squid_port_t : udp_socket name_bind ;
</pre><div class="para">
Refereer naar <a class="xref" href="#sect-Security-Enhanced_Linux-Fixing_Problems-Raw_Audit_Messages" title="7.3.6. Ruwe audit boodschappen">Paragraaf 7.3.6, “Ruwe audit boodschappen”</a> en <a class="xref" href="#sect-Security-Enhanced_Linux-Fixing_Problems-sealert_Messages" title="7.3.7. sealert boodschappen">Paragraaf 7.3.7, “sealert boodschappen”</a> voor informatie over het onderzoeken van weigeringen.
</div></div><div class="section" lang="nl-NL"><div class="titlepage"><div><div><h3 class="title" id="sect-Security-Enhanced_Linux-Fixing_Problems-Manual_Pages_for_Services">7.3.3. Manual pagina's voor services</h3></div></div></div><div class="para">
Manual pagina's voor services bevatten waardevolle informatie, zoals welk bestandstype gebruikt moet worden voor een bepaalde situatie, en Booleans om de toegang die een sevice heeft te veranderen (zoals toegang tot NFS bestandssystemen voor <code class="systemitem">httpd</code>). Deze informatie kan in de standaard manual pagina zijn, of in een manual pagina met <code class="computeroutput">selinux</code> voor of achter de servicenaam.
</div><div class="para">
Bijvoorbeeld, de <span class="citerefentry"><span class="refentrytitle">httpd_selinux</span>(8)</span> manual pagina heeft informatie over het te gebruiken bestandstype in een bepaalde situatie, en ook Booleans voor het toestaan van scripts, bestanden delen, toegang krijgen tot mappen in de persoonlijke mappen van gebruikers, enzovoort. Andere manual pagina's met SELinux informatie voor services zijn:
</div><div class="itemizedlist"><ul><li><div class="para">
Samba: de <span class="citerefentry"><span class="refentrytitle">samba_selinux</span>(8)</span> manual pagina beschrijft dat bestanden en mappen die met Samba geexporteerd worden gelabeld moeten zijn met het <code class="computeroutput">samba_share_t</code> type, en ook Booleans die toestaan dat bestanden gelabeld met andere types dan <code class="computeroutput">samba_share_t</code> met Samba geexporteerd kunnen worden.
</div></li><li><div class="para">
NFS: de <span class="citerefentry"><span class="refentrytitle">nfs_selinux</span>(8)</span> manual pagina beschrijft dat standaard bestandssystemen niet met NFS geexporteerd kunnen worden, en om toe te staan dat bestanden geexporteerd kunnen worden, Booleans zoals <code class="computeroutput">nfs_export_all_ro</code> of <code class="computeroutput">nfs_export_all_rw</code> aangezet moeten worden.
</div></li><li><div class="para">
Berkeley Internet Name Domain (BIND): de <span class="citerefentry"><span class="refentrytitle">named</span>(8)</span> manual pagina beschrijft welke bestandstype te gebruiken voor een bepaalde situatie (zie de <code class="computeroutput">Red Hat SELinux BIND Security Profile</code> paragraaf). De <span class="citerefentry"><span class="refentrytitle">named_selinux</span>(8)</span> manual pagina beschrijf dat <code class="systemitem">named</code> standaard niet naar master zone bestanden kan schrijven, en om deze toegang toe te staan, de <code class="computeroutput">named_write_master_zones</code> Boolean aangezet moet worden.
</div></li></ul></div><div class="para">
De informatie in manual pagina's helpt je de juiste bestandstypes en Booleans in te stellen, wat helpt voorkomen dat SELinux toegangs weigeringen geeft
</div></div><div class="section" lang="nl-NL"><div class="titlepage"><div><div><h3 class="title" id="sect-Security-Enhanced_Linux-Fixing_Problems-Permissive_Domains">7.3.4. Toelatende domeinen</h3></div></div></div><div class="para">
Als SELinux in de toelatende modus draait, weigert SELinux geen toegang, maar weigeringen worden gelogd voor acties die geweigerd zouden zijn als SELinux in de afdwingende modus draaide. Vroeger was het niet mogelijk om een enkel domein toelatend te maken (denk eraan: processen draaien in domeinen). In bepaalde situaties leidde dit er toe dat het hele systeem toelatend werd gemaakt voor foutzoek doeleinden.
</div><div class="para">
Fedora 11 introduceert toelatende domeinen, waarbij een beheerder een enkel proces (domein) toelatend kan draaien, in plaats van het hele systeem toelatend te maken. SELinux controles worden nog steeds gedaan voor toelatende domeinen, de kernel laat echter toegang toe en rapporteert een AVC weigering voor situaties waar SELinux toegang geweigerd zou hebben. Toelatende domeinen zijn ook beschikbaar in Fedora 9 (als de laatste vernieuwingen toegepast zijn).
</div><div class="para">
In Red Hat Enterprise Linux 4 en 5 zijn <code class="computeroutput"><em class="replaceable"><code>domain</code></em>_disable_trans</code> Booleans beschikbaar om een toepassing te beletten om over te gaan naar een beperkt domein, en daarom draait het proces in een onbeperkt domein, zoals <code class="computeroutput">initrc_t</code>. Het aanzetten van zulke Booleans kan grote problemen veroorzaken. Bijvoorbeeld, als de <code class="computeroutput">httpd_disable_trans</code> Boolean aangezet is:
</div><div class="itemizedlist"><ul><li><div class="para">
draait <code class="systemitem">httpd</code> in het onbeperkte <code class="computeroutput">initrc_t</code> domein. Bestanden gemaakt door processen die in het <code class="computeroutput">initrc_t</code> domein draaien hebben misschien niet dezelfde labelingsregels toegepast gekregen als bestanden die draaien in het <code class="computeroutput">httpd_t</code> domein, wat potentieel toestaat dat processen verkeerd gelabelde bestanden maken. Dit veroorzaakt later toegangs problemen.
</div></li><li><div class="para">
beperkte domeinen die toegestaan worden om te communiceren met <code class="computeroutput">httpd_t</code> kunnen niet communiceren met <code class="computeroutput">initrc_t</code>, wat potentieel extra fouten veroorzaakt.
</div></li></ul></div><div class="para">
De <code class="computeroutput"><em class="replaceable"><code>domain</code></em>_disable_trans</code> Booleans zijn verwijderd in Fedora 7, hoewel er geen vervanger voor was. Toelatende domeinen lossen de hierboven beschreven problemen op: overgangs regels worden toegepast, en bestanden worden aangemaakt met de juiste labels.
</div><div class="para">
Toelatende domeinen kunnen gebruikt worden voor:
</div><div class="itemizedlist"><ul><li><div class="para">
maak een enkel proces (domein) toelatend om een probleem op te lossen, in plaats van het gehele systeem kwetsbaar te maken door het hele systeem toelatend te maken.
</div></li><li><div class="para">
het maken van tactiek voor nieuwe toepassingen. Vroeger was het aanbevolen dat een minmale tactiek werd gemaakt, en dat daarna de hele machine in de toelatende modus werd gebracht, zodat de toepassing kon draaien, maar SELinux weigeringen nog steeds gelogd werden. <code class="command">audit2allow</code> kon daarna gebruikt worden om te helpen met het schrijven van de tactiek. Dit maakte het gehele systeem kwetsbaar. Met toelatende domeinen, wordt alleen het domein in de nieuwe tactiek toelatend, zonder het hele systeem kwetsbaar te maken.
</div></li></ul></div><div class="section" lang="nl-NL"><div class="titlepage"><div><div><h4 class="title" id="sect-Security-Enhanced_Linux-Permissive_Domains-Making_a_Domain_Permissive">7.3.4.1. Een domein toelatend maken</h4></div></div></div><div class="para">
Om een domein toelatend te maken voer je het <code class="command">semanage permissive -a <em class="replaceable"><code>domein</code></em></code> commando uit, waarin <em class="replaceable"><code>domein</code></em> het domein is dat je toelatend wilt maken. Bijvoorbeeld, voer het volgende commando uit als de Linux root gebruiker om het <code class="computeroutput">httpd_t</code> domein (het domein waarin de Apache HTTP sever draait) toelatend te maken:
</div><div class="para">
<code class="command">/usr/sbin/semanage permissive -a httpd_t</code>
</div><div class="para">
Om een lijst te zien van de domeinen die je toelatend hebt gemaakt, voer je het <code class="command">semodule -l | grep permissive</code> commando uit als de Linux root gebruiker. Bijvoorbeeld:
</div><pre class="screen"># /usr/sbin/semodule -l | grep permissive
permissive_httpd_t 1.0
</pre><div class="para">
Als je een domein niet langer toelatend wilt laten zijn, voer je het <code class="command">semanage permissive -d <em class="replaceable"><code>domein</code></em></code> commando uit als de Linux root gebruiker. Bijvoorbeeld:
</div><div class="para">
<code class="command">/usr/sbin/semanage permissive -d httpd_t</code>
</div></div><div class="section" lang="nl-NL"><div class="titlepage"><div><div><h4 class="title" id="sect-Security-Enhanced_Linux-Permissive_Domains-Denials_for_Permissive_Domains">7.3.4.2. Weigeringen voor toelatende domeinen</h4></div></div></div><div class="para">
De <code class="computeroutput">SYSCALL</code> boodschap is verschillend voor toelatende domeinen. Het volgende is een voorbeeld AVC weigering ( en de bijbehorende systeem aanroep) van de Apache HTTP server:
</div><pre class="screen">type=AVC msg=audit(1226882736.442:86): avc: denied { getattr } for pid=2427 comm="httpd" path="/var/www/html/file1" dev=dm-0 ino=284133 scontext=unconfined_u:system_r:httpd_t:s0 tcontext=unconfined_u:object_r:samba_share_t:s0 tclass=file
type=SYSCALL msg=audit(1226882736.442:86): arch=40000003 syscall=196 success=no exit=-13 a0=b9a1e198 a1=bfc2921c a2=54dff4 a3=2008171 items=0 ppid=2425 pid=2427 auid=502 uid=48 gid=48 euid=48 suid=48 fsuid=48 egid=48 sgid=48 fsgid=48 tty=(none) ses=4 comm="httpd" exe="/usr/sbin/httpd" subj=unconfined_u:system_r:httpd_t:s0 key=(null)
</pre><div class="para">
Standaard is het <code class="computeroutput">httpd_t</code> domein niet toelatend, en daarom wordt de actie geweigerd, en de <code class="computeroutput">SYSCALL</code> boodschap bevat <code class="computeroutput">success=no</code>. Het volgende is een voorbeeld AVC weigering voor dezelfde actie, behalve dat het <code class="command">semanage permissive -a httpd_t</code> commando is uitgevoerd om het <code class="computeroutput">httpd_t</code> domein toelatend te maken:
</div><pre class="screen">type=AVC msg=audit(1226882925.714:136): avc: denied { read } for pid=2512 comm="httpd" name="file1" dev=dm-0 ino=284133 scontext=unconfined_u:system_r:httpd_t:s0 tcontext=unconfined_u:object_r:samba_share_t:s0 tclass=file
type=SYSCALL msg=audit(1226882925.714:136): arch=40000003 syscall=5 success=yes exit=11 a0=b962a1e8 a1=8000 a2=0 a3=8000 items=0 ppid=2511 pid=2512 auid=502 uid=48 gid=48 euid=48 suid=48 fsuid=48 egid=48 sgid=48 fsgid=48 tty=(none) ses=4 comm="httpd" exe="/usr/sbin/httpd" subj=unconfined_u:system_r:httpd_t:s0 key=(null)
</pre><div class="para">
In dit geval, hoewel er een AVC weigering gelogd is, was toegang niet geweigerd, zoals getoond wordt door <code class="computeroutput">success=yes</code> in de <code class="computeroutput">SYSCALL</code> boodschap.
</div><div class="para">
Refereer naar de blog van Dan Walsh <a href="http://danwalsh.livejournal.com/24537.html">"Permissive Domains"</a> voor meer informatie over toelatende domeinen.
</div></div></div><div class="section" lang="nl-NL"><div class="titlepage"><div><div><h3 class="title" id="sect-Security-Enhanced_Linux-Fixing_Problems-Searching_For_and_Viewing_Denials">7.3.5. Zoeken naar en het bekijken van weigeringen</h3></div></div></div><div class="para">
Deze paragraaf neemt aan dat de <span class="package">setroubleshoot</span>, <span class="package">setroubleshoot-server</span>, en <span class="package">audit</span> pakketten geinstalleerd zijn, en dat de <code class="systemitem">auditd</code>, <code class="systemitem">rsyslogd</code>, en <code class="systemitem">setroubleshootd</code> daemons draaien. Refereer naar <a class="xref" href="#sect-Security-Enhanced_Linux-Working_with_SELinux-Which_Log_File_is_Used" title="5.2. Welk log bestand wordt gebruikt">Paragraaf 5.2, “Welk log bestand wordt gebruikt”</a> voor informatie over het starten van deze daemons. Een aantal gereedschappen zijn beschikbaar voor het zoeken naar en bekijken van SELinux weigeringen, zoals <code class="command">ausearch</code>, <code class="command">aureport</code>, en <code class="command">sealert</code>.
</div><div class="formalpara"><h5 class="formalpara" id="form-Security-Enhanced_Linux-Searching_For_and_Viewing_Denials-ausearch">ausearch</h5>
Het <span class="package">audit</span> pakket bevat <code class="command">ausearch</code>. Uit de <span class="citerefentry"><span class="refentrytitle">ausearch</span>(8)</span> manual pagina: "<code class="command">ausearch</code> is een gereedschap dat de daemon logs kan onderzoeken voor gebeurtenissen gebaseerd op verscheidene zoek criteria"<sup>[<a id="d0e5962" href="#ftn.d0e5962" class="footnote">16</a>]</sup>. Het <code class="command">ausearch</code> gereedschap heeft toegang tot <code class="filename">/var/log/audit/audit.log</code>, en moet daarom als de Linux root gebruiker uitgevoerd worden:
</div><div class="segmentedlist"><table border="0"><thead><tr class="segtitle"><th>Zoeken naar</th><th>Commando</th></tr></thead><tbody><tr class="seglistitem"><td class="seg">alle weigeringen</td><td class="seg"><code class="command">/sbin/ausearch -m avc</code></td></tr><tr class="seglistitem"><td class="seg">weigeringen voor vandaag</td><td class="seg"><code class="command">/sbin/ausearch -m avc -ts today</code></td></tr><tr class="seglistitem"><td class="seg">weigeringen van de laatste 10 minuten</td><td class="seg"><code class="command">/sbin/ausearch -m avc -ts recent</code></td></tr></tbody></table></div><div class="para">
Om te zoeken naar SELinux weigeringen voor een bepaalde service, gebruik je de <code class="option">-c <em class="replaceable"><code>comm-naam</code></em></code> optie, waarin <em class="replaceable"><code>comm-naam</code></em> de naam van het programma is<sup>[<a id="d0e6014" href="#ftn.d0e6014" class="footnote">17</a>]</sup>, bijvoorbeeld, <code class="systemitem">httpd</code> voor de Apache HTTP server, en <code class="systemitem">smbd</code> voor Samba:
</div><div class="para">
<code class="command">/sbin/ausearch -m avc -c httpd</code>
</div><div class="para">
<code class="command">/sbin/ausearch -m avc -c smbd</code>
</div><div class="para">
Refereer naar de <span class="citerefentry"><span class="refentrytitle">ausearch</span>(8)</span> manual pagina voor meer <code class="command">ausearch</code> opties.
</div><div class="formalpara"><h5 class="formalpara" id="form-Security-Enhanced_Linux-Searching_For_and_Viewing_Denials-aureport">aureport</h5>
Het <span class="package">audit</span> pakket bevat <code class="command">aureport</code>. Uit de <span class="citerefentry"><span class="refentrytitle">aureport</span>(8)</span> manual pagina: "<code class="command">aureport</code> is een gereedschap dat samenvattingsrapporten maakt van de systeem logs"<sup>[<a id="d0e6074" href="#ftn.d0e6074" class="footnote">18</a>]</sup>. Het <code class="command">aureport</code> gereedschap heeft toegang tot <code class="filename">/var/log/audit/audit.log</code>, en moet daarom als de Linux root gebruiker uitgevoerd worden. Om een lijst te zien van SELinux weigeringen en hoe vaak ze zijn voorgekomen, voer je het <code class="command">aureport -a</code> commando uit. Het volgende is een vorbeeld output die twee weigeringen bevat:
</div><pre class="screen"># /sbin/aureport -a
AVC Report
========================================================
# date time comm subj syscall class permission obj event
========================================================
1. 05/01/2009 21:41:39 httpd unconfined_u:system_r:httpd_t:s0 195 file getattr system_u:object_r:samba_share_t:s0 denied 2
2. 05/03/2009 22:00:25 vsftpd unconfined_u:system_r:ftpd_t:s0 5 file read unconfined_u:object_r:cifs_t:s0 denied 4
</pre><div class="para">
Refereer naar de <span class="citerefentry"><span class="refentrytitle">aureport</span>(8)</span> manual pagina voor meer <code class="command">aureport</code> opties.
</div><div class="formalpara"><h5 class="formalpara" id="form-Security-Enhanced_Linux-Searching_For_and_Viewing_Denials-sealert">sealert</h5>
Het <span class="package">setroubleshoot-server</span> pakket bevat <code class="command">sealert</code>, welke weigerings boodschappen leest die vertaald zijn door <span class="package">setroubleshoot-server</span>. Weigeringen krijgen ID's toegekend, zoals te zien in <code class="filename">/var/log/messages</code>. Het volgende is een voorbeeld weigering van <code class="filename">messages</code>:
</div><pre class="screen">setroubleshoot: SELinux is preventing httpd (httpd_t) "getattr" to /var/www/html/file1 (samba_share_t). For complete SELinux messages. run sealert -l 84e0b04d-d0ad-4347-8317-22e74f6cd020
</pre><div class="para">
In dit voorbeeld is de ID van de weigering <code class="computeroutput">84e0b04d-d0ad-4347-8317-22e74f6cd020</code>. De <code class="option">-l</code> optie neemt een ID als argument. Het uitvoeren van het <code class="command">sealert -l 84e0b04d-d0ad-4347-8317-22e74f6cd020</code> commando laat een gedetaileerde analyse zien waarom SELinux toegang weigerde, en een mogelijke oplossing om toegang toe te staan.
</div><div class="para">
Als je het X Window systeen draait, je de <span class="package">setroubleshoot</span> en <span class="package">setroubleshoot-server</span> pakketten geinstalleerd hebt, en de <code class="systemitem">setroubleshootd</code> en <code class="systemitem">auditd</code> daemons draaien, worden een gele ster en een waarschuwing getoond als toegang geweigerd wordt door SELinux. Het klikken op de ster start de <code class="command">sealert</code> GUI, en laat de weigeringen zien in HTML output:
</div><div class="mediaobject"><img src="./images/sealert_gui.png"/></div><div class="itemizedlist"><ul><li><div class="para">
Voer het <code class="command">sealert -b</code> commando uit om de <code class="command">sealert</code> GUI op te starten.
</div></li><li><div class="para">
Voer het <code class="command">sealert -l \*</code> commando uit om een gedetaileerde analyse van alle weigeringen te zien.
</div></li><li><div class="para">
Als de Linux root gebruiker voer je het <code class="command">sealert -a /var/log/audit/audit.log -H > audit.html</code> commando uit om een HTML versie te maken van de <code class="command">sealert</code> analyse, zoals te zien is met de <code class="command">sealert</code> GUI.
</div></li></ul></div><div class="para">
Refereer naar de <span class="citerefentry"><span class="refentrytitle">sealert</span>(8)</span> manual pagina voor meer <code class="command">sealert</code> opties.
</div></div><div class="section" lang="nl-NL"><div class="titlepage"><div><div><h3 class="title" id="sect-Security-Enhanced_Linux-Fixing_Problems-Raw_Audit_Messages">7.3.6. Ruwe audit boodschappen</h3></div></div></div><div class="para">
Ruwe audit boodschappen worden gelogd naar <code class="filename">/var/log/audit/audit.log</code>. Het volgende is een voorbeeld AVC weigering (en de bijbehorende systeem aanroep) die optrad toen de Apache HTTP server (draaiende in het <code class="computeroutput">httpd_t</code> domein) probeerde om toegang te krijgen tot het <code class="filename">/var/www/html/file1</code> bestand (gelabeld met het <code class="computeroutput">samba_share_t</code> type):
</div><pre class="screen">type=AVC msg=audit(1226874073.147:96): avc: denied { getattr } for pid=2465 comm="httpd" path="/var/www/html/file1" dev=dm-0 ino=284133 scontext=unconfined_u:system_r:httpd_t:s0 tcontext=unconfined_u:object_r:samba_share_t:s0 tclass=file
type=SYSCALL msg=audit(1226874073.147:96): arch=40000003 syscall=196 success=no exit=-13 a0=b98df198 a1=bfec85dc a2=54dff4 a3=2008171 items=0 ppid=2463 pid=2465 auid=502 uid=48 gid=48 euid=48 suid=48 fsuid=48 egid=48 sgid=48 fsgid=48 tty=(none) ses=6 comm="httpd" exe="/usr/sbin/httpd" subj=unconfined_u:system_r:httpd_t:s0 key=(null)
</pre><div class="variablelist"><dl><dt><span class="term"><em class="replaceable"><code>{ getattr }</code></em></span></dt><dd><div class="para">
Het item tussen accolades geeft het recht aan dat geweigerd was. <code class="computeroutput">getattr</code> geeft aan dat het bron proces probeerde om de status informatie van het doel bestand te lezen. Dit treedt op voor het lezen van bestanden. Deze actie is geweigerd omdat toegang werd geprobeerd naar het bestand dat een verkeerd label had. Vaak geziene rechten zijn <code class="computeroutput">getattr</code>, <code class="computeroutput">read</code>, en <code class="computeroutput">write</code>.
</div></dd><dt><span class="term">comm="<em class="replaceable"><code>httpd</code></em>"</span></dt><dd><div class="para">
Het programma dat het proces heeft opgestart. Het volledige pad van het programma wordt gevonden in de <code class="computeroutput">exe=</code> sectie van de systeem aanroep (<code class="computeroutput">SYSCALL</code>) boodschap, welke in dit geval <code class="computeroutput">exe="/usr/sbin/httpd"</code> is.
</div></dd><dt><span class="term">path="<em class="replaceable"><code>/var/www/html/file1</code></em>"</span></dt><dd><div class="para">
Het pad naar het object (doel) waar het proces toegang naar probeerde te krijgen.
</div></dd><dt><span class="term">scontext="<em class="replaceable"><code>unconfined_u:system_r:httpd_t:s0</code></em>"</span></dt><dd><div class="para">
De SELinux context van het proces dat de geweigerde actie probeerde uit te voeren. In dit geval is het de SELinux context van de Apache HTTP server, welke draait in het <code class="computeroutput">httpd_t</code> domein.
</div></dd><dt><span class="term">tcontext="<em class="replaceable"><code>unconfined_u:object_r:samba_share_t:s0</code></em>"</span></dt><dd><div class="para">
De SELinux context van het object (doel) waarnaar het proces toegang probeerde te krijgen. In dit geval is het de SELinux context van <code class="filename">file1</code>. Merk op: het <code class="computeroutput">samba_share_t</code> type is niet bereikbaar voor processen die draaien in het <code class="computeroutput">httpd_t</code> domein.
</div><div class="para">
In bepaalde situaties kan de <code class="computeroutput">tcontext</code> overeenkomen met de <code class="computeroutput">scontext</code>, bijvoorbeeld, als een proces probeert een systeem service uit te voeren dat de eigenschappen van dat draaiende proces zal veranderen, zoals een gebruikers ID. Ook kan de <code class="computeroutput">tcontext</code> overeenkomen met de <code class="computeroutput">scontext</code> als een proces probeert meer hulpbronnen (zoals geheugen) te gebruiken dan de normale limieten toestaan, wat resulteert in een beveiligings controle om te zien of dat proces gemachtigd is om die limieten te doorbreken.
</div></dd></dl></div><div class="para">
Van de systeem aanroep (<code class="computeroutput">SYSCALL</code>) boodachap, zijn twee items interessant:
</div><div class="itemizedlist"><ul><li><div class="para">
<code class="computeroutput">success=<em class="replaceable"><code>no</code></em></code>: geeft aan of de weigering (AVC) afdwingend was of niet. <code class="computeroutput">success=no</code> geeft aan dat de system aanroep gefaald heeft (SELinux weigerde toegang). <code class="computeroutput">success=yes</code> geeft aan dat de systeem aanroep gelukt is - dit kan voorkomen bij toelatende domeinen of onbeperkte domeinen, zoals <code class="computeroutput">initrc_t</code> en <code class="computeroutput">kernel_t</code>.
</div></li><li><div class="para">
<code class="computeroutput">exe="<em class="replaceable"><code>/usr/sbin/httpd</code></em>"</code>: het volledige pad naar het programma dat het proces heeft opgestart, welke in dit geval <code class="computeroutput">exe="/usr/sbin/httpd"</code> is.
</div></li></ul></div><div class="para">
Een foutief bestandstype is een veel voorkomende oorzaak voor het weigeren van toegang door SELinux. Om te beginnen met foutzoeken, vergelijk je de bron context (<code class="computeroutput">scontext</code>) met de doel context (<code class="computeroutput">tcontext</code>). Moet het proces (<code class="computeroutput">scontext</code>) toegang hebben tot zo'n object (<code class="computeroutput">tcontext</code>)? Bijvoorbeeld, de Apache HTTP server (<code class="computeroutput">httpd_t</code>) moet alleen toegang hebben tot types gespecificeerd in de <span class="citerefentry"><span class="refentrytitle">httpd_selinux</span>(8)</span> manual pagina, zoals <code class="computeroutput">httpd_sys_content_t</code>, <code class="computeroutput">public_content_t</code>, enzovoort, behalve als iets anders ingesteld was.
</div></div><div class="section" lang="nl-NL"><div class="titlepage"><div><div><h3 class="title" id="sect-Security-Enhanced_Linux-Fixing_Problems-sealert_Messages">7.3.7. sealert boodschappen</h3></div></div></div><div class="para">
Weigeringen krijgen ID's toegewezen, zoals te zien is in <code class="filename">/var/log/messages</code>. Het volgende is een voorbeeld AVC weigering (gelogd naar <code class="filename">messages</code>) die optrad toen de Apache HTTP server (draaiende in het <code class="computeroutput">httpd_t</code> domein) probeerde toegang te krijgen tot het <code class="filename">/var/www/html/file1</code> bestand (gelabeld met het <code class="computeroutput">samba_share_t</code> type):
</div><pre class="screen"><em class="replaceable"><code>hostname</code></em> setroubleshoot: SELinux is preventing httpd (httpd_t) "getattr" to /var/www/html/file1 (samba_share_t). For complete SELinux messages. run sealert -l 84e0b04d-d0ad-4347-8317-22e74f6cd020
</pre><div class="para">
Zoals aangeraden, voer je het <code class="command">sealert -l 84e0b04d-d0ad-4347-8317-22e74f6cd020</code> commando uit om de complete boodschap te zien. Dit commando werkt alleen op de locale machine, en presenteert dezelfde informatie als de <code class="command">sealert</code> GUI:
</div><pre class="screen">$ sealert -l 84e0b04d-d0ad-4347-8317-22e74f6cd020
Summary:
SELinux is preventing httpd (httpd_t) "getattr" to /var/www/html/file1
(samba_share_t).
Detailed Description:
SELinux denied access to /var/www/html/file1 requested by httpd.
/var/www/html/file1 has a context used for sharing by different program. If you
would like to share /var/www/html/file1 from httpd also, you need to change its
file context to public_content_t. If you did not intend to this access, this
could signal a intrusion attempt.
Allowing Access:
You can alter the file context by executing chcon -t public_content_t
'/var/www/html/file1'
Fix Command:
chcon -t public_content_t '/var/www/html/file1'
Additional Information:
Source Context unconfined_u:system_r:httpd_t:s0
Target Context unconfined_u:object_r:samba_share_t:s0
Target Objects /var/www/html/file1 [ file ]
Source httpd
Source Path /usr/sbin/httpd
Port <Unknown>
Host <em class="replaceable"><code>hostname</code></em>
Source RPM Packages httpd-2.2.10-2
Target RPM Packages
Policy RPM selinux-policy-3.5.13-11.fc11
Selinux Enabled True
Policy Type targeted
MLS Enabled True
Enforcing Mode Enforcing
Plugin Name public_content
Host Name <em class="replaceable"><code>hostname</code></em>
Platform <em class="replaceable"><code>Linux hostname 2.6.27.4-68.fc11.i686 #1 SMP Thu Oct</code></em>
30 00:49:42 EDT 2008 i686 i686
Alert Count 4
First Seen Wed Nov 5 18:53:05 2008
Last Seen Wed Nov 5 01:22:58 2008
Local ID 84e0b04d-d0ad-4347-8317-22e74f6cd020
Line Numbers
Raw Audit Messages
node=<em class="replaceable"><code>hostname</code></em> type=AVC msg=audit(1225812178.788:101): avc: denied { getattr } for pid=2441 comm="httpd" path="/var/www/html/file1" dev=dm-0 ino=284916 scontext=unconfined_u:system_r:httpd_t:s0 tcontext=unconfined_u:object_r:samba_share_t:s0 tclass=file
node=<em class="replaceable"><code>hostname</code></em> type=SYSCALL msg=audit(1225812178.788:101): arch=40000003 syscall=196 success=no exit=-13 a0=b8e97188 a1=bf87aaac a2=54dff4 a3=2008171 items=0 ppid=2439 pid=2441 auid=502 uid=48 gid=48 euid=48 suid=48 fsuid=48 egid=48 sgid=48 fsgid=48 tty=(none) ses=3 comm="httpd" exe="/usr/sbin/httpd" subj=unconfined_u:system_r:httpd_t:s0 key=(null)
</pre><div class="variablelist"><dl><dt><span class="term">Summary - samenvatting</span></dt><dd><div class="para">
Een korte samenvatting van de geweigerde actie. Dit is hetzelfde als de weigering in <code class="filename">/var/log/messages</code>. In dit voorbeeld, werd het <code class="systemitem">httpd</code> proces toegang geweigerd tot een bestand (<code class="filename">file1</code>), welke gelabeld is met het <code class="computeroutput">samba_share_t</code> type.
</div></dd><dt><span class="term">Detailed Description - Gedetaileerde beschrijving</span></dt><dd><div class="para">
Een langere beschrijving. In dit voorbeeld is <code class="filename">file1</code> gelabeld met het <code class="computeroutput">samba_share_t</code> type. Dit type wordt gebruikt voor bestanden en mappen die je wilt exporteren met Samba. De beschrijving suggereert het veranderen van het type naar een type dat bereikt kan worden door de Apache HTTP server en Samba, als die toegang gewenst is.
</div></dd><dt><span class="term">Allowing Acces - Toegang toestaan</span></dt><dd><div class="para">
Een suggestie voor het toestaan van de toegang. Dit kan het herlabelen van bestanden zijn, het aanzetten van een Boolean, of het maken van een locale tactiek module. In dit geval is de aanbeveling om het bestand te labelen met een type waarnaar zowel de Apache HTTP server en Samba toegang naar hebben.
</div></dd><dt><span class="term">Fix Command - Herstel commando</span></dt><dd><div class="para">
Een gesuggereerd commando om toegang toe te staan en de weigering op te lossen. In dit voorbeeld is dat het commando om het type van <code class="filename">file1</code> te veranderen naar <code class="computeroutput">public_content_t</code>, welke toegankelijk is voor de Apache HTTP server en Samba.
</div></dd><dt><span class="term">Additional Information - Extra informatie</span></dt><dd><div class="para">
Informatie die nuttig is voor foutrapporten, zoals de naam en versie van het tactiek pakket (<code class="computeroutput">selinux-policy-3.5.13-11.fc11</code>), maar die niet zal helpen om de reden van de weigering op te lossen.
</div></dd><dt><span class="term">Raw Audit Messages - Ruwe audit boodschappen</span></dt><dd><div class="para">
De ruwe audit boodschappen van <code class="filename">/var/log/audit/audit.log</code> die verbonden zijn met de weigering. Refereer naar <a class="xref" href="#sect-Security-Enhanced_Linux-Fixing_Problems-Raw_Audit_Messages" title="7.3.6. Ruwe audit boodschappen">Paragraaf 7.3.6, “Ruwe audit boodschappen”</a> voor informatie over ieder item in de AVC weigering.
</div></dd></dl></div></div><div class="section" lang="nl-NL"><div class="titlepage"><div><div><h3 class="title" id="sect-Security-Enhanced_Linux-Fixing_Problems-Allowing_Access_audit2allow">7.3.8. Toegang toestaan: audit2allow</h3></div></div></div><div class="para">
Gebruik het voorbeeld in deze paragraaf niet in een productieomgeving. Het wordt alleen gebruikt om het gebruik van <code class="command">audit2allow</code> te laten zien.
</div><div class="para">
Uit de <span class="citerefentry"><span class="refentrytitle">audit2allow</span>(1)</span> manual pagina: "<code class="command">audit2allow</code> - maak SELinux tactiek toelatingsregels van de logs van geweigerde operaties"<sup>[<a id="d0e6515" href="#ftn.d0e6515" class="footnote">19</a>]</sup>. Na het onderzoeken van weigeren zoals in <a class="xref" href="#sect-Security-Enhanced_Linux-Fixing_Problems-sealert_Messages" title="7.3.7. sealert boodschappen">Paragraaf 7.3.7, “sealert boodschappen”</a>, en als label veranderingen of Booleans aanzetten geen toegang toestaan, gebruik je <code class="command">audit2allow</code> om een locale tactiek module te maken. Nadat toegang geweigerd is door SELinux, presenteert het draaien van het <code class="command">audit2allow</code> commando Type Enforcement regels die de hiervoor geweigerde toegang toestaan.
</div><div class="para">
Het volgende voorbeeld laat het gebruik van <code class="command">audit2allow</code> zien om een tactiek module te maken:
</div><div class="orderedlist"><ol><li><div class="para">
Een weigering en de bijbehorende systeem aanroep zijn gelogd naar <code class="filename">/var/log/audit/audit.log</code>:
</div><pre class="screen">type=AVC msg=audit(1226270358.848:238): avc: denied { write } for pid=13349 comm="certwatch" name="cache" dev=dm-0 ino=218171 scontext=system_u:system_r:certwatch_t:s0 tcontext=system_u:object_r:var_t:s0 tclass=dir
type=SYSCALL msg=audit(1226270358.848:238): arch=40000003 syscall=39 success=no exit=-13 a0=39a2bf a1=3ff a2=3a0354 a3=94703c8 items=0 ppid=13344 pid=13349 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm="certwatch" exe="/usr/bin/certwatch" subj=system_u:system_r:certwatch_t:s0 key=(null)
</pre><div class="para">
In dit voorbeeld was <span class="application"><strong>certwatch</strong></span> (<code class="computeroutput">comm="certwatch"</code>) schrijf toegang (<code class="computeroutput">{ write }</code>) geweigerd naar een map gelabeld met het <code class="computeroutput">var_t</code> type (<code class="computeroutput">tcontext=system_u:object_r:var_t:s0</code>). Analyseer de weigering zoals in <a class="xref" href="#sect-Security-Enhanced_Linux-Fixing_Problems-sealert_Messages" title="7.3.7. sealert boodschappen">Paragraaf 7.3.7, “sealert boodschappen”</a>. Als label veranderingen of Booleans aanzetten, geen toegang toestaan, gebruik je <code class="command">audit2allow</code> om een locale tactiek module te maken.
</div></li><li><div class="para">
Met een gelogde weigering, zoals de <code class="computeroutput">certwatch</code> weigering in stap 1, voer je het <code class="command">audit2allow -w -a</code> commando uit om een leesbare beschrijving te maken van de reden van de weigering. De <code class="option">-a</code> optie zorgt ervoor dat alle logs gelezen worden. De <code class="option">-w</code> optie produceert een leesbare beschrijving. Het <code class="command">audit2allow</code> programma neemt toegang tot <code class="filename">/var/log/audit/audit.log</code>, en moet daarom uitgevoerd worden als de Linux root gebruiker:
</div><pre class="screen"># audit2allow -w -a
type=AVC msg=audit(1226270358.848:238): avc: denied { write } for pid=13349 comm="certwatch" name="cache" dev=dm-0 ino=218171 scontext=system_u:system_r:certwatch_t:s0 tcontext=system_u:object_r:var_t:s0 tclass=dir
Was caused by:
Missing type enforcement (TE) allow rule.
You can use audit2allow to generate a loadable module to allow this access.
</pre><div class="para">
Zoals getoond was toegang geweigerd door een ontbrekende Type Enforcement regel.
</div></li><li><div class="para">
Voer het <code class="command">audit2allow -a</code> commando uit om de Type Enforcement regel te bekijken toe de geweigerde toegang toestaat:
</div><pre class="screen"># audit2allow -a
#============= certwatch_t ==============
allow certwatch_t var_t:dir write;
</pre><div class="important"><h2>Belangrijk</h2><div class="para">
Ontbrekende Type Enforcement regels worden gewoonlijk veroorzaakt door fouten in SELinux tactiek, en moeten gemeld worden in <a href="https://bugzilla.redhat.com/">Red Hat Bugzilla</a>. Voor Fedora, maak je een foutrapport voor het <code class="computeroutput">Fedora</code> product, en je selecteert de <code class="computeroutput">selinux-policy</code> component. Voeg de output van de <code class="command">audit2allow -w -a</code> en <code class="command">audit2allow -a</code> commando's toe in zo'n foutrapport.
</div></div></li><li><div class="para">
Om de regel te gebruiken die <code class="command">audit2allow -a</code> liet zien, voer je het <code class="command">audit2allow -a -M <em class="replaceable"><code>mycertwatch</code></em></code> commando uit als de Linux root gebruiker om de aangepaste module te maken. De <code class="option">-M</code> optie maakt een Type Enforcement bestand (<code class="filename">.te</code>) met de naam opgegeven met de <code class="option">-M</code> in je huidige werkmap:
</div><pre class="screen"># audit2allow -a -M mycertwatch
******************** IMPORTANT ***********************
To make this policy package active, execute:
semodule -i mycertwatch.pp
# ls
mycertwatch.pp mycertwatch.te
</pre><div class="para">
<code class="command">audit2allow</code> compileert de Type Enforcement regel ook naar een tactiek pakket (<code class="filename">.pp</code>). Om de module te installeren, voer je het <code class="command">/usr/sbin/semodule -i <em class="replaceable"><code>mycertwatch.pp</code></em></code> commando uit als de Linux root gebruiker.
</div><div class="important"><h2>Belangrijk</h2><div class="para">
Modules gemaakt met <code class="command">audit2allow</code> kunnen meer toegang toestaan dan nodig is. Het wordt aanbevolen dat tactiek die gemaakt is met <code class="command">audit2allow</code> voor bespreking opgestuurd wordt naar een SELinux lijst, zoals <a href="http://www.redhat.com/mailman/listinfo/fedora-selinux-list">fedora-selinux-list</a>. Als je denkt dat er een fout is in de tactiek, maak dat een foutrapport aan in <a href="https://bugzilla.redhat.com/">Red Hat Bugzilla</a>.
</div></div></li></ol></div><div class="para">
Als je meerdere weigeringen hebt van verschillende processen, maar je wilt alleen een aangepaste tactiek maken voor een enkel proces, gebruik je het <code class="command">grep</code> commando om de input voor <code class="command">audit2allow</code> te versmallen. Het volgende voorbeeld laat het gebruik van <code class="command">grep</code> zien om alleen weigeringen te versturen naar <code class="command">audit2allow</code> die gerelateerd zijn aan <code class="command">certwatch</code>:
</div><pre class="screen"># grep certwatch /var/log/audit/audit.log | audit2allow -M mycertwatch2
******************** IMPORTANT ***********************
To make this policy package active, execute:
# /usr/sbin/semodule -i mycertwatch2.pp
</pre><div class="para">
Refereer naar de blog van Dan Walsh <a href="http://danwalsh.livejournal.com/24750.html">"Using audit2allow to build policy modules. Revisited."</a> voor meer informatie over het gebruik van <code class="command">audit2allow</code> om tactiek modules te maken.
</div></div></div><div class="footnotes"><br/><hr width="100" align="left"/><div class="footnote"><p><sup>[<a id="ftn.d0e5351" href="#d0e5351" class="para">14</a>] </sup>
Bestanden in<code class="filename">/etc/selinux/targeted/contexts/files/</code> definieren context voor bestanden en mappen. Bestanden in deze map worden gelezen door <code class="command">restorecon</code> en <code class="command">setfiles</code> om de standaard context van bestanden en mappen te herstellen.
</p></div><div class="footnote"><p><sup>[<a id="ftn.d0e5513" href="#d0e5513" class="para">15</a>] </sup>
Het <code class="command">semanage port -a</code> commando voegt een regle toe aan het <code class="filename">/etc/selinux/targeted/modules/active/ports.local</code> bestand. merk op: standaard kan dit bestand alleen bekeken worden door de Linux root gebruiker.
</p></div><div class="footnote"><p><sup>[<a id="ftn.d0e5962" href="#d0e5962" class="para">16</a>] </sup>
Van de <span class="citerefentry"><span class="refentrytitle">ausearch</span>(8)</span> manual pagina, zoals verstuurd met het <span class="package">audit</span> pakket in Fedora 11.
</p></div><div class="footnote"><p><sup>[<a id="ftn.d0e6014" href="#d0e6014" class="para">17</a>] </sup>
Van de <span class="citerefentry"><span class="refentrytitle">ausearch</span>(8)</span> manual pagina, zoals verstuurd met het <span class="package">audit</span> pakket in Fedora 11.
</p></div><div class="footnote"><p><sup>[<a id="ftn.d0e6074" href="#d0e6074" class="para">18</a>] </sup>
Uit de <span class="citerefentry"><span class="refentrytitle">aureport</span>(8)</span> manual pagina, zoals verstuurd met het <span class="package">audit</span> pakket in Fedora 11.
</p></div><div class="footnote"><p><sup>[<a id="ftn.d0e6515" href="#d0e6515" class="para">19</a>] </sup>
Uit de <span class="citerefentry"><span class="refentrytitle">audit2allow</span>(1)</span> manual pagina, zoals verstuurd met het <span class="package">policycoreutils</span> pakket in Fedora 11.
</p></div></div></div><div class="chapter" lang="nl-NL"><div class="titlepage"><div><div><h2 class="title" id="chap-Security-Enhanced_Linux-Further_Information">Hoofdstuk 8. Verdere informatie</h2></div></div></div><div class="toc"><dl><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Further_Information-Contributors">8.1. Contributors</a></span></dt><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Further_Information-Other_Resources">8.2. Other Resources</a></span></dt></dl></div><div class="section" lang="nl-NL"><div class="titlepage"><div><div><h2 class="title" id="sect-Security-Enhanced_Linux-Further_Information-Contributors">8.1. Contributors</h2></div></div></div><div class="itemizedlist"><ul><li><div class="para">
<a href="http://fedoraproject.org/wiki/GeertWarrink">Geert Warrink</a> (translation - Dutch)
</div></li><li><div class="para">
<a href="http://fedoraproject.org/wiki/User:Beckerde">Domingo Becker</a> (translation - Spanish)
</div></li><li><div class="para">
<a href="http://fedoraproject.org/wiki/User:Logan">Daniel Cabrera</a> (translation - Spanish)
</div></li></ul></div></div><div class="section" lang="nl-NL"><div class="titlepage"><div><div><h2 class="title" id="sect-Security-Enhanced_Linux-Further_Information-Other_Resources">8.2. Other Resources</h2></div></div></div><div class="formalpara"><h5 class="formalpara" id="form-Security-Enhanced_Linux-Further_Information-The_National_Security_Agency_NSA">De National Security Agency (NSA)</h5>
Van de NSA <a href="http://www.nsa.gov/research/selinux/contrib.shtml">Bijdragers aan SELinux</a> pagina:
</div><div class="para">
<span class="emphasis"><em>Onderzoekers in het National Information Assurance Research Laboratory (NIARL) van NSA ontwikkelden en implementeerden flexibele verplichte toegangscontrole in de belangrijkste subsystemen van de Linux kernel en implementeerden de nieuwe operating systeem onderdelen aangeboden door de Flask architectuur, namelijk de beveiligings server en de toegangs vector cache. De NSA onderzoekers pasten de op LSM gebaseerde SELinux aan om opgenomen te worden in Linux 2.6. NSA heeft ook de ontwikkeling geleid van soortgelijke controles voor het X Window systeem (XACE/XSELinux) en voor Xen (XSM/Flask).</em></span>
</div><div class="itemizedlist"><ul><li><div class="para">
Hoofd SELinux website: <a href="http://www.nsa.gov/research/selinux/index.shtml">http://www.nsa.gov/research/selinux/index.shtml</a>.
</div></li><li><div class="para">
SELinux documentatie: <a href="http://www.nsa.gov/research/selinux/docs.shtml">http://www.nsa.gov/research/selinux/docs.shtml</a>.
</div></li><li><div class="para">
SELinux achtergrond: <a href="http://www.nsa.gov/research/selinux/background.shtml">http://www.nsa.gov/research/selinux/background.shtml</a>.
</div></li></ul></div><div class="formalpara"><h5 class="formalpara" id="form-Security-Enhanced_Linux-Further_Information-Tresys_Technology">Tresys Technology</h5>
<a href="http://www.tresys.com/">Tresys Technology</a> is de upstream ontwikkeling voor:
</div><div class="itemizedlist"><ul><li><div class="para">
<a href="http://userspace.selinuxproject.org/trac/">SELinux gebruikersomgeving bibliotheken en gereedschappen</a>.
</div></li><li><div class="para">
<a href="http://oss.tresys.com/projects/refpolicy">SELinux Referentie Tactiek</a>.
</div></li></ul></div><div class="formalpara"><h5 class="formalpara" id="form-Security-Enhanced_Linux-Further_Information-SELinux_News">SELinux News</h5>
<div class="itemizedlist"><ul><li><div class="para">
Nieuws: <a href="http://selinuxnews.org/wp/">http://selinuxnews.org/wp/</a>.
</div></li><li><div class="para">
Planet SELinux (blogs): <a href="http://selinuxnews.org/planet/">http://selinuxnews.org/planet/</a>.
</div></li></ul></div>
</div><div class="formalpara"><h5 class="formalpara" id="form-Security-Enhanced_Linux-Further_Information-SELinux_Project_Wiki">SELinux Project Wiki</h5>
<div class="itemizedlist"><ul><li><div class="para">
Hoofd pagina: <a href="http://selinuxproject.org/page/Main_Page">http://selinuxproject.org/page/Main_Page</a>.
</div></li><li><div class="para">
Gebruikers hulpbronnen, inclusief verwijzingen naar documentatie, maillijsten, websites, en gereedschappen: <a href="http://selinuxproject.org/page/User_Resources">http://selinuxproject.org/page/User_Resources</a>.
</div></li></ul></div>
</div><div class="formalpara"><h5 class="formalpara" id="form-Security-Enhanced_Linux-Further_Information-Red_Hat_Enterprise_Linux">Red Hat Enterprise Linux</h5>
<div class="itemizedlist"><ul><li><div class="para">
De <a href="http://www.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/5.2/html/Deploy...">Red Hat Enterprise Linux Deployment Guide</a> bevat een SELinux <a href="http://www.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/5.2/html/Deploy...">Referenties</a> sectie, die verwijzingen heeft naar SELinux handleidingen, algemene informatie, en de technologie achter SELinux.
</div></li><li><div class="para">
De <a href="http://www.redhat.com/docs/manuals/enterprise/RHEL-4-Manual/selinux-guide...">Red Hat Enterprise Linux 4 SELinux Guide</a>.
</div></li></ul></div>
</div><div class="formalpara"><h5 class="formalpara" id="form-Security-Enhanced_Linux-Further_Information-Fedora">Fedora</h5>
<div class="itemizedlist"><ul><li><div class="para">
Hoofd pagina: <a href="http://fedoraproject.org/wiki/SELinux">http://fedoraproject.org/wiki/SELinux</a>.
</div></li><li><div class="para">
Foutoplossen: <a href="http://fedoraproject.org/wiki/SELinux/Troubleshooting">http://fedoraproject.org/wiki/SELinux/Troubleshooting</a>.
</div></li><li><div class="para">
Fedora Core 5 SELinux FAQ: <a href="http://docs.fedoraproject.org/selinux-faq-fc5/">http://docs.fedoraproject.org/selinux-faq-fc5/</a>.
</div></li></ul></div>
</div><div class="formalpara"><h5 class="formalpara" id="form-Security-Enhanced_Linux-Further_Information-The_UnOfficial_SELinux_FAQ">De officieuze SELinux FAQ</h5>
<a href="http://www.crypt.gen.nz/selinux/faq.html">http://www.crypt.gen.nz/selinux/faq.html</a>
</div><div class="formalpara"><h5 class="formalpara" id="form-Security-Enhanced_Linux-Further_Information-IRC">IRC</h5>
Op <a href="http://freenode.net/">Freenode</a>:
</div><div class="itemizedlist"><ul><li><div class="para">
#selinux
</div></li><li><div class="para">
#fedora-selinux
</div></li></ul></div></div></div><div class="appendix" lang="nl-NL"><div class="titlepage"><div><div><h1 id="appe-Security-Enhanced_Linux-Revision_History" class="title">Revision History</h1></div></div></div><div class="para">
<div class="revhistory"><table border="0" width="100%" summary="Revision history"><tr><th align="left" valign="top" colspan="3"><b>Wijzigingen</b></th></tr><tr><td align="left">Herziening 1.3</td><td align="left">Tue May 12 2009</td><td align="left"><span class="author"><span class="firstname">Scott</span> <span class="surname">Radvan</span></span></td></tr><tr><td align="left" colspan="3">
<table class="simplelist" border="0" summary="Simple list"><tr><td>Heziening voor Fedora 11</td></tr></table>
</td></tr><tr><td align="left">Herziening 1.2</td><td align="left">Mon Jan 19 2009</td><td align="left"><span class="author"><span class="firstname">Murray</span> <span class="surname">McAllister</span></span></td></tr><tr><td align="left" colspan="3">
<table class="simplelist" border="0" summary="Simple list"><tr><td>Hyperlinks naar NSA websites vernieuwt</td></tr></table>
</td></tr><tr><td align="left">Herziening 1.1</td><td align="left">Sat Dec 6 2008</td><td align="left"><span class="author"><span class="firstname">Murray</span> <span class="surname">McAllister</span></span></td></tr><tr><td align="left" colspan="3">
<table class="simplelist" border="0" summary="Simple list"><tr><td><a href="https://bugzilla.redhat.com/show_bug.cgi?id=472986">Red Hat Bugzilla #472986, "httpd does not write to /etc/httpd/logs/"</a> opgelost</td></tr><tr><td>Paragraaf toegevoegd: "6.6. Booleans for Users Executing Applications"</td></tr><tr><td>Kleine tekst veranderingen</td></tr></table>
</td></tr><tr><td align="left">Herziening 1.0</td><td align="left">Tue Nov 25 2008</td><td align="left"><span class="author"><span class="firstname">Murray</span> <span class="surname">McAllister</span></span></td></tr><tr><td align="left" colspan="3">
<table class="simplelist" border="0" summary="Simple list"><tr><td>Eerste inhoud vrijgave op <a href="http://docs.fedoraproject.org/">http://docs.fedoraproject.org/</a></td></tr></table>
</td></tr></table></div>
</div></div></div></body></html>
14 years, 10 months
web/html/docs/selinux-user-guide/f11/nl-NL/html appe-Security-Enhanced_Linux-Revision_History.html, NONE, 1.1 chap-Security-Enhanced_Linux-Confining_Users.html, NONE, 1.1 chap-Security-Enhanced_Linux-Further_Information.html, NONE, 1.1 chap-Security-Enhanced_Linux-Introduction.html, NONE, 1.1 chap-Security-Enhanced_Linux-SELinux_Contexts.html, NONE, 1.1 chap-Security-Enhanced_Linux-Targeted_Policy.html, NONE, 1.1 chap-Security-Enhanced_Linux-Trademark_Information.html, NONE, 1.1 chap-Security-Enhanced_Linux
by Eric Christensen
Author: sparks
Update of /cvs/fedora/web/html/docs/selinux-user-guide/f11/nl-NL/html
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv3318
Added Files:
appe-Security-Enhanced_Linux-Revision_History.html
chap-Security-Enhanced_Linux-Confining_Users.html
chap-Security-Enhanced_Linux-Further_Information.html
chap-Security-Enhanced_Linux-Introduction.html
chap-Security-Enhanced_Linux-SELinux_Contexts.html
chap-Security-Enhanced_Linux-Targeted_Policy.html
chap-Security-Enhanced_Linux-Trademark_Information.html
chap-Security-Enhanced_Linux-Troubleshooting.html
chap-Security-Enhanced_Linux-Working_with_SELinux.html
index.html pr01s02.html
pref-Security-Enhanced_Linux-Preface.html
sect-Security-Enhanced_Linux-Booleans-Booleans_for_NFS_and_CIFS.html
sect-Security-Enhanced_Linux-Booleans-Configuring_Booleans.html
sect-Security-Enhanced_Linux-Confining_Users-Booleans_for_Users_Executing_Applications.html
sect-Security-Enhanced_Linux-Confining_Users-Changing_the_Default_Mapping.html
sect-Security-Enhanced_Linux-Confining_Users-Confining_Existing_Linux_Users_semanage_login.html
sect-Security-Enhanced_Linux-Confining_Users-Confining_New_Linux_Users_useradd.html
sect-Security-Enhanced_Linux-Confining_Users-xguest_Kiosk_Mode.html
sect-Security-Enhanced_Linux-Enabling_and_Disabling_SELinux-Disabling_SELinux.html
sect-Security-Enhanced_Linux-Fixing_Problems-Allowing_Access_audit2allow.html
sect-Security-Enhanced_Linux-Fixing_Problems-Manual_Pages_for_Services.html
sect-Security-Enhanced_Linux-Fixing_Problems-Permissive_Domains.html
sect-Security-Enhanced_Linux-Fixing_Problems-Possible_Causes_of_Silent_Denials.html
sect-Security-Enhanced_Linux-Fixing_Problems-Raw_Audit_Messages.html
sect-Security-Enhanced_Linux-Fixing_Problems-sealert_Messages.html
sect-Security-Enhanced_Linux-Fixing_Problems-Searching_For_and_Viewing_Denials.html
sect-Security-Enhanced_Linux-Further_Information-Other_Resources.html
sect-Security-Enhanced_Linux-Introduction-Examples.html
sect-Security-Enhanced_Linux-Introduction-SELinux_Architecture.html
sect-Security-Enhanced_Linux-Introduction-SELinux_on_Other_Operating_Systems.html
sect-Security-Enhanced_Linux-Maintaining_SELinux_Labels_-Archiving_Files_with_star.html
sect-Security-Enhanced_Linux-Maintaining_SELinux_Labels_-Archiving_Files_with_tar.html
sect-Security-Enhanced_Linux-Maintaining_SELinux_Labels_-Checking_the_Default_SELinux_Context.html
sect-Security-Enhanced_Linux-Maintaining_SELinux_Labels_-Moving_Files_and_Directories.html
sect-Security-Enhanced_Linux-Mounting_File_Systems-Changing_the_Default_Context.html
sect-Security-Enhanced_Linux-Mounting_File_Systems-Making_Context_Mounts_Persistent.html
sect-Security-Enhanced_Linux-Mounting_File_Systems-Mounting_an_NFS_File_System.html
sect-Security-Enhanced_Linux-Mounting_File_Systems-Multiple_NFS_Mounts.html
sect-Security-Enhanced_Linux-Permissive_Domains-Denials_for_Permissive_Domains.html
sect-Security-Enhanced_Linux-SELinux_Contexts_Labeling_Files-Persistent_Changes_semanage_fcontext.html
sect-Security-Enhanced_Linux-SELinux_Contexts-SELinux_Contexts_for_Processes.html
sect-Security-Enhanced_Linux-SELinux_Contexts-SELinux_Contexts_for_Users.html
sect-Security-Enhanced_Linux-Targeted_Policy-Confined_and_Unconfined_Users.html
sect-Security-Enhanced_Linux-Targeted_Policy-Unconfined_Processes.html
sect-Security-Enhanced_Linux-Top_Three_Causes_of_Problems-Evolving_Rules_and_Broken_Applications.html
sect-Security-Enhanced_Linux-Top_Three_Causes_of_Problems-How_are_Confined_Services_Running.html
sect-Security-Enhanced_Linux-Troubleshooting-Fixing_Problems.html
sect-Security-Enhanced_Linux-Troubleshooting-Top_Three_Causes_of_Problems.html
sect-Security-Enhanced_Linux-Working_with_SELinux-Booleans.html
sect-Security-Enhanced_Linux-Working_with_SELinux-Enabling_and_Disabling_SELinux.html
sect-Security-Enhanced_Linux-Working_with_SELinux-Main_Configuration_File.html
sect-Security-Enhanced_Linux-Working_with_SELinux-Maintaining_SELinux_Labels_.html
sect-Security-Enhanced_Linux-Working_with_SELinux-Mounting_File_Systems.html
sect-Security-Enhanced_Linux-Working_with_SELinux-SELinux_Contexts_Labeling_Files.html
sect-Security-Enhanced_Linux-Working_with_SELinux-SELinux_Modes.html
sect-Security-Enhanced_Linux-Working_with_SELinux-The_file_t_and_default_t_Types.html
sect-Security-Enhanced_Linux-Working_with_SELinux-Which_Log_File_is_Used.html
Log Message:
Adding nl-NL html files.
--- NEW FILE appe-Security-Enhanced_Linux-Revision_History.html ---
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Bijlage A. Revision History</title><link rel="stylesheet" href="./Common_Content/css/default.css" type="text/css"/><meta name="generator" content="publican"/><meta name="package" content="Fedora-Security-Enhanced_Linux-11-nl-NL-1.3-SELinux_User_guide"/><link rel="home" href="index.html" title="Security-Enhanced Linux"/><link rel="up" href="index.html" title="Security-Enhanced Linux"/><link rel="prev" href="sect-Security-Enhanced_Linux-Further_Information-Other_Resources.html" title="8.2. Other Resources"/></head><body class=""><p id="title"><a class="left" href="http://www.fedoraproject.org"><img src="Common_Content/images/image_left.png" alt="Product Site"/></a><a class="right" href="http://docs.fedoraproject.org"><img src="Common_Content/images/image_right.png" alt="Documentation Site"/></a></p><ul class="docnav"><li class="previous"><a accesskey="p" href="sect-Security-Enhanced_Linux-Further_Information-Other_Resource
s.html"><strong>Terug</strong></a></li><li class="next"/></ul><div class="appendix" lang="nl-NL"><div class="titlepage"><div><div><h1 id="appe-Security-Enhanced_Linux-Revision_History" class="title">Revision History</h1></div></div></div><div class="para">
<div class="revhistory"><table border="0" width="100%" summary="Revision history"><tr><th align="left" valign="top" colspan="3"><b>Wijzigingen</b></th></tr><tr><td align="left">Herziening 1.3</td><td align="left">Tue May 12 2009</td><td align="left"><span class="author"><span class="firstname">Scott</span> <span class="surname">Radvan</span></span></td></tr><tr><td align="left" colspan="3">
<table class="simplelist" border="0" summary="Simple list"><tr><td>Heziening voor Fedora 11</td></tr></table>
</td></tr><tr><td align="left">Herziening 1.2</td><td align="left">Mon Jan 19 2009</td><td align="left"><span class="author"><span class="firstname">Murray</span> <span class="surname">McAllister</span></span></td></tr><tr><td align="left" colspan="3">
<table class="simplelist" border="0" summary="Simple list"><tr><td>Hyperlinks naar NSA websites vernieuwt</td></tr></table>
</td></tr><tr><td align="left">Herziening 1.1</td><td align="left">Sat Dec 6 2008</td><td align="left"><span class="author"><span class="firstname">Murray</span> <span class="surname">McAllister</span></span></td></tr><tr><td align="left" colspan="3">
<table class="simplelist" border="0" summary="Simple list"><tr><td><a href="https://bugzilla.redhat.com/show_bug.cgi?id=472986">Red Hat Bugzilla #472986, "httpd does not write to /etc/httpd/logs/"</a> opgelost</td></tr><tr><td>Paragraaf toegevoegd: "6.6. Booleans for Users Executing Applications"</td></tr><tr><td>Kleine tekst veranderingen</td></tr></table>
</td></tr><tr><td align="left">Herziening 1.0</td><td align="left">Tue Nov 25 2008</td><td align="left"><span class="author"><span class="firstname">Murray</span> <span class="surname">McAllister</span></span></td></tr><tr><td align="left" colspan="3">
<table class="simplelist" border="0" summary="Simple list"><tr><td>Eerste inhoud vrijgave op <a href="http://docs.fedoraproject.org/">http://docs.fedoraproject.org/</a></td></tr></table>
</td></tr></table></div>
</div></div><ul class="docnav"><li class="previous"><a accesskey="p" href="sect-Security-Enhanced_Linux-Further_Information-Other_Resources.html"><strong>Terug</strong>8.2. Other Resources</a></li><li class="up"><a accesskey="u" href="#"><strong>Omhoog</strong></a></li><li class="home"><a accesskey="h" href="index.html"><strong>Begin</strong></a></li></ul></body></html>
--- NEW FILE chap-Security-Enhanced_Linux-Confining_Users.html ---
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Hoofdstuk 6. Gebruikers beperken</title><link rel="stylesheet" href="./Common_Content/css/default.css" type="text/css"/><meta name="generator" content="publican"/><meta name="package" content="Fedora-Security-Enhanced_Linux-11-nl-NL-1.3-SELinux_User_guide"/><link rel="home" href="index.html" title="Security-Enhanced Linux"/><link rel="up" href="index.html" title="Security-Enhanced Linux"/><link rel="prev" href="sect-Security-Enhanced_Linux-Maintaining_SELinux_Labels_-Archiving_Files_with_star.html" title="5.10.5. Bestanden archiveren met star"/><link rel="next" href="sect-Security-Enhanced_Linux-Confining_Users-Confining_New_Linux_Users_useradd.html" title="6.2. Nieuwe Linux gebruikers beperken: useradd"/></head><body class=""><p id="title"><a class="left" href="http://www.fedoraproject.org"><img src="Common_Content/images/image_left.png" alt="Product Site"/></a><a class="right" href="http://docs.fedoraproject.org"><img
src="Common_Content/images/image_right.png" alt="Documentation Site"/></a></p><ul class="docnav"><li class="previous"><a accesskey="p" href="sect-Security-Enhanced_Linux-Maintaining_SELinux_Labels_-Archiving_Files_with_star.html"><strong>Terug</strong></a></li><li class="next"><a accesskey="n" href="sect-Security-Enhanced_Linux-Confining_Users-Confining_New_Linux_Users_useradd.html"><strong>Volgende</strong></a></li></ul><div class="chapter" lang="nl-NL"><div class="titlepage"><div><div><h2 class="title" id="chap-Security-Enhanced_Linux-Confining_Users">Hoofdstuk 6. Gebruikers beperken</h2></div></div></div><div class="toc"><dl><dt><span class="section"><a href="chap-Security-Enhanced_Linux-Confining_Users.html#sect-Security-Enhanced_Linux-Confining_Users-Linux_and_SELinux_User_Mappings">6.1. Linix en SELinux gebruiker afbeelding</a></span></dt><dt><span class="section"><a href="sect-Security-Enhanced_Linux-Confining_Users-Confining_New_Linux_Users_useradd.html">6.2. Nieuwe
Linux gebruikers beperken: useradd</a></span></dt><dt><span class="section"><a href="sect-Security-Enhanced_Linux-Confining_Users-Confining_Existing_Linux_Users_semanage_login.html">6.3. Bestaande Linux gebruikers beperken: semanage login</a></span></dt><dt><span class="section"><a href="sect-Security-Enhanced_Linux-Confining_Users-Changing_the_Default_Mapping.html">6.4. De standaard afbeelbing veranderen</a></span></dt><dt><span class="section"><a href="sect-Security-Enhanced_Linux-Confining_Users-xguest_Kiosk_Mode.html">6.5. xguest: kiosk modus</a></span></dt><dt><span class="section"><a href="sect-Security-Enhanced_Linux-Confining_Users-Booleans_for_Users_Executing_Applications.html">6.6. Booleans voor gebruikers die toepassingen uitvoeren</a></span></dt></dl></div><div class="para">
Een aantal beperkte SELinux gebruikers zijn beschikbaar in Fedora 11. Elke Linux gebruiker wordt afgebeeld op een SELinux gebruiker met SELinux tactiek, wat Linux gebruikers de beperkingen van SELinux gebruikers laat erven, bijvoorbeeld (afhankelijk van de gebruiker), het niet in staat zijn om: het X Window systeem te draaien, het netwerk te gebruiken, setuid toepassingen draaien (tenzij SELinux tactiek dit toestaat), of de <code class="command">su</code> en <code class="command">sudo</code> commando's uit te voeren om de Linux root gebruiker te worden. Dit helpt om het systeem te beschermen tegen de gebruiker. Refereer naar <a class="xref" href="sect-Security-Enhanced_Linux-Targeted_Policy-Confined_and_Unconfined_Users.html" title="4.3. Beperkte en onbeperkte gebruikers">Paragraaf 4.3, “Beperkte en onbeperkte gebruikers”</a> voor meer informatie over beperkte gebruikers in Fedora 11.
</div><div class="section" lang="nl-NL"><div class="titlepage"><div><div><h2 class="title" id="sect-Security-Enhanced_Linux-Confining_Users-Linux_and_SELinux_User_Mappings">6.1. Linix en SELinux gebruiker afbeelding</h2></div></div></div><div class="para">
Als de Linux root gebruiker, voer je het <code class="command">semanage login -l</code> commando uit om de afbeelding van Linux gebruikers op SELinux gebruikers te zien:
</div><pre class="screen"># /usr/sbin/semanage login -l
Login Name SELinux User MLS/MCS Range
__default__ unconfined_u s0-s0:c0.c1023
root unconfined_u s0-s0:c0.c1023
system_u system_u s0-s0:c0.c1023
</pre><div class="para">
In Fedora 11 worden Linux gebruikers standaard afgebeeld op de SELinux <code class="computeroutput">__default__</code> (welke is afgebeeld op de SELinux <code class="computeroutput">unconfined_u</code> gebruiker). Als een Linux gebruiker wordt aangemaakt met het <code class="command">useradd</code> commando, worden ze afgebeeld op de SELinux <code class="computeroutput">unconfined_u</code> gebruiker indien er geen opties zijn opgegeven. Het volgende definieert de standaard afbeelding:
</div><pre class="screen">__default__ unconfined_u s0-s0:c0.c1023
</pre></div></div><ul class="docnav"><li class="previous"><a accesskey="p" href="sect-Security-Enhanced_Linux-Maintaining_SELinux_Labels_-Archiving_Files_with_star.html"><strong>Terug</strong>5.10.5. Bestanden archiveren met star</a></li><li class="up"><a accesskey="u" href="#"><strong>Omhoog</strong></a></li><li class="home"><a accesskey="h" href="index.html"><strong>Begin</strong></a></li><li class="next"><a accesskey="n" href="sect-Security-Enhanced_Linux-Confining_Users-Confining_New_Linux_Users_useradd.html"><strong>Volgende</strong>6.2. Nieuwe Linux gebruikers beperken: useradd</a></li></ul></body></html>
--- NEW FILE chap-Security-Enhanced_Linux-Further_Information.html ---
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Hoofdstuk 8. Verdere informatie</title><link rel="stylesheet" href="./Common_Content/css/default.css" type="text/css"/><meta name="generator" content="publican"/><meta name="package" content="Fedora-Security-Enhanced_Linux-11-nl-NL-1.3-SELinux_User_guide"/><link rel="home" href="index.html" title="Security-Enhanced Linux"/><link rel="up" href="index.html" title="Security-Enhanced Linux"/><link rel="prev" href="sect-Security-Enhanced_Linux-Fixing_Problems-Allowing_Access_audit2allow.html" title="7.3.8. Toegang toestaan: audit2allow"/><link rel="next" href="sect-Security-Enhanced_Linux-Further_Information-Other_Resources.html" title="8.2. Other Resources"/></head><body class=""><p id="title"><a class="left" href="http://www.fedoraproject.org"><img src="Common_Content/images/image_left.png" alt="Product Site"/></a><a class="right" href="http://docs.fedoraproject.org"><img src="Common_Content/images/image_right.png" alt="Doc
umentation Site"/></a></p><ul class="docnav"><li class="previous"><a accesskey="p" href="sect-Security-Enhanced_Linux-Fixing_Problems-Allowing_Access_audit2allow.html"><strong>Terug</strong></a></li><li class="next"><a accesskey="n" href="sect-Security-Enhanced_Linux-Further_Information-Other_Resources.html"><strong>Volgende</strong></a></li></ul><div class="chapter" lang="nl-NL"><div class="titlepage"><div><div><h2 class="title" id="chap-Security-Enhanced_Linux-Further_Information">Hoofdstuk 8. Verdere informatie</h2></div></div></div><div class="toc"><dl><dt><span class="section"><a href="chap-Security-Enhanced_Linux-Further_Information.html#sect-Security-Enhanced_Linux-Further_Information-Contributors">8.1. Contributors</a></span></dt><dt><span class="section"><a href="sect-Security-Enhanced_Linux-Further_Information-Other_Resources.html">8.2. Other Resources</a></span></dt></dl></div><div class="section" lang="nl-NL"><div class="titlepage"><div><div><h2 class="title" id=
"sect-Security-Enhanced_Linux-Further_Information-Contributors">8.1. Contributors</h2></div></div></div><div class="itemizedlist"><ul><li><div class="para">
<a href="http://fedoraproject.org/wiki/GeertWarrink">Geert Warrink</a> (translation - Dutch)
</div></li><li><div class="para">
<a href="http://fedoraproject.org/wiki/User:Beckerde">Domingo Becker</a> (translation - Spanish)
</div></li><li><div class="para">
<a href="http://fedoraproject.org/wiki/User:Logan">Daniel Cabrera</a> (translation - Spanish)
</div></li></ul></div></div></div><ul class="docnav"><li class="previous"><a accesskey="p" href="sect-Security-Enhanced_Linux-Fixing_Problems-Allowing_Access_audit2allow.html"><strong>Terug</strong>7.3.8. Toegang toestaan: audit2allow</a></li><li class="up"><a accesskey="u" href="#"><strong>Omhoog</strong></a></li><li class="home"><a accesskey="h" href="index.html"><strong>Begin</strong></a></li><li class="next"><a accesskey="n" href="sect-Security-Enhanced_Linux-Further_Information-Other_Resources.html"><strong>Volgende</strong>8.2. Other Resources</a></li></ul></body></html>
--- NEW FILE chap-Security-Enhanced_Linux-Introduction.html ---
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Hoofdstuk 2. Inleiding</title><link rel="stylesheet" href="./Common_Content/css/default.css" type="text/css"/><meta name="generator" content="publican"/><meta name="package" content="Fedora-Security-Enhanced_Linux-11-nl-NL-1.3-SELinux_User_guide"/><link rel="home" href="index.html" title="Security-Enhanced Linux"/><link rel="up" href="index.html" title="Security-Enhanced Linux"/><link rel="prev" href="chap-Security-Enhanced_Linux-Trademark_Information.html" title="Hoofdstuk 1. Handelsmerk informatie"/><link rel="next" href="sect-Security-Enhanced_Linux-Introduction-Examples.html" title="2.2. Voorbeelden"/></head><body class=""><p id="title"><a class="left" href="http://www.fedoraproject.org"><img src="Common_Content/images/image_left.png" alt="Product Site"/></a><a class="right" href="http://docs.fedoraproject.org"><img src="Common_Content/images/image_right.png" alt="Documentation Site"/></a></p><ul class="docnav"><li c
lass="previous"><a accesskey="p" href="chap-Security-Enhanced_Linux-Trademark_Information.html"><strong>Terug</strong></a></li><li class="next"><a accesskey="n" href="sect-Security-Enhanced_Linux-Introduction-Examples.html"><strong>Volgende</strong></a></li></ul><div class="chapter" lang="nl-NL"><div class="titlepage"><div><div><h2 class="title" id="chap-Security-Enhanced_Linux-Introduction">Hoofdstuk 2. Inleiding</h2></div></div></div><div class="toc"><dl><dt><span class="section"><a href="chap-Security-Enhanced_Linux-Introduction.html#sect-Security-Enhanced_Linux-Introduction-Benefits_of_running_SELinux">2.1. Voordelen van het draaien van SELinux</a></span></dt><dt><span class="section"><a href="sect-Security-Enhanced_Linux-Introduction-Examples.html">2.2. Voorbeelden</a></span></dt><dt><span class="section"><a href="sect-Security-Enhanced_Linux-Introduction-SELinux_Architecture.html">2.3. SELinux architectuur</a></span></dt><dt><span class="section"><a href="sect-Security
-Enhanced_Linux-Introduction-SELinux_on_Other_Operating_Systems.html">2.4. SELinux in andere operating systemen</a></span></dt></dl></div><div class="para">
Bestanden, zoals mappen en apparaten, worden objecten genoemd. Processen, zoals een gebruiker die een commando draait of de <span class="trademark">Mozilla</span>®<span class="trademark"> Firefox</span>® toepassing worden subjecten genoemd. De meeste operating systemen gebruiken een Discretionary Access Control (DAC) (toegangscontrole naar goeddunken) systeem dat controleert hoe subjecten omgaan met objecten en hoe subjecten omgaan met elkaar. In operating systemen die DAC gebruiken, controleren gebruikers de toegangsrechten van bestanden (objecten) waarvan zij eigenaar zijn. Bijvoorbeeld, in <span class="trademark">Linux</span>® operating systemen, kunnen gebruikers hun persoonlijke mappen leesbaar voor de wereld maken, en kunnen zij gebruikers en processen (subjects) toegang geven tot potentieel gevoelige informatie.
</div><div class="para">
DAC mechanismes zijn fundamenteel onvoldoende voor een sterke systeem beveiliging. DAC toegangsbeslissingen zijn alleen gebaseerd op gebruikers identiteit en eigendom, en negeren andere informatie die relevant is voor beveiliging, zoals de rol van de gebruiker, de functie en betrouwbaarheid van het programma, en de gevoeligheid en integriteit van de data. Elke gebruiker heeft volledige vrijheid over zijn bestanden, wat het onmogelijk maakt om een systeem-brede beveiligings tactiek af te dwingen. Verder erft elk programma dat door een gebruiker gedraaid wordt alle toegangsrechten die aan die gebruiker gegeven zijn en kan het toegang tot de bestanden van de gebruiker veranderen, dus wordt er geen bescherming geboden tegen kwaadwillige software. Veel systeem voorzieningen en bevoorrechte programma's moeten draaien met grof-korrelige voorrechten die hun vereiste ver overschrijden, zodat een mankement in elk van deze programma's benut kan worden om complete systeem toegang te kr
ijgen.<sup>[<a id="d0e488" href="#ftn.d0e488" class="footnote">1</a>]</sup>
</div><div class="para">
Het volgende is een voorbeeld van rechten gebruikt in Linux operating systemen die niet mogelijk zijn in Security-Enhanced Linux (SELinux). De rechten in deze voorbeelden kunnen verschillen van jouw systeem. Gebruik het <code class="command">ls -l</code> commando om de bestandsrechten te zien:
</div><pre class="screen">$ ls -l file1
-rwxrw-r-- 1 user1 group1 0 2009-04-30 15:42 file1
</pre><div class="para">
De eerste drie rechten bits, <code class="computeroutput">rwx</code>, controleren de toegang die de Linux <code class="computeroutput">user1</code> gebruiker (in dit geval de eigenaar) heeft voor <code class="filename">file1</code>. De volgende drie rechten bits, <code class="computeroutput">rw-</code>, controleren de toegang die de Linux <code class="computeroutput">group1</code> groep heeft voor <code class="filename">file1</code>. De laatste drie rechten bits, <code class="computeroutput">r--</code>, controleren de toegang die alle anderen hebben voor <code class="filename">file1</code>, wat alle gebruikers en processen omvat.
</div><div class="para">
Security-Enhanced Linux (SELinux) voegt Mandatory Access Control (MAC) (verplichte toegangs controle) toe aan de Linux kernel, en is standaard aangezet in Fedora. Een MAC architectuur voor algemene doeleinden heeft de mogelijkheid nodig om een door beheerders opgestelde beveiligings tactiek af te dwingen voor alle processen en bestanden op het systeem, waarbij beslissingen gebaseerd worden op labels die een verscheidenheid aan informatie bevatten die voor beveiling relevant is. Als dit correct geimplementeerd is, staat dit een systeem toe zich afdoende te verdedigen en biedt kritische ondersteuning voor beschermning tegen het knoeien met, of het omheen gaan van, beveiligde toepassingen. MAC biedt een sterke scheiding aan voor toepassingen wat het veilig uitvoeren van onbetrouwbare toepassingen toestaat. Zijn mogelijkheid om de rechten van draaiende processen te beperken, beperkt de reikwijdte van potentiele schade die het resultaat kan zijn van de uitbuiting van kwetsbaarhe
den in toepassingen en systeem voorzieningen. MAC staat toe dat informatie beschermd wordt tegen legitieme gebruikers met beperkte toestemming en ook tegen gemachtigde gebruikers die onbedoeld kwaadwillige toepassingen uitvoeren.<sup>[<a id="d0e530" href="#ftn.d0e530" class="footnote">2</a>]</sup>
</div><div class="para">
Het volgende is een voorbeeld van de labels die beveilings-relevantie informatie bevatten die worden gebruikt voor processen, Linux gebruikers, en bestanden in Linux operating systemen die SELinux draaien. Deze informatie wordt de SELinux context genoemd, en kan getoond worden met gebruik van het <code class="command">ls -Z</code> commando:
</div><pre class="screen">$ ls -Z file1
-rwxrw-r-- user1 group1 unconfined_u:object_r:user_home_t:s0 file1
</pre><div class="para">
In dit voorbeeld, biedt SELinux een gebruiker (<code class="computeroutput">unconfined_u</code>), een rol (<code class="computeroutput">object_r</code>), een type (<code class="computeroutput">user_home_t</code>), en een niveau (<code class="computeroutput">s0</code>) aan. Deze informatie wordt gebruikt om toegangscontrole beslissingen te maken. Met DAC kan de toegang alleen maar gecontroleerd worden op basis van de gebruiker en groep ID's. De SELinux tactiekregels worden gecontroleerd na de DAC regels. SELinux tactiekregels worden niet gebruikt als DAC reeds toegang weigert.
</div><div class="formalpara"><h5 class="formalpara" id="form-Security-Enhanced_Linux-Introduction-Linux_and_SELinux_Users">Linux en SELinux gebruikers</h5>
Op Linux operating systemen die SELinux draaien, zijn er zowel Linux gebruikers als SELinux gebruikers. SELinux gebruikers zijn onderdeel van de SELinux tactiek. Linux gebruikers zijn afgebeeld op SELinux gebruikers. Om verwarring te vermijden, gebruikt deze gids "Linux gebruiker" en "SELinux gebruiker" om tussen deze twee verschil te maken.
</div><div class="section" lang="nl-NL"><div class="titlepage"><div><div><h2 class="title" id="sect-Security-Enhanced_Linux-Introduction-Benefits_of_running_SELinux">2.1. Voordelen van het draaien van SELinux</h2></div></div></div><div class="itemizedlist"><ul><li><div class="para">
Alle processen en bestanden zijn gelabeld met een type. Een type definieert het domein voor processen en een type voor bestanden. Processen zijn van elkaar gescheiden door ze ieder in hun eigen domein te draaien, en SELinux tactiekregels bepalen hoe processen omgaan met bestanden, en ook hoe processen omgaan met elkaar. Toegang is alleen toegestaan als er een SELinux tactiekregel bestaat die dat specifiek toestaat.
</div></li><li><div class="para">
Fijn-korrelige toegangs controle. Door verder te gaan dan de traditionele <span class="trademark">UNIX</span>® rechten die gecontroleerd worden door het oordeel van de gebruiker en gebaseerd zijn op Linux gebruiker en groep ID's, zijn SELinux toegangs beslissingen gebaseerd op alle beschikbare informatie, zoals een SELinux gebruiker, rol, type en, optioneel, een niveau.
</div></li><li><div class="para">
SELinux tactiek is gedefinieerd op beheersniveau, wordt systeem-breed afgedwongen, en wordt niet ingesteld door het oordeel van de gebruiker.
</div></li><li><div class="para">
Verminderde gevoeligheid voor rechten escalatie aanvallen. Een voorbeeld: omdat processen in domeinen draaien, en daarom van elkaar gescheiden zijn, en SELinux tactiek regels bepalen hoe processen toegang hebben tot bestanden en andere processen; als dan een proces gecompromitteerd wordt, heeft de aanvaller alleen toegang tot de normale functie van dat proces, en tot bestanden waarvoor het proces ingesteld is om toegang tot te hebben. Bijvoorbeeld, als de Apache HTTP server gecompromitteerd is, kan een aanvaller dat proces niet gebruiken om bestanden te lezen in persoonlijke mappen, behalve als een specifieke SELinux tactiekregel was toegevoegd of ingesteld die deze toegang toestaat.
</div></li><li><div class="para">
SELinux kan gebruikt worden om data vertrouwelijkheid en integriteit af te dwingen, en ook om processen te beschermen voor niet vertrouwde input.
</div></li></ul></div><div class="para">
SELinux is niet:
</div><div class="itemizedlist"><ul><li><div class="para">
antivirus software.
</div></li><li><div class="para">
een vervanging voor wachtwoorden, firewall, of andere beveiligings systemen.
</div></li><li><div class="para">
een alles inbegrepen beveiligings oplossing.
</div></li></ul></div><div class="para">
SELinux is ontworpen om bestaande beveiligings oplossingen te versterken, niet om ze te vervangen. Zelfs als je SELinux draait, ga dan door met het opvolgen van goede beveilings praktijken, zoals de software up-to-date houden, moeilijk te raden wachtwoorden te gebruiken, firewall, enzovoort
</div></div><div class="footnotes"><br/><hr/><div class="footnote"><p><sup>[<a id="ftn.d0e488" href="#d0e488" class="para">1</a>] </sup>
"Integrating Flexible Support for Security Policies into the Linux Operating System", door Peter Loscocco en Stephen Smalley. Dit artikel was oorspronkelijk gemaakt voor de National Security Agency en is dus in het publieke domein. Refereer naar het <a href="http://www.nsa.gov/research/_files/selinux/papers/freenix01/index.shtml">originele artikel</a> voor details en het document zoals het eerst is vrijgegeven. Alle aanpassingen en veranderingen zijn gedaan door Murray McAllister.
</p></div><div class="footnote"><p><sup>[<a id="ftn.d0e530" href="#d0e530" class="para">2</a>] </sup>
"Meeting Critical Security Objectives with Security-Enhanced Linux", door Peter Loscocco en Stephen Smalley. Dit artikel was oorspronkelijk gemaakt voor de National Security Agency en is dus in het publieke domein. Refereer naar het <a href="http://www.nsa.gov/research/_files/selinux/papers/ottawa01/index.shtml">originele artikel</a> voor details en het document zoals het eerst was vrijgegeven. Alle aanpassingen en veranderingen zijn gemaakt door Murray McAllister.
</p></div></div></div><ul class="docnav"><li class="previous"><a accesskey="p" href="chap-Security-Enhanced_Linux-Trademark_Information.html"><strong>Terug</strong>Hoofdstuk 1. Handelsmerk informatie</a></li><li class="up"><a accesskey="u" href="#"><strong>Omhoog</strong></a></li><li class="home"><a accesskey="h" href="index.html"><strong>Begin</strong></a></li><li class="next"><a accesskey="n" href="sect-Security-Enhanced_Linux-Introduction-Examples.html"><strong>Volgende</strong>2.2. Voorbeelden</a></li></ul></body></html>
--- NEW FILE chap-Security-Enhanced_Linux-SELinux_Contexts.html ---
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Hoofdstuk 3. SELinux context</title><link rel="stylesheet" href="./Common_Content/css/default.css" type="text/css"/><meta name="generator" content="publican"/><meta name="package" content="Fedora-Security-Enhanced_Linux-11-nl-NL-1.3-SELinux_User_guide"/><link rel="home" href="index.html" title="Security-Enhanced Linux"/><link rel="up" href="index.html" title="Security-Enhanced Linux"/><link rel="prev" href="sect-Security-Enhanced_Linux-Introduction-SELinux_on_Other_Operating_Systems.html" title="2.4. SELinux in andere operating systemen"/><link rel="next" href="sect-Security-Enhanced_Linux-SELinux_Contexts-SELinux_Contexts_for_Processes.html" title="3.2. SELinux context voor processen"/></head><body class=""><p id="title"><a class="left" href="http://www.fedoraproject.org"><img src="Common_Content/images/image_left.png" alt="Product Site"/></a><a class="right" href="http://docs.fedoraproject.org"><img src="Common_Content
/images/image_right.png" alt="Documentation Site"/></a></p><ul class="docnav"><li class="previous"><a accesskey="p" href="sect-Security-Enhanced_Linux-Introduction-SELinux_on_Other_Operating_Systems.html"><strong>Terug</strong></a></li><li class="next"><a accesskey="n" href="sect-Security-Enhanced_Linux-SELinux_Contexts-SELinux_Contexts_for_Processes.html"><strong>Volgende</strong></a></li></ul><div class="chapter" lang="nl-NL"><div class="titlepage"><div><div><h2 class="title" id="chap-Security-Enhanced_Linux-SELinux_Contexts">Hoofdstuk 3. SELinux context</h2></div></div></div><div class="toc"><dl><dt><span class="section"><a href="chap-Security-Enhanced_Linux-SELinux_Contexts.html#sect-Security-Enhanced_Linux-SELinux_Contexts-Domain_Transitions">3.1. Domein overgangen</a></span></dt><dt><span class="section"><a href="sect-Security-Enhanced_Linux-SELinux_Contexts-SELinux_Contexts_for_Processes.html">3.2. SELinux context voor processen</a></span></dt><dt><span class="section
"><a href="sect-Security-Enhanced_Linux-SELinux_Contexts-SELinux_Contexts_for_Users.html">3.3. SELinux context voor gebruikers</a></span></dt></dl></div><div class="para">
Processen en bestanden worden gelabeld met een SELinux context die extra informatie bevat, zoals een SELinux gebruiker, rol, type, en, optioneel, een niveau. Als SELinux gedraaid wordt, wordt al deze informatie gebruikt om toegangs contole beslissingen te maken. In Fedora 11, biedt SELinux een combinatie van Role-Based Access Contol (RBAC) (toegangscontrole gebaseerd op rol), <span class="trademark">Type Enforcement</span>® (TE) (type afdwinging), en, optioneel, Multi-Level Security (MLS) (multi-niveau beveiliging)
</div><div class="para">
Het volgende is een voorbeeld SELinux context. SELinux context wordt gebruikt voor processen, Linux gebruikers, en bestanden in Linux operating systemen die SELinux draaien. Gebruik het <code class="command">ls -Z</code> commando om de SELinux context van bestanden en mappen te zien:
</div><pre class="screen">$ ls -Z file1
-rwxrw-r-- user1 group1 unconfined_u:object_r:user_home_t:s0 file1
</pre><div class="para">
SELinux context volgt de <span class="emphasis"><em>SELinux gebruiker:rol:type:niveau</em></span> syntax:
</div><div class="variablelist"><dl><dt><span class="term"><span class="emphasis"><em>SELinux gebruiker</em></span></span></dt><dd><div class="para">
De SELinux gebruiker identiteit is een identiteit die bekend is aan de tactiek en die gemachtigd is voor een specifieke verzameling van rollen, en voor een specifieke MLS reeks. Iedere Linux gebruiker wordt afgebeeld op een SELinux gebruiker via SELinux tactiek. Dit staat Linux gebruikers toe om de beperkingen van SELinux gebruiker te erven. De afgebeelde SELinux identiteit wordt gebruikt in de SELinux context voor processen in die sessie, om te beperken welke rollen en niveau's ze kunnen betreden. Voer het <code class="command">semanage login -l</code> commando uit als Linux root gebruiker om een lijst van afbeeldingen te zien tussen SELinux en Linux gebruikersaccounts:
</div><pre class="screen"># /usr/sbin/semanage login -l
Login Name SELinux User MLS/MCS Range
__default__ unconfined_u s0-s0:c0.c1023
root unconfined_u s0-s0:c0.c1023
system_u system_u s0-s0:c0.c1023
</pre><div class="para">
De output kan verschillen van systeem tot systeem. De <code class="computeroutput">Login Name</code> kolom laat de Linux gebruikers zien, en de <code class="computeroutput">SELinux User</code> kolom laat zien op welke SELinux gebruiker de Linux gebruiker is afgebeeld. Voor processen beperkt de SELinux gebruiker welke rollen en niveau's bereikbaar zijn. De laatste kolom, <code class="computeroutput">MLS/MCS Range</code>, is het niveau gebruikt door Multi-Level Security (MLS) en Multi-Category Security (MCS) (multi-categorie beveiliging). Niveau's worden later kort besproken.
</div></dd><dt><span class="term"><span class="emphasis"><em>rol</em></span></span></dt><dd><div class="para">
Onderdeel van SELinux is het Role-Based Access Control (RBAC) beveiligings model. De rol is een kenmerk van RBAC. SELinux gebruikers zijn gemachtigd voor rollen, en rollen zijn gemachtigd voor domeinen. De rol dient als een bemiddelaar tussen domeinen en SELinux gebruikers. De rollen die betreed kunnen worden bepalen welke domeinen betreed kunnen worden - uiteindelijk controleert dit tot welke object types toegang kan worden verkregen. Dit helpt de kwetsbaarheid te verminderen voor rechten escalatie aanvallen.
</div></dd><dt><span class="term"><span class="emphasis"><em>type</em></span></span></dt><dd><div class="para">
Het type is een kenmerk van Type Enforcement. Het type definieert een domein voor processen, en een type voor bestanden. SELinux tactiekregels bepalen hoe types toegang hebben tot elkaar, of het nu een domein is die toegang heeft tot een type, of een domein die toegang heeft tot een ander domein. Toegang is alleen toegestaan als er een specifieke SELinux tactiekregel bestaat die dit toestaat.
</div></dd><dt><span class="term"><span class="emphasis"><em>niveau</em></span></span></dt><dd><div class="para">
Het niveau is een kenmerk van MLS en Multi-Category Security (MCS). Een MLS reeks is een paar van niveau's, geschreven als <span class="emphasis"><em>laagniveau-hoogniveau</em></span> als de niveau's verschillend zijn, of <span class="emphasis"><em>laagniveau</em></span> als de niveau's identiek zijn (<code class="computeroutput">s0-s0</code> is hetzelfde als <code class="computeroutput">s0</code>). Elk niveau is een gevoeligheid-categorie paar, met categorie optioneel. Als er categorieën zijn, wordt het niveau geschreven als <span class="emphasis"><em>gevoeligheid:categorie-set</em></span>. Als er geen categorieën zijn, wordt het geschreven als <span class="emphasis"><em>gevoeligheid</em></span>.
</div><div class="para">
Als de categorie set een opeenvolgende reeks is, kan het afgekort worden. Bijvoorbeeld, <code class="computeroutput">c0.c3</code> is hetzelfde als <code class="computeroutput">c0,c1,c2,c3</code>. Het <code class="filename">/etc/selinux/targeted/setrans.conf</code> bestand beeldt niveau's (<code class="computeroutput">s0:c0</code>) af op een voor mensen leesbare vorm (<code class="computeroutput">CompanyConfidential</code>). Bewerk <code class="filename">setrans.conf</code> niet met een tekstverwerker: gebruik <code class="command">semanage</code> om veranderingen te maken. Refereer naar de <span class="citerefentry"><span class="refentrytitle">semanage</span>(8)</span> manual pagina voor meer informatie. De gerichte tactiek in Fedora 11 dwingt MCS af, en in MCS is een gevoeligheid, <code class="computeroutput">s0</code>. MCS in Fedora 11 ondersteunt 1024 verschillende categorieën: <code class="computeroutput">c0</code> tot en met <code class="computeroutput">c1023</code
>. <code class="computeroutput">s0-s0:c0.c1023</code> is gevoeligheid <code class="computeroutput">s0</code> en gemachtigd voor alle categorieën.
</div><div class="para">
MLS dwingt het <a href="http://en.wikipedia.org/wiki/Bell-LaPadula_model">Bell-LaPadula Mandatory Access Model</a> af, en wordt gebruikt in Labeled Security Protection Profile (LSPP) omgevingen. Om MLS beperkingen te gebruiken, installeer je het <span class="package">selinux-policy-mls</span> pakket, en je stelt MLS in om de standaard SELinux tactiek te zijn. De MLS tactiek die onderdeel van Fedora is laat veel programma domeinen weg die geen onderdeel waren van de geevalueerde configuratie, en daarom is MLS niet bruikbaar op een bureau werkstation (geen ondersteuning voor het X Windows systeem); echter een MLS tactiek kan gemaakt worden van de <a href="http://oss.tresys.com/projects/refpolicy">upstream SELinux Referentie Tactiek</a> die alle programma domeinen bevat.
</div></dd></dl></div><div class="section" lang="nl-NL"><div class="titlepage"><div><div><h2 class="title" id="sect-Security-Enhanced_Linux-SELinux_Contexts-Domain_Transitions">3.1. Domein overgangen</h2></div></div></div><div class="para">
Een proces in een domein gaat over naar een ander domein door het uitvoeren van een toepassing die het <code class="computeroutput">entrypoint</code> type heeft voor het nieuwe domein. De <code class="computeroutput">entrypoint</code> toestemming wordt gebruikt in SELinux tactiek, en controleert welke toepassingen gebruikt kunnen worden om een domein in te gaan. Het volgende voorbeeld laat een domein overgang zien:
</div><div class="orderedlist"><ol><li><div class="para">
Een gebruiker wil zijn wachtwoord veranderen. Om zijn wachtwoord te veranderen, gebruikt hij de <code class="command">passwd</code> toepassing. Het <code class="filename">/usr/bin/passwd</code> uitvoerbare programma is gelabeld met het <code class="computeroutput">passwd_exec_t</code> type:
</div><pre class="screen">$ ls -Z /usr/bin/passwd
-rwsr-xr-x root root system_u:object_r:passwd_exec_t:s0 /usr/bin/passwd
</pre><div class="para">
De <span class="application"><strong>passwd</strong></span> toepassing heeft toegang tot <code class="filename">/etc/shadow</code>, welke gelabeld is met het <code class="computeroutput">shadow_t</code> type:
</div><pre class="screen">$ ls -Z /etc/shadow
-r-------- root root system_u:object_r:shadow_t:s0 /etc/shadow
</pre></li><li><div class="para">
Een SELinux tactiekregel zegt dat het aan processen die in het <code class="computeroutput">passwd_t</code> domein draaien toegestaan wordt om te lezen en schrijven naar bestanden gelabeld met het <code class="computeroutput">shadow_t</code> type. Het <code class="computeroutput">shadow_t</code> type wordt alleen toegepast bij bestanden die nodig zijn voor een verandering van wachtwoord. Dit omvat <code class="filename">/etc/gshadow</code>, <code class="filename">/etc/shadow</code>, en hun backup bestanden.
</div></li><li><div class="para">
Een SELinux tactiekregel zegt dat het <code class="computeroutput">passwd_t</code> domein <code class="computeroutput">entrypoint</code> toestemming heeft voor het <code class="computeroutput">passwd_exec_t</code> type.
</div></li><li><div class="para">
Als een gebruiker de <code class="command">/usr/bin/passwd</code> toepassing uitvoert, zal het shell proces van de gebruiker overgaan naar het <code class="computeroutput">passwd_t</code> domein. Met SELinux, omdat de standaard actie weigeren is, en er een regel bestaat die toestaat (onder andere) dat toepassingen die draaien in het <code class="computeroutput">passwd_t</code> domein toegang hebben tot bestanden gelabeld met het <code class="computeroutput">shadow_t</code> type, is het de <span class="application"><strong>passwd</strong></span> toepassing toegestaan om toegang te hebben tot <code class="filename">/etc/shadow</code>, en dus om het wachtwoord van de gebruiker te vernieuwen.
</div></li></ol></div><div class="para">
Dit voorbeeld is niet volledig,en wordt gebruikt als een basis voorbeeld om domein overgangen uit te leggen. Hoewel er in werkelijkheid een regel is die subjects, die in het <code class="computeroutput">passwd_t</code> domein draaien, toestaan om toegang te hebben tot objecten met het <code class="computeroutput">shadow_t</code> bestandslabel type, moet er voldaan worden aan andere SELinux tactiekregels voordat het subject kan overgaan naar een nieuw domein. In dit voorbeeld, verzekert Type Enforcement dat:
</div><div class="itemizedlist"><ul><li><div class="para">
het <code class="computeroutput">passwd_t</code> domein kan alleen betreden worden door het uitvoeren van een toepassing gelabeld met het <code class="computeroutput">passwd_exec_t</code> type; kan alleen uitgevoerd worden met gemachtigde gedeelde bibliotheken, zoals het <code class="computeroutput">lib_t</code> type; en kan niet uitgevoerd worden enig andere toepassing.
</div></li><li><div class="para">
alleen gemachtigde domeinen, zoals <code class="computeroutput">passwd_t</code>, kunnen naar bestanden schrijven met het <code class="computeroutput">shadow_t</code> type. Zelfs als andere processen draaien met root gebruiker rechten, kunnen deze processen niet schrijven naar bestanden gelabeld met het <code class="computeroutput">shadow_t</code> type, omdat deze niet draaien in het <code class="computeroutput">passwd_t</code> domein.
</div></li><li><div class="para">
alleen gemachtigde domeinen kunnen overgaan naar het <code class="computeroutput">passwd_t</code> domein. Bijvoorbeeld, het <code class="systemitem">sendmail</code> proces draaiend in het <code class="computeroutput">sendmail_t</code> domein heeft geen geldige reden om <code class="command">passwd</code> uit te voeren; daarom kan het nooit overgaan naar het <code class="computeroutput">passwd_t</code> domein.
</div></li><li><div class="para">
processen die draaien in het <code class="computeroutput">passwd_t</code> domein kunnen alleen lezen en schrijven naar gemachtigde types, zoals bestanden gelabeld met <code class="computeroutput">etc_t</code> of <code class="computeroutput">shadow_t</code> types. Dit verhindert de <span class="application"><strong>passwd</strong></span> toepassing om misleid te worden om willekeurige bestanden te lezen of te schrijven.
</div></li></ul></div></div></div><ul class="docnav"><li class="previous"><a accesskey="p" href="sect-Security-Enhanced_Linux-Introduction-SELinux_on_Other_Operating_Systems.html"><strong>Terug</strong>2.4. SELinux in andere operating systemen</a></li><li class="up"><a accesskey="u" href="#"><strong>Omhoog</strong></a></li><li class="home"><a accesskey="h" href="index.html"><strong>Begin</strong></a></li><li class="next"><a accesskey="n" href="sect-Security-Enhanced_Linux-SELinux_Contexts-SELinux_Contexts_for_Processes.html"><strong>Volgende</strong>3.2. SELinux context voor processen</a></li></ul></body></html>
--- NEW FILE chap-Security-Enhanced_Linux-Targeted_Policy.html ---
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Hoofdstuk 4. Gerichte tactiek</title><link rel="stylesheet" href="./Common_Content/css/default.css" type="text/css"/><meta name="generator" content="publican"/><meta name="package" content="Fedora-Security-Enhanced_Linux-11-nl-NL-1.3-SELinux_User_guide"/><link rel="home" href="index.html" title="Security-Enhanced Linux"/><link rel="up" href="index.html" title="Security-Enhanced Linux"/><link rel="prev" href="sect-Security-Enhanced_Linux-SELinux_Contexts-SELinux_Contexts_for_Users.html" title="3.3. SELinux context voor gebruikers"/><link rel="next" href="sect-Security-Enhanced_Linux-Targeted_Policy-Unconfined_Processes.html" title="4.2. Onbeperkte processen"/></head><body class=""><p id="title"><a class="left" href="http://www.fedoraproject.org"><img src="Common_Content/images/image_left.png" alt="Product Site"/></a><a class="right" href="http://docs.fedoraproject.org"><img src="Common_Content/images/image_right.png" alt=
"Documentation Site"/></a></p><ul class="docnav"><li class="previous"><a accesskey="p" href="sect-Security-Enhanced_Linux-SELinux_Contexts-SELinux_Contexts_for_Users.html"><strong>Terug</strong></a></li><li class="next"><a accesskey="n" href="sect-Security-Enhanced_Linux-Targeted_Policy-Unconfined_Processes.html"><strong>Volgende</strong></a></li></ul><div class="chapter" lang="nl-NL"><div class="titlepage"><div><div><h2 class="title" id="chap-Security-Enhanced_Linux-Targeted_Policy">Hoofdstuk 4. Gerichte tactiek</h2></div></div></div><div class="toc"><dl><dt><span class="section"><a href="chap-Security-Enhanced_Linux-Targeted_Policy.html#sect-Security-Enhanced_Linux-Targeted_Policy-Confined_Processes">4.1. Beperkte processen</a></span></dt><dt><span class="section"><a href="sect-Security-Enhanced_Linux-Targeted_Policy-Unconfined_Processes.html">4.2. Onbeperkte processen</a></span></dt><dt><span class="section"><a href="sect-Security-Enhanced_Linux-Targeted_Policy-Confined_a
nd_Unconfined_Users.html">4.3. Beperkte en onbeperkte gebruikers</a></span></dt></dl></div><div class="para">
Gerichte tactiek is de standaard SELinux tactiek die gebruikt wordt in Fedora 11. Bij een gerichte tactiek draaien processen waarop gericht wordt in een beperkt domein, en draaien processen waar niet op gericht wordt in een onbeperkt domein. Bijvoorbeeld, standaard draaien ingelogde gebruikers in het <code class="computeroutput">unconfined_t</code> domein, en systeem processen opgestart door init draaien in het <code class="computeroutput">initrc_t</code> domein - deze beide domeinen zijn onbeperkt.
</div><div class="para">
Unconfined domains (as well as confined domains) are subject to executable and writeable memory checks. By default, subjects running in an unconfined domain can not allocate writeable memory and execute it. This reduces vulnerability to <a href="http://en.wikipedia.org/wiki/Buffer_overflow">buffer overflow attacks</a>. These memory checks are disabled by setting Booleans, which allow the SELinux policy to be modified at runtime. Boolean configuration is discussed later.
</div><div class="section" lang="nl-NL"><div class="titlepage"><div><div><h2 class="title" id="sect-Security-Enhanced_Linux-Targeted_Policy-Confined_Processes">4.1. Beperkte processen</h2></div></div></div><div class="para">
Bijna iedere service die luistert op een netwerk is beperkt in Fedora 11. Bovendien zijn de meeste processen beperkt die gedraaid worden als de Linux root gebruiker en taken uitvoeren voor gebruikers, zoals de <span class="application"><strong>passwd</strong></span> toepassing. Als een proces beperkt is, draait het in zijn eigen domein, zoals het <code class="systemitem">httpd</code> proces draait in het <code class="computeroutput">httpd_t</code> domein. Als een beperkt proces in gevaar wordt gebracht door een aanvaller zal, afhankelijk van de SELinux tactiek instellingen, de toegang van de aanvaller naar hulpbronnen, en de mogelijke schade die aangericht kan worden, beperkt zijn.
</div><div class="para">
Het volgende voorbeeld laat zien hoe SELinux voorkomt dat de Apache HTTP server (<code class="systemitem">httpd</code>) leest van bestanden die niet correct gelabeld zijn, zoals bestanden bedoelt voor gebruik met Samba. Dit is een voorbeeld, en moet niet gebruikt worden in een productieomgeving. Het neemt aan dat de <span class="package">httpd</span>, <span class="package">wget</span>, <span class="package">setroubleshoot-server</span>, en <span class="package">audit</span> pakketten geinstalleerd zijn, dat de SELinux gerichte tactiek wordt gebruikt, en dat SELinux draait in de afdwingende (enforcing) modus.
</div><div class="orderedlist"><ol><li><div class="para">
Voer het <code class="command">sestatus</code> commando uit om te bevestigen dat SELinux is aangezet, het draait in de afdwingende modus, en dat de gerichte tactiek wordt gebruikt:
</div><pre class="screen">$ /usr/sbin/sestatus
SELinux status: enabled
SELinuxfs mount: /selinux
Current mode: enforcing
Mode from config file: enforcing
Policy version: 23
Policy from config file: targeted
</pre><div class="para">
<code class="computeroutput">SELinux status: enabled</code> is returned when SELinux is enabled. <code class="computeroutput">Current mode: enforcing</code> is returned when SELinux is running in enforcing mode. <code class="computeroutput">Policy from config file: targeted</code> is returned when the SELinux targeted policy is used.
</div></li><li><div class="para">
Als de Linux root gebruiker draai je het <code class="command">touch /var/www/html/testfile</code> commando om een bestand aan te maken.
</div></li><li><div class="para">
Draai het <code class="command">ls -Z /var/www/html/testfile</code> commando om de SELinux context te bekijken:
</div><pre class="screen">-rw-r--r-- root root unconfined_u:object_r:httpd_sys_content_t:s0 /var/www/html/testfile
</pre><div class="para">
Standaard draaien Linux gebruikers onbeperkt in Fedora 11, daarom is het <code class="filename">testfile</code> bestand gelabeld met de SELinux <code class="computeroutput">unconfined_u</code> gebruiker. RBAC wordt gebruikt voor processen, niet voor bestanden. Rollen hebben geen betekenis voor bestanden - de <code class="computeroutput">object_r</code> rol is een algemene rol gebruikt voor bestanden (op blijvende opslag en netwerkbestandsystemen). In de <code class="filename">/proc/</code> map, kunnen bestanden die gerelateerd zijn aan processen de <code class="computeroutput">system_r</code> rol gebruiken.<sup>[<a id="d0e1236" href="#ftn.d0e1236" class="footnote">6</a>]</sup> Het <code class="computeroutput">httpd_sys_content_t</code> type staat het <code class="systemitem">httpd</code> proces toe om toegang te krijgen tot dit bestand.
</div></li><li><div class="para">
Als de Linux root gebruiker, draai je het <code class="command">service httpd start</code> commando om het <code class="systemitem">httpd</code> proces te starten. Als <code class="systemitem">httpd</code> met succes opstart verschijnt de volgende output:
</div><pre class="screen"># /sbin/service httpd start
Starting httpd: [ OK ]
</pre></li><li><div class="para">
Ga naar een map waar je Linux gebruiker schrijfrechten heeft, en draai het <code class="command">wget http://localhost/testfile</code> commando. Behalve als er veranderingen in de standaard instelling gemaakt zijn zal dit commando slagen:
</div><pre class="screen">--2009-05-06 23:00:01-- http://localhost/testfile
Resolving localhost... 127.0.0.1
Connecting to localhost|127.0.0.1|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 0 [text/plain]
Saving to: `testfile'
[ <=> ] 0 --.-K/s in 0s
2009-05-06 23:00:01 (0.00 B/s) - `testfile' saved [0/0]
</pre></li><li><div class="para">
Het <code class="command">chcon</code> commando herlabelt bestanden; zulke label veranderingen zullen echter niet blijven bestaan als het bestandssysteem opnieuw gelabeld wordt. Voor permanente veranderingen die een herlabeling van het bestandssysteem zullen overleven, gebruik je het <code class="command">semanage</code> commando, dat later besproken wordt. Als de Linux root gebruiker draai je het volgende commando om het type te veranderen naar een type dat door Samba gebruikt wordt:
</div><div class="para">
<code class="command">chcon -t samba_share_t /var/www/html/testfile</code>
</div><div class="para">
Draai het <code class="command">ls -Z /var/www/html/testfile</code> commando om de veranderingen te bekijken:
</div><pre class="screen">-rw-r--r-- root root unconfined_u:object_r:samba_share_t:s0 /var/www/html/testfile
</pre></li><li><div class="para">
Merk op: de huidige DAC rechten staan het <code class="systemitem">httpd</code> proces toegang toe tot<code class="filename">testfile</code>. Ga naar een map waar je Linux gebruiker schrijfrechten heeft, en voer het <code class="command">wget http://localhost/testfile</code> commando uit. Behalve als er veranderingen in de standaard instelling gemaakt zijn zal dit commando falen:
</div><pre class="screen">--2009-05-06 23:00:54-- http://localhost/testfile
Resolving localhost... 127.0.0.1
Connecting to localhost|127.0.0.1|:80... connected.
HTTP request sent, awaiting response... 403 Forbidden
2009-05-06 23:00:54 ERROR 403: Forbidden.
</pre></li><li><div class="para">
Als de Linux root gebruiker draai je het <code class="command">rm -i /var/www/html/testfile</code> commando om <code class="filename">testfile</code> te verwijderen.
</div></li><li><div class="para">
Als het voor jou niet nodig is dat <code class="systemitem">httpd</code> draait, voer je als de Linux root gebruiker het <code class="command">service httpd stop</code> commando uit om <code class="systemitem">httpd</code> te stoppen:
</div><pre class="screen"># /sbin/service httpd stop
Stopping httpd: [ OK ]
</pre></li></ol></div><div class="para">
Dit voorbeeld laat de extra beveiliging zien die toegevoegd is door SELinux. Hoewel DAC regels het <code class="systemitem">httpd</code> proces toegang toestaan tot <code class="filename">testfile</code> in stap 7, zal SELinux toegang weigeren omdat het bestand gelabeld was met een type waarnaar het <code class="systemitem">httpd</code> proces geen toegang heeft. Na stap 7 wordt een fout weggeschreven naar <code class="filename">/var/log/messages</code> die lijkt op het volgende:
</div><pre class="screen">May 6 23:00:54 localhost setroubleshoot: SELinux is preventing httpd (httpd_t) "getattr"
to /var/www/html/testfile (samba_share_t). For complete SELinux messages.
run sealert -l c05911d3-e680-4e42-8e36-fe2ab9f8e654
</pre><div class="para">
Eerdere log bestanden kunnen een <code class="filename">/var/log/messages.<em class="replaceable"><code>YYYYMMDD</code></em></code> formaat gebruiken. Als <span class="application"><strong>syslog-ng</strong></span> draait, kunnen eerdere log bestanden een <code class="filename">/var/log/messages.<em class="replaceable"><code>X</code></em></code> formaat gebruiken. Als de <code class="systemitem">setroubleshootd</code> en <code class="systemitem">auditd</code> processen draaien, worden fouten naar <code class="filename">/var/log/audit/audit.log</code> weggeschreven likend op het volgende:
</div><pre class="screen">type=AVC msg=audit(1220706212.937:70): avc: denied { getattr } for pid=1904 comm="httpd" path="/var/www/html/testfile" dev=sda5 ino=247576 scontext=unconfined_u:system_r:httpd_t:s0 tcontext=unconfined_u:object_r:samba_share_t:s0 tclass=file
type=SYSCALL msg=audit(1220706212.937:70): arch=40000003 syscall=196 success=no exit=-13 a0=b9e21da0 a1=bf9581dc a2=555ff4 a3=2008171 items=0 ppid=1902 pid=1904 auid=500 uid=48 gid=48 euid=48 suid=48 fsuid=48 egid=48 sgid=48 fsgid=48 tty=(none) ses=1 comm="httpd" exe="/usr/sbin/httpd" subj=unconfined_u:system_r:httpd_t:s0 key=(null)
</pre><div class="para">
Er wordt ook een fout weggeschreven naar <code class="filename">/var/log/httpd/error_log</code> lijkend op het volgende:
</div><pre class="screen">[Wed May 06 23:00:54 2009] [error] [client <em class="replaceable"><code>127.0.0.1</code></em>] (13)Permission denied: access to /testfile denied
</pre><div class="note"><h2>Opmerking</h2><div class="para">
In Fedora 11 worden de <span class="package">setroubleshoot-server</span> en <span class="package">audit</span> pakketten standaard geinstalleerd. Deze pakketten bevatten respectievelijk de <code class="systemitem">setroubleshootd</code> en <code class="systemitem">auditd</code> daemons. Deze daemons draaien standaard. Het stoppen van een van deze daemons verandert waar de SELinux weigeringen weggeschreven worden. Refereer naar <a class="xref" href="sect-Security-Enhanced_Linux-Working_with_SELinux-Which_Log_File_is_Used.html" title="5.2. Welk log bestand wordt gebruikt">Paragraaf 5.2, “Welk log bestand wordt gebruikt”</a> voor meer informatie.
</div></div></div><div class="footnotes"><br/><hr/><div class="footnote"><p><sup>[<a id="ftn.d0e1236" href="#d0e1236" class="para">6</a>] </sup>
Als andere tactieken gebruikt worden, zoals MLS, kunnen andere rollen gebruikt worden, bijvoorbeeld, <code class="computeroutput">secadm_r</code>.
</p></div></div></div><ul class="docnav"><li class="previous"><a accesskey="p" href="sect-Security-Enhanced_Linux-SELinux_Contexts-SELinux_Contexts_for_Users.html"><strong>Terug</strong>3.3. SELinux context voor gebruikers</a></li><li class="up"><a accesskey="u" href="#"><strong>Omhoog</strong></a></li><li class="home"><a accesskey="h" href="index.html"><strong>Begin</strong></a></li><li class="next"><a accesskey="n" href="sect-Security-Enhanced_Linux-Targeted_Policy-Unconfined_Processes.html"><strong>Volgende</strong>4.2. Onbeperkte processen</a></li></ul></body></html>
--- NEW FILE chap-Security-Enhanced_Linux-Trademark_Information.html ---
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Hoofdstuk 1. Handelsmerk informatie</title><link rel="stylesheet" href="./Common_Content/css/default.css" type="text/css"/><meta name="generator" content="publican"/><meta name="package" content="Fedora-Security-Enhanced_Linux-11-nl-NL-1.3-SELinux_User_guide"/><link rel="home" href="index.html" title="Security-Enhanced Linux"/><link rel="up" href="index.html" title="Security-Enhanced Linux"/><link rel="prev" href="pr01s02.html" title="2. We hebben terugkoppeling nodig!"/><link rel="next" href="chap-Security-Enhanced_Linux-Introduction.html" title="Hoofdstuk 2. Inleiding"/></head><body class=""><p id="title"><a class="left" href="http://www.fedoraproject.org"><img src="Common_Content/images/image_left.png" alt="Product Site"/></a><a class="right" href="http://docs.fedoraproject.org"><img src="Common_Content/images/image_right.png" alt="Documentation Site"/></a></p><ul class="docnav"><li class="previous"><a accesskey="p" h
ref="pr01s02.html"><strong>Terug</strong></a></li><li class="next"><a accesskey="n" href="chap-Security-Enhanced_Linux-Introduction.html"><strong>Volgende</strong></a></li></ul><div class="chapter" lang="nl-NL"><div class="titlepage"><div><div><h2 class="title" id="chap-Security-Enhanced_Linux-Trademark_Information">Hoofdstuk 1. Handelsmerk informatie</h2></div></div></div><div class="toc"><dl><dt><span class="section"><a href="chap-Security-Enhanced_Linux-Trademark_Information.html#chap-Security-Enhanced_Linux-Trademark_Information-Source_Code">1.1. Source Code</a></span></dt></dl></div><div class="para">
<span class="trademark">Linux</span>® is het geregistreerde handeslmerk van Linus Torvalds in de V.S. en andere landen.
</div><div class="para">
UNIX is een geregistreerd handelsmerk van The Open Group.
</div><div class="para">
Type Enforcement is een handelsmerk van Secure Computing, LLC, een volledige dochtermaatschappij van McAfee, Inc, geregistreert in de V.S. en andere landen. McAfee noch Secure Computing, LLC, hebben toestemming gegeven voor het gebruik van of referentie naar dit handelsmerk door de auteur buiten deze gids.
</div><div class="para">
Apache is het handelsmerk van The Apache Software Foundation.
</div><div class="para">
MySQL is een handelsmerk of geregistreerd handelsmerk van MySQL AB in de V.S. en andere landen.
</div><div class="section" lang="nl-NL"><div class="titlepage"><div><div><h2 class="title" id="chap-Security-Enhanced_Linux-Trademark_Information-Source_Code">1.1. Source Code</h2></div></div></div><div class="para">
The XML source for this guide is available at <a href="http://svn.fedorahosted.org/svn/selinuxguide/">http://svn.fedorahosted.org/svn/selinuxguide/</a>
</div></div></div><ul class="docnav"><li class="previous"><a accesskey="p" href="pr01s02.html"><strong>Terug</strong>2. We hebben terugkoppeling nodig!</a></li><li class="up"><a accesskey="u" href="#"><strong>Omhoog</strong></a></li><li class="home"><a accesskey="h" href="index.html"><strong>Begin</strong></a></li><li class="next"><a accesskey="n" href="chap-Security-Enhanced_Linux-Introduction.html"><strong>Volgende</strong>Hoofdstuk 2. Inleiding</a></li></ul></body></html>
--- NEW FILE chap-Security-Enhanced_Linux-Troubleshooting.html ---
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Hoofdstuk 7. Foutzoeken</title><link rel="stylesheet" href="./Common_Content/css/default.css" type="text/css"/><meta name="generator" content="publican"/><meta name="package" content="Fedora-Security-Enhanced_Linux-11-nl-NL-1.3-SELinux_User_guide"/><link rel="home" href="index.html" title="Security-Enhanced Linux"/><link rel="up" href="index.html" title="Security-Enhanced Linux"/><link rel="prev" href="sect-Security-Enhanced_Linux-Confining_Users-Booleans_for_Users_Executing_Applications.html" title="6.6. Booleans voor gebruikers die toepassingen uitvoeren"/><link rel="next" href="sect-Security-Enhanced_Linux-Troubleshooting-Top_Three_Causes_of_Problems.html" title="7.2. De top drie oorzaken van problemen"/></head><body class=""><p id="title"><a class="left" href="http://www.fedoraproject.org"><img src="Common_Content/images/image_left.png" alt="Product Site"/></a><a class="right" href="http://docs.fedoraproject.org"><im
g src="Common_Content/images/image_right.png" alt="Documentation Site"/></a></p><ul class="docnav"><li class="previous"><a accesskey="p" href="sect-Security-Enhanced_Linux-Confining_Users-Booleans_for_Users_Executing_Applications.html"><strong>Terug</strong></a></li><li class="next"><a accesskey="n" href="sect-Security-Enhanced_Linux-Troubleshooting-Top_Three_Causes_of_Problems.html"><strong>Volgende</strong></a></li></ul><div class="chapter" lang="nl-NL"><div class="titlepage"><div><div><h2 class="title" id="chap-Security-Enhanced_Linux-Troubleshooting">Hoofdstuk 7. Foutzoeken</h2></div></div></div><div class="toc"><dl><dt><span class="section"><a href="chap-Security-Enhanced_Linux-Troubleshooting.html#sect-Security-Enhanced_Linux-Troubleshooting-What_Happens_when_Access_is_Denied">7.1. Wat gebeurt er als toegang wordt geweigerd</a></span></dt><dt><span class="section"><a href="sect-Security-Enhanced_Linux-Troubleshooting-Top_Three_Causes_of_Problems.html">7.2. De top drie
oorzaken van problemen</a></span></dt><dd><dl><dt><span class="section"><a href="sect-Security-Enhanced_Linux-Troubleshooting-Top_Three_Causes_of_Problems.html#sect-Security-Enhanced_Linux-Top_Three_Causes_of_Problems-Labeling_Problems">7.2.1. Labelings problemen</a></span></dt><dt><span class="section"><a href="sect-Security-Enhanced_Linux-Top_Three_Causes_of_Problems-How_are_Confined_Services_Running.html">7.2.2. Hoe draaien beperkte services?</a></span></dt><dt><span class="section"><a href="sect-Security-Enhanced_Linux-Top_Three_Causes_of_Problems-Evolving_Rules_and_Broken_Applications.html">7.2.3. Het ontwikkelen van regels en gebrekkige toepassingen</a></span></dt></dl></dd><dt><span class="section"><a href="sect-Security-Enhanced_Linux-Troubleshooting-Fixing_Problems.html">7.3. Problemen herstellen</a></span></dt><dd><dl><dt><span class="section"><a href="sect-Security-Enhanced_Linux-Troubleshooting-Fixing_Problems.html#sect-Security-Enhanced_Linux-Fixing_Problems-Lin
ux_Permissions">7.3.1. Linux rechten</a></span></dt><dt><span class="section"><a href="sect-Security-Enhanced_Linux-Fixing_Problems-Possible_Causes_of_Silent_Denials.html">7.3.2. Mogelijke oorzaken van stille weigeringen</a></span></dt><dt><span class="section"><a href="sect-Security-Enhanced_Linux-Fixing_Problems-Manual_Pages_for_Services.html">7.3.3. Manual pagina's voor services</a></span></dt><dt><span class="section"><a href="sect-Security-Enhanced_Linux-Fixing_Problems-Permissive_Domains.html">7.3.4. Toelatende domeinen</a></span></dt><dt><span class="section"><a href="sect-Security-Enhanced_Linux-Fixing_Problems-Searching_For_and_Viewing_Denials.html">7.3.5. Zoeken naar en het bekijken van weigeringen</a></span></dt><dt><span class="section"><a href="sect-Security-Enhanced_Linux-Fixing_Problems-Raw_Audit_Messages.html">7.3.6. Ruwe audit boodschappen</a></span></dt><dt><span class="section"><a href="sect-Security-Enhanced_Linux-Fixing_Problems-sealert_Messages.html">7.
3.7. sealert boodschappen</a></span></dt><dt><span class="section"><a href="sect-Security-Enhanced_Linux-Fixing_Problems-Allowing_Access_audit2allow.html">7.3.8. Toegang toestaan: audit2allow</a></span></dt></dl></dd></dl></div><div class="para">
Het volgende hoofdstuk beschrijft wat er gebeurt als SELinux toegang weigert; de top drie oorzaken van problemen; waar informatie te vinden over correcte labels; SELinux weigeringen onderzoeken; en het maken aangepaste tactiekregels met <code class="command">audit2allow</code>.
</div><div class="section" lang="nl-NL"><div class="titlepage"><div><div><h2 class="title" id="sect-Security-Enhanced_Linux-Troubleshooting-What_Happens_when_Access_is_Denied">7.1. Wat gebeurt er als toegang wordt geweigerd</h2></div></div></div><div class="para">
SELinux beslissingen, zoals het toestaan of weigeren van toegang, worden bewaard. Deze opslag staat bekend als de Access Vector Cache (AVC). Weigeringsboodschappen worden gelogd als SELinux toegang weigert. Deze weigeringen staan ook bekend als "AVC denials", en worden gelogd op een andere plaats, afhankelijk van welke daemons draaien:
</div><div class="segmentedlist"><table border="0"><thead><tr class="segtitle"><th>Daemon</th><th>Log Location</th></tr></thead><tbody><tr class="seglistitem"><td class="seg">auditd on</td><td class="seg"><code class="filename">/var/log/audit/audit.log</code></td></tr><tr class="seglistitem"><td class="seg">auditd off; rsyslogd on</td><td class="seg"><code class="filename">/var/log/messages</code></td></tr><tr class="seglistitem"><td class="seg">setroubleshootd, rsyslogd, and auditd on</td><td class="seg"><code class="filename">/var/log/audit/audit.log</code>. Easier-to-read denial messages also sent to <code class="filename">/var/log/messages</code></td></tr></tbody></table></div><div class="para">
Als je het X Window systeem draait, en de <span class="package">setroubleshoot</span> en <span class="package">setroubleshoot-server</span> zijn geinstalleerd, en de <code class="systemitem">setroubleshootd</code> en <code class="systemitem">auditd</code> daemons draaien, dan worden een gele ster en een waarschuwing getoond als toegang wordt geweigerd door SELinux:
</div><div class="mediaobject"><img src="./images/setroubleshoot_denial.png"/></div><div class="para">
Klikken op de ster presenteert een gedetaileerde analyse over waarom SELinux de toegang weigerde, en een mogelijke oplossing voor het toestaan van toegang. Als je hetX Window systeem niet draait, is het minder duidelijk wanneer toegang is geweigerd door SELinux. Bijvoorbeel, gebruikers die jouw website bezoeken kunnen een fout krijgen die lijkt op het volgende:
</div><pre class="screen">Forbidden
You don't have permission to access <em class="replaceable"><code>file name</code></em> on this server
</pre><div class="para">
Voor deze situaties, als DAC regels (standaard L:innux rechten) toegang toestaan, controleer dan <code class="filename">/var/log/messages</code> en <code class="filename">/var/log/audit/audit.log</code> voor respectievelijk <code class="computeroutput">"SELinux is preventing"</code> en <code class="computeroutput">"denied"</code> fouten. Dit kan gedaan worden met het uitvoeren van de volgende commando's als de Linux root gebruiker:
</div><div class="para">
<code class="command">grep "SELinux is preventing" /var/log/messages</code>
</div><div class="para">
<code class="command">grep "denied" /var/log/audit/audit.log</code>
</div></div></div><ul class="docnav"><li class="previous"><a accesskey="p" href="sect-Security-Enhanced_Linux-Confining_Users-Booleans_for_Users_Executing_Applications.html"><strong>Terug</strong>6.6. Booleans voor gebruikers die toepassingen ui...</a></li><li class="up"><a accesskey="u" href="#"><strong>Omhoog</strong></a></li><li class="home"><a accesskey="h" href="index.html"><strong>Begin</strong></a></li><li class="next"><a accesskey="n" href="sect-Security-Enhanced_Linux-Troubleshooting-Top_Three_Causes_of_Problems.html"><strong>Volgende</strong>7.2. De top drie oorzaken van problemen</a></li></ul></body></html>
--- NEW FILE chap-Security-Enhanced_Linux-Working_with_SELinux.html ---
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Hoofdstuk 5. Werken met SELinux</title><link rel="stylesheet" href="./Common_Content/css/default.css" type="text/css"/><meta name="generator" content="publican"/><meta name="package" content="Fedora-Security-Enhanced_Linux-11-nl-NL-1.3-SELinux_User_guide"/><link rel="home" href="index.html" title="Security-Enhanced Linux"/><link rel="up" href="index.html" title="Security-Enhanced Linux"/><link rel="prev" href="sect-Security-Enhanced_Linux-Targeted_Policy-Confined_and_Unconfined_Users.html" title="4.3. Beperkte en onbeperkte gebruikers"/><link rel="next" href="sect-Security-Enhanced_Linux-Working_with_SELinux-Which_Log_File_is_Used.html" title="5.2. Welk log bestand wordt gebruikt"/></head><body class=""><p id="title"><a class="left" href="http://www.fedoraproject.org"><img src="Common_Content/images/image_left.png" alt="Product Site"/></a><a class="right" href="http://docs.fedoraproject.org"><img src="Common_Content/imag
es/image_right.png" alt="Documentation Site"/></a></p><ul class="docnav"><li class="previous"><a accesskey="p" href="sect-Security-Enhanced_Linux-Targeted_Policy-Confined_and_Unconfined_Users.html"><strong>Terug</strong></a></li><li class="next"><a accesskey="n" href="sect-Security-Enhanced_Linux-Working_with_SELinux-Which_Log_File_is_Used.html"><strong>Volgende</strong></a></li></ul><div class="chapter" lang="nl-NL"><div class="titlepage"><div><div><h2 class="title" id="chap-Security-Enhanced_Linux-Working_with_SELinux">Hoofdstuk 5. Werken met SELinux</h2></div></div></div><div class="toc"><dl><dt><span class="section"><a href="chap-Security-Enhanced_Linux-Working_with_SELinux.html#sect-Security-Enhanced_Linux-Working_with_SELinux-SELinux_Packages">5.1. SELinux pakketten</a></span></dt><dt><span class="section"><a href="sect-Security-Enhanced_Linux-Working_with_SELinux-Which_Log_File_is_Used.html">5.2. Welk log bestand wordt gebruikt</a></span></dt><dt><span class="section"
><a href="sect-Security-Enhanced_Linux-Working_with_SELinux-Main_Configuration_File.html">5.3. Het hoofd configuratie bestand</a></span></dt><dt><span class="section"><a href="sect-Security-Enhanced_Linux-Working_with_SELinux-Enabling_and_Disabling_SELinux.html">5.4. SELinux aanzetten en uitzetten</a></span></dt><dd><dl><dt><span class="section"><a href="sect-Security-Enhanced_Linux-Working_with_SELinux-Enabling_and_Disabling_SELinux.html#sect-Security-Enhanced_Linux-Enabling_and_Disabling_SELinux-Enabling_SELinux">5.4.1. SELinux aanzetten</a></span></dt><dt><span class="section"><a href="sect-Security-Enhanced_Linux-Enabling_and_Disabling_SELinux-Disabling_SELinux.html">5.4.2. SELinux uitzetten</a></span></dt></dl></dd><dt><span class="section"><a href="sect-Security-Enhanced_Linux-Working_with_SELinux-SELinux_Modes.html">5.5. SELinux modes</a></span></dt><dt><span class="section"><a href="sect-Security-Enhanced_Linux-Working_with_SELinux-Booleans.html">5.6. Booleans</a></s
pan></dt><dd><dl><dt><span class="section"><a href="sect-Security-Enhanced_Linux-Working_with_SELinux-Booleans.html#sect-Security-Enhanced_Linux-Booleans-Listing_Booleans">5.6.1. Booleans laten zien</a></span></dt><dt><span class="section"><a href="sect-Security-Enhanced_Linux-Booleans-Configuring_Booleans.html">5.6.2. Booleans instellen</a></span></dt><dt><span class="section"><a href="sect-Security-Enhanced_Linux-Booleans-Booleans_for_NFS_and_CIFS.html">5.6.3. Booleans voor NFS en CIFS</a></span></dt></dl></dd><dt><span class="section"><a href="sect-Security-Enhanced_Linux-Working_with_SELinux-SELinux_Contexts_Labeling_Files.html">5.7. SELinux context - Bestanden labelen</a></span></dt><dd><dl><dt><span class="section"><a href="sect-Security-Enhanced_Linux-Working_with_SELinux-SELinux_Contexts_Labeling_Files.html#sect-Security-Enhanced_Linux-SELinux_Contexts_Labeling_Files-Temporary_Changes_chcon">5.7.1. Tijdelijke veranderingen: chcon</a></span></dt><dt><span class="secti
on"><a href="sect-Security-Enhanced_Linux-SELinux_Contexts_Labeling_Files-Persistent_Changes_semanage_fcontext.html">5.7.2. Permanente veranderingen: semanage fcontext</a></span></dt></dl></dd><dt><span class="section"><a href="sect-Security-Enhanced_Linux-Working_with_SELinux-The_file_t_and_default_t_Types.html">5.8. De file_t en default_t types</a></span></dt><dt><span class="section"><a href="sect-Security-Enhanced_Linux-Working_with_SELinux-Mounting_File_Systems.html">5.9. Het aankoppelen van bestandssystemen</a></span></dt><dd><dl><dt><span class="section"><a href="sect-Security-Enhanced_Linux-Working_with_SELinux-Mounting_File_Systems.html#sect-Security-Enhanced_Linux-Mounting_File_Systems-Context_Mounts">5.9.1. Context aankoppelingen</a></span></dt><dt><span class="section"><a href="sect-Security-Enhanced_Linux-Mounting_File_Systems-Changing_the_Default_Context.html">5.9.2. De standaard context veranderen</a></span></dt><dt><span class="section"><a href="sect-Security
-Enhanced_Linux-Mounting_File_Systems-Mounting_an_NFS_File_System.html">5.9.3. Het aankoppelen van een NFS bestandssysteem</a></span></dt><dt><span class="section"><a href="sect-Security-Enhanced_Linux-Mounting_File_Systems-Multiple_NFS_Mounts.html">5.9.4. Meerdere NFS aankoppelingen</a></span></dt><dt><span class="section"><a href="sect-Security-Enhanced_Linux-Mounting_File_Systems-Making_Context_Mounts_Persistent.html">5.9.5. Maak de context aankoppelingen blijvend</a></span></dt></dl></dd><dt><span class="section"><a href="sect-Security-Enhanced_Linux-Working_with_SELinux-Maintaining_SELinux_Labels_.html">5.10. Het onderhouden van SELinux labels </a></span></dt><dd><dl><dt><span class="section"><a href="sect-Security-Enhanced_Linux-Working_with_SELinux-Maintaining_SELinux_Labels_.html#sect-Security-Enhanced_Linux-Maintaining_SELinux_Labels_-Copying_Files_and_Directories">5.10.1. Bestanden en mappen kopiëren</a></span></dt><dt><span class="section"><a href="sect-Security-
Enhanced_Linux-Maintaining_SELinux_Labels_-Moving_Files_and_Directories.html">5.10.2. Bestanden en mappen verplaatsen</a></span></dt><dt><span class="section"><a href="sect-Security-Enhanced_Linux-Maintaining_SELinux_Labels_-Checking_the_Default_SELinux_Context.html">5.10.3. Het controleren van de standaard SELinux context</a></span></dt><dt><span class="section"><a href="sect-Security-Enhanced_Linux-Maintaining_SELinux_Labels_-Archiving_Files_with_tar.html">5.10.4. Bestanden archiveren met tar</a></span></dt><dt><span class="section"><a href="sect-Security-Enhanced_Linux-Maintaining_SELinux_Labels_-Archiving_Files_with_star.html">5.10.5. Bestanden archiveren met star</a></span></dt></dl></dd></dl></div><div class="para">
De volgende paragrafen geven een kort overzicht van de belangrijkste SELinux pakketten in Fedora 11; het installeren en vernieuwen van pakketten; welke log bestanden gebruikt worden; het belangrijkste SELinux configuratie bestand; SELinux aanzetten en uitzetten, SELinux modes; het instellen van Booleans; het tijdelijk en blijvend veranderen van bestand en map labels; het voorbij gaan aan bestandssysteem labels met het <code class="command">mount</code> commando; het aankoppelen van NFS bestandssystemen; en hoe je SELinux context behoudt bij het kopiëren en archiveren van bestanden en mappen.
</div><div class="section" lang="nl-NL"><div class="titlepage"><div><div><h2 class="title" id="sect-Security-Enhanced_Linux-Working_with_SELinux-SELinux_Packages">5.1. SELinux pakketten</h2></div></div></div><div class="para">
In Fedora 11 worden de SELinux pakketten standaard geinstalleerd, behalve als ze handmatig uitgezonderd worden tijdens de installatie. Standaard wordt de SELinux gerichte tactiek gebruikt, en draait SELinux in de afdwingende modus. Het volgende is een korte beschrijving van de belangrijkste SELinux pakketten:
</div><div class="para">
<span class="package">policycoreutils</span>: biedt gereedschappen zoals <code class="command">semanage</code>, <code class="command">restorecon</code>, <code class="command">audit2allow</code>, <code class="command">semodule</code>, <code class="command">load_policy</code>, en <code class="command">setsebool</code>, voor het uitvoeren en beheren van SELinux.
</div><div class="para">
<span class="package">policycoreutils-gui</span>: biedt <code class="command">system-config-selinux</code>, een grafisch gereedschap voor het beheren van SELinux.
</div><div class="para">
<span class="package">selinux-policy</span>: biedt de SELinux Referentie Tactiek. De SELinux Referentie Tactiek is een complete SELinux tactiek, en wordt gebruikt als de basis voor andere tactieken, zoals de SELinux gerichte tactiek. Refereer naar de Tresys Technology <a href="http://oss.tresys.com/projects/refpolicy">SELinux Reference Policy</a> voor verdere informatie. Het <span class="package">selinux-policy-devel</span> pakket levelt ontwikkelgereedschappen, zoals <code class="command">/usr/share/selinux/devel/policygentool</code> en <code class="command">/usr/share/selinux/devel/policyhelp</code>, en ook voorbeeld tactiek bestanden. Dit pakket is opgegaan in het <span class="package">selinux-policy</span> pakket.
</div><div class="para">
<span class="package">selinux-policy-<em class="replaceable"><code>policy</code></em></span>: levert SELinux tactieken. Voor gerichte tactiek, installeer je <span class="package">selinux-policy-targeted</span>. Voor MLS, installeer je <span class="package">selinux-policy-mls</span>. In Fedora 8 is de strikte tactiek opgegaan in de gerichte tactiek, wat toestaat dat beperkte en onbeperkte gebruikers tegelijk kunnen bestaan op hetzelfde systeem.
</div><div class="para">
<span class="package">setroubleshoot-server</span>: vertaalt weigeringsboodschappen, die gemaakt worden als toegang geweigerd wordt door SELinux, in gedetaileerde beschrijvingen die bekeken kunnen worden met <code class="command">sealert</code> (welke door dit pakket geleverd wordt).
</div><div class="para">
<span class="package">setools</span>, <span class="package">setools-gui</span>, en <span class="package">setools-console</span>: deze pakketten leveren de <a href="http://oss.tresys.com/projects/setools">Tresys Technology SETools distributie</a>, een aantal gereedschappen en bibliotheken voor het analiseren en ondervragen van tactiek, controle log waarnemen en rapporteren, en bestandscontext beheer <sup>[<a id="d0e2067" href="#ftn.d0e2067" class="footnote">8</a>]</sup>. Het <span class="package">setools</span> pakket is een meta-pakket voor SETools. Het <span class="package">setools-gui</span> pakket levert de <code class="command">apol</code>, <code class="command">seaudit</code>, en <code class="command">sediffx</code> gereedschappen. Het <span class="package">setools-console</span> pakket levert de <code class="command">seaudit-report</code>, <code class="command">sechecker</code>, <code class="command">sediff</code>, <code class="command">seinfo</code>, <code class="co
mmand">sesearch</code>, <code class="command">findcon</code>, <code class="command">replcon</code>, en <code class="command">indexcon</code> commadoregel gereedschappen. Refereer naar de <a href="http://oss.tresys.com/projects/setools">Tresys Technology SETools</a> pagina voor meer informatie over deze gereedschappen.
</div><div class="para">
<span class="package">libselinux-utils</span>: levert de <code class="command">avcstat</code>, <code class="command">getenforce</code>, <code class="command">getsebool</code>, <code class="command">matchpathcon</code>, <code class="command">selinuxconlist</code>, <code class="command">selinuxdefcon</code>, <code class="command">selinuxenabled</code>, <code class="command">setenforce</code>, en <code class="command">togglesebool</code> gereedschappen.
</div><div class="para">
<span class="package">mcstrans</span>: vertaalt niveau's, zoals <code class="computeroutput">s0-s0:c0.c1023</code>, naar een eenvoudiger te lezen vorm, zoals <code class="computeroutput">SystemLow-SystemHigh</code>. Dit pakket is standaard niet geinstalleerd.
</div><div class="para">
Om pakketten in Fedora 11 te installeren, draai je als de Linux root gebruiker het <code class="command">yum install <em class="replaceable"><code>pakket-naam</code></em></code> commando. Bijvoorbeeld, om het <span class="package">mcstrans</span> pakket te installeren, voer je het <code class="command">yum install mcstrans</code> commando uit. Om alle geinstalleerde pakketten in Fedora 11 te vernieuwen, voer je het <code class="command">yum update</code> commando uit.
</div><div class="para">
Refereer naar <a href="http://docs.fedoraproject.org/yum/en/">Managing Software with yum</a><sup>[<a id="d0e2179" href="#ftn.d0e2179" class="footnote">9</a>]</sup> voor meer informatie over het gebruik van <code class="command">yum</code> om pakketten te beheren.
</div><div class="note"><h2>Opmerking</h2><div class="para">
In vorige versies van Fedora is het <span class="package">selinux-policy-devel</span> pakket nodig voor het maken van een locale tactiek module met <code class="command">audit2allow -M</code>.
</div></div></div><div class="footnotes"><br/><hr/><div class="footnote"><p><sup>[<a id="ftn.d0e2067" href="#d0e2067" class="para">8</a>] </sup>
Brindle, Joshua. "Re: blurb for fedora setools packages" Email aan Murray McAllister. 1 November 2008. Elke bewerking en verandering in deze versie is gedaan door Murray McAllister.
</p></div><div class="footnote"><p><sup>[<a id="ftn.d0e2179" href="#d0e2179" class="para">9</a>] </sup>
Managing Software with yum, geschreven door Stuart Ellis, bewerkt door Paul W. Frields, Rodrigo Menezes, en Hugo Cisneiros.
</p></div></div></div><ul class="docnav"><li class="previous"><a accesskey="p" href="sect-Security-Enhanced_Linux-Targeted_Policy-Confined_and_Unconfined_Users.html"><strong>Terug</strong>4.3. Beperkte en onbeperkte gebruikers</a></li><li class="up"><a accesskey="u" href="#"><strong>Omhoog</strong></a></li><li class="home"><a accesskey="h" href="index.html"><strong>Begin</strong></a></li><li class="next"><a accesskey="n" href="sect-Security-Enhanced_Linux-Working_with_SELinux-Which_Log_File_is_Used.html"><strong>Volgende</strong>5.2. Welk log bestand wordt gebruikt</a></li></ul></body></html>
--- NEW FILE index.html ---
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Security-Enhanced Linux</title><link rel="stylesheet" href="./Common_Content/css/default.css" type="text/css"/><meta name="generator" content="publican"/><meta name="package" content="Fedora-Security-Enhanced_Linux-11-nl-NL-1.3-SELinux_User_guide"/><meta name="description" content="Dieze gids behandelt het beheer en gebruik van Security-Enhanced Linux."/><link rel="home" href="index.html" title="Security-Enhanced Linux"/><link rel="next" href="pref-Security-Enhanced_Linux-Preface.html" title="Voorwoord"/></head><body class=""><p id="title"><a class="left" href="http://www.fedoraproject.org"><img src="Common_Content/images/image_left.png" alt="Product Site"/></a><a class="right" href="http://docs.fedoraproject.org"><img src="Common_Content/images/image_right.png" alt="Documentation Site"/></a></p><ul class="docnav"><li class="previous"/><li class="next"><a accesskey="n" href="pref-Security-Enhanced_Linux-Preface.html"><st
rong>Volgende</strong></a></li></ul><div class="book" lang="nl-NL"><div class="titlepage"><div><div class="producttitle"><span class="productname">Fedora</span> <span class="productnumber">11</span></div><div><h1 id="d0e1" class="title">Security-Enhanced Linux</h1></div><div><h2 class="subtitle">Gebruikers gids</h2></div><p class="edition">Uitgave 1.3</p><div><h3 class="corpauthor">
<span class="inlinemediaobject"><object data="Common_Content/images/title_logo.svg" type="image/svg+xml"> Logo</object></span>
</h3></div><div><div class="authorgroup"><div class="author"><h3 class="author"><span class="firstname">Murray</span> <span class="surname">McAllister</span></h3><div class="affiliation"><span class="orgname">Red Hat</span> <span class="orgdiv">Engineering Content Services</span></div><code class="email"><a class="email" href="mailto:mmcallis@redhat.com">mmcallis(a)redhat.com</a></code></div><div class="author"><h3 class="author"><span class="firstname">Daniel</span> <span class="surname">Walsh</span></h3><div class="affiliation"><span class="orgname">Red Hat</span> <span class="orgdiv">Security Engineering</span></div><code class="email"><a class="email" href="mailto:dwalsh@redhat.com">dwalsh(a)redhat.com</a></code></div><div class="author"><h3 class="author"><span class="firstname">Dominick</span> <span class="surname">Grift</span></h3><span class="contrib">Technische editor voor de Inleiding, SELinux Context, Gerichte tactiek, Werken met SELinux, Gebruikers beperken, en Fou
tzoeken hoofdstukken.</span> <div class="affiliation"><span class="orgname"/> <span class="orgdiv"/></div><code class="email"><a class="email" href="mailto:domg472@gmail.com">domg472(a)gmail.com</a></code></div><div class="author"><h3 class="author"><span class="firstname">Eric</span> <span class="surname">Paris</span></h3><span class="contrib">Technische editor voor de Bestandssystemen aankoppelen en Raw Audit Messages paragrafen.</span> <div class="affiliation"><span class="orgname">Red Hat</span> <span class="orgdiv">Security Engineering</span></div><code class="email"><a class="email" href="mailto:eparis@parisplace.org">eparis(a)parisplace.org</a></code></div><div class="author"><h3 class="author"><span class="firstname">James</span> <span class="surname">Morris</span></h3><span class="contrib">Technische editor voor de Inleiding en Gerichte tactiek hoofdstukken.</span> <div class="affiliation"><span class="orgname">Red Hat</span> <span class="orgdiv">Security Engineering
</span></div><code class="email"><a class="email" href="mailto:jmorris@redhat.com">jmorris(a)redhat.com</a></code></div><div class="author"><h3 class="author"><span class="firstname">Scott</span> <span class="surname">Radvan</span></h3><div class="affiliation"><span class="orgname">Red Hat</span> <span class="orgdiv">Engineering Content Services</span></div><code class="email"><a class="email" href="mailto:sradvan@redhat.com">sradvan(a)redhat.com</a></code></div></div></div><div><p class="copyright">Copyright © 2009 Red Hat, Inc.</p></div><hr/><div><div id="d0e35" class="legalnotice"><h1 class="legalnotice">Bericht</h1><div class="para">
Copyright <span class="trademark"/>© 2009 Red Hat, Inc. This material may only be distributed subject to the terms and conditions set forth in the Open Publication License, V1.0, (the latest version is presently available at <a href="http://www.opencontent.org/openpub/">http://www.opencontent.org/openpub/</a>).
</div><div class="para">
Fedora and the Fedora Infinity Design logo are trademarks or registered trademarks of Red Hat, Inc., in the U.S. and other countries.
</div><div class="para">
Red Hat and the Red Hat "Shadow Man" logo are registered trademarks of Red Hat Inc. in the United States and other countries.
</div><div class="para">
All other trademarks and copyrights referred to are the property of their respective owners.
</div><div class="para">
Documentation, as with software itself, may be subject to export control. Read about Fedora Project export controls at <a href="http://fedoraproject.org/wiki/Legal/Export">http://fedoraproject.org/wiki/Legal/Export</a>.
</div></div></div><div><div class="abstract"><h6>Samenvatting</h6><div class="para">Dieze gids behandelt het beheer en gebruik van Security-Enhanced <span class="trademark">Linux</span>®.</div></div></div></div><hr/></div><div class="toc"><dl><dt><span class="preface"><a href="pref-Security-Enhanced_Linux-Preface.html">Voorwoord</a></span></dt><dd><dl><dt><span class="section"><a href="pref-Security-Enhanced_Linux-Preface.html#d0e158">1. Document Conventie</a></span></dt><dd><dl><dt><span class="section"><a href="pref-Security-Enhanced_Linux-Preface.html#d0e168">1.1. Typografische Conventies</a></span></dt><dt><span class="section"><a href="pref-Security-Enhanced_Linux-Preface.html#d0e387">1.2. Pull-quote Conventies</a></span></dt><dt><span class="section"><a href="pref-Security-Enhanced_Linux-Preface.html#d0e406">1.3. Noten en waarschuwingen</a></span></dt></dl></dd><dt><span class="section"><a href="pr01s02.html">2. We hebben terugkoppeling nodig!</a></span></dt></dl></dd
><dt><span class="chapter"><a href="chap-Security-Enhanced_Linux-Trademark_Information.html">1. Handelsmerk informatie</a></span></dt><dd><dl><dt><span class="section"><a href="chap-Security-Enhanced_Linux-Trademark_Information.html#chap-Security-Enhanced_Linux-Trademark_Information-Source_Code">1.1. Source Code</a></span></dt></dl></dd><dt><span class="chapter"><a href="chap-Security-Enhanced_Linux-Introduction.html">2. Inleiding</a></span></dt><dd><dl><dt><span class="section"><a href="chap-Security-Enhanced_Linux-Introduction.html#sect-Security-Enhanced_Linux-Introduction-Benefits_of_running_SELinux">2.1. Voordelen van het draaien van SELinux</a></span></dt><dt><span class="section"><a href="sect-Security-Enhanced_Linux-Introduction-Examples.html">2.2. Voorbeelden</a></span></dt><dt><span class="section"><a href="sect-Security-Enhanced_Linux-Introduction-SELinux_Architecture.html">2.3. SELinux architectuur</a></span></dt><dt><span class="section"><a href="sect-Security-En
hanced_Linux-Introduction-SELinux_on_Other_Operating_Systems.html">2.4. SELinux in andere operating systemen</a></span></dt></dl></dd><dt><span class="chapter"><a href="chap-Security-Enhanced_Linux-SELinux_Contexts.html">3. SELinux context</a></span></dt><dd><dl><dt><span class="section"><a href="chap-Security-Enhanced_Linux-SELinux_Contexts.html#sect-Security-Enhanced_Linux-SELinux_Contexts-Domain_Transitions">3.1. Domein overgangen</a></span></dt><dt><span class="section"><a href="sect-Security-Enhanced_Linux-SELinux_Contexts-SELinux_Contexts_for_Processes.html">3.2. SELinux context voor processen</a></span></dt><dt><span class="section"><a href="sect-Security-Enhanced_Linux-SELinux_Contexts-SELinux_Contexts_for_Users.html">3.3. SELinux context voor gebruikers</a></span></dt></dl></dd><dt><span class="chapter"><a href="chap-Security-Enhanced_Linux-Targeted_Policy.html">4. Gerichte tactiek</a></span></dt><dd><dl><dt><span class="section"><a href="chap-Security-Enhanced_Linu
x-Targeted_Policy.html#sect-Security-Enhanced_Linux-Targeted_Policy-Confined_Processes">4.1. Beperkte processen</a></span></dt><dt><span class="section"><a href="sect-Security-Enhanced_Linux-Targeted_Policy-Unconfined_Processes.html">4.2. Onbeperkte processen</a></span></dt><dt><span class="section"><a href="sect-Security-Enhanced_Linux-Targeted_Policy-Confined_and_Unconfined_Users.html">4.3. Beperkte en onbeperkte gebruikers</a></span></dt></dl></dd><dt><span class="chapter"><a href="chap-Security-Enhanced_Linux-Working_with_SELinux.html">5. Werken met SELinux</a></span></dt><dd><dl><dt><span class="section"><a href="chap-Security-Enhanced_Linux-Working_with_SELinux.html#sect-Security-Enhanced_Linux-Working_with_SELinux-SELinux_Packages">5.1. SELinux pakketten</a></span></dt><dt><span class="section"><a href="sect-Security-Enhanced_Linux-Working_with_SELinux-Which_Log_File_is_Used.html">5.2. Welk log bestand wordt gebruikt</a></span></dt><dt><span class="section"><a href="s
ect-Security-Enhanced_Linux-Working_with_SELinux-Main_Configuration_File.html">5.3. Het hoofd configuratie bestand</a></span></dt><dt><span class="section"><a href="sect-Security-Enhanced_Linux-Working_with_SELinux-Enabling_and_Disabling_SELinux.html">5.4. SELinux aanzetten en uitzetten</a></span></dt><dd><dl><dt><span class="section"><a href="sect-Security-Enhanced_Linux-Working_with_SELinux-Enabling_and_Disabling_SELinux.html#sect-Security-Enhanced_Linux-Enabling_and_Disabling_SELinux-Enabling_SELinux">5.4.1. SELinux aanzetten</a></span></dt><dt><span class="section"><a href="sect-Security-Enhanced_Linux-Enabling_and_Disabling_SELinux-Disabling_SELinux.html">5.4.2. SELinux uitzetten</a></span></dt></dl></dd><dt><span class="section"><a href="sect-Security-Enhanced_Linux-Working_with_SELinux-SELinux_Modes.html">5.5. SELinux modes</a></span></dt><dt><span class="section"><a href="sect-Security-Enhanced_Linux-Working_with_SELinux-Booleans.html">5.6. Booleans</a></span></dt><d
d><dl><dt><span class="section"><a href="sect-Security-Enhanced_Linux-Working_with_SELinux-Booleans.html#sect-Security-Enhanced_Linux-Booleans-Listing_Booleans">5.6.1. Booleans laten zien</a></span></dt><dt><span class="section"><a href="sect-Security-Enhanced_Linux-Booleans-Configuring_Booleans.html">5.6.2. Booleans instellen</a></span></dt><dt><span class="section"><a href="sect-Security-Enhanced_Linux-Booleans-Booleans_for_NFS_and_CIFS.html">5.6.3. Booleans voor NFS en CIFS</a></span></dt></dl></dd><dt><span class="section"><a href="sect-Security-Enhanced_Linux-Working_with_SELinux-SELinux_Contexts_Labeling_Files.html">5.7. SELinux context - Bestanden labelen</a></span></dt><dd><dl><dt><span class="section"><a href="sect-Security-Enhanced_Linux-Working_with_SELinux-SELinux_Contexts_Labeling_Files.html#sect-Security-Enhanced_Linux-SELinux_Contexts_Labeling_Files-Temporary_Changes_chcon">5.7.1. Tijdelijke veranderingen: chcon</a></span></dt><dt><span class="section"><a href
="sect-Security-Enhanced_Linux-SELinux_Contexts_Labeling_Files-Persistent_Changes_semanage_fcontext.html">5.7.2. Permanente veranderingen: semanage fcontext</a></span></dt></dl></dd><dt><span class="section"><a href="sect-Security-Enhanced_Linux-Working_with_SELinux-The_file_t_and_default_t_Types.html">5.8. De file_t en default_t types</a></span></dt><dt><span class="section"><a href="sect-Security-Enhanced_Linux-Working_with_SELinux-Mounting_File_Systems.html">5.9. Het aankoppelen van bestandssystemen</a></span></dt><dd><dl><dt><span class="section"><a href="sect-Security-Enhanced_Linux-Working_with_SELinux-Mounting_File_Systems.html#sect-Security-Enhanced_Linux-Mounting_File_Systems-Context_Mounts">5.9.1. Context aankoppelingen</a></span></dt><dt><span class="section"><a href="sect-Security-Enhanced_Linux-Mounting_File_Systems-Changing_the_Default_Context.html">5.9.2. De standaard context veranderen</a></span></dt><dt><span class="section"><a href="sect-Security-Enhanced_L
inux-Mounting_File_Systems-Mounting_an_NFS_File_System.html">5.9.3. Het aankoppelen van een NFS bestandssysteem</a></span></dt><dt><span class="section"><a href="sect-Security-Enhanced_Linux-Mounting_File_Systems-Multiple_NFS_Mounts.html">5.9.4. Meerdere NFS aankoppelingen</a></span></dt><dt><span class="section"><a href="sect-Security-Enhanced_Linux-Mounting_File_Systems-Making_Context_Mounts_Persistent.html">5.9.5. Maak de context aankoppelingen blijvend</a></span></dt></dl></dd><dt><span class="section"><a href="sect-Security-Enhanced_Linux-Working_with_SELinux-Maintaining_SELinux_Labels_.html">5.10. Het onderhouden van SELinux labels </a></span></dt><dd><dl><dt><span class="section"><a href="sect-Security-Enhanced_Linux-Working_with_SELinux-Maintaining_SELinux_Labels_.html#sect-Security-Enhanced_Linux-Maintaining_SELinux_Labels_-Copying_Files_and_Directories">5.10.1. Bestanden en mappen kopiëren</a></span></dt><dt><span class="section"><a href="sect-Security-Enhanced_Li
nux-Maintaining_SELinux_Labels_-Moving_Files_and_Directories.html">5.10.2. Bestanden en mappen verplaatsen</a></span></dt><dt><span class="section"><a href="sect-Security-Enhanced_Linux-Maintaining_SELinux_Labels_-Checking_the_Default_SELinux_Context.html">5.10.3. Het controleren van de standaard SELinux context</a></span></dt><dt><span class="section"><a href="sect-Security-Enhanced_Linux-Maintaining_SELinux_Labels_-Archiving_Files_with_tar.html">5.10.4. Bestanden archiveren met tar</a></span></dt><dt><span class="section"><a href="sect-Security-Enhanced_Linux-Maintaining_SELinux_Labels_-Archiving_Files_with_star.html">5.10.5. Bestanden archiveren met star</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="chap-Security-Enhanced_Linux-Confining_Users.html">6. Gebruikers beperken</a></span></dt><dd><dl><dt><span class="section"><a href="chap-Security-Enhanced_Linux-Confining_Users.html#sect-Security-Enhanced_Linux-Confining_Users-Linux_and_SELinux_User_Map
pings">6.1. Linix en SELinux gebruiker afbeelding</a></span></dt><dt><span class="section"><a href="sect-Security-Enhanced_Linux-Confining_Users-Confining_New_Linux_Users_useradd.html">6.2. Nieuwe Linux gebruikers beperken: useradd</a></span></dt><dt><span class="section"><a href="sect-Security-Enhanced_Linux-Confining_Users-Confining_Existing_Linux_Users_semanage_login.html">6.3. Bestaande Linux gebruikers beperken: semanage login</a></span></dt><dt><span class="section"><a href="sect-Security-Enhanced_Linux-Confining_Users-Changing_the_Default_Mapping.html">6.4. De standaard afbeelbing veranderen</a></span></dt><dt><span class="section"><a href="sect-Security-Enhanced_Linux-Confining_Users-xguest_Kiosk_Mode.html">6.5. xguest: kiosk modus</a></span></dt><dt><span class="section"><a href="sect-Security-Enhanced_Linux-Confining_Users-Booleans_for_Users_Executing_Applications.html">6.6. Booleans voor gebruikers die toepassingen uitvoeren</a></span></dt></dl></dd><dt><span clas
s="chapter"><a href="chap-Security-Enhanced_Linux-Troubleshooting.html">7. Foutzoeken</a></span></dt><dd><dl><dt><span class="section"><a href="chap-Security-Enhanced_Linux-Troubleshooting.html#sect-Security-Enhanced_Linux-Troubleshooting-What_Happens_when_Access_is_Denied">7.1. Wat gebeurt er als toegang wordt geweigerd</a></span></dt><dt><span class="section"><a href="sect-Security-Enhanced_Linux-Troubleshooting-Top_Three_Causes_of_Problems.html">7.2. De top drie oorzaken van problemen</a></span></dt><dd><dl><dt><span class="section"><a href="sect-Security-Enhanced_Linux-Troubleshooting-Top_Three_Causes_of_Problems.html#sect-Security-Enhanced_Linux-Top_Three_Causes_of_Problems-Labeling_Problems">7.2.1. Labelings problemen</a></span></dt><dt><span class="section"><a href="sect-Security-Enhanced_Linux-Top_Three_Causes_of_Problems-How_are_Confined_Services_Running.html">7.2.2. Hoe draaien beperkte services?</a></span></dt><dt><span class="section"><a href="sect-Security-Enhan
ced_Linux-Top_Three_Causes_of_Problems-Evolving_Rules_and_Broken_Applications.html">7.2.3. Het ontwikkelen van regels en gebrekkige toepassingen</a></span></dt></dl></dd><dt><span class="section"><a href="sect-Security-Enhanced_Linux-Troubleshooting-Fixing_Problems.html">7.3. Problemen herstellen</a></span></dt><dd><dl><dt><span class="section"><a href="sect-Security-Enhanced_Linux-Troubleshooting-Fixing_Problems.html#sect-Security-Enhanced_Linux-Fixing_Problems-Linux_Permissions">7.3.1. Linux rechten</a></span></dt><dt><span class="section"><a href="sect-Security-Enhanced_Linux-Fixing_Problems-Possible_Causes_of_Silent_Denials.html">7.3.2. Mogelijke oorzaken van stille weigeringen</a></span></dt><dt><span class="section"><a href="sect-Security-Enhanced_Linux-Fixing_Problems-Manual_Pages_for_Services.html">7.3.3. Manual pagina's voor services</a></span></dt><dt><span class="section"><a href="sect-Security-Enhanced_Linux-Fixing_Problems-Permissive_Domains.html">7.3.4. Toelate
nde domeinen</a></span></dt><dt><span class="section"><a href="sect-Security-Enhanced_Linux-Fixing_Problems-Searching_For_and_Viewing_Denials.html">7.3.5. Zoeken naar en het bekijken van weigeringen</a></span></dt><dt><span class="section"><a href="sect-Security-Enhanced_Linux-Fixing_Problems-Raw_Audit_Messages.html">7.3.6. Ruwe audit boodschappen</a></span></dt><dt><span class="section"><a href="sect-Security-Enhanced_Linux-Fixing_Problems-sealert_Messages.html">7.3.7. sealert boodschappen</a></span></dt><dt><span class="section"><a href="sect-Security-Enhanced_Linux-Fixing_Problems-Allowing_Access_audit2allow.html">7.3.8. Toegang toestaan: audit2allow</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="chap-Security-Enhanced_Linux-Further_Information.html">8. Verdere informatie</a></span></dt><dd><dl><dt><span class="section"><a href="chap-Security-Enhanced_Linux-Further_Information.html#sect-Security-Enhanced_Linux-Further_Information-Contributors">8.1.
Contributors</a></span></dt><dt><span class="section"><a href="sect-Security-Enhanced_Linux-Further_Information-Other_Resources.html">8.2. Other Resources</a></span></dt></dl></dd><dt><span class="appendix"><a href="appe-Security-Enhanced_Linux-Revision_History.html">A. Revision History</a></span></dt></dl></div></div><ul class="docnav"><li class="previous"/><li class="next"><a accesskey="n" href="pref-Security-Enhanced_Linux-Preface.html"><strong>Volgende</strong>Voorwoord</a></li></ul></body></html>
--- NEW FILE pr01s02.html ---
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>2. We hebben terugkoppeling nodig!</title><link rel="stylesheet" href="./Common_Content/css/default.css" type="text/css"/><meta name="generator" content="publican"/><meta name="package" content="Fedora-Security-Enhanced_Linux-11-nl-NL-1.3-SELinux_User_guide"/><link rel="home" href="index.html" title="Security-Enhanced Linux"/><link rel="up" href="pref-Security-Enhanced_Linux-Preface.html" title="Voorwoord"/><link rel="prev" href="pref-Security-Enhanced_Linux-Preface.html" title="Voorwoord"/><link rel="next" href="chap-Security-Enhanced_Linux-Trademark_Information.html" title="Hoofdstuk 1. Handelsmerk informatie"/></head><body class=""><p id="title"><a class="left" href="http://www.fedoraproject.org"><img src="Common_Content/images/image_left.png" alt="Product Site"/></a><a class="right" href="http://docs.fedoraproject.org"><img src="Common_Content/images/image_right.png" alt="Documentation Site"/></a></p><ul class="docna
v"><li class="previous"><a accesskey="p" href="pref-Security-Enhanced_Linux-Preface.html"><strong>Terug</strong></a></li><li class="next"><a accesskey="n" href="chap-Security-Enhanced_Linux-Trademark_Information.html"><strong>Volgende</strong></a></li></ul><div class="section" lang="nl-NL"><div class="titlepage"><div><div><h2 class="title" id="d0e426">2. We hebben terugkoppeling nodig!</h2></div></div></div><a id="d0e429" class="indexterm"/><div class="para">
Indien u een typografische fout in deze handleiding vindt, of u weet een manier om deze handleiding te verbeteren, zouden wij dat graag van u horen! Meldt u alstublieft fouten in de uitgave <span class="application"><strong>Fedora Documentation</strong></span> via Bugzilla: <a href="http://bugzilla.redhat.com/bugzilla/">http://bugzilla.redhat.com/bugzilla/</a>.
</div><div class="para">
Indien u fouten meldt, vergeet dan alstublieft niet het kenmerk: <em class="citetitle">selinux-user-guide</em> te vermelden.
</div><div class="para">
Indien u suggesties hebt om de documentatie te verbeteren, probeer dan zo duidelijk mogelijk deze suggesties te omschrijven. Indien u fouten hebt ontdekt, vermeldt dan alstublieft het sectienummer en wat omringende tekst, opdat we de fout makkelijker kunnen vinden.
</div></div><ul class="docnav"><li class="previous"><a accesskey="p" href="pref-Security-Enhanced_Linux-Preface.html"><strong>Terug</strong>Voorwoord</a></li><li class="up"><a accesskey="u" href="#"><strong>Omhoog</strong></a></li><li class="home"><a accesskey="h" href="index.html"><strong>Begin</strong></a></li><li class="next"><a accesskey="n" href="chap-Security-Enhanced_Linux-Trademark_Information.html"><strong>Volgende</strong>Hoofdstuk 1. Handelsmerk informatie</a></li></ul></body></html>
--- NEW FILE pref-Security-Enhanced_Linux-Preface.html ---
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Voorwoord</title><link rel="stylesheet" href="./Common_Content/css/default.css" type="text/css"/><meta name="generator" content="publican"/><meta name="package" content="Fedora-Security-Enhanced_Linux-11-nl-NL-1.3-SELinux_User_guide"/><link rel="home" href="index.html" title="Security-Enhanced Linux"/><link rel="up" href="index.html" title="Security-Enhanced Linux"/><link rel="prev" href="index.html" title="Security-Enhanced Linux"/><link rel="next" href="pr01s02.html" title="2. We hebben terugkoppeling nodig!"/></head><body class=""><p id="title"><a class="left" href="http://www.fedoraproject.org"><img src="Common_Content/images/image_left.png" alt="Product Site"/></a><a class="right" href="http://docs.fedoraproject.org"><img src="Common_Content/images/image_right.png" alt="Documentation Site"/></a></p><ul class="docnav"><li class="previous"><a accesskey="p" href="index.html"><strong>Terug</strong></a></li><li class="ne
xt"><a accesskey="n" href="pr01s02.html"><strong>Volgende</strong></a></li></ul><div class="preface" lang="nl-NL"><div class="titlepage"><div><div><h1 id="pref-Security-Enhanced_Linux-Preface" class="title">Voorwoord</h1></div></div></div><div class="para">
De Fedora 11 SELinux gebruikers gids is voor mensen met minimale of geen ervaring met SELinux. Hoewel systeembeheer ervaring niet noodzakelijk is, is de inhoud van deze gids geschreven voor systeembeheer taken. Deze gids biedt een inleiding voor fundamentele concepten en practische toepassingen van SELinux. Na lezing van deze gids moet je een redelijk begrip hebben van SELinux.
</div><div class="para">
Dank je voor iedereen die aanmoediging, hulp en testen aanbood - het wordt zeer gewaardeerd. Met een speciale dank aan:
</div><div class="itemizedlist"><ul><li><div class="para">
Dominick Grift, Stephen Smalley, en Russell Coker voor hun bijdrages, hulp, en geduld.
</div></li><li><div class="para">
Karsten Wade voor zijn hulp, het toevoegen van een component voor deze gids aan <a href="https://bugzilla.redhat.com/"> Red Hat Bugzilla</a>, en voor het uitzoeken van web onderdak op <a href="http://docs.fedoraproject.org/">http://docs.fedoraproject.org/</a>.
</div></li><li><div class="para">
Het <a href="http://fedoraproject.org/wiki/Infrastructure">Fedora Infrastructure Team</a> voor het geven van onderdak.
</div></li><li><div class="para">
Jens-Ulrik Petersen voor het zorgen dat Red Hat Brisbane up-to-date Fedora spiegels heeft.
</div></li></ul></div><div class="section" lang="nl-NL"><div class="titlepage"><div><div><h2 class="title" id="d0e158">1. Document Conventie</h2></div></div></div><div class="para">
Dit handboek hanteert verscheidene conventies om bepaalde woorden of zinsdelen te benadrukken en aandacht te vestigen op specifieke delen van informatie.
</div><div class="para">
In PDF en papieren edities gebruikt dit handboek <a href="https://fedorahosted.org/liberation-fonts/">Liberation Fonts set</a> lettertypen. Het Liberation lettertype wordt ook gebruikt in HTML-edities indien dit lettertype op uw computer geïnstalleerd is. Indien dat niet het geval is, worden alternatieve, gelijkwaardige lettertypen gebruikt. Noot: bij Red Hat Enterprise Linux 5 en later wordt de Liberation Font set standaard meegeleverd.
</div><div class="section" lang="nl-NL"><div class="titlepage"><div><div><h3 class="title" id="d0e168">1.1. Typografische Conventies</h3></div></div></div><div class="para">
Vier typografische conventies worden gebruikt om aandacht te vestigen op specifieke woorden en zinsdelen. Deze conventies -en de omstandigheden waaronder zij gebruikt worden- luiden als volgt:
</div><div class="para">
<code class="literal">Mono-spaced Bold</code>
</div><div class="para">
Wordt gebruikt om systeem input, waaronder shell commando's, bestandsnamen en paden aan te geven. Wordt ook gebruikt bij toetsaanduiding of toetsencombinaties. Voorbeeld:
</div><div class="blockquote"><blockquote class="blockquote"><div class="para">
Om de inhoud van het bestand <code class="filename">mijn_onwijsgoed_verkopende_boek</code> in uw huidige directory te zien, voert u het commando <code class="command">cat mijn_onwijsgoed_verkopende_boek</code> in bij de shell-prompt en drukt u op <span class="keycap"><strong>Enter</strong></span> om het commando uit te laten voeren.
</div></blockquote></div><div class="para">
Bovenstaande bevat een bestandsnaam, een shell-commando en een toetsaanduiding, alle getoond in Mono-spaced Bold en alle te onderscheiden dankzij hun context.
</div><div class="para">
Toetsencombinaties kunnen worden onderscheiden van toetsaanduiding door het plusteken dat elk deel van een toetsencombinatie aan elkaar verbind. Voorbeeld:
</div><div class="blockquote"><blockquote class="blockquote"><div class="para">
Druk op <span class="keycap"><strong>Enter</strong></span> om het commando te laten uitvoeren.
</div><div class="para">
Druk op <span class="keycap"><strong>Ctrl</strong></span>+<span class="keycap"><strong>Alt</strong></span>+<span class="keycap"><strong>F1</strong></span> om naar de eerste virtuele terminal over te schakelen. Druk op <span class="keycap"><strong>Ctrl</strong></span>+<span class="keycap"><strong>Alt</strong></span>+<span class="keycap"><strong>F7</strong></span> om terug te keren naar uw X-Windows sessie.
</div></blockquote></div><div class="para">
De eerste zin benadrukt de bepaalde toets die moet worden ingedrukt. De tweede benadrukt twee reeksen van drie toetsen, waarbij de toetsen van elke reeks tegelijk moet worden ingedrukt.
</div><div class="para">
Indien broncode wordt besproken, worden klassennamen, functies, variabele namen en resultaten die in een paragraaf worden genoemd, weergegeven als hier boven afgedrukt, namelijk in <code class="literal">Mono-spaced Bold</code>. Voorbeeld:
</div><div class="blockquote"><blockquote class="blockquote"><div class="para">
Onder bestandsgerelateerde klassen vallen <code class="classname">filesystem</code> voor bestandsystemen, <code class="classname">file</code> voor bestanden, en <code class="classname">dir</code> voor directories. Elke klasse heeft haar eigen set van permissies.
</div></blockquote></div><div class="para">
<span class="application"><strong>Proportional Bold</strong></span>
</div><div class="para">
Wordt gebruikt om woorden of zinsdelen op een systeem aan te duiden, waaronder applicatie namen, dialoogtekst-boxen, gelabelde toetsen, checkbox en radiobutton labels, menutitels en submenutitels. Voorbeeld:
</div><div class="blockquote"><blockquote class="blockquote"><div class="para">
Kies <span class="guimenu"><strong>Systeem > Voorkeuren > Muis</strong></span> uit de hoofdmenubalk om <span class="application"><strong>Muis Voorkeuren</strong></span> te openen. In de <span class="guilabel"><strong>Knoppen</strong></span> tab, klik de <span class="guilabel"><strong>Linkshandige muis</strong></span> checkbox aan en klik <span class="guibutton"><strong>Sluiten</strong></span> om de primaire muisknop van links naar rechts te wisselen (waardoor de muis beter geschikt is geworden voor linkshandig gebruik).
</div><div class="para">
Om een speciaal teken in een <span class="application"><strong>gedit</strong></span> bestand op te nemen, kiest u <span class="guimenu"><strong>Toepassingen > Hulpmiddelen > Tekentabel</strong></span> uit de hoofdmenubalk. Vervolgens kiest u <span class="guimenu"><strong>Zoeken > Find…</strong></span> uit de <span class="application"><strong>Tekentabel</strong></span> menubalk, typ de naam van het teken in het <span class="guilabel"><strong>Zoek</strong></span> veld en klik <span class="guibutton"><strong>Volgende</strong></span>. Het teken dat u zoekt zal worden gemarkeerd in de <span class="guilabel"><strong>Tekentafel</strong></span>. Dubbel-klik op dit teken om het in de <span class="guilabel"><strong>Te kopiëren tekst</strong></span> veld op te nemen en klik dan de <span class="guibutton"><strong>Kopiëren</strong></span> knop. Keer terug naar uw document en kies <span class="guimenu"><strong>Bewerken > Plakken</strong></span> uit de <span class="appli
cation"><strong>gedit</strong></span> menubalk.
</div></blockquote></div><div class="para">
De bovenstaande tekst bevat applicatienamen, systeemwijde menunamen en onderdelen, applicatie specifieke menunamen, en knoppen en tekst van een GUI-interface, alle vertoond in Proportional Bold en alle te onderscheiden dankzij hun context.
</div><div class="para">
Merk het <span class="guimenu"><strong>></strong></span>-teken op, gebruikt om aan te geven dat door een menu en sub-menu wordt gelopen. Dit voorkomt het gebruik van de nogal omslachtige 'Selecteer <span class="guimenuitem"><strong>Muis</strong></span> van het <span class="guimenu"><strong>Voorkeuren</strong></span> sub-menu in het <span class="guimenu"><strong>Systeem</strong></span> menu uit de hoofdmenubalk'-omschrijvingen.
</div><div class="para">
<code class="command"> <em class="replaceable"><code>Mono-spaced Bold Italic</code></em> </code> of <span class="application"><strong> <em class="replaceable"><code>Proportional Bold Italic</code></em> </strong></span>
</div><div class="para">
Mono-spaced Bold of Proportional Bold behandelt indien cursief gedrukt altijd vervangbare of wisselende teksten. Cursief wijst op niet letterlijke tekst of toont tekst dat wisselt naar omstandigheden. Voorbeeld:
</div><div class="blockquote"><blockquote class="blockquote"><div class="para">
Om verbinding te maken met een andere computer met behulp van ssh, typt u <code class="command">ssh <em class="replaceable"><code>gebruikersnaam</code></em>@<em class="replaceable"><code>domein.naam</code></em> </code> bij een shell prompt.
</div><div class="para">
Het <code class="command">mount -o remount <em class="replaceable"><code>file-system</code></em> </code> commando mount opnieuw het genoemde bestandsysteem. Om bijvoorbeeld het <code class="filename">/home</code> bestandsysteem opnieuw te mounten, gebruikt men het <code class="command">mount -o remount /home</code> commando.
</div><div class="para">
Om de versie van een huidig geïnstalleerd pakket te zien, gebruikt u het <code class="command">rpm -q <em class="replaceable"><code>package</code></em> </code> commando. Dit zal het volgende resultaat opleveren: <code class="command"> <em class="replaceable"><code>package-version-release</code></em> </code>.
</div></blockquote></div><div class="para">
Let op de woorden in bold italics in bovenstaande tekst — username, domain.name, file-system, package, version en release. Elk woord is een [plaatshouder], hetzij voor tekst dat u invult indien u een commando typt, hetzij voor tekst die door het systeem wordt getoond.
</div><div class="para">
Buiten het standaard gebruik bij het presenteren van een titel van een werk, wordt cursief ingezet om het eerste gebruik van een nieuwe en belangrijke term te benadrukken. Voorbeeld:
</div><div class="blockquote"><blockquote class="blockquote"><div class="para">
Wanneer de Apache HTTP Server verzoeken accepteert, zet het childprocessen of threads ter afhandeling in. Deze groep van childprocessen of threads staan bekend als een <em class="firstterm">server-pool</em>. Onder Apache HTTP Server 2.0 is de verantwoordelijkheid voor het creëren en onderhouden van deze server-pools toegewezen aan een groep modules genaamd <em class="firstterm">Multi-Processing Modules</em> (<em class="firstterm">MPMs</em>). Anders dan bij de andere modules kan slechts één module van de MPM groep door de Apache HTTP Server geladen zijn.
</div></blockquote></div></div><div class="section" lang="nl-NL"><div class="titlepage"><div><div><h3 class="title" id="d0e387">1.2. Pull-quote Conventies</h3></div></div></div><div class="para">
Twee, normaal gesproken uit meerdere regels bestaande, datatypes worden visueel van de omringende tekst gescheiden.
</div><div class="para">
Tekst gezonden naar een terminal wordt getoond in <code class="computeroutput">Mono-spaced Roman</code> en als volgt gepresenteerd:
</div><pre class="screen">books Desktop documentation drafts mss photos stuff svn
books_tests Desktop1 downloads images notes scripts svgs
</pre><div class="para">
Opsommingen van broncode worden ook vertoond in <code class="computeroutput">Mono-spaced Roman</code> maar worden alsvolgt gepresenteerd en benadrukt:
</div><pre class="programlisting">package org.jboss.book.jca.ex1;
import javax.naming.InitialContext;
public class ExClient
{
public static void main(String args[])
throws Exception
{
InitialContext iniCtx = new InitialContext();
Object ref = iniCtx.lookup("EchoBean");
EchoHome home = (EchoHome) ref;
Echo echo = home.create();
System.out.println("Created Echo");
System.out.println("Echo.echo('Hello') = " + echo.echo("Hello"));
}
}
</pre></div><div class="section" lang="nl-NL"><div class="titlepage"><div><div><h3 class="title" id="d0e406">1.3. Noten en waarschuwingen</h3></div></div></div><div class="para">
Tenslotte gebruiken we drie visuele stijlen om aandacht te vestigen op informatie die anders misschien over het hoofd zou worden gezien.
</div><div class="note"><h2>Noot</h2><div class="para">
A Note is a tip or shortcut or alternative approach to the task at hand. Ignoring a note should have no negative consequences, but you might miss out on a trick that makes your life easier.
</div></div><div class="important"><h2>Belangrijk</h2><div class="para">
Important boxes detail things that are easily missed: configuration changes that only apply to the current session, or services that need restarting before an update will apply. Ignoring Important boxes won't cause data loss but may cause irritation and frustration.
</div></div><div class="warning"><h2>Waarschuwing</h2><div class="para">
Een waarschuwing dient niet genegeerd te worden. Waarschuwingen negeren zal ongetwijfeld leiden tot data- en haarverlies.
</div></div></div></div></div><ul class="docnav"><li class="previous"><a accesskey="p" href="index.html"><strong>Terug</strong>Security-Enhanced Linux</a></li><li class="up"><a accesskey="u" href="#"><strong>Omhoog</strong></a></li><li class="home"><a accesskey="h" href="index.html"><strong>Begin</strong></a></li><li class="next"><a accesskey="n" href="pr01s02.html"><strong>Volgende</strong>2. We hebben terugkoppeling nodig!</a></li></ul></body></html>
--- NEW FILE sect-Security-Enhanced_Linux-Booleans-Booleans_for_NFS_and_CIFS.html ---
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>5.6.3. Booleans voor NFS en CIFS</title><link rel="stylesheet" href="./Common_Content/css/default.css" type="text/css"/><meta name="generator" content="publican"/><meta name="package" content="Fedora-Security-Enhanced_Linux-11-nl-NL-1.3-SELinux_User_guide"/><link rel="home" href="index.html" title="Security-Enhanced Linux"/><link rel="up" href="sect-Security-Enhanced_Linux-Working_with_SELinux-Booleans.html" title="5.6. Booleans"/><link rel="prev" href="sect-Security-Enhanced_Linux-Booleans-Configuring_Booleans.html" title="5.6.2. Booleans instellen"/><link rel="next" href="sect-Security-Enhanced_Linux-Working_with_SELinux-SELinux_Contexts_Labeling_Files.html" title="5.7. SELinux context - Bestanden labelen"/></head><body class=""><p id="title"><a class="left" href="http://www.fedoraproject.org"><img src="Common_Content/images/image_left.png" alt="Product Site"/></a><a class="right" href="http://docs.fedoraproject.org"><
img src="Common_Content/images/image_right.png" alt="Documentation Site"/></a></p><ul class="docnav"><li class="previous"><a accesskey="p" href="sect-Security-Enhanced_Linux-Booleans-Configuring_Booleans.html"><strong>Terug</strong></a></li><li class="next"><a accesskey="n" href="sect-Security-Enhanced_Linux-Working_with_SELinux-SELinux_Contexts_Labeling_Files.html"><strong>Volgende</strong></a></li></ul><div class="section" lang="nl-NL"><div class="titlepage"><div><div><h3 class="title" id="sect-Security-Enhanced_Linux-Booleans-Booleans_for_NFS_and_CIFS">5.6.3. Booleans voor NFS en CIFS</h3></div></div></div><div class="para">
Standaard zijn NFS aankoppelingen op de client zijde gelabeld met een standaard context gedefinieerd door tactiek voor NFS bestandssystemen. In algemene tactieken gebruikt deze standaard context het <code class="computeroutput">nfs_t</code> type. En ook zijn standaard Samba delingen aangekoppeld op de client zijde gelabeld met een standaard context gedefinieerd door tactiek. In algemene tactieken gebruikt deze standaard context het <code class="computeroutput">cifs_t</code> type.
</div><div class="para">
Afhankelijk van de tactiek instelling, kunnen services niet in staat zijn om bestanden gelabeld met de <code class="computeroutput">nfs_t</code> of <code class="computeroutput">cifs_t</code> types te lezen. Dit kan bestandssystemen die met deze types gelabeld zijn beletten om aangekoppeld te worden en daarna gelezen of geexporteerd te worden door andere services. Booleans kunnen aan of uit gezet worden om te bepalen welke services toestemming hebben om toegang te krijgen tot de <code class="computeroutput">nfs_t</code> ene<code class="computeroutput">cifs_t</code> types.
</div><div class="para">
De <code class="command">setsebool</code> en <code class="command">semanage</code> commando's moeten uitgevoerd worden als de Linux root gebruiker. Het <code class="command">setsebool -P</code> commando maakt blijvende veranderingen. Gebruik de <code class="option">-P</code> optie niet als je niet wilt dat veranderingen blijvend zijn na het opnieuw opstarten van het systeem:
</div><div class="formalpara"><h5 class="formalpara" id="form-Security-Enhanced_Linux-Booleans_for_NFS_and_CIFS-Apache_HTTP_Server">Apache HTTP server</h5>
Om toegang toe te staan voor NFS bestandssystemen (bestanden gelabeld met het <code class="computeroutput">nfs_t</code> type):
</div><div class="para">
<code class="command">/usr/sbin/setsebool -P httpd_use_nfs on</code>
</div><div class="para">
Om toegang toe te staan tot Samba bestandsystemen (bestanden gelabeld met het <code class="computeroutput">cifs_t</code> type):
</div><div class="para">
<code class="command">/usr/sbin/setsebool -P httpd_use_cifs on</code>
</div><div class="formalpara"><h5 class="formalpara" id="form-Security-Enhanced_Linux-Booleans_for_NFS_and_CIFS-Samba">Samba</h5>
Om NFS bestandssystemen te exporteren:
</div><div class="para">
<code class="command">/usr/sbin/setsebool -P samba_share_nfs on</code>
</div><div class="formalpara"><h5 class="formalpara" id="form-Security-Enhanced_Linux-Booleans_for_NFS_and_CIFS-FTP_vsftpd">FTP (<code class="systemitem">vsftpd</code>)</h5>
Om toegang toe te staan tot NFS bestandssystemen:
</div><div class="para">
<code class="command">/usr/sbin/setsebool -P allow_ftpd_use_nfs on</code>
</div><div class="para">
Om toegang toe te staan tot Samba bestandssystemen:
</div><div class="para">
<code class="command">/usr/sbin/setsebool -P allow_ftpd_use_cifs on</code>
</div><div class="formalpara"><h5 class="formalpara" id="form-Security-Enhanced_Linux-Booleans_for_NFS_and_CIFS-Other_Services">Andere services</h5>
Voor een lijst van aan NFS gerelateerde Booleans voor andere services:
</div><div class="para">
<code class="command">/usr/sbin/semanage boolean -l | grep nfs</code>
</div><div class="para">
Voor een lijst van aan Samba gerelateerde Booleans voor andere services:
</div><div class="para">
<code class="command">/usr/sbin/semanage boolean -l | grep cifs</code>
</div><div class="note"><h2>Opmerking</h2><div class="para">
Deze Booleans bestaan in SELinux tactiek zoals verstuurd met Fedora 11. Ze kunnen misschien niet bestaan in tactiek verstuurd met andere versies van Fedora of andere operating systemen.
</div></div></div><ul class="docnav"><li class="previous"><a accesskey="p" href="sect-Security-Enhanced_Linux-Booleans-Configuring_Booleans.html"><strong>Terug</strong>5.6.2. Booleans instellen</a></li><li class="up"><a accesskey="u" href="#"><strong>Omhoog</strong></a></li><li class="home"><a accesskey="h" href="index.html"><strong>Begin</strong></a></li><li class="next"><a accesskey="n" href="sect-Security-Enhanced_Linux-Working_with_SELinux-SELinux_Contexts_Labeling_Files.html"><strong>Volgende</strong>5.7. SELinux context - Bestanden labelen</a></li></ul></body></html>
--- NEW FILE sect-Security-Enhanced_Linux-Booleans-Configuring_Booleans.html ---
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>5.6.2. Booleans instellen</title><link rel="stylesheet" href="./Common_Content/css/default.css" type="text/css"/><meta name="generator" content="publican"/><meta name="package" content="Fedora-Security-Enhanced_Linux-11-nl-NL-1.3-SELinux_User_guide"/><link rel="home" href="index.html" title="Security-Enhanced Linux"/><link rel="up" href="sect-Security-Enhanced_Linux-Working_with_SELinux-Booleans.html" title="5.6. Booleans"/><link rel="prev" href="sect-Security-Enhanced_Linux-Working_with_SELinux-Booleans.html" title="5.6. Booleans"/><link rel="next" href="sect-Security-Enhanced_Linux-Booleans-Booleans_for_NFS_and_CIFS.html" title="5.6.3. Booleans voor NFS en CIFS"/></head><body class=""><p id="title"><a class="left" href="http://www.fedoraproject.org"><img src="Common_Content/images/image_left.png" alt="Product Site"/></a><a class="right" href="http://docs.fedoraproject.org"><img src="Common_Content/images/image_right.pn
g" alt="Documentation Site"/></a></p><ul class="docnav"><li class="previous"><a accesskey="p" href="sect-Security-Enhanced_Linux-Working_with_SELinux-Booleans.html"><strong>Terug</strong></a></li><li class="next"><a accesskey="n" href="sect-Security-Enhanced_Linux-Booleans-Booleans_for_NFS_and_CIFS.html"><strong>Volgende</strong></a></li></ul><div class="section" lang="nl-NL"><div class="titlepage"><div><div><h3 class="title" id="sect-Security-Enhanced_Linux-Booleans-Configuring_Booleans">5.6.2. Booleans instellen</h3></div></div></div><div class="para">
Het <code class="command">setsebool <em class="replaceable"><code>boolean-naam</code></em> <em class="replaceable"><code>x</code></em></code> commando zet Booleans aan of uit, waarin <em class="replaceable"><code>boolean-naam</code></em> de naam van een Boolean is, en <em class="replaceable"><code>x</code></em> of <code class="option">on</code> is om de Boolean aan te zetten, of <code class="option">off</code> is om hem uit te zetten.
</div><div class="para">
Het volgende voorbeeld laat het instellen van de <code class="computeroutput">httpd_can_network_connect_db</code> Boolean zien:
</div><div class="orderedlist"><ol><li><div class="para">
Standaard is de <code class="computeroutput">httpd_can_network_connect_db</code> Boolean uit, wat Apache HTTP scripts en modules belet om te verbinden met database servers:
</div><pre class="screen">$ /usr/sbin/getsebool httpd_can_network_connect_db
httpd_can_network_connect_db --> off
</pre></li><li><div class="para">
Om Apache HTTP server scripts en modules tijdelijk toe te staan om te verbinden met database servers, voer je het <code class="command">setsebool httpd_can_network_connect_db on</code> commando uit als de Linux root gebruiker.
</div></li><li><div class="para">
Gebruik het <code class="command">getsebool httpd_can_network_connect_db</code> commando om te bevestigen dat de Boolean aangezet is:
</div><pre class="screen">$ /usr/sbin/getsebool httpd_can_network_connect_db
httpd_can_network_connect_db --> on
</pre><div class="para">
Dit staat Apache HTTP server scripts en modules toe om te verbinden met de datadase server.
</div></li><li><div class="para">
Deze verandering is niet blijvend na een systeem herstart. Om de veranderingen blijvend te maken na het herstarten van het systeem, voer je het <code class="command">setsebool -P <em class="replaceable"><code>boolean-naam</code></em> on</code> commando uit als de Linux root gebruiker:
</div><pre class="screen"># /usr/sbin/setsebool -P httpd_can_network_connect_db on
</pre></li><li><div class="para">
Om tijdelijk terug te gaan naar het standaard gedrag, voer je als de Linux root gebruiker het <code class="command">setsebool httpd_can_network_connect_db off</code> commando uit. Voor veranderingen die blijvend zijn na het herstarten, voer je het <code class="command">setsebool -P httpd_can_network_connect_db off</code> commando uit.
</div></li></ol></div></div><ul class="docnav"><li class="previous"><a accesskey="p" href="sect-Security-Enhanced_Linux-Working_with_SELinux-Booleans.html"><strong>Terug</strong>5.6. Booleans</a></li><li class="up"><a accesskey="u" href="#"><strong>Omhoog</strong></a></li><li class="home"><a accesskey="h" href="index.html"><strong>Begin</strong></a></li><li class="next"><a accesskey="n" href="sect-Security-Enhanced_Linux-Booleans-Booleans_for_NFS_and_CIFS.html"><strong>Volgende</strong>5.6.3. Booleans voor NFS en CIFS</a></li></ul></body></html>
--- NEW FILE sect-Security-Enhanced_Linux-Confining_Users-Booleans_for_Users_Executing_Applications.html ---
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>6.6. Booleans voor gebruikers die toepassingen uitvoeren</title><link rel="stylesheet" href="./Common_Content/css/default.css" type="text/css"/><meta name="generator" content="publican"/><meta name="package" content="Fedora-Security-Enhanced_Linux-11-nl-NL-1.3-SELinux_User_guide"/><link rel="home" href="index.html" title="Security-Enhanced Linux"/><link rel="up" href="chap-Security-Enhanced_Linux-Confining_Users.html" title="Hoofdstuk 6. Gebruikers beperken"/><link rel="prev" href="sect-Security-Enhanced_Linux-Confining_Users-xguest_Kiosk_Mode.html" title="6.5. xguest: kiosk modus"/><link rel="next" href="chap-Security-Enhanced_Linux-Troubleshooting.html" title="Hoofdstuk 7. Foutzoeken"/></head><body class=""><p id="title"><a class="left" href="http://www.fedoraproject.org"><img src="Common_Content/images/image_left.png" alt="Product Site"/></a><a class="right" href="http://docs.fedoraproject.org"><img src="Common_Conten
t/images/image_right.png" alt="Documentation Site"/></a></p><ul class="docnav"><li class="previous"><a accesskey="p" href="sect-Security-Enhanced_Linux-Confining_Users-xguest_Kiosk_Mode.html"><strong>Terug</strong></a></li><li class="next"><a accesskey="n" href="chap-Security-Enhanced_Linux-Troubleshooting.html"><strong>Volgende</strong></a></li></ul><div class="section" lang="nl-NL"><div class="titlepage"><div><div><h2 class="title" id="sect-Security-Enhanced_Linux-Confining_Users-Booleans_for_Users_Executing_Applications">6.6. Booleans voor gebruikers die toepassingen uitvoeren</h2></div></div></div><div class="para">
Het niet toestaan aan Linux gebruikers om toepassingen (welke de rechten van de gebruiker erven) uit te voeren in hun persoonlijke mappen en <code class="filename">/tmp/</code>, waarnaar ze schrijfrechten hebben, helpt om te voorkomen van foutieve of kwaadwillige toepassingen bestanden veranderen waarvan de gebruiker eigenaar is. In Fedora 11 kunnen Linux gebruikers in de <code class="computeroutput">guest_t</code> en <code class="computeroutput">xguest_t</code> domeinen standaard geen toepassingen in hun persoonlijke mappen of in <code class="filename">/tmp/</code>; Linux gebruikers in de <code class="computeroutput">user_t</code> en <code class="computeroutput">staff_t</code> domeinen kunnen dit echter wel.
</div><div class="para">
Booleans zijn beschikbaar om dit gedrag te veranderen, en deze worden ingesteld met het <code class="command">setsebool</code> commando. Het <code class="command">setsebool</code> commando moet uitgevoerd worden als de Linux root gebruiker. Het <code class="command">setsebool -P</code> commando maakt de veranderingen blijvend. Geruik de <code class="option">-P</code> optie niet als je niet wilt dat veranderingen blijvend zijn na een nieuwe systeem opstart:
</div><div class="formalpara"><h5 class="formalpara" id="form-Security-Enhanced_Linux-Booleans_for_Users_Executing_Applications-guest_t">guest_t</h5>
Om Linux gebruikers in het <code class="computeroutput">guest_t</code> domein <span class="emphasis"><em>toe te staan</em></span> toepassingen uit te voeren in hun persoonlijke mappen en <code class="filename">/tmp/</code>:
</div><div class="para">
<code class="command">/usr/sbin/setsebool -P allow_guest_exec_content on</code>
</div><div class="formalpara"><h5 class="formalpara" id="form-Security-Enhanced_Linux-Booleans_for_Users_Executing_Applications-xguest_t">xguest_t</h5>
Om Linux gebruikers in het <code class="computeroutput">xguest_t</code> domein <span class="emphasis"><em>toe te staan</em></span> om toepassingen uit te voeren in hun persoonlijke mappen en <code class="filename">/tmp/</code>:
</div><div class="para">
<code class="command">/usr/sbin/setsebool -P allow_xguest_exec_content on</code>
</div><div class="formalpara"><h5 class="formalpara" id="form-Security-Enhanced_Linux-Booleans_for_Users_Executing_Applications-user_t">user_t</h5>
Om Linux gebruikers in het <code class="computeroutput">user_t</code> domein te <span class="emphasis"><em>beletten</em></span> om toepassingen uit te voeren in hun persoonlijke mappen en <code class="filename">/tmp/</code>:
</div><div class="para">
<code class="command">/usr/sbin/setsebool -P allow_user_exec_content off</code>
</div><div class="formalpara"><h5 class="formalpara" id="form-Security-Enhanced_Linux-Booleans_for_Users_Executing_Applications-staff_t">staff_t</h5>
Om Linux gebruikers in het <code class="computeroutput">staff_t</code> domein te <span class="emphasis"><em>beletten</em></span> toepassingen uit te voeren in hun persoonlijke mappen en <code class="filename">/tmp/</code>:
</div><div class="para">
<code class="command">/usr/sbin/setsebool -P allow_staff_exec_content off</code>
</div></div><ul class="docnav"><li class="previous"><a accesskey="p" href="sect-Security-Enhanced_Linux-Confining_Users-xguest_Kiosk_Mode.html"><strong>Terug</strong>6.5. xguest: kiosk modus</a></li><li class="up"><a accesskey="u" href="#"><strong>Omhoog</strong></a></li><li class="home"><a accesskey="h" href="index.html"><strong>Begin</strong></a></li><li class="next"><a accesskey="n" href="chap-Security-Enhanced_Linux-Troubleshooting.html"><strong>Volgende</strong>Hoofdstuk 7. Foutzoeken</a></li></ul></body></html>
--- NEW FILE sect-Security-Enhanced_Linux-Confining_Users-Changing_the_Default_Mapping.html ---
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>6.4. De standaard afbeelbing veranderen</title><link rel="stylesheet" href="./Common_Content/css/default.css" type="text/css"/><meta name="generator" content="publican"/><meta name="package" content="Fedora-Security-Enhanced_Linux-11-nl-NL-1.3-SELinux_User_guide"/><link rel="home" href="index.html" title="Security-Enhanced Linux"/><link rel="up" href="chap-Security-Enhanced_Linux-Confining_Users.html" title="Hoofdstuk 6. Gebruikers beperken"/><link rel="prev" href="sect-Security-Enhanced_Linux-Confining_Users-Confining_Existing_Linux_Users_semanage_login.html" title="6.3. Bestaande Linux gebruikers beperken: semanage login"/><link rel="next" href="sect-Security-Enhanced_Linux-Confining_Users-xguest_Kiosk_Mode.html" title="6.5. xguest: kiosk modus"/></head><body class=""><p id="title"><a class="left" href="http://www.fedoraproject.org"><img src="Common_Content/images/image_left.png" alt="Product Site"/></a><a class="right
" href="http://docs.fedoraproject.org"><img src="Common_Content/images/image_right.png" alt="Documentation Site"/></a></p><ul class="docnav"><li class="previous"><a accesskey="p" href="sect-Security-Enhanced_Linux-Confining_Users-Confining_Existing_Linux_Users_semanage_login.html"><strong>Terug</strong></a></li><li class="next"><a accesskey="n" href="sect-Security-Enhanced_Linux-Confining_Users-xguest_Kiosk_Mode.html"><strong>Volgende</strong></a></li></ul><div class="section" lang="nl-NL"><div class="titlepage"><div><div><h2 class="title" id="sect-Security-Enhanced_Linux-Confining_Users-Changing_the_Default_Mapping">6.4. De standaard afbeelbing veranderen</h2></div></div></div><div class="para">
Standaard worden in Fedora 11 Linux gebruikers afgebeeld op de SELinux <code class="computeroutput">__default__</code> login (welke afgebeeld wordt op de SELinux <code class="computeroutput">unconfined_u</code> gebruiker). Als je nieuwe Linux gebruikers, en Linux gebruikers die niet specifiek afgebeeld zijn op een SELinux gebruiker, standaard wilt instellen om beperkt te zijn, verander je de standaard afbeelding met het <code class="command">semanage login</code> commando.
</div><div class="para">
Bijvoorbeeld, voer het volgende commando uit als de Linux root gebruiker om de standaard afbeelding te veranderen van <code class="computeroutput">unconfined_u</code> naar <code class="computeroutput">user_u</code>:
</div><div class="para">
<code class="command">/usr/sbin/semanage login -m -S targeted -s "user_u" -r s0 __default__</code>
</div><div class="para">
Voer het <code class="command">semanage login -l</code> commando uit als de Linux root gebruiker om te bevestigen dat de <code class="computeroutput">__default__</code> login is afgebeeld op <code class="computeroutput">user_u</code>:
</div><pre class="screen"># /usr/sbin/semanage login -l
Login Name SELinux User MLS/MCS Range
__default__ user_u s0
root unconfined_u s0-s0:c0.c1023
system_u system_u s0-s0:c0.c1023
</pre><div class="para">
Als een nieuwe Linux gebruiker wordt aangemaakt en er wordt geen SELinux gebruiker opgegeven, of als een bestaande Linux gebruiker inlogt en niet overeenkomt met een specifieke regel in de <code class="command">semanage login -l</code> output, worden ze afgebeeld op <code class="computeroutput">user_u</code>, via de <code class="computeroutput">__default__</code> login.
</div><div class="para">
Om weer terug te gaan naar het standaard gedrag, voer je het volgende commando uit als de Linux root gebruiker om de <code class="computeroutput">__default__</code> login af te beelden op de SELinux <code class="computeroutput">unconfined_u</code> gebruiker:
</div><div class="para">
<pre class="screen">/usr/sbin/semanage login -m -S targeted -s "unconfined_u" -r\
s0-s0:c0.c1023 __default__
</pre>
</div></div><ul class="docnav"><li class="previous"><a accesskey="p" href="sect-Security-Enhanced_Linux-Confining_Users-Confining_Existing_Linux_Users_semanage_login.html"><strong>Terug</strong>6.3. Bestaande Linux gebruikers beperken: semanag...</a></li><li class="up"><a accesskey="u" href="#"><strong>Omhoog</strong></a></li><li class="home"><a accesskey="h" href="index.html"><strong>Begin</strong></a></li><li class="next"><a accesskey="n" href="sect-Security-Enhanced_Linux-Confining_Users-xguest_Kiosk_Mode.html"><strong>Volgende</strong>6.5. xguest: kiosk modus</a></li></ul></body></html>
--- NEW FILE sect-Security-Enhanced_Linux-Confining_Users-Confining_Existing_Linux_Users_semanage_login.html ---
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>6.3. Bestaande Linux gebruikers beperken: semanage login</title><link rel="stylesheet" href="./Common_Content/css/default.css" type="text/css"/><meta name="generator" content="publican"/><meta name="package" content="Fedora-Security-Enhanced_Linux-11-nl-NL-1.3-SELinux_User_guide"/><link rel="home" href="index.html" title="Security-Enhanced Linux"/><link rel="up" href="chap-Security-Enhanced_Linux-Confining_Users.html" title="Hoofdstuk 6. Gebruikers beperken"/><link rel="prev" href="sect-Security-Enhanced_Linux-Confining_Users-Confining_New_Linux_Users_useradd.html" title="6.2. Nieuwe Linux gebruikers beperken: useradd"/><link rel="next" href="sect-Security-Enhanced_Linux-Confining_Users-Changing_the_Default_Mapping.html" title="6.4. De standaard afbeelbing veranderen"/></head><body class=""><p id="title"><a class="left" href="http://www.fedoraproject.org"><img src="Common_Content/images/image_left.png" alt="Product Site"
/></a><a class="right" href="http://docs.fedoraproject.org"><img src="Common_Content/images/image_right.png" alt="Documentation Site"/></a></p><ul class="docnav"><li class="previous"><a accesskey="p" href="sect-Security-Enhanced_Linux-Confining_Users-Confining_New_Linux_Users_useradd.html"><strong>Terug</strong></a></li><li class="next"><a accesskey="n" href="sect-Security-Enhanced_Linux-Confining_Users-Changing_the_Default_Mapping.html"><strong>Volgende</strong></a></li></ul><div class="section" lang="nl-NL"><div class="titlepage"><div><div><h2 class="title" id="sect-Security-Enhanced_Linux-Confining_Users-Confining_Existing_Linux_Users_semanage_login">6.3. Bestaande Linux gebruikers beperken: semanage login</h2></div></div></div><div class="para">
Als een Linux gebruiker is afgebeeld op de SELinux <code class="computeroutput">unconfined_u</code> gebruiker (het standaard gedrag), en je wilt de SELinux gebruiker waarop ze afgebeeld zijn veranderen, gebruik je het <code class="command">semanage login</code> commando. Het volgende voorbeeld maakt een nieuwe Linux gebruiker aan met de naam newuser, en beeldt dan die Linux gebruiker af op de SELinux <code class="computeroutput">user_u</code> gebruiker:
</div><div class="orderedlist"><ol><li><div class="para">
Als de Linux root gebruiker voer je het <code class="command">/usr/sbin/useradd newuser</code> commando uit om een nieuwe Linux gebruiker (newuser) aan te maken. Omdat deze gebruiker de standaard afbeelding gebruikt, verschijnt deze niet in de de <code class="command">/usr/sbin/semanage login -l</code> output:
</div><pre class="screen"># /usr/sbin/semanage login -l
Login Name SELinux User MLS/MCS Range
__default__ unconfined_u s0-s0:c0.c1023
root unconfined_u s0-s0:c0.c1023
system_u system_u s0-s0:c0.c1023
</pre></li><li><div class="para">
Om de Linux newuser gebruiker af te beelden op de SELinux <code class="computeroutput">user_u</code> gebruiker, voer je het volgende commando uit als de Linux root gebruiker:
</div><div class="para">
<code class="command">/usr/sbin/semanage login -a -s user_u newuser</code>
</div><div class="para">
De <code class="option">-a</code> optie voegt een nieuwe aantekening toe, en de <code class="option">-s</code> optie specificeert de SELinux gebruiker waarop de Linux gebruiker afgebeeld wordt. Het laatse argument, <code class="computeroutput">newuser</code>, is de Linux gebruiker die je wilt afbeelden op de opgegeven SELinux gebruiker.
</div></li><li><div class="para">
Om de afbeelding van de Linux newuser gebruiker op <code class="computeroutput">user_u</code> te bekijken, voer je het <code class="command">semanage login -l</code> commando uit als de Linux root gebruiker:
</div><pre class="screen"># /usr/sbin/semanage login -l
Login Name SELinux User MLS/MCS Range
__default__ unconfined_u s0-s0:c0.c1023
newuser user_u s0
root unconfined_u s0-s0:c0.c1023
system_u system_u s0-s0:c0.c1023
</pre></li><li><div class="para">
As the Linux root user, run the <code class="command">passwd newuser</code> command to assign a password to the Linux newuser user:
</div><pre class="screen"># passwd newuser
Changing password for user newuser.
New UNIX password: <em class="replaceable"><code>Enter a password</code></em>
Retype new UNIX password: <em class="replaceable"><code>Enter the same password again</code></em>
passwd: all authentication tokens updated successfully.
</pre></li><li><div class="para">
Log uit van je huidige sessie, en log in als de Linux newuser gebruiker. Voer het <code class="command">id -Z</code> commando uit om de SELinux context van newuser te bekijken:
</div><pre class="screen">[newuser@rlocalhost ~]$ id -Z
user_u:user_r:user_t:s0
</pre></li><li><div class="para">
Log uit van de sessie van de Linux newuser, en log weer in met je account. Als je de Linux newuser gebruiker niet wilt behouden, voer je het <code class="command">userdel -r newuser</code> commando uit als de Linux root gebruiker om het te verwijderen, te samen met zijn persoonlijke map. Ook de afbeelding van de Linux newuser gebruiker op <code class="computeroutput">user_u</code> wordt verwijderd:
</div><pre class="screen"># /usr/sbin/userdel -r newuser
# /usr/sbin/semanage login -l
Login Name SELinux User MLS/MCS Range
__default__ unconfined_u s0-s0:c0.c1023
root unconfined_u s0-s0:c0.c1023
system_u system_u s0-s0:c0.c1023
</pre></li></ol></div></div><ul class="docnav"><li class="previous"><a accesskey="p" href="sect-Security-Enhanced_Linux-Confining_Users-Confining_New_Linux_Users_useradd.html"><strong>Terug</strong>6.2. Nieuwe Linux gebruikers beperken: useradd</a></li><li class="up"><a accesskey="u" href="#"><strong>Omhoog</strong></a></li><li class="home"><a accesskey="h" href="index.html"><strong>Begin</strong></a></li><li class="next"><a accesskey="n" href="sect-Security-Enhanced_Linux-Confining_Users-Changing_the_Default_Mapping.html"><strong>Volgende</strong>6.4. De standaard afbeelbing veranderen</a></li></ul></body></html>
--- NEW FILE sect-Security-Enhanced_Linux-Confining_Users-Confining_New_Linux_Users_useradd.html ---
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>6.2. Nieuwe Linux gebruikers beperken: useradd</title><link rel="stylesheet" href="./Common_Content/css/default.css" type="text/css"/><meta name="generator" content="publican"/><meta name="package" content="Fedora-Security-Enhanced_Linux-11-nl-NL-1.3-SELinux_User_guide"/><link rel="home" href="index.html" title="Security-Enhanced Linux"/><link rel="up" href="chap-Security-Enhanced_Linux-Confining_Users.html" title="Hoofdstuk 6. Gebruikers beperken"/><link rel="prev" href="chap-Security-Enhanced_Linux-Confining_Users.html" title="Hoofdstuk 6. Gebruikers beperken"/><link rel="next" href="sect-Security-Enhanced_Linux-Confining_Users-Confining_Existing_Linux_Users_semanage_login.html" title="6.3. Bestaande Linux gebruikers beperken: semanage login"/></head><body class=""><p id="title"><a class="left" href="http://www.fedoraproject.org"><img src="Common_Content/images/image_left.png" alt="Product Site"/></a><a class="right" h
ref="http://docs.fedoraproject.org"><img src="Common_Content/images/image_right.png" alt="Documentation Site"/></a></p><ul class="docnav"><li class="previous"><a accesskey="p" href="chap-Security-Enhanced_Linux-Confining_Users.html"><strong>Terug</strong></a></li><li class="next"><a accesskey="n" href="sect-Security-Enhanced_Linux-Confining_Users-Confining_Existing_Linux_Users_semanage_login.html"><strong>Volgende</strong></a></li></ul><div class="section" lang="nl-NL"><div class="titlepage"><div><div><h2 class="title" id="sect-Security-Enhanced_Linux-Confining_Users-Confining_New_Linux_Users_useradd">6.2. Nieuwe Linux gebruikers beperken: useradd</h2></div></div></div><div class="para">
Linux gebruikers die afgebeeld zijn op de SELinux <code class="computeroutput">unconfined_u</code> gebruiker draaien in het <code class="computeroutput">unconfined_t</code> domein. Dit kan getoond worden door het uitvoeren van het <code class="command">id -Z</code> commando terwijl je ingelogd bent als een Linux gebruiker afgebeeld op <code class="computeroutput">unconfined_u</code>:
</div><pre class="screen">$ id -Z
unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023
</pre><div class="para">
Als Linux gebruikers in het <code class="computeroutput">unconfined_t</code> domein draaien, worden SELinux tactiekregels toegepast, maar er bestaan tactiekregels die Linux gebruikers die in het <code class="computeroutput">unconfined_t</code> domein draaien bijna alle toegang toestaan. Als onbeperkte Linux gebruikers een toepassing uitvoeren waarvan de SELinux tactiek definieert dat het kan overgaan van het <code class="computeroutput">unconfined_t</code> domein naar zijn eigen beperkte domein, zijn onbeperkte Linux gebruikers nog steeds onderworpen aan de beperkingen van het beperkte domein. Het beveiligings voordeel hiervan is dat, zelfs als een Linux gebruiker onbeperkt draait, de toepassing beperkt blijft, en dat daardoor de uitbuiting van een fout in de toepassing beperkt kan worden door tactiek. Merk op: dit beschermt het systeem niet tegen de gebruiker. In plaats daarvan worden de gebruiker en het systeem beschermd tegen mogelijke schade veroorzaakt door een fout i
n de toepassing.
</div><div class="para">
Als Linux gebruikers aangemaakt worden met <code class="command">useradd</code>, gebruik je de <code class="option">-Z</code> optie om op te geven op welke SELinux gebruiker ze afgebeeld worden. Het volgende voorbeeld maakt een nieuwe Linux gebruiker aan, useruuser, en beeldt die gebruiker af op de SELinux <code class="computeroutput">user_u</code> gebruiker. Linux gebruikers afgebeeld op de SELinux <code class="computeroutput">user_u</code> gebruiker draaien in het <code class="computeroutput">user_t</code> domein. In dit domein zijn Linux gebruikers niet in staat om setuid toepassingen te draaien tenzij SELinux tactiek dit toestaat (zoals <code class="command">passwd</code>), en kunnen ze <code class="command">su</code> of <code class="command">sudo</code> niet uitvoeren, wat hen tegenhoudt om met deze commando's de Linux root gebruiker te worden.
</div><div class="orderedlist"><ol><li><div class="para">
Als de Linux root gebruiker voer je het <code class="command">/usr/sbin/useradd -Z user_u useruuser</code> commando uit om een nieuwe Linux gebruiker (useruuser) aan te maken die afgebeeld wordt op de SELinux <code class="computeroutput">user_u</code> gebruiker.
</div></li><li><div class="para">
Als de Linux root gebruiker voer je het <code class="command">semanage login -l</code> commando uit om de afbeelding van de Linux <code class="computeroutput">useruuser</code> gebruiker op <code class="computeroutput">user_u</code> te zien:
</div><pre class="screen"># /usr/sbin/semanage login -l
Login Name SELinux User MLS/MCS Range
__default__ unconfined_u s0-s0:c0.c1023
root unconfined_u s0-s0:c0.c1023
system_u system_u s0-s0:c0.c1023
useruuser user_u s0
</pre></li><li><div class="para">
Als de Linix root gebruiker voer je het <code class="command">passwd useruuser</code> commando uit om een wachtwoord toe te kennen aan de Linux useruuser gebruiker:
</div><pre class="screen"># passwd useruuser
Changing password for user useruuser.
New UNIX password: <em class="replaceable"><code>Enter a password</code></em>
Retype new UNIX password: <em class="replaceable"><code>Enter the same password again</code></em>
passwd: all authentication tokens updated successfully.
</pre></li><li><div class="para">
Log uit van de huidige sessie, en log in als de Linux useruuser gebruiker. Als je inlogt, beeldt pam_selinux de Linux gebruiker af op een SELinux gebruiker (in dit geval, <code class="computeroutput">user_u</code>), en stelt de bijbehorende SELinux context in. De shell van de Linux gebruiker wordt dan opgestart met deze context. Voer het <code class="command">id -Z</code> commando uit om de context van een Linux gebruiker te bekijken:
</div><pre class="screen">[useruuser@localhost ~]$ id -Z
user_u:user_r:user_t:s0
</pre></li><li><div class="para">
Log uit van de sessie van de Linux useruuuser, en log weer in met je account. Als je de Linux useruuser niet wilt houden, voer je het <code class="command">/usr/sbin/userdel -r useruuser</code> commando uit als de Linux root gebruiker om het te verwijderen te samen met zijn persoonlijke map.
</div></li></ol></div></div><ul class="docnav"><li class="previous"><a accesskey="p" href="chap-Security-Enhanced_Linux-Confining_Users.html"><strong>Terug</strong>Hoofdstuk 6. Gebruikers beperken</a></li><li class="up"><a accesskey="u" href="#"><strong>Omhoog</strong></a></li><li class="home"><a accesskey="h" href="index.html"><strong>Begin</strong></a></li><li class="next"><a accesskey="n" href="sect-Security-Enhanced_Linux-Confining_Users-Confining_Existing_Linux_Users_semanage_login.html"><strong>Volgende</strong>6.3. Bestaande Linux gebruikers beperken: semanag...</a></li></ul></body></html>
--- NEW FILE sect-Security-Enhanced_Linux-Confining_Users-xguest_Kiosk_Mode.html ---
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>6.5. xguest: kiosk modus</title><link rel="stylesheet" href="./Common_Content/css/default.css" type="text/css"/><meta name="generator" content="publican"/><meta name="package" content="Fedora-Security-Enhanced_Linux-11-nl-NL-1.3-SELinux_User_guide"/><link rel="home" href="index.html" title="Security-Enhanced Linux"/><link rel="up" href="chap-Security-Enhanced_Linux-Confining_Users.html" title="Hoofdstuk 6. Gebruikers beperken"/><link rel="prev" href="sect-Security-Enhanced_Linux-Confining_Users-Changing_the_Default_Mapping.html" title="6.4. De standaard afbeelbing veranderen"/><link rel="next" href="sect-Security-Enhanced_Linux-Confining_Users-Booleans_for_Users_Executing_Applications.html" title="6.6. Booleans voor gebruikers die toepassingen uitvoeren"/></head><body class=""><p id="title"><a class="left" href="http://www.fedoraproject.org"><img src="Common_Content/images/image_left.png" alt="Product Site"/></a><a class
="right" href="http://docs.fedoraproject.org"><img src="Common_Content/images/image_right.png" alt="Documentation Site"/></a></p><ul class="docnav"><li class="previous"><a accesskey="p" href="sect-Security-Enhanced_Linux-Confining_Users-Changing_the_Default_Mapping.html"><strong>Terug</strong></a></li><li class="next"><a accesskey="n" href="sect-Security-Enhanced_Linux-Confining_Users-Booleans_for_Users_Executing_Applications.html"><strong>Volgende</strong></a></li></ul><div class="section" lang="nl-NL"><div class="titlepage"><div><div><h2 class="title" id="sect-Security-Enhanced_Linux-Confining_Users-xguest_Kiosk_Mode">6.5. xguest: kiosk modus</h2></div></div></div><div class="para">
Het <span class="package">xguest</span> pakket biedt een kiosk gebruikers accont aan. Dit account wordt gebruikt om machines te beveiligen waar mensen naar toe gaan en gebruiken, zoals in bibliotheken, banken, vliegvelden, informatie kiosken, en koffie shops. Het kiosk gebruikers account is zwaar vergrendeld: in wezen staat het gebruikers alleen toe om in te loggen en <span class="application"><strong>Firefox</strong></span> te gebruiken om Internet websites te bekijken. Elke verandering die gemaakt wordt onder dit account, zoals bestanden aanmaken of instellingen veranderen, gaan verloren zodra je uitlogt.
</div><div class="para">
Het kiosk account instellen:
</div><div class="orderedlist"><ol><li><div class="para">
Als de Linux root gebruiker voer je het <code class="command">yum install xguest</code> commando uit om het <span class="package">xguest</span> pakket te installeren. Installeer ook de benodigde afhankelijkheden.
</div></li><li><div class="para">
Om toe te staan dat het kiosk account gebruikt wordt door verschillende mensen, wordt het account niet beschermd met een wachtwoord, en daarom kan het account alleen maar beschermd worden als SELinux in de afdwingende modus draait. Voordat je inlogt met dit account, gebruik je het <code class="command">getenforce</code> commando om er zeker van te zijn dat SELinux in de afdwingende modus draait:
</div><pre class="screen">$ /usr/sbin/getenforce
Enforcing
</pre><div class="para">
Als dat niet het geval is, refereer je naar <a class="xref" href="sect-Security-Enhanced_Linux-Working_with_SELinux-SELinux_Modes.html" title="5.5. SELinux modes">Paragraaf 5.5, “SELinux modes”</a> voor informatie over het veranderen van de modus naar afdwingend. Het is niet mogelijk om met dit account in te loggen als SELinux in de toelatende modus is of uitstaat.
</div></li><li><div class="para">
Je kunt alleen inloggen met dit account in de GNOME Display Manager (GDM). Zodra het <span class="package">xguest</span> pakket geinstalleerd is, wordt een <code class="computeroutput">Guest</code> account toegevoegd aan GDM. Om in te loggen klik je op het <code class="computeroutput">Guest</code> account:
</div><div class="mediaobject"><img src="./images/xguest.png"/></div></li></ol></div></div><ul class="docnav"><li class="previous"><a accesskey="p" href="sect-Security-Enhanced_Linux-Confining_Users-Changing_the_Default_Mapping.html"><strong>Terug</strong>6.4. De standaard afbeelbing veranderen</a></li><li class="up"><a accesskey="u" href="#"><strong>Omhoog</strong></a></li><li class="home"><a accesskey="h" href="index.html"><strong>Begin</strong></a></li><li class="next"><a accesskey="n" href="sect-Security-Enhanced_Linux-Confining_Users-Booleans_for_Users_Executing_Applications.html"><strong>Volgende</strong>6.6. Booleans voor gebruikers die toepassingen ui...</a></li></ul></body></html>
--- NEW FILE sect-Security-Enhanced_Linux-Enabling_and_Disabling_SELinux-Disabling_SELinux.html ---
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>5.4.2. SELinux uitzetten</title><link rel="stylesheet" href="./Common_Content/css/default.css" type="text/css"/><meta name="generator" content="publican"/><meta name="package" content="Fedora-Security-Enhanced_Linux-11-nl-NL-1.3-SELinux_User_guide"/><link rel="home" href="index.html" title="Security-Enhanced Linux"/><link rel="up" href="sect-Security-Enhanced_Linux-Working_with_SELinux-Enabling_and_Disabling_SELinux.html" title="5.4. SELinux aanzetten en uitzetten"/><link rel="prev" href="sect-Security-Enhanced_Linux-Working_with_SELinux-Enabling_and_Disabling_SELinux.html" title="5.4. SELinux aanzetten en uitzetten"/><link rel="next" href="sect-Security-Enhanced_Linux-Working_with_SELinux-SELinux_Modes.html" title="5.5. SELinux modes"/></head><body class=""><p id="title"><a class="left" href="http://www.fedoraproject.org"><img src="Common_Content/images/image_left.png" alt="Product Site"/></a><a class="right" href="http
://docs.fedoraproject.org"><img src="Common_Content/images/image_right.png" alt="Documentation Site"/></a></p><ul class="docnav"><li class="previous"><a accesskey="p" href="sect-Security-Enhanced_Linux-Working_with_SELinux-Enabling_and_Disabling_SELinux.html"><strong>Terug</strong></a></li><li class="next"><a accesskey="n" href="sect-Security-Enhanced_Linux-Working_with_SELinux-SELinux_Modes.html"><strong>Volgende</strong></a></li></ul><div class="section" lang="nl-NL"><div class="titlepage"><div><div><h3 class="title" id="sect-Security-Enhanced_Linux-Enabling_and_Disabling_SELinux-Disabling_SELinux">5.4.2. SELinux uitzetten</h3></div></div></div><div class="para">
Om SELinux uit te zetten, configureer je <code class="option">SELINUX=disabled</code> in <code class="filename">/etc/selinux/config</code>:
</div><pre class="screen"># This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - No SELinux policy is loaded.
SELINUX=disabled
# SELINUXTYPE= can take one of these two values:
# targeted - Targeted processes are protected,
# mls - Multi Level Security protection.
SELINUXTYPE=targeted
</pre><div class="para">
Start je systeem opnieuw op. Na het opstarten bevestig je dat het <code class="command">getenforce</code> commando <code class="computeroutput">Disabled</code> terug geeft:
</div><pre class="screen">$ /usr/sbin/getenforce
Disabled
</pre></div><ul class="docnav"><li class="previous"><a accesskey="p" href="sect-Security-Enhanced_Linux-Working_with_SELinux-Enabling_and_Disabling_SELinux.html"><strong>Terug</strong>5.4. SELinux aanzetten en uitzetten</a></li><li class="up"><a accesskey="u" href="#"><strong>Omhoog</strong></a></li><li class="home"><a accesskey="h" href="index.html"><strong>Begin</strong></a></li><li class="next"><a accesskey="n" href="sect-Security-Enhanced_Linux-Working_with_SELinux-SELinux_Modes.html"><strong>Volgende</strong>5.5. SELinux modes</a></li></ul></body></html>
--- NEW FILE sect-Security-Enhanced_Linux-Fixing_Problems-Allowing_Access_audit2allow.html ---
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>7.3.8. Toegang toestaan: audit2allow</title><link rel="stylesheet" href="./Common_Content/css/default.css" type="text/css"/><meta name="generator" content="publican"/><meta name="package" content="Fedora-Security-Enhanced_Linux-11-nl-NL-1.3-SELinux_User_guide"/><link rel="home" href="index.html" title="Security-Enhanced Linux"/><link rel="up" href="sect-Security-Enhanced_Linux-Troubleshooting-Fixing_Problems.html" title="7.3. Problemen herstellen"/><link rel="prev" href="sect-Security-Enhanced_Linux-Fixing_Problems-sealert_Messages.html" title="7.3.7. sealert boodschappen"/><link rel="next" href="chap-Security-Enhanced_Linux-Further_Information.html" title="Hoofdstuk 8. Verdere informatie"/></head><body class=""><p id="title"><a class="left" href="http://www.fedoraproject.org"><img src="Common_Content/images/image_left.png" alt="Product Site"/></a><a class="right" href="http://docs.fedoraproject.org"><img src="Common_Con
tent/images/image_right.png" alt="Documentation Site"/></a></p><ul class="docnav"><li class="previous"><a accesskey="p" href="sect-Security-Enhanced_Linux-Fixing_Problems-sealert_Messages.html"><strong>Terug</strong></a></li><li class="next"><a accesskey="n" href="chap-Security-Enhanced_Linux-Further_Information.html"><strong>Volgende</strong></a></li></ul><div class="section" lang="nl-NL"><div class="titlepage"><div><div><h3 class="title" id="sect-Security-Enhanced_Linux-Fixing_Problems-Allowing_Access_audit2allow">7.3.8. Toegang toestaan: audit2allow</h3></div></div></div><div class="para">
Gebruik het voorbeeld in deze paragraaf niet in een productieomgeving. Het wordt alleen gebruikt om het gebruik van <code class="command">audit2allow</code> te laten zien.
</div><div class="para">
Uit de <span class="citerefentry"><span class="refentrytitle">audit2allow</span>(1)</span> manual pagina: "<code class="command">audit2allow</code> - maak SELinux tactiek toelatingsregels van de logs van geweigerde operaties"<sup>[<a id="d0e6515" href="#ftn.d0e6515" class="footnote">19</a>]</sup>. Na het onderzoeken van weigeren zoals in <a class="xref" href="sect-Security-Enhanced_Linux-Fixing_Problems-sealert_Messages.html" title="7.3.7. sealert boodschappen">Paragraaf 7.3.7, “sealert boodschappen”</a>, en als label veranderingen of Booleans aanzetten geen toegang toestaan, gebruik je <code class="command">audit2allow</code> om een locale tactiek module te maken. Nadat toegang geweigerd is door SELinux, presenteert het draaien van het <code class="command">audit2allow</code> commando Type Enforcement regels die de hiervoor geweigerde toegang toestaan.
</div><div class="para">
Het volgende voorbeeld laat het gebruik van <code class="command">audit2allow</code> zien om een tactiek module te maken:
</div><div class="orderedlist"><ol><li><div class="para">
Een weigering en de bijbehorende systeem aanroep zijn gelogd naar <code class="filename">/var/log/audit/audit.log</code>:
</div><pre class="screen">type=AVC msg=audit(1226270358.848:238): avc: denied { write } for pid=13349 comm="certwatch" name="cache" dev=dm-0 ino=218171 scontext=system_u:system_r:certwatch_t:s0 tcontext=system_u:object_r:var_t:s0 tclass=dir
type=SYSCALL msg=audit(1226270358.848:238): arch=40000003 syscall=39 success=no exit=-13 a0=39a2bf a1=3ff a2=3a0354 a3=94703c8 items=0 ppid=13344 pid=13349 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm="certwatch" exe="/usr/bin/certwatch" subj=system_u:system_r:certwatch_t:s0 key=(null)
</pre><div class="para">
In dit voorbeeld was <span class="application"><strong>certwatch</strong></span> (<code class="computeroutput">comm="certwatch"</code>) schrijf toegang (<code class="computeroutput">{ write }</code>) geweigerd naar een map gelabeld met het <code class="computeroutput">var_t</code> type (<code class="computeroutput">tcontext=system_u:object_r:var_t:s0</code>). Analyseer de weigering zoals in <a class="xref" href="sect-Security-Enhanced_Linux-Fixing_Problems-sealert_Messages.html" title="7.3.7. sealert boodschappen">Paragraaf 7.3.7, “sealert boodschappen”</a>. Als label veranderingen of Booleans aanzetten, geen toegang toestaan, gebruik je <code class="command">audit2allow</code> om een locale tactiek module te maken.
</div></li><li><div class="para">
Met een gelogde weigering, zoals de <code class="computeroutput">certwatch</code> weigering in stap 1, voer je het <code class="command">audit2allow -w -a</code> commando uit om een leesbare beschrijving te maken van de reden van de weigering. De <code class="option">-a</code> optie zorgt ervoor dat alle logs gelezen worden. De <code class="option">-w</code> optie produceert een leesbare beschrijving. Het <code class="command">audit2allow</code> programma neemt toegang tot <code class="filename">/var/log/audit/audit.log</code>, en moet daarom uitgevoerd worden als de Linux root gebruiker:
</div><pre class="screen"># audit2allow -w -a
type=AVC msg=audit(1226270358.848:238): avc: denied { write } for pid=13349 comm="certwatch" name="cache" dev=dm-0 ino=218171 scontext=system_u:system_r:certwatch_t:s0 tcontext=system_u:object_r:var_t:s0 tclass=dir
Was caused by:
Missing type enforcement (TE) allow rule.
You can use audit2allow to generate a loadable module to allow this access.
</pre><div class="para">
Zoals getoond was toegang geweigerd door een ontbrekende Type Enforcement regel.
</div></li><li><div class="para">
Voer het <code class="command">audit2allow -a</code> commando uit om de Type Enforcement regel te bekijken toe de geweigerde toegang toestaat:
</div><pre class="screen"># audit2allow -a
#============= certwatch_t ==============
allow certwatch_t var_t:dir write;
</pre><div class="important"><h2>Belangrijk</h2><div class="para">
Ontbrekende Type Enforcement regels worden gewoonlijk veroorzaakt door fouten in SELinux tactiek, en moeten gemeld worden in <a href="https://bugzilla.redhat.com/">Red Hat Bugzilla</a>. Voor Fedora, maak je een foutrapport voor het <code class="computeroutput">Fedora</code> product, en je selecteert de <code class="computeroutput">selinux-policy</code> component. Voeg de output van de <code class="command">audit2allow -w -a</code> en <code class="command">audit2allow -a</code> commando's toe in zo'n foutrapport.
</div></div></li><li><div class="para">
Om de regel te gebruiken die <code class="command">audit2allow -a</code> liet zien, voer je het <code class="command">audit2allow -a -M <em class="replaceable"><code>mycertwatch</code></em></code> commando uit als de Linux root gebruiker om de aangepaste module te maken. De <code class="option">-M</code> optie maakt een Type Enforcement bestand (<code class="filename">.te</code>) met de naam opgegeven met de <code class="option">-M</code> in je huidige werkmap:
</div><pre class="screen"># audit2allow -a -M mycertwatch
******************** IMPORTANT ***********************
To make this policy package active, execute:
semodule -i mycertwatch.pp
# ls
mycertwatch.pp mycertwatch.te
</pre><div class="para">
<code class="command">audit2allow</code> compileert de Type Enforcement regel ook naar een tactiek pakket (<code class="filename">.pp</code>). Om de module te installeren, voer je het <code class="command">/usr/sbin/semodule -i <em class="replaceable"><code>mycertwatch.pp</code></em></code> commando uit als de Linux root gebruiker.
</div><div class="important"><h2>Belangrijk</h2><div class="para">
Modules gemaakt met <code class="command">audit2allow</code> kunnen meer toegang toestaan dan nodig is. Het wordt aanbevolen dat tactiek die gemaakt is met <code class="command">audit2allow</code> voor bespreking opgestuurd wordt naar een SELinux lijst, zoals <a href="http://www.redhat.com/mailman/listinfo/fedora-selinux-list">fedora-selinux-list</a>. Als je denkt dat er een fout is in de tactiek, maak dat een foutrapport aan in <a href="https://bugzilla.redhat.com/">Red Hat Bugzilla</a>.
</div></div></li></ol></div><div class="para">
Als je meerdere weigeringen hebt van verschillende processen, maar je wilt alleen een aangepaste tactiek maken voor een enkel proces, gebruik je het <code class="command">grep</code> commando om de input voor <code class="command">audit2allow</code> te versmallen. Het volgende voorbeeld laat het gebruik van <code class="command">grep</code> zien om alleen weigeringen te versturen naar <code class="command">audit2allow</code> die gerelateerd zijn aan <code class="command">certwatch</code>:
</div><pre class="screen"># grep certwatch /var/log/audit/audit.log | audit2allow -M mycertwatch2
******************** IMPORTANT ***********************
To make this policy package active, execute:
# /usr/sbin/semodule -i mycertwatch2.pp
</pre><div class="para">
Refereer naar de blog van Dan Walsh <a href="http://danwalsh.livejournal.com/24750.html">"Using audit2allow to build policy modules. Revisited."</a> voor meer informatie over het gebruik van <code class="command">audit2allow</code> om tactiek modules te maken.
</div><div class="footnotes"><br/><hr/><div class="footnote"><p><sup>[<a id="ftn.d0e6515" href="#d0e6515" class="para">19</a>] </sup>
Uit de <span class="citerefentry"><span class="refentrytitle">audit2allow</span>(1)</span> manual pagina, zoals verstuurd met het <span class="package">policycoreutils</span> pakket in Fedora 11.
</p></div></div></div><ul class="docnav"><li class="previous"><a accesskey="p" href="sect-Security-Enhanced_Linux-Fixing_Problems-sealert_Messages.html"><strong>Terug</strong>7.3.7. sealert boodschappen</a></li><li class="up"><a accesskey="u" href="#"><strong>Omhoog</strong></a></li><li class="home"><a accesskey="h" href="index.html"><strong>Begin</strong></a></li><li class="next"><a accesskey="n" href="chap-Security-Enhanced_Linux-Further_Information.html"><strong>Volgende</strong>Hoofdstuk 8. Verdere informatie</a></li></ul></body></html>
--- NEW FILE sect-Security-Enhanced_Linux-Fixing_Problems-Manual_Pages_for_Services.html ---
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>7.3.3. Manual pagina's voor services</title><link rel="stylesheet" href="./Common_Content/css/default.css" type="text/css"/><meta name="generator" content="publican"/><meta name="package" content="Fedora-Security-Enhanced_Linux-11-nl-NL-1.3-SELinux_User_guide"/><link rel="home" href="index.html" title="Security-Enhanced Linux"/><link rel="up" href="sect-Security-Enhanced_Linux-Troubleshooting-Fixing_Problems.html" title="7.3. Problemen herstellen"/><link rel="prev" href="sect-Security-Enhanced_Linux-Fixing_Problems-Possible_Causes_of_Silent_Denials.html" title="7.3.2. Mogelijke oorzaken van stille weigeringen"/><link rel="next" href="sect-Security-Enhanced_Linux-Fixing_Problems-Permissive_Domains.html" title="7.3.4. Toelatende domeinen"/></head><body class=""><p id="title"><a class="left" href="http://www.fedoraproject.org"><img src="Common_Content/images/image_left.png" alt="Product Site"/></a><a class="right" href="htt
p://docs.fedoraproject.org"><img src="Common_Content/images/image_right.png" alt="Documentation Site"/></a></p><ul class="docnav"><li class="previous"><a accesskey="p" href="sect-Security-Enhanced_Linux-Fixing_Problems-Possible_Causes_of_Silent_Denials.html"><strong>Terug</strong></a></li><li class="next"><a accesskey="n" href="sect-Security-Enhanced_Linux-Fixing_Problems-Permissive_Domains.html"><strong>Volgende</strong></a></li></ul><div class="section" lang="nl-NL"><div class="titlepage"><div><div><h3 class="title" id="sect-Security-Enhanced_Linux-Fixing_Problems-Manual_Pages_for_Services">7.3.3. Manual pagina's voor services</h3></div></div></div><div class="para">
Manual pagina's voor services bevatten waardevolle informatie, zoals welk bestandstype gebruikt moet worden voor een bepaalde situatie, en Booleans om de toegang die een sevice heeft te veranderen (zoals toegang tot NFS bestandssystemen voor <code class="systemitem">httpd</code>). Deze informatie kan in de standaard manual pagina zijn, of in een manual pagina met <code class="computeroutput">selinux</code> voor of achter de servicenaam.
</div><div class="para">
Bijvoorbeeld, de <span class="citerefentry"><span class="refentrytitle">httpd_selinux</span>(8)</span> manual pagina heeft informatie over het te gebruiken bestandstype in een bepaalde situatie, en ook Booleans voor het toestaan van scripts, bestanden delen, toegang krijgen tot mappen in de persoonlijke mappen van gebruikers, enzovoort. Andere manual pagina's met SELinux informatie voor services zijn:
</div><div class="itemizedlist"><ul><li><div class="para">
Samba: de <span class="citerefentry"><span class="refentrytitle">samba_selinux</span>(8)</span> manual pagina beschrijft dat bestanden en mappen die met Samba geexporteerd worden gelabeld moeten zijn met het <code class="computeroutput">samba_share_t</code> type, en ook Booleans die toestaan dat bestanden gelabeld met andere types dan <code class="computeroutput">samba_share_t</code> met Samba geexporteerd kunnen worden.
</div></li><li><div class="para">
NFS: de <span class="citerefentry"><span class="refentrytitle">nfs_selinux</span>(8)</span> manual pagina beschrijft dat standaard bestandssystemen niet met NFS geexporteerd kunnen worden, en om toe te staan dat bestanden geexporteerd kunnen worden, Booleans zoals <code class="computeroutput">nfs_export_all_ro</code> of <code class="computeroutput">nfs_export_all_rw</code> aangezet moeten worden.
</div></li><li><div class="para">
Berkeley Internet Name Domain (BIND): de <span class="citerefentry"><span class="refentrytitle">named</span>(8)</span> manual pagina beschrijft welke bestandstype te gebruiken voor een bepaalde situatie (zie de <code class="computeroutput">Red Hat SELinux BIND Security Profile</code> paragraaf). De <span class="citerefentry"><span class="refentrytitle">named_selinux</span>(8)</span> manual pagina beschrijf dat <code class="systemitem">named</code> standaard niet naar master zone bestanden kan schrijven, en om deze toegang toe te staan, de <code class="computeroutput">named_write_master_zones</code> Boolean aangezet moet worden.
</div></li></ul></div><div class="para">
De informatie in manual pagina's helpt je de juiste bestandstypes en Booleans in te stellen, wat helpt voorkomen dat SELinux toegangs weigeringen geeft
</div></div><ul class="docnav"><li class="previous"><a accesskey="p" href="sect-Security-Enhanced_Linux-Fixing_Problems-Possible_Causes_of_Silent_Denials.html"><strong>Terug</strong>7.3.2. Mogelijke oorzaken van stille weigeringen</a></li><li class="up"><a accesskey="u" href="#"><strong>Omhoog</strong></a></li><li class="home"><a accesskey="h" href="index.html"><strong>Begin</strong></a></li><li class="next"><a accesskey="n" href="sect-Security-Enhanced_Linux-Fixing_Problems-Permissive_Domains.html"><strong>Volgende</strong>7.3.4. Toelatende domeinen</a></li></ul></body></html>
--- NEW FILE sect-Security-Enhanced_Linux-Fixing_Problems-Permissive_Domains.html ---
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>7.3.4. Toelatende domeinen</title><link rel="stylesheet" href="./Common_Content/css/default.css" type="text/css"/><meta name="generator" content="publican"/><meta name="package" content="Fedora-Security-Enhanced_Linux-11-nl-NL-1.3-SELinux_User_guide"/><link rel="home" href="index.html" title="Security-Enhanced Linux"/><link rel="up" href="sect-Security-Enhanced_Linux-Troubleshooting-Fixing_Problems.html" title="7.3. Problemen herstellen"/><link rel="prev" href="sect-Security-Enhanced_Linux-Fixing_Problems-Manual_Pages_for_Services.html" title="7.3.3. Manual pagina's voor services"/><link rel="next" href="sect-Security-Enhanced_Linux-Permissive_Domains-Denials_for_Permissive_Domains.html" title="7.3.4.2. Weigeringen voor toelatende domeinen"/></head><body class=""><p id="title"><a class="left" href="http://www.fedoraproject.org"><img src="Common_Content/images/image_left.png" alt="Product Site"/></a><a class="right" href=
"http://docs.fedoraproject.org"><img src="Common_Content/images/image_right.png" alt="Documentation Site"/></a></p><ul class="docnav"><li class="previous"><a accesskey="p" href="sect-Security-Enhanced_Linux-Fixing_Problems-Manual_Pages_for_Services.html"><strong>Terug</strong></a></li><li class="next"><a accesskey="n" href="sect-Security-Enhanced_Linux-Permissive_Domains-Denials_for_Permissive_Domains.html"><strong>Volgende</strong></a></li></ul><div class="section" lang="nl-NL"><div class="titlepage"><div><div><h3 class="title" id="sect-Security-Enhanced_Linux-Fixing_Problems-Permissive_Domains">7.3.4. Toelatende domeinen</h3></div></div></div><div class="para">
Als SELinux in de toelatende modus draait, weigert SELinux geen toegang, maar weigeringen worden gelogd voor acties die geweigerd zouden zijn als SELinux in de afdwingende modus draaide. Vroeger was het niet mogelijk om een enkel domein toelatend te maken (denk eraan: processen draaien in domeinen). In bepaalde situaties leidde dit er toe dat het hele systeem toelatend werd gemaakt voor foutzoek doeleinden.
</div><div class="para">
Fedora 11 introduceert toelatende domeinen, waarbij een beheerder een enkel proces (domein) toelatend kan draaien, in plaats van het hele systeem toelatend te maken. SELinux controles worden nog steeds gedaan voor toelatende domeinen, de kernel laat echter toegang toe en rapporteert een AVC weigering voor situaties waar SELinux toegang geweigerd zou hebben. Toelatende domeinen zijn ook beschikbaar in Fedora 9 (als de laatste vernieuwingen toegepast zijn).
</div><div class="para">
In Red Hat Enterprise Linux 4 en 5 zijn <code class="computeroutput"><em class="replaceable"><code>domain</code></em>_disable_trans</code> Booleans beschikbaar om een toepassing te beletten om over te gaan naar een beperkt domein, en daarom draait het proces in een onbeperkt domein, zoals <code class="computeroutput">initrc_t</code>. Het aanzetten van zulke Booleans kan grote problemen veroorzaken. Bijvoorbeeld, als de <code class="computeroutput">httpd_disable_trans</code> Boolean aangezet is:
</div><div class="itemizedlist"><ul><li><div class="para">
draait <code class="systemitem">httpd</code> in het onbeperkte <code class="computeroutput">initrc_t</code> domein. Bestanden gemaakt door processen die in het <code class="computeroutput">initrc_t</code> domein draaien hebben misschien niet dezelfde labelingsregels toegepast gekregen als bestanden die draaien in het <code class="computeroutput">httpd_t</code> domein, wat potentieel toestaat dat processen verkeerd gelabelde bestanden maken. Dit veroorzaakt later toegangs problemen.
</div></li><li><div class="para">
beperkte domeinen die toegestaan worden om te communiceren met <code class="computeroutput">httpd_t</code> kunnen niet communiceren met <code class="computeroutput">initrc_t</code>, wat potentieel extra fouten veroorzaakt.
</div></li></ul></div><div class="para">
De <code class="computeroutput"><em class="replaceable"><code>domain</code></em>_disable_trans</code> Booleans zijn verwijderd in Fedora 7, hoewel er geen vervanger voor was. Toelatende domeinen lossen de hierboven beschreven problemen op: overgangs regels worden toegepast, en bestanden worden aangemaakt met de juiste labels.
</div><div class="para">
Toelatende domeinen kunnen gebruikt worden voor:
</div><div class="itemizedlist"><ul><li><div class="para">
maak een enkel proces (domein) toelatend om een probleem op te lossen, in plaats van het gehele systeem kwetsbaar te maken door het hele systeem toelatend te maken.
</div></li><li><div class="para">
het maken van tactiek voor nieuwe toepassingen. Vroeger was het aanbevolen dat een minmale tactiek werd gemaakt, en dat daarna de hele machine in de toelatende modus werd gebracht, zodat de toepassing kon draaien, maar SELinux weigeringen nog steeds gelogd werden. <code class="command">audit2allow</code> kon daarna gebruikt worden om te helpen met het schrijven van de tactiek. Dit maakte het gehele systeem kwetsbaar. Met toelatende domeinen, wordt alleen het domein in de nieuwe tactiek toelatend, zonder het hele systeem kwetsbaar te maken.
</div></li></ul></div><div class="section" lang="nl-NL"><div class="titlepage"><div><div><h4 class="title" id="sect-Security-Enhanced_Linux-Permissive_Domains-Making_a_Domain_Permissive">7.3.4.1. Een domein toelatend maken</h4></div></div></div><div class="para">
Om een domein toelatend te maken voer je het <code class="command">semanage permissive -a <em class="replaceable"><code>domein</code></em></code> commando uit, waarin <em class="replaceable"><code>domein</code></em> het domein is dat je toelatend wilt maken. Bijvoorbeeld, voer het volgende commando uit als de Linux root gebruiker om het <code class="computeroutput">httpd_t</code> domein (het domein waarin de Apache HTTP sever draait) toelatend te maken:
</div><div class="para">
<code class="command">/usr/sbin/semanage permissive -a httpd_t</code>
</div><div class="para">
Om een lijst te zien van de domeinen die je toelatend hebt gemaakt, voer je het <code class="command">semodule -l | grep permissive</code> commando uit als de Linux root gebruiker. Bijvoorbeeld:
</div><pre class="screen"># /usr/sbin/semodule -l | grep permissive
permissive_httpd_t 1.0
</pre><div class="para">
Als je een domein niet langer toelatend wilt laten zijn, voer je het <code class="command">semanage permissive -d <em class="replaceable"><code>domein</code></em></code> commando uit als de Linux root gebruiker. Bijvoorbeeld:
</div><div class="para">
<code class="command">/usr/sbin/semanage permissive -d httpd_t</code>
</div></div></div><ul class="docnav"><li class="previous"><a accesskey="p" href="sect-Security-Enhanced_Linux-Fixing_Problems-Manual_Pages_for_Services.html"><strong>Terug</strong>7.3.3. Manual pagina's voor services</a></li><li class="up"><a accesskey="u" href="#"><strong>Omhoog</strong></a></li><li class="home"><a accesskey="h" href="index.html"><strong>Begin</strong></a></li><li class="next"><a accesskey="n" href="sect-Security-Enhanced_Linux-Permissive_Domains-Denials_for_Permissive_Domains.html"><strong>Volgende</strong>7.3.4.2. Weigeringen voor toelatende domeinen</a></li></ul></body></html>
--- NEW FILE sect-Security-Enhanced_Linux-Fixing_Problems-Possible_Causes_of_Silent_Denials.html ---
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>7.3.2. Mogelijke oorzaken van stille weigeringen</title><link rel="stylesheet" href="./Common_Content/css/default.css" type="text/css"/><meta name="generator" content="publican"/><meta name="package" content="Fedora-Security-Enhanced_Linux-11-nl-NL-1.3-SELinux_User_guide"/><link rel="home" href="index.html" title="Security-Enhanced Linux"/><link rel="up" href="sect-Security-Enhanced_Linux-Troubleshooting-Fixing_Problems.html" title="7.3. Problemen herstellen"/><link rel="prev" href="sect-Security-Enhanced_Linux-Troubleshooting-Fixing_Problems.html" title="7.3. Problemen herstellen"/><link rel="next" href="sect-Security-Enhanced_Linux-Fixing_Problems-Manual_Pages_for_Services.html" title="7.3.3. Manual pagina's voor services"/></head><body class=""><p id="title"><a class="left" href="http://www.fedoraproject.org"><img src="Common_Content/images/image_left.png" alt="Product Site"/></a><a class="right" href="http://docs.fed
oraproject.org"><img src="Common_Content/images/image_right.png" alt="Documentation Site"/></a></p><ul class="docnav"><li class="previous"><a accesskey="p" href="sect-Security-Enhanced_Linux-Troubleshooting-Fixing_Problems.html"><strong>Terug</strong></a></li><li class="next"><a accesskey="n" href="sect-Security-Enhanced_Linux-Fixing_Problems-Manual_Pages_for_Services.html"><strong>Volgende</strong></a></li></ul><div class="section" lang="nl-NL"><div class="titlepage"><div><div><h3 class="title" id="sect-Security-Enhanced_Linux-Fixing_Problems-Possible_Causes_of_Silent_Denials">7.3.2. Mogelijke oorzaken van stille weigeringen</h3></div></div></div><div class="para">
In bepaalde situaties worden AVC weigeringen misschien niet gelogd als SELinux toegang weigert. Toepassingen en systeembibliotheek functies onderzoeken vaak voor meer toegang dan nodig is voor het uitvoeren van hun taak. Om zo weinig mogelijk rechten te onderhouden, zonder de log te vullen met AVC weigeringen voor onschuldig onderzoeken door toepassingen, kan de tactiek AVC weigeringen stil houden zonder een recht toe te staan door het gebruiken van <code class="computeroutput">dontaudit</code> regels. Deze regels komen veel voor in standaard tactiek. Het nadeel van <code class="computeroutput">dontaudit</code> is dat, hoewel SELinux toegang weigert, weigeringsboodschappen niet worden gelogd, wat het foutzoeken moeilijk maakt.
</div><div class="para">
Om tijdelijk <code class="computeroutput">dontaudit</code> regels uit te zetten, zodat alle weigeringen gelogd worden, voer je het volgende commando uit als de Linux root gebruiker:
</div><div class="para">
<code class="command">/usr/sbin/semodule -DB</code>
</div><div class="para">
De <code class="option">-D</code> zet <code class="computeroutput">dontaudit</code> regels uit; de <code class="option">-B</code> optie bouwt de tactiek opnieuw op. Na het uitvoeren van <code class="command">semodule -DB</code>, probeer je de toepassing opnieuw die toestemmigs problemen vertoonde, en kijk of er nu SELinux weigeringen — relevant voor de toepassing — zijn gelogd. Wees voorzichtig met het beslissen welke weigeringen toegestaan moeten worden, omdat sommige genegeerd moeten worden en afgehandeld met <code class="computeroutput">dontaudit</code> regels. In geval van twijfel, of als je hulp zoekt, neem dan contact op met andere SELinux gebruikers en ontwikkelaars op een SELinux lijst, zoals <a href="http://www.redhat.com/mailman/listinfo/fedora-selinux-list">fedora-selinux-list</a>.
</div><div class="para">
Om de tactiek opnieuw te bouwen en <code class="computeroutput">dontaudit</code> regels weer aan te zetten, voer je het volgende commando uit als de Linux root gebruiker:
</div><div class="para">
<code class="command">/usr/sbin/semodule -B</code>
</div><div class="para">
Dit brengt de tactiek terug naar zijn originele toestand. Voor een volledige lijst van <code class="computeroutput">dontaudit</code> regels, voer je het <code class="command">sesearch --dontaudit</code> commando uit. Versmal het zoeken met gebruik van de <code class="option">-s <em class="replaceable"><code>domein</code></em></code> optie en het <code class="command">grep</code> commando. Bijvoorbeeld:
</div><pre class="screen">$ sesearch --dontaudit -s smbd_t | grep squid
WARNING: This policy contained disabled aliases; they have been removed.
dontaudit smbd_t squid_port_t : tcp_socket name_bind ;
dontaudit smbd_t squid_port_t : udp_socket name_bind ;
</pre><div class="para">
Refereer naar <a class="xref" href="sect-Security-Enhanced_Linux-Fixing_Problems-Raw_Audit_Messages.html" title="7.3.6. Ruwe audit boodschappen">Paragraaf 7.3.6, “Ruwe audit boodschappen”</a> en <a class="xref" href="sect-Security-Enhanced_Linux-Fixing_Problems-sealert_Messages.html" title="7.3.7. sealert boodschappen">Paragraaf 7.3.7, “sealert boodschappen”</a> voor informatie over het onderzoeken van weigeringen.
</div></div><ul class="docnav"><li class="previous"><a accesskey="p" href="sect-Security-Enhanced_Linux-Troubleshooting-Fixing_Problems.html"><strong>Terug</strong>7.3. Problemen herstellen</a></li><li class="up"><a accesskey="u" href="#"><strong>Omhoog</strong></a></li><li class="home"><a accesskey="h" href="index.html"><strong>Begin</strong></a></li><li class="next"><a accesskey="n" href="sect-Security-Enhanced_Linux-Fixing_Problems-Manual_Pages_for_Services.html"><strong>Volgende</strong>7.3.3. Manual pagina's voor services</a></li></ul></body></html>
--- NEW FILE sect-Security-Enhanced_Linux-Fixing_Problems-Raw_Audit_Messages.html ---
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>7.3.6. Ruwe audit boodschappen</title><link rel="stylesheet" href="./Common_Content/css/default.css" type="text/css"/><meta name="generator" content="publican"/><meta name="package" content="Fedora-Security-Enhanced_Linux-11-nl-NL-1.3-SELinux_User_guide"/><link rel="home" href="index.html" title="Security-Enhanced Linux"/><link rel="up" href="sect-Security-Enhanced_Linux-Troubleshooting-Fixing_Problems.html" title="7.3. Problemen herstellen"/><link rel="prev" href="sect-Security-Enhanced_Linux-Fixing_Problems-Searching_For_and_Viewing_Denials.html" title="7.3.5. Zoeken naar en het bekijken van weigeringen"/><link rel="next" href="sect-Security-Enhanced_Linux-Fixing_Problems-sealert_Messages.html" title="7.3.7. sealert boodschappen"/></head><body class=""><p id="title"><a class="left" href="http://www.fedoraproject.org"><img src="Common_Content/images/image_left.png" alt="Product Site"/></a><a class="right" href="http://d
ocs.fedoraproject.org"><img src="Common_Content/images/image_right.png" alt="Documentation Site"/></a></p><ul class="docnav"><li class="previous"><a accesskey="p" href="sect-Security-Enhanced_Linux-Fixing_Problems-Searching_For_and_Viewing_Denials.html"><strong>Terug</strong></a></li><li class="next"><a accesskey="n" href="sect-Security-Enhanced_Linux-Fixing_Problems-sealert_Messages.html"><strong>Volgende</strong></a></li></ul><div class="section" lang="nl-NL"><div class="titlepage"><div><div><h3 class="title" id="sect-Security-Enhanced_Linux-Fixing_Problems-Raw_Audit_Messages">7.3.6. Ruwe audit boodschappen</h3></div></div></div><div class="para">
Ruwe audit boodschappen worden gelogd naar <code class="filename">/var/log/audit/audit.log</code>. Het volgende is een voorbeeld AVC weigering (en de bijbehorende systeem aanroep) die optrad toen de Apache HTTP server (draaiende in het <code class="computeroutput">httpd_t</code> domein) probeerde om toegang te krijgen tot het <code class="filename">/var/www/html/file1</code> bestand (gelabeld met het <code class="computeroutput">samba_share_t</code> type):
</div><pre class="screen">type=AVC msg=audit(1226874073.147:96): avc: denied { getattr } for pid=2465 comm="httpd" path="/var/www/html/file1" dev=dm-0 ino=284133 scontext=unconfined_u:system_r:httpd_t:s0 tcontext=unconfined_u:object_r:samba_share_t:s0 tclass=file
type=SYSCALL msg=audit(1226874073.147:96): arch=40000003 syscall=196 success=no exit=-13 a0=b98df198 a1=bfec85dc a2=54dff4 a3=2008171 items=0 ppid=2463 pid=2465 auid=502 uid=48 gid=48 euid=48 suid=48 fsuid=48 egid=48 sgid=48 fsgid=48 tty=(none) ses=6 comm="httpd" exe="/usr/sbin/httpd" subj=unconfined_u:system_r:httpd_t:s0 key=(null)
</pre><div class="variablelist"><dl><dt><span class="term"><em class="replaceable"><code>{ getattr }</code></em></span></dt><dd><div class="para">
Het item tussen accolades geeft het recht aan dat geweigerd was. <code class="computeroutput">getattr</code> geeft aan dat het bron proces probeerde om de status informatie van het doel bestand te lezen. Dit treedt op voor het lezen van bestanden. Deze actie is geweigerd omdat toegang werd geprobeerd naar het bestand dat een verkeerd label had. Vaak geziene rechten zijn <code class="computeroutput">getattr</code>, <code class="computeroutput">read</code>, en <code class="computeroutput">write</code>.
</div></dd><dt><span class="term">comm="<em class="replaceable"><code>httpd</code></em>"</span></dt><dd><div class="para">
Het programma dat het proces heeft opgestart. Het volledige pad van het programma wordt gevonden in de <code class="computeroutput">exe=</code> sectie van de systeem aanroep (<code class="computeroutput">SYSCALL</code>) boodschap, welke in dit geval <code class="computeroutput">exe="/usr/sbin/httpd"</code> is.
</div></dd><dt><span class="term">path="<em class="replaceable"><code>/var/www/html/file1</code></em>"</span></dt><dd><div class="para">
Het pad naar het object (doel) waar het proces toegang naar probeerde te krijgen.
</div></dd><dt><span class="term">scontext="<em class="replaceable"><code>unconfined_u:system_r:httpd_t:s0</code></em>"</span></dt><dd><div class="para">
De SELinux context van het proces dat de geweigerde actie probeerde uit te voeren. In dit geval is het de SELinux context van de Apache HTTP server, welke draait in het <code class="computeroutput">httpd_t</code> domein.
</div></dd><dt><span class="term">tcontext="<em class="replaceable"><code>unconfined_u:object_r:samba_share_t:s0</code></em>"</span></dt><dd><div class="para">
De SELinux context van het object (doel) waarnaar het proces toegang probeerde te krijgen. In dit geval is het de SELinux context van <code class="filename">file1</code>. Merk op: het <code class="computeroutput">samba_share_t</code> type is niet bereikbaar voor processen die draaien in het <code class="computeroutput">httpd_t</code> domein.
</div><div class="para">
In bepaalde situaties kan de <code class="computeroutput">tcontext</code> overeenkomen met de <code class="computeroutput">scontext</code>, bijvoorbeeld, als een proces probeert een systeem service uit te voeren dat de eigenschappen van dat draaiende proces zal veranderen, zoals een gebruikers ID. Ook kan de <code class="computeroutput">tcontext</code> overeenkomen met de <code class="computeroutput">scontext</code> als een proces probeert meer hulpbronnen (zoals geheugen) te gebruiken dan de normale limieten toestaan, wat resulteert in een beveiligings controle om te zien of dat proces gemachtigd is om die limieten te doorbreken.
</div></dd></dl></div><div class="para">
Van de systeem aanroep (<code class="computeroutput">SYSCALL</code>) boodachap, zijn twee items interessant:
</div><div class="itemizedlist"><ul><li><div class="para">
<code class="computeroutput">success=<em class="replaceable"><code>no</code></em></code>: geeft aan of de weigering (AVC) afdwingend was of niet. <code class="computeroutput">success=no</code> geeft aan dat de system aanroep gefaald heeft (SELinux weigerde toegang). <code class="computeroutput">success=yes</code> geeft aan dat de systeem aanroep gelukt is - dit kan voorkomen bij toelatende domeinen of onbeperkte domeinen, zoals <code class="computeroutput">initrc_t</code> en <code class="computeroutput">kernel_t</code>.
</div></li><li><div class="para">
<code class="computeroutput">exe="<em class="replaceable"><code>/usr/sbin/httpd</code></em>"</code>: het volledige pad naar het programma dat het proces heeft opgestart, welke in dit geval <code class="computeroutput">exe="/usr/sbin/httpd"</code> is.
</div></li></ul></div><div class="para">
Een foutief bestandstype is een veel voorkomende oorzaak voor het weigeren van toegang door SELinux. Om te beginnen met foutzoeken, vergelijk je de bron context (<code class="computeroutput">scontext</code>) met de doel context (<code class="computeroutput">tcontext</code>). Moet het proces (<code class="computeroutput">scontext</code>) toegang hebben tot zo'n object (<code class="computeroutput">tcontext</code>)? Bijvoorbeeld, de Apache HTTP server (<code class="computeroutput">httpd_t</code>) moet alleen toegang hebben tot types gespecificeerd in de <span class="citerefentry"><span class="refentrytitle">httpd_selinux</span>(8)</span> manual pagina, zoals <code class="computeroutput">httpd_sys_content_t</code>, <code class="computeroutput">public_content_t</code>, enzovoort, behalve als iets anders ingesteld was.
</div></div><ul class="docnav"><li class="previous"><a accesskey="p" href="sect-Security-Enhanced_Linux-Fixing_Problems-Searching_For_and_Viewing_Denials.html"><strong>Terug</strong>7.3.5. Zoeken naar en het bekijken van weigeringen</a></li><li class="up"><a accesskey="u" href="#"><strong>Omhoog</strong></a></li><li class="home"><a accesskey="h" href="index.html"><strong>Begin</strong></a></li><li class="next"><a accesskey="n" href="sect-Security-Enhanced_Linux-Fixing_Problems-sealert_Messages.html"><strong>Volgende</strong>7.3.7. sealert boodschappen</a></li></ul></body></html>
--- NEW FILE sect-Security-Enhanced_Linux-Fixing_Problems-sealert_Messages.html ---
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>7.3.7. sealert boodschappen</title><link rel="stylesheet" href="./Common_Content/css/default.css" type="text/css"/><meta name="generator" content="publican"/><meta name="package" content="Fedora-Security-Enhanced_Linux-11-nl-NL-1.3-SELinux_User_guide"/><link rel="home" href="index.html" title="Security-Enhanced Linux"/><link rel="up" href="sect-Security-Enhanced_Linux-Troubleshooting-Fixing_Problems.html" title="7.3. Problemen herstellen"/><link rel="prev" href="sect-Security-Enhanced_Linux-Fixing_Problems-Raw_Audit_Messages.html" title="7.3.6. Ruwe audit boodschappen"/><link rel="next" href="sect-Security-Enhanced_Linux-Fixing_Problems-Allowing_Access_audit2allow.html" title="7.3.8. Toegang toestaan: audit2allow"/></head><body class=""><p id="title"><a class="left" href="http://www.fedoraproject.org"><img src="Common_Content/images/image_left.png" alt="Product Site"/></a><a class="right" href="http://docs.fedoraproject.
org"><img src="Common_Content/images/image_right.png" alt="Documentation Site"/></a></p><ul class="docnav"><li class="previous"><a accesskey="p" href="sect-Security-Enhanced_Linux-Fixing_Problems-Raw_Audit_Messages.html"><strong>Terug</strong></a></li><li class="next"><a accesskey="n" href="sect-Security-Enhanced_Linux-Fixing_Problems-Allowing_Access_audit2allow.html"><strong>Volgende</strong></a></li></ul><div class="section" lang="nl-NL"><div class="titlepage"><div><div><h3 class="title" id="sect-Security-Enhanced_Linux-Fixing_Problems-sealert_Messages">7.3.7. sealert boodschappen</h3></div></div></div><div class="para">
Weigeringen krijgen ID's toegewezen, zoals te zien is in <code class="filename">/var/log/messages</code>. Het volgende is een voorbeeld AVC weigering (gelogd naar <code class="filename">messages</code>) die optrad toen de Apache HTTP server (draaiende in het <code class="computeroutput">httpd_t</code> domein) probeerde toegang te krijgen tot het <code class="filename">/var/www/html/file1</code> bestand (gelabeld met het <code class="computeroutput">samba_share_t</code> type):
</div><pre class="screen"><em class="replaceable"><code>hostname</code></em> setroubleshoot: SELinux is preventing httpd (httpd_t) "getattr" to /var/www/html/file1 (samba_share_t). For complete SELinux messages. run sealert -l 84e0b04d-d0ad-4347-8317-22e74f6cd020
</pre><div class="para">
Zoals aangeraden, voer je het <code class="command">sealert -l 84e0b04d-d0ad-4347-8317-22e74f6cd020</code> commando uit om de complete boodschap te zien. Dit commando werkt alleen op de locale machine, en presenteert dezelfde informatie als de <code class="command">sealert</code> GUI:
</div><pre class="screen">$ sealert -l 84e0b04d-d0ad-4347-8317-22e74f6cd020
Summary:
SELinux is preventing httpd (httpd_t) "getattr" to /var/www/html/file1
(samba_share_t).
Detailed Description:
SELinux denied access to /var/www/html/file1 requested by httpd.
/var/www/html/file1 has a context used for sharing by different program. If you
would like to share /var/www/html/file1 from httpd also, you need to change its
file context to public_content_t. If you did not intend to this access, this
could signal a intrusion attempt.
Allowing Access:
You can alter the file context by executing chcon -t public_content_t
'/var/www/html/file1'
Fix Command:
chcon -t public_content_t '/var/www/html/file1'
Additional Information:
Source Context unconfined_u:system_r:httpd_t:s0
Target Context unconfined_u:object_r:samba_share_t:s0
Target Objects /var/www/html/file1 [ file ]
Source httpd
Source Path /usr/sbin/httpd
Port <Unknown>
Host <em class="replaceable"><code>hostname</code></em>
Source RPM Packages httpd-2.2.10-2
Target RPM Packages
Policy RPM selinux-policy-3.5.13-11.fc11
Selinux Enabled True
Policy Type targeted
MLS Enabled True
Enforcing Mode Enforcing
Plugin Name public_content
Host Name <em class="replaceable"><code>hostname</code></em>
Platform <em class="replaceable"><code>Linux hostname 2.6.27.4-68.fc11.i686 #1 SMP Thu Oct</code></em>
30 00:49:42 EDT 2008 i686 i686
Alert Count 4
First Seen Wed Nov 5 18:53:05 2008
Last Seen Wed Nov 5 01:22:58 2008
Local ID 84e0b04d-d0ad-4347-8317-22e74f6cd020
Line Numbers
Raw Audit Messages
node=<em class="replaceable"><code>hostname</code></em> type=AVC msg=audit(1225812178.788:101): avc: denied { getattr } for pid=2441 comm="httpd" path="/var/www/html/file1" dev=dm-0 ino=284916 scontext=unconfined_u:system_r:httpd_t:s0 tcontext=unconfined_u:object_r:samba_share_t:s0 tclass=file
node=<em class="replaceable"><code>hostname</code></em> type=SYSCALL msg=audit(1225812178.788:101): arch=40000003 syscall=196 success=no exit=-13 a0=b8e97188 a1=bf87aaac a2=54dff4 a3=2008171 items=0 ppid=2439 pid=2441 auid=502 uid=48 gid=48 euid=48 suid=48 fsuid=48 egid=48 sgid=48 fsgid=48 tty=(none) ses=3 comm="httpd" exe="/usr/sbin/httpd" subj=unconfined_u:system_r:httpd_t:s0 key=(null)
</pre><div class="variablelist"><dl><dt><span class="term">Summary - samenvatting</span></dt><dd><div class="para">
Een korte samenvatting van de geweigerde actie. Dit is hetzelfde als de weigering in <code class="filename">/var/log/messages</code>. In dit voorbeeld, werd het <code class="systemitem">httpd</code> proces toegang geweigerd tot een bestand (<code class="filename">file1</code>), welke gelabeld is met het <code class="computeroutput">samba_share_t</code> type.
</div></dd><dt><span class="term">Detailed Description - Gedetaileerde beschrijving</span></dt><dd><div class="para">
Een langere beschrijving. In dit voorbeeld is <code class="filename">file1</code> gelabeld met het <code class="computeroutput">samba_share_t</code> type. Dit type wordt gebruikt voor bestanden en mappen die je wilt exporteren met Samba. De beschrijving suggereert het veranderen van het type naar een type dat bereikt kan worden door de Apache HTTP server en Samba, als die toegang gewenst is.
</div></dd><dt><span class="term">Allowing Acces - Toegang toestaan</span></dt><dd><div class="para">
Een suggestie voor het toestaan van de toegang. Dit kan het herlabelen van bestanden zijn, het aanzetten van een Boolean, of het maken van een locale tactiek module. In dit geval is de aanbeveling om het bestand te labelen met een type waarnaar zowel de Apache HTTP server en Samba toegang naar hebben.
</div></dd><dt><span class="term">Fix Command - Herstel commando</span></dt><dd><div class="para">
Een gesuggereerd commando om toegang toe te staan en de weigering op te lossen. In dit voorbeeld is dat het commando om het type van <code class="filename">file1</code> te veranderen naar <code class="computeroutput">public_content_t</code>, welke toegankelijk is voor de Apache HTTP server en Samba.
</div></dd><dt><span class="term">Additional Information - Extra informatie</span></dt><dd><div class="para">
Informatie die nuttig is voor foutrapporten, zoals de naam en versie van het tactiek pakket (<code class="computeroutput">selinux-policy-3.5.13-11.fc11</code>), maar die niet zal helpen om de reden van de weigering op te lossen.
</div></dd><dt><span class="term">Raw Audit Messages - Ruwe audit boodschappen</span></dt><dd><div class="para">
De ruwe audit boodschappen van <code class="filename">/var/log/audit/audit.log</code> die verbonden zijn met de weigering. Refereer naar <a class="xref" href="sect-Security-Enhanced_Linux-Fixing_Problems-Raw_Audit_Messages.html" title="7.3.6. Ruwe audit boodschappen">Paragraaf 7.3.6, “Ruwe audit boodschappen”</a> voor informatie over ieder item in de AVC weigering.
</div></dd></dl></div></div><ul class="docnav"><li class="previous"><a accesskey="p" href="sect-Security-Enhanced_Linux-Fixing_Problems-Raw_Audit_Messages.html"><strong>Terug</strong>7.3.6. Ruwe audit boodschappen</a></li><li class="up"><a accesskey="u" href="#"><strong>Omhoog</strong></a></li><li class="home"><a accesskey="h" href="index.html"><strong>Begin</strong></a></li><li class="next"><a accesskey="n" href="sect-Security-Enhanced_Linux-Fixing_Problems-Allowing_Access_audit2allow.html"><strong>Volgende</strong>7.3.8. Toegang toestaan: audit2allow</a></li></ul></body></html>
--- NEW FILE sect-Security-Enhanced_Linux-Fixing_Problems-Searching_For_and_Viewing_Denials.html ---
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>7.3.5. Zoeken naar en het bekijken van weigeringen</title><link rel="stylesheet" href="./Common_Content/css/default.css" type="text/css"/><meta name="generator" content="publican"/><meta name="package" content="Fedora-Security-Enhanced_Linux-11-nl-NL-1.3-SELinux_User_guide"/><link rel="home" href="index.html" title="Security-Enhanced Linux"/><link rel="up" href="sect-Security-Enhanced_Linux-Troubleshooting-Fixing_Problems.html" title="7.3. Problemen herstellen"/><link rel="prev" href="sect-Security-Enhanced_Linux-Permissive_Domains-Denials_for_Permissive_Domains.html" title="7.3.4.2. Weigeringen voor toelatende domeinen"/><link rel="next" href="sect-Security-Enhanced_Linux-Fixing_Problems-Raw_Audit_Messages.html" title="7.3.6. Ruwe audit boodschappen"/></head><body class=""><p id="title"><a class="left" href="http://www.fedoraproject.org"><img src="Common_Content/images/image_left.png" alt="Product Site"/></a><a class="r
ight" href="http://docs.fedoraproject.org"><img src="Common_Content/images/image_right.png" alt="Documentation Site"/></a></p><ul class="docnav"><li class="previous"><a accesskey="p" href="sect-Security-Enhanced_Linux-Permissive_Domains-Denials_for_Permissive_Domains.html"><strong>Terug</strong></a></li><li class="next"><a accesskey="n" href="sect-Security-Enhanced_Linux-Fixing_Problems-Raw_Audit_Messages.html"><strong>Volgende</strong></a></li></ul><div class="section" lang="nl-NL"><div class="titlepage"><div><div><h3 class="title" id="sect-Security-Enhanced_Linux-Fixing_Problems-Searching_For_and_Viewing_Denials">7.3.5. Zoeken naar en het bekijken van weigeringen</h3></div></div></div><div class="para">
Deze paragraaf neemt aan dat de <span class="package">setroubleshoot</span>, <span class="package">setroubleshoot-server</span>, en <span class="package">audit</span> pakketten geinstalleerd zijn, en dat de <code class="systemitem">auditd</code>, <code class="systemitem">rsyslogd</code>, en <code class="systemitem">setroubleshootd</code> daemons draaien. Refereer naar <a class="xref" href="sect-Security-Enhanced_Linux-Working_with_SELinux-Which_Log_File_is_Used.html" title="5.2. Welk log bestand wordt gebruikt">Paragraaf 5.2, “Welk log bestand wordt gebruikt”</a> voor informatie over het starten van deze daemons. Een aantal gereedschappen zijn beschikbaar voor het zoeken naar en bekijken van SELinux weigeringen, zoals <code class="command">ausearch</code>, <code class="command">aureport</code>, en <code class="command">sealert</code>.
</div><div class="formalpara"><h5 class="formalpara" id="form-Security-Enhanced_Linux-Searching_For_and_Viewing_Denials-ausearch">ausearch</h5>
Het <span class="package">audit</span> pakket bevat <code class="command">ausearch</code>. Uit de <span class="citerefentry"><span class="refentrytitle">ausearch</span>(8)</span> manual pagina: "<code class="command">ausearch</code> is een gereedschap dat de daemon logs kan onderzoeken voor gebeurtenissen gebaseerd op verscheidene zoek criteria"<sup>[<a id="d0e5962" href="#ftn.d0e5962" class="footnote">16</a>]</sup>. Het <code class="command">ausearch</code> gereedschap heeft toegang tot <code class="filename">/var/log/audit/audit.log</code>, en moet daarom als de Linux root gebruiker uitgevoerd worden:
</div><div class="segmentedlist"><table border="0"><thead><tr class="segtitle"><th>Zoeken naar</th><th>Commando</th></tr></thead><tbody><tr class="seglistitem"><td class="seg">alle weigeringen</td><td class="seg"><code class="command">/sbin/ausearch -m avc</code></td></tr><tr class="seglistitem"><td class="seg">weigeringen voor vandaag</td><td class="seg"><code class="command">/sbin/ausearch -m avc -ts today</code></td></tr><tr class="seglistitem"><td class="seg">weigeringen van de laatste 10 minuten</td><td class="seg"><code class="command">/sbin/ausearch -m avc -ts recent</code></td></tr></tbody></table></div><div class="para">
Om te zoeken naar SELinux weigeringen voor een bepaalde service, gebruik je de <code class="option">-c <em class="replaceable"><code>comm-naam</code></em></code> optie, waarin <em class="replaceable"><code>comm-naam</code></em> de naam van het programma is<sup>[<a id="d0e6014" href="#ftn.d0e6014" class="footnote">17</a>]</sup>, bijvoorbeeld, <code class="systemitem">httpd</code> voor de Apache HTTP server, en <code class="systemitem">smbd</code> voor Samba:
</div><div class="para">
<code class="command">/sbin/ausearch -m avc -c httpd</code>
</div><div class="para">
<code class="command">/sbin/ausearch -m avc -c smbd</code>
</div><div class="para">
Refereer naar de <span class="citerefentry"><span class="refentrytitle">ausearch</span>(8)</span> manual pagina voor meer <code class="command">ausearch</code> opties.
</div><div class="formalpara"><h5 class="formalpara" id="form-Security-Enhanced_Linux-Searching_For_and_Viewing_Denials-aureport">aureport</h5>
Het <span class="package">audit</span> pakket bevat <code class="command">aureport</code>. Uit de <span class="citerefentry"><span class="refentrytitle">aureport</span>(8)</span> manual pagina: "<code class="command">aureport</code> is een gereedschap dat samenvattingsrapporten maakt van de systeem logs"<sup>[<a id="d0e6074" href="#ftn.d0e6074" class="footnote">18</a>]</sup>. Het <code class="command">aureport</code> gereedschap heeft toegang tot <code class="filename">/var/log/audit/audit.log</code>, en moet daarom als de Linux root gebruiker uitgevoerd worden. Om een lijst te zien van SELinux weigeringen en hoe vaak ze zijn voorgekomen, voer je het <code class="command">aureport -a</code> commando uit. Het volgende is een vorbeeld output die twee weigeringen bevat:
</div><pre class="screen"># /sbin/aureport -a
AVC Report
========================================================
# date time comm subj syscall class permission obj event
========================================================
1. 05/01/2009 21:41:39 httpd unconfined_u:system_r:httpd_t:s0 195 file getattr system_u:object_r:samba_share_t:s0 denied 2
2. 05/03/2009 22:00:25 vsftpd unconfined_u:system_r:ftpd_t:s0 5 file read unconfined_u:object_r:cifs_t:s0 denied 4
</pre><div class="para">
Refereer naar de <span class="citerefentry"><span class="refentrytitle">aureport</span>(8)</span> manual pagina voor meer <code class="command">aureport</code> opties.
</div><div class="formalpara"><h5 class="formalpara" id="form-Security-Enhanced_Linux-Searching_For_and_Viewing_Denials-sealert">sealert</h5>
Het <span class="package">setroubleshoot-server</span> pakket bevat <code class="command">sealert</code>, welke weigerings boodschappen leest die vertaald zijn door <span class="package">setroubleshoot-server</span>. Weigeringen krijgen ID's toegekend, zoals te zien in <code class="filename">/var/log/messages</code>. Het volgende is een voorbeeld weigering van <code class="filename">messages</code>:
</div><pre class="screen">setroubleshoot: SELinux is preventing httpd (httpd_t) "getattr" to /var/www/html/file1 (samba_share_t). For complete SELinux messages. run sealert -l 84e0b04d-d0ad-4347-8317-22e74f6cd020
</pre><div class="para">
In dit voorbeeld is de ID van de weigering <code class="computeroutput">84e0b04d-d0ad-4347-8317-22e74f6cd020</code>. De <code class="option">-l</code> optie neemt een ID als argument. Het uitvoeren van het <code class="command">sealert -l 84e0b04d-d0ad-4347-8317-22e74f6cd020</code> commando laat een gedetaileerde analyse zien waarom SELinux toegang weigerde, en een mogelijke oplossing om toegang toe te staan.
</div><div class="para">
Als je het X Window systeen draait, je de <span class="package">setroubleshoot</span> en <span class="package">setroubleshoot-server</span> pakketten geinstalleerd hebt, en de <code class="systemitem">setroubleshootd</code> en <code class="systemitem">auditd</code> daemons draaien, worden een gele ster en een waarschuwing getoond als toegang geweigerd wordt door SELinux. Het klikken op de ster start de <code class="command">sealert</code> GUI, en laat de weigeringen zien in HTML output:
</div><div class="mediaobject"><img src="./images/sealert_gui.png"/></div><div class="itemizedlist"><ul><li><div class="para">
Voer het <code class="command">sealert -b</code> commando uit om de <code class="command">sealert</code> GUI op te starten.
</div></li><li><div class="para">
Voer het <code class="command">sealert -l \*</code> commando uit om een gedetaileerde analyse van alle weigeringen te zien.
</div></li><li><div class="para">
Als de Linux root gebruiker voer je het <code class="command">sealert -a /var/log/audit/audit.log -H > audit.html</code> commando uit om een HTML versie te maken van de <code class="command">sealert</code> analyse, zoals te zien is met de <code class="command">sealert</code> GUI.
</div></li></ul></div><div class="para">
Refereer naar de <span class="citerefentry"><span class="refentrytitle">sealert</span>(8)</span> manual pagina voor meer <code class="command">sealert</code> opties.
</div><div class="footnotes"><br/><hr/><div class="footnote"><p><sup>[<a id="ftn.d0e5962" href="#d0e5962" class="para">16</a>] </sup>
Van de <span class="citerefentry"><span class="refentrytitle">ausearch</span>(8)</span> manual pagina, zoals verstuurd met het <span class="package">audit</span> pakket in Fedora 11.
</p></div><div class="footnote"><p><sup>[<a id="ftn.d0e6014" href="#d0e6014" class="para">17</a>] </sup>
Van de <span class="citerefentry"><span class="refentrytitle">ausearch</span>(8)</span> manual pagina, zoals verstuurd met het <span class="package">audit</span> pakket in Fedora 11.
</p></div><div class="footnote"><p><sup>[<a id="ftn.d0e6074" href="#d0e6074" class="para">18</a>] </sup>
Uit de <span class="citerefentry"><span class="refentrytitle">aureport</span>(8)</span> manual pagina, zoals verstuurd met het <span class="package">audit</span> pakket in Fedora 11.
</p></div></div></div><ul class="docnav"><li class="previous"><a accesskey="p" href="sect-Security-Enhanced_Linux-Permissive_Domains-Denials_for_Permissive_Domains.html"><strong>Terug</strong>7.3.4.2. Weigeringen voor toelatende domeinen</a></li><li class="up"><a accesskey="u" href="#"><strong>Omhoog</strong></a></li><li class="home"><a accesskey="h" href="index.html"><strong>Begin</strong></a></li><li class="next"><a accesskey="n" href="sect-Security-Enhanced_Linux-Fixing_Problems-Raw_Audit_Messages.html"><strong>Volgende</strong>7.3.6. Ruwe audit boodschappen</a></li></ul></body></html>
--- NEW FILE sect-Security-Enhanced_Linux-Further_Information-Other_Resources.html ---
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>8.2. Other Resources</title><link rel="stylesheet" href="./Common_Content/css/default.css" type="text/css"/><meta name="generator" content="publican"/><meta name="package" content="Fedora-Security-Enhanced_Linux-11-nl-NL-1.3-SELinux_User_guide"/><link rel="home" href="index.html" title="Security-Enhanced Linux"/><link rel="up" href="chap-Security-Enhanced_Linux-Further_Information.html" title="Hoofdstuk 8. Verdere informatie"/><link rel="prev" href="chap-Security-Enhanced_Linux-Further_Information.html" title="Hoofdstuk 8. Verdere informatie"/><link rel="next" href="appe-Security-Enhanced_Linux-Revision_History.html" title="Bijlage A. Revision History"/></head><body class=""><p id="title"><a class="left" href="http://www.fedoraproject.org"><img src="Common_Content/images/image_left.png" alt="Product Site"/></a><a class="right" href="http://docs.fedoraproject.org"><img src="Common_Content/images/image_right.png" alt="Docu
mentation Site"/></a></p><ul class="docnav"><li class="previous"><a accesskey="p" href="chap-Security-Enhanced_Linux-Further_Information.html"><strong>Terug</strong></a></li><li class="next"><a accesskey="n" href="appe-Security-Enhanced_Linux-Revision_History.html"><strong>Volgende</strong></a></li></ul><div class="section" lang="nl-NL"><div class="titlepage"><div><div><h2 class="title" id="sect-Security-Enhanced_Linux-Further_Information-Other_Resources">8.2. Other Resources</h2></div></div></div><div class="formalpara"><h5 class="formalpara" id="form-Security-Enhanced_Linux-Further_Information-The_National_Security_Agency_NSA">De National Security Agency (NSA)</h5>
Van de NSA <a href="http://www.nsa.gov/research/selinux/contrib.shtml">Bijdragers aan SELinux</a> pagina:
</div><div class="para">
<span class="emphasis"><em>Onderzoekers in het National Information Assurance Research Laboratory (NIARL) van NSA ontwikkelden en implementeerden flexibele verplichte toegangscontrole in de belangrijkste subsystemen van de Linux kernel en implementeerden de nieuwe operating systeem onderdelen aangeboden door de Flask architectuur, namelijk de beveiligings server en de toegangs vector cache. De NSA onderzoekers pasten de op LSM gebaseerde SELinux aan om opgenomen te worden in Linux 2.6. NSA heeft ook de ontwikkeling geleid van soortgelijke controles voor het X Window systeem (XACE/XSELinux) en voor Xen (XSM/Flask).</em></span>
</div><div class="itemizedlist"><ul><li><div class="para">
Hoofd SELinux website: <a href="http://www.nsa.gov/research/selinux/index.shtml">http://www.nsa.gov/research/selinux/index.shtml</a>.
</div></li><li><div class="para">
SELinux documentatie: <a href="http://www.nsa.gov/research/selinux/docs.shtml">http://www.nsa.gov/research/selinux/docs.shtml</a>.
</div></li><li><div class="para">
SELinux achtergrond: <a href="http://www.nsa.gov/research/selinux/background.shtml">http://www.nsa.gov/research/selinux/background.shtml</a>.
</div></li></ul></div><div class="formalpara"><h5 class="formalpara" id="form-Security-Enhanced_Linux-Further_Information-Tresys_Technology">Tresys Technology</h5>
<a href="http://www.tresys.com/">Tresys Technology</a> is de upstream ontwikkeling voor:
</div><div class="itemizedlist"><ul><li><div class="para">
<a href="http://userspace.selinuxproject.org/trac/">SELinux gebruikersomgeving bibliotheken en gereedschappen</a>.
</div></li><li><div class="para">
<a href="http://oss.tresys.com/projects/refpolicy">SELinux Referentie Tactiek</a>.
</div></li></ul></div><div class="formalpara"><h5 class="formalpara" id="form-Security-Enhanced_Linux-Further_Information-SELinux_News">SELinux News</h5>
<div class="itemizedlist"><ul><li><div class="para">
Nieuws: <a href="http://selinuxnews.org/wp/">http://selinuxnews.org/wp/</a>.
</div></li><li><div class="para">
Planet SELinux (blogs): <a href="http://selinuxnews.org/planet/">http://selinuxnews.org/planet/</a>.
</div></li></ul></div>
</div><div class="formalpara"><h5 class="formalpara" id="form-Security-Enhanced_Linux-Further_Information-SELinux_Project_Wiki">SELinux Project Wiki</h5>
<div class="itemizedlist"><ul><li><div class="para">
Hoofd pagina: <a href="http://selinuxproject.org/page/Main_Page">http://selinuxproject.org/page/Main_Page</a>.
</div></li><li><div class="para">
Gebruikers hulpbronnen, inclusief verwijzingen naar documentatie, maillijsten, websites, en gereedschappen: <a href="http://selinuxproject.org/page/User_Resources">http://selinuxproject.org/page/User_Resources</a>.
</div></li></ul></div>
</div><div class="formalpara"><h5 class="formalpara" id="form-Security-Enhanced_Linux-Further_Information-Red_Hat_Enterprise_Linux">Red Hat Enterprise Linux</h5>
<div class="itemizedlist"><ul><li><div class="para">
De <a href="http://www.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/5.2/html/Deploy...">Red Hat Enterprise Linux Deployment Guide</a> bevat een SELinux <a href="http://www.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/5.2/html/Deploy...">Referenties</a> sectie, die verwijzingen heeft naar SELinux handleidingen, algemene informatie, en de technologie achter SELinux.
</div></li><li><div class="para">
De <a href="http://www.redhat.com/docs/manuals/enterprise/RHEL-4-Manual/selinux-guide...">Red Hat Enterprise Linux 4 SELinux Guide</a>.
</div></li></ul></div>
</div><div class="formalpara"><h5 class="formalpara" id="form-Security-Enhanced_Linux-Further_Information-Fedora">Fedora</h5>
<div class="itemizedlist"><ul><li><div class="para">
Hoofd pagina: <a href="http://fedoraproject.org/wiki/SELinux">http://fedoraproject.org/wiki/SELinux</a>.
</div></li><li><div class="para">
Foutoplossen: <a href="http://fedoraproject.org/wiki/SELinux/Troubleshooting">http://fedoraproject.org/wiki/SELinux/Troubleshooting</a>.
</div></li><li><div class="para">
Fedora Core 5 SELinux FAQ: <a href="http://docs.fedoraproject.org/selinux-faq-fc5/">http://docs.fedoraproject.org/selinux-faq-fc5/</a>.
</div></li></ul></div>
</div><div class="formalpara"><h5 class="formalpara" id="form-Security-Enhanced_Linux-Further_Information-The_UnOfficial_SELinux_FAQ">De officieuze SELinux FAQ</h5>
<a href="http://www.crypt.gen.nz/selinux/faq.html">http://www.crypt.gen.nz/selinux/faq.html</a>
</div><div class="formalpara"><h5 class="formalpara" id="form-Security-Enhanced_Linux-Further_Information-IRC">IRC</h5>
Op <a href="http://freenode.net/">Freenode</a>:
</div><div class="itemizedlist"><ul><li><div class="para">
#selinux
</div></li><li><div class="para">
#fedora-selinux
</div></li></ul></div></div><ul class="docnav"><li class="previous"><a accesskey="p" href="chap-Security-Enhanced_Linux-Further_Information.html"><strong>Terug</strong>Hoofdstuk 8. Verdere informatie</a></li><li class="up"><a accesskey="u" href="#"><strong>Omhoog</strong></a></li><li class="home"><a accesskey="h" href="index.html"><strong>Begin</strong></a></li><li class="next"><a accesskey="n" href="appe-Security-Enhanced_Linux-Revision_History.html"><strong>Volgende</strong>Bijlage A. Revision History</a></li></ul></body></html>
--- NEW FILE sect-Security-Enhanced_Linux-Introduction-Examples.html ---
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>2.2. Voorbeelden</title><link rel="stylesheet" href="./Common_Content/css/default.css" type="text/css"/><meta name="generator" content="publican"/><meta name="package" content="Fedora-Security-Enhanced_Linux-11-nl-NL-1.3-SELinux_User_guide"/><link rel="home" href="index.html" title="Security-Enhanced Linux"/><link rel="up" href="chap-Security-Enhanced_Linux-Introduction.html" title="Hoofdstuk 2. Inleiding"/><link rel="prev" href="chap-Security-Enhanced_Linux-Introduction.html" title="Hoofdstuk 2. Inleiding"/><link rel="next" href="sect-Security-Enhanced_Linux-Introduction-SELinux_Architecture.html" title="2.3. SELinux architectuur"/></head><body class=""><p id="title"><a class="left" href="http://www.fedoraproject.org"><img src="Common_Content/images/image_left.png" alt="Product Site"/></a><a class="right" href="http://docs.fedoraproject.org"><img src="Common_Content/images/image_right.png" alt="Documentation Site"/></a>
</p><ul class="docnav"><li class="previous"><a accesskey="p" href="chap-Security-Enhanced_Linux-Introduction.html"><strong>Terug</strong></a></li><li class="next"><a accesskey="n" href="sect-Security-Enhanced_Linux-Introduction-SELinux_Architecture.html"><strong>Volgende</strong></a></li></ul><div class="section" lang="nl-NL"><div class="titlepage"><div><div><h2 class="title" id="sect-Security-Enhanced_Linux-Introduction-Examples">2.2. Voorbeelden</h2></div></div></div><div class="para">
De volgende voorbeelden laten zien hoe SELinux de beveiliging verbetert:
</div><div class="itemizedlist"><ul><li><div class="para">
de standaard actie is weigeren. Als er geen SELinux tactiek regel bestaat om toegang toe te staan, zoals voor een proces om een bestand te openen, wordt toegang geweigerd.
</div></li><li><div class="para">
SELinux kan Linux gebruikers beperken. Er bestaan een aantal beperkte SELinux gebruikers. Linux gebruikers kunnen afgebeeld worden op SELinux gebruikers om voordeel te hebben van beperkte SELinux gebruikers. Bijvoorbeeld, een Linux gebruiker afbeelden op de SELinux user_u gebruiker, resulteert in een Linux gebruiker die niet in staat is om instellen van user ID (setuid) toepassingen te draaien (tenzij anders geconfigureerd), zoals <code class="command">sudo</code> en <code class="command">su</code>, zowel als ze te verhinderen om bestanden en toepassingen in hun persoonlijke map uit te voeren - als dat ingesteld is, dit belet gebruikers om verdachte bestanden vanuit hun persoonlijke mappen op te starten.
</div></li><li><div class="para">
proces scheiding. Processen draaien in hun eigen domein, wat processen verhindert om toegang te krijgen tot bestanden die door andere processen gebruikt worden, en ook voorkomen dat processen toegang krijgen tot andere processen. Bijvoorbeeld, als SELinux gedraaid wordt, tenzij anders ingesteld, kan een aanvaller een Samba server niet compromitteren, en dan die Samba server gebruiken om te lezen en te schrijven naar bestanden in gebruik van andere processen, zoals een database gebruikt door <span class="trademark">MySQL</span>®.
</div></li><li><div class="para">
helpt de schade te beperken veroorzaakt door configuratie vergissingen. <a href="http://en.wikipedia.org/wiki/Domain_Name_System">Domain Name System (DNS)</a> servers kunnen een kopie maken van elkaars informatie. Dit staat bekend als zone transfer. Aanvallers kunnen zone transfer gebruiken om DNS servers te vernieuwen met verkeerde informatie. Als je de <a href="https://www.isc.org/software/bind">Berkeley Internet Name Domain (BIND)</a> DNS server in Fedora 11 draait, zelfs als een beheerder vergeet te beperken welke server een zone transfer kan uitvoeren, zal de standaard SELinux tactiek voorkomen dat zone bestanden <sup>[<a id="d0e632" href="#ftn.d0e632" class="footnote">3</a>]</sup> vernieuwd worden door zone transfers, het BIND <code class="systemitem">named</code> daemon, en andere processen.
</div></li><li><div class="para">
refereer naar het <a href="http://www.redhatmagazine.com/"><span class="trademark">Red Hat</span>® Magazine</a> artikel, <a href="http://www.redhatmagazine.com/2008/02/26/risk-report-three-years-of-red-h...">Risk report: Three years of Red Hat Enterprise Linux 4</a><sup>[<a id="d0e649" href="#ftn.d0e649" class="footnote">4</a>]</sup>, voor uitbuitingen die beperkt werden dankzij de standaard SELinux doel tactiek in <span class="trademark">Red Hat</span>® Enterprise <span class="trademark">Linux</span>® 4.
</div></li><li><div class="para">
refereer naar het <a href="http://www.linuxworld.com">LinuxWorld.com</a> artikel, <a href="http://www.linuxworld.com/news/2008/022408-selinux.html?page=1">A seatbelt for server software: SELinux blocks real-world exploits</a><sup>[<a id="d0e669" href="#ftn.d0e669" class="footnote">5</a>]</sup>, voor achtergrond informatie over SELinux, en informatie over verscheidene uitbuitingen die SELinux heeft voorkomen.
</div></li><li><div class="para">
refereer naar James Morris's <a href="http://james-morris.livejournal.com/25421.html">SELinux mitigates remote root vulnerability in OpenPegasus</a> blog post, voor informatie over een uitbuiting in <a href="http://www.openpegasus.org/">OpenPegasus</a> die was verlicht door SELinux zoals geleverd met Red Hat Enterprise Linux 4 en 5.
</div></li></ul></div><div class="para">
De <a href="http://www.tresys.com/">Tresys Technology</a> website heeft een <a href="http://www.tresys.com/innovation.php">SELinux Mitigation News</a> sectie (aan de rechter kant) die recente uitbuitingen laat zien die verlicht of verhinderd zijn door SELinux.
</div><div class="footnotes"><br/><hr/><div class="footnote"><p><sup>[<a id="ftn.d0e632" href="#d0e632" class="para">3</a>] </sup>
Tekst bestanden die informatie bevatten, zoals hostnaam naar IP adres omzetting, die gebruikt wordt door DNS servers.
</p></div><div class="footnote"><p><sup>[<a id="ftn.d0e649" href="#d0e649" class="para">4</a>] </sup>
Cox, Mark. "Risk report: Three years of Red Hat Enterprise Linux 4". Published 26 February 2008. Accessed 28 August 2008: <a href="http://www.redhatmagazine.com/2008/02/26/risk-report-three-years-of-red-h...">http://www.redhatmagazine.com/2008/02/26/risk-report-three-years-of-red-h...</a>.
</p></div><div class="footnote"><p><sup>[<a id="ftn.d0e669" href="#d0e669" class="para">5</a>] </sup>
Marti, Don. "A seatbelt for server software: SELinux blocks real-world exploits". Published 24 February 2008. Accessed 28 August 2008: <a href="http://www.linuxworld.com/news/2008/022408-selinux.html?page=1">http://www.linuxworld.com/news/2008/022408-selinux.html?page=1</a>.
</p></div></div></div><ul class="docnav"><li class="previous"><a accesskey="p" href="chap-Security-Enhanced_Linux-Introduction.html"><strong>Terug</strong>Hoofdstuk 2. Inleiding</a></li><li class="up"><a accesskey="u" href="#"><strong>Omhoog</strong></a></li><li class="home"><a accesskey="h" href="index.html"><strong>Begin</strong></a></li><li class="next"><a accesskey="n" href="sect-Security-Enhanced_Linux-Introduction-SELinux_Architecture.html"><strong>Volgende</strong>2.3. SELinux architectuur</a></li></ul></body></html>
--- NEW FILE sect-Security-Enhanced_Linux-Introduction-SELinux_Architecture.html ---
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>2.3. SELinux architectuur</title><link rel="stylesheet" href="./Common_Content/css/default.css" type="text/css"/><meta name="generator" content="publican"/><meta name="package" content="Fedora-Security-Enhanced_Linux-11-nl-NL-1.3-SELinux_User_guide"/><link rel="home" href="index.html" title="Security-Enhanced Linux"/><link rel="up" href="chap-Security-Enhanced_Linux-Introduction.html" title="Hoofdstuk 2. Inleiding"/><link rel="prev" href="sect-Security-Enhanced_Linux-Introduction-Examples.html" title="2.2. Voorbeelden"/><link rel="next" href="sect-Security-Enhanced_Linux-Introduction-SELinux_on_Other_Operating_Systems.html" title="2.4. SELinux in andere operating systemen"/></head><body class=""><p id="title"><a class="left" href="http://www.fedoraproject.org"><img src="Common_Content/images/image_left.png" alt="Product Site"/></a><a class="right" href="http://docs.fedoraproject.org"><img src="Common_Content/images/image
_right.png" alt="Documentation Site"/></a></p><ul class="docnav"><li class="previous"><a accesskey="p" href="sect-Security-Enhanced_Linux-Introduction-Examples.html"><strong>Terug</strong></a></li><li class="next"><a accesskey="n" href="sect-Security-Enhanced_Linux-Introduction-SELinux_on_Other_Operating_Systems.html"><strong>Volgende</strong></a></li></ul><div class="section" lang="nl-NL"><div class="titlepage"><div><div><h2 class="title" id="sect-Security-Enhanced_Linux-Introduction-SELinux_Architecture">2.3. SELinux architectuur</h2></div></div></div><div class="para">
SELinux is een beveiligingsmodule die ingebouwd is in de Linux kernel. SELinux wordt bestuurt door laadbare tactiekregels. Als toegang plaats vindt die relevant is voor de beveiliging, zoals wanneer een proces probeert een bestand te openen, wordt de operatie onderschept in de kernel door SELinux. Als een SELinux tactiek regel de operatie toestaat, gaat het verder, anders wordt de operatie geblokkeerd en ontvangt het proces een fout.
</div><div class="para">
SELinux beslissingen, zoals het toestaan of tegenhouden van toegang, worden opgeslagen. Deze opslag staat bekend als de Access Vector Cache (AVC). Het opslaan van beslissingen vermindert hoe vaak SELinux tactiekregels geraadpleegd moeten worden, wat de prestaties verbetert. SELinux tactiekregels hebben geen effect als DAC regels toegang als eerste weigeren.
</div></div><ul class="docnav"><li class="previous"><a accesskey="p" href="sect-Security-Enhanced_Linux-Introduction-Examples.html"><strong>Terug</strong>2.2. Voorbeelden</a></li><li class="up"><a accesskey="u" href="#"><strong>Omhoog</strong></a></li><li class="home"><a accesskey="h" href="index.html"><strong>Begin</strong></a></li><li class="next"><a accesskey="n" href="sect-Security-Enhanced_Linux-Introduction-SELinux_on_Other_Operating_Systems.html"><strong>Volgende</strong>2.4. SELinux in andere operating systemen</a></li></ul></body></html>
--- NEW FILE sect-Security-Enhanced_Linux-Introduction-SELinux_on_Other_Operating_Systems.html ---
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>2.4. SELinux in andere operating systemen</title><link rel="stylesheet" href="./Common_Content/css/default.css" type="text/css"/><meta name="generator" content="publican"/><meta name="package" content="Fedora-Security-Enhanced_Linux-11-nl-NL-1.3-SELinux_User_guide"/><link rel="home" href="index.html" title="Security-Enhanced Linux"/><link rel="up" href="chap-Security-Enhanced_Linux-Introduction.html" title="Hoofdstuk 2. Inleiding"/><link rel="prev" href="sect-Security-Enhanced_Linux-Introduction-SELinux_Architecture.html" title="2.3. SELinux architectuur"/><link rel="next" href="chap-Security-Enhanced_Linux-SELinux_Contexts.html" title="Hoofdstuk 3. SELinux context"/></head><body class=""><p id="title"><a class="left" href="http://www.fedoraproject.org"><img src="Common_Content/images/image_left.png" alt="Product Site"/></a><a class="right" href="http://docs.fedoraproject.org"><img src="Common_Content/images/image_right.
png" alt="Documentation Site"/></a></p><ul class="docnav"><li class="previous"><a accesskey="p" href="sect-Security-Enhanced_Linux-Introduction-SELinux_Architecture.html"><strong>Terug</strong></a></li><li class="next"><a accesskey="n" href="chap-Security-Enhanced_Linux-SELinux_Contexts.html"><strong>Volgende</strong></a></li></ul><div class="section" lang="nl-NL"><div class="titlepage"><div><div><h2 class="title" id="sect-Security-Enhanced_Linux-Introduction-SELinux_on_Other_Operating_Systems">2.4. SELinux in andere operating systemen</h2></div></div></div><div class="para">
Refereer naar de volgende verwijzingen voor informatie over SELinux draaiende in operating systemen:
</div><div class="itemizedlist"><ul><li><div class="para">
Hardened Gentoo: <a href="http://www.gentoo.org/proj/en/hardened/selinux/selinux-handbook.xml">http://www.gentoo.org/proj/en/hardened/selinux/selinux-handbook.xml</a>.
</div></li><li><div class="para">
Debian: <a href="http://wiki.debian.org/SELinux">http://wiki.debian.org/SELinux</a>.
</div></li><li><div class="para">
Ubuntu: <a href="https://wiki.ubuntu.com/SELinux">https://wiki.ubuntu.com/SELinux</a> en <a href="https://help.ubuntu.com/community/SELinux">https://help.ubuntu.com/community/SELinux</a>.
</div></li><li><div class="para">
Red Hat Enterprise Linux: <a href="http://www.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/5.2/html/Deploy...">Red Hat Enterprise Linux Deployment Guide</a> en <a href="http://www.redhat.com/docs/manuals/enterprise/RHEL-4-Manual/selinux-guide/">Red Hat Enterprise Linux 4 SELinux Guide</a>.
</div></li><li><div class="para">
Fedora: <a href="http://fedoraproject.org/wiki/SELinux">http://fedoraproject.org/wiki/SELinux</a> en de <a href="http://docs.fedoraproject.org/selinux-faq-fc5/">Fedora Core 5 SELinux FAQ</a>.
</div></li></ul></div></div><ul class="docnav"><li class="previous"><a accesskey="p" href="sect-Security-Enhanced_Linux-Introduction-SELinux_Architecture.html"><strong>Terug</strong>2.3. SELinux architectuur</a></li><li class="up"><a accesskey="u" href="#"><strong>Omhoog</strong></a></li><li class="home"><a accesskey="h" href="index.html"><strong>Begin</strong></a></li><li class="next"><a accesskey="n" href="chap-Security-Enhanced_Linux-SELinux_Contexts.html"><strong>Volgende</strong>Hoofdstuk 3. SELinux context</a></li></ul></body></html>
--- NEW FILE sect-Security-Enhanced_Linux-Maintaining_SELinux_Labels_-Archiving_Files_with_star.html ---
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>5.10.5. Bestanden archiveren met star</title><link rel="stylesheet" href="./Common_Content/css/default.css" type="text/css"/><meta name="generator" content="publican"/><meta name="package" content="Fedora-Security-Enhanced_Linux-11-nl-NL-1.3-SELinux_User_guide"/><link rel="home" href="index.html" title="Security-Enhanced Linux"/><link rel="up" href="sect-Security-Enhanced_Linux-Working_with_SELinux-Maintaining_SELinux_Labels_.html" title="5.10. Het onderhouden van SELinux labels"/><link rel="prev" href="sect-Security-Enhanced_Linux-Maintaining_SELinux_Labels_-Archiving_Files_with_tar.html" title="5.10.4. Bestanden archiveren met tar"/><link rel="next" href="chap-Security-Enhanced_Linux-Confining_Users.html" title="Hoofdstuk 6. Gebruikers beperken"/></head><body class=""><p id="title"><a class="left" href="http://www.fedoraproject.org"><img src="Common_Content/images/image_left.png" alt="Product Site"/></a><a class="right
" href="http://docs.fedoraproject.org"><img src="Common_Content/images/image_right.png" alt="Documentation Site"/></a></p><ul class="docnav"><li class="previous"><a accesskey="p" href="sect-Security-Enhanced_Linux-Maintaining_SELinux_Labels_-Archiving_Files_with_tar.html"><strong>Terug</strong></a></li><li class="next"><a accesskey="n" href="chap-Security-Enhanced_Linux-Confining_Users.html"><strong>Volgende</strong></a></li></ul><div class="section" lang="nl-NL"><div class="titlepage"><div><div><h3 class="title" id="sect-Security-Enhanced_Linux-Maintaining_SELinux_Labels_-Archiving_Files_with_star">5.10.5. Bestanden archiveren met star</h3></div></div></div><div class="para">
<code class="command">star</code> behoudt standaard geen uitgebreide attributen. Omdat SELinux context bewaard wordt in uitgebreide attributen, kan de context verloren gaan als de bestanden gearchiveerd worden. Gebruik <code class="command">star -xattr -H=exustar</code> om archieven te maken die context behouden. Het <span class="package">star</span> pakket is standaard niet geinstalleerd. Om <code class="command">star</code> te installeren, voer je als de Linux root gebruiker het <code class="command">yum install star</code> commando uit.
</div><div class="para">
Het volgende voorbeeld laat het maken van een Star archief zien dat de SELinux context behoudt:
</div><div class="orderedlist"><ol><li><div class="para">
Als de Linux root gebruiker, voer je het <code class="command">touch /var/www/html/file{1,2,3}</code> commando uit om drie bestanden (<code class="filename">file1</code>, <code class="filename">file2</code>, en <code class="filename">file3</code>) aan te maken. Deze bestanden erven het <code class="computeroutput">httpd_sys_content_t</code> type van de <code class="filename">/var/www/html/</code> map:
</div><pre class="screen"># touch /var/www/html/file{1,2,3}
# ls -Z /var/www/html/
-rw-r--r-- root root unconfined_u:object_r:httpd_sys_content_t:s0 file1
-rw-r--r-- root root unconfined_u:object_r:httpd_sys_content_t:s0 file2
-rw-r--r-- root root unconfined_u:object_r:httpd_sys_content_t:s0 file3
</pre></li><li><div class="para">
Voer het <code class="command">cd /var/www/html/</code> commando uit om naar de <code class="filename">/var/www/html/</code> map te gaan. Als je in die map bent, voer je als de Linux root gebruiker het <code class="command">star -xattr -H=exustar -c -f=test.star file{1,2,3}</code> commando uit om een Star archief met de naam <code class="filename">test.star</code> te maken:
</div><pre class="screen"># star -xattr -H=exustar -c -f=test.star file{1,2,3}
star: 1 blocks + 0 bytes (total of 10240 bytes = 10.00k).
</pre></li><li><div class="para">
Als de Linux root gebruiker voer je het <code class="command">mkdir /test</code> commando uit om een nieuwe map aan te maken, en daarna voer je het <code class="command">chmod 777 /test/</code> commando uit om alle gebruikers volledige toegang tot de <code class="filename">/test/</code> map te geven.
</div></li><li><div class="para">
Voer het <code class="command">cp /var/www/html/test.star /test/</code> commando uit om het <code class="filename">test.star</code> bestand te kopiëren naar de <code class="filename">/test/</code> map.
</div></li><li><div class="para">
Voer het <code class="command">cd /test/</code> commando uit om naar de <code class="filename">/test/</code> map te gaan. Als je in die map bent, voer je het <code class="command">star -x -f=test.star</code> commando uit om het Star archief uit te pakken:
</div><pre class="screen">$ star -x -f=test.star
star: 1 blocks + 0 bytes (total of 10240 bytes = 10.00k).
</pre></li><li><div class="para">
Voer het <code class="command">ls -lZ /test/</code> commando uit om de SELinux context te bekijken. Het <code class="computeroutput">httpd_sys_content_t</code> type is behouden gebleven, in plaats van veranderd te zijn naar <code class="computeroutput">default_t</code>, wat gebeurt zou zijn als de <code class="option">--selinux</code> optie niet gebruikt was:
</div><pre class="screen">$ ls -lZ /test/
-rw-r--r-- user1 group1 unconfined_u:object_r:httpd_sys_content_t:s0 file1
-rw-r--r-- user1 group1 unconfined_u:object_r:httpd_sys_content_t:s0 file2
-rw-r--r-- user1 group1 unconfined_u:object_r:httpd_sys_content_t:s0 file3
-rw-r--r-- user1 group1 unconfined_u:object_r:default_t:s0 test.star
</pre></li><li><div class="para">
Als de <code class="filename">/test/</code> map niet langer nodig is, voer je als de Linux root gebruiker het <code class="command"> rm -ri /test/</code> commando uit om het te verwijderen te samen met de bestanden er in.
</div></li><li><div class="para">
Als <code class="command">star</code> niet langer nodig is, voer je als de Linux root gebruiker het <code class="command">yum remove star</code> commando uit om het pakket te verwijderen.
</div></li></ol></div><div class="para">
Refereer naar de <span class="citerefentry"><span class="refentrytitle">star</span>(1)</span> manual pagina voor meer informatie over <code class="command">star</code>.
</div></div><ul class="docnav"><li class="previous"><a accesskey="p" href="sect-Security-Enhanced_Linux-Maintaining_SELinux_Labels_-Archiving_Files_with_tar.html"><strong>Terug</strong>5.10.4. Bestanden archiveren met tar</a></li><li class="up"><a accesskey="u" href="#"><strong>Omhoog</strong></a></li><li class="home"><a accesskey="h" href="index.html"><strong>Begin</strong></a></li><li class="next"><a accesskey="n" href="chap-Security-Enhanced_Linux-Confining_Users.html"><strong>Volgende</strong>Hoofdstuk 6. Gebruikers beperken</a></li></ul></body></html>
--- NEW FILE sect-Security-Enhanced_Linux-Maintaining_SELinux_Labels_-Archiving_Files_with_tar.html ---
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>5.10.4. Bestanden archiveren met tar</title><link rel="stylesheet" href="./Common_Content/css/default.css" type="text/css"/><meta name="generator" content="publican"/><meta name="package" content="Fedora-Security-Enhanced_Linux-11-nl-NL-1.3-SELinux_User_guide"/><link rel="home" href="index.html" title="Security-Enhanced Linux"/><link rel="up" href="sect-Security-Enhanced_Linux-Working_with_SELinux-Maintaining_SELinux_Labels_.html" title="5.10. Het onderhouden van SELinux labels"/><link rel="prev" href="sect-Security-Enhanced_Linux-Maintaining_SELinux_Labels_-Checking_the_Default_SELinux_Context.html" title="5.10.3. Het controleren van de standaard SELinux context"/><link rel="next" href="sect-Security-Enhanced_Linux-Maintaining_SELinux_Labels_-Archiving_Files_with_star.html" title="5.10.5. Bestanden archiveren met star"/></head><body class=""><p id="title"><a class="left" href="http://www.fedoraproject.org"><img src="Com
mon_Content/images/image_left.png" alt="Product Site"/></a><a class="right" href="http://docs.fedoraproject.org"><img src="Common_Content/images/image_right.png" alt="Documentation Site"/></a></p><ul class="docnav"><li class="previous"><a accesskey="p" href="sect-Security-Enhanced_Linux-Maintaining_SELinux_Labels_-Checking_the_Default_SELinux_Context.html"><strong>Terug</strong></a></li><li class="next"><a accesskey="n" href="sect-Security-Enhanced_Linux-Maintaining_SELinux_Labels_-Archiving_Files_with_star.html"><strong>Volgende</strong></a></li></ul><div class="section" lang="nl-NL"><div class="titlepage"><div><div><h3 class="title" id="sect-Security-Enhanced_Linux-Maintaining_SELinux_Labels_-Archiving_Files_with_tar">5.10.4. Bestanden archiveren met tar</h3></div></div></div><div class="para">
<code class="command">tar</code> behoudt standaard geen uitgebreide attributen. Omdat SELinux context bewaard wordt in uitgebreide attributen, kan de context verloren raken als bestanden gearchiveerd worden. Gebruik <code class="command">tar --selinux</code> om archieven te maken die de context behouden. Als een Tar archief bestanden zonder uitgebreide attributen bevat, of je wilt dat de uitgebreide attributen overeenkomen met de systeemstandaard, voer het archiveren dan uit met <code class="command">/sbin/restorecon</code>:
</div><pre class="screen">$ tar -xvf <em class="replaceable"><code>archive.tar</code></em> | /sbin/restorecon -f -
</pre><div class="para">
Merk op: afhankelijk van de map kan het nodig zijn dat je de Linux root gebruiker bent om het <code class="command">/sbin/restorecon</code> commando uit te voeren.
</div><div class="para">
Het volgende voorbeeld laat het maken van een Tar archief zien dat de SELinux context behoudt:
</div><div class="orderedlist"><ol><li><div class="para">
Als de Linux root gebruiker, voer je het <code class="command">touch /var/www/html/file{1,2,3}</code> commando uit om drie bestanden (<code class="filename">file1</code>, <code class="filename">file2</code>, en <code class="filename">file3</code>) aan te maken. Deze bestanden erven het <code class="computeroutput">httpd_sys_content_t</code> type van de <code class="filename">/var/www/html/</code> map:
</div><pre class="screen"># touch /var/www/html/file{1,2,3}
# ls -Z /var/www/html/
-rw-r--r-- root root unconfined_u:object_r:httpd_sys_content_t:s0 file1
-rw-r--r-- root root unconfined_u:object_r:httpd_sys_content_t:s0 file2
-rw-r--r-- root root unconfined_u:object_r:httpd_sys_content_t:s0 file3
</pre></li><li><div class="para">
Voer het <code class="command">cd /var/www/html/</code> commando uit om naar de <code class="filename">/var/www/html/</code> map te gaan. Als je in die map bent, voer je als de Linux root gebruiker het <code class="command">tar --selinux -cf test.tar file{1,2,3}</code> uit om een Tar archief met de naam <code class="filename">test.tar</code> te maken.
</div></li><li><div class="para">
Als de Linux root gebruiker voer je het <code class="command">mkdir /test</code> commando uit om een nieuwe map aan te maken, en daarna voer je het <code class="command">chmod 777 /test/</code> commando uit om alle gebruikers volledige toegang tot de <code class="filename">/test/</code> map te geven.
</div></li><li><div class="para">
Voer het <code class="command">cp /var/www/html/test.tar /test/</code> commando uit om het <code class="filename">test.tar</code> bestand naar de <code class="filename">/test/</code> map te kopiëren.
</div></li><li><div class="para">
Voer het <code class="command">cd /test/</code> comando uit om naar de <code class="filename">/test/</code> map te gaan. Als je in die map bent, voer je het <code class="command">tar -xvf test.tar</code> commando uit om het Tar archief uit te pakken.
</div></li><li><div class="para">
Voer het <code class="command">ls -lZ /test/</code> commando uit om de SELinux context te bekijken. Het <code class="computeroutput">httpd_sys_content_t</code> type is behouden gebleven, in plaats van veranderd te zijn naar <code class="computeroutput">default_t</code>, wat gebeurt zou zijn als de <code class="option">--selinux</code> optie niet gebruikt was:
</div><pre class="screen">$ ls -lZ /test/
-rw-r--r-- user1 group1 unconfined_u:object_r:httpd_sys_content_t:s0 file1
-rw-r--r-- user1 group1 unconfined_u:object_r:httpd_sys_content_t:s0 file2
-rw-r--r-- user1 group1 unconfined_u:object_r:httpd_sys_content_t:s0 file3
-rw-r--r-- user1 group1 unconfined_u:object_r:default_t:s0 test.tar
</pre></li><li><div class="para">
Als de <code class="filename">/test/</code> map niet langer nodig is, voer je als de Linux root gebruiker het <code class="command"> rm -ri /test/</code> commando uit om het te verwijderen te samen met de bestanden er in.
</div></li></ol></div><div class="para">
Refereer naar de <span class="citerefentry"><span class="refentrytitle">tar</span>(1)</span> manual pagina voor meer informatie over <code class="command">tar</code>, zoals de <code class="option">--xattrs</code> optie die alle uitgebreide attributen behoudt.
</div></div><ul class="docnav"><li class="previous"><a accesskey="p" href="sect-Security-Enhanced_Linux-Maintaining_SELinux_Labels_-Checking_the_Default_SELinux_Context.html"><strong>Terug</strong>5.10.3. Het controleren van de standaard SELinux ...</a></li><li class="up"><a accesskey="u" href="#"><strong>Omhoog</strong></a></li><li class="home"><a accesskey="h" href="index.html"><strong>Begin</strong></a></li><li class="next"><a accesskey="n" href="sect-Security-Enhanced_Linux-Maintaining_SELinux_Labels_-Archiving_Files_with_star.html"><strong>Volgende</strong>5.10.5. Bestanden archiveren met star</a></li></ul></body></html>
--- NEW FILE sect-Security-Enhanced_Linux-Maintaining_SELinux_Labels_-Checking_the_Default_SELinux_Context.html ---
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>5.10.3. Het controleren van de standaard SELinux context</title><link rel="stylesheet" href="./Common_Content/css/default.css" type="text/css"/><meta name="generator" content="publican"/><meta name="package" content="Fedora-Security-Enhanced_Linux-11-nl-NL-1.3-SELinux_User_guide"/><link rel="home" href="index.html" title="Security-Enhanced Linux"/><link rel="up" href="sect-Security-Enhanced_Linux-Working_with_SELinux-Maintaining_SELinux_Labels_.html" title="5.10. Het onderhouden van SELinux labels"/><link rel="prev" href="sect-Security-Enhanced_Linux-Maintaining_SELinux_Labels_-Moving_Files_and_Directories.html" title="5.10.2. Bestanden en mappen verplaatsen"/><link rel="next" href="sect-Security-Enhanced_Linux-Maintaining_SELinux_Labels_-Archiving_Files_with_tar.html" title="5.10.4. Bestanden archiveren met tar"/></head><body class=""><p id="title"><a class="left" href="http://www.fedoraproject.org"><img src="Common_Con
tent/images/image_left.png" alt="Product Site"/></a><a class="right" href="http://docs.fedoraproject.org"><img src="Common_Content/images/image_right.png" alt="Documentation Site"/></a></p><ul class="docnav"><li class="previous"><a accesskey="p" href="sect-Security-Enhanced_Linux-Maintaining_SELinux_Labels_-Moving_Files_and_Directories.html"><strong>Terug</strong></a></li><li class="next"><a accesskey="n" href="sect-Security-Enhanced_Linux-Maintaining_SELinux_Labels_-Archiving_Files_with_tar.html"><strong>Volgende</strong></a></li></ul><div class="section" lang="nl-NL"><div class="titlepage"><div><div><h3 class="title" id="sect-Security-Enhanced_Linux-Maintaining_SELinux_Labels_-Checking_the_Default_SELinux_Context">5.10.3. Het controleren van de standaard SELinux context</h3></div></div></div><div class="para">
Gebruik het <code class="command">/usr/sbin/matchpathcon</code> commando om te controleren of bestanden en mappen de juiste SELinux context hebben. Van de <span class="citerefentry"><span class="refentrytitle">matchpathcon</span>(8)</span> manual pagina: "<code class="command">matchpathcon</code> ondervraagt de systeem tactiek en levert de standaard beveiligings context behorend bij het bestandspad."<sup>[<a id="d0e4354" href="#ftn.d0e4354" class="footnote">13</a>]</sup>. Het volgende voorbeeld laat het gebruik van het <code class="command">/usr/sbin/matchpathcon</code> commando zien om te bevestigen dat bestanden in de <code class="filename">/var/www/html/</code> map correct gelabeld zijn:
</div><div class="orderedlist"><ol><li><div class="para">
Als de Linux root gebruiker, voer je het <code class="command">touch /var/www/html/file{1,2,3}</code> commando uit om drie bestanden (<code class="filename">file1</code>, <code class="filename">file2</code>, en <code class="filename">file3</code>) aan te maken. Deze bestanden erven het <code class="computeroutput">httpd_sys_content_t</code> type van de <code class="filename">/var/www/html/</code> map:
</div><pre class="screen"># touch /var/www/html/file{1,2,3}
# ls -Z /var/www/html/
-rw-r--r-- root root unconfined_u:object_r:httpd_sys_content_t:s0 file1
-rw-r--r-- root root unconfined_u:object_r:httpd_sys_content_t:s0 file2
-rw-r--r-- root root unconfined_u:object_r:httpd_sys_content_t:s0 file3
</pre></li><li><div class="para">
Als de Linux root gebruiker, voer je het <code class="command">chcon -t samba_share_t /var/www/html/file1</code> commando uit om het type van <code class="filename">file1</code> te veranderen naar <code class="computeroutput">samba_share_t</code>. Merk op: de Apache HTTP server kan geen bestanden of mappen lezen die gelabeld zijn met het <code class="computeroutput">samba_share_t</code> type.
</div></li><li><div class="para">
Het <code class="command">/usr/sbin/matchpathcon</code> <code class="option">-V</code> optie vergelijkt de huidige SELinux contect met de juiste, standaard context in SELinux tactiek. Voer het <code class="command">/usr/sbin/matchpathcon -V /var/www/html/*</code> commando uit om alle bestanden in de <code class="filename">/var/www/html/</code> map te controleren:
</div><pre class="screen">$ /usr/sbin/matchpathcon -V /var/www/html/*
/var/www/html/file1 has context unconfined_u:object_r:samba_share_t:s0, should be system_u:object_r:httpd_sys_content_t:s0
/var/www/html/file2 verified.
/var/www/html/file3 verified.
</pre></li></ol></div><div class="para">
De volgende output van het <code class="command">/usr/sbin/matchpathcon</code> commando legt uit dat <code class="filename">file1</code> is gelabeld met het <code class="computeroutput">samba_share_t</code> type, maar het zou gelabeld moeten zijn met het <code class="computeroutput">httpd_sys_content_t</code> type:
</div><pre class="screen">/var/www/html/file1 has context unconfined_u:object_r:samba_share_t:s0, should be system_u:object_r:httpd_sys_content_t:s0
</pre><div class="para">
Om het label probleem op te lossen, en de Apache HTTP server toegang te geven tot <code class="filename">file1</code>, voer je als de Linux root gebruiker het <code class="command">/sbin/restorecon -v /var/www/html/file1</code> commando uit:
</div><pre class="screen"># /sbin/restorecon -v /var/www/html/file1
restorecon reset /var/www/html/file1 context unconfined_u:object_r:samba_share_t:s0->system_u:object_r:httpd_sys_content_t:s0
</pre><div class="footnotes"><br/><hr/><div class="footnote"><p><sup>[<a id="ftn.d0e4354" href="#d0e4354" class="para">13</a>] </sup>
De <span class="citerefentry"><span class="refentrytitle">matchpathcon</span>(8)</span> manual pagina, zoals verstuurd met het <span class="package">libselinux-utils</span> pakket Fedora, is geschreven door Daniel Walsh. Alle bewerkingen of veranderingen in deze versie zijn gemaakt door Murray McAllister.
</p></div></div></div><ul class="docnav"><li class="previous"><a accesskey="p" href="sect-Security-Enhanced_Linux-Maintaining_SELinux_Labels_-Moving_Files_and_Directories.html"><strong>Terug</strong>5.10.2. Bestanden en mappen verplaatsen</a></li><li class="up"><a accesskey="u" href="#"><strong>Omhoog</strong></a></li><li class="home"><a accesskey="h" href="index.html"><strong>Begin</strong></a></li><li class="next"><a accesskey="n" href="sect-Security-Enhanced_Linux-Maintaining_SELinux_Labels_-Archiving_Files_with_tar.html"><strong>Volgende</strong>5.10.4. Bestanden archiveren met tar</a></li></ul></body></html>
--- NEW FILE sect-Security-Enhanced_Linux-Maintaining_SELinux_Labels_-Moving_Files_and_Directories.html ---
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>5.10.2. Bestanden en mappen verplaatsen</title><link rel="stylesheet" href="./Common_Content/css/default.css" type="text/css"/><meta name="generator" content="publican"/><meta name="package" content="Fedora-Security-Enhanced_Linux-11-nl-NL-1.3-SELinux_User_guide"/><link rel="home" href="index.html" title="Security-Enhanced Linux"/><link rel="up" href="sect-Security-Enhanced_Linux-Working_with_SELinux-Maintaining_SELinux_Labels_.html" title="5.10. Het onderhouden van SELinux labels"/><link rel="prev" href="sect-Security-Enhanced_Linux-Working_with_SELinux-Maintaining_SELinux_Labels_.html" title="5.10. Het onderhouden van SELinux labels"/><link rel="next" href="sect-Security-Enhanced_Linux-Maintaining_SELinux_Labels_-Checking_the_Default_SELinux_Context.html" title="5.10.3. Het controleren van de standaard SELinux context"/></head><body class=""><p id="title"><a class="left" href="http://www.fedoraproject.org"><img src="Co
mmon_Content/images/image_left.png" alt="Product Site"/></a><a class="right" href="http://docs.fedoraproject.org"><img src="Common_Content/images/image_right.png" alt="Documentation Site"/></a></p><ul class="docnav"><li class="previous"><a accesskey="p" href="sect-Security-Enhanced_Linux-Working_with_SELinux-Maintaining_SELinux_Labels_.html"><strong>Terug</strong></a></li><li class="next"><a accesskey="n" href="sect-Security-Enhanced_Linux-Maintaining_SELinux_Labels_-Checking_the_Default_SELinux_Context.html"><strong>Volgende</strong></a></li></ul><div class="section" lang="nl-NL"><div class="titlepage"><div><div><h3 class="title" id="sect-Security-Enhanced_Linux-Maintaining_SELinux_Labels_-Moving_Files_and_Directories">5.10.2. Bestanden en mappen verplaatsen</h3></div></div></div><div class="para">
Bestanden en mappen behouden hun huidige SELinux context als ze verplaats worden. In veel gevallen is dit niet juist voor de locatie waarheen ze verplaatst zijn. Het volgende voorbeeld laat het verplaatsen van een bestand van de persoonlijke map van een gebruiker zien naar <code class="filename">/var/www/html/</code>, welke gebruikt wordt door de Apache HTTP server. Omdat het bestand is verplaatst, erft het niet de juiste SELinux context:
</div><div class="orderedlist"><ol><li><div class="para">
Voer het <code class="command">cd</code> commando uit zonder argumenten om naar je persoonlijke map te gaan. Als je daar bent, voer je het <code class="command">touch file1</code> commando uit om een bestand aan te maken. Dit bestand is gelabeld met het <code class="computeroutput">user_home_t</code> type:
</div><pre class="screen">$ ls -Z file1
-rw-rw-r-- user1 group1 unconfined_u:object_r:user_home_t:s0 file1
</pre></li><li><div class="para">
Voer het <code class="command">ls -dZ /var/www/html/</code> commando uit om de SELinux context van de <code class="filename">/var/www/html/</code> map te zien:
</div><pre class="screen">$ ls -dZ /var/www/html/
drwxr-xr-x root root system_u:object_r:httpd_sys_content_t:s0 /var/www/html/
</pre><div class="para">
Standaard wordt de <code class="filename">/var/www/html/</code> map gelabeld met het <code class="computeroutput">httpd_sys_content_t</code> type. Bestanden en mappen aangemaakt in de <code class="filename">/var/www/html/</code> map erven dit type, en dus zijn ze ermee gelabeld.
</div></li><li><div class="para">
Als de Linux root gebruiker voer je het <code class="command">mv file1 /var/www/html/</code> commando uit om <code class="filename">file1</code> te verplaatsen naar de <code class="filename">/var/www/html/</code> map. Omdat het bestand is verplaatst behoudt het zijn huidige <code class="computeroutput">user_home_t</code> type:
</div><pre class="screen"># mv file1 /var/www/html/
# ls -Z /var/www/html/file1
-rw-rw-r-- user1 group1 unconfined_u:object_r:user_home_t:s0 /var/www/html/file1
</pre></li></ol></div><div class="para">
Standaard kan de Apache HTTP server geen bestanden lezen die gelabeld zijn met het <code class="computeroutput">user_home_t</code> type. Als alle bestanden die een web pagina vormen gelabeld zijn met het <code class="computeroutput">user_home_t</code> type, of een ander type dat de Apache HTTP server niet kan lezen, wordt toegang geweigerd als je probeert ze te benaderen met Firefox of op tekst gebaseerde webbrowsers.
</div><div class="important"><h2>Belangrijk</h2><div class="para">
Het verplaatsen van bestanden en mappen met het <code class="command">mv</code> commando kan een verkeerde SELinux context tot gevolg hebben, en processen, zoals de Apache HTTP server en Samba, beletten om toegang te krijgen tot die bestanden en mappen.
</div></div></div><ul class="docnav"><li class="previous"><a accesskey="p" href="sect-Security-Enhanced_Linux-Working_with_SELinux-Maintaining_SELinux_Labels_.html"><strong>Terug</strong>5.10. Het onderhouden van SELinux labels </a></li><li class="up"><a accesskey="u" href="#"><strong>Omhoog</strong></a></li><li class="home"><a accesskey="h" href="index.html"><strong>Begin</strong></a></li><li class="next"><a accesskey="n" href="sect-Security-Enhanced_Linux-Maintaining_SELinux_Labels_-Checking_the_Default_SELinux_Context.html"><strong>Volgende</strong>5.10.3. Het controleren van de standaard SELinux ...</a></li></ul></body></html>
--- NEW FILE sect-Security-Enhanced_Linux-Mounting_File_Systems-Changing_the_Default_Context.html ---
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>5.9.2. De standaard context veranderen</title><link rel="stylesheet" href="./Common_Content/css/default.css" type="text/css"/><meta name="generator" content="publican"/><meta name="package" content="Fedora-Security-Enhanced_Linux-11-nl-NL-1.3-SELinux_User_guide"/><link rel="home" href="index.html" title="Security-Enhanced Linux"/><link rel="up" href="sect-Security-Enhanced_Linux-Working_with_SELinux-Mounting_File_Systems.html" title="5.9. Het aankoppelen van bestandssystemen"/><link rel="prev" href="sect-Security-Enhanced_Linux-Working_with_SELinux-Mounting_File_Systems.html" title="5.9. Het aankoppelen van bestandssystemen"/><link rel="next" href="sect-Security-Enhanced_Linux-Mounting_File_Systems-Mounting_an_NFS_File_System.html" title="5.9.3. Het aankoppelen van een NFS bestandssysteem"/></head><body class=""><p id="title"><a class="left" href="http://www.fedoraproject.org"><img src="Common_Content/images/image_left.p
ng" alt="Product Site"/></a><a class="right" href="http://docs.fedoraproject.org"><img src="Common_Content/images/image_right.png" alt="Documentation Site"/></a></p><ul class="docnav"><li class="previous"><a accesskey="p" href="sect-Security-Enhanced_Linux-Working_with_SELinux-Mounting_File_Systems.html"><strong>Terug</strong></a></li><li class="next"><a accesskey="n" href="sect-Security-Enhanced_Linux-Mounting_File_Systems-Mounting_an_NFS_File_System.html"><strong>Volgende</strong></a></li></ul><div class="section" lang="nl-NL"><div class="titlepage"><div><div><h3 class="title" id="sect-Security-Enhanced_Linux-Mounting_File_Systems-Changing_the_Default_Context">5.9.2. De standaard context veranderen</h3></div></div></div><div class="para">
Zoals vermeldt in <a class="xref" href="sect-Security-Enhanced_Linux-Working_with_SELinux-The_file_t_and_default_t_Types.html" title="5.8. De file_t en default_t types">Paragraaf 5.8, “De file_t en default_t types”</a>, worden benaderde bestanden, die geen SELinux context op schijf hebben, in bestandssystemen die uitgebreide attributen ondersteunen, behandeld alsof het een standaard context heeft zoals gedefinieerd door SELinux tactiek. In algemene tactieken gebruikt deze standaard context het <code class="computeroutput">file_t</code> type. Als het wenselijk is om een andere standaard context te gebruiken, koppel dan het bestandssysteem aan met de <code class="option">defcontext</code> optie.
</div><div class="para">
Het volgende voorbeeld koppelt een nieuw aangemaakt bestandssysteem (op <code class="filename">/dev/sda2</code>) aan naar de nieuw aangemaakte <code class="filename">/test/</code> map. Het veronderstelt dat er geen regels zijn in <code class="filename">/etc/selinux/targeted/contexts/files/</code> die een context definieren voor de <code class="filename">/test/</code> map:
</div><pre class="screen"># mount /dev/sda2 /test/ -o defcontext="system_u:object_r:samba_share_t:s0"
</pre><div class="para">
In dit voorbeeld:
</div><div class="itemizedlist"><ul><li><div class="para">
de <code class="option">defcontext</code> optie definieert dat <code class="computeroutput">system_u:object_r:samba_share_t:s0</code> "de standaard beveiligingscontext voor niet gelabelde bestanden"<sup>[<a id="d0e3903" href="#ftn.d0e3903" class="footnote">12</a>]</sup> is.
</div></li><li><div class="para">
als het aangekoppeld is, wordt de root map (<code class="filename">/test/</code>) van het bestandssysteem behandeld alsof het is gelabeld met de context opgegeven door <code class="option">defcontext</code> (dit label wordt niet op schijf bewaard). Dit heeft gevolgen voor het labelen van bestanden die in <code class="filename">/test/</code> aangemaakt worden: nieuwe bestanden erven het <code class="computeroutput">samba_share_t</code> type en deze labels worden op schijf bewaard.
</div></li><li><div class="para">
bestanden aangemaakt in <code class="filename">/test/</code> terwijl het bestandssysteem was aangekoppeld met een <code class="option">defcontext</code> optie houden hun labels vast.
</div></li></ul></div><div class="footnotes"><br/><hr/><div class="footnote"><p><sup>[<a id="ftn.d0e3903" href="#d0e3903" class="para">12</a>] </sup>
Morris, James. "Filesystem Labeling in SELinux". Published 1 October 2004. Accessed 14 October 2008: <a href="http://www.linuxjournal.com/article/7426">http://www.linuxjournal.com/article/7426</a>.
</p></div></div></div><ul class="docnav"><li class="previous"><a accesskey="p" href="sect-Security-Enhanced_Linux-Working_with_SELinux-Mounting_File_Systems.html"><strong>Terug</strong>5.9. Het aankoppelen van bestandssystemen</a></li><li class="up"><a accesskey="u" href="#"><strong>Omhoog</strong></a></li><li class="home"><a accesskey="h" href="index.html"><strong>Begin</strong></a></li><li class="next"><a accesskey="n" href="sect-Security-Enhanced_Linux-Mounting_File_Systems-Mounting_an_NFS_File_System.html"><strong>Volgende</strong>5.9.3. Het aankoppelen van een NFS bestandssysteem</a></li></ul></body></html>
--- NEW FILE sect-Security-Enhanced_Linux-Mounting_File_Systems-Making_Context_Mounts_Persistent.html ---
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>5.9.5. Maak de context aankoppelingen blijvend</title><link rel="stylesheet" href="./Common_Content/css/default.css" type="text/css"/><meta name="generator" content="publican"/><meta name="package" content="Fedora-Security-Enhanced_Linux-11-nl-NL-1.3-SELinux_User_guide"/><link rel="home" href="index.html" title="Security-Enhanced Linux"/><link rel="up" href="sect-Security-Enhanced_Linux-Working_with_SELinux-Mounting_File_Systems.html" title="5.9. Het aankoppelen van bestandssystemen"/><link rel="prev" href="sect-Security-Enhanced_Linux-Mounting_File_Systems-Multiple_NFS_Mounts.html" title="5.9.4. Meerdere NFS aankoppelingen"/><link rel="next" href="sect-Security-Enhanced_Linux-Working_with_SELinux-Maintaining_SELinux_Labels_.html" title="5.10. Het onderhouden van SELinux labels"/></head><body class=""><p id="title"><a class="left" href="http://www.fedoraproject.org"><img src="Common_Content/images/image_left.png" alt="Pr
oduct Site"/></a><a class="right" href="http://docs.fedoraproject.org"><img src="Common_Content/images/image_right.png" alt="Documentation Site"/></a></p><ul class="docnav"><li class="previous"><a accesskey="p" href="sect-Security-Enhanced_Linux-Mounting_File_Systems-Multiple_NFS_Mounts.html"><strong>Terug</strong></a></li><li class="next"><a accesskey="n" href="sect-Security-Enhanced_Linux-Working_with_SELinux-Maintaining_SELinux_Labels_.html"><strong>Volgende</strong></a></li></ul><div class="section" lang="nl-NL"><div class="titlepage"><div><div><h3 class="title" id="sect-Security-Enhanced_Linux-Mounting_File_Systems-Making_Context_Mounts_Persistent">5.9.5. Maak de context aankoppelingen blijvend</h3></div></div></div><div class="para">
Om de context aankoppelingen blijven te maken voor opnieuw aankoppelen en opnieuw opstarten, voeg je regels toe voor de bestandssystemen in <code class="filename">/etc/fstab</code> of een automounter map, en gebruik de gewenste context als een aankoppel optie. Het volgende voorbeeld voegt een regel toe aan <code class="filename">/etc/fstab</code> voor een NFS context aankoppeling:
</div><pre class="screen">server:/export /local/mount/ nfs context="system_u:object_r:httpd_sys_content_t:s0" 0 0
</pre><div class="para">
Refereer naar <a href="http://www.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/5.2/html/Deploy...">Red Hat Enterprise Linux 5 Deployment Guide, Section 19.2. "NFS Client Configuration"</a> voor informatie over het aankoppelen van NFS bestandssystemen.
</div></div><ul class="docnav"><li class="previous"><a accesskey="p" href="sect-Security-Enhanced_Linux-Mounting_File_Systems-Multiple_NFS_Mounts.html"><strong>Terug</strong>5.9.4. Meerdere NFS aankoppelingen</a></li><li class="up"><a accesskey="u" href="#"><strong>Omhoog</strong></a></li><li class="home"><a accesskey="h" href="index.html"><strong>Begin</strong></a></li><li class="next"><a accesskey="n" href="sect-Security-Enhanced_Linux-Working_with_SELinux-Maintaining_SELinux_Labels_.html"><strong>Volgende</strong>5.10. Het onderhouden van SELinux labels </a></li></ul></body></html>
--- NEW FILE sect-Security-Enhanced_Linux-Mounting_File_Systems-Mounting_an_NFS_File_System.html ---
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>5.9.3. Het aankoppelen van een NFS bestandssysteem</title><link rel="stylesheet" href="./Common_Content/css/default.css" type="text/css"/><meta name="generator" content="publican"/><meta name="package" content="Fedora-Security-Enhanced_Linux-11-nl-NL-1.3-SELinux_User_guide"/><link rel="home" href="index.html" title="Security-Enhanced Linux"/><link rel="up" href="sect-Security-Enhanced_Linux-Working_with_SELinux-Mounting_File_Systems.html" title="5.9. Het aankoppelen van bestandssystemen"/><link rel="prev" href="sect-Security-Enhanced_Linux-Mounting_File_Systems-Changing_the_Default_Context.html" title="5.9.2. De standaard context veranderen"/><link rel="next" href="sect-Security-Enhanced_Linux-Mounting_File_Systems-Multiple_NFS_Mounts.html" title="5.9.4. Meerdere NFS aankoppelingen"/></head><body class=""><p id="title"><a class="left" href="http://www.fedoraproject.org"><img src="Common_Content/images/image_left.png" alt
="Product Site"/></a><a class="right" href="http://docs.fedoraproject.org"><img src="Common_Content/images/image_right.png" alt="Documentation Site"/></a></p><ul class="docnav"><li class="previous"><a accesskey="p" href="sect-Security-Enhanced_Linux-Mounting_File_Systems-Changing_the_Default_Context.html"><strong>Terug</strong></a></li><li class="next"><a accesskey="n" href="sect-Security-Enhanced_Linux-Mounting_File_Systems-Multiple_NFS_Mounts.html"><strong>Volgende</strong></a></li></ul><div class="section" lang="nl-NL"><div class="titlepage"><div><div><h3 class="title" id="sect-Security-Enhanced_Linux-Mounting_File_Systems-Mounting_an_NFS_File_System">5.9.3. Het aankoppelen van een NFS bestandssysteem</h3></div></div></div><div class="para">
Standaard worden NFS aankoppelingen op de client zijde gelabeld met een standaard context gedefinieerd door tactiek voor NFS bestandssystemen. In algemene tactieken gebruikt deze standaard context het <code class="computeroutput">nfs_t</code> type. Alfhankelijk van de tactiek instelling, zullen services, zoals de Apache HTTP server en MySQL, misschien niet in staat zijn om bestanden te lezen die gelabeld zijn met het <code class="computeroutput">nfs_t</code> type. Dit kan verhinderen dat bestandssystemen die met dit type gelabeld zijn aangekoppeld worden en daarna gelezen of geexporteerd door andere services.
</div><div class="para">
Als je een NFS bestandssysteem wilt aankoppelen en dat bestandssysteem wilt lezen of exporteren met een andere service, gebruik je de <code class="option">context</code> optie tijdens het aankoppelen om het <code class="computeroutput">nfs_t</code> type terzijde te schuiven. Gebruik de volgende context optie om NFS bestandssystemen aan te koppelen zodat ze gedeeld kunnen worden via de Apache HTTP server:
</div><pre class="screen">mount server:/export /local/mount/point -o\
context="system_u:object_r:httpd_sys_content_t:s0"
</pre><div class="para">
Omdat voor deze situaties context veranderingen niet naar schijf worden geschreven, wordt de context opgegeven met de <code class="option">context</code> optie alleen behouden als de <code class="option">context</code> optie wordt gebruikt tijdens de volgende aankoppeling, en als dezelfde context wordt opgegeven.
</div><div class="para">
Als een alternatief voor het aankoppelen van bestandssystemen met <code class="option">context</code> opties, kunnen Booleans aangezet worden om services toe te staan om toegang te hebben tot bestandssystemen gelabeld met het <code class="computeroutput">nfs_t</code> type. Refereer naar <a class="xref" href="sect-Security-Enhanced_Linux-Booleans-Booleans_for_NFS_and_CIFS.html" title="5.6.3. Booleans voor NFS en CIFS">Paragraaf 5.6.3, “Booleans voor NFS en CIFS”</a> voor instructies over het instellen van Booleans om services toegang te geven tot het <code class="computeroutput">nfs_t</code> type.
</div></div><ul class="docnav"><li class="previous"><a accesskey="p" href="sect-Security-Enhanced_Linux-Mounting_File_Systems-Changing_the_Default_Context.html"><strong>Terug</strong>5.9.2. De standaard context veranderen</a></li><li class="up"><a accesskey="u" href="#"><strong>Omhoog</strong></a></li><li class="home"><a accesskey="h" href="index.html"><strong>Begin</strong></a></li><li class="next"><a accesskey="n" href="sect-Security-Enhanced_Linux-Mounting_File_Systems-Multiple_NFS_Mounts.html"><strong>Volgende</strong>5.9.4. Meerdere NFS aankoppelingen</a></li></ul></body></html>
--- NEW FILE sect-Security-Enhanced_Linux-Mounting_File_Systems-Multiple_NFS_Mounts.html ---
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>5.9.4. Meerdere NFS aankoppelingen</title><link rel="stylesheet" href="./Common_Content/css/default.css" type="text/css"/><meta name="generator" content="publican"/><meta name="package" content="Fedora-Security-Enhanced_Linux-11-nl-NL-1.3-SELinux_User_guide"/><link rel="home" href="index.html" title="Security-Enhanced Linux"/><link rel="up" href="sect-Security-Enhanced_Linux-Working_with_SELinux-Mounting_File_Systems.html" title="5.9. Het aankoppelen van bestandssystemen"/><link rel="prev" href="sect-Security-Enhanced_Linux-Mounting_File_Systems-Mounting_an_NFS_File_System.html" title="5.9.3. Het aankoppelen van een NFS bestandssysteem"/><link rel="next" href="sect-Security-Enhanced_Linux-Mounting_File_Systems-Making_Context_Mounts_Persistent.html" title="5.9.5. Maak de context aankoppelingen blijvend"/></head><body class=""><p id="title"><a class="left" href="http://www.fedoraproject.org"><img src="Common_Content/images
/image_left.png" alt="Product Site"/></a><a class="right" href="http://docs.fedoraproject.org"><img src="Common_Content/images/image_right.png" alt="Documentation Site"/></a></p><ul class="docnav"><li class="previous"><a accesskey="p" href="sect-Security-Enhanced_Linux-Mounting_File_Systems-Mounting_an_NFS_File_System.html"><strong>Terug</strong></a></li><li class="next"><a accesskey="n" href="sect-Security-Enhanced_Linux-Mounting_File_Systems-Making_Context_Mounts_Persistent.html"><strong>Volgende</strong></a></li></ul><div class="section" lang="nl-NL"><div class="titlepage"><div><div><h3 class="title" id="sect-Security-Enhanced_Linux-Mounting_File_Systems-Multiple_NFS_Mounts">5.9.4. Meerdere NFS aankoppelingen</h3></div></div></div><div class="para">
Als hetzelfde NFS bestandssysteem meerdere keren aangekoppeld wordt, en je probeert bij iedere aankoppeling de SELinux context terzijde te schuiven met een andere context, heeft dat als resultaat dat opvolgende aankoppel commando's zullen mislukken. In het volgende voorbeeld heeft de NFS server een enkele export, <code class="filename">/export</code>, welke twee submappen heeft, <code class="filename">web/</code> en <code class="filename">database/</code>. De volgende commando's proberen twee aankoppelingen te maken van een enkele NFS export, en proberen iedere keer de context terzijde te schuiven:
</div><pre class="screen"># mount server:/export/web /local/web -o\
context="system_u:object_r:httpd_sys_content_t:s0"
# mount server:/export/database /local/database -o\
context="system_u:object_r:mysqld_db_t:s0"
</pre><div class="para">
Het tweede aankoppel commando mislukt, en de volgende boodschap wordt naar <code class="filename">/var/log/messages</code> geschreven:
</div><pre class="screen">kernel: SELinux: mount invalid. Same superblock, different security settings for (dev 0:15, type nfs)
</pre><div class="para">
Om meerdere aankoppelingen te maken naar een enkele NFS export, waarbij iedere aankoppeling een andere context heeft, gebruik je de <code class="option">-o nosharecache,context</code> opties. Het volgende voorbeeld koppelt meerdere aankoppelingen voor een enkele NFS export, met een andere context voor iedere aankoppeling (wat een enkele service toestaat om toegang tot iedere te hebben):
</div><pre class="screen"># mount server:/export/web /local/web -o\
nosharecache,context="system_u:object_r:httpd_sys_content_t:s0"
# mount server:/export/database /local/database -o\
nosharecache,context="system_u:object_r:mysqld_db_t:s0"
</pre><div class="para">
In dit voorbeeld wordt <code class="computeroutput">server:/export/web</code> locaal aangekoppeld naar <code class="filename">/local/web/</code>, waarbij alle bestanden gelabeld worden met het <code class="computeroutput">httpd_sys_content_t</code> type, wat Apache HTTP server toegang toestaat. <code class="computeroutput">server:/export/database</code> wordt locaal aangekoppeld naar <code class="filename">/local/database</code>, waarbij alle bestanden gelabeld worden met het <code class="computeroutput">mysqld_db_t</code> type, wat MySQL toegang toestaat. Deze veranderingen worden niet naar schijf geschreven.
</div><div class="important"><h2>Belangrijk</h2><div class="para">
De <code class="option">nosharecache</code> opties laten je dezelfde submap van een export meerdere keren aankoppelen met verschillende contexten (bijvoorbeeld, het meerdere keren aankoppelen van <code class="filename">/export/web</code>). Koppel dezelfde submap van een export niet meerdere keren aan met verschillende contexten, omdat dit een overlappende aankoppeling maakt, waarbij bestanden bereikbaar zijn met twee verschillende contexten.
</div></div></div><ul class="docnav"><li class="previous"><a accesskey="p" href="sect-Security-Enhanced_Linux-Mounting_File_Systems-Mounting_an_NFS_File_System.html"><strong>Terug</strong>5.9.3. Het aankoppelen van een NFS bestandssysteem</a></li><li class="up"><a accesskey="u" href="#"><strong>Omhoog</strong></a></li><li class="home"><a accesskey="h" href="index.html"><strong>Begin</strong></a></li><li class="next"><a accesskey="n" href="sect-Security-Enhanced_Linux-Mounting_File_Systems-Making_Context_Mounts_Persistent.html"><strong>Volgende</strong>5.9.5. Maak de context aankoppelingen blijvend</a></li></ul></body></html>
--- NEW FILE sect-Security-Enhanced_Linux-Permissive_Domains-Denials_for_Permissive_Domains.html ---
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>7.3.4.2. Weigeringen voor toelatende domeinen</title><link rel="stylesheet" href="./Common_Content/css/default.css" type="text/css"/><meta name="generator" content="publican"/><meta name="package" content="Fedora-Security-Enhanced_Linux-11-nl-NL-1.3-SELinux_User_guide"/><link rel="home" href="index.html" title="Security-Enhanced Linux"/><link rel="up" href="sect-Security-Enhanced_Linux-Fixing_Problems-Permissive_Domains.html" title="7.3.4. Toelatende domeinen"/><link rel="prev" href="sect-Security-Enhanced_Linux-Fixing_Problems-Permissive_Domains.html" title="7.3.4. Toelatende domeinen"/><link rel="next" href="sect-Security-Enhanced_Linux-Fixing_Problems-Searching_For_and_Viewing_Denials.html" title="7.3.5. Zoeken naar en het bekijken van weigeringen"/></head><body class=""><p id="title"><a class="left" href="http://www.fedoraproject.org"><img src="Common_Content/images/image_left.png" alt="Product Site"/></a><a class="r
ight" href="http://docs.fedoraproject.org"><img src="Common_Content/images/image_right.png" alt="Documentation Site"/></a></p><ul class="docnav"><li class="previous"><a accesskey="p" href="sect-Security-Enhanced_Linux-Fixing_Problems-Permissive_Domains.html"><strong>Terug</strong></a></li><li class="next"><a accesskey="n" href="sect-Security-Enhanced_Linux-Fixing_Problems-Searching_For_and_Viewing_Denials.html"><strong>Volgende</strong></a></li></ul><div class="section" lang="nl-NL"><div class="titlepage"><div><div><h4 class="title" id="sect-Security-Enhanced_Linux-Permissive_Domains-Denials_for_Permissive_Domains">7.3.4.2. Weigeringen voor toelatende domeinen</h4></div></div></div><div class="para">
De <code class="computeroutput">SYSCALL</code> boodschap is verschillend voor toelatende domeinen. Het volgende is een voorbeeld AVC weigering ( en de bijbehorende systeem aanroep) van de Apache HTTP server:
</div><pre class="screen">type=AVC msg=audit(1226882736.442:86): avc: denied { getattr } for pid=2427 comm="httpd" path="/var/www/html/file1" dev=dm-0 ino=284133 scontext=unconfined_u:system_r:httpd_t:s0 tcontext=unconfined_u:object_r:samba_share_t:s0 tclass=file
type=SYSCALL msg=audit(1226882736.442:86): arch=40000003 syscall=196 success=no exit=-13 a0=b9a1e198 a1=bfc2921c a2=54dff4 a3=2008171 items=0 ppid=2425 pid=2427 auid=502 uid=48 gid=48 euid=48 suid=48 fsuid=48 egid=48 sgid=48 fsgid=48 tty=(none) ses=4 comm="httpd" exe="/usr/sbin/httpd" subj=unconfined_u:system_r:httpd_t:s0 key=(null)
</pre><div class="para">
Standaard is het <code class="computeroutput">httpd_t</code> domein niet toelatend, en daarom wordt de actie geweigerd, en de <code class="computeroutput">SYSCALL</code> boodschap bevat <code class="computeroutput">success=no</code>. Het volgende is een voorbeeld AVC weigering voor dezelfde actie, behalve dat het <code class="command">semanage permissive -a httpd_t</code> commando is uitgevoerd om het <code class="computeroutput">httpd_t</code> domein toelatend te maken:
</div><pre class="screen">type=AVC msg=audit(1226882925.714:136): avc: denied { read } for pid=2512 comm="httpd" name="file1" dev=dm-0 ino=284133 scontext=unconfined_u:system_r:httpd_t:s0 tcontext=unconfined_u:object_r:samba_share_t:s0 tclass=file
type=SYSCALL msg=audit(1226882925.714:136): arch=40000003 syscall=5 success=yes exit=11 a0=b962a1e8 a1=8000 a2=0 a3=8000 items=0 ppid=2511 pid=2512 auid=502 uid=48 gid=48 euid=48 suid=48 fsuid=48 egid=48 sgid=48 fsgid=48 tty=(none) ses=4 comm="httpd" exe="/usr/sbin/httpd" subj=unconfined_u:system_r:httpd_t:s0 key=(null)
</pre><div class="para">
In dit geval, hoewel er een AVC weigering gelogd is, was toegang niet geweigerd, zoals getoond wordt door <code class="computeroutput">success=yes</code> in de <code class="computeroutput">SYSCALL</code> boodschap.
</div><div class="para">
Refereer naar de blog van Dan Walsh <a href="http://danwalsh.livejournal.com/24537.html">"Permissive Domains"</a> voor meer informatie over toelatende domeinen.
</div></div><ul class="docnav"><li class="previous"><a accesskey="p" href="sect-Security-Enhanced_Linux-Fixing_Problems-Permissive_Domains.html"><strong>Terug</strong>7.3.4. Toelatende domeinen</a></li><li class="up"><a accesskey="u" href="#"><strong>Omhoog</strong></a></li><li class="home"><a accesskey="h" href="index.html"><strong>Begin</strong></a></li><li class="next"><a accesskey="n" href="sect-Security-Enhanced_Linux-Fixing_Problems-Searching_For_and_Viewing_Denials.html"><strong>Volgende</strong>7.3.5. Zoeken naar en het bekijken van weigeringen</a></li></ul></body></html>
--- NEW FILE sect-Security-Enhanced_Linux-SELinux_Contexts_Labeling_Files-Persistent_Changes_semanage_fcontext.html ---
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>5.7.2. Permanente veranderingen: semanage fcontext</title><link rel="stylesheet" href="./Common_Content/css/default.css" type="text/css"/><meta name="generator" content="publican"/><meta name="package" content="Fedora-Security-Enhanced_Linux-11-nl-NL-1.3-SELinux_User_guide"/><link rel="home" href="index.html" title="Security-Enhanced Linux"/><link rel="up" href="sect-Security-Enhanced_Linux-Working_with_SELinux-SELinux_Contexts_Labeling_Files.html" title="5.7. SELinux context - Bestanden labelen"/><link rel="prev" href="sect-Security-Enhanced_Linux-Working_with_SELinux-SELinux_Contexts_Labeling_Files.html" title="5.7. SELinux context - Bestanden labelen"/><link rel="next" href="sect-Security-Enhanced_Linux-Working_with_SELinux-The_file_t_and_default_t_Types.html" title="5.8. De file_t en default_t types"/></head><body class=""><p id="title"><a class="left" href="http://www.fedoraproject.org"><img src="Common_Content/imag
es/image_left.png" alt="Product Site"/></a><a class="right" href="http://docs.fedoraproject.org"><img src="Common_Content/images/image_right.png" alt="Documentation Site"/></a></p><ul class="docnav"><li class="previous"><a accesskey="p" href="sect-Security-Enhanced_Linux-Working_with_SELinux-SELinux_Contexts_Labeling_Files.html"><strong>Terug</strong></a></li><li class="next"><a accesskey="n" href="sect-Security-Enhanced_Linux-Working_with_SELinux-The_file_t_and_default_t_Types.html"><strong>Volgende</strong></a></li></ul><div class="section" lang="nl-NL"><div class="titlepage"><div><div><h3 class="title" id="sect-Security-Enhanced_Linux-SELinux_Contexts_Labeling_Files-Persistent_Changes_semanage_fcontext">5.7.2. Permanente veranderingen: semanage fcontext</h3></div></div></div><div class="para">
Het <code class="command">/usr/sbin/semanage fcontext</code> commando verandert de SELinux context voor bestanden. Als de gerichte tactiek gebruikt wordt, worden veranderingen die met dit commando gemaakt zijn toegevoegd aan het <code class="filename">/etc/selinux/targeted/contexts/files/file_contexts</code> bestand als de veranderingen gemaakt zijn voor bestanden die bestaan in <code class="filename">file_contexts</code>, of worden toegevoegd aan <code class="filename">file_contexts.local</code> voor nieuwe bestanden en mappen, zoals het aan maken van een <code class="filename">/web/</code> map. <code class="command">setfiles</code>, welke gebruikt wordt als een bestandssysteem geherlabeld wordt, en <code class="command">/sbin/restorecon</code>, welke de standaard SELinux context herstelt, lezen deze bestanden. Dit betekent dat veranderingen gemaakt door <code class="command">/usr/sbin/semanage fcontext</code> blijvend zijn, zelfs als het bestandssysteem opnieuw gelabeld
wordt. SELinux tactiek controleert of gebruikers in staat zijn de SELinux context van een bepaald bestand kunnen veranderen.
</div><div class="formalpara"><h5 class="formalpara" id="form-Security-Enhanced_Linux-Persistent_Changes_semanage_fcontext-Quick_Reference">Korte referentie</h5>
Om SELinux context veranderingen te maken die het opnieuw labelen van een bestandssysteem overleven:
</div><div class="orderedlist"><ol><li><div class="para">
Voer het <code class="command">/usr/sbin/semanage fcontext -a <em class="replaceable"><code>opties</code></em> <em class="replaceable"><code>bestandsnaam</code></em>|<em class="replaceable"><code>mapnaam</code></em></code> commando uit, waarbij je er aan moet denken om voor een bestand of map het volledige pad te gebruiken.
</div></li><li><div class="para">
Voer het <code class="command">/sbin/restorecon -v <em class="replaceable"><code>bestandsnaam</code></em>|<em class="replaceable"><code>mapnaam</code></em></code> commando uit om de context veranderingen toe te passen.
</div></li></ol></div><div class="formalpara"><h5 class="formalpara" id="form-Security-Enhanced_Linux-Persistent_Changes_semanage_fcontext-Changing_a_Files_Type">Het veranderen van een bestandstype</h5>
Het volgende voorbeeld laat het veranderen van een bestandstype zien, waarbij geen andere attributen van de SELinux context veranderen:
</div><div class="orderedlist"><ol><li><div class="para">
Als de Linux root gebruiker, voer je het <code class="command">touch /etc/file1</code> commando uit om een nieuw bestand aan te maken. Standaard worden nieuw aangemaakte bestanden in de <code class="filename">/etc/</code> gelabeld met het <code class="computeroutput">etc_t</code> type:
</div><pre class="screen"># ls -Z /etc/file1
-rw-r--r-- root root unconfined_u:object_r:etc_t:s0 /etc/file1
</pre></li><li><div class="para">
Als de Linux root gebruiker voer je het <code class="command">/usr/sbin/semanage fcontext -a -t samba_share_t /etc/file1</code> commando uit om het type van <code class="filename">file1</code> te veranderen naar <code class="computeroutput">samba_share_t</code>. De <code class="option">-a</code> optie voegt een nieuwe optekening toe, en de <code class="option">-t</code> optie definieert een type (<code class="computeroutput">samba_share_t</code>). Merk op: het uitvoeren van dit commando verandert niet direct het type - <code class="filename">file1</code> is nog steeds gelabeld met het <code class="computeroutput">etc_t</code> type:
</div><pre class="screen"># /usr/sbin/semanage fcontext -a -t samba_share_t /etc/file1
# ls -Z /etc/file1
-rw-r--r-- root root unconfined_u:object_r:etc_t:s0 /etc/file1
</pre><div class="para">
Het <code class="command">/usr/sbin/semanage fcontext -a -t samba_share_t /etc/file1</code> commando voegt de volgende regel toe aan <code class="filename">/etc/selinux/targeted/contexts/files/file_contexts.local</code>:
</div><pre class="screen">/etc/file1 unconfined_u:object_r:samba_share_t:s0
</pre></li><li><div class="para">
Als de Linux root gebruiker voer je het <code class="command">/sbin/restorecon -v /etc/file1</code> commando uit om het type te veranderen. Omdat het <code class="command">semanage</code> commando een regel aan <code class="filename">file.contexts.local</code> heeft toegevoegd voor <code class="filename">/etc/file1</code>, verandert het <code class="command">/sbin/restorecon</code> commando het type naar <code class="computeroutput">samba_share_t</code>:
</div><pre class="screen"># /sbin/restorecon -v /etc/file1
restorecon reset /etc/file1 context unconfined_u:object_r:etc_t:s0->system_u:object_r:samba_share_t:s0
</pre></li><li><div class="para">
Als de Linux root gebruiker voer je het <code class="command">rm -i /etc/file1</code> commando uit om <code class="filename">file1</code> te verwijderen.
</div></li><li><div class="para">
Als de Linux root gebruiker voer je het <code class="command">/usr/sbin/semanage fcontext -d /etc/file1</code> commando uit om de context toegevoegd voor <code class="filename">/etc/file1</code> te verwijderen. Als de context verwijderd is, zal het uitvoeren van <code class="command">restorecon</code> het type veranderen naar <code class="computeroutput">etc_t</code>, in plaats van <code class="computeroutput">samba_share_t</code>.
</div></li></ol></div><div class="formalpara"><h5 class="formalpara" id="form-Security-Enhanced_Linux-Persistent_Changes_semanage_fcontext-Changing_a_Directorys_Type">Het veranderen van het type van een map</h5>
Het volgende voorbeeld laat het aanmaken van een nieuwe map zien en het veranderen van het bestandstype van die map naar een type dat gebruikt wordt door de Apache HTTP server:
</div><div class="orderedlist"><ol><li><div class="para">
Als de Linux root gebruiker voer je het <code class="command">mkdir /web</code> commando uit om een nieuwe map aan te maken. Deze map is gelabeld met het <code class="computeroutput">default_t</code> type:
</div><pre class="screen"># ls -dZ /web
drwxr-xr-x root root unconfined_u:object_r:default_t:s0 /web
</pre><div class="para">
De <code class="command">ls</code> <code class="option">-d</code> optie laat <code class="command">ls</code> informatie tonen over een map, in plaats van zijn inhoud, en de <code class="option">-Z</code> optie laat <code class="command">ls</code> de SELinux context tonen (in dit voorbeeld, <code class="computeroutput">unconfined_u:object_r:default_t:s0</code>).
</div></li><li><div class="para">
Als de Linux root gebruiker voer je het <code class="command">/usr/sbin/semanage fcontext -a -t httpd_sys_content_t /web</code> commando uit om het type van <code class="filename">/web/</code> te veranderen naar <code class="computeroutput">httpd_sys_content_t</code>. De <code class="option">-a</code> optie voegt een nieuwe aantekening toe, en de <code class="option">-t</code> optie definieert een type (<code class="computeroutput">httpd_sys_content_t</code>). Merk op: het uitvoeren van dit commando verandert niet direct het type - <code class="filename">/web/</code> is nog steeds gelabeld met het <code class="computeroutput">default_t</code> type:
</div><pre class="screen"># /usr/sbin/semanage fcontext -a -t httpd_sys_content_t /web
# ls -dZ /web
drwxr-xr-x root root unconfined_u:object_r:default_t:s0 /web
</pre><div class="para">
Het <code class="command">/usr/sbin/semanage fcontext -a -t httpd_sys_content_t /web</code> commmando voegt de volgende regel toe aan <code class="command">/etc/selinux/targeted/contexts/files/file_contexts.local</code>:
</div><pre class="screen">/web unconfined_u:object_r:httpd_sys_content_t:s0
</pre></li><li><div class="para">
Als de Linux root gebruiker voer je het <code class="command">/sbin/restorecon -v /web</code> commando uit om het type te veranderen. Omdat het <code class="command">semanage</code> commando een regel aan <code class="filename">file.contexts.local</code> heeft toegevoegd voor <code class="filename">/web</code>, verandert het <code class="command">/sbin/restorecon</code> commando het type naar <code class="computeroutput">httpd_sys_content_t</code>:
</div><pre class="screen"># /sbin/restorecon -v /web
restorecon reset /web context unconfined_u:object_r:default_t:s0->system_u:object_r:httpd_sys_content_t:s0
</pre><div class="para">
Standaard erven nieuw aangemaakte bestanden en mappen het SELinux type van hun ouders map. Als dit voorbeeld gebruikt wordt, en voordat de SELinx context toegevoegd voor <code class="filename">/web/</code> is verwijderd, zijn bestanden en mappen aangemaakt in de <code class="filename">/web/</code> map gelabeld met het <code class="computeroutput">httpd_sys_content_t</code> type.
</div></li><li><div class="para">
Als de Linux root gebruiker voer je het <code class="command">/usr/sbin/semanage fcontext -d /web</code> commando uit om de toegevoegde context voor <code class="filename">/web/</code> te verwijderen.
</div></li><li><div class="para">
Als de Linux root gebruiker voer je het <code class="command">/sbin/restorecon -v /web</code> commando uit om de standaard SELinux context te herstellen.
</div></li></ol></div><div class="formalpara"><h5 class="formalpara" id="form-Security-Enhanced_Linux-Persistent_Changes_semanage_fcontext-Changing_a_Directory_and_its_Contents_Types">Een map en zijn context types veranderen</h5>
Het volgende voorbeeld laat het aanmaken van een nieuwe map zien, en het veranderen van het bestandstype van de map (te samen met zijn inhoud) naar een type dat gebruikt wordt door de Apache HTTP server. De instelling in dit voorbeeld wordt gebruikt als je wilt dat de Apache HTTP server een andere document root gaat gebruiken (in plaats van <code class="filename">/var/www/html/</code>):
</div><div class="orderedlist"><ol><li><div class="para">
Als de Linux root gebruiker voer je het <code class="command">mkdir /web</code> commando uit om een nieuwe map aan te maken, en daarna het <code class="command">touch /web/file{1,2,3}</code> commando om 3 lege bestanden aan te maken (<code class="filename">file1</code>, <code class="filename">file2</code>, en <code class="filename">file3</code>). De <code class="filename">/web/</code> map en zijn bestanden zijn gelabeld met het <code class="computeroutput">default_t</code> type:
</div><pre class="screen"># ls -dZ /web
drwxr-xr-x root root unconfined_u:object_r:default_t:s0 /web
# ls -lZ /web
-rw-r--r-- root root unconfined_u:object_r:default_t:s0 file1
-rw-r--r-- root root unconfined_u:object_r:default_t:s0 file2
-rw-r--r-- root root unconfined_u:object_r:default_t:s0 file3
</pre></li><li><div class="para">
Als de Linux root gebruiker voer je het <code class="command">/usr/sbin/semanage fcontext -a -t httpd_sys_content_t "/web(/.*)?"</code> commando uit om het type van de <code class="filename">/web/</code>, en de bestanden hierin, te veranderen naar <code class="computeroutput">httpd_sys_content_t</code>. De <code class="option">-a</code> optie voegt een nieuwe aantekening toe, en de <code class="option">-t</code> optie definieert een type (httpd_sys_content_t). De <code class="computeroutput">"/web(/.*)?"</code> reguliere expressie laat het <code class="command">semanage</code> commando veranderingen maken naar de <code class="filename">/web/</code> map, en naar de bestanden daar in. Merk op: het uitvoeren van dit commando verandert niet direct het type - <code class="filename">/web/</code> en de bestanden hierin zijn nog steeds gelabeld met het <code class="computeroutput">default_t</code> type:
</div><pre class="screen"># ls -dZ /web
drwxr-xr-x root root unconfined_u:object_r:default_t:s0 /web
# ls -lZ /web
-rw-r--r-- root root unconfined_u:object_r:default_t:s0 file1
-rw-r--r-- root root unconfined_u:object_r:default_t:s0 file2
-rw-r--r-- root root unconfined_u:object_r:default_t:s0 file3
</pre><div class="para">
Het <code class="command">/usr/sbin/semanage fcontext -a -t httpd_sys_content_t "/web(/.*)?"</code> commando voegt de volgende regel toe aan <code class="filename">/etc/selinux/targeted/contexts/files/file_contexts.local</code>:
</div><pre class="screen">/web(/.*)? system_u:object_r:httpd_sys_content_t:s0
</pre></li><li><div class="para">
Als de Linux root gebruiker voer je het <code class="command">/sbin/restorecon -R -v /web</code> commando uit om het type van de <code class="filename">/web/</code> map, en alle bestanden hierin, te veranderen. De <code class="option">-R</code> optie staat voor recursief, wat betekent dat alle bestanden en mappen onder de <code class="filename">/web/</code> map gelabeld worden met het <code class="computeroutput">httpd_sys_content_t</code> type. Omdat het <code class="command">semanage</code> commando een regel toevoegde aan <code class="filename">file.contexts.local</code> voor <code class="computeroutput">/web(/.*)?</code>, verandert het <code class="command">/sbin/restorecon</code> commando de types naar <code class="computeroutput">httpd_sys_content_t</code>:
</div><pre class="screen"># /sbin/restorecon -R -v /web
restorecon reset /web context unconfined_u:object_r:default_t:s0->system_u:object_r:httpd_sys_content_t:s0
restorecon reset /web/file2 context unconfined_u:object_r:default_t:s0->system_u:object_r:httpd_sys_content_t:s0
restorecon reset /web/file3 context unconfined_u:object_r:default_t:s0->system_u:object_r:httpd_sys_content_t:s0
restorecon reset /web/file1 context unconfined_u:object_r:default_t:s0->system_u:object_r:httpd_sys_content_t:s0
</pre><div class="para">
Standaard erven nieuw aangemaakte bestanden en mappen het SELinux type van hun ouders. In dit voorbeeld, zullen bestanden en mappen aangemaakt in de <code class="filename">/web/</code> map gelabeld worden met het <code class="computeroutput">httpd_sys_content_t</code> type.
</div></li><li><div class="para">
Als de Linux root gebruiker voer je het <code class="command">/usr/sbin/semanage fcontext -d "/web(/.*)?"</code> commando uit om de context toegevoegd voor <code class="computeroutput">"/web(/.*)?"</code> te verwijderen.
</div></li><li><div class="para">
Als de Linux root gebruiker voer je het <code class="command">/sbin/restorecon -R -v /web</code> om de standaard SELinux context te herstellen.
</div></li></ol></div><div class="formalpara"><h5 class="formalpara" id="form-Security-Enhanced_Linux-Persistent_Changes_semanage_fcontext-Deleting_an_added_Context">Een toegevoegde context verwijderen</h5>
Het volgende voorbeeld laat het toevoegen en verwijderen van een SELinux context zien:
</div><div class="orderedlist"><ol><li><div class="para">
Als de Linux root gebruiker voer je het <code class="command">/usr/sbin/semanage fcontext -a -t httpd_sys_content_t /test</code> commando uit. De <code class="filename">/test/</code> map hoeft niet te bestaan. Dit commando voegt de volgende context toe aan <code class="filename">/etc/selinux/targeted/contexts/files/file_contexts.local</code>:
</div><pre class="screen">/test system_u:object_r:httpd_sys_content_t:s0
</pre></li><li><div class="para">
Om de context te verwijderen, voer je als de Linux root gebruiker het <code class="command">/usr/sbin/semanage fcontext -d <em class="replaceable"><code>bestandsnaam</code></em>|<em class="replaceable"><code>mapnaam</code></em></code> commando uit, waarin <em class="replaceable"><code>bestandsnaam</code></em>|<em class="replaceable"><code>mapnaam</code></em> het eerste onderdeel is in <code class="filename">file_contexts.local</code>. Het volgende is een voorbeeld van een context in <code class="filename">file_contexts.local</code>:
</div><pre class="screen">/test system_u:object_r:httpd_sys_content_t:s0
</pre><div class="para">
Waarin het eerste onderdeel <code class="computeroutput">/test</code> is. Om te voorkomen dat de <code class="filename">/test/</code> map gelabeld wordt met <code class="computeroutput">httpd_sys_content_t</code> na het draaien van <code class="command">/sbin/restorecon</code>, of na een bestandssysteem herlabeling, voer je het volgende commando uit als de Linux root gebruiker om de context van <code class="filename">file_contexts.local</code> te verwijderen:
</div><div class="para">
<code class="command">/usr/sbin/semanage fcontext -d /test</code>
</div></li></ol></div><div class="para">
Als de context onderdeel is van een reguliere expressie, bijvoorbeeld, <code class="computeroutput">/web(/.*)?</code>, gebruik je aanhalingstekens om de reguliere expressie:
</div><div class="para">
<code class="command">/usr/sbin/semanage fcontext -d "/web(/.*)?"</code>
</div><div class="para">
Refereer naar de <span class="citerefentry"><span class="refentrytitle">semanage</span>(8)</span> manual pagina voor verdere informatie over <code class="command">/usr/sbin/semanage</code>.
</div><div class="important"><h2>Belangrijk</h2><div class="para">
Als de SELinux context veranderd wordt met <code class="command">/usr/sbin/semanage fcontext -a</code>, gebruik dan het volledige pad naar het bestand of de map om te voorkomen dat bestanden verkeerd worden gelabeld na een systeem herlabeling, of nadat het <code class="command">/sbin/restorecon</code> commando is uitgevoerd.
</div></div></div><ul class="docnav"><li class="previous"><a accesskey="p" href="sect-Security-Enhanced_Linux-Working_with_SELinux-SELinux_Contexts_Labeling_Files.html"><strong>Terug</strong>5.7. SELinux context - Bestanden labelen</a></li><li class="up"><a accesskey="u" href="#"><strong>Omhoog</strong></a></li><li class="home"><a accesskey="h" href="index.html"><strong>Begin</strong></a></li><li class="next"><a accesskey="n" href="sect-Security-Enhanced_Linux-Working_with_SELinux-The_file_t_and_default_t_Types.html"><strong>Volgende</strong>5.8. De file_t en default_t types</a></li></ul></body></html>
--- NEW FILE sect-Security-Enhanced_Linux-SELinux_Contexts-SELinux_Contexts_for_Processes.html ---
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>3.2. SELinux context voor processen</title><link rel="stylesheet" href="./Common_Content/css/default.css" type="text/css"/><meta name="generator" content="publican"/><meta name="package" content="Fedora-Security-Enhanced_Linux-11-nl-NL-1.3-SELinux_User_guide"/><link rel="home" href="index.html" title="Security-Enhanced Linux"/><link rel="up" href="chap-Security-Enhanced_Linux-SELinux_Contexts.html" title="Hoofdstuk 3. SELinux context"/><link rel="prev" href="chap-Security-Enhanced_Linux-SELinux_Contexts.html" title="Hoofdstuk 3. SELinux context"/><link rel="next" href="sect-Security-Enhanced_Linux-SELinux_Contexts-SELinux_Contexts_for_Users.html" title="3.3. SELinux context voor gebruikers"/></head><body class=""><p id="title"><a class="left" href="http://www.fedoraproject.org"><img src="Common_Content/images/image_left.png" alt="Product Site"/></a><a class="right" href="http://docs.fedoraproject.org"><img src="Common_Co
ntent/images/image_right.png" alt="Documentation Site"/></a></p><ul class="docnav"><li class="previous"><a accesskey="p" href="chap-Security-Enhanced_Linux-SELinux_Contexts.html"><strong>Terug</strong></a></li><li class="next"><a accesskey="n" href="sect-Security-Enhanced_Linux-SELinux_Contexts-SELinux_Contexts_for_Users.html"><strong>Volgende</strong></a></li></ul><div class="section" lang="nl-NL"><div class="titlepage"><div><div><h2 class="title" id="sect-Security-Enhanced_Linux-SELinux_Contexts-SELinux_Contexts_for_Processes">3.2. SELinux context voor processen</h2></div></div></div><div class="para">
Gebruikt het <code class="command">ps -eZ</code> commando om de SELinux context voor processen te bekijken. Bijvoorbeeld:
</div><div class="orderedlist"><ol><li><div class="para">
Open een terminal, zoals <span class="guimenu"><strong>Toepassingen</strong></span> → <span class="guisubmenu"><strong>Systeemgereedschappen</strong></span> → <span class="guimenuitem"><strong>Terminal</strong></span>.
</div></li><li><div class="para">
Voer het <code class="command">/usr/bin/passwd</code> commando uit. Vul geen nieuw wachtwoord in.
</div></li><li><div class="para">
Open een nieuwe tab, of een andere terminal, en voer het <code class="command">ps -eZ | grep passwd</code> commando uit. De output lijkt op het volgende:
</div><pre class="screen">unconfined_u:unconfined_r:passwd_t:s0-s0:c0.c1023 13212 pts/1 00:00:00 passwd
</pre></li><li><div class="para">
Druk op <strong class="userinput"><code>Ctrl+C</code></strong> in de eerste tab om de <span class="application"><strong>passwd</strong></span> toepassing te stoppen.
</div></li></ol></div><div class="para">
Als in dit voorbeeld de <code class="filename">/usr/bin/passwd</code> toepassing (gelabeld met het <code class="computeroutput">passwd_exec_t</code> type) wordt uitgevoerd, gaat het shell proces van de gebruiker over naar het <code class="computeroutput">passwd_t</code> domein. Denk eraan: het type definieert een domein voor een proces, en een type voor bestanden.
</div><div class="para">
Gebruik het <code class="command">ps -eZ</code> commando om de SELinux context voor draaiende processen te zien. Het volgende is een beperkt voorbeeld van de output, en kan op jouw systeem anders zijn:
</div><pre class="screen">system_u:system_r:setroubleshootd_t:s0 1866 ? 00:00:08 setroubleshootd
system_u:system_r:dhcpc_t:s0 1869 ? 00:00:00 dhclient
system_u:system_r:sshd_t:s0-s0:c0.c1023 1882 ? 00:00:00 sshd
system_u:system_r:gpm_t:s0 1964 ? 00:00:00 gpm
system_u:system_r:crond_t:s0-s0:c0.c1023 1973 ? 00:00:00 crond
system_u:system_r:kerneloops_t:s0 1983 ? 00:00:05 kerneloops
system_u:system_r:crond_t:s0-s0:c0.c1023 1991 ? 00:00:00 atd
</pre><div class="para">
De <code class="computeroutput">system_r</code> rol wordt gebruikt voor systeem processen, zoals daemons. Type Enforcement afzondert dan elk domein.
</div></div><ul class="docnav"><li class="previous"><a accesskey="p" href="chap-Security-Enhanced_Linux-SELinux_Contexts.html"><strong>Terug</strong>Hoofdstuk 3. SELinux context</a></li><li class="up"><a accesskey="u" href="#"><strong>Omhoog</strong></a></li><li class="home"><a accesskey="h" href="index.html"><strong>Begin</strong></a></li><li class="next"><a accesskey="n" href="sect-Security-Enhanced_Linux-SELinux_Contexts-SELinux_Contexts_for_Users.html"><strong>Volgende</strong>3.3. SELinux context voor gebruikers</a></li></ul></body></html>
--- NEW FILE sect-Security-Enhanced_Linux-SELinux_Contexts-SELinux_Contexts_for_Users.html ---
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>3.3. SELinux context voor gebruikers</title><link rel="stylesheet" href="./Common_Content/css/default.css" type="text/css"/><meta name="generator" content="publican"/><meta name="package" content="Fedora-Security-Enhanced_Linux-11-nl-NL-1.3-SELinux_User_guide"/><link rel="home" href="index.html" title="Security-Enhanced Linux"/><link rel="up" href="chap-Security-Enhanced_Linux-SELinux_Contexts.html" title="Hoofdstuk 3. SELinux context"/><link rel="prev" href="sect-Security-Enhanced_Linux-SELinux_Contexts-SELinux_Contexts_for_Processes.html" title="3.2. SELinux context voor processen"/><link rel="next" href="chap-Security-Enhanced_Linux-Targeted_Policy.html" title="Hoofdstuk 4. Gerichte tactiek"/></head><body class=""><p id="title"><a class="left" href="http://www.fedoraproject.org"><img src="Common_Content/images/image_left.png" alt="Product Site"/></a><a class="right" href="http://docs.fedoraproject.org"><img src="Commo
n_Content/images/image_right.png" alt="Documentation Site"/></a></p><ul class="docnav"><li class="previous"><a accesskey="p" href="sect-Security-Enhanced_Linux-SELinux_Contexts-SELinux_Contexts_for_Processes.html"><strong>Terug</strong></a></li><li class="next"><a accesskey="n" href="chap-Security-Enhanced_Linux-Targeted_Policy.html"><strong>Volgende</strong></a></li></ul><div class="section" lang="nl-NL"><div class="titlepage"><div><div><h2 class="title" id="sect-Security-Enhanced_Linux-SELinux_Contexts-SELinux_Contexts_for_Users">3.3. SELinux context voor gebruikers</h2></div></div></div><div class="para">
Gebruik het <code class="command">id -Z</code> commando om de SELinux context te zien die verbonden is met jouw Linux gebruiker:
</div><pre class="screen">unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023
</pre><div class="para">
In Fedora 11 draaien Linux gebruikers standaard als unconfined (onbeperkt). Deze SELinux context laat zien dat de Linux gebruiker is afgebeeld op de SELinux <code class="computeroutput">unconfined_u</code> gebruiker, draait in de <code class="computeroutput">unconfined_r</code> rol, en draait in het <code class="computeroutput">unconfined_t</code> domein. <code class="computeroutput">s0-s0</code> is een MLS reeks, die in dit geval hetzelfde is als <code class="computeroutput">s0</code>. De categorieën waar naar de gebruiker toegang heeft zijn gedefinieerd door <code class="computeroutput">c0.c1023</code>, wat betekent alle categorieën (<code class="computeroutput">c0</code> tot en met <code class="computeroutput">c1023</code>).
</div></div><ul class="docnav"><li class="previous"><a accesskey="p" href="sect-Security-Enhanced_Linux-SELinux_Contexts-SELinux_Contexts_for_Processes.html"><strong>Terug</strong>3.2. SELinux context voor processen</a></li><li class="up"><a accesskey="u" href="#"><strong>Omhoog</strong></a></li><li class="home"><a accesskey="h" href="index.html"><strong>Begin</strong></a></li><li class="next"><a accesskey="n" href="chap-Security-Enhanced_Linux-Targeted_Policy.html"><strong>Volgende</strong>Hoofdstuk 4. Gerichte tactiek</a></li></ul></body></html>
--- NEW FILE sect-Security-Enhanced_Linux-Targeted_Policy-Confined_and_Unconfined_Users.html ---
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>4.3. Beperkte en onbeperkte gebruikers</title><link rel="stylesheet" href="./Common_Content/css/default.css" type="text/css"/><meta name="generator" content="publican"/><meta name="package" content="Fedora-Security-Enhanced_Linux-11-nl-NL-1.3-SELinux_User_guide"/><link rel="home" href="index.html" title="Security-Enhanced Linux"/><link rel="up" href="chap-Security-Enhanced_Linux-Targeted_Policy.html" title="Hoofdstuk 4. Gerichte tactiek"/><link rel="prev" href="sect-Security-Enhanced_Linux-Targeted_Policy-Unconfined_Processes.html" title="4.2. Onbeperkte processen"/><link rel="next" href="chap-Security-Enhanced_Linux-Working_with_SELinux.html" title="Hoofdstuk 5. Werken met SELinux"/></head><body class=""><p id="title"><a class="left" href="http://www.fedoraproject.org"><img src="Common_Content/images/image_left.png" alt="Product Site"/></a><a class="right" href="http://docs.fedoraproject.org"><img src="Common_Content/im
ages/image_right.png" alt="Documentation Site"/></a></p><ul class="docnav"><li class="previous"><a accesskey="p" href="sect-Security-Enhanced_Linux-Targeted_Policy-Unconfined_Processes.html"><strong>Terug</strong></a></li><li class="next"><a accesskey="n" href="chap-Security-Enhanced_Linux-Working_with_SELinux.html"><strong>Volgende</strong></a></li></ul><div class="section" lang="nl-NL"><div class="titlepage"><div><div><h2 class="title" id="sect-Security-Enhanced_Linux-Targeted_Policy-Confined_and_Unconfined_Users">4.3. Beperkte en onbeperkte gebruikers</h2></div></div></div><div class="para">
Elke Linux gebruiker wordt afgebeeld op een SELinux gebruiker met SELinux tactiek. Dit staat Linux gebruikers toe om de beperkingen voor SELinux gebruikers te erven. Deze Linux gebruiker afbeelding kan bekeken worden door het uitvoeren van het <code class="command">semanage login -l</code> commando als de Linux root gebruiker:
</div><pre class="screen"># /usr/sbin/semanage login -l
Login Name SELinux User MLS/MCS Range
__default__ unconfined_u s0-s0:c0.c1023
root unconfined_u s0-s0:c0.c1023
system_u system_u s0-s0:c0.c1023
</pre><div class="para">
In Fedora 11 worden Linux gebruikers standaard afgebeeld op de <code class="computeroutput">__default__</code> login ( welke is afgebeeld op de SELinux <code class="computeroutput">unconfined_u</code> gebruiker). Het volgende definieert de standaard afbeelding:
</div><pre class="screen">__default__ unconfined_u s0-s0:c0.c1023
</pre><div class="para">
Het volgende voorbeeld laat het toevoegen van een nieuwe Linux gebruiker zien, en het afbeelden van die Linux gebruiker op de SELinux <code class="computeroutput">unconfined_u</code> gebruiker. Het neemt aan dat de Linux root gebruiker onbeperkt draait, wat standaard het geval is in Fedora 11:
</div><div class="orderedlist"><ol><li><div class="para">
Als de Linux root gebruiker voer je het <code class="command">/usr/sbin/useradd newuser</code> commando uit om een nieuwe Linux gebruiker aan te maken met de naam newuser.
</div></li><li><div class="para">
As the Linux root user, run the <code class="command">passwd newuser</code> command to assign a password to the Linux newuser user:
</div><pre class="screen"># passwd newuser
Changing password for user newuser.
New UNIX password: <em class="replaceable"><code>Enter a password</code></em>
Retype new UNIX password: <em class="replaceable"><code>Enter the same password again</code></em>
passwd: all authentication tokens updated successfully.
</pre></li><li><div class="para">
Log uit van je huidige sessie, en login als de Linux newuser gebruiker. Als je inlogt, beeldt pam_selinux de Linux gebruiker af op een SELinux gebruiker (in dit geval, unconfined_u), en stelt de daaruit volgende SELinux context in. De shell van de Lunix gebruiker wordt opgestart met deze context. Voer het <code class="command">id -Z</code> commando uit om de context van een Linux gebruiker te bekijken:
</div><pre class="screen">[newuser@localhost ~]$ id -Z
unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023
</pre></li><li><div class="para">
Log uit van de sessie van de Linux newuser, en log in met je eigen account. Als je de Linux newuser gebruiker niet wilt, voer je het <code class="command">/usr/sbin/userdel -r newuser</code> commando uit als de Linux root gebruiker om het te verwijderen, te samen met de persoonlijke map van de Linux newuser.
</div></li></ol></div><div class="para">
Beperkte en onbeperkte Linux gebruikers zijn onderworpen aan uitvoerbaarheids en naar-geheugen-schrijven controles, en zijn ook beperkt door MCS (en MLS, als de MLS tactiek wordt gebruikt). Als onbeperkte Linux gebruikers een toepassing uitvoeren waarvan SELinux tactiek definieert dat het kan overgaan van het <code class="computeroutput">unconfined_t</code> domein naar zijn eigen beperkt domein, zullen onbeperkte Linux gebruikers nog steeds vallen onder de beperkingen van dat beperkte domein. Het beveilings voordeel hiervan is dat, zelfs als een Linux gebruiker onbeperkt draait, de toepassing beperkt blijft, en dat daardoor de uitbuiting van een fout in de toepassing beperkt kan worden door de tactiek. Merk op: dit beschermt het systeem niet voor de gebruiker. In plaats daarvan worden de gebruiker en het systeem beschermd tegen mogelijke schade veroorzaakt door een fout in de toepassing.
</div><div class="para">
De volgende beperkte SELinux gebruikers zijn beschikbaar in Fedora 11:
</div><div class="table" id="tabl-Security-Enhanced_Linux-Confined_and_Unconfined_Users-SELinux_User_Capabilities"><div class="table-contents"><table summary="SELinux gebruiker eigenschappen" border="1"><colgroup><col/><col/><col/><col/><col/><col/></colgroup><thead><tr><th>
Gebruiker
</th><th>
Domein
</th><th>
X Window systeem
</th><th>
su en sudo
</th><th>
Uitvoeren in persoonlijke map en /tmp/
</th><th>
Netwerken
</th></tr></thead><tbody><tr><td>
guest_u
</td><td>
guest_t
</td><td align="center">
nee
</td><td align="center">
nee
</td><td align="center">
optioneel
</td><td align="center">
nee
</td></tr><tr><td>
xguest_u
</td><td>
xguest_t
</td><td align="center">
ja
</td><td align="center">
nee
</td><td align="center">
optioneel
</td><td align="center">
alleen <span class="application"><strong>Firefox</strong></span>
</td></tr><tr><td>
user_u
</td><td>
user_t
</td><td align="center">
ja
</td><td align="center">
nee
</td><td align="center">
optioneel
</td><td align="center">
ja
</td></tr><tr><td>
staff_u
</td><td>
staff_t
</td><td align="center">
ja
</td><td align="center">
alleen <code class="command">sudo</code>
</td><td align="center">
optioneel
</td><td align="center">
ja
</td></tr></tbody></table></div><h6>Tabel 4.1. SELinux gebruiker eigenschappen</h6></div><br class="table-break"/><div class="itemizedlist"><ul><li><div class="para">
Linux gebruikers in de <code class="computeroutput">guest_t</code>, <code class="computeroutput">xguest_t</code>, en <code class="computeroutput">user_t</code> domeinen kunnen alleen set user ID (setuid) toepassingen draaien als SELinux tactiek dat toestaat (zoals <code class="command">passwd</code>). Ze kunnen de <code class="command">su</code> en <code class="command">/usr/bin/sudo</code> setuid toepassingen niet draaien, en kunnen daarom deze toepassingen niet gebruiken om de Linux root gebruiker te worden.
</div></li><li><div class="para">
Linux gebruikers in het <code class="computeroutput">guest_t</code> domein hebben geen netwerk toegang, en kunnen alleen inloggen met een terminal (inclusief <code class="systemitem">ssh</code>; ze kunnen inloggen met <code class="systemitem">ssh</code>, maar kunnen <code class="systemitem">ssh</code> niet gebruiken om te verbinden met andere systemen).
</div></li><li><div class="para">
De enigste netwerk toegang die Linux gebruikers in het <code class="computeroutput">xguest_t</code> domein hebben is om met <span class="application"><strong>Firefox</strong></span> te verbinden met web pagina's.
</div></li><li><div class="para">
Linux gebruikers in de <code class="computeroutput">xguest_t</code>, <code class="computeroutput">user_t</code> en <code class="computeroutput">staff_t</code> domeinen kunnen inloggen met het X Window systeem en een terminal.
</div></li><li><div class="para">
Standaard hebben Linux gebruikers in het <code class="computeroutput">staff_t</code> domein geen rechten om toepassingen met <code class="command">/usr/bin/sudo</code> uit te voeren. Deze rechten moeten ingesteld worden door een beheerder.
</div></li></ul></div><div class="para">
Standaard kunnen Linux gebruikers in de <code class="computeroutput">guest_t</code> en <code class="computeroutput">xguest_t</code> domeinen geen toepassingen in hun persoonlijke mappen of <code class="filename">/tmp/</code> uitvoeren, wat hun tegenhoudt om toepassingen op te starten (welke de rechten van de gebruiker erven) in mappen waartoe ze schrijftoegang hebben. Dit helpt om foutieve of kwaadwillige toepassingen te verhinderen om bestanden waarvan ze eigenaar zijn te veranderen.
</div><div class="para">
Standaard kunnen Linux gebruikers in de <code class="computeroutput">user_t</code> en <code class="computeroutput">staff_t</code> domeinen toepassingen in hun persoonlijke mappen en <code class="filename">/tmp/</code> uitvoeren. Refereer naar <a class="xref" href="sect-Security-Enhanced_Linux-Confining_Users-Booleans_for_Users_Executing_Applications.html" title="6.6. Booleans voor gebruikers die toepassingen uitvoeren">Paragraaf 6.6, “Booleans voor gebruikers die toepassingen uitvoeren”</a> voor informatie over het toestaan en tegenhouden van gebruikers om toepassingen in hun persoonlijke mappen en <code class="filename">/tmp/</code> uit te voeren.
</div></div><ul class="docnav"><li class="previous"><a accesskey="p" href="sect-Security-Enhanced_Linux-Targeted_Policy-Unconfined_Processes.html"><strong>Terug</strong>4.2. Onbeperkte processen</a></li><li class="up"><a accesskey="u" href="#"><strong>Omhoog</strong></a></li><li class="home"><a accesskey="h" href="index.html"><strong>Begin</strong></a></li><li class="next"><a accesskey="n" href="chap-Security-Enhanced_Linux-Working_with_SELinux.html"><strong>Volgende</strong>Hoofdstuk 5. Werken met SELinux</a></li></ul></body></html>
--- NEW FILE sect-Security-Enhanced_Linux-Targeted_Policy-Unconfined_Processes.html ---
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>4.2. Onbeperkte processen</title><link rel="stylesheet" href="./Common_Content/css/default.css" type="text/css"/><meta name="generator" content="publican"/><meta name="package" content="Fedora-Security-Enhanced_Linux-11-nl-NL-1.3-SELinux_User_guide"/><link rel="home" href="index.html" title="Security-Enhanced Linux"/><link rel="up" href="chap-Security-Enhanced_Linux-Targeted_Policy.html" title="Hoofdstuk 4. Gerichte tactiek"/><link rel="prev" href="chap-Security-Enhanced_Linux-Targeted_Policy.html" title="Hoofdstuk 4. Gerichte tactiek"/><link rel="next" href="sect-Security-Enhanced_Linux-Targeted_Policy-Confined_and_Unconfined_Users.html" title="4.3. Beperkte en onbeperkte gebruikers"/></head><body class=""><p id="title"><a class="left" href="http://www.fedoraproject.org"><img src="Common_Content/images/image_left.png" alt="Product Site"/></a><a class="right" href="http://docs.fedoraproject.org"><img src="Common_Content/
images/image_right.png" alt="Documentation Site"/></a></p><ul class="docnav"><li class="previous"><a accesskey="p" href="chap-Security-Enhanced_Linux-Targeted_Policy.html"><strong>Terug</strong></a></li><li class="next"><a accesskey="n" href="sect-Security-Enhanced_Linux-Targeted_Policy-Confined_and_Unconfined_Users.html"><strong>Volgende</strong></a></li></ul><div class="section" lang="nl-NL"><div class="titlepage"><div><div><h2 class="title" id="sect-Security-Enhanced_Linux-Targeted_Policy-Unconfined_Processes">4.2. Onbeperkte processen</h2></div></div></div><div class="para">
Onbeperkte processen draaien in onbeperkte domeien, bijvoorbeeld, init programma's draaien in het onbeperkte <code class="computeroutput">initrc_t</code> domein, onbeperkte kernel processen draaien in het <code class="computeroutput">kernel_t</code> domein, en onbeperkte Linux gebruikers draaien in het <code class="computeroutput">unconfined_t</code> domein. Voor onbeperkte processen worden SELinux tactiekregels toegepast, maar de bestaande tactiekregels staan processen die in onbeperkte domeinen draaien bijna alle toegang toe. Processen die draaien in onbeperkte domeinen vallen terug op het gebruik van alleen de DAC regels. Als een onbeperkt proces in gevaar wordt gebracht, verhindert SELinux een aanvaller niet om toegang te krijgen tot systeemhulpbronnen en data, maar de DAC regels worden natuurlijk nog gebruikt. SELinux is een beveiligingsverbetering boven op DAC regels - het vervangt deze niet.
</div><div class="para">
Het volgende voorbeeld laat zien hoe de Apache HTTP Server (<code class="systemitem">httpd</code>) als het onbeperkt draait toegang kan krijgen tot data die bedoeld is voor gebruik met Samba. Merk op: in Fedora 11 draait het <code class="systemitem">httpd</code> proces standaard in het beperkte <code class="computeroutput">httpd_t</code> domein. Dit is een voorbeeld en moet niet in een productieomgeving gebruikt worden. Het neemt aan dat de <span class="package">httpd</span>, <span class="package">wget</span>, <span class="package">setroubleshoot-server</span>, en <span class="package">audit</span> pakketten geinstalleerd zijn, dat de SELinux gerichte tactiek gebruikt wordt, en dat SELinux in de afdwingende modus is:
</div><div class="orderedlist"><ol><li><div class="para">
Voer het <code class="command">sestatus</code> commando uit om te bevestigen dat SELinux is aangezet, het draait in de afdwingende modus, en dat de gerichte tactiek wordt gebruikt:
</div><pre class="screen">$ /usr/sbin/sestatus
SELinux status: enabled
SELinuxfs mount: /selinux
Current mode: enforcing
Mode from config file: enforcing
Policy version: 23
Policy from config file: targeted
</pre><div class="para">
<code class="computeroutput">SELinux status: enabled</code> is returned when SELinux is enabled. <code class="computeroutput">Current mode: enforcing</code> is returned when SELinux is running in enforcing mode. <code class="computeroutput">Policy from config file: targeted</code> is returned when the SELinux targeted policy is used.
</div></li><li><div class="para">
Als de Linux root gebruikerm voer je het <code class="command">touch /var/www/html/test2file</code> commando uit om een bestand te maken.
</div></li><li><div class="para">
Voer het <code class="command">ls -Z /var/www/html/test2file</code> commando uit om de SELinux context te zien:
</div><pre class="screen">-rw-r--r-- root root unconfined_u:object_r:httpd_sys_content_t:s0 /var/www/html/test2file
</pre><div class="para">
Standaard draaien Linux gebruikers onbeperkt in Fedora 11, daarom is het <code class="filename">test2file</code> bestand gelabeld met de SELinux <code class="computeroutput">unconfined_u</code> gebruiker. RBAC wordt gebruikt voor processen, niet voor bestanden. Rollen hebben geen betekenis voor bestanden - de <code class="computeroutput">object_r</code> rol is een algemene rol gebruikt voor bestanden (op blijvende opslag en netwerkbestandssystemen). In de <code class="filename">/proc/</code> map, kunnen bestanden die gerelateerd zijn aan processen de <code class="computeroutput">system_r</code> rol gebruiken.<sup>[<a id="d0e1486" href="#ftn.d0e1486" class="footnote">7</a>]</sup> Het <code class="computeroutput">httpd_sys_content_t</code> type staat het <code class="systemitem">httpd</code> proces toe om toegang te krijgen tot dit bestand.
</div></li><li><div class="para">
Het <code class="command">chcon</code> commando herlabelt bestanden; zulke label veranderingen zullen echter niet blijven bestaan als het bestandssysteem opnieuw gelabeld wordt. Voor permanente veranderingen die een herlabeling van het bestandssysteem zullen overleven, gebruik je het <code class="command">semanage</code> commando, dat later besproken wordt. Als de Linux root gebruiker draai je het volgende commando om het type te veranderen naar een type dat door Samba gebruikt wordt:
</div><div class="para">
<code class="command">chcon -t samba_share_t /var/www/html/test2file</code>
</div><div class="para">
Voer het <code class="command">ls -Z /var/www/html/test2file</code> commando uit om de veranderingen te bekijken:
</div><pre class="screen">-rw-r--r-- root root unconfined_u:object_r:samba_share_t:s0 /var/www/html/test2file
</pre></li><li><div class="para">
Voer het <code class="command">service httpd status</code> commando uit om te bevestigen dat het <code class="systemitem">httpd</code> proces niet draait:
</div><pre class="screen">$ /sbin/service httpd status
httpd is stopped
</pre><div class="para">
Als de output anders is, voer je het <code class="command">service httpd stop</code> commando uit als de Linux root gebruiker om het <code class="systemitem">httpd</code> proces te stoppen:
</div><pre class="screen"># /sbin/service httpd stop
Stopping httpd: [ OK ]
</pre></li><li><div class="para">
Om het <code class="systemitem">httpd</code> proces onbeperkt te laten draaien, voer je het volgende commando uit als de Linux root gebruiker om het type van <code class="filename">/usr/sbin/httpd</code> te veranderen naar een type dat niet overgaat naar een beperkt domein:
</div><div class="para">
<code class="command">chcon -t unconfined_exec_t /usr/sbin/httpd</code>
</div></li><li><div class="para">
Voer het <code class="command">ls -Z /usr/sbin/httpd</code> commando uit om te bevestigen dat <code class="filename">/usr/sbin/httpd</code> is gelabeld met het <code class="computeroutput">unconfined_exec_t</code> type:
</div><pre class="screen">-rwxr-xr-x root root system_u:object_r:unconfined_exec_t /usr/sbin/httpd
</pre></li><li><div class="para">
Als de Linux root gebruiker, draai je het <code class="command">service httpd start</code> commando om het <code class="systemitem">httpd</code> proces te starten. Als <code class="systemitem">httpd</code> met succes opstart verschijnt de volgende output:
</div><pre class="screen"># /sbin/service httpd start
Starting httpd: [ OK ]
</pre></li><li><div class="para">
Voer het <code class="command">ps -eZ | grep httpd</code> commando uit om <code class="systemitem">httpd</code> te zien draaien in het <code class="computeroutput">unconfined_t</code> domein:
</div><pre class="screen">$ ps -eZ | grep httpd
unconfined_u:system_r:unconfined_t <em class="replaceable"><code>7721</code></em> ? 00:00:00 httpd
unconfined_u:system_r:unconfined_t <em class="replaceable"><code>7723</code></em> ? 00:00:00 httpd
unconfined_u:system_r:unconfined_t <em class="replaceable"><code>7724</code></em> ? 00:00:00 httpd
unconfined_u:system_r:unconfined_t <em class="replaceable"><code>7725</code></em> ? 00:00:00 httpd
unconfined_u:system_r:unconfined_t <em class="replaceable"><code>7726</code></em> ? 00:00:00 httpd
unconfined_u:system_r:unconfined_t <em class="replaceable"><code>7727</code></em> ? 00:00:00 httpd
unconfined_u:system_r:unconfined_t <em class="replaceable"><code>7728</code></em> ? 00:00:00 httpd
unconfined_u:system_r:unconfined_t <em class="replaceable"><code>7729</code></em> ? 00:00:00 httpd
unconfined_u:system_r:unconfined_t <em class="replaceable"><code>7730</code></em> ? 00:00:00 httpd
</pre></li><li><div class="para">
Ga naar een map waar jouw Linux gebruiker schrijfrechten heeft, en voer het <code class="command">wget http://localhost/test2file</code> commando uit. Behalve als er veranderingen in de standaard instelling gemaakt zijn, zal dit commando slagen:
</div><pre class="screen">--2009-05-07 01:41:10-- http://localhost/test2file
Resolving localhost... 127.0.0.1
Connecting to localhost|127.0.0.1|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 0 [text/plain]
Saving to: `test2file.1'
[ <=> ]--.-K/s in 0s
2009-05-07 01:41:10 (0.00 B/s) - `test2file.1' saved [0/0]
</pre><div class="para">
Hoewel het <code class="systemitem">httpd</code> proces geen toegang heeft tot bestanden gelabeld met het <code class="computeroutput">samba_share_t</code> type, draait <code class="systemitem">httpd</code> in het onbeperkte <code class="computeroutput">unconfined_t</code> domein, en valt terug op het gebruiken van DAC regels, en dus zal het <code class="command">wget</code> commando slagen. Als <code class="systemitem">httpd</code> in het beperkte <code class="computeroutput">httpd_t</code> domein had gedraaid, dan zou het <code class="command">wget</code> commando gefaald hebben.
</div></li><li><div class="para">
Het <code class="command">restorecon</code> commando herlaadt de standaard SELinux context voor bestanden. Als de Linux root gebruiker voet je het <code class="command">restorecon -v /usr/sbin/httpd</code> commando uit om de standaard SELinux context voor <code class="filename">/usr/sbin/httpd</code> te herladen:
</div><pre class="screen"># /sbin/restorecon -v /usr/sbin/httpd
restorecon reset /usr/sbin/httpd context system_u:object_r:unconfined_notrans_exec_t:s0->system_u:object_r:httpd_exec_t:s0
</pre><div class="para">
Voer het <code class="command">ls -Z /usr/sbin/httpd</code> commando uit om te bevestigen dat <code class="filename">/usr/sbin/httpd</code> is gelabeld met het <code class="computeroutput">httpd_exec_t</code> type:
</div><pre class="screen">$ ls -Z /usr/sbin/httpd
-rwxr-xr-x root root system_u:object_r:httpd_exec_t /usr/sbin/httpd
</pre></li><li><div class="para">
Als de Linux root gebruiker voer je het <code class="command">/sbin/service httpd restart</code> commando uit om <code class="systemitem">httpd</code> opnieuw te starten. Na het herstarten, voer je het <code class="command">ps -eZ | grep httpd</code> commando uit om te bevestigen dat <code class="systemitem">httpd</code> in het beperkte <code class="computeroutput">httpd_t</code> domein draait:
</div><pre class="screen"># /sbin/service httpd restart
Stopping httpd: [ OK ]
Starting httpd: [ OK ]
# ps -eZ | grep httpd
unconfined_u:system_r:httpd_t 8880 ? 00:00:00 httpd
unconfined_u:system_r:httpd_t 8882 ? 00:00:00 httpd
unconfined_u:system_r:httpd_t 8883 ? 00:00:00 httpd
unconfined_u:system_r:httpd_t 8884 ? 00:00:00 httpd
unconfined_u:system_r:httpd_t 8885 ? 00:00:00 httpd
unconfined_u:system_r:httpd_t 8886 ? 00:00:00 httpd
unconfined_u:system_r:httpd_t 8887 ? 00:00:00 httpd
unconfined_u:system_r:httpd_t 8888 ? 00:00:00 httpd
unconfined_u:system_r:httpd_t 8889 ? 00:00:00 httpd
</pre></li><li><div class="para">
Als de Linux root gebruiker voer je het <code class="command">rm -i /var/www/html/test2file</code> commando uit om <code class="filename">test2file</code> te verwijderen.
</div></li><li><div class="para">
Als het voor jou niet nodig is dat <code class="systemitem">httpd</code> draait, voer je als de Linux root gebruiker het <code class="command">service httpd stop</code> commando uit om <code class="systemitem">httpd</code> te stoppen:
</div><pre class="screen"># /sbin/service httpd stop
Stopping httpd: [ OK ]
</pre></li></ol></div><div class="para">
De voorbeelden in deze paragrafen laten zien hoe data kan worden beschermd voor een in gevaar gebracht beperkt proces (beschermd door SELinux), en ook hoe data beter bereikbaar is voor een aanvaller vanuit een in gevaar gebracht onbeperkt proces (niet beschermd door SELinux).
</div><div class="footnotes"><br/><hr/><div class="footnote"><p><sup>[<a id="ftn.d0e1486" href="#d0e1486" class="para">7</a>] </sup>
Als andere tactieken gebruikt worden, zoals MLS, kunnen andere rollen gebruikt worden, bijvoorbeeld, <code class="computeroutput">secadm_r</code>.
</p></div></div></div><ul class="docnav"><li class="previous"><a accesskey="p" href="chap-Security-Enhanced_Linux-Targeted_Policy.html"><strong>Terug</strong>Hoofdstuk 4. Gerichte tactiek</a></li><li class="up"><a accesskey="u" href="#"><strong>Omhoog</strong></a></li><li class="home"><a accesskey="h" href="index.html"><strong>Begin</strong></a></li><li class="next"><a accesskey="n" href="sect-Security-Enhanced_Linux-Targeted_Policy-Confined_and_Unconfined_Users.html"><strong>Volgende</strong>4.3. Beperkte en onbeperkte gebruikers</a></li></ul></body></html>
--- NEW FILE sect-Security-Enhanced_Linux-Top_Three_Causes_of_Problems-Evolving_Rules_and_Broken_Applications.html ---
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>7.2.3. Het ontwikkelen van regels en gebrekkige toepassingen</title><link rel="stylesheet" href="./Common_Content/css/default.css" type="text/css"/><meta name="generator" content="publican"/><meta name="package" content="Fedora-Security-Enhanced_Linux-11-nl-NL-1.3-SELinux_User_guide"/><link rel="home" href="index.html" title="Security-Enhanced Linux"/><link rel="up" href="sect-Security-Enhanced_Linux-Troubleshooting-Top_Three_Causes_of_Problems.html" title="7.2. De top drie oorzaken van problemen"/><link rel="prev" href="sect-Security-Enhanced_Linux-Top_Three_Causes_of_Problems-How_are_Confined_Services_Running.html" title="7.2.2. Hoe draaien beperkte services?"/><link rel="next" href="sect-Security-Enhanced_Linux-Troubleshooting-Fixing_Problems.html" title="7.3. Problemen herstellen"/></head><body class=""><p id="title"><a class="left" href="http://www.fedoraproject.org"><img src="Common_Content/images/image_left.png" a
lt="Product Site"/></a><a class="right" href="http://docs.fedoraproject.org"><img src="Common_Content/images/image_right.png" alt="Documentation Site"/></a></p><ul class="docnav"><li class="previous"><a accesskey="p" href="sect-Security-Enhanced_Linux-Top_Three_Causes_of_Problems-How_are_Confined_Services_Running.html"><strong>Terug</strong></a></li><li class="next"><a accesskey="n" href="sect-Security-Enhanced_Linux-Troubleshooting-Fixing_Problems.html"><strong>Volgende</strong></a></li></ul><div class="section" lang="nl-NL"><div class="titlepage"><div><div><h3 class="title" id="sect-Security-Enhanced_Linux-Top_Three_Causes_of_Problems-Evolving_Rules_and_Broken_Applications">7.2.3. Het ontwikkelen van regels en gebrekkige toepassingen</h3></div></div></div><div class="para">
Toepassingen kunnen gebreken hebben, wat veroorzaakt dat SELinux toegang weigert. Ook zijn SELinux regels in ontwikkeling - SELinux heeft misschien een applicatie niet op een bepaalde manier zien werken, en kan mogelijk toegang weigeren, zelfs als de toepassing werkt zoals verwacht. Bijvoorbeeld, als een nieuwe versie van PostgreSQL wordt vrijgegeven, kan deze acties uitvoeren die de huidige tactiek nog nooit heeft gezien, wat een toegangsweigering veroorzaakt, zelfs al zou de toegang toegestaan moeten worden.
</div><div class="para">
Voor deze situaties, als toegang is geweigerd, gebruik je <code class="command">audit2allow</code> om een aangepaste tactiek module te maken om toegang toe te staan. Refereer naar <a class="xref" href="sect-Security-Enhanced_Linux-Fixing_Problems-Allowing_Access_audit2allow.html" title="7.3.8. Toegang toestaan: audit2allow">Paragraaf 7.3.8, “Toegang toestaan: audit2allow”</a> voor informatie over het gebruik van <code class="command">audit2allow</code>.
</div></div><ul class="docnav"><li class="previous"><a accesskey="p" href="sect-Security-Enhanced_Linux-Top_Three_Causes_of_Problems-How_are_Confined_Services_Running.html"><strong>Terug</strong>7.2.2. Hoe draaien beperkte services?</a></li><li class="up"><a accesskey="u" href="#"><strong>Omhoog</strong></a></li><li class="home"><a accesskey="h" href="index.html"><strong>Begin</strong></a></li><li class="next"><a accesskey="n" href="sect-Security-Enhanced_Linux-Troubleshooting-Fixing_Problems.html"><strong>Volgende</strong>7.3. Problemen herstellen</a></li></ul></body></html>
--- NEW FILE sect-Security-Enhanced_Linux-Top_Three_Causes_of_Problems-How_are_Confined_Services_Running.html ---
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>7.2.2. Hoe draaien beperkte services?</title><link rel="stylesheet" href="./Common_Content/css/default.css" type="text/css"/><meta name="generator" content="publican"/><meta name="package" content="Fedora-Security-Enhanced_Linux-11-nl-NL-1.3-SELinux_User_guide"/><link rel="home" href="index.html" title="Security-Enhanced Linux"/><link rel="up" href="sect-Security-Enhanced_Linux-Troubleshooting-Top_Three_Causes_of_Problems.html" title="7.2. De top drie oorzaken van problemen"/><link rel="prev" href="sect-Security-Enhanced_Linux-Troubleshooting-Top_Three_Causes_of_Problems.html" title="7.2. De top drie oorzaken van problemen"/><link rel="next" href="sect-Security-Enhanced_Linux-Top_Three_Causes_of_Problems-Evolving_Rules_and_Broken_Applications.html" title="7.2.3. Het ontwikkelen van regels en gebrekkige toepassingen"/></head><body class=""><p id="title"><a class="left" href="http://www.fedoraproject.org"><img src="Common_
Content/images/image_left.png" alt="Product Site"/></a><a class="right" href="http://docs.fedoraproject.org"><img src="Common_Content/images/image_right.png" alt="Documentation Site"/></a></p><ul class="docnav"><li class="previous"><a accesskey="p" href="sect-Security-Enhanced_Linux-Troubleshooting-Top_Three_Causes_of_Problems.html"><strong>Terug</strong></a></li><li class="next"><a accesskey="n" href="sect-Security-Enhanced_Linux-Top_Three_Causes_of_Problems-Evolving_Rules_and_Broken_Applications.html"><strong>Volgende</strong></a></li></ul><div class="section" lang="nl-NL"><div class="titlepage"><div><div><h3 class="title" id="sect-Security-Enhanced_Linux-Top_Three_Causes_of_Problems-How_are_Confined_Services_Running">7.2.2. Hoe draaien beperkte services?</h3></div></div></div><div class="para">
Services kunnen op verschillende manieren gedraaid worden. Om hier rekening mee te houden moet je SELinux laten weten hoe je services draait. Dit kan bereikt worden met Booleans die toestaan dat onderdelen van SELinux tactiek veranderd worden tijdens het draaien, zonder enige kennis van het schrijven van SELinux tactiekregels. Dit staat veranderingen toe, zoals het toestaan aan services van toegang tot NFS bestandssystemen, zonder het herladen of hercompileren van SELinux tactiek. Ook vereisen services die draaien op niet-standaard poorten dat de tactiek configuratie vernieuwd wordt met het <code class="command">semanage</code> commando.
</div><div class="para">
Bijvoorbeeld, om de Apache HTTP server toe te staan te communiceren met MySQL, zet je de <code class="computeroutput">httpd_can_network_connect_db</code> Boolean aan:
</div><pre class="screen"># /usr/sbin/setsebool -P httpd_can_network_connect_db on
</pre><div class="para">
Als toegang geweigerd wordt voor een bepaalde service, gebruik je de <code class="command">getsebool</code> en <code class="command">grep</code> commando's om te zien of er Booleans beschikbaar zijn die toegang toestaan. Bijvoorbeeld, gebruik het <code class="command">getsebool -a | grep ftp</code> commando om te zoeken naar Booleans gerelateerd met FTP:
</div><pre class="screen">$ /usr/sbin/getsebool -a | grep ftp
allow_ftpd_anon_write --> off
allow_ftpd_full_access --> off
allow_ftpd_use_cifs --> off
allow_ftpd_use_nfs --> off
ftp_home_dir --> off
httpd_enable_ftp_server --> off
tftp_anon_write --> off
</pre><div class="para">
Voor een lijst met Booleans en te zien of ze aan of uit zijn, voer je het <code class="command">/usr/sbin/getsebool -a</code> commando uit. Voor een lijst met Booleans, en uitleg over wat ieder is, en of ze aan of uit zijn, voer je het <code class="command">/usr/sbin/semanage boolean -l</code> commando uit als de Linux root gebruiker. Refereer naar <a class="xref" href="sect-Security-Enhanced_Linux-Working_with_SELinux-Booleans.html" title="5.6. Booleans">Paragraaf 5.6, “Booleans”</a> voor informatie over het tonen en instellen van Booleans.
</div><div class="formalpara"><h5 class="formalpara" id="form-Security-Enhanced_Linux-How_are_Confined_Services_Running-Port_Numbers">Poort nummers</h5>
Afhankelijk van de tactiek instelling, is het aan services toegestaan om alleen maar op bepaalde poort nummers te draaien. Het proberen om de poort te veranderen waarop een service draait zonder het veranderen van tactiek kan als resultaat hebben dat de service niet start. Bijvoorbeeld, voer het <code class="command">semanage port -l | grep http</code> commando uit als de Linux root gebruiker om een lijst te zien van de aan <code class="systemitem">http</code> gerelateerde poorten:
</div><pre class="screen"># /usr/sbin/semanage port -l | grep http
http_cache_port_t tcp 3128, 8080, 8118
http_cache_port_t udp 3130
http_port_t tcp 80, 443, 488, 8008, 8009, 8443
pegasus_http_port_t tcp 5988
pegasus_https_port_t tcp 5989
</pre><div class="para">
Het <code class="computeroutput">http_port_t</code> poort type definieert de poorten waarnaar de Apache HTTP server kan luisteren, welke in dit geval zijn, de TCP poorten 80, 443, 488, 8008, 8009, en 8443. Als een beheerder <code class="filename">httpd.conf</code> zodanig instelt dat <code class="systemitem">httpd</code> luistert op poort 9876 (<code class="option">Listen 9876</code>), maar tactiek is niet vernieuwd om dit te weten, zal het <code class="command">service httpd start</code> commando falen:
</div><pre class="screen"># /sbin/service httpd start
Starting httpd: (13)Permission denied: make_sock: could not bind to address [::]:9876
(13)Permission denied: make_sock: could not bind to address 0.0.0.0:9876
no listening sockets available, shutting down
Unable to open logs
[FAILED]
</pre><div class="para">
Een SELinux weigering lijkend op de volgende wordt gelogd naar <code class="filename">/var/log/audit/audit.log</code>:
</div><pre class="screen">type=AVC msg=audit(1225948455.061:294): avc: denied { name_bind } for pid=4997 comm="httpd" src=9876 scontext=unconfined_u:system_r:httpd_t:s0 tcontext=system_u:object_r:port_t:s0 tclass=tcp_socket
</pre><div class="para">
Om <code class="systemitem">httpd</code> toe te staan te luisteren op een poort dat niet getoond wordt voor het <code class="computeroutput">http_port_t</code> poort type, voer je het <code class="command">semanage port</code> commando uit om een poort toe te voegen aan de tactiek configuratie<sup>[<a id="d0e5513" href="#ftn.d0e5513" class="footnote">15</a>]</sup>:
</div><pre class="screen"># /usr/sbin/semanage port -a -t http_port_t -p tcp 9876
</pre><div class="para">
De <code class="option">-a</code> optie voegt een nieuwe aantekening toe, de <code class="option">-t</code> optie definieert een type, en de <code class="option">-p</code> option definieert een protocol. Het laatste argument is het poortnummer dat toegevoegd moet worden.
</div><div class="footnotes"><br/><hr/><div class="footnote"><p><sup>[<a id="ftn.d0e5513" href="#d0e5513" class="para">15</a>] </sup>
Het <code class="command">semanage port -a</code> commando voegt een regle toe aan het <code class="filename">/etc/selinux/targeted/modules/active/ports.local</code> bestand. merk op: standaard kan dit bestand alleen bekeken worden door de Linux root gebruiker.
</p></div></div></div><ul class="docnav"><li class="previous"><a accesskey="p" href="sect-Security-Enhanced_Linux-Troubleshooting-Top_Three_Causes_of_Problems.html"><strong>Terug</strong>7.2. De top drie oorzaken van problemen</a></li><li class="up"><a accesskey="u" href="#"><strong>Omhoog</strong></a></li><li class="home"><a accesskey="h" href="index.html"><strong>Begin</strong></a></li><li class="next"><a accesskey="n" href="sect-Security-Enhanced_Linux-Top_Three_Causes_of_Problems-Evolving_Rules_and_Broken_Applications.html"><strong>Volgende</strong>7.2.3. Het ontwikkelen van regels en gebrekkige t...</a></li></ul></body></html>
--- NEW FILE sect-Security-Enhanced_Linux-Troubleshooting-Fixing_Problems.html ---
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>7.3. Problemen herstellen</title><link rel="stylesheet" href="./Common_Content/css/default.css" type="text/css"/><meta name="generator" content="publican"/><meta name="package" content="Fedora-Security-Enhanced_Linux-11-nl-NL-1.3-SELinux_User_guide"/><link rel="home" href="index.html" title="Security-Enhanced Linux"/><link rel="up" href="chap-Security-Enhanced_Linux-Troubleshooting.html" title="Hoofdstuk 7. Foutzoeken"/><link rel="prev" href="sect-Security-Enhanced_Linux-Top_Three_Causes_of_Problems-Evolving_Rules_and_Broken_Applications.html" title="7.2.3. Het ontwikkelen van regels en gebrekkige toepassingen"/><link rel="next" href="sect-Security-Enhanced_Linux-Fixing_Problems-Possible_Causes_of_Silent_Denials.html" title="7.3.2. Mogelijke oorzaken van stille weigeringen"/></head><body class=""><p id="title"><a class="left" href="http://www.fedoraproject.org"><img src="Common_Content/images/image_left.png" alt="Product
Site"/></a><a class="right" href="http://docs.fedoraproject.org"><img src="Common_Content/images/image_right.png" alt="Documentation Site"/></a></p><ul class="docnav"><li class="previous"><a accesskey="p" href="sect-Security-Enhanced_Linux-Top_Three_Causes_of_Problems-Evolving_Rules_and_Broken_Applications.html"><strong>Terug</strong></a></li><li class="next"><a accesskey="n" href="sect-Security-Enhanced_Linux-Fixing_Problems-Possible_Causes_of_Silent_Denials.html"><strong>Volgende</strong></a></li></ul><div class="section" lang="nl-NL"><div class="titlepage"><div><div><h2 class="title" id="sect-Security-Enhanced_Linux-Troubleshooting-Fixing_Problems">7.3. Problemen herstellen</h2></div></div></div><div class="para">
De volgende paragrafen helpen met foutzoek zaken. Ze behandelen: het controleren van Linux rechten, welke toegepast worden voor de SELinux regels; mogelijke oorzaken voor toegangsweigering door SELinux, waarvan geen details gelogd zijn; manual pagina's voor services, welke informatie bevatten over labeling en Booleans; toestemmende domeinen, om een proces toe te staan toestemmend te draaien, in plaats van het hele systeem; hoe te zoeken naar weigeringsbooschappen en hoe ze te bekijken; het analyseren van weigeringen; en het maken van aangepaste tactiek modules met <code class="command">audit2allow</code>.
</div><div class="section" lang="nl-NL"><div class="titlepage"><div><div><h3 class="title" id="sect-Security-Enhanced_Linux-Fixing_Problems-Linux_Permissions">7.3.1. Linux rechten</h3></div></div></div><div class="para">
Als toegang geweigerd wordt, controleer dan de standaard Linux rechten. Zoals genoemd in <a class="xref" href="chap-Security-Enhanced_Linux-Introduction.html" title="Hoofdstuk 2. Inleiding">Hoofdstuk 2, <i>Inleiding</i></a>, gebruiken de meeste operating systemen een Discretionary Access Control (DAC) (toegangscontrole naar goeddunken) systeem om toegang te controleren, welke gebruikers toestaat de rechten te controleren van bestanden waarvan ze eigenaar zijn. SELinux tactiekregels worden gecontroleerd na de DAC regels. SELinux tactiekregels worden niet gebruikt als de DAC regels als eerste toegang weigeren.
</div><div class="para">
Als toegang wordt geweigerd en er zijn geen SELinux weigeringen gelogd, gebruik je het <code class="command">ls -l</code> commando om de standaard Linux rechten te zien:
</div><pre class="screen">$ ls -l /var/www/html/index.html
-rw-r----- 1 root root 0 2009-05-07 11:06 index.html
</pre><div class="para">
In dit voorbeeld zijn de root gebruiker en groep eigenaar van <code class="filename">index.html</code>. De root gebruiker heeft lees en schrijf rechten (<code class="computeroutput">-rw</code>), en leden van de root groep hebben lees rechten (<code class="computeroutput">-r-</code>). Alle anderen hebben geen toegang (<code class="computeroutput">---</code>). Standaard laten zulke rechten niet toe dat <code class="systemitem">httpd</code> dit bestand leest. Om dit op te lossen, gebruik je het <code class="command">chown</code> commando om de eigenaar en de groep te veranderen. Dit commando moet uitgevoerd worden als de Linux root gebruiker:
</div><pre class="screen"># chown apache:apache /var/www/html/index.html
</pre><div class="para">
Dit neemt de standaard configuratie aan, waarin <code class="systemitem">httpd</code> draait als de Linux apache gebruiker. Als je <code class="systemitem">httpd</code> draait met een andere gebruiker, vervang je <code class="computeroutput">apache:apache</code> met die gebruiker.
</div><div class="para">
Refereer naar de <a href="http://fedoraproject.org/wiki/Docs/Drafts/AdministrationGuide/Permissions">Fedora Documentation Project "Permissions"</a> concept voor informatie over het beheren van Linux rechten.
</div></div></div><ul class="docnav"><li class="previous"><a accesskey="p" href="sect-Security-Enhanced_Linux-Top_Three_Causes_of_Problems-Evolving_Rules_and_Broken_Applications.html"><strong>Terug</strong>7.2.3. Het ontwikkelen van regels en gebrekkige t...</a></li><li class="up"><a accesskey="u" href="#"><strong>Omhoog</strong></a></li><li class="home"><a accesskey="h" href="index.html"><strong>Begin</strong></a></li><li class="next"><a accesskey="n" href="sect-Security-Enhanced_Linux-Fixing_Problems-Possible_Causes_of_Silent_Denials.html"><strong>Volgende</strong>7.3.2. Mogelijke oorzaken van stille weigeringen</a></li></ul></body></html>
--- NEW FILE sect-Security-Enhanced_Linux-Troubleshooting-Top_Three_Causes_of_Problems.html ---
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>7.2. De top drie oorzaken van problemen</title><link rel="stylesheet" href="./Common_Content/css/default.css" type="text/css"/><meta name="generator" content="publican"/><meta name="package" content="Fedora-Security-Enhanced_Linux-11-nl-NL-1.3-SELinux_User_guide"/><link rel="home" href="index.html" title="Security-Enhanced Linux"/><link rel="up" href="chap-Security-Enhanced_Linux-Troubleshooting.html" title="Hoofdstuk 7. Foutzoeken"/><link rel="prev" href="chap-Security-Enhanced_Linux-Troubleshooting.html" title="Hoofdstuk 7. Foutzoeken"/><link rel="next" href="sect-Security-Enhanced_Linux-Top_Three_Causes_of_Problems-How_are_Confined_Services_Running.html" title="7.2.2. Hoe draaien beperkte services?"/></head><body class=""><p id="title"><a class="left" href="http://www.fedoraproject.org"><img src="Common_Content/images/image_left.png" alt="Product Site"/></a><a class="right" href="http://docs.fedoraproject.org"><img sr
c="Common_Content/images/image_right.png" alt="Documentation Site"/></a></p><ul class="docnav"><li class="previous"><a accesskey="p" href="chap-Security-Enhanced_Linux-Troubleshooting.html"><strong>Terug</strong></a></li><li class="next"><a accesskey="n" href="sect-Security-Enhanced_Linux-Top_Three_Causes_of_Problems-How_are_Confined_Services_Running.html"><strong>Volgende</strong></a></li></ul><div class="section" lang="nl-NL"><div class="titlepage"><div><div><h2 class="title" id="sect-Security-Enhanced_Linux-Troubleshooting-Top_Three_Causes_of_Problems">7.2. De top drie oorzaken van problemen</h2></div></div></div><div class="para">
De volgende paragrafen beschrijven de top drie oorzaken van problemen: labelings problemen, het instellen van Booleans en poorten voor services, en het ontwikkelen van SELinux regels.
</div><div class="section" lang="nl-NL"><div class="titlepage"><div><div><h3 class="title" id="sect-Security-Enhanced_Linux-Top_Three_Causes_of_Problems-Labeling_Problems">7.2.1. Labelings problemen</h3></div></div></div><div class="para">
Op systemen die SELinux draaien worden alle processen en bestanden gelabeld met een label dat beveiligings relevante informatie bevat. Deze informatie wordt de SELinux context genoemd. Als deze labels verkeerd zijn, kan toegang geweigerd worden. Als een toepassing niet juist is gelabeld, kan het proces dat het voortbrengt een verkeerde label hebben, wat mogelijk veroorzaakt dat SELinux toegang weigert, en het proces is in staat om verkeerd gelabelde bestanden te maken.
</div><div class="para">
Een veel voorkomende oorzaak van labelings problemen is het gebruiken van een niet-standaard map voor een sevice. Bijvoorbeeld, in plaats van het gebruiken van <code class="filename">/var/www/html/</code> voor een website, wil een beheerder <code class="filename">/srv/myweb/</code> gebruiken. In Fedora 11 is de <code class="filename">/srv/</code> map gelabeld met het <code class="computeroutput">var_t</code> type. Bestanden en mappen aangemaakt in <code class="filename">/srv/</code> erven dit type. Ook kunnen nieuw aangemaakte top-niveau mappen (zoals <code class="filename">/myserver/</code>) gelabeld zijn met het <code class="computeroutput">default_t</code> type. SELinux belet de Apache HTTP server (<code class="systemitem">httpd</code>) toegang tot beide deze types. Om toegang toe te staan, moet SELinux weten dat de bestanden in <code class="filename">/srv/myweb/</code> toegankelijk moeten zijn voor <code class="systemitem">httpd</code>:
</div><pre class="screen"># /usr/sbin/semanage fcontext -a -t httpd_sys_content_t \
"/srv/myweb(/.*)?"
</pre><div class="para">
Dit <code class="command">semanage</code> commando voegt de context voor de <code class="filename">/srv/myweb/</code> map (en alle bestanden en mappen er in) toe aan de SELinux bestandscontext configuratie<sup>[<a id="d0e5351" href="#ftn.d0e5351" class="footnote">14</a>]</sup>. Het <code class="command">semanage</code> commando verandert de context niet. Als de Linux root gebruiker voer je het <code class="command">restorecon</code> commando uit om de veranderingen toe te passen:
</div><pre class="screen"># /sbin/restorecon -R -v /srv/myweb
</pre><div class="para">
Refereer naar <a class="xref" href="sect-Security-Enhanced_Linux-SELinux_Contexts_Labeling_Files-Persistent_Changes_semanage_fcontext.html" title="5.7.2. Permanente veranderingen: semanage fcontext">Paragraaf 5.7.2, “Permanente veranderingen: semanage fcontext”</a> voor meer informatie over het toevoegen van context aan de bestandscontext configuratie.
</div><div class="section" lang="nl-NL"><div class="titlepage"><div><div><h4 class="title" id="sect-Security-Enhanced_Linux-Labeling_Problems-What_is_the_Correct_Context">7.2.1.1. Wat is de juiste context?</h4></div></div></div><div class="para">
Het <code class="command">matchpathcon</code> commando controleert de context van een bestandspad en vergelijkt het met het standaard label voor dat pad. Het volgende voorbeeld laat het gebruik van <code class="command">matchpathcon</code> zien voor een map die verkeerd gelabelde bestanden bevat:
</div><pre class="screen">$ /usr/sbin/matchpathcon -V /var/www/html/*
/var/www/html/index.html has context unconfined_u:object_r:user_home_t:s0, should be system_u:object_r:httpd_sys_content_t:s0
/var/www/html/page1.html has context unconfined_u:object_r:user_home_t:s0, should be system_u:object_r:httpd_sys_content_t:s0
</pre><div class="para">
In dit voorbeeld zijn de <code class="filename">index.html</code> en <code class="filename">page1.html</code> bestanden gelabeld met het <code class="computeroutput">user_home_t</code> type. Dit type wordt gebruikt voor bestanden in persoonlijke mapen van gebruikers. Het gebruik van het <code class="command">mv</code> commando om bestanden te verplaatsen vanuit je persoonlijke map kan als gevolg hebben dat de bestanden gelabeld zijn met het <code class="computeroutput">user_home_t</code> type. Dit type moet niet bestaan buiten persoonlijke mappen. Gebruik het <code class="command">restorecon</code> commando om het correcte type van zulke bestanden te herstellen:
</div><pre class="screen"># /sbin/restorecon -v /var/www/html/index.html
restorecon reset /var/www/html/index.html context unconfined_u:object_r:user_home_t:s0->system_u:object_r:httpd_sys_content_t:s0
</pre><div class="para">
Om de constext voor alle bestanden in een map te herstellen, gebruik je de <code class="option">-R</code> optie:
</div><pre class="screen"># /sbin/restorecon -R -v /var/www/html/
restorecon reset /var/www/html/page1.html context unconfined_u:object_r:samba_share_t:s0->system_u:object_r:httpd_sys_content_t:s0
restorecon reset /var/www/html/index.html context unconfined_u:object_r:samba_share_t:s0->system_u:object_r:httpd_sys_content_t:s0
</pre><div class="para">
Refereer naar <a class="xref" href="sect-Security-Enhanced_Linux-Maintaining_SELinux_Labels_-Checking_the_Default_SELinux_Context.html" title="5.10.3. Het controleren van de standaard SELinux context">Paragraaf 5.10.3, “Het controleren van de standaard SELinux context”</a> voor een uigebreider voorbeeld van <code class="command">matchpathcon</code>.
</div></div></div><div class="footnotes"><br/><hr/><div class="footnote"><p><sup>[<a id="ftn.d0e5351" href="#d0e5351" class="para">14</a>] </sup>
Bestanden in<code class="filename">/etc/selinux/targeted/contexts/files/</code> definieren context voor bestanden en mappen. Bestanden in deze map worden gelezen door <code class="command">restorecon</code> en <code class="command">setfiles</code> om de standaard context van bestanden en mappen te herstellen.
</p></div></div></div><ul class="docnav"><li class="previous"><a accesskey="p" href="chap-Security-Enhanced_Linux-Troubleshooting.html"><strong>Terug</strong>Hoofdstuk 7. Foutzoeken</a></li><li class="up"><a accesskey="u" href="#"><strong>Omhoog</strong></a></li><li class="home"><a accesskey="h" href="index.html"><strong>Begin</strong></a></li><li class="next"><a accesskey="n" href="sect-Security-Enhanced_Linux-Top_Three_Causes_of_Problems-How_are_Confined_Services_Running.html"><strong>Volgende</strong>7.2.2. Hoe draaien beperkte services?</a></li></ul></body></html>
--- NEW FILE sect-Security-Enhanced_Linux-Working_with_SELinux-Booleans.html ---
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>5.6. Booleans</title><link rel="stylesheet" href="./Common_Content/css/default.css" type="text/css"/><meta name="generator" content="publican"/><meta name="package" content="Fedora-Security-Enhanced_Linux-11-nl-NL-1.3-SELinux_User_guide"/><link rel="home" href="index.html" title="Security-Enhanced Linux"/><link rel="up" href="chap-Security-Enhanced_Linux-Working_with_SELinux.html" title="Hoofdstuk 5. Werken met SELinux"/><link rel="prev" href="sect-Security-Enhanced_Linux-Working_with_SELinux-SELinux_Modes.html" title="5.5. SELinux modes"/><link rel="next" href="sect-Security-Enhanced_Linux-Booleans-Configuring_Booleans.html" title="5.6.2. Booleans instellen"/></head><body class=""><p id="title"><a class="left" href="http://www.fedoraproject.org"><img src="Common_Content/images/image_left.png" alt="Product Site"/></a><a class="right" href="http://docs.fedoraproject.org"><img src="Common_Content/images/image_right.png" al
t="Documentation Site"/></a></p><ul class="docnav"><li class="previous"><a accesskey="p" href="sect-Security-Enhanced_Linux-Working_with_SELinux-SELinux_Modes.html"><strong>Terug</strong></a></li><li class="next"><a accesskey="n" href="sect-Security-Enhanced_Linux-Booleans-Configuring_Booleans.html"><strong>Volgende</strong></a></li></ul><div class="section" lang="nl-NL"><div class="titlepage"><div><div><h2 class="title" id="sect-Security-Enhanced_Linux-Working_with_SELinux-Booleans">5.6. Booleans</h2></div></div></div><div class="para">
Booleans staan toe dat onderdelen van SELinux tactiek veranderd worden tijdens het draaien, zonder dat enige kennis nodig is over het schrijven van SELinux tactiek. Dit staat toe om veranderingen te maken, zoals het toestaan van services toegang tot NFS bestandssystemen, zonder het herladen of hercompileren van SELinux tactiek.
</div><div class="section" lang="nl-NL"><div class="titlepage"><div><div><h3 class="title" id="sect-Security-Enhanced_Linux-Booleans-Listing_Booleans">5.6.1. Booleans laten zien</h3></div></div></div><div class="para">
Voor een lijst van Booleans, een uitleg over wat ze zijn, en of ze aan of uit zijn, voer je het <code class="command">semanage boolean -l</code> commando uit als de Linux root gebruiker. Het volgende voorbeeld laat niet alle Booleans zien:
</div><pre class="screen"># /usr/sbin/semanage boolean -l
SELinux boolean Description
ftp_home_dir -> off Allow ftp to read and write files in the user home directories
xen_use_nfs -> off Allow xen to manage nfs files
xguest_connect_network -> on Allow xguest to configure Network Manager
</pre><div class="para">
De <code class="computeroutput">SELinux boolean</code> kolom laat de lijst van Boolean namen zien. De <code class="computeroutput">Description</code> kolom laat zien of de Booleans aan of uit zijn, en wat ze doen.
</div><div class="para">
In het volgende voorbeeld, is de <code class="computeroutput">ftp_home_dir</code> Boolean uit, dit belet de FTP daemon (<code class="systemitem">vsftpd</code>) om bestanden in de persoonlijke mappen van de gebruiker te lezen of te schrijven:
</div><pre class="screen">ftp_home_dir -> off Allow ftp to read and write files in the user home directories
</pre><div class="para">
Het <code class="command">getsebool -a</code> commando laat een lijst zien van de Booleans, of ze nu aan of uit zijn, maar geeft geen beschrijving van elke Boolean. Het volgende voorbeeld laat niet alle Booleans zien:
</div><pre class="screen">$ /usr/sbin/getsebool -a
allow_console_login --> off
allow_cvs_read_shadow --> off
allow_daemons_dump_core --> on
</pre><div class="para">
Voer het <code class="command">getsebool <em class="replaceable"><code>boolean-naam</code></em></code> commando uit om alleen de status van de <em class="replaceable"><code>boolean-naam</code></em> Boolean te laten zien:
</div><pre class="screen">$ /usr/sbin/getsebool allow_console_login
allow_console_login --> off
</pre><div class="para">
Gebruik een met spaties gescheiden lijst om meerdere Booleans te laten zien:
</div><pre class="screen">$ getsebool allow_console_login allow_cvs_read_shadow allow_daemons_dump_core
allow_console_login --> off
allow_cvs_read_shadow --> off
allow_daemons_dump_core --> on
</pre></div></div><ul class="docnav"><li class="previous"><a accesskey="p" href="sect-Security-Enhanced_Linux-Working_with_SELinux-SELinux_Modes.html"><strong>Terug</strong>5.5. SELinux modes</a></li><li class="up"><a accesskey="u" href="#"><strong>Omhoog</strong></a></li><li class="home"><a accesskey="h" href="index.html"><strong>Begin</strong></a></li><li class="next"><a accesskey="n" href="sect-Security-Enhanced_Linux-Booleans-Configuring_Booleans.html"><strong>Volgende</strong>5.6.2. Booleans instellen</a></li></ul></body></html>
--- NEW FILE sect-Security-Enhanced_Linux-Working_with_SELinux-Enabling_and_Disabling_SELinux.html ---
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>5.4. SELinux aanzetten en uitzetten</title><link rel="stylesheet" href="./Common_Content/css/default.css" type="text/css"/><meta name="generator" content="publican"/><meta name="package" content="Fedora-Security-Enhanced_Linux-11-nl-NL-1.3-SELinux_User_guide"/><link rel="home" href="index.html" title="Security-Enhanced Linux"/><link rel="up" href="chap-Security-Enhanced_Linux-Working_with_SELinux.html" title="Hoofdstuk 5. Werken met SELinux"/><link rel="prev" href="sect-Security-Enhanced_Linux-Working_with_SELinux-Main_Configuration_File.html" title="5.3. Het hoofd configuratie bestand"/><link rel="next" href="sect-Security-Enhanced_Linux-Enabling_and_Disabling_SELinux-Disabling_SELinux.html" title="5.4.2. SELinux uitzetten"/></head><body class=""><p id="title"><a class="left" href="http://www.fedoraproject.org"><img src="Common_Content/images/image_left.png" alt="Product Site"/></a><a class="right" href="http://docs.fed
oraproject.org"><img src="Common_Content/images/image_right.png" alt="Documentation Site"/></a></p><ul class="docnav"><li class="previous"><a accesskey="p" href="sect-Security-Enhanced_Linux-Working_with_SELinux-Main_Configuration_File.html"><strong>Terug</strong></a></li><li class="next"><a accesskey="n" href="sect-Security-Enhanced_Linux-Enabling_and_Disabling_SELinux-Disabling_SELinux.html"><strong>Volgende</strong></a></li></ul><div class="section" lang="nl-NL"><div class="titlepage"><div><div><h2 class="title" id="sect-Security-Enhanced_Linux-Working_with_SELinux-Enabling_and_Disabling_SELinux">5.4. SELinux aanzetten en uitzetten</h2></div></div></div><div class="para">
Gebruik de <code class="command">/usr/sbin/getenforce</code> of <code class="command">/usr/sbin/sestatus</code> commando's om de status van SELinux te controleren. Het <code class="command">getenforce</code> commando geeft <code class="computeroutput">Enforcing</code>, <code class="computeroutput">Permissive</code>, of <code class="computeroutput">Disabled</code> terug. Het <code class="command">getenforce</code> geeft <code class="computeroutput">Enforcing</code> terug als SELinux is aangezet (SELinux tactiekregels zijn afgedwongen):
</div><pre class="screen">$ /usr/sbin/getenforce
Enforcing
</pre><div class="para">
Het <code class="command">getenforce</code> commando geeft <code class="computeroutput">Permissive</code> terug als SELinux is aangezet, maar SELinux tactiekregels worden niet afgedwongen, en alleen DAC regels worden gebruikt. Het <code class="command">getenforce</code> commando geeft <code class="computeroutput">Disabled</code> terug als SELinux is uitgezet.
</div><div class="para">
Het <code class="command">sestatus</code> commando geeft de SELinux status en de gebruikte SELinux tactiek terug:
</div><pre class="screen">$ /usr/sbin/sestatus
SELinux status: enabled
SELinuxfs mount: /selinux
Current mode: enforcing
Mode from config file: enforcing
Policy version: 23
Policy from config file: targeted
</pre><div class="para">
<code class="computeroutput">SELinux status: enabled</code> is returned when SELinux is enabled. <code class="computeroutput">Current mode: enforcing</code> is returned when SELinux is running in enforcing mode. <code class="computeroutput">Policy from config file: targeted</code> is returned when the SELinux targeted policy is used.
</div><div class="section" lang="nl-NL"><div class="titlepage"><div><div><h3 class="title" id="sect-Security-Enhanced_Linux-Enabling_and_Disabling_SELinux-Enabling_SELinux">5.4.1. SELinux aanzetten</h3></div></div></div><div class="para">
Op systemen waar SELinux is uitgezet, is de <code class="computeroutput">SELINUX=disabled</code> optie ingesteld in <code class="filename">/etc/selinux/config</code>:
</div><pre class="screen"># This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - No SELinux policy is loaded.
SELINUX=disabled
# SELINUXTYPE= can take one of these two values:
# targeted - Targeted processes are protected,
# mls - Multi Level Security protection.
SELINUXTYPE=targeted
</pre><div class="para">
Dus het <code class="command">getenforce</code> commando geeft <code class="computeroutput">Disabled</code> terug:
</div><pre class="screen">$ /usr/sbin/getenforce
Disabled
</pre><div class="para">
Om SELinux aan te zetten:
</div><div class="orderedlist"><ol><li><div class="para">
Gebruik de <code class="command">rpm -qa | grep selinux</code>, <code class="command">rpm -q policycoreutils</code>, en <code class="command">rpm -qa | grep setroubleshoot</code> commando's om te bevestigen dat de SELinux pakketten geinstalleerd zijn. Deze gids neemt aan dat de volgende pakketten geinstalleerd zijn: <span class="package">selinux-policy-targeted</span>, <span class="package">selinux-policy</span>, <span class="package">libselinux</span>, <span class="package">libselinux-python</span>, <span class="package">libselinux-utils</span>, <span class="package">policycoreutils</span>, <span class="package">setroubleshoot</span>, <span class="package">setroubleshoot-server</span> en <span class="package">setroubleshoot-plugins</span>. Als deze pakketten niet geinstalleerd zijn, installeer je ze als de Linux root gebruiker met het <code class="command">yum install <em class="replaceable"><code>pakket-naam</code></em></code> commando. De volgende pakketten zijn opti
oneel: <span class="package">policycoreutils-gui</span>, <span class="package">setroubleshoot</span>, <span class="package">selinux-policy-devel</span>, en <span class="package">mcstrans</span>.
</div><div class="para">
Na het installeren van het <span class="package">setroubleshoot-server</span> pakket, gebruik je het <code class="command">/sbin/chkconfig --list setroubleshoot</code> commando om te bevestigen dat <code class="systemitem">setroubleshootd</code> opstart als het systeem draait in runlevel<sup>[<a id="d0e2507" href="#ftn.d0e2507" class="footnote">10</a>]</sup> 3, 4, en 5:
</div><pre class="screen">$ /sbin/chkconfig --list setroubleshoot
setroubleshoot 0:off 1:off 2:off 3:on 4:on 5:on 6:off
</pre><div class="para">
Als de output anders is, voer je als de Linux root gebruiker het <code class="command">/sbin/chkconfig --levels 345 setroubleshoot on</code> commando uit. Hierdoor start <code class="systemitem">setroubleshootd</code> automatisch op als het systeem in runlevel 3, 4, en 5 draait.
</div></li><li><div class="para">
Voordat SELinux wordt aangezet, moet elk bestand in het bestandssysteem gelabeld worden met een SELinux context. Voordat dit gebeurt, kunnen beperkte domeinen toegang geweigerd worden, wat je systeem ervan weerhoudt om correct op te starten. Om dit te voorkomen, configureer je <code class="computeroutput">SELINUX=permissive</code> in <code class="filename">/etc/selinux/config</code>:
</div><pre class="screen"># This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - No SELinux policy is loaded.
SELINUX=permissive
# SELINUXTYPE= can take one of these two values:
# targeted - Targeted processes are protected,
# mls - Multi Level Security protection.
SELINUXTYPE=targeted
</pre></li><li><div class="para">
Als de Linux root gebruiker voer je het <code class="command">reboot</code> commando uit om het systeem opnieuw op te starten. Tijdens de volgende start worden de bestandssystemen gelabeld. Het label proces labelt alle bestanden met een SELinux context:
</div><pre class="screen">*** Warning -- SELinux targeted policy relabel is required.
*** Relabeling could take a very long time, depending on file
*** system size and speed of hard drives.
****
</pre><div class="para">
Elke <code class="computeroutput">*</code> karakter in de onderste regel representeerd 1000 bestanden die gelabeld zijn. In het bovenstaande voorbeeld, representeren vier <code class="computeroutput">*</code> karakters 4000 bestanden die gelabeld zijn. De tijd die het duurt om alle bestanden te labelen hangt af van het aantal bestanden op het systeem, en de snelheid van de harde schijf stations. Op moderne systemen kan dit proces 10 minuten duren.
</div></li><li><div class="para">
In de toelatende modus, wordt SELinux tactiek niet afgedwongen, maar weigeringen worden nog steeds gelogd voor acties die geweigerd zouden zijn als het systeem in de afdwingende modus zou draaien. Voordat je verandert naar de afdwingende modus, voer je als de Linux root gebruiker het <code class="command">grep "SELinux is preventing" /var/log/messages</code> commando uit om te bevestigen dat SELinux geen acties heeft geweigerd tijdens het laatste opstarten. Als SELinux geen acties heeft geweigerd tijdens het laatste opstarten, geeft dit commando geen output terug. Refereer naar <a class="xref" href="chap-Security-Enhanced_Linux-Troubleshooting.html" title="Hoofdstuk 7. Foutzoeken">Hoofdstuk 7, <i>Foutzoeken</i></a> voor foutzoek informatie als SELinux toegang heeft geweigerd tijdens het opstarten.
</div></li><li><div class="para">
Als er geen weigeringsboodschappen in <code class="filename">/var/log/messages</code> waren, configureer je <code class="computeroutput">SELINUX=enforcing</code> in <code class="filename">/etc/selinux/config</code>:
</div><pre class="screen"># This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - No SELinux policy is loaded.
SELINUX=enforcing
# SELINUXTYPE= can take one of these two values:
# targeted - Targeted processes are protected,
# mls - Multi Level Security protection.
SELINUXTYPE=targeted
</pre></li><li><div class="para">
Start je systeem opnieuw op. Na het opstarten, bevestig je dat het <code class="command">getenforce</code> commando <code class="computeroutput">Enforcing</code> terug geeft:
</div><pre class="screen">$ /usr/sbin/getenforce
Enforcing
</pre></li><li><div class="para">
Als de Linux root gebruiker voer je het <code class="command">/usr/sbin/semanage login -l</code> commando uit op de afbeelding tussen SELinux en Linux gebruikers te bekijken. De output moet als volgt zijn:
</div><pre class="screen">Login Name SELinux User MLS/MCS Range
__default__ unconfined_u s0-s0:c0.c1023
root unconfined_u s0-s0:c0.c1023
system_u system_u s0-s0:c0.c1023
</pre></li></ol></div><div class="para">
Als dit niet het geval is, voer je als de Linux root gebruiker de volgende commando's uit om de gebruikersafbeeldingen te herstellen. Het is veilig om de <code class="computeroutput">SELinux-user<em class="replaceable"><code> gebruikersnaam</code></em> is already defined</code> waarschuwingen te negeren als ze voorkomen, waarin <em class="replaceable"><code>gebruikersnaam</code></em> <code class="computeroutput">unconfined_u</code>, <code class="computeroutput">guest_u</code>, of <code class="computeroutput">xguest_u</code> kan zijn:
</div><div class="orderedlist"><ol><li><div class="para">
<pre class="screen">/usr/sbin/semanage user -a -S targeted -P user -R "unconfined_r system_r" -r s0-s0:c0.c1023 unconfined_u
</pre>
</div></li><li><div class="para">
<pre class="screen">/usr/sbin/semanage login -m -S targeted -s "unconfined_u" -r s0-s0:c0.c1023 __default__
</pre>
</div></li><li><div class="para">
<pre class="screen">/usr/sbin/semanage login -m -S targeted -s "unconfined_u" -r s0-s0:c0.c1023 root
</pre>
</div></li><li><div class="para">
<pre class="screen">/usr/sbin/semanage user -a -S targeted -P user -R guest_r guest_u
</pre>
</div></li><li><div class="para">
<pre class="screen">/usr/sbin/semanage user -a -S targeted -P user -R xguest_r xguest_u
</pre>
</div></li></ol></div><div class="important"><h2>Belangrijk</h2><div class="para">
Als systemen draaien in de toelatende of uitgezette modes, hebben gebruikers toestemming om bestanden verkeerd te labelen. Ook worden bestanden aangemaakt terwijl SELinux uitgezet is niet gelabeld. Dit veroorzaakt problemen als daarna de modus naar afdwingend wordt veranderd. Om te voorkomen dat verkeerd gelabelde of niet gelabelde bestanden problemen veroorzaken, worden bestandssystemen automatisch geherlabeld als de modus verandert van uitgezet naar de toelatende of afdwingende modus.
</div></div></div><div class="footnotes"><br/><hr/><div class="footnote"><p><sup>[<a id="ftn.d0e2507" href="#d0e2507" class="para">10</a>] </sup>
Refereer naar <a href="http://en.wikipedia.org/wiki/Runlevel">http://en.wikipedia.org/wiki/Runlevel</a> voor informatie over runlevels.
</p></div></div></div><ul class="docnav"><li class="previous"><a accesskey="p" href="sect-Security-Enhanced_Linux-Working_with_SELinux-Main_Configuration_File.html"><strong>Terug</strong>5.3. Het hoofd configuratie bestand</a></li><li class="up"><a accesskey="u" href="#"><strong>Omhoog</strong></a></li><li class="home"><a accesskey="h" href="index.html"><strong>Begin</strong></a></li><li class="next"><a accesskey="n" href="sect-Security-Enhanced_Linux-Enabling_and_Disabling_SELinux-Disabling_SELinux.html"><strong>Volgende</strong>5.4.2. SELinux uitzetten</a></li></ul></body></html>
--- NEW FILE sect-Security-Enhanced_Linux-Working_with_SELinux-Main_Configuration_File.html ---
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>5.3. Het hoofd configuratie bestand</title><link rel="stylesheet" href="./Common_Content/css/default.css" type="text/css"/><meta name="generator" content="publican"/><meta name="package" content="Fedora-Security-Enhanced_Linux-11-nl-NL-1.3-SELinux_User_guide"/><link rel="home" href="index.html" title="Security-Enhanced Linux"/><link rel="up" href="chap-Security-Enhanced_Linux-Working_with_SELinux.html" title="Hoofdstuk 5. Werken met SELinux"/><link rel="prev" href="sect-Security-Enhanced_Linux-Working_with_SELinux-Which_Log_File_is_Used.html" title="5.2. Welk log bestand wordt gebruikt"/><link rel="next" href="sect-Security-Enhanced_Linux-Working_with_SELinux-Enabling_and_Disabling_SELinux.html" title="5.4. SELinux aanzetten en uitzetten"/></head><body class=""><p id="title"><a class="left" href="http://www.fedoraproject.org"><img src="Common_Content/images/image_left.png" alt="Product Site"/></a><a class="right" href="h
ttp://docs.fedoraproject.org"><img src="Common_Content/images/image_right.png" alt="Documentation Site"/></a></p><ul class="docnav"><li class="previous"><a accesskey="p" href="sect-Security-Enhanced_Linux-Working_with_SELinux-Which_Log_File_is_Used.html"><strong>Terug</strong></a></li><li class="next"><a accesskey="n" href="sect-Security-Enhanced_Linux-Working_with_SELinux-Enabling_and_Disabling_SELinux.html"><strong>Volgende</strong></a></li></ul><div class="section" lang="nl-NL"><div class="titlepage"><div><div><h2 class="title" id="sect-Security-Enhanced_Linux-Working_with_SELinux-Main_Configuration_File">5.3. Het hoofd configuratie bestand</h2></div></div></div><div class="para">
Het <code class="filename">/etc/selinux/config</code> bestand is het hoofd SELinux configuratie bestand. Het controleert de SELinux modus en de te gebruiken SELinux tactiek:
</div><pre class="screen"># This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - No SELinux policy is loaded.
SELINUX=enforcing
# SELINUXTYPE= can take one of these two values:
# targeted - Targeted processes are protected,
# mls - Multi Level Security protection.
SELINUXTYPE=targeted
</pre><div class="variablelist"><dl><dt><span class="term"><code class="computeroutput">SELINUX=enforcing (afdwingend)</code></span></dt><dd><div class="para">
De <code class="option">SELINUX</code> optie stelt de modus in waarin SELinux draait. SELinux heeft drie modes: enforcing (afdwingend), permissive (toelatend), en disabled (uitgezet). Als de afdwingende modus gebruikt wordt, wordt de SELinux tactiek afgedwongen, en SELinux verbiedt toegang gebaseerd op SELinux tactiekregels. Weigeringsboodschappen worden gelogd. Als de toelatende modus gebruikt wordt, wordt de SELinux tactiek niet afgedwongen. SELinux verbiedt geen toegang, maar weigeringen voor acties die geweigerd zouden zijn als SELinux in de afdwingende modus zou zijn, worden gelogd. In de uitgezette modus, is SELinux uitgezet (de SELinux module wordt niet registreerd bij de Linux kernel), en alleen DAC regels worden gebruikt.
</div></dd><dt><span class="term"><code class="computeroutput">SELINUXTYPE=targeted (gericht)</code></span></dt><dd><div class="para">
De <code class="option">SELINUXTYPE</code> optie stelt de te gebruiken SELinux tactiek in. Gerichte tactiek is de standaard tactiek. Verander deze optie alleen als je de MLS tactiek wilt gebruiken. Om de MLS tactiek te gebruiken, installeer je het <span class="package">selinux-policy-mls</span> pakket, je configureert <code class="option">SELINUXTYPE=mls</code> in <code class="filename">/etc/selinux/config</code>; en je start je systeem opnieuw op.
</div></dd></dl></div><div class="important"><h2>Belangrijk</h2><div class="para">
Als systemen draaien in de toelatende of uitgezette modes, hebben gebruikers toestemming om bestanden verkeerd te labelen. Ook worden bestanden aangemaakt terwijl SELinux uitgezet is niet gelabeld. Dit veroorzaakt problemen als daarna de modus naar afdwingend wordt veranderd. Om te voorkomen dat verkeerd gelabelde of niet gelabelde bestanden problemen veroorzaken, worden bestandssystemen automatisch geherlabeld als de modus verandert van uitgezet naar de toelatende of afdwingende modus.
</div></div></div><ul class="docnav"><li class="previous"><a accesskey="p" href="sect-Security-Enhanced_Linux-Working_with_SELinux-Which_Log_File_is_Used.html"><strong>Terug</strong>5.2. Welk log bestand wordt gebruikt</a></li><li class="up"><a accesskey="u" href="#"><strong>Omhoog</strong></a></li><li class="home"><a accesskey="h" href="index.html"><strong>Begin</strong></a></li><li class="next"><a accesskey="n" href="sect-Security-Enhanced_Linux-Working_with_SELinux-Enabling_and_Disabling_SELinux.html"><strong>Volgende</strong>5.4. SELinux aanzetten en uitzetten</a></li></ul></body></html>
--- NEW FILE sect-Security-Enhanced_Linux-Working_with_SELinux-Maintaining_SELinux_Labels_.html ---
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>5.10. Het onderhouden van SELinux labels</title><link rel="stylesheet" href="./Common_Content/css/default.css" type="text/css"/><meta name="generator" content="publican"/><meta name="package" content="Fedora-Security-Enhanced_Linux-11-nl-NL-1.3-SELinux_User_guide"/><link rel="home" href="index.html" title="Security-Enhanced Linux"/><link rel="up" href="chap-Security-Enhanced_Linux-Working_with_SELinux.html" title="Hoofdstuk 5. Werken met SELinux"/><link rel="prev" href="sect-Security-Enhanced_Linux-Mounting_File_Systems-Making_Context_Mounts_Persistent.html" title="5.9.5. Maak de context aankoppelingen blijvend"/><link rel="next" href="sect-Security-Enhanced_Linux-Maintaining_SELinux_Labels_-Moving_Files_and_Directories.html" title="5.10.2. Bestanden en mappen verplaatsen"/></head><body class=""><p id="title"><a class="left" href="http://www.fedoraproject.org"><img src="Common_Content/images/image_left.png" alt="Product
Site"/></a><a class="right" href="http://docs.fedoraproject.org"><img src="Common_Content/images/image_right.png" alt="Documentation Site"/></a></p><ul class="docnav"><li class="previous"><a accesskey="p" href="sect-Security-Enhanced_Linux-Mounting_File_Systems-Making_Context_Mounts_Persistent.html"><strong>Terug</strong></a></li><li class="next"><a accesskey="n" href="sect-Security-Enhanced_Linux-Maintaining_SELinux_Labels_-Moving_Files_and_Directories.html"><strong>Volgende</strong></a></li></ul><div class="section" lang="nl-NL"><div class="titlepage"><div><div><h2 class="title" id="sect-Security-Enhanced_Linux-Working_with_SELinux-Maintaining_SELinux_Labels_">5.10. Het onderhouden van SELinux labels </h2></div></div></div><div class="para">
Deze paragrafen behandelen wat er gebeurt met SELinux context tijdens het kopiëren, verplaatsen, en archiveren van bestanden en mappen. Ze leggen ook uit hoe je de context kunt behouden tijdens het kopiëren en archiveren.
</div><div class="section" lang="nl-NL"><div class="titlepage"><div><div><h3 class="title" id="sect-Security-Enhanced_Linux-Maintaining_SELinux_Labels_-Copying_Files_and_Directories">5.10.1. Bestanden en mappen kopiëren</h3></div></div></div><div class="para">
Als een bestand of map wordt gekopieerd, wordt een nieuw bestand of map aangemaakt als het nog niet bestaat. De context van dat nieuwe bestand of map is gebaseerd op standaard labelingregels, en niet de context van het originele bestand of map (behalve als er opties zijn gebruikt om de originele context te behouden). Bijvoorbeeld, bestanden aangemaakt in de persoonlijke mappen van de gebruiker worden gelabeld met het <code class="computeroutput">user_home_t</code> type:
</div><pre class="screen">$ touch file1
$ ls -Z file1
-rw-rw-r-- user1 group1 unconfined_u:object_r:user_home_t:s0 file1
</pre><div class="para">
Als zo'n bestand gekopieerd wordt naar een andere map, zoals <code class="filename">/etc/</code>, wordt het nieuwe bestand aangemaakt overeenkomstig de standaard labelingsregels voor de <code class="filename">/etc/</code> map. Een bestand kopiëren (zonder extra opties) hoeft de originele context niet te behouden:
</div><pre class="screen">$ ls -Z file1
-rw-rw-r-- user1 group1 unconfined_u:object_r:user_home_t:s0 file1
# cp file1 /etc/
$ ls -Z /etc/file1
-rw-r--r-- root root unconfined_u:object_r:etc_t:s0 /etc/file1
</pre><div class="para">
Als <code class="filename">file1</code> gekopieerd wordt naar <code class="filename">/etc/</code>, en als <code class="filename">/etc/file1</code> niet bestaat, wordt <code class="filename">/etc/file1</code> aangemaakt als een nieuw bestand. Zoals in het voorbeeld hierboven is getoond, wordt <code class="filename">/etc/file1</code> gelabeld met het <code class="computeroutput">etc_t</code> type, overeenkomstig de standaard labelingsregels.
</div><div class="para">
Als een bestand wordt gekopieerd over een bestaand bestand, wordt de context van het bestaande bestand gehandhaafd, behalve als de gebruiker <code class="command">cp</code> opties op heeft gegeven om de context van het originele bestand te behouden, zoals <code class="option">--preserve=context</code>. SELinux tactiek kan beletten dat contexten behouden blijven tijdens het kopiëren.
</div><div class="formalpara"><h5 class="formalpara" id="form-Security-Enhanced_Linux-Copying_Files_and_Directories-Copying_Without_Preserving_SELinux_Contexts">Kopiëren zonder behoud van SELinux context</h5>
Als een bestand gekopieerd wordt met het <code class="command">cp</code> commando, en er worden geen opties meegegeven, wordt het type geerfd van de doel, ouders map:
</div><pre class="screen">$ touch file1
$ ls -Z file1
-rw-rw-r-- user1 group1 unconfined_u:object_r:user_home_t:s0 file1
$ ls -dZ /var/www/html/
drwxr-xr-x root root system_u:object_r:httpd_sys_content_t:s0 /var/www/html/
# cp file1 /var/www/html/
$ ls -Z /var/www/html/file1
-rw-r--r-- root root unconfined_u:object_r:httpd_sys_content_t:s0 /var/www/html/file1
</pre><div class="para">
In dit voorbeeld, wordt <code class="filename">file1</code> aangemaakt in de persoonlijke map van de gebruiker, en wordt gelabeld met het <code class="computeroutput">user_home_t</code> type. De <code class="filename">/var/www/html/</code> map is gelabeld met het <code class="computeroutput">httpd_sys_content_t</code> type, zoals getoond met het <code class="command">ls -dZ /var/www/html/</code> commando. Als <code class="filename">file1</code> wordt gekopieerd naar <code class="filename">/var/www/html/</code>, erft het het <code class="computeroutput">httpd_sys_content_t</code> type, zoals het <code class="command">ls -Z /var/www/html/file1</code> commando laat zien.
</div><div class="formalpara"><h5 class="formalpara" id="form-Security-Enhanced_Linux-Copying_Files_and_Directories-Preserving_SELinux_Contexts_When_Copying">De SELinux context behouden tijdens het kopiëren</h5>
Gebruik het <code class="command">cp --preserve=context</code> commando om de context te behouden tijdens het kopiëren:
</div><pre class="screen">$ touch file1
$ ls -Z file1
-rw-rw-r-- user1 group1 unconfined_u:object_r:user_home_t:s0 file1
$ ls -dZ /var/www/html/
drwxr-xr-x root root system_u:object_r:httpd_sys_content_t:s0 /var/www/html/
# cp --preserve=context file1 /var/www/html/
$ ls -Z /var/www/html/file1
-rw-r--r-- root root unconfined_u:object_r:user_home_t:s0 /var/www/html/file1
</pre><div class="para">
In dit voorbeeld, wordt <code class="filename">file1</code> aangemaakt in de persoonlijke map van de gebruiker, en wordt gelabeld met het <code class="computeroutput">user_home_t</code> type. De <code class="filename">/var/www/html/</code> map is gelabeld met het <code class="computeroutput">httpd_sys_content_t</code> type, zoals het <code class="command">ls -dZ /var/www/html/</code> coomado laat zien. Het gebruik van de <code class="option">--preserve=context</code> optie behoudt de SELinux context tijdens het kopiëren. Zoals het <code class="command">ls -Z /var/www/html/file1</code> commando laat zien is het <code class="computeroutput">user_home_t</code> type van <code class="filename">file1</code> behouden toen het bestand gekopieerd werd naar <code class="filename">/var/www/html/</code>.
</div><div class="formalpara"><h5 class="formalpara" id="form-Security-Enhanced_Linux-Copying_Files_and_Directories-Copying_and_Changing_the_Context">Kopiëren en de context veranderen</h5>
Gebruik het <code class="command">cp -Z</code> commando om de context van de doel kopie te veranderen. Het volgende voorbeeld is uitgevoerd in de persoonlijke map van de gebruiker:
</div><pre class="screen">$ touch file1
$ cp -Z system_u:object_r:samba_share_t:s0 file1 file2
$ ls -Z file1 file2
-rw-rw-r-- user1 group1 unconfined_u:object_r:user_home_t:s0 file1
-rw-rw-r-- user1 group1 system_u:object_r:samba_share_t:s0 file2
$ rm file1 file2
</pre><div class="para">
In dit voorbeeld, wordt de context gedefinieerd met de <code class="option">-Z</code> optie. Zonder de <code class="option">-Z</code> optie, zou <code class="filename">file2</code> gelabeld zijn met de <code class="computeroutput">unconfined_u:object_r:user_home_t</code> context.
</div><div class="formalpara"><h5 class="formalpara" id="form-Security-Enhanced_Linux-Copying_Files_and_Directories-Copying_a_File_Over_an_Existing_File">Kopiëren over een bestaand bestand</h5>
Als een bestand gekopieerd wordt over een bestaand bestand, wordt de context van het bestaande bestand behouden (behalve als een optie gebruikt wordt om de context te behouden). Bijvoorbeeld:
</div><pre class="screen"># touch /etc/file1
# ls -Z /etc/file1
-rw-r--r-- root root unconfined_u:object_r:etc_t:s0 /etc/file1
# touch /tmp/file2
# ls -Z /tmp/file2
-rw-r--r-- root root unconfined_u:object_r:user_tmp_t:s0 /tmp/file2
# cp /tmp/file2 /etc/file1
# ls -Z /etc/file1
-rw-r--r-- root root unconfined_u:object_r:etc_t:s0 /etc/file1
</pre><div class="para">
In dit voorbeeld worden twee bestanden aangemaakt: <code class="filename">/etc/file1</code>, gelabeld met het <code class="computeroutput">etc_t</code> type, en <code class="filename">/tmp/file2</code>, gelabeld met het <code class="computeroutput">user_tmp_t</code> type. Het <code class="command">cp /tmp/file2 /etc/file1</code> commando overschrijft <code class="filename">file1</code> met <code class="filename">file2</code>. Na het kopiëren, laat het <code class="command">ls -Z /etc/file1</code> zien dat <code class="filename">file1</code> gelabeld is met het <code class="computeroutput">etc_t</code> type, niet het <code class="computeroutput">user_tmp_t</code> type van <code class="filename">/tmp/file2</code> welke <code class="filename">/etc/file1</code> heeft vervangen.
</div><div class="important"><h2>Belangrijk</h2><div class="para">
Kopieer bestanden en mappen, inplaats van ze te verplaatsen. Dit helpt om er zeker van te zijn dat ze gelabeld zijn met de juiste SELinux context. Foutieve SELinux contexten kunnen voorkomen dat processen toegang hebben tot zulke bestanden en mappen.
</div></div></div></div><ul class="docnav"><li class="previous"><a accesskey="p" href="sect-Security-Enhanced_Linux-Mounting_File_Systems-Making_Context_Mounts_Persistent.html"><strong>Terug</strong>5.9.5. Maak de context aankoppelingen blijvend</a></li><li class="up"><a accesskey="u" href="#"><strong>Omhoog</strong></a></li><li class="home"><a accesskey="h" href="index.html"><strong>Begin</strong></a></li><li class="next"><a accesskey="n" href="sect-Security-Enhanced_Linux-Maintaining_SELinux_Labels_-Moving_Files_and_Directories.html"><strong>Volgende</strong>5.10.2. Bestanden en mappen verplaatsen</a></li></ul></body></html>
--- NEW FILE sect-Security-Enhanced_Linux-Working_with_SELinux-Mounting_File_Systems.html ---
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>5.9. Het aankoppelen van bestandssystemen</title><link rel="stylesheet" href="./Common_Content/css/default.css" type="text/css"/><meta name="generator" content="publican"/><meta name="package" content="Fedora-Security-Enhanced_Linux-11-nl-NL-1.3-SELinux_User_guide"/><link rel="home" href="index.html" title="Security-Enhanced Linux"/><link rel="up" href="chap-Security-Enhanced_Linux-Working_with_SELinux.html" title="Hoofdstuk 5. Werken met SELinux"/><link rel="prev" href="sect-Security-Enhanced_Linux-Working_with_SELinux-The_file_t_and_default_t_Types.html" title="5.8. De file_t en default_t types"/><link rel="next" href="sect-Security-Enhanced_Linux-Mounting_File_Systems-Changing_the_Default_Context.html" title="5.9.2. De standaard context veranderen"/></head><body class=""><p id="title"><a class="left" href="http://www.fedoraproject.org"><img src="Common_Content/images/image_left.png" alt="Product Site"/></a><a class="r
ight" href="http://docs.fedoraproject.org"><img src="Common_Content/images/image_right.png" alt="Documentation Site"/></a></p><ul class="docnav"><li class="previous"><a accesskey="p" href="sect-Security-Enhanced_Linux-Working_with_SELinux-The_file_t_and_default_t_Types.html"><strong>Terug</strong></a></li><li class="next"><a accesskey="n" href="sect-Security-Enhanced_Linux-Mounting_File_Systems-Changing_the_Default_Context.html"><strong>Volgende</strong></a></li></ul><div class="section" lang="nl-NL"><div class="titlepage"><div><div><h2 class="title" id="sect-Security-Enhanced_Linux-Working_with_SELinux-Mounting_File_Systems">5.9. Het aankoppelen van bestandssystemen</h2></div></div></div><div class="para">
Als een bestandssysteem dat uitgebreide attributen ondersteund wordt aangekoppeld, wordt standaard de beveiligingscontext voor ieder bestand verkregen van de <span class="emphasis"><em>security.selinux</em></span> uitgebreide attribuut van het bestand. Bestanden in bestandssystemen die uitgebreide attributen niet ondersteunen krijgen een enkele, standaard beveiliging van de tactiek configuratie, gebaseerd op het bestandssysteem type.
</div><div class="para">
Gebruik het <code class="command">mount -o context</code> commando om bestaande uitgebreide attributen ter zijde te schuiven, of om een andere, standaard context op te geven voor bestandssystemen die geen uitgebreide attributen ondersteunen. Dit is nuttig als je niet vertrouwt dat een bestandssysteem de juiste attriburen levert, bijvoorbeeld, verwijderbare media gebruikt in meerdere systemen. Het <code class="command">mount -o context</code> commando kan ook gebruikt worden om labeling te ondersteunen voor bestandssystemen die geen uitgebreide attributen ondersteunen, zoals de File Allocation Table (FAT) of NFS bestandssystemen. De context opgegeven met de <code class="option">context</code> optie wordt niet naar schijf geschreven, de originele context blijft bewaard, en kan gezien worden door aan te koppelen zonder een <code class="option">context</code> optie (als het bestandssysteem om te beginnen uitgebreide attributen heeft).
</div><div class="para">
Voor meer informatie over bestandssysteem labeling, refereer je naar het artikel van James Morris over "Filesystem Labeling in SELinux": <a href="http://www.linuxjournal.com/article/7426">http://www.linuxjournal.com/article/7426</a>.
</div><div class="section" lang="nl-NL"><div class="titlepage"><div><div><h3 class="title" id="sect-Security-Enhanced_Linux-Mounting_File_Systems-Context_Mounts">5.9.1. Context aankoppelingen</h3></div></div></div><div class="para">
Om een bestandssysteem met een gespecificeerde context aan te koppelen, waarbij voorbij gegaan wordt aan bestaande context als die er is, of om een andere, standaard context op te geven voor een bestandssysteem dat geen uitgebreide attributen ondersteund, gebruik je als de Linux root gebruiker het <code class="command">mount -o context=<em class="replaceable"><code>SELinux_user:role:type:level</code></em></code> commando om het gewenste bestandssysteem aan te koppelen. Context veranderingen worden niet naar schijf geschreven. Standaard worden NFS aankoppelingen op de client zijde gelabeld met een standaard context gedefinieerd door tactiek voor NFS bestandssystemen. In algemene tactieken gebruikt deze standaard context het <code class="computeroutput">nfs_t</code> type. Zonder extra aankoppel opties, kan dit het delen van NFS bestandssytemen via andere services beletten, zoals de Apache HTTP server. Het volgende voorbeeld koppelt een NFS bestandssysteem zodanig aan dat he
t gedeeld kan worden via de Apache HTTP server:
</div><div class="para">
<pre class="screen"># mount server:/export /local/mount/point -o\
context="system_u:object_r:httpd_sys_content_t:s0"
</pre>
</div><div class="para">
Nieuw aangemaakte bestanden en mappen in dit bestandssysteem lijken de SELinux context te hebben opgegeven met de <code class="option">-o context</code> optie; omdat echter de context veranderingen niet naar schijf geschreven worden in deze situaties, wordt de context opgegeven met de <code class="option">context</code> optie alleen vastgehouden als de <code class="option">context</code> optie wordr gebruikt bij de volgende aankoppeling, en als dezelfde context wordt opgegeven.
</div><div class="para">
Type Enforcement is de belangrijkste rechten controle die gebruikt wordt in de SELinux gerichte tactiek. Voor het grootste deel kunnen SELinux gebruikers en rollen genegeerd worden, dus als je de SELinux context terzijde schuift met de <code class="option">-o context</code> optie, gebruik dan de SELinux <code class="computeroutput">system_u</code> gebruiker en de <code class="computeroutput">object_r</code> rol, en concentreer je op het type. Als je de MLS tactiek of multi-categorie beveiliging niet gebruikt, gebruik je het <code class="computeroutput">s0</code> niveau.
</div><div class="note"><h2>Opmerking</h2><div class="para">
Als een bestandssysteem wordt aangekoppeld met een <code class="option">context</code> optie, zijn context veranderingen (door gebruikers en processen) verboden. Bijvoorbeeld, het uitvoeren van <code class="command">chcon</code> op een bestandssysteem aangekoppeld met een <code class="option">context</code> optie resulteert in een <code class="computeroutput">Operation not supported</code> fout.
</div></div></div></div><ul class="docnav"><li class="previous"><a accesskey="p" href="sect-Security-Enhanced_Linux-Working_with_SELinux-The_file_t_and_default_t_Types.html"><strong>Terug</strong>5.8. De file_t en default_t types</a></li><li class="up"><a accesskey="u" href="#"><strong>Omhoog</strong></a></li><li class="home"><a accesskey="h" href="index.html"><strong>Begin</strong></a></li><li class="next"><a accesskey="n" href="sect-Security-Enhanced_Linux-Mounting_File_Systems-Changing_the_Default_Context.html"><strong>Volgende</strong>5.9.2. De standaard context veranderen</a></li></ul></body></html>
--- NEW FILE sect-Security-Enhanced_Linux-Working_with_SELinux-SELinux_Contexts_Labeling_Files.html ---
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>5.7. SELinux context - Bestanden labelen</title><link rel="stylesheet" href="./Common_Content/css/default.css" type="text/css"/><meta name="generator" content="publican"/><meta name="package" content="Fedora-Security-Enhanced_Linux-11-nl-NL-1.3-SELinux_User_guide"/><link rel="home" href="index.html" title="Security-Enhanced Linux"/><link rel="up" href="chap-Security-Enhanced_Linux-Working_with_SELinux.html" title="Hoofdstuk 5. Werken met SELinux"/><link rel="prev" href="sect-Security-Enhanced_Linux-Booleans-Booleans_for_NFS_and_CIFS.html" title="5.6.3. Booleans voor NFS en CIFS"/><link rel="next" href="sect-Security-Enhanced_Linux-SELinux_Contexts_Labeling_Files-Persistent_Changes_semanage_fcontext.html" title="5.7.2. Permanente veranderingen: semanage fcontext"/></head><body class=""><p id="title"><a class="left" href="http://www.fedoraproject.org"><img src="Common_Content/images/image_left.png" alt="Product Site"/></a>
<a class="right" href="http://docs.fedoraproject.org"><img src="Common_Content/images/image_right.png" alt="Documentation Site"/></a></p><ul class="docnav"><li class="previous"><a accesskey="p" href="sect-Security-Enhanced_Linux-Booleans-Booleans_for_NFS_and_CIFS.html"><strong>Terug</strong></a></li><li class="next"><a accesskey="n" href="sect-Security-Enhanced_Linux-SELinux_Contexts_Labeling_Files-Persistent_Changes_semanage_fcontext.html"><strong>Volgende</strong></a></li></ul><div class="section" lang="nl-NL"><div class="titlepage"><div><div><h2 class="title" id="sect-Security-Enhanced_Linux-Working_with_SELinux-SELinux_Contexts_Labeling_Files">5.7. SELinux context - Bestanden labelen</h2></div></div></div><div class="para">
Op systemen die SELinux draaien, zijn alle processen en bestanden gelabeld met een label die informatie bevat die relevant is voor de beveiliging. Deze informatie wordt de SELinux context genoemd. Voor bestanden kan deze bekeken worden met het <code class="command">ls -Z</code> commando:
</div><pre class="screen">$ ls -Z file1
-rw-rw-r-- user1 group1 unconfined_u:object_r:user_home_t:s0 file1
</pre><div class="para">
In dit voorbeeld biedt SELinux een gebruiker (<code class="computeroutput">unconfined_u</code>), een rol (<code class="computeroutput">object_r</code>), een type (<code class="computeroutput">user_home_t</code>), en een niveau (<code class="computeroutput">s0</code>). Deze informatie wordt gebruikt om toegangscontrole beslissingen te maken. Op DAC systemen wordt toegang gecontroleerd op basis van Linux gebruiker en groep ID's. SELinux tactiekregels worden toegepast na de DAC regels. SELinux tactiekregels worden niet gebruikt als DAC regels als eerste toegang weigeren.
</div><div class="para">
Er zijn meerdere commando's voor het beheren van de SELinux context voor bestanden, zoals <code class="command">chcon</code>, <code class="command">semanage fcontext</code>, en <code class="command">restorecon</code>.
</div><div class="section" lang="nl-NL"><div class="titlepage"><div><div><h3 class="title" id="sect-Security-Enhanced_Linux-SELinux_Contexts_Labeling_Files-Temporary_Changes_chcon">5.7.1. Tijdelijke veranderingen: chcon</h3></div></div></div><div class="para">
Het <code class="command">chcon</code> commando verandert de SELinux context voor bestanden. Deze veranderingen overleven het herlabelen van een bestandssysteem niet, en ook het <code class="command">/sbin/restorecon</code> commando niet. SELinux tactiek controleert welke gebruikers in staat zijn om de SELinux context voor elk bestand te veranderen. Als <code class="command">chcon</code> gebruikt wordt, kunnen gebruikers alle of een deel van de SELinux context veranderen. Een foutief bestands type is een vaak voorkomende fout als SELinux toegang weigert.
</div><div class="formalpara"><h5 class="formalpara" id="form-Security-Enhanced_Linux-Temporary_Changes_chcon-Quick_Reference">Korte referentie</h5>
<div class="itemizedlist"><ul><li><div class="para">
Voer het <code class="command">chcon -t <em class="replaceable"><code>type</code></em> <em class="replaceable"><code>bestandsnaam</code></em></code> commando uit om het bestandstype te veranderen, waarin <em class="replaceable"><code>type</code></em> een type is, zoals <code class="computeroutput">httpd_sys_content_t</code>, en <em class="replaceable"><code>bestandsnaam</code></em> een bestand of een map is.
</div></li><li><div class="para">
Voer het <code class="command">chcon -R -t <em class="replaceable"><code>type</code></em> <em class="replaceable"><code>mapnaam</code></em></code> commando uit om het type van een map en zijn inhoud te veranderen, waarin <em class="replaceable"><code>type</code></em> een type is, zoals <code class="computeroutput">httpd_sys_content_t</code>, en <em class="replaceable"><code>mapnaam</code></em> een mapnaam is.
</div></li></ul></div>
</div><div class="formalpara"><h5 class="formalpara" id="form-Security-Enhanced_Linux-Temporary_Changes_chcon-Changing_a_Files_or_Directorys_Type">Het veranderen van het type van een bestand of map</h5>
Het volgende voorbeeld laat het veranderen van het type zien, alle andere attributen van de SELinux context blijven onveranderd:
</div><div class="orderedlist"><ol><li><div class="para">
Voer het <code class="command">cd</code> commando uit zonder argumenten om naar je persoonlijke map te gaan.
</div></li><li><div class="para">
Voer het <code class="command">touch file1</code> commando uit om een nieuw bestand aan te maken. Gebruik het <code class="command">ls -Z file1</code> commando om de SELinux context voor <code class="filename">file1</code> te zien:
</div><pre class="screen">$ ls -Z file1
-rw-rw-r-- user1 group1 unconfined_u:object_r:user_home_t:s0 file1
</pre><div class="para">
In dit voorbeeld bevat de SELinux context voor <code class="filename">file1</code> de SELinux <code class="computeroutput">unconfined_u</code> gebruiker, de <code class="computeroutput">object_r</code> rol, het <code class="computeroutput">user_home_t</code> type, en het <code class="computeroutput">s0</code> niveau. Voor een beschrijving van ieder onderdeel van de SELinux context, refereer je naar <a class="xref" href="chap-Security-Enhanced_Linux-SELinux_Contexts.html" title="Hoofdstuk 3. SELinux context">Hoofdstuk 3, <i>SELinux context</i></a>.
</div></li><li><div class="para">
Voer het <code class="command">chcon -t samba_share_t file1</code> commando uit om het type te veranderen naar <code class="computeroutput">samba_share_t</code>. De <code class="option">-t</code> optie verandert alleen het type. Bekijk de verandering met <code class="command">ls -Z file1</code>:
</div><pre class="screen">$ ls -Z file1
-rw-rw-r-- user1 group1 unconfined_u:object_r:samba_share_t:s0 file1
</pre></li><li><div class="para">
Gebruik het <code class="command">/sbin/restorecon -v file1</code> commando om de SELinux context voor het <code class="filename">file1</code> bestand te herstellen. Gebruik de <code class="option">-v</code> optie om te zien wat er verandert:
</div><pre class="screen">$ /sbin/restorecon -v file1
restorecon reset file1 context unconfined_u:object_r:samba_share_t:s0->system_u:object_r:user_home_t:s0
</pre><div class="para">
In dit voorbeeld wordt het vorige type, <code class="computeroutput">samba_share_t</code>, hersteld naar het juiste <code class="computeroutput">user_home_t</code> type. Als gerichte tactiek gebruikt wordt (de standaard SELinux tactiek in Fedora 11), leest het <code class="command">/sbin/restorecon</code> commando de bestanden in de <code class="filename">/etc/selinux/targeted/contexts/files/</code> map om te zien welke SELinux context bestanden moeten hebben.
</div></li></ol></div><div class="para">
Het voorbeeld in deze paragraaf werkt hetzelfde voor mappen, bijvoorbeeld, als <code class="filename">file1</code> een map was.
</div><div class="formalpara"><h5 class="formalpara" id="form-Security-Enhanced_Linux-Temporary_Changes_chcon-Changing_a_Directory_and_its_Contents_Types">Een map en zijn context types veranderen</h5>
Het volgende voorbeeld laat het aanmaken van een nieuwe map zien, en het veranderen van het bestandstype van de map (te samen met zijn inhoud) naar een type dat gebruikt wordt voor de Apache HTTP server. De instelling in dit voorbeeld wordt gebruikt als je wilt dat de Apache HTTP server een ander document root gebruikt (in plaats van <code class="filename">/var/www/html/</code>):
</div><div class="orderedlist"><ol><li><div class="para">
Als de Linux root gebruiker voer je het <code class="command">mkdir /web</code> commando uit om een nieuwe map aan te maken, en daarna het <code class="command">touch /web/file{1,2,3}</code> commando om 3 lege bestanden aan te maken (<code class="filename">file1</code>, <code class="filename">file2</code>, en <code class="filename">file3</code>). De <code class="filename">/web/</code> map en zijn bestanden zijn gelabeld met het <code class="computeroutput">default_t</code> type:
</div><pre class="screen"># ls -dZ /web
drwxr-xr-x root root unconfined_u:object_r:default_t:s0 /web
# ls -lZ /web
-rw-r--r-- root root unconfined_u:object_r:default_t:s0 file1
-rw-r--r-- root root unconfined_u:object_r:default_t:s0 file2
-rw-r--r-- root root unconfined_u:object_r:default_t:s0 file3
</pre></li><li><div class="para">
Als de Linux root gebruiker voer je het <code class="command">chcon -R -t httpd_sys_content_t /web/</code> commando uit om het type van de <code class="filename">/web/</code> map (en zijn inhoud) te veranderen naar <code class="computeroutput">httpd_sys_content_t</code>:
</div><pre class="screen"># chcon -R -t httpd_sys_content_t /web/
# ls -dZ /web/
drwxr-xr-x root root unconfined_u:object_r:httpd_sys_content_t:s0 /web/
# ls -lZ /web/
-rw-r--r-- root root unconfined_u:object_r:httpd_sys_content_t:s0 file1
-rw-r--r-- root root unconfined_u:object_r:httpd_sys_content_t:s0 file2
-rw-r--r-- root root unconfined_u:object_r:httpd_sys_content_t:s0 file3
</pre></li><li><div class="para">
Als de Linux root gebruiker voer je het <code class="command">/sbin/restorecon -R -v /web/</code> commando uit om de standaard SELinux context te herstellen:
</div><pre class="screen"># /sbin/restorecon -R -v /web/
restorecon reset /web context unconfined_u:object_r:httpd_sys_content_t:s0->system_u:object_r:default_t:s0
restorecon reset /web/file2 context unconfined_u:object_r:httpd_sys_content_t:s0->system_u:object_r:default_t:s0
restorecon reset /web/file3 context unconfined_u:object_r:httpd_sys_content_t:s0->system_u:object_r:default_t:s0
restorecon reset /web/file1 context unconfined_u:object_r:httpd_sys_content_t:s0->system_u:object_r:default_t:s0
</pre></li></ol></div><div class="para">
Refereer naar de <span class="citerefentry"><span class="refentrytitle">chcon</span>(1)</span> manual pagina voor verdere informatie over <code class="command">chcon</code>.
</div><div class="note"><h2>Opmerking</h2><div class="para">
Type Enforcement is de belangrijkste toestemmingscontrole gebruikt in SELinux gerichte tactiek. Voor het grootste deel kunnen SELinux gebruikers en rollen genegeerd worden.
</div></div></div></div><ul class="docnav"><li class="previous"><a accesskey="p" href="sect-Security-Enhanced_Linux-Booleans-Booleans_for_NFS_and_CIFS.html"><strong>Terug</strong>5.6.3. Booleans voor NFS en CIFS</a></li><li class="up"><a accesskey="u" href="#"><strong>Omhoog</strong></a></li><li class="home"><a accesskey="h" href="index.html"><strong>Begin</strong></a></li><li class="next"><a accesskey="n" href="sect-Security-Enhanced_Linux-SELinux_Contexts_Labeling_Files-Persistent_Changes_semanage_fcontext.html"><strong>Volgende</strong>5.7.2. Permanente veranderingen: semanage fcontext</a></li></ul></body></html>
--- NEW FILE sect-Security-Enhanced_Linux-Working_with_SELinux-SELinux_Modes.html ---
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>5.5. SELinux modes</title><link rel="stylesheet" href="./Common_Content/css/default.css" type="text/css"/><meta name="generator" content="publican"/><meta name="package" content="Fedora-Security-Enhanced_Linux-11-nl-NL-1.3-SELinux_User_guide"/><link rel="home" href="index.html" title="Security-Enhanced Linux"/><link rel="up" href="chap-Security-Enhanced_Linux-Working_with_SELinux.html" title="Hoofdstuk 5. Werken met SELinux"/><link rel="prev" href="sect-Security-Enhanced_Linux-Enabling_and_Disabling_SELinux-Disabling_SELinux.html" title="5.4.2. SELinux uitzetten"/><link rel="next" href="sect-Security-Enhanced_Linux-Working_with_SELinux-Booleans.html" title="5.6. Booleans"/></head><body class=""><p id="title"><a class="left" href="http://www.fedoraproject.org"><img src="Common_Content/images/image_left.png" alt="Product Site"/></a><a class="right" href="http://docs.fedoraproject.org"><img src="Common_Content/images/image_
right.png" alt="Documentation Site"/></a></p><ul class="docnav"><li class="previous"><a accesskey="p" href="sect-Security-Enhanced_Linux-Enabling_and_Disabling_SELinux-Disabling_SELinux.html"><strong>Terug</strong></a></li><li class="next"><a accesskey="n" href="sect-Security-Enhanced_Linux-Working_with_SELinux-Booleans.html"><strong>Volgende</strong></a></li></ul><div class="section" lang="nl-NL"><div class="titlepage"><div><div><h2 class="title" id="sect-Security-Enhanced_Linux-Working_with_SELinux-SELinux_Modes">5.5. SELinux modes</h2></div></div></div><div class="para">
SELinux heeft drie modes:
</div><div class="itemizedlist"><ul><li><div class="para">
Afdwingend: SELinux tactiek wordt afgedwongen. SELinux verbiedt toegang gebaseerd op SELinux tactiekreges.
</div></li><li><div class="para">
Toestaand: SELinux tactiek wordt niet afgedwongen. SELinux verbiedt geen toegang, maar weigeringen worden gelogd voor acties die verboden zouden zijn als de afdwingende modus actief zou zijn.
</div></li><li><div class="para">
Uitgezet: SELinux is uitgezet. Alleen DAC regels worden gebruikt.
</div></li></ul></div><div class="para">
Gebruik het <code class="command">/usr/sbin/setenforce</code> commando om te veranderen tussen afdwingende en toelatende mode. Veranderingen gemaakt met <code class="command">/usr/sbin/setenforce</code> zijn niet blijvend na een heropstarten van het systeem. Om naar de afdwingende modus te veranderen, voer je als de Linux root gebruiker het <code class="command">/usr/sbin/setenforce 1</code> commando uit. Om naar de toelatende modus te veranderen, voer je het <code class="command">/usr/sbin/setenforce 0</code> commando uit. Gebruik het <code class="command">/usr/sbin/getenforce</code> commando om de huidige SELinux modus te bekijken.
</div><div class="para">
Blijvende modus veranderingen worden behandeld in <a class="xref" href="sect-Security-Enhanced_Linux-Working_with_SELinux-Enabling_and_Disabling_SELinux.html" title="5.4. SELinux aanzetten en uitzetten">Paragraaf 5.4, “SELinux aanzetten en uitzetten”</a>.
</div></div><ul class="docnav"><li class="previous"><a accesskey="p" href="sect-Security-Enhanced_Linux-Enabling_and_Disabling_SELinux-Disabling_SELinux.html"><strong>Terug</strong>5.4.2. SELinux uitzetten</a></li><li class="up"><a accesskey="u" href="#"><strong>Omhoog</strong></a></li><li class="home"><a accesskey="h" href="index.html"><strong>Begin</strong></a></li><li class="next"><a accesskey="n" href="sect-Security-Enhanced_Linux-Working_with_SELinux-Booleans.html"><strong>Volgende</strong>5.6. Booleans</a></li></ul></body></html>
--- NEW FILE sect-Security-Enhanced_Linux-Working_with_SELinux-The_file_t_and_default_t_Types.html ---
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>5.8. De file_t en default_t types</title><link rel="stylesheet" href="./Common_Content/css/default.css" type="text/css"/><meta name="generator" content="publican"/><meta name="package" content="Fedora-Security-Enhanced_Linux-11-nl-NL-1.3-SELinux_User_guide"/><link rel="home" href="index.html" title="Security-Enhanced Linux"/><link rel="up" href="chap-Security-Enhanced_Linux-Working_with_SELinux.html" title="Hoofdstuk 5. Werken met SELinux"/><link rel="prev" href="sect-Security-Enhanced_Linux-SELinux_Contexts_Labeling_Files-Persistent_Changes_semanage_fcontext.html" title="5.7.2. Permanente veranderingen: semanage fcontext"/><link rel="next" href="sect-Security-Enhanced_Linux-Working_with_SELinux-Mounting_File_Systems.html" title="5.9. Het aankoppelen van bestandssystemen"/></head><body class=""><p id="title"><a class="left" href="http://www.fedoraproject.org"><img src="Common_Content/images/image_left.png" alt="Product S
ite"/></a><a class="right" href="http://docs.fedoraproject.org"><img src="Common_Content/images/image_right.png" alt="Documentation Site"/></a></p><ul class="docnav"><li class="previous"><a accesskey="p" href="sect-Security-Enhanced_Linux-SELinux_Contexts_Labeling_Files-Persistent_Changes_semanage_fcontext.html"><strong>Terug</strong></a></li><li class="next"><a accesskey="n" href="sect-Security-Enhanced_Linux-Working_with_SELinux-Mounting_File_Systems.html"><strong>Volgende</strong></a></li></ul><div class="section" lang="nl-NL"><div class="titlepage"><div><div><h2 class="title" id="sect-Security-Enhanced_Linux-Working_with_SELinux-The_file_t_and_default_t_Types">5.8. De file_t en default_t types</h2></div></div></div><div class="para">
Als op bestandsystemen die uitgebreide attributen ondersteunen een bestand op de schijf wordt benaderd die geen SELinux context heeft, dan wordt dit bestand behandeld alsof het een standaard context heeft zoals gedefinieerd door SELinux tactiek. In gewone tactieken gebruikt deze standaard context het <code class="computeroutput">file_t</code> type. Dit moet het enigste gebruik zijn van dit type, zodat bestanden zonder context op een schijf onderscheiden kunnen worden in de tactiek, en in het algemeen onbereikbaar worden gehouden voor beperkte domeinen. Het <code class="computeroutput">file_t</code> type moet niet bestaan op correct gelabelde bestandssystemen, omdat alle bestanden op een systeem dat SELinux draait en SELinux context moeten hebben, en het <code class="computeroutput">file_t</code> type wordt nooit gebruikt in bestandscontext configuratie<sup>[<a id="d0e3752" href="#ftn.d0e3752" class="footnote">11</a>]</sup>.
</div><div class="para">
Het <code class="computeroutput">default_t</code> type wordt gebruikt voor bestanden die niet passen bij elk ander patroon in de bestandscontext configuratie, zodat zulke bestanden onderscheiden kunnen worden van bestanden op schijf die geen context hebben, en ze worden in het algemeen onbereikbaar gehouden voor beperkte domeinen. Als je een nieuwe top-niveau map aanmaakt, zoals <code class="filename">/mijnmap/</code>, zal deze misschien gelabeld worden met het <code class="computeroutput">default_t</code> type. Als services toegang nodig hebben naar zo'n map, vernieuw dan de bestandscontext voor deze loocatie. Refereer naar <a class="xref" href="sect-Security-Enhanced_Linux-SELinux_Contexts_Labeling_Files-Persistent_Changes_semanage_fcontext.html" title="5.7.2. Permanente veranderingen: semanage fcontext">Paragraaf 5.7.2, “Permanente veranderingen: semanage fcontext”</a> voor details over het toevoegen van een context aan de bestandscontext configuratie.
</div><div class="footnotes"><br/><hr/><div class="footnote"><p><sup>[<a id="ftn.d0e3752" href="#d0e3752" class="para">11</a>] </sup>
Bestanden in <code class="filename">/etc/selinux/targeted/contexts/files/</code> definieren context voor bestanden en mappen. Bestanden in deze map worden gelezen door <code class="command">restorecon</code> en <code class="command">setfiles</code> om bestanden en mappen te herstellen naar hun standaard context.
</p></div></div></div><ul class="docnav"><li class="previous"><a accesskey="p" href="sect-Security-Enhanced_Linux-SELinux_Contexts_Labeling_Files-Persistent_Changes_semanage_fcontext.html"><strong>Terug</strong>5.7.2. Permanente veranderingen: semanage fcontext</a></li><li class="up"><a accesskey="u" href="#"><strong>Omhoog</strong></a></li><li class="home"><a accesskey="h" href="index.html"><strong>Begin</strong></a></li><li class="next"><a accesskey="n" href="sect-Security-Enhanced_Linux-Working_with_SELinux-Mounting_File_Systems.html"><strong>Volgende</strong>5.9. Het aankoppelen van bestandssystemen</a></li></ul></body></html>
--- NEW FILE sect-Security-Enhanced_Linux-Working_with_SELinux-Which_Log_File_is_Used.html ---
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>5.2. Welk log bestand wordt gebruikt</title><link rel="stylesheet" href="./Common_Content/css/default.css" type="text/css"/><meta name="generator" content="publican"/><meta name="package" content="Fedora-Security-Enhanced_Linux-11-nl-NL-1.3-SELinux_User_guide"/><link rel="home" href="index.html" title="Security-Enhanced Linux"/><link rel="up" href="chap-Security-Enhanced_Linux-Working_with_SELinux.html" title="Hoofdstuk 5. Werken met SELinux"/><link rel="prev" href="chap-Security-Enhanced_Linux-Working_with_SELinux.html" title="Hoofdstuk 5. Werken met SELinux"/><link rel="next" href="sect-Security-Enhanced_Linux-Working_with_SELinux-Main_Configuration_File.html" title="5.3. Het hoofd configuratie bestand"/></head><body class=""><p id="title"><a class="left" href="http://www.fedoraproject.org"><img src="Common_Content/images/image_left.png" alt="Product Site"/></a><a class="right" href="http://docs.fedoraproject.org"><img
src="Common_Content/images/image_right.png" alt="Documentation Site"/></a></p><ul class="docnav"><li class="previous"><a accesskey="p" href="chap-Security-Enhanced_Linux-Working_with_SELinux.html"><strong>Terug</strong></a></li><li class="next"><a accesskey="n" href="sect-Security-Enhanced_Linux-Working_with_SELinux-Main_Configuration_File.html"><strong>Volgende</strong></a></li></ul><div class="section" lang="nl-NL"><div class="titlepage"><div><div><h2 class="title" id="sect-Security-Enhanced_Linux-Working_with_SELinux-Which_Log_File_is_Used">5.2. Welk log bestand wordt gebruikt</h2></div></div></div><div class="para">
In Fedora 11 worden de <span class="package">setroubleshoot-server</span> en <span class="package">audit</span> pakketten geinstalleerd als ze niet verwijderd zijn van de standaard software selectie. Deze pakketten bevatten respectievelijk de <code class="systemitem">setroubleshootd</code> en <code class="systemitem">auditd</code> daemons. Deze daemons draaien standaard.
</div><div class="para">
SELinux weigeringsboodschappen, zoals de volgende worden standaard naar <code class="filename">/var/log/audit/audit.log</code> geschreven:
</div><pre class="screen">type=AVC msg=audit(1223024155.684:49): avc: denied { getattr } for pid=2000 comm="httpd" path="/var/www/html/file1" dev=dm-0 ino=399185 scontext=unconfined_u:system_r:httpd_t:s0 tcontext=system_u:object_r:samba_share_t:s0 tclass=file
</pre><div class="para">
Als <code class="systemitem">setroubleshootd</code> draait, wat standaard het geval is, worden weigeringsboodschappen van <code class="filename">/var/log/audit/audit.log</code> ook vertaald naar een eenvoudiger te lezen vorm en naar <code class="filename">/var/log/messages</code> gestuurd:
</div><pre class="screen">May 7 18:55:56 localhost setroubleshoot: SELinux is preventing httpd (httpd_t) "getattr" to /var/www/html/file1 (samba_share_t). For complete SELinux messages. run sealert -l de7e30d6-5488-466d-a606-92c9f40d316d
</pre><div class="para">
Weigeringsboodschappen worden naar verscheidene locaties gestuurd, afhankelijk van welke daemons draaien:
</div><div class="segmentedlist"><table border="0"><thead><tr class="segtitle"><th>Daemon</th><th>Log Location</th></tr></thead><tbody><tr class="seglistitem"><td class="seg">auditd on</td><td class="seg"><code class="filename">/var/log/audit/audit.log</code></td></tr><tr class="seglistitem"><td class="seg">auditd off; rsyslogd on</td><td class="seg"><code class="filename">/var/log/messages</code></td></tr><tr class="seglistitem"><td class="seg">setroubleshootd, rsyslogd, and auditd on</td><td class="seg"><code class="filename">/var/log/audit/audit.log</code>. Easier-to-read denial messages also sent to <code class="filename">/var/log/messages</code></td></tr></tbody></table></div><div class="formalpara"><h5 class="formalpara" id="form-Security-Enhanced_Linux-Which_Log_File_is_Used-Starting_Daemons_Automatically">Daemons automatisch opstarten</h5>
Om de <code class="systemitem">auditd</code>, <code class="systemitem">rsyslogd</code>, en <code class="systemitem">setroubleshootd</code> daemons in te stellen om automatisch op te starten bij het opstarten van het systeem, voer je de volgende commando's uit als de Linux root gebruiker:
</div><pre class="screen">/sbin/chkconfig --levels 2345 auditd on
</pre><pre class="screen">/sbin/chkconfig --levels 2345 rsyslog on
</pre><pre class="screen">/sbin/chkconfig --levels 345 setroubleshoot on
</pre><div class="para">
Gebruik het <code class="command">service <em class="replaceable"><code>service-naam</code></em> status</code> commando om te controleren of deze services draaien, bijvoorbeeld:
</div><pre class="screen">$ /sbin/service auditd status
auditd (pid <em class="replaceable"><code>1318</code></em>) is running...
</pre><div class="para">
Als de hierboven genoemde services niet draaien (<code class="computeroutput"><em class="replaceable"><code>service-naam</code></em> is stopped</code>), voer je het <code class="command">service <em class="replaceable"><code>service-naam</code></em> start</code> commando uit als de Liinux root gebruiker om ze te starten. Bijvoorbeeld:
</div><pre class="screen"># /sbin/service setroubleshoot start
Starting setroubleshootd: [ OK ]
</pre></div><ul class="docnav"><li class="previous"><a accesskey="p" href="chap-Security-Enhanced_Linux-Working_with_SELinux.html"><strong>Terug</strong>Hoofdstuk 5. Werken met SELinux</a></li><li class="up"><a accesskey="u" href="#"><strong>Omhoog</strong></a></li><li class="home"><a accesskey="h" href="index.html"><strong>Begin</strong></a></li><li class="next"><a accesskey="n" href="sect-Security-Enhanced_Linux-Working_with_SELinux-Main_Configuration_File.html"><strong>Volgende</strong>5.3. Het hoofd configuratie bestand</a></li></ul></body></html>
14 years, 10 months
web/html/docs/selinux-user-guide/f11/nl-NL/html/images - New directory
by Eric Christensen
Author: sparks
Update of /cvs/fedora/web/html/docs/selinux-user-guide/f11/nl-NL/html/images
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv3122/images
Log Message:
Directory /cvs/fedora/web/html/docs/selinux-user-guide/f11/nl-NL/html/images added to the repository
14 years, 10 months
web/html/docs/selinux-user-guide/f11/nl-NL/html/Common_Content - New directory
by Eric Christensen
Author: sparks
Update of /cvs/fedora/web/html/docs/selinux-user-guide/f11/nl-NL/html/Common_Content
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv3122/Common_Content
Log Message:
Directory /cvs/fedora/web/html/docs/selinux-user-guide/f11/nl-NL/html/Common_Content added to the repository
14 years, 10 months
web/html/docs/selinux-user-guide/f11/es-ES/pdf Security-Enhanced_Linux.pdf, NONE, 1.1
by Eric Christensen
Author: sparks
Update of /cvs/fedora/web/html/docs/selinux-user-guide/f11/es-ES/pdf
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv2468
Added Files:
Security-Enhanced_Linux.pdf
Log Message:
Adding es-ES pdf.
--- NEW FILE Security-Enhanced_Linux.pdf ---
%PDF-1.4
%ª«¬
4 0 obj
<<
/Title <FEFF004C0069006E0075007800200063006F006E00200053006500670075007200690064006100640020004D0065006A006F00720061006400610020002D00200047007500ED0061002000640065006C0020005500730075006100720069006F>
/Author (Logo)
/Creator (DocBook XSL Stylesheets with Apache FOP)
/Producer (Apache FOP Version SVN branches/fop-0_95)
/CreationDate (D:20090625110159+10'00')
>>
endobj
5 0 obj
<<
/N 3
/Length 10 0 R
/Filter /FlateDecode
>>
stream
xígPÙOwOÌC!A¢$ç$šÀF&dqVI ¢®.AVQÅ((`@wE@YWeôÇÞª{ëÞº?oÝù~~êíSõõé>UýT
óq!gŠ%¯d°ã
Óù+žÂÁBüÆBùÆ;¿Îñ÷uXá2
T&ÐFÀX[àÜ7ð!`#àXø ä] pTZÐ
b å@»¡Bšªê &è'ètº
A¡ húú#0 ŠÃ
°¬³a;Øö7À1p
çÁûà
ž>wÀá[ð,_Â@QFt6âx#¡H4ÂG¶#H9RŽ"ÝH?r sÈEC1Qº(K+*
ýÁ00,ÆÇdc01mK!Ì$fÅÊ`u°VXol6
ÄÂ^Äc§°ïqDÎçÅñp¹žr\3®7Æ-áÅñêxŒ7ß/Æ7à»ñwðSø%E°"øâ »VÂUÂ8á
HT!}qÄÄ
âiâuâñJÒ&9ÂHé€}€€K€€7d2YlK%§÷ÈWÈOÉïÅhbzbnb\±bÕbbÃb¯(x:ŲE)§¥Ü¡ÌãÅ5ÄÄ#Ä·W_ IJxK$II4KÜ¡b©T'*G=FœB€!4UCÛMk ]¥MÑ1tÝO/€ÿH€ÏKR%%%·HVK^0ÃÈ(fa2>J)HÙIEIíjZ¶.nþ(ÃqIÙ/Ó)óD%«-ë#){Döªì]ÎR#W wFî<,¯-ï+-L~@~AAQÁE!Y¡RáÂ"CÑV1^±L±GqVŠd§TŠtQéSiÇLdV0ûóÊòÊ®ÊéÊuÊÊK*,
3 ËÝÀÚ°eò7^ØDÙ±él8:<(Œ9üSwD}ÄB€[dMä<ÇsókË-ãÎFYEFMG[EFÏÄXŵ-s«{ï_¿àp"a91(±- tGå%ðú6+nÞ²y(Y'9?Ybr0eïÁoL
R7€v¥ÑW~ÌééߥOdXgTgŒÏÌ<»EboËÀVí{·Ng9gÏFes²{ssvåLl³ÛV·Ú¹œwêŒS;]vÜEØ°ëv®AniîÛÝA»»óòvæM~çò]KŸX>?låÚïQßÇ}?žwõÞÊœ_
ž7
Ë?qnþ`øCÅËû¢÷
)ÁðJF÷Ûì?Y*QU:yÀë@G³¬ ìíÁMo×"J?$šð¬èªT«,©üT[5Rm_ÝV#_³·fñ0÷ððÛ#µ
µ
µÆ}PçR×Q¯Q_~s,ãØóÀþãìãM²
OðNNúìk2kjjo.n[Ò[fO
ºû£ã]ºum¶ÂÓàtúé?
ÿ4zÆãLïYöÙÖÕ®i§µt@[;æ;c;]!]CçÜÏõv[v·ÿ¢÷ËóÊç«/H^(î!ôäõ,_̺žp)ùÒÜåËœz_ Ÿr¿Ï§oðªÇÕëׯ]é·ë¿xÝêúù7ÎÝdßìŒez«cÀd ý¶ÉíöAÓÁ;fwºîßíZ3Ô3l3|ùãœk÷ÝîßY;240ú`,lLðû`æaâÃ×2-=Þ9/x"þ€ü©üÓú_µ~m
.L8N<ó{öx3ùò·Ôß>Må='?/Vn19?ë<{÷ÅúS/_.Íåÿ.ñ{Í+ÍW?ÿaûÇÀ|ðüÔkþëå?ÞÈŒ9ñÖømïº
§ïÞ--ŒyòûCÿÇ ÓK°*>k}îþâñe|9iyYä"¹ÈD. r\@ä"¹ÈD. rü»À׳Bñ1
@e
endstream
endobj
6 0 obj
[/ICCBased 5 0 R]
endobj
7 0 obj
<<
/Type /Metadata
/Subtype /XML
/Length 11 0 R
/Filter /FlateDecode
>>
stream
xSÁrÓ0œç+4æÈØSÂ5¶;POàŽ
7F¶±cIžù'Ÿ~P9qÒn«Ý÷ÞhßîÆçmÍø,ÃBV÷ð㧀HŒO£)ÖPÈ÷
ùærÆ7K ï<ⶫz¡vUV¶ÇuqÆ^:µž¥²qq¯Ä+¬)Æëõ:XJ/pE&C<úá»Ê²Ö¯ÌœBkY[©ª^IðPÝèr+#8VPYà Äêžl®xàÔJ[B:UÓ"îÔrX4Z
&П*ÍC>z×ÜgH@>i©b| nUžfN'j±«íÛª`úçðJ |òÚfaHIHGÑËPBbÜ#»hÇÂRøÄ?ÚR\`;«vçÉÙSO\^gãЊW1>Éõ DÃA§oܶÆWךG üæÍ5«\Þà[UûäK4êuöŽÿèÂíÕó]Ž¬v]§]8œèf
endstream
endobj
10 0 obj
2419
endobj
11 0 obj
484
endobj
12 0 obj
<< /Length 13 0 R /Filter /FlateDecode >>
stream
xåK€G÷õ+rÃÒq¿H#€6nØYŽ`X0aFªfðü|÷ÄUe÷ÛVvuõqâĹŒ'.þâøÿÏ-ù£µÖkuùòñÓÓ_ŒþÒêÑjº€pdß}}ÖêÒŽåÃÅ&ðËO?ý
OîÓåÃÜb=]Ü¢5òÆo-\þöç³€ó©9zçÊ%º£óãçËïþÃ9ù>OãÓùŒûÙEP?ŸÔçgß_>üjë°·Þû¥Ç£Ú{{éóç|ŸâóÏ/ónîÏûs€÷{%)#Ož0£Š¿}ú0äôqôir~uÊýN?1Òùí<ÏêúísÜ¡Foj|Ë4X¹x&ÖëåPœQR=lëß¿n§ï?<ýä׿ùååïß|ûÿ˪»Ë/ùüùé'ÿÿßßüã?ÿç/fà}9°:®G÷R}f/£oÿð·o'Ãù"Ÿ¥¯¹Ô._ÄR«Ýq.è~zJíöŒbÉ/ØÒç[ØÖç=ýöé/ßaÉÒL4%Äû%ö\ï±HæÇØc$ô µ
ùø$,|ñ\ÀýžÿžÃçËäêZñLË¥£'ßJr~E>>E×(=ç²µòX\ŠMCä°¹âz¬<"Qšt)À£àBUÝùt É{KIw(y0jñx""!8+âkíµà¢þòÑkÆMŒ¥Õ€>!Yæߺ¯Sîxt0ùRBwÁŠ€{-èQX
ÖªÅêJAÏ®/1§XoÒSËà7º0âD(.äØUv)Ÿè<°¢ŸûnwùdnCã-àRî§úŒO%èíh>Tâ¹~ÄÁhäÝÑ\U«b9ô[[a,ÑTN¬X°Ðú'š à.Ô+Ó]FdÑr!õ·`€
Ìj1ÏjiÕÄCýý(<3Ìì
ZVGfÂ$ž.^0cxÉXÃHM€Á djKÁ ¶ ä*T*3wÈ?ÒÕ&|FðÎ¥StÑ?yÛa 9é3ìHÊÀzä$,²®^
L1¿î=fIµ¥"l^0µföÖVWÌÖ7Ʋ(0Ž!¯âs
b
+\îj0/ürVíDš¡m1o:æ{Ù=]aÐèF»·Êªâ),k4nþ_Ý
Yþ IØñeivª®øãDI ºxüŸ¬ýÓÀzOÞ5[aW1³V®|ßÚ»
DI=×|ÛµBä×Õûž¯Q
RUºÌY}EÖŒ³`SÑH
ÉáþPøyØŽÂ2âÅ®y*ŸL`Ù0?Ùú^û3YÝVlâ1c€LPMqS«œ¯Ñ-bÈÁS€ãÈjrÅ¢(è2Ò¬òÍØ:«y€Uõ÷£n13cÔî<#mÁq6ÑôÓÎmoc3&GF-Õ%³pt^Eh³Ç ÜLå@"RW&nL-Nð(ÕF"ù±Çž |êoÆ(^S
žB€B@ê»0XÓëNM"#Á|Ûë-bŽ°ùîú mG<gŒµ
TÐ5HóñºsÑó7d«fL)¡DN)k»©í1voÌQ±¯`ÄÑÐn]¯uD1P[3WP
SÊ#2gž3d÷TmuÙÂ/k²g[Dxd©Ã:¬µ¡¥#ŠmeÉÖŒFQ2zkeEÉLÉ^ÝK+l¥Öéiœxê
@ͺÎ;|±în0,C»wå
w¡3>w¯¿+öŒbm>¿áWòÍðÝ6ÓŽcLGªÚ§e+> UîjCkñ9#»©Ø\|Î#Åç,ߎhÄc5ÄÖjñGF¢H2ËIVdoÆSï¹FUAóH&éïGŽá Gðò-OQ¶Š
r$Qv`|:Çе\d®g«à X ÄN¯3/ë||¢Ö
{[«J uµ6Z(¶µvDŽØT«u7C üd5iàä [øšÚQÛÕµÕªÍ9Ìo¥'uîØ%_³Û(ò`Íñ²6!×Q¶žaÏ+¶Öž4U¡&.Ž°V«¡Â²pµÐsßk\õryo%¬
¬#-È\ã.Ð>+ªMdÚ6ÿ7çî¬0tuÓ!¿ÔFšQĵŸüûŒN ¥ÕiW)mYѧ¹lMÈuFÚüTš±ç
3ÍÕ»t#UIµ;Áh_
LEÛþÕ|ßâP3òÑ4TzÍ$zÛª·@×'@%Èl© (JPšŽÊX§ÖØkîYgCU}É"):»a9k0ï±æÙ^N{Ø59tk¬XÛÁð%£<õ8ª¥Ùçò8ý "±/¬ "1¬SÅ©:عnh?N¢béCe(Ü<Åd1ÑW ^ªæñ}ªc2_ÛFNtAsð.
zJtK:ì[+~ɳ)"|-éL>ZµÅ&ñv%kÉWŒ×&ÜYùéÔ²YØJ(¥Ò*ŒBgA:©°¯2ôdq;#aÂÍ*æ$.ÞNmª¬7ìŽÓeJ+" q=b$ôîN+ž á-\[yzÐ!ÍNŸVäì cÙÆBviŸãóÅfkÉbFS]8µNì/ëúó5HxñµËc«ùA8Íwîšu`uØ#µþS}Ñ€Ë7hÚö+,g
|ù !Ô7+~Em`Õ{²å£;@Å|ómwÅöXïhƶæó8µŸÉ©ë}'¢cÛŽ"
$6¥ÇÞ*éµ#æ4*éú6¢ëEŸ^v&L<Q·3Ž¹K7lòEÞä¡'Êà±I·¶b}µÑÜ»Ž"«|·ßæþ@àM1ûRÆÂÞZ¢ÞÀØb5guÂRH0ÝaØÚ6G(ßANk#x±À¶V¬ÄNžAµîzsb²Zû
Í.²ŽºÕ#gT,Z
ÞÈ
Ù¯ùd®ªÝ¶Â
YP+Ú#Uæ?1P;È<AÖTµ®F3!#¿AŸ³ÎÞÊãž.FKÛ
Þï=
ÎÝÈŸ\¿]WzêÙÖi5M[ÝFÀ-çEÎiiGpUzå5.X×ñÕµ<Š©Ôò]€Šb÷VVl¶±ç7ìÏöŸW§Âà§Ýçiš-å
✣í!×Jiâ
÷ö|Å÷
çžKH±¡ÒÍjcÙYÜ"ù÷!£5ÆræÑük°¡qûÎ$1¢¶¯€ãØ"«äõq¢ëük-¶-œ5¬ñqFT4zZZ^¬î±jÅ=ûX€£±jÎ êDPÇœ€öxã°NœÕ{Ë{Ï\~
Ôf÷Ž·ùÐc
õw-dí1Á{á¯ÔœeÏ_Uñ$G+ÂJtÕRšn²CE»²¡ÎãßF%
ªÀBÑÍK!ºVTÐH)²³.ÙwÊ¢>[XrMŽæ«íúFªç!
žéš;$ÅÄ\úÖ
EôJ¹Èéð*lÖ=#R<VjßÛSÉ·|õqïí
ëÂ,0h Š[öt/ ÌØCw %xaÙ¥ßÆ»GáóµmûœV¢í.ºà nûk»Zûä{ïG]UÚüµR
KV¬+Ú[fHBBcVºµÛÆœ±ŸÕ!4oz·¢¶Ü¿Ê·²;|ö
MÜò`±ØîcUë|éq3Ý]IUùV#÷-âå^APsÒ¶ã2b "I
tuÜÙZ¥åGCªš}ÓEŒjW(û;n)?S϶&D_b
"VAÔÉöcm:
êërdq1ñk"
!Æ~ÅÐeAIaõÚl7*[zŸ«ôG<2vÂé:üÅÖFãÞEpîÊ;yÚíuFÔÝ
¿¶ºeî~Lý{Ùž|}ï;¹âޱϬ[£ ±fipsr€vK¶!'¥ÉñÚÅÞv`EÃ{·î"äîtE×n:Gèc×buê
(ôónÝJsåÜ£#Múô`ÁÆé$ö(áÈLòÀøÆ&ÅØ¿=úÛµã,êº[.ÿ ®Õ±óÔŽsHeR&ìù#@·Fo¶Øµ/
ýŠC<ÒªdÒuGôŽ÷žÍà-l)Fýùvæør²7*wÚÂÉnâQvñ¡é¥ªLaðLN*VmíŽY
*wº u⺬ø¢Þ4ïóùhÈ8Ùg/ýzl ;TžÓåmÌ|Zg=|K
ëý|¶Uyùá>ÃœŠŠ³D+=M"ú÷ø"Ù©ÙgäyC¡§PÐê`a{@oA$)]ŠÓÓÈä|tÿŽu8þŽÊN4"
Øæ«ûÂyìnmn`ùF{nUeÏž7jv9€éà
dm%Ø;èSoBÌï|h§|µëÞþk)téktgn%ö³w8C³þÞæËl¿/;¿ùË__ýîÏU!§zœš]7í]ªŠéìùöÕ¹¿ÕK\ÿs=Z=MÕsUÿÕù&žßŒúU4È*ú.IGɺ^}Ÿr}Ÿrœ}{ŸµùÜÍ
NqÒksïçC^_òúw·*Ò=Ù ×#YWB(*úËkëPFsAÍ·WËmZµ`xÆXg ÇÂýüJúúŸZ«šyO¿Œvzt.ÖëSä¯þlyy±
endstream
endobj
8 0 obj
<<
/Resources 3 0 R
/Type /Page
/MediaBox [0 0 595 842]
/BleedBox [0 0 595 842]
/TrimBox [0 0 595 842]
/Parent 1 0 R
/Contents 12 0 R
>>
endobj
13 0 obj
4566
endobj
15 0 obj
<< /Type /Annot
/Subtype /Link
/Rect [ 356.22 665.72095 470.22 673.72095 ]
/C [ 0 0 0 ]
/Border [ 0 0 0 ]
/A << /URI (mailto:mmcallis@redhat.com)
/S /URI >>
/H /I
>>
endobj
17 0 obj
<< /Type /Annot
/Subtype /Link
/Rect [ 356.22 652.72095 458.22 660.72095 ]
/C [ 0 0 0 ]
/Border [ 0 0 0 ]
/A << /URI (mailto:dwalsh@redhat.com)
/S /URI >>
/H /I
>>
endobj
18 0 obj
<< /Type /Annot
/Subtype /Link
/Rect [ 356.22 639.72095 458.22 647.72095 ]
/C [ 0 0 0 ]
/Border [ 0 0 0 ]
/A << /URI (mailto:domg472@gmail.com)
/S /URI >>
/H /I
>>
endobj
19 0 obj
<< /Type /Annot
/Subtype /Link
/Rect [ 356.22 626.72095 482.22 634.72095 ]
/C [ 0 0 0 ]
/Border [ 0 0 0 ]
/A << /URI (mailto:eparis@parisplace.org)
/S /URI >>
/H /I
>>
endobj
20 0 obj
<< /Type /Annot
/Subtype /Link
/Rect [ 356.22 613.72095 464.22 621.72095 ]
/C [ 0 0 0 ]
/Border [ 0 0 0 ]
/A << /URI (mailto:jmorris@redhat.com)
/S /URI >>
/H /I
>>
endobj
21 0 obj
<< /Type /Annot
/Subtype /Link
/Rect [ 356.22 600.72095 464.22 608.72095 ]
/C [ 0 0 0 ]
/Border [ 0 0 0 ]
/A << /URI (mailto:sradvan@redhat.com)
/S /URI >>
/H /I
>>
endobj
22 0 obj
<< /Type /Annot
/Subtype /Link
/Rect [ 53.858 535.391 219.95801 544.74097 ]
/C [ 0 0 0 ]
/Border [ 0 0 0 ]
/A << /URI (http://www.opencontent.org/openpub/)
/S /URI >>
/H /I
>>
endobj
23 0 obj
<< /Type /Annot
/Subtype /Link
/Rect [ 133.278 404.391 312.11798 413.741 ]
/C [ 0 0 0 ]
/Border [ 0 0 0 ]
/A << /URI (http://fedoraproject.org/wiki/Legal/Export)
/S /URI >>
/H /I
>>
endobj
24 0 obj
<< /Length 25 0 R /Filter /FlateDecode >>
stream
xÍYKä4Ÿ÷¯Èd«ì8±%4R§»ÄmÅH=þ>~TÅÏL:;jíhMÚqÊõøꫲ;°ÿŸCû°×ZiÕýúrúçþ%vJöZénœB^ 1öv¢1cC/T÷ÒåCªûË}<~²·l®ýýg÷óéït?>}¶s~ëÀ~÷ß 6{Q?>æçÓ;ºçßIaoéÁtÏ/ݧïàb¯«œnöZ
Ñ>j÷6öqŽwŸC2&{Ý==ÐlE²Ïr÷§îs÷üãéöø4ä~yFKaß{p§Ó óÕÇíÕßI4s uVÍÄ#:¡mGv°Á`E¡Â5æÏaø3šîúØBHéL~ýT z9¯¯R# Zõ µÓ)fïÐEþ¢ìAÇV!¿|>ùf ÌîÊFÞGÖ'6IK°p$œŠÊäêl5+Ï€×9ÑM×+)¡Yœéö.LiŸs¢°¢ÅÜ¢,[" Ç1FÎFñuޢŶèšø37t9\2{Îä"E0X¡òØPSšTJR÷œt÷ï¯: tB
[...10138 lines suppressed...]
0000575303 00000 n
0000417406 00000 n
0000417551 00000 n
0000575387 00000 n
0000417697 00000 n
0000417843 00000 n
0000575473 00000 n
0000417989 00000 n
0000418137 00000 n
0000575559 00000 n
0000418285 00000 n
0000418431 00000 n
0000575645 00000 n
0000418577 00000 n
0000418723 00000 n
0000418869 00000 n
0000419015 00000 n
0000419159 00000 n
0000419303 00000 n
0000419449 00000 n
0000419593 00000 n
0000575731 00000 n
0000419737 00000 n
0000419882 00000 n
0000575817 00000 n
0000420026 00000 n
0000420169 00000 n
0000575901 00000 n
0000420311 00000 n
0000420454 00000 n
0000575987 00000 n
0000420598 00000 n
0000420741 00000 n
0000420885 00000 n
0000429776 00000 n
0000430128 00000 n
0000429798 00000 n
0000430298 00000 n
0000576073 00000 n
0000576157 00000 n
0000430319 00000 n
0000576210 00000 n
0000430424 00000 n
0000430535 00000 n
0000430676 00000 n
0000430823 00000 n
0000431024 00000 n
0000431147 00000 n
0000431249 00000 n
0000431458 00000 n
0000431763 00000 n
0000431841 00000 n
0000432074 00000 n
0000432182 00000 n
0000432287 00000 n
0000432407 00000 n
0000432525 00000 n
0000432790 00000 n
0000432896 00000 n
0000433031 00000 n
0000433151 00000 n
0000433408 00000 n
0000433509 00000 n
0000433628 00000 n
0000433745 00000 n
0000434019 00000 n
0000434120 00000 n
0000434324 00000 n
0000434576 00000 n
0000434750 00000 n
0000434853 00000 n
0000434959 00000 n
0000435072 00000 n
0000435219 00000 n
0000435325 00000 n
0000435450 00000 n
0000435559 00000 n
0000435742 00000 n
0000435851 00000 n
0000435974 00000 n
0000436099 00000 n
0000436268 00000 n
0000436372 00000 n
0000436505 00000 n
0000436639 00000 n
0000436851 00000 n
0000436981 00000 n
0000437279 00000 n
0000437395 00000 n
0000437531 00000 n
0000437676 00000 n
0000437803 00000 n
0000437915 00000 n
0000438200 00000 n
0000438323 00000 n
0000438464 00000 n
0000438613 00000 n
0000438743 00000 n
0000438858 00000 n
0000438993 00000 n
0000439259 00000 n
0000439508 00000 n
0000439682 00000 n
0000576295 00000 n
0000439831 00000 n
0000440053 00000 n
0000440349 00000 n
0000440482 00000 n
0000440717 00000 n
0000440818 00000 n
0000440962 00000 n
0000441214 00000 n
0000576381 00000 n
0000441373 00000 n
0000576467 00000 n
0000441487 00000 n
0000441608 00000 n
0000441864 00000 n
0000442100 00000 n
0000442215 00000 n
0000442333 00000 n
0000442602 00000 n
0000442696 00000 n
0000442793 00000 n
0000442986 00000 n
0000443251 00000 n
0000456244 00000 n
0000456349 00000 n
0000456519 00000 n
0000457042 00000 n
0000457659 00000 n
0000457932 00000 n
0000467059 00000 n
0000467166 00000 n
0000467342 00000 n
0000467747 00000 n
0000468239 00000 n
0000468349 00000 n
0000468617 00000 n
0000485915 00000 n
0000486028 00000 n
0000486201 00000 n
0000486819 00000 n
0000487517 00000 n
0000487786 00000 n
0000501486 00000 n
0000501593 00000 n
0000501765 00000 n
0000502222 00000 n
0000502774 00000 n
0000502885 00000 n
0000503155 00000 n
0000525095 00000 n
0000525218 00000 n
0000525391 00000 n
0000526010 00000 n
0000526726 00000 n
0000526999 00000 n
0000546078 00000 n
0000546195 00000 n
0000546367 00000 n
0000546912 00000 n
0000547555 00000 n
0000547631 00000 n
0000547900 00000 n
0000564654 00000 n
0000564771 00000 n
0000564941 00000 n
0000565501 00000 n
0000566149 00000 n
0000566172 00000 n
0000566192 00000 n
0000566213 00000 n
0000566235 00000 n
0000566255 00000 n
0000566276 00000 n
0000566299 00000 n
0000566319 00000 n
0000566340 00000 n
0000566363 00000 n
0000566383 00000 n
0000566404 00000 n
0000566427 00000 n
0000566447 00000 n
0000566468 00000 n
0000566491 00000 n
0000566511 00000 n
0000566532 00000 n
0000566555 00000 n
0000566575 00000 n
trailer
<<
/Size 881
/Root 2 0 R
/Info 4 0 R
/ID [<43D73A187FFC985AEC36F10FD3BE910B> <43D73A187FFC985AEC36F10FD3BE910B>]
>>
startxref
576551
%%EOF
14 years, 10 months
web/html/docs/selinux-user-guide/f11/es-ES/html-single index.html, NONE, 1.1
by Eric Christensen
Author: sparks
Update of /cvs/fedora/web/html/docs/selinux-user-guide/f11/es-ES/html-single
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv1493
Added Files:
index.html
Log Message:
Adding es-ES single-html.
--- NEW FILE index.html ---
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Linux con Seguridad Mejorada</title><link rel="stylesheet" href="./Common_Content/css/default.css" type="text/css"/><meta name="generator" content="publican"/><meta name="package" content=""/><meta name="description" content="Este libro es acerca de la administración y uso del Linux de Seguridad Mejorada."/></head><body class=""><div class="book" lang="es-ES"><div class="titlepage"><div><div class="producttitle"><span class="productname">Fedora</span> <span class="productnumber">11</span></div><div><h1 id="d0e1" class="title">Linux con Seguridad Mejorada</h1></div><div><h2 class="subtitle">Guía del Usuario</h2></div><p class="edition">Edición 1.3</p><div><h3 class="corpauthor">
<span class="inlinemediaobject"><object data="Common_Content/images/title_logo.svg" type="image/svg+xml"> Logo</object></span>
</h3></div><div><div class="authorgroup"><div class="author"><h3 class="author"><span class="firstname">Murray</span> <span class="surname">McAllister</span></h3><div class="affiliation"><span class="orgname">Red Hat</span> <span class="orgdiv">Ingeniería de Servicios de Contenidos</span></div><code class="email"><a class="email" href="mailto:mmcallis@redhat.com">mmcallis(a)redhat.com</a></code></div><div class="author"><h3 class="author"><span class="firstname">Daniel</span> <span class="surname">Walsh</span></h3><div class="affiliation"><span class="orgname">Red Hat</span> <span class="orgdiv">Ingeniería de Seguridad</span></div><code class="email"><a class="email" href="mailto:dwalsh@redhat.com">dwalsh(a)redhat.com</a></code></div><div class="author"><h3 class="author"><span class="firstname">Dominick</span> <span class="surname">Grift</span></h3><span class="contrib">Editor Técnico para la Introducción, Contextos de SELinux, Política Destinada, Trabajando con SELinux,
Confinando Usuarios, y capítulos de Resolución de Problemas.</span> <div class="affiliation"><span class="orgname"/> <span class="orgdiv"/></div><code class="email"><a class="email" href="mailto:domg472@gmail.com">domg472(a)gmail.com</a></code></div><div class="author"><h3 class="author"><span class="firstname">Eric</span> <span class="surname">Paris</span></h3><span class="contrib">Editor Técnico para las secciones de Montaje de Sistemas de Archivo y Mensajes de Auditoría Crudos..</span> <div class="affiliation"><span class="orgname">Red Hat</span> <span class="orgdiv">Ingeniería de Seguridad</span></div><code class="email"><a class="email" href="mailto:eparis@parisplace.org">eparis(a)parisplace.org</a></code></div><div class="author"><h3 class="author"><span class="firstname">James</span> <span class="surname">Morris</span></h3><span class="contrib">Editor Técnico para los capítolos de Introducción y Política Destinada.</span> <div class="affiliation"><span class=
"orgname">Red Hat</span> <span class="orgdiv">Ingeniería de Seguridad</span></div><code class="email"><a class="email" href="mailto:jmorris@redhat.com">jmorris(a)redhat.com</a></code></div><div class="author"><h3 class="author"><span class="firstname">Scott</span> <span class="surname">Radvan</span></h3><div class="affiliation"><span class="orgname">Red Hat</span> <span class="orgdiv">Ingeniería de Servicios de Contenido</span></div><code class="email"><a class="email" href="mailto:sradvan@redhat.com">sradvan(a)redhat.com</a></code></div></div></div><div><p class="copyright">Copyright © 2009 Red Hat, Inc.</p></div><hr/><div><div id="d0e35" class="legalnotice"><h1 class="legalnotice">aviso legal</h1><div class="para">
Copyright <span class="trademark"/>© 2009 Red Hat, Inc. This material may only be distributed subject to the terms and conditions set forth in the Open Publication License, V1.0, (the latest version is presently available at <a href="http://www.opencontent.org/openpub/">http://www.opencontent.org/openpub/</a>).
</div><div class="para">
Fedora and the Fedora Infinity Design logo are trademarks or registered trademarks of Red Hat, Inc., in the U.S. and other countries.
</div><div class="para">
Red Hat and the Red Hat "Shadow Man" logo are registered trademarks of Red Hat Inc. in the United States and other countries.
</div><div class="para">
All other trademarks and copyrights referred to are the property of their respective owners.
</div><div class="para">
Documentation, as with software itself, may be subject to export control. Read about Fedora Project export controls at <a href="http://fedoraproject.org/wiki/Legal/Export">http://fedoraproject.org/wiki/Legal/Export</a>.
</div></div></div><div><div class="abstract"><h6>Resumen</h6><div class="para">Este libro es acerca de la administración y uso del <span class="trademark">Linux</span>® de Seguridad Mejorada.</div></div></div></div><hr/></div><div class="toc"><dl><dt><span class="preface"><a href="#pref-Security-Enhanced_Linux-Preface">Prefacio</a></span></dt><dd><dl><dt><span class="section"><a href="#d0e158">1. Convenciones del Documento</a></span></dt><dd><dl><dt><span class="section"><a href="#d0e168">1.1. Convenciones Tipográficas</a></span></dt><dt><span class="section"><a href="#d0e384">1.2. Convenciones del documento</a></span></dt><dt><span class="section"><a href="#d0e403">1.3. Notas y Advertencias</a></span></dt></dl></dd><dt><span class="section"><a href="#d0e423">2. ¡Necesitamos sus comentarios!</a></span></dt></dl></dd><dt><span class="chapter"><a href="#chap-Security-Enhanced_Linux-Trademark_Information">1. Información de Marca Comercial</a></span></dt><dd><dl><dt><span c
lass="section"><a href="#chap-Security-Enhanced_Linux-Trademark_Information-Source_Code">1.1. Source Code</a></span></dt></dl></dd><dt><span class="chapter"><a href="#chap-Security-Enhanced_Linux-Introduction">2. Introducción</a></span></dt><dd><dl><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Introduction-Benefits_of_running_SELinux">2.1. Beneficios de usar SELinux</a></span></dt><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Introduction-Examples">2.2. Ejemplos</a></span></dt><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Introduction-SELinux_Architecture">2.3. Arquitectura de SELinux</a></span></dt><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Introduction-SELinux_on_Other_Operating_Systems">2.4. SELinux en otros Sistemas Operativos</a></span></dt></dl></dd><dt><span class="chapter"><a href="#chap-Security-Enhanced_Linux-SELinux_Contexts">3. Contextos de SELinux</a></span></dt><dd><dl><dt><span cla
ss="section"><a href="#sect-Security-Enhanced_Linux-SELinux_Contexts-Domain_Transitions">3.1. Transiciones de Dominios</a></span></dt><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-SELinux_Contexts-SELinux_Contexts_for_Processes">3.2. Contextos de SELinux para los Procesos</a></span></dt><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-SELinux_Contexts-SELinux_Contexts_for_Users">3.3. Contextos de SELinux para los Usuarios</a></span></dt></dl></dd><dt><span class="chapter"><a href="#chap-Security-Enhanced_Linux-Targeted_Policy">4. Política Destinado</a></span></dt><dd><dl><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Targeted_Policy-Confined_Processes">4.1. Procesos Confinados</a></span></dt><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Targeted_Policy-Unconfined_Processes">4.2. Procesos no Confinados</a></span></dt><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Targeted_Policy-Confine
d_and_Unconfined_Users">4.3. Usuarios Confinados y no Confinados</a></span></dt></dl></dd><dt><span class="chapter"><a href="#chap-Security-Enhanced_Linux-Working_with_SELinux">5. Trabajando con SELinux</a></span></dt><dd><dl><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Working_with_SELinux-SELinux_Packages">5.1. Paquetes de SELinux</a></span></dt><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Working_with_SELinux-Which_Log_File_is_Used">5.2. Qué Archivo Log se usa</a></span></dt><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Working_with_SELinux-Main_Configuration_File">5.3. Archivo de Configuración Principal</a></span></dt><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Working_with_SELinux-Enabling_and_Disabling_SELinux">5.4. Habilitando y Deshabilitando SELinux</a></span></dt><dd><dl><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Enabling_and_Disabling_SELinux-Enabling_SELinux">5
.4.1. Habilitando SELinux</a></span></dt><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Enabling_and_Disabling_SELinux-Disabling_SELinux">5.4.2. Deshabilitando SELinux</a></span></dt></dl></dd><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Working_with_SELinux-SELinux_Modes">5.5. Modos de SELinux</a></span></dt><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Working_with_SELinux-Booleans">5.6. Booleanos</a></span></dt><dd><dl><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Booleans-Listing_Booleans">5.6.1. Listando los Booleanos</a></span></dt><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Booleans-Configuring_Booleans">5.6.2. Configurando los Booleanos</a></span></dt><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Booleans-Booleans_for_NFS_and_CIFS">5.6.3. Booleanos para NFS y CIFS</a></span></dt></dl></dd><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-
Working_with_SELinux-SELinux_Contexts_Labeling_Files">5.7. Contextos de SELinux - Etiquetado de Archivos</a></span></dt><dd><dl><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-SELinux_Contexts_Labeling_Files-Temporary_Changes_chcon">5.7.1. Cambios Temporales: chcon</a></span></dt><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-SELinux_Contexts_Labeling_Files-Persistent_Changes_semanage_fcontext">5.7.2. Cambios Persistentes: semanage fcontext</a></span></dt></dl></dd><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Working_with_SELinux-The_file_t_and_default_t_Types">5.8. Los tipos file_t y default_t</a></span></dt><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Working_with_SELinux-Mounting_File_Systems">5.9. Montaje de Sistemas de Archivos</a></span></dt><dd><dl><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Mounting_File_Systems-Context_Mounts">5.9.1. Montajes de Contexto</a></span></dt><d
t><span class="section"><a href="#sect-Security-Enhanced_Linux-Mounting_File_Systems-Changing_the_Default_Context">5.9.2. Cambio del Contexto Predeterminado</a></span></dt><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Mounting_File_Systems-Mounting_an_NFS_File_System">5.9.3. Montando un Sistema de Archivos NFS</a></span></dt><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Mounting_File_Systems-Multiple_NFS_Mounts">5.9.4. Montajes NFS Múltiples</a></span></dt><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Mounting_File_Systems-Making_Context_Mounts_Persistent">5.9.5. Haciendo Persistente los Contextos de Montajes</a></span></dt></dl></dd><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Working_with_SELinux-Maintaining_SELinux_Labels_">5.10. Mantención de las Etiquetas de SELinux </a></span></dt><dd><dl><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Maintaining_SELinux_Labels_-Copying_Fil
es_and_Directories">5.10.1. Copia de Directorios y Archivos</a></span></dt><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Maintaining_SELinux_Labels_-Moving_Files_and_Directories">5.10.2. Movimiento de Archivos y Directorios</a></span></dt><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Maintaining_SELinux_Labels_-Checking_the_Default_SELinux_Context">5.10.3. Chequeando el Contexto SELinux Predeterminado</a></span></dt><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Maintaining_SELinux_Labels_-Archiving_Files_with_tar">5.10.4. Archivando archivos con tar</a></span></dt><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Maintaining_SELinux_Labels_-Archiving_Files_with_star">5.10.5. Archivando archivos con tar</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="#chap-Security-Enhanced_Linux-Confining_Users">6. Confinando a los Usuarios</a></span></dt><dd><dl><dt><span class="section"><a href="#
sect-Security-Enhanced_Linux-Confining_Users-Linux_and_SELinux_User_Mappings">6.1. Linux y los Mapeos de Usuarios de SELinux</a></span></dt><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Confining_Users-Confining_New_Linux_Users_useradd">6.2. Confinando Usuarios Nuevos de Linux: useradd</a></span></dt><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Confining_Users-Confining_Existing_Linux_Users_semanage_login">6.3. Confinando Usuarios Linux Existentes: semanage login</a></span></dt><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Confining_Users-Changing_the_Default_Mapping">6.4. Cambiando el Mapeo Predeterminado</a></span></dt><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Confining_Users-xguest_Kiosk_Mode">6.5. xguest: Modo Kiosk</a></span></dt><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Confining_Users-Booleans_for_Users_Executing_Applications">6.6. Booleanos para que los Usuarios Ej
ecuten Aplicaciones</a></span></dt></dl></dd><dt><span class="chapter"><a href="#chap-Security-Enhanced_Linux-Troubleshooting">7. Solución a Problemas</a></span></dt><dd><dl><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Troubleshooting-What_Happens_when_Access_is_Denied">7.1. Qué pasa cuando el Acceso es Denegado</a></span></dt><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Troubleshooting-Top_Three_Causes_of_Problems">7.2. Tres Principales Causas de Problemas</a></span></dt><dd><dl><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Top_Three_Causes_of_Problems-Labeling_Problems">7.2.1. Problemas de Etiquetados</a></span></dt><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Top_Three_Causes_of_Problems-How_are_Confined_Services_Running">7.2.2. ¿Cómo se Ejecutan los Servicios Confinados?</a></span></dt><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Top_Three_Causes_of_Problems-Evolving_Ru
les_and_Broken_Applications">7.2.3. Evolucionando las Reglas y las Aplicaciones Rotas</a></span></dt></dl></dd><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Troubleshooting-Fixing_Problems">7.3. Corrección de Problemas</a></span></dt><dd><dl><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Fixing_Problems-Linux_Permissions">7.3.1. Permisos de Linux</a></span></dt><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Fixing_Problems-Possible_Causes_of_Silent_Denials">7.3.2. Posibles Causas de las Negaciones Silenciosas</a></span></dt><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Fixing_Problems-Manual_Pages_for_Services">7.3.3. Páginas de Manual para Servicios</a></span></dt><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Fixing_Problems-Permissive_Domains">7.3.4. Dominios Permisivos</a></span></dt><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Fixing_Problems-Searching_For_a
nd_Viewing_Denials">7.3.5. Búsqueda y Revisión de Negaciones</a></span></dt><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Fixing_Problems-Raw_Audit_Messages">7.3.6. Mensajes Crudos de Auditoría</a></span></dt><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Fixing_Problems-sealert_Messages">7.3.7. Mensajes sealert</a></span></dt><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Fixing_Problems-Allowing_Access_audit2allow">7.3.8. Permitiendo el Acceso: audit2allow</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="#chap-Security-Enhanced_Linux-Further_Information">8. Información Adicional</a></span></dt><dd><dl><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Further_Information-Contributors">8.1. Contributors</a></span></dt><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Further_Information-Other_Resources">8.2. Other Resources</a></span></dt></dl></dd><dt><span class="a
ppendix"><a href="#appe-Security-Enhanced_Linux-Revision_History">A. Revision History</a></span></dt></dl></div><div class="preface" lang="es-ES"><div class="titlepage"><div><div><h1 id="pref-Security-Enhanced_Linux-Preface" class="title">Prefacio</h1></div></div></div><div class="para">
La Guía del Usuario de SELinux de Fedora 11 es para gente sin o con mínima experiencia con SELinux. Aunque la experiencia de administración de sistema no es necesario, el contenido de esta guía se escribe para tareas de administración del sistema. Esta guía provee una introducción a los conceptos fundamentales y aplicaciones prácticas de SELinux. Después de leer esta guía debe tener un entendimiento intermedio de SELinux.
</div><div class="para">
Gracias a todos los que nos alentaron, ofrecieron ayuda y lo probaron - la ayuda es muy apreciada. Agradecimientos muy especiales a:
</div><div class="itemizedlist"><ul><li><div class="para">
Dominick Grift, Stephen Smalley y Russell Coker por sus contribuciones, ayuda y paciencia.
</div></li><li><div class="para">
Karsten Wade por su ayuda, al agregar un componente para esta guía en el <a href="https://bugzilla.redhat.com/">Bugzilla de Red Hat</a> y resolver el sitio web en <a href="http://docs.fedoraproject.org/">http://docs.fedoraproject.org/</a>.
</div></li><li><div class="para">
Al <a href="http://fedoraproject.org/wiki/Infrastructure">Equipo de Infraestructura de Fedora</a> por proveer el alojamiento.
</div></li><li><div class="para">
Jens-Ulrik Petersen por asegurar que la oficina de Brisbane de Red Hat tenga espejos de Fedora actualizados.
</div></li></ul></div><div class="section" lang="es-ES"><div class="titlepage"><div><div><h2 class="title" id="d0e158">1. Convenciones del Documento</h2></div></div></div><div class="para">
Este manual utiliza varias convenciones para resaltar algunas palabras y frases y llamar la atención sobre ciertas partes específicas de información.
</div><div class="para">
En ediciones PDF y de papel, este manual utiliza tipos de letra procedentes de <a href="https://fedorahosted.org/liberation-fonts/">Liberation Fonts</a>. Liberation Fonts también se utilizan en ediciones de HTML si están instalados en su sistema. Si no, se muestran tipografías alternativas pero equivalentes. Nota: Red Hat Enterprise Linux 5 y siguientes incluyen Liberation Fonts predeterminadas.
</div><div class="section" lang="es-ES"><div class="titlepage"><div><div><h3 class="title" id="d0e168">1.1. Convenciones Tipográficas</h3></div></div></div><div class="para">
Se utilizan cuatro convenciones tipográficas para llamar la atención sobre palabras o frases específicas. Dichas convenciones y las circunstancias en que se aplican son las siguientes:
</div><div class="para">
<code class="literal">Negrita monoespaciado</code>
</div><div class="para">
Utilizada para resaltar la entrada del sistema, incluyendo comandos de shell, nombres de archivo y rutas. También se utiliza para resaltar teclas claves y combinaciones de teclas.
</div><div class="blockquote"><blockquote class="blockquote"><div class="para">
Para ver el contenido del archivo <code class="filename">my_next_bestselling_novel</code> en su directorio actual de trabajo, escriba el comando <code class="command">cat my_next_bestselling_novel</code> en el intérprete de comandos de shell y pulse <span class="keycap"><strong>Enter</strong></span> para ejecutar el comando.
</div></blockquote></div><div class="para">
Lo anterior incluye un nombre de archivo, un comando de shell y una tecla clave, todo en negrita-monoespaciado y distinguible gracias al contexto.
</div><div class="para">
Las combinaciones de teclas se pueden distinguir de las teclas claves mediante el guión que conecta cada parte de una combinación de tecla. Por ejemplo:
</div><div class="blockquote"><blockquote class="blockquote"><div class="para">
Pulse <span class="keycap"><strong>Enter</strong></span> para ejecutar el comando.
</div><div class="para">
Pulse <span class="keycap"><strong>Control</strong></span>+<span class="keycap"><strong>Alt</strong></span>+<span class="keycap"><strong>F1</strong></span> para cambiar a la primera terminal virtual. Pulse <span class="keycap"><strong>Control</strong></span>+<span class="keycap"><strong>Alt</strong></span>+<span class="keycap"><strong>F7</strong></span> para volver a su sesión de Ventanas-X.
</div></blockquote></div><div class="para">
La primera oración resalta la tecla clave determinada que se debe pulsar. La segunda resalta dos conjuntos de tres teclas claves, cada conjunto presionado simultáneamente.
</div><div class="para">
Si el código fuente es discutido, nombres de clase, métodos, funciones, nombres de variables, y valores de retorno mencionados dentro de un párrafo serán presentados como lo anterior, en <code class="literal">Negrita-monoespaciado</code>. Por ejemplo:
</div><div class="blockquote"><blockquote class="blockquote"><div class="para">
Las clases de archivo relacionadas incluyen <code class="classname">filename</code> para sistema de archivos, <code class="classname">file</code> para archivos y <code class="classname">dir</code> para directorios. Cada clase tiene su propio conjunto asociado de permisos.
</div></blockquote></div><div class="para">
<span class="application"><strong>Negrita proporcional</strong></span>
</div><div class="para">
Esta denota palabras o frases encontradas en un sistema, incluyendo nombres de aplicación; texto de cuadro de diálogo, botones etiquetados, etiquetas de cajilla de verificación y botón de radio; títulos de menú y títulos del sub-menú. Por ejemplo:
</div><div class="blockquote"><blockquote class="blockquote"><div class="para">
Seleccionar <span class="guimenu"><strong>Sistema > Preferencias > Ratón</strong></span> desde la barra del menú principal para lanzar <span class="application"><strong>Preferencias de Ratón</strong></span>. En la pestaña de <span class="guilabel"><strong>Botones</strong></span>, haga clic en la cajilla <span class="guilabel"><strong>ratón de mano izquierda</strong></span> y luego haga clic en <span class="guibutton"><strong>Cerrar</strong></span> para cambiar el botón principal del ratón de la izquierda a la derecha (adecuando el ratón para la mano izquierda).
</div><div class="para">
Para insertar un caracter especial en un archivo <span class="application"><strong>gedit</strong></span>, seleccione desde la barra del menú principal <span class="guimenu"><strong>Aplicaciones > Accesorios > Mapa de caracteres</strong></span>. Luego, desde la barra del menú elija <span class="guimenu"><strong>Búsqueda > Hallar…</strong></span> <span class="application"><strong>mapa de caracteres</strong></span>, teclee el nombre del caracter en el campo de <span class="guilabel"><strong>Búsqueda</strong></span> y haga clic en <span class="guibutton"><strong>Siguiente</strong></span>. El caracter buscado se resaltará en la <span class="guilabel"><strong>Tabla de caracteres</strong></span>. Haga doble clic en este caracter resaltado para colocarlo en el campo de <span class="guilabel"><strong>Texto para copiar</strong></span> y luego haga clic en el botón de <span class="guibutton"><strong>Copiar</strong></span>. Ahora regrese a su documento y elija <span
class="guimenu"><strong>Editar > Pegar</strong></span> desde la barra de menú de <span class="application"><strong>gedit</strong></span>.
</div></blockquote></div><div class="para">
El texto anterior incluye nombres de aplicación; nombres de menú de todo el sistema y elementos; nombres de menú de aplicaciones específicas y botones y texto hallados dentro de una interfaz GUI, todos presentados en negrita proporcional y distinguibles por contexto.
</div><div class="para">
Observe la <span class="guimenu"><strong> ></strong></span> abreviatura utilizada para indicar recorrido a través de un menú y sus sub-menúes. Esto es para evitar la dificultad de seguir el método 'Seleccionar <span class="guimenuitem"><strong>Ratón</strong></span> desde el sub-menú <span class="guimenu"><strong>Preferencias</strong></span> en el menú de <span class="guimenu"><strong>Sistema</strong></span> de la barra de menú principal'.
</div><div class="para">
<code class="command"><em class="replaceable"><code>Itálicas-negrita monoespaciado</code></em></code> o <span class="application"><strong><em class="replaceable"><code>Itálicas-negrita proporcional</code></em></strong></span>
</div><div class="para">
Negrita monoespaciado o Negrita proporcional, la adición de itálicas indica texto reemplazable o variable. Las itálicas denotan texto que usted no escribe literalmente o texto mostrado que cambia dependiendo de la circunstancia. Por ejemplo:
</div><div class="blockquote"><blockquote class="blockquote"><div class="para">
Para conectar a una máquina remota utilizando ssh, teclee <code class="command">ssh <em class="replaceable"><code>nombredeusuario</code></em>@<em class="replaceable"><code>dominio.nombre</code></em></code> en un intérprete de comandos de shell. Si la máquina remota es <code class="filename">example.com</code> y su nombre de usuario en esa máquina es john, teclee <code class="command">ssh john(a)example.com</code>.
</div><div class="para">
El comando <code class="command">mount -o remount <em class="replaceable"><code>file-system</code></em></code> remonta el sistema de archivo llamado. Por ejemplo, para volver a montar el sistema de archivo <code class="filename">/home</code>, el comando es <code class="command">mount -o remount /home</code>.
</div><div class="para">
Para ver la versión de un paquete actualmente instalado, utilice el comando <code class="command">rpm -q <em class="replaceable"><code>paquete</code></em></code>. Éste entregará el resultado siguiente: <code class="command"><em class="replaceable"><code>paquete-versión-lanzamiento</code></em></code>.
</div></blockquote></div><div class="para">
Observe las palabras en itálicas- negrita sobre — nombre de usuario, domain.name, sistema de archivo, paquete, versión y lanzamiento. Cada palabra es un marcador de posición, tanto para el texto que usted escriba al ejecutar un comando como para el texto mostrado por el sistema.
</div><div class="para">
Aparte del uso estándar para presentar el título de un trabajo, las itálicas denotan el primer uso de un término nuevo e importante. Por ejemplo:
</div><div class="blockquote"><blockquote class="blockquote"><div class="para">
cuando el servidor Apache HTTP acepta solicitudes, envía procesos hijos o hilos para manejarlos. Este grupo de procesos hijos o hilos se conoce como un <em class="firstterm">server-pool</em>. Bajo el servidor HTTP de Apache 2.0, la responsabilidad para crear o mantener estos server-pool se resume en un grupo de módulos llamado <em class="firstterm">Módulos de multi-procesamiento</em> (<em class="firstterm">MPMs</em>). A diferencia de otros módulos, sólo un módulo del grupo MPM puede ser cargado por el servidor HTTP de Apache.
</div></blockquote></div></div><div class="section" lang="es-ES"><div class="titlepage"><div><div><h3 class="title" id="d0e384">1.2. Convenciones del documento</h3></div></div></div><div class="para">
Dos, usualmente de varias líneas, los tipos de datos se distinguen visualmente del texto circundante.
</div><div class="para">
Salida enviada a una terminal está establecida en tipo <code class="computeroutput">romano monoespaciado</code> y presentada así:
</div><pre class="screen">libros Escritorio documentación borradores mss fotos cosas svn
libros_pruebas Escritorio1 descargas imágenes notas scripts svgs
</pre><div class="para">
Los listados de código fuente también se establecen en <code class="computeroutput">romano monoespaciado</code>, pero se presentan y resaltan de la siguiente manera:
</div><pre class="programlisting">package org.jboss.book.jca.ex1;
import javax.naming.InitialContext;
public class ExClient
{
public static void main(String args[])
throws Exception
{
InitialContext iniCtx = new InitialContext();
Object ref = iniCtx.lookup("EchoBean");
EchoHome home = (EchoHome) ref;
Echo echo = home.create();
System.out.println("Created Echo");
System.out.println("Echo.echo('Hello') = " + echo.echo("Hello"));
}
}
</pre></div><div class="section" lang="es-ES"><div class="titlepage"><div><div><h3 class="title" id="d0e403">1.3. Notas y Advertencias</h3></div></div></div><div class="para">
Finalmente, utilizamos tres estilos visuales para llamar la atención sobre la información que de otro modo se podría pasar por alto.
</div><div class="note"><h2>Nota</h2><div class="para">
Una nota es una sugerencia, atajo o enfoque alternativo que se tiene a mano para la tarea. Ignorar una nota no debería tener consecuencias negativas, pero podría perderse de algunos trucos que pueden facilitarle las cosas.
</div></div><div class="important"><h2>Importante</h2><div class="para">
Los cuadros de importante dan detalles de cosas que se pueden pasar por alto fácilmente: cambios de configuración únicamente aplicables a la sesión actual, o servicios que necesitan reiniciarse antes de que se aplique una actualización. Ignorar estos cuadros de importante no ocasionará pérdida de datos, pero puede causar enfado y frustración.
</div></div><div class="warning"><h2>Advertencia</h2><div class="para">
Las advertencias no deben ignorarse. Ignorarlas muy probablemente ocasionará pérdida de datos.
</div></div></div></div><div class="section" lang="es-ES"><div class="titlepage"><div><div><h2 class="title" id="d0e423">2. ¡Necesitamos sus comentarios!</h2></div></div></div><a id="d0e426" class="indexterm"/><div class="para">
Si encuentra un error tipográfico en este manual o si sabe de alguna manera de mejorarlo, nos gustaría escuchar sus sugerencias. Por favor complete un reporte en Bugzilla: <a href="http://bugzilla.redhat.com/bugzilla/">http://bugzilla.redhat.com/bugzilla/</a> usando el producto <span class="application"><strong>Fedora Documentation</strong></span>.
</div><div class="para">
Cuando envíe un reporte de error no olvide mencionar el identificador del manual: <em class="citetitle">selinux-user-guide</em>
</div><div class="para">
Si tiene una sugerencia para mejorar la documentación, intente ser tan específico como sea posible cuando describa su sugerencia. Si ha encontrado un error, por favor incluya el número de sección y parte del texto que rodea el error para que podamos encontrarlo más fácilmente.
</div></div></div><div class="chapter" lang="es-ES"><div class="titlepage"><div><div><h2 class="title" id="chap-Security-Enhanced_Linux-Trademark_Information">Capítulo 1. Información de Marca Comercial</h2></div></div></div><div class="toc"><dl><dt><span class="section"><a href="#chap-Security-Enhanced_Linux-Trademark_Information-Source_Code">1.1. Source Code</a></span></dt></dl></div><div class="para">
<span class="trademark">Linux</span>® es una marca comercial registrada de Linus Torvalds en los EEUU y en otros países.
</div><div class="para">
UNIX es una marca comercial registrada de El Grupo Abierto.
</div><div class="para">
Type Enforcement (Obligación de Tipos) es una marca comercial de Secure Computing, LLC, una subsidiaria de McAfee, Inc., registrada en los EEUU y en otros países. Ni McAfee ni Secure Computing, LLC, ha consentido el uso o referencia de esta marca comercial para el autor fuera de esta guía.
</div><div class="para">
Apache es una marca comercial de La Fundación de Software Apache.
</div><div class="para">
MySQL es una marca comercial o marca comercial registrada de MySQL AB en los EEUU y en otros países.
</div><div class="section" lang="es-ES"><div class="titlepage"><div><div><h2 class="title" id="chap-Security-Enhanced_Linux-Trademark_Information-Source_Code">1.1. Source Code</h2></div></div></div><div class="para">
The XML source for this guide is available at <a href="http://svn.fedorahosted.org/svn/selinuxguide/">http://svn.fedorahosted.org/svn/selinuxguide/</a>
</div></div></div><div class="chapter" lang="es-ES"><div class="titlepage"><div><div><h2 class="title" id="chap-Security-Enhanced_Linux-Introduction">Capítulo 2. Introducción</h2></div></div></div><div class="toc"><dl><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Introduction-Benefits_of_running_SELinux">2.1. Beneficios de usar SELinux</a></span></dt><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Introduction-Examples">2.2. Ejemplos</a></span></dt><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Introduction-SELinux_Architecture">2.3. Arquitectura de SELinux</a></span></dt><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Introduction-SELinux_on_Other_Operating_Systems">2.4. SELinux en otros Sistemas Operativos</a></span></dt></dl></div><div class="para">
Los Archivos, tales como directorios y dispositivos, se llaman objetos. Los procesos, tal como un comando que ejecuta el usuario o la aplicación <span class="trademark">Mozilla</span>®<span class="trademark"> Firefox</span>®, se llaman sujetos. La mayoría de los sistemas oeprativos usan un sistema de Control de Acceso Discrecional (DAC), que controla cómo interactuan los sujetos con los objetos, y cómo los sujetos interactuan entre sí. En sistemas operativos que usan DAC, los usuarios controlan los permisos de archivos (objetos) de los que son dueños. Por ejemplo, en sistemas operativos <span class="trademark">Linux</span>®, los usuarios pueden hacer sus directorios legibles para el resto del mundo, dando a los usuarios y procesos (sujetos) acceso a información potencialmente sensible.
</div><div class="para">
Los mecanismos DAC son fundamentalmente inadecuados para una fuerte seguridad del sistema. Las decisiones de acceso DAC son sólo basadas en la identidad del usuario y su propiedad, ignorando información de seguridad relevante tal como el rol del usuario, la función y la confiabilidad del programa, y la sensibilidad e integridad de los datos. Cada usuario tiene completa discreción sobre sus archivos, haciendo imposible aplicar una política de seguridad a nivel de sistema. Más aún, cada programa que ejecuta un usuario hereda todos los permisos garantizados al usuario y es libre de cambiar el acceso de archivos del usuario, por lo que no se provee una protección contra software malicioso. Muchos servicios del sistema y programas privilegiados deben ejecutarse con privilegios más allá de lo que realmente necesitan, por lo que una brecha en cualquiera de estos programas se puede explotar para obtener acceso completo al sistema.<sup>[<a id="d0e485" href="#ftn.d0e485" cl
ass="footnote">1</a>]</sup>
</div><div class="para">
El siguiente es un ejemplo de permisos usados en sistemas operativos Linux que no corren el Linux de Seguridad Mejorada (SELinux). Los permisos en estos ejemplos pueden diferir de su sistema. Use el comando <code class="command">ls -l</code> para ver los permisos de archivos:
</div><pre class="screen">$ ls -l archivo1
-rwxrw-r-- 1 usuario1 grupo1 0 2009-04-30 15:42 archivo1
</pre><div class="para">
Los primeros tres bits de permisos, <code class="computeroutput">rwx</code>, controlan el acceso que el usuario Linux <code class="computeroutput">usuario1</code> (en este caso, el dueño) tiene para el <code class="filename">archivo1</code>. Los siguientes tres bits de permisos, <code class="computeroutput">rw-</code>, controlan el acceso que el grupo Linux <code class="computeroutput">grupo1</code> tiene para el <code class="filename">archivo1</code>. Los últimos tres bits de permisos, <code class="computeroutput">r--</code>, controlan el acceso que todo el mundo tiene para el <code class="filename">archivo1</code>, que incluyen a todos los usuarios y procesos.
</div><div class="para">
Linux de Seguridad Mejorada (SELinux por Security-Enhanced Linux) agrega Control de Acceso Obligatorio (MAC en inglés) al kernel de Linux, y se habilita por defecto en Fedora. Una arquitectura MAC de propósito general necesita la habilidad de aplicar una política de seguridad puesta administrativamente sobre todos los procesos y archivos del sistema, basando decisiones en las etiquetas que contienen información variada relevante para la seguridad. Cuando se implementa apropiadamente, hace que un sistema se autodefienda adecuadamente y ofrece soporte crítico para la seguridad de aplicaciones protegiéndolas de la manipulación y sobrepaso. MAC provee una separación fuerte de aplicaciones que permite la ejecución a salvo de aplicaciones no confiables. Su habilidad para limitar los privilegios asociados con la ejecución de procesos limita el ámbito del potencial daño que puede resultar de la explotación de vulnerabilidades en aplicaciones y servicios del sistema. MA
C hace que la información esté protegida de los usuarios legítimos con autorización limitada, así como de usuarios autorizados que involuntariamente ejecutaron aplicaciones maliciosas.<sup>[<a id="d0e527" href="#ftn.d0e527" class="footnote">2</a>]</sup>
</div><div class="para">
El siguiente es un ejemplo de las etiquetas que contienen información de seguridad relevante que se usa en los procesos, usuarios Linux y archivos, en sistemas operativos Linux que corren SELinux. Esta información se llama contexto de SELinux y se visualiza usando el comando <code class="command">ls -Z</code>:
</div><pre class="screen">$ ls -Z file1
-rwxrw-r-- user1 group1 unconfined_u:object_r:user_home_t:s0 file1
</pre><div class="para">
En este ejemplo, SELinux provee un usuario (<code class="computeroutput">unconfined_u</code>), un rol (<code class="computeroutput">object_r</code>), un tipo (<code class="computeroutput">user_home_t</code>), y un nivel (<code class="computeroutput">s0</code>). Esta información se usa para tomar decisiones sobre el control de acceso. Con DAC, el acceso se controla basado sólo en los IDs de usuarios y grupos de Linux. Las reglas de políticas de SELinux se chequean después de las reglas DAC. Las reglas de políticas de SELInux no se usan si las reglas DAC niegan el acceso al principio.
</div><div class="formalpara"><h5 class="formalpara" id="form-Security-Enhanced_Linux-Introduction-Linux_and_SELinux_Users">Linux y los Usuarios SELinux</h5>
En sistemas operativos Linux que corren SELinux, hay usuarios Linux así como usuarios SELinux. Los usuarios SELinux son parte de la política de SELinux. Los usuarios Linux se mapean a usuarios SELinux. Para evitar confusión, esta guía usa "usuarios Linux" y "usuarios SELinux" para diferenciar entre ambos.
</div><div class="section" lang="es-ES"><div class="titlepage"><div><div><h2 class="title" id="sect-Security-Enhanced_Linux-Introduction-Benefits_of_running_SELinux">2.1. Beneficios de usar SELinux</h2></div></div></div><div class="itemizedlist"><ul><li><div class="para">
Todos los procesos y archivos se etiquetan con un tipo. Un tipo define un dominio para los procesos y un tipo para los archivos. Los procesos se separan entre sí corriéndolos en sus propios dominios, y las reglas de políticas de SELinux define cómo interactúan los procesos con los archivos, así como la forma en que interactúan entre sí. El acceso sólo se permite si existe una regla de política de SELinux que específicamente lo permita.
</div></li><li><div class="para">
Control de acceso más fino. Yendo un paso más alla de los permisos tradicionales de <span class="trademark">UNIX</span>® que se controlan a discreción del usuario y se basa en los IDs de usuario y de grupos de Linux, las decisiones de accesos de SELinux se basan en toda la información disponible, tales como un usuario SELinux, el rol, el tipo y, opcionalmente, un nivel.
</div></li><li><div class="para">
La política de SELinux se define administrativamente, obligando a todo el sistema, y no se pone a discreción del usuario.
</div></li><li><div class="para">
Vulnerabilidad reducida para ataques de escalamiento de privilegios. Un ejemplo: dado que los procesos corren en dominios, y son por lo tanto separados entresi, y las reglas de la política de SELinux definen cómo los procesos acceden a los archivos y a otros procesos, si un proceso queda comprometido, el atacante sólo tiene acceso a las funciones normales de ese proceso, y a archivos a los que el proceso tiene configurado que puede acceder. Por ejemplo, si el Servidor HTTP Apache es comprometido, un atacante no puede usar el proceso para leer archivos en los directorios home de los usuarios, a menos que una regla específica de la política de SELinux haya sido agregada o configurada para permitir tal acceso.
</div></li><li><div class="para">
Se linux se puede usar para asegurar la confidencialidad e integridad de los datos, así como proteger los procesos de entradas no confiables.
</div></li></ul></div><div class="para">
SELinux no es:
</div><div class="itemizedlist"><ul><li><div class="para">
software antivirus.
</div></li><li><div class="para">
un reemplazo para las contraseñas, cortafuegos y otros sistemas de seguridad.
</div></li><li><div class="para">
una solución todo en uno.
</div></li></ul></div><div class="para">
SELinux está diseñado para mejorar las soluciones de seguridad existentes, no reemplazarlas. Aún cuando corra SELinux, siga las buenas prácticas de seguridad, tales como mantener el software actualizado, usar contraseñas difíciles de adivinar, cortafuegos y demás.
</div></div><div class="section" lang="es-ES"><div class="titlepage"><div><div><h2 class="title" id="sect-Security-Enhanced_Linux-Introduction-Examples">2.2. Ejemplos</h2></div></div></div><div class="para">
Los siguientes ejemplos demuestran cómo SELinux aumenta la seguridad:
</div><div class="itemizedlist"><ul><li><div class="para">
la acción por defecto es denegar. Si una regla de la política de SELinux no existe para permitir el acceso, como para que un proceso pueda abrir un archivo, el acceso es denegado.
</div></li><li><div class="para">
SELinux puede confinar a usuarios Linux. Existe un número de usuarios SELinux confinados. Los usuarios Linux se pueden mapear a usuarios SELinux para sacar ventaja de los usuarios SELinux confinados. Por ejemplo, mapear un usario Linux al usuario SELinux user_u, resulta en un usuario Linux que no puede ejecutar (a menos que se configure de otra forma) aplicaciones con el ID del usuario (setuid), tales como <code class="command">sudo</code> y <code class="command">su</code>, así como previene la ejecución de archivos y aplicaciones en sus directorios de inicio (home)- si se configura, esto evita que los usuarios ejecuten archivos maliciosos desde sus directorios de inicio.
</div></li><li><div class="para">
separación de procesos. Los procesos que corren en sus propios dominios, previenen que estos accedan a archivos usados por otros procesos, así como el acceso a otros procesos. Por ejemplo, cuando se ejecuta SELinux, a menos que se configure de otra forma, un atacante no puede comprometer un servidor Samba, y luego usar ese servidor Samba para leer y escribir archivos usados por otros procesos, tales como las bases de datos usadas por <span class="trademark">MySQL</span>®.
</div></li><li><div class="para">
ayuda a limitar los daños hechos por errores en la configuración. Los servidores <a href="http://en.wikipedia.org/wiki/Domain_Name_System">Sistema de Nombres de Dominio (DNS)</a> pueden replicar información entre si. Esto se conoce como transferencia de zona. Los atacantes pueden usar las transferencias de zonas para actualizar los servidores de DNS con información falsa. Cuando se ejecuta el servidor de DNS <a href="https://www.isc.org/software/bind">Berkeley Internet Name Domain (BIND)</a> en Fedora 11, aún si un administrador se olvida de limitar qué servidores pueden realizar las transferencias de zona, la política predeterminada de SELinux evita que los archivos de zonas <sup>[<a id="d0e629" href="#ftn.d0e629" class="footnote">3</a>]</sup> sean actualizados por transferencias, por el demonio BIND <code class="systemitem">named</code> y por otros procesos.
</div></li><li><div class="para">
vaya al artículo de <a href="http://www.redhatmagazine.com/"><span class="trademark">Red Hat</span>® Magazine</a>, <a href="http://www.redhatmagazine.com/2008/02/26/risk-report-three-years-of-red-h...">Informe de riesgo: Tres años del Linux para Empresas de Red Hat 4</a><sup>[<a id="d0e646" href="#ftn.d0e646" class="footnote">4</a>]</sup>, para explotaciones que fueron restringidas gracias a la política destinada de SELinux en el <span class="trademark">Linux</span>® para Empresas de <span class="trademark">Red Hat</span>® 4.
</div></li><li><div class="para">
vaya al artículo en <a href="http://www.linuxworld.com">LinuxWorld.com</a> article, <a href="http://www.linuxworld.com/news/2008/022408-selinux.html?page=1">Un cinturón de seguridad para software servidor: SELinux bloquea explotaciones del mundo real</a><sup>[<a id="d0e666" href="#ftn.d0e666" class="footnote">5</a>]</sup>, para un poco de información sobre SELinux, y sobre varias explotaciones que SELinux evita.
</div></li><li><div class="para">
vaya al blog de James Morris <a href="http://james-morris.livejournal.com/25421.html">SELinux mitiga la vulnerabilidad de root en OpenPegasus</a>, para información acerca de una brecha en <a href="http://www.openpegasus.org/">OpenPegasus</a> que fue mitigada por SELinux tal como fue distribuido con el Linux para Empresas de Red Hat 4 y 5.
</div></li></ul></div><div class="para">
El sitio web de <a href="http://www.tresys.com/">Tresys Technology</a> tiene una sección de <a href="http://www.tresys.com/innovation.php">Noticias de Migración a SELinux</a> (en la parte derecha), que lista los ataques recientes que fueron mitigados o prevenidos por SELinux.
</div></div><div class="section" lang="es-ES"><div class="titlepage"><div><div><h2 class="title" id="sect-Security-Enhanced_Linux-Introduction-SELinux_Architecture">2.3. Arquitectura de SELinux</h2></div></div></div><div class="para">
SELinux es un módulo de seguridad de Linux que se construye dentro del kernel de Linux. SELinux se maneja por reglas de políticas cargables. Cuando un acceso de seguridad relevante se lleva a cabo, tal como un proceso que trata de abrir un archivo, la operación es interceptada por SELinux en el kernel. Si una regla de política de SELinux permite la operación, continúa, sino, la operación se bloquea y el proceso recibe un error.
</div><div class="para">
Las decisiones de SELinux, tales como permitir o negar accesos, son cacheadas. Este caché se conoce como Caché Vector de Acceso (AVC). Las decisiones de cacheado disminuye la necesidad de que las reglas de políticas de SELinux sean chequeadas muy a menudo, lo que mejora la performance. Las reglas de políticas de SELinux no tienen efecto si las reglas DAC niegan el acceso primero.
</div></div><div class="section" lang="es-ES"><div class="titlepage"><div><div><h2 class="title" id="sect-Security-Enhanced_Linux-Introduction-SELinux_on_Other_Operating_Systems">2.4. SELinux en otros Sistemas Operativos</h2></div></div></div><div class="para">
Vaya a la siguiente información sobre cómo correr SELinux en sistemas operativos:
</div><div class="itemizedlist"><ul><li><div class="para">
Gentoo endurecido: <a href="http://www.gentoo.org/proj/en/hardened/selinux/selinux-handbook.xml">http://www.gentoo.org/proj/en/hardened/selinux/selinux-handbook.xml</a>.
</div></li><li><div class="para">
Debian: <a href="http://wiki.debian.org/SELinux">http://wiki.debian.org/SELinux</a>.
</div></li><li><div class="para">
Ubuntu: <a href="https://wiki.ubuntu.com/SELinux">https://wiki.ubuntu.com/SELinux</a> and <a href="https://help.ubuntu.com/community/SELinux">https://help.ubuntu.com/community/SELinux</a>.
</div></li><li><div class="para">
Linux para Empresas de Red Hat: <a href="http://www.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/5.2/html/Deploy...">Guía de Despliegue del Linux para Empresas de Red Hat</a> y la <a href="http://www.redhat.com/docs/manuals/enterprise/RHEL-4-Manual/selinux-guide/">Guía de SELinux para el Linux para Empresas de Red Hat</a>.
</div></li><li><div class="para">
Fedora: <a href="http://fedoraproject.org/wiki/SELinux">http://fedoraproject.org/wiki/SELinux</a> y el <a href="http://docs.fedoraproject.org/selinux-faq-fc5/">FAQ de SELinux de Fedora Core 5</a>.
</div></li></ul></div></div><div class="footnotes"><br/><hr width="100" align="left"/><div class="footnote"><p><sup>[<a id="ftn.d0e485" href="#d0e485" class="para">1</a>] </sup>
"Integración del Soporte Flexible para Políticas de Seguridad en el Sistema Operativo Linux", de Peter Loscocco y Stephen Smalley. Este paper fue preparado originalmente por la Agencia de Seguridad Nacional y está, consecuentemente, en el dominio público. Vaya al <a href="http://www.nsa.gov/research/_files/selinux/papers/freenix01/index.shtml">paper original</a> para mas detalles y el documento tal como fue lanzado la primera vez. Cualquier edición y cambio fue hecho por Murray McAllister.
</p></div><div class="footnote"><p><sup>[<a id="ftn.d0e527" href="#d0e527" class="para">2</a>] </sup>
"Consiguiendo Objetivos de Seguridad Críticos con Linux de Seguridad Mejorada", por Peter Loscocco y Stephen Smalley. Este paper fue preparado originalmente por la Agencia de Seguridad Nacional y está, consecuentemente, en el dominio público. Vaya al <a href="http://www.nsa.gov/research/_files/selinux/papers/ottawa01/index.shtml">paper original</a> para detalles y por el documento tal como fue lanzado la primera vez. Cualquier edición y cambio fue hecho por Murray McAllister.
</p></div><div class="footnote"><p><sup>[<a id="ftn.d0e629" href="#d0e629" class="para">3</a>] </sup>
Archivos de texto que incluyen información, tal como el mapeo de nombre de equipo a dirección IP, que usan los servidores de DNS.
</p></div><div class="footnote"><p><sup>[<a id="ftn.d0e646" href="#d0e646" class="para">4</a>] </sup>
Cox, Mark. "Informe de riesgo: Tres años del Linux para Empresas de Red Hat 4". Publicado el 26 Febrero 2008. Accedido el 28 Agosto 2008: <a href="http://www.redhatmagazine.com/2008/02/26/risk-report-three-years-of-red-h...">http://www.redhatmagazine.com/2008/02/26/risk-report-three-years-of-red-h...</a>.
</p></div><div class="footnote"><p><sup>[<a id="ftn.d0e666" href="#d0e666" class="para">5</a>] </sup>
Marti, Don. "Un cinturón de seguridad para software servidor: SELinux bloquea explotaciones del mundo real". Publicado el 24 Febrero 2008. Accedido el 28 Agosto 2008: <a href="http://www.linuxworld.com/news/2008/022408-selinux.html?page=1">http://www.linuxworld.com/news/2008/022408-selinux.html?page=1</a>.
</p></div></div></div><div class="chapter" lang="es-ES"><div class="titlepage"><div><div><h2 class="title" id="chap-Security-Enhanced_Linux-SELinux_Contexts">Capítulo 3. Contextos de SELinux</h2></div></div></div><div class="toc"><dl><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-SELinux_Contexts-Domain_Transitions">3.1. Transiciones de Dominios</a></span></dt><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-SELinux_Contexts-SELinux_Contexts_for_Processes">3.2. Contextos de SELinux para los Procesos</a></span></dt><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-SELinux_Contexts-SELinux_Contexts_for_Users">3.3. Contextos de SELinux para los Usuarios</a></span></dt></dl></div><div class="para">
Los procesos y archivos se etiquetan con un contexto SELinux que contiene información adicional, tal como un usuario SELinux, rol, tipo y, opcionalmente, un nivel. Cuando se ejecuta SELinux, toda esta información se usa para tomar decisiones de control de acceso. En Fedora 11, SELinux provee una combinación de Control de Acceso Basado en Roles (RBAC en inglés), <span class="trademark">Obligación de Tipos</span>® (TE en inglés), y, opcionalmente, Seguridad Multi-nivel (MLS en inglés).
</div><div class="para">
El siguiente es un ejemplo de contexto de SELinux. Los contextos de SELinux se usan en procesos, usuarios de Linux y archivos, en sistemas operativos Linux que corren SELinux. Use el comando <code class="command">ls -Z</code> para ver el contexto SELinux de archivos y directorios:
</div><pre class="screen">$ ls -Z file1
-rwxrw-r-- user1 group1 unconfined_u:object_r:user_home_t:s0 file1
</pre><div class="para">
Los contextos de SELinux siguen la <span class="emphasis"><em>SELinux nombre-de-usuario:role:type:level</em></span> sintaxis:
</div><div class="variablelist"><dl><dt><span class="term"><span class="emphasis"><em>Usuario SELinux </em></span></span></dt><dd><div class="para">
La identidad de usuario SELinux es una identidad conocida para la política a la que se le autoriza un conjunto específico de roles, y un rango específico de MLS. Cada usuario Linux se mapea a un usuario SELinux vía la política de SELinux. Esto permite a los usuarios de LInux heredar las restricciones de los usuarios SELinux. La identidad del usuario SELinux mapeado se usa en el contexto de SELinux para procesos en esa sesión, para agrupar a qué roles y niveles pueden ingresar. Ejecute el comando <code class="command">semanage login -l</code> como usuario root de Linux para ver una lista de mapeos entre cuentas de usuarios Linux y SELinux:
</div><pre class="screen"># /usr/sbin/semanage login -l
Login Name SELinux User MLS/MCS Range
__default__ unconfined_u s0-s0:c0.c1023
root unconfined_u s0-s0:c0.c1023
system_u system_u s0-s0:c0.c1023
</pre><div class="para">
La salida puede ser distinta de sistema a sistema. La columna <code class="computeroutput">Nombre de Ingreso</code> lista los usuarios Linux, y la columna <code class="computeroutput">Usuario SELinux</code> lista qué a usuario SELinux es mapeado un usuario Linux. Para procesos, el usuario SELinux limita qué roles y niveles son accesibles. La última columna, <code class="computeroutput">Rango MLS/MCS</code>, es el nivel usado por la Seguridad Multi Nivel (MLS) y por la Seguridad Multi Categoría (MCS). Los niveles se describen brevemente más adelante.
</div></dd><dt><span class="term"><span class="emphasis"><em>rol</em></span></span></dt><dd><div class="para">
Parte de SELinux es el modelo de seguridad de Control de Acceso Basado en Roles (RBAC). El rol es un atributo de RBAC. Los usuarios de SELinux son autorizados para ciertos roles y los roles son autorizados para ciertos dominios. Los roles sirven como un intermediario entre dominios y usarios SELinux. Los roles en los que se puede ingresar determinan los dominios a los que se ingresan - al final, esto controla los tipos de objetos que se pueden acceder. Esto ayuda a reducir la vulnerabilidad de ataques de escalada de privilegios.
</div></dd><dt><span class="term"><span class="emphasis"><em>tipo</em></span></span></dt><dd><div class="para">
El tipo es un atributo de la Obligación de Tipos. El tipo define un dominio para procesos y un tipo para los archivos. Las reglas de políticas de SELinux define cómo se acceden los tipos entre si, ya sea un dominio que accede a un tipo o un dominio que accede a otro dominio. Los acceso sólo se permiten si existe una regla de política de SELinux que lo permita.
</div></dd><dt><span class="term"><span class="emphasis"><em>nivel</em></span></span></dt><dd><div class="para">
El nivel es un atributo de MLS y la Seguridad Multi Categoría (MCS). Un rango MLS es un par de niveles, escrito como <span class="emphasis"><em>bajonivel-altonivel</em></span> si los niveles sin distintos, o <span class="emphasis"><em>bajonivel</em></span> si los niveles son idénticos (<code class="computeroutput">s0-s0</code> es lo mismo que <code class="computeroutput">s0</code>). Cada nivel es un par sensible a categorías, donde las categorías son opcionales. Si no hay categorías, el nivel se escribe como <span class="emphasis"><em>sensibilidad:conjunto-de-categoría</em></span>. Si no hay categorías, se escribe como <span class="emphasis"><em>sensibilidad</em></span>.
</div><div class="para">
Si el conjunto de categoría es una serie contigua, se puede abreviar. Por ejemplo, <code class="computeroutput">c0.c3</code> es lo mismo que <code class="computeroutput">c0,c1,c2,c3</code>. El archivo <code class="filename">/etc/selinux/targeted/setrans.conf</code> mapea los niveles (<code class="computeroutput">s0:c0</code>) a una forma legible al humano (<code class="computeroutput">CompanyConfidential</code>). No edite <code class="filename">setrans.conf</code> con un editor de texto: use <code class="command">semanage</code> para hacer cambios. Vaya a la página de manual de <span class="citerefentry"><span class="refentrytitle">semanage</span>(8)</span> para más información. En Fedora 11, la política destinada obglica MCS, y en MCS hay sólo una sensibilidad, la <code class="computeroutput">s0</code>. MCS en Fedora 11 soporta 1024 categorías distintas: <code class="computeroutput">c0</code> a <code class="computeroutput">c1023</code>. <code class="computeroutpu
t">s0-s0:c0.c1023</code> es la sensibilidad <code class="computeroutput">s0</code> y autorizado para todas las categorías.
</div><div class="para">
MLS aplica el <a href="http://en.wikipedia.org/wiki/Bell-LaPadula_model">Modelo de Acceso Obligatorio Bell-LaPadula</a>, y se usa en entornos de Perfil de Protección de Seguirdad Etiquetada (LSPP en inglés). Para usar las restricciones MLS, instale el paquete <span class="package">selinux-policy-mls</span>, y configure a MLS como la política de SELinux predeterminada. La política MLS puesta en Fedora mite muchos dominios de programa que no eran parte de la configuración evaluada, y por lo tanto, MLS es inútil en un escritorio (no hay soporte para el Sistema de Ventanas X); sin embargo, una política MLS se puede incluir desde los <a href="http://oss.tresys.com/projects/refpolicy">desarrolladores de la Política de Referencia de SELinux</a> que incluya todos los dominios de programa.
</div></dd></dl></div><div class="section" lang="es-ES"><div class="titlepage"><div><div><h2 class="title" id="sect-Security-Enhanced_Linux-SELinux_Contexts-Domain_Transitions">3.1. Transiciones de Dominios</h2></div></div></div><div class="para">
Un proceso transiciona de un dominio a otro ejecutando una aplicación que tiene el tipo <code class="computeroutput">entrypoint</code> en el nuevo dominio. Los permisos <code class="computeroutput">entrypoint</code> se usan en las políticas de SELinux, y controlan qué aplicaciones pueden usarse para ingresar a un dominio. El siguiente ejemplo muestra una transición de dominio.
</div><div class="orderedlist"><ol><li><div class="para">
Un usuario desea cambiar su contraseña. Para cambiar sus contraseñas, corren la aplicación <code class="command">passwd</code>. El ejecutable <code class="filename">/usr/bin/passwd</code> está etiquetado con el tipo <code class="computeroutput">passwd_exec_t</code>:
</div><pre class="screen">$ ls -Z /usr/bin/passwd
-rwsr-xr-x root root system_u:object_r:passwd_exec_t:s0 /usr/bin/passwd
</pre><div class="para">
La aplicación <span class="application"><strong>passwd</strong></span> accede <code class="filename">/etc/shadow</code>, que está etiquetado con el tipo <code class="computeroutput">shadow_t</code>:
</div><pre class="screen">$ ls -Z /etc/shadow
-r-------- root root system_u:object_r:shadow_t:s0 /etc/shadow
</pre></li><li><div class="para">
Una regla de política de SELinux dice que los procesos que se ejecutan en el dominio <code class="computeroutput">passwd_t</code> no pueden leer y escribir archivos etiquetados con el tipo <code class="computeroutput">shadow_t</code>. El tipo <code class="computeroutput">shadow_t</code> sólo se aplica a archivos que necesitan un cambio de contraseñas. Esto incluye a <code class="filename">/etc/gshadow</code>, <code class="filename">/etc/shadow</code>, y sus archivos de respaldo.
</div></li><li><div class="para">
Una regla de política de SELinux fija que el dominio <code class="computeroutput">passwd_t</code> tiene permiso de <code class="computeroutput">entrypoint</code> al tipo <code class="computeroutput">passwd_exec_t</code>.
</div></li><li><div class="para">
Cuando un usuario ejecuta la aplicación <code class="command">/usr/bin/passwd</code>, el proceso shell del usuario transiciona al dominio <code class="computeroutput">passwd_t</code>. Con SELinux, dado que la acción por defecto es negar, y existe una regla que permite (entre otras cosas) a aplicaciones que corran en el dominio <code class="computeroutput">passwd_t</code> acceder a archivos etiquetados con el tipo <code class="computeroutput">shadow_t</code>, se le permite a <span class="application"><strong>passwd</strong></span> acceder a <code class="filename">/etc/shadow</code>, y actualizar la contraseña del usuario.
</div></li></ol></div><div class="para">
Este ejemplo no es exhaustivo, y se usa como un ejemplo básico para explicar la transición de dominio. Aunque hay una regla actual que permite a sujetos corriendo en el dominio <code class="computeroutput">passwd_t</code> accedan objetos etiquetados con el tipo de archivo <code class="computeroutput">shadow_t</code>, otras reglas de política de SELinux se deben cumplir para que el sujeto pueda transicionar a un nuevo dominio. En este ejemplo, la Obligación de Tipo asegura:
</div><div class="itemizedlist"><ul><li><div class="para">
el dominio <code class="computeroutput">passwd_t</code> sólo se puede ingresar ejecutando una aplicación con la etiqueta del tipo <code class="computeroutput">passwd_exec_t</code>; sólo pueden ejecutar desde bibliotecas compartidas autorizadas, tales como las del tipo <code class="computeroutput">lib_t</code>; y no pueden ejecutar ninguna otra aplicación.
</div></li><li><div class="para">
sólo los dominios autorizados, tales como <code class="computeroutput">passwd_t</code>, pueden escribir en archivos con la etiqueta del tipo <code class="computeroutput">shadow_t</code>. Aún si otros procesos corren con privilegios de superusuario, esos procesos no podrán escribir archivos etiquetados con el tipo <code class="computeroutput">shadow_t</code>, porque no están corriendo en el dominio <code class="computeroutput">passwd_t</code>.
</div></li><li><div class="para">
sólo los dominios autorizados pueden transicionar al dominio <code class="computeroutput">passwd_t</code>. Por ejemplo, el proceso <code class="systemitem">sendmail</code> corriendo en el dominio <code class="computeroutput">sendmail_t</code> no tiene una razón legítima para ejecutar <code class="command">passwd</code>; por lo tanto, no puede transicionar nunca al dominio <code class="computeroutput">passwd_t</code>.
</div></li><li><div class="para">
los procesos que se ejecutan en el dominio <code class="computeroutput">passwd_t</code> sólo pueden leer y escribir a tipos autorizados, tales como archivos etiquetados con los tipos <code class="computeroutput">etc_t</code> o <code class="computeroutput">shadow_t</code>. Esto impide a la aplicación <span class="application"><strong>passwd</strong></span> de ser modificada para leer o escribir en archivos arbitrarios.
</div></li></ul></div></div><div class="section" lang="es-ES"><div class="titlepage"><div><div><h2 class="title" id="sect-Security-Enhanced_Linux-SELinux_Contexts-SELinux_Contexts_for_Processes">3.2. Contextos de SELinux para los Procesos</h2></div></div></div><div class="para">
Use el comando <code class="command">ps -eZ</code> para ver los contextos de SELinux para los procesos. Por ejemplo:
</div><div class="orderedlist"><ol><li><div class="para">
Abra una terminal, como la de <span class="guimenu"><strong>Aplicaciones</strong></span> → <span class="guisubmenu"><strong>Herramientas del Sistema</strong></span> → <span class="guimenuitem"><strong>Terminal</strong></span>.
</div></li><li><div class="para">
Ejecute el comando <code class="command">/usr/bin/passwd</code>. No ingrese una nueva contraseña.
</div></li><li><div class="para">
Abra una nueva pestaña, u otra terminal, y ejecute el comando <code class="command">ps -eZ | grep passwd</code>. La salida es similar a la siguiente:
</div><pre class="screen">unconfined_u:unconfined_r:passwd_t:s0-s0:c0.c1023 13212 pts/1 00:00:00 passwd
</pre></li><li><div class="para">
En la primer pestaña, presione <strong class="userinput"><code>Ctrl+C</code></strong> para cancelar la aplicación <span class="application"><strong>passwd</strong></span>.
</div></li></ol></div><div class="para">
En este ejemplo, cuando la aplicación <code class="filename">/usr/bin/passwd</code> (etiquetada con el tipo <code class="computeroutput">passwd_exec_t</code>) se ejecuta, el proceso shell del usuario transiciona al dominio <code class="computeroutput">passwd_t</code>. Recuerde: el tipo define un dominio para procesos y un tipo para archivos.
</div><div class="para">
Use el comando <code class="command">ps -eZ</code> para ver los contextos SELinux de los procesos en ejecución. El siguiente es un ejemplo limitado de la salida, y puede cambiar en su sistema:
</div><pre class="screen">system_u:system_r:setroubleshootd_t:s0 1866 ? 00:00:08 setroubleshootd
system_u:system_r:dhcpc_t:s0 1869 ? 00:00:00 dhclient
system_u:system_r:sshd_t:s0-s0:c0.c1023 1882 ? 00:00:00 sshd
system_u:system_r:gpm_t:s0 1964 ? 00:00:00 gpm
system_u:system_r:crond_t:s0-s0:c0.c1023 1973 ? 00:00:00 crond
system_u:system_r:kerneloops_t:s0 1983 ? 00:00:05 kerneloops
system_u:system_r:crond_t:s0-s0:c0.c1023 1991 ? 00:00:00 atd
</pre><div class="para">
El rol <code class="computeroutput">system_r</code> se usa para procesos de sistema, como los demonios. El tipo obligatorio los separa luego en dominios.
</div></div><div class="section" lang="es-ES"><div class="titlepage"><div><div><h2 class="title" id="sect-Security-Enhanced_Linux-SELinux_Contexts-SELinux_Contexts_for_Users">3.3. Contextos de SELinux para los Usuarios</h2></div></div></div><div class="para">
Use el comando <code class="command">id -Z</code> para ver el contexto SELinux asociado con su usuario Linux:
</div><pre class="screen">unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023
</pre><div class="para">
En Fedora 11, los usuarios Linux corren no confinados por defecto. Este contexto de SELinux muestra que el usuario Linux se mapea al usuario SELinux <code class="computeroutput">unconfined_u</code>, corriendo con el rol <code class="computeroutput">unconfined_r</code> y en el dominio <code class="computeroutput">unconfined_t</code>. <code class="computeroutput">s0-s0</code> es un rango MLS, que en este caso, es el mismo que <code class="computeroutput">s0</code>. Las categorías a las que el usuario tiene acceso se definen por <code class="computeroutput">c0.c1023</code>, que son todas las categorías (<code class="computeroutput">c0</code> a <code class="computeroutput">c1023</code>).
</div></div></div><div class="chapter" lang="es-ES"><div class="titlepage"><div><div><h2 class="title" id="chap-Security-Enhanced_Linux-Targeted_Policy">Capítulo 4. Política Destinado</h2></div></div></div><div class="toc"><dl><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Targeted_Policy-Confined_Processes">4.1. Procesos Confinados</a></span></dt><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Targeted_Policy-Unconfined_Processes">4.2. Procesos no Confinados</a></span></dt><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Targeted_Policy-Confined_and_Unconfined_Users">4.3. Usuarios Confinados y no Confinados</a></span></dt></dl></div><div class="para">
La política destinada es la política predeterminada de SELinux usada en Fedora 11. Cuando la política destinada está en uso, los procesos son destinados a correr en dominios confinados, y los procesos que no son destinados a correr en un dominio corren en un dominio no confinado. Por ejemplo, por defecto, los usuarios que ingresaron corren en el dominio <code class="computeroutput">unconfined_t</code>, y los procesos del sistema iniciado por init corren en el dominio <code class="computeroutput">initrc_t</code> - ambos dominios están no confinados.
</div><div class="para">
Unconfined domains (as well as confined domains) are subject to executable and writeable memory checks. By default, subjects running in an unconfined domain can not allocate writeable memory and execute it. This reduces vulnerability to <a href="http://en.wikipedia.org/wiki/Buffer_overflow">buffer overflow attacks</a>. These memory checks are disabled by setting Booleans, which allow the SELinux policy to be modified at runtime. Boolean configuration is discussed later.
</div><div class="section" lang="es-ES"><div class="titlepage"><div><div><h2 class="title" id="sect-Security-Enhanced_Linux-Targeted_Policy-Confined_Processes">4.1. Procesos Confinados</h2></div></div></div><div class="para">
Casi todos los servicios que escuchan en la red se confinan en Fedora 11. También, la mayoría de los procesos que corren como usuario root de Linux y realizan tareas para los usuarios, tales como la aplicación <span class="application"><strong>passwd</strong></span>, están confinadas. Cuando un proceso se confina, corre en su propio dominio, tal como el proceso <code class="systemitem">httpd</code> ejecutándose en el domino <code class="computeroutput">httpd_t</code>. Si un proceso confinado es comprometido por un atacante, dependiendo de la configuración de política de SELinux, el acceso del atacante a recursos y el posible daño que puedan causar es limitado.
</div><div class="para">
El siguiente ejemplo muestra cómo previene SELinux la lectura por parte del Servidor HTTP Apache (<code class="systemitem">httpd</code>) de archivos que no se etiquetaron correctamente, tales como archivos a usar con Samba. Este es un ejemplo, y no se debe usar en producción. Asume que los paquetes <span class="package">httpd</span>, <span class="package">wget</span>, <span class="package">setroubleshoot-server</span> y <span class="package">audit</span> están instalados, que se usa la política destinada de SELinux y que SELinux está corriendo en modo obligatorio:
</div><div class="orderedlist"><ol><li><div class="para">
Ejecute el comando <code class="command">sestatus</code> para confirmar que SELinux está activado, se ejecuta en modo obligatorio y que la política destinada se está usando:
</div><pre class="screen">$ /usr/sbin/sestatus
SELinux status: enabled
SELinuxfs mount: /selinux
Current mode: enforcing
Mode from config file: enforcing
Policy version: 23
Policy from config file: targeted
</pre><div class="para">
<code class="computeroutput">SELinux status: enabled</code> is returned when SELinux is enabled. <code class="computeroutput">Current mode: enforcing</code> is returned when SELinux is running in enforcing mode. <code class="computeroutput">Policy from config file: targeted</code> is returned when the SELinux targeted policy is used.
</div></li><li><div class="para">
Como usuario root de Linux, ejecute el comando <code class="command">touch /var/www/html/prueba</code> para crear un archivo.
</div></li><li><div class="para">
Ejecute el comando <code class="command">ls -Z /var/www/html/prueba</code> para ver el contexto SELinux:
</div><pre class="screen">-rw-r--r-- root root unconfined_u:object_r:httpd_sys_content_t:s0 /var/www/html/prueba
</pre><div class="para">
Por defecto, los usuarios Linux corren no confinados en Fedora 11, razón por la cual el archivo <code class="filename">prueba</code> se etiqueta con el usuario SELinux <code class="computeroutput">unconfined_u</code>. RBAC se usa para procesos, y no para archivos. Los roles no tienen significado para archivos - el rol <code class="computeroutput">object_r</code> es un rol genérico usado para archivos (en sistemas de archivos persistentes y de red). Bajo el directorio <code class="filename">/proc/</code>, los archivos relacionados con procesos pueden usar el rol <code class="computeroutput">system_r</code>.<sup>[<a id="d0e1233" href="#ftn.d0e1233" class="footnote">6</a>]</sup> El tipo <code class="computeroutput">httpd_sys_content_t</code> permite al proceso <code class="systemitem">httpd</code> acceder a este archivo.
</div></li><li><div class="para">
Como usuario root de Linux, ejecute el comando <code class="command">service httpd start</code> para iniciar el proceso <code class="systemitem">httpd</code>. La salida escomo sigue si <code class="systemitem">httpd</code> inicia con éxito:
</div><pre class="screen"># /sbin/service httpd start
Iniciando httpd: [ OK ]
</pre></li><li><div class="para">
Cambie al directorio donde su usuario Linux tenga acceso de escritura y ejecute el comando <code class="command">wget http://localhost/prueba</code>. A menos que hubieran cambios en la configuración predeterminada, este comando tiene éxito:
</div><pre class="screen">--2009-05-06 23:00:01-- http://localhost/prueba
Resolving localhost... 127.0.0.1
Connecting to localhost|127.0.0.1|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 0 [text/plain]
Saving to: `prueba'
[ <=> ] 0 --.-K/s in 0s
2009-05-06 23:00:01 (0.00 B/s) - `prueba' saved [0/0]
</pre></li><li><div class="para">
El comando <code class="command">chcon</code> reetiqueta archivos; sin embargo, tales cambios de etiquetas no sobreviven cuando el sistema se reetiqueta. Para que los cambios sobrevivan un reetiquetado del sistema, use el comando <code class="command">semanage</code>, que se discute más adelante. Como usuario root de Linux, corra el siguiente comando para cambiar el tipo a un tipo usado por Samba:
</div><div class="para">
<code class="command">chcon -t samba_share_t /var/www/html/prueba</code>
</div><div class="para">
Ejecute el comando <code class="command">ls -Z /var/www/html/prueba</code> para ver los cambios:
</div><pre class="screen">-rw-r--r-- root root unconfined_u:object_r:samba_share_t:s0 /var/www/html/prueba
</pre></li><li><div class="para">
Nota: los permisos de DAC actuales permiten al proceso <code class="systemitem">httpd</code> acceder al <code class="filename">prueba</code>. Cambie al directorio donde el usuario Linux tenga permiso de escritura y ejecute el comando <code class="command">wget http://localhost/prueba</code>. A menos que hayan cambios en la configuración predeterminada, este comando fallará:
</div><pre class="screen">--2009-05-06 23:00:54-- http://localhost/prueba
Resolving localhost... 127.0.0.1
Connecting to localhost|127.0.0.1|:80... connected.
HTTP request sent, awaiting response... 403 Forbidden
2009-05-06 23:00:54 ERROR 403: Forbidden.
</pre></li><li><div class="para">
Como usuario root de Linux, corra el comando <code class="command">rm -i /var/www/html/prueba</code> para borrar <code class="filename">prueba</code>.
</div></li><li><div class="para">
Si no necesita que corra <code class="systemitem">httpd</code>, como usuario root de Linux corra el comando <code class="command">service httpd stop</code> para detener a <code class="systemitem">httpd</code>:
</div><pre class="screen"># /sbin/service httpd stop
Deteniendo httpd: [ OK ]
</pre></li></ol></div><div class="para">
Este ejemplo muestra la seguridad adicional agregada por SELinux. Aunque las reglas de DAC permitieron al proceso <code class="systemitem">httpd</code> acceder a <code class="filename">prueba</code> en el paso 7, dado que estaba etiquetado con un tipo al que el proceso <code class="systemitem">httpd</code> no tenía acceso, SELinux negó el acceso. Después del paso 7, un error similar al siguiente se guarda en <code class="filename">/var/log/messages</code>:
</div><pre class="screen">May 6 23:00:54 localhost setroubleshoot: SELinux is preventing httpd (httpd_t) "getattr"
to /var/www/html/prueba (samba_share_t). For complete SELinux messages.
run sealert -l c05911d3-e680-4e42-8e36-fe2ab9f8e654
</pre><div class="para">
Archivos log previos pueden usar el formato <code class="filename">/var/log/messages.<em class="replaceable"><code>YYYYMMDD</code></em></code>. Cuando se ejecuta <span class="application"><strong>syslog-ng</strong></span>, los archivos log previos pueden usar el formato <code class="filename">/var/log/messages.<em class="replaceable"><code>X</code></em></code>. Si los procesos <code class="systemitem">setroubleshootd</code> y <code class="systemitem">auditd</code> están ejecutándose, errores similares a los siguientes se registran en <code class="filename">/var/log/audit/audit.log</code>:
</div><pre class="screen">type=AVC msg=audit(1220706212.937:70): avc: denied { getattr } for pid=1904 comm="httpd" path="/var/www/html/prueba" dev=sda5 ino=247576 scontext=unconfined_u:system_r:httpd_t:s0 tcontext=unconfined_u:object_r:samba_share_t:s0 tclass=file
type=SYSCALL msg=audit(1220706212.937:70): arch=40000003 syscall=196 success=no exit=-13 a0=b9e21da0 a1=bf9581dc a2=555ff4 a3=2008171 items=0 ppid=1902 pid=1904 auid=500 uid=48 gid=48 euid=48 suid=48 fsuid=48 egid=48 sgid=48 fsgid=48 tty=(none) ses=1 comm="httpd" exe="/usr/sbin/httpd" subj=unconfined_u:system_r:httpd_t:s0 key=(null)
</pre><div class="para">
También, un error similar al siguiente se registra en <code class="filename">/var/log/httpd/error_log</code>:
</div><pre class="screen">[Wed May 06 23:00:54 2009] [error] [client <em class="replaceable"><code>127.0.0.1</code></em>] (13)Permission denied: access to /prueba denied
</pre><div class="note"><h2>Nota</h2><div class="para">
En Fedora 11, los paquetes <span class="package">setroubleshoot-server</span> y <span class="package">audit</span> se instalan por defecto. Estos paquetes incluyen los demonios <code class="systemitem">setroubleshootd</code> y <code class="systemitem">auditd</code> respectivamente. Estos demonios se ejecutan por defecto. Detener alguno de ellos provoca un cambio de en dónde se graban las negaciones de SELinux. Vaya a <a class="xref" href="#sect-Security-Enhanced_Linux-Working_with_SELinux-Which_Log_File_is_Used" title="5.2. Qué Archivo Log se usa">Sección 5.2, “Qué Archivo Log se usa”</a> para más información.
</div></div></div><div class="section" lang="es-ES"><div class="titlepage"><div><div><h2 class="title" id="sect-Security-Enhanced_Linux-Targeted_Policy-Unconfined_Processes">4.2. Procesos no Confinados</h2></div></div></div><div class="para">
Los procesos no confinados corren en dominios no confinados, por ejemplo, los programas init (del arranque) corren en el dominio no confinado <code class="computeroutput">initrc_t</code>, los procesos no confinados del kernel corren en el dominio <code class="computeroutput">kernel_t</code> y los usuarios no confinados deLInux corren en el dominio <code class="computeroutput">unconfined_t</code>. Para procesos no confinados, las reglas de la política de SELinux son aplicadas, pero hay reglas de la política que permiten que los procesos se ejecuten en dominios no confinados tengan casi todos los accesos. Los procesos que corren en dominios no confinados terminan usando exclusivamente las reglas DAC. Si un proceso no confinado es comprometido, SELinux no impide que un atacante gane acceso a los recursos del sistema y a los datos, pero, por supuesto, las reglas DAC todavía se usan. SELinux es una mejora de seguridad sobre las reglas DAC - no las reemplaza.
</div><div class="para">
El siguiente ejemplo muestra cómo el Servidor HTTP Apache (<code class="systemitem">httpd</code>) puede acceder datos que se suponen son para ser usados por Samba, cuando se corre no confinado. Nota: en Fedora 11, el proceso <code class="systemitem">httpd</code> corre en el dominio confinado <code class="computeroutput">httpd_t</code> por defecto. Este es un ejemplo, y no debe usarse en producción. Se asume que los paquetes <span class="package">httpd</span>, <span class="package">wget</span>, <span class="package">setroubleshoot-server</span>, y <span class="package">audit</span> están instalados, que se usa la política destinada de SELinux y que SELinux corre en modo obligatorio:
</div><div class="orderedlist"><ol><li><div class="para">
Ejecute el comando <code class="command">sestatus</code> para confirmar que SELinux está activado, se ejecuta en modo obligatorio y que la política destinada se está usando:
</div><pre class="screen">$ /usr/sbin/sestatus
SELinux status: enabled
SELinuxfs mount: /selinux
Current mode: enforcing
Mode from config file: enforcing
Policy version: 23
Policy from config file: targeted
</pre><div class="para">
<code class="computeroutput">SELinux status: enabled</code> is returned when SELinux is enabled. <code class="computeroutput">Current mode: enforcing</code> is returned when SELinux is running in enforcing mode. <code class="computeroutput">Policy from config file: targeted</code> is returned when the SELinux targeted policy is used.
</div></li><li><div class="para">
Como usuario root de Linux, corra el comando <code class="command">touch /var/www/html/prueba2</code> para crear un archivo.
</div></li><li><div class="para">
Ejecute el comando <code class="command">ls -Z /var/www/html/prueba2</code> para ver el contexto SELinux:
</div><pre class="screen">-rw-r--r-- root root unconfined_u:object_r:httpd_sys_content_t:s0 /var/www/html/prueba2
</pre><div class="para">
Por defecto, los usuarios Linux corren no confinados en Fedora 11, razón por la cual el archivo <code class="filename">prueba2</code> está etiquetado con el usuario SELinux <code class="computeroutput">unconfined_u</code>. RBAC se usa para procesos, no para archivos. Los roles no tienen un significado para archivos - el rol <code class="computeroutput">object_r</code> es el rol genérico que se usa para archivos (en almacenamiento persistente y sistemas de archivos de red). Bajo el directorio <code class="filename">/proc/</code>, los archivos relacionados con procesos pueden usar el rol <code class="computeroutput">system_r</code>.<sup>[<a id="d0e1483" href="#ftn.d0e1483" class="footnote">7</a>]</sup> El tipo <code class="computeroutput">httpd_sys_content_t</code> permite al proceso <code class="systemitem">httpd</code> acceder a este archivo.
</div></li><li><div class="para">
El comando <code class="command">chcon</code> reetiqueta archivos; sin embargo, tales cambios de etiquetas no sobreviven cuando el sistema se reetiqueta. Para que los cambios sobrevivan un reetiquetado del sistema, use el comando <code class="command">semanage</code>, que se discute más adelante. Como usuario root de Linux, corra el siguiente comando para cambiar el tipo a un tipo usado por Samba:
</div><div class="para">
<code class="command">chcon -t samba_share_t /var/www/html/prueba2</code>
</div><div class="para">
Ejecute el comando <code class="command">ls -Z /var/www/html/prueba2</code> para ver los cambios:
</div><pre class="screen">-rw-r--r-- root root unconfined_u:object_r:samba_share_t:s0 /var/www/html/prueba2
</pre></li><li><div class="para">
Corra el comando <code class="command">service httpd status</code> para confirmar que el proceso <code class="systemitem">httpd</code> no se está ejecutando:
</div><pre class="screen">$ /sbin/service httpd status
httpd está detenido
</pre><div class="para">
Si la salida difiere, ejecute <code class="command">service httpd stop</code> como usuario root de Linux para detener el proceso <code class="systemitem">httpd</code>:
</div><pre class="screen"># /sbin/service httpd stop
Deteniendo httpd: [ OK ]
</pre></li><li><div class="para">
Para hacer que el proceso <code class="systemitem">httpd</code> corra no confinado, ejecute el siguiente comando como usuario root de Linux para cambiar el tipo de <code class="filename">/usr/sbin/httpd</code>, a un tipo que no transicione a un dominio confinado:
</div><div class="para">
<code class="command">chcon -t unconfined_exec_t /usr/sbin/httpd</code>
</div></li><li><div class="para">
Ejecute el comando <code class="command">ls -Z /usr/sbin/httpd</code> para confirmar que <code class="filename">/usr/sbin/httpd</code> está etiquetado con el tipo <code class="computeroutput">unconfined_exec_t</code>:
</div><pre class="screen">-rwxr-xr-x root root system_u:object_r:unconfined_exec_t /usr/sbin/httpd
</pre></li><li><div class="para">
Como usuario root de Linux, ejecute el comando <code class="command">service httpd start</code> para iniciar el proceso <code class="systemitem">httpd</code>. La salida escomo sigue si <code class="systemitem">httpd</code> inicia con éxito:
</div><pre class="screen"># /sbin/service httpd start
Iniciando httpd: [ OK ]
</pre></li><li><div class="para">
Ejecute el comando <code class="command">ps -eZ | grep httpd</code> para ver si <code class="systemitem">httpd</code> está corriendo en el dominio <code class="computeroutput">unconfined_t</code>:
</div><pre class="screen">$ ps -eZ | grep httpd
unconfined_u:system_r:unconfined_t <em class="replaceable"><code>7721</code></em> ? 00:00:00 httpd
unconfined_u:system_r:unconfined_t <em class="replaceable"><code>7723</code></em> ? 00:00:00 httpd
unconfined_u:system_r:unconfined_t <em class="replaceable"><code>7724</code></em> ? 00:00:00 httpd
unconfined_u:system_r:unconfined_t <em class="replaceable"><code>7725</code></em> ? 00:00:00 httpd
unconfined_u:system_r:unconfined_t <em class="replaceable"><code>7726</code></em> ? 00:00:00 httpd
unconfined_u:system_r:unconfined_t <em class="replaceable"><code>7727</code></em> ? 00:00:00 httpd
unconfined_u:system_r:unconfined_t <em class="replaceable"><code>7728</code></em> ? 00:00:00 httpd
unconfined_u:system_r:unconfined_t <em class="replaceable"><code>7729</code></em> ? 00:00:00 httpd
unconfined_u:system_r:unconfined_t <em class="replaceable"><code>7730</code></em> ? 00:00:00 httpd
</pre></li><li><div class="para">
Cambie al directorio donde su usuario Linux tenga permiso de escritura y ejecute el comando <code class="command">wget http://localhost/prueba2</code>. A menos que hayan cambios en la configuración predeterminada, este comando debería tener éxito:
</div><pre class="screen">--2009-05-07 01:41:10-- http://localhost/prueba2
Resolving localhost... 127.0.0.1
Connecting to localhost|127.0.0.1|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 0 [text/plain]
Saving to: `prueba2.1'
[ <=> ]--.-K/s in 0s
2009-05-07 01:41:10 (0.00 B/s) - `prueba2.1' saved [0/0]
</pre><div class="para">
Aunque el proceso <code class="systemitem">httpd</code> no tiene acceso a archivos etiquetados con el tipo <code class="computeroutput">samba_share_t</code>, <code class="systemitem">httpd</code> se ejecuta en el dominio <code class="computeroutput">unconfined_t</code>, y termina usando las reglas DAC, como tal, el comando <code class="command">wget</code> tiene éxito. Teniendo a <code class="systemitem">httpd</code> ejecutándose en el dominio <code class="computeroutput">httpd_t</code>, el comando <code class="command">wget</code> habría fallado.
</div></li><li><div class="para">
El comando <code class="command">restorecon</code> restaura el contexto SELinux predeterminado de los archivos. Como usuario root de Linux, ejecute el comando <code class="command">restorecon -v /usr/sbin/httpd</code> para restaurar el contexto SELinux de <code class="filename">/usr/sbin/httpd</code>:
</div><pre class="screen"># /sbin/restorecon -v /usr/sbin/httpd
restorecon reset /usr/sbin/httpd context system_u:object_r:unconfined_notrans_exec_t:s0->system_u:object_r:httpd_exec_t:s0
</pre><div class="para">
Ejecute el comando <code class="command">ls -Z /usr/sbin/httpd</code> para confirmar que <code class="filename">/usr/sbin/httpd</code> está etiquetado con el tipo <code class="computeroutput">httpd_exec_t</code>:
</div><pre class="screen">$ ls -Z /usr/sbin/httpd
-rwxr-xr-x root root system_u:object_r:httpd_exec_t /usr/sbin/httpd
</pre></li><li><div class="para">
Como usuario root de Linux, corra el comando <code class="command">/sbin/service httpd restart</code> para reiniciar <code class="systemitem">httpd</code>. Después de reiniciar, ejecute <code class="command">ps -eZ | grep httpd</code> para confirmar que <code class="systemitem">httpd</code> se está ejecutando en el dominio confinado <code class="computeroutput">httpd_t</code>:
</div><pre class="screen"># /sbin/service httpd restart
Stopping httpd: [ OK ]
Starting httpd: [ OK ]
# ps -eZ | grep httpd
unconfined_u:system_r:httpd_t 8880 ? 00:00:00 httpd
unconfined_u:system_r:httpd_t 8882 ? 00:00:00 httpd
unconfined_u:system_r:httpd_t 8883 ? 00:00:00 httpd
unconfined_u:system_r:httpd_t 8884 ? 00:00:00 httpd
unconfined_u:system_r:httpd_t 8885 ? 00:00:00 httpd
unconfined_u:system_r:httpd_t 8886 ? 00:00:00 httpd
unconfined_u:system_r:httpd_t 8887 ? 00:00:00 httpd
unconfined_u:system_r:httpd_t 8888 ? 00:00:00 httpd
unconfined_u:system_r:httpd_t 8889 ? 00:00:00 httpd
</pre></li><li><div class="para">
Como usuario root de Linux, corra el comando <code class="command">rm -i /var/www/html/prueba2</code> para eliminar <code class="filename">prueba2</code>.
</div></li><li><div class="para">
Si no necesita que corra <code class="systemitem">httpd</code>, como usuario root de Linux corra el comando <code class="command">service httpd stop</code> para detener a <code class="systemitem">httpd</code>:
</div><pre class="screen"># /sbin/service httpd stop
Deteniendo httpd: [ OK ]
</pre></li></ol></div><div class="para">
Los ejemplos en estas secciones muestran cómo proteger los datos desde un proceso confinado comprometido (protegido por SELinux), así como cuánto más accesible son los datos para un atacante si el proceso comprometido estaba no confinado (no protegido por SELinux).
</div></div><div class="section" lang="es-ES"><div class="titlepage"><div><div><h2 class="title" id="sect-Security-Enhanced_Linux-Targeted_Policy-Confined_and_Unconfined_Users">4.3. Usuarios Confinados y no Confinados</h2></div></div></div><div class="para">
Cada usuario Linux se mapea a un usuario SELinux vía la política de SELinux. Esto permite a los usuarios Linux heredar las restricciones sobre los usuarios SELinux. Este mapeo de usuarios Linux se ve ejecutando el comando <code class="command">semanage login -l</code> como usuario root de Linux:
</div><pre class="screen"># /usr/sbin/semanage login -l
Login Name SELinux User MLS/MCS Range
__default__ unconfined_u s0-s0:c0.c1023
root unconfined_u s0-s0:c0.c1023
system_u system_u s0-s0:c0.c1023
</pre><div class="para">
En Fedora 11, los usuarios de Linux se mapean por defecto al ingreso <code class="computeroutput">__default__</code> de SELinux (el cual se mapea al usuario SELinux <code class="computeroutput">unconfined_u</code>). Lo siguiente define el mapeo por defecto:
</div><pre class="screen">__default__ unconfined_u s0-s0:c0.c1023
</pre><div class="para">
El siguiente ejemplo muestra el agregado de un usuario de Linux nuevo y el mapeo de ese usuario al usuario SELinux <code class="computeroutput">unconfined_u</code>. Asume que el usuario root corre no confinado, como es por defecto en Fedora 11:
</div><div class="orderedlist"><ol><li><div class="para">
Como usuario root de Linux, ejecute el comando <code class="command">/usr/sbin/useradd usuarionuevo</code> para crear un nuevo usuario Linux con nombre usuarionuevo.
</div></li><li><div class="para">
As the Linux root user, run the <code class="command">passwd newuser</code> command to assign a password to the Linux newuser user:
</div><pre class="screen"># passwd usuarionuevo
Changing password for user usuarionuevo.
New UNIX password: <em class="replaceable"><code>Enter a password</code></em>
Retype new UNIX password: <em class="replaceable"><code>Enter the same password again</code></em>
passwd: all authentication tokens updated successfully.
</pre></li><li><div class="para">
Salga de su sesión actual e ingrese como el usuario Linux usuarionuevo. Cuando ingrese, pam_selinux mapea el usuario Linux a un usuario SELinux (en este caso, unconfined_u), y configura el contexto SELinux resultante. El shell del usuario Linux es entonces lanzado en este contexto. Corra el comando <code class="command">id -Z</code> para ver el contexto de un usuario Linux:
</div><pre class="screen">[usuarionuevo@localhost ~]$ id -Z
unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023
</pre></li><li><div class="para">
Salga de la sesión del usuarionuevo de Linux e ingrese con su cuenta. Si no quiere el usuario usuarionuevo, ejecute el comando <code class="command">/usr/sbin/userdel -r usuarionuevo</code> como usuario root de Linux para eliminarlo, junto con su directorio de inicio.
</div></li></ol></div><div class="para">
Los usuarios Linux confinados y no confinados son sujeto a chequeso de memoria escribible y ejecutable, y también son restringidos por MCS (y MLS, si la política MLS está siendo usada). Si los usuarios Linux no confinados ejecutan una aplicación que la política de SELinux define que puede transicionar del dominio <code class="computeroutput">unconfined_t</code> a su propio dominio confinado, los usuarios Linux no confinados están sujetos a restricciones de ese dominio confinado. El beneficio de seguridad de esto es que, aunque un usuario Linux corra no confinado, la aplicación permanece confinada, y por lo tanto, la explotación de una brecha en la aplicación está limitada por la política. Nota: esto no protege al sistema del usuario. En su defecto, el usuario y el sistema están siendo protegidos de posibles daños causados por una brecha en la aplicación.
</div><div class="para">
Los siguientes usuarios SELinux confinados están disponibles en Fedora 11:
</div><div class="table" id="tabl-Security-Enhanced_Linux-Confined_and_Unconfined_Users-SELinux_User_Capabilities"><div class="table-contents"><table summary="Capacidades del Usuario SELinux" border="1"><colgroup><col/><col/><col/><col/><col/><col/></colgroup><thead><tr><th>
Usuario
</th><th>
Dominio
</th><th>
Sistema de Ventanas X
</th><th>
su y sudo
</th><th>
Ejecute en el directorio de inicio y /tmp/
</th><th>
Red
</th></tr></thead><tbody><tr><td>
guest_u
</td><td>
guest_t
</td><td align="center">
no
</td><td align="center">
no
</td><td align="center">
opcional
</td><td align="center">
no
</td></tr><tr><td>
xguest_u
</td><td>
xguest_t
</td><td align="center">
si
</td><td align="center">
no
</td><td align="center">
opcional
</td><td align="center">
sólo <span class="application"><strong>Firefox</strong></span>
</td></tr><tr><td>
user_u
</td><td>
user_t
</td><td align="center">
si
</td><td align="center">
no
</td><td align="center">
opcional
</td><td align="center">
si
</td></tr><tr><td>
staff_u
</td><td>
staff_t
</td><td align="center">
si
</td><td align="center">
sólo <code class="command">sudo</code>
</td><td align="center">
opcional
</td><td align="center">
si
</td></tr></tbody></table></div><h6>Tabla 4.1. Capacidades del Usuario SELinux</h6></div><br class="table-break"/><div class="itemizedlist"><ul><li><div class="para">
Los usuarios Linux en los dominios <code class="computeroutput">guest_t</code>, <code class="computeroutput">xguest_t</code> y <code class="computeroutput">user_t</code> sólo pueden ejecutar aplicaciones con ID de usuario (setuid) si la política de SELinux lo permite (tal como <code class="command">passwd</code>). No podrán ejecutar <code class="command">su</code> y <code class="command">/usr/bin/sudo</code>
</div></li><li><div class="para">
Los usuarios Linux en el dominio <code class="computeroutput">guest_t</code> no tienen acceso a la red, y sólo pueden ingresar vía una terminal (incluyendo <code class="systemitem">ssh</code>; pueden ingresaro por <code class="systemitem">ssh</code>, pero no se pueden <code class="systemitem">ssh</code> conectar a otro sistema).
</div></li><li><div class="para">
El único acceso de red que tienen los usuarios en el dominoi <code class="computeroutput">xguest_t</code> es con <span class="application"><strong>Firefox</strong></span> conectándose a páginas web.
</div></li><li><div class="para">
Los usuarios Linux en los dominios <code class="computeroutput">xguest_t</code>, <code class="computeroutput">user_t</code> y <code class="computeroutput">staff_t</code> pueden ingresar vía el Sistema de Ventanas X o por una terminal.
</div></li><li><div class="para">
Por defecto, los usuarios Linux en el dominio <code class="computeroutput">staff_t</code> no tienen permisos para ejecutar aplicaciones con <code class="command">/usr/bin/sudo</code>. Estos permisos deben ser configurados por un administrador.
</div></li></ul></div><div class="para">
Por defecto, los usuarios de Linux en los dominios <code class="computeroutput">guest_t</code> y <code class="computeroutput">xguest_t</code> no pueden ejecutar aplicaciones en sus directorios de inicio o en <code class="filename">/tmp/</code>, previniéndolos de ejecutar aplicaciones (que hereden los permisos de los usuarios) en directorios a los que tienen acceso de escritura. Esto ayuda a prevenir que aplicaciones maliciosas modifiquen archivos de los usuarios.
</div><div class="para">
Por defecto, los usuarios Linux en los dominios <code class="computeroutput">user_t</code> y <code class="computeroutput">staff_t</code> pueden ejecutar aplicaciones en sus directorios de inicio y en <code class="filename">/tmp/</code>. Vaya a <a class="xref" href="#sect-Security-Enhanced_Linux-Confining_Users-Booleans_for_Users_Executing_Applications" title="6.6. Booleanos para que los Usuarios Ejecuten Aplicaciones">Sección 6.6, “Booleanos para que los Usuarios Ejecuten Aplicaciones”</a> para información sobre permitir y evitar que los usuarios ejecuten aplicaciones en sus directorios de inicio y en <code class="filename">/tmp/</code>.
</div></div><div class="footnotes"><br/><hr width="100" align="left"/><div class="footnote"><p><sup>[<a id="ftn.d0e1233" href="#d0e1233" class="para">6</a>] </sup>
cuando se usan otras políticas, tal como MLS, se pueden usar otros roles, por ejemplo <code class="computeroutput">secadm_r</code>.
</p></div><div class="footnote"><p><sup>[<a id="ftn.d0e1483" href="#d0e1483" class="para">7</a>] </sup>
Cuando se usan otras políticas, tal como la MLS, se pueden usar también otros roles, por ejemplo el <code class="computeroutput">secadm_r</code>.
</p></div></div></div><div class="chapter" lang="es-ES"><div class="titlepage"><div><div><h2 class="title" id="chap-Security-Enhanced_Linux-Working_with_SELinux">Capítulo 5. Trabajando con SELinux</h2></div></div></div><div class="toc"><dl><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Working_with_SELinux-SELinux_Packages">5.1. Paquetes de SELinux</a></span></dt><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Working_with_SELinux-Which_Log_File_is_Used">5.2. Qué Archivo Log se usa</a></span></dt><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Working_with_SELinux-Main_Configuration_File">5.3. Archivo de Configuración Principal</a></span></dt><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Working_with_SELinux-Enabling_and_Disabling_SELinux">5.4. Habilitando y Deshabilitando SELinux</a></span></dt><dd><dl><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Enabling_and_Disabling_SELinux-
Enabling_SELinux">5.4.1. Habilitando SELinux</a></span></dt><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Enabling_and_Disabling_SELinux-Disabling_SELinux">5.4.2. Deshabilitando SELinux</a></span></dt></dl></dd><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Working_with_SELinux-SELinux_Modes">5.5. Modos de SELinux</a></span></dt><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Working_with_SELinux-Booleans">5.6. Booleanos</a></span></dt><dd><dl><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Booleans-Listing_Booleans">5.6.1. Listando los Booleanos</a></span></dt><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Booleans-Configuring_Booleans">5.6.2. Configurando los Booleanos</a></span></dt><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Booleans-Booleans_for_NFS_and_CIFS">5.6.3. Booleanos para NFS y CIFS</a></span></dt></dl></dd><dt><span class="section"><a href="#sect-Secur
ity-Enhanced_Linux-Working_with_SELinux-SELinux_Contexts_Labeling_Files">5.7. Contextos de SELinux - Etiquetado de Archivos</a></span></dt><dd><dl><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-SELinux_Contexts_Labeling_Files-Temporary_Changes_chcon">5.7.1. Cambios Temporales: chcon</a></span></dt><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-SELinux_Contexts_Labeling_Files-Persistent_Changes_semanage_fcontext">5.7.2. Cambios Persistentes: semanage fcontext</a></span></dt></dl></dd><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Working_with_SELinux-The_file_t_and_default_t_Types">5.8. Los tipos file_t y default_t</a></span></dt><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Working_with_SELinux-Mounting_File_Systems">5.9. Montaje de Sistemas de Archivos</a></span></dt><dd><dl><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Mounting_File_Systems-Context_Mounts">5.9.1. Montajes de Context
o</a></span></dt><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Mounting_File_Systems-Changing_the_Default_Context">5.9.2. Cambio del Contexto Predeterminado</a></span></dt><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Mounting_File_Systems-Mounting_an_NFS_File_System">5.9.3. Montando un Sistema de Archivos NFS</a></span></dt><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Mounting_File_Systems-Multiple_NFS_Mounts">5.9.4. Montajes NFS Múltiples</a></span></dt><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Mounting_File_Systems-Making_Context_Mounts_Persistent">5.9.5. Haciendo Persistente los Contextos de Montajes</a></span></dt></dl></dd><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Working_with_SELinux-Maintaining_SELinux_Labels_">5.10. Mantención de las Etiquetas de SELinux </a></span></dt><dd><dl><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Maintaining_SELinux_
Labels_-Copying_Files_and_Directories">5.10.1. Copia de Directorios y Archivos</a></span></dt><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Maintaining_SELinux_Labels_-Moving_Files_and_Directories">5.10.2. Movimiento de Archivos y Directorios</a></span></dt><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Maintaining_SELinux_Labels_-Checking_the_Default_SELinux_Context">5.10.3. Chequeando el Contexto SELinux Predeterminado</a></span></dt><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Maintaining_SELinux_Labels_-Archiving_Files_with_tar">5.10.4. Archivando archivos con tar</a></span></dt><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Maintaining_SELinux_Labels_-Archiving_Files_with_star">5.10.5. Archivando archivos con tar</a></span></dt></dl></dd></dl></div><div class="para">
Las siguientes secciones dan un breve repaso de los paquetes de SELinux principales en Fedora 11; instalación y actualización de paquetes; qué archivos de registro se usan; el archivo de configuración principal de SELinux; habilitación y deshabilitación de SELinux; modos de SELinux; configuración de Booleanos; cambios temporales y permanentes de etiquetas de archivos y directorios; superposición de las etiquetas de sistemas de archivos con el comando <code class="command">mount</code>; montaje de sistemas de archivos NFS; y cómo preservar contextos de SELinux cuando se copia y compacta archivos y directorios.
</div><div class="section" lang="es-ES"><div class="titlepage"><div><div><h2 class="title" id="sect-Security-Enhanced_Linux-Working_with_SELinux-SELinux_Packages">5.1. Paquetes de SELinux</h2></div></div></div><div class="para">
En Fedora 11, los paquetes SELinux se instalan por defecto, a menos que hayan sido manualmente excluídos durante la instalación. Por defecto, la política destinada de SELinux se usa y SELinux corre en modo Obediente. La siguiente es una descripción breve de los paquetes SELinux principales:
</div><div class="para">
<span class="package">policycoreutils</span>: provee utilitarios, tales como <code class="command">semanage</code>, <code class="command">restorecon</code>, <code class="command">audit2allow</code>, <code class="command">semodule</code>, <code class="command">load_policy</code> y <code class="command">setsebool</code>, para la operación y administración de SELinux.
</div><div class="para">
<span class="package">policycoreutils-gui</span>: provee <code class="command">system-config-selinux</code>, una herramienta gráfica para la administración de SELinux.
</div><div class="para">
<span class="package">selinux-policy</span>: provee una Política de Referencia de SELinux. La Política de Referencia de SELinux en una política de SELinux completa, y se usa como base para otras políticas, tales como la política destinada de SELinux. Vaya a la página <a href="http://oss.tresys.com/projects/refpolicy">Política de Referencia de SELinux</a> de Tresys Technology para más información. El paquete <span class="package">selinux-policy-devel</span> provee herramientas de desarrollo, tales como<code class="command">/usr/share/selinux/devel/policygentool</code> y <code class="command">/usr/share/selinux/devel/policyhelp</code>, así como archivos de política ejemplos. Este paquete fue mezclado con el paquete <span class="package">selinux-policy</span>.
</div><div class="para">
<span class="package">selinux-policy-<em class="replaceable"><code>policy</code></em></span>: provee las políticas de SELinux. Para la política destinada, instale <span class="package">selinux-policy-targeted</span>. Para MLS, instale <span class="package">selinux-policy-mls</span>. En Fedora 8, la política estricta fue mezclada con la política destinada, permitiendo a los usuarios confinados y no confinados coexistir en el mismo sistema.
</div><div class="para">
<span class="package">setroubleshoot-server</span>: traduce mensajes de negaciones, producidos cuando el acceso es denegado por SELinux, en descripciones detalladas que se ven con <code class="command">sealert</code> (que se provee en este paquete).
</div><div class="para">
<span class="package">setools</span>, <span class="package">setools-gui</span> y <span class="package">setools-console</span>: estos paquetes proveen la <a href="http://oss.tresys.com/projects/setools">Distribución de SEHerramientas de Tresys Technology</a>, un número de herramientas y bibliotecas para analizar y consultar la política, monitorear e informes de auditoría, y administración de contexto de archivos <sup>[<a id="d0e2064" href="#ftn.d0e2064" class="footnote">8</a>]</sup>. El paquete <span class="package">setools</span> es un metapaquete para las SEHerramientas. El paquete <span class="package">setools-gui</span> provee las herramientas <code class="command">apol</code>, <code class="command">seaudit</code> y <code class="command">sediffx</code>. El paquete <span class="package">setools-console</span> provee las herramientas de línea de comando <code class="command">seaudit-report</code>, <code class="command">sechecker</code>, <code class="command">sediff<
/code>, <code class="command">seinfo</code>, <code class="command">sesearch</code>, <code class="command">findcon</code>, <code class="command">replcon</code> y <code class="command">indexcon</code>. Vaya a la página de las <a href="http://oss.tresys.com/projects/setools">SEHerramientas de Tresys Technology</a> para información sobre estas herramientas.
</div><div class="para">
<span class="package">libselinux-utils</span>: provee las herramientas <code class="command">avcstat</code>, <code class="command">getenforce</code>, <code class="command">getsebool</code>, <code class="command">matchpathcon</code>, <code class="command">selinuxconlist</code>, <code class="command">selinuxdefcon</code>, <code class="command">selinuxenabled</code>, <code class="command">setenforce</code>, <code class="command">togglesebool</code>.
</div><div class="para">
<span class="package">mcstrans</span>: traduce niveles, tales como <code class="computeroutput">s0-s0:c0.c1023</code>, a una forma legible como <code class="computeroutput">SystemLow-SystemHigh</code>. Este paquete no se instala por defecto.
</div><div class="para">
Para instalar paquetes en Fedora 11, como usuario root de Linux ejecute el comando <code class="command">yum install <em class="replaceable"><code>nombre-de-paquete</code></em></code>. Por ejemplo, para instalar el paquete <span class="package">mcstrans</span>, ejecute el comando <code class="command">yum install mcstrans</code>. Para actualizar todos los paquetes instalados en Fedora 11, ejecute el comando <code class="command">yum update</code>.
</div><div class="para">
Vaya a <a href="http://docs.fedoraproject.org/yum/en/">Administración de Software con yum</a><sup>[<a id="d0e2176" href="#ftn.d0e2176" class="footnote">9</a>]</sup> para más información sobre el uso de <code class="command">yum</code> para administrar paquetes.
</div><div class="note"><h2>Nota</h2><div class="para">
En versiones anteriores de Fedora, el paquete <span class="package">selinux-policy-devel</span> es necesario cuando se crea un módulo de política local con <code class="command">audit2allow -M</code>.
</div></div></div><div class="section" lang="es-ES"><div class="titlepage"><div><div><h2 class="title" id="sect-Security-Enhanced_Linux-Working_with_SELinux-Which_Log_File_is_Used">5.2. Qué Archivo Log se usa</h2></div></div></div><div class="para">
En Fedora 11, los paquetes <span class="package">setroubleshoot-server</span> y <span class="package">audit</span> se instalan si los paquetes no se eliminan de la selección de paquetes predeterminada. Estos paquetes incluyen a los demonios <code class="systemitem">setroubleshootd</code> y <code class="systemitem">auditd</code> respectivamente. Estos demonios se ejecutan por defecto.
</div><div class="para">
Los mensajes de negación de SELinux, tales como el siguiente, se escriben por defecto en <code class="filename">/var/log/audit/audit.log</code>:
</div><pre class="screen">type=AVC msg=audit(1223024155.684:49): avc: denied { getattr } for pid=2000 comm="httpd" path="/var/www/html/archivo1" dev=dm-0 ino=399185 scontext=unconfined_u:system_r:httpd_t:s0 tcontext=system_u:object_r:samba_share_t:s0 tclass=file
</pre><div class="para">
También, si <code class="systemitem">setroubleshootd</code> está ejecutándose, lo que es por defecto, los mensajes de negación desde <code class="filename">/var/log/audit/audit.log</code> se traducen a una forma más fácil de leer en <code class="filename">/var/log/messages</code>:
</div><pre class="screen">May 7 18:55:56 localhost setroubleshoot: SELinux is preventing httpd (httpd_t) "getattr" to /var/www/html/archivo1 (samba_share_t). For complete SELinux messages. run sealert -l de7e30d6-5488-466d-a606-92c9f40d316d
</pre><div class="para">
Los mensajes de negación se envían a una ubicación distinta, dependiendo de cuáles demonios se están ejecutando:
</div><div class="segmentedlist"><table border="0"><thead><tr class="segtitle"><th>Daemon</th><th>Log Location</th></tr></thead><tbody><tr class="seglistitem"><td class="seg">auditd on</td><td class="seg"><code class="filename">/var/log/audit/audit.log</code></td></tr><tr class="seglistitem"><td class="seg">auditd off; rsyslogd on</td><td class="seg"><code class="filename">/var/log/messages</code></td></tr><tr class="seglistitem"><td class="seg">setroubleshootd, rsyslogd, and auditd on</td><td class="seg"><code class="filename">/var/log/audit/audit.log</code>. Easier-to-read denial messages also sent to <code class="filename">/var/log/messages</code></td></tr></tbody></table></div><div class="formalpara"><h5 class="formalpara" id="form-Security-Enhanced_Linux-Which_Log_File_is_Used-Starting_Daemons_Automatically">Iniciando Demonios Automáticamente</h5>
Para configurar los demonios <code class="systemitem">auditd</code>, <code class="systemitem">rsyslogd</code>, y <code class="systemitem">setroubleshootd</code> para que inicien automáticamente al arrancar, corra los siguientes comandos como usuario root de Linux:
</div><pre class="screen">/sbin/chkconfig --levels 2345 auditd on
</pre><pre class="screen">/sbin/chkconfig --levels 2345 rsyslog on
</pre><pre class="screen">/sbin/chkconfig --levels 345 setroubleshoot on
</pre><div class="para">
Use el comando <code class="command">service <em class="replaceable"><code>nombre-de-servicio</code></em> status</code> para chequear si estos servicios se están ejecutando, por ejemplo:
</div><pre class="screen">$ /sbin/service auditd status
auditd (pid <em class="replaceable"><code>1318</code></em>) is running...
</pre><div class="para">
Si los servicos de arriba no se están ejecutando (<code class="computeroutput"><em class="replaceable"><code>nombre-de-servicio</code></em> está detenido</code>), use el comando <code class="command">service <em class="replaceable"><code>nombre-de-servicio</code></em> start</code> como usuario root de Linux para iniciarlos. Por ejemplo:
</div><pre class="screen"># /sbin/service setroubleshoot start
Starting setroubleshootd: [ OK ]
</pre></div><div class="section" lang="es-ES"><div class="titlepage"><div><div><h2 class="title" id="sect-Security-Enhanced_Linux-Working_with_SELinux-Main_Configuration_File">5.3. Archivo de Configuración Principal</h2></div></div></div><div class="para">
El archivo <code class="filename">/etc/selinux/config</code> es el archivo de configuración principal de SELinux. Controla el modo de SELinux y la política de SELinux a usar:
</div><pre class="screen"># This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - No SELinux policy is loaded.
SELINUX=enforcing
# SELINUXTYPE= can take one of these two values:
# targeted - Targeted processes are protected,
# mls - Multi Level Security protection.
SELINUXTYPE=targeted
</pre><div class="variablelist"><dl><dt><span class="term"><code class="computeroutput">SELINUX=enforcing</code></span></dt><dd><div class="para">
La opción <code class="option">SELINUX</code> pone el modo en el que corre SELinux. SELinux tiene tres modos: obediente, permisivo y deshabilitado. Cuando se usa modo obediente, la política de SELinux es aplicada y SELinux niega el acceso basándose en las reglas de políticas de SELinux. Los mensajes de negación se guardan. Cuando se usa modo permisivo, la política de SELinux no es obediente. Los mensajes son guardados. SELinux no niega el acceso, pero se guardan las negaciones de acciones que hubieran sido negadas si SELinux estaba en modo obediente. Cuando se usa el modo deshabilitado, SELinux está deshabilitado (el módulo de SELinux no se registra con el kernel de Linux), y sólo se usan las reglas DAC.
</div></dd><dt><span class="term"><code class="computeroutput">SELINUXTYPE=targeted</code></span></dt><dd><div class="para">
La opción <code class="option">SELINUXTYPE</code> pone la política SELinux a usar. La política Destinada es la predeterminada. Sólo cambie esta opción si quiere usar la política MLS. Para usar la política MLS, instale el paquete <span class="package">selinux-policy-mls</span>; configure <code class="option">SELINUXTYPE=mls</code> en <code class="filename">/etc/selinux/config</code>; y reinicie su sistema.
</div></dd></dl></div><div class="important"><h2>Importante</h2><div class="para">
Cuando los sistemas corren con SELinux en modo permisivo o deshabilitado, los usuarios tiene permiso para etiquetar los archivos incorrectamente. También, los archivos creados con SELinux deshabilitado no son etiquetados. Esto causa problemas cuando se cambia a modo obediente. Para prevenir el etiquetado incorrecto o la falta de etiquetado, los sistemas de archivos son automáticamente reetiquetados cuando se cambie desde el modo deshabilitado al modo permisivo u obediente.
</div></div></div><div class="section" lang="es-ES"><div class="titlepage"><div><div><h2 class="title" id="sect-Security-Enhanced_Linux-Working_with_SELinux-Enabling_and_Disabling_SELinux">5.4. Habilitando y Deshabilitando SELinux</h2></div></div></div><div class="para">
Use los comandos <code class="command">/usr/sbin/getenforce</code> o <code class="command">/usr/sbin/sestatus</code> para chequear el estado de SELinux. El comando <code class="command">getenforce</code> devuelve <code class="computeroutput">Obediente</code>, <code class="computeroutput">Permisivo</code>, o <code class="computeroutput">Deshabilitado</code>. El comando <code class="command">getenforce</code> devuelve <code class="computeroutput">Obediente</code> cuando SELinux está habilitado (las reglas de la política de SELinux son aplicadas):
</div><pre class="screen">$ /usr/sbin/getenforce
Enforcing
</pre><div class="para">
El comando <code class="command">getenforce</code> devuelve <code class="computeroutput">Permissive</code> cuando SELinux está activado, pero las reglas de políticas de SELinux no están en obligatorio, y sólo se usan las reglas DAC. El comando <code class="command">getenforce</code> devuelve <code class="computeroutput">Disabled</code> si SELinux está deshabilitado.
</div><div class="para">
El comando <code class="command">sestatus</code> devuelve el estado de SELinux y la política de SELinux que se está usando:
</div><pre class="screen">$ /usr/sbin/sestatus
SELinux status: enabled
SELinuxfs mount: /selinux
Current mode: enforcing
Mode from config file: enforcing
Policy version: 23
Policy from config file: targeted
</pre><div class="para">
<code class="computeroutput">SELinux status: enabled</code> is returned when SELinux is enabled. <code class="computeroutput">Current mode: enforcing</code> is returned when SELinux is running in enforcing mode. <code class="computeroutput">Policy from config file: targeted</code> is returned when the SELinux targeted policy is used.
</div><div class="section" lang="es-ES"><div class="titlepage"><div><div><h3 class="title" id="sect-Security-Enhanced_Linux-Enabling_and_Disabling_SELinux-Enabling_SELinux">5.4.1. Habilitando SELinux</h3></div></div></div><div class="para">
En sistemas con SELinux deshabilitado, la opción <code class="computeroutput">SELINUX=disabled</code> se configura en <code class="filename">/etc/selinux/config</code>:
</div><pre class="screen"># This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - No SELinux policy is loaded.
SELINUX=disabled
# SELINUXTYPE= can take one of these two values:
# targeted - Targeted processes are protected,
# mls - Multi Level Security protection.
SELINUXTYPE=targeted
</pre><div class="para">
También, el comando <code class="command">getenforce</code> devuelve <code class="computeroutput">Disabled</code>:
</div><pre class="screen">$ /usr/sbin/getenforce
Disabled
</pre><div class="para">
Para habilitar SELinux:
</div><div class="orderedlist"><ol><li><div class="para">
Use los comandos <code class="command">rpm -qa | grep selinux</code>, <code class="command">rpm -q policycoreutils</code> y <code class="command">rpm -qa | grep setroubleshoot</code> para confirmar que los paquetes de SELinux están instalados. esta guía asume que los siguientes paquetes están instalados: <span class="package">selinux-policy-targeted</span>, <span class="package">selinux-policy</span>, <span class="package">libselinux</span>, <span class="package">libselinux-python</span>, <span class="package">libselinux-utils</span>, <span class="package">policycoreutils</span>, <span class="package">setroubleshoot</span>, <span class="package">setroubleshoot-server</span>, <span class="package">setroubleshoot-plugins</span>. Si estos paquetes no están instalados, como usuario root de Linux, debe instalarlos con el comando <code class="command">yum install <em class="replaceable"><code>nombre-de-paquete</code></em></code>. Los siguientes paquetes son opcionales: <s
pan class="package">policycoreutils-gui</span>, <span class="package">setroubleshoot</span>, <span class="package">selinux-policy-devel</span> y <span class="package">mcstrans</span>.
</div><div class="para">
Después de instalar el paquete <span class="package">setroubleshoot-server</span>, use el comando <code class="command">/sbin/chkconfig --list setroubleshoot</code> para confirmar que <code class="systemitem">setroubleshootd</code> se inicia cuando el sistema corre en el nivel de ejecución <sup>[<a id="d0e2504" href="#ftn.d0e2504" class="footnote">10</a>]</sup> 3, 4, y 5:
</div><pre class="screen">$ /sbin/chkconfig --list setroubleshoot
setroubleshoot 0:off 1:off 2:off 3:on 4:on 5:on 6:off
</pre><div class="para">
Si la salida difiere, como usuario root de Linux ejecute el comando <code class="command">/sbin/chkconfig --levels 345 setroubleshoot on</code>. Esto hace que <code class="systemitem">setroubleshootd</code> se inicie automáticamente cuando el sistema esté en los niveles de ejecución 3, 4 y 5.
</div></li><li><div class="para">
Antes de activar SELinux, cada archivo en el sistema de archivo debe ser etiquetado con un contexto de SELinux. Antes que esto ocurra, los dominios confinados pueden tener el acceso denegado, impidiendo de que su sistema se inicie correctamente. Para prevenir esto, configure <code class="computeroutput">SELINUX=permissive</code> en <code class="filename">/etc/selinux/config</code>:
</div><pre class="screen"># This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - No SELinux policy is loaded.
SELINUX=permissive
# SELINUXTYPE= can take one of these two values:
# targeted - Targeted processes are protected,
# mls - Multi Level Security protection.
SELINUXTYPE=targeted
</pre></li><li><div class="para">
Como usuario root de Linux, corra el comando <code class="command">reboot</code> para reiniciar el sistema. Durante el siguiente arranque, los sistemas de archivo son etiquetados. El proceso etiqueta todos los archivos con un contexto de SELinux:
</div><pre class="screen">*** Warning -- SELinux targeted policy relabel is required.
*** Relabeling could take a very long time, depending on file
*** system size and speed of hard drives.
****
</pre><div class="para">
Cada carácter <code class="computeroutput">*</code> en la línea de abajo representa 1000 archivos que han sido etiquetados. En el ejemplo de arriba, cuatro caracteres <code class="computeroutput">*</code> representan 4000 archivos etiquetados. El tiempo que toma reetiquetar todos los archivos depende del número de archivos del sistema, y la velocidad de los discos rígidos. En sistemas modernos, este proceso puede tomar 10 minutos.
</div></li><li><div class="para">
En modo permisivo, la política de SELinux no es aplicada, pero las negaciones se guardan para las acciones que hubieran sido negadas si estaba corriendo en modo obediente. Antes de cambiar a modo obediente, como usuario root de Linux, ejecute el comando <code class="command">grep "SELinux está negando" /var/log/messages</code> como usuario root de Linux para confirmar que SELinux no negó acciones durante la última reiniciada. Si SELinux no negó acciones durante el último arranque, este comando no devuelve nada. Vaya a <a class="xref" href="#chap-Security-Enhanced_Linux-Troubleshooting" title="Capítulo 7. Solución a Problemas">Capítulo 7, <i>Solución a Problemas</i></a> para información para resolver problemas si SELinux negó el acceso durante el arranque.
</div></li><li><div class="para">
Si no hay mensajes de negación en <code class="filename">/var/log/messages</code>, configure <code class="computeroutput">SELINUX=enforcing</code> en <code class="filename">/etc/selinux/config</code>:
</div><pre class="screen"># This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - No SELinux policy is loaded.
SELINUX=enforcing
# SELINUXTYPE= can take one of these two values:
# targeted - Targeted processes are protected,
# mls - Multi Level Security protection.
SELINUXTYPE=targeted
</pre></li><li><div class="para">
Reinicie su sistema. Después de reiniciar, confirme que <code class="command">getenforce</code> devuelve <code class="computeroutput">Enforcing</code>:
</div><pre class="screen">$ /usr/sbin/getenforce
Enforcing
</pre></li><li><div class="para">
Como usuario root de Linux, corra el comando <code class="command">/usr/sbin/semanage login -l</code> para ver el mapeo entre usuarios de SELinux y de Linux. La salida debe ser como la siguiente:
</div><pre class="screen">Login Name SELinux User MLS/MCS Range
__default__ unconfined_u s0-s0:c0.c1023
root unconfined_u s0-s0:c0.c1023
system_u system_u s0-s0:c0.c1023
</pre></li></ol></div><div class="para">
Si éste no es el caso, ejecute los siguientes comandos como usuario root de Linux para corregir los mapeos de usuario. Es seguro ignorar los mensajes <code class="computeroutput">El usuario SELinux <em class="replaceable"><code>nombre-de-usuario</code></em> ya está definido</code> si es que aparecen, donde <em class="replaceable"><code>nombre-de-usuario</code></em> puede ser <code class="computeroutput">unconfined_u</code>, <code class="computeroutput">guest_u</code>, o <code class="computeroutput">xguest_u</code>:
</div><div class="orderedlist"><ol><li><div class="para">
<pre class="screen">/usr/sbin/semanage usuario -a -S targeted -P usuario -R "unconfined_r system_r" -r s0-s0:c0.c1023 unconfined_u
</pre>
</div></li><li><div class="para">
<pre class="screen">/usr/sbin/semanage login -m -S targeted -s "unconfined_u" -r s0-s0:c0.c1023 __default__
</pre>
</div></li><li><div class="para">
<pre class="screen">/usr/sbin/semanage login -m -S targeted -s "unconfined_u" -r s0-s0:c0.c1023 root
</pre>
</div></li><li><div class="para">
<pre class="screen">/usr/sbin/semanage usuario -a -S targeted -P usuario -R guest_r guest_u
</pre>
</div></li><li><div class="para">
<pre class="screen">/usr/sbin/semanage usuario -a -S targeted -P usuario -R xguest_r xguest_u
</pre>
</div></li></ol></div><div class="important"><h2>Importante</h2><div class="para">
Cuando los sistemas corren con SELinux en modo permisivo o deshabilitado, los usuarios tiene permiso para etiquetar los archivos incorrectamente. También, los archivos creados con SELinux deshabilitado no son etiquetados. Esto causa problemas cuando se cambia a modo obediente. Para prevenir el etiquetado incorrecto o la falta de etiquetado, los sistemas de archivos son automáticamente reetiquetados cuando se cambie desde el modo deshabilitado al modo permisivo u obediente.
</div></div></div><div class="section" lang="es-ES"><div class="titlepage"><div><div><h3 class="title" id="sect-Security-Enhanced_Linux-Enabling_and_Disabling_SELinux-Disabling_SELinux">5.4.2. Deshabilitando SELinux</h3></div></div></div><div class="para">
Para deshabilitar SELinux, configure <code class="option">SELINUX=disabled</code> en <code class="filename">/etc/selinux/config</code>:
</div><pre class="screen"># This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - No SELinux policy is loaded.
SELINUX=disabled
# SELINUXTYPE= can take one of these two values:
# targeted - Targeted processes are protected,
# mls - Multi Level Security protection.
SELINUXTYPE=targeted
</pre><div class="para">
Reinicie su sistema. Después de reiniciar, confirme que <code class="command">getenforce</code> devuelve <code class="computeroutput">Disabled</code>:
</div><pre class="screen">$ /usr/sbin/getenforce
Disabled
</pre></div></div><div class="section" lang="es-ES"><div class="titlepage"><div><div><h2 class="title" id="sect-Security-Enhanced_Linux-Working_with_SELinux-SELinux_Modes">5.5. Modos de SELinux</h2></div></div></div><div class="para">
SELinux tiene tres modos:
</div><div class="itemizedlist"><ul><li><div class="para">
Obligatorio: la política de SELinux es obligatoria. SELinux niega el acceso basado en las reglas de políticas de SELinux.
</div></li><li><div class="para">
Permisivo: la política de SELinux no es obligatoria. SELinux no niega el acceso, pero se guardan las negaciones para acciones que hubieran sido negadas si el modo obligatorio estaba activado.
</div></li><li><div class="para">
Deshabilitado: SELinux está deshabilitado. Sólo se usan las reglas DAC.
</div></li></ul></div><div class="para">
Use el comando <code class="command">/usr/sbin/setenforce</code> para cambiar entre los modos obediente y permisivo. Los cambios hechos con <code class="command">/usr/sbin/setenforce</code> no sobreviven a una reiniciada. Para cambiar a modo obediente, como usuario root de Linux, ejecute el comando <code class="command">/usr/sbin/setenforce 1</code>. Para cambiar a modo permisivo, ejecute el comando <code class="command">/usr/sbin/setenforce 0</code>. Use el comando <code class="command">/usr/sbin/getenforce</code> para ver el modo de SELinux actual.
</div><div class="para">
Los cambios de modo persistentes se cubren en <a class="xref" href="#sect-Security-Enhanced_Linux-Working_with_SELinux-Enabling_and_Disabling_SELinux" title="5.4. Habilitando y Deshabilitando SELinux">Sección 5.4, “Habilitando y Deshabilitando SELinux”</a>.
</div></div><div class="section" lang="es-ES"><div class="titlepage"><div><div><h2 class="title" id="sect-Security-Enhanced_Linux-Working_with_SELinux-Booleans">5.6. Booleanos</h2></div></div></div><div class="para">
Los booleanos permiten cambiar partes de la política de SELinux en tiempo de ejecución, sin ningún conocimiento sobre la escritura de políticas de SELinux. Esto permite cambios, como permitir el acceso de servicios a sistemas de archivo NFS, sin recargar o recompilar la política de SELinux.
</div><div class="section" lang="es-ES"><div class="titlepage"><div><div><h3 class="title" id="sect-Security-Enhanced_Linux-Booleans-Listing_Booleans">5.6.1. Listando los Booleanos</h3></div></div></div><div class="para">
Para una lista de los Booleanos, una explicación de lo que son y de si están activos o inactivos, ejecute el comando <code class="command">semanage boolean -l</code> como usuario root de Linux. El siguiente ejemplo no lista todos los Booleanos:
</div><pre class="screen"># /usr/sbin/semanage boolean -l
SELinux boolean Description
ftp_home_dir -> off Allow ftp to read and write files in the user home directories
xen_use_nfs -> off Allow xen to manage nfs files
xguest_connect_network -> on Allow xguest to configure Network Manager
</pre><div class="para">
La columna <code class="computeroutput">SELinux boolean</code> lista los nombres de Booleanos. La columna <code class="computeroutput">Description</code> lista si el booleano está activo (on) o inactivo (off) y lo que hacen.
</div><div class="para">
En el siguiente ejemplo, el Booleano <code class="computeroutput">ftp_home_dir</code> está apagado, impidiendo al demonio FTP (<code class="systemitem">vsftpd</code>) la lectura y escritura de archivos en los directorios de inicio de los usuarios:
</div><pre class="screen">ftp_home_dir -> off Permite a ftp leer y escribir al directorio de inicio de los usuarios
</pre><div class="para">
El comando <code class="command">getsebool -a</code> lista los Booleanos, ya sea que estén activos o inactivos, pero no da una descripción de cada uno. El siguiente ejemplo no lista todos los booleanos:
</div><pre class="screen">$ /usr/sbin/getsebool -a
allow_console_login --> off
allow_cvs_read_shadow --> off
allow_daemons_dump_core --> on
</pre><div class="para">
Ejecute el comando <code class="command">getsebool <em class="replaceable"><code>nombre-de-booleano</code></em></code> para listar solamente el estado del booleano <em class="replaceable"><code>nombre-de-booleano</code></em>:
</div><pre class="screen">$ /usr/sbin/getsebool allow_console_login
allow_console_login --> off
</pre><div class="para">
Una lista separada por espacio para listar los Booleanos múltiples:
</div><pre class="screen">$ getsebool allow_console_login allow_cvs_read_shadow allow_daemons_dump_core
allow_console_login --> off
allow_cvs_read_shadow --> off
allow_daemons_dump_core --> on
</pre></div><div class="section" lang="es-ES"><div class="titlepage"><div><div><h3 class="title" id="sect-Security-Enhanced_Linux-Booleans-Configuring_Booleans">5.6.2. Configurando los Booleanos</h3></div></div></div><div class="para">
El comando <code class="command">setsebool <em class="replaceable"><code>nombre-de-booleano</code></em> <em class="replaceable"><code>x</code></em></code> activa o desactiva Booleanos, donde <em class="replaceable"><code>nombre-de-booleano</code></em> es un nombre de Booleano, y <em class="replaceable"><code>x</code></em> es <code class="option">on</code> para activar, u <code class="option">off</code> para desactivar.
</div><div class="para">
El siguiente ejemplo muestra la configuración de Booleano <code class="computeroutput">httpd_can_network_connect_db</code>:
</div><div class="orderedlist"><ol><li><div class="para">
Por defecto, el booleano <code class="computeroutput">httpd_can_network_connect_db</code> está apagado, impidiendo a los scripts y módulos del Servidor HTTP Apache conectarse a servidores de bases de datos:
</div><pre class="screen">$ /usr/sbin/getsebool httpd_can_network_connect_db
httpd_can_network_connect_db --> off
</pre></li><li><div class="para">
Para permitir temporalmente a los scripts y módulos del Servidor HTTP Apache conectarse a servidores de bases de datos, ejecute el comando <code class="command">setsebool httpd_can_network_connect_db on</code> como usuario root de Linux.
</div></li><li><div class="para">
Use el comando <code class="command">getsebool httpd_can_network_connect_db</code> para verificar que el Booleano está activado:
</div><pre class="screen">$ /usr/sbin/getsebool httpd_can_network_connect_db
httpd_can_network_connect_db --> on
</pre><div class="para">
Esto permite a los scripts y módulos del Servidor HTTP Apache conectarse a servidores de bases de datos.
</div></li><li><div class="para">
Este cambio no es persistente entre reinicios. Para hacer los cambios persistentes, corra el comando <code class="command">setsebool -P <em class="replaceable"><code>boolean-name</code></em> on</code> como usuario root de Linux:
</div><pre class="screen"># /usr/sbin/setsebool -P httpd_can_network_connect_db on
</pre></li><li><div class="para">
Para revertir temporalmente el comportamiento por defecto, como usuario root de Linux, corra el comando <code class="command">setsebool httpd_can_network_connect_db off</code>. Para que los cambios sean persistentes entre reiniciadas, ejecute el comando <code class="command">setsebool -P httpd_can_network_connect_db off</code>.
</div></li></ol></div></div><div class="section" lang="es-ES"><div class="titlepage"><div><div><h3 class="title" id="sect-Security-Enhanced_Linux-Booleans-Booleans_for_NFS_and_CIFS">5.6.3. Booleanos para NFS y CIFS</h3></div></div></div><div class="para">
Por defecto, los montajes NFS en el lado del cliente se etiquetan con el contexto predeterminado definido por la política para sistemas de archivos NFS. En políticas comúnes, este contexto predeterminado usa el tipo <code class="computeroutput">nfs_t</code>. También, por defecto, los compartidos de Samba en el lado del cliente se etiquetan con el contexto predeterminado definido por la política. En políticas comúnes, este contexto predeterminado usa el tipo <code class="computeroutput">cifs_t</code>.
</div><div class="para">
Dependiendo en la configuración de la política, los servicios pueden tener bloqueado la lectura a archivos con la etiqueta de los tipos <code class="computeroutput">nfs_t</code> o <code class="computeroutput">cifs_t</code>. Esto puede prevenir que los sistemas de archivo etiquetados con estas etiquetas se monten y sean leídos o exportados por otros servicios. Hay Booleanos que se pueden poner en 1 o 0 para controlar qué servicios pueden acceder los tipos <code class="computeroutput">nfs_t</code> y <code class="computeroutput">cifs_t</code>.
</div><div class="para">
Los comandos <code class="command">setsebool</code> y <code class="command">semanage</code> se deben ejecutar como usuario root de Linux. El comando <code class="command">setsebool -P</code> hace persistentes a los cambios. No use la opción <code class="option">-P</code> si no quiere que los cambios persistan entre reiniciadas:
</div><div class="formalpara"><h5 class="formalpara" id="form-Security-Enhanced_Linux-Booleans_for_NFS_and_CIFS-Apache_HTTP_Server">Servidor HTTP Apache</h5>
Para permitir el acceso a sistemas de archivo NFS (archivos etiquetados con el tipo <code class="computeroutput">nfs_t</code>):
</div><div class="para">
<code class="command">/usr/sbin/setsebool -P httpd_use_nfs on</code>
</div><div class="para">
Para permitir el acceso a sistemas de archivos SAMBA (archivos etiquetados con el tipo <code class="computeroutput">cifs_t</code>):
</div><div class="para">
<code class="command">/usr/sbin/setsebool -P httpd_use_cifs on</code>
</div><div class="formalpara"><h5 class="formalpara" id="form-Security-Enhanced_Linux-Booleans_for_NFS_and_CIFS-Samba">Samba</h5>
Para exportar sistemas de archivo NFS:
</div><div class="para">
<code class="command">/usr/sbin/setsebool -P samba_share_nfs on</code>
</div><div class="formalpara"><h5 class="formalpara" id="form-Security-Enhanced_Linux-Booleans_for_NFS_and_CIFS-FTP_vsftpd">FTP (<code class="systemitem">vsftpd</code>)</h5>
Para permitir el acceso a sistemas de archivo NFS:
</div><div class="para">
<code class="command">/usr/sbin/setsebool -P allow_ftpd_use_nfs on</code>
</div><div class="para">
Para permitir el acceso a sistemas de archivo Samba:
</div><div class="para">
<code class="command">/usr/sbin/setsebool -P allow_ftpd_use_cifs on</code>
</div><div class="formalpara"><h5 class="formalpara" id="form-Security-Enhanced_Linux-Booleans_for_NFS_and_CIFS-Other_Services">Otros Servicios</h5>
Para una lista de los Booleanos relacionados con NFS para otros servicios:
</div><div class="para">
<code class="command">/usr/sbin/semanage boolean -l | grep nfs</code>
</div><div class="para">
Para una lista de los Booleanos relacionados con SAMBA para otros servicios:
</div><div class="para">
<code class="command">/usr/sbin/semanage boolean -l | grep cifs</code>
</div><div class="note"><h2>Nota</h2><div class="para">
Estos Booleanos existen en la política de SELinux tal cual fueron puestos en Fedora 11. No pu eden existir en la política puesta en otras versiones de Fedora o de otros sistemas operativos.
</div></div></div></div><div class="section" lang="es-ES"><div class="titlepage"><div><div><h2 class="title" id="sect-Security-Enhanced_Linux-Working_with_SELinux-SELinux_Contexts_Labeling_Files">5.7. Contextos de SELinux - Etiquetado de Archivos</h2></div></div></div><div class="para">
En sistemas que corren SELinux, todos los procesos y archivos son etiquetados con una etiqueta que contiene información de seguridad relevante. Esta información se llama contexto de SELinux. Para archivos, esto se ve usando el comando <code class="command">ls -Z</code>:
</div><pre class="screen">$ ls -Z archivo1
-rw-rw-r-- usuario1 grupo1 unconfined_u:object_r:user_home_t:s0 archivo1
</pre><div class="para">
En este ejemplo, SELinux provee un usuario (<code class="computeroutput">unconfined_u</code>), un rol (<code class="computeroutput">object_r</code>), un tipo (<code class="computeroutput">user_home_t</code>) y un nivel (<code class="computeroutput">s0</code>). Esta información se usa para tomar decisiones sobre el control de acceso. En sistemas DAC, el control de acceso se basa en los IDs de usuario y grupo de Linux. Las reglas de la política de SELinux se chequean después de las reglas DAC. Las reglas de la política de SELinux no se usan si las reglas DAC niegan el acceso antes.
</div><div class="para">
Hay muchos comandos para la administración del contexto de archivos de SELinux, como por ejemplo <code class="command">chcon</code>, <code class="command">semanage fcontext</code>, y <code class="command">restorecon</code>.
</div><div class="section" lang="es-ES"><div class="titlepage"><div><div><h3 class="title" id="sect-Security-Enhanced_Linux-SELinux_Contexts_Labeling_Files-Temporary_Changes_chcon">5.7.1. Cambios Temporales: chcon</h3></div></div></div><div class="para">
El comando <code class="command">chcon</code> cambia el contexto SELinux de los archivos. Estos cambios no sobreviven un reetiquetado del sistema de archivo, o el comando <code class="command">/sbin/restorecon</code>. La política de SELinux controla si los usuarios pueden modificar el contexto SELinux de algún archivo. Cuando se usa <code class="command">chcon</code>, los usuarios proveen toda o parte del contexto SELinux a cambiar. Un tipo de archivo incorrecto es una causa común de negación de acceso de SELinux.
</div><div class="formalpara"><h5 class="formalpara" id="form-Security-Enhanced_Linux-Temporary_Changes_chcon-Quick_Reference">Referencia Rápida</h5>
<div class="itemizedlist"><ul><li><div class="para">
Ejecute el comando <code class="command">chcon -t <em class="replaceable"><code>tipo</code></em> <em class="replaceable"><code>nombre-de-archivo</code></em></code> para cambiar el tipo de archivo, donde <em class="replaceable"><code>tipo</code></em> es el tipo, por ejemplo <code class="computeroutput">httpd_sys_content_t</code>, y <em class="replaceable"><code>nombre-de-archivo</code></em> es un nombre de archivo o de directorio.
</div></li><li><div class="para">
Ejecute el comando <code class="command">chcon -R -t <em class="replaceable"><code>tipo</code></em> <em class="replaceable"><code>nombre-de-directorio</code></em></code> para cambiar el tipo de un directorio y su contenido, donde <em class="replaceable"><code>tipo</code></em> es el tipo, por ejemplo <code class="computeroutput">httpd_sys_content_t</code>, y <em class="replaceable"><code>nombre-de-directorio</code></em> es un nombre de directorio.
</div></li></ul></div>
</div><div class="formalpara"><h5 class="formalpara" id="form-Security-Enhanced_Linux-Temporary_Changes_chcon-Changing_a_Files_or_Directorys_Type">Cambiando el Tipo de un Archivo o de un Directorio</h5>
El siguiente ejemplo muestra el cambio de tipo solamente en el contexto de SELinux:
</div><div class="orderedlist"><ol><li><div class="para">
Ejecute el comando <code class="command">cd</code> sin argumentos para cambiar a su directorio de inicio.
</div></li><li><div class="para">
Ejecute el comando <code class="command">touch archivo1</code> para crear un archivo nuevo. Use el comando <code class="command">ls -Z archivo1</code> para ver el contexto de SELinux del <code class="filename">archivo1</code>:
</div><pre class="screen">$ ls -Z archivo1
-rw-rw-r-- usuario1 grupo1 unconfined_u:object_r:user_home_t:s0 archivo1
</pre><div class="para">
En este ejemplo, el contexto SELinux del <code class="filename">archivo1</code> incluye el usuario <code class="computeroutput">unconfined_u</code>, el rol <code class="computeroutput">object_r</code>, el tipo <code class="computeroutput">user_home_t</code>, y el nivel <code class="computeroutput">s0</code>. Para una descripción de cada parte del contexto SELinux, vaya a <a class="xref" href="#chap-Security-Enhanced_Linux-SELinux_Contexts" title="Capítulo 3. Contextos de SELinux">Capítulo 3, <i>Contextos de SELinux</i></a>.
</div></li><li><div class="para">
EJecute el comando <code class="command">chcon -t samba_share_t archivo1</code> para cambiar el tipo a <code class="computeroutput">samba_share_t</code>. La opción <code class="option">-t</code> sólo cambia el tipo. Vea el cambio con <code class="command">ls -Z archivo1</code>:
</div><pre class="screen">$ ls -Z archivo1
-rw-rw-r-- usuario1 grupo1 unconfined_u:object_r:samba_share_t:s0 archivo1
</pre></li><li><div class="para">
Use el comando <code class="command">/sbin/restorecon -v archivo1</code> para restaurar el contexto de SELinux del <code class="filename">archivo1</code>. Use la opción <code class="option">-v</code> para ver qué cambia:
</div><pre class="screen">$ /sbin/restorecon -v archivo1
restorecon reset archivo1 context unconfined_u:object_r:samba_share_t:s0->system_u:object_r:user_home_t:s0
</pre><div class="para">
En este ejemplo, el tipo previo <code class="computeroutput">samba_share_t</code>, se restaura al tipo correcto <code class="computeroutput">user_home_t</code>. Cuando se usa la política destinada (la política SELinux predeterminada en Fedora 11), el comando <code class="command">/sbin/restorecon</code> lee los archivos en el directorio <code class="filename">/etc/selinux/targeted/contexts/files/</code> para ver qué contexto de SELinux deben tener los archivos.
</div></li></ol></div><div class="para">
El ejemplo en esta sección funciona igual para directorios, por ejemplo, si <code class="filename">archivo1</code> fuera un directorio.
</div><div class="formalpara"><h5 class="formalpara" id="form-Security-Enhanced_Linux-Temporary_Changes_chcon-Changing_a_Directory_and_its_Contents_Types">Cambio de un Directorio y sus Tipos de Contenidos</h5>
El siguiente ejemplo muestra la creación de un directorio nuevo y el cambio del tipo de archivo del mismo (junto con su contenido) a un tipo usado por el Servidor HTTP Apache. La configuración en este ejemplo se usa si quiere que el Servidor HTTP Apache use una raíz de documento distinta (en vez de <code class="filename">/var/www/html/</code>):
</div><div class="orderedlist"><ol><li><div class="para">
Como usuario root de Linux, ejecute el comando <code class="command">mkdir /web</code> para crear un directorio nuevo, y luego el comando <code class="command">touch /web/archivo{1,2,3}</code> para crear 3 archivos vacíos (<code class="filename">archivo1</code>, <code class="filename">archivo2</code> y <code class="filename">archivo3</code>). El directorio <code class="filename">/web/</code> y los archivos en él son etiquetados con el tipo <code class="computeroutput">default_t</code>:
</div><pre class="screen"># ls -dZ /web
drwxr-xr-x root root unconfined_u:object_r:default_t:s0 /web
# ls -lZ /web
-rw-r--r-- root root unconfined_u:object_r:default_t:s0 archivo1
-rw-r--r-- root root unconfined_u:object_r:default_t:s0 archivo2
-rw-r--r-- root root unconfined_u:object_r:default_t:s0 archivo3
</pre></li><li><div class="para">
Como usuario root de Linux, corra el comando <code class="command">chcon -R -t httpd_sys_content_t /web/</code> para cambiar el tipo del directorio <code class="filename">/web/</code> (y su contenido) a <code class="computeroutput">httpd_sys_content_t</code>:
</div><pre class="screen"># chcon -R -t httpd_sys_content_t /web/
# ls -dZ /web/
drwxr-xr-x root root unconfined_u:object_r:httpd_sys_content_t:s0 /web/
# ls -lZ /web/
-rw-r--r-- root root unconfined_u:object_r:httpd_sys_content_t:s0 archivo1
-rw-r--r-- root root unconfined_u:object_r:httpd_sys_content_t:s0 archivo2
-rw-r--r-- root root unconfined_u:object_r:httpd_sys_content_t:s0 archivo3
</pre></li><li><div class="para">
Como usuario root de Linux, corra el comando <code class="command">/sbin/restorecon -R -v /web/</code> para restaurar los contextos de SELinux predeterminados:
</div><pre class="screen"># /sbin/restorecon -R -v /web/
restorecon reset /web context unconfined_u:object_r:httpd_sys_content_t:s0->system_u:object_r:default_t:s0
restorecon reset /web/archivo2 context unconfined_u:object_r:httpd_sys_content_t:s0->system_u:object_r:default_t:s0
restorecon reset /web/archivo3 context unconfined_u:object_r:httpd_sys_content_t:s0->system_u:object_r:default_t:s0
restorecon reset /web/archivo1 context unconfined_u:object_r:httpd_sys_content_t:s0->system_u:object_r:default_t:s0
</pre></li></ol></div><div class="para">
Vaya a la página del manual de <span class="citerefentry"><span class="refentrytitle">chcon</span>(1)</span> para más información sobre <code class="command">chcon</code>.
</div><div class="note"><h2>Nota</h2><div class="para">
La Obligación de Tipo es el control de permisos principal usado en la política destinada de SELinux. Para la mayor parte, los usuarios y roles de SELinux se pueden ignorar.
</div></div></div><div class="section" lang="es-ES"><div class="titlepage"><div><div><h3 class="title" id="sect-Security-Enhanced_Linux-SELinux_Contexts_Labeling_Files-Persistent_Changes_semanage_fcontext">5.7.2. Cambios Persistentes: semanage fcontext</h3></div></div></div><div class="para">
El comando <code class="command">/usr/sbin/semanage fcontext</code> cambia el contexto SELinux de los archivos. Cuando se usa la política destinada, los cambios hechos con este comando se agregan al archivo <code class="filename">/etc/selinux/targeted/contexts/files/file_contexts</code> si los cambios so para archivos que están en <code class="filename">file_contexts</code>, se agregan a <code class="filename">file_contexts.local</code> para archivos nuevos y directorios, como sería al crear un directorio <code class="filename">/web/</code> nuevo. <code class="command">setfiles</code>, que se usa cuando el sistema de archivo es reetiquetado, y <code class="command">/sbin/restorecon</code>, que restaura los contextos de SELinux predeterminados, leen estos archivos, Lo que significa que los cambios hechos por <code class="command">/usr/sbin/semanage fcontext</code> son persistentes, aún si el sistema de archivo es reetiquetado. La política de SELinux controla si los us
uarios pueden modificar el contexto de SELinux para cualquier archivo dado.
</div><div class="formalpara"><h5 class="formalpara" id="form-Security-Enhanced_Linux-Persistent_Changes_semanage_fcontext-Quick_Reference">Referencia Rápida</h5>
Para hacer que los cambios de contexto de SELinux sobrevivan un reetiquetado del sistema de archivo:
</div><div class="orderedlist"><ol><li><div class="para">
Ejecute el comando <code class="command">/usr/sbin/semanage fcontext -a <em class="replaceable"><code>opciones</code></em> <em class="replaceable"><code>nombre-de-archivo</code></em>|<em class="replaceable"><code>nombre-de-directorio</code></em></code>, recuerde usar la dirección completa del archivo o del directorio.
</div></li><li><div class="para">
Ejecute el comando <code class="command">/sbin/restorecon -v <em class="replaceable"><code>nombre-de-archivo</code></em>|<em class="replaceable"><code>nombre-de-directorio</code></em></code> para aplicar los cambios de contexto.
</div></li></ol></div><div class="formalpara"><h5 class="formalpara" id="form-Security-Enhanced_Linux-Persistent_Changes_semanage_fcontext-Changing_a_Files_Type">Cambiando un Tipo de archivo</h5>
El siguiente ejemplo muestra el cambio de tipo de un archivo, sin tocar otros atributos del contexto de SELinux:
</div><div class="orderedlist"><ol><li><div class="para">
Como usuario root de Linux, ejecute el comando <code class="command">touch /etc/archivo1</code> para crear un archivo nuevo. Por defecto, los archivos recién creados en el directorio <code class="filename">/etc/</code> se etiquetan con el tipo <code class="computeroutput">etc_t</code>:
</div><pre class="screen"># ls -Z /etc/archivo1
-rw-r--r-- root root unconfined_u:object_r:etc_t:s0 /etc/archivo1
</pre></li><li><div class="para">
Como usuario root de Linux, ejecute el comando <code class="command">/usr/sbin/semanage fcontext -a -t samba_share_t /etc/archivo1</code> para cambiar el tipo del <code class="filename">archivo1</code> a <code class="computeroutput">samba_share_t</code>. La opción <code class="option">-a</code> agrega un registro nuevo, y la opción <code class="option">-t</code> define un tipo (<code class="computeroutput">samba_share_t</code>). Nota: al ejecutar este comando no se cambia directamente el tipo - el <code class="filename">archivo1</code> todavía es del tipo <code class="computeroutput">etc_t</code>:
</div><pre class="screen"># /usr/sbin/semanage fcontext -a -t samba_share_t /etc/archivo1
# ls -Z /etc/archivo1
-rw-r--r-- root root unconfined_u:object_r:etc_t:s0 /etc/archivo1
</pre><div class="para">
El comando <code class="command">/usr/sbin/semanage fcontext -a -t samba_share_t /etc/archivo1</code> agrega la siguiente entrada a <code class="filename">/etc/selinux/targeted/contexts/files/file_contexts.local</code>:
</div><pre class="screen">/etc/archivo1 unconfined_u:object_r:samba_share_t:s0
</pre></li><li><div class="para">
Como usuario root de Linux, ejecute el comando <code class="command">/sbin/restorecon -v /etc/archivo1</code> para cambiar el tipo. Dado que el comando <code class="command">semanage</code> agregó una entrada a <code class="filename">file.contexts.local</code> para <code class="filename">/etc/archivo1</code>, el comando <code class="command">/sbin/restorecon</code> cambia el tipo a <code class="computeroutput">samba_share_t</code>:
</div><pre class="screen"># /sbin/restorecon -v /etc/archivo1
restorecon reset /etc/archivo1 context unconfined_u:object_r:etc_t:s0->system_u:object_r:samba_share_t:s0
</pre></li><li><div class="para">
Como usuario root de Linux, ejecute el comando <code class="command">rm -i /etc/archivo1</code> para borrar el <code class="filename">archivo1</code>.
</div></li><li><div class="para">
Como usuario root de Linux, ejecute el comando <code class="command">/usr/sbin/semanage fcontext -d /etc/archivo1</code> para eliminar el contexto agregado para <code class="filename">/etc/archivo1</code>. Cuando el contexto se elimina, ejecutando <code class="command">restorecon</code> cambia el tipo a <code class="computeroutput">etc_t</code>, en vez de <code class="computeroutput">samba_share_t</code>.
</div></li></ol></div><div class="formalpara"><h5 class="formalpara" id="form-Security-Enhanced_Linux-Persistent_Changes_semanage_fcontext-Changing_a_Directorys_Type">Cambiando un Tipo de Directorio</h5>
El siguiente ejemplo muestra la creación de un directorio nuevo y el cambio del tipo de archivo del directorio a un tipo usado por el Servidor HTTP Apache:
</div><div class="orderedlist"><ol><li><div class="para">
Como usuario root de LInux, ejecute el comando <code class="command">mkdir /web</code> para crear un directorio nuevo. Este directorio se etiqueta con el tipo <code class="computeroutput">default_t</code>:
</div><pre class="screen"># ls -dZ /web
drwxr-xr-x root root unconfined_u:object_r:default_t:s0 /web
</pre><div class="para">
La opción <code class="option">-d</code> de <code class="command">ls</code> hace que <code class="command">ls</code> liste la información de un directorio, en vez de su contenido, y la opción <code class="option">-Z</code> hace que <code class="command">ls</code> muestre el contexto de SELinux (en este ejemplo, <code class="computeroutput">unconfined_u:object_r:default_t:s0</code>).
</div></li><li><div class="para">
Como usuario root de Linux, ejecute el comando <code class="command">/usr/sbin/semanage fcontext -a -t httpd_sys_content_t /web</code> para cambiar el tipo de <code class="filename">/web/</code> a <code class="computeroutput">httpd_sys_content_t</code>. La opción <code class="option">-a</code> agrega un nuevo registro, y la opción <code class="option">-t</code> define un tipo (<code class="computeroutput">httpd_sys_content_t</code>). Nota: la ejecución de este comando no cambia el tipo directamente - <code class="filename">/web/</code> todavía tiene la etiqueta de tipo <code class="computeroutput">default_t</code>:
</div><pre class="screen"># /usr/sbin/semanage fcontext -a -t httpd_sys_content_t /web
# ls -dZ /web
drwxr-xr-x root root unconfined_u:object_r:default_t:s0 /web
</pre><div class="para">
El comando <code class="command">/usr/sbin/semanage fcontext -a -t httpd_sys_content_t /web</code> agrega la siguiente entrada a <code class="command">/etc/selinux/targeted/contexts/files/file_contexts.local</code>:
</div><pre class="screen">/web unconfined_u:object_r:httpd_sys_content_t:s0
</pre></li><li><div class="para">
Como usuario root de Linux, ejecute el comando <code class="command">/sbin/restorecon -v /web</code> para cambiar el tipo. Como el comando <code class="command">semanage</code> agregó una entrada a <code class="filename">file.contexts.local</code> para <code class="filename">/web</code>, el comando <code class="command">/sbin/restorecon</code> cambia el tipo a <code class="computeroutput">httpd_sys_content_t</code>:
</div><pre class="screen"># /sbin/restorecon -v /web
restorecon reset /web context unconfined_u:object_r:default_t:s0->system_u:object_r:httpd_sys_content_t:s0
</pre><div class="para">
Por defecto, los archivos y directorios recién creados heredan el tipo SELinux de sus carpetas padres. Cuando se usó este ejemplo, y antes de eliminar el contexto SELinux agregado para <code class="filename">/web/</code>, los archivos y directorios creados en el directorio <code class="filename">/web/</code> fueron etiquetados con el tipo <code class="computeroutput">httpd_sys_content_t</code>.
</div></li><li><div class="para">
Como usuario root de Linux, ejecute el comando <code class="command">/usr/sbin/semanage fcontext -d /web</code> para borrar el contexto agregado para <code class="filename">/web/</code>.
</div></li><li><div class="para">
Como usuario root de Linux, ejecute el comando <code class="command">/sbin/restorecon -v /web</code> para restaurar el contexto predeterminado de SELinux.
</div></li></ol></div><div class="formalpara"><h5 class="formalpara" id="form-Security-Enhanced_Linux-Persistent_Changes_semanage_fcontext-Changing_a_Directory_and_its_Contents_Types">Cambio de un Directorio y sus Tipos de Contenidos</h5>
El siguiente ejemplo muestra la creación de un directorio nuevo y el cambio del tipo de archivo del mismo (junto con su contenido) a un tipo usado por el Servidor HTTP Apache. La configuración en este ejemplo se usa si quiere que el Servidor HTTP Apache use una raíz de documento distinta (en vez de <code class="filename">/var/www/html/</code>):
</div><div class="orderedlist"><ol><li><div class="para">
Como usuario root de Linux, ejecute el comando <code class="command">mkdir /web</code> para crear un directorio nuevo, y luego el comando <code class="command">touch /web/archivo{1,2,3}</code> para crear 3 archivos vacíos (<code class="filename">archivo1</code>, <code class="filename">archivo2</code> y <code class="filename">archivo3</code>). El directorio <code class="filename">/web/</code> y los archivos en él son etiquetados con el tipo <code class="computeroutput">default_t</code>:
</div><pre class="screen"># ls -dZ /web
drwxr-xr-x root root unconfined_u:object_r:default_t:s0 /web
# ls -lZ /web
-rw-r--r-- root root unconfined_u:object_r:default_t:s0 archivo1
-rw-r--r-- root root unconfined_u:object_r:default_t:s0 archivo2
-rw-r--r-- root root unconfined_u:object_r:default_t:s0 archivo3
</pre></li><li><div class="para">
Como usuario root de Linux, ejecute el comando <code class="command">/usr/sbin/semanage fcontext -a -t httpd_sys_content_t "/web(/.*)?"</code> para cambiar el tipo del directorio <code class="filename">/web/</code> junto con los archivos dentro de él, a <code class="computeroutput">httpd_sys_content_t</code>. La opción <code class="option">-a</code> agrega un registro nuevo, y la opción <code class="option">-t</code> define un tipo(httpd_sys_content_t). La expresión regular <code class="computeroutput">"/web(/.*)?"</code> hace que el comando <code class="command">semanage</code> aplique los cambios al directorio <code class="filename">/web/</code>, así como a los archivos dentro de él. Nota: la ejecución de este comando no cambia el tipo directamente - <code class="filename">/web/</code> y los archivos dentro de él todavía tienen la etiqueta del tipo <code class="computeroutput">default_t</code>:
</div><pre class="screen"># ls -dZ /web
drwxr-xr-x root root unconfined_u:object_r:default_t:s0 /web
# ls -lZ /web
-rw-r--r-- root root unconfined_u:object_r:default_t:s0 archivo1
-rw-r--r-- root root unconfined_u:object_r:default_t:s0 archivo2
-rw-r--r-- root root unconfined_u:object_r:default_t:s0 archivo3
</pre><div class="para">
El comando <code class="command">/usr/sbin/semanage fcontext -a -t httpd_sys_content_t "/web(/.*)?"</code> agrega una entrada a <code class="filename">/etc/selinux/targeted/contexts/files/file_contexts.local</code>:
</div><pre class="screen">/web(/.*)? system_u:object_r:httpd_sys_content_t:s0
</pre></li><li><div class="para">
Como usuario root de LInux, ejecute el comando <code class="command">/sbin/restorecon -R -v /web</code> para cambiar elt ipo del directorio <code class="filename">/web/</code>, junto con los archivos dentro de él. La opción <code class="option">-R</code> significa recursivo, es decir, todos los archivos y directorios dentro del directorio <code class="filename">/web/</code> se etiquetarán con el tipo <code class="computeroutput">httpd_sys_content_t</code>. Dado que el comando <code class="command">semanage</code> agregó una entrada en <code class="filename">file.contexts.local</code> para <code class="computeroutput">/web(/.*)?</code>, el comando <code class="command">/sbin/restorecon</code> los tipos a <code class="computeroutput">httpd_sys_content_t</code>:
</div><pre class="screen"># /sbin/restorecon -R -v /web
restorecon reset /web context unconfined_u:object_r:default_t:s0->system_u:object_r:httpd_sys_content_t:s0
restorecon reset /web/archivo2 context unconfined_u:object_r:default_t:s0->system_u:object_r:httpd_sys_content_t:s0
restorecon reset /web/archivo3 context unconfined_u:object_r:default_t:s0->system_u:object_r:httpd_sys_content_t:s0
restorecon reset /web/archivo1 context unconfined_u:object_r:default_t:s0->system_u:object_r:httpd_sys_content_t:s0
</pre><div class="para">
Por defecto, los archivos y directorios recién creados heredan el tipo SELinux de sus padres. En este ejemplo, los archivos y directorios creado en el directorio <code class="filename">/web/</code> se etiquetarán con el tipo <code class="computeroutput">httpd_sys_content_t</code>.
</div></li><li><div class="para">
Como usuario root de Linux, ejecute el comando <code class="command">/usr/sbin/semanage fcontext -d "/web(/.*)?"</code> para eliminar el contexto agregado para <code class="computeroutput">"/web(/.*)?"</code>.
</div></li><li><div class="para">
Como usuario root de Linux, ejecute el comando <code class="command">/sbin/restorecon -R -v /web</code> para restaurar el contexto predeterminado de SELinux.
</div></li></ol></div><div class="formalpara"><h5 class="formalpara" id="form-Security-Enhanced_Linux-Persistent_Changes_semanage_fcontext-Deleting_an_added_Context">Borrado de un Contexto agregado</h5>
El siguiente ejemplo muestra el agregado y su eliminación del contexto de SELinux:
</div><div class="orderedlist"><ol><li><div class="para">
Como usuario root de Linux, ejecute el comando <code class="command">/usr/sbin/semanage fcontext -a -t httpd_sys_content_t /prueba</code>. El directorio <code class="filename">/prueba/</code> no tiene que existir. Este comando agrega el siguiente contexto a <code class="filename">/etc/selinux/targeted/contexts/files/file_contexts.local</code>:
</div><pre class="screen">/prueba system_u:object_r:httpd_sys_content_t:s0
</pre></li><li><div class="para">
Para eliminar el contexto, como usuario root de Linux, ejecute el comando <code class="command">/usr/sbin/semanage fcontext -d <em class="replaceable"><code>nombre-de-archivo</code></em>|<em class="replaceable"><code>nombre-de-directorio</code></em></code>, donde <em class="replaceable"><code>nombre-de-archivo</code></em>|<em class="replaceable"><code>nombre-de-directorio</code></em> es la primera parte en <code class="filename">file_contexts.local</code>. El siguiente es un ejemplo de un contexto en <code class="filename">file_contexts.local</code>:
</div><pre class="screen">/prueba system_u:object_r:httpd_sys_content_t:s0
</pre><div class="para">
Siendo la primera parte <code class="computeroutput">/prueba</code>. Para evitar que el directorio <code class="filename">/prueba/</code> se etiquete con <code class="computeroutput">httpd_sys_content_t</code> después de ejecutar <code class="command">/sbin/restorecon</code>, o después de un reetiquetado del sistema, ejecute el siguiente comando como usuario root de Linux para eliminar el contexto de <code class="filename">file_contexts.local</code>:
</div><div class="para">
<code class="command">/usr/sbin/semanage fcontext -d /prueba</code>
</div></li></ol></div><div class="para">
Si el contexto es parte de una expresión regular, por ejemplo <code class="computeroutput">/web(/.*)?</code>, use las comillas para encerrar la expresión regular:
</div><div class="para">
<code class="command">/usr/sbin/semanage fcontext -d "/web(/.*)?"</code>
</div><div class="para">
Vaya a la página de manual de <span class="citerefentry"><span class="refentrytitle">semanage</span>(8)</span> para información adicional sobre <code class="command">/usr/sbin/semanage</code>.
</div><div class="important"><h2>Importante</h2><div class="para">
Cuando se cambia el contexto de SELinux con <code class="command">/usr/sbin/semanage fcontext -a</code>, use la dirección completa del archivo o directorio para evitar etiquetar mal los archivos después de un reetiquetado del sistema de archivo, o después ejecutar el comando <code class="command">/sbin/restorecon</code>.
</div></div></div></div><div class="section" lang="es-ES"><div class="titlepage"><div><div><h2 class="title" id="sect-Security-Enhanced_Linux-Working_with_SELinux-The_file_t_and_default_t_Types">5.8. Los tipos file_t y default_t</h2></div></div></div><div class="para">
En sistemas de archivo que soportan atributos extendidos, cuando se accede a un archivo en disco al que le falta el contexto de SELinux, se trata como si tuviera un contexto predeterminado tal como fue definido en la política de SELinux. En políticas comunes, este conexto por defecto usa el tipo <code class="computeroutput">file_t</code>. Este debería ser el único uso de este tipo, por lo que los archivos sin un contexto en el disco se podrían distinguir en la política, y generalmente mantenerse inaccesibles a dominios confinados. El tipo <code class="computeroutput">file_t</code> no debería existir en sistemas de archivo correctamente etiquetados, porque todos los archivos dado que todos los archivos en un sistema corriendo SELinux deberían tener un contexto de SELinux, y el tipo <code class="computeroutput">file_t</code> no sebería usarse en la configuración de contexto de archivos <sup>[<a id="d0e3749" href="#ftn.d0e3749" class="footnote">11</a>]</sup>.
</div><div class="para">
El tipo <code class="computeroutput">default_t</code> se usa en archivos que no coinciden con ningún otro patrón en la configuración de contexto de archivo, por lo que tales archivos se pueden distinguir de aquellos que no tienen un contexto en el disco, y generalmente mantenerse inaccesibles a los dominios confinados. Si crea un directorio de alto nivel, tal como <code class="filename">/midir/</code>, este directorio puede ser etiquetado con el tipo <code class="computeroutput">default_t</code>. Si los servicios necesitan acceder a tal directorio, actualice la configuración de contextos de archivo para esta ubicación. Vaya a <a class="xref" href="#sect-Security-Enhanced_Linux-SELinux_Contexts_Labeling_Files-Persistent_Changes_semanage_fcontext" title="5.7.2. Cambios Persistentes: semanage fcontext">Sección 5.7.2, “Cambios Persistentes: semanage fcontext”</a> para más detalles sobre agragado de un contexto para la configuración de contexto de archivos.
</div></div><div class="section" lang="es-ES"><div class="titlepage"><div><div><h2 class="title" id="sect-Security-Enhanced_Linux-Working_with_SELinux-Mounting_File_Systems">5.9. Montaje de Sistemas de Archivos</h2></div></div></div><div class="para">
Por defecto, cuando un sistema de archivo que soporta atributos extendidos se monta, el contexto de seguridad para cada archivo se obtiene de atributo extendido <span class="emphasis"><em>security.selinux</em></span> del archivo. A los archivos en sistemas de archivo que no dan soporte a atributos extendidos se les asigna un único contexto de seguridad predeterminado desde la configuración de la política, basada en el tipo de sistema de archivo.
</div><div class="para">
Use el comando <code class="command">mount -o context</code> para superponer los atributos extendidos actuales, o para especificar uno distinto y por defecto para sistemas de archivo que no dan soporte a atributos extendidos. Esto es útil si no confía en que un sistema de archivo provea los atributos correctos, por ejemplo, medios removibles en sistemas múltiples. El comando <code class="command">mount -o context</code> también se puede ussar para dar soporte al etiquetado de sistemas de archivos que no soportan atributos extendidos, tales como la Tabla de Ubicación de Archivos (FAT) o los sistemas de archivo NFS. El contexto especificado con la opción <code class="option">context</code> no se escribe al disco: los contextos originales son preservados, y se ven cuando se lo monta sin la opción <code class="option">context</code> (si el sistema de archivo ya tenía sopoorte para atributos extendidos).
</div><div class="para">
Para más información sobre el etiquetado de sistemas de archivo, vaya al artículo de James Morris "Etiquetado del Sistema de Archivo en SELinux": <a href="http://www.linuxjournal.com/article/7426">http://www.linuxjournal.com/article/7426</a>.
</div><div class="section" lang="es-ES"><div class="titlepage"><div><div><h3 class="title" id="sect-Security-Enhanced_Linux-Mounting_File_Systems-Context_Mounts">5.9.1. Montajes de Contexto</h3></div></div></div><div class="para">
Para montar un sistema de archivo con el contexto especificado, superponiendo los contextos existentes si existieran, o para especificar uno predeterminado distinto para un sistema de archivo que no da soporte para atributos extendidos, como usuario root de Linux, use el comando <code class="command">mount -o context=<em class="replaceable"><code>SELinux_user:role:type:level</code></em></code> cuando monte el sistema de archivo deseado. Los cambios de contexto no se graban en el disco. Por defecto, los montajes NFS en el lado del cliente se etiquetan con un contexto distinto definido por una política para sistemas de archivo NFS. En políticas comunes, este contexto predeterminado usa el tipo <code class="computeroutput">nfs_t</code>. Sin las opciones de montaje adicionales, esto podría evitar el que sistemas de archivo NFS sean compartidos vía otros servicios, como el Servidor HTTP Apache. El siguiente ejemplo monta un sistema de archivo NFS para que se pueda acceder
a través del Servidor HTTP Apache:
</div><div class="para">
<pre class="screen"># mount servidor:/export /local/mount/point -o\
context="system_u:object_r:httpd_sys_content_t:s0"
</pre>
</div><div class="para">
Los archivos y directorios recién creados en este sistema de archivo parecen tener un contexto SELinux especificado con <code class="option">-o contexto</code>; sin embargo, dado que los cambios del contexto no se escriben en el disco en estas situaciones, el contexto especificado por la opción <code class="option">-o contexto</code> sólo se mantiene si se usa la misma opción en la siguiente montada, y si además se especifica el mismo contexto.
</div><div class="para">
La Obligación de Tipo es el control de permiso principal en la política destinada de SELinux. Para la mayor parte, los usuarios y roles de SELinux se pueden ignorar, por lo que, cuando se superponga el contexto de SELinux con <code class="option">-o context</code>, use el usuario SELinux <code class="computeroutput">system_u</code> y el rol <code class="computeroutput">object_r</code>, y concéntrese en el tipo. Si no está usando la política MLS o seguridad multi-categoría, use el nivel <code class="computeroutput">s0</code>.
</div><div class="note"><h2>Nota</h2><div class="para">
Cuando se monta un sistema de archivo con la opción <code class="option">context</code>, los cambios de contexto (por usuarios y procesos) son prohibidos. Por ejemplo, ejecutando <code class="command">chcon</code> en un sistema de archivo montado con la opción <code class="option">context</code> resulta en un error de <code class="computeroutput">Operación no soportada</code>.
</div></div></div><div class="section" lang="es-ES"><div class="titlepage"><div><div><h3 class="title" id="sect-Security-Enhanced_Linux-Mounting_File_Systems-Changing_the_Default_Context">5.9.2. Cambio del Contexto Predeterminado</h3></div></div></div><div class="para">
Como se mencionó en <a class="xref" href="#sect-Security-Enhanced_Linux-Working_with_SELinux-The_file_t_and_default_t_Types" title="5.8. Los tipos file_t y default_t">Sección 5.8, “Los tipos file_t y default_t”</a>, en sistemas de archivo que soportan atributos extendidos, cuando se accede a un archivo en disco que le falta el contexto SELinux, se trata como si hubiera tenido el contexto predeterminado tal como se define en la política SELinux. En políticas comúnes, este contexto predeterminados usa el tipo <code class="computeroutput">file_t</code>. Si se desea usar un contexto predeterminado diferente, monte el sistema de archivo con la opción<code class="option">defcontext</code>.
</div><div class="para">
El siguiente ejemplo monta un sistema de archivo recién creado (en <code class="filename">/dev/sda2</code>) en el directorio recién creado <code class="filename">/prueba/</code>. Asume que no hay reglas en <code class="filename">/etc/selinux/targeted/contexts/files/</code> que definan el contexto del directorio <code class="filename">/prueba/</code>:
</div><pre class="screen"># mount /dev/sda2 /prueba/ -o defcontext="system_u:object_r:samba_share_t:s0"
</pre><div class="para">
En este ejemplo:
</div><div class="itemizedlist"><ul><li><div class="para">
la opción <code class="option">defcontext</code> define que <code class="computeroutput">system_u:object_r:samba_share_t:s0</code> es "el contexto de seguridad predeterminado para archivos no etiquetados"<sup>[<a id="d0e3897" href="#ftn.d0e3897" class="footnote">12</a>]</sup>.
</div></li><li><div class="para">
cuando sea montado, el directorio raíz (<code class="filename">/prueba/</code>) del sistema de archivo se trata como si estuviera etiquetado con el contexto especificado por <code class="option">defcontext</code> (esta etiqueta no se guarda en el disco). Esto afecta el etiquetado de archvios creados en <code class="filename">/prueba/</code>: los archivos nuevos heredan el tipo <code class="computeroutput">samba_share_t</code>, y estas etiquetas se guardan en el disco.
</div></li><li><div class="para">
los archivos creados bajo <code class="filename">/prueba/</code> mientras el sistema de archivo estaba montado con la opción <code class="option">defcontext</code> retendrán sus etiquetas.
</div></li></ul></div></div><div class="section" lang="es-ES"><div class="titlepage"><div><div><h3 class="title" id="sect-Security-Enhanced_Linux-Mounting_File_Systems-Mounting_an_NFS_File_System">5.9.3. Montando un Sistema de Archivos NFS</h3></div></div></div><div class="para">
Por defecto, los montajes NFS en el lado del cliente son etiquetados con un contexto predeterminado por la política para los sistemas de archivo NFS. En políticas comunes, este contexto predeterminado usa el tipo <code class="computeroutput">nfs_t</code>. Dependiendo de la configuración de la política, los servicios, como el Servidor HTTP Apache y MySQL, pueden no poder leer archivos etiquetados con el tipo <code class="computeroutput">nfs_t</code>. Esto puede prevenir que los sistemas de archivos etiquetados con este tipo se monten y sean leídos o exportados por otros servicios.
</div><div class="para">
Si desea montar un sistema de archivo NFS y leer o exportar ese sistema de archivo con otro servicio, use la opción <code class="option">contexto</code> cuando monte para anular el tipo <code class="computeroutput">nfs_t</code>. Use la siguiente opción de contexto para montar sistemas de archivo NFS para que puedan compartirse vía el Servidor HTTP Apache:
</div><pre class="screen">mount servidor:/export /local/punto/de/montaje -o\
context="system_u:object_r:httpd_sys_content_t:s0"
</pre><div class="para">
Dado que los cambios de contexto no se escriben al disco para estas situaciones, el contexto especificado con la opción <code class="option">context</code> sólo se retiene si la opción <code class="option">context</code> se usa en el siguiente montaje, y si el mismo contexto se especifica.
</div><div class="para">
Como una alternativa a montar sistemas de archivo con la opción <code class="option">contexto</code>, los Booleanos se pueden activar para permitir a los servicios acceder sistemas de archivos etiquetados con el tipo <code class="computeroutput">nfs_t</code>. Vaya a <a class="xref" href="#sect-Security-Enhanced_Linux-Booleans-Booleans_for_NFS_and_CIFS" title="5.6.3. Booleanos para NFS y CIFS">Sección 5.6.3, “Booleanos para NFS y CIFS”</a> para instrucciones sobre configuración de Booleanos para permitir a servicios acceder al tipo <code class="computeroutput">nfs_t</code>.
</div></div><div class="section" lang="es-ES"><div class="titlepage"><div><div><h3 class="title" id="sect-Security-Enhanced_Linux-Mounting_File_Systems-Multiple_NFS_Mounts">5.9.4. Montajes NFS Múltiples</h3></div></div></div><div class="para">
Cuando se monten múltiples montajes desde el mismo NFS exportado, el intento de sobreescribir el contexto de SELinux e cada montaje con un contexto diferente, resulta en fallos de los comandos de montaje subsecuentes. En el siguiente ejemplo, el servidor NFS tiene un exportado único, <code class="filename">/export</code>, que tiene dos subdirectorios, <code class="filename">web/</code> and <code class="filename">database/</code>. El siguiente comando intenta dos montajes desde un único export NFS e intenta sobreescribir el contexto para cada uno:
</div><pre class="screen"># mount servidor:/export/web /local/web -o\
context="system_u:object_r:httpd_sys_content_t:s0"
# mount servidor:/export/database /local/database -o\
context="system_u:object_r:mysqld_db_t:s0"
</pre><div class="para">
El segundo comando mount falla, y se graba lo siguiente en <code class="filename">/var/log/messages</code>:
</div><pre class="screen">kernel: SELinux: montaje inválido. Similar superblock, configuración de seguridad diferente para (dev 0:15, tipo nfs)
</pre><div class="para">
Para montar montajes múltiples de un exportado NFS único, con cada montaje teniendo un contexto diferente, use las opciones <code class="option">-o nosharecache,context</code>. El siguiente ejemplo monta montajes múltiples de un único export de NSF, con un contexto diferente para cada montaje (permitiendo un único acceso de servicio a cada uno):
</div><pre class="screen"># mount servidor:/export/web /local/web -o\
nosharecache,context="system_u:object_r:httpd_sys_content_t:s0"
# mount servidor:/export/database /local/database -o\
nosharecache,context="system_u:object_r:mysqld_db_t:s0"
</pre><div class="para">
En este ejemplo, <code class="computeroutput">server:/export/web</code> se monta localmente en <code class="filename">/local/web/</code>, con todos los archivos etiquetados con el tipo <code class="computeroutput">httpd_sys_content_t</code>, lo que permite el acceso al Servidor HTTP Apache. <code class="computeroutput">server:/export/database</code> está montado localmente en <code class="filename">/local/database</code>, con los archivos etiquetados con el tipo <code class="computeroutput">mysqld_db_t</code>, lo que permite a MySQL el acceso. Estos cambios de tipo no se escriben en el disco.
</div><div class="important"><h2>Importante</h2><div class="para">
Las opciones <code class="option">nosharecache</code> le permiten montar el mismo subdirectorio de un exportado varias veces con distintos contextos (por ejemplo, montar <code class="filename">/export/web</code> varias veces). No monte el mismo directorio de un exportado varias veces con distintos contextos, dado que esto crea un montado solapado, donde los archivos se pueden acceder con dos contextos diferentes.
</div></div></div><div class="section" lang="es-ES"><div class="titlepage"><div><div><h3 class="title" id="sect-Security-Enhanced_Linux-Mounting_File_Systems-Making_Context_Mounts_Persistent">5.9.5. Haciendo Persistente los Contextos de Montajes</h3></div></div></div><div class="para">
Para hacer que los contextos de montajes persistentes entre remontadas y reiniciadas, agregue las entradas de los sistemas de archivos en <code class="filename">/etc/fstab</code> o un mapa de automontador, y use el contexto deseado como una opción de montaje. El siguiente ejemplo agrega una entrada en <code class="filename">/etc/fstab</code> para un montaje de contexto NFS:
</div><pre class="screen">servidor:/export /local/montaje/ nfs context="system_u:object_r:httpd_sys_content_t:s0" 0 0
</pre><div class="para">
Vaya a la <a href="http://www.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/5.2/html/Deploy...">Guía de Despliegue del Linux para Empresas de Red Hat 5, Sección 19.2. "Configuración de Cliente NFS"</a> para información adicional sobre montaje de sistemas de archivo NFS.
</div></div></div><div class="section" lang="es-ES"><div class="titlepage"><div><div><h2 class="title" id="sect-Security-Enhanced_Linux-Working_with_SELinux-Maintaining_SELinux_Labels_">5.10. Mantención de las Etiquetas de SELinux </h2></div></div></div><div class="para">
Estas secciones describen qué les pasa a los contextos SELinux cuando se copia, mueve y compacta archivos y directorios. También explica cómo preservar los contextos cuando se copia o se compacta.
</div><div class="section" lang="es-ES"><div class="titlepage"><div><div><h3 class="title" id="sect-Security-Enhanced_Linux-Maintaining_SELinux_Labels_-Copying_Files_and_Directories">5.10.1. Copia de Directorios y Archivos</h3></div></div></div><div class="para">
Cuando se copia un archivo o directorio, se crea uno si no existía. El contexto de ese archivo o directorio nuevo está basado en las reglas de etiquetados predeterminada, y no el contexto original del archivo o directorio (a menos que se usen opciones para preservar el contexto original). Por ejemplo, los archivos creados en los directorios home de los usuarios se etiquetan con el tipo <code class="computeroutput">user_home_t</code>:
</div><pre class="screen">$ touch archivo1
$ ls -Z archivo1
-rw-rw-r-- usuario1 grupo1 unconfined_u:object_r:user_home_t:s0 archivo1
</pre><div class="para">
Si un archivo se copia a otro directorio, tal como <code class="filename">/etc/</code>, el archivo nuevo se crea de acuerdo a las reglas de etiquetado predeterminado del directorio <code class="filename">/etc/</code>. El copiado de un archivo (sin opciones adicionales) puede no preservar el contexto original:
</div><pre class="screen">$ ls -Z archivo1
-rw-rw-r-- usuario1 grupo1 unconfined_u:object_r:user_home_t:s0 archivo1
# cp archivo1 /etc/
$ ls -Z /etc/archivo1
-rw-r--r-- root root unconfined_u:object_r:etc_t:s0 /etc/archivo1
</pre><div class="para">
Cuando el <code class="filename">archivo1</code> se copia a <code class="filename">/etc/</code>, si <code class="filename">/etc/archivo1</code> no existe, <code class="filename">/etc/archivo1</code> se crea como un archivo nuevo. Como se muestra en el ejemplo de arriba, <code class="filename">/etc/archivo1</code> se etiqueta con el tipo <code class="computeroutput">etc_t</code>, de acuerdo con las reglas de etiquetado predeterminadas.
</div><div class="para">
Cuando un archivo se copia sobre otro existente, el contexto del archivo existente se preserva, a menos que el usuario especifique opciones de <code class="command">cp</code> para preservar el contexto del archivo original, tal como <code class="option">--preserve=context</code>. La política de SELinux puede prevenir que se preserver los contextos al copiar.
</div><div class="formalpara"><h5 class="formalpara" id="form-Security-Enhanced_Linux-Copying_Files_and_Directories-Copying_Without_Preserving_SELinux_Contexts">Copia sin Preservar los Contextos de SELinux</h5>
Cuando se copia un archivo con el comando <code class="command">cp</code>, si no se dan opciones, el tipo se hereda desde el directorio padre destino:
</div><pre class="screen">$ touch archivo1
$ ls -Z archivo1
-rw-rw-r-- usuario1 grupo1 unconfined_u:object_r:user_home_t:s0 archivo1
$ ls -dZ /var/www/html/
drwxr-xr-x root root system_u:object_r:httpd_sys_content_t:s0 /var/www/html/
# cp archivo1 /var/www/html/
$ ls -Z /var/www/html/archivo1
-rw-r--r-- root root unconfined_u:object_r:httpd_sys_content_t:s0 /var/www/html/archivo1
</pre><div class="para">
En este ejemplo, <code class="filename">archivo1</code> se crea en el directorio de inicio del usuario, y se etiqueta con el tipo <code class="computeroutput">user_home_t</code>. El directorio <code class="filename">/var/www/html/</code> está etiquetado con el tipo <code class="computeroutput">httpd_sys_content_t</code>, como se muestra con el comando <code class="command">ls -dZ /var/www/html/</code>. Cuando el <code class="filename">archivo1</code> se copia a <code class="filename">/var/www/html/</code>, hereda el tipo <code class="computeroutput">httpd_sys_content_t</code>, como se muestra con el comando<code class="command">ls -Z /var/www/html/archivo1</code>.
</div><div class="formalpara"><h5 class="formalpara" id="form-Security-Enhanced_Linux-Copying_Files_and_Directories-Preserving_SELinux_Contexts_When_Copying">Preservación de los Contextos de SELinux cuando se copia</h5>
Use el comando <code class="command">cp --preserve=context</code> para preservar los contextos cuando se copia:
</div><pre class="screen">$ touch archivo1
$ ls -Z archivo1
-rw-rw-r-- usuario1 grupo1 unconfined_u:object_r:user_home_t:s0 archivo1
$ ls -dZ /var/www/html/
drwxr-xr-x root root system_u:object_r:httpd_sys_content_t:s0 /var/www/html/
# cp --preserve=context archivo1 /var/www/html/
$ ls -Z /var/www/html/archivo1
-rw-r--r-- root root unconfined_u:object_r:user_home_t:s0 /var/www/html/archivo1
</pre><div class="para">
En este ejemplo, el <code class="filename">archivo1</code> se crea en el directorio de inicio del usuario, y se etiqueta con el tipo <code class="computeroutput">user_home_t</code>. El directorio <code class="filename">/var/www/html/</code> está etiquetado con el tipo <code class="computeroutput">httpd_sys_content_t</code>, como se muestra con el comando <code class="command">ls -dZ /var/www/html/</code>. Usando la opción <code class="option">--preserve=context</code> se mantienen los contextos de SELinux durante operaciones de copia. Como se muestra con el comando <code class="command">ls -Z /var/www/html/archivo1</code>, el tipo <code class="computeroutput">user_home_t</code> del <code class="filename">archivo1</code> fue preservado cuando el archivo se copió a <code class="filename">/var/www/html/</code>.
</div><div class="formalpara"><h5 class="formalpara" id="form-Security-Enhanced_Linux-Copying_Files_and_Directories-Copying_and_Changing_the_Context">Copiado y Cambio del Contexto</h5>
Use el comando <code class="command">cp -Z</code> para cambiar el contexto destino de copia. El siguiente ejemplo se realizó en el directorio de inicio del usuario:
</div><pre class="screen">$ touch archivo1
$ cp -Z system_u:object_r:samba_share_t:s0 archivo1 archivo2
$ ls -Z archivo1 archivo2
-rw-rw-r-- usuario1 grupo1 unconfined_u:object_r:user_home_t:s0 archivo1
-rw-rw-r-- usuario1 grupo1 system_u:object_r:samba_share_t:s0 archivo2
$ rm archivo1 archivo2
</pre><div class="para">
En este ejemplo, el contexto se define en la opción <code class="option">-Z</code>. Sin la opción <code class="option">-Z</code>, <code class="filename">archivo2</code> se etiquetaría con el contexto <code class="computeroutput">unconfined_u:object_r:user_home_t</code>.
</div><div class="formalpara"><h5 class="formalpara" id="form-Security-Enhanced_Linux-Copying_Files_and_Directories-Copying_a_File_Over_an_Existing_File">Copia de un Archivos sobre un otro existente</h5>
Cuando un archivo se copia sobre otro existente, el contexto del archivo existente se preserva (a menos que se use una opción para preservar los contextos). Por ejemplo:
</div><pre class="screen"># touch /etc/archivo1
# ls -Z /etc/archivo1
-rw-r--r-- root root unconfined_u:object_r:etc_t:s0 /etc/archivo1
# touch /tmp/archivo2
# ls -Z /tmp/archivo2
-rw-r--r-- root root unconfined_u:object_r:user_tmp_t:s0 /tmp/archivo2
# cp /tmp/archivo2 /etc/archivo1
# ls -Z /etc/archivo1
-rw-r--r-- root root unconfined_u:object_r:etc_t:s0 /etc/archivo1
</pre><div class="para">
En este ejemplo, se crean dos archivos: <code class="filename">/etc/archivo1</code>, etiquetado con el tipo <code class="computeroutput">etc_t</code>, y <code class="filename">/tmp/archivo2</code>, etiquetado con el tipo <code class="computeroutput">user_tmp_t</code>. Ell comando <code class="command">cp /tmp/archivo2 /etc/archivo1</code> sobreescribe <code class="filename">archivo1</code> con <code class="filename">archivo2</code>. Después de copiar, el comando <code class="command">ls -Z /etc/archivo1</code> muestra a <code class="filename">archivo1</code> etiquetado con el tipo <code class="computeroutput">etc_t</code>, en vez del <code class="computeroutput">user_tmp_t</code> de <code class="filename">/tmp/archivo2</code> que reemplazó a <code class="filename">/etc/archivo1</code>.
</div><div class="important"><h2>Importante</h2><div class="para">
Copie archivos y directorios, en vez de moverlos. Esto ayuda a asegurar que se etiquetan con los contextos de SELinux correctos. Los contextos SELinux incorrectos pueden hacer que los procesos no puedan acceder a esos archivos y directorios.
</div></div></div><div class="section" lang="es-ES"><div class="titlepage"><div><div><h3 class="title" id="sect-Security-Enhanced_Linux-Maintaining_SELinux_Labels_-Moving_Files_and_Directories">5.10.2. Movimiento de Archivos y Directorios</h3></div></div></div><div class="para">
Los archivos y directorios mantienen su contexto SELinux actual cuando se mueven. En muchos casos, esto es incorrecto para la ubicación nueva a donde se los mueve. El siguiente ejemplo muestra la movida de un archivo desde el directorio de inicio del usuario a <code class="filename">/var/www/html/</code>, que es usado por el Servidor HTTP Apache. Dado que el archivo es movido, no hereda el contexto SELinux correcto:
</div><div class="orderedlist"><ol><li><div class="para">
Ejecute el comando <code class="command">cd</code> sin ningún argumento para cambiar a su directorio de inicio. Una vez ahí, ejecute el comando <code class="command">touch archivo1</code> para crear un archivo. Este archivo se etiqueta con el tipo <code class="computeroutput">user_home_t</code>:
</div><pre class="screen">$ ls -Z archivo1
-rw-rw-r-- usuario1 grupo1 unconfined_u:object_r:user_home_t:s0 archivo1
</pre></li><li><div class="para">
Ejecute el comando <code class="command">ls -dZ /var/www/html/</code> para ver el contexto de SELinux del directorio <code class="filename">/var/www/html/</code>:
</div><pre class="screen">$ ls -dZ /var/www/html/
drwxr-xr-x root root system_u:object_r:httpd_sys_content_t:s0 /var/www/html/
</pre><div class="para">
Por defecto, el directorio <code class="filename">/var/www/html/</code> se etiqueta con el tipo <code class="computeroutput">httpd_sys_content_t</code>. Los archivos y directorios creados bajo el directorio <code class="filename">/var/www/html/</code> heredan este tipo, y como tal, son etiquetados con este tipo.
</div></li><li><div class="para">
Como usuario root de Linux, ejecute el comando <code class="command">mv archivo1 /var/www/html/</code> para mover el <code class="filename">archivo1</code> al directorio <code class="filename">/var/www/html/</code>. Dado que el archivo es movido, mantiene su tipo <code class="computeroutput">user_home_t</code> actual:
</div><pre class="screen"># mv archivo1 /var/www/html/
# ls -Z /var/www/html/archivo1
-rw-rw-r-- usuario1 grupo1 unconfined_u:object_r:user_home_t:s0 /var/www/html/archivo1
</pre></li></ol></div><div class="para">
Por defecto, el Servidor HTTP Apache no puede leer archivos etiquetados con el tipo <code class="computeroutput">user_home_t</code>. Si todos los archivos de una página web se etiquetaron con <code class="computeroutput">user_home_t</code>, u otro tipo al que el Servidor HTTP Apache no puede leer, el permiso es negado cuando intente accederlo vía Firefox o algún otro navegador web basado en texto.
</div><div class="important"><h2>Importante</h2><div class="para">
Mover archivos y directorios con el comando <code class="command">mv</code> puede resultar en el contexto SELinux incorrecto, evitando que los procesos tales como el Servidor HTTP Apache y Samba puedan acceder a tales archivos y directorios.
</div></div></div><div class="section" lang="es-ES"><div class="titlepage"><div><div><h3 class="title" id="sect-Security-Enhanced_Linux-Maintaining_SELinux_Labels_-Checking_the_Default_SELinux_Context">5.10.3. Chequeando el Contexto SELinux Predeterminado</h3></div></div></div><div class="para">
Use el comando <code class="command">/usr/sbin/matchpathcon</code> para chequear si los archivos y directorios tienen el contexto SELinux correcto. De la página de manual de <span class="citerefentry"><span class="refentrytitle">matchpathcon</span>(8)</span>: "<code class="command">matchpathcon</code> consulta la política del sistema y muestra el contexto de seguridad predeterminado asociado con una dirección de archivo."<sup>[<a id="d0e4348" href="#ftn.d0e4348" class="footnote">13</a>]</sup>. El siguiente ejemplo muestra el uso del comando <code class="command">/usr/sbin/matchpathcon</code> para verificar que los archivos dentro del directorio <code class="filename">/var/www/html/</code> están etiquetados correctamente:
</div><div class="orderedlist"><ol><li><div class="para">
Como usuario root de Linux, ejecute el comando <code class="command">touch /var/www/html/archivo{1,2,3}</code> para crear tres archivos (<code class="filename">archivo1</code>, <code class="filename">archivo2</code> y <code class="filename">archivo3</code>). Estos heredan el tipo <code class="computeroutput">httpd_sys_content_t</code> del directorio <code class="filename">/var/www/html/</code>:
</div><pre class="screen"># touch /var/www/html/archivo{1,2,3}
# ls -Z /var/www/html/
-rw-r--r-- root root unconfined_u:object_r:httpd_sys_content_t:s0 archivo1
-rw-r--r-- root root unconfined_u:object_r:httpd_sys_content_t:s0 archivo2
-rw-r--r-- root root unconfined_u:object_r:httpd_sys_content_t:s0 archivo3
</pre></li><li><div class="para">
Como usuario root de Linux, ejecute el comando <code class="command">chcon -t samba_share_t /var/www/html/archivo1</code> para cambiar el tipo del <code class="filename">archivo1</code> a <code class="computeroutput">samba_share_t</code>. Nota: El Servidor HTTP Apache no puede leer archivos o directorios etiquetados con el tipo <code class="computeroutput">samba_share_t</code>.
</div></li><li><div class="para">
La opción <code class="command">/usr/sbin/matchpathcon</code> <code class="option">-V</code> compara el contexto SELinux actual con el contexto predeterminado correcto dado por la política de SELinux. Ejecute el comando <code class="command">/usr/sbin/matchpathcon -V /var/www/html/*</code> para chequear todos los archivos del directorio <code class="filename">/var/www/html/</code>:
</div><pre class="screen">$ /usr/sbin/matchpathcon -V /var/www/html/*
/var/www/html/archivo1 tiene el contexto unconfined_u:object_r:samba_share_t:s0, debería ser system_u:object_r:httpd_sys_content_t:s0
/var/www/html/archivo2 verified.
/var/www/html/archivo3 verified.
</pre></li></ol></div><div class="para">
La siguiente salida del comando <code class="command">/usr/sbin/matchpathcon</code> explica que el <code class="filename">archivo1</code> está etiquetado con el tipo <code class="computeroutput">samba_share_t</code>, pero debería estar etiquetado con el tipo <code class="computeroutput">httpd_sys_content_t</code>:
</div><pre class="screen">/var/www/html/archivo1 tiene el contexto unconfined_u:object_r:samba_share_t:s0, debería tener system_u:object_r:httpd_sys_content_t:s0
</pre><div class="para">
Para resolver el problema de etiqueta y permitir al Servidor HTTP Apache acceder a <code class="filename">archivo1</code>, como usuario root de Linux corra el comando <code class="command">/sbin/restorecon -v /var/www/html/archivo1</code>:
</div><pre class="screen"># /sbin/restorecon -v /var/www/html/archivo1
restorecon reset /var/www/html/archivo1 context unconfined_u:object_r:samba_share_t:s0->system_u:object_r:httpd_sys_content_t:s0
</pre></div><div class="section" lang="es-ES"><div class="titlepage"><div><div><h3 class="title" id="sect-Security-Enhanced_Linux-Maintaining_SELinux_Labels_-Archiving_Files_with_tar">5.10.4. Archivando archivos con tar</h3></div></div></div><div class="para">
<code class="command">tar</code> no retiene los atributos extendidos por defecto. Dado que los contextos SELinux se almacenan en los atributos extendidos, los contextos se pueden perder cuando se compactan archivos. Use <code class="command">tar --selinux</code> para crear archivos que retengan los contextos. Si un archivo Tar contiene archivos sin los atributos extendidos, o si quiere que los atributos extendidos coincidan con los predeterminados del sistema, ejecute el archivado a través de <code class="command">/sbin/restorecon</code>:
</div><pre class="screen">$ tar -xvf <em class="replaceable"><code>archivo.tar</code></em> | /sbin/restorecon -f -
</pre><div class="para">
Nota: dependiendo del directorio, puede necesitar ser el usuario root de Linux para ejecutar el comando <code class="command">/sbin/restorecon</code>.
</div><div class="para">
El siguiente ejemplo muestra la creación de un archivo Tar que mantiene sus contextos SELinux:
</div><div class="orderedlist"><ol><li><div class="para">
Como usuario root de Linux, ejecute el comando <code class="command">touch /var/www/html/archivo{1,2,3}</code> para crear tres archivos (<code class="filename">archivo1</code>, <code class="filename">archivo2</code> y <code class="filename">archivo3</code>). Estos heredan el tipo <code class="computeroutput">httpd_sys_content_t</code> del directorio <code class="filename">/var/www/html/</code>:
</div><pre class="screen"># touch /var/www/html/archivo{1,2,3}
# ls -Z /var/www/html/
-rw-r--r-- root root unconfined_u:object_r:httpd_sys_content_t:s0 archivo1
-rw-r--r-- root root unconfined_u:object_r:httpd_sys_content_t:s0 archivo2
-rw-r--r-- root root unconfined_u:object_r:httpd_sys_content_t:s0 archivo3
</pre></li><li><div class="para">
Ejecute el comando <code class="command">cd /var/www/html/</code> para cambiar al directorio <code class="filename">/var/www/html/</code>. Una vez en este directorio, como usuario root de Linux ejecute el comando <code class="command">tar --selinux -cf prueba.tar archivo{1,2,3}</code> para crear un archivo Tar con nombre <code class="filename">prueba.tar</code>.
</div></li><li><div class="para">
Como usuario root de Linux, corra el comando <code class="command">mkdir /prueba</code> para crear un directorio nuevo, y luego ejecute el comando <code class="command">chmod 777 /prueba/</code> para permitir a los usuarios acceso total al directorio <code class="filename">/prueba/</code>.
</div></li><li><div class="para">
Ejecute el comando <code class="command">cp /var/www/html/prueba.tar /prueba/</code> para copiar el archivo <code class="filename">prueba.tar</code> en el directorio <code class="filename">/prueba/</code>.
</div></li><li><div class="para">
Ejecute el comando <code class="command">cd /prueba/</code> para cambiar al directorio <code class="filename">/test/</code>. Una vez ahí, ejecute el comando <code class="command">tar -xvf prueba.tar</code> para extraer el archivo Tar.
</div></li><li><div class="para">
Ejecute el comando <code class="command">ls -lZ /prueba/</code> para ver los contextos SELinux. El tipo <code class="computeroutput">httpd_sys_content_t</code> fue retenido, en vez de haberse cambiado al <code class="computeroutput">default_t</code>, lo que hubiera pasado si la opción <code class="option">--selinux</code> no se hubiera usado:
</div><pre class="screen">$ ls -lZ /prueba/
-rw-r--r-- usuario1 grupo1 unconfined_u:object_r:httpd_sys_content_t:s0 archivo1
-rw-r--r-- usuario1 grupo1 unconfined_u:object_r:httpd_sys_content_t:s0 archivo2
-rw-r--r-- usuario1 grupo1 unconfined_u:object_r:httpd_sys_content_t:s0 archivo3
-rw-r--r-- usuario1 grupo1 unconfined_u:object_r:default_t:s0 prueba.tar
</pre></li><li><div class="para">
Si el directorio <code class="filename">/prueba/</code> no se necesita más, como usuario root de Linux ejecute el comando <code class="command"> rm -ri /prueba/</code> para eliminarlo, así como todos los archivos en él.
</div></li></ol></div><div class="para">
Vaya a la página man de <span class="citerefentry"><span class="refentrytitle">tar</span>(1)</span> para información adicional de <code class="command">tar</code>, tal como la opción <code class="option">--xattrs</code> para retener todos los atributos extendidos.
</div></div><div class="section" lang="es-ES"><div class="titlepage"><div><div><h3 class="title" id="sect-Security-Enhanced_Linux-Maintaining_SELinux_Labels_-Archiving_Files_with_star">5.10.5. Archivando archivos con tar</h3></div></div></div><div class="para">
<code class="command">star</code> no retiene los atributos extendidos por defecto. Dado que los contextos SELinux se almacenan en los atributos extendidos, los contextos se pueden perder cuando se crean esos archivos. Use <code class="command">star -xattr -H=exustar</code> para crear archivos que retengan los contextos. El paquete <span class="package">star</span> no se instala por defecto. Para instalar <code class="command">star</code>, ejecute el comando <code class="command">yum install star</code> como usuario root de Linux.
</div><div class="para">
El siguiente ejemplo muestra la creación de un archivo Star que retiene los contextos SELinux:
</div><div class="orderedlist"><ol><li><div class="para">
Como usuario root de Linux, ejecute el comando <code class="command">touch /var/www/html/archivo{1,2,3}</code> para crear tres archivos (<code class="filename">archivo1</code>, <code class="filename">archivo2</code> y <code class="filename">archivo3</code>). Estos heredan el tipo <code class="computeroutput">httpd_sys_content_t</code> del directorio <code class="filename">/var/www/html/</code>:
</div><pre class="screen"># touch /var/www/html/archivo{1,2,3}
# ls -Z /var/www/html/
-rw-r--r-- root root unconfined_u:object_r:httpd_sys_content_t:s0 archivo1
-rw-r--r-- root root unconfined_u:object_r:httpd_sys_content_t:s0 archivo2
-rw-r--r-- root root unconfined_u:object_r:httpd_sys_content_t:s0 archivo3
</pre></li><li><div class="para">
Ejecute el comando <code class="command">cd /var/www/html/</code> para cambiar al directorio <code class="filename">/var/www/html/</code>. Una vez en este directorio, como usuario root de Linux ejecute el comando <code class="command">star -xattr -H=exustar -c -f=prueba.star archivo{1,2,3}</code> para crear un archivo Star llamado <code class="filename">prueba.star</code>:
</div><pre class="screen"># star -xattr -H=exustar -c -f=prueba.star archivo{1,2,3}
star: 1 blocks + 0 bytes (total of 10240 bytes = 10.00k).
</pre></li><li><div class="para">
Como usuario root de Linux, corra el comando <code class="command">mkdir /prueba</code> para crear un directorio nuevo, y luego ejecute el comando <code class="command">chmod 777 /prueba/</code> para permitir a los usuarios acceso total al directorio <code class="filename">/prueba/</code>.
</div></li><li><div class="para">
Ejecute el comando <code class="command">cp /var/www/html/prueba.star /prueba/</code> para copiar el archivo <code class="filename">prueba.star</code> al directorio <code class="filename">/prueba/</code>.
</div></li><li><div class="para">
Ejecute el comando <code class="command">cd /prueba/</code> para cambiar al directorio <code class="filename">/prueba/</code>. Una vez ahí, ejecute el comando <code class="command">star -x -f=prueba.star</code> para extraer el archivo Star:
</div><pre class="screen">$ star -x -f=prueba.star
star: 1 blocks + 0 bytes (total of 10240 bytes = 10.00k).
</pre></li><li><div class="para">
Ejecute el comando <code class="command">ls -lZ /prueba/</code> para ver los contextos SELinux. El tipo <code class="computeroutput">httpd_sys_content_t</code> fue retenido, en vez de haberse cambiado al <code class="computeroutput">default_t</code>, lo que hubiera pasado si la opción <code class="option">--selinux</code> no se hubiera usado:
</div><pre class="screen">$ ls -lZ /prueba/
-rw-r--r-- usuario1 grupo1 unconfined_u:object_r:httpd_sys_content_t:s0 archivo1
-rw-r--r-- usuario1 grupo1 unconfined_u:object_r:httpd_sys_content_t:s0 archivo2
-rw-r--r-- usuario1 grupo1 unconfined_u:object_r:httpd_sys_content_t:s0 archivo3
-rw-r--r-- usuario1 grupo1 unconfined_u:object_r:default_t:s0 prueba.star
</pre></li><li><div class="para">
Si el directorio <code class="filename">/prueba/</code> no se necesita más, como usuario root de Linux ejecute el comando <code class="command"> rm -ri /prueba/</code> para eliminarlo, así como todos los archivos en él.
</div></li><li><div class="para">
Si <code class="command">star</code> ya no se necesita, como usuario root de Linux, ejecute el comando <code class="command">yum remove star</code> para eliminar el paquete.
</div></li></ol></div><div class="para">
Vaya a la página man de <span class="citerefentry"><span class="refentrytitle">star</span>(1)</span> para más información acerca de <code class="command">star</code>.
</div></div></div><div class="footnotes"><br/><hr width="100" align="left"/><div class="footnote"><p><sup>[<a id="ftn.d0e2064" href="#d0e2064" class="para">8</a>] </sup>
Brindle, Joshua. "Re: blurb for fedora setools packages" Email para Murray McAllister. 1 Noviembre 2008. Cualquier edición o cambio en esta versión fue hecha por Murray McAllister.
</p></div><div class="footnote"><p><sup>[<a id="ftn.d0e2176" href="#d0e2176" class="para">9</a>] </sup>
Administración de Software con yum, escrito por Stuart Ellis, editado por Paul W. Frields, Rodrigo Menezes y Hugo Cisneiros.
</p></div><div class="footnote"><p><sup>[<a id="ftn.d0e2504" href="#d0e2504" class="para">10</a>] </sup>
Vaya a <a href="http://en.wikipedia.org/wiki/Runlevel">http://en.wikipedia.org/wiki/Runlevel</a> para información sobre los niveles de ejecución.
</p></div><div class="footnote"><p><sup>[<a id="ftn.d0e3749" href="#d0e3749" class="para">11</a>] </sup>
Los archivos en <code class="filename">/etc/selinux/targeted/contexts/files/</code> definen los contextos de los archivos y directorios. Los archivos en este directorio son accedidos por <code class="command">restorecon</code> y por <code class="command">setfiles</code> para restaurar al valor predeterminado los contextos de los archivos y directorios.
</p></div><div class="footnote"><p><sup>[<a id="ftn.d0e3897" href="#d0e3897" class="para">12</a>] </sup>
Morris, James. "Etiquetado de Sistemas de Archivos en SELinux". Publicado el 1 Octubre 2004. Accedido el 14 Octubre 2008: <a href="http://www.linuxjournal.com/article/7426">http://www.linuxjournal.com/article/7426</a>.
</p></div><div class="footnote"><p><sup>[<a id="ftn.d0e4348" href="#d0e4348" class="para">13</a>] </sup>
La página de manual <span class="citerefentry"><span class="refentrytitle">matchpathcon</span>(8)</span>, tal como se incluyó en el paquete <span class="package">libselinux-utils</span> en Fedora, fue escrita por Daniel Walsh. Cualquier edición o cambio en esta versión fue hecha por Murray McAllister.
</p></div></div></div><div class="chapter" lang="es-ES"><div class="titlepage"><div><div><h2 class="title" id="chap-Security-Enhanced_Linux-Confining_Users">Capítulo 6. Confinando a los Usuarios</h2></div></div></div><div class="toc"><dl><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Confining_Users-Linux_and_SELinux_User_Mappings">6.1. Linux y los Mapeos de Usuarios de SELinux</a></span></dt><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Confining_Users-Confining_New_Linux_Users_useradd">6.2. Confinando Usuarios Nuevos de Linux: useradd</a></span></dt><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Confining_Users-Confining_Existing_Linux_Users_semanage_login">6.3. Confinando Usuarios Linux Existentes: semanage login</a></span></dt><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Confining_Users-Changing_the_Default_Mapping">6.4. Cambiando el Mapeo Predeterminado</a></span></dt><dt><span class="section
"><a href="#sect-Security-Enhanced_Linux-Confining_Users-xguest_Kiosk_Mode">6.5. xguest: Modo Kiosk</a></span></dt><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Confining_Users-Booleans_for_Users_Executing_Applications">6.6. Booleanos para que los Usuarios Ejecuten Aplicaciones</a></span></dt></dl></div><div class="para">
Un número de usuarios confinados SELinux están disponibles en Fedora 11. Cada usuario Linux se mapea aun usuario SELinux vía la política de SELinux, permitiendo a los usuarios Linux heredar las restricciones sobre los usuarios SELinux, por ejemplo (dependiendo del usuairo), no poder: ejecutar el sistema de ventanas X; usar la red; ejecutar aplicaciones setuid (a menos que la política de SELinux lo permita); o ejecutar comandos <code class="command">su</code> y <code class="command">sudo</code> para volverse el usuario root de Linux. Esto ayuda a proteger el sistema del usuario. Vaya a <a class="xref" href="#sect-Security-Enhanced_Linux-Targeted_Policy-Confined_and_Unconfined_Users" title="4.3. Usuarios Confinados y no Confinados">Sección 4.3, “Usuarios Confinados y no Confinados”</a> para información adicional sobre usuarios confinados en Fedora 11.
</div><div class="section" lang="es-ES"><div class="titlepage"><div><div><h2 class="title" id="sect-Security-Enhanced_Linux-Confining_Users-Linux_and_SELinux_User_Mappings">6.1. Linux y los Mapeos de Usuarios de SELinux</h2></div></div></div><div class="para">
Como usuario root de Linux, corra el comando <code class="command">semanage login -l</code> para ver el mapeo entre los usuarios de Linux y los usuarios de SELinux:
</div><pre class="screen"># /usr/sbin/semanage login -l
Login Name SELinux User MLS/MCS Range
__default__ unconfined_u s0-s0:c0.c1023
root unconfined_u s0-s0:c0.c1023
system_u system_u s0-s0:c0.c1023
</pre><div class="para">
En Fedora 11, los usuarios Linux se mapean al ingreso SELinux <code class="computeroutput">__default__</code> por defecto (que se mapea al usuario SELinux <code class="computeroutput">unconfined_u</code>). Cuando se crea un usuario Linux con el comando <code class="command">useradd</code>, si no se especifica ninguna opcion, son mapeados al usuario SELinux <code class="computeroutput">unconfined_u</code>. Lo siguiente define el mapeo por defecto:
</div><pre class="screen">__default__ unconfined_u s0-s0:c0.c1023
</pre></div><div class="section" lang="es-ES"><div class="titlepage"><div><div><h2 class="title" id="sect-Security-Enhanced_Linux-Confining_Users-Confining_New_Linux_Users_useradd">6.2. Confinando Usuarios Nuevos de Linux: useradd</h2></div></div></div><div class="para">
Los usuarios Linux mapeados al usuario SELinux <code class="computeroutput">unconfined_u</code> corren en el dominio <code class="computeroutput">unconfined_t</code>. Esto se ve ejecutando el comando <code class="command">id -Z</code> luego de haber ingresado como el usuario Linux que se mapea a <code class="computeroutput">unconfined_u</code>:
</div><pre class="screen">$ id -Z
unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023
</pre><div class="para">
Cuando los usuarios linux ejecuten en el dominio <code class="computeroutput">unconfined_t</code>, se aplican las reglas de la política de SELinux, pero las reglas de políticas que existen para usuarios Linux que corren en el dominio <code class="computeroutput">unconfined_t</code> permiten casi todos los accesos. Si los usuarios Linux no confinados ejecutan una aplicación que la política de SELinux define pueden transicionar desde el dominio <code class="computeroutput">unconfined_t</code> a su propio dominio confinado, los usuarios Linux no confinados todavía pueden ser sujetos a restricciones del dominio confinado. El beneficio de seguridad de esto es que, aunque el usuario Linux corre en un dominio confinado, la aplicación permanece confinada, y por lo tanto, la explotación de una brecha en la aplicación se puede limitar por la política. Nota: esto no protege al sistema del usuario. En su lugar, el usuario y el sistema están siendo protegido de posibles daño
s causados en alguna debilidad en la aplicación.
</div><div class="para">
Cuando se crean usuarios LInux con <code class="command">useradd</code>, use la opción <code class="option">-Z</code> para especificar a qué usuario SELinux se debe mapear. El siguiente ejemplo crea un usuario Linux nuevo, useruuser, y mapea ese usuario al usuario SELinux <code class="computeroutput">user_u</code>. Los usuarios Linux mapeados al usuario SELinux <code class="computeroutput">user_u</code> corren en el dominio <code class="computeroutput">user_t</code>. En este dominio, los usuarios Linux no pueden correr aplicaciones setuid a menos que la política de SELinux lo permita (tal como <code class="command">passwd</code>), y tampoco pueden correr <code class="command">su</code> o <code class="command">sudo</code>, lo que evita que se puedan volver usuarios root de Linux con estos comandos.
</div><div class="orderedlist"><ol><li><div class="para">
Como usuario root de Linux, corra el comando <code class="command">/usr/sbin/useradd -Z user_u useruuser</code> para crear el usuario Linux nuevo (useruuser) que se mapeará al usuario SELinux <code class="computeroutput">user_u</code>.
</div></li><li><div class="para">
Como usuario root de Linux, corra el comando <code class="command">semanage login -l</code> para ver el mapeo entre el usuario Linux <code class="computeroutput">useruuser</code> y <code class="computeroutput">user_u</code>:
</div><pre class="screen"># /usr/sbin/semanage login -l
Login Name SELinux User MLS/MCS Range
__default__ unconfined_u s0-s0:c0.c1023
root unconfined_u s0-s0:c0.c1023
system_u system_u s0-s0:c0.c1023
useruuser user_u s0
</pre></li><li><div class="para">
Como usuario root de Linux, corra el comando <code class="command">passwd useruuser</code> para asignar una contraseña para el usuario useruuser de Linux:
</div><pre class="screen"># passwd useruuser
Cambiando la contraseña del usuario useruuser.
Nueva contraseña de UNIX: <em class="replaceable"><code>Ingrese una contraseña</code></em>
Reingrese la nueva contraseña de UNIX: <em class="replaceable"><code>Ingrese la misma contraseña de nuevo</code></em>
passwd: todos los tokens actualizados exitosamente.
</pre></li><li><div class="para">
Salga de su sesión actual, e ingrese como el usuario useruuser de Linux. Cuando ingrese, pam_selinux mapea el usuario Linux a un usuario SELinux (en este caso, <code class="computeroutput">user_u</code>), y configura el contexto SELinux resultante. El shell del usuario Linux es luego lanzado con este contexto. Corra el comando <code class="command">id -Z</code> para ver el contexto de un usuario Linux:
</div><pre class="screen">[useruuser@localhost ~]$ id -Z
user_u:user_r:user_t:s0
</pre></li><li><div class="para">
Salga de la sesión useruuser de Linux, y vuelva a ingresar en su cuenta. Si no quiere el usuario useruuser, ejecute el comando <code class="command">/usr/sbin/userdel -r useruuser</code> como usuario root de Linux para borrarlo junto con su directorio de inicio.
</div></li></ol></div></div><div class="section" lang="es-ES"><div class="titlepage"><div><div><h2 class="title" id="sect-Security-Enhanced_Linux-Confining_Users-Confining_Existing_Linux_Users_semanage_login">6.3. Confinando Usuarios Linux Existentes: semanage login</h2></div></div></div><div class="para">
Si un usuario Linux se mapea al usuario <code class="computeroutput">unconfined_u</code> (el comportamiento predeterminado), y desea cambiar le usuario SELinux al que se mapea, use el comando <code class="command">semanage login</code>. El siguiente ejemplo crea un usuario de Linux nuevo llamado usuarionuevo, luego lo mapea al usuario SELinux <code class="computeroutput">user_u</code>:
</div><div class="orderedlist"><ol><li><div class="para">
Como usuario root de Linux, ejecute el comando <code class="command">/usr/sbin/useradd usuarionuevo</code> para crear un nuevo usuario (usuarionuevo). Dado que este usuario usa el mapeo por defecto, no aparece en la salida de <code class="command">/usr/sbin/semanage login -l</code>:
</div><pre class="screen"># /usr/sbin/semanage login -l
Login Name SELinux User MLS/MCS Range
__default__ unconfined_u s0-s0:c0.c1023
root unconfined_u s0-s0:c0.c1023
system_u system_u s0-s0:c0.c1023
</pre></li><li><div class="para">
Para mapear un usuario usuarionuevo de Linux al usuario <code class="computeroutput">user_u</code> de SELinux, corra el siguiente comando como usuario root de Linux:
</div><div class="para">
<code class="command">/usr/sbin/semanage login -a -s user_u usuarionuevo</code>
</div><div class="para">
La opción <code class="option">-a</code> agrega un registro nuevo y la opción <code class="option">-s</code> especifica el usuario SELinux al que mapea el usuario Linux. El último argumento <code class="computeroutput">usuarionuevo</code>, es el usuario Linux al que quiere que se mapee el usuario SELinux especificado.
</div></li><li><div class="para">
Para ver el mapeo entre el usuario usarionuevo de Linux y <code class="computeroutput">user_u</code>, corra el comando <code class="command">semanage login -l</code> como usuario root de Linux:
</div><pre class="screen"># /usr/sbin/semanage login -l
Login Name SELinux User MLS/MCS Range
__default__ unconfined_u s0-s0:c0.c1023
usuarionuevo user_u s0
root unconfined_u s0-s0:c0.c1023
system_u system_u s0-s0:c0.c1023
</pre></li><li><div class="para">
As the Linux root user, run the <code class="command">passwd newuser</code> command to assign a password to the Linux newuser user:
</div><pre class="screen"># passwd usuarionuevo
Cambiando la contraseña del usuario usuarionuevo.
Nueva contraseña de UNIX: <em class="replaceable"><code>Ingrese una contraseña</code></em>
Reingrese la nueva contraseña de UNIX: <em class="replaceable"><code>Ingrese la misma contraseña de nuevo</code></em>
passwd: todos los tokens de autenticación se actualizaron exitosamente.
</pre></li><li><div class="para">
Salga de su sesión actual e ingrese como el usuario de Linux usuarionuevo. Corra el comando <code class="command">id -Z</code> para ver el contexto SELinux de usuarionuevo:
</div><pre class="screen">[usuarionuevo@localhost ~]$ id -Z
user_u:user_r:user_t:s0
</pre></li><li><div class="para">
Salga de la sesión de Linux del usuarionuevo y vuelva a ingresar en su cuenta. Si no quiere el usuarionuevo de Linux, corra el comando <code class="command">userdel -r usuarionuevo</code> como usuario root de Linux, junto con su directorio de inicio. También, el mapeo del usuario Linux usuarionuevo y <code class="computeroutput">user_u</code> se elimina:
</div><pre class="screen"># /usr/sbin/userdel -r usuarionuevo
# /usr/sbin/semanage login -l
Login Name SELinux User MLS/MCS Range
__default__ unconfined_u s0-s0:c0.c1023
root unconfined_u s0-s0:c0.c1023
system_u system_u s0-s0:c0.c1023
</pre></li></ol></div></div><div class="section" lang="es-ES"><div class="titlepage"><div><div><h2 class="title" id="sect-Security-Enhanced_Linux-Confining_Users-Changing_the_Default_Mapping">6.4. Cambiando el Mapeo Predeterminado</h2></div></div></div><div class="para">
En Fedora 11, los usuarios Linux se mapean al ingreso SELinux <code class="computeroutput">__default__</code> por defecto (que se mapea al usuario SELinux <code class="computeroutput">unconfined_u</code>). Si quiere que los usuarios nuevos de Linux y los usuarios Linux no mapeados específicamente a un usuario SELinux sean confinados por defecto, cambie el mapeo predeterminado con el comando <code class="command">semanage login</code>.
</div><div class="para">
Por ejemplo, corra el siguiente comando como usuario root de Linux para cambiar el mapeo predeterminado de <code class="computeroutput">unconfined_u</code> a <code class="computeroutput">user_u</code>:
</div><div class="para">
<code class="command">/usr/sbin/semanage login -m -S targeted -s "user_u" -r s0 __default__</code>
</div><div class="para">
Corra el comando <code class="command">semanage login -l</code> como usuario root de Linux para verificar que el ingreso <code class="computeroutput">__default__</code> se mapea a <code class="computeroutput">user_u</code>:
</div><pre class="screen"># /usr/sbin/semanage login -l
Login Name SELinux User MLS/MCS Range
__default__ user_u s0
root unconfined_u s0-s0:c0.c1023
system_u system_u s0-s0:c0.c1023
</pre><div class="para">
Si un usuario Linux nuevo se crea y el usuario SELinux no se especifica, o si un usuario Linux existente ingresa y no coincide una entrada específica de la salida de <code class="command">semanage login -l</code>, se mapean a <code class="computeroutput">user_u</code>, según el ingreso <code class="computeroutput">__default__</code>.
</div><div class="para">
Para volver al comportamiento predeterminado, corra el siguiente comando como usuario root de Linux para mapear el ingreso <code class="computeroutput">__default__</code> al usuario SELinux <code class="computeroutput">unconfined_u</code>:
</div><div class="para">
<pre class="screen">/usr/sbin/semanage login -m -S targeted -s "unconfined_u" -r\
s0-s0:c0.c1023 __default__
</pre>
</div></div><div class="section" lang="es-ES"><div class="titlepage"><div><div><h2 class="title" id="sect-Security-Enhanced_Linux-Confining_Users-xguest_Kiosk_Mode">6.5. xguest: Modo Kiosk</h2></div></div></div><div class="para">
El paquete <span class="package">xguest</span> provee una cuenta de usuario kiosk. Esta cuenta se usa para asegurar máquinas a las que ingresan personas y las usan, como las de las bibliotecas, bancos, aeropuertos, quioscos de información y cyber cafés. La cuenta de usuario kiosk está muy bloqueada: escencialmente, s´olo permite a los usuarios ingresar y usar <span class="application"><strong>Firefox</strong></span> para navegar sitios de Internet. Cualquier cambio hecho mientras se ingresó con esa cuenta, tal como la creación y cambio de la configuración, se pierde cuando se sale.
</div><div class="para">
Para configurar la cuenta kiosk:
</div><div class="orderedlist"><ol><li><div class="para">
Como usuario root de Linux, corra el comando <code class="command">yum install xguest</code> para instalar el paquete <span class="package">xguest</span>. Instale las dependencias requeridas.
</div></li><li><div class="para">
Para permitir a la cuenta kiosk usarse para una variedad de personas, la cuenta no se protege con contraseña, y como tal, la cuenta sólo se puede proteger si SELinux está funcionando en modo obediente. Antes de ingresar con esta cuenta, use el comando <code class="command">getenforce</code> para confirmar que SELinux está funcionando en modo obediente:
</div><pre class="screen">$ /usr/sbin/getenforce
Enforcing
</pre><div class="para">
Si no es éste el caso, vaya a <a class="xref" href="#sect-Security-Enhanced_Linux-Working_with_SELinux-SELinux_Modes" title="5.5. Modos de SELinux">Sección 5.5, “Modos de SELinux”</a> para información acerca del cambio de modo de obligatorio. No es posible ingresar con esta cuenta si SELinux está en modo permisivo o deshabilitado.
</div></li><li><div class="para">
Solamente puede ingresar a esta cuenta a través del Administración de Pantalla de GNOME (GDM). Una vez que el paquete <span class="package">xguest</span> se instala, se agrega una cuenta <code class="computeroutput">Invitado</code> a GDM. Para ingresar, haga clic en la cuenta <code class="computeroutput">Invitado</code>:
</div><div class="mediaobject"><img src="./images/xguest.png"/></div></li></ol></div></div><div class="section" lang="es-ES"><div class="titlepage"><div><div><h2 class="title" id="sect-Security-Enhanced_Linux-Confining_Users-Booleans_for_Users_Executing_Applications">6.6. Booleanos para que los Usuarios Ejecuten Aplicaciones</h2></div></div></div><div class="para">
No permitir que los usuarios Linux ejecuten aplicaciones (que heredan los permisos del usuario) en sus directorios de inicio (home) y <code class="filename">/tmp/</code>, a los que tienen acceso de escritura, lo que ayuda a evitar que aplicaciones con brechas o maliciosas puedan modificar archivos del usuario. En Fedora 11, por defecto, los usuarios Linux en los dominios <code class="computeroutput">guest_t</code> y <code class="computeroutput">xguest_t</code> no pueden ejecutar aplicaciones en los directorios de inicio o en <code class="filename">/tmp/</code>; however, por defecto, los usuarios Linux en los dominios <code class="computeroutput">user_t</code> and <code class="computeroutput">staff_t</code> si pueden.
</div><div class="para">
Hay booleanos disponibles para cambiar este comportamiento, y se configuran con el comando <code class="command">setsebool</code>. El comando <code class="command">setsebool</code> se debe usar con el usuario root de Linux. El comando <code class="command">setsebool -P</code> hace los cambios persistentes. No use la opción <code class="option">-P</code> si no quiere que los cambios persistan entre reiniciadas:
</div><div class="formalpara"><h5 class="formalpara" id="form-Security-Enhanced_Linux-Booleans_for_Users_Executing_Applications-guest_t">guest_t</h5>
Para <span class="emphasis"><em>permitir</em></span> a los usuarios Linux en el dominio <code class="computeroutput">guest_t</code> que ejecuten aplicaciones en sus directorios de inicio y en <code class="filename">/tmp/</code>:
</div><div class="para">
<code class="command">/usr/sbin/setsebool -P allow_guest_exec_content on</code>
</div><div class="formalpara"><h5 class="formalpara" id="form-Security-Enhanced_Linux-Booleans_for_Users_Executing_Applications-xguest_t">xguest_t</h5>
Para <span class="emphasis"><em>permitir</em></span> a los usuarios Linux en el dominio <code class="computeroutput">xguest_t</code> ejecutar aplicaciones en sus directorios inicios y <code class="filename">/tmp/</code>:
</div><div class="para">
<code class="command">/usr/sbin/setsebool -P allow_xguest_exec_content on</code>
</div><div class="formalpara"><h5 class="formalpara" id="form-Security-Enhanced_Linux-Booleans_for_Users_Executing_Applications-user_t">user_t</h5>
Para <span class="emphasis"><em>impedir</em></span> que los usuarios Linux en el dominio <code class="computeroutput">user_t</code> ejecuten aplicaciones en sus directorios de inicio y <code class="filename">/tmp/</code>:
</div><div class="para">
<code class="command">/usr/sbin/setsebool -P allow_user_exec_content off</code>
</div><div class="formalpara"><h5 class="formalpara" id="form-Security-Enhanced_Linux-Booleans_for_Users_Executing_Applications-staff_t">staff_t</h5>
Para <span class="emphasis"><em>impedir</em></span> que los usuarios Linux en el dominio <code class="computeroutput">staff_t</code> ejecuten aplicaciones en sus directorios de inicio y en <code class="filename">/tmp/</code>:
</div><div class="para">
<code class="command">/usr/sbin/setsebool -P allow_staff_exec_content off</code>
</div></div></div><div class="chapter" lang="es-ES"><div class="titlepage"><div><div><h2 class="title" id="chap-Security-Enhanced_Linux-Troubleshooting">Capítulo 7. Solución a Problemas</h2></div></div></div><div class="toc"><dl><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Troubleshooting-What_Happens_when_Access_is_Denied">7.1. Qué pasa cuando el Acceso es Denegado</a></span></dt><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Troubleshooting-Top_Three_Causes_of_Problems">7.2. Tres Principales Causas de Problemas</a></span></dt><dd><dl><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Top_Three_Causes_of_Problems-Labeling_Problems">7.2.1. Problemas de Etiquetados</a></span></dt><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Top_Three_Causes_of_Problems-How_are_Confined_Services_Running">7.2.2. ¿Cómo se Ejecutan los Servicios Confinados?</a></span></dt><dt><span class="section"><a href="#sect-Securit
y-Enhanced_Linux-Top_Three_Causes_of_Problems-Evolving_Rules_and_Broken_Applications">7.2.3. Evolucionando las Reglas y las Aplicaciones Rotas</a></span></dt></dl></dd><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Troubleshooting-Fixing_Problems">7.3. Corrección de Problemas</a></span></dt><dd><dl><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Fixing_Problems-Linux_Permissions">7.3.1. Permisos de Linux</a></span></dt><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Fixing_Problems-Possible_Causes_of_Silent_Denials">7.3.2. Posibles Causas de las Negaciones Silenciosas</a></span></dt><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Fixing_Problems-Manual_Pages_for_Services">7.3.3. Páginas de Manual para Servicios</a></span></dt><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Fixing_Problems-Permissive_Domains">7.3.4. Dominios Permisivos</a></span></dt><dt><span class="section"><a href="#sec
t-Security-Enhanced_Linux-Fixing_Problems-Searching_For_and_Viewing_Denials">7.3.5. Búsqueda y Revisión de Negaciones</a></span></dt><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Fixing_Problems-Raw_Audit_Messages">7.3.6. Mensajes Crudos de Auditoría</a></span></dt><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Fixing_Problems-sealert_Messages">7.3.7. Mensajes sealert</a></span></dt><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Fixing_Problems-Allowing_Access_audit2allow">7.3.8. Permitiendo el Acceso: audit2allow</a></span></dt></dl></dd></dl></div><div class="para">
El siguiente capítulo describe qué pasa cuando SELinux niega el acceso; las principales tres causas de problemas; dónde encontrar información acerca del correcto etiquetado; análisis de las negaciones de SELinux; y creación de módulos de políticas personalizados con <code class="command">audit2allow</code>.
</div><div class="section" lang="es-ES"><div class="titlepage"><div><div><h2 class="title" id="sect-Security-Enhanced_Linux-Troubleshooting-What_Happens_when_Access_is_Denied">7.1. Qué pasa cuando el Acceso es Denegado</h2></div></div></div><div class="para">
Las decisiones de SELinux, tales como permitir o negar el acceso, son cacheadas. Este cache se conoce como Caché Vector de Acceso (AVC). Los mensajes de negación se registran cuando SELinux niega el acceso. Estas negaciones se conocen también como "negaciones AVC", y se guardan en una ubicación distinta, dependiendo de los demonios que se ejecutan:
</div><div class="segmentedlist"><table border="0"><thead><tr class="segtitle"><th>Daemon</th><th>Log Location</th></tr></thead><tbody><tr class="seglistitem"><td class="seg">auditd on</td><td class="seg"><code class="filename">/var/log/audit/audit.log</code></td></tr><tr class="seglistitem"><td class="seg">auditd off; rsyslogd on</td><td class="seg"><code class="filename">/var/log/messages</code></td></tr><tr class="seglistitem"><td class="seg">setroubleshootd, rsyslogd, and auditd on</td><td class="seg"><code class="filename">/var/log/audit/audit.log</code>. Easier-to-read denial messages also sent to <code class="filename">/var/log/messages</code></td></tr></tbody></table></div><div class="para">
Si está corriendo el Sistema de Ventanas X, ya tienen los paquetes <span class="package">setroubleshoot</span> y <span class="package">setroubleshoot-server</span> instalados, y los demonios <code class="systemitem">setroubleshootd</code> y <code class="systemitem">auditd</code> están ejecutándose, se muestra una estrella amarilla y una advertencia cuando SELinux deniega el acceso:
</div><div class="mediaobject"><img src="./images/setroubleshoot_denial.png"/></div><div class="para">
Haciendo clic en las estrelas se presenta un análisis detallado de por qué SELinux negó el acceso, y una posible solución para permitir el acceso. Si no está corriendo el Sistema de Ventanas X, es menos obvio cuando un acceso es negado por SELinux. Por ejemplo, los usuarios navegando su sitio web pueden recibir un error similar al siguiente:
</div><pre class="screen">Prohibido
No tiene permiso para acceder el <em class="replaceable"><code>archivo xx</code></em> en este servidor
</pre><div class="para">
Para estas situaciones, si las reglas DAC (los permisos estándares de Linux) permiten el acceso, busque en <code class="filename">/var/log/messages</code> y <code class="filename">/var/log/audit/audit.log</code> la cadena de los errores <code class="computeroutput">"SELinux está negando"</code> y <code class="computeroutput">"negado"</code> respectivamente. Esto se puede hacer con los siguientes comandos como usuario root de Linux:
</div><div class="para">
<code class="command">grep "SELinux está previniendo" /var/log/messages</code>
</div><div class="para">
<code class="command">grep "denegado" /var/log/audit/audit.log</code>
</div></div><div class="section" lang="es-ES"><div class="titlepage"><div><div><h2 class="title" id="sect-Security-Enhanced_Linux-Troubleshooting-Top_Three_Causes_of_Problems">7.2. Tres Principales Causas de Problemas</h2></div></div></div><div class="para">
Las siguientes secciones describen las tres principales causas de problemas: problemas de etiquetados, configuración de Booleanos y puertos para servicios, y la evolución de las reglas SELinux.
</div><div class="section" lang="es-ES"><div class="titlepage"><div><div><h3 class="title" id="sect-Security-Enhanced_Linux-Top_Three_Causes_of_Problems-Labeling_Problems">7.2.1. Problemas de Etiquetados</h3></div></div></div><div class="para">
En sistemas que corren SELinux, todos los procesosy archivos se etiquetan con una etiqueta que contiene información de seguridad relevante. Esta información se llama contexto de SELinux. Si estas etiquetas están mal, el acceso puede ser negado. Si una aplicación se etiqueta incorrectamente, el proceso al que transiciona puede no tener la etiqueta correcta, causando negaciones de acceso de SELinux, y los procesos pueden crear archivo con las etiquetas incorrectas.
</div><div class="para">
Una causa común de problemas de etiquetados es cuando un directorio no estandar se usa para un servicio. Por ejemplo, en vez de usar <code class="filename">/var/www/html/</code> para un sitio web, un administrador prefiere usar <code class="filename">/srv/miweb/</code>. En Fedora 11, el directorio <code class="filename">/srv/</code> se etiqueta con el tipo <code class="computeroutput">var_t</code>. Los archivos y directorios creados en <code class="filename">/srv/</code> heredan este tipo. También, los directorios de alto nivel recién creados (como <code class="filename">/miservidor/</code>) puede ser etiquetado con el tipo <code class="computeroutput">default_t</code>. SELinux impide al Servidor HTTP Apache (<code class="systemitem">httpd</code>) el acceso a estos dos tipos. Para permitirle el acceso, SELinux debe saber qué archivos en <code class="filename">/srv/miweb/</code> son accesibles a <code class="systemitem">httpd</code>:
</div><pre class="screen"># /usr/sbin/semanage fcontext -a -t httpd_sys_content_t \
"/srv/myweb(/.*)?"
</pre><div class="para">
Este comando <code class="command">semanage</code> agrega el contexto para el directorio <code class="filename">/srv/miweb/</code> (y todos los archivos dentro de él) a la configuración de contexto de archivos de SELinux <sup>[<a id="d0e5345" href="#ftn.d0e5345" class="footnote">14</a>]</sup>. El comando <code class="command">semanage</code> no cambia el contexto. Como usuario root de Linux, ejecute el comando <code class="command">restorecon</code> para aplicar los cambios:
</div><pre class="screen"># /sbin/restorecon -R -v /srv/myweb
</pre><div class="para">
Vaya a <a class="xref" href="#sect-Security-Enhanced_Linux-SELinux_Contexts_Labeling_Files-Persistent_Changes_semanage_fcontext" title="5.7.2. Cambios Persistentes: semanage fcontext">Sección 5.7.2, “Cambios Persistentes: semanage fcontext”</a> para más información sobre agregado de contextos a la configuración de contexto de archivo.
</div><div class="section" lang="es-ES"><div class="titlepage"><div><div><h4 class="title" id="sect-Security-Enhanced_Linux-Labeling_Problems-What_is_the_Correct_Context">7.2.1.1. ¿Cuál es el contexto correcto?</h4></div></div></div><div class="para">
El comando <code class="command">matchpathcon</code> chequea el contexto de un nombre completo de archivo y lo compara con la etiqueta por defecto para esa dirección. El siguiente ejemplo muestra el uso de <code class="command">matchpathcon</code> en un directorio con archivos etiquetados incorrectamente:
</div><pre class="screen">$ /usr/sbin/matchpathcon -V /var/www/html/*
/var/www/html/index.html tiene el contexto unconfined_u:object_r:user_home_t:s0, debería ser system_u:object_r:httpd_sys_content_t:s0
/var/www/html/page1.html tiene el contexto unconfined_u:object_r:user_home_t:s0, debería ser system_u:object_r:httpd_sys_content_t:s0
</pre><div class="para">
En este ejemplo, los archivos <code class="filename">index.html</code> and <code class="filename">pagina1.html</code> se etiquetan con el tipo <code class="computeroutput">user_home_t</code>. Este tipo se usa para archivos en los directorios de inicio de los usuarios. Usando el comando <code class="command">mv</code> para mover archivos puede resultar en archivos etiquetados con el tipo <code class="computeroutput">user_home_t</code>. Este tipo no debería existir fuera de los directorios home. Use el comando <code class="command">restorecon</code> para restaurar tales archivos a su tipo correcto:
</div><pre class="screen"># /sbin/restorecon -v /var/www/html/index.html
restorecon reset /var/www/html/index.html context unconfined_u:object_r:user_home_t:s0->system_u:object_r:httpd_sys_content_t:s0
</pre><div class="para">
Para restaurar el contexto de todos los archivos bajo un directorio, use la opción <code class="option">-R</code>:
</div><pre class="screen"># /sbin/restorecon -R -v /var/www/html/
restorecon reset /var/www/html/page1.html context unconfined_u:object_r:samba_share_t:s0->system_u:object_r:httpd_sys_content_t:s0
restorecon reset /var/www/html/index.html context unconfined_u:object_r:samba_share_t:s0->system_u:object_r:httpd_sys_content_t:s0
</pre><div class="para">
Vaya a <a class="xref" href="#sect-Security-Enhanced_Linux-Maintaining_SELinux_Labels_-Checking_the_Default_SELinux_Context" title="5.10.3. Chequeando el Contexto SELinux Predeterminado">Sección 5.10.3, “Chequeando el Contexto SELinux Predeterminado”</a> para un ejemplo más detallado de <code class="command">matchpathcon</code>.
</div></div></div><div class="section" lang="es-ES"><div class="titlepage"><div><div><h3 class="title" id="sect-Security-Enhanced_Linux-Top_Three_Causes_of_Problems-How_are_Confined_Services_Running">7.2.2. ¿Cómo se Ejecutan los Servicios Confinados?</h3></div></div></div><div class="para">
Los servicios se pueden ejecutar en una variedad de formas. Para cambiar esto, debe decirle a SELinux cómo correrá los servicios. Esto se puede conseguir vía los Booleanos que permiten que parte de las políticas de SELinux se cambien en tiempo de ejecución, sin ningún conocimiento sobre la escritura de políticas de SELinux. Esto permite cambios, tales como permitir a servicios que accedan a sistemas de archivo NFS, sin recargar o recompilar una política SELinux. También, correr servicios en números de puerto no predeterminados requiere que la configuración de la política se actualice vía el comando <code class="command">semanage</code>.
</div><div class="para">
Por ejemplo, para permitir al Servidor HTTP Apache comunicarse con MySQL, active el Booleano <code class="computeroutput">httpd_can_network_connect_db</code>:
</div><pre class="screen"># /usr/sbin/setsebool -P httpd_can_network_connect_db on
</pre><div class="para">
Si el acceso es denegado para un servicio particular, use los comandos <code class="command">getsebool</code> y <code class="command">grep</code> para ver si algún Booleano está disponible para permitir el acceso. Por ejemplo, use el comando <code class="command">getsebool -a | grep ftp</code> para buscar un Booleano relacionado con FTP:
</div><pre class="screen">$ /usr/sbin/getsebool -a | grep ftp
allow_ftpd_anon_write --> off
allow_ftpd_full_access --> off
allow_ftpd_use_cifs --> off
allow_ftpd_use_nfs --> off
ftp_home_dir --> off
httpd_enable_ftp_server --> off
tftp_anon_write --> off
</pre><div class="para">
Para una lista de los Booleanos y de si están activos o inactivos, corra el comando <code class="command">/usr/sbin/getsebool -a</code>. Para una lista de los Booleanos y una explicación de lo que son, y de si están activos o no, ejecute el comando <code class="command">/usr/sbin/semanage boolean -l</code> como usuario root de Linux. vaya a <a class="xref" href="#sect-Security-Enhanced_Linux-Working_with_SELinux-Booleans" title="5.6. Booleanos">Sección 5.6, “Booleanos”</a> para información sobre listado y configuración de Booleanos.
</div><div class="formalpara"><h5 class="formalpara" id="form-Security-Enhanced_Linux-How_are_Confined_Services_Running-Port_Numbers">Números de Puertos</h5>
Dependiendo de la configuración de la política, los servicios pueden tener permitido correr sobre ciertos números de puerto. Intentar cambiar el puerto en el que corre un servicio sin cambiar la política puede resultar en un fallo al iniciar el servicio. Por ejemplo, ejecute el comando <code class="command">semanage port -l | grep http</code> como usuario root de Linux para listar los puertos relacionados con <code class="systemitem">http</code>:
</div><pre class="screen"># /usr/sbin/semanage port -l | grep http
http_cache_port_t tcp 3128, 8080, 8118
http_cache_port_t udp 3130
http_port_t tcp 80, 443, 488, 8008, 8009, 8443
pegasus_http_port_t tcp 5988
pegasus_https_port_t tcp 5989
</pre><div class="para">
El tipo de puerto <code class="computeroutput">http_port_t</code> define los puertos en los que el Servidor HTTP Apache puede escuchar, que en este caso son los puertos TCP 80, 443, 488, 8008, 8009, y 8443. Si un administrador configura <code class="filename">httpd.conf</code> para que <code class="systemitem">httpd</code> escuche en el puerto 9876 (<code class="option">Listen 9876</code>), pero la política no fue actualizada para reflejar esto, el comando <code class="command">service httpd start</code> falla:
</div><pre class="screen"># /sbin/service httpd start
Starting httpd: (13)Permission denied: make_sock: could not bind to address [::]:9876
(13)Permission denied: make_sock: could not bind to address 0.0.0.0:9876
no listening sockets available, shutting down
Unable to open logs
[FAILED]
</pre><div class="para">
Una negación de SELinux es similar a la siguiente y se guarda en <code class="filename">/var/log/audit/audit.log</code>:
</div><pre class="screen">type=AVC msg=audit(1225948455.061:294): avc: denied { name_bind } for pid=4997 comm="httpd" src=9876 scontext=unconfined_u:system_r:httpd_t:s0 tcontext=system_u:object_r:port_t:s0 tclass=tcp_socket
</pre><div class="para">
Para permitir a <code class="systemitem">httpd</code> escuchar en un puerto que no está listado en el tipo de puerto <code class="computeroutput">http_port_t</code>, ejecute el comando <code class="command">semanage port</code> para agregar un puerto a la configuración de la política <sup>[<a id="d0e5507" href="#ftn.d0e5507" class="footnote">15</a>]</sup>:
</div><pre class="screen"># /usr/sbin/semanage port -a -t http_port_t -p tcp 9876
</pre><div class="para">
La opción <code class="option">-a</code> agrega un nuevo registro; la opción <code class="option">-t</code> define un tipo; y la opción <code class="option">-p</code> define un protocolo. El último argumento es el número de puerto a agregar.
</div></div><div class="section" lang="es-ES"><div class="titlepage"><div><div><h3 class="title" id="sect-Security-Enhanced_Linux-Top_Three_Causes_of_Problems-Evolving_Rules_and_Broken_Applications">7.2.3. Evolucionando las Reglas y las Aplicaciones Rotas</h3></div></div></div><div class="para">
Las aplicaciones se pueden romper, provocando que SELinux niegue el acceso. También, las reglas de SELinux evolucionan - SELinux no se debe ver como una aplicación que se ejecuta en una cierta forma, haciendo que deniegue el acceso, aún cuando la aplicación está funcionado como se espera que lo haga. Por ejemplo, si una nueva versión de PostgreSQL se lanza, puede realizar acciones sobre la política actual que no han sido vistas antes, haciendo que el acceso sea denegado, aún cuando el acceso debería ser permitido.
</div><div class="para">
Para estas situaciones, después de que se niegue el acceso, use <code class="command">audit2allow</code> para crear un módulo de política personalizado para permitir el acceso. Vaya a <a class="xref" href="#sect-Security-Enhanced_Linux-Fixing_Problems-Allowing_Access_audit2allow" title="7.3.8. Permitiendo el Acceso: audit2allow">Sección 7.3.8, “Permitiendo el Acceso: audit2allow”</a> para más información sobre el uso de <code class="command">audit2allow</code>.
</div></div></div><div class="section" lang="es-ES"><div class="titlepage"><div><div><h2 class="title" id="sect-Security-Enhanced_Linux-Troubleshooting-Fixing_Problems">7.3. Corrección de Problemas</h2></div></div></div><div class="para">
Las siguientes secciones ayudan a resolver problemas. Cubren los temas: chequeo de los permisos de Linux, que se chequean antes que las reglas de SELinux; posibles causas de negaciones de acceso de SELinux, pero no negaciones que se estén guardando; páginas man de los servicios, que contienen información sobre etiquetado y Booleanos; dominios permisivos, para permitir a un proceso correr en modo permisivo, en vez de todo el sistema; cómo buscar y encontrar mensajes; análisis de negaciones; y creación de módulos de políticas personalizados con <code class="command">audit2allow</code>.
</div><div class="section" lang="es-ES"><div class="titlepage"><div><div><h3 class="title" id="sect-Security-Enhanced_Linux-Fixing_Problems-Linux_Permissions">7.3.1. Permisos de Linux</h3></div></div></div><div class="para">
Cuando el acceso se niega, verifique los permisos estándares de LInux. Como se mencionó en <a class="xref" href="#chap-Security-Enhanced_Linux-Introduction" title="Capítulo 2. Introducción">Capítulo 2, <i>Introducción</i></a>, la mayoría de los sistemas operativos usan un sistema de Control de Acceso Discrecional (DAC) para controlar el acceso, permitiendo a los usuarios controlar los permisos de sus propios archivos. Las reglas de políticas de SELinux se verifican después de estas reglas DAC. Las reglas de políticas de SELinux no se usan si las reglas DAC niegan el acceso al principio.
</div><div class="para">
Si el acceso es denegado y no hay negaciones SELinux guardadas, use el comando <code class="command">ls -l</code> para ver los permisos estándares de Linux:
</div><pre class="screen">$ ls -l /var/www/html/index.html
-rw-r----- 1 root root 0 2009-05-07 11:06 index.html
</pre><div class="para">
En este ejemplo, <code class="filename">index.html</code> pertenece al usuario y al grupo root. El usuario root tiene permisos de lectura y escritura (<code class="computeroutput">-rw</code>), y los miembros del grupo root tienen permisos de lectura (<code class="computeroutput">-r-</code>). Cualquier otro no tiene acceso (<code class="computeroutput">---</code>). Por defecto, tales permisos no permiten a <code class="systemitem">httpd</code> leer este archivo. Para resolver esto, use el comando <code class="command">chown</code> el dueño y el grupo. Este comando se debe ejecutar como usuario root de Linux:
</div><pre class="screen"># chown apache:apache /var/www/html/index.html
</pre><div class="para">
Esto asume la configuración predeterminada, en la que <code class="systemitem">httpd</code> corre como usuario apache de Linux. Si corre <code class="systemitem">httpd</code> con un usuario diferente, reemplace <code class="computeroutput">apache:apache</code> con ese usuario.
</div><div class="para">
Vaya al borrador <a href="http://fedoraproject.org/wiki/Docs/Drafts/AdministrationGuide/Permissions">Proyecto de Documentación de Fedora - "Permisos"</a> para información sobre el manejo de los permisos de Linux.
</div></div><div class="section" lang="es-ES"><div class="titlepage"><div><div><h3 class="title" id="sect-Security-Enhanced_Linux-Fixing_Problems-Possible_Causes_of_Silent_Denials">7.3.2. Posibles Causas de las Negaciones Silenciosas</h3></div></div></div><div class="para">
En ciertas situaciones, las negaciones AVC pueden no ser guardadas cuando SELinux niega el acceso. Las aplicaciones y las funciones de las bibliotecas del sistema a menudo prueban más accesos que los pedidos para realizar sus tareas. Para mantener el menor privilegio sin llenar los informes de auditoría con negaciones AVC para pruebas sin peligro de las aplicaciones, la política puede silenciar las negaciones AVC sin permitir el uso de reglas <code class="computeroutput">dontaudit</code>. Estas reglas son comúnes en la política estándar. La contraparte de <code class="computeroutput">dontaudit</code> es que, aunque SELinux niega el acceso, los mensajes no se guardan, lo que dificulta resolver el problema.
</div><div class="para">
Deshabilite temporalmente las reglas <code class="computeroutput">dontaudit</code>, permitiendo que se guarden todas las negaciones, ejecute el siguiente comando como usuario root de Linux:
</div><div class="para">
<code class="command">/usr/sbin/semodule -DB</code>
</div><div class="para">
La opción <code class="option">-D</code> deshabilita las reglas <code class="computeroutput">dontaudit</code>; la opción <code class="option">-B</code> reconstruye la política. Después de ejcutar <code class="command">semodule -DB</code>, pruebe ejercitar la aplicación que tuvo problemas de permisos, y vea si ahora se guardan negaciones de SELinux relacionadas con la aplicación. Tenga cuidado con la decición de qué negaciones se deben permitir, dado que algunas se deben ignorar y manejarse vía reglas <code class="computeroutput">dontaudit</code>. Si tiene duda, o busca alguna guía, contacte a otros usuarios y desarrolladores de SELinux en una lista de SELinux, tal como <a href="http://www.redhat.com/mailman/listinfo/fedora-selinux-list">fedora-selinux-list</a>.
</div><div class="para">
Para reconstruir la política y habilitar las reglas <code class="computeroutput">dontaudit</code>, ejecute el siguiente comando como usuario root de Linux:
</div><div class="para">
<code class="command">/usr/sbin/semodule -B</code>
</div><div class="para">
Esto restaura la política a su estado original. Para una lista completa de las reglas <code class="computeroutput">dontaudit</code>, corra el comando <code class="command">sesearch --dontaudit</code>. Búsquedas más refinadas usando la opción <code class="option">-s <em class="replaceable"><code>dominio</code></em></code> y el comando <code class="command">grep</code>. Por ejemplo:
</div><pre class="screen">$ sesearch --dontaudit -s smbd_t | grep squid
WARNING: This policy contained disabled aliases; they have been removed.
dontaudit smbd_t squid_port_t : tcp_socket name_bind ;
dontaudit smbd_t squid_port_t : udp_socket name_bind ;
</pre><div class="para">
Vaya a <a class="xref" href="#sect-Security-Enhanced_Linux-Fixing_Problems-Raw_Audit_Messages" title="7.3.6. Mensajes Crudos de Auditoría">Sección 7.3.6, “Mensajes Crudos de Auditoría”</a> y a <a class="xref" href="#sect-Security-Enhanced_Linux-Fixing_Problems-sealert_Messages" title="7.3.7. Mensajes sealert">Sección 7.3.7, “Mensajes sealert”</a> para información acerca del análisis de las negaciones.
</div></div><div class="section" lang="es-ES"><div class="titlepage"><div><div><h3 class="title" id="sect-Security-Enhanced_Linux-Fixing_Problems-Manual_Pages_for_Services">7.3.3. Páginas de Manual para Servicios</h3></div></div></div><div class="para">
Las páginas de manual para los servicios conteniendo información valiosa, tal como qué tipo de archivo usar para una situación dada, y los Booleanos para cambiar el acceso que un servicio tiene (tal como <code class="systemitem">httpd</code> para acceder sistemas de archivos NFS). Esta información puede estar en la página de manual estándar o una página de manual con <code class="computeroutput">selinux</code> como prefijo o sufijo.
</div><div class="para">
Por ejemplo, la página de manual <span class="citerefentry"><span class="refentrytitle">httpd_selinux</span>(8)</span> tiene información sobre qué tipo de archivo usar para una situación dada, así como los Booleanos para permitir scripts, compartir archivos, acceder directorios dentro de los directorios home, y así sucesivamente. Otras páginas de manual con información de SELinux para servicios incluyen a:
</div><div class="itemizedlist"><ul><li><div class="para">
Samba: la página de manual <span class="citerefentry"><span class="refentrytitle">samba_selinux</span>(8)</span> describe que los archivos y directorios exportar vía Samba deben ser etiquetados con el tipo <code class="computeroutput">samba_share_t</code>, así como los Booleanos para permitir archivos etiquetados con otros tipos distintos a <code class="computeroutput">samba_share_t</code> para exportarlos vía Samba.
</div></li><li><div class="para">
NFS: la página de manual <span class="citerefentry"><span class="refentrytitle">nfs_selinux</span>(8)</span> describe que, por defecto, los sistemas de archivo no se pueden exportar vía NFS, y que no se permite exportar sistemas de archivos. Los Booleanos como <code class="computeroutput">nfs_export_all_ro</code> o <code class="computeroutput">nfs_export_all_rw</code> deben activarse.
</div></li><li><div class="para">
Berkeley Internet Name Domain (BIND): la página de manual de <span class="citerefentry"><span class="refentrytitle">named</span>(8)</span> describe qué tipo de archivo usar para una situación dada (vea la sección <code class="computeroutput">Perfil de Seguridad de SELinux para BIND de Red Hat</code> section). La página man de <span class="citerefentry"><span class="refentrytitle">named_selinux</span>(8)</span> describe que, por defecto, <code class="systemitem">named</code> no puede escribir a archivos de zona maestros y que, para permitir ese acceso, el Booleano <code class="computeroutput">named_write_master_zones</code> debe ser puesto en 1.
</div></li></ul></div><div class="para">
La información en las páginas del manual le ayudan a configurar los tipos de archivos correctos y los Booleanos, ayudándolo a prevenir las negaciones de acceso por parte de SELinux.
</div></div><div class="section" lang="es-ES"><div class="titlepage"><div><div><h3 class="title" id="sect-Security-Enhanced_Linux-Fixing_Problems-Permissive_Domains">7.3.4. Dominios Permisivos</h3></div></div></div><div class="para">
Cuando SELinux se ejecuta en modo permisivo, SELinux no niega el acceso, sino que las negaciones para las acciones se guardan como si fuera que corre en modo obediente. Previamente, no era posible hacer permisivo un único dominio (recuerde: los procesos corren en dominios). En ciertas situaciones, esto llevó a hacer el sistema permisivo para poder corregir los problemas.
</div><div class="para">
Fedora 11 introduce los dominios permisivos, donde un administrador puede configurar un único proceso (dominio) para que corra permisivo, en vez de hacer todo el sistema permisivo. Los chequeos de SELinux se realizan igualmente para dominios permisivos; sin embargo, el kernel permite el acceso e informa la negación AVC para situaciones donde SELinux hubiera negado el acceso. Los dominios permisivos están también disponibles en Fedora 9 (con las últimas actualizaciones aplicadas).
</div><div class="para">
En el Linux para Empresas de Red Hat 4 y 5, los Booleanos <code class="computeroutput"><em class="replaceable"><code>dominio</code></em>_disable_trans</code> están disponibles para prevenir que una aplicación transicione a un dominio confinado, y por lo tanto, el proceso se ejecute en un dominio no confinado, tal como <code class="computeroutput">initrc_t</code>. Poniendo en 1 tales booleanos pueden causar problemas serios. Por ejemplo, si el Booleano <code class="computeroutput">httpd_disable_trans</code> se pone en 1:
</div><div class="itemizedlist"><ul><li><div class="para">
<code class="systemitem">httpd</code> corre en el dominio no confinado <code class="computeroutput">initrc_t</code>. Los archivos creados por los procesos en el dominio <code class="computeroutput">initrc_t</code> puede no tener aplicadas las mismas reglas de etiquetados como los archivos creados por el proceso corriendo en el dominio <code class="computeroutput">httpd_t</code>, permitiendo que los procesos puedan potencialmente crear archivos mal etiquetados. Esto causa problemas más adelante.
</div></li><li><div class="para">
dominios confinados que pueden comunicarse con <code class="computeroutput">httpd_t</code> no pueden comunicarse con <code class="computeroutput">initrc_t</code>, posiblemente causan fallas adicionales.
</div></li></ul></div><div class="para">
Los Booleanos <code class="computeroutput"><em class="replaceable"><code>domain</code></em>_disable_trans</code> fueron eliminados de Fedora 7, y no se pusieron reemplazos. Los dominios permisivos pueden resolver esos problemas: se aplican las reglas de transición y los archivos se crean con las etiquetas correctas.
</div><div class="para">
Los dominios permisivos se pueden usar para:
</div><div class="itemizedlist"><ul><li><div class="para">
hacer que un único proceso (dominio) corra permisivo para solucionar alguna cuestión, en vez de poner todo el sistema en riesgo haciendo permisivo a todo el sistema.
</div></li><li><div class="para">
creación de políticas para nuevas aplicaciones. Previamente, era recomendado crear una política mínima, y luego poner la máquina completa en modo permisivo, para que la aplicación pudiera funcionar, pero las negaciones de SELinux eran igualmente grabadas. <code class="command">audit2allow</code> podría usarse luego para ayudar a escribir la política. Esto pone todo el sistema en riesgo. Con dominios permisivos, sólo el dominio en la nueva política puede marcarse como permisivo, sin poner en riesgo todo el sistema.
</div></li></ul></div><div class="section" lang="es-ES"><div class="titlepage"><div><div><h4 class="title" id="sect-Security-Enhanced_Linux-Permissive_Domains-Making_a_Domain_Permissive">7.3.4.1. Creando un Dominio Permisivo</h4></div></div></div><div class="para">
Para hacer un dominio permisivo, ejecute el comando <code class="command">semanage permissive -a <em class="replaceable"><code>dominio</code></em></code>, donde <em class="replaceable"><code>dominio</code></em> es el dominio que quiere hacer permisivo. Por ejemplo, ejecute el siguiente comando como usuario root de Linux para hacer permisivo el dominio <code class="computeroutput">httpd_t</code> (el dominio en el que corre el Servidor HTTP Apache):
</div><div class="para">
<code class="command">/usr/sbin/semanage permissive -a httpd_t</code>
</div><div class="para">
Para ver una lista de los dominios que hizo permisivos, corra el comando <code class="command">semodule -l | grep permissive</code> como usuario root de Linux. Por ejemplo:
</div><pre class="screen"># /usr/sbin/semodule -l | grep permissive
permissive_httpd_t 1.0
</pre><div class="para">
Si ya no quiere que un dominio sea permisivo, corra el comando <code class="command">semanage permissive -d <em class="replaceable"><code>dominio</code></em></code> como usuario root de Linux. Por ejemplo:
</div><div class="para">
<code class="command">/usr/sbin/semanage permissive -d httpd_t</code>
</div></div><div class="section" lang="es-ES"><div class="titlepage"><div><div><h4 class="title" id="sect-Security-Enhanced_Linux-Permissive_Domains-Denials_for_Permissive_Domains">7.3.4.2. Negaciones para Dominios Permisivos</h4></div></div></div><div class="para">
El mensaje <code class="computeroutput">SYSCALL</code> es diferente para dominios permisivos. El siguiente es un ejemplo de una negación de AVC (y la llamada a sistema asociada) desde el Servidor HTTP Apache:
</div><pre class="screen">type=AVC msg=audit(1226882736.442:86): avc: denied { getattr } for pid=2427 comm="httpd" path="/var/www/html/archivo1" dev=dm-0 ino=284133 scontext=unconfined_u:system_r:httpd_t:s0 tcontext=unconfined_u:object_r:samba_share_t:s0 tclass=file
type=SYSCALL msg=audit(1226882736.442:86): arch=40000003 syscall=196 success=no exit=-13 a0=b9a1e198 a1=bfc2921c a2=54dff4 a3=2008171 items=0 ppid=2425 pid=2427 auid=502 uid=48 gid=48 euid=48 suid=48 fsuid=48 egid=48 sgid=48 fsgid=48 tty=(none) ses=4 comm="httpd" exe="/usr/sbin/httpd" subj=unconfined_u:system_r:httpd_t:s0 key=(null)
</pre><div class="para">
Por defecto, el dominio <code class="computeroutput">httpd_t</code> es no permisivo, y como tal, la acción es negada, y el mensaje <code class="computeroutput">SYSCALL</code> contiene <code class="computeroutput">success=no</code>. El siguiente es un ejemplo de negación AVC para la misma situación, excepto que el comando <code class="command">semanage permissive -a httpd_t</code> se ejecutó para hacer el dominio <code class="computeroutput">httpd_t</code> permisivo:
</div><pre class="screen">type=AVC msg=audit(1226882925.714:136): avc: denied { read } for pid=2512 comm="httpd" name="archivo1" dev=dm-0 ino=284133 scontext=unconfined_u:system_r:httpd_t:s0 tcontext=unconfined_u:object_r:samba_share_t:s0 tclass=file
type=SYSCALL msg=audit(1226882925.714:136): arch=40000003 syscall=5 success=yes exit=11 a0=b962a1e8 a1=8000 a2=0 a3=8000 items=0 ppid=2511 pid=2512 auid=502 uid=48 gid=48 euid=48 suid=48 fsuid=48 egid=48 sgid=48 fsgid=48 tty=(none) ses=4 comm="httpd" exe="/usr/sbin/httpd" subj=unconfined_u:system_r:httpd_t:s0 key=(null)
</pre><div class="para">
En este caso, aunque la negación AVC fue grabada, el acceso no fue negado, como se muestra en el mensaje <code class="computeroutput">SYSCALL</code> <code class="computeroutput">success=yes</code>.
</div><div class="para">
Vaya al blog de Dan Walsh <a href="http://danwalsh.livejournal.com/24537.html">"Dominios Permisivos"</a> para más información sobre dominios permisivos.
</div></div></div><div class="section" lang="es-ES"><div class="titlepage"><div><div><h3 class="title" id="sect-Security-Enhanced_Linux-Fixing_Problems-Searching_For_and_Viewing_Denials">7.3.5. Búsqueda y Revisión de Negaciones</h3></div></div></div><div class="para">
Esta sección asume que los paquetes <span class="package">setroubleshoot</span>, <span class="package">setroubleshoot-server</span>, y <span class="package">audit</span> están instalados, y que los demonios <code class="systemitem">auditd</code>, <code class="systemitem">rsyslogd</code> y <code class="systemitem">setroubleshootd</code> están ejecutándose. Vaya a <a class="xref" href="#sect-Security-Enhanced_Linux-Working_with_SELinux-Which_Log_File_is_Used" title="5.2. Qué Archivo Log se usa">Sección 5.2, “Qué Archivo Log se usa”</a> para información sobre cómo iniciar estos demonios. Hay disponibles un número de herramientas para ver las negaciones de SELinux, tales como <code class="command">ausearch</code>, <code class="command">aureport</code> y <code class="command">sealert</code>.
</div><div class="formalpara"><h5 class="formalpara" id="form-Security-Enhanced_Linux-Searching_For_and_Viewing_Denials-ausearch">ausearch</h5>
El paquete <span class="package">audit</span> provee <code class="command">ausearch</code>. De la página de manual de <span class="citerefentry"><span class="refentrytitle">ausearch</span>(8)</span>: "<code class="command">ausearch</code> es una herramienta que puede consultar los registros del demonio audit basados en distintos criterios de búsqueda"<sup>[<a id="d0e5956" href="#ftn.d0e5956" class="footnote">16</a>]</sup>. La herramienta <code class="command">ausearch</code> accede a <code class="filename">/var/log/audit/audit.log</code>, y como tal, sebe ser ejecutada como usuario root de Linux:
</div><div class="segmentedlist"><table border="0"><thead><tr class="segtitle"><th>Buscando</th><th>Comando</th></tr></thead><tbody><tr class="seglistitem"><td class="seg">todas las negaciones</td><td class="seg"><code class="command">/sbin/ausearch -m avc</code></td></tr><tr class="seglistitem"><td class="seg">negaciones de hoy</td><td class="seg"><code class="command">/sbin/ausearch -m avc -ts today</code></td></tr><tr class="seglistitem"><td class="seg">negaciones desde los últimos 10 minutos</td><td class="seg"><code class="command">/sbin/ausearch -m avc -ts recent</code></td></tr></tbody></table></div><div class="para">
Para buscar negaciones de SELinux para un servicio particular, use la opción <code class="option">-c <em class="replaceable"><code>nombre-de-comando</code></em></code>, donde <em class="replaceable"><code>nombre-de-comando</code></em> "es el nombre del ejecutable"<sup>[<a id="d0e6008" href="#ftn.d0e6008" class="footnote">17</a>]</sup>, por ejemplo, <code class="systemitem">httpd</code> para el Servidor HTTP Apache, y <code class="systemitem">smbd</code> para Samba:
</div><div class="para">
<code class="command">/sbin/ausearch -m avc -c httpd</code>
</div><div class="para">
<code class="command">/sbin/ausearch -m avc -c smbd</code>
</div><div class="para">
Vaya a la página de manual de <span class="citerefentry"><span class="refentrytitle">ausearch</span>(8)</span> para más opciones de <code class="command">ausearch</code>.
</div><div class="formalpara"><h5 class="formalpara" id="form-Security-Enhanced_Linux-Searching_For_and_Viewing_Denials-aureport">aureport</h5>
El paquete <span class="package">audit</span> provee <code class="command">aureport</code>. De la página de manual de <span class="citerefentry"><span class="refentrytitle">aureport</span>(8)</span>: "<code class="command">aureport</code> es una herramienta que produce informes resumen de los registros de auditoría del sistema"<sup>[<a id="d0e6068" href="#ftn.d0e6068" class="footnote">18</a>]</sup>. La herramienta <code class="command">aureport</code> accede a <code class="filename">/var/log/audit/audit.log</code>, y como tal, se debe ejecutar como usuario root de Linux. Para ver una lista de las negaciones de SElinux y cuán a menudo ocurren, ejecute el comando <code class="command">aureport -a</code>. El siguiente es un ejemplo de la salida en donde se incluyen dos negaciones:
</div><pre class="screen"># /sbin/aureport -a
AVC Report
========================================================
# date time comm subj syscall class permission obj event
========================================================
1. 05/01/2009 21:41:39 httpd unconfined_u:system_r:httpd_t:s0 195 file getattr system_u:object_r:samba_share_t:s0 denied 2
2. 05/03/2009 22:00:25 vsftpd unconfined_u:system_r:ftpd_t:s0 5 file read unconfined_u:object_r:cifs_t:s0 denied 4
</pre><div class="para">
Vaya a la página de manual de <span class="citerefentry"><span class="refentrytitle">aureport</span>(8)</span> para más opciones de <code class="command">aureport</code>.
</div><div class="formalpara"><h5 class="formalpara" id="form-Security-Enhanced_Linux-Searching_For_and_Viewing_Denials-sealert">sealert</h5>
El paquete <span class="package">setroubleshoot-server</span> provee <code class="command">sealert</code>, que lee los mensajes de negación traducidos por <span class="package">setroubleshoot-server</span>. A las negaciones se le asignan IDs, como se ve en <code class="filename">/var/log/messages</code>. El siguiente es un ejemplo de negación en <code class="filename">messages</code>:
</div><pre class="screen">setroubleshoot: SELinux esta previniendo acerca de la intención de httpd (httpd_t) "getattr" to /var/www/html/archivo1 (samba_share_t). Para mensajes SELinux completos, ejecute sealert -l 84e0b04d-d0ad-4347-8317-22e74f6cd020
</pre><div class="para">
En este ejemplo, el ID de negación es <code class="computeroutput">84e0b04d-d0ad-4347-8317-22e74f6cd020</code>. La opción <code class="option">-l</code> toma un ID como argumento. Ejecutando el comando <code class="command">sealert -l 84e0b04d-d0ad-4347-8317-22e74f6cd020</code> le presenta un análisis detallado de por qué SELinux negó el acceso, y una posible solución para permitir el acceso.
</div><div class="para">
Si está corriendo el Sistema de Ventanas X, tenga los paquetes <span class="package">setroubleshoot</span> y <span class="package">setroubleshoot-server</span> instalados, y los demonios <code class="systemitem">setroubleshootd</code> y <code class="systemitem">auditd</code> ejecutándose, una estrella amarilla y una advertencia se muestran cuando un acceso es negado por SELinux. Con clic sobre la estrella se lanza <code class="command">sealert</code> modo gráfico y se muestra la negación como HTML:
</div><div class="mediaobject"><img src="./images/sealert_gui.png"/></div><div class="itemizedlist"><ul><li><div class="para">
Ejecute el comando <code class="command">sealert -b</code> para lanzar la GUI de <code class="command">sealert</code>.
</div></li><li><div class="para">
Ejecute el comando <code class="command">sealert -l \*</code> para ver un análisis detallado de todas las negaciones.
</div></li><li><div class="para">
Como usuario root de Linux, ejecute el comando <code class="command">sealert -a /var/log/audit/audit.log -H > audit.html</code> para crear una versión HTML del análisis de <code class="command">sealert</code>, como si se viera en la GUI de <code class="command">sealert</code>.
</div></li></ul></div><div class="para">
Vaya a la página man de <span class="citerefentry"><span class="refentrytitle">sealert</span>(8)</span> para más opciones de <code class="command">sealert</code>.
</div></div><div class="section" lang="es-ES"><div class="titlepage"><div><div><h3 class="title" id="sect-Security-Enhanced_Linux-Fixing_Problems-Raw_Audit_Messages">7.3.6. Mensajes Crudos de Auditoría</h3></div></div></div><div class="para">
Los mensajes crudos de auditoría se guardan en <code class="filename">/var/log/audit/audit.log</code>. El siguiente es un ejemplo de negación AVC (y su llamada a sistema asociado) que ocurrío cuando el Servidor HTTP Apache (corriendo en el dominio <code class="computeroutput">httpd_t</code>) intentó acceder el <code class="filename">/var/www/html/archivo1</code> (etiquetado con el tipo <code class="computeroutput">samba_share_t</code>):
</div><pre class="screen">type=AVC msg=audit(1226874073.147:96): avc: denied { getattr } for pid=2465 comm="httpd" path="/var/www/html/archivo1" dev=dm-0 ino=284133 scontext=unconfined_u:system_r:httpd_t:s0 tcontext=unconfined_u:object_r:samba_share_t:s0 tclass=file
type=SYSCALL msg=audit(1226874073.147:96): arch=40000003 syscall=196 success=no exit=-13 a0=b98df198 a1=bfec85dc a2=54dff4 a3=2008171 items=0 ppid=2463 pid=2465 auid=502 uid=48 gid=48 euid=48 suid=48 fsuid=48 egid=48 sgid=48 fsgid=48 tty=(none) ses=6 comm="httpd" exe="/usr/sbin/httpd" subj=unconfined_u:system_r:httpd_t:s0 key=(null)
</pre><div class="variablelist"><dl><dt><span class="term"><em class="replaceable"><code>{ getattr }</code></em></span></dt><dd><div class="para">
El item entre llaves indica el permiso que fue negado. <code class="computeroutput">getattr</code> indica el proceso fuente que intentó leer la información de estado del archivo destino. Esto ocurre antes de leer archivos. Esta acción es negada dado que el archivo está siendo accedido con la etiqueta equivocada. Los permisos vistos comúnmente incluyen a <code class="computeroutput">getattr</code>, <code class="computeroutput">read</code> y <code class="computeroutput">write</code>.
</div></dd><dt><span class="term">comm="<em class="replaceable"><code>httpd</code></em>"</span></dt><dd><div class="para">
El ejecutable que lanzó el proceso. La dirección completa del ejecutable se encuentra en la sección <code class="computeroutput">exe=</code> del mensaje de la llamada al sistema (<code class="computeroutput">SYSCALL</code>), que es en este caso <code class="computeroutput">exe="/usr/sbin/httpd"</code>.
</div></dd><dt><span class="term">path="<em class="replaceable"><code>/var/www/html/archivo1</code></em>"</span></dt><dd><div class="para">
La dirección al objeto (destino) al que quiere acceder el proceso.
</div></dd><dt><span class="term">scontext="<em class="replaceable"><code>unconfined_u:system_r:httpd_t:s0</code></em>"</span></dt><dd><div class="para">
El contexto de SELinux del proceso que intentó la acción denegada. En este caso, es el contexto SELinux del Servidor HTTP Apache, que core en el dominio <code class="computeroutput">httpd_t</code>.
</div></dd><dt><span class="term">tcontext="<em class="replaceable"><code>unconfined_u:object_r:samba_share_t:s0</code></em>"</span></dt><dd><div class="para">
El contexto de SELinux del objeto (destino) al que intentó acceder el proceso. En este caso, es el contexto SELinux del <code class="filename">archivo1</code>. Nota: el tipo <code class="computeroutput">samba_share_t</code> no es accesible para procesos que corren el dominio <code class="computeroutput">httpd_t</code>.
</div><div class="para">
En ciertas cituaciónes, el <code class="computeroutput">tcontext</code> puede coincidir con <code class="computeroutput">scontext</code>, por ejemplo, cuando un proceso intenta ejecutar un servicio del sistema que cambiará las características de ese proceso en ejecución, tales como el ID del usuario. También el <code class="computeroutput">tcontext</code> puede coincidir con el <code class="computeroutput">scontext</code> cuando un proceso intenta usar más recursos (como la memoria) más allá de los límites normales permitidos, lo que resulta en un chequeo de seguridad para ver si el proceso tiene permitido romper esos límites.
</div></dd></dl></div><div class="para">
Desde el mensaje de llamado al sistema (<code class="computeroutput">SYSCALL</code>) nos interesan dos ítems:
</div><div class="itemizedlist"><ul><li><div class="para">
<code class="computeroutput">success=<em class="replaceable"><code>no</code></em></code>: indica si la negación (AVC) fue aplicada o no. <code class="computeroutput">success=no</code> indica que la llamada al sistema no fue exitosa(SELinux negó el acceso). <code class="computeroutput">success=yes</code> indica que la llamada al sistema fue exitosa - esto se puede ver en dominios permisivos o en dominios no confinados, tales como <code class="computeroutput">initrc_t</code> y <code class="computeroutput">kernel_t</code>.
</div></li><li><div class="para">
<code class="computeroutput">exe="<em class="replaceable"><code>/usr/sbin/httpd</code></em>"</code>: la dirección completa al ejecutable que inició el proceso, que es en este caso <code class="computeroutput">exe="/usr/sbin/httpd"</code>.
</div></li></ul></div><div class="para">
Un tipo de archivo incorrecto es una causa común de que SELinux niegue el acceso. Para comenzar a resolver el problema, compare el contexto fuente (<code class="computeroutput">scontext</code>) con el contexto destino (<code class="computeroutput">tcontext</code>). ¿Debería el proceso (<code class="computeroutput">scontext</code>) acceder a un objeto (<code class="computeroutput">tcontext</code>)? Por ejemplo, el Servidor HTTP Apache (<code class="computeroutput">httpd_t</code>) sólo debería acceder tipos especificados en la página man <span class="citerefentry"><span class="refentrytitle">httpd_selinux</span>(8)</span>, tales como <code class="computeroutput">httpd_sys_content_t</code>, <code class="computeroutput">public_content_t</code>, y así sucesivamente, a menos que se configure de otra forma.
</div></div><div class="section" lang="es-ES"><div class="titlepage"><div><div><h3 class="title" id="sect-Security-Enhanced_Linux-Fixing_Problems-sealert_Messages">7.3.7. Mensajes sealert</h3></div></div></div><div class="para">
Las negaciones tienen IDs asignados, como se ve en <code class="filename">/var/log/messages</code>. El siguiente es un ejemplo de negación AVC (guardado en <code class="filename">messages</code>) que ocurrió cuando el Servidor HTTP Apache (corriendo en el dominio <code class="computeroutput">httpd_t</code> domain) intentó acceder el <code class="filename">/var/www/html/archivo1</code> (etiquetado con el tipo <code class="computeroutput">samba_share_t</code>):
</div><pre class="screen"><em class="replaceable"><code>hostname</code></em> setroubleshoot: SELinux está previniendo acerca de la intención de httpd (httpd_t) de "getattr" sobre /var/www/html/archivo1 (samba_share_t). Para los mensajes completos de SELinux, ejecute sealert -l 84e0b04d-d0ad-4347-8317-22e74f6cd020
</pre><div class="para">
Como se sugirió, ejecute el comando <code class="command">sealert -l 84e0b04d-d0ad-4347-8317-22e74f6cd020</code> para ver el mensaje completo. Este comando sólo funciona en la máquina local, y presenta la misma información que la interfase gráfica de <code class="command">sealert</code>:
</div><pre class="screen">$ sealert -l 84e0b04d-d0ad-4347-8317-22e74f6cd020
Summary:
SELinux is preventing httpd (httpd_t) "getattr" to /var/www/html/archivo
(samba_share_t).
Detailed Description:
SELinux denied access to /var/www/html/archivo1 requested by httpd.
/var/www/html/file1 has a context used for sharing by different program. If you
would like to share /var/www/html/file1 from httpd also, you need to change its
file context to public_content_t. If you did not intend to this access, this
could signal a intrusion attempt.
Allowing Access:
You can alter the file context by executing chcon -t public_content_t
'/var/www/html/file1'
Fix Command:
chcon -t public_content_t '/var/www/html/archivo1'
Additional Information:
Source Context unconfined_u:system_r:httpd_t:s0
Target Context unconfined_u:object_r:samba_share_t:s0
Target Objects /var/www/html/archivo1 [ file ]
Source httpd
Source Path /usr/sbin/httpd
Port <Unknown>
Host <em class="replaceable"><code>hostname</code></em>
Source RPM Packages httpd-2.2.10-2
Target RPM Packages
Policy RPM selinux-policy-3.5.13-11.fc11
Selinux Enabled True
Policy Type targeted
MLS Enabled True
Enforcing Mode Enforcing
Plugin Name public_content
Host Name <em class="replaceable"><code>hostname</code></em>
Platform <em class="replaceable"><code>Linux hostname 2.6.27.4-68.fc11.i686 #1 SMP Thu Oct</code></em>
30 00:49:42 EDT 2008 i686 i686
Alert Count 4
First Seen Wed Nov 5 18:53:05 2008
Last Seen Wed Nov 5 01:22:58 2008
Local ID 84e0b04d-d0ad-4347-8317-22e74f6cd020
Line Numbers
Raw Audit Messages
node=<em class="replaceable"><code>hostname</code></em> type=AVC msg=audit(1225812178.788:101): avc: denied { getattr } for pid=2441 comm="httpd" path="/var/www/html/archivo1" dev=dm-0 ino=284916 scontext=unconfined_u:system_r:httpd_t:s0 tcontext=unconfined_u:object_r:samba_share_t:s0 tclass=file
node=<em class="replaceable"><code>hostname</code></em> type=SYSCALL msg=audit(1225812178.788:101): arch=40000003 syscall=196 success=no exit=-13 a0=b8e97188 a1=bf87aaac a2=54dff4 a3=2008171 items=0 ppid=2439 pid=2441 auid=502 uid=48 gid=48 euid=48 suid=48 fsuid=48 egid=48 sgid=48 fsgid=48 tty=(none) ses=3 comm="httpd" exe="/usr/sbin/httpd" subj=unconfined_u:system_r:httpd_t:s0 key=(null)
</pre><div class="variablelist"><dl><dt><span class="term">Resumen</span></dt><dd><div class="para">
Un breve resumen de la acción negada. Esto es lo mismo que la negación en <code class="filename">/var/log/messages</code>. En este ejemplo, al proceso <code class="systemitem">httpd</code> se le negó el acceso al (<code class="filename">archivo1</code>), que está etiquetado con el tipo <code class="computeroutput">samba_share_t</code>.
</div></dd><dt><span class="term">Descripción Detallada</span></dt><dd><div class="para">
Una descripción más detallada. En este ejemplo <code class="filename">archivo1</code> está etiquetado con el tipo <code class="computeroutput">samba_share_t</code>. Este tipo se usa para archivos y directorios que quiere exportar vía Samba. La descripción sugiere cambiar el tipo a un tipo que pueda ser accedido por Samba y por el Servidor HTTP Apache, si tal acceso es deseado.
</div></dd><dt><span class="term">Permitiendo Acceso</span></dt><dd><div class="para">
Una sugerencia sobre cómo permitir el acceso. Esto puede hacerse reetiquetando archivos, poniendo en 1 un Booleano, o creando un módulo de política local. En este caso, la sugerencia es etiquetar el archivo con un tipo accesible por el Servidor HTTP Apache y por Samba.
</div></dd><dt><span class="term">Comando para Corregir</span></dt><dd><div class="para">
Un comando sugerido para permitir el acceso y resolver la negación. En este ejemplo, se dá el comando para cambiar el tipo del <code class="filename">archivo1</code> a <code class="computeroutput">public_content_t</code>, que es accesible por el Servidor HTTP Apache y por Samba.
</div></dd><dt><span class="term">Información Adicional</span></dt><dd><div class="para">
Información que es útil en los informes de errores, como el nombre de paquete de política y la versión (<code class="computeroutput">selinux-policy-3.5.13-11.fc11</code>), pero que no puede ser de ayuda para resolver por qué ocurrió la negación.
</div></dd><dt><span class="term">Mensajes Crudos de Auditoría</span></dt><dd><div class="para">
Los mensajes crudos de auditoría de <code class="filename">/var/log/audit/audit.log</code> que son asociados con la negación. Vaya a <a class="xref" href="#sect-Security-Enhanced_Linux-Fixing_Problems-Raw_Audit_Messages" title="7.3.6. Mensajes Crudos de Auditoría">Sección 7.3.6, “Mensajes Crudos de Auditoría”</a> para información acerca de cada ítem en la negación AVC.
</div></dd></dl></div></div><div class="section" lang="es-ES"><div class="titlepage"><div><div><h3 class="title" id="sect-Security-Enhanced_Linux-Fixing_Problems-Allowing_Access_audit2allow">7.3.8. Permitiendo el Acceso: audit2allow</h3></div></div></div><div class="para">
No use el ejemplo en esta sección en producción. Se usa sólo para mostrar el uso de <code class="command">audit2allow</code>.
</div><div class="para">
De la página de manual de <span class="citerefentry"><span class="refentrytitle">audit2allow</span>(1)</span>: "<code class="command">audit2allow</code> - genera reglas para habilitar de la política de SELinux a partir de operaciones negadas"<sup>[<a id="d0e6509" href="#ftn.d0e6509" class="footnote">19</a>]</sup>. Después de analizar las negaciones como en <a class="xref" href="#sect-Security-Enhanced_Linux-Fixing_Problems-sealert_Messages" title="7.3.7. Mensajes sealert">Sección 7.3.7, “Mensajes sealert”</a>, y si ningún cambio de etiqueta o de Booleano permitió el acceso, use <code class="command">audit2allow</code> para crear un módulo de política local. Después de que el acceso es negado por SELinux, ejecutando el comando <code class="command">audit2allow</code> presenta reglas de Obligación de Tipo que permitirían el acceso previamente negado.
</div><div class="para">
El siguiente ejemplo muestra el uso de <code class="command">audit2allow</code> para crear un módulo de política:
</div><div class="orderedlist"><ol><li><div class="para">
Una negación y la llamada al sistema asociado se graban en <code class="filename">/var/log/audit/audit.log</code>:
</div><pre class="screen">type=AVC msg=audit(1226270358.848:238): avc: denied { write } for pid=13349 comm="certwatch" name="cache" dev=dm-0 ino=218171 scontext=system_u:system_r:certwatch_t:s0 tcontext=system_u:object_r:var_t:s0 tclass=dir
type=SYSCALL msg=audit(1226270358.848:238): arch=40000003 syscall=39 success=no exit=-13 a0=39a2bf a1=3ff a2=3a0354 a3=94703c8 items=0 ppid=13344 pid=13349 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm="certwatch" exe="/usr/bin/certwatch" subj=system_u:system_r:certwatch_t:s0 key=(null)
</pre><div class="para">
En este ejemplo, a <span class="application"><strong>certwatch</strong></span> (<code class="computeroutput">comm="certwatch"</code>) se le negó el acceso de escritura (<code class="computeroutput">{ write }</code>) a un direcotiro etiquetado con el tipo <code class="computeroutput">var_t</code> (<code class="computeroutput">tcontext=system_u:object_r:var_t:s0</code>). Analice la negación como en <a class="xref" href="#sect-Security-Enhanced_Linux-Fixing_Problems-sealert_Messages" title="7.3.7. Mensajes sealert">Sección 7.3.7, “Mensajes sealert”</a>. Si no hay cambios de etiquetas o Boleanos que permitan el acceso, use <code class="command">audit2allow</code> para crear un módulo de política local.
</div></li><li><div class="para">
Con una negación grabada, tal como la negación de <code class="computeroutput">certwatch</code> en el paso 1, corra el comando <code class="command">audit2allow -w -a</code> para producir una descripción legible al humano sobre por qué el acceso fue negado. La opción <code class="option">-a</code> hace que se lean todos los registros de autidoría. La opción <code class="option">-w</code> produce una descripción legible al humano. La herramienta <code class="command">audit2allow</code> accede a <code class="filename">/var/log/audit/audit.log</code>, y como tal, debe ser ejecutada como usuario root de Linux:
</div><pre class="screen"># audit2allow -w -a
type=AVC msg=audit(1226270358.848:238): avc: denied { write } for pid=13349 comm="certwatch" name="cache" dev=dm-0 ino=218171 scontext=system_u:system_r:certwatch_t:s0 tcontext=system_u:object_r:var_t:s0 tclass=dir
Was caused by:
Missing type enforcement (TE) allow rule.
You can use audit2allow to generate a loadable module to allow this access.
</pre><div class="para">
Como se muestra, el acceso fue negado debido a que falta una regla de Obligación de Tipo.
</div></li><li><div class="para">
Ejecute el comando <code class="command">audit2allow -a</code> para ver la regla de Obligación de Tipo que permite el acceso negado:
</div><pre class="screen"># audit2allow -a
#============= certwatch_t ==============
allow certwatch_t var_t:dir write;
</pre><div class="important"><h2>Importante</h2><div class="para">
La falta de reglas de Ejecución de Tipos son usualmente causados por errores en la política de SELinux, y deben ser informadas en el <a href="https://bugzilla.redhat.com/">Bugzilla de Red Hat</a>. Para Fedora, crear informes sobre el producto <code class="computeroutput">Fedora</code>, y seleccione el componente <code class="computeroutput">selinux-policy</code>. Incluya la salida de los comandos <code class="command">audit2allow -w -a</code> y <code class="command">audit2allow -a</code> en el informe del error.
</div></div></li><li><div class="para">
Para usar la regla mostrada por <code class="command">audit2allow -a</code>, ejecute el comando <code class="command">audit2allow -a -M <em class="replaceable"><code>mycertwatch</code></em></code> como usuario root de Linux. La opción <code class="option">-M</code> crea un archivo de Obligación de Tipo (<code class="filename">.te</code>) con el nombre especificado en <code class="option">-M</code>, en su directorio actual de trabajo:
</div><pre class="screen"># audit2allow -a -M mycertwatch
******************** IMPORTANT ***********************
To make this policy package active, execute:
semodule -i mycertwatch.pp
# ls
mycertwatch.pp mycertwatch.te
</pre><div class="para">
También, <code class="command">audit2allow</code> compila la regla de Obediencia de Tipo en un paquete de política (<code class="filename">.pp</code>). Para instalar el módulo, ejecute el comando <code class="command">/usr/sbin/semodule -i <em class="replaceable"><code>mycertwatch.pp</code></em></code> como usuario root de Linux.
</div><div class="important"><h2>Importante</h2><div class="para">
Los módulos creados con <code class="command">audit2allow</code> pueden permitir más acceso que el requerido. Se recomienda que la política creada con <code class="command">audit2allow</code> sea enviada a una lista de SELinux, tal como <a href="http://www.redhat.com/mailman/listinfo/fedora-selinux-list">fedora-selinux-list</a>, para su revisión. Si cree que hay un error en la política, informe un error en <a href="https://bugzilla.redhat.com/">Bugzilla de Red Hat</a>.
</div></div></li></ol></div><div class="para">
Si tiene múltiples negaciones de múltiples procesos, pero solo quiere crear una política personalizada para un proceso único, use el comando <code class="command">grep</code> para una búsqueda más refinada de <code class="command">audit2allow</code>. El siguiente ejemplo muestra el uso de <code class="command">grep</code> para sólo enviar negaciones de <code class="command">certwatch</code> a <code class="command">audit2allow</code>:
</div><pre class="screen"># grep certwatch /var/log/audit/audit.log | audit2allow -M mycertwatch2
******************** IMPORTANT ***********************
To make this policy package active, execute:
# /usr/sbin/semodule -i mycertwatch2.pp
</pre><div class="para">
Vaya a la entrada blog <a href="http://danwalsh.livejournal.com/24750.html">"Uso de audit2allow para construir módulos de políticas. Revisado."</a> de Dan Walsh para información adicional sobre el uso de <code class="command">audit2allow</code> para construir módulos de políticas.
</div></div></div><div class="footnotes"><br/><hr width="100" align="left"/><div class="footnote"><p><sup>[<a id="ftn.d0e5345" href="#d0e5345" class="para">14</a>] </sup>
Los archivos en <code class="filename">/etc/selinux/targeted/contexts/files/</code> definen los contextos de archivos y directorios. Los archivos en este directorio son leídos por <code class="command">restorecon</code> y <code class="command">setfiles</code> para restaurar archivos y directorios a sus contextos predeterminados.
</p></div><div class="footnote"><p><sup>[<a id="ftn.d0e5507" href="#d0e5507" class="para">15</a>] </sup>
El comando <code class="command">semanage port -a</code> agrega una entrada al archivo <code class="filename">/etc/selinux/targeted/modules/active/ports.local</code>. Nota: por defecto, este archivo sólo puede ser visto por el usuario root de Linux.
</p></div><div class="footnote"><p><sup>[<a id="ftn.d0e5956" href="#d0e5956" class="para">16</a>] </sup>
De la página man de <span class="citerefentry"><span class="refentrytitle">ausearch</span>(8)</span>, como se incluyó en el paquete <span class="package">audit</span> en Fedora 11.
</p></div><div class="footnote"><p><sup>[<a id="ftn.d0e6008" href="#d0e6008" class="para">17</a>] </sup>
De la página de manual de <span class="citerefentry"><span class="refentrytitle">ausearch</span>(8)</span>, como se incluyó en el paquete <span class="package">audit</span> en Fedora 11.
</p></div><div class="footnote"><p><sup>[<a id="ftn.d0e6068" href="#d0e6068" class="para">18</a>] </sup>
de la página de manual de <span class="citerefentry"><span class="refentrytitle">aureport</span>(8)</span> como se incluyó en el paquete <span class="package">audit</span> en Fedora 11.
</p></div><div class="footnote"><p><sup>[<a id="ftn.d0e6509" href="#d0e6509" class="para">19</a>] </sup>
De la página man de <span class="citerefentry"><span class="refentrytitle">audit2allow</span>(1)</span>, tal como fue incluida en el paquete <span class="package">policycoreutils</span> en Fedora 11.
</p></div></div></div><div class="chapter" lang="es-ES"><div class="titlepage"><div><div><h2 class="title" id="chap-Security-Enhanced_Linux-Further_Information">Capítulo 8. Información Adicional</h2></div></div></div><div class="toc"><dl><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Further_Information-Contributors">8.1. Contributors</a></span></dt><dt><span class="section"><a href="#sect-Security-Enhanced_Linux-Further_Information-Other_Resources">8.2. Other Resources</a></span></dt></dl></div><div class="section" lang="es-ES"><div class="titlepage"><div><div><h2 class="title" id="sect-Security-Enhanced_Linux-Further_Information-Contributors">8.1. Contributors</h2></div></div></div><div class="itemizedlist"><ul><li><div class="para">
<a href="http://fedoraproject.org/wiki/GeertWarrink">Geert Warrink</a> (translation - Dutch)
</div></li><li><div class="para">
<a href="http://fedoraproject.org/wiki/User:Beckerde">Domingo Becker</a> (translation - Spanish)
</div></li><li><div class="para">
<a href="http://fedoraproject.org/wiki/User:Logan">Daniel Cabrera</a> (translation - Spanish)
</div></li></ul></div></div><div class="section" lang="es-ES"><div class="titlepage"><div><div><h2 class="title" id="sect-Security-Enhanced_Linux-Further_Information-Other_Resources">8.2. Other Resources</h2></div></div></div><div class="formalpara"><h5 class="formalpara" id="form-Security-Enhanced_Linux-Further_Information-The_National_Security_Agency_NSA">La Agencia de Seguridad Nacional (NSA)</h5>
De la página <a href="http://www.nsa.gov/research/selinux/contrib.shtml">Contribuyentes de SELinux</a>:
</div><div class="para">
<span class="emphasis"><em>Los investigadores del laboratorio de Investigación en Seguridad de la Información Nacional (NIARL) de la NSA diseñaron e implementaron controles de acceso obligatorios flexibles en los susbsistemas principales del kernel de Linux e implementaron nuevos componentes del sistema operativo provistos por la arquitectura Flask, llamado servidor de seguridad y caché vector de acceso. Los investigadores de la NSA rediseñaron el SELinux basado en LSM para incluírlo en Linux 2.6. NSA también lideró el desarrollo de controles similares para el Sistema de Ventanas X (XACE/XSELinux) y para Xen (XSM/Flask).</em></span>
</div><div class="itemizedlist"><ul><li><div class="para">
El sitio web de SELinux principal: <a href="http://www.nsa.gov/research/selinux/index.shtml">http://www.nsa.gov/research/selinux/index.shtml</a>.
</div></li><li><div class="para">
Documentación de SELinux: <a href="http://www.nsa.gov/research/selinux/docs.shtml">http://www.nsa.gov/research/selinux/docs.shtml</a>.
</div></li><li><div class="para">
Trasfondo de SELinux: <a href="http://www.nsa.gov/research/selinux/background.shtml">http://www.nsa.gov/research/selinux/background.shtml</a>.
</div></li></ul></div><div class="formalpara"><h5 class="formalpara" id="form-Security-Enhanced_Linux-Further_Information-Tresys_Technology">Tecnología de Tresys</h5>
<a href="http://www.tresys.com/">Tresys Technology</a> son los desarrolladores de:
</div><div class="itemizedlist"><ul><li><div class="para">
<a href="http://userspace.selinuxproject.org/trac/">Herramientas y bibliotecas en el espacio del usuario para SELinux</a>.
</div></li><li><div class="para">
<a href="http://oss.tresys.com/projects/refpolicy">Política de Referencia de SELinux</a>.
</div></li></ul></div><div class="formalpara"><h5 class="formalpara" id="form-Security-Enhanced_Linux-Further_Information-SELinux_News">Noticias de SELinux</h5>
<div class="itemizedlist"><ul><li><div class="para">
Noticias: <a href="http://selinuxnews.org/wp/">http://selinuxnews.org/wp/</a>.
</div></li><li><div class="para">
Planeta SELinux (blogs): <a href="http://selinuxnews.org/planet/">http://selinuxnews.org/planet/</a>.
</div></li></ul></div>
</div><div class="formalpara"><h5 class="formalpara" id="form-Security-Enhanced_Linux-Further_Information-SELinux_Project_Wiki">Wiki del Proyecto SELinux</h5>
<div class="itemizedlist"><ul><li><div class="para">
Página principal: <a href="http://selinuxproject.org/page/Main_Page">http://selinuxproject.org/page/Main_Page</a>.
</div></li><li><div class="para">
Recursos del usuario, incluyendo en laces a documentación, listas de correo, sitios web y herramientas: <a href="http://selinuxproject.org/page/User_Resources">http://selinuxproject.org/page/User_Resources</a>.
</div></li></ul></div>
</div><div class="formalpara"><h5 class="formalpara" id="form-Security-Enhanced_Linux-Further_Information-Red_Hat_Enterprise_Linux">Linux para Empresas de Red Hat</h5>
<div class="itemizedlist"><ul><li><div class="para">
La <a href="http://www.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/5.2/html/Deploy...">Guía de Despliegue del Linux para Empresas de Red Hat</a> contiene una sección de <a href="http://www.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/5.2/html/Deploy...">Referencias</a> SELinux, que tiene enlaces a tutoriales de SELinux, información general y la tecnología detrás de SELinux.
</div></li><li><div class="para">
La <a href="http://www.redhat.com/docs/manuals/enterprise/RHEL-4-Manual/selinux-guide...">Guía de SELinux del Linux para Empresas de Red Hat 4</a>.
</div></li></ul></div>
</div><div class="formalpara"><h5 class="formalpara" id="form-Security-Enhanced_Linux-Further_Information-Fedora">Fedora</h5>
<div class="itemizedlist"><ul><li><div class="para">
Página principal: <a href="http://fedoraproject.org/wiki/SELinux">http://fedoraproject.org/wiki/SELinux</a>.
</div></li><li><div class="para">
Resolución de problemas: <a href="http://fedoraproject.org/wiki/SELinux/Troubleshooting">http://fedoraproject.org/wiki/SELinux/Troubleshooting</a>.
</div></li><li><div class="para">
FAQ de SELinux para Fedora Core 5: <a href="http://docs.fedoraproject.org/selinux-faq-fc5/">http://docs.fedoraproject.org/selinux-faq-fc5/</a>.
</div></li></ul></div>
</div><div class="formalpara"><h5 class="formalpara" id="form-Security-Enhanced_Linux-Further_Information-The_UnOfficial_SELinux_FAQ">Las Preguntas Frecuentes No Oficiales de SELinux</h5>
<a href="http://www.crypt.gen.nz/selinux/faq.html">http://www.crypt.gen.nz/selinux/faq.html</a>
</div><div class="formalpara"><h5 class="formalpara" id="form-Security-Enhanced_Linux-Further_Information-IRC">IRC</h5>
En <a href="http://freenode.net/">Freenode</a>:
</div><div class="itemizedlist"><ul><li><div class="para">
#selinux
</div></li><li><div class="para">
#fedora-selinux
</div></li></ul></div></div></div><div class="appendix" lang="es-ES"><div class="titlepage"><div><div><h1 id="appe-Security-Enhanced_Linux-Revision_History" class="title">Revision History</h1></div></div></div><div class="para">
<div class="revhistory"><table border="0" width="100%" summary="Revision history"><tr><th align="left" valign="top" colspan="3"><b>Historial de revisiones</b></th></tr><tr><td align="left">Revisión 1.3</td><td align="left">Tue May 12 2009</td><td align="left"><span class="author"><span class="firstname">Scott</span> <span class="surname">Radvan</span></span></td></tr><tr><td align="left" colspan="3">
<table class="simplelist" border="0" summary="Simple list"><tr><td>Revisión para Fedora 11</td></tr></table>
</td></tr><tr><td align="left">Revisión 1.2</td><td align="left">Mon Jan 19 2009</td><td align="left"><span class="author"><span class="firstname">Murray</span> <span class="surname">McAllister</span></span></td></tr><tr><td align="left" colspan="3">
<table class="simplelist" border="0" summary="Simple list"><tr><td>Actualización de los enlaces a sitios web de la NSA</td></tr></table>
</td></tr><tr><td align="left">Revisión 1.1</td><td align="left">Sat Dec 6 2008</td><td align="left"><span class="author"><span class="firstname">Murray</span> <span class="surname">McAllister</span></span></td></tr><tr><td align="left" colspan="3">
<table class="simplelist" border="0" summary="Simple list"><tr><td>Resolución del <a href="https://bugzilla.redhat.com/show_bug.cgi?id=472986">Bugzilla de Red Hat #472986, "httpd no escribe en /etc/httpd/logs/"</a></td></tr><tr><td>Se agregó la sección nueva, "6.6. Booleanos para que los Usuarios Ejecuten Aplicaciones"</td></tr><tr><td>Revisiones menores del texto</td></tr></table>
</td></tr><tr><td align="left">Revisión 1.0</td><td align="left">Tue Nov 25 2008</td><td align="left"><span class="author"><span class="firstname">Murray</span> <span class="surname">McAllister</span></span></td></tr><tr><td align="left" colspan="3">
<table class="simplelist" border="0" summary="Simple list"><tr><td>El contenido inicial se guarda en <a href="http://docs.fedoraproject.org/">http://docs.fedoraproject.org/</a></td></tr></table>
</td></tr></table></div>
</div></div></div></body></html>
14 years, 10 months