#NEWLINE# def testRootPATHCheck( self ) : #NEWLINE# #INDENT# 'Ensure root $PATH check detects files that non-root users can edit.' #NEWLINE# data = [ self . CreateStat ( '/usr/local/bin/hit-123' , 50 , 0 , 33184 ) , self . CreateStat ( '/usr/local/bin/no-hit-123' , 0 , 6000 , 33056 ) , self . CreateStat ( '/usr/local/bin/no-hit-234' , 0 , 0 , 33184 ) , self . CreateStat ( '/usr/local/bin/hit-345' , 70 , 0 , 33200 ) , self . CreateStat ( '/bin/hit-symlink-567' , 70 , 0 , 41471 ) , self . CreateStat ( '/bin/no-hit-symlink-456' , 0 , 0 , 41471 ) ] #NEWLINE# results = self . GenResults ( [ 'RootEnvPath' ] , [ data ] ) #NEWLINE# check_id = 'CIS-ROOT-PATH-HAS-FILES-WRITABLE-BY-NON-ROOT' #NEWLINE# sym = 'Found: Files in default $PATH of root can be modified by non-privileged users.' #NEWLINE# found = [ '/usr/local/bin/hit-123 user: 50, group: 0, mode: -rw-r-----' , '/usr/local/bin/hit-345 user: 70, group: 0, mode: -rw-rw----' , '/bin/hit-symlink-567 user: 70, group: 0, mode: lrwxrwxrwx' ] #NEWLINE# self . assertCheckDetectedAnom ( check_id , results , sym , found )