/usr/lib64/python2.6/site-packages/sepolgen
NameSizeModeActions
access.py116390644editdlrm
access.pyc126950644editdlrm
access.pyo126950644editdlrm
audit.py207060644editdlrm
audit.pyc205140644editdlrm
audit.pyo205140644editdlrm
classperms.py28010644editdlrm
classperms.pyc32000644editdlrm
classperms.pyo32000644editdlrm
defaults.py12870644editdlrm
defaults.pyc15160644editdlrm
defaults.pyo15160644editdlrm
interfaces.py165090644editdlrm
interfaces.pyc160510644editdlrm
interfaces.pyo160510644editdlrm
lex.py335860644editdlrm
lex.pyc201030644editdlrm
lex.pyo201030644editdlrm
matching.py86290644editdlrm
matching.pyc74860644editdlrm
matching.pyo74860644editdlrm
module.py72180644editdlrm
module.pyc85650644editdlrm
module.pyo85650644editdlrm
objectmodel.py65240644editdlrm
objectmodel.pyc47900644editdlrm
objectmodel.pyo47900644editdlrm
output.py50310644editdlrm
output.pyc45240644editdlrm
output.pyo45240644editdlrm
policygen.py144270644editdlrm
policygen.pyc140950644editdlrm
policygen.pyo140260644editdlrm
refparser.py290300644editdlrm
refparser.pyc344630644editdlrm
refparser.pyo344630644editdlrm
refpolicy.py264480644editdlrm
refpolicy.pyc442310644editdlrm
refpolicy.pyo442310644editdlrm
sepolgeni18n.py9120644editdlrm
sepolgeni18n.pyc4100644editdlrm
sepolgeni18n.pyo4100644editdlrm
util.py25730644editdlrm
util.pyc27220644editdlrm
util.pyo27220644editdlrm
yacc.py820750644editdlrm
yacc.pyc432200644editdlrm
yacc.pyo432200644editdlrm
__init__.py00644editdlrm
__init__.pyc1420644editdlrm
__init__.pyo1420644editdlrm
Edit: /usr/lib64/python2.6/site-packages/sepolgen/audit.pyo (20514B)
Ñò Ô<*Xc@s1ddkZddkZddkZd„Zd„Zd„Zd„Zddd„ƒYZdefd „ƒYZd efd „ƒYZ ddk i Z hZ d efd „ƒYZ defd„ƒYZdefd„ƒYZdefd„ƒYZddd„ƒYZddd„ƒYZddd„ƒYZdS(iÿÿÿÿNc Cs¿ddk}ddk}tddƒ}t|iƒiƒdƒ}|i|i|iƒ|ƒ}|id|ƒ}|id|ƒ}|i dd d d ||gd |i ƒi ƒd}|S( s Obtain all of the avc and policy load messages from the audit log. This function uses ausearch and requires that the current process have sufficient rights to run ausearch. Returns: string contain all of the audit messages returned by ausearch. iÿÿÿÿNs /proc/uptimetris%xs%Ts/sbin/ausearchs-ms5AVC,USER_AVC,MAC_POLICY_LOAD,DAEMON_START,SELINUX_ERRs-tststdout( t subprocessttimetopentfloattreadtsplittcloset localtimetstrftimetPopentPIPEt communicate(RRtfdtofftstbootdatetboottimetoutput((s4/usr/lib64/python2.6/site-packages/sepolgen/audit.pytget_audit_boot_msgss  cCs;ddk}|idddgd|iƒiƒd}|S(s Obtain all of the avc and policy load messages from the audit log. This function uses ausearch and requires that the current process have sufficient rights to run ausearch. Returns: string contain all of the audit messages returned by ausearch. iÿÿÿÿNs/sbin/ausearchs-ms5AVC,USER_AVC,MAC_POLICY_LOAD,DAEMON_START,SELINUX_ERRRi(RR R R (RR((s4/usr/lib64/python2.6/site-packages/sepolgen/audit.pytget_audit_msgs.s cCs5ddk}|idgd|iƒiƒd}|S(s•Obtain all of the avc and policy load messages from /bin/dmesg. Returns: string contain all of the audit messages returned by dmesg. iÿÿÿÿNs /bin/dmesgRi(RR R R (RR((s4/usr/lib64/python2.6/site-packages/sepolgen/audit.pytget_dmesg_msgs;s cCs;ddk}|idddgd|iƒiƒd}|S(s¨Obtain all of the avc and policy load messages from /var/log/messages. Returns: string contain all of the audit messages returned by /var/log/messages. iÿÿÿÿNs /bin/greptavcs/var/log/messagesRi(RR R R (RR((s4/usr/lib64/python2.6/site-packages/sepolgen/audit.pyt get_log_msgsFs t AuditMessagecBs eZdZd„Zd„ZRS(sãBase class for all objects representing audit messages. AuditMessage is a base class for all audit messages and only provides storage for the raw message (as a string) and a parsing function that does nothing. cCs||_d|_dS(Nt(tmessagetheader(tselfR((s4/usr/lib64/python2.6/site-packages/sepolgen/audit.pyt__init__Zs cCs€xy|D]q}|idƒ}t|ƒdjo&|d djo||_dSqn|ddjo|d|_dSqWdS( sàParse a string that has been split into records by space into an audit message. This method should be overridden by subclasses. Error reporting should be done by raise ValueError exceptions. t=iisaudit(Nitmsgi(RtlenR(RtrecsR tfields((s4/usr/lib64/python2.6/site-packages/sepolgen/audit.pytfrom_split_string^s  (t__name__t __module__t__doc__RR$(((s4/usr/lib64/python2.6/site-packages/sepolgen/audit.pyRSs tInvalidMessagecBseZdZd„ZRS(sþClass representing invalid audit messages. This is used to differentiate between audit messages that aren't recognized (that should return None from the audit message parser) and a message that is recognized but is malformed in some way. cCsti||ƒdS(N(RR(RR((s4/usr/lib64/python2.6/site-packages/sepolgen/audit.pyRys(R%R&R'R(((s4/usr/lib64/python2.6/site-packages/sepolgen/audit.pyR(sst PathMessagecBs eZdZd„Zd„ZRS(s!Class representing a path messagecCsti||ƒd|_dS(NR(RRtpath(RR((s4/usr/lib64/python2.6/site-packages/sepolgen/audit.pyR~scCsxti||ƒxa|D]Y}|idƒ}t|ƒdjoqn|ddjo|ddd!|_dSqWdS(NRiiR*iiÿÿÿÿ(RR$RR!R*(RR"R R#((s4/usr/lib64/python2.6/site-packages/sepolgen/audit.pyR$‚s(R%R&R'RR$(((s4/usr/lib64/python2.6/site-packages/sepolgen/audit.pyR)|s t AVCMessagecBs2eZdZd„Zd„Zd„Zd„ZRS(skAVC message representing an access denial or granted message. This is a very basic class and does not represent all possible fields in an avc message. Currently the fields are: scontext - context for the source (process) that generated the message tcontext - context for the target tclass - object class for the target (only one) comm - the process name exe - the on-disc binary path - the path of the target access - list of accesses that were allowed or denied denial - boolean indicating whether this was a denial (True) or granted (False) message. An example audit message generated from the audit daemon looks like (line breaks added): 'type=AVC msg=audit(1155568085.407:10877): avc: denied { search } for pid=677 comm="python" name="modules" dev=dm-0 ino=13716388 scontext=user_u:system_r:setroubleshootd_t:s0 tcontext=system_u:object_r:modules_object_t:s0 tclass=dir' An example audit message stored in syslog (not processed by the audit daemon - line breaks added): 'Sep 12 08:26:43 dhcp83-5 kernel: audit(1158064002.046:4): avc: denied { read } for pid=2 496 comm="bluez-pin" name=".gdm1K3IFT" dev=dm-0 ino=3601333 scontext=user_u:system_r:bluetooth_helper_t:s0-s0:c0 tcontext=system_u:object_r:xdm_tmp_t:s0 tclass=file cCs}ti||ƒtiƒ|_tiƒ|_d|_d|_d|_d|_ g|_ t |_ t i|_g|_dS(NR(RRt refpolicytSecurityContexttscontextttcontextttclasstcommtexeR*taccessestTruetdenialt audit2whytTERULEttypetbools(RR((s4/usr/lib64/python2.6/site-packages/sepolgen/audit.pyR­s       cCsµt}|}|t|ƒdjotd|iƒ‚nxR|t|ƒjo>||djo t}Pn|ii||ƒ|d}q=W|ptd|iƒ‚n|dS(Nis#AVC message in invalid format [%s] t}(tFalseR!t ValueErrorRR4R3tappend(RR"tstartt found_closeti((s4/usr/lib64/python2.6/site-packages/sepolgen/audit.pyt__parse_accessºscCsåti||ƒt}t}t}t}xutt|ƒƒD]a}||djo#|i||dƒ}t}q;n||djo t|_n||idƒ}t|ƒdjoq;n|ddjo t i |dƒ|_ t}q;|ddjo t i |dƒ|_ t}q;|dd jo|d|_ t}q;|dd jo|ddd !|_q;|dd jo|ddd !|_q;q;W| p| p| p| otd |iƒ‚n|iƒdS(Nt{itgrantedRiiR.R/R0R1iÿÿÿÿR2s#AVC message in invalid format [%s] (RR$R;trangeR!t_AVCMessage__parse_accessR4R5RR,R-R.R/R0R1R2R<Rtanalyze(RR"t found_srct found_tgtt found_classt found_accessR@R#((s4/usr/lib64/python2.6/site-packages/sepolgen/audit.pyR$Ðs@      cCs¼|iiƒ}|iiƒ}t|iƒ}|||i|ftiƒjo)t|||i|f\|_|_ nAt i |||i|iƒ\|_|_ |it i jot i |_n|it ijotd|ƒ‚n|it ijotd|ƒ‚n|it ijotd|iƒ‚n|it ijo tddi|iƒƒ‚n|it ijotdƒ‚n|i|i ft|||i|f}| p|i|ƒo |i|ii|iiƒqqW|S(soReturn RoleAllowSet statements matching the specified filter Filter out types that match the filer, or all roles Params: role_filter - [optional] Filter object used to filter the output. Returns: Access vector set representing the denied access in the audit logs parsed by this object. (taccesst RoleTypeSetRatfiltertaddR[R\R8(Rt role_filtert role_typestcs((s4/usr/lib64/python2.6/site-packages/sepolgen/audit.pytto_roleÔs  $c CsÛtiƒ}xÈ|iD]½}|itjo|oqn|oU|i|ƒoA|i|ii|i i|i |i |d|id|i ƒqÓq|i|ii|i i|i |i |d|id|i ƒqW|S(s‚Convert the audit logs access into a an access vector set. Convert the audit logs into an access vector set, optionally filtering the restults with the passed in filter object. Filter objects are object instances with a .filter method that takes and access vector and returns True if the message should be included in the final output and False otherwise. Params: avc_filter - [optional] Filter object used to filter the output. Returns: Access vector set representing the denied access in the audit logs parsed by this object. tavc_typeR9( R}tAccessVectorSetR`R5R4RR€R.R8R/R0R3R9(Rt avc_filtert only_denialstav_setR((s4/usr/lib64/python2.6/site-packages/sepolgen/audit.pyt to_accessæs  '#N(R%R&R'R;RR^RmRvRwRyR|RhR„R4RŠ(((s4/usr/lib64/python2.6/site-packages/sepolgen/audit.pyR]@s   ! % t AVCTypeFiltercBseZd„Zd„ZRS(cCsti|ƒ|_dS(N(tretcompiletregex(RRŽ((s4/usr/lib64/python2.6/site-packages/sepolgen/audit.pyRscCs@|ii|iiƒotS|ii|iiƒotStS(N(RŽtmatchR.R8R4R/R;(RR((s4/usr/lib64/python2.6/site-packages/sepolgen/audit.pyRs (R%R&RR(((s4/usr/lib64/python2.6/site-packages/sepolgen/audit.pyR‹s tComputeSidTypeFiltercBseZd„Zd„ZRS(cCsti|ƒ|_dS(N(RŒRRŽ(RRŽ((s4/usr/lib64/python2.6/site-packages/sepolgen/audit.pyRscCs^|ii|iiƒotS|ii|iiƒotS|ii|iiƒotStS(N(RŽRR[R8R4R.R/R;(RR((s4/usr/lib64/python2.6/site-packages/sepolgen/audit.pyRs(R%R&RR(((s4/usr/lib64/python2.6/site-packages/sepolgen/audit.pyRs (((((R,R}RŒRRRRRR(R)tselinux.audit2whyR6RNR+RWRXRZR]R‹R(((s4/usr/lib64/python2.6/site-packages/sepolgen/audit.pyts$       } "Ä